diff options
author | Thorsten Behrens <tbehrens@novell.com> | 2011-08-15 01:03:13 +0200 |
---|---|---|
committer | Thorsten Behrens <tbehrens@novell.com> | 2011-08-15 01:04:04 +0200 |
commit | b240636a5b1f7afa8ba3795ba520cbb3500e7236 (patch) | |
tree | 91c25024a98bdd7ec70529572b18f91ff4f14b8c /sd | |
parent | 7c1a620eca8f24f08d690b65d224ddf56042bdef (diff) |
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.
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/drviews3.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index 2c3b0bd4a796..6701a62656a5 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 |