diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-27 11:12:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-27 13:06:59 +0200 |
commit | e5ece062058f7772f8414d47d07bb8af6e8e5c2a (patch) | |
tree | 97ab9340c5e29f5445279a9585b4abe42396b14d /sw/source/filter/xml | |
parent | 2d5090419e0113f5b411ee84bfc55926a19da411 (diff) |
loplugin:oncevar in sw
Change-Id: Ia96172489eec09607113d388a5b683bb6e0d2dec
Reviewed-on: https://gerrit.libreoffice.org/39290
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/xml')
-rw-r--r-- | sw/source/filter/xml/xmlexp.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimp.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexti.cxx | 15 |
3 files changed, 7 insertions, 14 deletions
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 6d41045d0b8c..0e2758b6b0fd 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -426,9 +426,8 @@ void SwXMLExport::SetBodyAttributes() if( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() && pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->GetPageCount() > 1 ) { - bool bValue = true; OUStringBuffer sBuffer; - ::sax::Converter::convertBool(sBuffer, bValue); + ::sax::Converter::convertBool(sBuffer, true); AddAttribute(XML_NAMESPACE_TEXT, XML_USE_SOFT_PAGE_BREAKS, sBuffer.makeStringAndClear()); } diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index dba62895d3f7..e12627b4c656 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1259,8 +1259,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC if( ! bPrinterIndependentLayout ) { - sal_Int16 nTmp = document::PrinterIndependentLayout::DISABLED; - xProps->setPropertyValue( "PrinterIndependentLayout", Any(nTmp) ); + xProps->setPropertyValue( "PrinterIndependentLayout", Any(sal_Int16(document::PrinterIndependentLayout::DISABLED)) ); } if( ! bAddExternalLeading ) diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 99052561e3db..58a3bd20f4b8 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -269,8 +269,6 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( try { // create object with desired ClassId - sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT; - OUString aName("DummyName"); uno::Sequence < sal_Int8 > aClass( aClassName.GetByteSequence() ); uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() ); uno::Sequence<beans::PropertyValue> aObjArgs( comphelper::InitPropertySequence({ @@ -278,11 +276,11 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( })); uno::Reference < embed::XEmbeddedObject > xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew( - aClass, OUString(), xStorage, aName, aObjArgs), uno::UNO_QUERY ); + aClass, OUString(), xStorage, "DummyName", aObjArgs), uno::UNO_QUERY ); if ( xObj.is() ) { //TODO/LATER: is it enough to only set the VisAreaSize? - lcl_setObjectVisualArea( xObj, nAspect, aTwipSize, MapUnit::MapTwip ); + lcl_setObjectVisualArea( xObj, embed::Aspects::MSOLE_CONTENT, aTwipSize, MapUnit::MapTwip ); } if( pTextCursor ) @@ -566,7 +564,6 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( try { // create object with desired ClassId - OUString aName("DummyName"); uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::OOoEmbeddedObjectFactory::create(::comphelper::getProcessComponentContext()); @@ -587,7 +584,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( uno::Reference < embed::XEmbeddedObject > xObj( xFactory->createInstanceLink( - xStorage, aName, aMediaDescriptor, uno::Sequence< beans::PropertyValue >() ), + xStorage, "DummyName", aMediaDescriptor, uno::Sequence< beans::PropertyValue >() ), uno::UNO_QUERY_THROW ); { @@ -700,12 +697,11 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin( try { // create object with desired ClassId - OUString aName("DummyName"); uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence() ); uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() ); uno::Reference < embed::XEmbeddedObject > xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew( - aClass, OUString(), xStorage, aName, + aClass, OUString(), xStorage, "DummyName", uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY ); // set size to the object @@ -833,12 +829,11 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra try { // create object with desired ClassId - OUString aName("DummyName"); uno::Sequence < sal_Int8 > aClass( SvGlobalName( SO3_IFRAME_CLASSID ).GetByteSequence() ); uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() ); uno::Reference < embed::XEmbeddedObject > xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew( - aClass, OUString(), xStorage, aName, + aClass, OUString(), xStorage, "DummyName", uno::Sequence < beans::PropertyValue >() ), uno::UNO_QUERY ); // set size to the object |