From 4111ed76906bf6be05b704bf52fa91353dfef183 Mon Sep 17 00:00:00 2001 From: Srijan Bhatia Date: Tue, 2 Jun 2020 18:09:20 +0530 Subject: tdf#132137 Rename Default Style in Calc. Change-Id: I0f7c5ffc64b2387fbb63bb5724594480d3135f58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95484 Tested-by: Jenkins Reviewed-by: Heiko Tietze --- sc/source/core/data/stlpool.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'sc/source/core/data/stlpool.cxx') diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index 9dc911258d68..7d3da5eb3e0d 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -83,7 +83,10 @@ SfxStyleSheetBase& ScStyleSheetPool::Make( const OUString& rName, sal_uInt32 nCount = GetIndexedStyleSheets().GetNumberOfStyleSheets(); for ( sal_uInt32 nAdd = 1; nAdd <= nCount; nAdd++ ) { - OUString aNewName = ScResId(STR_STYLENAME_STANDARD) + OUString::number( nAdd ); + OUString aNewName = ScResId(STR_STYLENAME_STANDARD_CELL) + OUString::number( nAdd ); + if ( Find( aNewName, eFam ) == nullptr ) + return SfxStyleSheetPool::Make(aNewName, eFam, mask); + aNewName = ScResId(STR_STYLENAME_STANDARD_PAGE) + OUString::number( nAdd ); if ( Find( aNewName, eFam ) == nullptr ) return SfxStyleSheetPool::Make(aNewName, eFam, mask); } @@ -96,8 +99,8 @@ SfxStyleSheetBase* ScStyleSheetPool::Create( const OUString& rName, SfxStyleSearchBits nMaskP ) { ScStyleSheet* pSheet = new ScStyleSheet( rName, *this, eFamily, nMaskP ); - if ( eFamily == SfxStyleFamily::Para && ScResId(STR_STYLENAME_STANDARD) != rName ) - pSheet->SetParent( ScResId(STR_STYLENAME_STANDARD) ); + if ( eFamily == SfxStyleFamily::Para && ScResId(STR_STYLENAME_STANDARD_CELL) != rName ) + pSheet->SetParent( ScResId(STR_STYLENAME_STANDARD_CELL) ); return pSheet; } @@ -182,8 +185,8 @@ void ScStyleSheetPool::CopyStdStylesFrom( ScStyleSheetPool* pSrcPool ) { // Copy Default styles - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_STANDARD), SfxStyleFamily::Para ); - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_STANDARD), SfxStyleFamily::Page ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_STANDARD_CELL), SfxStyleFamily::Para ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_STANDARD_PAGE), SfxStyleFamily::Page ); CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_REPORT), SfxStyleFamily::Page ); } @@ -224,7 +227,7 @@ void ScStyleSheetPool::CreateStandardStyles() SvxBoxItem aBoxItem ( ATTR_BORDER ); SvxBoxInfoItem aBoxInfoItem ( ATTR_BORDER_INNER ); - OUString aStrStandard = ScResId(STR_STYLENAME_STANDARD); + OUString aStrStandard = ScResId(STR_STYLENAME_STANDARD_CELL); // Cell format templates: @@ -259,6 +262,7 @@ void ScStyleSheetPool::CreateStandardStyles() // if ( eCtl == LANGUAGE_THAI ) // pSet->Put( SvxFontHeightItem( 300, 100, ATTR_CTL_FONT_HEIGHT ) ); // 15 pt + aStrStandard = ScResId(STR_STYLENAME_STANDARD_PAGE); // Page format template: -- cgit v1.2.3