From 78419248217f693905fff691da091ff62de63a15 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 7 Dec 2010 11:17:24 +0000 Subject: cppunit: test zoom limits --- starmath/qa/cppunit/test_starmath.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'starmath/qa') diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx index 1b08ae019bc4..0cfadd035b0b 100644 --- a/starmath/qa/cppunit/test_starmath.cxx +++ b/starmath/qa/cppunit/test_starmath.cxx @@ -376,6 +376,24 @@ void Test::tViewZoom() nFinalZoom = rGraphicWindow.GetZoom(); CPPUNIT_ASSERT_MESSAGE("Should be 50%", nFinalZoom == 50); } + + { + SfxItemSet aSet(m_xDocShRef->GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM); + aSet.Put(SvxZoomItem(SVX_ZOOM_PERCENT, 5)); + SfxRequest aZoom(SID_ATTR_ZOOM, SFX_CALLMODE_SYNCHRON, aSet); + m_pViewShell->Execute(aZoom); + nFinalZoom = rGraphicWindow.GetZoom(); + CPPUNIT_ASSERT_MESSAGE("Should be Clipped to 25%", nFinalZoom == 25); + } + + { + SfxItemSet aSet(m_xDocShRef->GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM); + aSet.Put(SvxZoomItem(SVX_ZOOM_PERCENT, 1000)); + SfxRequest aZoom(SID_ATTR_ZOOM, SFX_CALLMODE_SYNCHRON, aSet); + m_pViewShell->Execute(aZoom); + nFinalZoom = rGraphicWindow.GetZoom(); + CPPUNIT_ASSERT_MESSAGE("Should be Clipped to 800%", nFinalZoom == 800); + } } void Test::testDocument() -- cgit