[Libreoffice-commits] core.git: include/sfx2 sfx2/source

Stephan Bergmann sbergman at redhat.com
Mon Nov 18 03:11:30 PST 2013


 include/sfx2/docfile.hxx    |    2 +-
 sfx2/source/doc/docfile.cxx |   17 +++++------------
 2 files changed, 6 insertions(+), 13 deletions(-)

New commits:
commit b150000278891a4bce875502de1265f507ed8958
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Nov 18 12:10:46 2013 +0100

    SfxMedium::LockOrigFileOnDemand return value is never used
    
    Change-Id: I2f64cc8fbe78354f9ded7a9a6bf03d9c597b3897

diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 7ef8b9e..33450a3 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -161,7 +161,7 @@ public:
     sal_Bool            IsStorage();
 
     sal_Int8            ShowLockedDocumentDialog( const css::uno::Sequence< OUString >& aData, sal_Bool bIsLoading, sal_Bool bOwnLock );
-    bool                LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI );
+    void                LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI );
     void                UnlockFile( sal_Bool bReleaseLockStream );
 
     css::uno::Reference< css::embed::XStorage > GetStorage( sal_Bool bCreateTempIfNo = sal_True );
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 0a96f89..1b808ed 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -979,23 +979,17 @@ namespace
 
 #endif // HAVE_FEATURE_MULTIUSER_ENVIRONMENT
 
-// returns true if the document can be opened for editing ( even if it should be a copy )
-// otherwise the document should be opened readonly
+// sets SID_DOC_READONLY if the document cannot be opened for editing
 // if user cancel the loading the ERROR_ABORT is set
-bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
+void SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
 {
 #if !HAVE_FEATURE_MULTIUSER_ENVIRONMENT
     (void) bLoading;
     (void) bNoUI;
-    return true;
 #else
-    if (!IsLockingUsed())
-        return true;
-
-    if ( GetURLObject().HasError() )
-        return false;
+    if (!IsLockingUsed() || GetURLObject().HasError())
+        return;
 
-    bool bResult = false;
     try
     {
         if ( pImp->m_bLocked && bLoading && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) )
@@ -1005,7 +999,7 @@ bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
             GetLockingStream_Impl();
         }
 
-        bResult = pImp->m_bLocked;
+        bool bResult = pImp->m_bLocked;
 
         if ( !bResult )
         {
@@ -1224,7 +1218,6 @@ bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
     {
         SAL_WARN( "sfx.doc", "Locking exception: high probability, that the content has not been created" );
     }
-    return bResult;
 #endif
 }
 


More information about the Libreoffice-commits mailing list