[Libreoffice-commits] .: 2 commits - rsc/inc rsc/source sw/CppunitTest_sw_filters_test.mk sw/prj sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Mon Dec 12 06:11:54 PST 2011


 rsc/inc/rscrsc.hxx                |   10 ++++-----
 rsc/source/rsc/rsc.cxx            |   42 ++++++++++++++++++++------------------
 sw/CppunitTest_sw_filters_test.mk |    1 
 sw/prj/build.lst                  |    2 -
 sw/source/filter/ww8/WW8Sttbf.cxx |    2 -
 sw/source/filter/ww8/ww8scan.cxx  |    4 +--
 6 files changed, 33 insertions(+), 28 deletions(-)

New commits:
commit 978e94ea4e7cc9e1ea1e692ed11835ac27181804
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 12 14:10:43 2011 +0000

    less debug spew

diff --git a/sw/CppunitTest_sw_filters_test.mk b/sw/CppunitTest_sw_filters_test.mk
index 3b31eb9..d12ff2d 100644
--- a/sw/CppunitTest_sw_filters_test.mk
+++ b/sw/CppunitTest_sw_filters_test.mk
@@ -97,6 +97,7 @@ $(eval $(call gb_CppunitTest_add_old_components,sw_filters_test,\
     configmgr \
     ucb1 \
     ucpfile1 \
+    ucpchelp1 \
 ))
 
 $(eval $(call gb_CppunitTest_set_args,sw_filters_test,\
diff --git a/sw/prj/build.lst b/sw/prj/build.lst
index e2d759d..37b464d 100644
--- a/sw/prj/build.lst
+++ b/sw/prj/build.lst
@@ -1,2 +1,2 @@
-sw      sw      :    filter TRANSLATIONS:translations configmgr connectivity writerperfect vbahelper svx stoc writerfilter unoxml fileaccess package forms toolkit dbaccess comphelper LIBXSLT:libxslt test NULL
+sw      sw      :    filter TRANSLATIONS:translations configmgr connectivity writerperfect vbahelper svx stoc writerfilter unoxml fileaccess package forms toolkit dbaccess comphelper LIBXSLT:libxslt test xmlhelp NULL
 sw sw\prj nmake - all sw_prj   NULL
diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx b/sw/source/filter/ww8/WW8Sttbf.cxx
index 5ef8211..e331160 100644
--- a/sw/source/filter/ww8/WW8Sttbf.cxx
+++ b/sw/source/filter/ww8/WW8Sttbf.cxx
@@ -98,7 +98,7 @@ namespace ww8
 #endif
         }
 
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
         char sBuffer[256];
         snprintf(sBuffer, sizeof(sBuffer), "offset=\"%" SAL_PRIuUINT32 "\" count=\"%" SAL_PRIuUINT32 "\"",
                  nOffset, nCount);
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 9ef2ff9..56631b9 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -923,7 +923,7 @@ void WW8SprmIter::UpdateMyMembers()
         nAktSize = mrSprmParser.GetSprmSize(nAktId, pSprms);
         pAktParams = pSprms + mrSprmParser.DistanceToData(nAktId);
         bValid = nAktSize <= nRemLen;
-        OSL_ENSURE(bValid, "sprm longer than remaining bytes");
+        SAL_WARN_IF(!bValid, ".doc", "sprm longer than remaining bytes, doc or parser is wrong");
     }
 
     if (!bValid)
