summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2018-12-18 14:13:09 +0100
committerLászló Németh <nemeth@numbertext.org>2018-12-19 07:57:46 +0100
commit69ce3374f90847f357249a41118314508da6bb98 (patch)
tree9448aba709a8bbc9d68482bdaad02f185b38c5fb /writerfilter/source/dmapper
parent05cbfa4cca3dc77dcdcdd5d87de7baf37485d852 (diff)
tdf#99631 DOCX import: keep zoom of embedded XLSX
OLE objects by importing their VisibleArea settings This also reverts commit 5c1a6c9adb5ccfbb869a0a7ac730d8860a1bf405 "tdf#99631 DOCX import: set 1:1 scale in embedded XLSX". Change-Id: I73dc945c86d0200e72767810b2ff39f233729080 Reviewed-on: https://gerrit.libreoffice.org/65343 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter/source/dmapper')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx8
-rw-r--r--writerfilter/source/dmapper/OLEHandler.cxx12
-rw-r--r--writerfilter/source/dmapper/OLEHandler.hxx4
3 files changed, 24 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 1a0238e59fac..244969372080 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1753,6 +1753,14 @@ void DomainMapper_Impl::appendOLE( const OUString& rStreamName, const std::share
xOLEProperties->setPropertyValue(getPropertyName( PROP_HEIGHT ),
uno::makeAny(aSize.Height));
+ OUString aVisAreaWidth = pOLEHandler->GetVisAreaWidth();
+ if(!aVisAreaWidth.isEmpty())
+ xOLEProperties->setPropertyValue("VisibleAreaWidth", uno::makeAny(aVisAreaWidth));
+
+ OUString aVisAreaHeight = pOLEHandler->GetVisAreaHeight();
+ if(!aVisAreaHeight.isEmpty())
+ xOLEProperties->setPropertyValue("VisibleAreaHeight", uno::makeAny(aVisAreaHeight));
+
uno::Reference< graphic::XGraphic > xGraphic = pOLEHandler->getReplacement();
xOLEProperties->setPropertyValue(getPropertyName( PROP_GRAPHIC ),
uno::makeAny(xGraphic));
diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx
index dee9ceb22ae1..fad449489e3c 100644
--- a/writerfilter/source/dmapper/OLEHandler.cxx
+++ b/writerfilter/source/dmapper/OLEHandler.cxx
@@ -95,8 +95,10 @@ void OLEHandler::lcl_attribute(Id rName, Value & rVal)
rVal.getAny() >>= m_xInputStream;
break;
case NS_ooxml::LN_CT_Object_dxaOrig:
+ m_sVisAreaWidth = sStringValue;
break;
case NS_ooxml::LN_CT_Object_dyaOrig:
+ m_sVisAreaHeight = sStringValue;
break;
case NS_ooxml::LN_shape:
{
@@ -262,6 +264,16 @@ OUString const & OLEHandler::GetDrawAspect() const
return m_sDrawAspect;
}
+OUString const & OLEHandler::GetVisAreaWidth() const
+{
+ return m_sVisAreaWidth;
+}
+
+OUString const & OLEHandler::GetVisAreaHeight() const
+{
+ return m_sVisAreaHeight;
+}
+
OUString OLEHandler::copyOLEOStream(
uno::Reference<text::XTextDocument> const& xTextDocument)
{
diff --git a/writerfilter/source/dmapper/OLEHandler.hxx b/writerfilter/source/dmapper/OLEHandler.hxx
index 6ba2fb34ae1a..b0aae530f37a 100644
--- a/writerfilter/source/dmapper/OLEHandler.hxx
+++ b/writerfilter/source/dmapper/OLEHandler.hxx
@@ -52,6 +52,8 @@ class OLEHandler : public LoggedProperties
OUString m_sProgId;
OUString m_sShapeId;
OUString m_sDrawAspect;
+ OUString m_sVisAreaWidth;
+ OUString m_sVisAreaHeight;
OUString m_sObjectId;
OUString m_sr_id;
/// The stream URL right after the import of the raw data.
@@ -90,6 +92,8 @@ public:
OUString getCLSID(const css::uno::Reference<css::uno::XComponentContext>& xComponentContext) const;
OUString const & GetDrawAspect() const;
+ OUString const & GetVisAreaWidth() const;
+ OUString const & GetVisAreaHeight() const;
OUString copyOLEOStream(css::uno::Reference<css::text::XTextDocument> const& xTextDocument);