diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2021-03-16 20:10:18 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-03-25 09:49:33 +0100 |
commit | 56d8007a197b095b09423c691a51515567648e80 (patch) | |
tree | 63ce068e98e368587e57e5e686dc09a27bd9ec74 /xmloff/source | |
parent | 473f2dec087288309cb169bf84c12124e1d7d7d1 (diff) |
* add BackgroundFullSize property to PageProperties
* add a checkbox on the SvxPageDescPage
* marshal the item via SfxGrabBagItem to avoid changing svxids.hrc
* add RES_BACKGROUND_FULL_SIZE item, pool default is "true" which is
appropriate for Word import filters
* ODF export: remove hard-coded export in
XMLPageMasterExportPropMapper::ContextFilter()
* use it in SwFrame::PaintSwFrameBackground()
* fix painting of bitmaps by also using the page frame area in
SwFrame::GetBackgroundBrush(), which was the reason why
f006b6339e20af6a3fbd60d97d21590d4ebf5021 painted things inconsistently
* force repaint in lcl_DescSetAttr()/SwFrame::UpdateAttrFrame()
Change-Id: I4cb64f87c01d17c051936e9b8128395fbb8b4fe5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112594
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/style/PageMasterExportPropMapper.cxx | 61 | ||||
-rw-r--r-- | xmloff/source/style/PageMasterStyleMap.cxx | 3 |
2 files changed, 1 insertions, 63 deletions
diff --git a/xmloff/source/style/PageMasterExportPropMapper.cxx b/xmloff/source/style/PageMasterExportPropMapper.cxx index 2f1a5df943e4..4ef4de901eb0 100644 --- a/xmloff/source/style/PageMasterExportPropMapper.cxx +++ b/xmloff/source/style/PageMasterExportPropMapper.cxx @@ -24,8 +24,6 @@ #include <comphelper/types.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/table/BorderLine2.hpp> -#include <com/sun/star/drawing/FillStyle.hpp> -#include <com/sun/star/drawing/BitmapMode.hpp> #include <PageMasterStyleMap.hxx> #include <rtl/ref.hxx> #include <comphelper/extract.hxx> @@ -331,9 +329,6 @@ void XMLPageMasterExportPropMapper::ContextFilter( XMLPropertyState* pFooterRepeatOffsetX = nullptr; XMLPropertyState* pFooterRepeatOffsetY = nullptr; - XMLPropertyState* pFill = nullptr; - XMLPropertyState* pFillBitmapMode = nullptr; - rtl::Reference < XMLPropertySetMapper > aPropMapper(getPropertySetMapper()); // distinguish 2 cases: drawing-page export has CTF_PM_FILL, page-layout-properties export does not @@ -372,20 +367,6 @@ void XMLPageMasterExportPropMapper::ContextFilter( switch( nSimpleId ) { - case CTF_PM_FILL: // tdf#103602: add background-size attribute to ODT - if (nFlag != CTF_PM_HEADERFLAG && nFlag != CTF_PM_FOOTERFLAG - && rProp.maValue.hasValue()) - { - pFill = &rProp; - } - break; - case CTF_PM_FILLBITMAPMODE: - if (nFlag != CTF_PM_HEADERFLAG && nFlag != CTF_PM_FOOTERFLAG - && rProp.maValue.hasValue()) - { - pFillBitmapMode = &rProp; - } - break; case CTF_PM_MARGINALL: pBuffer->pPMMarginAll = pProp; break; case CTF_PM_BORDERALL: pBuffer->pPMBorderAll = pProp; break; case CTF_PM_BORDERTOP: pBuffer->pPMBorderTop = pProp; break; @@ -582,48 +563,6 @@ void XMLPageMasterExportPropMapper::ContextFilter( lcl_AddState(rPropState, aPropMapper->FindEntryIndex(CTF_PM_PRINT_ZEROVALUES), "PrintZeroValues", rPropSet); } - if (pFill) - { // note: only drawing-page export should write this, because CTF_PM_FILL - uno::Any backgroundSize; - switch (pFill->maValue.get<drawing::FillStyle>()) - { - case drawing::FillStyle_NONE: - break; - case drawing::FillStyle_SOLID: - case drawing::FillStyle_GRADIENT: - case drawing::FillStyle_HATCH: - backgroundSize <<= true; - break; - case drawing::FillStyle_BITMAP: - if (pFillBitmapMode) - { - switch (pFillBitmapMode->maValue.get<drawing::BitmapMode>()) - { - case drawing::BitmapMode_REPEAT: - backgroundSize <<= true; - break; - case drawing::BitmapMode_STRETCH: - case drawing::BitmapMode_NO_REPEAT: - backgroundSize <<= false; - break; - default: - assert(false); - } - } - // else: leave it ambiguous if not explicitly defined - break; - default: - assert(false); - } - - if (backgroundSize.hasValue()) - { - auto const nIndex(aPropMapper->FindEntryIndex(CTF_PM_BACKGROUNDSIZE)); - assert(0 <= nIndex); - rPropState.emplace_back(nIndex, backgroundSize); - } - } - SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily, rPropState, rPropSet); } diff --git a/xmloff/source/style/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx index d7b9f41e8f02..754c7d284baf 100644 --- a/xmloff/source/style/PageMasterStyleMap.cxx +++ b/xmloff/source/style/PageMasterStyleMap.cxx @@ -277,8 +277,7 @@ XMLPropertyMapEntry const g_XMLPageMasterDrawingPageStyleMap[] = // ODF 1.3 OFFICE-3937 style of family "drawing-page" referenced from style:master-page // duplication of relevant part of aXMLPageMasterStyleMap but as DP type DPMAP("FillStyle", XML_NAMESPACE_DRAW, XML_FILL, XML_SW_TYPE_FILLSTYLE, CTF_PM_FILL), - // this does not exist yet! - DPMAP("BackgroundFullSize", XML_NAMESPACE_DRAW, XML_BACKGROUND_SIZE, XML_SW_TYPE_PRESPAGE_BACKSIZE|MID_FLAG_NO_PROPERTY, CTF_PM_BACKGROUNDSIZE), + DPMAP("BackgroundFullSize", XML_NAMESPACE_DRAW, XML_BACKGROUND_SIZE, XML_SW_TYPE_PRESPAGE_BACKSIZE, CTF_PM_BACKGROUNDSIZE), DPMAP("FillColor", XML_NAMESPACE_DRAW, XML_FILL_COLOR, XML_TYPE_COLOR, 0), DPMAP("FillColor2", XML_NAMESPACE_DRAW, XML_SECONDARY_FILL_COLOR, XML_TYPE_COLOR, 0), DPMAP("FillGradientName", XML_NAMESPACE_DRAW, XML_FILL_GRADIENT_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_PM_FILLGRADIENTNAME), |