[Libreoffice-commits] .: 2 commits - solenv/gbuild vcl/generic vcl/headless vcl/inc vcl/unx

Caolán McNamara caolan at kemper.freedesktop.org
Thu Jan 5 03:13:22 PST 2012


 solenv/gbuild/extensions/post_BuildplTargets.mk |    4 +-
 vcl/generic/print/common_gfx.cxx                |   18 +++++-----
 vcl/generic/print/genprnpsp.cxx                 |   42 ++++++++++++------------
 vcl/generic/print/printerjob.cxx                |    2 -
 vcl/headless/svpprn.cxx                         |    2 -
 vcl/inc/vcl/ppdparser.hxx                       |    3 +
 vcl/unx/generic/printer/ppdparser.cxx           |    4 +-
 7 files changed, 39 insertions(+), 36 deletions(-)

New commits:
commit f42e17d83b5c4f5343c8b113ef2d8dcbf96f8a20
Author: Christina Rossmanith <ChrRossmanith at web.de>
Date:   Mon Jan 2 21:56:19 2012 +0100

    Replace (Byte)String with rtl::O(U)String

diff --git a/vcl/generic/print/common_gfx.cxx b/vcl/generic/print/common_gfx.cxx
index 43c2cbb..26ac567 100644
--- a/vcl/generic/print/common_gfx.cxx
+++ b/vcl/generic/print/common_gfx.cxx
@@ -1188,26 +1188,26 @@ PrinterGfx::DrawEPS( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize
     // first search the BoundingBox of the EPS data
     SvMemoryStream aStream( pPtr, nSize, STREAM_READ );
     aStream.Seek( STREAM_SEEK_TO_BEGIN );
-    ByteString aLine;
+    rtl::OString aLine;
 
     rtl::OString aDocTitle;
     double fLeft = 0, fRight = 0, fTop = 0, fBottom = 0;
     bool bEndComments = false;
     while( ! aStream.IsEof()
            && ( ( fLeft == 0 && fRight == 0 && fTop == 0 && fBottom == 0 ) ||
-                ( aDocTitle.getLength() == 0 && bEndComments == false ) )
+                ( aDocTitle.isEmpty() && bEndComments == false ) )
            )
     {
         aStream.ReadLine( aLine );
-        if( aLine.Len() > 1 && aLine.GetChar( 0 ) == '%' )
+        if( aLine.getLength() > 1 && aLine[0] == '%' )
         {
-            char cChar = aLine.GetChar(1);
+            char cChar = aLine[1];
             if( cChar == '%' )
             {
-                if( aLine.CompareIgnoreCaseToAscii( "%%BoundingBox:", 14 ) == COMPARE_EQUAL )
+                if( comphelper::string::matchIgnoreAsciiCaseL( aLine, RTL_CONSTASCII_STRINGPARAM("%%BoundingBox:") )  )
                 {
                     aLine = WhitespaceToSpace( comphelper::string::getToken(aLine, 1, ':') );
-                    if( aLine.Len() && aLine.Search( "atend" ) == STRING_NOTFOUND )
+                    if( !aLine.isEmpty() && aLine.indexOf( "atend" ) == -1 )
                     {
                         fLeft   = StringToDouble( GetCommandLineToken( 0, aLine ) );
                         fBottom = StringToDouble( GetCommandLineToken( 1, aLine ) );
@@ -1215,9 +1215,9 @@ PrinterGfx::DrawEPS( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize
                         fTop    = StringToDouble( GetCommandLineToken( 3, aLine ) );
                     }
                 }
-                else if( aLine.CompareIgnoreCaseToAscii( "%%Title:", 8 ) == COMPARE_EQUAL )
-                    aDocTitle = WhitespaceToSpace( aLine.Copy( 8 ) );
-                else if( aLine.CompareIgnoreCaseToAscii( "%%EndComments", 13 ) == COMPARE_EQUAL )
+                else if( comphelper::string::matchIgnoreAsciiCaseL( aLine, RTL_CONSTASCII_STRINGPARAM("%%Title:") ) )
+                    aDocTitle = WhitespaceToSpace( aLine.copy( 8 ) );
+                else if( comphelper::string::matchIgnoreAsciiCaseL( aLine, RTL_CONSTASCII_STRINGPARAM("%%EndComments") ) )
                     bEndComments = true;
             }
             else if( cChar == ' ' || cChar == '\t' || cChar == '\r' || cChar == '\n' )
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index 23a7bf5..747b0ec 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -47,6 +47,7 @@
 #endif
 
 #include "rtl/ustring.hxx"
+#include "comphelper/string.hxx"
 
 #include "osl/module.h"
 
@@ -86,19 +87,19 @@ typedef int(*faxFunction)(String&);
 static faxFunction pFaxNrFunction           = NULL;
 }
 
-static String getPdfDir( const PrinterInfo& rInfo )
+static rtl::OUString getPdfDir( const PrinterInfo& rInfo )
 {
-    String aDir;
+    rtl::OUString aDir;
     sal_Int32 nIndex = 0;
     while( nIndex != -1 )
     {
-        OUString aToken( rInfo.m_aFeatures.getToken( 0, ',', nIndex ) );
+        rtl::OUString aToken( rInfo.m_aFeatures.getToken( 0, ',', nIndex ) );
         if( ! aToken.compareToAscii( "pdf=", 4 ) )
         {
             sal_Int32 nPos = 0;
             aDir = aToken.getToken( 1, '=', nPos );
-            if( ! aDir.Len() )
-                aDir = String( ByteString( getenv( "HOME" ) ), osl_getThreadTextEncoding() );
+            if( aDir.isEmpty() && getenv( "HOME" ) )
+                aDir = rtl::OUString( getenv( "HOME" ), strlen( getenv( "HOME" ) ), osl_getThreadTextEncoding() );
             break;
         }
     }
@@ -137,7 +138,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
     pJobSetup->meOrientation    = (Orientation)(rData.m_eOrientation == orientation::Landscape ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT);
 
     // copy page size
-    String aPaper;
+    OUString aPaper;
     int width, height;
 
     rData.m_aContext.getPageSize( aPaper, width, height );
@@ -235,20 +236,19 @@ static bool passFileToCommandLine( const String& rFilename, const String& rComma
     bool bSuccess = false;
 
     rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
-    ByteString aCmdLine(rtl::OUStringToOString(rCommandLine, aEncoding));
+    rtl::OString aCmdLine(rtl::OUStringToOString(rCommandLine, aEncoding));
     rtl::OString aFilename(rtl::OUStringToOString(rFilename, aEncoding));
 
-    bool bPipe = aCmdLine.Search( "(TMP)" ) != STRING_NOTFOUND ? false : true;
+    bool bPipe = aCmdLine.indexOf( "(TMP)" ) != -1 ? false : true;
 
     // setup command line for exec
     if( ! bPipe )
-        while( aCmdLine.SearchAndReplace( "(TMP)", aFilename ) != STRING_NOTFOUND )
-            ;
+        aCmdLine = comphelper::string::replace( aCmdLine, rtl::OString("(TMP)"), aFilename );
 
 #if OSL_DEBUG_LEVEL > 1
     fprintf( stderr, "%s commandline: \"%s\"\n",
              bPipe ? "piping to" : "executing",
-             aCmdLine.GetBuffer() );
+             aCmdLine.getStr() );
     struct stat aStat;
     if( stat( aFilename.getStr(), &aStat ) )
         fprintf( stderr, "stat( %s ) failed\n", aFilename.getStr() );
@@ -258,7 +258,7 @@ static bool passFileToCommandLine( const String& rFilename, const String& rComma
     if( ! ( argv[ 0 ] = getenv( "SHELL" ) ) )
         argv[ 0 ] = "/bin/sh";
     argv[ 1 ] = "-c";
-    argv[ 2 ] = aCmdLine.GetBuffer();
+    argv[ 2 ] = aCmdLine.getStr();
     argv[ 3 ] = 0;
 
     bool bHavePipes = false;
@@ -301,7 +301,7 @@ static bool passFileToCommandLine( const String& rFilename, const String& rComma
                 dup2( fd[0], STDIN_FILENO );
         }
         execv( argv[0], const_cast<char**>(argv) );
-        fprintf( stderr, "failed to execute \"%s\"\n", aCmdLine.GetBuffer() );
+        fprintf( stderr, "failed to execute \"%s\"\n", aCmdLine.getStr() );
         _exit( 1 );
     }
     else
@@ -487,8 +487,8 @@ void SalGenericInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
         sal_Int32 nIndex = 0;
         while( nIndex != -1 )
         {
-            String aToken( rInfo.m_aFeatures.getToken( 0, ',', nIndex ) );
-            if( aToken.CompareToAscii( "pdf=", 4 ) == COMPARE_EQUAL )
+            rtl::OUString aToken( rInfo.m_aFeatures.getToken( 0, ',', nIndex ) );
+            if( aToken.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("pdf=") ) )
             {
                 pInfo->maLocation = getPdfDir( rInfo );
                 break;
@@ -774,7 +774,7 @@ void PspSalInfoPrinter::GetPageInfo(
     if( aData.m_pParser )
     {
 
-        String aPaper;
+        OUString aPaper;
         int width, height;
         int left = 0, top = 0, right = 0, bottom = 0;
         int nDPI = aData.m_aContext.getRenderResolution();
@@ -808,7 +808,7 @@ sal_uLong PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup )
     JobData aData;
     JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
 
-    const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ): NULL;
+    const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ): NULL;
     return pKey ? pKey->countValues() : 0;
 }
 
@@ -817,10 +817,10 @@ rtl::OUString PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup,
     JobData aData;
     JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
 
-    String aRet;
+    OUString aRet;
     if( aData.m_pParser )
     {
-        const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ): NULL;
+        const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "InputSlot" ) ) ): NULL;
         if( ! pKey || nPaperBin >= (sal_uLong)pKey->countValues() )
             aRet = aData.m_pParser->getDefaultInputSlot();
         else