@@ -7410,7 +7410,7 @@ sal_uInt8* wwSprmParser::findSprmData(sal_uInt16 nId, sal_uInt8* pSprms,
 
         bool bValid = nSize <= nLen;
 
-        OSL_ENSURE(bValid, "sprm longer than remaining bytes");
+        SAL_WARN_IF(!bValid, ".doc", "sprm longer than remaining bytes, doc or parser is wrong");
 
         if (nAktId == nId && bValid) // Sprm found
             return pSprms + DistanceToData(nId);
commit b103bb2ab3050b732f1b59a4055b5f94dc460804
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 12 13:52:02 2011 +0000

    ditch some ByteStrings

diff --git a/rsc/inc/rscrsc.hxx b/rsc/inc/rscrsc.hxx
index 09a91ff..f949d2b 100644
--- a/rsc/inc/rscrsc.hxx
+++ b/rsc/inc/rscrsc.hxx
@@ -65,10 +65,10 @@ public:
 
     struct OutputFile
     {
-        ByteString                   aLangName;         // language name
-        ByteString                   aOutputRc;         // target file
-        ByteString                   aLangSearchPath;   // language specific search path
-        ::std::list< ByteString >    aSysSearchDirs;    // pathes to search for images
+        rtl::OString aLangName;         // language name
+        rtl::OString aOutputRc;         // target file
+        rtl::OString aLangSearchPath;   // language specific search path
+        ::std::list< rtl::OString >    aSysSearchDirs;    // pathes to search for images
 
         OutputFile() {}
     };
@@ -99,7 +99,7 @@ private:
     bool            GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
                                       const WriteRcContext& rContext,
                                       const rtl::OString& rBaseFileName,
-                                      ByteString& rImagePath,
+                                      rtl::OString& rImagePath,
                                       FILE* pSysListFile );
     void            PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
                                        const WriteRcContext& rContext,
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 8aef412..e8ececa 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -214,7 +214,7 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
             }
             else if( !rsc_strnicmp( (*ppStr) + 1, "fs=", 3 ) )
             { // anderer Name fuer .rc-file
-                if( m_aOutputFiles.back().aOutputRc.Len() )
+                if( m_aOutputFiles.back().aOutputRc.getLength() )
                     m_aOutputFiles.push_back( OutputFile() );
                 m_aOutputFiles.back().aOutputRc = (*ppStr) + 4;
             }
@@ -225,15 +225,18 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
                 // ignore empty -lip= arguments that we get lots of these days
                 if (aSysSearchDir.getLength())
                 {
-                    DirEntry aSysDir( String( aSysSearchDir, RTL_TEXTENCODING_ASCII_US ) );
+                    DirEntry aSysDir(rtl::OStringToOUString(aSysSearchDir, RTL_TEXTENCODING_ASCII_US));
                     m_aOutputFiles.back().aSysSearchDirs.push_back(
                         rtl::OUStringToOString(aSysDir.GetFull(), RTL_TEXTENCODING_ASCII_US) );
-                    if( m_aOutputFiles.back().aLangSearchPath.Len() )
+                    rtl::OString aLangSearchPath = m_aOutputFiles.back().aLangSearchPath;
+                    if( aLangSearchPath.getLength() )
                     {
-                        m_aOutputFiles.back().aLangSearchPath.Append(
-                        rtl::OUStringToOString(DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US) );
+                        aLangSearchPath = aLangSearchPath +
+                        rtl::OUStringToOString(DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US);
                     }
-                    m_aOutputFiles.back().aLangSearchPath.Append( aSysSearchDir );
+                    aLangSearchPath = aLangSearchPath + aSysSearchDir;
+
+                    m_aOutputFiles.back().aLangSearchPath = aLangSearchPath;
                 }
             }
             else if( !rsc_strnicmp( (*ppStr) + 1, "fp=", 3 ) )
@@ -287,7 +290,7 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
             }
             else if( !rsc_strnicmp( (*ppStr) + 1, "lg", 2 ) )
             {
-                if( m_aOutputFiles.back().aLangName.Len() )
+                if( m_aOutputFiles.back().aLangName.getLength() )
                     m_aOutputFiles.push_back( OutputFile() );
                 m_aOutputFiles.back().aLangName = rtl::OString((*ppStr)+3);
             }
@@ -311,7 +314,7 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
         ::std::list<OutputFile>::iterator it;
         for( it = m_aOutputFiles.begin(); it != m_aOutputFiles.end(); ++it )
         {
-            if( ! it->aOutputRc.Len() )
+            if( ! it->aOutputRc.getLength() )
                 it->aOutputRc  = ::OutputFile( *aInputList.front(), "rc"  );
         }
         if( ! bOutputSrsIsSet )
@@ -870,7 +873,7 @@ ERRTYPE RscCompiler::Link()
                 aSysSearchPath.append(aToken);
             }
             while ( nIndex >= 0 );
-            OSL_TRACE( "setting search path for language %s: %s", it->aLangName.GetBuffer(), aSysSearchPath.getStr() );
+            OSL_TRACE( "setting search path for language %s: %s", it->aLangName.getStr(), aSysSearchPath.getStr() );
             pTC->SetSysSearchPath(aSysSearchPath.makeStringAndClear());
 
             WriteRcContext  aContext;
