[ooo-build-commit] Branch 'ooo/OOO320' - 5 commits - desktop/source sfx2/inc sfx2/source shell/inc svx/source xmloff/source

Jan Holesovsky kendy at kemper.freedesktop.org
Wed Dec 16 18:25:47 PST 2009


 desktop/source/deployment/dp_persmap.cxx           |    2 
 sfx2/inc/sfx2/docfile.hxx                          |    3 
 sfx2/source/doc/docfile.cxx                        |  159 ++++++++++++---
 sfx2/source/doc/objmisc.cxx                        |   16 +
 sfx2/source/doc/objstor.cxx                        |   14 +
 sfx2/source/doc/sfxacldetect.cxx                   |  216 ++++++++++-----------
 shell/inc/internal/utilities.hxx                   |    1 
 svx/source/cui/numpages.cxx                        |    8 
 svx/source/cui/paragrph.cxx                        |    2 
 svx/source/dialog/svxruler.cxx                     |    5 
 svx/source/sdr/primitive2d/sdrattributecreator.cxx |    2 
 svx/source/unodraw/UnoGraphicExporter.cxx          |    4 
 xmloff/source/text/txtimp.cxx                      |   10 
 13 files changed, 282 insertions(+), 160 deletions(-)

New commits:
commit 97463bc311d99f3a70431e7858ec8be43b0c21b2
Author: Oliver Bolte <obo at openoffice.org>
Date:   Mon Dec 14 12:45:03 2009 +0000

    CWS-TOOLING: integrate CWS sw32bf09
    2009-12-11 11:56:15 +0100 od  r277785 : #i107610# method <XMLTextImportHelper::SetOutlineStyles(..)>
    	  - correction of fix for issue 106218 to assure that paragraph style which
    	    are already applied to the outline style stay assigned.

diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 5e59f12..b26953b 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1661,8 +1661,14 @@ void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels )
         pProps->Name = sHeadingStyleName;
         for ( sal_Int32 i = 0; i < nCount; ++i )
         {
-            pProps->Value <<= sChosenStyles[i];
-            xChapterNumbering->replaceByIndex( i, makeAny( aProps ) );
+            // --> OD 2009-12-11 #i107610#
+            if ( bSetEmptyLevels ||
+                 sChosenStyles[i].getLength() > 0 )
+            // <--
+            {
+                pProps->Value <<= sChosenStyles[i];
+                xChapterNumbering->replaceByIndex( i, makeAny( aProps ) );
+            }
         }
         // <--
     }
commit 9b579030e34e57c9a66369cac7be44fd60454733
Author: Oliver Bolte <obo at openoffice.org>
Date:   Mon Dec 14 11:44:06 2009 +0000

    CWS-TOOLING: integrate CWS jl146
    2009-12-11 15:27:57 +0100 jsk  r277793 : jl146: #i107038 - The page is now centered so the workarounds for UNIX(like) OS are no longer required. Fixed one timing issue in a tools library
    2009-12-11 14:51:36 +0100 mav  r277792 : #i107525# use the system file locking after storing process is over
    2009-12-11 08:01:14 +0100 hde  r277783 : reverted previous changes
    2009-12-11 07:57:16 +0100 hde  r277782 : Introduce new sub to change default page layout
    2009-12-11 07:54:40 +0100 hde  r277781 : Introduce new sub to change default page layout
    2009-12-10 14:12:21 +0100 hde  r277779 : FIX: initial dialog closed that opened after loading document, close all documents at end of testcase
    2009-12-10 13:21:20 +0100 jsk  r277778 : jl146: #i107038 - Added call to ViewZoom at the end of hNewDocument() for Writer documents
    2009-12-10 13:19:53 +0100 mav  r277777 : #i10000# adopt for unix
    2009-12-10 11:58:47 +0100 hde  r277774 : FIX: selection of tabpage failed
    2009-12-10 11:58:16 +0100 mav  r277773 : #i107512# let the singleton be registered
    2009-12-10 11:28:23 +0100 jsk  r277771 : jl146: #i107038 - Reverting changes made for the given issue as it is no longer reproducible in a m7.
    2009-12-10 09:43:31 +0100 hde  r277770 : FIX: document must'nt be read only, export Filter fixed
    2009-12-09 21:51:15 +0100 mav  r277769 : #i107525# let the original file be locked with the system file locking
    2009-12-09 12:10:48 +0100 er  r277763 : #i107501# #i107518# ScRange::Parse_XL_Header: reset external doc name if it was none
    2009-12-09 11:54:32 +0100 jsk  r277762 : jl149: #i107548 - e_extensions.bas was unable to handle root-installations. Now we identify the installation target directory messagebox (which only pops up if the user has the rights to install into shared layer). Otherwise we skip.
    2009-12-09 08:56:16 +0100 jsk  r277756 : sb146: #i107548 - Replacing publisher.inc with the version from cws sb111 (which brings dynamic waiting plus extra time for unopkg add to complete)
    2009-12-08 15:11:19 +0100 jl  r277751 : #i107528# incorrect string conversion of the path of the berkeley db causes the Extension Manager to abort

diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx
index 43fe8b8..04f3f19 100644
--- a/desktop/source/deployment/dp_persmap.cxx
+++ b/desktop/source/deployment/dp_persmap.cxx
@@ -104,7 +104,7 @@ PersistentMap::PersistentMap( OUString const & url_, bool readOnly )
             OSL_ASSERT( false );
         }
         OString cstr_sysPath(
-            OUStringToOString( m_sysPath, osl_getThreadTextEncoding() ) );
+            OUStringToOString( m_sysPath, RTL_TEXTENCODING_UTF8 ) );
         char const * pcstr_sysPath = cstr_sysPath.getStr();
         
         u_int32_t flags = DB_CREATE;
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index ad63ad3..ad9e4e0 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -229,7 +229,7 @@ public:
 
     sal_Int8            ShowLockedDocumentDialog( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aData, sal_Bool bIsLoading, sal_Bool bOwnLock );
     sal_Bool            LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI );
-    void                UnlockFile();
+    void                UnlockFile( sal_Bool bReleaseLockStream );
 
     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetStorage( sal_Bool bCreateTempIfNo = sal_True );
     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetOutputStorage();
@@ -290,6 +290,7 @@ public:
     SAL_DLLPRIVATE void Init_Impl();
     SAL_DLLPRIVATE void ForceSynchronStream_Impl( sal_Bool bSynchron );
 
+    SAL_DLLPRIVATE void GetLockingStream_Impl();
     SAL_DLLPRIVATE void GetMedium_Impl();
     SAL_DLLPRIVATE sal_Bool TryDirectTransfer( const ::rtl::OUString& aURL, SfxItemSet& aTargetSet );
     SAL_DLLPRIVATE void Transfer_Impl();
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 5ac85ab..00117a1 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -383,6 +383,8 @@ public:
     Reference < XInputStream > xInputStream;
     Reference < XStream > xStream;
 
+    uno::Reference< io::XStream > m_xLockingStream;
+
     sal_uInt32					nLastStorageError;
     ::rtl::OUString				aCharset;
 
@@ -1114,6 +1116,13 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
     // otherwise the document should be opened readonly
     // if user cancel the loading the ERROR_ABORT is set
 
+    if ( pImp->m_bLocked && bLoading && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) )
+    {
+        // if the document is already locked the system locking might be temporarely off after storing
+        // check whether the system file locking should be taken again
+        GetLockingStream_Impl();
+    }
+
     sal_Bool bResult = pImp->m_bLocked;
 
     if ( !bResult )
@@ -1125,21 +1134,18 @@ sal_Bool SfxMedium::LockOrigFileOnDemand( sal_Bool bLoading, sal_Bool bNoUI )
 
     if ( !bResult && !IsReadOnly() )
     {
-        // check whether the file is readonly in fs
-        // the check is only necessary if 
-        // do it only for loading, some contents still might have problems with this property, let them not affect the saving
         sal_Bool bContentReadonly = sal_False;
-        if ( bLoading && ::utl::LocalFileHelper::IsLocalFile( aLogicName ) )
+        if ( bLoading && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) )
         {
-            // let the stream be opened to check the possibility to open it for editing
-            GetMedium_Impl();
+            // let the original document be opened to check the possibility to open it for editing
+            // and to let the writable stream stay open to hold the lock on the document
+            GetLockingStream_Impl();
         }
 
         // "IsReadOnly" property does not allow to detect whether the file is readonly always
         // so we try always to open the file for editing
         // the file is readonly only in case the read-write stream can not be opened
