Kaydet (Commit) b240636a authored tarafından Thorsten Behrens's avatar Thorsten Behrens

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.
üst 7c1a620e
...@@ -709,8 +709,18 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) ...@@ -709,8 +709,18 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
const SvxNumberFormat& rFormat = rNumBulletItem.GetNumRule()->GetLevel(nOutlineLevel); const SvxNumberFormat& rFormat = rNumBulletItem.GetNumRule()->GetLevel(nOutlineLevel);
SvxNumberFormat aFormat(rFormat); SvxNumberFormat aFormat(rFormat);
// left margin always controls LRSpace item // left margin gets distributed onto LRSpace item
aLRSpaceItem.SetTxtLeft(rItem.GetTxtLeft() - aFormat.GetAbsLSpace()); // 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 // negative first line indent goes to the number
// format, positive to the lrSpace item // format, positive to the lrSpace item
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment