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-16 14:22:26 +0200 |
commit | 952a2c2cbace5987e81731d1f648e260053a1c77 (patch) | |
tree | fe754f6eff3bfc2d7f8b27239eea0dbc51b7b04d /writerfilter | |
parent | 9a7ae73f17cbb20850f8e5ffc87123334be67e49 (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>
(cherry picked from commit 9d1edef89b5a8cb333dfdd12631a9fa2ce3d482d)
Reviewed-on: https://gerrit.libreoffice.org/38871
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
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 16a65806a6ce..13a2de3a14e0 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) |