diff options
author | Justin Luth <justin.luth@collabora.com> | 2019-10-15 20:49:07 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2019-10-17 06:23:00 +0200 |
commit | f51cd77bcecc5134e0e04c398bfb7b34eb65d68d (patch) | |
tree | 277bd77d3de6758313027ea4855b44cf6a59e619 /writerfilter | |
parent | f0340d58cc0f2808ce8003099ff2a0495360f267 (diff) |
tdf#108350 writerfilter: restore TimesNewRoman as default font
Followup for LO 5.4 commit 6f2ad89b33d972f9642bb53eeb91f41df3b6b0e6
which set Calibri/11pt as default. That is true if there is
no style.xml file, or more specifically if there is no
DocDefaults rPrDefault node. But if that node exists, then
the age-old defaults are still valid.
Earlier in LO 4.3, the default templates changed to use
Liberation fonts by default. But in the same vein as using Calibri
(and depending on LO to fallback to Carlito), set Word's default
Times New Roman font and depend on LO to fallback to Liberation.
That will make it better for MSWord users who share the document
and who have less likelihood of knowing about Liberation/Carlito.
Note that 10pt fontsize was already added to m_pDefaultCharProps
earlier, so that part was already reset long ago.
Change-Id: I3ba8a529fe95b05fbe2889cf1ebdbabb25963e8b
Reviewed-on: https://gerrit.libreoffice.org/80854
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/StyleSheetTable.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index bf1ed75c9f9f..05fb9e9b57d9 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -1460,6 +1460,8 @@ void StyleSheetTable::applyDefaults(bool bParaProperties) m_pImpl->m_rDMapper.GetTextFactory()->createInstance("com.sun.star.text.Defaults"), uno::UNO_QUERY_THROW ); } + + // WARNING: these defaults only take effect IF there is a DocDefaults style section. Normally there is, but not always. if( bParaProperties && m_pImpl->m_pDefaultParaProps.get()) { // tdf#87533 LO will have different defaults here, depending on the locale. Import with documented defaults @@ -1494,6 +1496,12 @@ void StyleSheetTable::applyDefaults(bool bParaProperties) } if( !bParaProperties && m_pImpl->m_pDefaultCharProps.get()) { + // tdf#108350: Earlier in DomainMapper for DOCX, Calibri/11pt was set to match MSWord 2007+, + // but that is valid only if DocDefaults_rPrDefault is omitted. + // Now that DocDefaults_rPrDefault is known, the defaults should be reset to Times New Roman/10pt. + if ( m_pImpl->m_rDMapper.IsOOXMLImport() ) + m_pImpl->m_xTextDefaults->setPropertyValue( getPropertyName(PROP_CHAR_FONT_NAME), css::uno::Any(OUString("Times New Roman")) ); + const uno::Sequence< beans::PropertyValue > aPropValues = m_pImpl->m_pDefaultCharProps->GetPropertyValues(); for( const auto& rPropValue : aPropValues ) { |