Kaydet (Commit) b95d203b authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

fdo#53175: Don't load the default values of the styles in writerfilter

...or we may have some additional properties set on some styles.

Change-Id: I5a5d307931a2a6c1f25bd2da93381d8de65c2480
üst 4967a9d8
...@@ -93,7 +93,8 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd ...@@ -93,7 +93,8 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd
LABEL_DOCUMENT, LABEL_DOCUMENT,
PURGE_OLE, PURGE_OLE,
KERN_ASIAN_PUNCTUATION, KERN_ASIAN_PUNCTUATION,
MATH_BASELINE_ALIGNMENT MATH_BASELINE_ALIGNMENT,
STYLES_NODEFAULT
}; };
public: public:
......
...@@ -566,6 +566,7 @@ private: ...@@ -566,6 +566,7 @@ private:
// floating screen objects as given by its // floating screen objects as given by its
// attribute 'WrapInfluenceOnObjPos'. // attribute 'WrapInfluenceOnObjPos'.
bool mbMathBaselineAlignment : 1; // TL 2010-10-29 #i972# bool mbMathBaselineAlignment : 1; // TL 2010-10-29 #i972#
bool mbStylesNoDefault : 1;
// non-ui-compatibility flags: // non-ui-compatibility flags:
bool mbOldNumbering : 1; bool mbOldNumbering : 1;
......
...@@ -209,6 +209,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const ...@@ -209,6 +209,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
case KERN_ASIAN_PUNCTUATION: return mbKernAsianPunctuation; case KERN_ASIAN_PUNCTUATION: return mbKernAsianPunctuation;
case DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT: return mbDoNotResetParaAttrsForNumFont; case DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT: return mbDoNotResetParaAttrsForNumFont;
case MATH_BASELINE_ALIGNMENT: return mbMathBaselineAlignment; case MATH_BASELINE_ALIGNMENT: return mbMathBaselineAlignment;
case STYLES_NODEFAULT: return mbStylesNoDefault;
default: default:
OSL_FAIL("Invalid setting id"); OSL_FAIL("Invalid setting id");
} }
...@@ -377,6 +378,9 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value) ...@@ -377,6 +378,9 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
case MATH_BASELINE_ALIGNMENT: case MATH_BASELINE_ALIGNMENT:
mbMathBaselineAlignment = value; mbMathBaselineAlignment = value;
break; break;
case STYLES_NODEFAULT:
mbStylesNoDefault = value;
break;
default: default:
OSL_FAIL("Invalid setting id"); OSL_FAIL("Invalid setting id");
} }
......
This diff is collapsed.
...@@ -125,7 +125,8 @@ enum SwDocumentSettingsPropertyHandles ...@@ -125,7 +125,8 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_COLLAPSE_EMPTY_CELL_PARA, HANDLE_COLLAPSE_EMPTY_CELL_PARA,
HANDLE_SMALL_CAPS_PERCENTAGE_66, HANDLE_SMALL_CAPS_PERCENTAGE_66,
HANDLE_TAB_OVERFLOW, HANDLE_TAB_OVERFLOW,
HANDLE_UNBREAKABLE_NUMBERINGS HANDLE_UNBREAKABLE_NUMBERINGS,
HANDLE_STYLES_NODEFAULT
}; };
MasterPropertySetInfo * lcl_createSettingsInfo() MasterPropertySetInfo * lcl_createSettingsInfo()
...@@ -188,6 +189,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo() ...@@ -188,6 +189,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo()
{ RTL_CONSTASCII_STRINGPARAM("SmallCapsPercentage66"), HANDLE_SMALL_CAPS_PERCENTAGE_66, CPPUTYPE_BOOLEAN, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("SmallCapsPercentage66"), HANDLE_SMALL_CAPS_PERCENTAGE_66, CPPUTYPE_BOOLEAN, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("TabOverflow"), HANDLE_TAB_OVERFLOW, CPPUTYPE_BOOLEAN, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("TabOverflow"), HANDLE_TAB_OVERFLOW, CPPUTYPE_BOOLEAN, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("UnbreakableNumberings"), HANDLE_UNBREAKABLE_NUMBERINGS, CPPUTYPE_BOOLEAN, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("UnbreakableNumberings"), HANDLE_UNBREAKABLE_NUMBERINGS, CPPUTYPE_BOOLEAN, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("StylesNoDefault"), HANDLE_STYLES_NODEFAULT, CPPUTYPE_BOOLEAN, 0, 0},
/* /*
* As OS said, we don't have a view when we need to set this, so I have to * As OS said, we don't have a view when we need to set this, so I have to
* find another solution before adding them to this property set - MTG * find another solution before adding them to this property set - MTG
...@@ -747,6 +749,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf ...@@ -747,6 +749,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
mpDoc->set(IDocumentSettingAccess::UNBREAKABLE_NUMBERINGS, bTmp); mpDoc->set(IDocumentSettingAccess::UNBREAKABLE_NUMBERINGS, bTmp);
} }
break; break;
case HANDLE_STYLES_NODEFAULT:
{
sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
mpDoc->set(IDocumentSettingAccess::STYLES_NODEFAULT, bTmp);
}
break;
default: default:
throw UnknownPropertyException(); throw UnknownPropertyException();
} }
...@@ -1119,6 +1127,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf ...@@ -1119,6 +1127,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
rValue.setValue( &bTmp, ::getBooleanCppuType() ); rValue.setValue( &bTmp, ::getBooleanCppuType() );
} }
break; break;
case HANDLE_STYLES_NODEFAULT:
{
sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::STYLES_NODEFAULT );
rValue.setValue( &bTmp, ::getBooleanCppuType() );
}
break;
default: default:
throw UnknownPropertyException(); throw UnknownPropertyException();
} }
......
...@@ -173,6 +173,9 @@ void WriterFilter::setTargetDocument( const uno::Reference< lang::XComponent >& ...@@ -173,6 +173,9 @@ void WriterFilter::setTargetDocument( const uno::Reference< lang::XComponent >&
uno::Reference< beans::XPropertySet > xSettings( xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY ); uno::Reference< beans::XPropertySet > xSettings( xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY );
xSettings->setPropertyValue( "UnbreakableNumberings", uno::makeAny( sal_True ) ); xSettings->setPropertyValue( "UnbreakableNumberings", uno::makeAny( sal_True ) );
// Don't load the default style definitions to avoid weird mix
xSettings->setPropertyValue( "StylesNoDefault", uno::makeAny( sal_True ) );
} }
void WriterFilter::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc ) void WriterFilter::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment