summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Voytenko <mav@openoffice.org>2011-01-03 13:40:23 +0100
committerMikhail Voytenko <mav@openoffice.org>2011-01-03 13:40:23 +0100
commit491837143455a6279f33703d0db01e57abc0e8cc (patch)
treed94f43191f8fd7db06483f0ac5da2388bdd5906f
parented82e3fdceba985d06ace98120a8b8bb1f13045a (diff)
fwk162: #i115902# review usage of SfxObjectShellRef, SfxObjecShellLock; remove unused some methods
-rw-r--r--sc/source/ui/docshell/arealink.cxx4
-rw-r--r--sc/source/ui/docshell/docsh4.cxx3
-rw-r--r--sc/source/ui/docshell/tablink.cxx3
3 files changed, 6 insertions, 4 deletions
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index d819785c843b..1cd4c4700894 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -270,9 +270,9 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter,
SfxMedium* pMed = new SfxMedium(aNewUrl, STREAM_STD_READ, FALSE, pFilter);
+ // aRef->DoClose() will be closed explicitly, but it is still more safe to use SfxObjectShellLock here
ScDocShell* pSrcShell = new ScDocShell(SFX_CREATE_MODE_INTERNAL);
-//REMOVE SvEmbeddedObjectRef aRef = pSrcShell;
- SfxObjectShellRef aRef = pSrcShell;
+ SfxObjectShellLock aRef = pSrcShell;
pSrcShell->DoLoad(pMed);
ScDocument* pSrcDoc = pSrcShell->GetDocument();
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index bba756b397cb..a8dd4e09254e 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -782,8 +782,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
SfxErrorContext aEc( ERRCTX_SFX_OPENDOC, pMed->GetName() );
+ // pOtherDocSh->DoClose() will be called explicitly later, but it is still more safe to use SfxObjectShellLock here
ScDocShell* pOtherDocSh = new ScDocShell;
- SfxObjectShellRef aDocShTablesRef = pOtherDocSh;
+ SfxObjectShellLock aDocShTablesRef = pOtherDocSh;
pOtherDocSh->DoLoad( pMed );
ULONG nErr = pOtherDocSh->GetErrorCode();
if (nErr)
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 697b39052b9f..5414e19c1ca4 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -219,8 +219,9 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter,
if ( bInEdit ) // only if using the edit dialog,
pMed->UseInteractionHandler( TRUE ); // enable the filter options dialog
+ // aRef->DoClose() will be called explicitly, but it is still more safe to use SfxObjectShellLock here
ScDocShell* pSrcShell = new ScDocShell(SFX_CREATE_MODE_INTERNAL);
- SfxObjectShellRef aRef = pSrcShell;
+ SfxObjectShellLock aRef = pSrcShell;
pSrcShell->DoLoad(pMed);
// Optionen koennten gesetzt worden sein