[Libreoffice-commits] .: 2 commits - writerfilter/debug_setup.mk writerfilter/source
Miklos Vajna
vmiklos at kemper.freedesktop.org
Sat Apr 14 14:36:21 PDT 2012
writerfilter/debug_setup.mk | 1 +
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 20 ++++++++++++++++++++
writerfilter/source/dmapper/SettingsTable.cxx | 22 +++++++++++++---------
writerfilter/source/dmapper/SettingsTable.hxx | 3 +++
4 files changed, 37 insertions(+), 9 deletions(-)
New commits:
commit 8adbd3df42ee18fe58455ac92a44bca4f76444c9
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Sat Apr 14 23:31:19 2012 +0200
dmapper: parse NS_ooxml::LN_CT_Zoom_percent token
The VisibleBottom and ZoomType properties are just set as it seems
without that, SwView::ReadUserDataSequence() ignores the ZoomFactor as
well.
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index de03396..3c4e8eb 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -74,6 +74,8 @@
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/util/XNumberFormats.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/document/XViewDataSupplier.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
#include <rtl/ustrbuf.hxx>
#include <rtl/string.h>
#include <rtl/oustringostreaminserter.hxx>
@@ -3543,6 +3545,24 @@ void DomainMapper_Impl::ApplySettingsTable()
aSpacing.Height = sal_Int16(115);
xTextDefaults->setPropertyValue(rSupplier.GetName(PROP_PARA_LINE_SPACING), uno::makeAny(aSpacing));
}
+
+ if (m_pSettingsTable->GetZoomFactor())
+ {
+ uno::Sequence<beans::PropertyValue> aViewProps(3);
+ aViewProps[0].Name = "ZoomFactor";
+ aViewProps[0].Value <<= m_pSettingsTable->GetZoomFactor();
+ aViewProps[1].Name = "VisibleBottom";
+ aViewProps[1].Value <<= sal_Int32(0);
+ aViewProps[2].Name = "ZoomType";
+ aViewProps[2].Value <<= sal_Int16(0);
+
+ uno::Reference<container::XIndexContainer> xBox(m_xComponentContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.IndexedPropertyValues",
+ m_xComponentContext), uno::UNO_QUERY );
+ xBox->insertByIndex(sal_Int32(0), uno::makeAny(aViewProps));
+ uno::Reference<container::XIndexAccess> xIndexAccess(xBox, uno::UNO_QUERY);
+ uno::Reference<document::XViewDataSupplier> xViewDataSupplier(m_xTextDocument, uno::UNO_QUERY);
+ xViewDataSupplier->setViewData(xIndexAccess);
+ }
}
catch(const uno::Exception& )
{
diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx
index 870ce6f..1012d7b 100644
--- a/writerfilter/source/dmapper/SettingsTable.cxx
+++ b/writerfilter/source/dmapper/SettingsTable.cxx
@@ -75,6 +75,7 @@ struct SettingsTable_Impl
::rtl::OUString m_sHash;
::rtl::OUString m_sSalt;
bool m_bLinkStyles;
+ sal_Int16 m_nZoomFactor;
SettingsTable_Impl( DomainMapper& rDMapper, const uno::Reference< lang::XMultiServiceFactory > xTextFactory ) :
m_rDMapper( rDMapper )
@@ -92,6 +93,7 @@ struct SettingsTable_Impl
, m_nCryptAlgorithmType(NS_ooxml::LN_Value_wordprocessingml_ST_AlgType_typeAny)
, m_nCryptSpinCount(0)
, m_bLinkStyles(false)
+ , m_nZoomFactor(0)
{}
};
@@ -111,16 +113,13 @@ SettingsTable::~SettingsTable()
void SettingsTable::lcl_attribute(Id nName, Value & val)
{
- (void) nName;
int nIntValue = val.getInt();
- (void)nIntValue;
- ::rtl::OUString sValue = val.getString();
- (void)sValue;
switch(nName)
{
- //case NS_ooxml:::
- //break;
+ case NS_ooxml::LN_CT_Zoom_percent:
+ m_pImpl->m_nZoomFactor = nIntValue;
+ break;
default:
{
#ifdef DEBUG_DMAPPER_SETTINGS_TABLE
@@ -226,6 +225,11 @@ bool SettingsTable::GetLinkStyles() const
return m_pImpl->m_bLinkStyles;
}
+sal_Int16 SettingsTable::GetZoomFactor() const
+{
+ return m_pImpl->m_nZoomFactor;
+}
+
void SettingsTable::ApplyProperties( uno::Reference< text::XTextDocument > xDoc )
{
uno::Reference< beans::XPropertySet> xDocProps( xDoc, uno::UNO_QUERY );
diff --git a/writerfilter/source/dmapper/SettingsTable.hxx b/writerfilter/source/dmapper/SettingsTable.hxx
index 79e095a..3d9a560 100644
--- a/writerfilter/source/dmapper/SettingsTable.hxx
+++ b/writerfilter/source/dmapper/SettingsTable.hxx
@@ -67,6 +67,9 @@ class WRITERFILTER_DLLPRIVATE SettingsTable : public LoggedProperties, public Lo
/// Automatically update styles from document template?
bool GetLinkStyles() const;
+ /// What's the zoom factor set in percents?
+ sal_Int16 GetZoomFactor() const;
+
void ApplyProperties( uno::Reference< text::XTextDocument > xDoc );
private:
commit 9a8c2db542618b7a6d242b9d3257f23f54007682
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Sat Apr 14 19:31:10 2012 +0200
dmapper: log unhandled attributes in the settings table
diff --git a/writerfilter/debug_setup.mk b/writerfilter/debug_setup.mk
index a618171..95681da 100644
--- a/writerfilter/debug_setup.mk
+++ b/writerfilter/debug_setup.mk
@@ -12,5 +12,6 @@ $(if $(filter-out 0 1,$(strip $(gb_DEBUGLEVEL))),\
-DDEBUG_DMAPPER_PROPERTY_MAP \
-DDEBUG_DMAPPER_TABLE_HANDLER \
-DDEBUG_TABLE \
+ -DDEBUG_DMAPPER_SETTINGS_TABLE \
)
endef
diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx
index 8d53198..870ce6f 100644
--- a/writerfilter/source/dmapper/SettingsTable.cxx
+++ b/writerfilter/source/dmapper/SettingsTable.cxx
@@ -117,17 +117,17 @@ void SettingsTable::lcl_attribute(Id nName, Value & val)
::rtl::OUString sValue = val.getString();
(void)sValue;
-#if 0 //no values known, yet
-
- switch(Name)
+ switch(nName)
{
- case NS_ooxml:::
- break;
+ //case NS_ooxml:::
+ //break;
default:
{
+#ifdef DEBUG_DMAPPER_SETTINGS_TABLE
+ dmapper_logger->element("unhandled");
+#endif
}
}
-#endif
}
void SettingsTable::lcl_sprm(Sprm& rSprm)
More information about the Libreoffice-commits
mailing list