[Libreoffice-commits] .: 2 commits - starmath/qa sw/source
Caolán McNamara
caolan at kemper.freedesktop.org
Mon Dec 6 13:27:45 PST 2010
starmath/qa/cppunit/test_starmath.cxx | 19 +++++++++++++++++++
sw/source/core/text/itrtxt.hxx | 9 +++++++--
2 files changed, 26 insertions(+), 2 deletions(-)
New commits:
commit a73272d873b7f370b46076b4b7df148c7a19ab23
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 6 21:26:08 2010 +0000
cppunit: test optimal zoom
diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx
index e5dc92d..aab6942 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()
commit 510ee53fbadba4ae27c71d6f0bc7848cf0915353
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 6 19:57:06 2010 +0000
cppcheck: init some member variables
diff --git a/sw/source/core/text/itrtxt.hxx b/sw/source/core/text/itrtxt.hxx
index 9419a86..3d4a9a4 100644
--- a/sw/source/core/text/itrtxt.hxx
+++ b/sw/source/core/text/itrtxt.hxx
@@ -66,8 +66,13 @@ protected:
// Zuruecksetzen in die erste Zeile.
void Init();
void CtorInitTxtIter( SwTxtFrm *pFrm, SwTxtInfo *pInf );
- inline SwTxtIter(SwTxtNode* pTxtNode) : SwAttrIter(pTxtNode) { }
-
+ inline SwTxtIter(SwTxtNode* pTxtNode)
+ : SwAttrIter(pTxtNode)
+ , pFrm(NULL)
+ , pInf(NULL)
+ , pCurr(NULL)
+ , pPrev(NULL)
+ {}
public:
inline SwTxtIter( SwTxtFrm *pTxtFrm, SwTxtInfo *pTxtInf ) : SwAttrIter(pTxtFrm!=NULL?pTxtFrm->GetTxtNode():NULL)
{ CtorInitTxtIter( pTxtFrm, pTxtInf ); }
More information about the Libreoffice-commits
mailing list