[Libreoffice-commits] .: 6 commits - comphelper/inc comphelper/qa comphelper/source cui/source editeng/inc editeng/source extensions/source l10ntools/source oowintool rsc/source sc/Library_scd.mk sc/source sfx2/inc sfx2/source starmath/source svtools/bmpmaker svtools/source svx/inc svx/source sw/source tools/bootstrp tools/inc tools/source unusedcode.easy vcl/generic vcl/inc vcl/source vcl/unx
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Nov 23 02:11:00 PST 2011
comphelper/inc/comphelper/string.hxx | 40 +++++++++
comphelper/qa/string/test_string.cxx | 44 ++++++++++
comphelper/source/misc/string.cxx | 62 ++++++++++++++
cui/source/options/optdict.cxx | 5 -
editeng/inc/editeng/editeng.hxx | 1
editeng/source/editeng/editeng.cxx | 6 -
extensions/source/propctrlr/browserline.cxx | 26 ++----
l10ntools/source/export.cxx | 22 ++---
l10ntools/source/gsicheck.cxx | 4
l10ntools/source/helpmerge.cxx | 8 -
l10ntools/source/lngmerge.cxx | 120 ++++++++++++++--------------
l10ntools/source/localize.cxx | 2
l10ntools/source/xrmmerge.cxx | 6 -
oowintool | 11 +-
rsc/source/rsc/rsc.cxx | 4
sc/Library_scd.mk | 1
sc/source/filter/lotus/lotform.cxx | 3
sc/source/ui/unoobj/scdetect.cxx | 3
sfx2/inc/sfx2/newstyle.hxx | 8 -
sfx2/source/appl/newhelp.cxx | 5 -
sfx2/source/bastyp/frmhtmlw.cxx | 13 +--
starmath/source/cursor.cxx | 3
starmath/source/dialog.cxx | 4
starmath/source/mathmlimport.cxx | 9 +-
starmath/source/node.cxx | 17 ++-
starmath/source/view.cxx | 28 +++---
svtools/bmpmaker/bmpcore.cxx | 4
svtools/source/contnr/fileview.cxx | 3
svtools/source/control/fmtfield.cxx | 9 +-
svtools/source/control/inettbc.cxx | 5 -
svtools/source/misc/imap2.cxx | 18 ++--
svtools/source/svhtml/htmlsupp.cxx | 10 --
svx/inc/svx/sdrpagewindow.hxx | 1
svx/inc/svx/svdobj.hxx | 2
svx/inc/svx/svdpntv.hxx | 7 -
svx/source/svdraw/sdrpagewindow.cxx | 4
svx/source/svdraw/svdobj.cxx | 53 ------------
svx/source/svdraw/svdpntv.cxx | 6 -
sw/source/filter/html/htmlform.cxx | 4
sw/source/filter/rtf/rtffld.cxx | 5 -
sw/source/filter/rtf/swparrtf.cxx | 3
tools/bootstrp/prj.cxx | 2
tools/inc/tools/urlobj.hxx | 96 ++++++++++------------
tools/source/inet/inetstrm.cxx | 7 -
unusedcode.easy | 5 -
vcl/generic/fontmanager/fontmanager.cxx | 11 +-
vcl/inc/vcl/animate.hxx | 6 -
vcl/source/gdi/animate.cxx | 8 -
vcl/unx/generic/printer/ppdparser.cxx | 33 +++----
49 files changed, 414 insertions(+), 343 deletions(-)
New commits:
commit a910204348b032bae1882bf7f74085a0b8c529ca
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 23 10:09:22 2011 +0000
add a fallback for %COMMONPROGRAMFILES% if its not set
diff --git a/oowintool b/oowintool
index 6cb98a3..d8d340c 100755
--- a/oowintool
+++ b/oowintool
@@ -248,7 +248,7 @@ sub copy_dll($$$)
-f "$src/$fname" || die "can't find $src";
-d $dest || die "no directory $dest";
- print STDERR "Copying $src/$fname to $dest\n";
+ print STDERR "Copying $src/$fname to $dest\n";
copy ("$src/$fname", $dest) || die "copy failed: $!";
chmod (0755, "$dest/$fname") || die "failed to set dll executable: $!";
}
@@ -293,11 +293,16 @@ sub msvc_copy_msms($$)
my $common_files_path = $ENV{"CommonProgramFiles(x86)"};
if (!defined $common_files_path) {
$common_files_path = $ENV{CommonProgramFiles};
+ if (!defined $common_files_path) {
+ $common_files_path = "C:\\Program Files\\Common Files";
+ }
}
- defined $common_files_path || return;
+
+ defined $common_files_path || die "Windows CommonProgramFiles not found";
+
my $msm_path = (cygpath $common_files_path . "\\Merge Modules", 'w', $output_format);
foreach $fname ("Microsoft_VC90_CRT_x86$postfix.msm", "policy_9_0_Microsoft_VC90_CRT_x86$postfix.msm") {
- print STDERR "Copying $msm_path/$fname to $dest\n";
+ print STDERR "Copying $msm_path/$fname to $dest\n";
copy ("$msm_path/$fname", $dest) || die "copy failed: $!";
}
}
commit 5e283a80cd8e3e3a158b604f59c3dafa59a6b6f1
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 23 10:08:52 2011 +0000
callcatcher: remove recently unused code
diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index f23223e..88111b3 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -320,7 +320,6 @@ public:
void SetGlobalCharStretching( sal_uInt16 nX = 100, sal_uInt16 nY = 100 );
void GetGlobalCharStretching( sal_uInt16& rX, sal_uInt16& rY );
- void DoStretchChars( sal_uInt16 nX, sal_uInt16 nY );
void SetEditTextObjectPool( SfxItemPool* pPool );
SfxItemPool* GetEditTextObjectPool() const;
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index cfbf1b8..b7b9397 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2030,12 +2030,6 @@ void EditEngine::GetGlobalCharStretching( sal_uInt16& rX, sal_uInt16& rY )
pImpEditEngine->GetCharStretching( rX, rY );
}
-void EditEngine::DoStretchChars( sal_uInt16 nX, sal_uInt16 nY )
-{
- DBG_CHKTHIS( EditEngine, 0 );
- pImpEditEngine->DoStretchChars( nX, nY );
-}
-
sal_Bool EditEngine::ShouldCreateBigTextObject() const
{
DBG_CHKTHIS( EditEngine, 0 );
diff --git a/svx/inc/svx/sdrpagewindow.hxx b/svx/inc/svx/sdrpagewindow.hxx
index c073a91..7498c32 100644
--- a/svx/inc/svx/sdrpagewindow.hxx
+++ b/svx/inc/svx/sdrpagewindow.hxx
@@ -117,7 +117,6 @@ public:
void PrepareRedraw(const Region& rReg);
void RedrawAll(sdr::contact::ViewObjectContactRedirector* pRedirector) const;
void RedrawLayer(const SdrLayerID* pId, sdr::contact::ViewObjectContactRedirector* pRedirector) const;
- void PostPaint();
// Invalidate call, used from ObjectContact(OfPageView) in InvalidatePartOfView(...)
void InvalidatePageWindow(const basegfx::B2DRange& rRange);
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index eeef220..1bac35e 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -1101,8 +1101,6 @@ public:
// to use (0,0) as upper left and will be scaled to the given size in the matrix.
virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon);
- sal_Bool IsTransparent( sal_Bool bCheckForAlphaChannel = sal_False ) const;
-
// #116168#
// Give info if object is in destruction
sal_Bool IsInDestruction() const;
diff --git a/svx/inc/svx/svdpntv.hxx b/svx/inc/svx/svdpntv.hxx
index 927f96c..761e5d3 100644
--- a/svx/inc/svx/svdpntv.hxx
+++ b/svx/inc/svx/svdpntv.hxx
@@ -476,13 +476,6 @@ public:
void SetNotPersistDefaultAttr(const SfxItemSet& rAttr, sal_Bool bReplaceAll);
void MergeNotPersistDefaultAttr(SfxItemSet& rAttr, sal_Bool bOnlyHardAttr) const;
- // Aufziehen eines animierten Rechtecks fuer Applikationsspeziefische
- // Verwendung. Alle Positionsangaben in logischen View-Koordinaten.
- // pOut bezeichnet das OutputDevice, in das animierte Rechteck dargestellt
- // werden soll. Wird NULL uebergeben, wird es in allen an der View
- // angemeldeten OutputDevices gleichzeitig dargestellt.
- void MovEncirclement(const Point& rPnt);
-
// use this mode as mode to draw all internal GraphicManager objects with
sal_uIntPtr GetGraphicManagerDrawMode() const { return nGraphicManagerDrawMode; }
void SetGraphicManagerDrawMode( sal_uIntPtr nMode ) { nGraphicManagerDrawMode = nMode; }
diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx
index 5630043..86d269e 100644
--- a/svx/source/svdraw/sdrpagewindow.cxx
+++ b/svx/source/svdraw/sdrpagewindow.cxx
@@ -193,10 +193,6 @@ void SdrPageWindow::PrePaint()
}
}
-void SdrPageWindow::PostPaint()
-{
-}
-
void SdrPageWindow::PrepareRedraw(const Region& rReg)
{
// evtl. give OC the chance to do ProcessDisplay preparations
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index be67009..3340c2d 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -2734,59 +2734,6 @@ void SdrObject::MigrateItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, S
}
}
-sal_Bool SdrObject::IsTransparent( sal_Bool /*bCheckForAlphaChannel*/) const
-{
- bool bRet = false;
-
- if( IsGroupObject() )
- {
- SdrObjListIter aIter( *GetSubList(), IM_DEEPNOGROUPS );
-
- for( SdrObject* pO = aIter.Next(); pO && !bRet; pO = aIter.Next() )
- {
- const SfxItemSet& rAttr = pO->GetMergedItemSet();
-
- if( ( ( (const XFillTransparenceItem&) rAttr.Get( XATTR_FILLTRANSPARENCE ) ).GetValue() ||
- ( (const XLineTransparenceItem&) rAttr.Get( XATTR_LINETRANSPARENCE ) ).GetValue() ) ||
- ( ( rAttr.GetItemState( XATTR_FILLFLOATTRANSPARENCE ) == SFX_ITEM_SET ) &&
- ( (const XFillFloatTransparenceItem&) rAttr.Get( XATTR_FILLFLOATTRANSPARENCE ) ).IsEnabled() ) )
- {
- bRet = sal_True;
- }
- else if( pO->ISA( SdrGrafObj ) )
- {
- SdrGrafObj* pGrafObj = (SdrGrafObj*) pO;
- if( ( (const SdrGrafTransparenceItem&) rAttr.Get( SDRATTR_GRAFTRANSPARENCE ) ).GetValue() ||
- ( pGrafObj->GetGraphicType() == GRAPHIC_BITMAP && pGrafObj->GetGraphic().GetBitmapEx().IsAlpha() ) )
- {
- bRet = sal_True;
- }
- }
- }
- }
- else
- {
- const SfxItemSet& rAttr = GetMergedItemSet();
-
- if( ( ( (const XFillTransparenceItem&) rAttr.Get( XATTR_FILLTRANSPARENCE ) ).GetValue() ||
- ( (const XLineTransparenceItem&) rAttr.Get( XATTR_LINETRANSPARENCE ) ).GetValue() ) ||
- ( ( rAttr.GetItemState( XATTR_FILLFLOATTRANSPARENCE ) == SFX_ITEM_SET ) &&
- ( (const XFillFloatTransparenceItem&) rAttr.Get( XATTR_FILLFLOATTRANSPARENCE ) ).IsEnabled() ) )
- {
- bRet = sal_True;
- }
- else if( ISA( SdrGrafObj ) )
- {
- SdrGrafObj* pGrafObj = (SdrGrafObj*) this;
-
- // #i25616#
- bRet = pGrafObj->IsObjectTransparent();
- }
- }
-
- return bRet;
-}
-
void SdrObject::impl_setUnoShape( const uno::Reference< uno::XInterface >& _rxUnoShape )
{
maWeakUnoShape = _rxUnoShape;
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 4e66939..e88931d 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -429,12 +429,6 @@ void SdrPaintView::SetActualWin(const OutputDevice* pWin)
////////////////////////////////////////////////////////////////////////////////////////////////////
-void SdrPaintView::MovEncirclement(const Point&)
-{
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
void SdrPaintView::ClearPageView()
{
BrkAction();
diff --git a/unusedcode.easy b/unusedcode.easy
index fc8834c..6bb28a2 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -7,6 +7,8 @@ AtomPubSession::~AtomPubSession()
BufferNode::childAt(int) const
ByteString::Assign(char const*, unsigned short)
ByteString::Assign(char)
+ByteString::EraseLeadingChars(char)
+ByteString::EraseTrailingChars(char)
CIccCLUT::Interp3dTetra(float*, float const*)
CIccCLUT::Iterate(IIccCLUTExec*)
CIccFormulaCurveSegment::SetFunction(unsigned short, unsigned char, float*)
@@ -397,7 +399,6 @@ ScHTMLColOffset_SAR::Replace(unsigned long const&, unsigned short)
ScHTMLColOffset_SAR::Replace(unsigned long const*, unsigned short, unsigned short)
ScHTMLColOffset_SAR::_ForEach(unsigned short, unsigned short, unsigned char (*)(unsigned long const&, void*), void*)
ScInputBarGroup::GainFocus()
-ScInputBarGroup::LinkStubImpl_ScrollHdl(void*, void*)
ScJobSetup::ScJobSetup(SfxPrinter*)
ScLeftFooterEditPage::GetRanges()
ScLeftHeaderEditPage::GetRanges()
@@ -2028,7 +2029,6 @@ oox::ole::VbaProject::hasDialog(rtl::OUString const&) const
oox::ole::VbaProject::hasModule(rtl::OUString const&) const
oox::ole::VbaSiteModel::isVisible() const
oox::ppt::PPTShape::findPlaceholder(int, int, std::__debug::vector<boost::shared_ptr<oox::drawingml::Shape>, std::allocator<boost::shared_ptr<oox::drawingml::Shape> > >&)
-oox::ppt::lclDebugSubType(int)
oox::vml::(anonymous namespace)::lclInsertTextFrame(oox::core::XmlFilterBase const&, com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&)
oox::vml::(anonymous namespace)::lclSetXShapeRect(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&, com::sun::star::awt::Rectangle const&)
oox::xls::(anonymous namespace)::lclCalcEmu(oox::xls::UnitConverter const&, long, oox::xls::Unit)
@@ -2225,7 +2225,6 @@ std::__cxx1998::vector<SfxFilter*, std::allocator<SfxFilter*> >::~vector()
std::__cxx1998::vector<SotFactory*, std::allocator<SotFactory*> >::~vector()
std::__cxx1998::vector<com::sun::star::datatransfer::DataFlavor*, std::allocator<com::sun::star::datatransfer::DataFlavor*> >::~vector()
svgi::(anonymous namespace)::appendChar(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char)
-svgi::getTokenName(int)
svx::SvxShowCharSetItem::~SvxShowCharSetItem()
svxform::DataNavigatorManager::GetChildWindowId()
svxform::FmFilterNavigatorWinMgr::GetChildWindowId()
diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx
index 956f63f..c77587d 100644
--- a/vcl/inc/vcl/animate.hxx
+++ b/vcl/inc/vcl/animate.hxx
@@ -200,12 +200,6 @@ public:
sal_Bool Start(
OutputDevice* pOutDev,
const Point& rDestPt,
- long nExtraData = 0,
- OutputDevice* pFirstFrameOutDev = NULL
- );
- sal_Bool Start(
- OutputDevice* pOutDev,
- const Point& rDestPt,
const Size& rDestSz,
long nExtraData = 0,
OutputDevice* pFirstFrameOutDev = NULL
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index b4de8f9..aba1f53 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -295,14 +295,6 @@ sal_uLong Animation::GetChecksum() const
// -----------------------------------------------------------------------
-sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, long nExtraData,
- OutputDevice* pFirstFrameOutDev )
-{
- return Start( pOut, rDestPt, pOut->PixelToLogic( maGlobalSize ), nExtraData, pFirstFrameOutDev );
-}
-
-// -----------------------------------------------------------------------
-
sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz, long nExtraData,
OutputDevice* pFirstFrameOutDev )
{
commit b7ea36101497c275cb08b0e37facbde656197d9b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Nov 22 23:40:24 2011 +0000
add stripStart, can replace EraseTrailingChars
diff --git a/comphelper/inc/comphelper/string.hxx b/comphelper/inc/comphelper/string.hxx
index e6b2d72..c1f5649 100644
--- a/comphelper/inc/comphelper/string.hxx
+++ b/comphelper/inc/comphelper/string.hxx
@@ -223,7 +223,7 @@ COMPHELPER_DLLPUBLIC rtl::OUString remove(const rtl::OUString &rIn,
/** Strips occurrences of a character from the start of the source string
@param rIn The input OString
- @param c The character to be stripped from the beginning
+ @param c The character to be stripped from the start
@return The resulting OString
*/
@@ -233,13 +233,32 @@ COMPHELPER_DLLPUBLIC rtl::OString stripStart(const rtl::OString &rIn,
/** Strips occurrences of a character from the start of the source string
@param rIn The input OUString
- @param c The character to be stripped from the beginning
+ @param c The character to be stripped from the start
@return The resulting OUString
*/
COMPHELPER_DLLPUBLIC rtl::OUString stripStart(const rtl::OUString &rIn,
sal_Unicode c);
+/** Strips occurrences of a character from the end of the source string
+
+ @param rIn The input OString
+ @param c The character to be stripped from the end
+
+ @return The resulting OString
+ */
+COMPHELPER_DLLPUBLIC rtl::OString stripEnd(const rtl::OString &rIn,
+ sal_Char c);
+
+/** Strips occurrences of a character from the end of the source string
+
+ @param rIn The input OUString
+ @param c The character to be stripped from the end
+
+ @return The resulting OUString
+ */
+COMPHELPER_DLLPUBLIC rtl::OUString stripEnd(const rtl::OUString &rIn,
+ sal_Unicode c);
/** Returns a token in the OString
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx
index 790519d..1e89408 100644
--- a/comphelper/qa/string/test_string.cxx
+++ b/comphelper/qa/string/test_string.cxx
@@ -50,6 +50,7 @@ public:
void testReplace();
void testRemove();
void testStripStart();
+ void testStripEnd();
void testToken();
void testDecimalStringToNumber();
void testIsdigitAsciiString();
@@ -64,6 +65,7 @@ public:
CPPUNIT_TEST(testReplace);
CPPUNIT_TEST(testRemove);
CPPUNIT_TEST(testStripStart);
+ CPPUNIT_TEST(testStripEnd);
CPPUNIT_TEST(testToken);
CPPUNIT_TEST(testDecimalStringToNumber);
CPPUNIT_TEST(testIsdigitAsciiString);
@@ -452,6 +454,26 @@ void TestString::testStripStart()
CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("ba")));
}
+void TestString::testStripEnd()
+{
+ ::rtl::OString aIn(RTL_CONSTASCII_STRINGPARAM("abc"));
+ ::rtl::OString aOut;
+
+ aOut = ::comphelper::string::stripEnd(aIn, 'b');
+ CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("abc")));
+
+ aOut = ::comphelper::string::stripEnd(aIn, 'c');
+ CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("ab")));
+
+ aIn = rtl::OString(RTL_CONSTASCII_STRINGPARAM("aaa"));
+ aOut = ::comphelper::string::stripEnd(aIn, 'a');
+ CPPUNIT_ASSERT(aOut.isEmpty());
+
+ aIn = rtl::OString(RTL_CONSTASCII_STRINGPARAM("aba"));
+ aOut = ::comphelper::string::stripEnd(aIn, 'a');
+ CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("ab")));
+}
+
void TestString::testToken()
{
::rtl::OString aIn(RTL_CONSTASCII_STRINGPARAM("10.11.12"));
diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx
index 09fb268..02d1cd4 100644
--- a/comphelper/source/misc/string.cxx
+++ b/comphelper/source/misc/string.cxx
@@ -200,6 +200,37 @@ rtl::OUString stripStart(const rtl::OUString &rIn, sal_Unicode c)
return tmpl_stripStart<rtl::OUString, sal_Unicode>(rIn, c);
}
+namespace
+{
+ template <typename T, typename C> T tmpl_stripEnd(const T &rIn,
+ const C cRemove)
+ {
+ if (rIn.isEmpty())
+ return rIn;
+
+ sal_Int32 i = rIn.getLength();
+
+ while (i > 0)
+ {
+ if (rIn[i-1] != cRemove)
+ break;
+ --i;
+ }
+
+ return rIn.copy(0, i);
+ }
+}
+
+rtl::OString stripEnd(const rtl::OString &rIn, sal_Char c)
+{
+ return tmpl_stripEnd<rtl::OString, sal_Char>(rIn, c);
+}
+
+rtl::OUString stripEnd(const rtl::OUString &rIn, sal_Unicode c)
+{
+ return tmpl_stripEnd<rtl::OUString, sal_Unicode>(rIn, c);
+}
+
sal_uInt32 decimalStringToNumber(
::rtl::OUString const & str )
{
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index 6c91c3e..0dd6073 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -65,10 +65,9 @@ static long nStaticTabs[]=
// static function -------------------------------------------------------
-static String getNormDicEntry_Impl( const String &rText )
+static String getNormDicEntry_Impl(const rtl::OUString &rText)
{
- String aTmp( rText );
- aTmp.EraseTrailingChars( '.' );
+ rtl::OUString aTmp(comphelper::string::stripEnd(rText, '.'));
return comphelper::string::remove(aTmp, '=');
}
diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx
index e337bc6..0105e34 100644
--- a/extensions/source/propctrlr/browserline.cxx
+++ b/extensions/source/propctrlr/browserline.cxx
@@ -30,19 +30,17 @@
#include "precompiled_extensions.hxx"
#include "browserline.hxx"
-/** === begin UNO includes === **/
#include <com/sun/star/inspection/PropertyLineElement.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
-/** === end UNO includes === **/
-#include <vcl/svapp.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-
-#include <comphelper/processfactory.hxx>
-#include <comphelper/componentcontext.hxx>
+#include <vcl/svapp.hxx>
//............................................................................
namespace pcr
@@ -306,16 +304,16 @@ namespace pcr
//------------------------------------------------------------------
XubString OBrowserLine::GetTitle() const
{
- String sDisplayName = m_aFtTitle.GetText();
+ rtl::OUString sDisplayName = m_aFtTitle.GetText();
- // for Issue 69452
- if (Application::GetSettings().GetLayoutRTL())
- {
- sal_Unicode cRTL_mark = 0x200F;
- sDisplayName.EraseTrailingChars(cRTL_mark);
- }
+ // for Issue 69452
+ if (Application::GetSettings().GetLayoutRTL())
+ {
+ sal_Unicode cRTL_mark = 0x200F;
+ sDisplayName = comphelper::string::stripEnd(sDisplayName, cRTL_mark);
+ }
- sDisplayName.EraseTrailingChars( '.' );
+ sDisplayName = comphelper::string::stripEnd(sDisplayName, '.');
return sDisplayName;
}
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 2234125..d00242f 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -366,8 +366,8 @@ sal_Bool ResData::SetId( const ByteString &rId, sal_uInt16 nLevel )
{
YYWarning( "LocalId > 255 chars, truncating..." );
sId.Erase( 255 );
- sId.EraseTrailingChars( ' ' );
- sId.EraseTrailingChars( '\t' );
+ sId = comphelper::string::stripEnd(sId, ' ');
+ sId = comphelper::string::stripEnd(sId, '\t');
}
return sal_True;
@@ -643,7 +643,7 @@ int Export::Execute( int nToken, const char * pToken )
sToken = comphelper::string::remove(sToken, '\r');
sToken = comphelper::string::remove(sToken, '{');
while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {};
- sToken.EraseTrailingChars( ' ' );
+ sToken = comphelper::string::stripEnd(sToken, ' ');
ByteString sT = getToken(sToken, 0, ' ');
pResData->sResTyp = sT.ToLowerAscii();
ByteString sId( sToken.Copy( pResData->sResTyp.Len() + 1 ));
@@ -1280,7 +1280,7 @@ ByteString Export::GetPairedListID( const ByteString& sText ){
ByteString sIdent = getToken(sText, 1, ';');
sIdent.ToUpperAscii();
while( sIdent.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {};
- sIdent.EraseTrailingChars( ' ' );
+ sIdent = comphelper::string::stripEnd(sIdent, ' ');
sIdent = comphelper::string::stripStart(sIdent, ' ');
return sIdent;
}
@@ -1288,10 +1288,10 @@ ByteString Export::GetPairedListString( const ByteString& sText ){
// < "STRING" ; IDENTIFIER ; > ;
ByteString sString = getToken(sText, 0, ';');
while( sString.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {};
- sString.EraseTrailingChars( ' ' );
+ sString = comphelper::string::stripEnd(sString, ' ');
ByteString s1 = sString.Copy( sString.Search( '\"' )+1 );
sString = s1.Copy( 0 , s1.SearchBackward( '\"' ) );
- sString.EraseTrailingChars( ' ' );
+ sString = comphelper::string::stripEnd(sString, ' ');
sString = comphelper::string::stripStart(sString, ' ');
return sString;
}
@@ -1311,7 +1311,7 @@ sal_Bool Export::WriteExportList( ResData *pResData, ExportList *pExportList,
else {
sGID += ".";
sGID += pResData->sId;
- sGID.EraseTrailingChars( '.' );
+ sGID = comphelper::string::stripEnd(sGID, '.');
}
ByteString sTimeStamp( Export::GetTimeStamp());
@@ -1548,7 +1548,7 @@ ByteString Export::GetText( const ByteString &rSource, int nToken )
while( sToken.SearchAndReplace( " ", " " ) !=
STRING_NOTFOUND ) {};
sToken = comphelper::string::stripStart(sToken, ' ');
- sToken.EraseTrailingChars( ' ' );
+ sToken = comphelper::string::stripEnd(sToken, ' ');
if ( sToken.Len()) {
sReturn += "\\\" ";
sReturn += sToken;
diff --git a/l10ntools/source/gsicheck.cxx b/l10ntools/source/gsicheck.cxx
index 036edaf..e258702 100644
--- a/l10ntools/source/gsicheck.cxx
+++ b/l10ntools/source/gsicheck.cxx
@@ -393,7 +393,7 @@ void GSIBlock::PrintList( ParserMessageList *pList, ByteString aPrefix,
aContext = pLine->GetText().Copy( 0, 300 );
else
aContext = pLine->Copy( pMsg->GetTagBegin()-150, 300 );
- aContext.EraseTrailingChars(' ');
+ aContext = comphelper::string::stripEnd(aContext, ' ');
aContext = comphelper::string::stripStart(aContext, ' ');
}
diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index efa5c0c..5a9f82e 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -506,8 +506,8 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile
ByteString HelpParser::GetOutpath( const ByteString& rPathX , const ByteString& sCur , const ByteString& rPathY ){
ByteString testpath = rPathX;
static const ByteString sDelimiter( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US );
- testpath.EraseTrailingChars( '/' );
- testpath.EraseTrailingChars( '\\' );
+ testpath = comphelper::string::stripEnd(testpath, '/');
+ testpath = comphelper::string::stripEnd(testpath, '\\');
testpath += sDelimiter;
testpath += sCur;
testpath += sDelimiter;
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index 57216af..83affd6 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -174,13 +174,13 @@ void LngParser::WriteSDF( SvFileStream &aSDFStream , ByteStringHashMap &rText_in
bool LngParser::isNextGroup( ByteString &sGroup_out , ByteString &sLine_in )
{
sLine_in = comphelper::string::stripStart(sLine_in, ' ');
- sLine_in.EraseTrailingChars( ' ' );
+ sLine_in = comphelper::string::stripEnd(sLine_in, ' ');
if (( sLine_in.GetChar( 0 ) == '[' ) &&
( sLine_in.GetChar( sLine_in.Len() - 1 ) == ']' ))
{
sGroup_out = getToken(getToken(sLine_in, 1, '['), 0, ']');
sGroup_out = comphelper::string::stripStart(sGroup_out, ' ');
- sGroup_out.EraseTrailingChars( ' ' );
+ sGroup_out = comphelper::string::stripEnd(sGroup_out, ' ');
return true;
}
return false;
@@ -226,13 +226,13 @@ sal_Bool LngParser::Merge(
{
ByteString sLine( *(*pLines)[ nPos ] );
sLine = comphelper::string::stripStart(sLine, ' ');
- sLine.EraseTrailingChars( ' ' );
+ sLine = comphelper::string::stripEnd(sLine, ' ');
if (( sLine.GetChar( 0 ) == '[' ) &&
( sLine.GetChar( sLine.Len() - 1 ) == ']' ))
{
sGroup = getToken(getToken(sLine, 1, '['), 0, ']');
sGroup = comphelper::string::stripStart(sGroup, ' ');
- sGroup.EraseTrailingChars( ' ' );
+ sGroup = comphelper::string::stripEnd(sGroup, ' ');
bGroup = sal_True;
}
nPos ++;
@@ -255,13 +255,13 @@ sal_Bool LngParser::Merge(
{
ByteString sLine( *(*pLines)[ nPos ] );
sLine = comphelper::string::stripStart(sLine, ' ');
- sLine.EraseTrailingChars( ' ' );
+ sLine = comphelper::string::stripEnd(sLine, ' ');
if (( sLine.GetChar( 0 ) == '[' ) &&
( sLine.GetChar( sLine.Len() - 1 ) == ']' ))
{
sGroup = getToken(getToken(sLine, 1, '['), 0, ']');
sGroup = comphelper::string::stripStart(sGroup, ' ');
- sGroup.EraseTrailingChars( ' ' );
+ sGroup = comphelper::string::stripEnd(sGroup, ' ');
bGroup = sal_True;
nPos ++;
sLanguagesDone = "";
@@ -270,7 +270,7 @@ sal_Bool LngParser::Merge(
{
ByteString sLang = getToken(sLine, 0, '=');
sLang = comphelper::string::stripStart(sLang, ' ');
- sLang.EraseTrailingChars( ' ' );
+ sLang = comphelper::string::stripEnd(sLang, ' ');
ByteString sSearch( ";" );
sSearch += sLang;
diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx
index 0d49e84..e390fdd 100644
--- a/l10ntools/source/xrmmerge.cxx
+++ b/l10ntools/source/xrmmerge.cxx
@@ -442,7 +442,7 @@ void XRMResParser::ConvertStringToDBFormat( ByteString &rString )
sResult = rString;
rString = comphelper::string::stripStart(rString, _LF);
rString = comphelper::string::stripStart(rString, '\t');
- rString.EraseTrailingChars( '\t' );
+ rString = comphelper::string::stripEnd(rString, '\t');
} while ( sResult != rString );
rString.SearchAndReplaceAll( "\t", "\\t" );
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index 1688004..6c2b236 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -43,6 +43,7 @@
#include "tool.h"
#include <math.h>
+#include <comphelper/string.hxx>
extern WKTYP eTyp;
@@ -77,7 +78,7 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtStri
if( n != STRING_NOTFOUND )
t.Erase( 0, n + s.Len() );
- t.EraseTrailingChars( '(' );
+ t = comphelper::string::stripEnd(t, '(');
eOc = lcl_KnownAddIn( t );
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 595d233..e532d98 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -48,8 +48,9 @@
#include <boost/unordered_map.hpp>
#include <rtl/ustrbuf.hxx>
-#include <comphelper/processfactory.hxx>
#include <comphelper/configurationhelper.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
@@ -1040,7 +1041,7 @@ SearchTabPage_Impl::~SearchTabPage_Impl()
aUserData += ';';
}
- aUserData.EraseTrailingChars(';');
+ aUserData = comphelper::string::stripEnd(aUserData, ';');
Any aUserItem = makeAny( ::rtl::OUString( aUserData ) );
aViewOpt.SetUserItem( USERITEM_NAME, aUserItem );
}
diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx
index 2451d10..504baa7 100644
--- a/sfx2/source/bastyp/frmhtmlw.cxx
+++ b/sfx2/source/bastyp/frmhtmlw.cxx
@@ -49,8 +49,8 @@
#include <sfx2/sfx.hrc>
#include "bastyp.hrc"
-#include <comphelper/string.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <com/sun/star/script/XTypeConverter.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
@@ -238,16 +238,17 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const String& rBaseURL,
xUserDefinedProps->getPropertySetInfo();
DBG_ASSERT(xPropInfo.is(), "UserDefinedProperties Info is null");
uno::Sequence<beans::Property> props = xPropInfo->getProperties();
- for (sal_Int32 i = 0; i < props.getLength(); ++i) {
- try {
+ for (sal_Int32 i = 0; i < props.getLength(); ++i)
+ {
+ try
+ {
::rtl::OUString name = props[i].Name;
- ::rtl::OUString str;
uno::Any aStr = xConverter->convertToSimpleType(
xUserDefinedProps->getPropertyValue(name),
uno::TypeClass_STRING);
+ ::rtl::OUString str;
aStr >>= str;
- String valstr(str);
- valstr.EraseTrailingChars();
+ String valstr(comphelper::string::stripEnd(str, ' '));
OutMeta( rStrm, pIndent, name, valstr, sal_False,
eDestEnc, pNonConvertableChars );
}
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index ab4094a..72ba885 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -31,6 +31,7 @@
#include "document.hxx"
#include "view.hxx"
#include "accessibility.hxx"
+#include <comphelper/string.hxx>
void SmCursor::Move(OutputDevice* pDev, SmMovementDirection direction, bool bMoveAnchor){
SmCaretPosGraphEntry* NewPos = NULL;
@@ -1112,7 +1113,7 @@ void SmCursor::InsertSpecial(XubString aString) {
Delete();
aString.EraseLeadingAndTrailingChars();
- aString.EraseLeadingChars('%');
+ aString = comphelper::string::stripStart(aString, '%');
//Create instance of special node
SmToken token;
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index e9eced8..426163d 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -2188,8 +2188,8 @@ bool SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox,
// 'Normalisieren' des SymbolNamens (ohne leading und trailing Leerzeichen)
XubString aNormName (rSymbolSetName);
- aNormName.EraseLeadingChars(' ');
- aNormName.EraseTrailingChars(' ');
+ aNormName = comphelper::string::stripStart(aNormName, ' ');
+ aNormName = comphelper::string::stripEnd(aNormName, ' ');
// und evtl Abweichungen in der Eingabe beseitigen
rComboBox.SetText(aNormName);
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 6ab4cbf..b3bb953 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -49,6 +49,10 @@ one go*/
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/uno/Any.h>
+#include <comphelper/genericpropertyset.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
+#include <comphelper/string.hxx>
#include <rtl/math.hxx>
#include <sfx2/frame.hxx>
#include <sfx2/docfile.hxx>
@@ -58,7 +62,6 @@ one go*/
#include <unotools/saveopt.hxx>
#include <svl/stritem.hxx>
#include <svl/itemprop.hxx>
-#include <comphelper/processfactory.hxx>
#include <unotools/streamwrap.hxx>
#include <sax/tools/converter.hxx>
#include <xmloff/xmlnmspe.hxx>
@@ -68,8 +71,6 @@ one go*/
#include <xmloff/xmluconv.hxx>
#include <xmloff/xmlmetai.hxx>
#include <osl/mutex.hxx>
-#include <comphelper/genericpropertyset.hxx>
-#include <comphelper/servicehelper.hxx>
#include <memory>
@@ -572,7 +573,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/starmath/source/node.cxx b/starmath/source/node.cxx
index 29ed283..156537a 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -38,6 +38,7 @@
#include "mathtype.hxx"
#include "visitors.hxx"
+#include <comphelper/string.hxx>
#include <tools/gen.hxx>
#include <tools/fract.hxx>
#include <rtl/math.hxx>
@@ -449,7 +450,7 @@ void SmNode::CreateTextFromNode(String &rText)
pNode->CreateTextFromNode(rText);
if (nSize > 1)
{
- rText.EraseTrailingChars();
+ rText = comphelper::string::stripEnd(rText, ' ');
APPEND(rText,"} ");
}
}
@@ -824,7 +825,7 @@ void SmExpressionNode::CreateTextFromNode(String &rText)
if (nSize > 1)
{
- rText.EraseTrailingChars();
+ rText = comphelper::string::stripEnd(rText, ' ');
APPEND(rText,"} ");
}
}
@@ -1654,13 +1655,13 @@ void SmSubSupNode::CreateTextFromNode(String &rText)
}
if (NULL != (pNode = GetSubNode(RSUB+1)))
{
- rText.EraseTrailingChars();
+ rText = comphelper::string::stripEnd(rText, ' ');
rText.Append('_');
pNode->CreateTextFromNode(rText);
}
if (NULL != (pNode = GetSubNode(RSUP+1)))
{
- rText.EraseTrailingChars();
+ rText = comphelper::string::stripEnd(rText, ' ');
rText.Append('^');
pNode->CreateTextFromNode(rText);
}
@@ -1677,7 +1678,7 @@ void SmBraceNode::CreateTextFromNode(String &rText)
String aStr;
GetSubNode(0)->CreateTextFromNode(aStr);
aStr.EraseLeadingAndTrailingChars();
- aStr.EraseLeadingChars('\\');
+ aStr = comphelper::string::stripStart(aStr, '\\');
if (aStr.Len())
{
if (aStr.EqualsAscii("divides"))
@@ -1700,7 +1701,7 @@ void SmBraceNode::CreateTextFromNode(String &rText)
String aStr;
GetSubNode(2)->CreateTextFromNode(aStr);
aStr.EraseLeadingAndTrailingChars();
- aStr.EraseLeadingChars('\\');
+ aStr = comphelper::string::stripStart(aStr, '\\');
if (aStr.Len())
{
if (aStr.EqualsAscii("divides"))
@@ -2521,7 +2522,7 @@ void SmMatrixNode::CreateTextFromNode(String &rText)
if (i != nNumRows-1)
APPEND(rText,"## ");
}
- rText.EraseTrailingChars();
+ rText = comphelper::string::stripEnd(rText, ' ');
APPEND(rText,"} ");
}
@@ -2817,7 +2818,7 @@ void SmAttributNode::CreateTextFromNode(String &rText)
if (NULL != (pNode = GetSubNode(1)))
pNode->CreateTextFromNode(rText);
- rText.EraseTrailingChars();
+ rText = comphelper::string::stripEnd(rText, ' ');
if (nLast == 0xE082)
APPEND(rText," overbrace {}");
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 4d3ea9c..b72c085 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1079,8 +1079,8 @@ Size SmViewShell::GetTextLineSize(OutputDevice& rDevice, const String& rLine)
aSize.Width() = ((aSize.Width() / TabPos) + 1) * TabPos;
aText = rLine.GetToken(i, '\t');
- aText.EraseLeadingChars('\t');
- aText.EraseTrailingChars('\t');
+ aText = comphelper::string::stripStart(aText, '\t');
+ aText = comphelper::string::stripEnd(aText, '\t');
aSize.Width() += rDevice.GetTextWidth(aText);
}
}
@@ -1103,8 +1103,8 @@ Size SmViewShell::GetTextSize(OutputDevice& rDevice, const String& rText, long M
{
aLine = rText.GetToken(i, '\n');
aLine = comphelper::string::remove(aLine, '\r');
- aLine.EraseLeadingChars('\n');
- aLine.EraseTrailingChars('\n');
+ aLine = comphelper::string::stripStart(aLine, '\n');
+ aLine = comphelper::string::stripEnd(aLine, '\n');
aSize = GetTextLineSize(rDevice, aLine);
@@ -1134,9 +1134,9 @@ Size SmViewShell::GetTextSize(OutputDevice& rDevice, const String& rText, long M
TextSize.Height() += aSize.Height();
TextSize.Width() = Max(TextSize.Width(), Min(aSize.Width(), MaxWidth));
- aLine.EraseLeadingChars(' ');
- aLine.EraseLeadingChars('\t');
- aLine.EraseLeadingChars(' ');
+ aLine = comphelper::string::stripStart(aLine, ' ');
+ aLine = comphelper::string::stripStart(aLine, '\t');
+ aLine = comphelper::string::stripStart(aLine, ' ');
}
while (aLine.Len() > 0);
}
@@ -1169,8 +1169,8 @@ void SmViewShell::DrawTextLine(OutputDevice& rDevice, const Point& rPosition, co
aPoint.X() = ((aPoint.X() / TabPos) + 1) * TabPos;
aText = rLine.GetToken(i, '\t');
- aText.EraseLeadingChars('\t');
- aText.EraseTrailingChars('\t');
+ aText = comphelper::string::stripStart(aText, '\t');
+ aText = comphelper::string::stripEnd(aText, '\t');
rDevice.DrawText(aPoint, aText);
aPoint.X() += rDevice.GetTextWidth(aText);
}
@@ -1194,8 +1194,8 @@ void SmViewShell::DrawText(OutputDevice& rDevice, const Point& rPosition, const
{
aLine = rText.GetToken(i, '\n');
aLine = comphelper::string::remove(aLine, '\r');
- aLine.EraseLeadingChars('\n');
- aLine.EraseTrailingChars('\n');
+ aLine = comphelper::string::stripEnd(aLine, '\n');
+ aLine = comphelper::string::stripEnd(aLine, '\n');
aSize = GetTextLineSize(rDevice, aLine);
if (aSize.Width() > MaxWidth)
{
@@ -1222,9 +1222,9 @@ void SmViewShell::DrawText(OutputDevice& rDevice, const Point& rPosition, const
DrawTextLine(rDevice, aPoint, aText);
aPoint.Y() += aSize.Height();
- aLine.EraseLeadingChars(' ');
- aLine.EraseLeadingChars('\t');
- aLine.EraseLeadingChars(' ');
+ aLine = comphelper::string::stripStart(aLine, ' ');
+ aLine = comphelper::string::stripStart(aLine, '\t');
+ aLine = comphelper::string::stripStart(aLine, ' ');
}
while (GetTextLineSize(rDevice, aLine).Width() > MaxWidth);
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 6e7370b..c579e14 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -63,6 +63,7 @@
#include <tools/urlobj.hxx>
#include <tools/datetime.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <unotools/localfilehelper.hxx>
#include <ucbhelper/content.hxx>
#include <ucbhelper/commandenvironment.hxx>
@@ -1686,7 +1687,7 @@ String SvtFileView::GetConfigString() const
sRet += ';';
}
- sRet.EraseTrailingChars( ';' );
+ sRet = comphelper::string::stripEnd(sRet, ';');
return sRet;
}
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index 188ef36..6e602e2 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -32,6 +32,7 @@
#include <stdio.h>
#include <tools/debug.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <unotools/localedatawrapper.hxx>
#include <vcl/svapp.hxx>
#include <svl/zformat.hxx>
@@ -1348,8 +1349,8 @@ void DoubleCurrencyField::UpdateCurrencyFormat()
if (getPrependCurrSym())
{
XubString sSymbol = getCurrencySymbol();
- sSymbol.EraseLeadingChars(' ');
- sSymbol.EraseTrailingChars(' ');
+ sSymbol = comphelper::string::stripStart(sSymbol, ' ');
+ sSymbol = comphelper::string::stripEnd(sSymbol, ' ');
XubString sTemp = String::CreateFromAscii("[$");
sTemp += sSymbol;
@@ -1370,8 +1371,8 @@ void DoubleCurrencyField::UpdateCurrencyFormat()
else
{
XubString sTemp = getCurrencySymbol();
- sTemp.EraseLeadingChars(' ');
- sTemp.EraseTrailingChars(' ');
+ sTemp = comphelper::string::stripStart(sTemp, ' ');
+ sTemp = comphelper::string::stripEnd(sTemp, ' ');
sNewFormat += String::CreateFromAscii(" [$");
sNewFormat += sTemp;
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index 097a8ad..6b99f8f 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -48,6 +48,7 @@
#include <com/sun/star/ucb/XContentAccess.hpp>
#include <com/sun/star/ucb/XSortedDynamicResultSetFactory.hpp>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <vcl/toolbox.hxx>
#include <osl/thread.hxx>
#include <osl/mutex.hxx>
@@ -1162,7 +1163,7 @@ String SvtURLBox::GetURL()
#ifdef WNT
// erase trailing spaces on Windows since thay are invalid on this OS and
// most of the time they are inserted by accident via copy / paste
- aText.EraseTrailingChars();
+ aText = comphelper::string::stripEnd(aText, ' ');
if ( !aText.Len() )
return aText;
// #i9739#
@@ -1327,7 +1328,7 @@ sal_Bool SvtURLBox_Impl::TildeParsing(
else
{
// "blabla/" path should be converted to "blabla"
- aParseTilde.EraseTrailingChars( '/' );
+ aParseTilde = comphelper::string::stripEnd(aParseTilde, '/');
}
}
else
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index 1d3b7ab..5f73c5c 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -382,12 +382,12 @@ long ImageMap::ImpReadCERNRadius( const char** ppStr )
String ImageMap::ImpReadCERNURL( const char** ppStr, const String& rBaseURL )
{
- String aStr( String::CreateFromAscii( *ppStr ) );
+ rtl::OUString aStr(rtl::OUString::createFromAscii(*ppStr));
- aStr.EraseLeadingChars( ' ' );
- aStr.EraseLeadingChars( '\t' );
- aStr.EraseTrailingChars( ' ' );
- aStr.EraseTrailingChars( '\t' );
+ aStr = comphelper::string::stripStart(aStr, ' ');
+ aStr = comphelper::string::stripStart(aStr, '\t');
+ aStr = comphelper::string::stripEnd(aStr, ' ');
+ aStr = comphelper::string::stripEnd(aStr, '\t');
return INetURLObject::GetAbsURL( rBaseURL, aStr );
}
diff --git a/svtools/source/svhtml/htmlsupp.cxx b/svtools/source/svhtml/htmlsupp.cxx
index 96cb4f1..292d36f 100644
--- a/svtools/source/svhtml/htmlsupp.cxx
+++ b/svtools/source/svhtml/htmlsupp.cxx
@@ -31,11 +31,11 @@
#include <ctype.h>
#include <stdio.h>
-#include <tools/urlobj.hxx>
-
+#include <comphelper/string.hxx>
#include <svtools/parhtml.hxx>
#include <svtools/htmltokn.h>
#include <svtools/htmlkywd.hxx>
+#include <tools/urlobj.hxx>
// Table for converting option values into strings
static HTMLOptionEnum const aScriptLangOptEnums[] =
@@ -135,7 +135,7 @@ void HTMLParser::RemoveSGMLComment( String &rString, sal_Bool bFull )
if( bFull )
{
// "//" or "'", maybe preceding CR/LF
- rString.EraseTrailingChars();
+ rString = comphelper::string::stripEnd(rString, ' ');
xub_StrLen nDel = 0, nLen = rString.Len();
if( nLen >= 2 &&
rString.Copy(nLen-2).CompareToAscii("//") == COMPARE_EQUAL )
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index 7f234e8..857395f 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -2523,8 +2523,8 @@ void SwHTMLParser::EndSelect()
for( i = 0; i < nEntryCnt; i++ )
{
- String sText( *pFormImpl->GetStringList()[i] );
- sText.EraseTrailingChars();
+ rtl::OUString sText( *pFormImpl->GetStringList()[i] );
+ sText = comphelper::string::stripEnd(sText, ' ');
pStrings[i] = sText;
sText = *pFormImpl->GetValueList()[i];
diff --git a/sw/source/filter/rtf/rtffld.cxx b/sw/source/filter/rtf/rtffld.cxx
index 7bb6210..44563d0 100644
--- a/sw/source/filter/rtf/rtffld.cxx
+++ b/sw/source/filter/rtf/rtffld.cxx
@@ -34,6 +34,7 @@
#include <sal/macros.h>
#include <com/sun/star/i18n/ScriptType.hdl>
+#include <comphelper/string.hxx>
#include <vcl/graph.hxx>
#include <svl/urihelper.hxx>
#include <svtools/rtftoken.h>
@@ -159,7 +160,7 @@ static RTF_FLD_TYPES _WhichFld( String& rName, String& rNext )
nFndPos += nTokenStt + static_cast< xub_StrLen >(nLen);
while( rNext.GetChar( nFndPos ) == ' ' ) ++nFndPos;
rNext.Erase( 0, nFndPos );
- rNext.EraseTrailingChars();
+ rNext = comphelper::string::stripEnd(rNext, ' ');
return aFldNmArr[n].eFldType;
}
}
@@ -242,7 +243,7 @@ sal_Unicode RtfFieldSwitch::GetSwitch( String& rParam )
rParam = sParam.GetToken( 0, c );
sParam.Erase( 0, rParam.Len() + nOffset ).EraseLeadingChars();
if( '\\' == c )
- rParam.EraseTrailingChars();
+ rParam = comphelper::string::stripEnd(rParam, ' ');
nCurPos = 0;
return cKey;
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 38236e6..b381ad0 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -105,6 +105,7 @@
#include <svx/svdoutl.hxx>
#include <unotools/streamwrap.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <editeng/outlobj.hxx>
#include <editeng/paperinf.hxx>
@@ -1583,7 +1584,7 @@ sal_uInt16 SwRTFParser::ReadRevTbl()
break;
case RTF_TEXTTOKEN:
- aToken.EraseTrailingChars(';');
+ aToken = comphelper::string::stripEnd(aToken, ';');
sal_uInt16 nSWId = pDoc->InsertRedlineAuthor(aToken);
// Store matchpair
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 789e57d..24b2006 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -2087,9 +2087,9 @@ void PrintFontManager::initFontsAlias()
// remove eventual quotes
aAlias = comphelper::string::stripStart(aAlias, '"');
- aAlias.EraseTrailingChars( '"' );
+ aAlias = comphelper::string::stripEnd(aAlias, '"');
aMap = comphelper::string::stripStart(aMap, '"');
- aMap.EraseTrailingChars( '"' );
+ aMap = comphelper::string::stripEnd(aMap, '"');
XLFDEntry aAliasEntry, aMapEntry;
parseXLFD( aAlias, aAliasEntry );
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index e3b7970..724d46a 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -606,13 +606,13 @@ String PPDParser::getPPDPrinterName( const String& rFile )
{
aCurLine.Erase( 0, 9 );
aCurLine = comphelper::string::stripStart(aCurLine, ' ');
- aCurLine.EraseTrailingChars( ' ' );
+ aCurLine = comphelper::string::stripEnd(aCurLine, ' ');
aCurLine = comphelper::string::stripStart(aCurLine, '\t');
- aCurLine.EraseTrailingChars( '\t' );
- aCurLine.EraseTrailingChars( '\r' );
- aCurLine.EraseTrailingChars( '\n' );
+ aCurLine = comphelper::string::stripEnd(aCurLine, '\t');
+ aCurLine = comphelper::string::stripEnd(aCurLine, '\r');
+ aCurLine = comphelper::string::stripEnd(aCurLine, '\n');
aCurLine = comphelper::string::stripStart(aCurLine, '"');
- aCurLine.EraseTrailingChars( '"' );
+ aCurLine = comphelper::string::stripEnd(aCurLine, '"');
aStream.Close();
aStream.Open( getPPDFile( aCurLine ) );
continue;
@@ -705,13 +705,13 @@ PPDParser::PPDParser( const String& rFile ) :
{
aCurLine.Erase( 0, 9 );
aCurLine = comphelper::string::stripStart(aCurLine, ' ');
- aCurLine.EraseTrailingChars( ' ' );
+ aCurLine = comphelper::string::stripEnd(aCurLine, ' ');
aCurLine = comphelper::string::stripStart(aCurLine, '\t');
- aCurLine.EraseTrailingChars( '\t' );
- aCurLine.EraseTrailingChars( '\r' );
- aCurLine.EraseTrailingChars( '\n' );
+ aCurLine = comphelper::string::stripEnd(aCurLine, '\t');
+ aCurLine = comphelper::string::stripEnd(aCurLine, '\r');
+ aCurLine = comphelper::string::stripEnd(aCurLine, '\n');
aCurLine = comphelper::string::stripStart(aCurLine, '"');
- aCurLine.EraseTrailingChars( '"' );
+ aCurLine = comphelper::string::stripEnd(aCurLine, '"');
aStream.Close();
aStream.Open( getPPDFile( String( aCurLine, m_aFileEncoding ) ) );
continue;
commit 62d880f3228c7f5c3f8a1d30f5a5c9ed390a1eb5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Nov 22 22:48:09 2011 +0000
_SVSTDARR_ULONGS not used here
diff --git a/svtools/source/svhtml/htmlsupp.cxx b/svtools/source/svhtml/htmlsupp.cxx
index 187273b..96cb4f1 100644
--- a/svtools/source/svhtml/htmlsupp.cxx
+++ b/svtools/source/svhtml/htmlsupp.cxx
@@ -32,10 +32,6 @@
#include <ctype.h>
#include <stdio.h>
#include <tools/urlobj.hxx>
-#ifndef _SVSTDARR_HXX
-#define _SVSTDARR_ULONGS
-#include <svl/svstdarr.hxx>
-#endif
#include <svtools/parhtml.hxx>
#include <svtools/htmltokn.h>
commit d05f4d3a7ea617c7f3c4901f7e0d89963e5db604
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Nov 22 22:00:43 2011 +0000
convert inlines as well
diff --git a/tools/inc/tools/urlobj.hxx b/tools/inc/tools/urlobj.hxx
index bc792fb..e8ac79a 100644
--- a/tools/inc/tools/urlobj.hxx
+++ b/tools/inc/tools/urlobj.hxx
@@ -578,7 +578,7 @@ public:
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
inline bool SetUserAndPass(const rtl::OString& rTheUser,
- const rtl:OString& rThePassword,
+ const rtl::OString& rThePassword,
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset
= RTL_TEXTENCODING_UTF8);
@@ -1428,8 +1428,7 @@ private:
static inline rtl::OUString extend(const rtl::OString& rOctets)
{
- return rtl::OUString(rOctets.GetBuffer(), rOctets.Len(),
- RTL_TEXTENCODING_ISO_8859_1);
+ return rtl::OStringToOUString(rOctets, RTL_TEXTENCODING_ISO_8859_1);
}
static inline sal_Char getEscapePrefix(INetProtocol eTheScheme)
commit 20153742d2dee2df022275a07cc958b1759b9b72
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Nov 22 17:17:53 2011 +0000
add a stripStart, can replace EraseLeadingChars
diff --git a/comphelper/inc/comphelper/string.hxx b/comphelper/inc/comphelper/string.hxx
index 00a1664..e6b2d72 100644
--- a/comphelper/inc/comphelper/string.hxx
+++ b/comphelper/inc/comphelper/string.hxx
@@ -220,6 +220,27 @@ COMPHELPER_DLLPUBLIC rtl::OString remove(const rtl::OString &rIn,
COMPHELPER_DLLPUBLIC rtl::OUString remove(const rtl::OUString &rIn,
sal_Unicode c);
+/** Strips occurrences of a character from the start of the source string
+
+ @param rIn The input OString
+ @param c The character to be stripped from the beginning
+
+ @return The resulting OString
+ */
+COMPHELPER_DLLPUBLIC rtl::OString stripStart(const rtl::OString &rIn,
+ sal_Char c);
+
+/** Strips occurrences of a character from the start of the source string
+
+ @param rIn The input OUString
+ @param c The character to be stripped from the beginning
+
+ @return The resulting OUString
+ */
+COMPHELPER_DLLPUBLIC rtl::OUString stripStart(const rtl::OUString &rIn,
+ sal_Unicode c);
+
+
/** Returns a token in the OString
@param token the number of the token to return
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx
index 2ce6f2c..790519d 100644
--- a/comphelper/qa/string/test_string.cxx
+++ b/comphelper/qa/string/test_string.cxx
@@ -49,6 +49,7 @@ public:
void testNatural();
void testReplace();
void testRemove();
+ void testStripStart();
void testToken();
void testDecimalStringToNumber();
void testIsdigitAsciiString();
@@ -62,6 +63,7 @@ public:
CPPUNIT_TEST(testNatural);
CPPUNIT_TEST(testReplace);
CPPUNIT_TEST(testRemove);
+ CPPUNIT_TEST(testStripStart);
CPPUNIT_TEST(testToken);
CPPUNIT_TEST(testDecimalStringToNumber);
CPPUNIT_TEST(testIsdigitAsciiString);
@@ -430,6 +432,26 @@ void TestString::testRemove()
CPPUNIT_ASSERT(aOut.isEmpty());
}
+void TestString::testStripStart()
+{
+ ::rtl::OString aIn(RTL_CONSTASCII_STRINGPARAM("abc"));
+ ::rtl::OString aOut;
+
+ aOut = ::comphelper::string::stripStart(aIn, 'b');
+ CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("abc")));
+
+ aOut = ::comphelper::string::stripStart(aIn, 'a');
+ CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("bc")));
+
+ aIn = rtl::OString(RTL_CONSTASCII_STRINGPARAM("aaa"));
+ aOut = ::comphelper::string::stripStart(aIn, 'a');
+ CPPUNIT_ASSERT(aOut.isEmpty());
+
+ aIn = rtl::OString(RTL_CONSTASCII_STRINGPARAM("aba"));
+ aOut = ::comphelper::string::stripStart(aIn, 'a');
+ CPPUNIT_ASSERT(aOut.equalsL(RTL_CONSTASCII_STRINGPARAM("ba")));
+}
+
void TestString::testToken()
{
::rtl::OString aIn(RTL_CONSTASCII_STRINGPARAM("10.11.12"));
diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx
index 8525e79..09fb268 100644
--- a/comphelper/source/misc/string.cxx
+++ b/comphelper/source/misc/string.cxx
@@ -169,6 +169,37 @@ rtl::OUString remove(const rtl::OUString &rIn, sal_Unicode c)
return tmpl_remove<rtl::OUString, sal_Unicode, rtl::OUStringBuffer>(rIn, c);
}
+namespace
+{
+ template <typename T, typename C> T tmpl_stripStart(const T &rIn,
+ const C cRemove)
+ {
+ if (rIn.isEmpty())
+ return rIn;
+
+ sal_Int32 i = 0;
+
+ while (i < rIn.getLength())
+ {
+ if (rIn[i] != cRemove)
+ break;
+ ++i;
+ }
+
+ return rIn.copy(i);
+ }
+}
+
+rtl::OString stripStart(const rtl::OString &rIn, sal_Char c)
+{
+ return tmpl_stripStart<rtl::OString, sal_Char>(rIn, c);
+}
+
+rtl::OUString stripStart(const rtl::OUString &rIn, sal_Unicode c)
+{
+ return tmpl_stripStart<rtl::OUString, sal_Unicode>(rIn, c);
+}
+
sal_uInt32 decimalStringToNumber(
::rtl::OUString const & str )
{
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 7ad52f6..2234125 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -1281,7 +1281,7 @@ ByteString Export::GetPairedListID( const ByteString& sText ){
sIdent.ToUpperAscii();
while( sIdent.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {};
sIdent.EraseTrailingChars( ' ' );
- sIdent.EraseLeadingChars( ' ' );
+ sIdent = comphelper::string::stripStart(sIdent, ' ');
return sIdent;
}
ByteString Export::GetPairedListString( const ByteString& sText ){
@@ -1292,7 +1292,7 @@ ByteString Export::GetPairedListString( const ByteString& sText ){
ByteString s1 = sString.Copy( sString.Search( '\"' )+1 );
sString = s1.Copy( 0 , s1.SearchBackward( '\"' ) );
sString.EraseTrailingChars( ' ' );
- sString.EraseLeadingChars( ' ' );
+ sString = comphelper::string::stripStart(sString, ' ');
return sString;
}
ByteString Export::StripList( const ByteString& sText ){
@@ -1547,7 +1547,7 @@ ByteString Export::GetText( const ByteString &rSource, int nToken )
STRING_NOTFOUND ) {};
while( sToken.SearchAndReplace( " ", " " ) !=
STRING_NOTFOUND ) {};
- sToken.EraseLeadingChars( ' ' );
+ sToken = comphelper::string::stripStart(sToken, ' ');
sToken.EraseTrailingChars( ' ' );
if ( sToken.Len()) {
sReturn += "\\\" ";
diff --git a/l10ntools/source/gsicheck.cxx b/l10ntools/source/gsicheck.cxx
index 9f1485b..036edaf 100644
--- a/l10ntools/source/gsicheck.cxx
+++ b/l10ntools/source/gsicheck.cxx
@@ -394,7 +394,7 @@ void GSIBlock::PrintList( ParserMessageList *pList, ByteString aPrefix,
else
aContext = pLine->Copy( pMsg->GetTagBegin()-150, 300 );
aContext.EraseTrailingChars(' ');
- aContext.EraseLeadingChars(' ');
+ aContext = comphelper::string::stripStart(aContext, ' ');
}
PrintMessage( pMsg->Prefix(), pMsg->GetErrorText(), aPrefix, aContext, pLine->GetLineNumber(), pLine->GetUniqId() );
diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index 214105c..efa5c0c 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -512,8 +512,8 @@ ByteString HelpParser::GetOutpath( const ByteString& rPathX , const ByteString&
testpath += sCur;
testpath += sDelimiter;
ByteString sRelativePath( rPathY );
- sRelativePath.EraseLeadingChars( '/' );
- sRelativePath.EraseLeadingChars( '\\' );
+ sRelativePath = comphelper::string::stripStart(sRelativePath, '/');
+ sRelativePath = comphelper::string::stripStart(sRelativePath, '\\');
testpath += sRelativePath;
testpath += sDelimiter;
return testpath;
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index 7592d49..57216af 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -142,54 +142,59 @@ sal_Bool LngParser::CreateSDF(
return true;
}
- void LngParser::WriteSDF( SvFileStream &aSDFStream , ByteStringHashMap &rText_inout ,
- const ByteString &rPrj , const ByteString &rRoot ,
- const ByteString &sActFileName , const ByteString &sID )
- {
-
- sal_Bool bExport = true;
- if ( bExport ) {
- ByteString sTimeStamp( Export::GetTimeStamp());
- ByteString sCur;
- for( unsigned int n = 0; n < aLanguages.size(); n++ ){
- sCur = aLanguages[ n ];
- ByteString sAct = rText_inout[ sCur ];
- if ( !sAct.Len() && sCur.Len() )
- sAct = rText_inout[ ByteString("en-US") ];
-
- ByteString sOutput( rPrj ); sOutput += "\t";
- if ( rRoot.Len())
- sOutput += sActFileName;
- sOutput += "\t0\t";
- sOutput += "LngText\t";
- sOutput += sID; sOutput += "\t\t\t\t0\t";
- sOutput += sCur; sOutput += "\t";
- sOutput += sAct; sOutput += "\t\t\t\t";
- sOutput += sTimeStamp;
- aSDFStream.WriteLine( sOutput );
- }
- }
- }
- bool LngParser::isNextGroup( ByteString &sGroup_out , ByteString &sLine_in ){
- sLine_in.EraseLeadingChars( ' ' );
+void LngParser::WriteSDF( SvFileStream &aSDFStream , ByteStringHashMap &rText_inout ,
+ const ByteString &rPrj , const ByteString &rRoot ,
+ const ByteString &sActFileName , const ByteString &sID )
+{
+
+ sal_Bool bExport = true;
+ if ( bExport ) {
+ ByteString sTimeStamp( Export::GetTimeStamp());
+ ByteString sCur;
+ for( unsigned int n = 0; n < aLanguages.size(); n++ ){
+ sCur = aLanguages[ n ];
+ ByteString sAct = rText_inout[ sCur ];
+ if ( !sAct.Len() && sCur.Len() )
+ sAct = rText_inout[ ByteString("en-US") ];
+
+ ByteString sOutput( rPrj ); sOutput += "\t";
+ if ( rRoot.Len())
+ sOutput += sActFileName;
+ sOutput += "\t0\t";
+ sOutput += "LngText\t";
+ sOutput += sID; sOutput += "\t\t\t\t0\t";
+ sOutput += sCur; sOutput += "\t";
+ sOutput += sAct; sOutput += "\t\t\t\t";
+ sOutput += sTimeStamp;
+ aSDFStream.WriteLine( sOutput );
+ }
+ }
+}
+
+bool LngParser::isNextGroup( ByteString &sGroup_out , ByteString &sLine_in )
+{
+ sLine_in = comphelper::string::stripStart(sLine_in, ' ');
sLine_in.EraseTrailingChars( ' ' );
if (( sLine_in.GetChar( 0 ) == '[' ) &&
- ( sLine_in.GetChar( sLine_in.Len() - 1 ) == ']' )){
+ ( sLine_in.GetChar( sLine_in.Len() - 1 ) == ']' ))
+ {
sGroup_out = getToken(getToken(sLine_in, 1, '['), 0, ']');
- sGroup_out.EraseLeadingChars( ' ' );
+ sGroup_out = comphelper::string::stripStart(sGroup_out, ' ');
sGroup_out.EraseTrailingChars( ' ' );
return true;
}
return false;
- }
- void LngParser::ReadLine( const ByteString &sLine_in , ByteStringHashMap &rText_inout){
- ByteString sLang = getToken(sLine_in, 0, '=');
- sLang.EraseLeadingChars( ' ' );
- sLang.EraseTrailingChars( ' ' );
- ByteString sText = getToken(getToken(sLine_in, 1, '\"'), 0, '\"');
- if( sLang.Len() )
- rText_inout[ sLang ] = sText;
- }
+}
+
+void LngParser::ReadLine( const ByteString &sLine_in , ByteStringHashMap &rText_inout)
+{
+ rtl::OString sLang = getToken(sLine_in, 0, '=');
+ sLang = comphelper::string::stripStart(sLang, ' ');
+ sLang = comphelper::string::stripStart(sLang, ' ');
+ rtl::OString sText = getToken(getToken(sLine_in, 1, '\"'), 0, '\"');
+ if (!sLang.isEmpty())
+ rText_inout[ sLang ] = sText;
+}
/*****************************************************************************/
sal_Bool LngParser::Merge(
@@ -217,15 +222,16 @@ sal_Bool LngParser::Merge(
ByteString sGroup;
// seek to next group
- while ( nPos < pLines->size() && !bGroup ) {
+ while ( nPos < pLines->size() && !bGroup )
+ {
ByteString sLine( *(*pLines)[ nPos ] );
- sLine.EraseLeadingChars( ' ' );
+ sLine = comphelper::string::stripStart(sLine, ' ');
sLine.EraseTrailingChars( ' ' );
if (( sLine.GetChar( 0 ) == '[' ) &&
( sLine.GetChar( sLine.Len() - 1 ) == ']' ))
{
sGroup = getToken(getToken(sLine, 1, '['), 0, ']');
- sGroup.EraseLeadingChars( ' ' );
+ sGroup = comphelper::string::stripStart(sGroup, ' ');
sGroup.EraseTrailingChars( ' ' );
bGroup = sal_True;
}
@@ -245,23 +251,25 @@ sal_Bool LngParser::Merge(
ByteString sLanguagesDone;
- while ( nPos < pLines->size() && !bGroup ) {
+ while ( nPos < pLines->size() && !bGroup )
+ {
ByteString sLine( *(*pLines)[ nPos ] );
- sLine.EraseLeadingChars( ' ' );
+ sLine = comphelper::string::stripStart(sLine, ' ');
sLine.EraseTrailingChars( ' ' );
if (( sLine.GetChar( 0 ) == '[' ) &&
( sLine.GetChar( sLine.Len() - 1 ) == ']' ))
{
sGroup = getToken(getToken(sLine, 1, '['), 0, ']');
- sGroup.EraseLeadingChars( ' ' );
+ sGroup = comphelper::string::stripStart(sGroup, ' ');
sGroup.EraseTrailingChars( ' ' );
bGroup = sal_True;
nPos ++;
sLanguagesDone = "";
}
- else if ( sLine.GetTokenCount( '=' ) > 1 ) {
+ else if ( sLine.GetTokenCount( '=' ) > 1 )
+ {
ByteString sLang = getToken(sLine, 0, '=');
- sLang.EraseLeadingChars( ' ' );
+ sLang = comphelper::string::stripStart(sLang, ' ');
sLang.EraseTrailingChars( ' ' );
ByteString sSearch( ";" );
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index 609e344..4bbdf2e 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -279,7 +279,7 @@ const ByteString SourceTreeLocalizer::GetProjectRootRel()
DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US );
sCur.SearchAndReplaceAll( sDelimiter, "/" );
- sCur.EraseLeadingChars( '/' );
+ sCur = comphelper::string::stripStart(sCur, '/');
sal_uLong nCount = sCur.GetTokenCount( '/' );
ByteString sProjectRootRel;
diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx
index 166d355..0d49e84 100644
--- a/l10ntools/source/xrmmerge.cxx
+++ b/l10ntools/source/xrmmerge.cxx
@@ -440,8 +440,8 @@ void XRMResParser::ConvertStringToDBFormat( ByteString &rString )
ByteString sResult;
do {
sResult = rString;
- rString.EraseLeadingChars( _LF );
- rString.EraseLeadingChars( '\t' );
+ rString = comphelper::string::stripStart(rString, _LF);
+ rString = comphelper::string::stripStart(rString, '\t');
rString.EraseTrailingChars( '\t' );
} while ( sResult != rString );
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index b9969de..1a1a5e3 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -1196,8 +1196,8 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
if( !aIStm.ReadLine( aLine ) )
break;
- aLine.EraseLeadingChars( ' ' );
- aLine.EraseLeadingChars( '\t' );
+ aLine = comphelper::string::stripStart(aLine, ' ');
+ aLine = comphelper::string::stripStart(aLine, '\t');
aLine = comphelper::string::remove(aLine, ';');
if (comphelper::string::isdigitAsciiString(aLine))
diff --git a/sc/Library_scd.mk b/sc/Library_scd.mk
index cc879c8..cff2975 100644
--- a/sc/Library_scd.mk
+++ b/sc/Library_scd.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_Library_add_api,scd,\
))
$(eval $(call gb_Library_add_linked_libs,scd,\
+ comphelper \
cppu \
cppuhelper \
sal \
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index 59ba7f1..1132a76 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/io/XInputStream.hpp>
@@ -729,7 +730,7 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream )
}
else if ( bIsXLS && bMaybeText )
{
- aHeader.EraseLeadingChars();
+ aHeader = comphelper::string::stripStart(aHeader, ' ');
if( aHeader.CompareTo( "<?xml", 5 ) == COMPARE_EQUAL )
pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilter2003XML) );
else
diff --git a/sfx2/inc/sfx2/newstyle.hxx b/sfx2/inc/sfx2/newstyle.hxx
index 22f47ee..32f30d9 100644
--- a/sfx2/inc/sfx2/newstyle.hxx
+++ b/sfx2/inc/sfx2/newstyle.hxx
@@ -28,9 +28,9 @@
#ifndef _NEWSTYLE_HXX
#define _NEWSTYLE_HXX
-#include "sal/config.h"
-#include "sfx2/dllapi.h"
-
+#include <comphelper/string.hxx>
+#include <sal/config.h>
+#include <sfx2/dllapi.h>
#include <vcl/button.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/combobox.hxx>
@@ -57,7 +57,7 @@ public:
SfxNewStyleDlg( Window* pParent, SfxStyleSheetBasePool& );
~SfxNewStyleDlg();
- String GetName() const { return aColBox.GetText().EraseLeadingChars(); }
+ String GetName() const { return comphelper::string::stripStart(aColBox.GetText(), ' '); }
};
#endif
diff --git a/svtools/bmpmaker/bmpcore.cxx b/svtools/bmpmaker/bmpcore.cxx
index d1e0964..159d6e4 100644
--- a/svtools/bmpmaker/bmpcore.cxx
+++ b/svtools/bmpmaker/bmpcore.cxx
@@ -130,8 +130,8 @@ void BmpCreator::ImplCreate( const ::std::vector< DirEntry >& rInDirs,
if( !pSRS->ReadLine( aLine ) )
break;
- aLine.EraseLeadingChars( ' ' );
- aLine.EraseLeadingChars( '\t' );
+ aLine = comphelper::string::stripStart(aLine, ' ');
+ aLine = comphelper::string::stripStart(aLine, '\t');
aLine = comphelper::string::remove(aLine, ';');
if (comphelper::string::isdigitAsciiString(aLine))
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index 5b1d23d..1d3b7ab 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -265,8 +265,8 @@ void ImageMap::ImpReadCERNLine( const rtl::OString& rLine, const String& rBaseUR
{
ByteString aStr( rLine );
- aStr.EraseLeadingChars( ' ' );
- aStr.EraseLeadingChars( '\t' );
+ aStr = comphelper::string::stripStart(aStr, ' ');
+ aStr = comphelper::string::stripStart(aStr, '\t');
aStr = comphelper::string::remove(aStr, ';');
aStr.ToLowerAscii();
@@ -408,8 +408,8 @@ void ImageMap::ImpReadNCSALine( const rtl::OString& rLine, const String& rBaseUR
{
ByteString aStr( rLine );
- aStr.EraseLeadingChars( ' ' );
- aStr.EraseLeadingChars( '\t' );
+ aStr = comphelper::string::stripStart(aStr, ' ');
+ aStr = comphelper::string::stripStart(aStr, '\t');
aStr = comphelper::string::remove(aStr, ';');
aStr.ToLowerAscii();
diff --git a/tools/bootstrp/prj.cxx b/tools/bootstrp/prj.cxx
index d6432e9..a3caf23 100644
--- a/tools/bootstrp/prj.cxx
+++ b/tools/bootstrp/prj.cxx
@@ -72,7 +72,7 @@ rtl::OString SimpleConfig::getNext()
#pragma warning (pop)
#endif
- aStringBuffer.EraseLeadingChars( '\t' );
+ aStringBuffer = comphelper::string::stripStart(aStringBuffer, '\t');
return aString;
}
diff --git a/tools/inc/tools/urlobj.hxx b/tools/inc/tools/urlobj.hxx
index 08211e9..bc792fb 100644
--- a/tools/inc/tools/urlobj.hxx
+++ b/tools/inc/tools/urlobj.hxx
@@ -157,8 +157,8 @@ public:
/** The way input strings that represent (parts of) URIs are interpreted
in set-methods.
- @descr Most set-methods accept either a ByteString or a rtl::OUString
- as input. Using a ByteString, octets in the range 0x80--0xFF are
+ @descr Most set-methods accept either a rtl::OString or a rtl::OUString
+ as input. Using a rtl::OString, octets in the range 0x80--0xFF are
replaced by single escape sequences. Using a rtl::OUString , UTF-32
characters in the range 0x80--0x10FFFF are replaced by sequences of
escape sequences, representing the UTF-8 coded characters.
@@ -271,7 +271,7 @@ public:
//========================================================================
// Strict Parsing:
- inline INetURLObject(ByteString const & rTheAbsURIRef,
+ inline INetURLObject(const rtl::OString& rTheAbsURIRef,
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
@@ -279,7 +279,7 @@ public:
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
- inline bool SetURL(ByteString const & rTheAbsURIRef,
+ inline bool SetURL(const rtl::OString& rTheAbsURIRef,
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
@@ -404,7 +404,7 @@ public:
{ m_eSmartScheme = eTheSmartScheme; }
inline bool
- SetSmartURL(ByteString const & rTheAbsURIRef,
+ SetSmartURL(const rtl::OString& rTheAbsURIRef,
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
FSysStyle eStyle = FSYS_DETECT);
@@ -416,7 +416,7 @@ public:
FSysStyle eStyle = FSYS_DETECT);
inline INetURLObject
- smartRel2Abs(ByteString const & rTheRelURIRef,
+ smartRel2Abs(const rtl::OString& rTheRelURIRef,
bool & rWasAbsolute,
bool bIgnoreFragment = false,
EncodeMechanism eMechanism = WAS_ENCODED,
@@ -437,7 +437,7 @@ public:
// Relative URLs:
inline bool
- GetNewAbsURL(ByteString const & rTheRelURIRef,
+ GetNewAbsURL(const rtl::OString& rTheRelURIRef,
INetURLObject * pTheAbsURIRef,
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
@@ -469,8 +469,8 @@ public:
FSysStyle eStyle = FSYS_DETECT);
static inline rtl::OUString
- GetRelURL(ByteString const & rTheBaseURIRef,
- ByteString const & rTheAbsURIRef,
+ GetRelURL(const rtl::OString& rTheBaseURIRef,
+ const rtl::OString& rTheAbsURIRef,
EncodeMechanism eEncodeMechanism = WAS_ENCODED,
DecodeMechanism eDecodeMechanism = DECODE_TO_IURI,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
@@ -491,7 +491,7 @@ public:
rtl_TextEncoding eCharset
= RTL_TEXTENCODING_UTF8) const;
- static inline bool translateToExternal(ByteString const & rTheIntURIRef,
+ static inline bool translateToExternal(const rtl::OString& rTheIntURIRef,
rtl::OUString & rTheExtURIRef,
DecodeMechanism eDecodeMechanism
= DECODE_TO_IURI,
@@ -505,7 +505,7 @@ public:
rtl_TextEncoding eCharset
= RTL_TEXTENCODING_UTF8);
- static inline bool translateToInternal(ByteString const & rTheExtURIRef,
+ static inline bool translateToInternal(const rtl::OString& rTheExtURIRef,
rtl::OUString & rTheIntURIRef,
DecodeMechanism eDecodeMechanism
= DECODE_TO_IURI,
@@ -534,7 +534,7 @@ public:
*/
static rtl::OUString GetScheme(INetProtocol eTheScheme);
- static inline INetProtocol CompareProtocolScheme(ByteString const &
+ static inline INetProtocol CompareProtocolScheme(const rtl::OString&
rTheAbsURIRef)
{ return CompareProtocolScheme(extend(rTheAbsURIRef)); }
@@ -559,7 +559,7 @@ public:
= RTL_TEXTENCODING_UTF8) const
{ return decode(m_aAuth, getEscapePrefix(), eMechanism, eCharset); }
- inline bool SetUser(ByteString const & rTheUser,
+ inline bool SetUser(const rtl::OString& rTheUser,
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
{ return setUser(extend(rTheUser), true, eMechanism, eCharset); }
@@ -569,7 +569,7 @@ public:
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
{ return setUser(rTheUser, false, eMechanism, eCharset); }
- inline bool SetPass(ByteString const & rThePassword,
+ inline bool SetPass(const rtl::OString& rThePassword,
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
@@ -577,8 +577,8 @@ public:
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
- inline bool SetUserAndPass(ByteString const & rTheUser,
- ByteString const & rThePassword,
+ inline bool SetUserAndPass(const rtl::OString& rTheUser,
+ const rtl:OString& rThePassword,
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset
= RTL_TEXTENCODING_UTF8);
@@ -604,7 +604,7 @@ public:
sal_uInt32 GetPort() const;
- inline bool SetHost(ByteString const & rTheHost,
+ inline bool SetHost(const rtl::OString& rTheHost,
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
{ return setHost(extend(rTheHost), true, eMechanism, eCharset); }
@@ -626,7 +626,7 @@ public:
= RTL_TEXTENCODING_UTF8) const
{ return decode(m_aPath, getEscapePrefix(), eMechanism, eCharset); }
- inline bool SetURLPath(ByteString const & rThePath,
+ inline bool SetURLPath(const rtl::OString& rThePath,
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
{ return setPath(extend(rThePath), true, eMechanism, eCharset); }
@@ -933,7 +933,7 @@ public:
= RTL_TEXTENCODING_UTF8) const
{ return decode(m_aQuery, getEscapePrefix(), eMechanism, eCharset); }
- inline bool SetParam(ByteString const & rTheQuery,
+ inline bool SetParam(const rtl::OString& rTheQuery,
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
@@ -951,7 +951,7 @@ public:
= RTL_TEXTENCODING_UTF8) const
{ return decode(m_aFragment, getEscapePrefix(), eMechanism, eCharset); }
- inline bool SetMark(ByteString const & rTheFragment,
+ inline bool SetMark(const rtl::OString& rTheFragment,
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
@@ -1073,7 +1073,7 @@ public:
@return The encoded representation of the text ('forbidden'
characters replaced by escape sequences).
*/
- static inline rtl::OUString encode(ByteString const & rText, Part ePart,
+ static inline rtl::OUString encode(const rtl::OString& rText, Part ePart,
sal_Char cEscapePrefix,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset
@@ -1190,7 +1190,7 @@ public:
rtl_TextEncoding eCharset
= RTL_TEXTENCODING_UTF8) const;
- inline bool Append(ByteString const & rTheSegment,
+ inline bool Append(const rtl::OString& rTheSegment,
EncodeMechanism eMechanism = WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8)
{ return appendSegment(extend(rTheSegment), true, eMechanism, eCharset); }
@@ -1426,7 +1426,7 @@ private:
// Coding:
- static inline rtl::OUString extend(ByteString const & rOctets)
+ static inline rtl::OUString extend(const rtl::OString& rOctets)
{
return rtl::OUString(rOctets.GetBuffer(), rOctets.Len(),
RTL_TEXTENCODING_ISO_8859_1);
@@ -1495,7 +1495,7 @@ inline rtl::OUString INetURLObject::decode(SubString const & rSubString,
rtl::OUString();
}
-inline INetURLObject::INetURLObject(ByteString const & rTheAbsURIRef,
+inline INetURLObject::INetURLObject(const rtl::OString& rTheAbsURIRef,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset):
m_eScheme(INET_PROT_NOT_VALID), m_eSmartScheme(INET_PROT_HTTP)
@@ -1513,7 +1513,7 @@ inline INetURLObject::INetURLObject(rtl::OUString const & rTheAbsURIRef,
FSysStyle(0));
}
-inline bool INetURLObject::SetURL(ByteString const & rTheAbsURIRef,
+inline bool INetURLObject::SetURL(const rtl::OString& rTheAbsURIRef,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
@@ -1539,7 +1539,7 @@ inline INetURLObject::INetURLObject(rtl::OUString const & rTheAbsURIRef,
setAbsURIRef(rTheAbsURIRef, false, eMechanism, eCharset, true, eStyle);
}
-inline bool INetURLObject::SetSmartURL(ByteString const & rTheAbsURIRef,
+inline bool INetURLObject::SetSmartURL(const rtl::OString& rTheAbsURIRef,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset,
FSysStyle eStyle)
@@ -1558,7 +1558,7 @@ inline bool INetURLObject::SetSmartURL(rtl::OUString const & rTheAbsURIRef,
}
inline INetURLObject
-INetURLObject::smartRel2Abs(ByteString const & rTheRelURIRef,
+INetURLObject::smartRel2Abs(const rtl::OString& rTheRelURIRef,
bool & rWasAbsolute,
bool bIgnoreFragment,
EncodeMechanism eMechanism,
@@ -1589,7 +1589,7 @@ INetURLObject::smartRel2Abs(rtl::OUString const & rTheRelURIRef,
return aTheAbsURIRef;
}
-inline bool INetURLObject::GetNewAbsURL(ByteString const & rTheRelURIRef,
+inline bool INetURLObject::GetNewAbsURL(const rtl::OString& rTheRelURIRef,
INetURLObject * pTheAbsURIRef,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset,
@@ -1626,8 +1626,8 @@ inline bool INetURLObject::GetNewAbsURL(rtl::OUString const & rTheRelURIRef,
}
// static
-inline rtl::OUString INetURLObject::GetRelURL(ByteString const & rTheBaseURIRef,
- ByteString const & rTheAbsURIRef,
+inline rtl::OUString INetURLObject::GetRelURL(const rtl::OString& rTheBaseURIRef,
+ const rtl::OString& rTheAbsURIRef,
EncodeMechanism eEncodeMechanism,
DecodeMechanism eDecodeMechanism,
rtl_TextEncoding eCharset,
@@ -1656,8 +1656,7 @@ inline rtl::OUString INetURLObject::GetRelURL(rtl::OUString const & rTheBaseURIR
}
// static
-inline bool INetURLObject::translateToExternal(ByteString const &
- rTheIntURIRef,
+inline bool INetURLObject::translateToExternal(const rtl::OString& rTheIntURIRef,
rtl::OUString & rTheExtURIRef,
DecodeMechanism
eDecodeMechanism,
@@ -1683,7 +1682,7 @@ inline bool INetURLObject::translateToExternal(rtl::OUString const &
}
// static
-inline bool INetURLObject::translateToInternal(ByteString const &
+inline bool INetURLObject::translateToInternal(const rtl::OString&
rTheExtURIRef,
rtl::OUString & rTheIntURIRef,
DecodeMechanism
@@ -1709,11 +1708,11 @@ inline bool INetURLObject::translateToInternal(rtl::OUString const &
eDecodeMechanism, eCharset);
}
-inline bool INetURLObject::SetPass(ByteString const & rThePassword,
+inline bool INetURLObject::SetPass(const rtl::OString& rThePassword,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
- return rThePassword.Len() == 0 ?
+ return rThePassword.isEmpty() ?
clearPassword() :
setPassword(extend(rThePassword), true, eMechanism, eCharset);
}
@@ -1722,18 +1721,18 @@ inline bool INetURLObject::SetPass(rtl::OUString const & rThePassword,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
- return rThePassword.getLength() == 0 ?
+ return rThePassword.isEmpty() ?
clearPassword() :
setPassword(rThePassword, false, eMechanism, eCharset);
}
-inline bool INetURLObject::SetUserAndPass(ByteString const & rTheUser,
- ByteString const & rThePassword,
+inline bool INetURLObject::SetUserAndPass(const rtl::OString& rTheUser,
+ const rtl::OString& rThePassword,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
return setUser(extend(rTheUser), true, eMechanism, eCharset)
- && (rThePassword.Len() == 0 ?
+ && (rThePassword.isEmpty() ?
clearPassword() :
setPassword(extend(rThePassword), true, eMechanism,
eCharset));
@@ -1745,7 +1744,7 @@ inline bool INetURLObject::SetUserAndPass(rtl::OUString const & rTheUser,
rtl_TextEncoding eCharset)
{
return setUser(rTheUser, false, eMechanism, eCharset)
- && (rThePassword.getLength() == 0 ?
+ && (rThePassword.isEmpty() ?
clearPassword() :
setPassword(rThePassword, false, eMechanism, eCharset));
}
@@ -1761,11 +1760,11 @@ inline bool INetURLObject::insertName(rtl::OUString const & rTheName,
bIgnoreFinalSlash, eMechanism, eCharset);
}
-inline bool INetURLObject::SetParam(ByteString const & rTheQuery,
+inline bool INetURLObject::SetParam(const rtl::OString& rTheQuery,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
- return rTheQuery.Len() == 0 ?
+ return rTheQuery.isEmpty() ?
clearQuery() :
setQuery(extend(rTheQuery), true, eMechanism, eCharset);
}
@@ -1774,16 +1773,16 @@ inline bool INetURLObject::SetParam(rtl::OUString const & rTheQuery,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
- return rTheQuery.getLength() == 0 ?
+ return rTheQuery.isEmpty() ?
clearQuery() :
setQuery(rTheQuery, false, eMechanism, eCharset);
}
-inline bool INetURLObject::SetMark(ByteString const & rTheFragment,
+inline bool INetURLObject::SetMark(const rtl::OString& rTheFragment,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
- return rTheFragment.Len() == 0 ?
+ return rTheFragment.isEmpty() ?
clearFragment() :
setFragment(extend(rTheFragment), true, eMechanism, eCharset);
}
@@ -1792,7 +1791,7 @@ inline bool INetURLObject::SetMark(rtl::OUString const & rTheFragment,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
{
- return rTheFragment.getLength() == 0 ?
+ return rTheFragment.isEmpty() ?
clearFragment() :
setFragment(rTheFragment, false, eMechanism, eCharset);
}
@@ -1805,7 +1804,7 @@ inline INetURLObject::INetURLObject(rtl::OUString const & rFSysPath,
}
// static
-inline rtl::OUString INetURLObject::encode(ByteString const & rText, Part ePart,
+inline rtl::OUString INetURLObject::encode(const rtl::OString& rText, Part ePart,
sal_Char cEscapePrefix,
EncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx
index 6fc8df2..a11f22d 100644
--- a/tools/source/inet/inetstrm.cxx
+++ b/tools/source/inet/inetstrm.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_tools.hxx"
+#include <comphelper/string.hxx>
#include <sal/types.h>
#include <rtl/memory.h>
#include <rtl/strbuf.hxx>
@@ -510,7 +511,7 @@ int INetMessageOStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize)
aField.Copy (0, nPos));
ByteString aValue (
aField.Copy (nPos + 1, aField.Len() - nPos + 1));
- aValue.EraseLeadingChars (' ');
+ aValue = comphelper::string::stripStart(aValue, ' ');
pTargetMsg->SetHeaderField (
INetMessageHeader (aName, aValue));
@@ -1298,8 +1299,8 @@ INetMIMEMessageStream::GetMsgEncoding (const String& rContentType)
if (rContentType.GetTokenCount ('=') > 1)
{
String aCharset (rContentType.GetToken (1, '='));
- aCharset.EraseLeadingChars (' ');
- aCharset.EraseLeadingChars ('"');
+ aCharset = comphelper::string::stripStart(aCharset, ' ');
+ aCharset = comphelper::string::stripStart(aCharset, '"');
if (aCharset.CompareIgnoreCaseToAscii ("us-ascii", 8) == 0)
return INETMSG_ENCODING_7BIT;
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 3d95034..789e57d 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -83,7 +83,8 @@
#include <valgrind/callgrind.h>
#endif
-#include "comphelper/processfactory.hxx"
+#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include "com/sun/star/beans/XMaterialHolder.hpp"
#include "com/sun/star/beans/NamedValue.hpp"
@@ -2085,9 +2086,9 @@ void PrintFontManager::initFontsAlias()
ByteString aMap = GetCommandLineToken( 1, aLine );
// remove eventual quotes
- aAlias.EraseLeadingChars( '"' );
+ aAlias = comphelper::string::stripStart(aAlias, '"');
aAlias.EraseTrailingChars( '"' );
- aMap.EraseLeadingChars( '"' );
+ aMap = comphelper::string::stripStart(aMap, '"');
aMap.EraseTrailingChars( '"' );
XLFDEntry aAliasEntry, aMapEntry;
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index 7eec1f7..e3b7970 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -34,6 +34,7 @@
#include <boost/unordered_map.hpp>
+#include <comphelper/string.hxx>
#include "vcl/ppdparser.hxx"
#include "vcl/strhelper.hxx"
#include "vcl/helper.hxx"
@@ -604,13 +605,13 @@ String PPDParser::getPPDPrinterName( const String& rFile )
if( aCurLine.CompareIgnoreCaseToAscii( "*include:", 9 ) == COMPARE_EQUAL )
{
aCurLine.Erase( 0, 9 );
- aCurLine.EraseLeadingChars( ' ' );
+ aCurLine = comphelper::string::stripStart(aCurLine, ' ');
aCurLine.EraseTrailingChars( ' ' );
- aCurLine.EraseLeadingChars( '\t' );
+ aCurLine = comphelper::string::stripStart(aCurLine, '\t');
aCurLine.EraseTrailingChars( '\t' );
aCurLine.EraseTrailingChars( '\r' );
aCurLine.EraseTrailingChars( '\n' );
- aCurLine.EraseLeadingChars( '"' );
+ aCurLine = comphelper::string::stripStart(aCurLine, '"');
aCurLine.EraseTrailingChars( '"' );
aStream.Close();
aStream.Open( getPPDFile( aCurLine ) );
@@ -703,13 +704,13 @@ PPDParser::PPDParser( const String& rFile ) :
if( aCurLine.CompareIgnoreCaseToAscii( "*include:", 9 ) == COMPARE_EQUAL )
{
aCurLine.Erase( 0, 9 );
- aCurLine.EraseLeadingChars( ' ' );
+ aCurLine = comphelper::string::stripStart(aCurLine, ' ');
aCurLine.EraseTrailingChars( ' ' );
- aCurLine.EraseLeadingChars( '\t' );
+ aCurLine = comphelper::string::stripStart(aCurLine, '\t');
aCurLine.EraseTrailingChars( '\t' );
aCurLine.EraseTrailingChars( '\r' );
aCurLine.EraseTrailingChars( '\n' );
- aCurLine.EraseLeadingChars( '"' );
+ aCurLine = comphelper::string::stripStart(aCurLine, '"');
aCurLine.EraseTrailingChars( '"' );
aStream.Close();
aStream.Open( getPPDFile( String( aCurLine, m_aFileEncoding ) ) );
More information about the Libreoffice-commits
mailing list