[Libreoffice-commits] .: writerfilter/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Aug 27 05:09:29 PDT 2012
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 7 +++++++
writerfilter/source/dmapper/SettingsTable.cxx | 10 ++++++++++
writerfilter/source/dmapper/SettingsTable.hxx | 2 ++
writerfilter/source/filter/ImportFilter.cxx | 2 --
4 files changed, 19 insertions(+), 2 deletions(-)
New commits:
commit 93cdd851ee5917fa95e78d84734c73055b0edc4e
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Mon Aug 27 14:06:12 2012 +0200
n#775899 docx import of w:usePrinterMetrics compat option
This was set unconditionally, but it turns out it's not the default for
docx, it's triggered by a compat flag there as well.
Change-Id: I84dccfe7ffd49fbc6878b19ff4276f8a36b827a3
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 18e8c45..bc0871c 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/container/XIndexReplace.hpp>
#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/document/PrinterIndependentLayout.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -3663,6 +3664,12 @@ void DomainMapper_Impl::ApplySettingsTable()
uno::Reference<document::XViewDataSupplier> xViewDataSupplier(m_xTextDocument, uno::UNO_QUERY);
xViewDataSupplier->setViewData(xIndexAccess);
}
+
+ if (m_pSettingsTable->GetUsePrinterMetrics())
+ {
+ uno::Reference< beans::XPropertySet > xSettings(m_xTextFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY);
+ xSettings->setPropertyValue("PrinterIndependentLayout", uno::makeAny(document::PrinterIndependentLayout::DISABLED));
+ }
}
catch(const uno::Exception&)
{
diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx
index c2dc342..c28b45b 100644
--- a/writerfilter/source/dmapper/SettingsTable.cxx
+++ b/writerfilter/source/dmapper/SettingsTable.cxx
@@ -68,6 +68,7 @@ struct SettingsTable_Impl
bool m_bLinkStyles;
sal_Int16 m_nZoomFactor;
bool m_bEvenAndOddHeaders;
+ bool m_bUsePrinterMetrics;
SettingsTable_Impl( DomainMapper& rDMapper, const uno::Reference< lang::XMultiServiceFactory > xTextFactory ) :
m_rDMapper( rDMapper )
@@ -87,6 +88,7 @@ struct SettingsTable_Impl
, m_bLinkStyles(false)
, m_nZoomFactor(0)
, m_bEvenAndOddHeaders(false)
+ , m_bUsePrinterMetrics(false)
{}
};
@@ -194,6 +196,9 @@ void SettingsTable::lcl_sprm(Sprm& rSprm)
resolveSprmProps(*this, rSprm);
}
break;
+ case NS_ooxml::LN_CT_Compat_usePrinterMetrics:
+ m_pImpl->m_bUsePrinterMetrics = nIntValue;
+ break;
default:
{
#ifdef DEBUG_DMAPPER_SETTINGS_TABLE
@@ -226,6 +231,11 @@ sal_Int16 SettingsTable::GetZoomFactor() const
return m_pImpl->m_nZoomFactor;
}
+bool SettingsTable::GetUsePrinterMetrics() const
+{
+ return m_pImpl->m_bUsePrinterMetrics;
+}
+
bool SettingsTable::GetEvenAndOddHeaders() const
{
return m_pImpl->m_bEvenAndOddHeaders;
diff --git a/writerfilter/source/dmapper/SettingsTable.hxx b/writerfilter/source/dmapper/SettingsTable.hxx
index 965636b..6c30f37 100644
--- a/writerfilter/source/dmapper/SettingsTable.hxx
+++ b/writerfilter/source/dmapper/SettingsTable.hxx
@@ -63,6 +63,8 @@ class WRITERFILTER_DLLPRIVATE SettingsTable : public LoggedProperties, public Lo
bool GetEvenAndOddHeaders() const;
+ bool GetUsePrinterMetrics() const;
+
void ApplyProperties( uno::Reference< text::XTextDocument > xDoc );
private:
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx
index e51bd96..8e60b56 100644
--- a/writerfilter/source/filter/ImportFilter.cxx
+++ b/writerfilter/source/filter/ImportFilter.cxx
@@ -23,7 +23,6 @@
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/document/PrinterIndependentLayout.hpp>
#include <comphelper/mediadescriptor.hxx>
#include <oox/core/filterdetect.hxx>
#include <dmapper/DomainMapper.hxx>
@@ -179,7 +178,6 @@ void WriterFilter::setTargetDocument( const uno::Reference< lang::XComponent >&
xSettings->setPropertyValue( "StylesNoDefault", uno::makeAny( sal_True ) );
xSettings->setPropertyValue("FloattableNomargins", uno::makeAny( sal_True ));
- xSettings->setPropertyValue("PrinterIndependentLayout", uno::makeAny(document::PrinterIndependentLayout::DISABLED));
}
void WriterFilter::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc )
More information about the Libreoffice-commits
mailing list