From eea95136da32d09a6f82a99583dd8c158d96c1d9 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Fri, 20 May 2011 14:44:03 +0200 Subject: compatibility option for old size of small caps (bnc#691473) Version 3.2 had 66 as the small capitals size percentage, later changed to 80 (see e.g. http://openoffice.org/bugzilla/show_bug.cgi?id=1526). This however can destroy layout of old documents that rely on the old size. So for backwards compatibility the old value is used if either the .odt document has an option enabled or does not have the option at all (meaning it's an older .odt document). There's unfortunately a period when the new value was already in effect where this change can break those documents :-/. Signed-off-by: Cedric Bosdonnat Signed-off-by: Michael Meeks Signed-off-by: Jan Holesovsky --- sw/source/ui/uno/SwXDocumentSettings.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'sw/source/ui/uno/SwXDocumentSettings.cxx') diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index a9d2f0b9b9c0..3fb2202b2a16 100644 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -122,7 +122,8 @@ enum SwDocumentSettingsPropertyHandles HANDLE_MODIFYPASSWORDINFO, HANDLE_MATH_BASELINE_ALIGNMENT, HANDLE_INVERT_BORDER_SPACING, - HANDLE_COLLAPSE_EMPTY_CELL_PARA + HANDLE_COLLAPSE_EMPTY_CELL_PARA, + HANDLE_SMALL_CAPS_PERCENTAGE_66 }; MasterPropertySetInfo * lcl_createSettingsInfo() @@ -180,6 +181,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo() { RTL_CONSTASCII_STRINGPARAM("MathBaselineAlignment"), HANDLE_MATH_BASELINE_ALIGNMENT, CPPUTYPE_BOOLEAN, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("InvertBorderSpacing"), HANDLE_INVERT_BORDER_SPACING, CPPUTYPE_BOOLEAN, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("CollapseEmptyCellPara"), HANDLE_COLLAPSE_EMPTY_CELL_PARA, CPPUTYPE_BOOLEAN, 0, 0}, + { RTL_CONSTASCII_STRINGPARAM("SmallCapsPercentage66"), HANDLE_SMALL_CAPS_PERCENTAGE_66, CPPUTYPE_BOOLEAN, 0, 0}, /* * 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 @@ -705,6 +707,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf mpDoc->set(IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA, bTmp); } break; + case HANDLE_SMALL_CAPS_PERCENTAGE_66: + { + sal_Bool bTmp = *(sal_Bool*)rValue.getValue(); + mpDoc->set(IDocumentSettingAccess::SMALL_CAPS_PERCENTAGE_66, bTmp); + } + break; default: throw UnknownPropertyException(); } @@ -1050,6 +1058,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf rValue.setValue( &bTmp, ::getBooleanCppuType() ); } break; + case HANDLE_SMALL_CAPS_PERCENTAGE_66: + { + sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::SMALL_CAPS_PERCENTAGE_66 ); + rValue.setValue( &bTmp, ::getBooleanCppuType() ); + } + break; default: throw UnknownPropertyException(); } -- cgit v1.2.3