[PATCH 1/2] Change unnamespace file.hxx macros

Andy Holder andy.m.holder at googlemail.com
Sat Dec 11 10:02:43 PST 2010


---
 basic/source/runtime/iosys.cxx                     |   10 +++++-----
 desktop/source/app/lockfile.cxx                    |    4 ++--
 framework/source/services/license.cxx              |    2 +-
 sfx2/source/appl/shutdownicon.cxx                  |    2 +-
 shell/qa/recent_docs.cxx                           |    2 +-
 svx/source/dialog/docrecovery.cxx                  |    2 +-
 svx/source/unodraw/recoveryui.cxx                  |    2 +-
 ucb/source/ucp/file/filinpstr.cxx                  |    4 ++--
 ucb/source/ucp/file/filrec.cxx                     |    6 +++---
 ucb/source/ucp/file/filstr.cxx                     |    4 ++--
 ucb/source/ucp/file/shell.cxx                      |   12 ++++++------
 .../source/cxxhelp/inc/util/RandomAccessStream.hxx |    6 +++---
 xmlhelp/source/cxxhelp/provider/databases.cxx      |    4 ++--
 xmlhelp/source/cxxhelp/provider/inputstream.cxx    |    2 +-
 xmlhelp/source/cxxhelp/provider/urlparameter.cxx   |    2 +-
 xmlhelp/source/treeview/tvread.cxx                 |    4 ++--
 16 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index b433925..36135ee 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -364,21 +364,21 @@ OslStream::OslStream( const String& rName, short nStrmMode )
 
     if( (nStrmMode & (STREAM_READ | STREAM_WRITE)) == (STREAM_READ | STREAM_WRITE) )
     {
-        nFlags = OpenFlag_Read | OpenFlag_Write;
+        nFlags = osl_File_OpenFlag_Read | osl_File_OpenFlag_Write;
     }
     else if( nStrmMode & STREAM_WRITE )
     {
-        nFlags = OpenFlag_Write;
+        nFlags = osl_File_OpenFlag_Write;
     }
     else //if( nStrmMode & STREAM_READ )
     {
-        nFlags = OpenFlag_Read;
+        nFlags = osl_File_OpenFlag_Read;
     }
 
     osl::FileBase::RC nRet = maFile.open( nFlags );
-    if( nRet == osl::FileBase::E_NOENT && nFlags != OpenFlag_Read )
+    if( nRet == osl::FileBase::E_NOENT && nFlags != osl_File_OpenFlag_Read )
     {
-        nFlags |= OpenFlag_Create;
+        nFlags |= osl_File_OpenFlag_Create;
         nRet = maFile.open( nFlags );
     }
 
