[Libreoffice-commits] .: sd/source
Thorsten Behrens
thorsten at kemper.freedesktop.org
Sun Aug 14 16:04:25 PDT 2011
sd/source/ui/view/drviews3.cxx | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
New commits:
commit b240636a5b1f7afa8ba3795ba520cbb3500e7236
Author: Thorsten Behrens <tbehrens at novell.com>
Date: Mon Aug 15 01:03:13 2011 +0200
Fix ruler to not generate negative left indent
This fixes n#707779 - previously, with larger number format
AbsLSpace, LRSpace's left indent could easily become negative -
which the EditEngine does not like at all & exhibits repaint
errors.
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index 2c3b0bd..6701a62 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -709,8 +709,18 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
const SvxNumberFormat& rFormat = rNumBulletItem.GetNumRule()->GetLevel(nOutlineLevel);
SvxNumberFormat aFormat(rFormat);
- // left margin always controls LRSpace item
- aLRSpaceItem.SetTxtLeft(rItem.GetTxtLeft() - aFormat.GetAbsLSpace());
+ // left margin gets distributed onto LRSpace item
+ // and number format AbsLSpace - this fixes
+ // n#707779 (previously, LRSpace left indent could
+ // become negative - EditEngine really does not
+ // like that.
+ const short nAbsLSpace=aFormat.GetAbsLSpace();
+ const long nTxtLeft=rItem.GetTxtLeft();
+ const long nLeftIndent=std::max(0L,nTxtLeft - nAbsLSpace);
+ aLRSpaceItem.SetTxtLeft(nLeftIndent);
+ // control for clipped left indent - remainder
+ // reduces number format first line indent
+ aFormat.SetAbsLSpace(nTxtLeft - nLeftIndent);
// negative first line indent goes to the number
// format, positive to the lrSpace item
More information about the Libreoffice-commits
mailing list