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

Petr Mladek pmladek at kemper.freedesktop.org
Thu Apr 28 06:59:39 PDT 2011


 editeng/source/editeng/impedit3.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 796bd6da745128e24eec6cf386ae8a9469c03307
Author: Radek Doulik <rodo at novell.com>
Date:   Thu Apr 28 15:57:29 2011 +0200

    svx-fix-fit-to-frame-crash.diff:  fix for crash on Windows (bnc#508621)
    
    root cause unknown

diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index a2546cb..1a40527 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -934,7 +934,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY )
                         long nCurPos = nTmpWidth+nStartX;
                         // consider scaling
                         if ( aStatus.DoStretch() && ( nStretchX != 100 ) )
-                            nCurPos = nCurPos*100/nStretchX;
+                            nCurPos = nCurPos*100/std::max(static_cast<sal_Int32>(nStretchX), static_cast<sal_Int32>(1));
 
                         short nAllSpaceBeforeText = static_cast< short >(rLRItem.GetTxtLeft()/* + rLRItem.GetTxtLeft()*/ + nSpaceBeforeAndMinLabelWidth);
                         aCurrentTab.aTabStop = pNode->GetContentAttribs().FindTabStop( nCurPos - nAllSpaceBeforeText /*rLRItem.GetTxtLeft()*/, aEditDoc.GetDefTab() );


More information about the Libreoffice-commits mailing list