diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/api/XTextContentTest.hxx | 5 | ||||
-rw-r--r-- | sw/qa/core/macros-test.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 36 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmoutputtypepage.cxx | 11 | ||||
-rw-r--r-- | sw/source/ui/vba/vbadocuments.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/PageMarginControl.cxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/PageOrientationControl.cxx | 7 |
7 files changed, 26 insertions, 50 deletions
diff --git a/sw/qa/api/XTextContentTest.hxx b/sw/qa/api/XTextContentTest.hxx index 4cb52d29db9b..f3227a5c2204 100644 --- a/sw/qa/api/XTextContentTest.hxx +++ b/sw/qa/api/XTextContentTest.hxx @@ -41,10 +41,7 @@ public: css::uno::Reference<css::text::XTextRange> xTextRange(map["text::XTextRange"], css::uno::UNO_QUERY_THROW); - if (xTextContent.is()) - { - xTextContent->attach(xTextRange); - } + xTextContent->attach(xTextRange); } void testGetAnchor() diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index d15bdfdab62e..2f9f8beff3c8 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -406,7 +406,6 @@ void SwMacrosTest::testFdo68983() CPPUNIT_ASSERT_MESSAGE("Failed to load fdo68983.odt", xComponent.is()); Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocStorable.is()); utl::TempFile aTempFile; aTempFile.EnableKillingFile(); @@ -459,8 +458,6 @@ void SwMacrosTest::testFdo87530() xBasLibPwd->changeLibraryPassword("BarLibrary", "", "foo"); Reference<frame::XStorable> xDocStorable(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocStorable.is()); - xDocStorable->storeAsURL(aTempFile.GetURL(), desc); } @@ -491,8 +488,6 @@ void SwMacrosTest::testFdo87530() // store again Reference<frame::XStorable> xDocStorable(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xDocStorable.is()); - xDocStorable->store(); } diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index b7373bfa5235..e3cfea969113 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2351,30 +2351,26 @@ void DocxAttributeOutput::GetSdtEndBefore(const SdrObject* pSdrObj) if (pSdrObj) { uno::Reference<drawing::XShape> xShape(const_cast<SdrObject*>(pSdrObj)->getUnoShape(), uno::UNO_QUERY_THROW); - if( xShape.is() ) + uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY ); + if( xPropSet.is() ) { - uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY ); - uno::Reference< beans::XPropertySetInfo > xPropSetInfo; - if( xPropSet.is() ) + uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); + uno::Sequence< beans::PropertyValue > aGrabBag; + if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) { - xPropSetInfo = xPropSet->getPropertySetInfo(); - uno::Sequence< beans::PropertyValue > aGrabBag; - if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) - { - xPropSet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag; - } - else if(xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("InteropGrabBag")) - { - xPropSet->getPropertyValue("InteropGrabBag") >>= aGrabBag; - } + xPropSet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag; + } + else if(xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("InteropGrabBag")) + { + xPropSet->getPropertyValue("InteropGrabBag") >>= aGrabBag; + } - for (sal_Int32 nProp=0; nProp < aGrabBag.getLength(); ++nProp) + for (sal_Int32 nProp=0; nProp < aGrabBag.getLength(); ++nProp) + { + if ("SdtEndBefore" == aGrabBag[nProp].Name && m_bStartedCharSdt && !m_bEndCharSdt) { - if ("SdtEndBefore" == aGrabBag[nProp].Name && m_bStartedCharSdt && !m_bEndCharSdt) - { - aGrabBag[nProp].Value >>= m_bEndCharSdt; - break; - } + aGrabBag[nProp].Value >>= m_bEndCharSdt; + break; } } } diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index 7f841e2ba7ae..d66ba8126a94 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.cxx +++ b/sw/source/ui/dbui/mmoutputtypepage.cxx @@ -198,13 +198,10 @@ void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMa try { uno::Reference< beans::XPropertySet > xTransferableProperties( aAttachments[nFile].Data, uno::UNO_QUERY_THROW); - if( xTransferableProperties.is() ) - { - OUString sURL; - xTransferableProperties->getPropertyValue("URL") >>= sURL; - if(!sURL.isEmpty()) - SWUnoHelper::UCB_DeleteFile( sURL ); - } + OUString sURL; + xTransferableProperties->getPropertyValue("URL") >>= sURL; + if(!sURL.isEmpty()) + SWUnoHelper::UCB_DeleteFile( sURL ); } catch (const uno::Exception&) { diff --git a/sw/source/ui/vba/vbadocuments.cxx b/sw/source/ui/vba/vbadocuments.cxx index 7cada2510f34..c2f2dfb8d701 100644 --- a/sw/source/ui/vba/vbadocuments.cxx +++ b/sw/source/ui/vba/vbadocuments.cxx @@ -102,10 +102,7 @@ SwVbaDocuments::Add( const uno::Any& Template, const uno::Any& /*NewTemplate*/, return Open( sFileName, uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any(), uno::Any()); } uno::Reference <text::XTextDocument> xTextDoc( createDocument() , uno::UNO_QUERY_THROW ); - - if( xTextDoc.is() ) - return getDocument( mxContext, xTextDoc, Application() ); - return uno::Any(); + return getDocument( mxContext, xTextDoc, Application() ); } // #TODO# #FIXME# can any of the unused params below be used? diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx index 84ed8c5dddab..ad6d3c5860e7 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.cxx +++ b/sw/source/uibase/sidebar/PageMarginControl.cxx @@ -80,11 +80,8 @@ namespace if ( xModel.is() ) { const css::uno::Reference< css::document::XUndoManagerSupplier > xSuppUndo( xModel, css::uno::UNO_QUERY_THROW ); - if ( xSuppUndo.is() ) - { - const css::uno::Reference< css::document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), css::uno::UNO_QUERY_THROW ); - return xUndoManager; - } + const css::uno::Reference< css::document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), css::uno::UNO_QUERY_THROW ); + return xUndoManager; } } diff --git a/sw/source/uibase/sidebar/PageOrientationControl.cxx b/sw/source/uibase/sidebar/PageOrientationControl.cxx index 1812a572ceef..a5ff79bab38e 100644 --- a/sw/source/uibase/sidebar/PageOrientationControl.cxx +++ b/sw/source/uibase/sidebar/PageOrientationControl.cxx @@ -38,11 +38,8 @@ namespace { if ( xModel.is() ) { const css::uno::Reference< css::document::XUndoManagerSupplier > xSuppUndo( xModel, css::uno::UNO_QUERY_THROW ); - if ( xSuppUndo.is() ) - { - const css::uno::Reference< css::document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), css::uno::UNO_QUERY_THROW ); - return xUndoManager; - } + const css::uno::Reference< css::document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), css::uno::UNO_QUERY_THROW ); + return xUndoManager; } } |