-        SFX_ITEMSET_ARG( pSet, pWriteStreamItem, SfxUnoAnyItem, SID_STREAM, sal_False);
-        if ( bLoading && !pWriteStreamItem )
+        if ( bLoading && !pImp->m_xLockingStream.is() )
         {
             try
             {
@@ -2270,6 +2276,45 @@ void SfxMedium::ClearBackup_Impl()
 }
 
 //----------------------------------------------------------------
+void SfxMedium::GetLockingStream_Impl()
+{
+    if ( ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) )
+      && !pImp->m_xLockingStream.is() )
+    {
+        SFX_ITEMSET_ARG( pSet, pWriteStreamItem, SfxUnoAnyItem, SID_STREAM, sal_False);
+        if ( pWriteStreamItem )
+            pWriteStreamItem->GetValue() >>= pImp->m_xLockingStream;
+   
+        if ( !pImp->m_xLockingStream.is() )
+        {
+            // open the original document
+            uno::Sequence< beans::PropertyValue > xProps;
+            TransformItems( SID_OPENDOC, *GetItemSet(), xProps );
+            comphelper::MediaDescriptor aMedium( xProps );
+
+            aMedium.addInputStreamOwnLock();
+
+            uno::Reference< io::XInputStream > xInputStream;
+            aMedium[comphelper::MediaDescriptor::PROP_STREAM()] >>= pImp->m_xLockingStream;
+            aMedium[comphelper::MediaDescriptor::PROP_INPUTSTREAM()] >>= xInputStream;
+
+            if ( !pImp->pTempFile && !aName.Len() )
+            {
+                // the medium is still based on the original file, it makes sence to initialize the streams
+                if ( pImp->m_xLockingStream.is() )
+                    pImp->xStream = pImp->m_xLockingStream;
+
+                if ( xInputStream.is() )
+                    pImp->xInputStream = xInputStream;
+
+                if ( !pImp->xInputStream.is() && pImp->xStream.is() )
+                    pImp->xInputStream = pImp->xStream->getInputStream();
+            }
+        }
+    }
+}
+
+//----------------------------------------------------------------
 void SfxMedium::GetMedium_Impl()
 {
     if ( !pInStream )
@@ -2335,27 +2380,36 @@ void SfxMedium::GetMedium_Impl()
                 TransformItems( SID_OPENDOC, *GetItemSet(), xProps );
                 comphelper::MediaDescriptor aMedium( xProps );
 
-                if ( bFromTempFile )
+                if ( pImp->m_xLockingStream.is() && !bFromTempFile )
                 {
-                    aMedium[comphelper::MediaDescriptor::PROP_URL()] <<= ::rtl::OUString( aFileName );
-                    aMedium.erase( comphelper::MediaDescriptor::PROP_READONLY() );
-                    aMedium.addInputStream();
-                }
-                else if ( ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) )
-                {
-                    // use the special locking approach only for file URLs
-                    aMedium.addInputStreamOwnLock();
+                    // the medium is not based on the temporary file, so the original stream can be used
+                    pImp->xStream = pImp->m_xLockingStream;
                 }
                 else
-                    aMedium.addInputStream();
+                {
+                    if ( bFromTempFile )
+                    {
+                        aMedium[comphelper::MediaDescriptor::PROP_URL()] <<= ::rtl::OUString( aFileName );
+                        aMedium.erase( comphelper::MediaDescriptor::PROP_READONLY() );
+                        aMedium.addInputStream();
+                    }
+                    else if ( ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) )
+                    {
+                        // use the special locking approach only for file URLs
+                        aMedium.addInputStreamOwnLock();
+                    }
+                    else
+                        aMedium.addInputStream();
+
+                    // the ReadOnly property set in aMedium is ignored
+                    // the check is done in LockOrigFileOnDemand() for file and non-file URLs
 
