[Libreoffice-commits] .: 2 commits - binfilter/bf_starmath binfilter/bf_sw

Caolán McNamara caolan at kemper.freedesktop.org
Wed Nov 23 02:11:12 PST 2011


 binfilter/bf_starmath/source/starmath_mathml.cxx  |    3 ++-
 binfilter/bf_starmath/source/starmath_utility.cxx |    3 ++-
 binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx   |   19 ++++++++++---------
 3 files changed, 14 insertions(+), 11 deletions(-)

New commits:
commit 8e457595bea4ebccafc71c8ce71bc19696d70c40
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 22 23:40:45 2011 +0000

    use stripStart

diff --git a/binfilter/bf_starmath/source/starmath_mathml.cxx b/binfilter/bf_starmath/source/starmath_mathml.cxx
index e81a8f2..dd64eb9 100644
--- a/binfilter/bf_starmath/source/starmath_mathml.cxx
+++ b/binfilter/bf_starmath/source/starmath_mathml.cxx
@@ -76,6 +76,7 @@ one go*/
 #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <comphelper/genericpropertyset.hxx>
+#include <comphelper/string.hxx>
 
 #include <bf_svtools/itemprop.hxx>
 
@@ -630,7 +631,7 @@ void SmXMLImport::endDocument(void)
                 //Make up some editable text
                 aText = pDocShell->GetText();
                 pTree->CreateTextFromNode(aText);
-                aText.EraseTrailingChars();
+                aText = comphelper::string::stripEnd(aText, ' ');
                 if((aText.GetChar(0) == '{') &&
                     (aText.GetChar(aText.Len()-1) == '}'))
                 {
diff --git a/binfilter/bf_starmath/source/starmath_utility.cxx b/binfilter/bf_starmath/source/starmath_utility.cxx
index 735b22a..68aa269 100644
--- a/binfilter/bf_starmath/source/starmath_utility.cxx
+++ b/binfilter/bf_starmath/source/starmath_utility.cxx
@@ -26,6 +26,7 @@
  *
  ************************************************************************/
 
+#include <comphelper/string.hxx>
 #include <tools/tenccvt.hxx>
 #include <osl/thread.h>
 
@@ -217,7 +218,7 @@ int GetTextEncodingTabIndex( const String &rTxt, xub_StrLen nPos )
 /*N*/     // in old 2.0 or 3.0 formulas the strings to be imported do have an
 /*N*/     // additional '\0' character at the end that gets removed here.
 /*N*/     if (aString.Len())
-/*N*/         aString.EraseTrailingChars( '\0' );
+/*N*/         aString = comphelper::string::stripEnd(aString, '\0');
 /*N*/
 /*N*/   aString.ConvertLineEnd();
 /*N*/     return aString;
diff --git a/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx b/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx
index dcb93f6..99b2e9d 100644
--- a/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx
+++ b/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx
@@ -3366,7 +3366,7 @@ void Sw6Layout::AddXForm(sal_Char cLead, ByteString &rTmp, String &rStr)
 // Kurzform, wird oefter benoetigt
 {
     rTmp = comphelper::string::stripStart(rTmp, ' ');
-    rTmp.EraseTrailingChars();
+    rTmp = comphelper::string::stripEnd(rTmp, ' ');
     rTmp.Insert((sal_Char)rTmp.Len(),0);
     rTmp.Insert(cLead,0);
     AddHForm(rTmp.GetBuffer(),rStr.Len(),rTmp.Len(),1);
@@ -3498,7 +3498,7 @@ size_t Sw6Layout::PutRest(String &rStr,sal_Char *pCtrl)
                         rtl::OStringToOUString(aTmp, RTL_TEXTENCODING_IBM_850),
                         osl_getThreadTextEncoding());
                     aTmp = comphelper::string::stripStart(aTmp, ' ');
-                    aTmp.EraseTrailingChars();
+                    aTmp = comphelper::string::stripEnd(aTmp, ' ');
                     aTmp.Insert('}');            // Mache versteckten Text
                     aTmp.Insert('{',0);
                     AddXForm('-',aTmp,rStr);
@@ -5320,7 +5320,7 @@ BOOL SwSw6Parser::ReadDocInfo(void)
             if (ReadLn(rTmp))
             {
                 rTmp = comphelper::string::stripStart(rTmp, ' ');
-                rTmp.EraseTrailingChars();
+                rTmp = comphelper::string::stripEnd(rTmp, ' ');
             }
             else
                 break;
@@ -5331,7 +5331,7 @@ BOOL SwSw6Parser::ReadDocInfo(void)
             if (ReadLn(rTmp))
             {
                 rTmp = comphelper::string::stripStart(rTmp, ' ');
-                rTmp.EraseTrailingChars();
+                rTmp = comphelper::string::stripEnd(rTmp, ' ');
             }
             else
                 break;
commit 1318e3ab271d62a2dc1ff2691b836c3b6da9a2de
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 22 17:18:15 2011 +0000

    use stripStart

diff --git a/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx b/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx
index 73b6671..dcb93f6 100644
--- a/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx
+++ b/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx
@@ -57,6 +57,7 @@
 #include <bf_svx/cntritem.hxx>
 #include <bf_svx/shdditem.hxx>
 #include <bf_svx/colritem.hxx>
+#include <comphelper/string.hxx>
 
 
 #include <fmtpdsc.hxx>
@@ -3361,10 +3362,10 @@ BOOL Sw6Layout::TextBefehl(const sal_Char *pPatt,const sal_Char *pOrig)
     return !*pPatt && (!cLen || *pOrig<'A' || *pOrig>'Z');
 }
 
-void Sw6Layout::AddXForm(sal_Char cLead,ByteString &rTmp,String &rStr)
+void Sw6Layout::AddXForm(sal_Char cLead, ByteString &rTmp, String &rStr)
 // Kurzform, wird oefter benoetigt
 {
-    rTmp.EraseLeadingChars();
+    rTmp = comphelper::string::stripStart(rTmp, ' ');
     rTmp.EraseTrailingChars();
     rTmp.Insert((sal_Char)rTmp.Len(),0);
     rTmp.Insert(cLead,0);
@@ -3496,7 +3497,7 @@ size_t Sw6Layout::PutRest(String &rStr,sal_Char *pCtrl)
                     aTmp = rtl::OUStringToOString(
                         rtl::OStringToOUString(aTmp, RTL_TEXTENCODING_IBM_850),
                         osl_getThreadTextEncoding());
-                    aTmp.EraseLeadingChars();
+                    aTmp = comphelper::string::stripStart(aTmp, ' ');
                     aTmp.EraseTrailingChars();
                     aTmp.Insert('}');            // Mache versteckten Text
                     aTmp.Insert('{',0);
@@ -5318,7 +5319,7 @@ BOOL SwSw6Parser::ReadDocInfo(void)
             String &rTmp=pDat->DocInfo.Thema[Idx];
             if (ReadLn(rTmp))
             {
-                rTmp.EraseLeadingChars();
+                rTmp = comphelper::string::stripStart(rTmp, ' ');
                 rTmp.EraseTrailingChars();
             }
             else
@@ -5329,7 +5330,7 @@ BOOL SwSw6Parser::ReadDocInfo(void)
             String &rTmp=pDat->DocInfo.Keys[Idx];
             if (ReadLn(rTmp))
             {
-                rTmp.EraseLeadingChars();
+                rTmp = comphelper::string::stripStart(rTmp, ' ');
                 rTmp.EraseTrailingChars();
             }
             else


More information about the Libreoffice-commits mailing list