@@ -905,8 +908,8 @@ ERRTYPE RscCompiler::Link()
 
             fclose( foutput );
             fExitFile = NULL;
-            unlink( it->aOutputRc.GetBuffer() );
-            if( rename( aRcTmp.getStr(), it->aOutputRc.GetBuffer() ) )
+            unlink( it->aOutputRc.getStr() );
+            if( rename( aRcTmp.getStr(), it->aOutputRc.getStr() ) )
             {
                 OStringBuffer aBuf;
                 aBuf.append( aRcTmp );
@@ -917,7 +920,7 @@ ERRTYPE RscCompiler::Link()
             else
             {
 #ifdef UNX
-                chmod( it->aOutputRc.GetBuffer(), S_IRWXU | S_IRWXG | S_IROTH );
+                chmod( it->aOutputRc.getStr(), S_IRWXU | S_IRWXG | S_IROTH );
 #endif
             }
 
@@ -1052,7 +1055,7 @@ void RscCompiler::Append( const rtl::OString& rOutputSrs,
 bool RscCompiler::GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
                                     const WriteRcContext& rContext,
                                     const rtl::OString& rBaseFileName,
-                                    ByteString& rImagePath,
+                                    rtl::OString& rImagePath,
                                     FILE* pSysListFile )
 {
     ::std::list< rtl::OString >  aFileNames;
@@ -1065,7 +1068,7 @@ bool RscCompiler::GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
 
     while( ( aFileIter != aFileNames.end() ) && !bFound )
     {
-        ::std::list< ByteString >::const_iterator aDirIter( rOutputFile.aSysSearchDirs.begin() );
+        ::std::list< rtl::OString >::const_iterator aDirIter( rOutputFile.aSysSearchDirs.begin() );
 
         while( ( aDirIter != rOutputFile.aSysSearchDirs.end() ) && !bFound )
         {
@@ -1119,7 +1122,7 @@ bool RscCompiler::GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
                 }
 
 #if OSL_DEBUG_LEVEL > 1
-                fprintf( stderr, "ImagePath to add: %s\n", rImagePath.GetBuffer() );
+                fprintf( stderr, "ImagePath to add: %s\n", rImagePath.getStr() );
 #endif
             }
 
@@ -1146,14 +1149,15 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
 
     if( !aIStm.GetError() && !aOStm.GetError() )
     {
-        ByteString aLine, aFilePath;
+        ByteString aLine;
+        rtl::OString aFilePath;
 
         while( aIStm.ReadLine( aLine ) )
         {
             if( ( aLine.GetTokenCount( '=' ) == 2 ) &&
                 ( getToken(aLine, 0, '=').indexOf("File") != -1 ) )
             {
-                ByteString aBaseFileName( getToken(getToken(aLine, 1, '"'), 0, '.') );
+                rtl::OString aBaseFileName( getToken(getToken(aLine, 1, '"'), 0, '.') );
 
                 if( GetImageFilePath( rOutputFile, rContext, aBaseFileName, aFilePath, pSysListFile ) )
                     ( ( aLine = "File = \"" ) += aFilePath ) += "\";";
@@ -1164,7 +1168,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
             }
             else if( aLine.Search( "ImageList" ) != STRING_NOTFOUND )
             {
-                ::std::vector< ::std::pair< ByteString, sal_Int32 > > aEntryVector;
+                ::std::vector< ::std::pair< rtl::OString, sal_Int32 > > aEntryVector;
 
                 aOStm.WriteLine( aLine );
 
@@ -1210,7 +1214,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
                             rtl::OString aBaseFileName = aBuf.makeStringAndClear();
 
                             if( GetImageFilePath( rOutputFile, rContext, aBaseFileName, aFilePath, pSysListFile ) )
-                                aEntryVector.push_back( ::std::pair< ByteString, sal_Int32 >( aFilePath, nNumber ) );
+                                aEntryVector.push_back( ::std::pair< rtl::OString, sal_Int32 >( aFilePath, nNumber ) );
                             else
                                 aMissingImages.push_back( aBaseFileName );
                         }


More information about the Libreoffice-commits mailing list