summaryrefslogtreecommitdiff
path: root/starmath/qa/cppunit
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2010-12-06 21:26:08 +0000
committerCaolán McNamara <caolanm@redhat.com>2010-12-06 21:26:08 +0000
commit914691ae9acbeb3208ea9dae46e43c3d3fb9fab3 (patch)
tree2604720daa28a71ff9d2964f0794e80963fb8cec /starmath/qa/cppunit
parent18bda54f77ad948de59c38f884863e3fb24e7931 (diff)
cppunit: test optimal zoom
Diffstat (limited to 'starmath/qa/cppunit')
-rw-r--r--starmath/qa/cppunit/test_starmath.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx
index e5dc92dddd88..aab6942bda3c 100644
--- a/starmath/qa/cppunit/test_starmath.cxx
+++ b/starmath/qa/cppunit/test_starmath.cxx
@@ -280,7 +280,18 @@ void Test::tViewZoom()
{
sal_uInt16 nOrigZoom, nNextZoom, nFinalZoom;
+ EditEngine &rEditEngine = m_xDocShRef->GetEditEngine();
+
+ rtl::OUString sStringOne(RTL_CONSTASCII_USTRINGPARAM("a under b"));
+ {
+ rEditEngine.SetText(0, sStringOne);
+ m_xDocShRef->UpdateText();
+ rtl::OUString sFinalText = m_xDocShRef->GetText();
+ CPPUNIT_ASSERT_MESSAGE("Strings must match", sStringOne == sFinalText);
+ }
+
SmGraphicWindow &rGraphicWindow = m_pViewShell->GetGraphicWindow();
+ rGraphicWindow.SetSizePixel(Size(1024, 800));
nOrigZoom = rGraphicWindow.GetZoom();
{
@@ -296,6 +307,14 @@ void Test::tViewZoom()
nFinalZoom = rGraphicWindow.GetZoom();
CPPUNIT_ASSERT_MESSAGE("Should be equal", nFinalZoom == nOrigZoom);
}
+
+ {
+ SfxRequest aZoomOut(SID_FITINWINDOW, SFX_CALLMODE_SYNCHRON, m_pViewShell->GetPool());
+ m_pViewShell->Execute(aZoomOut);
+ nFinalZoom = rGraphicWindow.GetZoom();
+ CPPUNIT_ASSERT_MESSAGE("Should be about 800%", nFinalZoom > nOrigZoom);
+ }
+
}
void Test::testDocument()