Hello community, here is the log from the commit of package libreoffice for openSUSE:Leap:15.2 checked in at 2020-06-06 20:48:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/libreoffice (Old) and /work/SRC/openSUSE:Leap:15.2/.libreoffice.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libreoffice" Sat Jun 6 20:48:43 2020 rev:99 rq:812092 version:6.4.4.2 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/libreoffice/libreoffice.changes 2020-04-08 12:48:26.118344024 +0200 +++ /work/SRC/openSUSE:Leap:15.2/.libreoffice.new.3606/libreoffice.changes 2020-06-06 20:48:53.628588741 +0200 @@ -1,0 +2,45 @@ +Thu May 21 09:12:27 UTC 2020 - Tomáš Chvátal <[email protected]> + +- Update to 6.4.4.2: + * 6.4.4 release +- Remove merged patch bsc1160687-1.diff + +------------------------------------------------------------------- +Tue May 12 08:57:23 UTC 2020 - Andras Timar <[email protected]> + +- Fix bsc#1160687 - LO-L3: Elements on title page mixed up + * bsc1160687-1.diff + * bsc1160687-2.diff + * bsc1160687-3.diff + * bsc1160687-4.diff + * bsc1160687-5.diff + * bsc1160687-6.diff + * bsc1160687-7.diff + * bsc1160687-8.diff + +------------------------------------------------------------------- +Tue May 5 12:36:00 UTC 2020 - Andras Timar <[email protected]> + +- Fix bsc#1165870 - LO-L3: Image shadow that should be invisible shown as extraneous line below + * bsc1165870.diff + +------------------------------------------------------------------- +Wed Apr 8 11:13:30 UTC 2020 - Tomáš Chvátal <[email protected]> + +- Update to 6.4.3.2 bsc#1171997 CVE-2020-12801: + * 6.4.3 RC2 release +- Drop merged patch adapt-o3tl-span-to-removal-of-std-span-cbegin-et-al.patch + +------------------------------------------------------------------- +Mon Mar 30 08:41:19 UTC 2020 - Martin Liška <[email protected]> + +- Add replace-boost-bimap-in-sdext-pdfimport.patch and + adapt-o3tl-span-to-removal-of-std-span-cbegin-et-al.patch + in order to fix boo#1167463. + +------------------------------------------------------------------- +Fri Mar 27 12:04:43 UTC 2020 - Michael Gorse <[email protected]> + +- Add poppler-0.86.patch: fix the build with poppler 0.86. + +------------------------------------------------------------------- Old: ---- libreoffice-6.4.2.2.tar.xz libreoffice-6.4.2.2.tar.xz.asc libreoffice-help-6.4.2.2.tar.xz libreoffice-help-6.4.2.2.tar.xz.asc libreoffice-translations-6.4.2.2.tar.xz libreoffice-translations-6.4.2.2.tar.xz.asc New: ---- bsc1160687-2.diff bsc1160687-3.diff bsc1160687-4.diff bsc1160687-5.diff bsc1160687-6.diff bsc1160687-7.diff bsc1160687-8.diff bsc1165870.diff libreoffice-6.4.4.2.tar.xz libreoffice-6.4.4.2.tar.xz.asc libreoffice-help-6.4.4.2.tar.xz libreoffice-help-6.4.4.2.tar.xz.asc libreoffice-translations-6.4.4.2.tar.xz libreoffice-translations-6.4.4.2.tar.xz.asc poppler-0.86.patch replace-boost-bimap-in-sdext-pdfimport.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libreoffice.spec ++++++ --- /var/tmp/diff_new_pack.zPtwbm/_old 2020-06-06 20:48:56.500597939 +0200 +++ /var/tmp/diff_new_pack.zPtwbm/_new 2020-06-06 20:48:56.504597951 +0200 @@ -50,7 +50,7 @@ %bcond_with system_gpgme %endif Name: libreoffice -Version: 6.4.2.2 +Version: 6.4.4.2 Release: 0 Summary: A Free Office Suite (Framework) License: LGPL-3.0-or-later AND MPL-2.0+ @@ -99,6 +99,18 @@ Patch2: nlpsolver-no-broken-help.diff Patch3: mediawiki-no-broken-help.diff Patch6: fix_old_boost_spirit_namespace.patch +Patch7: poppler-0.86.patch +Patch8: replace-boost-bimap-in-sdext-pdfimport.patch +# Bug 1165870 - LO-L3: Image shadow that should be invisible shown as extraneous line below +Patch9: bsc1165870.diff +# Bug 1160687 - LO-L3: Elements on title page mixed up +Patch11: bsc1160687-2.diff +Patch12: bsc1160687-3.diff +Patch13: bsc1160687-4.diff +Patch14: bsc1160687-5.diff +Patch15: bsc1160687-6.diff +Patch16: bsc1160687-7.diff +Patch17: bsc1160687-8.diff # try to save space by using hardlinks Patch990: install-with-hardlinks.diff # save time by relying on rpm check rather than doing stupid find+grep @@ -955,6 +967,16 @@ %patch2 %patch3 %patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 %patch990 -p1 %patch991 -p1 ++++++ bsc1160687-2.diff ++++++ >From e00329729e1fd18fa452e91820a81964d5527e6d Mon Sep 17 00:00:00 2001 From: Miklos Vajna <[email protected]> Date: Tue, 28 Apr 2020 15:04:19 +0200 Subject: [PATCH] sw from-bottom relative orientation: add UNO API When it comes to vertical positioning of anchored sw objects, one can say the position should be "1cm from the top of the page". But measuring from the bottom of something was not possible. Add API for this to help working with documents from Word, which supports the feature. There is no duplicated C++ enum in sw/ for vertical relative orientation, so no "doc model" changes are needed for this in sw/. Change-Id: I3199d3e794bda2f21f92ce3bb7c3c6f04d284db2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93065 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins (cherry picked from commit 79107d3f8d10aa0f38641775c5eb47dcfd4fd37e) --- offapi/com/sun/star/text/RelOrientation.idl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/offapi/com/sun/star/text/RelOrientation.idl b/offapi/com/sun/star/text/RelOrientation.idl index adfb094fd593..59f39a045740 100644 --- a/offapi/com/sun/star/text/RelOrientation.idl +++ b/offapi/com/sun/star/text/RelOrientation.idl @@ -73,6 +73,12 @@ published constants RelOrientation */ const short TEXT_LINE = 9; + /** Similar to PAGE_PRINT_AREA, but count from bottom, not from top. + + @since LibreOffice 7.0 + */ + const short PAGE_PRINT_AREA_BOTTOM = 10; + }; -- 2.26.1 ++++++ bsc1160687-3.diff ++++++ >From 9e170a5def6ce48c8273843d13bd5bbb43b802da Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski <[email protected]> Date: Thu, 5 Mar 2020 20:49:55 +0100 Subject: [PATCH] Dump some more layout info as Xml Change-Id: Ia82d545e4c5d4507899d123eba9d4b2efded992d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90125 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <[email protected]> (cherry picked from commit 36f0a04d3caa176b20dccb10ff0bbcfb5cb8d893) --- sw/inc/swrect.hxx | 3 ++- sw/source/core/bastyp/swrect.cxx | 12 ++++++++++++ sw/source/core/text/xmldump.cxx | 23 ++++++++++------------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx index 69b1f2ad781a..6cde3c3f01e7 100644 --- a/sw/inc/swrect.hxx +++ b/sw/inc/swrect.hxx @@ -26,6 +26,7 @@ #include "swdllapi.h" class SvStream; +typedef struct _xmlTextWriter* xmlTextWriterPtr; /// *Of course* Writer needs its own rectangles. /// This is half-open so m_Point.X() + m_Size.getWidth() is *not* included. @@ -104,7 +105,7 @@ public: // Output operator for debugging. friend SvStream& WriteSwRect( SvStream &rStream, const SwRect &rRect ); - + void dumpAsXmlAttributes(xmlTextWriterPtr writer) const; void Top_( const long nTop ); void Bottom_( const long nBottom ); diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx index 1d53e6e7a71e..884c155003e2 100644 --- a/sw/source/core/bastyp/swrect.cxx +++ b/sw/source/core/bastyp/swrect.cxx @@ -19,6 +19,8 @@ #include <swrect.hxx> +#include <libxml/xmlwriter.h> + #ifdef DBG_UTIL #include <tools/stream.hxx> #endif @@ -218,6 +220,16 @@ void SwRect::SetUpperRightCorner( const Point& rNew ) void SwRect::SetLowerLeftCorner( const Point& rNew ) { m_Point = Point(rNew.X(), rNew.Y() - m_Size.getHeight()); } +void SwRect::dumpAsXmlAttributes(xmlTextWriterPtr writer) const +{ + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("left"), "%li", Left()); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("top"), "%li", Top()); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("width"), "%li", Width()); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("height"), "%li", Height()); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("bottom"), "%li", Bottom()); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("right"), "%li", Right()); +} + #ifdef DBG_UTIL SvStream& WriteSwRect(SvStream &rStream, const SwRect &rRect) { diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index 20f61111126a..4f3d50eba742 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -343,6 +343,12 @@ void SwFrame::dumpAsXml( xmlTextWriterPtr writer ) const xmlTextWriterWriteAttribute(writer, BAD_CAST("ValidLayout"), BAD_CAST(OString::boolean(!pPageFrame->IsInvalidLayout()).getStr())); xmlTextWriterWriteAttribute(writer, BAD_CAST("ValidContent"), BAD_CAST(OString::boolean(!pPageFrame->IsInvalidContent()).getStr())); xmlTextWriterEndElement(writer); + xmlTextWriterStartElement(writer, BAD_CAST("page_info")); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("phyNum"), "%d", pPageFrame->GetPhyPageNum()); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("virtNum"), "%d", pPageFrame->GetVirtPageNum()); + OUString aFormatName = pPageFrame->GetPageDesc()->GetName(); + xmlTextWriterWriteFormatAttribute( writer, BAD_CAST("pageDesc"), "%s", BAD_CAST(OUStringToOString(aFormatName, RTL_TEXTENCODING_UTF8).getStr())); + xmlTextWriterEndElement(writer); } if (IsTextFrame()) @@ -421,22 +427,16 @@ void SwFrame::dumpInfosAsXml( xmlTextWriterPtr writer ) const { // output the Frame xmlTextWriterStartElement( writer, BAD_CAST( "bounds" ) ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "left" ), "%ld", getFrameArea().Left() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "top" ), "%ld", getFrameArea().Top() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%ld", getFrameArea().Width() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%ld", getFrameArea().Height() ); + getFrameArea().dumpAsXmlAttributes(writer); xmlTextWriterWriteAttribute(writer, BAD_CAST("mbFixSize"), BAD_CAST(OString::boolean(HasFixSize()).getStr())); xmlTextWriterWriteAttribute(writer, BAD_CAST("mbValidPos"), BAD_CAST(OString::boolean(isFrameAreaPositionValid()).getStr())); xmlTextWriterWriteAttribute(writer, BAD_CAST("mbValidSize"), BAD_CAST(OString::boolean(isFrameAreaSizeValid()).getStr())); xmlTextWriterWriteAttribute(writer, BAD_CAST("mbValidPrtArea"), BAD_CAST(OString::boolean(isFramePrintAreaValid()).getStr())); xmlTextWriterEndElement( writer ); - // output the Prt + // output the print area xmlTextWriterStartElement( writer, BAD_CAST( "prtBounds" ) ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "left" ), "%ld", getFramePrintArea().Left() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "top" ), "%ld", getFramePrintArea().Top() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%ld", getFramePrintArea().Width() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%ld", getFramePrintArea().Height() ); + getFramePrintArea().dumpAsXmlAttributes(writer); xmlTextWriterEndElement( writer ); } @@ -515,10 +515,7 @@ void SwAnchoredObject::dumpAsXml( xmlTextWriterPtr writer ) const xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ptr" ), "%p", this ); xmlTextWriterStartElement( writer, BAD_CAST( "bounds" ) ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "left" ), "%ld", GetObjBoundRect().Left() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "top" ), "%ld", GetObjBoundRect().Top() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "width" ), "%ld", GetObjBoundRect().Width() ); - xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "height" ), "%ld", GetObjBoundRect().Height() ); + GetObjBoundRect().dumpAsXmlAttributes(writer); xmlTextWriterEndElement( writer ); if (const SdrObject* pObject = GetDrawObj()) -- 2.26.1 ++++++ bsc1160687-4.diff ++++++ >From c91584ef805866b46b06fe7451b077f9f33419b4 Mon Sep 17 00:00:00 2001 From: Miklos Vajna <[email protected]> Date: Tue, 28 Apr 2020 17:28:16 +0200 Subject: [PATCH] sw from-bottom relative orientation: add layout The implementation is a combination of what "bottom" and "from-top" already provided. Change-Id: Id7bac8cbcccbadcca377fe9946a21ccb3e368913 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93086 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins (cherry picked from commit dd52fdba87d0cfee039cc236b86241708d4e63b8) --- .../objectpositioning/objectpositioning.cxx | 33 +++++++++++++++++++ .../tocntntanchoredobjectposition.cxx | 12 +++++++ 2 files changed, 45 insertions(+) diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx index 18c08f8540d9..9bf3c7bfb6cb 100644 --- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx @@ -548,6 +548,18 @@ void SwToContentAnchoredObjectPosition::CalcPosition() aRectFnSet.GetTop(aPgPrtRect), nTopOfOrient ); } + else if (aVert.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA_BOTTOM) + { + // The anchored object is relative from the bottom of the page's print area. + SwRect aPgPrtRect(rPageAlignLayFrame.getFrameArea()); + if (rPageAlignLayFrame.IsPageFrame()) + { + auto& rPageFrame = static_cast<const SwPageFrame&>(rPageAlignLayFrame); + aPgPrtRect = rPageFrame.PrtWithoutHeaderAndFooter(); + } + SwTwips nPageBottom = aRectFnSet.GetBottom(aPgPrtRect); + nVertOffsetToFrameAnchorPos += aRectFnSet.YDiff(nPageBottom, nTopOfOrient); + } nRelPosY = nVertOffsetToFrameAnchorPos + aVert.GetPos(); } -- 2.26.1 ++++++ bsc1160687-5.diff ++++++ >From 49f0501f8ba4acd36067a84590469944e9d3234c Mon Sep 17 00:00:00 2001 From: Miklos Vajna <[email protected]> Date: Wed, 29 Apr 2020 12:31:25 +0200 Subject: [PATCH] sw from-bottom relative orientation: add ODF filter Map between RelOrientation::PAGE_PRINT_AREA_BOTTOM and loext:vertical-rel="page-content-bottom". Conflicts: sw/qa/extras/odfexport/odfexport.cxx Change-Id: I1d614bf7c82a76285f4268b8008e08c25ef9b7f0 --- include/xmloff/xmltoken.hxx | 2 ++ .../OpenDocument-schema-v1.3+libreoffice.rng | 11 +++++++++++ .../odfexport/data/page-content-bottom.odt | Bin 0 -> 8502 bytes sw/qa/extras/odfexport/odfexport.cxx | 7 +++++++ xmloff/source/core/xmltoken.cxx | 2 ++ xmloff/source/style/xmlexppr.cxx | 13 +++++++++++-- xmloff/source/text/txtprhdl.cxx | 2 ++ xmloff/source/text/txtprmap.cxx | 6 ++++++ xmloff/source/token/tokens.txt | 1 + 9 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 sw/qa/extras/odfexport/data/page-content-bottom.odt diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index 1175958548ff..dfc9ad5ced3d 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -3367,6 +3367,8 @@ namespace xmloff { namespace token { XML_RESOLVED, + XML_PAGE_CONTENT_BOTTOM, + XML_TOKEN_END }; diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index e0f6e4d7a216..b37e90f0b568 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3360,6 +3360,8 @@ namespace xmloff { namespace token { // For recording whether comments/annotations are resolved TOKEN( "resolved", XML_RESOLVED ), + TOKEN( "page-content-bottom", XML_PAGE_CONTENT_BOTTOM ), + #if OSL_DEBUG_LEVEL > 0 { 0, nullptr, nullptr, XML_TOKEN_END } #else diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index 76fd72c71deb..cd94fccae8dd 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -1030,10 +1030,10 @@ void SvXMLExportPropertyMapper::_exportXML( if( bRemove ) rAttrList.RemoveAttribute( sName ); + // We don't seem to have a generic mechanism to write an attribute in the extension + // namespace in case of certain attribute values only, so do this manually. if (IsXMLToken(mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex), XML_WRITING_MODE)) { - // We don't seem to have a generic mechanism to write an attribute in the extension - // namespace in case of certain attribute values only, so do this manually. if (IsXMLToken(aValue, XML_BT_LR)) { sName = rNamespaceMap.GetQNameByKey( @@ -1041,6 +1041,15 @@ void SvXMLExportPropertyMapper::_exportXML( mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex)); } } + else if (IsXMLToken(mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex), XML_VERTICAL_REL)) + { + if (IsXMLToken(aValue, XML_PAGE_CONTENT_BOTTOM)) + { + sName = rNamespaceMap.GetQNameByKey( + XML_NAMESPACE_LO_EXT, + mpImpl->mxPropMapper->GetEntryXMLName(rProperty.mnIndex)); + } + } rAttrList.AddAttribute( sName, aValue ); } diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index 32644e5f7f1c..13770a7de558 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -153,6 +153,7 @@ static SvXMLEnumMapEntry<sal_uInt16> const pXML_VertRel_Enum[] = // DVO, OD 17.09.2003 #i18732# - allow vertical alignment at page { XML_PAGE, RelOrientation::PAGE_FRAME }, { XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA }, + { XML_PAGE_CONTENT_BOTTOM, RelOrientation::PAGE_PRINT_AREA_BOTTOM }, { XML_FRAME, RelOrientation::FRAME }, // import only { XML_FRAME_CONTENT, RelOrientation::PRINT_AREA }, // import only // OD 13.11.2003 #i22341# - new vertical alignment at top of line @@ -166,6 +167,7 @@ static SvXMLEnumMapEntry<sal_uInt16> const pXML_VertRelPage_Enum[] = { XML_PAGE_CONTENT, RelOrientation::PRINT_AREA }, { XML_PAGE, RelOrientation::PAGE_FRAME }, { XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA }, + { XML_PAGE_CONTENT_BOTTOM, RelOrientation::PAGE_PRINT_AREA_BOTTOM }, { XML_TOKEN_INVALID, 0 } }; diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index ebd91ebc3062..e3597b7c6f50 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -736,6 +736,9 @@ XMLPropertyMapEntry const aXMLFramePropMap[] = MG_ED( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL, CTF_VERTICALREL ), MG_ED( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_PAGE|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_PAGE ), MG_ED( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_VERTICALREL_FRAME ), + MAP_EXT_I( "VertOrientRelation", XML_NAMESPACE_LO_EXT, XML_VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL|XML_TYPE_PROP_GRAPHIC|MID_FLAG_DEFAULT_ITEM_EXPORT, CTF_VERTICALREL ), + MAP_EXT_I( "VertOrientRelation", XML_NAMESPACE_LO_EXT, XML_VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_PAGE|MID_FLAG_SPECIAL_ITEM_IMPORT|XML_TYPE_PROP_GRAPHIC|MID_FLAG_DEFAULT_ITEM_EXPORT, CTF_VERTICALREL_PAGE ), + MAP_EXT_I( "VertOrientRelation", XML_NAMESPACE_LO_EXT, XML_VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT|XML_TYPE_PROP_GRAPHIC|MID_FLAG_DEFAULT_ITEM_EXPORT, CTF_VERTICALREL_FRAME ), // RES_HORI_ORIENT MG_ED( "HoriOrient", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_POS|MID_FLAG_MULTI_PROPERTY, CTF_HORIZONTALPOS ), MG_ED( "PageToggle", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_MIRROR, CTF_HORIZONTALMIRROR ), @@ -901,6 +904,9 @@ XMLPropertyMapEntry const aXMLShapePropMap[] = MG_E( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL, CTF_SHAPE_VERTICALREL ), MG_E( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_PAGE|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_SHAPE_VERTICALREL_PAGE ), MG_E( "VertOrientRelation", STYLE, VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_SHAPE_VERTICALREL_FRAME ), + MAP_EXT_I( "VertOrientRelation", XML_NAMESPACE_LO_EXT, XML_VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL|XML_TYPE_PROP_GRAPHIC, CTF_VERTICALREL ), + MAP_EXT_I( "VertOrientRelation", XML_NAMESPACE_LO_EXT, XML_VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_PAGE|MID_FLAG_SPECIAL_ITEM_IMPORT|XML_TYPE_PROP_GRAPHIC, CTF_VERTICALREL_PAGE ), + MAP_EXT_I( "VertOrientRelation", XML_NAMESPACE_LO_EXT, XML_VERTICAL_REL, XML_TYPE_TEXT_VERTICAL_REL_FRAME|MID_FLAG_SPECIAL_ITEM_IMPORT|XML_TYPE_PROP_GRAPHIC, CTF_VERTICALREL_FRAME ), // RES_HORI_ORIENT MG_E( "HoriOrient", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_POS|MID_FLAG_MULTI_PROPERTY, CTF_SHAPE_HORIZONTALPOS ), MG_E( "PageToggle", STYLE, HORIZONTAL_POS, XML_TYPE_TEXT_HORIZONTAL_MIRROR, CTF_SHAPE_HORIZONTALMIRROR ), diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt index 921ff2b63b5a..ef2aaca8ea77 100644 --- a/xmloff/source/token/tokens.txt +++ b/xmloff/source/token/tokens.txt @@ -3127,4 +3127,5 @@ newline creator-initials transliteration-spellout resolved +page-content-bottom TOKEN_END_DUMMY -- 2.26.1 ++++++ bsc1160687-6.diff ++++++ >From d29f4857da385db17fe9efd4157c0a021531d0c4 Mon Sep 17 00:00:00 2001 From: Miklos Vajna <[email protected]> Date: Wed, 29 Apr 2020 19:19:37 +0200 Subject: [PATCH] sw from-bottom relative orientation: add DOCX filter The OOXML equivalent is <wp:positionV relativeFrom="bottomMargin">, and the position is typically a negative number (i.e. the position is the offset between the top of the shape and the top of the top or bottom margin; not the distance and it's always the top of some margin). (cherry picked from commit fc620901ddd134f644a56ed4ea4a9b5446cc5675) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport14.cxx Change-Id: Ia979bc8bfaa37d29b0947c4408335e0a80c05880 --- .../ooxmlexport/data/page-content-bottom.docx | Bin 0 -> 5007 bytes sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 11 +++++++++++ sw/source/filter/ww8/docxsdrexport.cxx | 3 +++ writerfilter/source/dmapper/GraphicHelpers.cxx | 4 ++++ 4 files changed, 18 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/page-content-bottom.docx diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 7cacc4eb3173..e9381ca77d0d 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -498,6 +498,9 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons case text::RelOrientation::PAGE_PRINT_AREA: relativeFromV = "margin"; break; + case text::RelOrientation::PAGE_PRINT_AREA_BOTTOM: + relativeFromV = "bottomMargin"; + break; case text::RelOrientation::PAGE_FRAME: relativeFromV = "page"; break; diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx index 9168ad51eebd..7e8564826758 100644 --- a/writerfilter/source/dmapper/GraphicHelpers.cxx +++ b/writerfilter/source/dmapper/GraphicHelpers.cxx @@ -75,6 +75,10 @@ void PositionHandler::lcl_attribute( Id aName, Value& rVal ) m_nRelation = text::RelOrientation::PAGE_FRAME; break; + case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_bottomMargin: + m_nRelation = text::RelOrientation::PAGE_PRINT_AREA_BOTTOM; + break; + case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_paragraph: m_nRelation = text::RelOrientation::FRAME; break; -- 2.26.1 ++++++ bsc1160687-7.diff ++++++ >From 1b9c1803f6f42adc23f65ff4182c15192c4b7b92 Mon Sep 17 00:00:00 2001 From: Miklos Vajna <[email protected]> Date: Tue, 5 May 2020 13:59:16 +0200 Subject: [PATCH] sw from-bottom relative orientation: add UI And fix the value of LAST: it seems this went wrong in commit c2fc91664f71c447209d2cd29c0df1d7faba4927 (Convert LB flags to scoped enum, 2016-05-14), where the upper limit went from 0x80000000 to 0x080000, which means it started to matter if we allow equality or not. Other places compare LAST without allowing equality, so leave that unchanged and instead give LAST its own value. Change-Id: I0ceac18475f5f50b792c7a8442648c9ba2a25236 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93477 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins (cherry picked from commit 8af2c4e3a517e3b75f2ace9719c1ca03153baddf) --- cui/source/tabpages/swpossizetabpage.cxx | 11 +++++++---- include/svx/swframeposstrings.hxx | 1 + svx/inc/swframeposstrings.hrc | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index 46a210559892..d4ade3ea4dfc 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -94,10 +94,12 @@ enum class LB { // #i22341# VertLine = 0x080000, // vertical text line - LAST = VertLine + RelPagePrintAreaBottom = 0x100000, // bottom of text area of page + + LAST = 0x200000 }; namespace o3tl { - template<> struct typed_flags<LB> : is_typed_flags<LB, 0x0fffff> {}; + template<> struct typed_flags<LB> : is_typed_flags<LB, 0x3fffff> {}; } static RelationMap const aRelationMap[] = @@ -110,6 +112,7 @@ static RelationMap const aRelationMap[] = {SwFPos::REL_FRM_RIGHT, SwFPos::MIR_REL_FRM_RIGHT, LB::RelFrameRight, RelOrientation::FRAME_RIGHT}, {SwFPos::REL_PG_FRAME, SwFPos::REL_PG_FRAME, LB::RelPageFrame, RelOrientation::PAGE_FRAME}, {SwFPos::REL_PG_PRTAREA,SwFPos::REL_PG_PRTAREA, LB::RelPagePrintArea, RelOrientation::PAGE_PRINT_AREA}, + {SwFPos::REL_PG_PRTAREA_BOTTOM,SwFPos::REL_PG_PRTAREA_BOTTOM, LB::RelPagePrintAreaBottom, RelOrientation::PAGE_PRINT_AREA_BOTTOM}, {SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB::RelChar, RelOrientation::CHAR}, {SwFPos::FLY_REL_PG_LEFT, SwFPos::FLY_MIR_REL_PG_LEFT, LB::FlyRelPageLeft, RelOrientation::PAGE_LEFT}, @@ -257,7 +260,7 @@ static FrmMap const aVParaMap[] = {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, VERT_PARA_REL}, {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, VERT_PARA_REL}, {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, VERT_PARA_REL}, - {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_PARA_REL} + {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_PARA_REL|LB::RelPagePrintAreaBottom} }; static FrmMap const aVParaHtmlMap[] = @@ -314,7 +317,7 @@ static FrmMap aVCharMap[] = {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, VERT_CHAR_REL|LB::RelChar}, {SwFPos::BELOW, SwFPos::BELOW, VertOrientation::CHAR_BOTTOM, LB::RelChar}, {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, VERT_CHAR_REL|LB::RelChar}, - {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_CHAR_REL}, + {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_CHAR_REL|LB::RelPagePrintAreaBottom}, {SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, VertOrientation::NONE, LB::RelChar|LB::VertLine}, {SwFPos::TOP, SwFPos::TOP, VertOrientation::LINE_TOP, LB::VertLine}, {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::LINE_BOTTOM, LB::VertLine}, diff --git a/include/svx/swframeposstrings.hxx b/include/svx/swframeposstrings.hxx index c0ef3a3520d0..61d06d459cdf 100644 --- a/include/svx/swframeposstrings.hxx +++ b/include/svx/swframeposstrings.hxx @@ -49,6 +49,7 @@ public: MIR_REL_FRM_RIGHT , REL_PG_FRAME , REL_PG_PRTAREA , + REL_PG_PRTAREA_BOTTOM , REL_BASE , REL_CHAR , REL_ROW , diff --git a/svx/inc/swframeposstrings.hrc b/svx/inc/swframeposstrings.hrc index df4d92a976fb..b08a9a3b525b 100644 --- a/svx/inc/swframeposstrings.hrc +++ b/svx/inc/swframeposstrings.hrc @@ -43,6 +43,7 @@ const char* RID_SVXSW_FRAMEPOSITIONS[] = NC_("RID_SVXSW_FRAMEPOSITIONS", "Outer paragraph border"), NC_("RID_SVXSW_FRAMEPOSITIONS", "Entire page"), NC_("RID_SVXSW_FRAMEPOSITIONS", "Page text area"), + NC_("RID_SVXSW_FRAMEPOSITIONS", "Page text area bottom"), NC_("RID_SVXSW_FRAMEPOSITIONS", "Base line"), NC_("RID_SVXSW_FRAMEPOSITIONS", "Character"), NC_("RID_SVXSW_FRAMEPOSITIONS", "Row"), -- 2.26.1 ++++++ bsc1160687-8.diff ++++++ >From b6969472df1564351f10af94ea373af6e7435aab Mon Sep 17 00:00:00 2001 From: Miklos Vajna <[email protected]> Date: Tue, 5 May 2020 18:03:51 +0200 Subject: [PATCH] sw from-bottom relative orientation: fix calculation of position limits Create a new Writer doc, insert a rectangle with height = 10cm, try to position it 2cm above the bottom of the page, so that would be -12cm, but we limited the metric field to -2cm because 2cm was the page margin. Teach SwFEShell::CalcBoundRect() about text::RelOrientation::PAGE_PRINT_AREA_BOTTOM, then this will work without problems. (cherry picked from commit e21bc1b3e587c2bd90168b24f3774d98a3837f8e) Conflicts: sw/qa/core/frmedt/frmedt.cxx Change-Id: Ib6ddccc1512d39fff5bff2e989973b156a6c2bf7 --- sw/qa/core/frmedt/frmedt.cxx | 54 ++++++++++++++++++++++++++++ sw/source/core/frmedt/fews.cxx | 16 ++++++++- sw/source/uibase/shells/drwbassh.cxx | 3 +- 3 files changed, 71 insertions(+), 2 deletions(-) diff --git a/sw/qa/core/frmedt/frmedt.cxx b/sw/qa/core/frmedt/frmedt.cxx index cf3d1945e049..6c29e647d391 100644 --- a/sw/qa/core/frmedt/frmedt.cxx +++ b/sw/qa/core/frmedt/frmedt.cxx @@ -13,6 +13,9 @@ #include <comphelper/classids.hxx> #include <tools/globname.hxx> #include <svtools/embedhlp.hxx> + +#include <com/sun/star/text/VertOrientation.hpp> + #include <svx/svdpage.hxx> #include <wrtsh.hxx> @@ -20,6 +23,8 @@ #include <IDocumentDrawModelAccess.hxx> #include <drawdoc.hxx> #include <dcontact.hxx> +#include <docary.hxx> +#include <pagefrm.hxx> static char const DATA_DIRECTORY[] = "/sw/qa/core/frmedt/data/"; @@ -58,6 +63,55 @@ CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testTextboxReanchor) CPPUNIT_ASSERT_EQUAL(nOldAnchor, nNewAnchor); } +CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testVertPosFromBottomBoundingBox) +{ + // Insert a shape and anchor it vertically in a way, so its position is from the top of the page + // bottom margin area. + mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument"); + uno::Reference<css::lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY); + uno::Reference<drawing::XShape> xShape( + xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY); + xShape->setSize(awt::Size(10000, 10000)); + uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); + xShapeProps->setPropertyValue("AnchorType", + uno::makeAny(text::TextContentAnchorType_AT_CHARACTER)); + xShapeProps->setPropertyValue("VertOrient", uno::makeAny(text::VertOrientation::NONE)); + xShapeProps->setPropertyValue("VertOrientRelation", + uno::makeAny(text::RelOrientation::PAGE_PRINT_AREA_BOTTOM)); + xShapeProps->setPropertyValue("VertOrientPosition", + uno::makeAny(static_cast<sal_Int32>(-11000))); + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + xDrawPageSupplier->getDrawPage()->add(xShape); + + // Get the absolute position of the top of the page bottom margin area. + xmlDocPtr pXmlDoc = parseLayoutDump(); + SwTwips nPagePrintAreaBottom = getXPath(pXmlDoc, "//page/infos/prtBounds", "bottom").toInt32(); + + // Calculate the allowed bounding box of the shape, e.g. the shape's position & size dialog uses + // this to limit the vertical position to sensible values. + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); + SwRect aBoundRect; + RndStdIds eAnchorType = RndStdIds::FLY_AT_CHAR; + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + const auto& rFrameFormats = *pDoc->GetFrameFormats(); + const SwPosition* pContentPos = rFrameFormats[0]->GetAnchor().GetContentAnchor(); + sal_Int16 eHoriRelOrient = text::RelOrientation::PAGE_FRAME; + sal_Int16 eVertRelOrient = text::RelOrientation::PAGE_PRINT_AREA_BOTTOM; + bool bFollowTextFlow = false; + bool bMirror = false; + Size aPercentSize; + pWrtShell->CalcBoundRect(aBoundRect, eAnchorType, eHoriRelOrient, eVertRelOrient, pContentPos, + bFollowTextFlow, bMirror, nullptr, &aPercentSize); + + // Without the accompanying fix in place, this test would have failed with: + // - Expected: -14705 + // - Actual : -1134 + // i.e. UI did not allow anchoring a shape 10cm above the bottom of the page due to wrong + // bounding box. + CPPUNIT_ASSERT_EQUAL(-1 * nPagePrintAreaBottom, aBoundRect.Pos().getY()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 2f874fd34e24..b20c37d28674 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -967,7 +967,9 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, // #i18732# - adjustment vertical 'virtual' anchor position // (<aPos.Y()> respectively <aPos.X()>), if object is vertical aligned // to page areas. - if ( _eVertRelOrient == text::RelOrientation::PAGE_FRAME || _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA ) + if (_eVertRelOrient == text::RelOrientation::PAGE_FRAME + || _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA + || _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA_BOTTOM) { if ( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() ) { @@ -998,6 +1000,18 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, aPos.setY(aPos.getY() + pTmpFrame->getFrameArea().Height()); } } + else if (_eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA_BOTTOM) + { + if (rVertEnvironLayFrame.IsPageFrame()) + { + auto& rPageFrame = static_cast<const SwPageFrame&>(rVertEnvironLayFrame); + aPos.setY(rPageFrame.PrtWithoutHeaderAndFooter().Bottom()); + } + else + { + aPos.AdjustY(rVertEnvironLayFrame.getFramePrintArea().Bottom()); + } + } } } } diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index 12d87bab691b..d0d4cba2cba8 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -932,7 +932,8 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, // and alignment at page areas. const bool bMaxVPosAtBottom = !rValidation.bFollowTextFlow || rValidation.nVRelOrient == text::RelOrientation::PAGE_FRAME || - rValidation.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA; + rValidation.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA || + rValidation.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA_BOTTOM; { SwTwips nTmpMaxVPos = ( bMaxVPosAtBottom ? aBoundRect.Bottom() -- 2.26.1 ++++++ bsc1165870.diff ++++++ >From b98f2d2d4f020d1d3b3271632ff4271872340f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCl=C5=9Fah=20K=C3=B6se?= <[email protected]> Date: Tue, 14 Apr 2020 15:49:28 +0300 Subject: [PATCH] tdf#130058 Import shadow size. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie1cee377a33567088fb76ea47f0e6fc51d47f0fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92188 Tested-by: Jenkins Reviewed-by: Gülşah Köse <[email protected]> --- drawinglayer/source/attribute/sdrshadowattribute.cxx | 14 +++++++++++++- include/drawinglayer/attribute/sdrshadowattribute.hxx | 2 ++ include/editeng/unoprnms.hxx | 2 ++ include/oox/drawingml/shapepropertymap.hxx | 4 +++- include/svx/sdr/primitive2d/sdrdecompositiontools.hxx | 4 +++- include/svx/svddef.hxx | 4 +++- include/svx/unoshprp.hxx | 4 +++- oox/source/drawingml/effectproperties.cxx | 16 ++++++++++++++++ oox/source/drawingml/effectproperties.hxx | 2 ++ oox/source/drawingml/effectpropertiescontext.cxx | 2 ++ oox/source/drawingml/shapepropertymap.cxx | 4 +++- oox/source/token/properties.txt | 2 ++ svx/source/sdr/primitive2d/sdrattributecreator.cxx | 7 ++++++- svx/source/sdr/primitive2d/sdrdecompositiontools.cxx | 18 ++++++++++++++---- svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx | 10 ++++++++-- svx/source/svdraw/svdattr.cxx | 2 ++ 16 files changed, 84 insertions(+), 13 deletions(-) diff --git a/drawinglayer/source/attribute/sdrshadowattribute.cxx b/drawinglayer/source/attribute/sdrshadowattribute.cxx index 0075cf4c2ba7..7957d4a5cc8e 100644 --- a/drawinglayer/source/attribute/sdrshadowattribute.cxx +++ b/drawinglayer/source/attribute/sdrshadowattribute.cxx @@ -32,14 +32,17 @@ namespace drawinglayer public: // shadow definitions basegfx::B2DVector maOffset; // shadow offset 1/100th mm + basegfx::B2DVector maSize; // [0.0 .. 2.0] double mfTransparence; // [0.0 .. 1.0], 0.0==no transp. basegfx::BColor maColor; // color of shadow ImpSdrShadowAttribute( const basegfx::B2DVector& rOffset, + const basegfx::B2DVector& rSize, double fTransparence, const basegfx::BColor& rColor) : maOffset(rOffset), + maSize(rSize), mfTransparence(fTransparence), maColor(rColor) { @@ -47,6 +50,7 @@ namespace drawinglayer ImpSdrShadowAttribute() : maOffset(basegfx::B2DVector()), + maSize(basegfx::B2DVector()), mfTransparence(0.0), maColor(basegfx::BColor()) { @@ -54,12 +58,14 @@ namespace drawinglayer // data read access const basegfx::B2DVector& getOffset() const { return maOffset; } + const basegfx::B2DVector& getSize() const { return maSize; } double getTransparence() const { return mfTransparence; } const basegfx::BColor& getColor() const { return maColor; } bool operator==(const ImpSdrShadowAttribute& rCandidate) const { return (getOffset() == rCandidate.getOffset() + && getSize() == rCandidate.getSize() && getTransparence() == rCandidate.getTransparence() && getColor() == rCandidate.getColor()); } @@ -74,10 +80,11 @@ namespace drawinglayer SdrShadowAttribute::SdrShadowAttribute( const basegfx::B2DVector& rOffset, + const basegfx::B2DVector& rSize, double fTransparence, const basegfx::BColor& rColor) : mpSdrShadowAttribute(ImpSdrShadowAttribute( - rOffset, fTransparence, rColor)) + rOffset, rSize, fTransparence, rColor)) { } @@ -115,6 +122,11 @@ namespace drawinglayer return mpSdrShadowAttribute->getOffset(); } + const basegfx::B2DVector& SdrShadowAttribute::getSize() const + { + return mpSdrShadowAttribute->getSize(); + } + double SdrShadowAttribute::getTransparence() const { return mpSdrShadowAttribute->getTransparence(); diff --git a/include/drawinglayer/attribute/sdrshadowattribute.hxx b/include/drawinglayer/attribute/sdrshadowattribute.hxx index 39b5acf59b73..c785a24f1e81 100644 --- a/include/drawinglayer/attribute/sdrshadowattribute.hxx +++ b/include/drawinglayer/attribute/sdrshadowattribute.hxx @@ -52,6 +52,7 @@ namespace drawinglayer /// constructors/assignmentoperator/destructor SdrShadowAttribute( const basegfx::B2DVector& rOffset, + const basegfx::B2DVector& rSize, double fTransparence, const basegfx::BColor& rColor); SdrShadowAttribute(); @@ -69,6 +70,7 @@ namespace drawinglayer // data access const basegfx::B2DVector& getOffset() const; + const basegfx::B2DVector& getSize() const; double getTransparence() const; const basegfx::BColor& getColor() const; }; diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx index ca3b977afeee..5ce726375e6d 100644 --- a/include/editeng/unoprnms.hxx +++ b/include/editeng/unoprnms.hxx @@ -84,6 +84,8 @@ #define UNO_NAME_SHADOWCOLOR "ShadowColor" #define UNO_NAME_SHADOWXDIST "ShadowXDistance" #define UNO_NAME_SHADOWYDIST "ShadowYDistance" +#define UNO_NAME_SHADOWSIZEX "ShadowSizeX" +#define UNO_NAME_SHADOWSIZEY "ShadowSizeY" #define UNO_NAME_SHADOWTRANSPARENCE "ShadowTransparence" #define UNO_NAME_EDGERADIUS "CornerRadius" diff --git a/include/oox/drawingml/shapepropertymap.hxx b/include/oox/drawingml/shapepropertymap.hxx index cc55b24e8ceb..a24ee49b5971 100644 --- a/include/oox/drawingml/shapepropertymap.hxx +++ b/include/oox/drawingml/shapepropertymap.hxx @@ -73,7 +73,9 @@ enum class ShapeProperty FillBackground, FillBitmapName, ShadowXDistance, - LAST = ShadowXDistance + ShadowSizeX, + ShadowSizeY, + LAST = ShadowSizeY }; typedef o3tl::enumarray<ShapeProperty, sal_Int32> ShapePropertyIds; diff --git a/include/svx/sdr/primitive2d/sdrdecompositiontools.hxx b/include/svx/sdr/primitive2d/sdrdecompositiontools.hxx index da3c54650746..844da339c111 100644 --- a/include/svx/sdr/primitive2d/sdrdecompositiontools.hxx +++ b/include/svx/sdr/primitive2d/sdrdecompositiontools.hxx @@ -71,7 +71,9 @@ namespace drawinglayer Primitive2DContainer SVX_DLLPUBLIC createEmbeddedShadowPrimitive( const Primitive2DContainer& rContent, - const attribute::SdrShadowAttribute& rShadow); + const attribute::SdrShadowAttribute& rShadow, + sal_Int32 nGraphicTranslateX = 0, + sal_Int32 nGraphicTranslateY = 0); } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/include/svx/svddef.hxx b/include/svx/svddef.hxx index a8696559c4fd..188ade20d469 100644 --- a/include/svx/svddef.hxx +++ b/include/svx/svddef.hxx @@ -175,7 +175,9 @@ class SdrTextHorzAdjustItem; #define SDRATTR_SHADOWTRANSPARENCE TypedWhichId<SdrPercentItem>(SDRATTR_SHADOW_FIRST+ 4) /* 1071 */ /* 1071 */ /* 1054 */ /* Pool V2 */ #define SDRATTR_SHADOW3D TypedWhichId<SfxVoidItem>(SDRATTR_SHADOW_FIRST+ 5) /* 1072 */ /* 1072 */ /* 1055 */ /* Pool V2 */ #define SDRATTR_SHADOWPERSP TypedWhichId<SfxVoidItem>(SDRATTR_SHADOW_FIRST+ 6) /* 1073 */ /* 1073 */ /* 1056 */ /* Pool V2 */ -#define SDRATTR_SHADOW_LAST (SDRATTR_SHADOWPERSP) /* 1078 */ /* 1078 */ /* 1061 */ /* Pool V1: 1039 */ +#define SDRATTR_SHADOWSIZEX TypedWhichId<SdrMetricItem>(SDRATTR_SHADOW_FIRST+ 7) +#define SDRATTR_SHADOWSIZEY TypedWhichId<SdrMetricItem>(SDRATTR_SHADOW_FIRST+ 8) +#define SDRATTR_SHADOW_LAST (SDRATTR_SHADOWSIZEY) /* 1078 */ /* 1078 */ /* 1061 */ /* Pool V1: 1039 */ #define SDRATTR_CAPTION_FIRST (SDRATTR_SHADOW_LAST + 1) /* 1080 */ /* 1080 */ /* 1063 */ /* Pool V1: 1041 */ #define SDRATTR_CAPTIONTYPE TypedWhichId<SdrCaptionTypeItem>(SDRATTR_CAPTION_FIRST+ 0) /* 1080 */ /* 1080 */ /* 1063 */ diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx index 0861844be16d..54b8db4b2715 100644 --- a/include/svx/unoshprp.hxx +++ b/include/svx/unoshprp.hxx @@ -214,7 +214,9 @@ { OUString(UNO_NAME_SHADOWCOLOR), SDRATTR_SHADOWCOLOR, ::cppu::UnoType<sal_Int32>::get(), 0, 0}, \ { OUString(UNO_NAME_SHADOWTRANSPARENCE),SDRATTR_SHADOWTRANSPARENCE, ::cppu::UnoType<sal_Int16>::get(), 0, 0}, \ { OUString(UNO_NAME_SHADOWXDIST), SDRATTR_SHADOWXDIST, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ - { OUString(UNO_NAME_SHADOWYDIST), SDRATTR_SHADOWYDIST, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, + { OUString(UNO_NAME_SHADOWYDIST), SDRATTR_SHADOWYDIST, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_SHADOWSIZEX), SDRATTR_SHADOWSIZEX, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_SHADOWSIZEY), SDRATTR_SHADOWSIZEY, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, #define LINE_PROPERTIES_DEFAULTS\ { OUString(UNO_NAME_LINECAP), XATTR_LINECAP, ::cppu::UnoType<css::drawing::LineCap>::get(), 0, 0}, \ diff --git a/oox/source/drawingml/effectproperties.cxx b/oox/source/drawingml/effectproperties.cxx index bbfee474b3f2..d1f07964b09e 100644 --- a/oox/source/drawingml/effectproperties.cxx +++ b/oox/source/drawingml/effectproperties.cxx @@ -23,6 +23,8 @@ void EffectShadowProperties::assignUsed(const EffectShadowProperties& rSourcePro { moShadowDist.assignIfUsed( rSourceProps.moShadowDist ); moShadowDir.assignIfUsed( rSourceProps.moShadowDir ); + moShadowSx.assignIfUsed( rSourceProps.moShadowSx ); + moShadowSy.assignIfUsed( rSourceProps.moShadowSy ); moShadowColor.assignIfUsed( rSourceProps.moShadowColor ); } @@ -48,6 +50,9 @@ void EffectProperties::pushToPropMap( PropertyMap& rPropMap, if( it->msName == "outerShdw" ) { sal_Int32 nAttrDir = 0, nAttrDist = 0; + sal_Int32 nAttrSizeX = 100000, nAttrSizeY = 100000; // If shadow size is %100=100000 (means equal to object's size), sx sy is not exists, + // Default values of sx, sy should be 100000 in this case. + std::map< OUString, css::uno::Any >::const_iterator attribIt = it->maAttribs.find( "dir" ); if( attribIt != it->maAttribs.end() ) attribIt->second >>= nAttrDir; @@ -56,6 +61,15 @@ void EffectProperties::pushToPropMap( PropertyMap& rPropMap, if( attribIt != it->maAttribs.end() ) attribIt->second >>= nAttrDist; + attribIt = it->maAttribs.find( "sx" ); + if( attribIt != it->maAttribs.end() ) + attribIt->second >>= nAttrSizeX; + + attribIt = it->maAttribs.find( "sy" ); + if( attribIt != it->maAttribs.end() ) + attribIt->second >>= nAttrSizeY; + + // Negative X or Y dist indicates left or up, respectively // Negative X or Y dist indicates left or up, respectively double nAngle = basegfx::deg2rad(static_cast<double>(nAttrDir) / PER_DEGREE); sal_Int32 nDist = convertEmuToHmm( nAttrDist ); @@ -65,6 +79,8 @@ void EffectProperties::pushToPropMap( PropertyMap& rPropMap, rPropMap.setProperty( PROP_Shadow, true ); rPropMap.setProperty( PROP_ShadowXDistance, nXDist); rPropMap.setProperty( PROP_ShadowYDistance, nYDist); + rPropMap.setProperty( PROP_ShadowSizeX, nAttrSizeX); + rPropMap.setProperty( PROP_ShadowSizeY, nAttrSizeY); rPropMap.setProperty( PROP_ShadowColor, it->moColor.getColor(rGraphicHelper ) ); rPropMap.setProperty( PROP_ShadowTransparence, it->moColor.getTransparency()); } diff --git a/oox/source/drawingml/effectproperties.hxx b/oox/source/drawingml/effectproperties.hxx index 146214cc9191..092ca62669ae 100644 --- a/oox/source/drawingml/effectproperties.hxx +++ b/oox/source/drawingml/effectproperties.hxx @@ -24,6 +24,8 @@ struct EffectShadowProperties { OptValue< sal_Int64 > moShadowDist; OptValue< sal_Int64 > moShadowDir; + OptValue< sal_Int64 > moShadowSx; + OptValue< sal_Int64 > moShadowSy; Color moShadowColor; /** Overwrites all members that are explicitly set in rSourceProps. */ diff --git a/oox/source/drawingml/effectpropertiescontext.cxx b/oox/source/drawingml/effectpropertiescontext.cxx index 4c779e75f1ef..40c132f3fb2c 100644 --- a/oox/source/drawingml/effectpropertiescontext.cxx +++ b/oox/source/drawingml/effectpropertiescontext.cxx @@ -83,6 +83,8 @@ ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement, mrEffectProperties.maShadow.moShadowDist = rAttribs.getInteger( XML_dist, 0 ); mrEffectProperties.maShadow.moShadowDir = rAttribs.getInteger( XML_dir, 0 ); + mrEffectProperties.maShadow.moShadowSx = rAttribs.getInteger( XML_sx, 0 ); + mrEffectProperties.maShadow.moShadowSy = rAttribs.getInteger( XML_sy, 0 ); return new ColorContext(*this, mrEffectProperties.m_Effects[nPos]->moColor); } break; diff --git a/oox/source/drawingml/shapepropertymap.cxx b/oox/source/drawingml/shapepropertymap.cxx index c6168be243ab..7a37c0641a93 100644 --- a/oox/source/drawingml/shapepropertymap.cxx +++ b/oox/source/drawingml/shapepropertymap.cxx @@ -49,7 +49,9 @@ static const ShapePropertyIds spnDefaultShapeIds = PROP_FillHatch, PROP_FillBackground, PROP_FillBitmapName, - PROP_ShadowXDistance + PROP_ShadowXDistance, + PROP_ShadowSizeX, + PROP_ShadowSizeY }; } // namespace diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index f53b73f8b79e..1f1a785063d8 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -443,6 +443,8 @@ SelectedPage Shadow ShadowColor ShadowFormat +ShadowSizeX +ShadowSizeY ShadowTransparence ShadowXDistance ShadowYDistance diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index cb9c2f50c909..edad8cd21132 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -374,9 +374,14 @@ namespace drawinglayer const basegfx::B2DVector aOffset( static_cast<double>(rSet.Get(SDRATTR_SHADOWXDIST).GetValue()), static_cast<double>(rSet.Get(SDRATTR_SHADOWYDIST).GetValue())); + + const basegfx::B2DVector aSize( + static_cast<double>(rSet.Get(SDRATTR_SHADOWSIZEX).GetValue()), + static_cast<double>(rSet.Get(SDRATTR_SHADOWSIZEY).GetValue())); + const Color aColor(rSet.Get(SDRATTR_SHADOWCOLOR).GetColorValue()); - return attribute::SdrShadowAttribute(aOffset, static_cast<double>(nTransparence) * 0.01, aColor.getBColor()); + return attribute::SdrShadowAttribute(aOffset, aSize, static_cast<double>(nTransparence) * 0.01, aColor.getBColor()); } } diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index 6787e0d5a322..d6822bfd1519 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -481,16 +481,26 @@ namespace drawinglayer Primitive2DContainer createEmbeddedShadowPrimitive( const Primitive2DContainer& rContent, - const attribute::SdrShadowAttribute& rShadow) + const attribute::SdrShadowAttribute& rShadow, + sal_Int32 nGraphicTranslateX, + sal_Int32 nGraphicTranslateY) { if(!rContent.empty()) { Primitive2DContainer aRetval(2); basegfx::B2DHomMatrix aShadowOffset; - // prepare shadow offset - aShadowOffset.set(0, 2, rShadow.getOffset().getX()); - aShadowOffset.set(1, 2, rShadow.getOffset().getY()); + { + if(rShadow.getSize().getX() != 100000) + { + // Scale the shadow + aShadowOffset.translate(-nGraphicTranslateX, -nGraphicTranslateY); + aShadowOffset.scale(rShadow.getSize().getX() * 0.00001, rShadow.getSize().getY() * 0.00001); + aShadowOffset.translate(nGraphicTranslateX, nGraphicTranslateY); + } + + aShadowOffset.translate(rShadow.getOffset().getX(), rShadow.getOffset().getY()); + } // create shadow primitive and add content aRetval[0] = Primitive2DReference( diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx index fa8c554fa0be..676b26183b09 100644 --- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx @@ -35,6 +35,7 @@ namespace drawinglayer void SdrGrafPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& /*aViewInformation*/) const { Primitive2DContainer aRetval; + basegfx::B2DTuple aTranslateGrf; // create unit outline polygon const basegfx::B2DPolygon& aUnitOutline(basegfx::utils::createUnitPolygon()); @@ -61,7 +62,10 @@ namespace drawinglayer getTransform(), getGraphicObject(), getGraphicAttr())); - + double fRotate = 0; + double fShearX = 0; + basegfx::B2DTuple aScaleGrf; + getTransform().decompose(aScaleGrf, aTranslateGrf, fRotate, fShearX); aRetval.push_back(xGraphicContentPrimitive); } @@ -122,7 +126,9 @@ namespace drawinglayer { aRetval = createEmbeddedShadowPrimitive( aRetval, - getSdrLFSTAttribute().getShadow()); + getSdrLFSTAttribute().getShadow(), + aTranslateGrf.getX(), + aTranslateGrf.getY()); } rContainer.insert(rContainer.end(), aRetval.begin(), aRetval.end()); diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 0a757b343c86..31cf34a76c73 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -139,6 +139,8 @@ SdrItemPool::SdrItemPool( rPoolDefaults[SDRATTR_SHADOWCOLOR -SDRATTR_START]=new XColorItem(SDRATTR_SHADOWCOLOR, aNullCol); rPoolDefaults[SDRATTR_SHADOWXDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWXDIST, 0); rPoolDefaults[SDRATTR_SHADOWYDIST -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWYDIST, 0); + rPoolDefaults[SDRATTR_SHADOWSIZEX -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWSIZEX, 100000); + rPoolDefaults[SDRATTR_SHADOWSIZEY -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWSIZEY, 100000); rPoolDefaults[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]=new SdrPercentItem(SDRATTR_SHADOWTRANSPARENCE, 0); rPoolDefaults[SDRATTR_SHADOW3D -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOW3D ); rPoolDefaults[SDRATTR_SHADOWPERSP -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOWPERSP ); -- 2.16.4 ++++++ libreoffice-6.4.2.2.tar.xz -> libreoffice-6.4.4.2.tar.xz ++++++ /work/SRC/openSUSE:Leap:15.2/libreoffice/libreoffice-6.4.2.2.tar.xz /work/SRC/openSUSE:Leap:15.2/.libreoffice.new.3606/libreoffice-6.4.4.2.tar.xz differ: char 25, line 1 ++++++ libreoffice-help-6.4.2.2.tar.xz -> libreoffice-help-6.4.4.2.tar.xz ++++++ /work/SRC/openSUSE:Leap:15.2/libreoffice/libreoffice-help-6.4.2.2.tar.xz /work/SRC/openSUSE:Leap:15.2/.libreoffice.new.3606/libreoffice-help-6.4.4.2.tar.xz differ: char 27, line 1 ++++++ libreoffice-translations-6.4.2.2.tar.xz -> libreoffice-translations-6.4.4.2.tar.xz ++++++ /work/SRC/openSUSE:Leap:15.2/libreoffice/libreoffice-translations-6.4.2.2.tar.xz /work/SRC/openSUSE:Leap:15.2/.libreoffice.new.3606/libreoffice-translations-6.4.4.2.tar.xz differ: char 25, line 1 ++++++ poppler-0.86.patch ++++++ >From c1adc0a7559340213d754db950fd68bfe9e5a651 Mon Sep 17 00:00:00 2001 From: Martin Whitaker <[email protected]> Date: Sun, 15 Mar 2020 13:14:34 +0000 Subject: [PATCH] Fix build with poppler 0.86.0. diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx index e9c2a407c279..16ad04bf660a 100644 --- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx +++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx @@ -563,7 +563,9 @@ void PDFOutDev::processLink(Link* link, Catalog*) if (!(pAction && pAction->getKind() == actionURI)) return; -#if POPPLER_CHECK_VERSION(0, 72, 0) +#if POPPLER_CHECK_VERSION(0, 86, 0) + const char* pURI = static_cast<LinkURI*>(pAction)->getURI().c_str(); +#elif POPPLER_CHECK_VERSION(0, 72, 0) const char* pURI = static_cast<LinkURI*>(pAction)->getURI()->c_str(); #else const char* pURI = static_cast<LinkURI*>(pAction)->getURI()->getCString(); -- 2.21.1 ++++++ replace-boost-bimap-in-sdext-pdfimport.patch ++++++ >From 193b49763a03d63ba79db50c1fa0563ec0d6b0c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <[email protected]> Date: Wed, 29 Jan 2020 12:44:52 +0000 Subject: [PATCH] replace boost::bimap in sdext pdfimport Change-Id: Ie324a0b81931bbd427483878a87beeca455ada18 --- sdext/source/pdfimport/inc/pdfiprocessor.hxx | 12 ++++------- sdext/source/pdfimport/tree/pdfiprocessor.cxx | 21 +++++++++++-------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/sdext/source/pdfimport/inc/pdfiprocessor.hxx b/sdext/source/pdfimport/inc/pdfiprocessor.hxx index 89f9d601b7b0..9e08d6a6a765 100644 --- a/sdext/source/pdfimport/inc/pdfiprocessor.hxx +++ b/sdext/source/pdfimport/inc/pdfiprocessor.hxx @@ -37,9 +37,6 @@ #include "treevisitorfactory.hxx" #include "genericelements.hxx" -#include <boost/bimap/bimap.hpp> -#include <boost/bimap/unordered_set_of.hpp> - namespace pdfi { @@ -160,10 +157,8 @@ namespace pdfi typedef std::unordered_map<sal_Int32,FontAttributes> IdToFontMap; typedef std::unordered_map<FontAttributes,sal_Int32,FontAttrHash> FontToIdMap; - typedef boost::bimaps::bimap< - boost::bimaps::unordered_set_of<GraphicsContext, GraphicsContextHash>, - boost::bimaps::unordered_set_of<sal_Int32> - > GCToIdBiMap; + typedef std::unordered_map<sal_Int32,GraphicsContext> IdToGCMap; + typedef std::unordered_map<GraphicsContext, sal_Int32, GraphicsContextHash> GCToIdMap; typedef std::vector<GraphicsContext> GraphicsContextStack; @@ -178,7 +173,8 @@ namespace pdfi GraphicsContextStack m_aGCStack; sal_Int32 m_nNextGCId; - GCToIdBiMap m_aGCToId; + IdToGCMap m_aIdToGC; + GCToIdMap m_aGCToId; ImageContainer m_aImages; diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx index c6baa7fee8b2..ed2eaf6510b9 100644 --- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx +++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx @@ -54,6 +54,7 @@ namespace pdfi m_aFontToId(), m_aGCStack(), m_nNextGCId( 1 ), + m_aIdToGC(), m_aGCToId(), m_aImages(), m_nPages(0), @@ -65,12 +66,13 @@ namespace pdfi aDefFont.isBold = false; aDefFont.isItalic = false; aDefFont.size = 10*PDFI_OUTDEV_RESOLUTION/72; - m_aIdToFont[ 0 ] = aDefFont; - m_aFontToId[ aDefFont ] = 0; + m_aIdToFont.insert({0, aDefFont}); + m_aFontToId.insert({aDefFont, 0}); GraphicsContext aDefGC; m_aGCStack.push_back( aDefGC ); - m_aGCToId.insert(GCToIdBiMap::relation(aDefGC, 0)); + m_aGCToId.insert({aDefGC, 0}); + m_aIdToGC.insert({0, aDefGC}); } void PDFIProcessor::setPageNum( sal_Int32 nPages ) @@ -468,12 +470,13 @@ const FontAttributes& PDFIProcessor::getFont( sal_Int32 nFontId ) const sal_Int32 PDFIProcessor::getGCId( const GraphicsContext& rGC ) { sal_Int32 nGCId = 0; - auto it = m_aGCToId.left.find( rGC ); - if( it != m_aGCToId.left.end() ) + auto it = m_aGCToId.find( rGC ); + if( it != m_aGCToId.end() ) nGCId = it->second; else { - m_aGCToId.insert(GCToIdBiMap::relation(rGC, m_nNextGCId)); + m_aGCToId.insert({rGC, m_nNextGCId}); + m_aIdToGC.insert({m_nNextGCId, rGC}); nGCId = m_nNextGCId; m_nNextGCId++; } @@ -483,9 +486,9 @@ sal_Int32 PDFIProcessor::getGCId( const GraphicsContext& rGC ) const GraphicsContext& PDFIProcessor::getGraphicsContext( sal_Int32 nGCId ) const { - auto it = m_aGCToId.right.find( nGCId ); - if( it == m_aGCToId.right.end() ) - it = m_aGCToId.right.find( 0 ); + auto it = m_aIdToGC.find( nGCId ); + if( it == m_aIdToGC.end() ) + it = m_aIdToGC.find( 0 ); return it->second; } -- 2.24.1
