summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJacek Fraczek <fraczek.jacek@gmail.com>2016-10-05 22:00:51 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-10-10 08:48:30 +0000
commitf004aa99514d385f3ee254bba735f5eaeb7d9ad8 (patch)
treeaacd5792f553b8e9cbf029cc7e0797ed0dd423fe /sfx2
parent728c7327bd97602a38723553ed044ea4c01d13b2 (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 'sfx2')
-rw-r--r--sfx2/source/appl/macroloader.cxx4
-rw-r--r--sfx2/source/appl/xpackcreator.cxx2
-rw-r--r--sfx2/source/bastyp/progress.cxx18
-rw-r--r--sfx2/source/doc/docfile.cxx2
-rw-r--r--sfx2/source/doc/doctempl.cxx2
-rw-r--r--sfx2/source/doc/printhelper.cxx10
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx74
-rw-r--r--sfx2/source/view/viewfrm.cxx6
8 files changed, 59 insertions, 59 deletions
diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx
index 9cf3dade9e30..3ab011f3dac0 100644
--- a/sfx2/source/appl/macroloader.cxx
+++ b/sfx2/source/appl/macroloader.cxx
@@ -290,9 +290,9 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, css::uno::Any& rRetval,
// execute the method
SbxVariableRef retValRef = new SbxVariable;
- nErr = pBasMgr->ExecuteMacro( aQualifiedMethod, aArgs, retValRef );
+ nErr = pBasMgr->ExecuteMacro( aQualifiedMethod, aArgs, retValRef.get() );
if ( nErr == ERRCODE_NONE )
- rRetval = sbxToUnoValue( retValRef );
+ rRetval = sbxToUnoValue( retValRef.get() );
}
if ( bSetGlobalThisComponent )
diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx
index 5297d927b009..8e1a2eec043d 100644
--- a/sfx2/source/appl/xpackcreator.cxx
+++ b/sfx2/source/appl/xpackcreator.cxx
@@ -85,7 +85,7 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const OUString& aFolde
{
pTempStream = new SvFileStream( aTempURL, StreamMode::STD_READWRITE );
tools::SvRef<SotStorage> aTargetStorage = new SotStorage( true, *pTempStream );
- aStorage->CopyTo( aTargetStorage );
+ aStorage->CopyTo( aTargetStorage.get() );
aTargetStorage->Commit();
if ( aStorage->GetError() || aTargetStorage->GetError() || pTempStream->GetError() )
diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx
index a9bcff553e61..be387aa711ec 100644
--- a/sfx2/source/bastyp/progress.cxx
+++ b/sfx2/source/bastyp/progress.cxx
@@ -74,7 +74,7 @@ struct SfxProgress_Impl
void SfxProgress_Impl::Enable_Impl()
{
- SfxObjectShell* pDoc = static_cast<SfxObjectShell*>(xObjSh);
+ SfxObjectShell* pDoc = xObjSh.get();
SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pDoc);
while ( pFrame )
{
@@ -249,7 +249,7 @@ void SfxProgress::SetState
{
// get the active ViewFrame of the document this progress is working on
// if it doesn't work on a document, take the current ViewFrame
- SfxObjectShell* pObjSh = pImpl->xObjSh;
+ SfxObjectShell* pObjSh = pImpl->xObjSh.get();
pImpl->pView = SfxViewFrame::Current();
DBG_ASSERT( pImpl->pView || pObjSh, "Can't make progress bar!");
if ( pObjSh && ( !pImpl->pView || pObjSh != pImpl->pView->GetObjectShell() ) )
@@ -321,16 +321,16 @@ void SfxProgress::Resume()
{
if ( pImpl->xObjSh.Is() )
{
- for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pImpl->xObjSh);
+ for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pImpl->xObjSh.get() );
pFrame;
- pFrame = SfxViewFrame::GetNext( *pFrame, pImpl->xObjSh ) )
+ pFrame = SfxViewFrame::GetNext( *pFrame, pImpl->xObjSh.get() ) )
pFrame->GetWindow().EnterWait();
}
}
- if ( pImpl->xObjSh )
+ if ( pImpl->xObjSh.Is() )
{
- SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pImpl->xObjSh);
+ SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pImpl->xObjSh.get());
if ( pFrame )
pFrame->GetBindings().ENTERREGISTRATIONS();
}
@@ -366,14 +366,14 @@ void SfxProgress::Suspend()
if ( pImpl->xObjSh.Is() )
{
for ( SfxViewFrame *pFrame =
- SfxViewFrame::GetFirst(pImpl->xObjSh);
+ SfxViewFrame::GetFirst(pImpl->xObjSh.get());
pFrame;
- pFrame = SfxViewFrame::GetNext( *pFrame, pImpl->xObjSh ) )
+ pFrame = SfxViewFrame::GetNext( *pFrame, pImpl->xObjSh.get() ) )
pFrame->GetWindow().LeaveWait();
}
if ( pImpl->xObjSh.Is() )
{
- SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pImpl->xObjSh);
+ SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pImpl->xObjSh.get() );
if ( pFrame )
pFrame->GetBindings().LEAVEREGISTRATIONS();
}
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 42b1fda5068c..cae3a9e89623 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -3185,7 +3185,7 @@ SvKeyValueIterator* SfxMedium::GetHeaderAttributes_Impl()
}
}
- return pImpl->xAttributes;
+ return pImpl->xAttributes.get();
}
css::uno::Reference< css::io::XInputStream > SfxMedium::GetInputStream()
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index 24933ce425ae..a1c31340f74c 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -975,7 +975,7 @@ bool SfxDocumentTemplates::InsertDir
if ( xTemplates->addGroup( rText ) )
{
- RegionData_Impl* pNewRegion = new RegionData_Impl( pImp, rText );
+ RegionData_Impl* pNewRegion = new RegionData_Impl( pImp.get(), rText );
if ( ! pImp->InsertRegion( pNewRegion, nRegion ) )
{
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 29c9458acf8b..d84f56b556a2 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -260,12 +260,12 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() thro
// search for any view of this document that is currently printing
const Printer *pPrinter = nullptr;
- SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ? SfxViewFrame::GetFirst( m_pData->m_pObjectShell, false ) : nullptr;
+ SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ? SfxViewFrame::GetFirst( m_pData->m_pObjectShell.get(), false ) : nullptr;
SfxViewFrame* pFirst = pViewFrm;
while ( pViewFrm && !pPrinter )
{
pPrinter = pViewFrm->GetViewShell()->GetActivePrinter();
- pViewFrm = SfxViewFrame::GetNext( *pViewFrm, m_pData->m_pObjectShell, false );
+ pViewFrm = SfxViewFrame::GetNext( *pViewFrm, m_pData->m_pObjectShell.get(), false );
}
// if no view is printing currently, use the permanent SfxPrinter instance
@@ -320,7 +320,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
{
// Get old Printer
SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ?
- SfxViewFrame::GetFirst( m_pData->m_pObjectShell, false ) : nullptr;
+ SfxViewFrame::GetFirst( m_pData->m_pObjectShell.get(), false ) : nullptr;
if ( !pViewFrm )
return;
@@ -595,7 +595,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
// get view for sfx printing capabilities
SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ?
- SfxViewFrame::GetFirst( m_pData->m_pObjectShell, false ) : nullptr;
+ SfxViewFrame::GetFirst( m_pData->m_pObjectShell.get(), false ) : nullptr;
if ( !pViewFrm )
return;
SfxViewShell* pView = pViewFrm->GetViewShell();
@@ -796,7 +796,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
const SfxPrintingHint* pPrintHint = dynamic_cast<const SfxPrintingHint*>(&rHint);
- if ( &rBC != m_pObjectShell
+ if ( &rBC != m_pObjectShell.get()
|| !pPrintHint
|| pPrintHint->GetWhich() == SFX_PRINTABLESTATE_CANCELJOB )
return;
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index a4c1c25f424d..0381dc047f95 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -256,8 +256,8 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
{
if (!m_xDocumentMetadata.is())
{
- OSL_ENSURE(m_pObjectShell, "GetDMA: no object shell?");
- if (!m_pObjectShell)
+ OSL_ENSURE(m_pObjectShell.Is(), "GetDMA: no object shell?");
+ if (!m_pObjectShell.Is())
{
return nullptr;
}
@@ -297,7 +297,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
Reference<rdf::XDocumentMetadataAccess> CreateDMAUninitialized()
{
- return (m_pObjectShell)
+ return (m_pObjectShell.Is())
? new ::sfx2::DocumentMetadataAccess(
::comphelper::getProcessComponentContext(), *m_pObjectShell)
: nullptr;
@@ -456,15 +456,15 @@ class SfxSaveGuard
SfxSaveGuard::SfxSaveGuard(const Reference< frame::XModel >& xModel ,
IMPL_SfxBaseModel_DataContainer* pData)
- : m_xModel (xModel)
- , m_pData (pData )
- , m_pFramesLock(nullptr )
+ : m_xModel ( xModel )
+ , m_pData ( pData )
+ , m_pFramesLock( nullptr )
{
if ( m_pData->m_bClosed )
throw lang::DisposedException("Object already disposed.");
m_pData->m_bSaving = true;
- m_pFramesLock = new SfxOwnFramesLocker(m_pData->m_pObjectShell);
+ m_pFramesLock = new SfxOwnFramesLocker( m_pData->m_pObjectShell.get() );
}
SfxSaveGuard::~SfxSaveGuard()
@@ -624,7 +624,7 @@ Reference< container::XNameContainer > SAL_CALL SfxBaseModel::getLibraryContaine
Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess;
if( !rxAccess.is() && m_pData->m_pObjectShell.Is() )
- rxAccess = implGetStarBasicAccess( m_pData->m_pObjectShell );
+ rxAccess = implGetStarBasicAccess( m_pData->m_pObjectShell.get() );
Reference< container::XNameContainer > xRet;
if( rxAccess.is() )
@@ -650,7 +650,7 @@ void SAL_CALL SfxBaseModel::createLibrary( const OUString& LibName, const OUStri
Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess;
if( !rxAccess.is() && m_pData->m_pObjectShell.Is() )
- rxAccess = implGetStarBasicAccess( m_pData->m_pObjectShell );
+ rxAccess = implGetStarBasicAccess( m_pData->m_pObjectShell.get() );
if( rxAccess.is() )
rxAccess->createLibrary( LibName, Password, ExternalSourceURL, LinkTargetURL );
@@ -674,7 +674,7 @@ void SAL_CALL SfxBaseModel::addModule( const OUString& LibraryName, const OUStri
Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess;
if( !rxAccess.is() && m_pData->m_pObjectShell.Is() )
- rxAccess = implGetStarBasicAccess( m_pData->m_pObjectShell );
+ rxAccess = implGetStarBasicAccess( m_pData->m_pObjectShell.get() );
if( rxAccess.is() )
rxAccess->addModule( LibraryName, ModuleName, Language, Source );
@@ -697,7 +697,7 @@ void SAL_CALL SfxBaseModel::addDialog( const OUString& LibraryName, const OUStri
Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess;
if( !rxAccess.is() && m_pData->m_pObjectShell.Is() )
- rxAccess = implGetStarBasicAccess( m_pData->m_pObjectShell );
+ rxAccess = implGetStarBasicAccess( m_pData->m_pObjectShell.get() );
if( rxAccess.is() )
rxAccess->addDialog( LibraryName, DialogName, Data );
@@ -884,7 +884,7 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const OUString&
{
m_pData->m_sURL = rURL;
- SfxObjectShell* pObjectShell = m_pData->m_pObjectShell;
+ SfxObjectShell* pObjectShell = m_pData->m_pObjectShell.get();
::comphelper::NamedValueCollection aArgs( rArgs );
@@ -1002,7 +1002,7 @@ Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() throw(RuntimeE
seqArgsNew[ nNewLength - 1 ].Value <<= m_pData->m_aPreusedFilterName;
}
- SfxViewFrame* pFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell );
+ SfxViewFrame* pFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell.get() );
if ( pFrame )
{
SvBorder aBorder = pFrame->GetBorderPixelImpl();
@@ -1549,7 +1549,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue >
SfxAllItemSet *pParams = new SfxAllItemSet( SfxGetpApp()->GetPool() );
TransformParameters( nSlotId, aArgs, *pParams );
- SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOC, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOC), m_pData->m_pObjectShell ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOC, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOC), m_pData->m_pObjectShell.get() ) );
bool bRet = false;
@@ -1590,7 +1590,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue >
m_pData->m_pObjectShell->AddLog( OSL_LOG_PREFIX "successful saving." );
m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();
- SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCDONE, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCDONE), m_pData->m_pObjectShell ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCDONE, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCDONE), m_pData->m_pObjectShell.get() ) );
}
else
{
@@ -1598,7 +1598,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue >
m_pData->m_pObjectShell->StoreLog();
// write the contents of the logger to the file
- SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCFAILED, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCFAILED), m_pData->m_pObjectShell ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCFAILED, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCFAILED), m_pData->m_pObjectShell.get() ) );
throw task::ErrorCodeIOException(
"SfxBaseModel::storeSelf: 0x" + OUString::number(nErrCode, 16),
@@ -2293,7 +2293,7 @@ Reference< container::XNameReplace > SAL_CALL SfxBaseModel::getEvents() throw( R
if ( ! m_pData->m_xEvents.is() )
{
- m_pData->m_xEvents = new SfxEvents_Impl( m_pData->m_pObjectShell, this );
+ m_pData->m_xEvents = new SfxEvents_Impl( m_pData->m_pObjectShell.get(), this );
}
return m_pData->m_xEvents;
@@ -2308,7 +2308,7 @@ Reference< script::XStorageBasedLibraryContainer > SAL_CALL SfxBaseModel::getBas
SfxModelGuard aGuard( *this );
Reference< script::XStorageBasedLibraryContainer > xBasicLibraries;
- if ( m_pData->m_pObjectShell )
+ if ( m_pData->m_pObjectShell.Is() )
xBasicLibraries.set( m_pData->m_pObjectShell->GetBasicContainer(), UNO_QUERY_THROW );
return xBasicLibraries;
}
@@ -2318,7 +2318,7 @@ Reference< script::XStorageBasedLibraryContainer > SAL_CALL SfxBaseModel::getDia
SfxModelGuard aGuard( *this );
Reference< script::XStorageBasedLibraryContainer > xDialogLibraries;
- if ( m_pData->m_pObjectShell )
+ if ( m_pData->m_pObjectShell.Is() )
xDialogLibraries.set( m_pData->m_pObjectShell->GetDialogContainer(), UNO_QUERY_THROW );
return xDialogLibraries;
}
@@ -2327,7 +2327,7 @@ sal_Bool SAL_CALL SfxBaseModel::getAllowMacroExecution() throw (RuntimeException
{
SfxModelGuard aGuard( *this );
- if ( m_pData->m_pObjectShell )
+ if ( m_pData->m_pObjectShell.Is() )
return m_pData->m_pObjectShell->AdjustMacroMode();
return false;
}
@@ -2574,7 +2574,7 @@ uno::Sequence< document::CmisVersion > SAL_CALL SfxBaseModel::getAllVersions( )
bool SfxBaseModel::getBoolPropertyValue( const OUString& rName ) throw ( RuntimeException )
{
bool bValue = false;
- if ( m_pData->m_pObjectShell )
+ if ( m_pData->m_pObjectShell.Is() )
{
SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
if ( pMedium )
@@ -2724,7 +2724,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
if ( !m_pData )
return;
- if ( &rBC == m_pData->m_pObjectShell )
+ if ( &rBC == m_pData->m_pObjectShell.get() )
{
if ( rHint.GetId() == SFX_HINT_DOCCHANGED )
changing();
@@ -2850,7 +2850,7 @@ void SfxBaseModel::changing()
SfxObjectShell* SfxBaseModel::GetObjectShell() const
{
- return m_pData ? static_cast<SfxObjectShell*>(m_pData->m_pObjectShell) : nullptr;
+ return m_pData ? m_pData->m_pObjectShell.get() : nullptr;
}
@@ -2859,7 +2859,7 @@ SfxObjectShell* SfxBaseModel::GetObjectShell() const
bool SfxBaseModel::IsInitialized() const
{
- if ( !m_pData || !m_pData->m_pObjectShell )
+ if ( !m_pData || !m_pData->m_pObjectShell.Is() )
{
OSL_FAIL( "SfxBaseModel::IsInitialized: this should have been caught earlier!" );
return false;
@@ -2906,7 +2906,7 @@ void SfxBaseModel::impl_store( const OUString& sURL
throw frame::IllegalArgumentIOException();
bool bSaved = false;
- if ( !bSaveTo && m_pData->m_pObjectShell && !sURL.isEmpty()
+ if ( !bSaveTo && m_pData->m_pObjectShell.Is() && !sURL.isEmpty()
&& !sURL.startsWith( "private:stream" )
&& ::utl::UCBContentHelper::EqualURLs( getLocation(), sURL ) )
{
@@ -2980,10 +2980,10 @@ void SfxBaseModel::impl_store( const OUString& sURL
}
}
- if ( !bSaved && m_pData->m_pObjectShell )
+ if ( !bSaved && m_pData->m_pObjectShell.Is() )
{
SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOC : SFX_EVENT_SAVEASDOC, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOC : GlobalEventId::SAVEASDOC ),
- m_pData->m_pObjectShell ) );
+ m_pData->m_pObjectShell.get() ) );
std::unique_ptr<SfxAllItemSet> pItemSet(new SfxAllItemSet(SfxGetpApp()->GetPool()));
pItemSet->Put(SfxStringItem(SID_FILE_NAME, sURL));
@@ -3082,14 +3082,14 @@ void SfxBaseModel::impl_store( const OUString& sURL
m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();
m_pData->m_pObjectShell->SetModifyPasswordEntered();
- SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEASDOCDONE, GlobalEventConfig::GetEventName(GlobalEventId::SAVEASDOCDONE), m_pData->m_pObjectShell ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEASDOCDONE, GlobalEventConfig::GetEventName(GlobalEventId::SAVEASDOCDONE), m_pData->m_pObjectShell.get() ) );
}
else
{
m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash );
m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo );
- SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVETODOCDONE, GlobalEventConfig::GetEventName(GlobalEventId::SAVETODOCDONE), m_pData->m_pObjectShell ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVETODOCDONE, GlobalEventConfig::GetEventName(GlobalEventId::SAVETODOCDONE), m_pData->m_pObjectShell.get() ) );
}
}
else
@@ -3103,7 +3103,7 @@ void SfxBaseModel::impl_store( const OUString& sURL
SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOCFAILED : SFX_EVENT_SAVEASDOCFAILED, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOCFAILED : GlobalEventId::SAVEASDOCFAILED),
- m_pData->m_pObjectShell ) );
+ m_pData->m_pObjectShell.get() ) );
throw task::ErrorCodeIOException(
("SfxBaseModel::impl_store <" + sURL + "> failed: 0x"
@@ -3185,8 +3185,8 @@ Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData() throw
if ( m_pData->m_pObjectShell.Is() && !m_pData->m_contViewData.is() )
{
SfxViewFrame *pActFrame = SfxViewFrame::Current();
- if ( !pActFrame || pActFrame->GetObjectShell() != m_pData->m_pObjectShell )
- pActFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell );
+ if ( !pActFrame || pActFrame->GetObjectShell() != m_pData->m_pObjectShell.get() )
+ pActFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell.get() );
if ( !pActFrame || !pActFrame->GetViewShell() )
// currently no frame for this document at all or View is under construction
@@ -3204,8 +3204,8 @@ Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData() throw
Reference < container::XIndexContainer > xCont( m_pData->m_contViewData, UNO_QUERY );
sal_Int32 nCount = 0;
Sequence < beans::PropertyValue > aSeq;
- for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell ); pFrame;
- pFrame = SfxViewFrame::GetNext( *pFrame, m_pData->m_pObjectShell ) )
+ for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell.get() ); pFrame;
+ pFrame = SfxViewFrame::GetNext( *pFrame, m_pData->m_pObjectShell.get() ) )
{
bool bIsActive = ( pFrame == pActFrame );
pFrame->GetViewShell()->WriteUserDataSequence( aSeq );
@@ -3607,7 +3607,7 @@ void SAL_CALL SfxBaseModel::setVisualAreaSize( sal_Int64 nAspect, const awt::Siz
if ( !m_pData->m_pObjectShell.Is() )
throw Exception(); // TODO: error handling
- SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst( m_pData->m_pObjectShell, false );
+ SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst( m_pData->m_pObjectShell.get(), false );
if ( pViewFrm && m_pData->m_pObjectShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED && !pViewFrm->GetFrame().IsInPlace() )
{
vcl::Window* pWindow = VCLUnoHelper::GetWindow( pViewFrm->GetFrame().GetFrameInterface()->getContainerWindow() );
@@ -3882,7 +3882,7 @@ bool SfxBaseModel::impl_getPrintHelper()
SfxModelGuard aGuard( *this );
if (!m_pData->m_sModuleIdentifier.isEmpty())
return m_pData->m_sModuleIdentifier;
- if (m_pData->m_pObjectShell)
+ if (m_pData->m_pObjectShell.Is())
return m_pData->m_pObjectShell->GetFactory().GetDocumentServiceName();
return OUString();
}
@@ -3935,7 +3935,7 @@ OUString SAL_CALL SfxBaseModel::getTitle()
SfxModelGuard aGuard( *this );
OUString aResult = impl_getTitleHelper()->getTitle ();
- if ( !m_pData->m_bExternalTitle && m_pData->m_pObjectShell )
+ if ( !m_pData->m_bExternalTitle && m_pData->m_pObjectShell.get() )
{
SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
if ( pMedium )
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 4fb03e400b09..ef4f10d22a82 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1701,7 +1701,7 @@ void SfxViewFrame::SetQuietMode_Impl( bool bOn )
SfxObjectShell* SfxViewFrame::GetObjectShell()
{
- return m_xObjSh;
+ return m_xObjSh.get();
}
const Size& SfxViewFrame::GetMargin_Impl() const
@@ -2330,8 +2330,8 @@ void SfxViewFrame::SetModalMode( bool bModal )
m_pImpl->bModal = bModal;
if ( m_xObjSh.Is() )
{
- for ( SfxViewFrame* pFrame = SfxViewFrame::GetFirst( m_xObjSh );
- !bModal && pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, m_xObjSh ) )
+ for ( SfxViewFrame* pFrame = SfxViewFrame::GetFirst( m_xObjSh.get() );
+ !bModal && pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, m_xObjSh.get() ) )
bModal = pFrame->m_pImpl->bModal;
m_xObjSh->SetModalMode_Impl( bModal );
}