Kaydet (Commit) 5c4b5c26 authored tarafından Caolán McNamara's avatar Caolán McNamara

orig code guarded against matching on the first char

as well as not matching anywhere

Change-Id: Id4e46943189e19421b6f9fbc38d51d542d9428b6
üst 9cbafe90
...@@ -286,7 +286,7 @@ IMPL_LINK( SfxNewFileDialog_Impl, RegionSelect, ListBox *, pBox ) ...@@ -286,7 +286,7 @@ IMPL_LINK( SfxNewFileDialog_Impl, RegionSelect, ListBox *, pBox )
aTemplateLb.Clear(); aTemplateLb.Clear();
OUString aSel = aRegionLb.GetSelectEntry(); OUString aSel = aRegionLb.GetSelectEntry();
sal_Int32 nc = aSel.indexOf('('); sal_Int32 nc = aSel.indexOf('(');
if (nc != -1) if (nc != -1 && nc != 0)
aSel = aSel.replaceAt(nc-1, 1, ""); aSel = aSel.replaceAt(nc-1, 1, "");
if ( aSel.compareToIgnoreAsciiCase( SfxResId(STR_STANDARD).toString() ) == 0 ) if ( aSel.compareToIgnoreAsciiCase( SfxResId(STR_STANDARD).toString() ) == 0 )
aTemplateLb.InsertEntry(aNone); aTemplateLb.InsertEntry(aNone);
...@@ -374,7 +374,7 @@ sal_uInt16 SfxNewFileDialog_Impl::GetSelectedTemplatePos() const ...@@ -374,7 +374,7 @@ sal_uInt16 SfxNewFileDialog_Impl::GetSelectedTemplatePos() const
sal_uInt16 nEntry = aTemplateLb.GetSelectEntryPos(); sal_uInt16 nEntry = aTemplateLb.GetSelectEntryPos();
OUString aSel = aRegionLb.GetSelectEntry(); OUString aSel = aRegionLb.GetSelectEntry();
sal_Int32 nc = aSel.indexOf('('); sal_Int32 nc = aSel.indexOf('(');
if (nc!= -1) if (nc != -1 && nc != 0)
aSel = aSel.replaceAt(nc-1, 1, ""); aSel = aSel.replaceAt(nc-1, 1, "");
if ( aSel.compareToIgnoreAsciiCase(SfxResId(STR_STANDARD).toString()) != 0 ) if ( aSel.compareToIgnoreAsciiCase(SfxResId(STR_STANDARD).toString()) != 0 )
nEntry++; nEntry++;
......
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