From 9938cb54589680b335e75cc5fd47cd646b8a7314 Mon Sep 17 00:00:00 2001
From: Matteo Casalin <matteo.casalin@yahoo.com>
Date: Sun, 20 Apr 2014 18:34:16 +0200
Subject: OUString: use startsWith, plus minor optimization

Change-Id: I883d9c3fa1e31791dfcae73b9e551e97440db647
---
 sw/source/ui/chrdlg/chardlg.cxx | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

(limited to 'sw/source')

diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index 454440b40261..93b4eecc1b34 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -67,7 +67,7 @@ SwCharDlg::SwCharDlg(Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet,
 {
     if(pStr)
     {
-        SetText(GetText() + SW_RESSTR(STR_TEXTCOLL_HEADER) + *pStr + OUString(')'));
+        SetText(GetText() + SW_RESSTR(STR_TEXTCOLL_HEADER) + *pStr + ")");
     }
     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
     OSL_ENSURE(pFact, "Dialogdiet fail!");
@@ -238,14 +238,12 @@ void SwCharURLPage::Reset(const SfxItemSet& rSet)
 
 bool SwCharURLPage::FillItemSet(SfxItemSet& rSet)
 {
-   OUString sURL = m_pURLED->GetText();
-   if(!sURL.isEmpty())
+    OUString sURL = m_pURLED->GetText();
+    if(!sURL.isEmpty())
     {
         sURL = URIHelper::SmartRel2Abs(INetURLObject(), sURL, Link(), false );
         // #i100683# file URLs should be normalized in the UI
-        static const sal_Char* pFile = "file:";
-       sal_Int32 nLength = ((sal_Int32)sizeof(pFile)-1);
-       if( sURL.copy(0, nLength ).equalsAsciiL( pFile, nLength ))
+        if ( sURL.startsWith("file:") )
             sURL = URIHelper::simpleNormalizedMakeRelative(OUString(), sURL);
     }
 
-- 
cgit