summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/uibase/app/docsh2.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 6fbae6d556ae..97982108de3a 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -1030,15 +1030,16 @@ void SwDocShell::Execute(SfxRequest& rReq)
OUString sTmpl;
aTemplateValue >>= sTmpl;
- sal_Int32 nColonPos = sTmpl.indexOf( ':' );
- OUString sPrefix = sTmpl.copy( 0, nColonPos );
- if ( sPrefix == "Style" )
+ OUString aStyle(SwResId(STR_FDLG_STYLE));
+ OUString aOutline(SwResId(STR_FDLG_OUTLINE_LEVEL));
+
+ if ( sTmpl.startsWith(aStyle) )
{
- aTemplateName = sTmpl.copy( 7 ); //get string behind "Style: "
+ aTemplateName = sTmpl.copy( aStyle.getLength() ); //get string behind "Style: "
}
- else if ( sPrefix == "Outline" )
+ else if ( sTmpl.startsWith(aOutline) )
{
- nTemplateOutlineLevel = ( sTmpl.copy( 15 )).toInt32(); //get string behind "Outline: Leve ";
+ nTemplateOutlineLevel = sTmpl.copy(aOutline.getLength()).toInt32(); //get string behind "Outline: Level ";
bCreateByOutlineLevel = true;
}