diff options
author | Jacek Fraczek <fraczek.jacek@gmail.com> | 2016-10-05 22:00:51 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-10-10 08:48:30 +0000 |
commit | f004aa99514d385f3ee254bba735f5eaeb7d9ad8 (patch) | |
tree | aacd5792f553b8e9cbf029cc7e0797ed0dd423fe /basctl | |
parent | 728c7327bd97602a38723553ed044ea4c01d13b2 (diff) |
tdf#89307: Removed SvRef::operator T*()
Conditional statements are using SvRef::Is() method.
Changed static_cast<T*>(svRef<T>) occurances to svRef.get().
Added operator == and != to SvRef.
SbxObject::Execute is using SbxVariableRef internally.
SbxObject::FindQualified is using SbxVariableRef internally.
Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395
Reviewed-on: https://gerrit.libreoffice.org/29621
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/baside2.cxx | 6 | ||||
-rw-r--r-- | basctl/source/basicide/baside2.hxx | 4 | ||||
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 24 | ||||
-rw-r--r-- | basctl/source/basicide/basides1.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/basobj2.cxx | 8 | ||||
-rw-r--r-- | basctl/source/basicide/macrodlg.cxx | 2 |
6 files changed, 23 insertions, 23 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 11872eb4e3f6..7ece04118eb8 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -285,7 +285,7 @@ void ModulWindow::CheckCompileBasic() if ( bDone ) { - GetBreakPoints().SetBreakPointsInBasic( m_xModule ); + GetBreakPoints().SetBreakPointsInBasic( m_xModule.get() ); } GetShell()->GetViewFrame()->GetWindow().LeaveWait(); @@ -1280,7 +1280,7 @@ void ModulWindow::BasicStarted() if ( rList.size() ) { rList.ResetHitCount(); - rList.SetBreakPointsInBasic( m_xModule ); + rList.SetBreakPointsInBasic( m_xModule.get() ); for ( sal_uInt16 nMethod = 0; nMethod < m_xModule->GetMethods()->Count(); nMethod++ ) { SbMethod* pMethod = static_cast<SbMethod*>(m_xModule->GetMethods()->Get( nMethod )); @@ -1400,7 +1400,7 @@ void ModulWindow::UpdateModule () OUString const aModule = getTextEngineText(*GetEditEngine()); // update module in basic - assert(m_xModule); + assert(m_xModule.Is()); // update module in module window SetModule(aModule); diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx index 23976945e3f8..c8bf2e6a53ca 100644 --- a/basctl/source/basicide/baside2.hxx +++ b/basctl/source/basicide/baside2.hxx @@ -344,9 +344,9 @@ public: virtual void SetReadOnly (bool bReadOnly) override; virtual bool IsReadOnly() override; - StarBASIC* GetBasic() { XModule(); return m_xBasic; } + StarBASIC* GetBasic() { XModule(); return m_xBasic.get(); } - SbModule* GetSbModule() { return m_xModule; } + SbModule* GetSbModule() { return m_xModule.get(); } void SetSbModule( SbModule* pModule ) { m_xModule = pModule; } OUString GetSbModuleName(); diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 57f04b0f1492..c83bc7bb70fc 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -645,7 +645,7 @@ void EditorWindow::HandleAutoCorrect() else { //autocorrect procedures - SbxArray* pArr = rModulWindow.GetSbModule()->GetMethods(); + SbxArray* pArr = rModulWindow.GetSbModule()->GetMethods().get(); for( sal_uInt32 i=0; i < pArr->Count32(); ++i ) { if( pArr->Get32(i)->GetName().equalsIgnoreAsciiCase( sStr ) ) @@ -1724,7 +1724,7 @@ SbxDimArray* WatchItem::GetRootArray() WatchItem* pRootItem = GetRootItem(); SbxDimArray* pRet = nullptr; if( pRootItem ) - pRet = pRootItem->mpArray; + pRet = pRootItem->mpArray.get(); return pRet; } @@ -2132,7 +2132,7 @@ void WatchTreeListBox::RequestingChildren( SvTreeListEntry * pParent ) SvTreeListEntry* pEntry = pParent; WatchItem* pItem = static_cast<WatchItem*>(pEntry->GetUserData()); - SbxDimArray* pArray = pItem->mpArray; + SbxDimArray* pArray = pItem->mpArray.get(); SbxDimArray* pRootArray = pItem->GetRootArray(); bool bArrayIsRootArray = false; if( !pArray && pRootArray ) @@ -2141,7 +2141,7 @@ void WatchTreeListBox::RequestingChildren( SvTreeListEntry * pParent ) bArrayIsRootArray = true; } - SbxObject* pObj = pItem->mpObject; + SbxObject* pObj = pItem->mpObject.get(); if( pObj ) { createAllObjectProperties( pObj ); @@ -2231,7 +2231,7 @@ SbxBase* WatchTreeListBox::ImplGetSBXForEntry( SvTreeListEntry* pEntry, bool& rb WatchItem* pParentItem = pParentEntry ? static_cast<WatchItem*>(pParentEntry->GetUserData()) : nullptr; if( pParentItem ) { - SbxObject* pObj = pParentItem->mpObject; + SbxObject* pObj = pParentItem->mpObject.get(); SbxDimArray* pArray; if( pObj ) { @@ -2272,7 +2272,7 @@ bool WatchTreeListBox::EditingEntry( SvTreeListEntry* pEntry, Selection& ) if (IsSbxVariable(pSbx) || bArrayElement) { // Accept no objects and only end nodes of arrays for editing - if( !pItem->mpObject && (pItem->mpArray == nullptr || pItem->nDimLevel == pItem->nDimCount) ) + if( !pItem->mpObject.Is() && ( !pItem->mpArray.Is() || pItem->nDimLevel == pItem->nDimCount ) ) { aEditingRes = SvHeaderTabListBox::GetEntryText( pEntry, ITEM_ID_VALUE-1 ); aEditingRes = comphelper::string::strip(aEditingRes, ' '); @@ -2349,7 +2349,7 @@ OUString implCreateTypeStringForDimArray( WatchItem* pItem, SbxDataType eType ) { OUString aRetStr = getBasicTypeName( eType ); - SbxDimArray* pArray = pItem->mpArray; + SbxDimArray* pArray = pItem->mpArray.get(); if( !pArray ) pArray = pItem->GetRootArray(); if( pArray ) @@ -2427,7 +2427,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped ) // consider multidimensinal arrays! if (SbxDimArray* pNewArray = dynamic_cast<SbxDimArray*>(pVar->GetObject())) { - SbxDimArray* pOldArray = pItem->mpArray; + SbxDimArray* pOldArray = pItem->mpArray.get(); bool bArrayChanged = false; if( pNewArray != nullptr && pOldArray != nullptr ) @@ -2494,7 +2494,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped ) { if (SbxObject* pObj = dynamic_cast<SbxObject*>(pVar->GetObject())) { - if (pItem->mpObject && !pItem->maMemberList.empty()) + if ( pItem->mpObject.Is() && !pItem->maMemberList.empty() ) { bool bObjChanged = false; // Check if member list has changed SbxArray* pProps = pObj->GetProperties(); @@ -2522,7 +2522,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped ) else { aWatchStr = "Null"; - if( pItem->mpObject != nullptr ) + if( pItem->mpObject.Is() ) { bCollapse = true; pItem->clearWatchItem(); @@ -2533,7 +2533,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped ) } else { - if( pItem->mpObject != nullptr ) + if( pItem->mpObject.Is() ) { bCollapse = true; pItem->clearWatchItem(); @@ -2575,7 +2575,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped ) } else if( bBasicStopped ) { - if( pItem->mpObject || pItem->mpArray ) + if( pItem->mpObject.Is() || pItem->mpArray.Is() ) { implCollapseModifiedObjectEntry( pEntry, this ); pItem->mpObject = nullptr; diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index 5f41f798bc24..59c3006377ab 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -311,7 +311,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq ) pModule = pBasic->FindModule( aModName ); } else - pModule = pBasic->GetModules().front(); + pModule = pBasic->GetModules().front().get(); } DBG_ASSERT( pModule, "Kein Modul!" ); if ( pModule && !pModule->GetMethods()->Find( rInfo.GetMethod(), SbxClassType::Method ) ) diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx index 0f383e436b23..5d939a7134c0 100644 --- a/basctl/source/basicide/basobj2.cxx +++ b/basctl/source/basicide/basobj2.cxx @@ -227,7 +227,7 @@ namespace if ( pData->aDocument.isDocument() ) pUndoGuard.reset( new ::framework::DocumentUndoGuard( pData->aDocument.getDocument() ) ); - RunMethod(pData->xMethod); + RunMethod( pData->xMethod.get() ); } } @@ -374,7 +374,7 @@ Sequence< OUString > GetMethodNames( const ScriptDocument& rDocument, const OUSt { xModule = new SbModule( rModName ); xModule->SetSource32( aOUSource ); - pMod = xModule; + pMod = xModule.get(); } sal_uInt16 nCount = pMod->GetMethods()->Count(); @@ -424,9 +424,9 @@ bool HasMethod ( { xModule = new SbModule( rModName ); xModule->SetSource32( aOUSource ); - pMod = xModule; + pMod = xModule.get(); } - SbxArray* pMethods = pMod->GetMethods(); + SbxArray* pMethods = pMod->GetMethods().get(); if ( pMethods ) { SbMethod* pMethod = static_cast<SbMethod*>(pMethods->Find( rMethName, SbxClassType::Method )); diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index a14f9847ac0a..dcbccac9efcd 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -361,7 +361,7 @@ SbMethod* MacroChooser::CreateMacro() pModule = pBasic->FindModule( aModName ); } else if ( !pBasic->GetModules().empty() ) - pModule = pBasic->GetModules().front(); + pModule = pBasic->GetModules().front().get(); if ( !pModule ) { |