[Libreoffice-commits] core.git: sc/source
Julien Nabet
serval2412 at yahoo.fr
Mon May 9 08:51:29 UTC 2016
sc/source/core/data/documen2.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit a7b4a0a9f387310832cce7a6850ec438ce03b31e
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Sun Apr 24 20:54:28 2016 +0200
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 at libreoffice.org>
Tested-by: Yousuf Philips <philipz85 at hotmail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index e92b6a8..264ae65 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();
More information about the Libreoffice-commits
mailing list