Kaydet (Commit) 9938cb54 authored tarafından Matteo Casalin's avatar Matteo Casalin

OUString: use startsWith, plus minor optimization

Change-Id: I883d9c3fa1e31791dfcae73b9e551e97440db647
üst e6ad7c39
...@@ -67,7 +67,7 @@ SwCharDlg::SwCharDlg(Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet, ...@@ -67,7 +67,7 @@ SwCharDlg::SwCharDlg(Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet,
{ {
if(pStr) if(pStr)
{ {
SetText(GetText() + SW_RESSTR(STR_TEXTCOLL_HEADER) + *pStr + OUString(')')); SetText(GetText() + SW_RESSTR(STR_TEXTCOLL_HEADER) + *pStr + ")");
} }
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!"); OSL_ENSURE(pFact, "Dialogdiet fail!");
...@@ -238,14 +238,12 @@ void SwCharURLPage::Reset(const SfxItemSet& rSet) ...@@ -238,14 +238,12 @@ void SwCharURLPage::Reset(const SfxItemSet& rSet)
bool SwCharURLPage::FillItemSet(SfxItemSet& rSet) bool SwCharURLPage::FillItemSet(SfxItemSet& rSet)
{ {
OUString sURL = m_pURLED->GetText(); OUString sURL = m_pURLED->GetText();
if(!sURL.isEmpty()) if(!sURL.isEmpty())
{ {
sURL = URIHelper::SmartRel2Abs(INetURLObject(), sURL, Link(), false ); sURL = URIHelper::SmartRel2Abs(INetURLObject(), sURL, Link(), false );
// #i100683# file URLs should be normalized in the UI // #i100683# file URLs should be normalized in the UI
static const sal_Char* pFile = "file:"; if ( sURL.startsWith("file:") )
sal_Int32 nLength = ((sal_Int32)sizeof(pFile)-1);
if( sURL.copy(0, nLength ).equalsAsciiL( pFile, nLength ))
sURL = URIHelper::simpleNormalizedMakeRelative(OUString(), sURL); sURL = URIHelper::simpleNormalizedMakeRelative(OUString(), sURL);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment