From ec3850e661e40c146edd55c6ad1fce3996e421c4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 12 Nov 2024 21:04:11 +0200 Subject: [PATCH] loplugin:reftotemp in writerperfect Change-Id: I7a185e98047965a1f6cedd0b31dead5ba6d89192 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176502 Reviewed-by: Noel Grandin Tested-by: Jenkins --- .../source/calc/MSWorksCalcImportFilter.cxx | 4 +- .../source/writer/exp/XMLTextFrameContext.cxx | 16 +++--- writerperfect/source/writer/exp/txtparai.cxx | 56 +++++++++---------- writerperfect/source/writer/exp/txtstyli.cxx | 16 +++--- writerperfect/source/writer/exp/xmlfmt.cxx | 28 +++++----- writerperfect/source/writer/exp/xmltbli.cxx | 40 ++++++------- 6 files changed, 80 insertions(+), 80 deletions(-) diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx index 3ad0ef2bbeda..34d34db4e53d 100644 --- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx +++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx @@ -376,12 +376,12 @@ MSWorksCalcImportFilter::filter(const css::uno::SequencegetString(1)); + const OUString aTitle(xRow->getString(1)); if (aTitle.equalsIgnoreAsciiCase(sTestFM3Name)) sFM3Name = aTitle; } while (xResultSet->next() && sFM3Name.isEmpty()); diff --git a/writerperfect/source/writer/exp/XMLTextFrameContext.cxx b/writerperfect/source/writer/exp/XMLTextFrameContext.cxx index 4c6ca118efd2..b6504311fa0e 100644 --- a/writerperfect/source/writer/exp/XMLTextFrameContext.cxx +++ b/writerperfect/source/writer/exp/XMLTextFrameContext.cxx @@ -106,8 +106,8 @@ void XMLTextImageContext::startElement( { for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) { - const OUString& rAttributeName = xAttribs->getNameByIndex(i); - if (rAttributeName == "loext:mime-type" || rAttributeName == "draw:mime-type") + const OUString aAttributeName = xAttribs->getNameByIndex(i); + if (aAttributeName == "loext:mime-type" || aAttributeName == "draw:mime-type") m_aMimeType = OUStringToOString(xAttribs->getValueByIndex(i), RTL_TEXTENCODING_UTF8); } } @@ -145,16 +145,16 @@ void XMLTextFrameContext::startElement( librevenge::RVNGPropertyList aPropertyList; for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) { - const OUString& rAttributeName = xAttribs->getNameByIndex(i); - const OUString& rAttributeValue = xAttribs->getValueByIndex(i); + const OUString aAttributeName = xAttribs->getNameByIndex(i); + const OUString aAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "draw:style-name") - FillStyles(rAttributeValue, GetImport().GetAutomaticGraphicStyles(), + if (aAttributeName == "draw:style-name") + FillStyles(aAttributeValue, GetImport().GetAutomaticGraphicStyles(), GetImport().GetGraphicStyles(), aPropertyList); else { - OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8); - OString sValue = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8); + OString sName = OUStringToOString(aAttributeName, RTL_TEXTENCODING_UTF8); + OString sValue = OUStringToOString(aAttributeValue, RTL_TEXTENCODING_UTF8); aPropertyList.insert(sName.getStr(), sValue.getStr()); } } diff --git a/writerperfect/source/writer/exp/txtparai.cxx b/writerperfect/source/writer/exp/txtparai.cxx index 101546c39e35..95bcf350590d 100644 --- a/writerperfect/source/writer/exp/txtparai.cxx +++ b/writerperfect/source/writer/exp/txtparai.cxx @@ -134,15 +134,15 @@ void XMLSpanContext::startElement( { for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) { - const OUString& rAttributeName = xAttribs->getNameByIndex(i); - const OUString& rAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "text:style-name") - FillStyles(rAttributeValue, GetImport().GetAutomaticTextStyles(), + const OUString aAttributeName = xAttribs->getNameByIndex(i); + const OUString aAttributeValue = xAttribs->getValueByIndex(i); + if (aAttributeName == "text:style-name") + FillStyles(aAttributeValue, GetImport().GetAutomaticTextStyles(), GetImport().GetTextStyles(), m_aPropertyList); else { - OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8); - OString sValue = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8); + OString sName = OUStringToOString(aAttributeName, RTL_TEXTENCODING_UTF8); + OString sValue = OUStringToOString(aAttributeValue, RTL_TEXTENCODING_UTF8); m_aPropertyList.insert(sName.getStr(), sValue.getStr()); } } @@ -403,24 +403,24 @@ void XMLTextFrameHyperlinkContext::startElement( librevenge::RVNGPropertyList aPropertyList; for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) { - const OUString& rAttributeName = xAttribs->getNameByIndex(i); - const OUString& rAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "text:style-name") + const OUString aAttributeName = xAttribs->getNameByIndex(i); + const OUString aAttributeValue = xAttribs->getValueByIndex(i); + if (aAttributeName == "text:style-name") // This affects the nested span's properties. - FillStyles(rAttributeValue, GetImport().GetAutomaticTextStyles(), + FillStyles(aAttributeValue, GetImport().GetAutomaticTextStyles(), GetImport().GetTextStyles(), m_aPropertyList); else { - if (rAttributeName == "xlink:href") + if (aAttributeName == "xlink:href") { - m_ePopupState = GetImport().FillPopupData(rAttributeValue, aPropertyList); + m_ePopupState = GetImport().FillPopupData(aAttributeValue, aPropertyList); if (m_ePopupState != PopupState::NotConsumed) continue; } // This affects the link's properties. - OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8); - OString sValue = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8); + OString sName = OUStringToOString(aAttributeName, RTL_TEXTENCODING_UTF8); + OString sValue = OUStringToOString(aAttributeValue, RTL_TEXTENCODING_UTF8); aPropertyList.insert(sName.getStr(), sValue.getStr()); } } @@ -490,24 +490,24 @@ void XMLHyperlinkContext::startElement( librevenge::RVNGPropertyList aPropertyList; for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) { - const OUString& rAttributeName = xAttribs->getNameByIndex(i); - const OUString& rAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "text:style-name") + const OUString aAttributeName = xAttribs->getNameByIndex(i); + const OUString aAttributeValue = xAttribs->getValueByIndex(i); + if (aAttributeName == "text:style-name") // This affects the nested span's properties. - FillStyles(rAttributeValue, GetImport().GetAutomaticTextStyles(), + FillStyles(aAttributeValue, GetImport().GetAutomaticTextStyles(), GetImport().GetTextStyles(), m_aPropertyList); else { - if (rAttributeName == "xlink:href") + if (aAttributeName == "xlink:href") { - m_ePopupState = GetImport().FillPopupData(rAttributeValue, aPropertyList); + m_ePopupState = GetImport().FillPopupData(aAttributeValue, aPropertyList); if (m_ePopupState != PopupState::NotConsumed) continue; } // This affects the link's properties. - OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8); - OString sValue = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8); + OString sName = OUStringToOString(aAttributeName, RTL_TEXTENCODING_UTF8); + OString sValue = OUStringToOString(aAttributeValue, RTL_TEXTENCODING_UTF8); aPropertyList.insert(sName.getStr(), sValue.getStr()); } } @@ -556,11 +556,11 @@ void XMLParaContext::startElement( librevenge::RVNGPropertyList aPropertyList; for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) { - const OUString& rAttributeName = xAttribs->getNameByIndex(i); - const OUString& rAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "text:style-name") + const OUString aAttributeName = xAttribs->getNameByIndex(i); + const OUString aAttributeValue = xAttribs->getValueByIndex(i); + if (aAttributeName == "text:style-name") { - m_aStyleName = rAttributeValue; + m_aStyleName = aAttributeValue; FillStyles(m_aStyleName, GetImport().GetAutomaticParagraphStyles(), GetImport().GetParagraphStyles(), aPropertyList); FillStyles(m_aStyleName, GetImport().GetAutomaticTextStyles(), @@ -570,8 +570,8 @@ void XMLParaContext::startElement( } else { - OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8); - OString sValue = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8); + OString sName = OUStringToOString(aAttributeName, RTL_TEXTENCODING_UTF8); + OString sValue = OUStringToOString(aAttributeValue, RTL_TEXTENCODING_UTF8); aPropertyList.insert(sName.getStr(), sValue.getStr()); } } diff --git a/writerperfect/source/writer/exp/txtstyli.cxx b/writerperfect/source/writer/exp/txtstyli.cxx index 53ac4b4e52f0..60d98bdaa5d7 100644 --- a/writerperfect/source/writer/exp/txtstyli.cxx +++ b/writerperfect/source/writer/exp/txtstyli.cxx @@ -335,16 +335,16 @@ void XMLStyleContext::startElement( { for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) { - const OUString& rAttributeName = xAttribs->getNameByIndex(i); - const OUString& rAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "style:name") - m_aName = rAttributeValue; - else if (rAttributeName == "style:family") - m_aFamily = rAttributeValue; + const OUString aAttributeName = xAttribs->getNameByIndex(i); + const OUString aAttributeValue = xAttribs->getValueByIndex(i); + if (aAttributeName == "style:name") + m_aName = aAttributeValue; + else if (aAttributeName == "style:family") + m_aFamily = aAttributeValue; // Remember properties of the style itself, e.g. parent name. - OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8); - OString sValue = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8); + OString sName = OUStringToOString(aAttributeName, RTL_TEXTENCODING_UTF8); + OString sValue = OUStringToOString(aAttributeValue, RTL_TEXTENCODING_UTF8); m_aTextPropertyList.insert(sName.getStr(), sValue.getStr()); m_aParagraphPropertyList.insert(sName.getStr(), sValue.getStr()); m_aGraphicPropertyList.insert(sName.getStr(), sValue.getStr()); diff --git a/writerperfect/source/writer/exp/xmlfmt.cxx b/writerperfect/source/writer/exp/xmlfmt.cxx index 4ac70b85a3b1..1fbad97d4eb3 100644 --- a/writerperfect/source/writer/exp/xmlfmt.cxx +++ b/writerperfect/source/writer/exp/xmlfmt.cxx @@ -175,11 +175,11 @@ void XMLFontFaceFormatContext::startElement( { for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) { - const OUString& rAttributeName = xAttribs->getNameByIndex(i); - const OUString& rAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "svg:string") + const OUString aAttributeName = xAttribs->getNameByIndex(i); + const OUString aAttributeValue = xAttribs->getValueByIndex(i); + if (aAttributeName == "svg:string") { - OString aAttributeValueU8 = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8); + OString aAttributeValueU8 = OUStringToOString(aAttributeValue, RTL_TEXTENCODING_UTF8); mrFontFaceUri.GetPropertyList().insert("librevenge:mime-type", aAttributeValueU8.getStr()); } @@ -199,16 +199,16 @@ void XMLFontFaceUriContext::startElement( { for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) { - const OUString& rAttributeName = xAttribs->getNameByIndex(i); - const OUString& rAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "loext:font-style") + const OUString aAttributeName = xAttribs->getNameByIndex(i); + const OUString aAttributeValue = xAttribs->getValueByIndex(i); + if (aAttributeName == "loext:font-style") { - OString aAttributeValueU8 = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8); + OString aAttributeValueU8 = OUStringToOString(aAttributeValue, RTL_TEXTENCODING_UTF8); maPropertyList.insert("librevenge:font-style", aAttributeValueU8.getStr()); } - else if (rAttributeName == "loext:font-weight") + else if (aAttributeName == "loext:font-weight") { - OString aAttributeValueU8 = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8); + OString aAttributeValueU8 = OUStringToOString(aAttributeValue, RTL_TEXTENCODING_UTF8); maPropertyList.insert("librevenge:font-weight", aAttributeValueU8.getStr()); } } @@ -261,10 +261,10 @@ void XMLFontFaceContext::startElement( { for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) { - const OUString& rAttributeName = xAttribs->getNameByIndex(i); - const OUString& rAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "style:name") - maName = rAttributeValue; + const OUString aAttributeName = xAttribs->getNameByIndex(i); + const OUString aAttributeValue = xAttribs->getValueByIndex(i); + if (aAttributeName == "style:name") + maName = aAttributeValue; } } diff --git a/writerperfect/source/writer/exp/xmltbli.cxx b/writerperfect/source/writer/exp/xmltbli.cxx index 0e5818f0b17f..cc1134383b28 100644 --- a/writerperfect/source/writer/exp/xmltbli.cxx +++ b/writerperfect/source/writer/exp/xmltbli.cxx @@ -80,16 +80,16 @@ void XMLTableCellContext::startElement( librevenge::RVNGPropertyList aPropertyList; for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) { - const OUString& rAttributeName = xAttribs->getNameByIndex(i); - const OUString& rAttributeValue = xAttribs->getValueByIndex(i); + const OUString aAttributeName = xAttribs->getNameByIndex(i); + const OUString aAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "table:style-name") - FillStyles(rAttributeValue, GetImport().GetAutomaticCellStyles(), + if (aAttributeName == "table:style-name") + FillStyles(aAttributeValue, GetImport().GetAutomaticCellStyles(), GetImport().GetCellStyles(), aPropertyList); else { - OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8); - OString sValue = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8); + OString sName = OUStringToOString(aAttributeName, RTL_TEXTENCODING_UTF8); + OString sValue = OUStringToOString(aAttributeValue, RTL_TEXTENCODING_UTF8); aPropertyList.insert(sName.getStr(), sValue.getStr()); } } @@ -133,11 +133,11 @@ void XMLTableColumnContext::startElement( librevenge::RVNGPropertyList aPropertyList; for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) { - const OUString& rAttributeName = xAttribs->getNameByIndex(i); - const OUString& rAttributeValue = xAttribs->getValueByIndex(i); + const OUString aAttributeName = xAttribs->getNameByIndex(i); + const OUString aAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "table:style-name") - FillStyles(rAttributeValue, GetImport().GetAutomaticColumnStyles(), + if (aAttributeName == "table:style-name") + FillStyles(aAttributeValue, GetImport().GetAutomaticColumnStyles(), GetImport().GetColumnStyles(), aPropertyList); } m_rColumns.append(aPropertyList); @@ -169,11 +169,11 @@ void XMLTableRowContext::startElement( librevenge::RVNGPropertyList aPropertyList; for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) { - const OUString& rAttributeName = xAttribs->getNameByIndex(i); - const OUString& rAttributeValue = xAttribs->getValueByIndex(i); + const OUString aAttributeName = xAttribs->getNameByIndex(i); + const OUString aAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "table:style-name") - FillStyles(rAttributeValue, GetImport().GetAutomaticRowStyles(), + if (aAttributeName == "table:style-name") + FillStyles(aAttributeValue, GetImport().GetAutomaticRowStyles(), GetImport().GetRowStyles(), aPropertyList); } GetImport().GetGenerator().openTableRow(aPropertyList); @@ -222,20 +222,20 @@ void XMLTableContext::startElement( { for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) { - const OUString& rAttributeName = xAttribs->getNameByIndex(i); - const OUString& rAttributeValue = xAttribs->getValueByIndex(i); + const OUString aAttributeName = xAttribs->getNameByIndex(i); + const OUString aAttributeValue = xAttribs->getValueByIndex(i); - if (rAttributeName == "table:style-name") + if (aAttributeName == "table:style-name") { - FillStyles(rAttributeValue, GetImport().GetAutomaticTableStyles(), + FillStyles(aAttributeValue, GetImport().GetAutomaticTableStyles(), GetImport().GetTableStyles(), m_aPropertyList); if (m_bTopLevel) GetImport().HandlePageSpan(m_aPropertyList); } else { - OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8); - OString sValue = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8); + OString sName = OUStringToOString(aAttributeName, RTL_TEXTENCODING_UTF8); + OString sValue = OUStringToOString(aAttributeValue, RTL_TEXTENCODING_UTF8); m_aPropertyList.insert(sName.getStr(), sValue.getStr()); } }