-                // the ReadOnly property set in aMedium is ignored
-                // the check is done in LockOrigFileOnDemand() for file and non-file URLs
+                    //TODO/MBA: what happens if property is not there?!
+                    aMedium[comphelper::MediaDescriptor::PROP_STREAM()] >>= pImp->xStream;
+                    aMedium[comphelper::MediaDescriptor::PROP_INPUTSTREAM()] >>= pImp->xInputStream;
+                }
 
-                //TODO/MBA: what happens if property is not there?!
                 GetContent();
-                aMedium[comphelper::MediaDescriptor::PROP_STREAM()] >>= pImp->xStream;
-                aMedium[comphelper::MediaDescriptor::PROP_INPUTSTREAM()] >>= pImp->xInputStream;
                 if ( !pImp->xInputStream.is() && pImp->xStream.is() )
                     pImp->xInputStream = pImp->xStream->getInputStream();
             }
@@ -2664,7 +2718,7 @@ void SfxMedium::Close()
 
     CloseStreams_Impl();
 
-    UnlockFile();
+    UnlockFile( sal_False );
 }
 
 void SfxMedium::CloseAndRelease()
@@ -2697,11 +2751,31 @@ void SfxMedium::CloseAndRelease()
 
     CloseAndReleaseStreams_Impl();
 
-    UnlockFile();
+    UnlockFile( sal_True );
 }
 
-void SfxMedium::UnlockFile()
+void SfxMedium::UnlockFile( sal_Bool bReleaseLockStream )
 {
+    if ( pImp->m_xLockingStream.is() )
+    {
+        if ( bReleaseLockStream )
+        {
+            try
+            {
+                uno::Reference< io::XInputStream > xInStream = pImp->m_xLockingStream->getInputStream();
+                uno::Reference< io::XOutputStream > xOutStream = pImp->m_xLockingStream->getOutputStream();
+                if ( xInStream.is() )
+                    xInStream->closeInput();
+                if ( xOutStream.is() )
+                    xOutStream->closeOutput();
+            }
+            catch( uno::Exception& )
+            {}
+        }
+
+        pImp->m_xLockingStream = uno::Reference< io::XStream >();
+    }
+
     if ( pImp->m_bLocked )
     {   
         try
@@ -2723,8 +2797,14 @@ void SfxMedium::CloseAndReleaseStreams_Impl()
     uno::Reference< io::XInputStream > xInToClose = pImp->xInputStream;
     uno::Reference< io::XOutputStream > xOutToClose;
     if ( pImp->xStream.is() )
+    {
         xOutToClose = pImp->xStream->getOutputStream();
 
+        // if the locking stream is closed here the related member should be cleaned
+        if ( pImp->xStream == pImp->m_xLockingStream )
+            pImp->m_xLockingStream = uno::Reference< io::XStream >();
+    }
+
     // The probably exsisting SvStream wrappers should be closed first
     CloseStreams_Impl();
 
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index ff4ed98..8fb219d 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -2531,12 +2531,20 @@ void SfxObjectShell::StoreLog()
 
     if ( pImp->m_xLogRing.is() )
     {
-        ::rtl::OUString aFileURL =
-            ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/bootstrap.ini:UserInstallation}" ) );
+#ifdef WNT
+        ::rtl::OUString aFileURL = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/bootstrap.ini:UserInstallation}" ) );
+#else
+        ::rtl::OUString aFileURL = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}" ) );
+#endif
+
         ::rtl::Bootstrap::expandMacros( aFileURL );
 
-        ::rtl::OUString aBuildID = 
-            ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/setup.ini:buildid}" ) );
+#ifdef WNT
+        ::rtl::OUString aBuildID = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/setup.ini:buildid}" ) );
+#else
+        ::rtl::OUString aBuildID = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "${$BRAND_BASE_DIR/program/setuprc:buildid}" ) );
+#endif
+
         ::rtl::Bootstrap::expandMacros( aBuildID );
 
         if ( aFileURL.getLength() )
