Accepting request 804990 from LibreOffice:6.4
- Fix Bug 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 OBS-URL: https://build.opensuse.org/request/show/804990 OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=877
This commit is contained in:
parent
5ced1b02f8
commit
1732ddcc18
90
bsc1160687-1.diff
Normal file
90
bsc1160687-1.diff
Normal file
@ -0,0 +1,90 @@
|
||||
From fda60625c9e8bbc0259c790e7da76e608a012451 Mon Sep 17 00:00:00 2001
|
||||
From: Miklos Vajna <vmiklos@collabora.com>
|
||||
Date: Mon, 27 Apr 2020 10:54:27 +0200
|
||||
Subject: [PATCH] DOCX import: handle <wp:positionH
|
||||
relativeFrom="insideMargin">
|
||||
|
||||
This is the same as page, but it is from-left on odd pages and
|
||||
from-right on even pages, i.e. our "mirror on even pages" mode.
|
||||
|
||||
(cherry picked from commit fccbb557add457db16e0556c3f0172cafc2cf981)
|
||||
|
||||
Conflicts:
|
||||
writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx
|
||||
|
||||
Change-Id: I018e0ac165a3d802f64cfc314d5c5f58da3cb580
|
||||
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93003
|
||||
Tested-by: Jenkins
|
||||
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
||||
---
|
||||
|
||||
diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx
|
||||
index 3339156ae3b2..9168ad51eebd 100644
|
||||
--- a/writerfilter/source/dmapper/GraphicHelpers.cxx
|
||||
+++ b/writerfilter/source/dmapper/GraphicHelpers.cxx
|
||||
@@ -102,6 +102,11 @@ void PositionHandler::lcl_attribute( Id aName, Value& rVal )
|
||||
m_nRelation = text::RelOrientation::PAGE_FRAME;
|
||||
break;
|
||||
|
||||
+ case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_insideMargin:
|
||||
+ m_nRelation = text::RelOrientation::PAGE_FRAME;
|
||||
+ m_bPageToggle = true;
|
||||
+ break;
|
||||
+
|
||||
case NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_column:
|
||||
m_nRelation = text::RelOrientation::FRAME;
|
||||
break;
|
||||
diff --git a/writerfilter/source/dmapper/GraphicHelpers.hxx b/writerfilter/source/dmapper/GraphicHelpers.hxx
|
||||
index dbfe9ddd9f13..d28f2fb50bf7 100644
|
||||
--- a/writerfilter/source/dmapper/GraphicHelpers.hxx
|
||||
+++ b/writerfilter/source/dmapper/GraphicHelpers.hxx
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
sal_Int16 orientation() const;
|
||||
sal_Int16 relation() const { return m_nRelation;}
|
||||
sal_Int32 position() const { return m_nPosition;}
|
||||
+ bool GetPageToggle() const { return m_bPageToggle; }
|
||||
private:
|
||||
virtual void lcl_attribute( Id aName, Value& rVal ) override;
|
||||
virtual void lcl_sprm( Sprm& rSprm ) override;
|
||||
@@ -45,6 +46,7 @@ public:
|
||||
sal_Int32 m_nPosition;
|
||||
std::pair<OUString, OUString>& m_rPositionOffsets;
|
||||
std::pair<OUString, OUString>& m_rAligns;
|
||||
+ bool m_bPageToggle = false;
|
||||
};
|
||||
|
||||
class WrapHandler: public LoggedProperties
|
||||
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
|
||||
index 97c807752f60..a2c19383c95d 100644
|
||||
--- a/writerfilter/source/dmapper/GraphicImport.cxx
|
||||
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
|
||||
@@ -193,6 +193,7 @@ public:
|
||||
|
||||
sal_Int16 nHoriOrient;
|
||||
sal_Int16 nHoriRelation;
|
||||
+ bool bPageToggle = false;
|
||||
sal_Int16 nVertOrient;
|
||||
sal_Int16 nVertRelation;
|
||||
text::WrapTextMode nWrap;
|
||||
@@ -343,8 +344,8 @@ public:
|
||||
uno::makeAny(nLeftPosition));
|
||||
xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_HORI_ORIENT_RELATION ),
|
||||
uno::makeAny(nHoriRelation));
|
||||
- xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_PAGE_TOGGLE ),
|
||||
- uno::makeAny(false));
|
||||
+ xGraphicObjectProperties->setPropertyValue(getPropertyName(PROP_PAGE_TOGGLE),
|
||||
+ uno::makeAny(bPageToggle));
|
||||
if (!bRelativeOnly)
|
||||
xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_VERT_ORIENT_POSITION),
|
||||
uno::makeAny(nTopPosition));
|
||||
@@ -1089,6 +1090,7 @@ void GraphicImport::lcl_sprm(Sprm& rSprm)
|
||||
if( !m_pImpl->bUseSimplePos )
|
||||
{
|
||||
m_pImpl->nHoriRelation = pHandler->relation();
|
||||
+ m_pImpl->bPageToggle = pHandler->GetPageToggle();
|
||||
m_pImpl->nHoriOrient = pHandler->orientation();
|
||||
m_pImpl->nLeftPosition = pHandler->position();
|
||||
|
||||
--
|
||||
2.26.1
|
||||
|
44
bsc1160687-2.diff
Normal file
44
bsc1160687-2.diff
Normal file
@ -0,0 +1,44 @@
|
||||
From e00329729e1fd18fa452e91820a81964d5527e6d Mon Sep 17 00:00:00 2001
|
||||
From: Miklos Vajna <vmiklos@collabora.com>
|
||||
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 <vmiklos@collabora.com>
|
||||
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
|
||||
|
125
bsc1160687-3.diff
Normal file
125
bsc1160687-3.diff
Normal file
@ -0,0 +1,125 @@
|
||||
From 9e170a5def6ce48c8273843d13bd5bbb43b802da Mon Sep 17 00:00:00 2001
|
||||
From: Jan-Marek Glogowski <jan-marek.glogowski@extern.cib.de>
|
||||
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 <glogow@fbihome.de>
|
||||
(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
|
||||
|
44
bsc1160687-4.diff
Normal file
44
bsc1160687-4.diff
Normal file
@ -0,0 +1,44 @@
|
||||
From c91584ef805866b46b06fe7451b077f9f33419b4 Mon Sep 17 00:00:00 2001
|
||||
From: Miklos Vajna <vmiklos@collabora.com>
|
||||
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 <vmiklos@collabora.com>
|
||||
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
|
||||
|
141
bsc1160687-5.diff
Normal file
141
bsc1160687-5.diff
Normal file
@ -0,0 +1,141 @@
|
||||
From 49f0501f8ba4acd36067a84590469944e9d3234c Mon Sep 17 00:00:00 2001
|
||||
From: Miklos Vajna <vmiklos@collabora.com>
|
||||
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
|
||||
|
56
bsc1160687-6.diff
Normal file
56
bsc1160687-6.diff
Normal file
@ -0,0 +1,56 @@
|
||||
From d29f4857da385db17fe9efd4157c0a021531d0c4 Mon Sep 17 00:00:00 2001
|
||||
From: Miklos Vajna <vmiklos@collabora.com>
|
||||
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
|
||||
|
95
bsc1160687-7.diff
Normal file
95
bsc1160687-7.diff
Normal file
@ -0,0 +1,95 @@
|
||||
From 1b9c1803f6f42adc23f65ff4182c15192c4b7b92 Mon Sep 17 00:00:00 2001
|
||||
From: Miklos Vajna <vmiklos@collabora.com>
|
||||
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 <vmiklos@collabora.com>
|
||||
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
|
||||
|
156
bsc1160687-8.diff
Normal file
156
bsc1160687-8.diff
Normal file
@ -0,0 +1,156 @@
|
||||
From b6969472df1564351f10af94ea373af6e7435aab Mon Sep 17 00:00:00 2001
|
||||
From: Miklos Vajna <vmiklos@collabora.com>
|
||||
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
|
||||
|
@ -1,3 +1,16 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue May 12 08:57:23 UTC 2020 - Andras Timar <andras.timar@collabora.com>
|
||||
|
||||
- Fix Bug 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 <andras.timar@collabora.com>
|
||||
|
||||
|
@ -103,6 +103,15 @@ 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
|
||||
Patch10: bsc1160687-1.diff
|
||||
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
|
||||
@ -962,6 +971,14 @@ Provides %{langname} translations and additional resources (help files, etc.) fo
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
%patch990 -p1
|
||||
%patch991 -p1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user