From 2ae89f59fdad8ac5a98ce02ea31cbe55a5048c43 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Tue, 19 May 2015 04:53:07 +0200 Subject: don't use default style as parent for OOXML cond format style, tdf#91335 Change-Id: I1388bb5ab71f6f6d174872023f085240f3bff916 --- sc/inc/stlsheet.hxx | 3 +++ sc/source/core/data/stlsheet.cxx | 5 +++++ sc/source/filter/oox/stylesbuffer.cxx | 7 +++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sc/inc/stlsheet.hxx b/sc/inc/stlsheet.hxx index cb65a01028bb..6bfcfd595e9d 100644 --- a/sc/inc/stlsheet.hxx +++ b/sc/inc/stlsheet.hxx @@ -22,6 +22,8 @@ #include +#include "scdllapi.h" + #define SCSTYLEBIT_STANDARD 0x0001 class ScStyleSheetPool; @@ -48,6 +50,7 @@ public: ScStyleSheet( const ScStyleSheet& rStyle ); virtual bool SetParent ( const OUString& rParentName ) SAL_OVERRIDE; + SC_DLLPUBLIC void ResetParent(); virtual SfxItemSet& GetItemSet () SAL_OVERRIDE; virtual bool IsUsed () const SAL_OVERRIDE; virtual bool HasFollowSupport () const SAL_OVERRIDE; diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx index 5d278ff1b8f4..be060c284ad6 100644 --- a/sc/source/core/data/stlsheet.cxx +++ b/sc/source/core/data/stlsheet.cxx @@ -121,6 +121,11 @@ bool ScStyleSheet::SetParent( const OUString& rParentName ) return bResult; } +void ScStyleSheet::ResetParent() +{ + GetItemSet().SetParent(NULL); +} + SfxItemSet& ScStyleSheet::GetItemSet() { if ( !pSet ) diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index 5e73b6856359..598ea497e311 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -3117,9 +3117,12 @@ OUString StylesBuffer::createDxfStyle( sal_Int32 nDxfId ) const // Create a cell style. This may overwrite an existing style if // one with the same name exists. + ScStyleSheet& rStyleSheet = ScfTools::MakeCellStyleSheet( + *getScDocument().GetStyleSheetPool(), rStyleName, true); + + rStyleSheet.ResetParent(); SfxItemSet& rStyleItemSet = - ScfTools::MakeCellStyleSheet( - *getScDocument().GetStyleSheetPool(), rStyleName, true).GetItemSet(); + rStyleSheet.GetItemSet(); pDxf->fillToItemSet(rStyleItemSet); } -- cgit