diff --git a/common.pri b/common.pri index 8c9354c..0e26197 100644 --- a/common.pri +++ b/common.pri @@ -112,7 +112,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 96 +LIMEREPORT_VERSION_RELEASE = 97 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/limereport/lrbanddesignintf.cpp b/limereport/lrbanddesignintf.cpp index 3067c7a..9f39638 100644 --- a/limereport/lrbanddesignintf.cpp +++ b/limereport/lrbanddesignintf.cpp @@ -130,7 +130,7 @@ BandDesignIntf::BandDesignIntf(BandsType bandType, const QString &xmlTypeName, Q m_printAlways(false), m_repeatOnEachRow(false), m_useAlternateBackgroundColor(false), - m_bottomSpace() + m_bottomSpace(0) { setPossibleResizeDirectionFlags(ResizeBottom); setPossibleMoveFlags(TopBotom); @@ -572,7 +572,6 @@ BaseDesignIntf* BandDesignIntf::cloneUpperPart(int height, QObject *owner, QGrap { int maxBottom = 0; BandDesignIntf* upperPart = dynamic_cast(createSameTypeItem(owner,parent)); - upperPart->m_bottomSpace = this->bottomSpace(); BaseDesignIntf* upperItem = 0; upperPart->initFromItem(this); @@ -619,7 +618,6 @@ bool itemLessThen(QGraphicsItem* i1, QGraphicsItem* i2){ BaseDesignIntf *BandDesignIntf::cloneBottomPart(int height, QObject *owner, QGraphicsItem *parent) { BandDesignIntf* bottomPart = dynamic_cast(createSameTypeItem(owner,parent)); - bottomPart->m_bottomSpace = this->bottomSpace(); bottomPart->initFromItem(this); QList bandItems; @@ -837,7 +835,7 @@ void BandDesignIntf::setAlternateBackgroundColor(const QColor &alternateBackgrou qreal BandDesignIntf::bottomSpace() const { - return m_bottomSpace.isValid() ? m_bottomSpace.value() : height()-findMaxBottom(); + return height()-findMaxBottom(); } QVariant BandDesignIntf::getBookMark(const QString& key){ @@ -867,6 +865,16 @@ void BandDesignIntf::setKeepTopSpace(bool value) } } +int BandDesignIntf::bootomSpace() const +{ + return m_bottomSpace; +} + +void BandDesignIntf::setBootomSpace(int bootomSpace) +{ + m_bottomSpace = bootomSpace; +} + bool BandDesignIntf::repeatOnEachRow() const { return m_repeatOnEachRow; @@ -1036,6 +1044,8 @@ void BandDesignIntf::updateItemSize(DataSourceManager* dataManager, RenderPass p if (borderLines()!=0){ spaceBorder += borderLineSize(); } + + spaceBorder += m_bottomSpace; restoreLinks(); snapshotItemsLayout(); arrangeSubItems(pass, dataManager); diff --git a/limereport/lrbanddesignintf.h b/limereport/lrbanddesignintf.h index 4ab039e..c550143 100644 --- a/limereport/lrbanddesignintf.h +++ b/limereport/lrbanddesignintf.h @@ -254,6 +254,8 @@ public: QVariant getBookMark(const QString& key); void copyBookmarks(BandDesignIntf* sourceBand); + int bootomSpace() const; + void setBootomSpace(int bootomSpace); signals: void bandRendered(BandDesignIntf* band); void bandRegistred(); @@ -313,7 +315,7 @@ private: QMap m_slicedItems; QColor m_alternateBackgroundColor; bool m_useAlternateBackgroundColor; - InitializedValue m_bottomSpace; + int m_bottomSpace; QMap m_bookmarks; }; diff --git a/limereport/lrpageitemdesignintf.cpp b/limereport/lrpageitemdesignintf.cpp index e653177..66a1983 100644 --- a/limereport/lrpageitemdesignintf.cpp +++ b/limereport/lrpageitemdesignintf.cpp @@ -490,8 +490,16 @@ void PageItemDesignIntf::relocateBands() m_bands[i+1]->columnsCount()); } if (m_bands[i+1]->columnIndex()==0){ - m_bands[i+1]->setPos(pageRect().x(),posByColumn[0]); - posByColumn[0] += m_bands[i+1]->height()+bandSpace; + if ( ((m_bands[i]->borderLines() & BandDesignIntf::BottomLine) && + (m_bands[i+1]->borderLines() & BandDesignIntf::TopLine)) || + (!(m_bands[i]->borderLines() & BandDesignIntf::BottomLine) && + !(m_bands[i+1]->borderLines() & BandDesignIntf::TopLine)) ){ + m_bands[i+1]->setPos(pageRect().x(),posByColumn[0]); + posByColumn[0] += m_bands[i+1]->height()+bandSpace; + } else { + m_bands[i+1]->setPos(pageRect().x(),posByColumn[0]+2); + posByColumn[0] += m_bands[i+1]->height()+bandSpace+2; + } } else { m_bands[i+1]->setPos(m_bands[i+1]->pos().x(),posByColumn[m_bands[i+1]->columnIndex()]); posByColumn[m_bands[i+1]->columnIndex()] += m_bands[i+1]->height()+bandSpace; diff --git a/limereport/lrpreviewreportwindow.cpp b/limereport/lrpreviewreportwindow.cpp index fec6d75..c81591e 100644 --- a/limereport/lrpreviewreportwindow.cpp +++ b/limereport/lrpreviewreportwindow.cpp @@ -47,7 +47,7 @@ namespace LimeReport{ PreviewReportWindow::PreviewReportWindow(ReportEngine *report, QWidget *parent, QSettings *settings, Qt::WindowFlags flags) : QMainWindow(parent,flags), - ui(new Ui::PreviewReportWindow), m_settings(settings), m_ownedSettings(false) + ui(new Ui::PreviewReportWindow), m_settings(settings), m_ownedSettings(false), m_scalePercentChanging(false) { ui->setupUi(this); setWindowTitle("Lime Report Preview"); @@ -404,12 +404,20 @@ void PreviewReportWindow::on_actionOne_to_one_triggered() void PreviewReportWindow::scaleComboboxChanged(QString text) { + if (m_scalePercentChanging) return; + m_scalePercentChanging = true; m_previewReportWidget->setScalePercent(text.remove(text.count()-1,1).toInt()); + m_scalePercentChanging = false; } void PreviewReportWindow::slotScalePercentChanged(int percent) { + if (m_scalePercentChanging) return; + m_scalePercentChanging = true; + if (m_scalePercent->findText(QString("%1%").arg(percent)) == -1) + m_scalePercent->setCurrentIndex(-1); m_scalePercent->setEditText(QString("%1%").arg(percent)); + m_scalePercentChanging = false; } void PreviewReportWindow::on_actionShowMessages_toggled(bool value) diff --git a/limereport/lrpreviewreportwindow.h b/limereport/lrpreviewreportwindow.h index 9b29ce5..a42ccde 100644 --- a/limereport/lrpreviewreportwindow.h +++ b/limereport/lrpreviewreportwindow.h @@ -123,6 +123,7 @@ private: QComboBox* m_scalePercent; ScaleType m_previewScaleType; int m_previewScalePercent; + bool m_scalePercentChanging; }; } //namespace LimeReport diff --git a/limereport/lrreportengine.cpp b/limereport/lrreportengine.cpp index d46d507..3bd6af9 100644 --- a/limereport/lrreportengine.cpp +++ b/limereport/lrreportengine.cpp @@ -81,7 +81,7 @@ ReportEnginePrivate::ReportEnginePrivate(QObject *parent) : m_previewWindowIcon(":/report/images/logo32"), m_previewWindowTitle(tr("Preview")), m_reportRendering(false), m_resultIsEditable(true), m_passPhrase("HjccbzHjlbyfCkjy"), m_fileWatcher( new QFileSystemWatcher( this ) ), m_reportLanguage(QLocale::AnyLanguage), - m_previewLayoutDirection(Qt::LeftToRight), m_designerFactory(0), + m_previewLayoutDirection(Qt::LayoutDirectionAuto), m_designerFactory(0), m_previewScaleType(FitWidth), m_previewScalePercent(0) { #ifdef HAVE_STATIC_BUILD diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index d96368f..ada065d 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -451,6 +451,8 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign bandClone=renderData(patternBand); } + if (isLast) bandClone->setBootomSpace(1); + if (mode == ForcedStartPage){ savePage(); startNewPage();