commit 59c70a59d7a0ad11c00554d00a9c2ec57489b8b0
Author: Oliver Bolte <obo at openoffice.org>
Date:   Mon Dec 14 11:14:52 2009 +0000

    CWS-TOOLING: integrate CWS fwk132
    2009-12-12 22:36:36 +0100 mav  r277797 : #i107638# in some case no transfer is expected
    2009-12-12 20:38:55 +0100 jsk  r277796 : fwk132: <no issue> Found coding error, corrected
    2009-12-12 02:22:18 +0100 mav  r277795 : #i104974# workaround linux smb-client problem, be ready for errors while using mmap
    2009-12-12 01:46:25 +0100 mav  r277794 : #i104974# workaround impossibility to copy opened file

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 5b1e220..5ac85ab 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -3436,13 +3436,14 @@ void SfxMedium::CreateTempFile( sal_Bool bReplace )
 
     if ( !( nStorOpenMode & STREAM_TRUNC ) )
     {
+        sal_Bool bTransferSuccess = sal_False;
+
         if ( GetContent().is()
           && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) )
           && ::utl::UCBContentHelper::IsDocument( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) )
         {
             // if there is already such a document, we should copy it
             // if it is a file system use OS copy process
-            sal_Bool bTransferSuccess = sal_False;
             try
             {
                 uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > xComEnv;
@@ -3463,16 +3464,14 @@ void SfxMedium::CreateTempFile( sal_Bool bReplace )
             catch( uno::Exception& )
             {}
 
-            if ( !bTransferSuccess )
+            if ( bTransferSuccess )
             {
-                SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
-                return;
+                CloseOutStream();
+                CloseInStream();
             }
-
-            CloseOutStream();
-            CloseInStream();
         }
-        else if ( pInStream )
+
+        if ( !bTransferSuccess && pInStream )
         {
             // the case when there is no URL-access available or this is a remote protocoll
             // but there is an input stream
@@ -3492,13 +3491,25 @@ void SfxMedium::CreateTempFile( sal_Bool bReplace )
                     pOutStream->Write( pBuf, nRead );
                 }
 
+                bTransferSuccess = sal_True;
                 delete[] pBuf;
                 CloseInStream();
             }
             CloseOutStream_Impl();
         }
         else
