summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorZolnai Tamás <zolnaitamas2000@gmail.com>2013-08-16 14:45:32 +0200
committerZolnai Tamás <zolnaitamas2000@gmail.com>2013-08-18 09:49:51 +0200
commitc956bde226ffd646ab6ca0c72d50a375ae52edb3 (patch)
tree8454b2d3b58fcb3377d36d91ecab28afb749b9a7 /sw
parent835d9e0da9416c7e586766ad734f45d048886e0a (diff)
Make drop caps border a bit more robust
Decrease the minimum size of the drop caps letters to 0 and handle the case when padding is too big. Change-Id: I10f76ddffe9d19f82afbe3226ebe3aa8ba70da89
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/txtdrop.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index 49337ba2dab7..500b5e094430 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -802,7 +802,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTxtFormatInfo &rInf )
// for growing controll
long nMax = KSHRT_MAX;
- long nMin = nFactor / 2;
+ long nMin = 0;
#if OSL_DEBUG_LEVEL > 1
long nGrow = 0;
#endif
@@ -889,6 +889,16 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTxtFormatInfo &rInf )
rFnt.SetProportion( nOldProp );
// Modify the bounding rectangle with the borders
+ // Robust: If the padding is so big as drop cap letter has no enough space than
+ // remove all padding.
+ if( rFnt.GetTopBorderSpace() + rFnt.GetBottomBorderSpace() >= nWishedHeight )
+ {
+ rFnt.SetTopBorderDist(0);
+ rFnt.SetBottomBorderDist(0);
+ rFnt.SetRightBorderDist(0);
+ rFnt.SetLeftBorderDist(0);
+ }
+
if( rFnt.GetTopBorder() )
{
aRect.setHeight(aRect.GetHeight() + rFnt.GetTopBorderSpace());