summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-05-22 10:00:34 +0100
committerAndras Timar <andras.timar@collabora.com>2014-02-24 02:33:03 -0800
commit089876810db8bceedfdb0eee8711b3e9ae27b4d2 (patch)
treedfb054051af11fd40cc5591e1f4387348473904e /sc
parent364682a19713169b374d949d0fc34d105a2be5d4 (diff)
fix for bnc#819865 itemstate in parent style incorrectly reported as set
Problem occurs because attrs set with default values are reported as set when queried Change-Id: I89d6c3b09312fb78052d87ff20aa12c6fbe7bc98 (cherry picked from commit bf8e9b29aaebcbdd8f2f06b42ac97b8d9f8f4503) Signed-off-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/oox/numberformatsbuffer.cxx2
-rw-r--r--sc/source/filter/oox/stylesbuffer.cxx25
2 files changed, 12 insertions, 15 deletions
diff --git a/sc/source/filter/oox/numberformatsbuffer.cxx b/sc/source/filter/oox/numberformatsbuffer.cxx
index d512e3eea095..5b3a98c90c1b 100644
--- a/sc/source/filter/oox/numberformatsbuffer.cxx
+++ b/sc/source/filter/oox/numberformatsbuffer.cxx
@@ -2053,7 +2053,7 @@ void NumberFormatsBuffer::insertBuiltinFormats()
{
// do not put the current system locale for default table
Locale aLocale;
- if( (*aVIt)->mpcLocale[ 0 ] != '\0' )
+ if( (*aVIt)->mpcParent[ 0 ] != '\0' )
aLocale = aSysLocale;
for( const BuiltinFormat* pBuiltin = (*aVIt)->mpFormats; pBuiltin && (pBuiltin->mnNumFmtId >= 0); ++pBuiltin )
{
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index ba102a91ec2c..48e48ca9e287 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -2260,7 +2260,6 @@ void Xf::finalizeImport()
// alignment and protection
maAlignment.finalizeImport();
maProtection.finalizeImport();
- createPattern();
}
FontRef Xf::getFont() const
@@ -2421,8 +2420,12 @@ Xf::createPattern( bool bSkipPoolDefs )
StylesBuffer& rStyles = getStyles();
const Xf* pStyleXf = isCellXf() ? rStyles.getStyleXf( maModel.mnStyleXfId ).get() : 0;
- if( pStyleXf )
+ if( pStyleXf && !mpStyleSheet )
{
+ rStyles.createCellStyle( maModel.mnStyleXfId );
+ mpStyleSheet = rStyles.getCellStyleSheet( maModel.mnStyleXfId );
+ OSL_ENSURE( mpStyleSheet, "Xf::createPattern - no parentStyle created" );
+
const XfModel& rStyleData = pStyleXf->maModel;
if( !maModel.mbFontUsed )
maModel.mbFontUsed = !rStyleData.mbFontUsed || (maModel.mnFontId != rStyleData.mnFontId);
@@ -2802,8 +2805,13 @@ void CellStyle::createCellStyle()
{
// #i1624# #i1768# ignore unnamed user styles
+ bool bDefStyle = maModel.isDefaultStyle();
if( !mbCreated )
+ {
+ if ( bDefStyle && maFinalName.isEmpty() )
+ maFinalName = ScGlobal::GetRscString( STR_STYLENAME_STANDARD );
mbCreated = maFinalName.isEmpty();
+ }
if( !mbCreated && !mpStyleSheet )
{
@@ -2811,12 +2819,11 @@ void CellStyle::createCellStyle()
Xf* pXF = getStyles().getStyleXf( maModel.mnXfId ).get();
::ScDocument& rDoc = getScDocument();
- bool bDefStyle = maModel.isDefaultStyle();
if( bDefStyle )
{
// use existing "Default" style sheet
mpStyleSheet = static_cast< ScStyleSheet* >( static_cast< ScStyleSheetPool* >( rDoc.GetStyleSheetPool() )->Find(
- getStyles().getDefaultStyleName(), SFX_STYLE_FAMILY_PARA ) );
+ ScGlobal::GetRscString( STR_STYLENAME_STANDARD ), SFX_STYLE_FAMILY_PARA ) );
OSL_ENSURE( mpStyleSheet, "CellStyle::createStyle - Default style not found" );
bCreatePattern = true;
}
@@ -2952,16 +2959,6 @@ void CellStyleBuffer::finalizeImport()
// set final names and create user-defined and modified built-in cell styles
aCellStyles.forEachMemWithKey( &CellStyle::finalizeImport );
-
- if (mxDefStyle)
- {
- Reference<XNameAccess> xNA(getStyleFamily(false), UNO_QUERY_THROW);
- if (xNA->hasByName("Default"))
- {
- PropertySet aPropSet(xNA->getByName("Default"));
- getStyles().writeStyleXfToPropertySet(aPropSet, mxDefStyle->getModel().mnXfId);
- }
- }
}
sal_Int32 CellStyleBuffer::getDefaultXfId() const