loplugin:reftotemp in writerperfect

Change-Id: I7a185e98047965a1f6cedd0b31dead5ba6d89192
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176502
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit is contained in:
Noel Grandin 2024-11-12 21:04:11 +02:00
parent 910d3a4f04
commit ec3850e661
6 changed files with 80 additions and 80 deletions

View file

@ -376,12 +376,12 @@ MSWorksCalcImportFilter::filter(const css::uno::Sequence<css::beans::PropertyVal
sWM3Name = aTmpUrl.getName(INetURLObject::LAST_SEGMENT, true,
INetURLObject::DecodeMechanism::WithCharset);
aTmpUrl.setExtension(u"FM3");
const OUString& sTestFM3Name
const OUString sTestFM3Name
= aTmpUrl.getName(INetURLObject::LAST_SEGMENT, true,
INetURLObject::DecodeMechanism::WithCharset);
do
{
const OUString& aTitle(xRow->getString(1));
const OUString aTitle(xRow->getString(1));
if (aTitle.equalsIgnoreAsciiCase(sTestFM3Name))
sFM3Name = aTitle;
} while (xResultSet->next() && sFM3Name.isEmpty());

View file

@ -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());
}
}

View file

@ -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());
}
}

View file

@ -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());

View file

@ -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;
}
}

View file

@ -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());
}
}