diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2020-09-19 12:08:20 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2020-09-19 13:02:45 +0200 |
commit | 49c03a624084a63b4cb7f6a23dd803ea66e4bb33 (patch) | |
tree | 61f7e40ea4299eabc3d9ed53b8fdfc7340d5e5c3 /sd/qa | |
parent | 1f07c2e440326f2b2c8ffbb53c91570e6cfcd74d (diff) |
Remove commented parts + reindent
Code commented since initial adding of the test:
author Muthu Subramanian <sumuthu@suse.com> 2012-08-14 17:04:40 +0530
committer Muthu Subramanian <sumuthu@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@yahoo.fr>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 38 |
1 files changed, 17 insertions, 21 deletions
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(); |