+        {
+            // Quite strange design, but currently it is expected that in this case no transfer happens
+            // TODO/LATER: get rid of this inconsistent part of the call design
+            bTransferSuccess = sal_True;
             CloseInStream();
+        }
+
+        if ( !bTransferSuccess )
+        {
+            SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
+            return;
+        }
     }
 
     CloseStorage();
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index e1a8c62..972ac57 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1872,7 +1872,19 @@ sal_Bool SfxObjectShell::DisconnectStorage_Impl( SfxMedium& rSrcMedium, SfxMediu
         {
             uno::Reference< embed::XOptimizedStorage > xOptStorage( xStorage, uno::UNO_QUERY_THROW );
             ::rtl::OUString aBackupURL = rTargetMedium.GetBackup_Impl();
-            if ( aBackupURL.getLength() )
+            if ( !aBackupURL.getLength() )
+            {
+                // the backup could not be created, try to disconnect the storage and close the source SfxMedium
+                // in this case the optimization is not possible, connect storage to a temporary file
+                rTargetMedium.ResetError();
+                xOptStorage->writeAndAttachToStream( uno::Reference< io::XStream >() );
+                rSrcMedium.CanDisposeStorage_Impl( sal_False );
+                rSrcMedium.Close();
+
+                // now try to create the backup
+                rTargetMedium.GetBackup_Impl();
+            }
+            else
             {
                 // the following call will only compare stream sizes
                 // TODO/LATER: this is a very risky part, since if the URL contents are different from the storage
commit dcd868172cb0b527415537dc8c8960c1f46ad1a5
Author: Oliver Bolte <obo at openoffice.org>
Date:   Mon Dec 14 10:55:03 2009 +0000

    CWS-TOOLING: integrate CWS mingwport26
    2009-12-10 12:08:57 +0100 tono  r277776 : i#107584: mingw port fix for fwk125
    2009-12-10 12:04:42 +0100 tono  r277775 : i#107582: mingw port for tkr28

diff --git a/sfx2/source/doc/sfxacldetect.cxx b/sfx2/source/doc/sfxacldetect.cxx
index 94370e9..45d0dc9 100755
--- a/sfx2/source/doc/sfxacldetect.cxx
+++ b/sfx2/source/doc/sfxacldetect.cxx
@@ -1,108 +1,108 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: shutdowniconw32.cxx,v $
- * $Revision: 1.48 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef WNT
-
-// necessary to include system headers without warnings
-#ifdef _MSC_VER
-#pragma warning(disable:4668 4917) 
-#endif
-
-#include <windows.h>
-#include <lmaccess.h>
-#include <sal/types.h>
-
-sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath )
-{
-    sal_Bool bResult = sal_False;
-
-    sal_uInt32 nFDSize = 0;
-    GetFileSecurityW( pFilePath, DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, NULL, 0, &nFDSize );
-    if ( nFDSize )
-    {
-        PSECURITY_DESCRIPTOR pFileDescr = reinterpret_cast< PSECURITY_DESCRIPTOR >( malloc( nFDSize ) );
-        if ( GetFileSecurityW( pFilePath, DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, pFileDescr, nFDSize, &nFDSize ) )
-        {
-            HANDLE hToken = NULL;
-            if ( OpenThreadToken( GetCurrentThread(), TOKEN_DUPLICATE|TOKEN_QUERY, TRUE, &hToken )
-              || OpenProcessToken( GetCurrentProcess(), TOKEN_DUPLICATE|TOKEN_QUERY, &hToken) )
-            {
-                HANDLE hImpersonationToken = NULL;
-                if ( DuplicateToken( hToken, SecurityImpersonation, &hImpersonationToken) )
-                {
-                    sal_uInt32 nDesiredAccess = ACCESS_WRITE;
-                    GENERIC_MAPPING aGenericMapping = { ACCESS_READ, ACCESS_WRITE, 0, ACCESS_READ | ACCESS_WRITE };
-                    MapGenericMask( &nDesiredAccess, &aGenericMapping );
-
-                    PRIVILEGE_SET aPrivilegeSet;
-                    sal_uInt32 nPrivilegeSetSize = sizeof( PRIVILEGE_SET );
-
-                    sal_uInt32 nGrantedAccess;
-                    BOOL bAccessible = TRUE;
-                    if ( AccessCheck( pFileDescr,
-                                      hImpersonationToken,
-                                      nDesiredAccess,
-                                      &aGenericMapping,
-                                      &aPrivilegeSet,
-                                      &nPrivilegeSetSize,
-                                      &nGrantedAccess, 
-                                      &bAccessible ) )
-                    {
-                        bResult = !bAccessible;
-                    }
-
-                    CloseHandle( hImpersonationToken );
-                }
-
-                CloseHandle( hToken );
-            }
-        }
-
-        free( pFileDescr );
-    }
-
-    return bResult;
-}
-
-#else // this is UNX
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sfx2.hxx"
-
-
-#include <sal/types.h>
-
-sal_Bool IsReadonlyAccordingACL( const sal_Unicode* )
-{
-    // to be implemented
-    return sal_False;
-}
-
-#endif
-
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: shutdowniconw32.cxx,v $
+ * $Revision: 1.48 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifdef WNT
+
+// necessary to include system headers without warnings
+#ifdef _MSC_VER
+#pragma warning(disable:4668 4917) 
+#endif
+
+#include <windows.h>
+#include <lmaccess.h>
+#include <sal/types.h>
+
+sal_Bool IsReadonlyAccordingACL( const sal_Unicode* pFilePath )
+{
+    sal_Bool bResult = sal_False;
+
+    sal_uInt32 nFDSize = 0;
+    GetFileSecurityW( reinterpret_cast< LPCWSTR >(pFilePath), DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, NULL, 0, &nFDSize );
+    if ( nFDSize )
+    {
+        PSECURITY_DESCRIPTOR pFileDescr = reinterpret_cast< PSECURITY_DESCRIPTOR >( malloc( nFDSize ) );
+        if ( GetFileSecurityW( reinterpret_cast< LPCWSTR >(pFilePath), DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION, pFileDescr, nFDSize, &nFDSize ) )
+        {
+            HANDLE hToken = NULL;
+            if ( OpenThreadToken( GetCurrentThread(), TOKEN_DUPLICATE|TOKEN_QUERY, TRUE, &hToken )
+              || OpenProcessToken( GetCurrentProcess(), TOKEN_DUPLICATE|TOKEN_QUERY, &hToken) )
+            {
+                HANDLE hImpersonationToken = NULL;
+                if ( DuplicateToken( hToken, SecurityImpersonation, &hImpersonationToken) )
+                {
+                    sal_uInt32 nDesiredAccess = ACCESS_WRITE;
+                    GENERIC_MAPPING aGenericMapping = { ACCESS_READ, ACCESS_WRITE, 0, ACCESS_READ | ACCESS_WRITE };
+                    MapGenericMask( &nDesiredAccess, &aGenericMapping );
+
+                    PRIVILEGE_SET aPrivilegeSet;
+                    sal_uInt32 nPrivilegeSetSize = sizeof( PRIVILEGE_SET );
+
+                    sal_uInt32 nGrantedAccess;
+                    BOOL bAccessible = TRUE;
+                    if ( AccessCheck( pFileDescr,
+                                      hImpersonationToken,
+                                      nDesiredAccess,
+                                      &aGenericMapping,
+                                      &aPrivilegeSet,
+                                      &nPrivilegeSetSize,
+                                      &nGrantedAccess, 
+                                      &bAccessible ) )
+                    {
+                        bResult = !bAccessible;
+                    }
+
+                    CloseHandle( hImpersonationToken );
+                }
+
+                CloseHandle( hToken );
+            }
+        }
+
+        free( pFileDescr );
+    }
+
+    return bResult;
+}
+
+#else // this is UNX
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sfx2.hxx"
+
+
+#include <sal/types.h>
+
+sal_Bool IsReadonlyAccordingACL( const sal_Unicode* )
+{
+    // to be implemented
+    return sal_False;
+}
+
+#endif
+
diff --git a/shell/inc/internal/utilities.hxx b/shell/inc/internal/utilities.hxx
index ebdf605..aed9626 100644
--- a/shell/inc/internal/utilities.hxx
+++ b/shell/inc/internal/utilities.hxx
@@ -47,6 +47,7 @@
 #include "internal/types.hxx"
 
 #include <string>
+#define STRSAFE_NO_DEPRECATE
 #include <strsafe.h>
 
 //---------------------------------
commit 8698dc35dac0058ea0bcfd6e4ef121712030aacf
Author: Oliver Bolte <obo at openoffice.org>
Date:   Mon Dec 14 08:59:59 2009 +0000

    CWS-TOOLING: integrate CWS communitypatches320
    2009-12-14 08:15:29 +0100 ka  r277799 : added community patches

diff --git a/svx/source/cui/numpages.cxx b/svx/source/cui/numpages.cxx
index 6069efd..40673c3 100644
--- a/svx/source/cui/numpages.cxx
+++ b/svx/source/cui/numpages.cxx
@@ -311,7 +311,7 @@ SfxTabPage*	 SvxSingleNumPickTabPage::Create( Window* pParent,
 
 BOOL  SvxSingleNumPickTabPage::FillItemSet( SfxItemSet& rSet )
 {
-    if(bPreset || bModified && pSaveNum)
+    if( (bPreset || bModified) && pSaveNum)
     {
         *pSaveNum = *pActNum;
         rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId);
@@ -513,7 +513,7 @@ SfxTabPage*	 SvxBulletPickTabPage::Create( Window* pParent,
 
 BOOL  SvxBulletPickTabPage::FillItemSet( SfxItemSet& rSet )
 {
-    if(bPreset || bModified && pActNum)
+    if( (bPreset || bModified) && pActNum)
     {
         *pSaveNum = *pActNum;
         rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId);
@@ -750,7 +750,7 @@ SfxTabPage*	 SvxNumPickTabPage::Create( Window* pParent,
 
 BOOL  SvxNumPickTabPage::FillItemSet( SfxItemSet& rSet )
 {
-    if(bPreset || bModified && pActNum)
+    if( (bPreset || bModified) && pActNum)
     {
         *pSaveNum = *pActNum;
         rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId);
@@ -1110,7 +1110,7 @@ BOOL  SvxBitmapPickTabPage::FillItemSet( SfxItemSet& rSet )
 //		rSet.DisableItem(SID_ATTR_NUMBERING_RULE);
         return FALSE;
     }
-    if(bPreset || bModified && pActNum)
+    if( (bPreset || bModified) && pActNum)
     {
         *pSaveNum = *pActNum;
         rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId);
diff --git a/svx/source/cui/paragrph.cxx b/svx/source/cui/paragrph.cxx
index 2275e0d..29ec73d 100644
--- a/svx/source/cui/paragrph.cxx
+++ b/svx/source/cui/paragrph.cxx
@@ -1307,7 +1307,7 @@ void SvxParaAlignTabPage::Reset( const SfxItemSet& rSet )
         aLastLineLB.Hide();
         aLastLineFT.Hide();
         aExpandCB.Hide();
-        if(!(nHtmlMode & HTMLMODE_FULL_STYLES|HTMLMODE_FIRSTLINE) )
+        if(!(nHtmlMode & (HTMLMODE_FULL_STYLES|HTMLMODE_FIRSTLINE)) )
             aJustify.Disable();
         aSnapToGridCB.Show(FALSE);
     }
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 13d479b..f52b897 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -2761,8 +2761,9 @@ void SvxRuler::EvalModifier()
      case KEY_MOD1:  {
          const RulerType eType = GetDragType();
          nDragType = DRAG_OBJECT_SIZE_PROPORTIONAL;
-         if(RULER_TYPE_BORDER == eType || RULER_TYPE_TAB == eType||
-            RULER_TYPE_MARGIN1&&pColumnItem)
+         if( RULER_TYPE_TAB == eType ||
+             ( ( RULER_TYPE_BORDER == eType || RULER_TYPE_MARGIN1 == eType ) &&
+               pColumnItem ) )  
              PrepareProportional_Impl(eType);
          break;
      }
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 417445b..b6a8a4e 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -556,7 +556,7 @@ namespace drawinglayer
                 const XGradient& rGradient = ((XFillFloatTransparenceItem*)pGradientItem)->GetGradientValue();
                 const sal_uInt8 nStartLuminance(rGradient.GetStartColor().GetLuminance());
                 const sal_uInt8 nEndLuminance(rGradient.GetEndColor().GetLuminance());
-                const bool bCompletelyTransparent(0xff == nStartLuminance == nEndLuminance);
+                const bool bCompletelyTransparent(0xff == nStartLuminance && 0xff == nEndLuminance);
 
                 if(!bCompletelyTransparent)
                 {
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 691d23a..f360ef2 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -837,7 +837,9 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
                     if ( aGraphic.GetType() == GRAPHIC_BITMAP )
                     {
                         Size aSizePixel( aGraphic.GetSizePixel() );
-                        if ( rSettings.mnWidth && rSettings.mnHeight && ( rSettings.mnWidth != aSizePixel.Width() ) || ( rSettings.mnHeight != aSizePixel.Height() ) )
+                        if( rSettings.mnWidth && rSettings.mnHeight &&
+                            ( ( rSettings.mnWidth != aSizePixel.Width() ) ||
+                              ( rSettings.mnHeight != aSizePixel.Height() ) ) )
                         {
                             BitmapEx aBmpEx( aGraphic.GetBitmapEx() );
                             aBmpEx.Scale( Size( rSettings.mnWidth, rSettings.mnHeight ) );


More information about the ooo-build-commit mailing list