diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-08-29 10:15:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-29 10:28:43 +0100 |
commit | 5c4b5c26b099c0655983841051b475ffa06c1e37 (patch) | |
tree | 5c1c73384a9bb0b49e17807aaca390240f517a98 /sfx2/source/doc/new.cxx | |
parent | 9cbafe9085b226d0d109fed85d67ba4e0895974e (diff) |
orig code guarded against matching on the first char
as well as not matching anywhere
Change-Id: Id4e46943189e19421b6f9fbc38d51d542d9428b6
Diffstat (limited to 'sfx2/source/doc/new.cxx')
-rw-r--r-- | sfx2/source/doc/new.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index 7b52d8cad61b..e92833a49d24 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -286,7 +286,7 @@ IMPL_LINK( SfxNewFileDialog_Impl, RegionSelect, ListBox *, pBox ) aTemplateLb.Clear(); OUString aSel = aRegionLb.GetSelectEntry(); sal_Int32 nc = aSel.indexOf('('); - if (nc != -1) + if (nc != -1 && nc != 0) aSel = aSel.replaceAt(nc-1, 1, ""); if ( aSel.compareToIgnoreAsciiCase( SfxResId(STR_STANDARD).toString() ) == 0 ) aTemplateLb.InsertEntry(aNone); @@ -374,7 +374,7 @@ sal_uInt16 SfxNewFileDialog_Impl::GetSelectedTemplatePos() const sal_uInt16 nEntry = aTemplateLb.GetSelectEntryPos(); OUString aSel = aRegionLb.GetSelectEntry(); sal_Int32 nc = aSel.indexOf('('); - if (nc!= -1) + if (nc != -1 && nc != 0) aSel = aSel.replaceAt(nc-1, 1, ""); if ( aSel.compareToIgnoreAsciiCase(SfxResId(STR_STANDARD).toString()) != 0 ) nEntry++; |