summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2018-07-24 20:05:25 +0300
committerJustin Luth <justin_luth@sil.org>2018-08-06 07:29:38 +0200
commit46780892cd3c49c27fdeb4566b7407602901e98f (patch)
tree3d0a6207a8db9d10e3b2bb64fe587b5508e9c27a
parent2b5d38649f6f8db8532f9944af87f5dbc1a05a63 (diff)
related tdf#103961 writerfilter: DocDefaults -> defaults
Effectively should be an NonFunctional Change. Both LO and .docx format have an ability to specify document-wide properties. However, on import the defaults are being directly applied to the styles, and no internal defaults were being set. This patch changes it so that the style:default-style for the paragraph family gets the DocDefaults. Now "Standard" is treated just like any other style. This just opens up more possibilities for the future. Currently, the lack of export support hinders doing anything further. Thus the defaults are still being directly applied to the styles. Change-Id: Ibd1225c5a2dd021b4ce2e57241f0ee99969a0c68 Reviewed-on: https://gerrit.libreoffice.org/57932 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx15
1 files changed, 5 insertions, 10 deletions
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 95d645a08bb1..2e1a2732063f 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -958,8 +958,6 @@ void StyleSheetTable::ApplyStyleSheets( const FontTablePtr& rFontTable )
}
xStyles->getByName( sConvertedStyleName ) >>= xStyle;
- // Standard is handled already in applyDefaults().
- if (sConvertedStyleName != "Standard")
{
StyleSheetTable_Impl::SetPropertiesToDefault(xStyle);
@@ -1024,8 +1022,7 @@ void StyleSheetTable::ApplyStyleSheets( const FontTablePtr& rFontTable )
else if( bParaStyle )
{
// Paragraph styles that don't inherit from some parent need to apply the DocDefaults
- if ( sConvertedStyleName != "Standard" )
- pEntry->pProperties->InsertProps( m_pImpl->m_pDefaultParaProps, /*bAllowOverwrite=*/false );
+ pEntry->pProperties->InsertProps( m_pImpl->m_pDefaultParaProps, /*bAllowOverwrite=*/false );
//now it's time to set the default parameters - for paragraph styles
//Fonts: Western first entry in font table
@@ -1532,18 +1529,16 @@ void StyleSheetTable::applyDefaults(bool bParaProperties)
uno::Reference<container::XNameAccess> xStyleFamilies = xStylesSupplier->getStyleFamilies();
uno::Reference<container::XNameAccess> xParagraphStyles;
xStyleFamilies->getByName("ParagraphStyles") >>= xParagraphStyles;
- uno::Reference<beans::XPropertySet> xStandard;
- xParagraphStyles->getByName("Standard") >>= xStandard;
-
- uno::Reference<style::XStyle> xStyle(xStandard, uno::UNO_QUERY);
- StyleSheetTable_Impl::SetPropertiesToDefault(xStyle);
+ uno::Reference<beans::XPropertySet> xDefault;
+ // This is the built-in default style that every style inherits from
+ xParagraphStyles->getByName("Paragraph style") >>= xDefault;
uno::Sequence< beans::PropertyValue > aPropValues = m_pImpl->m_pDefaultParaProps->GetPropertyValues();
for( sal_Int32 i = 0; i < aPropValues.getLength(); ++i )
{
try
{
- xStandard->setPropertyValue(aPropValues[i].Name, aPropValues[i].Value);
+ xDefault->setPropertyValue(aPropValues[i].Name, aPropValues[i].Value);
}
catch( const uno::Exception& )
{