summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2022-10-02 19:51:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-10-03 15:56:33 +0200
commit07aa8138db9bbaf222f2b7cea12a9f7d0a8192d7 (patch)
tree18ae930475bbbd5f476a8c73bbd0dded8bcf6ed0
parent161e8c63a5175a634b3ddaea4314e335b290a298 (diff)
tdf#151260: crash in SfxItemPool::SetDefaults (reportdesign/ReportController)
+ deal with the case when there's no XATTR_FILLUSESLIDEBACKGROUND (like here) Change-Id: I2a4cccc80eea69aa88d45b3485d7f6d4448816e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140894 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--cui/source/tabpages/tparea.cxx7
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx44
2 files changed, 28 insertions, 23 deletions
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 119d6d154076..bbdb9733a02f 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -238,8 +238,11 @@ DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet )
{
XFillStyleItem aStyleItem( drawing::FillStyle_NONE );
_pSet->Put( aStyleItem );
- XFillUseSlideBackgroundItem aFillBgItem( false );
- _pSet->Put( aFillBgItem );
+ if (_pSet->HasItem(XATTR_FILLUSESLIDEBACKGROUND))
+ {
+ XFillUseSlideBackgroundItem aFillBgItem( false );
+ _pSet->Put( aFillBgItem );
+ }
}
break;
}
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 59bc64749bac..38034ffb81f0 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -150,7 +150,9 @@
#define RPTUI_ID_START XATTR_FILL_FIRST - 3
#define RPTUI_ID_END XATTR_FILL_FIRST - 2
#define RPTUI_ID_BRUSH TypedWhichId<SvxBrushItem>(XATTR_FILL_FIRST - 1)
-#define RPTUI_ID_METRIC XATTR_FILL_LAST + 1
+/// Note that we deliberately overlap an existing item id, so that we can have contiguous item ids for
+/// the static defaults.
+#define RPTUI_ID_METRIC XATTR_FILL_LAST
using namespace ::com::sun::star;
using namespace uno;
@@ -2336,26 +2338,26 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
{ SID_PAPER_START, true },
{ SID_PAPER_END, true },
{ SID_ATTR_BRUSH, true },
- { XATTR_FILLSTYLE, true },
- { XATTR_FILLCOLOR, true },
- { XATTR_FILLGRADIENT, true },
- { XATTR_FILLHATCH, true },
- { XATTR_FILLBITMAP, true },
- { XATTR_FILLTRANSPARENCE, true },
- { XATTR_GRADIENTSTEPCOUNT, true },
- { XATTR_FILLBMP_TILE, true },
- { XATTR_FILLBMP_POS, true },
- { XATTR_FILLBMP_SIZEX, true },
- { XATTR_FILLBMP_SIZEY, true },
- { XATTR_FILLFLOATTRANSPARENCE, true },
- { XATTR_SECONDARYFILLCOLOR, true },
- { XATTR_FILLBMP_SIZELOG, true },
- { XATTR_FILLBMP_TILEOFFSETX, true },
- { XATTR_FILLBMP_TILEOFFSETY, true },
- { XATTR_FILLBMP_STRETCH, true },
- { XATTR_FILLBMP_POSOFFSETX, true },
- { XATTR_FILLBMP_POSOFFSETY, true },
- { XATTR_FILLBACKGROUND, true },
+ { 0, true }, // XATTR_FILLSTYLE
+ { 0, true }, // XATTR_FILLCOLOR
+ { 0, true }, // XATTR_FILLGRADIENT
+ { 0, true }, // XATTR_FILLHATCH
+ { 0, true }, // XATTR_FILLBITMAP
+ { 0, true }, // XATTR_FILLTRANSPARENCE
+ { 0, true }, // XATTR_GRADIENTSTEPCOUNT
+ { 0, true }, // XATTR_FILLBMP_TILE
+ { 0, true }, // XATTR_FILLBMP_POS
+ { 0, true }, // XATTR_FILLBMP_SIZEX
+ { 0, true }, // XATTR_FILLBMP_SIZEY
+ { 0, true }, // XATTR_FILLFLOATTRANSPARENCE
+ { 0, true }, // XATTR_SECONDARYFILLCOLOR
+ { 0, true }, // XATTR_FILLBMP_SIZELOG
+ { 0, true }, // XATTR_FILLBMP_TILEOFFSETX
+ { 0, true }, // XATTR_FILLBMP_TILEOFFSETY
+ { 0, true }, // XATTR_FILLBMP_STRETCH
+ { 0, true }, // XATTR_FILLBMP_POSOFFSETX
+ { 0, true }, // XATTR_FILLBMP_POSOFFSETY
+ { 0, true }, // XATTR_FILLBACKGROUND
{ SID_ATTR_METRIC, true }
};