summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2016-04-24 20:54:28 +0200
committerCaolán McNamara <caolanm@redhat.com>2016-05-10 08:48:10 +0000
commitc9b828dd75961e22da276471f18a3aab1b87ffbc (patch)
treec0cfcf0d7ba1bf5f706f55c8d351ebe6122d1ad7 /sc
parent7327ea0bd7a2c3876626e6b9671cbf5aa3a1ec68 (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> (cherry picked from commit a7b4a0a9f387310832cce7a6850ec438ce03b31e) Reviewed-on: https://gerrit.libreoffice.org/24792 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documen2.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index f43636393d9b..97607d4e4123 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();