summaryrefslogtreecommitdiff
path: root/writerfilter/source/ooxml
diff options
context:
space:
mode:
authorBakos Attila <bakos.attilakaroly@nisz.hu>2020-02-11 11:43:48 +0100
committerLászló Németh <nemeth@numbertext.org>2020-02-21 16:08:51 +0100
commitad8857dab30e099a0cf6ec18d184a6c836b33317 (patch)
tree42530401d14bf11c693ff2dba081bd4d53515f3a /writerfilter/source/ooxml
parent4b3cccf59d200d96b1779bdd0d114b33597ef01e (diff)
tdf#130120 DOCX: export o:allowincell
Object anchors are set by allowincell/ LayoutInCell attributes in table cells. Export it by grab bag method temporarily, instead of using the suggested FollowTextFlow, related also to the missing GUI support. Follow-up of commit 14ad64270e4fbca3c24da6f55f260b1fb229556a (tdf#129888 DOCX shape import: handle o:allowincell) Change-Id: If883511b6114e8f60d673ecbd3a11095fcafddc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88438 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter/source/ooxml')
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 3c57e245d9c7..4aa381c9ebb5 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -34,6 +34,9 @@
#include "OOXMLFastContextHandler.hxx"
#include "OOXMLFactory.hxx"
#include "Handler.hxx"
+#include <dmapper/PropertyIds.hxx>
+#include <comphelper/propertysequence.hxx>
+#include <comphelper/sequenceashashmap.hxx>
static const sal_Unicode uCR = 0xd;
static const sal_Unicode uFtnEdnRef = 0x2;
@@ -1670,15 +1673,28 @@ void OOXMLFastContextHandlerShape::sendShape( Token_t Element )
//tdf#87569: Fix table layout with correcting anchoring
//If anchored object is in table, Word calculates its position from cell border
//instead of page (what is set in the sample document)
+ uno::Reference<beans::XPropertySet> xShapePropSet(xShape, uno::UNO_QUERY);
+ if(xShapePropSet && bIsPicture) //TODO make grabbag for textboxes as well
+ {
+ uno::Sequence<beans::PropertyValue> aShapeGrabBag;
+ xShapePropSet->getPropertyValue("InteropGrabBag") >>= aShapeGrabBag;
+ beans::PropertyValue aLayInCell;
+ aLayInCell.Name = "LayoutInCell";
+ aLayInCell.Value <<= mbLayoutInCell;
+ aShapeGrabBag.realloc(1+aShapeGrabBag.size());
+ aShapeGrabBag[aShapeGrabBag.size() -1] = aLayInCell;
+ xShapePropSet->setPropertyValue("InteropGrabBag", uno::makeAny(aShapeGrabBag));
+ }
if (mnTableDepth > 0 && mbLayoutInCell) //if we had a table
{
- uno::Reference<beans::XPropertySet> xShapePropSet(xShape, uno::UNO_QUERY);
sal_Int16 nCurrentHorOriRel; //A temp variable for storaging the current setting
xShapePropSet->getPropertyValue("HoriOrientRelation") >>= nCurrentHorOriRel;
//and the correction:
if (nCurrentHorOriRel == com::sun::star::text::RelOrientation::PAGE_FRAME)
+ {
xShapePropSet->setPropertyValue("HoriOrientRelation",
uno::makeAny(text::RelOrientation::FRAME));
+ }
}
// Notify the dmapper that the shape is ready to use
@@ -1754,6 +1770,7 @@ OOXMLFastContextHandlerShape::lcl_createFastChildContext
this);
//tdf129888 store allowincell attribute of the VML shape
+ mbLayoutInCell = true;
if (Attribs->hasAttribute(NMSP_vmlOffice | XML_allowincell))
mbLayoutInCell
= !(Attribs->getValue(NMSP_vmlOffice | XML_allowincell) == "f");