summaryrefslogtreecommitdiff
path: root/sc/source/core/data/stlsheet.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-04-07 16:28:08 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-04-07 23:03:17 +0200
commitddcc2ae791b3e5dcb80fa9eebc59879d927646b0 (patch)
treed5013fb7c2f382d14f35717aebd08b590793295b /sc/source/core/data/stlsheet.cxx
parentbcf91144808232fa0d92184d2f1c09e5eaa1e86c (diff)
Avoid -fsanitize=null
...during CppunitTest_sd_filters_test (see below), where SfxStyleSheetBase::m_pPool has apparently been null'ed in SdStyleSheet::disposing (sd/source/core/stlsheet.cxx). Presumably introduced with dfefe448c41921f2f1e54d3f69b8b9e89031d055 "SOSAW080: Added first bunch of basic changes to helpers"; adding a "TTTT" marker on alg_'s request. Needed to change SfxStyleSheetBase::GetPool to return pointer instead of ref. > include/svl/style.hxx:142:47: runtime error: reference binding to null pointer of type 'SfxStyleSheetBasePool' > #0 in SfxStyleSheetBase::GetPool() at include/svl/style.hxx:142:40 (instdir/program/libsvxcorelo.so +0x2d7a3ed) > #1 in sdr::properties::AttributeProperties::ImpRemoveStyleSheet() at svx/source/sdr/properties/attributeproperties.cxx:136:44 (instdir/program/libsvxcorelo.so +0x2d72f40) > #2 in sdr::properties::AttributeProperties::Notify(SfxBroadcaster&, SfxHint const&) at svx/source/sdr/properties/attributeproperties.cxx:474:25 (instdir/program/libsvxcorelo.so +0x2d793ec) > #3 in sdr::properties::TextProperties::Notify(SfxBroadcaster&, SfxHint const&) at svx/source/sdr/properties/textproperties.cxx:542:34 (instdir/program/libsvxcorelo.so +0x2d631f2) > #4 in SfxBroadcaster::Broadcast(SfxHint const&) at svl/source/notify/SfxBroadcaster.cxx:49:24 (instdir/program/libsvllo.so +0xc2d628) > #5 in (anonymous namespace)::StyleSheetDisposerFunctor::Dispose(rtl::Reference<SfxStyleSheetBase>) at svl/source/items/style.cxx:804:16 (instdir/program/libsvllo.so +0x99e4ef) > #6 in svl::IndexedStyleSheets::Clear(svl::StyleSheetDisposer&) at svl/source/items/IndexedStyleSheets.cxx:202:18 (instdir/program/libsvllo.so +0x8bb852) > #7 in SfxStyleSheetBasePool::Clear() at svl/source/items/style.cxx:815:34 (instdir/program/libsvllo.so +0x9965ea) > #8 in SdStyleSheetPool::dispose() at sd/source/core/stlpool.cxx:1386:9 (instdir/program/libsdlo.so +0x25353a7) > #9 in SdrModel::~SdrModel() at svx/source/svdraw/svdmodel.cxx:275:25 (instdir/program/libsvxcorelo.so +0x323f1ad) > #10 in FmFormModel::~FmFormModel() at svx/source/form/fmmodel.cxx:94:1 (instdir/program/libsvxcorelo.so +0x465f020) > #11 in SdDrawDocument::~SdDrawDocument() at sd/source/core/drawdoc.cxx:394:1 (instdir/program/libsdlo.so +0x2324254) > #12 in SdDrawDocument::~SdDrawDocument() at sd/source/core/drawdoc.cxx:346:1 (instdir/program/libsdlo.so +0x2324445) > #13 in SdDrawDocument::~SdDrawDocument() at sd/source/core/drawdoc.cxx:346:1 (instdir/program/libsdlo.so +0x23244ce) > #14 in sd::DrawDocShell::~DrawDocShell() at sd/source/ui/docshell/docshell.cxx:200:9 (instdir/program/libsdlo.so +0x2c4bdb9) > #15 in sd::DrawDocShell::~DrawDocShell() at sd/source/ui/docshell/docshell.cxx:179:1 (instdir/program/libsdlo.so +0x2c4c4a5) > #16 in sd::DrawDocShell::~DrawDocShell() at sd/source/ui/docshell/docshell.cxx:179:1 (instdir/program/libsdlo.so +0x2c4c56e) > #17 in SvRefBase::ReleaseRef() at include/tools/ref.hxx:165:29 (workdir/LinkTarget/CppunitTest/libtest_sd_filters_test.so +0x1ff01) > #18 in tools::SvRef<sd::DrawDocShell>::~SvRef() at include/tools/ref.hxx:56:36 (workdir/LinkTarget/CppunitTest/libtest_sd_filters_test.so +0x1a9fc) > #19 in SdFiltersTest::load(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) at sd/qa/unit/filters-test.cxx:78:1 (workdir/LinkTarget/CppunitTest/libtest_sd_filters_test.so +0x17f53) > #20 in test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) at unotest/source/cpp/filters-test.cxx:130:20 (workdir/LinkTarget/CppunitTest/../Library/libunotest.so +0x5589c) > #21 in test::FiltersTest::testDir(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) at unotest/source/cpp/filters-test.cxx:155:5 (workdir/LinkTarget/CppunitTest/../Library/libunotest.so +0x56519) > #22 in SdFiltersTest::testCVEs() at sd/qa/unit/filters-test.cxx:83:5 (workdir/LinkTarget/CppunitTest/libtest_sd_filters_test.so +0x1839d) Change-Id: Ibf61c18738c7a204ebf2bbc85b28930481b22612 Reviewed-on: https://gerrit.libreoffice.org/52554 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc/source/core/data/stlsheet.cxx')
-rw-r--r--sc/source/core/data/stlsheet.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index 596a703b5c5f..f57939773372 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -113,7 +113,7 @@ bool ScStyleSheet::SetParent( const OUString& rParentName )
// #i113491# Drag&Drop in the stylist's hierarchical view doesn't execute a slot,
// so the repaint has to come from here (after modifying the ItemSet).
// RepaintRange checks the document's IsVisible flag and locked repaints.
- ScDocument* pDoc = static_cast<ScStyleSheetPool&>(GetPool()).GetDocument();
+ ScDocument* pDoc = static_cast<ScStyleSheetPool*>(GetPool())->GetDocument();
if (pDoc)
pDoc->RepaintRange( ScRange( 0,0,0, MAXCOL,MAXROW,MAXTAB ) );
}
@@ -139,7 +139,7 @@ SfxItemSet& ScStyleSheet::GetItemSet()
// therefore suitable values are set at this point.
// (== Standard page template)
- SfxItemPool& rItemPool = GetPool().GetPool();
+ SfxItemPool& rItemPool = GetPool()->GetPool();
pSet = new SfxItemSet(
rItemPool,
svl::Items<
@@ -154,7 +154,7 @@ SfxItemSet& ScStyleSheet::GetItemSet()
// GetPrinter would then also create a new printer,
// because the stored Printer is not loaded yet!
- ScDocument* pDoc = static_cast<ScStyleSheetPool&>(GetPool()).GetDocument();
+ ScDocument* pDoc = static_cast<ScStyleSheetPool*>(GetPool())->GetDocument();
if ( pDoc )
{
// Setting reasonable default values:
@@ -224,7 +224,7 @@ SfxItemSet& ScStyleSheet::GetItemSet()
case SfxStyleFamily::Para:
default:
- pSet = new SfxItemSet( GetPool().GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
+ pSet = new SfxItemSet( GetPool()->GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
break;
}
bMySet = true;
@@ -237,7 +237,7 @@ SfxItemSet& ScStyleSheet::GetItemSet()
// ~ScStyleSheetPool -> ~SfxStyleSheetPool, GetPool() is no longer
// an ScStyleSheetPool:
ScStyleSheetPool * pool = dynamic_cast<ScStyleSheetPool *>(
- &GetPool());
+ GetPool());
if (pool != nullptr) {
ScDocument* pDoc = pool->GetDocument();
if ( pDoc )