diff options
author | David Tardon <dtardon@redhat.com> | 2014-10-13 10:02:02 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-10-13 10:02:26 +0200 |
commit | 1c8695ecf65174298ebd9edb5b0289db07af98ca (patch) | |
tree | eeffb14f90dfeda6eab2713272c434074200da5d | |
parent | 376dae8117365166a6a9c7c280f5bf367570fefa (diff) |
boost::rational throws if 0 is passed as denominator
Change-Id: I312fd6b964555b3b4aa4e22cec6054c9a83b2c52
-rw-r--r-- | sd/source/ui/view/frmview.cxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index 470866dffd38..8f48aeca2f1f 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 ) { |