diff options
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/crsr/bookmrk.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/doc/doc.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/doc/docnew.cxx | 1 | ||||
-rw-r--r-- | sw/source/core/inc/swfont.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/txtnode/fntcap.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/txtnode/swfont.cxx | 7 |
6 files changed, 24 insertions, 4 deletions
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 30039539de96..3c039f917d4a 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -84,7 +84,8 @@ namespace rStart.nNode.GetNode().GetTxtNode(); SwTxtNode const*const pEndTxtNode = rEnd.nNode.GetNode().GetTxtNode(); const sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(rStart.nContent.GetIndex()); - xub_StrLen nEndPos = rEnd == rStart ? rEnd.nContent.GetIndex() : rEnd.nContent.GetIndex() - 1; + xub_StrLen nEndPos = ( rEnd == rStart || rEnd.nContent.GetIndex() == 0 ) ? + rEnd.nContent.GetIndex() : rEnd.nContent.GetIndex() - 1; const sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar( nEndPos ); SwPaM aStartPaM(rStart); SwPaM aEndPaM(rEnd); diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 7c4e1984b819..e9ea7e9f30b0 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -201,6 +201,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const case TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST: return mbTabAtLeftIndentForParagraphsInList; case INVERT_BORDER_SPACING: return mbInvertBorderSpacing; case COLLAPSE_EMPTY_CELL_PARA: return mbCollapseEmptyCellPara; + case SMALL_CAPS_PERCENTAGE_66: return mbSmallCapsPercentage66; case BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the ViewShell has to be asked! case HTML_MODE: return mbHTMLMode; @@ -331,6 +332,10 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value) case COLLAPSE_EMPTY_CELL_PARA: mbCollapseEmptyCellPara = value; break; + + case SMALL_CAPS_PERCENTAGE_66: + mbSmallCapsPercentage66 = value; + break; // COMPATIBILITY FLAGS END case BROWSE_MODE: //can be used temporary (load/save) when no ViewShell is avaiable diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 5c18528525f7..439f83901aff 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -356,6 +356,7 @@ SwDoc::SwDoc() mbTabAtLeftIndentForParagraphsInList = false; // hidden #i89181# mbInvertBorderSpacing = false; // hidden mbCollapseEmptyCellPara = true; // hidden + mbSmallCapsPercentage66 = false; // hidden // // COMPATIBILITY FLAGS END diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index f0cf7bab6a32..d99e368d861f 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -58,8 +58,9 @@ class SwSubFont : public SvxFont sal_uInt16 nOrgHeight; // Hoehe inkl. Escapement/Proportion sal_uInt16 nOrgAscent; // Ascent inkl. Escapement/Proportion sal_uInt16 nPropWidth; // proportional width + bool smallCapsPercentage66; inline SwSubFont() : aSize(0,0) - { pMagic = NULL; nFntIndex = nOrgHeight = nOrgAscent = 0; nPropWidth =100; } + { pMagic = NULL; nFntIndex = nOrgHeight = nOrgAscent = 0; nPropWidth =100; smallCapsPercentage66 = false; } sal_uInt16 CalcEscAscent( const sal_uInt16 nOldAscent ) const; sal_uInt16 CalcEscHeight( const sal_uInt16 nOldHeight, 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, diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index cfa8036ecdce..35216ec19983 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -560,6 +560,12 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, SetVertical( pAttrSet->GetCharRotate().GetValue() ); else SetVertical( 0 ); + if( pIDocumentSettingAccess && pIDocumentSettingAccess->get( IDocumentSettingAccess::SMALL_CAPS_PERCENTAGE_66 )) + { + aSub[ SW_LATIN ].smallCapsPercentage66 = true; + aSub[ SW_CJK ].smallCapsPercentage66 = true; + aSub[ SW_CTL ].smallCapsPercentage66 = true; + } } SwSubFont& SwSubFont::operator=( const SwSubFont &rFont ) @@ -571,6 +577,7 @@ SwSubFont& SwSubFont::operator=( const SwSubFont &rFont ) nOrgAscent = rFont.nOrgAscent; nPropWidth = rFont.nPropWidth; aSize = rFont.aSize; + smallCapsPercentage66 = rFont.smallCapsPercentage66; return *this; } |