summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-28 09:13:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-28 11:17:34 +0200
commitcb96678b3f875595e203f263e397afc33b433bb0 (patch)
tree1d6e1d19b7a9f6bdae149da9e872569ede7a2ac8
parent9a884b3d055ffdedbadb64c7f14e6d38078dedb1 (diff)
loplugin:oncevar in xmloff
Change-Id: I0fbd37685a0006e1fbc98d2b432c2b84d13d6cc8 Reviewed-on: https://gerrit.libreoffice.org/39344 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--xmloff/source/chart/SchXMLCalculationSettingsContext.cxx3
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.cxx3
-rw-r--r--xmloff/source/chart/SchXMLSeries2Context.cxx2
-rw-r--r--xmloff/source/core/xmlexp.cxx6
-rw-r--r--xmloff/source/core/xmlimp.cxx18
-rw-r--r--xmloff/source/core/xmlmultiimagehelper.cxx4
-rw-r--r--xmloff/source/draw/animationexport.cxx3
-rw-r--r--xmloff/source/draw/shapeexport.cxx3
-rw-r--r--xmloff/source/style/DashStyle.cxx4
-rw-r--r--xmloff/source/style/PageMasterImportContext.cxx3
-rw-r--r--xmloff/source/style/PageMasterPropHdl.cxx3
-rw-r--r--xmloff/source/style/XMLPageExport.cxx3
-rw-r--r--xmloff/source/style/fonthdl.cxx4
-rw-r--r--xmloff/source/style/opaquhdl.cxx4
-rw-r--r--xmloff/source/text/XMLCalculationSettingsContext.cxx3
-rw-r--r--xmloff/source/text/XMLIndexTOCContext.cxx4
-rw-r--r--xmloff/source/text/XMLSectionFootnoteConfigImport.cxx3
-rw-r--r--xmloff/source/text/txtflde.cxx18
-rw-r--r--xmloff/source/text/txtfldi.cxx8
-rw-r--r--xmloff/source/text/txtimp.cxx12
-rw-r--r--xmloff/source/text/txtparae.cxx22
-rw-r--r--xmloff/source/text/txtparai.cxx6
-rw-r--r--xmloff/source/text/txtstyle.cxx3
-rw-r--r--xmloff/source/text/txtvfldi.cxx3
24 files changed, 42 insertions, 103 deletions
diff --git a/xmloff/source/chart/SchXMLCalculationSettingsContext.cxx b/xmloff/source/chart/SchXMLCalculationSettingsContext.cxx
index 573941ec64d3..5464c5c4d936 100644
--- a/xmloff/source/chart/SchXMLCalculationSettingsContext.cxx
+++ b/xmloff/source/chart/SchXMLCalculationSettingsContext.cxx
@@ -68,8 +68,7 @@ void SchXMLCalculationSettingsContext::EndElement()
if ( m_aNullDate.hasValue() )
{
Reference < XPropertySet > xPropSet ( GetImport().GetModel(), UNO_QUERY );
- OUString sNullDate( "NullDate" );
- xPropSet->setPropertyValue ( sNullDate, m_aNullDate );
+ xPropSet->setPropertyValue ( "NullDate", m_aNullDate );
}
}
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 5fdb943556a8..9fe693cd0bb0 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -204,8 +204,7 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext(
xProp->setPropertyValue("HasZAxis", aFalseBool );
xProp->setPropertyValue("HasZAxisDescription", aFalseBool );
- chart::ChartDataRowSource eSource = chart::ChartDataRowSource_COLUMNS;
- xProp->setPropertyValue("DataRowSource", uno::Any(eSource) );
+ xProp->setPropertyValue("DataRowSource", uno::Any(chart::ChartDataRowSource_COLUMNS) );
}
catch( const beans::UnknownPropertyException & )
{
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index 2f35804bedb6..a2e9069629b5 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -385,7 +385,7 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib
}
if( ! mrGlobalChartTypeUsedBySeries )
mrGlobalChartTypeUsedBySeries = (maSeriesChartTypeName.equals( maGlobalChartTypeName ));
- sal_Int32 nCoordinateSystemIndex = 0;//so far we can only import one coordinate system
+ sal_Int32 const nCoordinateSystemIndex = 0;//so far we can only import one coordinate system
m_xSeries.set(
SchXMLImportHelper::GetNewDataSeries( mxNewDoc, nCoordinateSystemIndex, maSeriesChartTypeName, ! mrGlobalChartTypeUsedBySeries ));
Reference< chart2::data::XLabeledDataSequence > xLabeledSeq( SchXMLTools::GetNewLabeledDataSequence(), uno::UNO_QUERY_THROW );
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index d4f396c963ae..7b6a78cb0403 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -2016,10 +2016,8 @@ XMLEventExport& SvXMLExport::GetEventExport()
mpEventExport = new XMLEventExport(*this);
// and register standard handlers + names
- OUString sStarBasic("StarBasic");
- mpEventExport->AddHandler(sStarBasic, new XMLStarBasicExportHandler());
- OUString sScript("Script");
- mpEventExport->AddHandler(sScript, new XMLScriptExportHandler());
+ mpEventExport->AddHandler("StarBasic", new XMLStarBasicExportHandler());
+ mpEventExport->AddHandler("Script", new XMLScriptExportHandler());
mpEventExport->AddTranslationTable(aStandardEventTable);
}
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index b4e5698832ad..5d9d1de5123e 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -684,12 +684,11 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName,
if( (nPrefix & XML_NAMESPACE_UNKNOWN_FLAG) != 0 &&
dynamic_cast< const SvXMLImportContext*>(xContext.get()) != nullptr )
{
- OUString aMsg( "Root element unknown" );
Reference<xml::sax::XLocator> xDummyLocator;
Sequence < OUString > aParams { rName };
SetError( XMLERROR_FLAG_SEVERE|XMLERROR_UNKNOWN_ROOT,
- aParams, aMsg, xDummyLocator );
+ aParams, "Root element unknown", xDummyLocator );
}
}
@@ -1390,8 +1389,7 @@ Reference < XOutputStream >
Reference< XNameAccess > xNA( mxEmbeddedResolver, UNO_QUERY );
if( xNA.is() )
{
- OUString aURL( "Obj12345678" );
- Any aAny = xNA->getByName( aURL );
+ Any aAny = xNA->getByName( "Obj12345678" );
aAny >>= xOLEStream;
}
}
@@ -1405,8 +1403,7 @@ OUString SvXMLImport::ResolveEmbeddedObjectURLFromBase64()
if( mxEmbeddedResolver.is() )
{
- OUString aURL( "Obj12345678" );
- sRet = mxEmbeddedResolver->resolveEmbeddedObjectURL( aURL );
+ sRet = mxEmbeddedResolver->resolveEmbeddedObjectURL( "Obj12345678" );
}
return sRet;
@@ -1557,8 +1554,7 @@ XMLEventImportHelper& SvXMLImport::GetEventImport()
mpEventImportHelper->AddTranslationTable(aStandardEventTable);
// register StarBasic event handler with capitalized spelling
- OUString sStarBasicCap( "StarBasic" );
- mpEventImportHelper->RegisterFactory(sStarBasicCap,
+ mpEventImportHelper->RegisterFactory("StarBasic",
new XMLStarBasicContextFactory());
}
@@ -1739,8 +1735,7 @@ sal_Unicode SvXMLImport::ConvStarBatsCharToStarSymbol( sal_Unicode c )
sal_Unicode cNew = c;
if( !mpImpl->hBatsFontConv )
{
- OUString sStarBats( "StarBats" );
- mpImpl->hBatsFontConv = CreateFontToSubsFontConverter( sStarBats,
+ mpImpl->hBatsFontConv = CreateFontToSubsFontConverter( "StarBats",
FontToSubsFontFlags::IMPORT|FontToSubsFontFlags::ONLYOLDSOSYMBOLFONTS );
SAL_WARN_IF( !mpImpl->hBatsFontConv, "xmloff.core", "Got no symbol font converter" );
}
@@ -1757,8 +1752,7 @@ sal_Unicode SvXMLImport::ConvStarMathCharToStarSymbol( sal_Unicode c )
sal_Unicode cNew = c;
if( !mpImpl->hMathFontConv )
{
- OUString sStarMath( "StarMath" );
- mpImpl->hMathFontConv = CreateFontToSubsFontConverter( sStarMath,
+ mpImpl->hMathFontConv = CreateFontToSubsFontConverter( "StarMath",
FontToSubsFontFlags::IMPORT|FontToSubsFontFlags::ONLYOLDSOSYMBOLFONTS );
SAL_WARN_IF( !mpImpl->hMathFontConv, "xmloff.core", "Got no symbol font converter" );
}
diff --git a/xmloff/source/core/xmlmultiimagehelper.cxx b/xmloff/source/core/xmlmultiimagehelper.cxx
index 897528c565c5..2c8d89844e4a 100644
--- a/xmloff/source/core/xmlmultiimagehelper.cxx
+++ b/xmloff/source/core/xmlmultiimagehelper.cxx
@@ -26,8 +26,6 @@ namespace
{
sal_uInt32 getQualityIndex(const OUString& rString)
{
- sal_uInt32 nRetval(0);
-
// pixel formats first
if(rString.endsWith(".bmp"))
{
@@ -68,7 +66,7 @@ namespace
return 1040;
}
- return nRetval;
+ return 0;
}
}
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx
index 43b44a606f69..f3014ce41224 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -1143,8 +1143,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat
}
else
{
- OUString aStr( "invalid" );
- mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ATTRIBUTENAME, aStr );
+ mrExport.AddAttribute( XML_NAMESPACE_SMIL, XML_ATTRIBUTENAME, "invalid" );
}
}
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 0116c610a5c6..02e32dca12b6 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -240,9 +240,8 @@ uno::Reference< drawing::XShape > XMLShapeExport::checkForCustomShapeReplacement
uno::Sequence< beans::PropertyValue > aPropValues( 2 );
aPropValues[ 0 ].Name = "CustomShape";
aPropValues[ 0 ].Value <<= xShape;
- bool bForceGroupWithText = true;
aPropValues[ 1 ].Name = "ForceGroupWithText";
- aPropValues[ 1 ].Value <<= bForceGroupWithText;
+ aPropValues[ 1 ].Value <<= true;
aArgument[ 0 ] <<= aPropValues;
uno::Reference< uno::XInterface > xInterface(
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aEngine, aArgument, xContext) );
diff --git a/xmloff/source/style/DashStyle.cxx b/xmloff/source/style/DashStyle.cxx
index 842eced6c360..bbb49ba29945 100644
--- a/xmloff/source/style/DashStyle.cxx
+++ b/xmloff/source/style/DashStyle.cxx
@@ -214,8 +214,6 @@ bool XMLDashStyleExport::exportXML(
const OUString& rStrName,
const uno::Any& rValue )
{
- bool bRet = false;
-
SvXMLUnitConverter & rUnitConverter = rExport.GetMM100UnitConverter();
drawing::LineDash aLineDash;
@@ -306,7 +304,7 @@ bool XMLDashStyleExport::exportXML(
true, false );
}
}
- return bRet;
+ return false;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/style/PageMasterImportContext.cxx b/xmloff/source/style/PageMasterImportContext.cxx
index e92b05c2c8b0..7d79145893e3 100644
--- a/xmloff/source/style/PageMasterImportContext.cxx
+++ b/xmloff/source/style/PageMasterImportContext.cxx
@@ -146,12 +146,11 @@ SvXMLImportContext *PageStyleContext::CreateChildContext(
}
if (!bEnd)
nEndIndex = nIndex;
- PageContextType aType = Page;
return new PagePropertySetContext( GetImport(), nPrefix,
rLocalName, xAttrList,
XML_TYPE_PROP_PAGE_LAYOUT,
GetProperties(),
- xImpPrMap, 0, nEndIndex, aType);
+ xImpPrMap, 0, nEndIndex, Page);
}
}
diff --git a/xmloff/source/style/PageMasterPropHdl.cxx b/xmloff/source/style/PageMasterPropHdl.cxx
index 86d8829f70ae..5ebd7aa78d1d 100644
--- a/xmloff/source/style/PageMasterPropHdl.cxx
+++ b/xmloff/source/style/PageMasterPropHdl.cxx
@@ -283,13 +283,12 @@ bool XMLPMPropHdl_Print::importXML(
Any& rValue,
const SvXMLUnitConverter& ) const
{
- sal_Unicode cToken = ' ';
sal_Int32 nTokenIndex = 0;
bool bFound = false;
do
{
- bFound = (sAttrValue == rStrImpValue.getToken( 0, cToken, nTokenIndex ));
+ bFound = (sAttrValue == rStrImpValue.getToken( 0, ' ', nTokenIndex ));
}
while ( (nTokenIndex >= 0) && !bFound );
diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx
index 5f884a4b9f07..dd599528bb6b 100644
--- a/xmloff/source/style/XMLPageExport.cxx
+++ b/xmloff/source/style/XMLPageExport.cxx
@@ -219,8 +219,7 @@ void XMLPageExport::exportDefaultStyle()
Reference < lang::XMultiServiceFactory > xFactory (GetExport().GetModel(), UNO_QUERY);
if (xFactory.is())
{
- OUString sTextDefaults ( "com.sun.star.text.Defaults" );
- Reference < XPropertySet > xPropSet (xFactory->createInstance ( sTextDefaults ), UNO_QUERY);
+ Reference < XPropertySet > xPropSet (xFactory->createInstance ( "com.sun.star.text.Defaults" ), UNO_QUERY);
if (xPropSet.is())
{
// <style:default-style ...>
diff --git a/xmloff/source/style/fonthdl.cxx b/xmloff/source/style/fonthdl.cxx
index 8e4884fd0579..a04f4c1b8d26 100644
--- a/xmloff/source/style/fonthdl.cxx
+++ b/xmloff/source/style/fonthdl.cxx
@@ -228,12 +228,10 @@ XMLFontEncodingPropHdl::~XMLFontEncodingPropHdl()
bool XMLFontEncodingPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const
{
- bool bRet = true;
-
if( IsXMLToken( rStrImpValue, XML_X_SYMBOL ) )
rValue <<= (sal_Int16) RTL_TEXTENCODING_SYMBOL;
- return bRet;
+ return true;
}
bool XMLFontEncodingPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
diff --git a/xmloff/source/style/opaquhdl.cxx b/xmloff/source/style/opaquhdl.cxx
index 375724b1af11..588b5e5c58de 100644
--- a/xmloff/source/style/opaquhdl.cxx
+++ b/xmloff/source/style/opaquhdl.cxx
@@ -36,12 +36,10 @@ XMLOpaquePropHdl::~XMLOpaquePropHdl()
bool XMLOpaquePropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const
{
- bool bRet = true;
-
bool bValue = IsXMLToken( rStrImpValue, XML_OPAQUE_FOREGROUND );
rValue <<= bValue;
- return bRet;
+ return true;
}
bool XMLOpaquePropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& ) const
diff --git a/xmloff/source/text/XMLCalculationSettingsContext.cxx b/xmloff/source/text/XMLCalculationSettingsContext.cxx
index ad4d8463133c..2a22bc8f1ad7 100644
--- a/xmloff/source/text/XMLCalculationSettingsContext.cxx
+++ b/xmloff/source/text/XMLCalculationSettingsContext.cxx
@@ -75,8 +75,7 @@ void XMLCalculationSettingsContext::EndElement()
if (xTextDoc.is())
{
Reference < XPropertySet > xPropSet ( xTextDoc, UNO_QUERY );
- OUString sTwoDigitYear ( "TwoDigitYear" );
- xPropSet->setPropertyValue ( sTwoDigitYear, Any(nYear) );
+ xPropSet->setPropertyValue ( "TwoDigitYear", Any(nYear) );
}
}
}
diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx
index 0f741002a713..26621f72aaa1 100644
--- a/xmloff/source/text/XMLIndexTOCContext.cxx
+++ b/xmloff/source/text/XMLIndexTOCContext.cxx
@@ -189,9 +189,9 @@ void XMLIndexTOCContext::StartElement(
// preliminaries
#ifndef DBG_UTIL
- OUString sMarker(" ");
+ OUString const sMarker(" ");
#else
- OUString sMarker("Y");
+ OUString const sMarker("Y");
#endif
rtl::Reference<XMLTextImportHelper> rImport =
GetImport().GetTextImport();
diff --git a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx
index 78f061cad181..fe697f07f8bb 100644
--- a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx
+++ b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx
@@ -65,7 +65,6 @@ XMLSectionFootnoteConfigImport::~XMLSectionFootnoteConfigImport()
void XMLSectionFootnoteConfigImport::StartElement(
const Reference<XAttributeList> & xAttrList)
{
- bool bEnd = true; // we're inside the element, so this is true
bool bNumOwn = false;
bool bNumRestart = false;
bool bEndnote = false;
@@ -166,7 +165,7 @@ void XMLSectionFootnoteConfigImport::StartElement(
nIndex = rMapper->FindEntryIndex( bEndnote ?
CTF_SECTION_ENDNOTE_END : CTF_SECTION_FOOTNOTE_END );
- XMLPropertyState aEndState( nIndex, css::uno::Any(bEnd) );
+ XMLPropertyState aEndState( nIndex, css::uno::Any(true) ); // we're inside the element, so this is true
rProperties.push_back( aEndState );
}
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index dcc878248bd1..713b2621a9bc 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -2236,13 +2236,7 @@ void XMLTextFieldExport::ExportMacro(
{
// some strings we'll need
OUString sEventType( "EventType" );
- OUString sStarBasic( "StarBasic" );
OUString sScript( "Script" );
- OUString sLibrary( "Library" );
- OUString sMacroName( "MacroName" );
- OUString sOnClick( "OnClick" );
- OUString sPropertyMacroLibrary( "MacroLibrary" );
- OUString sPropertyMacroName( "MacroName" );
OUString sPropertyScriptURL( "ScriptURL" );
@@ -2278,15 +2272,15 @@ void XMLTextFieldExport::ExportMacro(
aSeq = Sequence<PropertyValue> (3);
PropertyValue* pArr = aSeq.getArray();
pArr[0].Name = sEventType;
- pArr[0].Value <<= sStarBasic;
- pArr[1].Name = sLibrary;
- pArr[1].Value = rPropSet->getPropertyValue( sPropertyMacroLibrary );
- pArr[2].Name = sMacroName;
- pArr[2].Value = rPropSet->getPropertyValue( sPropertyMacroName );
+ pArr[0].Value <<= OUString("StarBasic");
+ pArr[1].Name = "Library";
+ pArr[1].Value = rPropSet->getPropertyValue( "MacroLibrary" );
+ pArr[2].Name = "MacroName";
+ pArr[2].Value = rPropSet->getPropertyValue( "MacroName" );
}
// 2) export the sequence
- GetExport().GetEventExport().ExportSingleEvent( aSeq, sOnClick, false );
+ GetExport().GetEventExport().ExportSingleEvent( aSeq, "OnClick", false );
// and finally, the field presentation
GetExport().Characters(rContent);
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index 392bfecf34a7..c105ee7b49a4 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -2468,10 +2468,6 @@ void XMLMacroFieldImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
Any aAny;
-
- OUString sOnClick("OnClick");
- OUString sPropertyMacroLibrary("MacroLibrary");
-
aAny <<= (bDescriptionOK ? sDescription : GetContent());
xPropertySet->setPropertyValue(sAPI_hint, aAny);
@@ -2488,7 +2484,7 @@ void XMLMacroFieldImportContext::PrepareField(
XMLEventsImportContext* pEvents =
static_cast<XMLEventsImportContext*>(xEventContext.get());
Sequence<PropertyValue> aValues;
- pEvents->GetEventSequence( sOnClick, aValues );
+ pEvents->GetEventSequence( "OnClick", aValues );
sal_Int32 nLength = aValues.getLength();
for( sal_Int32 i = 0; i < nLength; i++ )
@@ -2535,7 +2531,7 @@ void XMLMacroFieldImportContext::PrepareField(
xPropertySet->setPropertyValue("ScriptURL", Any(sScriptURL));
xPropertySet->setPropertyValue("MacroName", Any(sMacroName));
- xPropertySet->setPropertyValue(sPropertyMacroLibrary, Any(sLibraryName));
+ xPropertySet->setPropertyValue("MacroLibrary", Any(sLibraryName));
}
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 53bb6b70bced..dc6b16147c19 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1329,11 +1329,9 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
rFlags &= ~(CONV_FROM_STAR_BATS|CONV_FROM_STAR_MATH);
OUString sFontName;
rProp.maValue >>= sFontName;
- OUString sStarBats( "StarBats" );
- OUString sStarMath( "StarMath" );
- if( sFontName.equalsIgnoreAsciiCase( sStarBats ) )
+ if( sFontName.equalsIgnoreAsciiCase( "StarBats" ) )
rFlags |= CONV_FROM_STAR_BATS;
- else if( sFontName.equalsIgnoreAsciiCase( sStarMath ) )
+ else if( sFontName.equalsIgnoreAsciiCase( "StarMath" ) )
rFlags |= CONV_FROM_STAR_MATH;
break;
}
@@ -1660,9 +1658,8 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
// TODO: property missing
if (xPropSetInfo->hasPropertyByName(s_ParaIsNumberingRestart))
{
- bool bTmp = true;
xPropSet->setPropertyValue(s_ParaIsNumberingRestart,
- makeAny(bTmp) );
+ makeAny(true) );
}
pListBlock->ResetRestartNumbering();
}
@@ -2177,7 +2174,6 @@ void XMLTextImportHelper::SetRuby(
Reference<XPropertySet> xPropSet(rCursor, UNO_QUERY);
OUString sRubyText("RubyText");
- OUString sRubyCharStyleName("RubyCharStyleName");
// if we have one Ruby property, we assume all of them are present
if (xPropSet.is() &&
@@ -2208,7 +2204,7 @@ void XMLTextImportHelper::SetRuby(
if( (!sDisplayName.isEmpty()) &&
m_xImpl->m_xTextStyles->hasByName( sDisplayName ))
{
- xPropSet->setPropertyValue(sRubyCharStyleName, makeAny(sDisplayName));
+ xPropSet->setPropertyValue("RubyCharStyleName", makeAny(sDisplayName));
}
}
}
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 867e9dbfe18f..b1f8b60c50dc 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -1653,8 +1653,6 @@ void XMLTextParagraphExport::exportText(
if( ! xParaEnum.is() )
return;
- bool bExportLevels = true;
-
if (xPropertySet.is())
{
Reference < XPropertySetInfo > xInfo ( xPropertySet->getPropertySetInfo() );
@@ -1665,21 +1663,6 @@ void XMLTextParagraphExport::exportText(
{
xPropertySet->getPropertyValue(sTextSection) >>= xBaseSection ;
}
-
-/* #i35937#
- // for applications that use the outliner we need to check if
- // the current text object needs the level information exported
- if( !bAutoStyles )
- {
- // fixme: move string to class member, couldn't do now because
- // of no incompatible build
- OUString sHasLevels( "HasLevels" );
- if (xInfo->hasPropertyByName( sHasLevels ) )
- {
- xPropertySet->getPropertyValue(sHasLevels) >>= bExportLevels;
- }
- }
-*/
}
}
@@ -1688,7 +1671,7 @@ void XMLTextParagraphExport::exportText(
if( !bAutoStyles && (pRedlineExport != nullptr) )
pRedlineExport->ExportStartOrEndRedline( xPropertySet, true );
exportTextContentEnumeration( xParaEnum, bAutoStyles, xBaseSection,
- bIsProgress, bExportParagraph, nullptr, bExportLevels, eExtensionNS );
+ bIsProgress, bExportParagraph, nullptr, true/*bExportLevels*/, eExtensionNS );
if( !bAutoStyles && (pRedlineExport != nullptr) )
pRedlineExport->ExportStartOrEndRedline( xPropertySet, false );
}
@@ -3153,8 +3136,7 @@ void XMLTextParagraphExport::exportEvents( const Reference < XPropertySet > & rP
GetExport().GetEventExport().Export(xEventsSupp);
// image map
- OUString sImageMap("ImageMap");
- if (rPropSet->getPropertySetInfo()->hasPropertyByName(sImageMap))
+ if (rPropSet->getPropertySetInfo()->hasPropertyByName("ImageMap"))
GetExport().GetImageMapExport().Export( rPropSet );
}
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
index 61cb1e374153..2bad8ab7f422 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -2101,8 +2101,7 @@ XMLParaContext::~XMLParaContext()
TextContentAnchorType eAnchorType =
TextContentAnchorType_AT_PARAGRAPH;
{
- OUString sAnchorType( "AnchorType" );
- Any aAny = xPropSet->getPropertyValue( sAnchorType );
+ Any aAny = xPropSet->getPropertyValue( "AnchorType" );
aAny >>= eAnchorType;
}
if ( TextContentAnchorType_AT_CHARACTER == eAnchorType )
@@ -2130,8 +2129,7 @@ XMLParaContext::~XMLParaContext()
Reference < XPropertySet > xPropSet( xShape, UNO_QUERY );
TextContentAnchorType eAnchorType = TextContentAnchorType_AT_PARAGRAPH;
{
- OUString sAnchorType( "AnchorType" );
- Any aAny = xPropSet->getPropertyValue( sAnchorType );
+ Any aAny = xPropSet->getPropertyValue( "AnchorType" );
aAny >>= eAnchorType;
}
if ( TextContentAnchorType_AT_CHARACTER == eAnchorType )
diff --git a/xmloff/source/text/txtstyle.cxx b/xmloff/source/text/txtstyle.cxx
index 0832876e57e8..eefa1d2fca6a 100644
--- a/xmloff/source/text/txtstyle.cxx
+++ b/xmloff/source/text/txtstyle.cxx
@@ -116,8 +116,7 @@ void XMLTextParagraphExport::exportTextStyles( bool bUsed, bool bProg )
Reference < lang::XMultiServiceFactory > xFactory (GetExport().GetModel(), UNO_QUERY);
if (xFactory.is())
{
- OUString sTextDefaults ( "com.sun.star.text.Defaults" );
- Reference < XPropertySet > xPropSet (xFactory->createInstance ( sTextDefaults ), UNO_QUERY);
+ Reference < XPropertySet > xPropSet (xFactory->createInstance ( "com.sun.star.text.Defaults" ), UNO_QUERY);
if (xPropSet.is())
{
exportDefaultStyle( xPropSet, GetXMLToken(XML_PARAGRAPH), GetParaPropMapper());
diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx
index 7285cf132e33..c150ad5857a6 100644
--- a/xmloff/source/text/txtvfldi.cxx
+++ b/xmloff/source/text/txtvfldi.cxx
@@ -550,8 +550,7 @@ XMLExpressionFieldImportContext::XMLExpressionFieldImportContext(
void XMLExpressionFieldImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- sal_Int16 nSubType = SetVariableType::FORMULA;
- xPropertySet->setPropertyValue(sAPI_sub_type, Any(nSubType));
+ xPropertySet->setPropertyValue(sAPI_sub_type, Any(sal_Int16(SetVariableType::FORMULA)));
// delegate to super class
XMLVarFieldImportContext::PrepareField(xPropertySet);