@@ -848,8 +848,8 @@ sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal
             JobData aData;
             JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aData );
 
-            const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "Collate" ) ) ) : NULL;
-            const PPDValue* pVal = pKey ? pKey->getValue( String( RTL_CONSTASCII_USTRINGPARAM( "True" ) ) ) : NULL;
+            const PPDKey* pKey = aData.m_pParser ? aData.m_pParser->getKey( OUString( RTL_CONSTASCII_USTRINGPARAM( "Collate" ) ) ) : NULL;
+            const PPDValue* pVal = pKey ? pKey->getValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "True" ) ) ) : NULL;
 
             // PPDs don't mention the number of possible collated copies.
             // so let's guess as many as we want ?
diff --git a/vcl/generic/print/printerjob.cxx b/vcl/generic/print/printerjob.cxx
index 33a32da..423424d 100644
--- a/vcl/generic/print/printerjob.cxx
+++ b/vcl/generic/print/printerjob.cxx
@@ -578,7 +578,7 @@ PrinterJob::InitPaperSize (const JobData& rJobSetup)
 {
     int nRes = rJobSetup.m_aContext.getRenderResolution ();
 
-    String aPaper;
+    rtl::OUString aPaper;
     int nWidth, nHeight;
     rJobSetup.m_aContext.getPageSize (aPaper, nWidth, nHeight);
 
diff --git a/vcl/headless/svpprn.cxx b/vcl/headless/svpprn.cxx
index b7e4dbb..eca65e3 100644
--- a/vcl/headless/svpprn.cxx
+++ b/vcl/headless/svpprn.cxx
@@ -78,7 +78,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
     pJobSetup->meOrientation    = (Orientation)(rData.m_eOrientation == orientation::Landscape ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT);
 
     // copy page size
-    String aPaper;
+    OUString aPaper;
     int width, height;
 
     rData.m_aContext.getPageSize( aPaper, width, height );
diff --git a/vcl/inc/vcl/ppdparser.hxx b/vcl/inc/vcl/ppdparser.hxx
index 0437c5b..0cc316c 100644
--- a/vcl/inc/vcl/ppdparser.hxx
+++ b/vcl/inc/vcl/ppdparser.hxx
@@ -34,6 +34,7 @@
 
 #include "tools/string.hxx"
 #include "tools/stream.hxx"
+#include "rtl/string.hxx"
 
 #include "vcl/dllapi.h"
 
@@ -309,7 +310,7 @@ public:
 
     // width, height in points, paper will contain the name of the selected
     // paper after the call
-    void getPageSize( String& rPaper, int& rWidth, int& rHeight ) const;
+    void getPageSize( rtl::OUString& rPaper, int& rWidth, int& rHeight ) const;
 };
 
 } // namespace
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index 738df2d..a34d9c9 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -1969,10 +1969,10 @@ int PPDContext::getRenderResolution() const
 
 // -------------------------------------------------------------------
 
