[Libreoffice-commits] core.git: sw/inc sw/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 18 17:25:02 UTC 2019
sw/inc/fmtwrapinfluenceonobjpos.hxx | 5 +++++
sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx | 11 +++++++++++
2 files changed, 16 insertions(+)
New commits:
commit c3940a9fb2de7ba09f7d82497491918fd9bb3d0e
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Sep 18 16:55:58 2019 +0200
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Sep 18 19:23:53 2019 +0200
Related: tdf#124600 sw anchored object allow overlap: add doc model
This is initial code to support DOCX's <wp:anchor ... allowOverlap="0">
markup as a full feature in core. Currently anchored objects can
unconditionally overlap, the new bool allows opting in to prevent that.
Layout is not yet using the new
SwFormatWrapInfluenceOnObjPos::GetAllowOverlap(), to be done in a
follow-up commit.
Change-Id: I2f299571223c039741c81860ea17d42cd63140b3
Reviewed-on: https://gerrit.libreoffice.org/79105
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
Tested-by: Jenkins
diff --git a/sw/inc/fmtwrapinfluenceonobjpos.hxx b/sw/inc/fmtwrapinfluenceonobjpos.hxx
index 8d2b4a73032c..8e56be1ed653 100644
--- a/sw/inc/fmtwrapinfluenceonobjpos.hxx
+++ b/sw/inc/fmtwrapinfluenceonobjpos.hxx
@@ -28,6 +28,8 @@ class SW_DLLPUBLIC SwFormatWrapInfluenceOnObjPos: public SfxPoolItem
{
private:
sal_Int16 mnWrapInfluenceOnPosition;
+ /// Allow objects to overlap, permitted by default.
+ bool mbAllowOverlap = true;
public:
@@ -55,6 +57,9 @@ public:
sal_Int16 GetWrapInfluenceOnObjPos(
const bool _bIterativeAsOnceConcurrent = false ) const;
+ void SetAllowOverlap(bool bAllowOverlap);
+ bool GetAllowOverlap() const;
+
void dumpAsXml(xmlTextWriterPtr pWriter) const override;
};
diff --git a/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx b/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
index bda1f3d136a5..0a1ef3221e94 100644
--- a/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
+++ b/sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx
@@ -125,11 +125,22 @@ sal_Int16 SwFormatWrapInfluenceOnObjPos::GetWrapInfluenceOnObjPos(
return nWrapInfluenceOnPosition;
}
+void SwFormatWrapInfluenceOnObjPos::SetAllowOverlap(bool bAllowOverlap)
+{
+ mbAllowOverlap = bAllowOverlap;
+}
+
+bool SwFormatWrapInfluenceOnObjPos::GetAllowOverlap() const
+{
+ return mbAllowOverlap;
+}
+
void SwFormatWrapInfluenceOnObjPos::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatWrapInfluenceOnObjPos"));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nWrapInfluenceOnPosition"), BAD_CAST(OString::number(mnWrapInfluenceOnPosition).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("mbAllowOverlap"), BAD_CAST(OString::boolean(mbAllowOverlap).getStr()));
xmlTextWriterEndElement(pWriter);
}
More information about the Libreoffice-commits
mailing list