summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-11-30 18:33:21 +0100
committerMichael Stahl <mstahl@redhat.com>2014-12-10 21:12:20 +0000
commit8aac6ecc58fa2c475f34817e607efb6a31317898 (patch)
treef54e8b33783d244518c073d0615f054b8e468774 /sw/source/filter/xml
parent5f77059ff156ecbd69967f278d3e8f814c15958e (diff)
Use Any specializations for bool, instead of SetValue
Change-Id: I7a5babe494bdb09a71164ea74d7be3f6bf985ff6 Reviewed-on: https://gerrit.libreoffice.org/13215 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw/source/filter/xml')
-rw-r--r--sw/source/filter/xml/XMLRedlineImportHelper.cxx9
-rw-r--r--sw/source/filter/xml/swxml.cxx33
-rw-r--r--sw/source/filter/xml/wrtxml.cxx18
-rw-r--r--sw/source/filter/xml/xmlexp.cxx7
-rw-r--r--sw/source/filter/xml/xmlimp.cxx10
-rw-r--r--sw/source/filter/xml/xmltexte.cxx6
6 files changed, 25 insertions, 58 deletions
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 94d4ee26f3f8..2bf19fd5a95b 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -289,10 +289,7 @@ XMLRedlineImportHelper::XMLRedlineImportHelper(
// set redline mode to "don't record changes"
if( bHandleRecordChanges )
{
- Any aAny;
- sal_Bool bTmp = sal_False;
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- xModelPropertySet->setPropertyValue( sRecordChanges, aAny );
+ xModelPropertySet->setPropertyValue( sRecordChanges, makeAny(false) );
}
}
@@ -354,13 +351,13 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper()
{
Any aAny;
- aAny.setValue( &bShowChanges, ::getBooleanCppuType() );
+ aAny <<= bShowChanges;
if ( bHandleShowChanges )
xModelPropertySet->setPropertyValue( sShowChanges, aAny );
else
xImportInfoPropertySet->setPropertyValue( sShowChanges, aAny );
- aAny.setValue( &bRecordChanges, ::getBooleanCppuType() );
+ aAny <<= bRecordChanges;
if ( bHandleRecordChanges )
xModelPropertySet->setPropertyValue( sRecordChanges, aAny );
else
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index fddb41148834..c62994560d40 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -716,10 +716,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c
xInfoSet->setPropertyValue( "StyleInsertModeFamilies",
makeAny(aFamiliesSeq) );
- sal_Bool bTmp = !aOpt.IsMerge();
- Any aAny;
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- xInfoSet->setPropertyValue( "StyleInsertModeOverwrite", aAny );
+ xInfoSet->setPropertyValue( "StyleInsertModeOverwrite", makeAny(!aOpt.IsMerge()) );
}
else if( bInsertMode )
{
@@ -736,17 +733,11 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c
if( IsBlockMode() )
{
- sal_Bool bTmp = sal_True;
- Any aAny;
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- xInfoSet->setPropertyValue( "AutoTextMode", aAny );
+ xInfoSet->setPropertyValue( "AutoTextMode", makeAny(true) );
}
if( IsOrganizerMode() )
{
- sal_Bool bTmp = sal_True;
- Any aAny;
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- xInfoSet->setPropertyValue( "OrganizerMode", aAny );
+ xInfoSet->setPropertyValue( "OrganizerMode", makeAny(true) );
}
// Set base URI
@@ -783,19 +774,15 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c
sal_uInt32 nRet = 0;
// save redline mode into import info property set
- Any aAny;
- sal_Bool bTmp;
const OUString sShowChanges("ShowChanges");
const OUString sRecordChanges("RecordChanges");
const OUString sRedlineProtectionKey("RedlineProtectionKey");
- bTmp = IDocumentRedlineAccess::IsShowChanges( rDoc.getIDocumentRedlineAccess().GetRedlineMode() );
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- xInfoSet->setPropertyValue( sShowChanges, aAny );
- bTmp = IDocumentRedlineAccess::IsRedlineOn(rDoc.getIDocumentRedlineAccess().GetRedlineMode());
- aAny.setValue( &bTmp, ::getBooleanCppuType() );
- xInfoSet->setPropertyValue( sRecordChanges, aAny );
- aAny <<= rDoc.getIDocumentRedlineAccess().GetRedlinePassword();
- xInfoSet->setPropertyValue( sRedlineProtectionKey, aAny );
+ xInfoSet->setPropertyValue( sShowChanges,
+ makeAny(IDocumentRedlineAccess::IsShowChanges(rDoc.getIDocumentRedlineAccess().GetRedlineMode())) );
+ xInfoSet->setPropertyValue( sRecordChanges,
+ makeAny(IDocumentRedlineAccess::IsRedlineOn(rDoc.getIDocumentRedlineAccess().GetRedlineMode())) );
+ xInfoSet->setPropertyValue( sRedlineProtectionKey,
+ makeAny(rDoc.getIDocumentRedlineAccess().GetRedlinePassword()) );
// force redline mode to "none"
rDoc.getIDocumentRedlineAccess().SetRedlineMode_intern( nsRedlineMode_t::REDLINE_NONE );
@@ -910,7 +897,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c
aOpt.ResetAllFmtsOnly();
// redline password
- aAny = xInfoSet->getPropertyValue( sRedlineProtectionKey );
+ Any aAny = xInfoSet->getPropertyValue( sRedlineProtectionKey );
Sequence<sal_Int8> aKey;
aAny >>= aKey;
rDoc.getIDocumentRedlineAccess().SetRedlinePassword( aKey );
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index ff271930ff81..221e4fb9022b 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -179,16 +179,13 @@ sal_uInt32 SwXMLWriter::_Write( const uno::Reference < task::XStatusIndicator >&
}
SvtSaveOptions aSaveOpt;
- sal_Bool bUsePrettyPrinting( aSaveOpt.IsPrettyPrinting() );
- aAny.setValue( &bUsePrettyPrinting, ::getBooleanCppuType() );
- xInfoSet->setPropertyValue( "UsePrettyPrinting", aAny );
+ xInfoSet->setPropertyValue( "UsePrettyPrinting", makeAny(aSaveOpt.IsPrettyPrinting()) );
// save show redline mode ...
const OUString sShowChanges("ShowChanges");
sal_uInt16 nRedlineMode = pDoc->getIDocumentRedlineAccess().GetRedlineMode();
- sal_Bool bShowChanges( IDocumentRedlineAccess::IsShowChanges( nRedlineMode ) );
- aAny.setValue( &bShowChanges, ::getBooleanCppuType() );
- xInfoSet->setPropertyValue( sShowChanges, aAny );
+ xInfoSet->setPropertyValue( sShowChanges,
+ makeAny( IDocumentRedlineAccess::IsShowChanges( nRedlineMode ) ) );
// ... and hide redlines for export
nRedlineMode &= ~nsRedlineMode_t::REDLINE_SHOW_MASK;
nRedlineMode |= nsRedlineMode_t::REDLINE_SHOW_INSERT;
@@ -208,10 +205,7 @@ sal_uInt32 SwXMLWriter::_Write( const uno::Reference < task::XStatusIndicator >&
if( bBlock )
{
- sal_Bool bTmp = sal_True;
- Any aAny2;
- aAny2.setValue( &bTmp, ::getBooleanCppuType() );
- xInfoSet->setPropertyValue( "AutoTextMode", aAny2 );
+ xInfoSet->setPropertyValue( "AutoTextMode", makeAny(true) );
}
// #i69627#
@@ -499,9 +493,7 @@ bool SwXMLWriter::WriteThroughComponent(
xSet->setPropertyValue("MediaType", aAny );
// even plain stream should be encrypted in encrypted documents
- sal_Bool bTrue = sal_True;
- aAny.setValue( &bTrue, ::getBooleanCppuType() );
- xSet->setPropertyValue( "UseCommonStoragePasswordEncryption", aAny );
+ xSet->setPropertyValue( "UseCommonStoragePasswordEncryption", makeAny(true) );
// set buffer and create outputstream
uno::Reference< io::XOutputStream > xOutputStream = xStream->getOutputStream();
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index e399b3899c65..f43b8cb46289 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -381,7 +381,7 @@ void SwXMLExport::GetViewSettings(Sequence<PropertyValue>& aProps)
// "show redline mode" cannot simply be read from the document
// since it gets changed during execution. If it's in the info
// XPropertySet, we take it from there.
- sal_Bool bShowRedlineChanges = bSavedShowChanges;
+ bool bShowRedlineChanges = bSavedShowChanges;
Reference<XPropertySet> xInfoSet( getExportInfo() );
if ( xInfoSet.is() )
{
@@ -394,11 +394,10 @@ void SwXMLExport::GetViewSettings(Sequence<PropertyValue>& aProps)
}
pValue[nIndex].Name = "ShowRedlineChanges";
- pValue[nIndex++].Value.setValue( &bShowRedlineChanges, ::getBooleanCppuType() );
+ pValue[nIndex++].Value <<= bShowRedlineChanges;
- sal_Bool bInBrowse = pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::BROWSE_MODE);
pValue[nIndex].Name = "InBrowseMode";
- pValue[nIndex++].Value.setValue( &bInBrowse, ::getBooleanCppuType() );
+ pValue[nIndex++].Value <<= pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::BROWSE_MODE);
if ( nIndex < NUM_EXPORTED_VIEW_SETTINGS )
aProps.realloc(nIndex);
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 4d276919abde..b7aa423c2c03 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1292,18 +1292,12 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
if( !bUseOldNumbering )
{
- Any aAny;
- sal_Bool bOldNum = true;
- aAny.setValue(&bOldNum, ::getBooleanCppuType());
- xProps->setPropertyValue( "UseOldNumbering", aAny );
+ xProps->setPropertyValue( "UseOldNumbering", makeAny(true) );
}
if( !bOutlineLevelYieldsOutlineRule )
{
- Any aAny;
- sal_Bool bTmp = true;
- aAny.setValue(&bTmp, ::getBooleanCppuType());
- xProps->setPropertyValue( "OutlineLevelYieldsNumbering", aAny );
+ xProps->setPropertyValue( "OutlineLevelYieldsNumbering", makeAny(true) );
}
if( !bAddParaSpacingToTableCells )
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index 3d9dab5c5385..e5eb86c057af 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -297,14 +297,12 @@ static void lcl_addFrameProperties(
if( !bIsAutoScroll )
{
- Any aAny2( &bIsScrollingMode, ::getBooleanCppuType() );
- *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_FRAME_DISPLAY_SCROLLBAR ), aAny2 );
+ *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_FRAME_DISPLAY_SCROLLBAR ), makeAny(bIsScrollingMode) );
pStates++;
}
if( !bIsAutoBorder )
{
- Any aAny2( &bIsBorderSet, ::getBooleanCppuType() );
- *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_FRAME_DISPLAY_BORDER ), aAny2 );
+ *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_FRAME_DISPLAY_BORDER ), makeAny(bIsBorderSet) );
pStates++;
}
if( SIZE_NOT_SET != nWidth )