diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-17 11:36:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-20 11:53:47 +0100 |
commit | ffba2c683a5cd7ac3293e146fb0b930545b93609 (patch) | |
tree | 766f0dbd56dda8a91696bd0aa7dd0a5da42fe0af /sd | |
parent | 2d13cc9723547f7a2028713e66e4f44a99090a34 (diff) |
TypedWhichId for SDRATTR* constants (1)
Change-Id: I29bd18fea4dea531ae84ebc024d2aa87a5c7004d
Reviewed-on: https://gerrit.libreoffice.org/44943
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/export-tests-ooxml1.cxx | 14 | ||||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 8 | ||||
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviews3.cxx | 6 |
5 files changed, 21 insertions, 23 deletions
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 0ad825d57700..a31ff8d350e7 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -313,17 +313,17 @@ void SdOOXMLExportTest1::testFdo71961() SdrObjCustomShape *pTxtObj = dynamic_cast<SdrObjCustomShape *>( pPage->GetObj( 1 )); CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr); CPPUNIT_ASSERT_EQUAL( OUString( "Text to be always wrapped" ), pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0)); - CPPUNIT_ASSERT_EQUAL( true, (static_cast<const SdrOnOffItem&>(pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue()); + CPPUNIT_ASSERT_EQUAL( true, pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue()); pTxtObj = dynamic_cast<SdrObjCustomShape *>( pPage->GetObj( 2 )); CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr); CPPUNIT_ASSERT_EQUAL( OUString( "Custom shape non-wrapped text" ), pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0)); - CPPUNIT_ASSERT_EQUAL( false, (static_cast<const SdrOnOffItem&>(pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue()); + CPPUNIT_ASSERT_EQUAL( false, pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue()); pTxtObj = dynamic_cast<SdrObjCustomShape *>( pPage->GetObj( 3 )); CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != nullptr); CPPUNIT_ASSERT_EQUAL( OUString( "Custom shape wrapped text" ), pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0)); - CPPUNIT_ASSERT_EQUAL( true, (static_cast<const SdrOnOffItem&>(pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue()); + CPPUNIT_ASSERT_EQUAL( true, pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue()); xDocShRef->DoClose(); } @@ -397,10 +397,10 @@ void SdOOXMLExportTest1::testBnc862510_5() CPPUNIT_ASSERT(pObjGroup); const SdrObject* pObj = pObjGroup->GetSubList()->GetObj(1); CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrMetricItem& >(pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST))).GetValue()); - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrMetricItem& >(pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST))).GetValue()); - CPPUNIT_ASSERT_EQUAL( sal_Int32(7510), (static_cast< const SdrMetricItem& >(pObj->GetMergedItem(SDRATTR_TEXT_RIGHTDIST))).GetValue()); - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrMetricItem& >(pObj->GetMergedItem(SDRATTR_TEXT_LEFTDIST))).GetValue()); + CPPUNIT_ASSERT_EQUAL( sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST).GetValue()); + CPPUNIT_ASSERT_EQUAL( sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST).GetValue()); + CPPUNIT_ASSERT_EQUAL( sal_Int32(7510), pObj->GetMergedItem(SDRATTR_TEXT_RIGHTDIST).GetValue()); + CPPUNIT_ASSERT_EQUAL( sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_LEFTDIST).GetValue()); xDocShRef->DoClose(); } diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 1f0cd6fde6e2..cf03f83d02c5 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -768,10 +768,10 @@ void SdImportTest::testBnc870237() // Simulate a:ext inside dsp:txXfrm with changing the lower distance const SdrObjGroup* pObj = dynamic_cast<SdrObjGroup*>( pPage->GetObj( 0 ) ); CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrMetricItem& >(pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST))).GetValue()); - CPPUNIT_ASSERT_EQUAL( sal_Int32(9919), (static_cast< const SdrMetricItem& >(pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST))).GetValue()); - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrMetricItem& >(pObj->GetMergedItem(SDRATTR_TEXT_RIGHTDIST))).GetValue()); - CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrMetricItem& >(pObj->GetMergedItem(SDRATTR_TEXT_LEFTDIST))).GetValue()); + CPPUNIT_ASSERT_EQUAL( sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST).GetValue()); + CPPUNIT_ASSERT_EQUAL( sal_Int32(9919), pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST).GetValue()); + CPPUNIT_ASSERT_EQUAL( sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_RIGHTDIST).GetValue()); + CPPUNIT_ASSERT_EQUAL( sal_Int32(0), pObj->GetMergedItem(SDRATTR_TEXT_LEFTDIST).GetValue()); xDocShRef->DoClose(); } diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 8fe7ceb1b98a..79020b01dac7 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -2329,12 +2329,12 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj if ( pSheet2 ) { SfxItemSet& rItemSet = pSheet2->GetItemSet(); - rItemSet.Put( static_cast<const SdrMetricItem&>(pText->GetMergedItem( SDRATTR_TEXT_LEFTDIST ) ) ); - rItemSet.Put( static_cast<const SdrMetricItem&>(pText->GetMergedItem( SDRATTR_TEXT_RIGHTDIST )) ); - rItemSet.Put( static_cast<const SdrMetricItem&>(pText->GetMergedItem( SDRATTR_TEXT_UPPERDIST )) ); - rItemSet.Put( static_cast<const SdrMetricItem&>(pText->GetMergedItem( SDRATTR_TEXT_LOWERDIST )) ); - rItemSet.Put( static_cast<const SdrTextVertAdjustItem&>(pText->GetMergedItem( SDRATTR_TEXT_VERTADJUST )) ); - rItemSet.Put( static_cast<const SdrTextHorzAdjustItem&>(pText->GetMergedItem( SDRATTR_TEXT_HORZADJUST )) ); + rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_LEFTDIST ) ); + rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_RIGHTDIST ) ); + rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_UPPERDIST ) ); + rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_LOWERDIST ) ); + rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_VERTADJUST ) ); + rItemSet.Put( pText->GetMergedItem( SDRATTR_TEXT_HORZADJUST ) ); if ( pTextObj->GetInstance() == TSS_Type::Title || pTextObj->GetInstance() == TSS_Type::Subtitle) { diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 6b0259bfeaae..a7236c03bb94 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -3559,7 +3559,7 @@ void DrawViewShell::GetStatePropPanelAttr(SfxItemSet& rSet) SfxItemState eConState = aAttrs.GetItemState( SDRATTR_TEXT_CONTOURFRAME ); if( eConState != SfxItemState::DONTCARE ) { - bContour = static_cast<const SdrOnOffItem&>( aAttrs.Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue(); + bContour = aAttrs.Get( SDRATTR_TEXT_CONTOURFRAME ).GetValue(); } if (bContour) break; @@ -3569,7 +3569,7 @@ void DrawViewShell::GetStatePropPanelAttr(SfxItemSet& rSet) //if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState) if(SfxItemState::DONTCARE != eVState) { - SdrTextVertAdjust eTVA = static_cast<const SdrTextVertAdjustItem&>(aAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); + SdrTextVertAdjust eTVA = aAttrs.Get(SDRATTR_TEXT_VERTADJUST).GetValue(); bool bSet = (nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP) || (nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER) || (nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM); diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index 274644ec72a9..f8f398dd91ca 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -924,8 +924,7 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SfxItemState::SET ) { - const SdrMetricItem& rTLDItem = static_cast<const SdrMetricItem&>( - aEditAttr.Get( SDRATTR_TEXT_LEFTDIST )); + const SdrMetricItem& rTLDItem = aEditAttr.Get( SDRATTR_TEXT_LEFTDIST ); long nLD = rTLDItem.GetValue(); aPos.X() += nLD; } @@ -936,8 +935,7 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SfxItemState::SET ) { - const SdrMetricItem& rTLDItem = static_cast<const SdrMetricItem&>( - aEditAttr.Get( SDRATTR_TEXT_LEFTDIST )); + const SdrMetricItem& rTLDItem = aEditAttr.Get( SDRATTR_TEXT_LEFTDIST ); long nLD = rTLDItem.GetValue(); aLRSpace.SetLeft( aLRSpace.GetLeft() + nLD ); } |