summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@novell.com>2011-08-15 01:03:13 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2011-08-15 05:11:03 +0200
commite796bed98262852aee9d5b4f733a52ab6787b88d (patch)
tree102da5a70c0c19716c2ee5b018a3f74370cbcd28
parent424841035086c784e0573aa226cc13b74abe684b (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. Signed-off-by: Fridrich Štrba <fridrich.strba@bluewin.ch>
-rw-r--r--sd/source/ui/view/drviews3.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index d520a8b1c..ceab21b55 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