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

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Sat Sep 19 11:03:19 UTC 2020


 sd/qa/unit/import-tests.cxx |   38 +++++++++++++++++---------------------
 1 file changed, 17 insertions(+), 21 deletions(-)

New commits:
commit 49c03a624084a63b4cb7f6a23dd803ea66e4bb33
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sat Sep 19 12:08:20 2020 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Sat Sep 19 13:02:45 2020 +0200

    Remove commented parts + reindent
    
    Code commented since initial adding of the test:
    author  Muthu Subramanian <sumuthu at suse.com>    2012-08-14 17:04:40 +0530
    committer       Muthu Subramanian <sumuthu at suse.com>    2012-08-14 17:04:40 +0530
    commit  3ccb8dac1405dc4ffa0ca3c45bd0724cc339d8ad (patch)
    tree    1fe5ae808b41458624624a9cd29502aa5bb290ad
    parent  e3acf19c0502b0758359b56abda81e504d167630 (diff)
    Adding unit test case for n#759180
    
    Change-Id: I85d58e7e0d1a595e2780612808bb8c51c1fb880e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103032
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index b9e549ab0ea4..70f1ceb38e4b 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -448,28 +448,24 @@ void SdImportTest::testN759180()
 
     const SdrPage *pPage = GetPage( 1, xDocShRef );
 
-    //sal_uIntPtr nObjs = pPage->GetObjCount();
-    //for (sal_uIntPtr i = 0; i < nObjs; i++)
+    // Get the object
+    SdrObject *pObj = pPage->GetObj(0);
+    SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
+    CPPUNIT_ASSERT(pTxtObj);
+    std::vector<EECharAttrib> rLst;
+    const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
+    const SvxULSpaceItem *pULSpace = aEdit.GetParaAttribs(0).GetItem(EE_PARA_ULSPACE);
+    CPPUNIT_ASSERT(pULSpace);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Para bottom spacing is wrong!", static_cast<sal_uInt16>(0), pULSpace->GetLower());
+    aEdit.GetCharAttribs(1, rLst);
+    auto it = std::find_if(rLst.rbegin(), rLst.rend(),
+        [](const EECharAttrib& rCharAttr) { return dynamic_cast<const SvxFontHeightItem *>(rCharAttr.pAttr) != nullptr; });
+    if (it != rLst.rend())
     {
-        // Get the object
-        SdrObject *pObj = pPage->GetObj(0);
-        SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj );
-        CPPUNIT_ASSERT(pTxtObj);
-        std::vector<EECharAttrib> rLst;
-        const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
-        const SvxULSpaceItem *pULSpace = aEdit.GetParaAttribs(0).GetItem(EE_PARA_ULSPACE);
-        CPPUNIT_ASSERT(pULSpace);
-        CPPUNIT_ASSERT_EQUAL_MESSAGE( "Para bottom spacing is wrong!", static_cast<sal_uInt16>(0), pULSpace->GetLower());
-        aEdit.GetCharAttribs(1, rLst);
-        auto it = std::find_if(rLst.rbegin(), rLst.rend(),
-            [](const EECharAttrib& rCharAttr) { return dynamic_cast<const SvxFontHeightItem *>(rCharAttr.pAttr) != nullptr; });
-        if (it != rLst.rend())
-        {
-            const SvxFontHeightItem * pFontHeight = dynamic_cast<const SvxFontHeightItem *>((*it).pAttr);
-            // nStart == 9
-            // font height = 5 => 5*2540/72
-            CPPUNIT_ASSERT_EQUAL_MESSAGE( "Font height is wrong", static_cast<sal_uInt32>(176), pFontHeight->GetHeight() );
-        }
+        const SvxFontHeightItem * pFontHeight = dynamic_cast<const SvxFontHeightItem *>((*it).pAttr);
+        // nStart == 9
+        // font height = 5 => 5*2540/72
+        CPPUNIT_ASSERT_EQUAL_MESSAGE( "Font height is wrong", static_cast<sal_uInt32>(176), pFontHeight->GetHeight() );
     }
 
     xDocShRef->DoClose();


More information about the Libreoffice-commits mailing list