diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2016-04-24 20:54:28 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-05-09 08:51:03 +0000 |
commit | a7b4a0a9f387310832cce7a6850ec438ce03b31e (patch) | |
tree | ddff6e70de6fcc8709646ff0c63f1fe6fef534a7 /sc/source | |
parent | bcb41235deaf4b7ca90522bda3ba21a686819e6e (diff) |
tdf#99479: Delete column with styles resets the 'Apply Style' drop down
To start, the problem appears in SvxStyleToolBoxControl::FillStyleBox()
pStyleSheetPool->First() returns null to pStyle because pStyleSheetPool is empty so we don't enter in while ( pStyle )
and can't add non default styles
So why pStyleSheetPool is empty?
pStyleSheetPool comes from pPool (SvxStyleToolBoxControl::Update()),
pPool is retrieved from pDocShell->GetStyleSheetPool() (=> static_cast<SfxStyleSheetBasePool*>(aDocument.GetStyleSheetPool()))
which is retrieved from xPoolHelper->GetStylePool(); ScDocument::GetStyleSheetPool()
Let's move on, why xPoolHelper is empty?
it's because when we delete the column, it does this:
0 ScPoolHelper::SourceDocumentGone (this=0x2c006c0) at /home/julien/lo/libreoffice/sc/source/core/data/poolhelp.cxx:116
1 0x00002aaad4e28eae in ScDocument::~ScDocument (this=0x8d6ac40, __in_chrg=<optimized out>) at /home/julien/lo/libreoffice/sc/source/core/data/documen2.cxx:426
2 0x00002aaad57a85f8 in ScDocFunc::DeleteCells (this=0x2c04bb0, rRange=..., pTabMark=0x3231ad0, eCmd=DEL_DELCOLS, bApi=false)
at /home/julien/lo/libreoffice/sc/source/ui/docshell/docfunc.cxx:2415
3 0x00002aaad5cfa0f3 in ScViewFunc::DeleteCells (this=0x3230fd8, eCmd=DEL_DELCOLS) at /home/julien/lo/libreoffice/sc/source/ui/view/viewfunc.cxx:1512
But calling delete on pRefUndoDoc shouldn't call SourceDocumentGone since it's been created as a ScDocument with SCDOCMODE_UNDO eMode
not with "SCDOCMODE_DOCUMENT" eMode. Since xPoolHelper is instantiated when only "SCDOCMODE_DOCUMENT" eMode
(see http://opengrok.libreoffice.org/xref/core/sc/source/core/data/documen2.cxx#224),
only destructor call of a document with eMode "SCDOCMODE_DOCUMENT" should be able to destroy xPoolHelper
So the fix is only to call PoolHelper->SourceDocumentGone(); when (xPoolHelper.is() && !bIsClip) but also if !bIsUndo
Change-Id: I1089d20264d0594c7e8ebe9263ebad6e68485c12
Reviewed-on: https://gerrit.libreoffice.org/24345
Tested-by: Jenkins <ci@libreoffice.org>
Tested-by: Yousuf Philips <philipz85@hotmail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/documen2.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index e92b6a8df847..264ae650b218 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -422,7 +422,7 @@ ScDocument::~ScDocument() // delete the EditEngine before destroying the xPoolHelper delete pCacheFieldEditEngine; - if ( xPoolHelper.is() && !bIsClip ) + if ( xPoolHelper.is() && !bIsClip && !bIsUndo) xPoolHelper->SourceDocumentGone(); xPoolHelper.clear(); |