summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-03 08:39:03 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-07-20 01:26:04 -0400
commita0e8e05008e143ee5e3bbc281d1c253c7e5ed136 (patch)
treeeaf5f70a067fd48704addd9f2b582624a2fb44ae /xmloff
parent9c7cae1561cfe16226b1f16dce59f08a38da3ce0 (diff)
use Any constructor instead of temporaries
(cherry picked from commit 58a32075ca4f457f570af75aef368dd6c389aca7) Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx8
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.cxx12
-rw-r--r--xmloff/source/chart/XMLChartStyleContext.cxx4
-rw-r--r--xmloff/source/core/unoatrcn.cxx4
-rw-r--r--xmloff/source/core/xmlerror.cxx4
-rw-r--r--xmloff/source/core/xmlexp.cxx15
-rw-r--r--xmloff/source/core/xmlimp.cxx19
-rw-r--r--xmloff/source/draw/XMLImageMapContext.cxx59
-rw-r--r--xmloff/source/draw/XMLShapePropertySetContext.cxx5
-rw-r--r--xmloff/source/draw/animimp.cxx24
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx5
-rw-r--r--xmloff/source/draw/shapeexport.cxx4
-rw-r--r--xmloff/source/draw/shapeimport.cxx11
-rw-r--r--xmloff/source/draw/ximp3dobject.cxx18
-rw-r--r--xmloff/source/draw/ximp3dscene.cxx32
-rw-r--r--xmloff/source/draw/ximppage.cxx29
-rw-r--r--xmloff/source/draw/ximpshap.cxx130
-rw-r--r--xmloff/source/draw/ximpshow.cxx15
-rw-r--r--xmloff/source/meta/MetaExportComponent.cxx4
-rw-r--r--xmloff/source/script/XMLEventsImportContext.cxx5
-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
-rw-r--r--xmloff/source/text/XMLCalculationSettingsContext.cxx4
-rw-r--r--xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx12
-rw-r--r--xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx3
-rw-r--r--xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx34
-rw-r--r--xmloff/source/text/XMLIndexBibliographyEntryContext.cxx4
-rw-r--r--xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx8
-rw-r--r--xmloff/source/text/XMLIndexSimpleEntryContext.cxx3
-rw-r--r--xmloff/source/text/XMLIndexTOCContext.cxx3
-rw-r--r--xmloff/source/text/XMLIndexTOCSourceContext.cxx3
-rw-r--r--xmloff/source/text/XMLIndexTOCStylesContext.cxx3
-rw-r--r--xmloff/source/text/XMLIndexTableSourceContext.cxx6
-rw-r--r--xmloff/source/text/XMLIndexTemplateContext.cxx6
-rw-r--r--xmloff/source/text/XMLIndexUserSourceContext.cxx3
-rw-r--r--xmloff/source/text/XMLLineNumberingImportContext.cxx20
-rw-r--r--xmloff/source/text/XMLPropertyBackpatcher.cxx4
-rw-r--r--xmloff/source/text/XMLSectionFootnoteConfigImport.cxx22
-rw-r--r--xmloff/source/text/XMLSectionImportContext.cxx7
-rw-r--r--xmloff/source/text/XMLSectionSourceImportContext.cxx7
-rw-r--r--xmloff/source/text/XMLTextColumnsContext.cxx18
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx73
-rw-r--r--xmloff/source/text/XMLTextMasterPageContext.cxx6
-rw-r--r--xmloff/source/text/XMLTextShapeImportHelper.cxx10
-rw-r--r--xmloff/source/text/txtfldi.cxx300
-rw-r--r--xmloff/source/text/txtparai.cxx20
-rw-r--r--xmloff/source/text/txtstyli.cxx24
-rw-r--r--xmloff/source/text/txtvfldi.cxx58
51 files changed, 321 insertions, 812 deletions
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index fa953f59dbc8..bd842f97f946 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -687,9 +687,7 @@ void SchXMLChartContext::EndElement()
{
try
{
- uno::Any aAny;
- aAny <<= maMainTitle;
- xTitleProp->setPropertyValue("String", aAny );
+ xTitleProp->setPropertyValue("String", uno::Any(maMainTitle) );
}
catch(const beans::UnknownPropertyException&)
{
@@ -704,9 +702,7 @@ void SchXMLChartContext::EndElement()
{
try
{
- uno::Any aAny;
- aAny <<= maSubTitle;
- xTitleProp->setPropertyValue("String", aAny );
+ xTitleProp->setPropertyValue("String", uno::Any(maSubTitle) );
}
catch(const beans::UnknownPropertyException&)
{
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index a21f7a5f8c06..1a7e387f2c36 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -204,10 +204,8 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext(
xProp->setPropertyValue("HasZAxis", aFalseBool );
xProp->setPropertyValue("HasZAxisDescription", aFalseBool );
- uno::Any aAny;
chart::ChartDataRowSource eSource = chart::ChartDataRowSource_COLUMNS;
- aAny <<= eSource;
- xProp->setPropertyValue("DataRowSource", aAny );
+ xProp->setPropertyValue("DataRowSource", uno::Any(eSource) );
}
catch( const beans::UnknownPropertyException & )
{
@@ -282,12 +280,8 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri
{
try
{
- uno::Any aAny;
- aAny <<= mrColHasLabels;
- xDocProp->setPropertyValue("DataSourceLabelsInFirstColumn", aAny );
-
- aAny <<= mrRowHasLabels;
- xDocProp->setPropertyValue("DataSourceLabelsInFirstRow", aAny );
+ xDocProp->setPropertyValue("DataSourceLabelsInFirstColumn", uno::Any(mrColHasLabels) );
+ xDocProp->setPropertyValue("DataSourceLabelsInFirstRow", uno::Any(mrRowHasLabels) );
}
catch( const beans::UnknownPropertyException & )
{
diff --git a/xmloff/source/chart/XMLChartStyleContext.cxx b/xmloff/source/chart/XMLChartStyleContext.cxx
index d3421909be04..a3fc7a829948 100644
--- a/xmloff/source/chart/XMLChartStyleContext.cxx
+++ b/xmloff/source/chart/XMLChartStyleContext.cxx
@@ -82,10 +82,8 @@ void lcl_NumberFormatStyleToProperty( const OUString& rStyleName, const OUString
XML_STYLE_FAMILY_DATA_STYLE, rStyleName, true ));
if( pStyle )
{
- uno::Any aNumberFormat;
sal_Int32 nNumberFormat = const_cast<SvXMLNumFormatContext*>(pStyle)->GetKey();
- aNumberFormat <<= nNumberFormat;
- rPropSet->setPropertyValue( rPropertyName, aNumberFormat );
+ rPropSet->setPropertyValue( rPropertyName, uno::Any(nNumberFormat) );
}
}
}
diff --git a/xmloff/source/core/unoatrcn.cxx b/xmloff/source/core/unoatrcn.cxx
index b196291cc725..9faa6e00d019 100644
--- a/xmloff/source/core/unoatrcn.cxx
+++ b/xmloff/source/core/unoatrcn.cxx
@@ -126,9 +126,7 @@ uno::Any SAL_CALL SvUnoAttributeContainer::getByName(const OUString& aName)
aData.Type = "CDATA";
aData.Value = mpContainer->GetAttrValue(nAttr);
- uno::Any aAny;
- aAny <<= aData;
- return aAny;
+ return uno::Any(aData);
}
uno::Sequence< OUString > SAL_CALL SvUnoAttributeContainer::getElementNames() throw( uno::RuntimeException, std::exception )
diff --git a/xmloff/source/core/xmlerror.cxx b/xmloff/source/core/xmlerror.cxx
index eebd4ba91746..fbdcc941e399 100644
--- a/xmloff/source/core/xmlerror.cxx
+++ b/xmloff/source/core/xmlerror.cxx
@@ -210,10 +210,8 @@ void XMLErrors::ThrowErrorAsSAXException(sal_Int32 nIdMask)
{
// we throw the error
ErrorRecord& rErr = aErrors[0];
- Any aAny;
- aAny <<= rErr.aParams;
throw SAXParseException(
- rErr.sExceptionMessage, nullptr, aAny,
+ rErr.sExceptionMessage, nullptr, Any(rErr.aParams),
rErr.sPublicId, rErr.sSystemId, rErr.nRow, rErr.nColumn );
}
}
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 4eb3bbffd12b..1bf31e70dbbc 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -559,11 +559,8 @@ SvXMLExport::~SvXMLExport()
{
sal_Int32 nProgressMax(mpProgressBarHelper->GetReference());
sal_Int32 nProgressCurrent(mpProgressBarHelper->GetValue());
- uno::Any aAny;
- aAny <<= nProgressMax;
- mxExportInfo->setPropertyValue(sProgressMax, aAny);
- aAny <<= nProgressCurrent;
- mxExportInfo->setPropertyValue(sProgressCurrent, aAny);
+ mxExportInfo->setPropertyValue(sProgressMax, uno::Any(nProgressMax));
+ mxExportInfo->setPropertyValue(sProgressCurrent, uno::Any(nProgressCurrent));
}
if (xPropertySetInfo->hasPropertyByName(sRepeat))
mxExportInfo->setPropertyValue(sRepeat, css::uno::makeAny(mpProgressBarHelper->GetRepeat()));
@@ -575,9 +572,7 @@ SvXMLExport::~SvXMLExport()
{
uno::Sequence<sal_Int32> aWasUsed;
mpNumExport->GetWasUsed(aWasUsed);
- uno::Any aAny;
- aAny <<= aWasUsed;
- mxExportInfo->setPropertyValue(sWrittenNumberFormats, aAny);
+ mxExportInfo->setPropertyValue(sWrittenNumberFormats, Any(aWasUsed));
}
}
}
@@ -1363,9 +1358,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
::comphelper::GenericPropertySet_CreateInstance(
new ::comphelper::PropertySetInfo( aInfoMap ) ) );
- Any aAny;
- aAny <<= GetXMLToken( eClass );
- xConvPropSet->setPropertyValue( "Class", aAny );
+ xConvPropSet->setPropertyValue( "Class", Any(GetXMLToken( eClass )) );
Reference< XPropertySet > xPropSet =
mxExportInfo.is()
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 2b8c995589cf..ce1bd27c3407 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -577,11 +577,8 @@ void SAL_CALL SvXMLImport::endDocument()
{
sal_Int32 nProgressMax(mpProgressBarHelper->GetReference());
sal_Int32 nProgressCurrent(mpProgressBarHelper->GetValue());
- uno::Any aAny;
- aAny <<= nProgressMax;
- mxImportInfo->setPropertyValue(sProgressMax, aAny);
- aAny <<= nProgressCurrent;
- mxImportInfo->setPropertyValue(sProgressCurrent, aAny);
+ mxImportInfo->setPropertyValue(sProgressMax, uno::Any(nProgressMax));
+ mxImportInfo->setPropertyValue(sProgressCurrent, uno::Any(nProgressCurrent));
}
if (xPropertySetInfo->hasPropertyByName(sRepeat))
mxImportInfo->setPropertyValue(sRepeat, css::uno::makeAny(mpProgressBarHelper->GetRepeat()));
@@ -590,9 +587,7 @@ void SAL_CALL SvXMLImport::endDocument()
OUString sNumberStyles(XML_NUMBERSTYLES);
if (mxNumberStyles.is() && xPropertySetInfo->hasPropertyByName(sNumberStyles))
{
- uno::Any aAny;
- aAny <<= mxNumberStyles;
- mxImportInfo->setPropertyValue(sNumberStyles, aAny);
+ mxImportInfo->setPropertyValue(sNumberStyles, Any(mxNumberStyles));
}
}
}
@@ -1427,9 +1422,7 @@ void SvXMLImport::AddStyleDisplayName( sal_uInt16 nFamily,
{
Reference < XInterface > xIfc(
static_cast< XUnoTunnel *>( mpStyleMap ) );
- Any aAny;
- aAny <<= xIfc;
- mxImportInfo->setPropertyValue( sPrivateData, aAny );
+ mxImportInfo->setPropertyValue( sPrivateData, Any(xIfc) );
}
}
}
@@ -1525,11 +1518,9 @@ void SvXMLImport::AddNumberStyle(sal_Int32 nKey, const OUString& rName)
mxNumberStyles.set( comphelper::NameContainer_createInstance( ::cppu::UnoType<sal_Int32>::get()) );
if (mxNumberStyles.is())
{
- uno::Any aAny;
- aAny <<= nKey;
try
{
- mxNumberStyles->insertByName(rName, aAny);
+ mxNumberStyles->insertByName(rName, Any(nKey));
}
catch ( uno::Exception& )
{
diff --git a/xmloff/source/draw/XMLImageMapContext.cxx b/xmloff/source/draw/XMLImageMapContext.cxx
index 55f94824b9be..cb19429a244f 100644
--- a/xmloff/source/draw/XMLImageMapContext.cxx
+++ b/xmloff/source/draw/XMLImageMapContext.cxx
@@ -25,7 +25,6 @@
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/drawing/PointSequenceSequence.hpp>
#include <com/sun/star/document/XEventsSupplier.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <xmloff/xmltoken.hxx>
@@ -54,7 +53,6 @@ using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::xml::sax::XAttributeList;
using ::com::sun::star::uno::XInterface;
using ::com::sun::star::uno::Any;
-using ::com::sun::star::drawing::PointSequenceSequence;
using ::com::sun::star::document::XEventsSupplier;
@@ -128,21 +126,18 @@ public:
SvXMLImport& rImport,
sal_uInt16 nPrefix,
const OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XIndexContainer> xMap,
+ css::uno::Reference<css::container::XIndexContainer> const & xMap,
const sal_Char* pServiceName);
void StartElement(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList >& xAttrList ) override;
+ const css::uno::Reference<css::xml::sax::XAttributeList >& xAttrList ) override;
void EndElement() override;
SvXMLImportContext *CreateChildContext(
sal_uInt16 nPrefix,
const OUString& rLocalName,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::xml::sax::XAttributeList> & xAttrList ) override;
+ const css::uno::Reference<css::xml::sax::XAttributeList> & xAttrList ) override;
protected:
@@ -151,8 +146,7 @@ protected:
const OUString& rValue);
virtual void Prepare(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropertySet);
+ css::uno::Reference<css::beans::XPropertySet> & rPropertySet);
};
@@ -160,7 +154,7 @@ XMLImageMapObjectContext::XMLImageMapObjectContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
const OUString& rLocalName,
- Reference<XIndexContainer> xMap,
+ Reference<XIndexContainer> const & xMap,
const sal_Char* pServiceName) :
SvXMLImportContext(rImport, nPrefix, rLocalName),
sBoundary("Boundary"),
@@ -226,9 +220,7 @@ void XMLImageMapObjectContext::EndElement()
Prepare( xMapEntry );
// insert into image map
- Any aAny;
- aAny <<= xMapEntry;
- xImageMap->insertByIndex( xImageMap->getCount(), aAny );
+ xImageMap->insertByIndex( xImageMap->getCount(), Any(xMapEntry) );
}
// else: not valid -> don't create and insert
}
@@ -317,8 +309,7 @@ public:
SvXMLImport& rImport,
sal_uInt16 nPrefix,
const OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XIndexContainer> xMap);
+ css::uno::Reference<css::container::XIndexContainer> const & xMap);
virtual ~XMLImageMapRectangleContext();
@@ -328,8 +319,7 @@ protected:
const OUString& rValue) override;
virtual void Prepare(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropertySet) override;
+ css::uno::Reference<css::beans::XPropertySet> & rPropertySet) override;
};
@@ -337,7 +327,7 @@ XMLImageMapRectangleContext::XMLImageMapRectangleContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
const OUString& rLocalName,
- Reference<XIndexContainer> xMap) :
+ Reference<XIndexContainer> const & xMap) :
XMLImageMapObjectContext(rImport, nPrefix, rLocalName, xMap,
"com.sun.star.image.ImageMapRectangleObject"),
bXOK(false),
@@ -400,9 +390,7 @@ void XMLImageMapRectangleContext::ProcessAttribute(
void XMLImageMapRectangleContext::Prepare(
Reference<XPropertySet> & rPropertySet)
{
- Any aAny;
- aAny <<= aRectangle;
- rPropertySet->setPropertyValue( sBoundary, aAny );
+ rPropertySet->setPropertyValue( sBoundary, uno::Any(aRectangle) );
// common properties handled by super class
XMLImageMapObjectContext::Prepare(rPropertySet);
@@ -423,8 +411,7 @@ public:
SvXMLImport& rImport,
sal_uInt16 nPrefix,
const OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XIndexContainer> xMap);
+ css::uno::Reference<css::container::XIndexContainer> const & xMap);
virtual ~XMLImageMapPolygonContext();
@@ -434,8 +421,7 @@ protected:
const OUString& rValue) override;
virtual void Prepare(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropertySet) override;
+ css::uno::Reference<css::beans::XPropertySet> & rPropertySet) override;
};
@@ -443,7 +429,7 @@ XMLImageMapPolygonContext::XMLImageMapPolygonContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
const OUString& rLocalName,
- Reference<XIndexContainer> xMap) :
+ Reference<XIndexContainer> const & xMap) :
XMLImageMapObjectContext(rImport, nPrefix, rLocalName, xMap,
"com.sun.star.image.ImageMapPolygonObject"),
bViewBoxOK(false),
@@ -493,8 +479,7 @@ void XMLImageMapPolygonContext::Prepare(Reference<XPropertySet> & rPropertySet)
uno::Any aAny;
basegfx::tools::B2DPolygonToUnoPointSequence(aPolygon, aPointSequence);
- aAny <<= aPointSequence;
- rPropertySet->setPropertyValue(sPolygon, aAny);
+ rPropertySet->setPropertyValue(sPolygon, Any(aPointSequence));
}
}
@@ -517,8 +502,7 @@ public:
SvXMLImport& rImport,
sal_uInt16 nPrefix,
const OUString& rLocalName,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::container::XIndexContainer> xMap);
+ css::uno::Reference<css::container::XIndexContainer> const & xMap);
virtual ~XMLImageMapCircleContext();
@@ -528,8 +512,7 @@ protected:
const OUString& rValue) override;
virtual void Prepare(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet> & rPropertySet) override;
+ css::uno::Reference<css::beans::XPropertySet> & rPropertySet) override;
};
@@ -537,7 +520,7 @@ XMLImageMapCircleContext::XMLImageMapCircleContext(
SvXMLImport& rImport,
sal_uInt16 nPrefix,
const OUString& rLocalName,
- Reference<XIndexContainer> xMap)
+ Reference<XIndexContainer> const & xMap)
: XMLImageMapObjectContext(rImport, nPrefix, rLocalName, xMap,
"com.sun.star.image.ImageMapCircleObject")
, nRadius(0)
@@ -593,13 +576,9 @@ void XMLImageMapCircleContext::Prepare(
Reference<XPropertySet> & rPropertySet)
{
// center (x,y)
- Any aAny;
- aAny <<= aCenter;
- rPropertySet->setPropertyValue( sCenter, aAny );
-
+ rPropertySet->setPropertyValue( sCenter, uno::Any(aCenter) );
// radius
- aAny <<= nRadius;
- rPropertySet->setPropertyValue( sRadius, aAny );
+ rPropertySet->setPropertyValue( sRadius, uno::Any(nRadius) );
// common properties handled by super class
XMLImageMapObjectContext::Prepare(rPropertySet);
diff --git a/xmloff/source/draw/XMLShapePropertySetContext.cxx b/xmloff/source/draw/XMLShapePropertySetContext.cxx
index 0b48378f1331..477aff269c24 100644
--- a/xmloff/source/draw/XMLShapePropertySetContext.cxx
+++ b/xmloff/source/draw/XMLShapePropertySetContext.cxx
@@ -57,10 +57,7 @@ void XMLShapePropertySetContext::EndElement()
pBulletStyle->FillUnoNumRule(xNumRule);
}
- Any aAny;
- aAny <<= xNumRule;
-
- XMLPropertyState aPropState( mnBulletIndex, aAny );
+ XMLPropertyState aPropState( mnBulletIndex, Any(xNumRule) );
mrProperties.push_back( aPropState );
SvXMLPropertySetContext::EndElement();
diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx
index 1aae82c862fd..9e4818f5aa0e 100644
--- a/xmloff/source/draw/animimp.cxx
+++ b/xmloff/source/draw/animimp.cxx
@@ -550,7 +550,6 @@ void XMLAnimationsEffectContext::EndElement()
try
{
rtl::Reference< XMLShapeImportHelper > xShapeImport( GetImport().GetShapeImport() );
- Any aAny;
if( !maShapeId.isEmpty() )
{
@@ -580,16 +579,13 @@ void XMLAnimationsEffectContext::EndElement()
{
if( meKind == XMLE_DIM )
{
- aAny <<= true;
- xSet->setPropertyValue( mpImpl->msDimPrev, aAny );
+ xSet->setPropertyValue( mpImpl->msDimPrev, Any(true) );
- aAny <<= maDimColor;
- xSet->setPropertyValue( mpImpl->msDimColor, aAny );
+ xSet->setPropertyValue( mpImpl->msDimColor, Any(maDimColor) );
}
else if( meKind == XMLE_PLAY )
{
- aAny <<= true;
- xSet->setPropertyValue( mpImpl->msIsAnimation, aAny );
+ xSet->setPropertyValue( mpImpl->msIsAnimation, Any(true) );
// #i42894# speed is not supported for the old group animation fallback, so no need to set it
// aAny <<= meSpeed;
@@ -599,8 +595,7 @@ void XMLAnimationsEffectContext::EndElement()
{
if( meKind == XMLE_HIDE && !mbTextEffect && meEffect == EK_none )
{
- aAny <<= true;
- xSet->setPropertyValue( mpImpl->msDimHide, aAny );
+ xSet->setPropertyValue( mpImpl->msDimHide, Any(true) );
}
else
{
@@ -622,14 +617,9 @@ void XMLAnimationsEffectContext::EndElement()
{
if( xSet.is() )
{
- aAny <<= maSoundURL;
- xSet->setPropertyValue( mpImpl->msSound, aAny );
-
- aAny <<= mbPlayFull;
- xSet->setPropertyValue( mpImpl->msPlayFull, aAny );
-
- aAny <<= true;
- xSet->setPropertyValue( mpImpl->msSoundOn, aAny );
+ xSet->setPropertyValue( mpImpl->msSound, Any(maSoundURL) );
+ xSet->setPropertyValue( mpImpl->msPlayFull, Any(mbPlayFull) );
+ xSet->setPropertyValue( mpImpl->msSoundOn, Any(true) );
}
else
{
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index a614e6767c6c..319b9b109220 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -2156,12 +2156,9 @@ void SdXMLExport::_ExportStyles(bool bUsed)
{
Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
- Any aAny;
-
if( xInfoSetInfo->hasPropertyByName( msPageLayoutNames ) )
{
- aAny <<= maDrawPagesAutoLayoutNames;
- xInfoSet->setPropertyValue( msPageLayoutNames, aAny );
+ xInfoSet->setPropertyValue( msPageLayoutNames, Any(maDrawPagesAutoLayoutNames) );
}
}
}
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 9dbba4f3ac8d..2413c5c77a9b 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -2314,9 +2314,7 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
aStreamURL = aStreamURL.concat( aStr );
}
- uno::Any aAny;
- aAny <<= aStreamURL;
- xPropSet->setPropertyValue( "GraphicStreamURL", aAny );
+ xPropSet->setPropertyValue( "GraphicStreamURL", uno::Any(aStreamURL) );
}
mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index 2000a4c925dd..f13864986e79 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -796,8 +796,7 @@ void ShapeSortContext::moveShape( sal_Int32 nSourcePos, sal_Int32 nDestPos )
if( xPropSet.is() && xPropSet->getPropertySetInfo()->hasPropertyByName( "ZOrder" ) )
{
- aAny <<= nDestPos;
- xPropSet->setPropertyValue( "ZOrder", aAny );
+ xPropSet->setPropertyValue( "ZOrder", uno::Any(nDestPos) );
for( ZOrderHint& rHint : maZOrderList )
{
@@ -950,8 +949,6 @@ void XMLShapeImportHelper::restoreConnections()
{
if( !mpImpl->maConnections.empty() )
{
- uno::Any aAny;
-
const vector<ConnectionHint>::size_type nCount = mpImpl->maConnections.size();
for( vector<ConnectionHint>::size_type i = 0; i < nCount; i++ )
{
@@ -977,12 +974,10 @@ void XMLShapeImportHelper::restoreConnections()
mrImporter.getInterfaceToIdentifierMapper().getReference( rHint.aDestShapeId ), uno::UNO_QUERY );
if( xShape.is() )
{
- aAny <<= xShape;
- xConnector->setPropertyValue( rHint.bStart ? msStartShape : msEndShape, aAny );
+ xConnector->setPropertyValue( rHint.bStart ? msStartShape : msEndShape, uno::Any(xShape) );
sal_Int32 nGlueId = rHint.nDestGlueId < 4 ? rHint.nDestGlueId : getGluePointId( xShape, rHint.nDestGlueId );
- aAny <<= nGlueId;
- xConnector->setPropertyValue( rHint.bStart ? msStartGluePointIndex : msEndGluePointIndex, aAny );
+ xConnector->setPropertyValue( rHint.bStart ? msStartGluePointIndex : msEndGluePointIndex, uno::Any(nGlueId) );
}
// #86637# restore line deltas
diff --git a/xmloff/source/draw/ximp3dobject.cxx b/xmloff/source/draw/ximp3dobject.cxx
index 105b29004d96..7c5ff8b82423 100644
--- a/xmloff/source/draw/ximp3dobject.cxx
+++ b/xmloff/source/draw/ximp3dobject.cxx
@@ -88,9 +88,7 @@ void SdXML3DObjectContext::StartElement(const uno::Reference< xml::sax::XAttribu
// set parameters
if(mbSetTransform)
{
- uno::Any aAny;
- aAny <<= mxHomMat;
- xPropSet->setPropertyValue("D3DTransformMatrix", aAny);
+ xPropSet->setPropertyValue("D3DTransformMatrix", uno::Any(mxHomMat));
}
// call parent
@@ -190,11 +188,8 @@ void SdXML3DCubeObjectShapeContext::StartElement(const uno::Reference< xml::sax:
aDirection3D.DirectionY = maMaxEdge.getY();
aDirection3D.DirectionZ = maMaxEdge.getZ();
- uno::Any aAny;
- aAny <<= aPosition3D;
- xPropSet->setPropertyValue("D3DPosition", aAny);
- aAny <<= aDirection3D;
- xPropSet->setPropertyValue("D3DSize", aAny);
+ xPropSet->setPropertyValue("D3DPosition", uno::Any(aPosition3D));
+ xPropSet->setPropertyValue("D3DSize", uno::Any(aDirection3D));
}
}
}
@@ -288,11 +283,8 @@ void SdXML3DSphereObjectShapeContext::StartElement(const uno::Reference< xml::sa
aDirection3D.DirectionY = maSize.getY();
aDirection3D.DirectionZ = maSize.getZ();
- uno::Any aAny;
- aAny <<= aPosition3D;
- xPropSet->setPropertyValue("D3DPosition", aAny);
- aAny <<= aDirection3D;
- xPropSet->setPropertyValue("D3DSize", aAny);
+ xPropSet->setPropertyValue("D3DPosition", uno::Any(aPosition3D));
+ xPropSet->setPropertyValue("D3DSize", uno::Any(aDirection3D));
}
}
}
diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx
index 971fda1607fc..afa7658b6c8f 100644
--- a/xmloff/source/draw/ximp3dscene.cxx
+++ b/xmloff/source/draw/ximp3dscene.cxx
@@ -352,33 +352,21 @@ void SdXML3DSceneAttributesHelper::setSceneAttributes( const com::sun::star::uno
// world transformation
if(mbSetTransform)
{
- aAny <<= mxHomMat;
- xPropSet->setPropertyValue("D3DTransformMatrix", aAny);
+ xPropSet->setPropertyValue("D3DTransformMatrix", uno::Any(mxHomMat));
}
// distance
- aAny <<= mnDistance;
- xPropSet->setPropertyValue("D3DSceneDistance", aAny);
-
+ xPropSet->setPropertyValue("D3DSceneDistance", uno::Any(mnDistance));
// focalLength
- aAny <<= mnFocalLength;
- xPropSet->setPropertyValue("D3DSceneFocalLength", aAny);
-
+ xPropSet->setPropertyValue("D3DSceneFocalLength", uno::Any(mnFocalLength));
// shadowSlant
- aAny <<= (sal_Int16)mnShadowSlant;
- xPropSet->setPropertyValue("D3DSceneShadowSlant", aAny);
-
+ xPropSet->setPropertyValue("D3DSceneShadowSlant", uno::Any((sal_Int16)mnShadowSlant));
// shadeMode
- aAny <<= mxShadeMode;
- xPropSet->setPropertyValue("D3DSceneShadeMode", aAny);
-
+ xPropSet->setPropertyValue("D3DSceneShadeMode", uno::Any(mxShadeMode));
// ambientColor
- aAny <<= maAmbientColor;
- xPropSet->setPropertyValue("D3DSceneAmbientColor", aAny);
-
+ xPropSet->setPropertyValue("D3DSceneAmbientColor", uno::Any(maAmbientColor));
// lightingMode
- aAny <<= mbLightingMode;
- xPropSet->setPropertyValue("D3DSceneTwoSidedLighting", aAny);
+ xPropSet->setPropertyValue("D3DSceneTwoSidedLighting", uno::Any(mbLightingMode));
if( !maList.empty() )
{
@@ -472,13 +460,11 @@ void SdXML3DSceneAttributesHelper::setSceneAttributes( const com::sun::star::uno
aCamGeo.vup.DirectionX = maVUP.getX();
aCamGeo.vup.DirectionY = maVUP.getY();
aCamGeo.vup.DirectionZ = maVUP.getZ();
- aAny <<= aCamGeo;
- xPropSet->setPropertyValue("D3DCameraGeometry", aAny);
+ xPropSet->setPropertyValue("D3DCameraGeometry", uno::Any(aCamGeo));
// #91047# set drawing::ProjectionMode AFTER camera geometry is set
// projection "D3DScenePerspective" drawing::ProjectionMode
- aAny <<= mxPrjMode;
- xPropSet->setPropertyValue("D3DScenePerspective", aAny);
+ xPropSet->setPropertyValue("D3DScenePerspective", uno::Any(mxPrjMode));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx
index 404fa163c20f..04a479165591 100644
--- a/xmloff/source/draw/ximppage.cxx
+++ b/xmloff/source/draw/ximppage.cxx
@@ -500,28 +500,13 @@ void SdXMLGenericPageContext::SetPageMaster( OUString& rsPageMasterName )
Reference <beans::XPropertySet> xPropSet(xMasterPage, uno::UNO_QUERY);
if(xPropSet.is())
{
- uno::Any aAny;
-
- aAny <<= pPageMasterContext->GetBorderBottom();
- xPropSet->setPropertyValue("BorderBottom", aAny);
-
- aAny <<= pPageMasterContext->GetBorderLeft();
- xPropSet->setPropertyValue("BorderLeft", aAny);
-
- aAny <<= pPageMasterContext->GetBorderRight();
- xPropSet->setPropertyValue("BorderRight", aAny);
-
- aAny <<= pPageMasterContext->GetBorderTop();
- xPropSet->setPropertyValue("BorderTop", aAny);
-
- aAny <<= pPageMasterContext->GetWidth();
- xPropSet->setPropertyValue("Width", aAny);
-
- aAny <<= pPageMasterContext->GetHeight();
- xPropSet->setPropertyValue("Height", aAny);
-
- aAny <<= pPageMasterContext->GetOrientation();
- xPropSet->setPropertyValue("Orientation", aAny);
+ xPropSet->setPropertyValue("BorderBottom", Any(pPageMasterContext->GetBorderBottom()));
+ xPropSet->setPropertyValue("BorderLeft", Any(pPageMasterContext->GetBorderLeft()));
+ xPropSet->setPropertyValue("BorderRight", Any(pPageMasterContext->GetBorderRight()));
+ xPropSet->setPropertyValue("BorderTop", Any(pPageMasterContext->GetBorderTop()));
+ xPropSet->setPropertyValue("Width", Any(pPageMasterContext->GetWidth()));
+ xPropSet->setPropertyValue("Height", Any(pPageMasterContext->GetHeight()));
+ xPropSet->setPropertyValue("Orientation", Any(pPageMasterContext->GetOrientation()));
}
}
}
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 5383b321651c..a66f068fe998 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -570,7 +570,6 @@ void SdXMLShapeContext::SetTransformation()
}
// now set transformation for this object
- uno::Any aAny;
drawing::HomogenMatrix3 aMatrix;
aMatrix.Line1.Column1 = maUsedTransformation.get(0, 0);
@@ -585,9 +584,7 @@ void SdXMLShapeContext::SetTransformation()
aMatrix.Line3.Column2 = maUsedTransformation.get(2, 1);
aMatrix.Line3.Column3 = maUsedTransformation.get(2, 2);
- aAny <<= aMatrix;
-
- xPropSet->setPropertyValue("Transformation", aAny);
+ xPropSet->setPropertyValue("Transformation", Any(aMatrix));
}
}
}
@@ -691,9 +688,7 @@ void SdXMLShapeContext::SetStyle( bool bSupportsStyle /* = true */)
try
{
// set style on object
- uno::Any aAny;
- aAny <<= xStyle;
- xPropSet->setPropertyValue("Style", aAny);
+ xPropSet->setPropertyValue("Style", Any(xStyle));
}
catch(const uno::Exception&)
{
@@ -749,10 +744,7 @@ void SdXMLShapeContext::SetLayer()
uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
if(xPropSet.is() )
{
- uno::Any aAny;
- aAny <<= maLayerName;
-
- xPropSet->setPropertyValue("LayerName", aAny);
+ xPropSet->setPropertyValue("LayerName", Any(maLayerName));
return;
}
}
@@ -1163,14 +1155,12 @@ void SdXMLLineShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib
drawing::PointSequence* pOuterSequence = aPolyPoly.getArray();
pOuterSequence->realloc(2L);
awt::Point* pInnerSequence = pOuterSequence->getArray();
- uno::Any aAny;
*pInnerSequence = awt::Point( mnX1 - aTopLeft.X, mnY1 - aTopLeft.Y);
pInnerSequence++;
*pInnerSequence = awt::Point( mnX2 - aTopLeft.X, mnY2 - aTopLeft.Y);
- aAny <<= aPolyPoly;
- xPropSet->setPropertyValue("Geometry", aAny);
+ xPropSet->setPropertyValue("Geometry", Any(aPolyPoly));
}
// set sizes for transformation
@@ -1304,15 +1294,9 @@ void SdXMLEllipseShapeContext::StartElement(const uno::Reference< xml::sax::XAtt
uno::Reference< beans::XPropertySet > xPropSet( mxShape, uno::UNO_QUERY );
if( xPropSet.is() )
{
- uno::Any aAny;
- aAny <<= (drawing::CircleKind)meKind;
- xPropSet->setPropertyValue("CircleKind", aAny );
-
- aAny <<= mnStartAngle;
- xPropSet->setPropertyValue("CircleStartAngle", aAny );
-
- aAny <<= mnEndAngle;
- xPropSet->setPropertyValue("CircleEndAngle", aAny );
+ xPropSet->setPropertyValue("CircleKind", Any( (drawing::CircleKind)meKind) );
+ xPropSet->setPropertyValue("CircleStartAngle", Any(mnStartAngle) );
+ xPropSet->setPropertyValue("CircleEndAngle", Any(mnEndAngle) );
}
}
@@ -1411,11 +1395,9 @@ void SdXMLPolygonShapeContext::StartElement(const uno::Reference< xml::sax::XAtt
}
com::sun::star::drawing::PointSequenceSequence aPointSequenceSequence;
- uno::Any aAny;
basegfx::tools::B2DPolyPolygonToUnoPointSequenceSequence(basegfx::B2DPolyPolygon(aPolygon), aPointSequenceSequence);
- aAny <<= aPointSequenceSequence;
- xPropSet->setPropertyValue("Geometry", aAny);
+ xPropSet->setPropertyValue("Geometry", Any(aPointSequenceSequence));
}
}
}
@@ -2041,24 +2023,12 @@ void SdXMLConnectorShapeContext::StartElement(const uno::Reference< xml::sax::XA
uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
if( xProps.is() )
{
- uno::Any aAny;
- aAny <<= maStart;
- xProps->setPropertyValue("StartPosition", aAny);
-
- aAny <<= maEnd;
- xProps->setPropertyValue("EndPosition", aAny );
-
- aAny <<= (drawing::ConnectorType)mnType;
- xProps->setPropertyValue("EdgeKind", aAny );
-
- aAny <<= mnDelta1;
- xProps->setPropertyValue("EdgeLine1Delta", aAny );
-
- aAny <<= mnDelta2;
- xProps->setPropertyValue("EdgeLine2Delta", aAny );
-
- aAny <<= mnDelta3;
- xProps->setPropertyValue("EdgeLine3Delta", aAny );
+ xProps->setPropertyValue("StartPosition", Any(maStart));
+ xProps->setPropertyValue("EndPosition", Any(maEnd) );
+ xProps->setPropertyValue("EdgeKind", Any((drawing::ConnectorType)mnType) );
+ xProps->setPropertyValue("EdgeLine1Delta", Any(mnDelta1) );
+ xProps->setPropertyValue("EdgeLine2Delta", Any(mnDelta2) );
+ xProps->setPropertyValue("EdgeLine3Delta", Any(mnDelta3) );
}
SetStyle();
SetLayer();
@@ -2167,12 +2137,8 @@ void SdXMLMeasureShapeContext::StartElement(const uno::Reference< xml::sax::XAtt
uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
if( xProps.is() )
{
- uno::Any aAny;
- aAny <<= maStart;
- xProps->setPropertyValue("StartPosition", aAny);
-
- aAny <<= maEnd;
- xProps->setPropertyValue("EndPosition", aAny );
+ xProps->setPropertyValue("StartPosition", Any(maStart));
+ xProps->setPropertyValue("EndPosition", Any(maEnd) );
}
// delete pre created fields
@@ -2607,8 +2573,7 @@ void SdXMLChartShapeContext::StartElement(const uno::Reference< xml::sax::XAttri
const OUString aCLSID( "12DCAE26-281F-416F-a234-c3086127382e");
- aAny <<= aCLSID;
- xProps->setPropertyValue("CLSID", aAny );
+ xProps->setPropertyValue("CLSID", Any(aCLSID) );
aAny = xProps->getPropertyValue("Model");
uno::Reference< frame::XModel > xChartModel;
@@ -2946,49 +2911,40 @@ void SdXMLAppletShapeContext::EndElement()
uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
if( xProps.is() )
{
- uno::Any aAny;
-
if ( maSize.Width && maSize.Height )
{
// the visual area for applet must be set on loading
awt::Rectangle aRect( 0, 0, maSize.Width, maSize.Height );
- aAny <<= aRect;
- xProps->setPropertyValue("VisibleArea", aAny );
+ xProps->setPropertyValue("VisibleArea", Any(aRect) );
}
if( maParams.getLength() )
{
- aAny <<= maParams;
- xProps->setPropertyValue("AppletCommands", aAny );
+ xProps->setPropertyValue("AppletCommands", Any(maParams) );
}
if( !maHref.isEmpty() )
{
- aAny <<= maHref;
- xProps->setPropertyValue("AppletCodeBase", aAny );
+ xProps->setPropertyValue("AppletCodeBase", Any(maHref) );
}
if( !maAppletName.isEmpty() )
{
- aAny <<= maAppletName;
- xProps->setPropertyValue("AppletName", aAny );
+ xProps->setPropertyValue("AppletName", Any(maAppletName) );
}
if( mbIsScript )
{
- aAny <<= mbIsScript;
- xProps->setPropertyValue("AppletIsScript", aAny );
+ xProps->setPropertyValue("AppletIsScript", Any(mbIsScript) );
}
if( !maAppletCode.isEmpty() )
{
- aAny <<= maAppletCode;
- xProps->setPropertyValue("AppletCode", aAny );
+ xProps->setPropertyValue("AppletCode", Any(maAppletCode) );
}
- aAny <<= OUString( GetImport().GetDocumentBase() );
- xProps->setPropertyValue("AppletDocBase", aAny );
+ xProps->setPropertyValue("AppletDocBase", Any(GetImport().GetDocumentBase()) );
SetThumbnail();
}
@@ -3168,8 +3124,6 @@ void SdXMLPluginShapeContext::EndElement()
if( xProps.is() )
{
- uno::Any aAny;
-
if ( maSize.Width && maSize.Height )
{
const OUString sVisibleArea( "VisibleArea" );
@@ -3178,8 +3132,7 @@ void SdXMLPluginShapeContext::EndElement()
{
// the visual area for a plugin must be set on loading
awt::Rectangle aRect( 0, 0, maSize.Width, maSize.Height );
- aAny <<= aRect;
- xProps->setPropertyValue( sVisibleArea, aAny );
+ xProps->setPropertyValue( sVisibleArea, Any(aRect) );
}
}
@@ -3188,20 +3141,17 @@ void SdXMLPluginShapeContext::EndElement()
// in case we have a plugin object
if( maParams.getLength() )
{
- aAny <<= maParams;
- xProps->setPropertyValue("PluginCommands", aAny );
+ xProps->setPropertyValue("PluginCommands", Any(maParams) );
}
if( !maMimeType.isEmpty() )
{
- aAny <<= maMimeType;
- xProps->setPropertyValue("PluginMimeType", aAny );
+ xProps->setPropertyValue("PluginMimeType", Any(maMimeType) );
}
if( !maHref.isEmpty() )
{
- aAny <<= maHref;
- xProps->setPropertyValue("PluginURL", aAny );
+ xProps->setPropertyValue("PluginURL", Any(maHref) );
}
}
else
@@ -3344,18 +3294,14 @@ void SdXMLFloatingFrameShapeContext::StartElement( const ::com::sun::star::uno::
uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
if( xProps.is() )
{
- uno::Any aAny;
-
if( !maFrameName.isEmpty() )
{
- aAny <<= maFrameName;
- xProps->setPropertyValue("FrameName", aAny );
+ xProps->setPropertyValue("FrameName", Any(maFrameName) );
}
if( !maHref.isEmpty() )
{
- aAny <<= maHref;
- xProps->setPropertyValue("FrameURL", aAny );
+ xProps->setPropertyValue("FrameURL", Any(maHref) );
}
}
@@ -3399,9 +3345,7 @@ void SdXMLFloatingFrameShapeContext::EndElement()
{
// the visual area for a floating frame must be set on loading
awt::Rectangle aRect( 0, 0, maSize.Width, maSize.Height );
- uno::Any aAny;
- aAny <<= aRect;
- xProps->setPropertyValue("VisibleArea", aAny );
+ xProps->setPropertyValue("VisibleArea", Any(aRect) );
}
}
@@ -3779,15 +3723,11 @@ void SdXMLCustomShapeContext::StartElement( const uno::Reference< xml::sax::XAtt
{
if ( !maCustomShapeEngine.isEmpty() )
{
- uno::Any aAny;
- aAny <<= maCustomShapeEngine;
- xPropSet->setPropertyValue( EASGet( EAS_CustomShapeEngine ), aAny );
+ xPropSet->setPropertyValue( EASGet( EAS_CustomShapeEngine ), Any(maCustomShapeEngine) );
}
if ( !maCustomShapeData.isEmpty() )
{
- uno::Any aAny;
- aAny <<= maCustomShapeData;
- xPropSet->setPropertyValue( EASGet( EAS_CustomShapeData ), aAny );
+ xPropSet->setPropertyValue( EASGet( EAS_CustomShapeData ), Any(maCustomShapeData) );
}
}
}
@@ -3871,9 +3811,7 @@ void SdXMLCustomShapeContext::EndElement()
uno::Reference< beans::XPropertySet > xPropSet( mxShape, uno::UNO_QUERY );
if( xPropSet.is() )
{
- uno::Any aAny;
- aAny <<= aSeq;
- xPropSet->setPropertyValue( sCustomShapeGeometry, aAny );
+ xPropSet->setPropertyValue( sCustomShapeGeometry, Any(aSeq) );
}
}
catch(const uno::Exception&)
diff --git a/xmloff/source/draw/ximpshow.cxx b/xmloff/source/draw/ximpshow.cxx
index 0b5efd5a7b0b..c24228673bb1 100644
--- a/xmloff/source/draw/ximpshow.cxx
+++ b/xmloff/source/draw/ximpshow.cxx
@@ -96,8 +96,7 @@ SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, sal_uInt16 nPrfx, c
case XML_NAMESPACE_PRESENTATION:
if( IsXMLToken( aLocalName, XML_START_PAGE ) )
{
- aAny <<= sValue;
- mpImpl->mxPresProps->setPropertyValue("FirstPage", aAny );
+ mpImpl->mxPresProps->setPropertyValue("FirstPage", Any(sValue) );
bAll = false;
}
else if( IsXMLToken( aLocalName, XML_SHOW ) )
@@ -113,8 +112,7 @@ SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, sal_uInt16 nPrfx, c
const sal_Int32 nMS = (aDuration.Hours * 60 +
aDuration.Minutes) * 60 + aDuration.Seconds;
- aAny <<= nMS;
- mpImpl->mxPresProps->setPropertyValue("Pause", aAny );
+ mpImpl->mxPresProps->setPropertyValue("Pause", Any(nMS) );
}
else if( IsXMLToken( aLocalName, XML_ANIMATIONS ) )
{
@@ -168,8 +166,7 @@ SdXMLShowsContext::SdXMLShowsContext( SdXMLImport& rImport, sal_uInt16 nPrfx, c
}
}
}
- aAny <<= bAll;
- mpImpl->mxPresProps->setPropertyValue("IsShowAll", aAny );
+ mpImpl->mxPresProps->setPropertyValue("IsShowAll", Any(bAll) );
}
}
@@ -220,7 +217,6 @@ SvXMLImportContext * SdXMLShowsContext::CreateChildContext( sal_uInt16 p_nPrefix
{
SvXMLTokenEnumerator aPageNames( aPages, ',' );
OUString sPageName;
- Any aAny;
while( aPageNames.getNextToken( sPageName ) )
{
@@ -231,13 +227,12 @@ SvXMLImportContext * SdXMLShowsContext::CreateChildContext( sal_uInt16 p_nPrefix
mpImpl->mxPages->getByName( sPageName ) >>= xPage;
if( xPage.is() )
{
- aAny <<= xPage;
- xShow->insertByIndex( xShow->getCount(), aAny );
+ xShow->insertByIndex( xShow->getCount(), Any(xPage) );
}
}
+ Any aAny;
aAny <<= xShow;
-
if( mpImpl->mxShows->hasByName( aName ) )
{
mpImpl->mxShows->replaceByName( aName, aAny );
diff --git a/xmloff/source/meta/MetaExportComponent.cxx b/xmloff/source/meta/MetaExportComponent.cxx
index 7b6481109f20..15f939947c53 100644
--- a/xmloff/source/meta/MetaExportComponent.cxx
+++ b/xmloff/source/meta/MetaExportComponent.cxx
@@ -90,9 +90,7 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum )
::comphelper::GenericPropertySet_CreateInstance(
new ::comphelper::PropertySetInfo( aInfoMap ) ) );
- uno::Any aAny;
- aAny <<= GetXMLToken( XML_TEXT );
- xConvPropSet->setPropertyValue("Class", aAny );
+ xConvPropSet->setPropertyValue("Class", uno::Any(GetXMLToken( XML_TEXT )) );
uno::Reference< beans::XPropertySet > xPropSet =
getExportInfo().is()
diff --git a/xmloff/source/script/XMLEventsImportContext.cxx b/xmloff/source/script/XMLEventsImportContext.cxx
index c0fc8209ab85..27547f5bed0b 100644
--- a/xmloff/source/script/XMLEventsImportContext.cxx
+++ b/xmloff/source/script/XMLEventsImportContext.cxx
@@ -191,12 +191,9 @@ void XMLEventsImportContext::AddEventValues(
// set event (if name is known)
if (xEvents->hasByName(rEventName))
{
- Any aAny;
- aAny <<= rValues;
-
try
{
- xEvents->replaceByName(rEventName, aAny);
+ xEvents->replaceByName(rEventName, Any(rValues));
} catch ( const IllegalArgumentException & rException )
{
Sequence<OUString> aMsgParams { rEventName };
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 44229af18de7..f7e4fd2b5eff 100644
--- a/xmloff/source/style/prstylei.cxx
+++ b/xmloff/source/style/prstylei.cxx
@@ -355,9 +355,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;
}
@@ -493,8 +491,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 e4e888020cf7..a34dea760cf9 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 067f07b83759..6b185562be37 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 4239164ac0bd..646683b5120e 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) );
}
}
}
@@ -1178,9 +1176,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;
}
@@ -1206,8 +1202,7 @@ void SvxXMLListStyleContext::CreateAndInsertLate( bool bOverwrite )
if( bOverwrite || bNew )
{
FillUnoNumRule(xNumRules);
- aAny <<= xNumRules;
- xPropSet->setPropertyValue( sNumberingRules, aAny );
+ xPropSet->setPropertyValue( sNumberingRules, Any(xNumRules) );
}
else
{
@@ -1294,9 +1289,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: */
diff --git a/xmloff/source/text/XMLCalculationSettingsContext.cxx b/xmloff/source/text/XMLCalculationSettingsContext.cxx
index c4fcd7f46840..ecb684dbfbb4 100644
--- a/xmloff/source/text/XMLCalculationSettingsContext.cxx
+++ b/xmloff/source/text/XMLCalculationSettingsContext.cxx
@@ -77,9 +77,7 @@ void XMLCalculationSettingsContext::EndElement()
{
Reference < XPropertySet > xPropSet ( xTextDoc, UNO_QUERY );
OUString sTwoDigitYear ( "TwoDigitYear" );
- Any aAny;
- aAny <<= nYear;
- xPropSet->setPropertyValue ( sTwoDigitYear, aAny );
+ xPropSet->setPropertyValue ( sTwoDigitYear, Any(nYear) );
}
}
}
diff --git a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx
index b2edb7c5175d..19b91e3ab4f2 100644
--- a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx
+++ b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx
@@ -385,11 +385,9 @@ void XMLFootnoteConfigurationImportContext::ProcessSettings(
rConfig->setPropertyValue(sPropertyParagraphStyleName, aAny);
}
- aAny <<= sPrefix;
- rConfig->setPropertyValue(sPropertyPrefix, aAny);
+ rConfig->setPropertyValue(sPropertyPrefix, Any(sPrefix));
- aAny <<= sSuffix;
- rConfig->setPropertyValue(sPropertySuffix, aAny);
+ rConfig->setPropertyValue(sPropertySuffix, Any(sSuffix));
sal_Int16 nNumType = NumberingType::ARABIC;
GetImport().GetMM100UnitConverter().convertNumFormat( nNumType, sNumFormat,
@@ -399,11 +397,9 @@ void XMLFootnoteConfigurationImportContext::ProcessSettings(
if( NumberingType::CHAR_SPECIAL == nNumType )
nNumType = NumberingType::ARABIC;
- aAny <<= nNumType;
- rConfig->setPropertyValue(sPropertyNumberingType, aAny);
+ rConfig->setPropertyValue(sPropertyNumberingType, Any(nNumType));
- aAny <<= nOffset;
- rConfig->setPropertyValue(sPropertyStartAt, aAny);
+ rConfig->setPropertyValue(sPropertyStartAt, Any(nOffset));
if (!bIsEndnote)
{
diff --git a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx
index 3e4344cc6765..3d94e6bf1e3c 100644
--- a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx
+++ b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx
@@ -226,8 +226,7 @@ void XMLIndexAlphabeticalSourceContext::EndElement()
if (!sAlgorithm.isEmpty())
{
- aAny <<= sAlgorithm;
- rIndexPropertySet->setPropertyValue(sSortAlgorithm, aAny);
+ rIndexPropertySet->setPropertyValue(sSortAlgorithm, css::uno::Any(sAlgorithm));
}
if ( !maLanguageTagODF.isEmpty() )
diff --git a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
index 19e15810f37c..23fb8da97c80 100644
--- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
+++ b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
@@ -157,13 +157,12 @@ SvXMLImportContext *XMLIndexBibliographyConfigurationContext::CreateChildContext
const OUString& rLocalName,
const Reference<XAttributeList> & xAttrList )
{
- OUString sKey;
- sal_Bool bSort(sal_True);
-
// process children here and use default context!
if ( ( nPrefix == XML_NAMESPACE_TEXT ) &&
IsXMLToken( rLocalName, XML_SORT_KEY ) )
{
+ OUString sKey;
+ bool bSort(true);
sal_Int16 nLength = xAttrList->getLength();
for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
{
@@ -195,20 +194,16 @@ SvXMLImportContext *XMLIndexBibliographyConfigurationContext::CreateChildContext
if (SvXMLUnitConverter::convertEnum(nKey, sKey,
aBibliographyDataFieldMap))
{
-
- Any aAny;
Sequence<PropertyValue> aKey(2);
PropertyValue aNameValue;
aNameValue.Name = sSortKey;
- aAny <<= (sal_Int16)nKey;
- aNameValue.Value = aAny;
+ aNameValue.Value = Any((sal_Int16)nKey);
aKey[0] = aNameValue;
PropertyValue aSortValue;
aSortValue.Name = sIsSortAscending;
- aAny.setValue(&bSort, cppu::UnoType<bool>::get());
- aSortValue.Value = aAny;
+ aSortValue.Value = Any(bSort);
aKey[1] = aSortValue;
aSortKeys.push_back(aKey);
@@ -251,17 +246,10 @@ void XMLIndexBibliographyConfigurationContext::CreateAndInsert(bool)
Reference<XPropertySet> xPropSet( xIfc, UNO_QUERY );
Any aAny;
- aAny <<= sSuffix;
- xPropSet->setPropertyValue(sBracketAfter, aAny);
-
- aAny <<= sPrefix;
- xPropSet->setPropertyValue(sBracketBefore, aAny);
-
- aAny.setValue(&bNumberedEntries, cppu::UnoType<bool>::get());
- xPropSet->setPropertyValue(sIsNumberEntries, aAny);
-
- aAny.setValue(&bSortByPosition, cppu::UnoType<bool>::get());
- xPropSet->setPropertyValue(sIsSortByPosition, aAny);
+ xPropSet->setPropertyValue(sBracketAfter, Any(sSuffix));
+ xPropSet->setPropertyValue(sBracketBefore, Any(sPrefix));
+ xPropSet->setPropertyValue(sIsNumberEntries, Any(bNumberedEntries));
+ xPropSet->setPropertyValue(sIsSortByPosition, Any(bSortByPosition));
if( !maLanguageTagODF.isEmpty() )
{
@@ -271,8 +259,7 @@ void XMLIndexBibliographyConfigurationContext::CreateAndInsert(bool)
if( !sAlgorithm.isEmpty() )
{
- aAny <<= sAlgorithm;
- xPropSet->setPropertyValue(sSortAlgorithm, aAny);
+ xPropSet->setPropertyValue(sSortAlgorithm, Any(sAlgorithm));
}
sal_Int32 nCount = aSortKeys.size();
@@ -281,8 +268,7 @@ void XMLIndexBibliographyConfigurationContext::CreateAndInsert(bool)
{
aKeysSeq[i] = aSortKeys[i];
}
- aAny <<= aKeysSeq;
- xPropSet->setPropertyValue(sSortKeys, aAny);
+ xPropSet->setPropertyValue(sSortKeys, Any(aKeysSeq));
}
// else: can't get FieldMaster -> ignore
}
diff --git a/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx b/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx
index f775857c77fe..73f78e49a35e 100644
--- a/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx
+++ b/xmloff/source/text/XMLIndexBibliographyEntryContext.cxx
@@ -157,9 +157,7 @@ void XMLIndexBibliographyEntryContext::FillPropertyValues(
// bibliography data field
sal_Int32 nIndex = bCharStyleNameOK ? 2 : 1;
rValues[nIndex].Name = rTemplateContext.sBibliographyDataField;
- Any aAny;
- aAny <<= nBibliographyInfo;
- rValues[nIndex].Value = aAny;
+ rValues[nIndex].Value = css::uno::Any(nBibliographyInfo);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx
index a61ffaad93a7..d360c889071c 100644
--- a/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx
+++ b/xmloff/source/text/XMLIndexChapterInfoEntryContext.cxx
@@ -179,17 +179,13 @@ void XMLIndexChapterInfoEntryContext::FillPropertyValues(
{
// chapter info field
rValues[nIndex].Name = rTemplateContext.sChapterFormat;
- Any aAny;
- aAny <<= nChapterInfo;
- rValues[nIndex].Value = aAny;
+ rValues[nIndex].Value = css::uno::Any(nChapterInfo);
nIndex++;
}
if( bOutlineLevelOK )
{
rValues[nIndex].Name = rTemplateContext.sChapterLevel;
- Any aAny;
- aAny <<= nOutlineLevel;
- rValues[nIndex].Value = aAny;
+ rValues[nIndex].Value = css::uno::Any(nOutlineLevel);
}
}
diff --git a/xmloff/source/text/XMLIndexSimpleEntryContext.cxx b/xmloff/source/text/XMLIndexSimpleEntryContext.cxx
index 3267404f54ba..99d030789311 100644
--- a/xmloff/source/text/XMLIndexSimpleEntryContext.cxx
+++ b/xmloff/source/text/XMLIndexSimpleEntryContext.cxx
@@ -110,8 +110,7 @@ void XMLIndexSimpleEntryContext::FillPropertyValues(
// token type
rValues[0].Name = rTemplateContext.sTokenType;
- aAny <<= rEntryType;
- rValues[0].Value = aAny;
+ rValues[0].Value = css::uno::Any(rEntryType);
// char style
if (bCharStyleNameOK)
diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx
index 9ed5e223c363..fd9876368dfa 100644
--- a/xmloff/source/text/XMLIndexTOCContext.cxx
+++ b/xmloff/source/text/XMLIndexTOCContext.cxx
@@ -246,8 +246,7 @@ void XMLIndexTOCContext::StartElement(
if (!sIndexName.isEmpty())
{
- aAny <<= sIndexName;
- xTOCPropertySet->setPropertyValue( sName, aAny );
+ xTOCPropertySet->setPropertyValue( sName, Any(sIndexName) );
}
}
}
diff --git a/xmloff/source/text/XMLIndexTOCSourceContext.cxx b/xmloff/source/text/XMLIndexTOCSourceContext.cxx
index 59f8497f40b5..32b18e4a75da 100644
--- a/xmloff/source/text/XMLIndexTOCSourceContext.cxx
+++ b/xmloff/source/text/XMLIndexTOCSourceContext.cxx
@@ -146,8 +146,7 @@ void XMLIndexTOCSourceContext::EndElement()
aAny.setValue(&bUseParagraphStyles, cppu::UnoType<bool>::get());
rIndexPropertySet->setPropertyValue(sCreateFromLevelParagraphStyles, aAny);
- aAny <<= (sal_Int16)nOutlineLevel;
- rIndexPropertySet->setPropertyValue(sLevel, aAny);
+ rIndexPropertySet->setPropertyValue(sLevel, css::uno::Any((sal_Int16)nOutlineLevel));
// process common attributes
XMLIndexSourceBaseContext::EndElement();
diff --git a/xmloff/source/text/XMLIndexTOCStylesContext.cxx b/xmloff/source/text/XMLIndexTOCStylesContext.cxx
index d218d9ad9c93..f3a3bc8cd219 100644
--- a/xmloff/source/text/XMLIndexTOCStylesContext.cxx
+++ b/xmloff/source/text/XMLIndexTOCStylesContext.cxx
@@ -106,8 +106,7 @@ void XMLIndexTOCStylesContext::EndElement()
aAny >>= xIndexReplace;
// set style names
- aAny <<= aStyleNamesSequence;
- xIndexReplace->replaceByIndex(nOutlineLevel, aAny);
+ xIndexReplace->replaceByIndex(nOutlineLevel, Any(aStyleNamesSequence));
}
}
diff --git a/xmloff/source/text/XMLIndexTableSourceContext.cxx b/xmloff/source/text/XMLIndexTableSourceContext.cxx
index 871a75589604..724b95d40e55 100644
--- a/xmloff/source/text/XMLIndexTableSourceContext.cxx
+++ b/xmloff/source/text/XMLIndexTableSourceContext.cxx
@@ -133,14 +133,12 @@ void XMLIndexTableSourceContext::EndElement()
if (bSequenceOK)
{
- aAny <<= sSequence;
- rIndexPropertySet->setPropertyValue(sLabelCategory, aAny);
+ rIndexPropertySet->setPropertyValue(sLabelCategory, css::uno::Any(sSequence));
}
if (bDisplayFormatOK)
{
- aAny <<= nDisplayFormat;
- rIndexPropertySet->setPropertyValue(sLabelDisplayType, aAny);
+ rIndexPropertySet->setPropertyValue(sLabelDisplayType, css::uno::Any(nDisplayFormat));
}
XMLIndexSourceBaseContext::EndElement();
diff --git a/xmloff/source/text/XMLIndexTemplateContext.cxx b/xmloff/source/text/XMLIndexTemplateContext.cxx
index cb5842b34738..1ee033a9c2b4 100644
--- a/xmloff/source/text/XMLIndexTemplateContext.cxx
+++ b/xmloff/source/text/XMLIndexTemplateContext.cxx
@@ -188,8 +188,7 @@ void XMLIndexTemplateContext::EndElement()
aAny >>= xIndexReplace;
// ... and insert
- aAny <<= aValueSequence;
- xIndexReplace->replaceByIndex(nOutlineLevel, aAny);
+ xIndexReplace->replaceByIndex(nOutlineLevel, Any(aValueSequence));
if (bStyleNameOK)
{
@@ -209,9 +208,8 @@ void XMLIndexTemplateContext::EndElement()
if( rStyles.is() &&
rStyles->hasByName( sDisplayStyleName ) )
{
- aAny <<= sDisplayStyleName;
rPropertySet->setPropertyValue(
- OUString::createFromAscii(pStyleProperty), aAny);
+ OUString::createFromAscii(pStyleProperty), css::uno::Any(sDisplayStyleName));
}
}
}
diff --git a/xmloff/source/text/XMLIndexUserSourceContext.cxx b/xmloff/source/text/XMLIndexUserSourceContext.cxx
index a4a2d5cedac1..b853d4bbcbdb 100644
--- a/xmloff/source/text/XMLIndexUserSourceContext.cxx
+++ b/xmloff/source/text/XMLIndexUserSourceContext.cxx
@@ -176,8 +176,7 @@ void XMLIndexUserSourceContext::EndElement()
if( !sIndexName.isEmpty() )
{
- aAny <<= sIndexName;
- rIndexPropertySet->setPropertyValue(sUserIndexName, aAny);
+ rIndexPropertySet->setPropertyValue(sUserIndexName, css::uno::Any(sIndexName));
}
XMLIndexSourceBaseContext::EndElement();
diff --git a/xmloff/source/text/XMLLineNumberingImportContext.cxx b/xmloff/source/text/XMLLineNumberingImportContext.cxx
index d04edaa32e6a..71bc60a5d7bd 100644
--- a/xmloff/source/text/XMLLineNumberingImportContext.cxx
+++ b/xmloff/source/text/XMLLineNumberingImportContext.cxx
@@ -233,25 +233,18 @@ void XMLLineNumberingImportContext::CreateAndInsert(bool)
xLineNumbering->setPropertyValue(sCharStyleName, aAny);
}
- aAny <<= sSeparator;
- xLineNumbering->setPropertyValue(sSeparatorText, aAny);
-
- aAny <<= nOffset;
- xLineNumbering->setPropertyValue(sDistance, aAny);
-
- aAny <<= nNumberPosition;
- xLineNumbering->setPropertyValue(sNumberPosition, aAny);
+ xLineNumbering->setPropertyValue(sSeparatorText, Any(sSeparator));
+ xLineNumbering->setPropertyValue(sDistance, Any(nOffset));
+ xLineNumbering->setPropertyValue(sNumberPosition, Any(nNumberPosition));
if (nIncrement >= 0)
{
- aAny <<= nIncrement;
- xLineNumbering->setPropertyValue(sInterval, aAny);
+ xLineNumbering->setPropertyValue(sInterval, Any(nIncrement));
}
if (nSeparatorIncrement >= 0)
{
- aAny <<= nSeparatorIncrement;
- xLineNumbering->setPropertyValue(sSeparatorInterval, aAny);
+ xLineNumbering->setPropertyValue(sSeparatorInterval, Any(nSeparatorIncrement));
}
aAny.setValue(&bNumberLines, cppu::UnoType<bool>::get());
@@ -270,8 +263,7 @@ void XMLLineNumberingImportContext::CreateAndInsert(bool)
GetImport().GetMM100UnitConverter().convertNumFormat( nNumType,
sNumFormat,
sNumLetterSync );
- aAny <<= nNumType;
- xLineNumbering->setPropertyValue(sNumberingType, aAny);
+ xLineNumbering->setPropertyValue(sNumberingType, Any(nNumType));
}
}
}
diff --git a/xmloff/source/text/XMLPropertyBackpatcher.cxx b/xmloff/source/text/XMLPropertyBackpatcher.cxx
index 330f777613c5..d08480bb52d2 100644
--- a/xmloff/source/text/XMLPropertyBackpatcher.cxx
+++ b/xmloff/source/text/XMLPropertyBackpatcher.cxx
@@ -118,9 +118,7 @@ void XMLPropertyBackpatcher<A>::SetProperty(
if (aIDMap.count(sName))
{
// we know this ID -> set property
- Any aAny;
- aAny <<= aIDMap[sName];
- xPropSet->setPropertyValue(sPropertyName, aAny);
+ xPropSet->setPropertyValue(sPropertyName, css::uno::Any(aIDMap[sName]));
}
else
{
diff --git a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx
index 8f3571220797..4e9973d055dd 100644
--- a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx
+++ b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx
@@ -128,53 +128,45 @@ void XMLSectionFootnoteConfigImport::StartElement(
}
// OK, now we have all values and can fill the XMLPropertyState vector
- Any aAny;
- aAny.setValue( &bNumOwn, cppu::UnoType<bool>::get() );
sal_Int32 nIndex = rMapper->FindEntryIndex( bEndnote ?
CTF_SECTION_ENDNOTE_NUM_OWN : CTF_SECTION_FOOTNOTE_NUM_OWN );
- XMLPropertyState aNumOwn( nIndex, aAny );
+ XMLPropertyState aNumOwn( nIndex, css::uno::Any(bNumOwn) );
rProperties.push_back( aNumOwn );
- aAny.setValue( &bNumRestart, cppu::UnoType<bool>::get() );
nIndex = rMapper->FindEntryIndex( bEndnote ?
CTF_SECTION_ENDNOTE_NUM_RESTART : CTF_SECTION_FOOTNOTE_NUM_RESTART );
- XMLPropertyState aNumRestart( nIndex, aAny );
+ XMLPropertyState aNumRestart( nIndex, css::uno::Any(bNumRestart) );
rProperties.push_back( aNumRestart );
- aAny <<= nNumRestartAt;
nIndex = rMapper->FindEntryIndex( bEndnote ?
CTF_SECTION_ENDNOTE_NUM_RESTART_AT :
CTF_SECTION_FOOTNOTE_NUM_RESTART_AT );
- XMLPropertyState aNumRestartAtState( nIndex, aAny );
+ XMLPropertyState aNumRestartAtState( nIndex, css::uno::Any(nNumRestartAt) );
rProperties.push_back( aNumRestartAtState );
sal_Int16 nNumType = NumberingType::ARABIC;
GetImport().GetMM100UnitConverter().convertNumFormat( nNumType,
sNumFormat,
sNumLetterSync );
- aAny <<= nNumType;
nIndex = rMapper->FindEntryIndex( bEndnote ?
CTF_SECTION_ENDNOTE_NUM_TYPE : CTF_SECTION_FOOTNOTE_NUM_TYPE );
- XMLPropertyState aNumFormatState( nIndex, aAny );
+ XMLPropertyState aNumFormatState( nIndex, css::uno::Any(nNumType) );
rProperties.push_back( aNumFormatState );
- aAny <<= sNumPrefix;
nIndex = rMapper->FindEntryIndex( bEndnote ?
CTF_SECTION_ENDNOTE_NUM_PREFIX : CTF_SECTION_FOOTNOTE_NUM_PREFIX );
- XMLPropertyState aPrefixState( nIndex, aAny );
+ XMLPropertyState aPrefixState( nIndex, css::uno::Any(sNumPrefix) );
rProperties.push_back( aPrefixState );
- aAny <<= sNumSuffix;
nIndex = rMapper->FindEntryIndex( bEndnote ?
CTF_SECTION_ENDNOTE_NUM_SUFFIX : CTF_SECTION_FOOTNOTE_NUM_SUFFIX );
- XMLPropertyState aSuffixState( nIndex, aAny );
+ XMLPropertyState aSuffixState( nIndex, css::uno::Any(sNumSuffix) );
rProperties.push_back( aSuffixState );
- aAny.setValue( &bEnd, cppu::UnoType<bool>::get() );
nIndex = rMapper->FindEntryIndex( bEndnote ?
CTF_SECTION_ENDNOTE_END : CTF_SECTION_FOOTNOTE_END );
- XMLPropertyState aEndState( nIndex, aAny );
+ XMLPropertyState aEndState( nIndex, css::uno::Any(bEnd) );
rProperties.push_back( aEndState );
}
diff --git a/xmloff/source/text/XMLSectionImportContext.cxx b/xmloff/source/text/XMLSectionImportContext.cxx
index 7e9bbda0250e..ef567ed29ef6 100644
--- a/xmloff/source/text/XMLSectionImportContext.cxx
+++ b/xmloff/source/text/XMLSectionImportContext.cxx
@@ -183,8 +183,7 @@ void XMLSectionImportContext::StartElement(
if (bCondOK)
{
- aAny <<= sCond;
- xPropSet->setPropertyValue( sCondition, aAny );
+ xPropSet->setPropertyValue( sCondition, Any(sCond) );
}
}
@@ -192,9 +191,7 @@ void XMLSectionImportContext::StartElement(
if ( bSequenceOK &&
IsXMLToken(GetLocalName(), XML_SECTION) )
{
- Any aAny;
- aAny <<= aSequence;
- xPropSet->setPropertyValue(sProtectionKey, aAny);
+ xPropSet->setPropertyValue(sProtectionKey, Any(aSequence));
}
// protection
diff --git a/xmloff/source/text/XMLSectionSourceImportContext.cxx b/xmloff/source/text/XMLSectionSourceImportContext.cxx
index 91ab4bf94448..78d4847a3dbb 100644
--- a/xmloff/source/text/XMLSectionSourceImportContext.cxx
+++ b/xmloff/source/text/XMLSectionSourceImportContext.cxx
@@ -110,21 +110,18 @@ void XMLSectionSourceImportContext::StartElement(
const OUString sFileLink("FileLink");
const OUString sLinkRegion("LinkRegion");
- Any aAny;
if (!sURL.isEmpty() || !sFilterName.isEmpty())
{
SectionFileLink aFileLink;
aFileLink.FileURL = GetImport().GetAbsoluteReference( sURL );
aFileLink.FilterName = sFilterName;
- aAny <<= aFileLink;
- rSectionPropertySet->setPropertyValue(sFileLink, aAny);
+ rSectionPropertySet->setPropertyValue(sFileLink, Any(aFileLink));
}
if (!sSectionName.isEmpty())
{
- aAny <<= sSectionName;
- rSectionPropertySet->setPropertyValue(sLinkRegion, aAny);
+ rSectionPropertySet->setPropertyValue(sLinkRegion, Any(sSectionName));
}
}
diff --git a/xmloff/source/text/XMLTextColumnsContext.cxx b/xmloff/source/text/XMLTextColumnsContext.cxx
index b99a4506e6e2..cdc18f4021ae 100644
--- a/xmloff/source/text/XMLTextColumnsContext.cxx
+++ b/xmloff/source/text/XMLTextColumnsContext.cxx
@@ -452,33 +452,27 @@ void XMLTextColumnsContext::EndElement( )
{
if( pColumnSep->GetWidth() )
{
- aAny <<= pColumnSep->GetWidth();
- xPropSet->setPropertyValue( sSeparatorLineWidth, aAny );
+ xPropSet->setPropertyValue( sSeparatorLineWidth, Any(pColumnSep->GetWidth()) );
}
if( pColumnSep->GetHeight() )
{
- aAny <<= pColumnSep->GetHeight();
xPropSet->setPropertyValue( sSeparatorLineRelativeHeight,
- aAny );
+ Any(pColumnSep->GetHeight()) );
}
if ( pColumnSep->GetStyle() )
{
- aAny <<= pColumnSep->GetStyle();
- xPropSet->setPropertyValue( sSeparatorLineStyle, aAny );
+ xPropSet->setPropertyValue( sSeparatorLineStyle, Any(pColumnSep->GetStyle()) );
}
- aAny <<= pColumnSep->GetColor();
- xPropSet->setPropertyValue( sSeparatorLineColor, aAny );
+ xPropSet->setPropertyValue( sSeparatorLineColor, Any(pColumnSep->GetColor()) );
- aAny <<= pColumnSep->GetVertAlign();
- xPropSet->setPropertyValue( sSeparatorLineVerticalAlignment, aAny );
+ xPropSet->setPropertyValue( sSeparatorLineVerticalAlignment, Any(pColumnSep->GetVertAlign()) );
}
// handle 'automatic columns': column distance
if( bAutomatic )
{
- aAny <<= nAutomaticDistance;
- xPropSet->setPropertyValue( sAutomaticDistance, aAny );
+ xPropSet->setPropertyValue( sAutomaticDistance, Any(nAutomaticDistance) );
}
}
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index 20768ff1fd55..82191a9ad3f7 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -285,7 +285,6 @@ XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl(
{
const SdXMLImExViewBox aViewBox( sViewBox, GetImport().GetMM100UnitConverter());
basegfx::B2DPolyPolygon aPolyPolygon;
- Any aAny;
if( bPath )
{
@@ -320,24 +319,21 @@ XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl(
com::sun::star::drawing::PointSequenceSequence aPointSequenceSequence;
basegfx::tools::B2DPolyPolygonToUnoPointSequenceSequence(aPolyPolygon, aPointSequenceSequence);
- aAny <<= aPointSequenceSequence;
- xPropSet->setPropertyValue( sContourPolyPolygon, aAny );
+ xPropSet->setPropertyValue( sContourPolyPolygon, Any(aPointSequenceSequence) );
}
const OUString sIsPixelContour("IsPixelContour");
if( xPropSetInfo->hasPropertyByName( sIsPixelContour ) )
{
- aAny.setValue( &bPixelWidth, cppu::UnoType<bool>::get() );
- xPropSet->setPropertyValue( sIsPixelContour, aAny );
+ xPropSet->setPropertyValue( sIsPixelContour, Any(bPixelWidth) );
}
const OUString sIsAutomaticContour("IsAutomaticContour");
if( xPropSetInfo->hasPropertyByName( sIsAutomaticContour ) )
{
- aAny.setValue( &bAuto, cppu::UnoType<bool>::get() );
- xPropSet->setPropertyValue( sIsAutomaticContour, aAny );
+ xPropSet->setPropertyValue( sIsAutomaticContour, Any(bAuto) );
}
}
}
@@ -626,16 +622,14 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ )
if( rStyles.is() &&
rStyles->hasByName( sDisplayStyleName ) )
{
- aAny <<= sDisplayStyleName;
- xPropSet->setPropertyValue( sFrameStyleName, aAny );
+ xPropSet->setPropertyValue( sFrameStyleName, Any(sDisplayStyleName) );
}
}
// anchor type (must be set before any other properties, because
// otherwise some orientations cannot be set or will be changed
// afterwards)
- aAny <<= eAnchorType;
- xPropSet->setPropertyValue( sAnchorType, aAny );
+ xPropSet->setPropertyValue( sAnchorType, Any(eAnchorType) );
// hard properties
if( pStyle )
@@ -647,8 +641,7 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ )
aAny >>= nHoriOrient;
if( HoriOrientation::NONE == nHoriOrient )
{
- aAny <<= nX;
- xPropSet->setPropertyValue( sHoriOrientPosition, aAny );
+ xPropSet->setPropertyValue( sHoriOrientPosition, Any(nX) );
}
sal_Int16 nVertOrient = VertOrientation::NONE;
@@ -656,26 +649,21 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ )
aAny >>= nVertOrient;
if( VertOrientation::NONE == nVertOrient )
{
- aAny <<= nY;
- xPropSet->setPropertyValue( sVertOrientPosition, aAny );
+ xPropSet->setPropertyValue( sVertOrientPosition, Any(nY) );
}
// width
if( nWidth > 0 )
{
- aAny <<= nWidth;
- xPropSet->setPropertyValue( sWidth, aAny );
+ xPropSet->setPropertyValue( sWidth, Any(nWidth) );
}
if( nRelWidth > 0 || nWidth > 0 )
{
- aAny <<= nRelWidth;
- xPropSet->setPropertyValue( sRelativeWidth, aAny );
+ xPropSet->setPropertyValue( sRelativeWidth, Any(nRelWidth) );
}
if( bSyncWidth || nWidth > 0 )
{
- sal_Bool bTmp = bSyncWidth;
- aAny.setValue( &bTmp, cppu::UnoType<bool>::get() );
- xPropSet->setPropertyValue( sIsSyncWidthToHeight, aAny );
+ xPropSet->setPropertyValue( sIsSyncWidthToHeight, Any(bSyncWidth) );
}
if( xPropSetInfo->hasPropertyByName( sWidthType ) &&
(bMinWidth || nWidth > 0 || nRelWidth > 0 ) )
@@ -683,25 +671,20 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ )
sal_Int16 nSizeType =
(bMinWidth && XML_TEXT_FRAME_TEXTBOX == nType) ? SizeType::MIN
: SizeType::FIX;
- aAny <<= nSizeType;
- xPropSet->setPropertyValue( sWidthType, aAny );
+ xPropSet->setPropertyValue( sWidthType, Any(nSizeType) );
}
if( nHeight > 0 )
{
- aAny <<= nHeight;
- xPropSet->setPropertyValue( sHeight, aAny );
+ xPropSet->setPropertyValue( sHeight, Any(nHeight) );
}
if( nRelHeight > 0 || nHeight > 0 )
{
- aAny <<= nRelHeight;
- xPropSet->setPropertyValue( sRelativeHeight, aAny );
+ xPropSet->setPropertyValue( sRelativeHeight, Any(nRelHeight) );
}
if( bSyncHeight || nHeight > 0 )
{
- sal_Bool bTmp = bSyncHeight;
- aAny.setValue( &bTmp, cppu::UnoType<bool>::get() );
- xPropSet->setPropertyValue( sIsSyncHeightToWidth, aAny );
+ xPropSet->setPropertyValue( sIsSyncHeightToWidth, Any(bSyncHeight) );
}
if( xPropSetInfo->hasPropertyByName( sSizeType ) &&
(bMinHeight || nHeight > 0 || nRelHeight > 0 ) )
@@ -709,8 +692,7 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ )
sal_Int16 nSizeType =
(bMinHeight && XML_TEXT_FRAME_TEXTBOX == nType) ? SizeType::MIN
: SizeType::FIX;
- aAny <<= nSizeType;
- xPropSet->setPropertyValue( sSizeType, aAny );
+ xPropSet->setPropertyValue( sSizeType, Any(nSizeType) );
}
if( XML_TEXT_FRAME_GRAPHIC == nType )
@@ -733,24 +715,20 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ )
sHRef = GetImport().ResolveGraphicObjectURLFromBase64( xBase64Stream );
xBase64Stream = nullptr;
}
- aAny <<= sHRef;
- xPropSet->setPropertyValue( sGraphicURL, aAny );
+ xPropSet->setPropertyValue( sGraphicURL, Any(sHRef) );
// filter name
- aAny <<=sFilterName;
- xPropSet->setPropertyValue( sGraphicFilter, aAny );
+ xPropSet->setPropertyValue( sGraphicFilter, Any(sFilterName) );
// rotation
- aAny <<= nRotation;
- xPropSet->setPropertyValue( sGraphicRotation, aAny );
+ xPropSet->setPropertyValue( sGraphicRotation, Any(nRotation) );
}
// page number (must be set after the frame is inserted, because it
// will be overwritten then inserting the frame.
if( TextContentAnchorType_AT_PAGE == eAnchorType && nPage > 0 )
{
- aAny <<= nPage;
- xPropSet->setPropertyValue( sAnchorPageNo, aAny );
+ xPropSet->setPropertyValue( sAnchorPageNo, Any(nPage) );
}
if( XML_TEXT_FRAME_OBJECT != nType &&
@@ -1287,26 +1265,21 @@ void XMLTextFrameContext_Impl::SetHyperlink( const OUString& rHRef,
!xPropSetInfo->hasPropertyByName(s_HyperLinkURL))
return;
- Any aAny;
- aAny <<= rHRef;
- xPropSet->setPropertyValue( s_HyperLinkURL, aAny );
+ xPropSet->setPropertyValue( s_HyperLinkURL, Any(rHRef) );
if (xPropSetInfo->hasPropertyByName(s_HyperLinkName))
{
- aAny <<= rName;
- xPropSet->setPropertyValue(s_HyperLinkName, aAny);
+ xPropSet->setPropertyValue(s_HyperLinkName, Any(rName));
}
if (xPropSetInfo->hasPropertyByName(s_HyperLinkTarget))
{
- aAny <<= rTargetFrameName;
- xPropSet->setPropertyValue( s_HyperLinkTarget, aAny );
+ xPropSet->setPropertyValue( s_HyperLinkTarget, Any(rTargetFrameName) );
}
if (xPropSetInfo->hasPropertyByName(s_ServerMap))
{
- aAny.setValue( &bMap, cppu::UnoType<bool>::get() );
- xPropSet->setPropertyValue(s_ServerMap, aAny);
+ xPropSet->setPropertyValue(s_ServerMap, Any(bMap));
}
}
diff --git a/xmloff/source/text/XMLTextMasterPageContext.cxx b/xmloff/source/text/XMLTextMasterPageContext.cxx
index 267bf0eed1c4..40416adf2c43 100644
--- a/xmloff/source/text/XMLTextMasterPageContext.cxx
+++ b/xmloff/source/text/XMLTextMasterPageContext.cxx
@@ -137,8 +137,7 @@ XMLTextMasterPageContext::XMLTextMasterPageContext( SvXMLImport& rImport,
if( !xStyle.is() )
return;
- aAny <<= xStyle;
- xPageStyles->insertByName( sDisplayName, aAny );
+ xPageStyles->insertByName( sDisplayName, Any(xStyle) );
bNew = true;
}
@@ -283,8 +282,7 @@ void XMLTextMasterPageContext::Finish( bool bOverwrite )
aAny >>= sCurrFollow;
if( sCurrFollow != sDisplayFollow )
{
- aAny <<= sDisplayFollow;
- xPropSet->setPropertyValue( sFollowStyle, aAny );
+ xPropSet->setPropertyValue( sFollowStyle, Any(sDisplayFollow) );
}
}
diff --git a/xmloff/source/text/XMLTextShapeImportHelper.cxx b/xmloff/source/text/XMLTextShapeImportHelper.cxx
index 60aae4701189..be9f7f05651e 100644
--- a/xmloff/source/text/XMLTextShapeImportHelper.cxx
+++ b/xmloff/source/text/XMLTextShapeImportHelper.cxx
@@ -120,11 +120,9 @@ void XMLTextShapeImportHelper::addShape(
}
Reference < XPropertySet > xPropSet( rShape, UNO_QUERY );
- Any aAny;
// anchor type
- aAny <<= eAnchorType;
- xPropSet->setPropertyValue( sAnchorType, aAny );
+ xPropSet->setPropertyValue( sAnchorType, Any(eAnchorType) );
Reference < XTextContent > xTxtCntnt( rShape, UNO_QUERY );
xTxtImport->InsertTextContent( xTxtCntnt );
@@ -137,13 +135,11 @@ void XMLTextShapeImportHelper::addShape(
// only set positive page numbers
if ( nPage > 0 )
{
- aAny <<= nPage;
- xPropSet->setPropertyValue( sAnchorPageNo, aAny );
+ xPropSet->setPropertyValue( sAnchorPageNo, Any(nPage) );
}
break;
case TextContentAnchorType_AS_CHARACTER:
- aAny <<= nY;
- xPropSet->setPropertyValue( sVertOrientPosition, aAny );
+ xPropSet->setPropertyValue( sVertOrientPosition, Any(nY) );
break;
default:
break;
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index 7836ce61f63d..80d22879f773 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -707,13 +707,10 @@ void XMLSenderFieldImportContext::PrepareField(
const Reference<XPropertySet> & rPropSet)
{
// set members
- Any aAny;
- aAny <<= nSubType;
- rPropSet->setPropertyValue(sPropertyFieldSubType, aAny);
+ rPropSet->setPropertyValue(sPropertyFieldSubType, Any(nSubType));
// set fixed
- aAny.setValue( &bFixed, cppu::UnoType<bool>::get() );
- rPropSet->setPropertyValue(sPropertyFixed, aAny);
+ rPropSet->setPropertyValue(sPropertyFixed, Any(bFixed));
// set content if fixed
if (bFixed)
@@ -726,8 +723,7 @@ void XMLSenderFieldImportContext::PrepareField(
}
else
{
- aAny <<= GetContent();
- rPropSet->setPropertyValue(sPropertyContent, aAny);
+ rPropSet->setPropertyValue(sPropertyContent, Any(GetContent()));
}
}
}
@@ -766,11 +762,9 @@ void XMLAuthorFieldImportContext::PrepareField(
{
// set members
Any aAny;
- aAny.setValue( &bAuthorFullName, cppu::UnoType<bool>::get() );
- rPropSet->setPropertyValue(sPropertyAuthorFullName, aAny);
+ rPropSet->setPropertyValue(sPropertyAuthorFullName, Any(bAuthorFullName));
- aAny.setValue( &bFixed, cppu::UnoType<bool>::get() );
- rPropSet->setPropertyValue(sPropertyFixed, aAny);
+ rPropSet->setPropertyValue(sPropertyFixed, Any(bFixed));
// set content if fixed
if (bFixed)
@@ -842,8 +836,7 @@ void XMLPageContinuationImportContext::PrepareField(
{
Any aAny;
- aAny <<= eSelectPage;
- xPropertySet->setPropertyValue(sPropertySubType, aAny);
+ xPropertySet->setPropertyValue(sPropertySubType, Any(eSelectPage));
aAny <<= (sStringOK ? sString : GetContent());
xPropertySet->setPropertyValue(sPropertyUserText, aAny);
@@ -909,8 +902,6 @@ void XMLPageNumberImportContext::ProcessAttribute(
void XMLPageNumberImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
// all properties are optional
Reference<XPropertySetInfo> xPropertySetInfo(
xPropertySet->getPropertySetInfo());
@@ -928,8 +919,7 @@ void XMLPageNumberImportContext::PrepareField(
else
nNumType = style::NumberingType::PAGE_DESCRIPTOR;
- aAny <<= nNumType;
- xPropertySet->setPropertyValue(sPropertyNumberingType, aAny);
+ xPropertySet->setPropertyValue(sPropertyNumberingType, Any(nNumType));
}
if (xPropertySetInfo->hasPropertyByName(sPropertyOffset))
@@ -948,14 +938,12 @@ void XMLPageNumberImportContext::PrepareField(
default:
SAL_WARN("xmloff.text", "unknown page number type");
}
- aAny <<= nPageAdjust;
- xPropertySet->setPropertyValue(sPropertyOffset, aAny);
+ xPropertySet->setPropertyValue(sPropertyOffset, Any(nPageAdjust));
}
if (xPropertySetInfo->hasPropertyByName(sPropertySubType))
{
- aAny <<= eSelectPage;
- xPropertySet->setPropertyValue(sPropertySubType, aAny);
+ xPropertySet->setPropertyValue(sPropertySubType, Any(eSelectPage));
}
}
@@ -1020,8 +1008,7 @@ void XMLPlaceholderFieldImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet) {
Any aAny;
- aAny <<= sDescription;
- xPropertySet->setPropertyValue(sPropertyHint, aAny);
+ xPropertySet->setPropertyValue(sPropertyHint, Any(sDescription));
// remove <...> around content (if present)
OUString aContent = GetContent();
@@ -1039,8 +1026,7 @@ void XMLPlaceholderFieldImportContext::PrepareField(
aAny <<= aContent.copy(nStart, nLength);
xPropertySet->setPropertyValue(sPropertyPlaceholder, aAny);
- aAny <<= nPlaceholderType;
- xPropertySet->setPropertyValue(sPropertyPlaceholderType, aAny);
+ xPropertySet->setPropertyValue(sPropertyPlaceholderType, Any(nPlaceholderType));
}
@@ -1120,25 +1106,20 @@ void XMLTimeFieldImportContext::ProcessAttribute(
void XMLTimeFieldImportContext::PrepareField(
const Reference<XPropertySet> & rPropertySet)
{
- Any aAny;
-
// all properties are optional (except IsDate)
Reference<XPropertySetInfo> xPropertySetInfo(
rPropertySet->getPropertySetInfo());
if (xPropertySetInfo->hasPropertyByName(sPropertyFixed))
{
- aAny.setValue( &bFixed, cppu::UnoType<bool>::get() );
- rPropertySet->setPropertyValue(sPropertyFixed, aAny);
+ rPropertySet->setPropertyValue(sPropertyFixed, Any(bFixed));
}
- aAny.setValue( &bIsDate, cppu::UnoType<bool>::get() );
- rPropertySet->setPropertyValue(sPropertyIsDate, aAny);
+ rPropertySet->setPropertyValue(sPropertyIsDate, Any(bIsDate));
if (xPropertySetInfo->hasPropertyByName(sPropertyAdjust))
{
- aAny <<= nAdjust;
- rPropertySet->setPropertyValue(sPropertyAdjust, aAny);
+ rPropertySet->setPropertyValue(sPropertyAdjust, Any(nAdjust));
}
// set value
@@ -1157,13 +1138,11 @@ void XMLTimeFieldImportContext::PrepareField(
{
if (xPropertySetInfo->hasPropertyByName(sPropertyDateTimeValue))
{
- aAny <<= aDateTimeValue;
- rPropertySet->setPropertyValue(sPropertyDateTimeValue,aAny);
+ rPropertySet->setPropertyValue(sPropertyDateTimeValue, Any(aDateTimeValue));
}
else if (xPropertySetInfo->hasPropertyByName(sPropertyDateTime))
{
- aAny <<= aDateTimeValue;
- rPropertySet->setPropertyValue(sPropertyDateTime, aAny);
+ rPropertySet->setPropertyValue(sPropertyDateTime, Any(aDateTimeValue));
}
}
}
@@ -1172,14 +1151,12 @@ void XMLTimeFieldImportContext::PrepareField(
if (bFormatOK &&
xPropertySetInfo->hasPropertyByName(sPropertyNumberFormat))
{
- aAny <<= nFormatKey;
- rPropertySet->setPropertyValue(sPropertyNumberFormat, aAny);
+ rPropertySet->setPropertyValue(sPropertyNumberFormat, Any(nFormatKey));
if( xPropertySetInfo->hasPropertyByName( sPropertyIsFixedLanguage ) )
{
- sal_Bool bIsFixedLanguage = ! bIsDefaultLanguage;
- aAny.setValue( &bIsFixedLanguage, cppu::UnoType<bool>::get() );
- rPropertySet->setPropertyValue( sPropertyIsFixedLanguage, aAny );
+ bool bIsFixedLanguage = ! bIsDefaultLanguage;
+ rPropertySet->setPropertyValue( sPropertyIsFixedLanguage, Any(bIsFixedLanguage) );
}
}
}
@@ -1337,34 +1314,27 @@ SvXMLImportContext* XMLDatabaseFieldImportContext::CreateChildContext(
void XMLDatabaseFieldImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
- aAny <<= sTableName;
- xPropertySet->setPropertyValue(sPropertyTableName, aAny);
+ xPropertySet->setPropertyValue(sPropertyTableName, Any(sTableName));
if( bDatabaseNameOK )
{
- aAny <<= sDatabaseName;
- xPropertySet->setPropertyValue(sPropertyDataBaseName, aAny);
+ xPropertySet->setPropertyValue(sPropertyDataBaseName, Any(sDatabaseName));
}
else if( bDatabaseURLOK )
{
- aAny <<= sDatabaseURL;
- xPropertySet->setPropertyValue(sPropertyDataBaseURL, aAny);
+ xPropertySet->setPropertyValue(sPropertyDataBaseURL, Any(sDatabaseURL));
}
// #99980# load/save command type for all fields; also load
// old documents without command type
if( bCommandTypeOK )
{
- aAny <<= nCommandType;
- xPropertySet->setPropertyValue( sPropertyDataCommandType, aAny );
+ xPropertySet->setPropertyValue( sPropertyDataCommandType, Any(nCommandType) );
}
if( bUseDisplay && bDisplayOK )
{
- aAny.setValue( &bDisplay, cppu::UnoType<bool>::get() );
- xPropertySet->setPropertyValue( sPropertyIsVisible, aAny );
+ xPropertySet->setPropertyValue( sPropertyIsVisible, Any(bDisplay) );
}
}
@@ -1491,10 +1461,7 @@ void XMLDatabaseSelectImportContext::ProcessAttribute(
void XMLDatabaseSelectImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
- aAny <<= nNumber;
- xPropertySet->setPropertyValue(sPropertySetNumber, aAny);
+ xPropertySet->setPropertyValue(sPropertySetNumber, Any(nNumber));
XMLDatabaseNextImportContext::PrepareField(xPropertySet);
}
@@ -1552,19 +1519,15 @@ void XMLDatabaseNumberImportContext::ProcessAttribute(
void XMLDatabaseNumberImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
sal_Int16 nNumType = style::NumberingType::ARABIC;
GetImport().GetMM100UnitConverter().convertNumFormat( nNumType,
sNumberFormat,
sNumberSync );
- aAny <<= nNumType;
- xPropertySet->setPropertyValue(sPropertyNumberingType, aAny);
+ xPropertySet->setPropertyValue(sPropertyNumberingType, Any(nNumType));
if (bValueOK)
{
- aAny <<= nValue;
- xPropertySet->setPropertyValue(sPropertySetNumber, aAny);
+ xPropertySet->setPropertyValue(sPropertySetNumber, Any(nValue));
}
XMLDatabaseFieldImportContext::PrepareField(xPropertySet);
@@ -1612,8 +1575,7 @@ void XMLSimpleDocInfoImportContext::PrepareField(
if (xPropertySetInfo->hasPropertyByName(sPropertyFixed))
{
Any aAny;
- aAny.setValue(&bFixed, cppu::UnoType<bool>::get() );
- rPropertySet->setPropertyValue(sPropertyFixed, aAny);
+ rPropertySet->setPropertyValue(sPropertyFixed, Any(bFixed));
// set Content and CurrentPresentation (if fixed)
if (bFixed)
@@ -1744,9 +1706,7 @@ void XMLRevisionDocInfoImportContext::PrepareField(
sal_Int32 nTmp;
if (::sax::Converter::convertNumber(nTmp, GetContent()))
{
- Any aAny;
- aAny <<= nTmp;
- rPropertySet->setPropertyValue(sPropertyRevision, aAny);
+ rPropertySet->setPropertyValue(sPropertyRevision, Any(nTmp));
}
}
}
@@ -1833,25 +1793,20 @@ void XMLDateTimeDocInfoImportContext::PrepareField(
// process fixed and presentation
XMLSimpleDocInfoImportContext::PrepareField(xPropertySet);
- Any aAny;
-
if (bHasDateTime)
{
- aAny.setValue( &bIsDate, cppu::UnoType<bool>::get());
- xPropertySet->setPropertyValue(sPropertyIsDate, aAny);
+ xPropertySet->setPropertyValue(sPropertyIsDate, Any(bIsDate));
}
if (bFormatOK)
{
- aAny <<= nFormat;
- xPropertySet->setPropertyValue(sPropertyNumberFormat, aAny);
+ xPropertySet->setPropertyValue(sPropertyNumberFormat, Any(nFormat));
if( xPropertySet->getPropertySetInfo()->
hasPropertyByName( sPropertyIsFixedLanguage ) )
{
- sal_Bool bIsFixedLanguage = ! bIsDefaultLanguage;
- aAny.setValue( &bIsFixedLanguage, cppu::UnoType<bool>::get() );
- xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, aAny );
+ bool bIsFixedLanguage = ! bIsDefaultLanguage;
+ xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, Any(bIsFixedLanguage) );
}
}
@@ -1917,25 +1872,21 @@ void XMLUserDocInfoImportContext::PrepareField(
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet> & xPropertySet)
{
- uno::Any aAny;
if ( !aName.isEmpty() )
{
- aAny <<= aName;
- xPropertySet->setPropertyValue(sPropertyName, aAny);
+ xPropertySet->setPropertyValue(sPropertyName, Any(aName));
}
Reference<XPropertySetInfo> xPropertySetInfo(
xPropertySet->getPropertySetInfo());
if (bFormatOK &&
xPropertySetInfo->hasPropertyByName(sPropertyNumberFormat))
{
- aAny <<= nFormat;
- xPropertySet->setPropertyValue(sPropertyNumberFormat, aAny);
+ xPropertySet->setPropertyValue(sPropertyNumberFormat, Any(nFormat));
if( xPropertySetInfo->hasPropertyByName( sPropertyIsFixedLanguage ) )
{
- sal_Bool bIsFixedLanguage = ! bIsDefaultLanguage;
- aAny.setValue( &bIsFixedLanguage, cppu::UnoType<bool>::get() );
- xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, aAny );
+ bool bIsFixedLanguage = ! bIsDefaultLanguage;
+ xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, Any(bIsFixedLanguage) );
}
}
@@ -1989,12 +1940,8 @@ void XMLHiddenParagraphImportContext::ProcessAttribute(
void XMLHiddenParagraphImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
- aAny <<= sCondition;
- xPropertySet->setPropertyValue(sPropertyCondition, aAny);
-
- aAny.setValue( &bIsHidden, cppu::UnoType<bool>::get() );
- xPropertySet->setPropertyValue(sPropertyIsHidden, aAny);
+ xPropertySet->setPropertyValue(sPropertyCondition, Any(sCondition));
+ xPropertySet->setPropertyValue(sPropertyIsHidden, Any(bIsHidden));
}
@@ -2063,22 +2010,11 @@ void XMLConditionalTextImportContext::ProcessAttribute(
void XMLConditionalTextImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
- aAny <<= sCondition;
- xPropertySet->setPropertyValue(sPropertyCondition, aAny);
-
- aAny <<= sFalseContent;
- xPropertySet->setPropertyValue(sPropertyFalseContent, aAny);
-
- aAny <<= sTrueContent;
- xPropertySet->setPropertyValue(sPropertyTrueContent, aAny);
-
- aAny.setValue( &bCurrentValue, cppu::UnoType<bool>::get() );
- xPropertySet->setPropertyValue(sPropertyIsConditionTrue, aAny);
-
- aAny <<= GetContent();
- xPropertySet->setPropertyValue(sPropertyCurrentPresentation, aAny);
+ xPropertySet->setPropertyValue(sPropertyCondition, Any(sCondition));
+ xPropertySet->setPropertyValue(sPropertyFalseContent, Any(sFalseContent));
+ xPropertySet->setPropertyValue(sPropertyTrueContent, Any(sTrueContent));
+ xPropertySet->setPropertyValue(sPropertyIsConditionTrue, Any(bCurrentValue));
+ xPropertySet->setPropertyValue(sPropertyCurrentPresentation, Any(GetContent()));
}
@@ -2140,16 +2076,9 @@ void XMLHiddenTextImportContext::ProcessAttribute(
void XMLHiddenTextImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
- aAny <<= sCondition;
- xPropertySet->setPropertyValue(sPropertyCondition, aAny);
-
- aAny <<= sString;
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
-
- aAny.setValue( &bIsHidden, cppu::UnoType<bool>::get() );
- xPropertySet->setPropertyValue(sPropertyIsHidden, aAny);
+ xPropertySet->setPropertyValue(sPropertyCondition, Any(sCondition));
+ xPropertySet->setPropertyValue(sPropertyContent, Any(sString));
+ xPropertySet->setPropertyValue(sPropertyIsHidden, Any(bIsHidden));
}
@@ -2214,28 +2143,23 @@ void XMLFileNameImportContext::ProcessAttribute(
void XMLFileNameImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
// properties are optional
Reference<XPropertySetInfo> xPropertySetInfo(
xPropertySet->getPropertySetInfo());
if (xPropertySetInfo->hasPropertyByName(sPropertyFixed))
{
- aAny <<= bFixed;
- xPropertySet->setPropertyValue(sPropertyFixed, aAny);
+ xPropertySet->setPropertyValue(sPropertyFixed, Any(bFixed));
}
if (xPropertySetInfo->hasPropertyByName(sPropertyFileFormat))
{
- aAny <<= nFormat;
- xPropertySet->setPropertyValue(sPropertyFileFormat, aAny);
+ xPropertySet->setPropertyValue(sPropertyFileFormat, Any(nFormat));
}
if (xPropertySetInfo->hasPropertyByName(sPropertyCurrentPresentation))
{
- aAny <<= GetContent();
- xPropertySet->setPropertyValue(sPropertyCurrentPresentation, aAny);
+ xPropertySet->setPropertyValue(sPropertyCurrentPresentation, Any(GetContent()));
}
}
@@ -2291,10 +2215,7 @@ void XMLTemplateNameImportContext::ProcessAttribute(
void XMLTemplateNameImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
- aAny <<= nFormat;
- xPropertySet->setPropertyValue(sPropertyFileFormat, aAny);
+ xPropertySet->setPropertyValue(sPropertyFileFormat, Any(nFormat));
}
@@ -2364,13 +2285,8 @@ void XMLChapterImportContext::ProcessAttribute(
void XMLChapterImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
- aAny <<= nFormat;
- xPropertySet->setPropertyValue(sPropertyChapterFormat, aAny);
-
- aAny <<= nLevel;
- xPropertySet->setPropertyValue(sPropertyLevel, aAny);
+ xPropertySet->setPropertyValue(sPropertyChapterFormat, Any(nFormat));
+ xPropertySet->setPropertyValue(sPropertyLevel, Any(nLevel));
}
@@ -2410,8 +2326,6 @@ void XMLCountFieldImportContext::ProcessAttribute(
void XMLCountFieldImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
// properties optional
// (only page count, but do for all to save common implementation)
@@ -2428,8 +2342,7 @@ void XMLCountFieldImportContext::PrepareField(
}
else
nNumType = style::NumberingType::PAGE_DESCRIPTOR;
- aAny <<= nNumType;
- xPropertySet->setPropertyValue(sPropertyNumberingType, aAny);
+ xPropertySet->setPropertyValue(sPropertyNumberingType, Any(nNumType));
}
}
@@ -2507,8 +2420,6 @@ void XMLPageVarGetFieldImportContext::ProcessAttribute(
void XMLPageVarGetFieldImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
sal_Int16 nNumType;
if( bNumberFormatOK )
{
@@ -2519,12 +2430,10 @@ void XMLPageVarGetFieldImportContext::PrepareField(
}
else
nNumType = style::NumberingType::PAGE_DESCRIPTOR;
- aAny <<= nNumType;
- xPropertySet->setPropertyValue(sPropertyNumberingType, aAny);
+ xPropertySet->setPropertyValue(sPropertyNumberingType, Any(nNumType));
// display old content (#96657#)
- aAny <<= GetContent();
- xPropertySet->setPropertyValue( sAPI_current_presentation, aAny );
+ xPropertySet->setPropertyValue( sAPI_current_presentation, Any(GetContent()) );
}
@@ -2576,13 +2485,8 @@ void XMLPageVarSetFieldImportContext::ProcessAttribute(
void XMLPageVarSetFieldImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
- aAny.setValue(&bActive, cppu::UnoType<bool>::get());
- xPropertySet->setPropertyValue(sPropertyOn, aAny);
-
- aAny <<= nAdjust;
- xPropertySet->setPropertyValue(sPropertyOffset, aAny);
+ xPropertySet->setPropertyValue(sPropertyOn, Any(bActive));
+ xPropertySet->setPropertyValue(sPropertyOffset, Any(nAdjust));
}
@@ -2711,14 +2615,9 @@ void XMLMacroFieldImportContext::PrepareField(
sMacroName = sMacro;
}
- aAny <<= sScriptURL;
- xPropertySet->setPropertyValue(sPropertyScriptURL, aAny);
-
- aAny <<= sMacroName;
- xPropertySet->setPropertyValue(sPropertyMacroName, aAny);
-
- aAny <<= sLibraryName;
- xPropertySet->setPropertyValue(sPropertyMacroLibrary, aAny);
+ xPropertySet->setPropertyValue(sPropertyScriptURL, Any(sScriptURL));
+ xPropertySet->setPropertyValue(sPropertyMacroName, Any(sMacroName));
+ xPropertySet->setPropertyValue(sPropertyMacroLibrary, Any(sLibraryName));
}
@@ -2828,20 +2727,15 @@ void XMLReferenceFieldImportContext::ProcessAttribute(
void XMLReferenceFieldImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
- aAny <<= nType;
- xPropertySet->setPropertyValue(sPropertyReferenceFieldPart, aAny);
+ xPropertySet->setPropertyValue(sPropertyReferenceFieldPart, Any(nType));
- aAny <<= nSource;
- xPropertySet->setPropertyValue(sPropertyReferenceFieldSource, aAny);
+ xPropertySet->setPropertyValue(sPropertyReferenceFieldSource, Any(nSource));
switch (nElementToken)
{
case XML_TOK_TEXT_REFERENCE_REF:
case XML_TOK_TEXT_BOOKMARK_REF:
- aAny <<= sName;
- xPropertySet->setPropertyValue(sPropertySourceName, aAny);
+ xPropertySet->setPropertyValue(sPropertySourceName, Any(sName));
break;
case XML_TOK_TEXT_NOTE_REF:
@@ -2853,8 +2747,7 @@ void XMLReferenceFieldImportContext::PrepareField(
break;
}
- aAny <<= GetContent();
- xPropertySet->setPropertyValue(sPropertyCurrentPresentation, aAny);
+ xPropertySet->setPropertyValue(sPropertyCurrentPresentation, Any(GetContent()));
}
@@ -3010,24 +2903,17 @@ void XMLDdeFieldDeclImportContext::StartElement(
xPropSet->getPropertySetInfo()->hasPropertyByName(
sPropertyDDECommandType))
{
- Any aAny;
-
- aAny <<= sName;
- xPropSet->setPropertyValue(sPropertyName, aAny);
+ xPropSet->setPropertyValue(sPropertyName, Any(sName));
- aAny <<= sCommandApplication;
- xPropSet->setPropertyValue(sPropertyDDECommandType, aAny);
+ xPropSet->setPropertyValue(sPropertyDDECommandType, Any(sCommandApplication));
- aAny <<= sCommandTopic;
- xPropSet->setPropertyValue(sPropertyDDECommandFile, aAny);
+ xPropSet->setPropertyValue(sPropertyDDECommandFile, Any(sCommandTopic));
- aAny <<= sCommandItem;
xPropSet->setPropertyValue(sPropertyDDECommandElement,
- aAny);
+ Any(sCommandItem));
- aAny.setValue(&bUpdate, cppu::UnoType<bool>::get());
xPropSet->setPropertyValue(sPropertyIsAutomaticUpdate,
- aAny);
+ Any(bUpdate));
}
// else: ignore (can't get XPropertySet, or DDE
// properties are not supported)
@@ -3220,19 +3106,14 @@ void XMLUrlFieldImportContext::ProcessAttribute(
void XMLUrlFieldImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
- aAny <<= sURL;
- xPropertySet->setPropertyValue(sPropertyURL, aAny);
+ xPropertySet->setPropertyValue(sPropertyURL, Any(sURL));
if (bFrameOK)
{
- aAny <<= sFrame;
- xPropertySet->setPropertyValue(sPropertyTargetFrame, aAny);
+ xPropertySet->setPropertyValue(sPropertyTargetFrame, Any(sFrame));
}
- aAny <<= GetContent();
- xPropertySet->setPropertyValue(sPropertyRepresentation, aAny);
+ xPropertySet->setPropertyValue(sPropertyRepresentation, Any(GetContent()));
}
@@ -3348,9 +3229,7 @@ void XMLBibliographyFieldImportContext::PrepareField(
}
// set sequence
- Any aAny;
- aAny <<= aValueSequence;
- xPropertySet->setPropertyValue(sPropertyFields, aAny);
+ xPropertySet->setPropertyValue(sPropertyFields, Any(aValueSequence));
}
const sal_Char* XMLBibliographyFieldImportContext::MapBibliographyFieldName(
@@ -3763,22 +3642,17 @@ void XMLScriptImportContext::ProcessAttribute(
void XMLScriptImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
-
// if href attribute was present, we use it. Else we use element content
if (! bContentOK)
{
sContent = GetContent();
}
- aAny <<= sContent;
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
+ xPropertySet->setPropertyValue(sPropertyContent, Any(sContent));
// URL or script text? We use URL if we have an href-attribute
- aAny.setValue(&bContentOK, cppu::UnoType<bool>::get());
- xPropertySet->setPropertyValue(sPropertyURLContent, aAny);
+ xPropertySet->setPropertyValue(sPropertyURLContent, Any(bContentOK));
- aAny <<= sScriptType;
- xPropertySet->setPropertyValue(sPropertyScriptType, aAny);
+ xPropertySet->setPropertyValue(sPropertyScriptType, Any(sScriptType));
}
@@ -3822,9 +3696,7 @@ void XMLMeasureFieldImportContext::ProcessAttribute(
void XMLMeasureFieldImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
- aAny <<= mnKind;
- xPropertySet->setPropertyValue("Kind", aAny);
+ xPropertySet->setPropertyValue("Kind", Any(mnKind));
}
@@ -3937,34 +3809,28 @@ void XMLDropDownFieldImportContext::PrepareField(
pSequence[n] = aLabels[n];
// now set values:
- Any aAny;
- aAny <<= aSequence;
- xPropertySet->setPropertyValue( sPropertyItems, aAny );
+ xPropertySet->setPropertyValue( sPropertyItems, Any(aSequence) );
if( nSelected >= 0 && nSelected < nLength )
{
- aAny <<= pSequence[nSelected];
- xPropertySet->setPropertyValue( sPropertySelectedItem, aAny );
+ xPropertySet->setPropertyValue( sPropertySelectedItem, Any(pSequence[nSelected]) );
}
// set name
if( bNameOK )
{
- aAny <<= sName;
- xPropertySet->setPropertyValue( sPropertyName, aAny );
+ xPropertySet->setPropertyValue( sPropertyName, Any(sName) );
}
// set help
if( bHelpOK )
{
- aAny <<= sHelp;
- xPropertySet->setPropertyValue( sPropertyHelp, aAny );
+ xPropertySet->setPropertyValue( sPropertyHelp, Any(sHelp) );
}
// set hint
if( bHintOK )
{
- aAny <<= sHint;
- xPropertySet->setPropertyValue( sPropertyToolTip, aAny );
+ xPropertySet->setPropertyValue( sPropertyToolTip, Any(sHint) );
}
}
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
index f2ac9f27bb14..65cf9d5c6c65 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -975,17 +975,13 @@ void XMLMetaFieldImportContext::InsertMeta(
if (-1 != nKey)
{
- static OUString sPropertyIsFixedLanguage(
- OUString("IsFixedLanguage") );
- Any any;
- any <<= nKey;
- xPropertySet->setPropertyValue("NumberFormat", any);
+ OUString sPropertyIsFixedLanguage("IsFixedLanguage");
+ xPropertySet->setPropertyValue("NumberFormat", Any(nKey));
if ( xPropertySet->getPropertySetInfo()->
hasPropertyByName( sPropertyIsFixedLanguage ) )
{
- any <<= static_cast<bool>(!isDefaultLanguage);
xPropertySet->setPropertyValue( sPropertyIsFixedLanguage,
- any );
+ Any(!isDefaultLanguage) );
}
}
}
@@ -2166,10 +2162,7 @@ XMLParaContext::~XMLParaContext()
{
// set anchor position for at-character anchored objects
Reference<XTextRange> xRange(xAttrCursor, UNO_QUERY);
- Any aPos;
- aPos <<= xRange;
- OUString sTextRange( "TextRange" );
- xPropSet->setPropertyValue(sTextRange, aPos);
+ xPropSet->setPropertyValue("TextRange", Any(xRange));
}
}
}
@@ -2198,10 +2191,7 @@ XMLParaContext::~XMLParaContext()
{
// set anchor position for at-character anchored objects
Reference<XTextRange> xRange(xAttrCursor, UNO_QUERY);
- Any aPos;
- aPos <<= xRange;
- OUString sTextRange( "TextRange" );
- xPropSet->setPropertyValue(sTextRange, aPos);
+ xPropSet->setPropertyValue("TextRange", Any(xRange));
}
}
}
diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx
index 17a4b0ce5e14..bfbf9f9d5694 100644
--- a/xmloff/source/text/txtstyli.cxx
+++ b/xmloff/source/text/txtstyli.cxx
@@ -227,9 +227,7 @@ void XMLTextStyleContext::CreateAndInsert( bool bOverwrite )
xPropSetInfo->hasPropertyByName( sCategory ) &&
SvXMLUnitConverter::convertEnum( nCategory, sCategoryVal, aCategoryMap ) )
{
- Any aAny;
- aAny <<= (sal_Int16)nCategory;
- xPropSet->setPropertyValue( sCategory, aAny );
+ xPropSet->setPropertyValue( sCategory, Any((sal_Int16)nCategory) );
}
// tell the style about it's events (if applicable)
@@ -286,11 +284,9 @@ void XMLTextStyleContext::Finish( bool bOverwrite )
if( xPropSetInfo->hasPropertyByName( sOutlineLevel ))
{
- Any aAny;
if( nOutlineLevel >= 0 )
{
- aAny <<= nOutlineLevel;
- xPropSet->setPropertyValue( sOutlineLevel, aAny );
+ xPropSet->setPropertyValue( sOutlineLevel, Any(nOutlineLevel) );
}
}
@@ -328,9 +324,7 @@ void XMLTextStyleContext::Finish( bool bOverwrite )
{
if ( sListStyleName.isEmpty() )
{
- Any aAny;
- aAny <<= sListStyleName /* empty string */;
- xPropSet->setPropertyValue( sNumberingStyleName, aAny );
+ xPropSet->setPropertyValue( sNumberingStyleName, Any(sListStyleName) ); /* empty string */;
}
else
{
@@ -346,9 +340,7 @@ void XMLTextStyleContext::Finish( bool bOverwrite )
if ( rNumStyles.is() &&
rNumStyles->hasByName( sDisplayListStyleName ) )
{
- Any aAny;
- aAny <<= sDisplayListStyleName;
- xPropSet->setPropertyValue( sNumberingStyleName, aAny );
+ xPropSet->setPropertyValue( sNumberingStyleName, Any(sDisplayListStyleName) );
}
}
}
@@ -367,9 +359,7 @@ void XMLTextStyleContext::Finish( bool bOverwrite )
rTextStyles->hasByName( sDisplayDropCapTextStyleName ) &&
xPropSetInfo->hasPropertyByName( sDropCapCharStyleName ) )
{
- Any aAny;
- aAny <<= sDisplayDropCapTextStyleName;
- xPropSet->setPropertyValue( sDropCapCharStyleName, aAny );
+ xPropSet->setPropertyValue( sDropCapCharStyleName, Any(sDisplayDropCapTextStyleName) );
}
}
@@ -386,9 +376,7 @@ void XMLTextStyleContext::Finish( bool bOverwrite )
rPageStyles->hasByName( sDisplayName )) ) &&
xPropSetInfo->hasPropertyByName( sPageDescName ) )
{
- Any aAny;
- aAny <<= sDisplayName;
- xPropSet->setPropertyValue( sPageDescName, aAny );
+ xPropSet->setPropertyValue( sPageDescName, Any(sDisplayName) );
}
}
}
diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx
index 80f565db7b04..f46bb42be976 100644
--- a/xmloff/source/text/txtvfldi.cxx
+++ b/xmloff/source/text/txtvfldi.cxx
@@ -212,31 +212,23 @@ void XMLVarFieldImportContext::PrepareField(
if (bFormulaOK)
{
- Any aAny;
- aAny <<= sFormula;
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
+ xPropertySet->setPropertyValue(sPropertyContent, Any(sFormula));
}
}
if (bSetDescription && bDescriptionOK)
{
- Any aAny;
- aAny <<= sDescription;
- xPropertySet->setPropertyValue(sPropertyHint, aAny);
+ xPropertySet->setPropertyValue(sPropertyHint, Any(sDescription));
}
if (bSetHelp && bHelpOK)
{
- Any aAny;
- aAny <<= sHelp;
- xPropertySet->setPropertyValue(sPropertyHelp, aAny);
+ xPropertySet->setPropertyValue(sPropertyHelp, Any(sHelp));
}
if (bSetHint && bHintOK)
{
- Any aAny;
- aAny <<= sHint;
- xPropertySet->setPropertyValue(sPropertyTooltip, aAny);
+ xPropertySet->setPropertyValue(sPropertyTooltip, Any(sHint));
}
if (bSetVisible && bDisplayOK)
@@ -417,13 +409,12 @@ void XMLSequenceFieldImportContext::PrepareField(
// set format
sal_Int16 nNumType = NumberingType::ARABIC;
GetImport().GetMM100UnitConverter().convertNumFormat( nNumType, sNumFormat, sNumFormatSync );
- Any aAny;
- aAny <<= nNumType;
- xPropertySet->setPropertyValue(sPropertyNumberFormat, aAny);
+ xPropertySet->setPropertyValue(sPropertyNumberFormat, Any(nNumType));
// handle reference name
if (bRefNameOK)
{
+ Any aAny;
aAny = xPropertySet->getPropertyValue(sPropertySequenceValue);
sal_Int16 nValue = 0;
aAny >>= nValue;
@@ -541,9 +532,7 @@ XMLUserFieldInputImportContext::XMLUserFieldInputImportContext(
void XMLUserFieldInputImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
- Any aAny;
- aAny <<= GetName();
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
+ xPropertySet->setPropertyValue(sPropertyContent, Any(GetName()));
// delegate to super class
XMLVarFieldImportContext::PrepareField(xPropertySet);
@@ -571,9 +560,7 @@ void XMLVariableGetFieldImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
// set name
- Any aAny;
- aAny <<= GetName();
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
+ xPropertySet->setPropertyValue(sPropertyContent, Any(GetName()));
// the remainder is handled by super class
XMLVarFieldImportContext::PrepareField(xPropertySet);
@@ -604,9 +591,7 @@ void XMLExpressionFieldImportContext::PrepareField(
const Reference<XPropertySet> & xPropertySet)
{
sal_Int16 nSubType = SetVariableType::FORMULA;
- Any aAny;
- aAny <<= nSubType;
- xPropertySet->setPropertyValue(sPropertySubType, aAny);
+ xPropertySet->setPropertyValue(sPropertySubType, Any(nSubType));
// delegate to super class
XMLVarFieldImportContext::PrepareField(xPropertySet);
@@ -637,9 +622,7 @@ void XMLTextInputFieldImportContext::PrepareField(
{
XMLVarFieldImportContext::PrepareField(xPropertySet);
- Any aAny;
- aAny <<= GetContent();
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
+ xPropertySet->setPropertyValue(sPropertyContent, Any(GetContent()));
}
@@ -844,15 +827,13 @@ XMLVariableDeclImportContext::XMLVariableDeclImportContext(
switch (eVarType)
{
case VarTypeSequence:
- aAny <<= nNumLevel;
- xFieldMaster->setPropertyValue(sPropertyNumberingLevel, aAny);
+ xFieldMaster->setPropertyValue(sPropertyNumberingLevel, Any(nNumLevel));
if (nNumLevel >= 0)
{
OUString sStr(&cSeparationChar, 1);
- aAny <<= sStr;
xFieldMaster->setPropertyValue(
- sPropertyNumberingSeparator, aAny);
+ sPropertyNumberingSeparator, Any(sStr));
}
break;
case VarTypeSimple:
@@ -990,13 +971,11 @@ bool XMLVariableDeclImportContext::FindFieldMaster(
xMaster = xTmp;
// set name
- Any aAny;
- aAny <<= sName;
- xMaster->setPropertyValue(sAPI_name, aAny);
+ xMaster->setPropertyValue(sAPI_name, Any(sName));
if (eVarType != VarTypeUserField) {
// set subtype for setexp field
-
+ Any aAny;
aAny <<= ((eVarType == VarTypeSimple) ?
SetVariableType::VAR :
SetVariableType::SEQUENCE);
@@ -1086,8 +1065,7 @@ void XMLDatabaseDisplayImportContext::EndElement()
sAPI_fieldmaster_database))
{
Any aAny;
- aAny <<= sColumnName;
- xMaster->setPropertyValue(sPropertyColumnName, aAny);
+ xMaster->setPropertyValue(sPropertyColumnName, Any(sColumnName));
// fieldmaster takes database, table and column name
XMLDatabaseFieldImportContext::PrepareField(xMaster);
@@ -1355,8 +1333,7 @@ void XMLValueImportHelper::PrepareField(
// format/style
if (bSetStyle && bFormatOK)
{
- aAny <<= nFormatKey;
- xPropertySet->setPropertyValue(sPropertyNumberFormat, aAny);
+ xPropertySet->setPropertyValue(sPropertyNumberFormat, Any(nFormatKey));
if( xPropertySet->getPropertySetInfo()->
hasPropertyByName( sPropertyIsFixedLanguage ) )
@@ -1377,8 +1354,7 @@ void XMLValueImportHelper::PrepareField(
}
else
{
- aAny <<= fValue;
- xPropertySet->setPropertyValue(sPropertyValue, aAny);
+ xPropertySet->setPropertyValue(sPropertyValue, Any(fValue));
}
}
}