diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-05-30 15:01:40 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2017-06-10 20:02:18 +0200 |
commit | fdc9bdb8a7b4e432022079b593023b0e28746cae (patch) | |
tree | b473ff091d464772236e04b2f7d97e08cb15e75a /writerfilter | |
parent | 9db9c8e04958a30a954e7176ab3556a8cb397fca (diff) |
Watermark: RTF import / export
* "wzName" should contain shape name
* MS Word watermark has text inside the "gtextUNICODE"
(do not create additional shptxt)
Change-Id: I7929ec83a9219d6087d36ccbf6d7e735acf63722
Reviewed-on: https://gerrit.libreoffice.org/38219
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfsdrimport.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index fa05c83e9e02..d71bcf972d81 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/text/WrapTextMode.hpp> #include <com/sun/star/text/WritingMode.hpp> #include <com/sun/star/text/TextContentAnchorType.hpp> +#include <com/sun/star/text/XTextRange.hpp> #include <ooxml/resourceids.hxx> #include <filter/msfilter/escherex.hxx> #include <filter/msfilter/util.hxx> @@ -376,6 +377,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap boost::logic::tribool obFlipH(boost::logic::indeterminate); boost::logic::tribool obFlipV(boost::logic::indeterminate); + OUString aShapeText = ""; bool bCustom(false); int const nType = initShape(xShape, xPropertySet, bCustom, rShape, bClose, shapeOrPict); @@ -397,6 +399,8 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap } else if (rProperty.first == "wzDescription") xPropertySet->setPropertyValue("Description", uno::makeAny(rProperty.second)); + else if (rProperty.first == "gtextUNICODE") + aShapeText = rProperty.second; else if (rProperty.first == "pib") { m_rImport.setDestinationText(rProperty.second); @@ -854,6 +858,14 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap xDefaulter->createCustomShapeDefaults(OUString::number(nType)); } + // Set shape text + if (bCustom && !aShapeText.isEmpty()) + { + uno::Reference<text::XTextRange> xTextRange(xShape, uno::UNO_QUERY); + if (xTextRange.is()) + xTextRange->setString(aShapeText); + } + // Creating CustomShapeGeometry property std::vector<beans::PropertyValue> aGeometry; if (aViewBox.X || aViewBox.Y || aViewBox.Width || aViewBox.Height) |