summaryrefslogtreecommitdiff
path: root/sw/source/core/txtnode/fntcap.cxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-05-20 14:44:03 +0200
committerLuboš Luňák <l.lunak@suse.cz>2011-05-20 14:56:39 +0200
commita20e84fbc295b565f12be55af853a6d3dce54a30 (patch)
tree37f183b948d7c68b96d79a7fe1b06d5ad5f45eb0 /sw/source/core/txtnode/fntcap.cxx
parentde9eba79bdd312bc40674a368679513d086a90ae (diff)
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 :-/.
Diffstat (limited to 'sw/source/core/txtnode/fntcap.cxx')
-rw-r--r--sw/source/core/txtnode/fntcap.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx
index 5696984a7dce..98337825271b 100644
--- a/sw/source/core/txtnode/fntcap.cxx
+++ b/sw/source/core/txtnode/fntcap.cxx
@@ -622,8 +622,13 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo )
else
pBigFont = pLastFont;
- // Hier entsteht der Kleinbuchstabenfont:
- aFont.SetProportion( (aFont.GetPropr() * SMALL_CAPS_PERCENTAGE ) / 100L );
+ // Older LO versions had 66 as the small caps percentage size, later changed to 80,
+ // therefore a backwards compatibility option is kept (otherwise layout is changed).
+ // NOTE: There are more uses of SMALL_CAPS_PERCENTAGE in editeng, but it seems they
+ // do not matter for Writer (and if they did it'd be pretty ugly to propagate
+ // the option there).
+ int smallCapsPercentage = smallCapsPercentage66 ? 66 : SMALL_CAPS_PERCENTAGE;
+ aFont.SetProportion( (aFont.GetPropr() * smallCapsPercentage ) / 100L );
pMagic2 = NULL;
nIndex2 = 0;
SwFntAccess *pSmallFontAccess = new SwFntAccess( pMagic2, nIndex2, &aFont,