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 xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx | 3 xmloff/source/text/XMLIndexAlphabeticalSourceContext.cxx | 31 +---- xmloff/source/text/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 +--- xmloff/source/text/XMLLineNumberingImportContext.cxx | 15 -- xmloff/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(-)
New commits: commit 82e9cfc9910005e55f57ab13dd685f8860f47d27 Author: Noel Grandin <n...@peralex.com> Date: Thu Apr 28 14:35:37 2016 +0200 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 <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx index 5acd04a..ed37f51 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<bool>::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 a11d631..dce92b1 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<bool>::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 d783515..90f6b6d 100644 --- a/sd/source/ui/unoidl/unocpres.cxx +++ b/sd/source/ui/unoidl/unocpres.cxx @@ -27,7 +27,6 @@ #include <cppuhelper/supportsservice.hxx> #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 25b76f8..0000000 --- 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<bool>::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 b556ae3..4d44236 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -37,7 +37,6 @@ #include "unoprnms.hxx" #include <com/sun/star/lang/NoSupportException.hpp> #include <svx/svdpool.hxx> -#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 674ae3d..845a8de 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -78,7 +78,6 @@ #include <sdpage.hxx> #include <strings.hrc> -#include "unohelp.hxx" #include <unolayer.hxx> #include <unoprnms.hxx> #include <unopage.hxx> diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index f833ae5..d1d6807 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -59,7 +59,6 @@ #include <svx/svdogrp.hxx> #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 4aafc5f..4db7930 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 <vcl/dibtools.hxx> #include <svx/svdograf.hxx> #include <svx/svdoashp.hxx> diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index e7eb5b7..06941d2 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -31,7 +31,6 @@ #include <svx/unoshape.hxx> #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 a435300..fd80a34 100644 --- a/sd/source/ui/unoidl/unosrch.cxx +++ b/sd/source/ui/unoidl/unosrch.cxx @@ -27,7 +27,6 @@ #include <comphelper/extract.hxx> -#include "unohelp.hxx" #include "unoprnms.hxx" #include "unosrch.hxx" diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index 8f9e968..aea07ed 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<bool>::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<bool>::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 0b4f7a7..84b0e97 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<bool>::get()); + Sequence< Any > aValues { Any(bLoadUserDefinedSettings) }; PutProperties( aNames, aValues ); } diff --git a/xmloff/source/style/PageMasterImportPropMapper.cxx b/xmloff/source/style/PageMasterImportPropMapper.cxx index ebab21f..5d7016c 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<bool>::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<bool>::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<bool>::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<bool>::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 4239164..09280f2 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<bool>::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 b2edb7c..a2e1684 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<bool>::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 b5b1923..ebf1065 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<bool>::get()); - rIndexPropertySet->setPropertyValue(sUseAlphabeticalSeparators, aAny); - - aAny.setValue(&bCombineEntries, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sUseCombinedEntries, aAny); - - aAny.setValue(&bCaseSensitive, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sIsCaseSensitive, aAny); - - aAny.setValue(&bEntry, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sUseKeyAsEntry, aAny); - - aAny.setValue(&bUpperCase, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sUseUpperCase, aAny); - - aAny.setValue(&bCombineDash, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sUseDash, aAny); - - aAny.setValue(&bCombinePP, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sUsePP, aAny); - - aAny.setValue(&bCommaSeparated, cppu::UnoType<bool>::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 5adef3de..5ed4f8f 100644 --- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx +++ b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx @@ -158,7 +158,7 @@ SvXMLImportContext *XMLIndexBibliographyConfigurationContext::CreateChildContext const Reference<XAttributeList> & 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<bool>::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<bool>::get()); - xPropSet->setPropertyValue(sIsNumberEntries, aAny); + xPropSet->setPropertyValue(sIsNumberEntries, Any(bNumberedEntries)); - aAny.setValue(&bSortByPosition, cppu::UnoType<bool>::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 fba25b3..be1c5e9 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<bool>::get()); - rIndexPropertySet->setPropertyValue(sCreateFromStarCalc, aAny); - - aAny.setValue(&bUseChart, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sCreateFromStarChart, aAny); - - aAny.setValue(&bUseDraw, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sCreateFromStarDraw, aAny); - - aAny.setValue(&bUseMath, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sCreateFromStarMath, aAny); - - aAny.setValue(&bUseOtherObjects, cppu::UnoType<bool>::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 2d841e3..03483c0 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<bool>::get()); - rIndexPropertySet->setPropertyValue(sIsRelativeTabstops, aAny); - - aAny.setValue(&bChapterIndex, cppu::UnoType<bool>::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 6dbe66a..2e82090 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<bool>::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 59f8497..3cff735 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<bool>::get()); - rIndexPropertySet->setPropertyValue(sCreateFromMarks, aAny); - - aAny.setValue(&bUseOutline, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sCreateFromOutline, aAny); - - aAny.setValue(&bUseParagraphStyles, cppu::UnoType<bool>::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 871a755..e4cdea9 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<bool>::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 a4a2d5c..e1f95d4 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<bool>::get()); - rIndexPropertySet->setPropertyValue(sCreateFromEmbeddedObjects, aAny); - - aAny.setValue(&bUseGraphic, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sCreateFromGraphicObjects, aAny); - - aAny.setValue(&bUseLevelFromSource, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sUseLevelFromSource, aAny); - - aAny.setValue(&bUseMarks, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sCreateFromMarks, aAny); - - aAny.setValue(&bUseTables, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sCreateFromTables, aAny); - - aAny.setValue(&bUseFrames, cppu::UnoType<bool>::get()); - rIndexPropertySet->setPropertyValue(sCreateFromTextFrames, aAny); - - aAny.setValue(&bUseLevelParagraphStyles, cppu::UnoType<bool>::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 d04edaa..3af8f5b 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<bool>::get()); - xLineNumbering->setPropertyValue(sIsOn, aAny); - - aAny.setValue(&bCountEmptyLines, cppu::UnoType<bool>::get()); - xLineNumbering->setPropertyValue(sCountEmptyLines, aAny); - - aAny.setValue(&bCountInFloatingFrames, cppu::UnoType<bool>::get()); - xLineNumbering->setPropertyValue(sCountLinesInFrames, aAny); - - aAny.setValue(&bRestartNumbering, cppu::UnoType<bool>::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 b13bf41..ad2ff93 100644 --- a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx +++ b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx @@ -65,9 +65,9 @@ XMLSectionFootnoteConfigImport::~XMLSectionFootnoteConfigImport() void XMLSectionFootnoteConfigImport::StartElement( const Reference<XAttributeList> & 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<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; @@ -171,10 +169,9 @@ void XMLSectionFootnoteConfigImport::StartElement( XMLPropertyState aSuffixState( nIndex, aAny ); 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 440bfab..d89abf0 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<bool>::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<bool>::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<bool>::get() ); - xPropSet->setPropertyValue( sIsProtected, aAny ); + xPropSet->setPropertyValue( sIsProtected, Any(bProtect) ); // insert marker, <paragraph>, 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 b99a450..e25e6a4 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<bool>::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 7de81fa..4001d26 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<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) ); } } } @@ -663,9 +661,7 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ ) } 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 ) ) @@ -689,9 +685,7 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ ) } 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 ) ) @@ -1295,8 +1289,7 @@ void XMLTextFrameContext_Impl::SetHyperlink( const OUString& rHRef, 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/XMLTextHeaderFooterContext.cxx b/xmloff/source/text/XMLTextHeaderFooterContext.cxx index 90f2208..dd14bf7 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<bool>::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<bool>::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<sal_Bool const *>(aAny.getValue()); + bool bOn = *static_cast<sal_Bool const *>(aAny.getValue()); if( !bOn ) { // Switch header on - bOn = true; - aAny.setValue( &bOn, cppu::UnoType<bool>::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<sal_Bool const *>(aAny.getValue()); + bool bShared = *static_cast<sal_Bool const *>(aAny.getValue()); if( !bShared ) { - bShared = true; - aAny.setValue( &bShared, cppu::UnoType<bool>::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<bool>::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 8b6b7c6..77cdcf0 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<bool>::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 3e59289..50b7dca 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<bool>::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<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) @@ -1128,12 +1125,10 @@ void XMLTimeFieldImportContext::PrepareField( 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)) { @@ -1177,9 +1172,8 @@ void XMLTimeFieldImportContext::PrepareField( 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) ); } } } @@ -1363,8 +1357,7 @@ void XMLDatabaseFieldImportContext::PrepareField( if( bUseDisplay && bDisplayOK ) { - aAny.setValue( &bDisplay, cppu::UnoType<bool>::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<bool>::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<bool>::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<bool>::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<bool>::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<bool>::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<bool>::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<bool>::get() ); - xPropertySet->setPropertyValue(sPropertyIsHidden, aAny); + xPropertySet->setPropertyValue(sPropertyIsHidden, Any(bIsHidden)); } @@ -2577,8 +2563,7 @@ void XMLPageVarSetFieldImportContext::PrepareField( { Any aAny; - aAny.setValue(&bActive, cppu::UnoType<bool>::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<bool>::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<bool>::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 e055751..a933210 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<bool>::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 5ca8d33..01016aa 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<bool>::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<bool>::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<bool>::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<bool>::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<bool>::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<bool>::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<bool>::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<bool>::get() ); - xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, aAny ); + bool bIsFixedLanguage = ! bIsDefaultLanguage; + xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, Any(bIsFixedLanguage) ); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits