summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2011-01-18 18:14:05 +0100
committerIvo Hinkelmann <ihi@openoffice.org>2011-01-18 18:14:05 +0100
commitfe734aca5cb8f5f2c77d29099c66db0321fb621c (patch)
tree5de36a30bfd6a959ea243247cd1aa4215d5a0e20 /sfx2
parentd24e979e2a82dcb3364f20fe0c56fa9551d35a52 (diff)
parente123329fb58109e3e83a51b0074dfed7d6849272 (diff)
CWS-TOOLING: integrate CWS fwk162
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/frmload.hxx2
-rw-r--r--sfx2/inc/sfx2/docfile.hxx1
-rw-r--r--sfx2/inc/sfx2/objsh.hxx11
-rw-r--r--sfx2/inc/sfx2/sfxbasecontroller.hxx3
-rw-r--r--sfx2/inc/sfx2/sfxbasemodel.hxx31
-rw-r--r--sfx2/source/appl/app.cxx2
-rw-r--r--sfx2/source/doc/doctempl.cxx4
-rw-r--r--sfx2/source/doc/docvor.cxx18
-rw-r--r--sfx2/source/doc/objcont.cxx50
-rw-r--r--sfx2/source/doc/objxtor.cxx25
-rwxr-xr-xsfx2/source/doc/printhelper.cxx8
-rw-r--r--sfx2/source/view/frmload.cxx40
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx10
13 files changed, 56 insertions, 149 deletions
diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx
index aa9b7e5cee..3f3fe029b6 100644
--- a/sfx2/inc/frmload.hxx
+++ b/sfx2/inc/frmload.hxx
@@ -113,7 +113,7 @@ private:
const ::rtl::OUString& i_rFactoryURL
) const;
- SfxObjectShellLock impl_findObjectShell(
+ SfxObjectShellRef impl_findObjectShell(
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel2 >& i_rxDocument
) const;
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index ccf5c7a353..d6288a7228 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -75,7 +75,6 @@ class SvStringsDtor;
#define OWEAKOBJECT ::cppu::OWeakObject
#define REFERENCE ::com::sun::star::uno::Reference
#define XINTERFACE ::com::sun::star::uno::XInterface
-#define SEQUENCE ::com::sun::star::uno::Sequence
#define EXCEPTION ::com::sun::star::uno::Exception
#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException
#define ANY ::com::sun::star::uno::Any
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index 8e4dde2872..f6efccbb60 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -158,11 +158,6 @@ typedef sal_uInt32 SfxObjectShellFlags;
//--------------------------------------------------------------------
-#define SEQUENCE ::com::sun::star::uno::Sequence
-#define OUSTRING ::rtl::OUString
-
-//--------------------------------------------------------------------
-
#define HIDDENINFORMATION_RECORDEDCHANGES 0x0001
#define HIDDENINFORMATION_NOTES 0x0002
#define HIDDENINFORMATION_DOCUMENTVERSIONS 0x0004
@@ -209,6 +204,7 @@ class SFX2_DLLPUBLIC SfxObjectShell :
public ::comphelper::IEmbeddedHelper, public ::sfx2::IXmlIdRegistrySupplier
{
friend struct ModifyBlocker_Impl;
+friend class SfxObjectShellLock;
private:
struct SfxObjectShell_Impl* pImp; // interne Daten
@@ -617,7 +613,7 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetBaseModel() const;
// Nur uebergangsweise fuer die Applikationen !!!
- virtual SEQUENCE< OUSTRING > GetEventNames();
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > GetEventNames();
Window* GetDialogParent( SfxMedium* pMedium=0 );
String UpdateTitle( SfxMedium* pMed=NULL, USHORT nDocViewNo=0 );
@@ -831,7 +827,6 @@ public:
//#endif
//--------------------------------------------------------------------
-
#ifndef SFX_DECL_OBJECTSHELL_DEFINED
#define SFX_DECL_OBJECTSHELL_DEFINED
SV_DECL_REF(SfxObjectShell)
@@ -840,8 +835,6 @@ SV_DECL_LOCK(SfxObjectShell)
SV_IMPL_LOCK(SfxObjectShell)
SV_IMPL_REF(SfxObjectShell)
-SfxObjectShellRef MakeObjectShellForOrganizer_Impl( const String& rName, BOOL bWriting );
-
//#if 0 // _SOLAR__PRIVATE
//--------------------------------------------------------------------
class AutoReloadTimer_Impl : public Timer
diff --git a/sfx2/inc/sfx2/sfxbasecontroller.hxx b/sfx2/inc/sfx2/sfxbasecontroller.hxx
index 566e45a599..ebabd29de5 100644
--- a/sfx2/inc/sfx2/sfxbasecontroller.hxx
+++ b/sfx2/inc/sfx2/sfxbasecontroller.hxx
@@ -66,7 +66,6 @@
// Some defines to write better code :-)
#define REFERENCE ::com::sun::star::uno::Reference
#define ANY ::com::sun::star::uno::Any
-#define SEQUENCE ::com::sun::star::uno::Sequence
#define XDISPATCH ::com::sun::star::frame::XDispatch
#define DISPATCHDESCRIPTOR ::com::sun::star::frame::DispatchDescriptor
#define XMODEL ::com::sun::star::frame::XModel
@@ -304,7 +303,7 @@ public:
@onerror -
*/
- virtual SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL queryDispatches( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescriptor ) throw( RUNTIMEEXCEPTION ) ;
+ virtual ::com::sun::star::uno::Sequence< REFERENCE< XDISPATCH > > SAL_CALL queryDispatches( const ::com::sun::star::uno::Sequence< DISPATCHDESCRIPTOR >& seqDescriptor ) throw( RUNTIMEEXCEPTION ) ;
//____________________________________________________________________________________________________
// XControllerBorder
diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx
index 5a8e377b7a..d29b0a1b42 100644
--- a/sfx2/inc/sfx2/sfxbasemodel.hxx
+++ b/sfx2/inc/sfx2/sfxbasemodel.hxx
@@ -161,7 +161,6 @@
#define EVENTOBJECT ::com::sun::star::lang::EventObject
#define PROPERTYVALUE ::com::sun::star::beans::PropertyValue
#define REFERENCE ::com::sun::star::uno::Reference
-#define SEQUENCE ::com::sun::star::uno::Sequence
#define MUTEX ::osl::Mutex
#define OUSTRING ::rtl::OUString
#define UNOTYPE ::com::sun::star::uno::Type
@@ -385,7 +384,7 @@ public:
@onerror A RuntimeException is thrown.
*/
- virtual SEQUENCE< UNOTYPE > SAL_CALL getTypes() throw( RUNTIMEEXCEPTION ) ;
+ virtual ::com::sun::star::uno::Sequence< UNOTYPE > SAL_CALL getTypes() throw( RUNTIMEEXCEPTION ) ;
/**___________________________________________________________________________________________________
@short get implementation id
@@ -401,7 +400,7 @@ public:
@onerror A RuntimeException is thrown.
*/
- virtual SEQUENCE< sal_Int8 > SAL_CALL getImplementationId() throw( RUNTIMEEXCEPTION ) ;
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw( RUNTIMEEXCEPTION ) ;
//____________________________________________________________________________________________________
@@ -580,7 +579,7 @@ public:
*/
virtual sal_Bool SAL_CALL attachResource( const OUSTRING& sURL ,
- const SEQUENCE< PROPERTYVALUE >& aArgs )
+ const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& aArgs )
throw (::com::sun::star::uno::RuntimeException);
/**___________________________________________________________________________________________________
@@ -611,7 +610,7 @@ public:
@onerror -
*/
- virtual SEQUENCE< PROPERTYVALUE > SAL_CALL getArgs() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< PROPERTYVALUE > SAL_CALL getArgs() throw (::com::sun::star::uno::RuntimeException);
/**___________________________________________________________________________________________________
@short -
@@ -861,7 +860,7 @@ public:
@onerror -
*/
- virtual SEQUENCE< PROPERTYVALUE > SAL_CALL getPrinter() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< PROPERTYVALUE > SAL_CALL getPrinter() throw (::com::sun::star::uno::RuntimeException);
/**___________________________________________________________________________________________________
@short -
@@ -876,7 +875,7 @@ public:
@onerror -
*/
- virtual void SAL_CALL setPrinter( const SEQUENCE< PROPERTYVALUE >& seqPrinter )
+ virtual void SAL_CALL setPrinter( const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqPrinter )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
/**___________________________________________________________________________________________________
@short -
@@ -891,14 +890,14 @@ public:
@onerror -
*/
- virtual void SAL_CALL print( const SEQUENCE< PROPERTYVALUE >& seqOptions )
+ virtual void SAL_CALL print( const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqOptions )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
//____________________________________________________________________________________________________
// XStorable2
//____________________________________________________________________________________________________
- virtual void SAL_CALL storeSelf( const SEQUENCE< PROPERTYVALUE >& seqArguments )
+ virtual void SAL_CALL storeSelf( const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
//____________________________________________________________________________________________________
@@ -979,7 +978,7 @@ public:
*/
virtual void SAL_CALL storeAsURL( const OUSTRING& sURL ,
- const SEQUENCE< PROPERTYVALUE >& seqArguments )
+ const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments )
throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException) ;
/**___________________________________________________________________________________________________
@@ -996,7 +995,7 @@ public:
*/
virtual void SAL_CALL storeToURL( const OUSTRING& sURL ,
- const SEQUENCE< PROPERTYVALUE >& seqArguments )
+ const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments )
throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
@@ -1037,7 +1036,7 @@ public:
@onerror -
*/
- virtual void SAL_CALL load( const SEQUENCE< PROPERTYVALUE >& seqArguments )
+ virtual void SAL_CALL load( const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments )
throw (::com::sun::star::frame::DoubleInitializationException,
::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException,
@@ -1058,7 +1057,7 @@ public:
//____________________________________________________________________________________________________
virtual void SAL_CALL loadFromStorage( const REFERENCE< XSTORAGE >& xStorage,
- const SEQUENCE< PROPERTYVALUE >& aMediaDescriptor )
+ const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& aMediaDescriptor )
throw ( ILLEGALARGUMENTEXCEPTION,
DOUBLEINITIALIZATIONEXCEPTION,
IOEXCEPTION,
@@ -1066,7 +1065,7 @@ public:
RUNTIMEEXCEPTION );
virtual void SAL_CALL storeToStorage( const REFERENCE< XSTORAGE >& xStorage,
- const SEQUENCE< PROPERTYVALUE >& aMediaDescriptor )
+ const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& aMediaDescriptor )
throw ( ILLEGALARGUMENTEXCEPTION,
IOEXCEPTION,
EXCEPTION,
@@ -1164,7 +1163,7 @@ public:
*/
- virtual SEQUENCE< DATAFLAVOR > SAL_CALL getTransferDataFlavors()
+ virtual ::com::sun::star::uno::Sequence< DATAFLAVOR > SAL_CALL getTransferDataFlavors()
throw (::com::sun::star::uno::RuntimeException);
/**___________________________________________________________________________________________________
@@ -1544,7 +1543,7 @@ private:
SAL_DLLPRIVATE ::rtl::OUString GetMediumFilterName_Impl();
SAL_DLLPRIVATE void impl_store( const OUSTRING& sURL ,
- const SEQUENCE< PROPERTYVALUE >& seqArguments ,
+ const ::com::sun::star::uno::Sequence< PROPERTYVALUE >& seqArguments ,
sal_Bool bSaveTo ) ;
SAL_DLLPRIVATE void postEvent_Impl( const ::rtl::OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >& xController = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >() );
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 0130f29f08..76e580bd6d 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -375,6 +375,8 @@ SfxApplication::SfxApplication()
SfxApplication::~SfxApplication()
{
+ OSL_ENSURE( GetObjectShells_Impl().Count() == 0, "Memory leak: some object shells were not removed!" );
+
Broadcast( SfxSimpleHint(SFX_HINT_DYING) );
SfxModule::DestroyModules_Impl();
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index c4cf0677bc..f92eabd321 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -137,7 +137,11 @@ namespace DocTempl {
class DocTempl_EntryData_Impl
{
RegionData_Impl* mpParent;
+
+ // the following member must be SfxObjectShellLock since it controlls that SfxObjectShell lifetime by design
+ // and users of this class expect it to be so.
SfxObjectShellLock mxObjShell;
+
OUString maTitle;
OUString maOwnURL;
OUString maTargetURL;
diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx
index e09ebbb582..e27a43fe85 100644
--- a/sfx2/source/doc/docvor.cxx
+++ b/sfx2/source/doc/docvor.cxx
@@ -546,6 +546,9 @@ BOOL SfxOrganizeListBox_Impl::Select( SvLBoxEntry* pEntry, BOOL bSelect )
return SvTreeListBox::Select(pEntry,bSelect);
Path aPath(this, pEntry);
+
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
GetObjectShell(aPath)->TriggerHelpPI(
aPath[nLevel+1], aPath[nLevel+2], aPath[nLevel+3]);
return SvTreeListBox::Select(pEntry,bSelect);
@@ -691,10 +694,12 @@ BOOL SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox,
BOOL bRemovedFromSource = FALSE;
Path aSource(pSourceBox, pSource);
Path aTarget(this, pTarget);
- SfxObjectShellRef aSourceDoc =
- ((SfxOrganizeListBox_Impl *)pSourceBox)->GetObjectShell(aSource);
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
+ SfxObjectShellRef aSourceDoc = ((SfxOrganizeListBox_Impl *)pSourceBox)->GetObjectShell(aSource);
SfxObjectShellRef aTargetDoc = GetObjectShell(aTarget);
+
const USHORT nSLevel =
((SfxOrganizeListBox_Impl *)pSourceBox)->GetDocLevel();
const USHORT nTLevel = GetDocLevel();
@@ -1210,6 +1215,9 @@ void SfxOrganizeListBox_Impl::RequestingChilds( SvLBoxEntry* pEntry )
{
const USHORT nDocLevel = GetDocLevel();
Path aPath(this, pEntry);
+
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
SfxObjectShellRef aRef = GetObjectShell(aPath);
if(aRef.Is())
{
@@ -1887,6 +1895,9 @@ long SfxOrganizeDlg_Impl::Dispatch_Impl( USHORT nId, Menu* _pMenu )
if(!QueryDelete_Impl(pDialog, STR_DELETE_TEMPLATE, pFocusBox->GetEntryText(pEntry)))
return 1;
Path aPath(pFocusBox, pEntry);
+
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
SfxObjectShellRef aRef = pFocusBox->GetObjectShell(aPath);
if(aRef.Is() &&
aRef->Remove(aPath[1+pFocusBox->GetDocLevel()],
@@ -1953,6 +1964,9 @@ long SfxOrganizeDlg_Impl::Dispatch_Impl( USHORT nId, Menu* _pMenu )
if ( !pEntry )
return 1;
Path aPath( pFocusBox, pEntry );
+
+ // it is ok to use the SfxObjectShellRef here since the object that
+ // provides it ( GetObjectShell() calls CreateObjectShell() ) has a lock on it
SfxObjectShellRef aRef = pFocusBox->GetObjectShell( aPath );
if ( aRef.Is() )
{
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 8300f7ea02..1e545e4f6b 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -1088,60 +1088,10 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
//REPLACE pInfo->Save(xDocStor);
}
}
-/*
- SfxConfigManager *pCfgMgr = SFX_CFGMANAGER();
- {
- SfxConfigManager *pTemplCfg = new SfxConfigManager(aTemplStor, pCfgMgr);
- SetConfigManager(pTemplCfg);
- SetTemplateConfig(TRUE);
-
- // Falls der gerade zerst"orte CfgMgr des Dokuments der
- // aktive war, pCfgMgr lieber neu holen
- pCfgMgr = SFX_CFGMANAGER();
-
- // ggf. den neuen ConfigManager aktivieren
- if ( this == SfxObjectShell::Current() )
- pTemplCfg->Activate(pCfgMgr);
- }
-*/
- // Template und Template-DocInfo werden nicht mehr gebraucht
-// delete pTemplInfo;
}
}
}
-SfxObjectShellRef MakeObjectShellForOrganizer_Impl( const String& aTargetURL, BOOL bForWriting )
-{
- // check for own format
- SfxObjectShellRef xDoc;
- StreamMode nMode = bForWriting ? SFX_STREAM_READWRITE : SFX_STREAM_READONLY;
- SfxMedium *pMed = new SfxMedium( aTargetURL, nMode, FALSE, 0 );
- const SfxFilter* pFilter = NULL;
- pMed->UseInteractionHandler(TRUE);
- if( SFX_APP()->GetFilterMatcher().GuessFilter( *pMed, &pFilter ) == ERRCODE_NONE && pFilter && pFilter->IsOwnFormat() )
- {
- // create document
- xDoc = SfxObjectShell::CreateObject( pFilter->GetServiceName(), SFX_CREATE_MODE_ORGANIZER );
- if ( xDoc.Is() )
- {
- // partially load, so don't use DoLoad!
- xDoc->DoInitNew(0);
- // TODO/LATER: make sure that we don't use binary templates!
- if( xDoc->LoadFrom( *pMed ) )
- {
- // connect to storage, abandon temp. storage
- xDoc->DoSaveCompleted( pMed );
- }
- else
- xDoc.Clear();
- }
- }
- else
- delete pMed;
-
- return xDoc;
-}
-
sal_Bool SfxObjectShell::IsHelpDocument() const
{
const SfxFilter* pFilter = GetMedium()->GetFilter();
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 83619b0265..530cdf4836 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -172,12 +172,7 @@ void SAL_CALL SfxModelListener_Impl::disposing( const com::sun::star::lang::Even
SfxObjectShell::SetCurrentComponent( Reference< XInterface >() );
}
- if ( mpDoc->Get_Impl()->bHiddenLockedByAPI )
- {
- mpDoc->Get_Impl()->bHiddenLockedByAPI = FALSE;
- mpDoc->OwnerLock(FALSE);
- }
- else if ( !mpDoc->Get_Impl()->bClosing )
+ if ( !mpDoc->Get_Impl()->bClosing )
// GCC stuerzt ab, wenn schon im dtor, also vorher Flag abfragen
mpDoc->DoClose();
}
@@ -835,22 +830,6 @@ void SfxObjectShell::InitBasicManager_Impl()
}
//--------------------------------------------------------------------
-#if 0 //(mba)
-SotObjectRef SfxObjectShell::CreateAggObj( const SotFactory* pFact )
-{
- // SvDispatch?
- SotFactory* pDispFact = SvDispatch::ClassFactory();
- if( pFact == pDispFact )
- return( (SfxShellObject*)GetSbxObject() );
-
- // sonst unbekannte Aggregation
- DBG_ERROR("unkekannte Factory");
- SotObjectRef aSvObjectRef;
- return aSvObjectRef;
-}
-#endif
-
-//--------------------------------------------------------------------
sal_uInt16 SfxObjectShell::Count()
{
@@ -873,7 +852,7 @@ SfxObjectShell* SfxObjectShell::GetObjectShell()
//--------------------------------------------------------------------
-SEQUENCE< OUSTRING > SfxObjectShell::GetEventNames()
+uno::Sequence< ::rtl::OUString > SfxObjectShell::GetEventNames()
{
static uno::Sequence< ::rtl::OUString >* pEventNameContainer = NULL;
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 78c236f385..8fdc19ff29 100755
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -344,7 +344,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
// Name-Property?
if ( rProp.Name.compareToAscii( "Name" ) == 0 )
{
- OUSTRING sTemp;
+ ::rtl::OUString sTemp;
if ( ( rProp.Value >>= sTemp ) == sal_False )
throw ::com::sun::star::lang::IllegalArgumentException();
@@ -618,9 +618,9 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
if ( rProp.Name.compareToAscii( "FileName" ) == 0 )
{
// unpack th URL and check for a valid and well known protocol
- OUSTRING sTemp;
+ ::rtl::OUString sTemp;
if (
- ( rProp.Value.getValueType()!=::getCppuType((const OUSTRING*)0)) ||
+ ( rProp.Value.getValueType()!=::getCppuType((const ::rtl::OUString*)0)) ||
(!(rProp.Value>>=sTemp))
)
{
@@ -717,7 +717,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
// Pages-Property
else if ( rProp.Name.compareToAscii( "Pages" ) == 0 )
{
- OUSTRING sTemp;
+ ::rtl::OUString sTemp;
if( rProp.Value >>= sTemp )
{
aCheckedArgs[nProps].Name = rProp.Name;
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index 06baeb744f..a5b6f8d4fa 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -263,25 +263,6 @@ sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlo
}
// --------------------------------------------------------------------------------------------------------------------
-void SfxFrameLoader_Impl::impl_lockHiddenDocument( SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor ) const
-{
- const sal_Bool bHidden = i_rDescriptor.getOrDefault( "Hidden", sal_False );
- if ( !bHidden )
- return;
-
- const SfxViewFrame* pExistingViewFrame = SfxViewFrame::GetFirst( &i_rDocument );
- if ( pExistingViewFrame )
- return;
-
- // the document is to be loaded hidden, and it is not yet displayed in any other frame
- // To prevent it from being closed when the loader returns, increase its OwnerLock
- // (the OwnerLock is normally increased by every frame in which the document is displayed, and by this loader)
- i_rDocument.RestoreNoDelete();
- i_rDocument.OwnerLock( TRUE );
- i_rDocument.Get_Impl()->bHiddenLockedByAPI = TRUE;
-}
-
-// --------------------------------------------------------------------------------------------------------------------
void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollection& io_rDescriptor ) const
{
const ::rtl::OUString sURL = io_rDescriptor.getOrDefault( "URL", ::rtl::OUString() );
@@ -331,7 +312,7 @@ void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollecti
}
// --------------------------------------------------------------------------------------------------------------------
-SfxObjectShellLock SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XModel2 >& i_rxDocument ) const
+SfxObjectShellRef SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XModel2 >& i_rxDocument ) const
{
for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, FALSE ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, FALSE ) )
{
@@ -635,15 +616,12 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA
// tell the doc its (current) load args.
impl_removeLoaderArguments( aDescriptor );
xModel->attachResource( xModel->getURL(), aDescriptor.getPropertyValues() );
- // TODO: not sure this is correct. The original, pre-refactoring code did it this way. However, I could
- // imagine scenarios where it is *not* correct to overrule the *existing* model args (XModel::getArgs)
- // with the ones passed to the loader here. For instance, what about the MacroExecutionMode? The document
- // might have a mode other than the one passed to the loader, and we always overwrite the former with
- // the latter.
}
// get the SfxObjectShell (still needed at the moment)
- const SfxObjectShellLock xDoc = impl_findObjectShell( xModel );
+ // SfxObjectShellRef is used here ( instead of ...Lock ) since the model is closed below if necessary
+ // SfxObjectShellLock would be even dangerous here, since the lifetime control should be done outside in case of success
+ const SfxObjectShellRef xDoc = impl_findObjectShell( xModel );
ENSURE_OR_THROW( xDoc.Is(), "no SfxObjectShell for the given model" );
// ensure the ID of the to-be-created view is in the descriptor, if possible
@@ -651,16 +629,6 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA
const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 );
const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetAPIViewName() );
- // if the document is created hidden, prevent it from being deleted until it is shown or disposed
- impl_lockHiddenDocument( *xDoc, aDescriptor );
- // TODO; if we wouldn't use a SfxObjectShellLock instance for xDoc, but a simple SfxObjectShellRef,
- // then this would not be necessary, /me thinks. That is, the *Lock classes inc/dec a "Lock" counter
- // (additional to the ref counter) in their ctor/dtor, and if the lock counter goes to 0, the
- // object is closed (DoClose). The impl_lockHiddenDocument is to prevent exactly that premature
- // closing. However, a *Ref object wouldn't close, anyway. And in case of unsuccessfull loading, the
- // code at the very end of this method cares for closing the XModel, which should also close the
- // ObjectShell.
-
// plug the document into the frame
impl_createDocumentView( xModel, _rTargetFrame, aViewCreationArgs, sViewName );
bLoadSuccess = sal_True;
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 4d71e06955..46d47b76fe 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -734,7 +734,7 @@ ANY SfxBaseController::getViewData() throw( ::com::sun::star::uno::RuntimeExcept
if ( m_pData->m_pViewShell )
{
m_pData->m_pViewShell->WriteUserData( sData1 ) ;
- OUSTRING sData( sData1 );
+ ::rtl::OUString sData( sData1 );
aAny <<= sData ;
}
@@ -750,7 +750,7 @@ void SAL_CALL SfxBaseController::restoreViewData( const ANY& aValue ) throw( ::c
::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pData->m_pViewShell )
{
- OUSTRING sData;
+ ::rtl::OUString sData;
aValue >>= sData ;
m_pData->m_pViewShell->ReadUserData( sData ) ;
}
@@ -781,7 +781,7 @@ REFERENCE< XMODEL > SAL_CALL SfxBaseController::getModel() throw( ::com::sun::st
//________________________________________________________________________________________________________
REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL& aURL ,
- const OUSTRING& sTargetFrameName,
+ const ::rtl::OUString& sTargetFrameName,
sal_Int32 eSearchFlags ) throw( RUNTIMEEXCEPTION )
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
@@ -938,12 +938,12 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL&
// SfxBaseController -> XDispatchProvider
//________________________________________________________________________________________________________
-SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL SfxBaseController::queryDispatches( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescripts ) throw( ::com::sun::star::uno::RuntimeException )
+uno::Sequence< REFERENCE< XDISPATCH > > SAL_CALL SfxBaseController::queryDispatches( const uno::Sequence< DISPATCHDESCRIPTOR >& seqDescripts ) throw( ::com::sun::star::uno::RuntimeException )
{
// Create return list - which must have same size then the given descriptor
// It's not allowed to pack it!
sal_Int32 nCount = seqDescripts.getLength();
- SEQUENCE< REFERENCE< XDISPATCH > > lDispatcher( nCount );
+ uno::Sequence< REFERENCE< XDISPATCH > > lDispatcher( nCount );
for( sal_Int32 i=0; i<nCount; ++i )
{