[Libreoffice-commits] .: Branch 'libreoffice-3-3' - sfx2/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Nov 23 20:05:05 PST 2010


 sfx2/source/doc/docfile.cxx      |    9 +++++++--
 sfx2/source/doc/sfxacldetect.cxx |    9 +++++++++
 sfx2/source/doc/sfxacldetect.hxx |   39 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 55 insertions(+), 2 deletions(-)

New commits:
commit 5e2fc23bbd05cc3f1a1a8aa90118c8d6012ba371
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Nov 23 15:42:32 2010 -0500

    Temporarily disable the extra ACL check.
    
    The fix for i#102464 no longer seems necessary.  In fact, leaving
    that "fix" would interfere with documents saved in samba shere;
    when a 2nd user tries to open a document in a samba share that's
    already opened by someone else, it would silently open in read-only
    mode, but the correct behavior is to launch the "Document in Use"
    dialog telling the 2nd user which user has it open.
    
    If disabling this checks causes no regressions, we can remove this.

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index f2e903e..7da31fb 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -143,12 +143,11 @@ using namespace ::com::sun::star::io;
 #include "openflag.hxx"     // SFX_STREAM_READONLY etc.
 #include "sfxresid.hxx"
 #include <sfx2/appuno.hxx>
+#include "sfxacldetect.hxx"
 
 #define MAX_REDIRECT 5
 
 
-sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath );
-
 //==========================================================
 namespace {
 
@@ -1055,6 +1054,11 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
             catch( uno::Exception )
             {}
 
+#if EXTRA_ACL_CHECK
+            // This block was introduced as a fix to i#102464, but removing
+            // this does not make the problem re-appear.  But leaving this
+            // part would interfere with documents saved in samba share.  This
+            // affects Windows only.
             if ( !bContentReadonly )
             {
                 // the file is not readonly, check the ACL
@@ -1063,6 +1067,7 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
                 if ( ::utl::LocalFileHelper::ConvertURLToPhysicalName( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), aPhysPath ) )
                     bContentReadonly = IsReadonlyAccordingACL( aPhysPath.GetBuffer() );
             }
+#endif
         }
 
         // do further checks only if the file not readonly in fs
diff --git a/sfx2/source/doc/sfxacldetect.cxx b/sfx2/source/doc/sfxacldetect.cxx
index 825bbdd..0aa9cb9 100644
--- a/sfx2/source/doc/sfxacldetect.cxx
+++ b/sfx2/source/doc/sfxacldetect.cxx
@@ -26,6 +26,13 @@
  *
  ************************************************************************/
 
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sfx2.hxx"
+
+#include "sfxacldetect.hxx"
+
+#if EXTRA_ACL_CHECK
+
 #ifdef WNT
 
 // necessary to include system headers without warnings
@@ -104,4 +111,6 @@ sal_Bool IsReadonlyAccordingACL( const sal_Unicode* )
 
 #endif
 
+#endif
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/sfxacldetect.hxx b/sfx2/source/doc/sfxacldetect.hxx
new file mode 100644
index 0000000..99868f6
--- /dev/null
+++ b/sfx2/source/doc/sfxacldetect.hxx
@@ -0,0 +1,39 @@
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Kohei Yoshida <kyoshida at novell.com>
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef __SFXACLDETECT_HXX__
+#define __SFXACLDETECT_HXX__
+
+// Let's check if this extra ACL check is still necessary...  If disabling it
+// causes no regressions, then we can safely remove this code.
+#define EXTRA_ACL_CHECK 0
+
+#if EXTRA_ACL_CHECK
+sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath );
+#endif
+
+#endif


More information about the Libreoffice-commits mailing list