summaryrefslogtreecommitdiff
path: root/xmloff/source/style
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-03 08:39:03 +0200
committerNoel Grandin <noel@peralex.com>2016-05-04 12:39:40 +0200
commit58a32075ca4f457f570af75aef368dd6c389aca7 (patch)
treee437dcbdeb248b4316cb8a9281d1543419853f6d /xmloff/source/style
parent7d47700972d267fe7c5270c5dadd45a523a2baec (diff)
use Any constructor instead of temporaries
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
Diffstat (limited to 'xmloff/source/style')
-rw-r--r--xmloff/source/style/XMLFootnoteSeparatorImport.cxx22
-rw-r--r--xmloff/source/style/prstylei.cxx7
-rw-r--r--xmloff/source/style/xmlimppr.cxx8
-rw-r--r--xmloff/source/style/xmlnume.cxx13
-rw-r--r--xmloff/source/style/xmlnumi.cxx15
5 files changed, 19 insertions, 46 deletions
diff --git a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
index 83775bdd2976..df2b277821cc 100644
--- a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
+++ b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
@@ -163,43 +163,35 @@ void XMLFootnoteSeparatorImport::StartElement(
}
// OK, now we have all values and can fill the XMLPropertyState vector
- Any aAny;
sal_Int32 nIndex;
- aAny <<= eLineAdjust;
nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_LINE_ADJUST);
- XMLPropertyState aLineAdjust( nIndex, aAny);
+ XMLPropertyState aLineAdjust( nIndex, uno::Any(eLineAdjust));
rProperties.push_back(aLineAdjust);
- aAny <<= nLineColor;
nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_LINE_COLOR);
- XMLPropertyState aLineColor( nIndex, aAny );
+ XMLPropertyState aLineColor( nIndex, uno::Any(nLineColor) );
rProperties.push_back(aLineColor);
- aAny <<= nLineStyle;
nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_LINE_STYLE);
- XMLPropertyState aLineStyle( nIndex, aAny );
+ XMLPropertyState aLineStyle( nIndex, uno::Any(nLineStyle) );
rProperties.push_back(aLineStyle);
- aAny <<= nLineDistance;
nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_DISTANCE);
- XMLPropertyState aLineDistance( nIndex, aAny );
+ XMLPropertyState aLineDistance( nIndex, uno::Any(nLineDistance) );
rProperties.push_back(aLineDistance);
- aAny <<= nLineRelWidth;
nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_LINE_WIDTH);
- XMLPropertyState aLineRelWidth( nIndex, aAny);
+ XMLPropertyState aLineRelWidth( nIndex, uno::Any(nLineRelWidth));
rProperties.push_back(aLineRelWidth);
- aAny <<= nLineTextDistance;
nIndex = rMapper->FindEntryIndex(CTF_PM_FTN_LINE_DISTANCE);
- XMLPropertyState aLineTextDistance( nIndex, aAny);
+ XMLPropertyState aLineTextDistance( nIndex, uno::Any(nLineTextDistance));
rProperties.push_back(aLineTextDistance);
DBG_ASSERT( rMapper->FindEntryIndex(CTF_PM_FTN_LINE_WEIGHT) == nPropIndex,
"Received wrong property map index!" );
- aAny <<= nLineWeight;
- XMLPropertyState aLineWeight( nPropIndex, aAny );
+ XMLPropertyState aLineWeight( nPropIndex, uno::Any(nLineWeight) );
rProperties.push_back(aLineWeight);
}
diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx
index d97a8bd2815a..5f03fd31d48c 100644
--- a/xmloff/source/style/prstylei.cxx
+++ b/xmloff/source/style/prstylei.cxx
@@ -363,9 +363,7 @@ void XMLPropStyleContext::CreateAndInsert( bool bOverwrite )
if( !mxStyle.is() )
return;
- Any aAny;
- aAny <<= mxStyle;
- xFamilies->insertByName( rName, aAny );
+ xFamilies->insertByName( rName, Any(mxStyle) );
bNew = true;
}
@@ -501,8 +499,7 @@ void XMLPropStyleContext::Finish( bool bOverwrite )
aAny >>= sCurrFollow;
if( sCurrFollow != sFollow )
{
- aAny <<= sFollow;
- xPropSet->setPropertyValue( msFollowStyle, aAny );
+ xPropSet->setPropertyValue( msFollowStyle, Any(sFollow) );
}
}
diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx
index b841e599876d..ab4bfbe39a2e 100644
--- a/xmloff/source/style/xmlimppr.cxx
+++ b/xmloff/source/style/xmlimppr.cxx
@@ -282,9 +282,7 @@ void SvXMLImportPropertyMapper::importXML(
// #106963#; use userdefined attribute only if it is in the specified property range
if( nIndex != -1 && nIndex >= nStartIdx && nIndex < nEndIdx)
{
- Any aAny;
- aAny <<= xAttrContainer;
- XMLPropertyState aNewProperty( nIndex, aAny );
+ XMLPropertyState aNewProperty( nIndex, Any(xAttrContainer) );
// push it on our stack so we export it later
rProperties.push_back( aNewProperty );
@@ -307,9 +305,7 @@ void SvXMLImportPropertyMapper::importXML(
sName.append( aLocalName );
- Any aAny;
- aAny <<= aData;
- xAttrContainer->insertByName( sName.makeStringAndClear(), aAny );
+ xAttrContainer->insertByName( sName.makeStringAndClear(), Any(aData) );
}
}
}
diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx
index 8b0aa079c32d..ee4cfdcdd78c 100644
--- a/xmloff/source/style/xmlnume.cxx
+++ b/xmloff/source/style/xmlnume.cxx
@@ -540,14 +540,12 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
}
else
{
- Any aAny;
OUString sTemp;
const SvXMLUnitConverter& rUnitConv =
GetExport().GetMM100UnitConverter();
XMLFontFamilyNamePropHdl aFamilyNameHdl;
- aAny <<= sBulletFontName;
- if( aFamilyNameHdl.exportXML( sTemp, aAny, rUnitConv ) )
+ if( aFamilyNameHdl.exportXML( sTemp, Any(sBulletFontName), rUnitConv ) )
GetExport().AddAttribute( XML_NAMESPACE_FO,
XML_FONT_FAMILY, sTemp );
@@ -557,21 +555,18 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
sBulletFontStyleName );
XMLFontFamilyPropHdl aFamilyHdl;
- aAny <<= (sal_Int16)eBulletFontFamily;
- if( aFamilyHdl.exportXML( sTemp, aAny, rUnitConv ) )
+ if( aFamilyHdl.exportXML( sTemp, Any((sal_Int16)eBulletFontFamily), rUnitConv ) )
GetExport().AddAttribute( XML_NAMESPACE_STYLE,
XML_FONT_FAMILY_GENERIC,
sTemp );
XMLFontPitchPropHdl aPitchHdl;
- aAny <<= (sal_Int16)eBulletFontPitch;
- if( aPitchHdl.exportXML( sTemp, aAny, rUnitConv ) )
+ if( aPitchHdl.exportXML( sTemp, Any((sal_Int16)eBulletFontPitch), rUnitConv ) )
GetExport().AddAttribute( XML_NAMESPACE_STYLE,
XML_FONT_PITCH, sTemp );
XMLFontEncodingPropHdl aEncHdl;
- aAny <<= (sal_Int16)eBulletFontEncoding;
- if( aEncHdl.exportXML( sTemp, aAny, rUnitConv ) )
+ if( aEncHdl.exportXML( sTemp, Any((sal_Int16)eBulletFontEncoding), rUnitConv ) )
GetExport().AddAttribute( XML_NAMESPACE_STYLE,
XML_FONT_CHARSET, sTemp );
}
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 09280f2291f5..0a8b5b6823c6 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -1098,9 +1098,7 @@ void SvxXMLListStyleContext::FillUnoNumRule(
{
Sequence<beans::PropertyValue> aProps =
pLevelStyle->GetProperties();
- Any aAny;
- aAny <<= aProps;
- rNumRule->replaceByIndex( nLevel, aAny );
+ rNumRule->replaceByIndex( nLevel, Any(aProps) );
}
}
}
@@ -1175,9 +1173,7 @@ void SvxXMLListStyleContext::CreateAndInsertLate( bool bOverwrite )
if( !xStyle.is() )
return;
- Any aAny;
- aAny <<= xStyle;
- rNumStyles->insertByName( rName, aAny );
+ rNumStyles->insertByName( rName, Any(xStyle) );
bNew = true;
}
@@ -1203,8 +1199,7 @@ void SvxXMLListStyleContext::CreateAndInsertLate( bool bOverwrite )
if( bOverwrite || bNew )
{
FillUnoNumRule(xNumRules);
- aAny <<= xNumRules;
- xPropSet->setPropertyValue( sNumberingRules, aAny );
+ xPropSet->setPropertyValue( sNumberingRules, Any(xNumRules) );
}
else
{
@@ -1291,9 +1286,7 @@ void SvxXMLListStyleContext::SetDefaultStyle(
(pProps++)->Value <<= OUString( "Numbering Symbols" );
}
- Any aAny;
- aAny <<= aPropSeq;
- rNumRule->replaceByIndex( nLevel, aAny );
+ rNumRule->replaceByIndex( nLevel, Any(aPropSeq) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */