sw/source/core/unocore/unoframe.cxx | 3 +- xmloff/source/text/txtexppr.cxx | 53 ++++++++++++++++++------------------ xmloff/source/text/txtprmap.cxx | 3 ++ 3 files changed, 32 insertions(+), 27 deletions(-)
New commits: commit b2914050c0e2b3843f1067560a5de7dd8c76dd72 Author: Michael Stahl <mst...@redhat.com> Date: Tue Apr 21 00:15:55 2015 +0200 sw: ODF import: frame background: do not override gradient transparency ... with style:background-transparency (regression from 102bb87ca1a5dee3a09442bf503a54bb703c79ea) Change-Id: Icead7a47c145eace51249896b6e05d65dfaa2f78 (cherry picked from commit 3670e3c0c1bfcea9dc50fefb20b67a828b1e35bb) Reviewed-on: https://gerrit.libreoffice.org/15464 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> (cherry picked from commit d8263317d1812fabf139c5ffa2bf8b17aa612b3e) Reviewed-on: https://gerrit.libreoffice.org/15469 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 7cd950e..63fa7df 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -455,7 +455,8 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI aXFillTransparenceItem.PutValue(*pXFillTransparenceItem); rToSet.Put(aXFillTransparenceItem); } - else if (pColTrans) + else if (pColTrans && + !pXFillFloatTransparenceItem && !pXFillFloatTransparenceNameItem) { // No fill transparency is given. On the other hand, we have a // BackColorTransparency, so use that. commit 1636879e50b3fbeba4b2742f9841adb1df48ba88 Author: Michael Stahl <mst...@redhat.com> Date: Tue Apr 21 14:03:01 2015 +0200 tdf#90640: xmloff: ODF export: fix style:background-image attributes ... for Writer frames, which were missing the draw:opacity; turns out this is because now the the default valued properties are not exported any more, which causes them to be missing in the property array so the hard-coded indexes in XMLTextExportPropertySetMapper::handleElementItem() do not find them. (regression from c3e49660e782816d1203cb936156ef6d6a1ad572) Change-Id: I84b6c09b23a2275161135290f1b0ac9f52546a80 (cherry picked from commit c13b80e202a07b374531babe3af5a8529483f060) Reviewed-on: https://gerrit.libreoffice.org/15465 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> (cherry picked from commit af9db3f55f61d57187be98997fc03167d22fb864) Reviewed-on: https://gerrit.libreoffice.org/15470 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx index 5fc9cc4..46948b2 100644 --- a/xmloff/source/text/txtexppr.cxx +++ b/xmloff/source/text/txtexppr.cxx @@ -70,35 +70,36 @@ void XMLTextExportPropertySetMapper::handleElementItem( case CTF_BACKGROUND_URL: { - DBG_ASSERT( pProperties && nIdx >= 3, - "property vector missing" ); + assert(pProperties && nIdx >= 3); const Any *pPos = 0, *pFilter = 0, *pTrans = 0; - if( pProperties && nIdx >= 3 ) + sal_uInt32 nPropIndex = rProperty.mnIndex; + + // these are all optional, so have to check them in order + // note: this index order dependency is a steaming pile of manure + sal_uInt32 nIndex(nIdx - 1); + const XMLPropertyState& rFilter = (*pProperties)[nIndex]; + if (CTF_BACKGROUND_FILTER == getPropertySetMapper() + ->GetEntryContextId(rFilter.mnIndex)) { - const XMLPropertyState& rTrans = (*pProperties)[nIdx-3]; - // #99657# transparency may be there, but doesn't have to be. - // If it's there, it must be in the right position. - if( CTF_BACKGROUND_TRANSPARENCY == getPropertySetMapper() - ->GetEntryContextId( rTrans.mnIndex ) ) - pTrans = &rTrans.maValue; - - const XMLPropertyState& rPos = (*pProperties)[nIdx-2]; - DBG_ASSERT( CTF_BACKGROUND_POS == getPropertySetMapper() - ->GetEntryContextId( rPos.mnIndex ), - "invalid property map: pos expected" ); - if( CTF_BACKGROUND_POS == getPropertySetMapper() - ->GetEntryContextId( rPos.mnIndex ) ) - pPos = &rPos.maValue; - - const XMLPropertyState& rFilter = (*pProperties)[nIdx-1]; - DBG_ASSERT( CTF_BACKGROUND_FILTER == getPropertySetMapper() - ->GetEntryContextId( rFilter.mnIndex ), - "invalid property map: filter expected" ); - if( CTF_BACKGROUND_FILTER == getPropertySetMapper() - ->GetEntryContextId( rFilter.mnIndex ) ) - pFilter = &rFilter.maValue; + pFilter = &rFilter.maValue; + --nIndex; } - sal_uInt32 nPropIndex = rProperty.mnIndex; + + const XMLPropertyState& rPos = (*pProperties)[nIndex]; + if (CTF_BACKGROUND_POS == getPropertySetMapper() + ->GetEntryContextId(rPos.mnIndex)) + { + pPos = &rPos.maValue; + --nIndex; + } + + const XMLPropertyState& rTrans = (*pProperties)[nIndex]; + // #99657# transparency may be there, but doesn't have to be. + // If it's there, it must be in the right position. + if( CTF_BACKGROUND_TRANSPARENCY == getPropertySetMapper() + ->GetEntryContextId( rTrans.mnIndex ) ) + pTrans = &rTrans.maValue; + pThis->maBackgroundImageExport.exportXML( rProperty.maValue, pPos, pFilter, pTrans, getPropertySetMapper()->GetEntryNameSpace( nPropIndex ), diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index 5b596cd..02ca011 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -366,6 +366,7 @@ XMLPropertyMapEntry aXMLParaPropMap[] = // RES_ANCHOR // not required // RES_BACKGROUND + // DO NOT REORDER these! MP_E( "ParaBackColor", FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), MP_E( "ParaBackTransparent", FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ), MP_E( "ParaBackGraphicLocation", STYLE, POSITION, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BUILDIN_CMP_ONLY, CTF_BACKGROUND_POS ), @@ -710,6 +711,7 @@ XMLPropertyMapEntry aXMLFramePropMap[] = // RES_ANCHOR // see above // RES_BACKGROUND + // DO NOT REORDER these! MG_ED( "BackColorRGB", FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), MG_ED( "BackTransparent", FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, CTF_BACKGROUND_TRANSPARENT ), MG_ED( "BackColorTransparency", STYLE, BACKGROUND_TRANSPARENCY, XML_TYPE_PERCENT8, CTF_BACKGROUND_TRANSPARENCY ), @@ -890,6 +892,7 @@ XMLPropertyMapEntry aXMLSectionPropMap[] = MS_E( "TextColumns", STYLE, COLUMNS, MID_FLAG_ELEMENT_ITEM|XML_TYPE_TEXT_COLUMNS, CTF_TEXTCOLUMNS ), // RES_BACKGROUND + // DO NOT REORDER these! MS_E( "BackColor", FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), MS_E( "BackTransparent", FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ), MS_E( "BackGraphicLocation", STYLE, POSITION, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BUILDIN_CMP_ONLY, CTF_BACKGROUND_POS ),
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits