[Libreoffice-commits] core.git: 3 commits - basctl/source extensions/source sw/qa
Caolán McNamara
caolanm at redhat.com
Sun Sep 11 20:54:02 UTC 2016
basctl/source/basicide/basobj3.cxx | 30 +++++++++--------------
extensions/source/abpilot/datasourcehandling.cxx | 7 +++--
extensions/source/abpilot/datasourcehandling.hxx | 4 ++-
sw/qa/extras/uiwriter/uiwriter.cxx | 18 ++++++++-----
4 files changed, 31 insertions(+), 28 deletions(-)
New commits:
commit 78e57cf6622ac1b424c9e00885e378ee819df882
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Sep 11 21:12:05 2016 +0100
rework to avoid coverity#1371295 Missing move assignment operator
Change-Id: I6cdaa375525b14299b374273b6651a2a89f0c500
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 779d91c..8d0ed48 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -1950,13 +1950,17 @@ void SwUiWriterTest::testSearchWithTransliterate()
{
SwDoc* pDoc = createDoc();
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
- SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1);
- SwPaM aPaM(aIdx);
- pDoc->getIDocumentContentOperations().InsertString(aPaM,"This is paragraph one");
- pWrtShell->SplitNode();
- aIdx = SwNodeIndex(pDoc->GetNodes().GetEndOfContent(), -1);
- aPaM = SwPaM(aIdx);
- pDoc->getIDocumentContentOperations().InsertString(aPaM,"This is Other PARAGRAPH");
+ {
+ SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1);
+ SwPaM aPaM(aIdx);
+ pDoc->getIDocumentContentOperations().InsertString(aPaM,"This is paragraph one");
+ pWrtShell->SplitNode();
+ }
+ {
+ SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1);
+ SwPaM aPaM(aIdx);
+ pDoc->getIDocumentContentOperations().InsertString(aPaM,"This is Other PARAGRAPH");
+ }
css::util::SearchOptions2 SearchOpt;
SearchOpt.algorithmType = css::util::SearchAlgorithms_ABSOLUTE;
SearchOpt.searchFlag = css::util::SearchFlags::ALL_IGNORE_CASE;
commit 8bd5dd43a90576f4c55a05ed2ba1af49d2168bab
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Sep 11 21:01:42 2016 +0100
coverity#1371190 Missing move assignment operator
Change-Id: I20991a31a82ff96292cdd1be4fd2c4779f9f5514
diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx
index 3b80969..6c09d1d 100644
--- a/extensions/source/abpilot/datasourcehandling.cxx
+++ b/extensions/source/abpilot/datasourcehandling.cxx
@@ -328,7 +328,6 @@ namespace abp
*this = _rSource;
}
-
ODataSource& ODataSource::operator=( const ODataSource& _rSource )
{
if( this != &_rSource )
@@ -338,13 +337,17 @@ namespace abp
return *this;
}
+ ODataSource& ODataSource::operator=( ODataSource&& _rSource )
+ {
+ m_pImpl = std::move(_rSource.m_pImpl);
+ return *this;
+ }
ODataSource::ODataSource( const Reference< XComponentContext >& _rxORB )
:m_pImpl(new ODataSourceImpl(_rxORB))
{
}
-
ODataSource::~ODataSource( )
{
}
diff --git a/extensions/source/abpilot/datasourcehandling.hxx b/extensions/source/abpilot/datasourcehandling.hxx
index 65a4398..928bbe0 100644
--- a/extensions/source/abpilot/datasourcehandling.hxx
+++ b/extensions/source/abpilot/datasourcehandling.hxx
@@ -113,9 +113,11 @@ namespace abp
/// dtor
~ODataSource( );
- /// assignment
+ /// copy assignment
ODataSource& operator=( const ODataSource& _rSource );
+ /// move assignment
+ ODataSource& operator=( ODataSource&& _rSource );
/// checks whether or not the object represents a valid data source
bool isValid() const;
commit b9f5607ba8e228d69dba89584ea75136b439b547
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Sep 11 20:50:21 2016 +0100
coverity#1371151 rearrange code to avoid assignment
Change-Id: Iccba596ce958bcdd62aae572f3189592f96cad25
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index ad9626e..d406120 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -100,24 +100,18 @@ SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName )
aOUSource += aSubStr;
// update module in library
- ScriptDocument aDocument( ScriptDocument::NoDocument );
StarBASIC* pBasic = dynamic_cast<StarBASIC*>(pModule->GetParent());
- DBG_ASSERT(pBasic, "basctl::CreateMacro: No Basic found!");
- if ( pBasic )
+ BasicManager* pBasMgr = pBasic ? FindBasicManager(pBasic) : nullptr;
+ SAL_WARN_IF(!pBasMgr, "basctl.basicide", "No BasicManager found!");
+ ScriptDocument aDocument = pBasMgr
+ ? ScriptDocument::getDocumentForBasicManager(pBasMgr)
+ : ScriptDocument(ScriptDocument::NoDocument);
+
+ if (aDocument.isValid())
{
- BasicManager* pBasMgr = FindBasicManager( pBasic );
- DBG_ASSERT(pBasMgr, "basctl::CreateMacro: No BasicManager found!");
- if ( pBasMgr )
- {
- aDocument = ScriptDocument::getDocumentForBasicManager( pBasMgr );
- OSL_ENSURE( aDocument.isValid(), "basctl::CreateMacro: no document for the given BasicManager!" );
- if ( aDocument.isValid() )
- {
- OUString aLibName = pBasic->GetName();
- OUString aModName = pModule->GetName();
- OSL_VERIFY( aDocument.updateModule( aLibName, aModName, aOUSource ) );
- }
- }
+ OUString aLibName = pBasic->GetName();
+ OUString aModName = pModule->GetName();
+ OSL_VERIFY( aDocument.updateModule( aLibName, aModName, aOUSource ) );
}
SbMethod* pMethod = pModule->FindMethod( aMacroName, SbxClassType::Method );
@@ -127,8 +121,8 @@ SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName )
pDispatcher->Execute( SID_BASICIDE_UPDATEALLMODULESOURCES );
}
- if ( aDocument.isAlive() )
- MarkDocumentModified( aDocument );
+ if (aDocument.isAlive())
+ MarkDocumentModified(aDocument);
return pMethod;
}
More information about the Libreoffice-commits
mailing list