diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-01 14:37:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-02 07:12:46 +0000 |
commit | a7369d98991eb41e0e6bb008ef0305c17859540e (patch) | |
tree | 8bc87665d071392677446332725de3b6004d1530 /reportdesign | |
parent | tdf#71603: Create a new DC for the font fallback (diff) | |
download | core-a7369d98991eb41e0e6bb008ef0305c17859540e.tar.gz core-a7369d98991eb41e0e6bb008ef0305c17859540e.zip |
loplugin:oncevar in helpcompiler..reportdesign
Change-Id: I2dc57931fb230953c285aeb18f57c0a41fedafcb
Reviewed-on: https://gerrit.libreoffice.org/30463
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
5 files changed, 14 insertions, 30 deletions
diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx index f56651570fad..893441c1becd 100644 --- a/reportdesign/source/core/api/ReportEngineJFree.cxx +++ b/reportdesign/source/core/api/ReportEngineJFree.cxx @@ -228,12 +228,10 @@ OUString OReportEngineJFree::getNewOutputName() OUStringBuffer sAuthor(aUserOpts.GetFirstName()); sAuthor.append(" "); sAuthor.append(aUserOpts.GetLastName()); - static const char s_sAuthor[] = "Author"; - aConvertedProperties[nPos].Name = s_sAuthor; + aConvertedProperties[nPos].Name = "Author"; aConvertedProperties[nPos++].Value <<= sAuthor.makeStringAndClear(); - static const char s_sTitle[] = "Title"; - aConvertedProperties[nPos].Name = s_sTitle; + aConvertedProperties[nPos].Name = "Title"; aConvertedProperties[nPos++].Value <<= m_xReport->getCaption(); // create job factory and initialize diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 1fbf33e42440..f4cb39528786 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -999,10 +999,8 @@ OUString ORptExport::convertFormula(const OUString& _sFormula) bool ORptExport::exportFormula(enum ::xmloff::token::XMLTokenEnum eName,const OUString& _sFormula) { const OUString sFieldData = convertFormula(_sFormula); - static const char s_sPageNumber[] = "PageNumber()"; - static const char s_sPageCount[] = "PageCount()"; - sal_Int32 nPageNumberIndex = sFieldData.indexOf(s_sPageNumber); - sal_Int32 nPageCountIndex = sFieldData.indexOf(s_sPageCount); + sal_Int32 nPageNumberIndex = sFieldData.indexOf("PageNumber()"); + sal_Int32 nPageCountIndex = sFieldData.indexOf("PageCount()"); bool bRet = nPageNumberIndex != -1 || nPageCountIndex != -1; if ( !bRet ) AddAttribute(XML_NAMESPACE_REPORT, eName,sFieldData); @@ -1056,11 +1054,10 @@ void ORptExport::exportGroup(const Reference<XReportDefinition>& _xReportDefinit OUString sExpression = sField; if ( !sExpression.isEmpty() ) { - static const char s_sQuote[] = "\"\""; sal_Int32 nIndex = sExpression.indexOf('"'); while ( nIndex > -1 ) { - sExpression = sExpression.replaceAt(nIndex,1,s_sQuote); + sExpression = sExpression.replaceAt(nIndex, 1, "\"\""); nIndex = sExpression.indexOf('"',nIndex+2); } OUString sFormula("rpt:HASCHANGED(\""); @@ -1404,7 +1401,6 @@ void ORptExport::exportParagraph(const Reference< XReportControlModel >& _xRepor { OUString sFieldData = _xReportElement->getDataField(); static const char s_sPageNumber[] = "PageNumber()"; - static const char s_sPageCount[] = "PageCount()"; static const char s_sReportPrefix[] = "rpt:"; sFieldData = sFieldData.copy(strlen(s_sReportPrefix), sFieldData.getLength() - strlen(s_sReportPrefix)); sal_Int32 nPageNumberIndex = sFieldData.indexOf(s_sPageNumber); @@ -1419,12 +1415,11 @@ void ORptExport::exportParagraph(const Reference< XReportControlModel >& _xRepor { if ( sToken == s_sPageNumber ) { - static const char s_sCurrent[] = "current"; - AddAttribute(XML_NAMESPACE_TEXT, XML_SELECT_PAGE, s_sCurrent ); + AddAttribute(XML_NAMESPACE_TEXT, XML_SELECT_PAGE, "current" ); SvXMLElementExport aPageNumber(*this,XML_NAMESPACE_TEXT, XML_PAGE_NUMBER, false, false); Characters("1"); } - else if ( sToken == s_sPageCount ) + else if ( sToken == "PageCount()" ) { SvXMLElementExport aPageNumber(*this,XML_NAMESPACE_TEXT, XML_PAGE_COUNT, false, false); Characters("1"); diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index b5af7b79acff..7a56abb2e8db 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -43,8 +43,7 @@ void lcl_exportPrettyPrinting(const uno::Reference< xml::sax::XDocumentHandler > SvtSaveOptions aSaveOpt; if ( aSaveOpt.IsPrettyPrinting() ) { - static const char s_sWhitespaces[] = " "; - _xDelegatee->ignorableWhitespace(s_sWhitespaces); + _xDelegatee->ignorableWhitespace(" "); } } @@ -358,20 +357,17 @@ void ExportDocumentHandler::exportTableRows() const OUString sValueType( lcl_createAttribute(XML_NP_OFFICE, XML_VALUE_TYPE) ); - static const char s_sFieldPrefix[] = "field:["; - static const char s_sFieldPostfix[] = "]"; const OUString sCell( lcl_createAttribute(XML_NP_TABLE, XML_TABLE_CELL) ); const OUString sP( lcl_createAttribute(XML_NP_TEXT, XML_P) ); const OUString sFtext(lcl_createAttribute(XML_NP_RPT,XML_FORMATTED_TEXT) ); const OUString sRElement(lcl_createAttribute(XML_NP_RPT,XML_REPORT_ELEMENT) ); const OUString sRComponent( lcl_createAttribute(XML_NP_RPT,XML_REPORT_COMPONENT) ) ; const OUString sFormulaAttrib( lcl_createAttribute(XML_NP_RPT,XML_FORMULA) ); - static const char s_sString[] = "string"; static const char s_sFloat[] = "float"; SvXMLAttributeList* pCellAtt = new SvXMLAttributeList(); uno::Reference< xml::sax::XAttributeList > xCellAtt = pCellAtt; - pCellAtt->AddAttribute(sValueType,s_sString); + pCellAtt->AddAttribute(sValueType, "string"); bool bRemoveString = true; OUString sFormula; @@ -395,9 +391,9 @@ void ExportDocumentHandler::exportTableRows() } for(sal_Int32 i = 0; i < nCount ; ++i) { - sFormula = s_sFieldPrefix; + sFormula = "field:["; sFormula += m_aColumns[i]; - sFormula += s_sFieldPostfix; + sFormula += "]"; SvXMLAttributeList* pList = new SvXMLAttributeList(); uno::Reference< xml::sax::XAttributeList > xAttribs = pList; pList->AddAttribute(sFormulaAttrib,sFormula); diff --git a/reportdesign/source/filter/xml/xmlFormattedField.cxx b/reportdesign/source/filter/xml/xmlFormattedField.cxx index 47053d3a8137..fed1adea735b 100644 --- a/reportdesign/source/filter/xml/xmlFormattedField.cxx +++ b/reportdesign/source/filter/xml/xmlFormattedField.cxx @@ -63,10 +63,7 @@ OXMLFormattedField::OXMLFormattedField( ORptFilter& rImport, _xComponent->setDataField(ORptFilter::convertFormula(sValue)); break; case XML_TOK_SELECT_PAGE: - { - static const char s_sPageNumber[] = "rpt:PageNumber()"; - _xComponent->setDataField(s_sPageNumber); - } + _xComponent->setDataField("rpt:PageNumber()"); break; default: break; @@ -74,8 +71,7 @@ OXMLFormattedField::OXMLFormattedField( ORptFilter& rImport, } if ( _bPageCount ) { - static const char s_sPageNumber[] = "rpt:PageCount()"; - _xComponent->setDataField(s_sPageNumber); + _xComponent->setDataField("rpt:PageCount()"); } } catch(Exception&) diff --git a/reportdesign/source/filter/xml/xmlGroup.cxx b/reportdesign/source/filter/xml/xmlGroup.cxx index 1a29e2263a01..79b30a80784e 100644 --- a/reportdesign/source/filter/xml/xmlGroup.cxx +++ b/reportdesign/source/filter/xml/xmlGroup.cxx @@ -100,11 +100,10 @@ OXMLGroup::OXMLGroup( ORptFilter& _rImport { nPos = strlen(s_sChanged); static const char s_sQuote[] = "\"\""; - static const char s_sSingleQuote[] = "\""; sal_Int32 nIndex = sValue.indexOf(s_sQuote,nPos); while ( nIndex > -1 ) { - sValue = sValue.replaceAt(nIndex,2,s_sSingleQuote); + sValue = sValue.replaceAt(nIndex,2, "\""); nIndex = sValue.indexOf(s_sQuote,nIndex+2); } nLen = sValue.getLength() - 1; |