diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-25 14:49:14 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-25 14:59:07 +0000 |
commit | 9bc5d4cdf010091406091875e6c45d975ebc9708 (patch) | |
tree | 9c4230d1057242147f5b136de847b1df61cd7117 | |
parent | 2a0ad98ba798a280de649e17fb7212f6b4077917 (diff) |
re org things a little to quieten coverity warnings
Change-Id: I3bf0840f6428ee8cefd424a486cc2f5fcfda290f
-rw-r--r-- | sw/inc/accmap.hxx | 7 | ||||
-rw-r--r-- | sw/source/core/access/accdoc.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/access/accmap.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/app/swdll.cxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/app/swdllimpl.hxx | 3 | ||||
-rw-r--r-- | vcl/source/gdi/svgdata.cxx | 6 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/inputstream.cxx | 5 |
7 files changed, 21 insertions, 13 deletions
diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx index 05240c9169d9..814b210460ed 100644 --- a/sw/inc/accmap.hxx +++ b/sw/inc/accmap.hxx @@ -119,7 +119,10 @@ class SwAccessibleMap : public ::accessibility::IAccessibleViewForwarder, //mpSelectedFrameMap contains the old selected objects. SwAccessibleContextMap_Impl *mpSeletedFrameMap; - //IvalidateShapeInParaSelection() method is responsible for the updating the selected states of the objects. + + OUString maDocName; + + //InvalidateShapeInParaSelection() method is responsible for the updating the selected states of the objects. void InvalidateShapeInParaSelection(); void InvalidateRelationSet_( const SwFrame* pFrame, bool bFrom ); @@ -261,6 +264,8 @@ public: void FireEvents(); + const OUString& GetDocName() const { return maDocName; } + // IAccessibleViewForwarder virtual Rectangle GetVisibleArea() const override; diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx index 9e5f0e0eaac3..94131d5eeed5 100644 --- a/sw/source/core/access/accdoc.cxx +++ b/sw/source/core/access/accdoc.cxx @@ -338,7 +338,7 @@ SwAccessibleDocument::SwAccessibleDocument ( SwAccessibleMap* pInitMap ) : SwAccessibleDocumentBase( pInitMap ), maSelectionHelper( *this ) { - SetName( GetResource( STR_ACCESS_DOC_NAME ) ); + SetName(pInitMap->GetDocName()); vcl::Window *pWin = pInitMap->GetShell()->GetWin(); if( pWin ) { diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 3c484701c717..d47e20d5e470 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -30,6 +30,7 @@ #include <accmap.hxx> #include <acccontext.hxx> #include <accdoc.hxx> +#include <access.hrc> #include <accpreview.hxx> #include <accpage.hxx> #include <accpara.hxx> @@ -1641,7 +1642,8 @@ SwAccessibleMap::SwAccessibleMap( SwViewShell *pSh ) : mpVSh( pSh ), mpPreview( nullptr ), mbShapeSelected( false ), - mpSeletedFrameMap(nullptr) + mpSeletedFrameMap(nullptr), + maDocName(SwAccessibleContext::GetResource(STR_ACCESS_DOC_NAME)) { pSh->GetLayout()->AddAccessibleShell(); } diff --git a/sw/source/uibase/app/swdll.cxx b/sw/source/uibase/app/swdll.cxx index 609b4add0b77..549df9b99a4e 100644 --- a/sw/source/uibase/app/swdll.cxx +++ b/sw/source/uibase/app/swdll.cxx @@ -80,6 +80,7 @@ namespace SwGlobals } SwDLL::SwDLL() + : m_pAutoCorrCfg(nullptr) { if ( SfxApplication::GetModule(SfxToolsModule::Writer) ) // Module already active return; @@ -146,16 +147,16 @@ SwDLL::SwDLL() SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get(); const SvxAutoCorrect* pOld = rACfg.GetAutoCorrect(); rACfg.SetAutoCorrect(new SwAutoCorrect( *pOld )); + m_pAutoCorrCfg = &rACfg; } } SwDLL::~SwDLL() { - if (!utl::ConfigManager::IsAvoidConfig()) + if (m_pAutoCorrCfg) { // fdo#86494 SwAutoCorrect must be deleted before FinitCore - SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get(); - rACfg.SetAutoCorrect(nullptr); // delete SwAutoCorrect before exit handlers + m_pAutoCorrCfg->SetAutoCorrect(nullptr); // delete SwAutoCorrect before exit handlers } // Pool has to be deleted before statics are diff --git a/sw/source/uibase/app/swdllimpl.hxx b/sw/source/uibase/app/swdllimpl.hxx index 57a34bed2c81..8f6707fe7b26 100644 --- a/sw/source/uibase/app/swdllimpl.hxx +++ b/sw/source/uibase/app/swdllimpl.hxx @@ -16,6 +16,8 @@ namespace sw { class Filters; } +class SvxAutoCorrCfg; + class SwDLL { public: @@ -33,6 +35,7 @@ private: SwDLL& operator=(SwDLL const&) = delete; std::unique_ptr< sw::Filters > filters_; + SvxAutoCorrCfg *m_pAutoCorrCfg; }; #endif diff --git a/vcl/source/gdi/svgdata.cxx b/vcl/source/gdi/svgdata.cxx index 155844fe7b90..27abb60d9a60 100644 --- a/vcl/source/gdi/svgdata.cxx +++ b/vcl/source/gdi/svgdata.cxx @@ -44,10 +44,9 @@ BitmapEx convertPrimitive2DSequenceToBitmapEx( { // create replacement graphic from maSequence // create XPrimitive2DRenderer - uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext()); - try { + uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext()); const uno::Reference< graphic::XPrimitive2DRenderer > xPrimitive2DRenderer = graphic::Primitive2DTools::create(xContext); uno::Sequence< beans::PropertyValue > aViewParameters; @@ -125,10 +124,9 @@ void SvgData::ensureSequenceAndRange() if(myInputStream.is()) { // create SVG interpreter - uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext()); - try { + uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext()); const uno::Reference< graphic::XSvgParser > xSvgParser = graphic::SvgTools::create(xContext); maSequence = comphelper::sequenceToContainer<std::deque<css::uno::Reference< css::graphic::XPrimitive2D >>>(xSvgParser->getDecomposition(myInputStream, maPath)); diff --git a/xmlhelp/source/cxxhelp/provider/inputstream.cxx b/xmlhelp/source/cxxhelp/provider/inputstream.cxx index fd6a27836e22..31067b4b1ea0 100644 --- a/xmlhelp/source/cxxhelp/provider/inputstream.cxx +++ b/xmlhelp/source/cxxhelp/provider/inputstream.cxx @@ -37,13 +37,12 @@ XInputStream_impl::XInputStream_impl( const OUString& aUncPath ) m_bIsOpen = ( osl::FileBase::E_None == m_aFile.open( osl_File_OpenFlag_Read ) ); } - XInputStream_impl::~XInputStream_impl() { - closeInput(); + if (m_bIsOpen) + m_aFile.close(); } - uno::Any SAL_CALL XInputStream_impl::queryInterface( const uno::Type& rType ) { |