diff options
Diffstat (limited to 'xmloff/source/text')
-rw-r--r-- | xmloff/source/text/XMLIndexMarkExport.cxx | 5 | ||||
-rw-r--r-- | xmloff/source/text/XMLLineNumberingExport.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/text/XMLRedlineExport.cxx | 23 | ||||
-rw-r--r-- | xmloff/source/text/XMLSectionExport.cxx | 31 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextColumnsExport.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextHeaderFooterContext.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextMasterPageContext.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/text/txtexppr.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/text/txtflde.cxx | 5 | ||||
-rw-r--r-- | xmloff/source/text/txtftne.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/text/txtimppr.cxx | 5 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 45 | ||||
-rw-r--r-- | xmloff/source/text/txtprhdl.cxx | 15 | ||||
-rw-r--r-- | xmloff/source/text/txtstyli.cxx | 4 |
14 files changed, 100 insertions, 74 deletions
diff --git a/xmloff/source/text/XMLIndexMarkExport.cxx b/xmloff/source/text/XMLIndexMarkExport.cxx index b4f0ad1d7ea9..14c983fe77b3 100644 --- a/xmloff/source/text/XMLIndexMarkExport.cxx +++ b/xmloff/source/text/XMLIndexMarkExport.cxx @@ -18,6 +18,7 @@ */ #include "XMLIndexMarkExport.hxx" +#include <o3tl/any.hxx> #include <tools/debug.hxx> #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> @@ -91,7 +92,7 @@ void XMLIndexMarkExport::ExportIndexMark( // collapsed/alternative text entry? aAny = rPropSet->getPropertyValue(sIsCollapsed); - if (*static_cast<sal_Bool const *>(aAny.getValue())) + if (*o3tl::doGet<bool>(aAny)) { // collapsed entry: needs alternative text nElementNo = 0; @@ -107,7 +108,7 @@ void XMLIndexMarkExport::ExportIndexMark( { // start and end entries: has ID aAny = rPropSet->getPropertyValue(sIsStart); - nElementNo = *static_cast<sal_Bool const *>(aAny.getValue()) ? 1 : 2; + nElementNo = *o3tl::doGet<bool>(aAny) ? 1 : 2; // generate ID OUStringBuffer sBuf; diff --git a/xmloff/source/text/XMLLineNumberingExport.cxx b/xmloff/source/text/XMLLineNumberingExport.cxx index df911191b6a0..6394f81cd03c 100644 --- a/xmloff/source/text/XMLLineNumberingExport.cxx +++ b/xmloff/source/text/XMLLineNumberingExport.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/text/XLineNumberingProperties.hpp> #include <com/sun/star/style/LineNumberPosition.hpp> +#include <o3tl/any.hxx> #include <sax/tools/converter.hxx> #include <xmloff/xmlexp.hxx> #include <xmloff/xmluconv.hxx> @@ -89,7 +90,7 @@ void XMLLineNumberingExport::Export() // enable aAny = xLineNumbering->getPropertyValue(sIsOn); - if (! *static_cast<sal_Bool const *>(aAny.getValue())) + if (! *o3tl::doGet<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_NUMBER_LINES, XML_FALSE); @@ -97,7 +98,7 @@ void XMLLineNumberingExport::Export() // count empty lines aAny = xLineNumbering->getPropertyValue(sCountEmptyLines); - if (! *static_cast<sal_Bool const *>(aAny.getValue())) + if (! *o3tl::doGet<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_COUNT_EMPTY_LINES, XML_FALSE); @@ -105,7 +106,7 @@ void XMLLineNumberingExport::Export() // count in frames aAny = xLineNumbering->getPropertyValue(sCountLinesInFrames); - if (*static_cast<sal_Bool const *>(aAny.getValue())) + if (*o3tl::doGet<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_COUNT_IN_TEXT_BOXES, XML_TRUE); @@ -113,7 +114,7 @@ void XMLLineNumberingExport::Export() // restart numbering aAny = xLineNumbering->getPropertyValue(sRestartAtEachPage); - if (*static_cast<sal_Bool const *>(aAny.getValue())) + if (*o3tl::doGet<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_RESTART_ON_PAGE, XML_TRUE); diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx index f7b38efb5edf..ce9bfa37f1b6 100644 --- a/xmloff/source/text/XMLRedlineExport.cxx +++ b/xmloff/source/text/XMLRedlineExport.cxx @@ -18,6 +18,7 @@ */ #include "XMLRedlineExport.hxx" +#include <o3tl/any.hxx> #include <tools/debug.hxx> #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> @@ -213,8 +214,8 @@ void XMLRedlineExport::ExportChangesListElements() Reference<XPropertySet> aDocPropertySet( rExport.GetModel(), uno::UNO_QUERY ); // redlining enabled? - bool bEnabled = *static_cast<sal_Bool const *>(aDocPropertySet->getPropertyValue( - sRecordChanges ).getValue()); + bool bEnabled = *o3tl::doGet<bool>(aDocPropertySet->getPropertyValue( + sRecordChanges )); // only export if we have redlines or attributes if ( aEnumAccess->hasElements() || bEnabled ) @@ -248,7 +249,7 @@ void XMLRedlineExport::ExportChangesListElements() // export only if not in header or footer // (those must be exported with their XText) aAny = xPropSet->getPropertyValue(sIsInHeaderFooter); - if (! *static_cast<sal_Bool const *>(aAny.getValue())) + if (! *o3tl::doGet<bool>(aAny)) { // and finally, export change ExportChangedRegion(xPropSet); @@ -272,8 +273,8 @@ void XMLRedlineExport::ExportChangeAutoStyle( Any aIsStart = rPropSet->getPropertyValue(sIsStart); Any aIsCollapsed = rPropSet->getPropertyValue(sIsCollapsed); - if ( *static_cast<sal_Bool const *>(aIsStart.getValue()) || - *static_cast<sal_Bool const *>(aIsCollapsed.getValue()) ) + if ( *o3tl::doGet<bool>(aIsStart) || + *o3tl::doGet<bool>(aIsCollapsed) ) pCurrentChangesList->push_back(rPropSet); } @@ -315,7 +316,7 @@ void XMLRedlineExport::ExportChangesListAutoStyles() // export only if not in header or footer // (those must be exported with their XText) aAny = xPropSet->getPropertyValue(sIsInHeaderFooter); - if (! *static_cast<sal_Bool const *>(aAny.getValue())) + if (! *o3tl::doGet<bool>(aAny)) { ExportChangeAutoStyle(xPropSet); } @@ -331,7 +332,7 @@ void XMLRedlineExport::ExportChangeInline( // determine element name (depending on collapsed, start/end) enum XMLTokenEnum eElement = XML_TOKEN_INVALID; Any aAny = rPropSet->getPropertyValue(sIsCollapsed); - bool bCollapsed = *static_cast<sal_Bool const *>(aAny.getValue()); + bool bCollapsed = *o3tl::doGet<bool>(aAny); if (bCollapsed) { eElement = XML_CHANGE; @@ -339,7 +340,7 @@ void XMLRedlineExport::ExportChangeInline( else { aAny = rPropSet->getPropertyValue(sIsStart); - const bool bStart = *static_cast<sal_Bool const *>(aAny.getValue()); + const bool bStart = *o3tl::doGet<bool>(aAny); eElement = bStart ? XML_CHANGE_START : XML_CHANGE_END; } @@ -364,7 +365,7 @@ void XMLRedlineExport::ExportChangedRegion( // merge-last-paragraph Any aAny = rPropSet->getPropertyValue(sMergeLastPara); - if( ! *static_cast<sal_Bool const *>(aAny.getValue()) ) + if( ! *o3tl::doGet<bool>(aAny) ) rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_MERGE_LAST_PARAGRAPH, XML_FALSE); @@ -581,11 +582,11 @@ void XMLRedlineExport::ExportStartOrEndRedline( } else if (sIsCollapsed.equals(pValues[i].Name)) { - bIsCollapsed = *static_cast<sal_Bool const *>(pValues[i].Value.getValue()); + bIsCollapsed = *o3tl::doGet<bool>(pValues[i].Value); } else if (sIsStart.equals(pValues[i].Name)) { - bIsStart = *static_cast<sal_Bool const *>(pValues[i].Value.getValue()); + bIsStart = *o3tl::doGet<bool>(pValues[i].Value); } } diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index 3242abfb1bd4..825e6a0191a5 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -18,6 +18,7 @@ */ #include "XMLSectionExport.hxx" +#include <o3tl/any.hxx> #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> @@ -429,7 +430,7 @@ void XMLSectionExport::ExportRegularSectionStart( // #97450# store hidden-status (of conditional sections only) aAny = xPropSet->getPropertyValue(sIsCurrentlyVisible); - if (! *static_cast<sal_Bool const *>(aAny.getValue())) + if (! *o3tl::doGet<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_IS_HIDDEN, XML_TRUE); @@ -440,14 +441,14 @@ void XMLSectionExport::ExportRegularSectionStart( eDisplay = XML_NONE; } aAny = xPropSet->getPropertyValue(sIsVisible); - if (! *static_cast<sal_Bool const *>(aAny.getValue())) + if (! *o3tl::doGet<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_DISPLAY, eDisplay); } // protect + protection key aAny = xPropSet->getPropertyValue(sIsProtected); - if (*static_cast<sal_Bool const *>(aAny.getValue())) + if (*o3tl::doGet<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_PROTECTED, XML_TRUE); } @@ -531,7 +532,7 @@ void XMLSectionExport::ExportRegularSectionStart( sItem); aAny = xPropSet->getPropertyValue(sIsAutomaticUpdate); - if (*static_cast<sal_Bool const *>(aAny.getValue())) + if (*o3tl::doGet<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_AUTOMATIC_UPDATE, XML_TRUE); @@ -765,7 +766,7 @@ void XMLSectionExport::ExportBaseIndexStart( { // protect + protection key Any aAny = rPropertySet->getPropertyValue(sIsProtected); - if (*static_cast<sal_Bool const *>(aAny.getValue())) + if (*o3tl::doGet<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_PROTECTED, XML_TRUE); } @@ -809,7 +810,7 @@ void XMLSectionExport::ExportBaseIndexSource( { // document or chapter index? aAny = rPropertySet->getPropertyValue(sCreateFromChapter); - if (*static_cast<sal_Bool const *>(aAny.getValue())) + if (*o3tl::doGet<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_INDEX_SCOPE, XML_CHAPTER); @@ -817,7 +818,7 @@ void XMLSectionExport::ExportBaseIndexSource( // tab-stops relative to margin? aAny = rPropertySet->getPropertyValue(sIsRelativeTabstops); - if (! *static_cast<sal_Bool const *>(aAny.getValue())) + if (! *o3tl::doGet<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_RELATIVE_TAB_STOP_POSITION, @@ -914,7 +915,7 @@ void XMLSectionExport::ExportTableAndIllustrationIndexSourceAttributes( { // use caption Any aAny = rPropertySet->getPropertyValue(sCreateFromLabels); - if (! *static_cast<sal_Bool const *>(aAny.getValue())) + if (! *o3tl::doGet<bool>(aAny)) { GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_USE_CAPTION, XML_FALSE); @@ -1284,7 +1285,7 @@ void XMLSectionExport::ExportIndexTemplateElement( case TOK_TPARAM_TAB_RIGHT_ALIGNED: bRightAligned = - *static_cast<sal_Bool const *>(rValues[i].Value.getValue()); + *o3tl::doGet<bool>(rValues[i].Value); break; case TOK_TPARAM_TAB_POSITION: @@ -1294,7 +1295,7 @@ void XMLSectionExport::ExportIndexTemplateElement( // #i21237# case TOK_TPARAM_TAB_WITH_TAB: - bWithTabStop = *static_cast<sal_Bool const *>(rValues[i].Value.getValue()); + bWithTabStop = *o3tl::doGet<bool>(rValues[i].Value); bWithTabStopOK = true; break; @@ -1591,7 +1592,7 @@ void XMLSectionExport::ExportBoolean( OSL_ENSURE(eAttributeName != XML_TOKEN_INVALID, "Need attribute name"); Any aAny = rPropSet->getPropertyValue(sPropertyName); - bool bTmp = *static_cast<sal_Bool const *>(aAny.getValue()); + bool bTmp = *o3tl::doGet<bool>(aAny); // value = value ^ bInvert // omit if value == default @@ -1647,14 +1648,14 @@ void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport) rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_SUFFIX, sTmp); aAny = xPropSet->getPropertyValue(sIsNumberEntries); - if (*static_cast<sal_Bool const *>(aAny.getValue())) + if (*o3tl::doGet<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_NUMBERED_ENTRIES, XML_TRUE); } aAny = xPropSet->getPropertyValue(sIsSortByPosition); - if (! *static_cast<sal_Bool const *>(aAny.getValue())) + if (! *o3tl::doGet<bool>(aAny)) { rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_SORT_BY_POSITION, XML_FALSE); @@ -1709,7 +1710,7 @@ void XMLSectionExport::ExportBibliographyConfiguration(SvXMLExport& rExport) } else if (rValue.Name == "IsSortAscending") { - bool bTmp = *static_cast<sal_Bool const *>(rValue.Value.getValue()); + bool bTmp = *o3tl::doGet<bool>(rValue.Value); rExport.AddAttribute(XML_NAMESPACE_TEXT, XML_SORT_ASCENDING, bTmp ? XML_TRUE : XML_FALSE); @@ -1749,7 +1750,7 @@ bool XMLSectionExport::IsMuteSection( { Any aAny = xPropSet->getPropertyValue(sIsGlobalDocumentSection); - if ( *static_cast<sal_Bool const *>(aAny.getValue()) ) + if ( *o3tl::doGet<bool>(aAny) ) { Reference<XDocumentIndex> xIndex; if (! GetIndex(rSection, xIndex)) diff --git a/xmloff/source/text/XMLTextColumnsExport.cxx b/xmloff/source/text/XMLTextColumnsExport.cxx index ee797e2c6b70..4d5eee50f365 100644 --- a/xmloff/source/text/XMLTextColumnsExport.cxx +++ b/xmloff/source/text/XMLTextColumnsExport.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <o3tl/any.hxx> #include <rtl/ustrbuf.hxx> @@ -72,7 +75,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) if( xPropSet.is() ) { Any aAny = xPropSet->getPropertyValue( sIsAutomatic ); - if ( *static_cast<sal_Bool const *>(aAny.getValue()) ) + if ( *o3tl::doGet<bool>(aAny) ) { aAny = xPropSet->getPropertyValue( sAutomaticDistance ); sal_Int32 nDistance = 0; @@ -92,7 +95,7 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) if( xPropSet.is() ) { Any aAny = xPropSet->getPropertyValue( sSeparatorLineIsOn ); - if( *static_cast<sal_Bool const *>(aAny.getValue()) ) + if( *o3tl::doGet<bool>(aAny) ) { // style:width aAny = xPropSet->getPropertyValue( sSeparatorLineWidth ); diff --git a/xmloff/source/text/XMLTextHeaderFooterContext.cxx b/xmloff/source/text/XMLTextHeaderFooterContext.cxx index efa42e333cbf..6dc6e25021eb 100644 --- a/xmloff/source/text/XMLTextHeaderFooterContext.cxx +++ b/xmloff/source/text/XMLTextHeaderFooterContext.cxx @@ -20,6 +20,7 @@ #include <com/sun/star/text/XText.hpp> #include <com/sun/star/text/XParagraphAppend.hpp> #include <com/sun/star/text/XRelativeTextContentRemove.hpp> +#include <o3tl/any.hxx> #include <xmloff/nmspmap.hxx> #include <xmloff/xmlnmspe.hxx> #include "XMLTextHeaderFooterContext.hxx" @@ -58,7 +59,7 @@ XMLTextHeaderFooterContext::XMLTextHeaderFooterContext( SvXMLImport& rImport, sa Any aAny; aAny = xPropSet->getPropertyValue( sOn ); - bool bOn = *static_cast<sal_Bool const *>(aAny.getValue()); + bool bOn = *o3tl::doGet<bool>(aAny); if( bOn ) { @@ -124,7 +125,7 @@ SvXMLImportContext *XMLTextHeaderFooterContext::CreateChildContext( else { aAny = xPropSet->getPropertyValue( sOn ); - bool bOn = *static_cast<sal_Bool const *>(aAny.getValue()); + bool bOn = *o3tl::doGet<bool>(aAny); if( !bOn ) { @@ -138,7 +139,7 @@ SvXMLImportContext *XMLTextHeaderFooterContext::CreateChildContext( // If a header or footer is not shared, share it now. aAny = xPropSet->getPropertyValue( sShareContent ); - bool bShared = *static_cast<sal_Bool const *>(aAny.getValue()); + bool bShared = *o3tl::doGet<bool>(aAny); if( !bShared ) { xPropSet->setPropertyValue( sShareContent, Any(true) ); diff --git a/xmloff/source/text/XMLTextMasterPageContext.cxx b/xmloff/source/text/XMLTextMasterPageContext.cxx index 155d29697ab8..8d39758498c1 100644 --- a/xmloff/source/text/XMLTextMasterPageContext.cxx +++ b/xmloff/source/text/XMLTextMasterPageContext.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/style/PageStyleLayout.hpp> #include <com/sun/star/beans/XMultiPropertyStates.hpp> +#include <o3tl/any.hxx> #include <osl/diagnose.h> #include <xmloff/nmspmap.hxx> #include <xmloff/xmlnmspe.hxx> @@ -147,7 +148,7 @@ XMLTextMasterPageContext::XMLTextMasterPageContext( SvXMLImport& rImport, if( !bNew && xPropSetInfo->hasPropertyByName( sIsPhysical ) ) { aAny = xPropSet->getPropertyValue( sIsPhysical ); - bNew = !*static_cast<sal_Bool const *>(aAny.getValue()); + bNew = !*o3tl::doGet<bool>(aAny); } SetNew( bNew ); diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx index 687fa59383ba..d77a548e95ed 100644 --- a/xmloff/source/text/txtexppr.cxx +++ b/xmloff/source/text/txtexppr.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/text/TextContentAnchorType.hpp> #include <com/sun/star/awt/FontUnderline.hpp> #include <com/sun/star/text/XChapterNumberingSupplier.hpp> +#include <o3tl/any.hxx> #include <tools/debug.hxx> #include <tools/color.hxx> #include <xmloff/txtprmap.hxx> @@ -148,7 +149,7 @@ void XMLTextExportPropertySetMapper::handleSpecialItem( { case CTF_DROPCAPWHOLEWORD: DBG_ASSERT( !bDropWholeWord, "drop whole word is set already!" ); - pThis->bDropWholeWord = *static_cast<sal_Bool const *>(rProperty.maValue.getValue()); + pThis->bDropWholeWord = *o3tl::doGet<bool>(rProperty.maValue); break; case CTF_DROPCAPCHARSTYLE: DBG_ASSERT( sDropCharStyle.isEmpty(), "drop char style is set already!" ); @@ -1004,7 +1005,7 @@ void XMLTextExportPropertySetMapper::ContextFilter( } if( pWrapContourModeState && (!pWrapContourState || - !*static_cast<sal_Bool const *>(pWrapContourState ->maValue.getValue()) ) ) + !*o3tl::doGet<bool>(pWrapContourState ->maValue) ) ) pWrapContourModeState->mnIndex = -1; } @@ -1022,7 +1023,7 @@ void XMLTextExportPropertySetMapper::ContextFilter( if( pHoriOrientState && pHoriOrientMirroredState ) { if( pHoriOrientMirrorState && - *static_cast<sal_Bool const *>(pHoriOrientMirrorState->maValue.getValue()) ) + *o3tl::doGet<bool>(pHoriOrientMirrorState->maValue) ) pHoriOrientState->mnIndex = -1; else pHoriOrientMirroredState->mnIndex = -1; @@ -1098,7 +1099,7 @@ void XMLTextExportPropertySetMapper::ContextFilter( if( pShapeHoriOrientState && pShapeHoriOrientMirroredState ) { if( pShapeHoriOrientMirrorState && - *static_cast<sal_Bool const *>(pShapeHoriOrientMirrorState->maValue.getValue()) ) + *o3tl::doGet<bool>(pShapeHoriOrientMirrorState->maValue) ) pShapeHoriOrientState->mnIndex = -1; else pShapeHoriOrientMirroredState->mnIndex = -1; diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index c198d272d056..b87e256af950 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -64,6 +64,7 @@ #include <com/sun/star/text/BibliographyDataType.hpp> #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/rdf/XMetadatable.hpp> +#include <o3tl/any.hxx> #include <rtl/ustrbuf.hxx> #include <tools/debug.hxx> #include <rtl/math.hxx> @@ -2950,7 +2951,7 @@ enum XMLTokenEnum XMLTextFieldExport::MapPageNumberName( enum XMLTokenEnum eName = XML_TOKEN_INVALID; PageNumberType ePage; Any aAny = xPropSet->getPropertyValue(sPropertySubType); - ePage = *static_cast<PageNumberType const *>(aAny.getValue()); + ePage = *o3tl::doGet<PageNumberType>(aAny); switch (ePage) { @@ -3492,7 +3493,7 @@ inline bool GetBoolProperty( const Reference<XPropertySet> & xPropSet) { Any aAny = xPropSet->getPropertyValue(sPropName); - bool bBool = *static_cast<sal_Bool const *>(aAny.getValue()); + bool bBool = *o3tl::doGet<bool>(aAny); return bBool; } diff --git a/xmloff/source/text/txtftne.cxx b/xmloff/source/text/txtftne.cxx index f990e2f33150..97324420ccde 100644 --- a/xmloff/source/text/txtftne.cxx +++ b/xmloff/source/text/txtftne.cxx @@ -26,6 +26,10 @@ * - footnote configuration elements * - endnote configuration elements */ + +#include <sal/config.h> + +#include <o3tl/any.hxx> #include <tools/debug.hxx> #include <rtl/ustrbuf.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -315,7 +319,7 @@ void XMLTextParagraphExport::exportTextFootnoteConfigurationHelper( aAny = rFootnoteConfig->getPropertyValue( sPositionEndOfDoc); GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_FOOTNOTES_POSITION, - ( (*static_cast<sal_Bool const *>(aAny.getValue())) ? + ( (*o3tl::doGet<bool>(aAny)) ? XML_DOCUMENT : XML_PAGE ) ); aAny = rFootnoteConfig->getPropertyValue(sFootnoteCounting); diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx index f89a142d0636..6bc35f5f469f 100644 --- a/xmloff/source/text/txtimppr.cxx +++ b/xmloff/source/text/txtimppr.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <o3tl/any.hxx> #include <osl/thread.h> #include <com/sun/star/awt/FontFamily.hpp> #include <com/sun/star/awt/FontPitch.hpp> @@ -671,7 +674,7 @@ void XMLTextImportPropertyMapper::finished( // #i5775# don't overwrite %transparency with binary transparency if( ( pBackTransparency != nullptr ) && ( pBackTransparent != nullptr ) ) { - if( ! *static_cast<sal_Bool const *>(pBackTransparent->maValue.getValue()) ) + if( ! *o3tl::doGet<bool>(pBackTransparent->maValue) ) pBackTransparent->mnIndex = -1; } diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index efe5a79b4e1e..dfea038f50ae 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <o3tl/any.hxx> #include <xmloff/unointerfacetouniqueidentifiermapper.hxx> #include <tools/debug.hxx> #include <rtl/ustrbuf.hxx> @@ -513,13 +516,13 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, xNumPropSet->getPropertySetInfo() ->hasPropertyByName( "IsAutomatic" ) ) { - bAdd = *static_cast<sal_Bool const *>(xNumPropSet->getPropertyValue( "IsAutomatic" ).getValue()); + bAdd = *o3tl::doGet<bool>(xNumPropSet->getPropertyValue( "IsAutomatic" )); // Check on outline style (#i73361#) if ( bAdd && xNumPropSet->getPropertySetInfo() ->hasPropertyByName( "NumberingIsOutline" ) ) { - bAdd = !(*static_cast<sal_Bool const *>(xNumPropSet->getPropertyValue( "NumberingIsOutline" ).getValue())); + bAdd = !(*o3tl::doGet<bool>(xNumPropSet->getPropertyValue( "NumberingIsOutline" ))); } } else @@ -619,13 +622,13 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, xNumPropSet->getPropertySetInfo() ->hasPropertyByName( "IsAutomatic" ) ) { - bAdd = *static_cast<sal_Bool const *>(xNumPropSet->getPropertyValue( "IsAutomatic" ).getValue()); + bAdd = *o3tl::doGet<bool>(xNumPropSet->getPropertyValue( "IsAutomatic" )); // Check on outline style (#i73361#) if ( bAdd && xNumPropSet->getPropertySetInfo() ->hasPropertyByName( "NumberingIsOutline" ) ) { - bAdd = !(*static_cast<sal_Bool const *>(xNumPropSet->getPropertyValue( "NumberingIsOutline" ).getValue())); + bAdd = !(*o3tl::doGet<bool>(xNumPropSet->getPropertyValue( "NumberingIsOutline" ))); } } else @@ -1456,13 +1459,13 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress ) } Any aAny = xAutoStyleFamilies->getByName( sName ); - Reference< XAutoStyleFamily > xAutoStyles = *static_cast<Reference<XAutoStyleFamily> const *>(aAny.getValue()); + Reference< XAutoStyleFamily > xAutoStyles = *o3tl::doGet<Reference<XAutoStyleFamily>>(aAny); Reference < XEnumeration > xAutoStylesEnum( xAutoStyles->createEnumeration() ); while ( xAutoStylesEnum->hasMoreElements() ) { aAny = xAutoStylesEnum->nextElement(); - Reference< XAutoStyle > xAutoStyle = *static_cast<Reference<XAutoStyle> const *>(aAny.getValue()); + Reference< XAutoStyle > xAutoStyle = *o3tl::doGet<Reference<XAutoStyle>>(aAny); Reference < XPropertySet > xPSet( xAutoStyle, uno::UNO_QUERY ); Add( nFamily, xPSet, nullptr, true ); } @@ -1479,7 +1482,7 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress ) while ( xTextFieldsEnum->hasMoreElements() ) { Any aAny = xTextFieldsEnum->nextElement(); - Reference< XTextField > xTextField = *static_cast<Reference<XTextField> const *>(aAny.getValue()); + Reference< XTextField > xTextField = *o3tl::doGet<Reference<XTextField>>(aAny); exportTextField( xTextField, bAutoStyles, bIsProgress, !xAutoStylesSupp.is() ); try @@ -1557,7 +1560,7 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress ) for( sal_Int32 i = 0; i < nCount; ++i ) { Any aAny = xSections->getByIndex( i ); - Reference< XTextSection > xSection = *static_cast<Reference<XTextSection> const *>(aAny.getValue()); + Reference< XTextSection > xSection = *o3tl::doGet<Reference<XTextSection>>(aAny); Reference < XPropertySet > xPSet( xSection, uno::UNO_QUERY ); Add( XML_STYLE_FAMILY_TEXT_SECTION, xPSet ); } @@ -1575,7 +1578,7 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress ) for( sal_Int32 i = 0; i < nCount; ++i ) { Any aAny = xTables->getByIndex( i ); - Reference< XTextTable > xTable = *static_cast<Reference<XTextTable> const *>(aAny.getValue()); + Reference< XTextTable > xTable = *o3tl::doGet<Reference<XTextTable>>(aAny); exportTable( xTable, true, true ); } } @@ -1605,13 +1608,13 @@ bool XMLTextParagraphExport::collectTextAutoStylesOptimized( bool bIsProgress ) xNumPropSet->getPropertySetInfo() ->hasPropertyByName( "IsAutomatic" ) ) { - bAdd = *static_cast<sal_Bool const *>(xNumPropSet->getPropertyValue( "IsAutomatic" ).getValue()); + bAdd = *o3tl::doGet<bool>(xNumPropSet->getPropertyValue( "IsAutomatic" )); // Check on outline style (#i73361#) if ( bAdd && xNumPropSet->getPropertySetInfo() ->hasPropertyByName( "NumberingIsOutline" ) ) { - bAdd = !(*static_cast<sal_Bool const *>(xNumPropSet->getPropertyValue( "NumberingIsOutline" ).getValue())); + bAdd = !(*o3tl::doGet<bool>(xNumPropSet->getPropertyValue( "NumberingIsOutline" ))); } } else @@ -2503,13 +2506,13 @@ void XMLTextParagraphExport::exportTextMark( // start, end, or point-reference? sal_Int8 nElement; - if( *static_cast<sal_Bool const *>(rPropSet->getPropertyValue(sIsCollapsed).getValue()) ) + if( *o3tl::doGet<bool>(rPropSet->getPropertyValue(sIsCollapsed)) ) { nElement = 0; } else { - nElement = *static_cast<sal_Bool const *>(rPropSet->getPropertyValue(sIsStart).getValue()) ? 1 : 2; + nElement = *o3tl::doGet<bool>(rPropSet->getPropertyValue(sIsStart)) ? 1 : 2; } // bookmark, bookmark-start: xml:id and RDFa for RDF metadata @@ -2669,7 +2672,7 @@ XMLShapeExportFlags XMLTextParagraphExport::addTextFrameAttributes( bool bSyncWidth = false; if( xPropSetInfo->hasPropertyByName( sIsSyncWidthToHeight ) ) { - bSyncWidth = *static_cast<sal_Bool const *>(rPropSet->getPropertyValue( sIsSyncWidthToHeight ).getValue()); + bSyncWidth = *o3tl::doGet<bool>(rPropSet->getPropertyValue( sIsSyncWidthToHeight )); if( bSyncWidth ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_REL_WIDTH, XML_SCALE ); @@ -2697,7 +2700,7 @@ XMLShapeExportFlags XMLTextParagraphExport::addTextFrameAttributes( bool bSyncHeight = false; if( xPropSetInfo->hasPropertyByName( sIsSyncHeightToWidth ) ) { - bSyncHeight = *static_cast<sal_Bool const *>(rPropSet->getPropertyValue( sIsSyncHeightToWidth ).getValue()); + bSyncHeight = *o3tl::doGet<bool>(rPropSet->getPropertyValue( sIsSyncHeightToWidth )); } sal_Int16 nRelHeight = 0; if( !bSyncHeight && xPropSetInfo->hasPropertyByName( sRelativeHeight ) ) @@ -2964,7 +2967,7 @@ void XMLTextParagraphExport::exportContour( if( rPropSetInfo->hasPropertyByName( sIsPixelContour ) ) { - bPixel = *static_cast<sal_Bool const *>(rPropSet->getPropertyValue( sIsPixelContour ).getValue()); + bPixel = *o3tl::doGet<bool>(rPropSet->getPropertyValue( sIsPixelContour )); } // svg: width @@ -3026,8 +3029,8 @@ void XMLTextParagraphExport::exportContour( if( rPropSetInfo->hasPropertyByName( sIsAutomaticContour ) ) { - bool bTmp = *static_cast<sal_Bool const *>(rPropSet->getPropertyValue( - sIsAutomaticContour ).getValue()); + bool bTmp = *o3tl::doGet<bool>(rPropSet->getPropertyValue( + sIsAutomaticContour )); GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_RECREATE_ON_EDIT, bTmp ? XML_TRUE : XML_FALSE ); } @@ -3247,7 +3250,7 @@ bool XMLTextParagraphExport::addHyperlinkAttributes( && ( !rPropState.is() || PropertyState_DIRECT_VALUE == rPropState->getPropertyState( sServerMap ) ) ) { - bServerMap = *static_cast<sal_Bool const *>(rPropSet->getPropertyValue( sServerMap ).getValue()); + bServerMap = *o3tl::doGet<bool>(rPropSet->getPropertyValue( sServerMap )); if ( bServerMap ) bExport = true; } @@ -3624,11 +3627,11 @@ void XMLTextParagraphExport::exportRuby( bool bAutoStyles ) { // early out: a collapsed ruby makes no sense - if (*static_cast<sal_Bool const *>(rPropSet->getPropertyValue(sIsCollapsed).getValue())) + if (*o3tl::doGet<bool>(rPropSet->getPropertyValue(sIsCollapsed))) return; // start value ? - bool bStart = *static_cast<sal_Bool const *>(rPropSet->getPropertyValue(sIsStart).getValue()); + bool bStart = *o3tl::doGet<bool>(rPropSet->getPropertyValue(sIsStart)); if (bAutoStyles) { diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index 6d3a22735d73..3d4d2fbfee5f 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <o3tl/any.hxx> #include <tools/debug.hxx> #include <osl/diagnose.h> #include <rtl/ustrbuf.hxx> @@ -351,7 +354,7 @@ bool XMLOpaquePropHdl_Impl::exportXML( const Any& rValue, const SvXMLUnitConverter& ) const { - if( *static_cast<sal_Bool const *>(rValue.getValue()) ) + if( *o3tl::doGet<bool>(rValue) ) rStrExpValue = GetXMLToken( XML_FOREGROUND ); else rStrExpValue = GetXMLToken( XML_BACKGROUND ); @@ -401,7 +404,7 @@ bool XMLContourModePropHdl_Impl::exportXML( const Any& rValue, const SvXMLUnitConverter& ) const { - if( *static_cast<sal_Bool const *>(rValue.getValue()) ) + if( *o3tl::doGet<bool>(rValue) ) rStrExpValue = GetXMLToken( XML_OUTSIDE ); else rStrExpValue = GetXMLToken( XML_FULL ); @@ -454,7 +457,7 @@ bool XMLParagraphOnlyPropHdl_Impl::exportXML( const Any& rValue, const SvXMLUnitConverter& ) const { - if( *static_cast<sal_Bool const *>(rValue.getValue()) ) + if( *o3tl::doGet<bool>(rValue) ) rStrExpValue = GetXMLToken( XML_1 ); else rStrExpValue = GetXMLToken( XML_NO_LIMIT ); @@ -580,7 +583,7 @@ bool XMLFrameProtectPropHdl_Impl::exportXML( const Any& rValue, const SvXMLUnitConverter& ) const { - if( *static_cast<sal_Bool const *>(rValue.getValue()) ) + if( *o3tl::doGet<bool>(rValue) ) { if( rStrExpValue.isEmpty() || IsXMLToken( rStrExpValue, XML_NONE ) ) @@ -822,7 +825,7 @@ bool XMLGrfMirrorPropHdl_Impl::exportXML( const Any& rValue, const SvXMLUnitConverter& ) const { - if( *static_cast<sal_Bool const *>(rValue.getValue()) ) + if( *o3tl::doGet<bool>(rValue) ) { if( rStrExpValue.isEmpty() || IsXMLToken( rStrExpValue, XML_NONE ) ) @@ -1097,7 +1100,7 @@ bool XMLTextSyncWidthHeightPropHdl_Impl::exportXML( const SvXMLUnitConverter& ) const { bool bRet = false; - if( *static_cast<sal_Bool const *>(rValue.getValue()) ) + if( *o3tl::doGet<bool>(rValue) ) { rStrExpValue = sValue; bRet = true; diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index eb748ea87696..ccd3a4c8a39a 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -39,6 +39,8 @@ #include <com/sun/star/style/ParagraphStyleCategory.hpp> #include <com/sun/star/style/XStyle.hpp> +#include <o3tl/any.hxx> + #include <sax/tools/converter.hxx> #include <tools/debug.hxx> @@ -482,7 +484,7 @@ void XMLTextStyleContext::FillPropertySet( if ( nIndex != -1 ) { Any& rAny = GetProperties()[nIndex].maValue; - bool bVal = *static_cast<sal_Bool const *>(rAny.getValue()); + bool bVal = *o3tl::doGet<bool>(rAny); bHasCombinedCharactersLetter = bVal; } |