diff --git a/desktop/source/app/lockfile.cxx b/desktop/source/app/lockfile.cxx
index 24c3b7e..79c8bca 100644
--- a/desktop/source/app/lockfile.cxx
+++ b/desktop/source/app/lockfile.cxx
@@ -121,7 +121,7 @@ namespace desktop {
 
         // try to create file
         File aFile(m_aLockname);
-        if (aFile.open( OpenFlag_Create ) == File::E_EXIST) {
+        if (aFile.open( osl_File_OpenFlag_Create ) == File::E_EXIST) {
             m_bIsLocked = sal_True;
         } else {
             // new lock created
@@ -141,7 +141,7 @@ namespace desktop {
                 // remove file and create new
                 File::remove( m_aLockname );
                 File aFile(m_aLockname);
-                aFile.open( OpenFlag_Create );
+                aFile.open( osl_File_OpenFlag_Create );
                 aFile.close( );
                 syncToFile( );
                 m_bRemove = sal_True;
diff --git a/framework/source/services/license.cxx b/framework/source/services/license.cxx
index a091f93..03bc99b 100644
--- a/framework/source/services/license.cxx
+++ b/framework/source/services/license.cxx
@@ -451,7 +451,7 @@ LicenseDialog::LicenseDialog(const ::rtl::OUString & aLicensePath, ResMgr *pResM
 
     // load license text
     File aLicenseFile(aLicensePath);
-    if ( aLicenseFile.open(OpenFlag_Read) == FileBase::E_None)
+    if ( aLicenseFile.open(osl_File_OpenFlag_Read) == FileBase::E_None)
     {
         DirectoryItem d;
         DirectoryItem::get(aLicensePath, d);
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 85e366f..47839f8 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -859,7 +859,7 @@ bool ShutdownIcon::GetAutostart( )
     OUString aShortcutUrl;
     osl::File::getFileURLFromSystemPath( aShortcut, aShortcutUrl );
     osl::File f( aShortcutUrl );
-    osl::File::RC error = f.open( OpenFlag_Read );
+    osl::File::RC error = f.open( osl_File_OpenFlag_Read );
     if( error == osl::File::E_None )
     {
         f.close();
diff --git a/shell/qa/recent_docs.cxx b/shell/qa/recent_docs.cxx
index 5f3c34c..fa4181a 100644
--- a/shell/qa/recent_docs.cxx
+++ b/shell/qa/recent_docs.cxx
@@ -137,7 +137,7 @@ public:
     void read_recently_used(void* buffer, size_t size)
     {
         File ruf(get_recently_used_url());
-        FileBase::RC rc = ruf.open(OpenFlag_Read);
+        FileBase::RC rc = ruf.open(osl_File_OpenFlag_Read);
 
         CPPUNIT_ASSERT_MESSAGE("Cannot open ~/.recently-used", FileBase::E_None == rc);
 
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index 987f902..876b4d6 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -2080,7 +2080,7 @@ void BrokenRecoveryDialog::impl_askForSavePath()
             ::osl::File aFile( rURL );
 
             printf( "Loading %s:", OString( rURL.getStr(), rURL.getLength(), osl_getThreadTextEncoding() ).getStr() );
-            if ( ::osl::FileBase::E_None == aFile.open( OpenFlag_Read ) )
+            if ( ::osl::FileBase::E_None == aFile.open( osl_File_OpenFlag_Read ) )
             {
                 ::rtl::OString	aContent;
                 ::osl::FileBase::RC	result;
diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx
index 4c3a460..e131ffc 100644
--- a/svx/source/unodraw/recoveryui.cxx
+++ b/svx/source/unodraw/recoveryui.cxx
@@ -231,7 +231,7 @@ static bool new_crash_pending()
     OUString	aUnsentURL = GetUnsentURL();
     File	aFile( aUnsentURL );
 
-    if ( FileBase::E_None == aFile.open( OpenFlag_Read ) )
+    if ( FileBase::E_None == aFile.open( osl_File_OpenFlag_Read ) )
     {
         aFile.close();
         return true;
diff --git a/ucb/source/ucp/file/filinpstr.cxx b/ucb/source/ucp/file/filinpstr.cxx
index 052cf13..368a129 100644
--- a/ucb/source/ucp/file/filinpstr.cxx
+++ b/ucb/source/ucp/file/filinpstr.cxx
@@ -48,9 +48,9 @@ XInputStream_impl::XInputStream_impl( shell* pMyShell,const rtl::OUString& aUncP
       m_nErrorCode( TASKHANDLER_NO_ERROR ),
       m_nMinorErrorCode( TASKHANDLER_NO_ERROR )
 {
-    sal_uInt32 nFlags = OpenFlag_Read;
+    sal_uInt32 nFlags = osl_File_OpenFlag_Read;
     if ( !bLock )
-        nFlags |= OpenFlag_NoLock;
+        nFlags |= osl_File_OpenFlag_NoLock;
 
     osl::FileBase::RC err = m_aFile.open( nFlags );
     if( err != osl::FileBase::E_None )
diff --git a/ucb/source/ucp/file/filrec.cxx b/ucb/source/ucp/file/filrec.cxx
index b0debe0..a4a07b0 100644
--- a/ucb/source/ucp/file/filrec.cxx
+++ b/ucb/source/ucp/file/filrec.cxx
@@ -46,7 +46,7 @@ sal_Bool ReconnectingFile::reconnect()
     {
         disconnect();
         if ( m_aFile.open( m_nFlags ) == ::osl::FileBase::E_None
-          || m_aFile.open( OpenFlag_Read ) == ::osl::FileBase::E_None )
+          || m_aFile.open( osl_File_OpenFlag_Read ) == ::osl::FileBase::E_None )
         {
             m_bDisconnect = sal_False;
             bResult = sal_True;
@@ -61,8 +61,8 @@ sal_Bool ReconnectingFile::reconnect()
     ::osl::FileBase::RC nResult = m_aFile.open( uFlags );
     if ( nResult == ::osl::FileBase::E_None )
     {
-        if ( uFlags & OpenFlag_Create )
-            m_nFlags = (uFlags & ( ~OpenFlag_Create )) | OpenFlag_Write;
+        if ( uFlags & osl_File_OpenFlag_Create )
+            m_nFlags = (uFlags & ( ~osl_File_OpenFlag_Create )) | osl_File_OpenFlag_Write;
         else
             m_nFlags = uFlags;
     
diff --git a/ucb/source/ucp/file/filstr.cxx b/ucb/source/ucp/file/filstr.cxx
index 640ec62..5a28a4c 100644
--- a/ucb/source/ucp/file/filstr.cxx
+++ b/ucb/source/ucp/file/filstr.cxx
@@ -110,9 +110,9 @@ XStream_impl::XStream_impl( shell* pMyShell,const rtl::OUString& aUncPath, sal_B
       m_nErrorCode( TASKHANDLER_NO_ERROR ),
       m_nMinorErrorCode( TASKHANDLER_NO_ERROR )
 {
-    sal_uInt32 nFlags = ( OpenFlag_Read | OpenFlag_Write );
+    sal_uInt32 nFlags = ( osl_File_OpenFlag_Read | osl_File_OpenFlag_Write );
     if ( !bLock )
-        nFlags |= OpenFlag_NoLock;
+        nFlags |= osl_File_OpenFlag_NoLock;
 
     osl::FileBase::RC err = m_aFile.open( nFlags );
     if(  err != osl::FileBase::E_None )
diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx
index 714588a..63cef17 100644
--- a/ucb/source/ucp/file/shell.cxx
+++ b/ucb/source/ucp/file/shell.cxx
@@ -594,7 +594,7 @@ void SAL_CALL shell::page( sal_Int32 CommandId,
 {
     uno::Reference< XContentProvider > xProvider( m_pProvider );
     osl::File aFile( aUnqPath );
-    osl::FileBase::RC err = aFile.open( OpenFlag_Read );
+    osl::FileBase::RC err = aFile.open( osl_File_OpenFlag_Read );
 
     if( err != osl::FileBase::E_None )
     {
@@ -905,7 +905,7 @@ shell::setv( const rtl::OUString& aUnqPath,
                 {   // valid value for the size
                     osl::File aFile(aUnqPath);
                     bool err =
-                        aFile.open(OpenFlag_Write) != osl::FileBase::E_None ||
+                        aFile.open(osl_File_OpenFlag_Write) != osl::FileBase::E_None ||
                         aFile.setSize(sal_uInt64(newSize)) != osl::FileBase::E_None ||
                         aFile.close() != osl::FileBase::E_None;
 
@@ -1800,12 +1800,12 @@ shell::write( sal_Int32 CommandId,
 
     if( OverWrite )
     {
-        err = aFile.open( OpenFlag_Write | OpenFlag_Create );
+        err = aFile.open( osl_File_OpenFlag_Write | osl_File_OpenFlag_Create );
 
         if( err != osl::FileBase::E_None )
         {
             aFile.close();
-            err = aFile.open( OpenFlag_Write );
+            err = aFile.open( osl_File_OpenFlag_Write );
         }
 
         if( err != osl::FileBase::E_None )
@@ -1818,7 +1818,7 @@ shell::write( sal_Int32 CommandId,
     }
     else
     {
-        err = aFile.open( OpenFlag_Read | OpenFlag_NoLock );
+        err = aFile.open( osl_File_OpenFlag_Read | osl_File_OpenFlag_NoLock );
         if( err == osl::FileBase::E_None )  // The file exists and shall not be overwritten
         {
             installError( CommandId,
@@ -1831,7 +1831,7 @@ shell::write( sal_Int32 CommandId,
 
         // as a temporary solution the creation does not lock the file at all
         // in future it should be possible to create the file without lock explicitly
-        err = aFile.open( OpenFlag_Write | OpenFlag_Create | OpenFlag_NoLock );
+        err = aFile.open( osl_File_OpenFlag_Write | osl_File_OpenFlag_Create | osl_File_OpenFlag_NoLock );
 
         if( err != osl::FileBase::E_None )
         {
diff --git a/xmlhelp/source/cxxhelp/inc/util/RandomAccessStream.hxx b/xmlhelp/source/cxxhelp/inc/util/RandomAccessStream.hxx
index bff2eef..c4ecca2 100644
--- a/xmlhelp/source/cxxhelp/inc/util/RandomAccessStream.hxx
+++ b/xmlhelp/source/cxxhelp/inc/util/RandomAccessStream.hxx
@@ -51,9 +51,9 @@ namespace xmlsearch {
       
         protected:
       
-            enum OPENFLAG { Read = OpenFlag_Read,
-                            Write = OpenFlag_Write,
-                            Create = OpenFlag_Create };
+            enum OPENFLAG { Read = osl_File_OpenFlag_Read,
+                            Write = osl_File_OpenFlag_Write,
+                            Create = osl_File_OpenFlag_Create };
       
         };
 
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index c1d57c7..361fafa 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -494,7 +494,7 @@ StaticModuleInformation* Databases::getStaticInformationForModule( const rtl::OU
                            key +
                            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ".cfg" )) );
 
-        if( osl::FileBase::E_None != cfgFile.open( OpenFlag_Read ) )
+        if( osl::FileBase::E_None != cfgFile.open( osl_File_OpenFlag_Read ) )
             it->second = 0;
         else
         {
@@ -1329,7 +1329,7 @@ void Databases::cascadingStylesheet( const rtl::OUString& Language,
             osl::FileStatus aStatus( FileStatusMask_FileSize );
 
             if( osl::FileBase::E_None == osl::DirectoryItem::get( fileURL,aDirItem ) &&
-                osl::FileBase::E_None == aFile.open( OpenFlag_Read )                 &&
+                osl::FileBase::E_None == aFile.open( osl_File_OpenFlag_Read )        &&
                 osl::FileBase::E_None == aDirItem.getFileStatus( aStatus ) )
             {
                 sal_uInt64 nSize;
diff --git a/xmlhelp/source/cxxhelp/provider/inputstream.cxx b/xmlhelp/source/cxxhelp/provider/inputstream.cxx
index 52fbe60..b668a7d 100644
--- a/xmlhelp/source/cxxhelp/provider/inputstream.cxx
+++ b/xmlhelp/source/cxxhelp/provider/inputstream.cxx
@@ -42,7 +42,7 @@ XInputStream_impl::XInputStream_impl( const rtl::OUString& aUncPath )
     : m_bIsOpen( false ),
       m_aFile( aUncPath )
 {
-    m_bIsOpen = ( osl::FileBase::E_None == m_aFile.open( OpenFlag_Read ) );
+    m_bIsOpen = ( osl::FileBase::E_None == m_aFile.open( osl_File_OpenFlag_Read ) );
 }
 
 
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index 0d5aa3e..3b5b30b 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -761,7 +761,7 @@ helpMatch(const char * URI) {
 static void *
 fileOpen(const char *URI) {
     osl::File *pRet = new osl::File(rtl::OUString(URI, strlen(URI), RTL_TEXTENCODING_UTF8));
-    pRet->open(OpenFlag_Read);
+    pRet->open(osl_File_OpenFlag_Read);
     return pRet;
 }
 
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index 502e8bd..f39461c 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -519,7 +519,7 @@ TVChildTarget::TVChildTarget( const Reference< XMultiServiceFactory >& xMSF )
         len = configData.vFileLen[--j];
         char* s = new char[ int(len) ];  // the buffer to hold the installed files
         osl::File aFile( configData.vFileURL[j] );
-        aFile.open( OpenFlag_Read );
+        aFile.open( osl_File_OpenFlag_Read );
         aFile.read( s,len,ret );
         aFile.close();
 
@@ -781,7 +781,7 @@ ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
                 if(! showBasic && baseName.compareToAscii("sbasic") == 0 )
                   continue;
                 osl::File aFile( aFileUrl );
-                if( osl::FileBase::E_None == aFile.open( OpenFlag_Read ) )
+                if( osl::FileBase::E_None == aFile.open( osl_File_OpenFlag_Read ) )
                 {
                     sal_uInt64 nSize;
                     aFile.getSize( nSize );
-- 
1.7.3.2


--MP_/b/7eCpPSuNsI+VjM0PBzGO.
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename=0001-Change-unnamespaced-file.hxx-macros-bootstrap.patch



More information about the LibreOffice mailing list