[Libreoffice-commits] core.git: sd/source

David Tardon dtardon at redhat.com
Mon Oct 13 01:03:31 PDT 2014


 sd/source/ui/view/frmview.cxx |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

New commits:
commit 1c8695ecf65174298ebd9edb5b0289db07af98ca
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Oct 13 10:02:02 2014 +0200

    boost::rational throws if 0 is passed as denominator
    
    Change-Id: I312fd6b964555b3b4aa4e22cec6054c9a83b2c52

diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx
index 470866d..8f48aec 100644
--- a/sd/source/ui/view/frmview.cxx
+++ b/sd/source/ui/view/frmview.cxx
@@ -874,19 +874,31 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
             }
             else if ( pValue->Name == sUNO_View_GridSnapWidthXNumerator )
             {
-                pValue->Value >>= aSnapGridWidthXNum;
+                sal_Int32 nValue = 0;
+                pValue->Value >>= nValue;
+                if (nValue != 0) // 0 is allowed, but it doesn't make any sense...
+                    aSnapGridWidthXNum = nValue;
             }
             else if ( pValue->Name == sUNO_View_GridSnapWidthXDenominator )
             {
-                pValue->Value >>= aSnapGridWidthXDom;
+                sal_Int32 nValue = 0;
+                pValue->Value >>= nValue;
+                if (nValue != 0)
+                    aSnapGridWidthXDom = nValue;
             }
             else if ( pValue->Name == sUNO_View_GridSnapWidthYNumerator )
             {
-                pValue->Value >>= aSnapGridWidthYNum;
+                sal_Int32 nValue = 0;
+                pValue->Value >>= nValue;
+                if (nValue != 0) // 0 is allowed, but it doesn't make any sense...
+                    aSnapGridWidthYNum = nValue;
             }
             else if ( pValue->Name == sUNO_View_GridSnapWidthYDenominator )
             {
-                pValue->Value >>= aSnapGridWidthYDom;
+                sal_Int32 nValue = 0;
+                pValue->Value >>= nValue;
+                if (nValue != 0)
+                    aSnapGridWidthYDom = nValue;
             }
             else if (!bImpress && pValue->Name == sUNO_View_VisibleLayers  )
             {


More information about the Libreoffice-commits mailing list