From 69369e3b0c948d6a9632870eeadcdfba92435be5 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Thu, 27 Jun 2019 10:45:26 +0300 Subject: [PATCH] Ruler has been fixed --- designer/designersettingmanager.h | 1 - limereport/items/lrbarcodeitem.cpp | 2 +- limereport/items/lrchartitem.cpp | 8 +------- limereport/items/lrverticallayout.cpp | 2 +- limereport/lrbanddesignintf.cpp | 1 - limereport/lrdatadesignintf.cpp | 2 +- limereport/lrdatasourcemanager.cpp | 4 ++-- limereport/lrgroupfunctions.cpp | 3 +-- limereport/lrpagedesignintf.cpp | 2 +- limereport/lrpageitemdesignintf.cpp | 1 - limereport/lrreportdesignwidget.cpp | 4 ++-- limereport/lrreportengine.cpp | 1 + limereport/lrreportrender.cpp | 6 +++--- .../objectinspector/propertyItems/lrrectproptem.cpp | 1 - 14 files changed, 14 insertions(+), 24 deletions(-) diff --git a/designer/designersettingmanager.h b/designer/designersettingmanager.h index d5c13c9..4c1d28c 100644 --- a/designer/designersettingmanager.h +++ b/designer/designersettingmanager.h @@ -18,7 +18,6 @@ public slots: QLocale::Language getCurrentDefaultLanguage(); void currentDefaultLanguageChanged(QLocale::Language language); private: - QApplication* m_app; QSettings* m_setting; }; diff --git a/limereport/items/lrbarcodeitem.cpp b/limereport/items/lrbarcodeitem.cpp index cd37d1a..73ebdae 100644 --- a/limereport/items/lrbarcodeitem.cpp +++ b/limereport/items/lrbarcodeitem.cpp @@ -49,7 +49,7 @@ BarcodeItem::BarcodeItem(QObject* owner,QGraphicsItem* parent) : ContentItemDesignIntf(xmlTag,owner,parent),m_designTestValue("1"), m_barcodeType(CODE128), m_foregroundColor(Qt::black), m_backgroundColor(Qt::white), m_whitespace(10), m_angle(Angle0), m_barcodeWidth(0), m_securityLevel(0), m_pdf417CodeWords(928), m_inputMode(UNICODE_INPUT_MODE), - m_option3(0) + m_hideText(false), m_option3(0) {} BarcodeItem::~BarcodeItem() diff --git a/limereport/items/lrchartitem.cpp b/limereport/items/lrchartitem.cpp index 62f9230..171d45c 100644 --- a/limereport/items/lrchartitem.cpp +++ b/limereport/items/lrchartitem.cpp @@ -515,15 +515,13 @@ void PieChart::paintChart(QPainter *painter, QRectF chartRect) } qreal onePercent = sum / 100; qreal currentDegree = 0; - int currentColor = 0; - for(int i=0; idata()->values().count();++i){ + for(int i=0; idata()->values().count(); ++i){ qreal value = si->data()->values().at(i); qreal sectorDegree = (value/onePercent)*3.6; painter->setBrush(si->data()->colors().at(i)); painter->drawPie(chartRect,currentDegree*16,sectorDegree*16); drawPercent(painter, chartRect, currentDegree, sectorDegree); currentDegree += sectorDegree; - currentColor++; } } else { painter->setBrush(color_map[0]); @@ -768,7 +766,6 @@ void VerticalBarChart::paintSerialLines(QPainter* painter, QRectF barsRect) qreal topShift = (delta - (maxValue()-minValue())) * vStep +barsRect.top(); if (!m_chartItem->series().isEmpty() && !m_chartItem->series().at(0)->data()->labels().isEmpty()){ - int curSeries = 0; foreach (SeriesItem* series, m_chartItem->series()) { if (series->preferredType() == SeriesItem::Line){ QPen pen(series->color()); @@ -791,7 +788,6 @@ void VerticalBarChart::paintSerialLines(QPainter* painter, QRectF barsRect) } } - curSeries++; } } painter->restore(); @@ -803,7 +799,6 @@ void VerticalBarChart::paintLabels(QPainter *painter, QRectF labelsRect) { painter->save(); qreal hStep = (labelsRect.width() / valuesCount()); - int curLabel = 0; if (!m_chartItem->labels().isEmpty()){ painter->rotate(270); @@ -811,7 +806,6 @@ void VerticalBarChart::paintLabels(QPainter *painter, QRectF labelsRect) foreach (QString label, m_chartItem->labels()) { painter->drawText(QRectF(QPoint(0,0), QSize(labelsRect.height()-4,hStep)),Qt::AlignVCenter|Qt::AlignRight,label); - curLabel++; painter->translate(0,hStep); } painter->rotate(-270); diff --git a/limereport/items/lrverticallayout.cpp b/limereport/items/lrverticallayout.cpp index 65d75d9..51cb533 100644 --- a/limereport/items/lrverticallayout.cpp +++ b/limereport/items/lrverticallayout.cpp @@ -134,8 +134,8 @@ BaseDesignIntf* VerticalLayout::cloneBottomPart(int height, QObject* owner, QGra } } - int currentHeight = 0; if (!bottomPart->isEmpty()){ + int currentHeight = 0; foreach (BaseDesignIntf* item, bottomPart->childBaseItems()) { currentHeight+=item->height(); } diff --git a/limereport/lrbanddesignintf.cpp b/limereport/lrbanddesignintf.cpp index 47d73ea..3751f44 100644 --- a/limereport/lrbanddesignintf.cpp +++ b/limereport/lrbanddesignintf.cpp @@ -662,7 +662,6 @@ BaseDesignIntf* BandDesignIntf::cloneUpperPart(int height, QObject *owner, QGrap } } upperPart->setHeight(height); - height = maxBottom; return upperPart; } diff --git a/limereport/lrdatadesignintf.cpp b/limereport/lrdatadesignintf.cpp index 718f1f4..6fa78a5 100644 --- a/limereport/lrdatadesignintf.cpp +++ b/limereport/lrdatadesignintf.cpp @@ -718,10 +718,10 @@ QVariant CallbackDatasource::dataByRowIndex(const QString &columnName, int rowIn QVariant CallbackDatasource::dataByKeyField(const QString& columnName, const QString& keyColumnName, QVariant keyData) { int backupCurrentRow = m_currentRow; - int currentRow = 0; QVariant result = QVariant(); first(); if (!checkIfEmpty()){ + int currentRow = 0; do { QVariant key = callbackData(keyColumnName, currentRow); if (key == keyData){ diff --git a/limereport/lrdatasourcemanager.cpp b/limereport/lrdatasourcemanager.cpp index b020550..1fcc20d 100644 --- a/limereport/lrdatasourcemanager.cpp +++ b/limereport/lrdatasourcemanager.cpp @@ -485,8 +485,8 @@ QString DataSourceManager::replaceVariables(QString query, QMap QString DataSourceManager::replaceFields(QString query, QMap &aliasesToParam, QString masterDatasource) { QRegExp rx(Const::FIELD_RX); - int curentAliasIndex=0; if (query.contains(rx)){ + int curentAliasIndex=0; int pos; while ((pos=rx.indexIn(query))!=-1){ QString field=rx.cap(0); @@ -719,7 +719,7 @@ void DataSourceManager::removeConnection(const QString &connectionName) delete (*cit); cit = m_connections.erase(cit); } else { - cit++; + ++cit; } } m_hasChanges = true; diff --git a/limereport/lrgroupfunctions.cpp b/limereport/lrgroupfunctions.cpp index b3ea189..1061ea5 100644 --- a/limereport/lrgroupfunctions.cpp +++ b/limereport/lrgroupfunctions.cpp @@ -118,9 +118,8 @@ QVariant GroupFunction::multiplication(QVariant value1, QVariant value2) } GroupFunction::GroupFunction(const QString &expression, const QString &dataBandName, DataSourceManager* dataManager) - :m_dataBandName(dataBandName), m_dataManager(dataManager),m_isValid(true), m_errorMessage("") + :m_data(expression), m_dataBandName(dataBandName), m_dataManager(dataManager), m_isValid(true), m_errorMessage("") { - m_data = expression; QRegExp rxField(Const::FIELD_RX,Qt::CaseInsensitive); QRegExp rxVariable(Const::VARIABLE_RX,Qt::CaseInsensitive); QRegExp rxScript(Const::SCRIPT_RX,Qt::CaseInsensitive); diff --git a/limereport/lrpagedesignintf.cpp b/limereport/lrpagedesignintf.cpp index 0e478bf..5fe7288 100644 --- a/limereport/lrpagedesignintf.cpp +++ b/limereport/lrpagedesignintf.cpp @@ -1334,9 +1334,9 @@ BaseDesignIntf* PageDesignIntf::findDestObject(BaseDesignIntf* item){ void PageDesignIntf::paste() { QClipboard *clipboard = QApplication::clipboard(); - BaseDesignIntf* destItem = 0; ItemsReaderIntf::Ptr reader = StringXMLreader::create(clipboard->text()); if (reader->first() && reader->itemType() == "Object"){ + BaseDesignIntf* destItem = 0; if (!selectedItems().isEmpty()) destItem = findDestObject(dynamic_cast(selectedItems().at(0))); else diff --git a/limereport/lrpageitemdesignintf.cpp b/limereport/lrpageitemdesignintf.cpp index ac3ba68..b9c5693 100644 --- a/limereport/lrpageitemdesignintf.cpp +++ b/limereport/lrpageitemdesignintf.cpp @@ -778,7 +778,6 @@ void PageItemDesignIntf::swapBands(BandDesignIntf* band, BandDesignIntf* bandToS BandDesignIntf* firstMoveBand = (bandToSwap->bandIndex() > band->bandIndex()) ? bandToSwap: band; firstMoveBand->changeBandIndex(firstIndex, true); - moveIndex = firstMoveBand->maxChildIndex() + 1; moveIndex = firstIndex; qSort(bandToMove.begin(), bandToMove.end(), bandIndexLessThen); diff --git a/limereport/lrreportdesignwidget.cpp b/limereport/lrreportdesignwidget.cpp index a453f7d..de897e7 100644 --- a/limereport/lrreportdesignwidget.cpp +++ b/limereport/lrreportdesignwidget.cpp @@ -1119,7 +1119,7 @@ void Ruler::paintEvent(QPaintEvent *event){ QString::number(i)); } } - painter.setPen(Qt::black); + painter.setPen(palette().foreground().color()); painter.drawLine(m_mousePos.x() - (hStartPos > 0 ? hStartPos : 0) , 0, m_mousePos.x() - (hStartPos > 0 ? hStartPos : 0) , 20); break; @@ -1148,7 +1148,7 @@ void Ruler::paintEvent(QPaintEvent *event){ painter.drawLine(10, vs5, 20, vs5); } } - painter.setPen(Qt::black); + painter.setPen(palette().foreground().color()); painter.drawLine(0, m_mousePos.y() - (vStartPos > 0 ? vStartPos : 0), 20, m_mousePos.y() - (vStartPos > 0 ? vStartPos : 0)); break; diff --git a/limereport/lrreportengine.cpp b/limereport/lrreportengine.cpp index d997639..abcfc37 100644 --- a/limereport/lrreportengine.cpp +++ b/limereport/lrreportengine.cpp @@ -514,6 +514,7 @@ bool ReportEnginePrivate::showPreviewWindow(ReportPages pages, PreviewHints hint w->setSettings(settings()); w->setPages(pages); w->setLayoutDirection(m_previewLayoutDirection); + w->setStyleSheet(styleSheet()); if (!dataManager()->errorsList().isEmpty()){ w->setErrorMessages(dataManager()->errorsList()); diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index bf74151..ec608fd 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -901,7 +901,7 @@ void ReportRender::closeGroup(BandDesignIntf *band) bl->clear(); delete bl; } - it++; + ++it; } m_childBands.remove(band); @@ -931,7 +931,7 @@ void ReportRender::closeDataGroup(BandDesignIntf *band) if ((*it)->bandIndex()>band->bandIndex()) it = m_reprintableBands.erase(it); else - it++; + ++it; } } recalcIfNeeded(band); @@ -1573,7 +1573,7 @@ void PagesRanges::addTOCPage() if (tocRange.firstPage == 0) { tocRange.firstPage = tocRange.lastPage == 0 ? 1 : tocRange.lastPage; tocRange.lastPage = tocRange.lastPage == 0 ? 1 : tocRange.lastPage; - if (tocRange.lastPage == 1 && tocRange.lastPage == 1) + if (tocRange.firstPage == 1 && tocRange.lastPage == 1) shiftRangesNextToTOC(); } else { tocRange.lastPage++; diff --git a/limereport/objectinspector/propertyItems/lrrectproptem.cpp b/limereport/objectinspector/propertyItems/lrrectproptem.cpp index 5d2d13b..a5503f7 100644 --- a/limereport/objectinspector/propertyItems/lrrectproptem.cpp +++ b/limereport/objectinspector/propertyItems/lrrectproptem.cpp @@ -146,7 +146,6 @@ QWidget * LimeReport::RectUnitValuePropItem::createProperyEditor(QWidget *parent QDoubleSpinBox *editor= new QDoubleSpinBox(parent); editor->setMaximum(100000); editor->setSuffix(" "+unitShortName()); - BaseDesignIntf* item = dynamic_cast(object()); return editor; }