From 82e9cfc9910005e55f57ab13dd685f8860f47d27 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 28 Apr 2016 14:35:37 +0200 Subject: use Any constructor for bool values, instead of temporary vars mostly found with: git grep -n 'setValue.*cppu.*UnoType.*bool.*get' Change-Id: Ie8e5aa6402d25dbe90b0f492031a245bb222c1a5 Reviewed-on: https://gerrit.libreoffice.org/24464 Tested-by: Jenkins Reviewed-by: Noel Grandin --- cui/source/options/optasian.cxx | 6 +-- extensions/source/bibliography/datman.cxx | 4 +- sd/source/ui/unoidl/unocpres.cxx | 1 - sd/source/ui/unoidl/unohelp.hxx | 34 ------------- sd/source/ui/unoidl/unolayer.cxx | 7 ++- sd/source/ui/unoidl/unomodel.cxx | 1 - sd/source/ui/unoidl/unoobj.cxx | 1 - sd/source/ui/unoidl/unopage.cxx | 1 - sd/source/ui/unoidl/unopback.cxx | 1 - sd/source/ui/unoidl/unosrch.cxx | 1 - starmath/source/mathmlexport.cxx | 10 ++-- unotools/source/config/saveopt.cxx | 3 +- xmloff/source/style/PageMasterImportPropMapper.cxx | 20 ++------ xmloff/source/style/xmlnumi.cxx | 5 +- .../text/XMLFootnoteConfigurationImportContext.cxx | 3 +- .../text/XMLIndexAlphabeticalSourceContext.cxx | 31 +++--------- .../XMLIndexBibliographyConfigurationContext.cxx | 11 ++-- xmloff/source/text/XMLIndexObjectSourceContext.cxx | 21 ++------ xmloff/source/text/XMLIndexSourceBaseContext.cxx | 9 +--- xmloff/source/text/XMLIndexTOCContext.cxx | 5 +- xmloff/source/text/XMLIndexTOCSourceContext.cxx | 11 ++-- xmloff/source/text/XMLIndexTableSourceContext.cxx | 3 +- xmloff/source/text/XMLIndexUserSourceContext.cxx | 27 +++------- .../source/text/XMLLineNumberingImportContext.cxx | 15 ++---- .../source/text/XMLSectionFootnoteConfigImport.cxx | 15 +++--- xmloff/source/text/XMLSectionImportContext.cxx | 11 ++-- xmloff/source/text/XMLTextColumnsContext.cxx | 5 +- xmloff/source/text/XMLTextFrameContext.cxx | 19 +++---- xmloff/source/text/XMLTextHeaderFooterContext.cxx | 25 +++------ xmloff/source/text/XMLTextShapeStyleContext.cxx | 6 +-- xmloff/source/text/txtfldi.cxx | 59 ++++++++-------------- xmloff/source/text/txtstyli.cxx | 5 +- xmloff/source/text/txtvfldi.cxx | 37 +++++--------- 33 files changed, 113 insertions(+), 300 deletions(-) delete mode 100644 sd/source/ui/unoidl/unohelp.hxx diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx index 5acd04abc3a8..ed37f51f38a1 100644 --- a/cui/source/options/optasian.cxx +++ b/cui/source/options/optasian.cxx @@ -187,10 +187,8 @@ bool SvxAsianLayoutPage::FillItemSet( SfxItemSet* ) OUString sPunct(cIsKernAsianPunctuation); if(pImpl->xPrSetInfo.is() && pImpl->xPrSetInfo->hasPropertyByName(sPunct)) { - Any aVal; - sal_Bool bVal = !m_pCharKerningRB->IsChecked(); - aVal.setValue(&bVal, cppu::UnoType::get()); - pImpl->xPrSet->setPropertyValue(sPunct, aVal); + bool bVal = !m_pCharKerningRB->IsChecked(); + pImpl->xPrSet->setPropertyValue(sPunct, Any(bVal)); } } diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index a11d6310c1bd..dce92b1d00c2 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -1369,9 +1369,7 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel( xPropSet->setPropertyValue("StringItemList", aAny); - sal_Bool bTrue = true; - aAny.setValue( &bTrue, cppu::UnoType::get() ); - xPropSet->setPropertyValue( "Dropdown", aAny ); + xPropSet->setPropertyValue( "Dropdown", Any(true) ); } Reference< XFormComponent > aFormComp(xModel,UNO_QUERY ); diff --git a/sd/source/ui/unoidl/unocpres.cxx b/sd/source/ui/unoidl/unocpres.cxx index d7835157dd78..90f6b6d16a7f 100644 --- a/sd/source/ui/unoidl/unocpres.cxx +++ b/sd/source/ui/unoidl/unocpres.cxx @@ -27,7 +27,6 @@ #include #include "createunocustomshow.hxx" -#include "unohelp.hxx" #include "unomodel.hxx" #include "drawdoc.hxx" #include "unocpres.hxx" diff --git a/sd/source/ui/unoidl/unohelp.hxx b/sd/source/ui/unoidl/unohelp.hxx deleted file mode 100644 index 25b76f8648b9..000000000000 --- a/sd/source/ui/unoidl/unohelp.hxx +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SD_SOURCE_UI_UNOIDL_UNOHELP_HXX -#define INCLUDED_SD_SOURCE_UI_UNOIDL_UNOHELP_HXX - -namespace sd -{ -inline void bool2any( bool bBool, css::uno::Any& rAny ) -{ - rAny.setValue( &bBool, cppu::UnoType::get() ); -} - -} - -#endif // INCLUDED_SD_SOURCE_UI_UNOIDL_UNOHELP_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index b556ae33f120..4d44236d066a 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -37,7 +37,6 @@ #include "unoprnms.hxx" #include #include -#include "unohelp.hxx" #include "FrameView.hxx" #include "DrawViewShell.hxx" #include "View.hxx" @@ -258,13 +257,13 @@ uno::Any SAL_CALL SdLayer::getPropertyValue( const OUString& PropertyName ) switch( pEntry ? pEntry->nWID : -1 ) { case WID_LAYER_LOCKED: - sd::bool2any( get( LOCKED ), aValue ); + aValue <<= get( LOCKED ); break; case WID_LAYER_PRINTABLE: - sd::bool2any( get( PRINTABLE ), aValue ); + aValue <<= get( PRINTABLE ); break; case WID_LAYER_VISIBLE: - sd::bool2any( get( VISIBLE ), aValue ); + aValue <<= get( VISIBLE ); break; case WID_LAYER_NAME: { diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 674ae3de4c4e..845a8de78a72 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -78,7 +78,6 @@ #include #include -#include "unohelp.hxx" #include #include #include diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index f833ae5b7373..d1d68073cb7b 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -59,7 +59,6 @@ #include #include "anminfo.hxx" -#include "unohelp.hxx" #include "unoobj.hxx" #include "unoprnms.hxx" #include "unomodel.hxx" diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 4aafc5f75910..4db7930b7531 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -70,7 +70,6 @@ #include "res_bmp.hrc" #include "unokywds.hxx" #include "unopback.hxx" -#include "unohelp.hxx" #include #include #include diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index e7eb5b75f51a..06941d2204ee 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -31,7 +31,6 @@ #include #include "unopback.hxx" -#include "unohelp.hxx" #include "drawdoc.hxx" #include "unokywds.hxx" diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx index a4353007c9fa..fd80a34d320d 100644 --- a/sd/source/ui/unoidl/unosrch.cxx +++ b/sd/source/ui/unoidl/unosrch.cxx @@ -27,7 +27,6 @@ #include -#include "unohelp.hxx" #include "unoprnms.hxx" #include "unosrch.hxx" diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index 8f9e96856541..aea07edde6e1 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -161,10 +161,8 @@ bool SmXMLExportWrapper::Export(SfxMedium &rMedium) SvtSaveOptions aSaveOpt; OUString sUsePrettyPrinting("UsePrettyPrinting"); - sal_Bool bUsePrettyPrinting( bFlat || aSaveOpt.IsPrettyPrinting() ); - Any aAny; - aAny.setValue( &bUsePrettyPrinting, cppu::UnoType::get() ); - xInfoSet->setPropertyValue( sUsePrettyPrinting, aAny ); + bool bUsePrettyPrinting( bFlat || aSaveOpt.IsPrettyPrinting() ); + xInfoSet->setPropertyValue( sUsePrettyPrinting, Any(bUsePrettyPrinting) ); // Set base URI OUString sPropName( "BaseURI" ); @@ -337,9 +335,7 @@ bool SmXMLExportWrapper::WriteThroughComponent( // all streams must be encrypted in encrypted document OUString aTmpPropName( "UseCommonStoragePasswordEncryption" ); - sal_Bool bTrue = true; - aAny.setValue( &bTrue, cppu::UnoType::get() ); - xSet->setPropertyValue( aTmpPropName, aAny ); + xSet->setPropertyValue( aTmpPropName, Any(true) ); // set Base URL if ( rPropSet.is() ) diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx index 0b4f7a752dda..84b0e979c9c7 100644 --- a/unotools/source/config/saveopt.cxx +++ b/unotools/source/config/saveopt.cxx @@ -800,8 +800,7 @@ SvtLoadOptions_Impl::~SvtLoadOptions_Impl() void SvtLoadOptions_Impl::ImplCommit() { Sequence< OUString > aNames { cUserDefinedSettings }; - Sequence< Any > aValues( 1 ); - aValues[0].setValue(&bLoadUserDefinedSettings, cppu::UnoType::get()); + Sequence< Any > aValues { Any(bLoadUserDefinedSettings) }; PutProperties( aNames, aValues ); } diff --git a/xmloff/source/style/PageMasterImportPropMapper.cxx b/xmloff/source/style/PageMasterImportPropMapper.cxx index ebab21f51624..5d7016c22e3b 100644 --- a/xmloff/source/style/PageMasterImportPropMapper.cxx +++ b/xmloff/source/style/PageMasterImportPropMapper.cxx @@ -313,31 +313,19 @@ void PageMasterImportPropertyMapper::finished(std::vector< XMLPropertyState >& r if (pHeaderHeight) { - sal_Bool bValue(false); - uno::Any aAny; - aAny.setValue( &bValue, cppu::UnoType::get() ); - xHeaderDynamic.reset(new XMLPropertyState(pHeaderHeight->mnIndex + 2, aAny)); + xHeaderDynamic.reset(new XMLPropertyState(pHeaderHeight->mnIndex + 2, Any(false))); } if (pHeaderMinHeight) { - sal_Bool bValue(true); - uno::Any aAny; - aAny.setValue( &bValue, cppu::UnoType::get() ); - xHeaderDynamic.reset(new XMLPropertyState(pHeaderMinHeight->mnIndex + 1, aAny)); + xHeaderDynamic.reset(new XMLPropertyState(pHeaderMinHeight->mnIndex + 1, Any(true))); } if (pFooterHeight) { - sal_Bool bValue(false); - uno::Any aAny; - aAny.setValue( &bValue, cppu::UnoType::get() ); - xFooterDynamic.reset(new XMLPropertyState(pFooterHeight->mnIndex + 2, aAny)); + xFooterDynamic.reset(new XMLPropertyState(pFooterHeight->mnIndex + 2, Any(false))); } if (pFooterMinHeight) { - sal_Bool bValue(true); - uno::Any aAny; - aAny.setValue( &bValue, cppu::UnoType::get() ); - xFooterDynamic.reset(new XMLPropertyState(pFooterMinHeight->mnIndex + 1, aAny)); + xFooterDynamic.reset(new XMLPropertyState(pFooterMinHeight->mnIndex + 1, Any(true))); } // fdo#38056: nerf the various AllFoo properties so they do not override diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index 4239164ac0bd..09280f2291f5 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -1112,10 +1112,7 @@ void SvxXMLListStyleContext::FillUnoNumRule( if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName( sIsContinuousNumbering ) ) { - Any aAny; - sal_Bool bTmp = bConsecutive; - aAny.setValue( &bTmp, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sIsContinuousNumbering, aAny ); + xPropSet->setPropertyValue( sIsContinuousNumbering, Any(bConsecutive) ); } } catch (const Exception&) diff --git a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx index b2edb7c5175d..a2e16843d0b2 100644 --- a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx @@ -407,8 +407,7 @@ void XMLFootnoteConfigurationImportContext::ProcessSettings( if (!bIsEndnote) { - aAny.setValue(&bPosition, cppu::UnoType::get()); - rConfig->setPropertyValue(sPropertyPositionEndOfDoc, aAny); + rConfig->setPropertyValue(sPropertyPositionEndOfDoc, Any(bPosition)); aAny <<= nNumbering; rConfig->setPropertyValue(sPropertyFootnoteCounting, aAny); diff --git a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx index b5b19233241e..ebf106523ee0 100644 --- a/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx +++ b/xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx @@ -199,29 +199,14 @@ void XMLIndexAlphabeticalSourceContext::EndElement() rIndexPropertySet->setPropertyValue(sMainEntryCharacterStyleName,aAny); } - aAny.setValue(&bSeparators, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sUseAlphabeticalSeparators, aAny); - - aAny.setValue(&bCombineEntries, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sUseCombinedEntries, aAny); - - aAny.setValue(&bCaseSensitive, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sIsCaseSensitive, aAny); - - aAny.setValue(&bEntry, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sUseKeyAsEntry, aAny); - - aAny.setValue(&bUpperCase, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sUseUpperCase, aAny); - - aAny.setValue(&bCombineDash, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sUseDash, aAny); - - aAny.setValue(&bCombinePP, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sUsePP, aAny); - - aAny.setValue(&bCommaSeparated, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sIsCommaSeparated, aAny); + rIndexPropertySet->setPropertyValue(sUseAlphabeticalSeparators, css::uno::Any(bSeparators)); + rIndexPropertySet->setPropertyValue(sUseCombinedEntries, css::uno::Any(bCombineEntries)); + rIndexPropertySet->setPropertyValue(sIsCaseSensitive, css::uno::Any(bCaseSensitive)); + rIndexPropertySet->setPropertyValue(sUseKeyAsEntry, css::uno::Any(bEntry)); + rIndexPropertySet->setPropertyValue(sUseUpperCase, css::uno::Any(bUpperCase)); + rIndexPropertySet->setPropertyValue(sUseDash, css::uno::Any(bCombineDash)); + rIndexPropertySet->setPropertyValue(sUsePP, css::uno::Any(bCombinePP)); + rIndexPropertySet->setPropertyValue(sIsCommaSeparated, css::uno::Any(bCommaSeparated)); if (!sAlgorithm.isEmpty()) diff --git a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx index 5adef3de47ee..5ed4f8fc963a 100644 --- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx +++ b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx @@ -158,7 +158,7 @@ SvXMLImportContext *XMLIndexBibliographyConfigurationContext::CreateChildContext const Reference & xAttrList ) { OUString sKey; - sal_Bool bSort(true); + bool bSort(true); // process children here and use default context! if ( ( nPrefix == XML_NAMESPACE_TEXT ) && @@ -207,8 +207,7 @@ SvXMLImportContext *XMLIndexBibliographyConfigurationContext::CreateChildContext PropertyValue aSortValue; aSortValue.Name = sIsSortAscending; - aAny.setValue(&bSort, cppu::UnoType::get()); - aSortValue.Value = aAny; + aSortValue.Value = Any(bSort); aKey[1] = aSortValue; aSortKeys.push_back(aKey); @@ -257,11 +256,9 @@ void XMLIndexBibliographyConfigurationContext::CreateAndInsert(bool) aAny <<= sPrefix; xPropSet->setPropertyValue(sBracketBefore, aAny); - aAny.setValue(&bNumberedEntries, cppu::UnoType::get()); - xPropSet->setPropertyValue(sIsNumberEntries, aAny); + xPropSet->setPropertyValue(sIsNumberEntries, Any(bNumberedEntries)); - aAny.setValue(&bSortByPosition, cppu::UnoType::get()); - xPropSet->setPropertyValue(sIsSortByPosition, aAny); + xPropSet->setPropertyValue(sIsSortByPosition, Any(bSortByPosition)); if( !maLanguageTagODF.isEmpty() ) { diff --git a/xmloff/source/text/XMLIndexObjectSourceContext.cxx b/xmloff/source/text/XMLIndexObjectSourceContext.cxx index fba25b3e7353..be1c5e95e14e 100644 --- a/xmloff/source/text/XMLIndexObjectSourceContext.cxx +++ b/xmloff/source/text/XMLIndexObjectSourceContext.cxx @@ -128,22 +128,11 @@ void XMLIndexObjectSourceContext::ProcessAttribute( void XMLIndexObjectSourceContext::EndElement() { - Any aAny; - - aAny.setValue(&bUseCalc, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromStarCalc, aAny); - - aAny.setValue(&bUseChart, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromStarChart, aAny); - - aAny.setValue(&bUseDraw, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromStarDraw, aAny); - - aAny.setValue(&bUseMath, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromStarMath, aAny); - - aAny.setValue(&bUseOtherObjects, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromOtherEmbeddedObjects, aAny); + rIndexPropertySet->setPropertyValue(sCreateFromStarCalc, css::uno::Any(bUseCalc)); + rIndexPropertySet->setPropertyValue(sCreateFromStarChart, css::uno::Any(bUseChart)); + rIndexPropertySet->setPropertyValue(sCreateFromStarDraw, css::uno::Any(bUseDraw)); + rIndexPropertySet->setPropertyValue(sCreateFromStarMath, css::uno::Any(bUseMath)); + rIndexPropertySet->setPropertyValue(sCreateFromOtherEmbeddedObjects, css::uno::Any(bUseOtherObjects)); XMLIndexSourceBaseContext::EndElement(); } diff --git a/xmloff/source/text/XMLIndexSourceBaseContext.cxx b/xmloff/source/text/XMLIndexSourceBaseContext.cxx index 2d841e3d6747..03483c0d5678 100644 --- a/xmloff/source/text/XMLIndexSourceBaseContext.cxx +++ b/xmloff/source/text/XMLIndexSourceBaseContext.cxx @@ -216,13 +216,8 @@ void XMLIndexSourceBaseContext::ProcessAttribute( void XMLIndexSourceBaseContext::EndElement() { - Any aAny; - - aAny.setValue(&bRelativeTabs, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sIsRelativeTabstops, aAny); - - aAny.setValue(&bChapterIndex, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromChapter, aAny); + rIndexPropertySet->setPropertyValue(sIsRelativeTabstops, css::uno::Any(bRelativeTabs)); + rIndexPropertySet->setPropertyValue(sCreateFromChapter, css::uno::Any(bChapterIndex)); } SvXMLImportContext* XMLIndexSourceBaseContext::CreateChildContext( diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx index 6dbe66af19fe..2e82090ae777 100644 --- a/xmloff/source/text/XMLIndexTOCContext.cxx +++ b/xmloff/source/text/XMLIndexTOCContext.cxx @@ -131,7 +131,7 @@ void XMLIndexTOCContext::StartElement( // find text:protected and set value // find text:name and set value (if not empty) sal_Int16 nCount = xAttrList->getLength(); - sal_Bool bProtected = false; + bool bProtected = false; OUString sIndexName; OUString sXmlId; XMLPropStyleContext* pStyle(nullptr); @@ -241,8 +241,7 @@ void XMLIndexTOCContext::StartElement( } Any aAny; - aAny.setValue( &bProtected, cppu::UnoType::get() ); - xTOCPropertySet->setPropertyValue( sIsProtected, aAny ); + xTOCPropertySet->setPropertyValue( sIsProtected, Any(bProtected) ); if (!sIndexName.isEmpty()) { diff --git a/xmloff/source/text/XMLIndexTOCSourceContext.cxx b/xmloff/source/text/XMLIndexTOCSourceContext.cxx index 59f8497f40b5..3cff73576e63 100644 --- a/xmloff/source/text/XMLIndexTOCSourceContext.cxx +++ b/xmloff/source/text/XMLIndexTOCSourceContext.cxx @@ -137,14 +137,9 @@ void XMLIndexTOCSourceContext::EndElement() { Any aAny; - aAny.setValue(&bUseMarks, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromMarks, aAny); - - aAny.setValue(&bUseOutline, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromOutline, aAny); - - aAny.setValue(&bUseParagraphStyles, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromLevelParagraphStyles, aAny); + rIndexPropertySet->setPropertyValue(sCreateFromMarks, css::uno::Any(bUseMarks)); + rIndexPropertySet->setPropertyValue(sCreateFromOutline, css::uno::Any(bUseOutline)); + rIndexPropertySet->setPropertyValue(sCreateFromLevelParagraphStyles, css::uno::Any(bUseParagraphStyles)); aAny <<= (sal_Int16)nOutlineLevel; rIndexPropertySet->setPropertyValue(sLevel, aAny); diff --git a/xmloff/source/text/XMLIndexTableSourceContext.cxx b/xmloff/source/text/XMLIndexTableSourceContext.cxx index 871a75589604..e4cdea920775 100644 --- a/xmloff/source/text/XMLIndexTableSourceContext.cxx +++ b/xmloff/source/text/XMLIndexTableSourceContext.cxx @@ -128,8 +128,7 @@ void XMLIndexTableSourceContext::EndElement() { Any aAny; - aAny.setValue(&bUseCaption, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromLabels, aAny); + rIndexPropertySet->setPropertyValue(sCreateFromLabels, css::uno::Any(bUseCaption)); if (bSequenceOK) { diff --git a/xmloff/source/text/XMLIndexUserSourceContext.cxx b/xmloff/source/text/XMLIndexUserSourceContext.cxx index a4a2d5cedac1..e1f95d4c1ac0 100644 --- a/xmloff/source/text/XMLIndexUserSourceContext.cxx +++ b/xmloff/source/text/XMLIndexUserSourceContext.cxx @@ -153,26 +153,13 @@ void XMLIndexUserSourceContext::EndElement() { Any aAny; - aAny.setValue(&bUseObjects, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromEmbeddedObjects, aAny); - - aAny.setValue(&bUseGraphic, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromGraphicObjects, aAny); - - aAny.setValue(&bUseLevelFromSource, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sUseLevelFromSource, aAny); - - aAny.setValue(&bUseMarks, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromMarks, aAny); - - aAny.setValue(&bUseTables, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromTables, aAny); - - aAny.setValue(&bUseFrames, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromTextFrames, aAny); - - aAny.setValue(&bUseLevelParagraphStyles, cppu::UnoType::get()); - rIndexPropertySet->setPropertyValue(sCreateFromLevelParagraphStyles, aAny); + rIndexPropertySet->setPropertyValue(sCreateFromEmbeddedObjects, css::uno::Any(bUseObjects)); + rIndexPropertySet->setPropertyValue(sCreateFromGraphicObjects, css::uno::Any(bUseGraphic)); + rIndexPropertySet->setPropertyValue(sUseLevelFromSource, css::uno::Any(bUseLevelFromSource)); + rIndexPropertySet->setPropertyValue(sCreateFromMarks, css::uno::Any(bUseMarks)); + rIndexPropertySet->setPropertyValue(sCreateFromTables, css::uno::Any(bUseTables)); + rIndexPropertySet->setPropertyValue(sCreateFromTextFrames, css::uno::Any(bUseFrames)); + rIndexPropertySet->setPropertyValue(sCreateFromLevelParagraphStyles, css::uno::Any(bUseLevelParagraphStyles)); if( !sIndexName.isEmpty() ) { diff --git a/xmloff/source/text/XMLLineNumberingImportContext.cxx b/xmloff/source/text/XMLLineNumberingImportContext.cxx index d04edaa32e6a..3af8f5b472ba 100644 --- a/xmloff/source/text/XMLLineNumberingImportContext.cxx +++ b/xmloff/source/text/XMLLineNumberingImportContext.cxx @@ -254,17 +254,10 @@ void XMLLineNumberingImportContext::CreateAndInsert(bool) xLineNumbering->setPropertyValue(sSeparatorInterval, aAny); } - aAny.setValue(&bNumberLines, cppu::UnoType::get()); - xLineNumbering->setPropertyValue(sIsOn, aAny); - - aAny.setValue(&bCountEmptyLines, cppu::UnoType::get()); - xLineNumbering->setPropertyValue(sCountEmptyLines, aAny); - - aAny.setValue(&bCountInFloatingFrames, cppu::UnoType::get()); - xLineNumbering->setPropertyValue(sCountLinesInFrames, aAny); - - aAny.setValue(&bRestartNumbering, cppu::UnoType::get()); - xLineNumbering->setPropertyValue(sRestartAtEachPage, aAny); + xLineNumbering->setPropertyValue(sIsOn, Any(bNumberLines)); + xLineNumbering->setPropertyValue(sCountEmptyLines, Any(bCountEmptyLines)); + xLineNumbering->setPropertyValue(sCountLinesInFrames, Any(bCountInFloatingFrames)); + xLineNumbering->setPropertyValue(sRestartAtEachPage, Any(bRestartNumbering)); sal_Int16 nNumType = NumberingType::ARABIC; GetImport().GetMM100UnitConverter().convertNumFormat( nNumType, diff --git a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx index b13bf411e0d8..ad2ff935f30b 100644 --- a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx +++ b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx @@ -65,9 +65,9 @@ XMLSectionFootnoteConfigImport::~XMLSectionFootnoteConfigImport() void XMLSectionFootnoteConfigImport::StartElement( const Reference & xAttrList) { - sal_Bool bEnd = true; // we're inside the element, so this is true - sal_Bool bNumOwn = false; - sal_Bool bNumRestart = false; + bool bEnd = true; // we're inside the element, so this is true + bool bNumOwn = false; + bool bNumRestart = false; bool bEndnote = false; sal_Int16 nNumRestartAt = 0; OUString sNumPrefix; @@ -130,16 +130,14 @@ void XMLSectionFootnoteConfigImport::StartElement( // OK, now we have all values and can fill the XMLPropertyState vector Any aAny; - aAny.setValue( &bNumOwn, cppu::UnoType::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::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; @@ -171,10 +169,9 @@ void XMLSectionFootnoteConfigImport::StartElement( XMLPropertyState aSuffixState( nIndex, aAny ); rProperties.push_back( aSuffixState ); - aAny.setValue( &bEnd, cppu::UnoType::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 440bfab11cf9..d89abf0240a4 100644 --- a/xmloff/source/text/XMLSectionImportContext.cxx +++ b/xmloff/source/text/XMLSectionImportContext.cxx @@ -168,17 +168,14 @@ void XMLSectionImportContext::StartElement( if (! bIsIndexHeader) { Any aAny; - aAny.setValue( &bIsVisible, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sIsVisible, aAny ); + xPropSet->setPropertyValue( sIsVisible, Any(bIsVisible) ); // #97450# hidden sections must be hidden on reload // For backwards compatibility, set flag only if it is // present if( bIsCurrentlyVisibleOK ) { - aAny.setValue( &bIsCurrentlyVisible, - cppu::UnoType::get() ); - xPropSet->setPropertyValue( sIsCurrentlyVisible, aAny); + xPropSet->setPropertyValue( sIsCurrentlyVisible, Any(bIsCurrentlyVisible)); } if (bCondOK) @@ -198,9 +195,7 @@ void XMLSectionImportContext::StartElement( } // protection - Any aAny; - aAny.setValue( &bProtect, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sIsProtected, aAny ); + xPropSet->setPropertyValue( sIsProtected, Any(bProtect) ); // insert marker, , marker; then insert // section over the first marker character, and delete the diff --git a/xmloff/source/text/XMLTextColumnsContext.cxx b/xmloff/source/text/XMLTextColumnsContext.cxx index b99a4506e6e2..e25e6a465de8 100644 --- a/xmloff/source/text/XMLTextColumnsContext.cxx +++ b/xmloff/source/text/XMLTextColumnsContext.cxx @@ -443,10 +443,9 @@ void XMLTextColumnsContext::EndElement( ) if( xPropSet.is() ) { Any aAny; - sal_Bool bOn = pColumnSep != nullptr; + bool bOn = pColumnSep != nullptr; - aAny.setValue( &bOn, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sSeparatorLineIsOn, aAny ); + xPropSet->setPropertyValue( sSeparatorLineIsOn, Any(bOn) ); if( pColumnSep ) { diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 7de81faf5ce1..4001d26243c2 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -225,7 +225,7 @@ XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl( { OUString sD, sPoints, sViewBox; bool bPixelWidth = false, bPixelHeight = false; - sal_Bool bAuto = false; + bool bAuto = false; sal_Int32 nWidth = 0; sal_Int32 nHeight = 0; @@ -325,16 +325,14 @@ XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl( if( xPropSetInfo->hasPropertyByName( sIsPixelContour ) ) { - aAny.setValue( &bPixelWidth, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sIsPixelContour, aAny ); + xPropSet->setPropertyValue( sIsPixelContour, Any(bPixelWidth) ); } const OUString sIsAutomaticContour("IsAutomaticContour"); if( xPropSetInfo->hasPropertyByName( sIsAutomaticContour ) ) { - aAny.setValue( &bAuto, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sIsAutomaticContour, aAny ); + xPropSet->setPropertyValue( sIsAutomaticContour, Any(bAuto) ); } } } @@ -663,9 +661,7 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ ) } if( bSyncWidth || nWidth > 0 ) { - sal_Bool bTmp = bSyncWidth; - aAny.setValue( &bTmp, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sIsSyncWidthToHeight, aAny ); + xPropSet->setPropertyValue( sIsSyncWidthToHeight, Any(bSyncWidth) ); } if( xPropSetInfo->hasPropertyByName( sWidthType ) && (bMinWidth || nWidth > 0 || nRelWidth > 0 ) ) @@ -689,9 +685,7 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ ) } if( bSyncHeight || nHeight > 0 ) { - sal_Bool bTmp = bSyncHeight; - aAny.setValue( &bTmp, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sIsSyncHeightToWidth, aAny ); + xPropSet->setPropertyValue( sIsSyncHeightToWidth, Any(bSyncHeight) ); } if( xPropSetInfo->hasPropertyByName( sSizeType ) && (bMinHeight || nHeight > 0 || nRelHeight > 0 ) ) @@ -1295,8 +1289,7 @@ void XMLTextFrameContext_Impl::SetHyperlink( const OUString& rHRef, if (xPropSetInfo->hasPropertyByName(s_ServerMap)) { - aAny.setValue( &bMap, cppu::UnoType::get() ); - xPropSet->setPropertyValue(s_ServerMap, aAny); + xPropSet->setPropertyValue(s_ServerMap, Any(bMap)); } } diff --git a/xmloff/source/text/XMLTextHeaderFooterContext.cxx b/xmloff/source/text/XMLTextHeaderFooterContext.cxx index 90f22089147d..dd14bf7e1dc2 100644 --- a/xmloff/source/text/XMLTextHeaderFooterContext.cxx +++ b/xmloff/source/text/XMLTextHeaderFooterContext.cxx @@ -71,9 +71,7 @@ XMLTextHeaderFooterContext::XMLTextHeaderFooterContext( SvXMLImport& rImport, sa if( bShared ) { // Don't share headers any longer - bShared = false; - aAny.setValue( &bShared, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sShareContent, aAny ); + xPropSet->setPropertyValue( sShareContent, Any(false) ); } } if (bFirst) @@ -85,9 +83,7 @@ XMLTextHeaderFooterContext::XMLTextHeaderFooterContext( SvXMLImport& rImport, sa if( bSharedFirst ) { // Don't share first/right headers any longer - bSharedFirst = false; - aAny.setValue( &bSharedFirst, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sShareContentFirst, aAny ); + xPropSet->setPropertyValue( sShareContentFirst, Any(false) ); } } } @@ -128,14 +124,12 @@ SvXMLImportContext *XMLTextHeaderFooterContext::CreateChildContext( else { aAny = xPropSet->getPropertyValue( sOn ); - sal_Bool bOn = *static_cast(aAny.getValue()); + bool bOn = *static_cast(aAny.getValue()); if( !bOn ) { // Switch header on - bOn = true; - aAny.setValue( &bOn, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sOn, aAny ); + xPropSet->setPropertyValue( sOn, Any(true) ); // The content has not to be removed, because the header // or footer is empty already. @@ -144,12 +138,10 @@ SvXMLImportContext *XMLTextHeaderFooterContext::CreateChildContext( // If a header or footer is not shared, share it now. aAny = xPropSet->getPropertyValue( sShareContent ); - sal_Bool bShared = *static_cast(aAny.getValue()); + bool bShared = *static_cast(aAny.getValue()); if( !bShared ) { - bShared = true; - aAny.setValue( &bShared, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sShareContent, aAny ); + xPropSet->setPropertyValue( sShareContent, Any(true) ); } aAny = xPropSet->getPropertyValue( sText ); @@ -201,10 +193,7 @@ void XMLTextHeaderFooterContext::EndElement() { // If no content has been inserted into the header or footer, // switch it off. - sal_Bool bOn = false; - Any aAny; - aAny.setValue( &bOn, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sOn, aAny ); + xPropSet->setPropertyValue( sOn, Any(false) ); } } diff --git a/xmloff/source/text/XMLTextShapeStyleContext.cxx b/xmloff/source/text/XMLTextShapeStyleContext.cxx index 8b6b7c6fefb4..77cdcf096a79 100644 --- a/xmloff/source/text/XMLTextShapeStyleContext.cxx +++ b/xmloff/source/text/XMLTextShapeStyleContext.cxx @@ -212,10 +212,8 @@ void XMLTextShapeStyleContext::CreateAndInsert( bool bOverwrite ) xPropSet->getPropertySetInfo(); if( xPropSetInfo->hasPropertyByName( sIsAutoUpdate ) ) { - Any aAny; - sal_Bool bTmp = bAutoUpdate; - aAny.setValue( &bTmp, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sIsAutoUpdate, aAny ); + bool bTmp = bAutoUpdate; + xPropSet->setPropertyValue( sIsAutoUpdate, Any(bTmp) ); } // tell the style about it's events (if applicable) diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index 3e592895e2bc..50b7dca74ebe 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -712,8 +712,7 @@ void XMLSenderFieldImportContext::PrepareField( rPropSet->setPropertyValue(sPropertyFieldSubType, aAny); // set fixed - aAny.setValue( &bFixed, cppu::UnoType::get() ); - rPropSet->setPropertyValue(sPropertyFixed, aAny); + rPropSet->setPropertyValue(sPropertyFixed, Any(bFixed)); // set content if fixed if (bFixed) @@ -766,11 +765,9 @@ void XMLAuthorFieldImportContext::PrepareField( { // set members Any aAny; - aAny.setValue( &bAuthorFullName, cppu::UnoType::get() ); - rPropSet->setPropertyValue(sPropertyAuthorFullName, aAny); + rPropSet->setPropertyValue(sPropertyAuthorFullName, Any(bAuthorFullName)); - aAny.setValue( &bFixed, cppu::UnoType::get() ); - rPropSet->setPropertyValue(sPropertyFixed, aAny); + rPropSet->setPropertyValue(sPropertyFixed, Any(bFixed)); // set content if fixed if (bFixed) @@ -1128,12 +1125,10 @@ void XMLTimeFieldImportContext::PrepareField( if (xPropertySetInfo->hasPropertyByName(sPropertyFixed)) { - aAny.setValue( &bFixed, cppu::UnoType::get() ); - rPropertySet->setPropertyValue(sPropertyFixed, aAny); + rPropertySet->setPropertyValue(sPropertyFixed, Any(bFixed)); } - aAny.setValue( &bIsDate, cppu::UnoType::get() ); - rPropertySet->setPropertyValue(sPropertyIsDate, aAny); + rPropertySet->setPropertyValue(sPropertyIsDate, Any(bIsDate)); if (xPropertySetInfo->hasPropertyByName(sPropertyAdjust)) { @@ -1177,9 +1172,8 @@ void XMLTimeFieldImportContext::PrepareField( if( xPropertySetInfo->hasPropertyByName( sPropertyIsFixedLanguage ) ) { - sal_Bool bIsFixedLanguage = ! bIsDefaultLanguage; - aAny.setValue( &bIsFixedLanguage, cppu::UnoType::get() ); - rPropertySet->setPropertyValue( sPropertyIsFixedLanguage, aAny ); + bool bIsFixedLanguage = ! bIsDefaultLanguage; + rPropertySet->setPropertyValue( sPropertyIsFixedLanguage, Any(bIsFixedLanguage) ); } } } @@ -1363,8 +1357,7 @@ void XMLDatabaseFieldImportContext::PrepareField( if( bUseDisplay && bDisplayOK ) { - aAny.setValue( &bDisplay, cppu::UnoType::get() ); - xPropertySet->setPropertyValue( sPropertyIsVisible, aAny ); + xPropertySet->setPropertyValue( sPropertyIsVisible, Any(bDisplay) ); } } @@ -1612,8 +1605,7 @@ void XMLSimpleDocInfoImportContext::PrepareField( if (xPropertySetInfo->hasPropertyByName(sPropertyFixed)) { Any aAny; - aAny.setValue(&bFixed, cppu::UnoType::get() ); - rPropertySet->setPropertyValue(sPropertyFixed, aAny); + rPropertySet->setPropertyValue(sPropertyFixed, Any(bFixed)); // set Content and CurrentPresentation (if fixed) if (bFixed) @@ -1837,8 +1829,7 @@ void XMLDateTimeDocInfoImportContext::PrepareField( if (bHasDateTime) { - aAny.setValue( &bIsDate, cppu::UnoType::get()); - xPropertySet->setPropertyValue(sPropertyIsDate, aAny); + xPropertySet->setPropertyValue(sPropertyIsDate, Any(bIsDate)); } if (bFormatOK) @@ -1849,9 +1840,8 @@ void XMLDateTimeDocInfoImportContext::PrepareField( if( xPropertySet->getPropertySetInfo()-> hasPropertyByName( sPropertyIsFixedLanguage ) ) { - sal_Bool bIsFixedLanguage = ! bIsDefaultLanguage; - aAny.setValue( &bIsFixedLanguage, cppu::UnoType::get() ); - xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, aAny ); + bool bIsFixedLanguage = ! bIsDefaultLanguage; + xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, Any(bIsFixedLanguage) ); } } @@ -1932,9 +1922,8 @@ void XMLUserDocInfoImportContext::PrepareField( if( xPropertySetInfo->hasPropertyByName( sPropertyIsFixedLanguage ) ) { - sal_Bool bIsFixedLanguage = ! bIsDefaultLanguage; - aAny.setValue( &bIsFixedLanguage, cppu::UnoType::get() ); - xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, aAny ); + bool bIsFixedLanguage = ! bIsDefaultLanguage; + xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, Any(bIsFixedLanguage) ); } } @@ -1992,8 +1981,7 @@ void XMLHiddenParagraphImportContext::PrepareField( aAny <<= sCondition; xPropertySet->setPropertyValue(sPropertyCondition, aAny); - aAny.setValue( &bIsHidden, cppu::UnoType::get() ); - xPropertySet->setPropertyValue(sPropertyIsHidden, aAny); + xPropertySet->setPropertyValue(sPropertyIsHidden, Any(bIsHidden)); } @@ -2073,8 +2061,7 @@ void XMLConditionalTextImportContext::PrepareField( aAny <<= sTrueContent; xPropertySet->setPropertyValue(sPropertyTrueContent, aAny); - aAny.setValue( &bCurrentValue, cppu::UnoType::get() ); - xPropertySet->setPropertyValue(sPropertyIsConditionTrue, aAny); + xPropertySet->setPropertyValue(sPropertyIsConditionTrue, Any(bCurrentValue)); aAny <<= GetContent(); xPropertySet->setPropertyValue(sPropertyCurrentPresentation, aAny); @@ -2147,8 +2134,7 @@ void XMLHiddenTextImportContext::PrepareField( aAny <<= sString; xPropertySet->setPropertyValue(sPropertyContent, aAny); - aAny.setValue( &bIsHidden, cppu::UnoType::get() ); - xPropertySet->setPropertyValue(sPropertyIsHidden, aAny); + xPropertySet->setPropertyValue(sPropertyIsHidden, Any(bIsHidden)); } @@ -2577,8 +2563,7 @@ void XMLPageVarSetFieldImportContext::PrepareField( { Any aAny; - aAny.setValue(&bActive, cppu::UnoType::get()); - xPropertySet->setPropertyValue(sPropertyOn, aAny); + xPropertySet->setPropertyValue(sPropertyOn, Any(bActive)); aAny <<= nAdjust; xPropertySet->setPropertyValue(sPropertyOffset, aAny); @@ -2933,7 +2918,7 @@ void XMLDdeFieldDeclImportContext::StartElement( OUString sCommandTopic; OUString sCommandItem; - sal_Bool bUpdate = false; + bool bUpdate = false; bool bNameOK = false; bool bCommandApplicationOK = false; bool bCommandTopicOK = false; @@ -3024,9 +3009,8 @@ void XMLDdeFieldDeclImportContext::StartElement( xPropSet->setPropertyValue(sPropertyDDECommandElement, aAny); - aAny.setValue(&bUpdate, cppu::UnoType::get()); xPropSet->setPropertyValue(sPropertyIsAutomaticUpdate, - aAny); + Any(bUpdate)); } // else: ignore (can't get XPropertySet, or DDE // properties are not supported) @@ -3772,8 +3756,7 @@ void XMLScriptImportContext::PrepareField( xPropertySet->setPropertyValue(sPropertyContent, aAny); // URL or script text? We use URL if we have an href-attribute - aAny.setValue(&bContentOK, cppu::UnoType::get()); - xPropertySet->setPropertyValue(sPropertyURLContent, aAny); + xPropertySet->setPropertyValue(sPropertyURLContent, Any(bContentOK)); aAny <<= sScriptType; xPropertySet->setPropertyValue(sPropertyScriptType, aAny); diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index e0557519e2be..a9332109d2eb 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -215,10 +215,7 @@ void XMLTextStyleContext::CreateAndInsert( bool bOverwrite ) xPropSet->getPropertySetInfo(); if( xPropSetInfo->hasPropertyByName( sIsAutoUpdate ) ) { - Any aAny; - sal_Bool bTmp = bAutoUpdate; - aAny.setValue( &bTmp, cppu::UnoType::get() ); - xPropSet->setPropertyValue( sIsAutoUpdate, aAny ); + xPropSet->setPropertyValue( sIsAutoUpdate, Any(bAutoUpdate) ); } sal_uInt16 nCategory = ParagraphStyleCategory::TEXT; diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx index 5ca8d33450f6..01016aa50864 100644 --- a/xmloff/source/text/txtvfldi.cxx +++ b/xmloff/source/text/txtvfldi.cxx @@ -241,10 +241,8 @@ void XMLVarFieldImportContext::PrepareField( if (bSetVisible && bDisplayOK) { - Any aAny; - sal_Bool bTmp = ! (bDisplayNone && bDisplayOK); - aAny.setValue( &bTmp, cppu::UnoType::get()); - xPropertySet->setPropertyValue(sPropertyIsVisible, aAny); + bool bTmp = ! (bDisplayNone && bDisplayOK); + xPropertySet->setPropertyValue(sPropertyIsVisible, Any(bTmp)); } // workaround for #no-bug#: display formula by default @@ -259,10 +257,8 @@ void XMLVarFieldImportContext::PrepareField( if (bSetDisplayFormula) { - Any aAny; - sal_Bool bTmp = bDisplayFormula && bDisplayOK; - aAny.setValue( &bTmp, cppu::UnoType::get()); - xPropertySet->setPropertyValue(sPropertyIsDisplayFormula, aAny); + bool bTmp = bDisplayFormula && bDisplayOK; + xPropertySet->setPropertyValue(sPropertyIsDisplayFormula, Any(bTmp)); } // delegate to value helper @@ -489,9 +485,7 @@ void XMLVariableInputFieldImportContext::PrepareField( { // set type (input field) Any aAny; - sal_Bool bTrue = true; - aAny.setValue( &bTrue, cppu::UnoType::get() ); - xPropertySet->setPropertyValue(sPropertyIsInput, aAny); + xPropertySet->setPropertyValue(sPropertyIsInput, Any(true)); // set type aAny <<= (IsStringValue()? SetVariableType::STRING : SetVariableType::VAR); @@ -698,8 +692,7 @@ void XMLTableFormulaImportContext::PrepareField( Any aAny; // set 'show formula' and presentation - aAny.setValue( &bIsShowFormula, cppu::UnoType::get() ); - xPropertySet->setPropertyValue( sPropertyIsShowFormula, aAny ); + xPropertySet->setPropertyValue( sPropertyIsShowFormula, Any(bIsShowFormula) ); aAny <<= GetContent(); xPropertySet->setPropertyValue( sPropertyCurrentPresentation, aAny ); @@ -867,9 +860,8 @@ XMLVariableDeclImportContext::XMLVariableDeclImportContext( break; case VarTypeUserField: { - sal_Bool bTmp = !aValueHelper.IsStringValue(); - aAny.setValue(&bTmp, cppu::UnoType::get()); - xFieldMaster->setPropertyValue(sPropertyIsExpression, aAny); + bool bTmp = !aValueHelper.IsStringValue(); + xFieldMaster->setPropertyValue(sPropertyIsExpression, Any(bTmp)); aValueHelper.PrepareField(xFieldMaster); break; } @@ -1112,9 +1104,8 @@ void XMLDatabaseDisplayImportContext::EndElement() GetImportHelper().InsertTextContent(xTextContent); // prepare field: format from database? - sal_Bool bTmp = !aValueHelper.IsFormatOK(); - aAny.setValue( &bTmp, cppu::UnoType::get() ); - xField->setPropertyValue(sPropertyDatabaseFormat,aAny); + bool bTmp = !aValueHelper.IsFormatOK(); + xField->setPropertyValue(sPropertyDatabaseFormat, Any(bTmp)); // value, value-type and format done by value helper aValueHelper.PrepareField(xField); @@ -1122,8 +1113,7 @@ void XMLDatabaseDisplayImportContext::EndElement() // visibility if( bDisplayOK ) { - aAny.setValue( &bDisplay, cppu::UnoType::get() ); - xField->setPropertyValue(sPropertyIsVisible, aAny); + xField->setPropertyValue(sPropertyIsVisible, Any(bDisplay)); } // set presentation @@ -1361,9 +1351,8 @@ void XMLValueImportHelper::PrepareField( if( xPropertySet->getPropertySetInfo()-> hasPropertyByName( sPropertyIsFixedLanguage ) ) { - sal_Bool bIsFixedLanguage = ! bIsDefaultLanguage; - aAny.setValue( &bIsFixedLanguage, cppu::UnoType::get() ); - xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, aAny ); + bool bIsFixedLanguage = ! bIsDefaultLanguage; + xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, Any(bIsFixedLanguage) ); } } -- cgit