-void PPDContext::getPageSize( String& rPaper, int& rWidth, int& rHeight ) const
+void PPDContext::getPageSize( rtl::OUString& rPaper, int& rWidth, int& rHeight ) const
 {
     // initialize to reasonable default, if parser is not set
-    rPaper  = String( RTL_CONSTASCII_USTRINGPARAM( "A4" ) );
+    rPaper  = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "A4" ) );
     rWidth  = 595;
     rHeight = 842;
     if( m_pParser )
commit 2e70dc68e65789da7f4a8af6b5a22f9921245c00
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 5 10:42:14 2012 +0000

    try and get callcatcher working again

diff --git a/solenv/gbuild/extensions/post_BuildplTargets.mk b/solenv/gbuild/extensions/post_BuildplTargets.mk
index 01535e5..2f05f76 100644
--- a/solenv/gbuild/extensions/post_BuildplTargets.mk
+++ b/solenv/gbuild/extensions/post_BuildplTargets.mk
@@ -129,10 +129,12 @@ findunusedcode:
 	@mkdir -p $(SRCDIR)/solenv/callcatcher/bin && \
 	    ln -sf $(SRCDIR)/solenv/$(INPATH)/bin/dmake \
 		$(SRCDIR)/solenv/callcatcher/bin/dmake && \
+	    source $(SRCDIR)/config_host_callcatcher.mk && \
 	    source $(SRCDIR)/Env.callcatcher.sh && \
 	    source $(SRCDIR)/solenv/bin/callcatchEnv.Set.sh && \
 	    $(call gb_BuildplTarget_command,instsetoo_native,--all)
-	@source $(SRCDIR)/Env.callcatcher.sh && \
+	@source $(SRCDIR)/config_host_callcatcher.mk && \
+            source $(SRCDIR)/Env.callcatcher.sh && \
 	    callanalyse \
 		$$WORKDIR/LinkTarget/*/* \
 		*/$$OUTPATH/bin/* \


More information about the Libreoffice-commits mailing list