[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sd/source

Fridrich Strba fridrich at kemper.freedesktop.org
Sun Aug 14 20:11:34 PDT 2011


 sd/source/ui/view/drviews3.cxx |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit e796bed98262852aee9d5b4f733a52ab6787b88d
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.
    
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>

diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index d520a8b..ceab21b 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