diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-05-30 15:01:40 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-06-07 10:35:24 +0200 |
commit | 9d1edef89b5a8cb333dfdd12631a9fa2ce3d482d (patch) | |
tree | 861937b8c319b47642e18176ab30652b7f8540bb /writerfilter | |
parent | f5375d5539897bff0aef82df92b7d485b8839004 (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 fe13f2f2833c..6df5a0cf9f97 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) |