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 /svx | |
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 'svx')
20 files changed, 111 insertions, 111 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 0aea03d3ed54..d336ec66e4af 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -415,8 +415,8 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F bool GetFontWorkOutline(FWData& rFWData, const SdrObject* pCustomShape) { - SdrTextHorzAdjust eHorzAdjust( static_cast<const SdrTextHorzAdjustItem&>(pCustomShape->GetMergedItem( SDRATTR_TEXT_HORZADJUST )).GetValue() ); - drawing::TextFitToSizeType const eFTS( static_cast<const SdrTextFitToSizeTypeItem&>(pCustomShape->GetMergedItem( SDRATTR_TEXT_FITTOSIZE )).GetValue() ); + SdrTextHorzAdjust eHorzAdjust( pCustomShape->GetMergedItem( SDRATTR_TEXT_HORZADJUST ).GetValue() ); + drawing::TextFitToSizeType const eFTS( pCustomShape->GetMergedItem( SDRATTR_TEXT_FITTOSIZE ).GetValue() ); std::vector< FWTextArea >::iterator aTextAreaIter = rFWData.vTextAreas.begin(); std::vector< FWTextArea >::const_iterator aTextAreaIEnd = rFWData.vTextAreas.end(); diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx index 110aadbd0cdd..1a2ff5325698 100644 --- a/svx/source/sdr/attribute/sdrformtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx @@ -82,7 +82,7 @@ namespace if(bShadow) { - nRetval = (sal_uInt8)((static_cast<const SdrPercentItem&>(rSet.Get(SDRATTR_SHADOWTRANSPARENCE)).GetValue() * 255) / 100); + nRetval = (sal_uInt8)((rSet.Get(SDRATTR_SHADOWTRANSPARENCE).GetValue() * 255) / 100); } else { @@ -98,7 +98,7 @@ namespace if(bShadow) { - const Color aShadowColor(static_cast<const XColorItem&>(rSet.Get(SDRATTR_SHADOWCOLOR)).GetColorValue()); + const Color aShadowColor(rSet.Get(SDRATTR_SHADOWCOLOR).GetColorValue()); aColorAttribute = aShadowColor.getBColor(); } else diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx index 413d4abd0785..7fc5effd6cf3 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx @@ -108,8 +108,8 @@ namespace sdr { // for SC, the caption object may have a specialized shadow. The usual object shadow is off // and a specialized shadow gets created here (see old paint) - const XColorItem& rShadColItem = static_cast<const XColorItem&>(rItemSet.Get(SDRATTR_SHADOWCOLOR)); - const sal_uInt16 nShadowTransparence(static_cast<const SdrPercentItem&>(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE)).GetValue()); + const XColorItem& rShadColItem = rItemSet.Get(SDRATTR_SHADOWCOLOR); + const sal_uInt16 nShadowTransparence(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE).GetValue()); const Color aShadowColor(rShadColItem.GetColorValue()); const drawing::FillStyle eShadowStyle = rItemSet.Get(XATTR_FILLSTYLE).GetValue(); @@ -145,8 +145,8 @@ namespace sdr if(!aFill.isDefault() && 1.0 != aFill.getTransparence()) { // add shadow offset to object matrix - const sal_uInt32 nXDist(static_cast<const SdrMetricItem&>(rItemSet.Get(SDRATTR_SHADOWXDIST)).GetValue()); - const sal_uInt32 nYDist(static_cast<const SdrMetricItem&>(rItemSet.Get(SDRATTR_SHADOWYDIST)).GetValue()); + const sal_uInt32 nXDist(rItemSet.Get(SDRATTR_SHADOWXDIST).GetValue()); + const sal_uInt32 nYDist(rItemSet.Get(SDRATTR_SHADOWYDIST).GetValue()); if(nXDist || nYDist) { diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index 03c46280c4d0..8cabe8d261bf 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -215,7 +215,7 @@ namespace sdr } // check if SdrTextWordWrapItem is set - bWordWrap = static_cast<const SdrOnOffItem&>(GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP)).GetValue(); + bWordWrap = GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue(); } // create primitive diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx index c508f3fc8515..c0ab639395de 100644 --- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx @@ -66,7 +66,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrRectObj::createV aObjectRange.getMinX(), aObjectRange.getMinY())); // calculate corner radius - sal_uInt32 nCornerRadius(static_cast<const SdrMetricItem&>(rItemSet.Get(SDRATTR_ECKENRADIUS)).GetValue()); + sal_uInt32 nCornerRadius(rItemSet.Get(SDRATTR_ECKENRADIUS).GetValue()); double fCornerRadiusX; double fCornerRadiusY; drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY); diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 799b525493df..dc62cf66c067 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -338,11 +338,11 @@ namespace drawinglayer attribute::SdrShadowAttribute createNewSdrShadowAttribute(const SfxItemSet& rSet) { - const bool bShadow(static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_SHADOW)).GetValue()); + const bool bShadow(rSet.Get(SDRATTR_SHADOW).GetValue()); if(bShadow) { - sal_uInt16 nTransparence(static_cast<const SdrPercentItem&>(rSet.Get(SDRATTR_SHADOWTRANSPARENCE)).GetValue()); + sal_uInt16 nTransparence(rSet.Get(SDRATTR_SHADOWTRANSPARENCE).GetValue()); if(nTransparence > 100) { @@ -371,9 +371,9 @@ namespace drawinglayer if(100 != nTransparence) { const basegfx::B2DVector aOffset( - (double)static_cast<const SdrMetricItem&>(rSet.Get(SDRATTR_SHADOWXDIST)).GetValue(), - (double)static_cast<const SdrMetricItem&>(rSet.Get(SDRATTR_SHADOWYDIST)).GetValue()); - const Color aColor(static_cast<const XColorItem&>(rSet.Get(SDRATTR_SHADOWCOLOR)).GetColorValue()); + (double)rSet.Get(SDRATTR_SHADOWXDIST).GetValue(), + (double)rSet.Get(SDRATTR_SHADOWYDIST).GetValue()); + const Color aColor(rSet.Get(SDRATTR_SHADOWCOLOR).GetColorValue()); return attribute::SdrShadowAttribute(aOffset, (double)nTransparence * 0.01, aColor.getBColor()); } @@ -577,14 +577,14 @@ namespace drawinglayer pLower ? *pLower : rTextObj.GetTextLowerDistance(), rTextObj.GetTextHorizontalAdjust(rSet), rTextObj.GetTextVerticalAdjust(rSet), - static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_CONTOURFRAME)).GetValue(), + rSet.Get(SDRATTR_TEXT_CONTOURFRAME).GetValue(), rTextObj.IsFitToSize(), rTextObj.IsAutoFit(), rSet.Get(XATTR_FORMTXTHIDEFORM).GetValue(), SdrTextAniKind::Blink == eAniKind, SdrTextAniKind::Scroll == eAniKind || SdrTextAniKind::Alternate == eAniKind || SdrTextAniKind::Slide == eAniKind, bInEditMode, - static_cast<const SdrTextFixedCellHeightItem&>(rSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue(), + rSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue(), bWrongSpell, bChainable); } diff --git a/svx/source/sdr/properties/customshapeproperties.cxx b/svx/source/sdr/properties/customshapeproperties.cxx index 24633ee82f99..95ab71fbddef 100644 --- a/svx/source/sdr/properties/customshapeproperties.cxx +++ b/svx/source/sdr/properties/customshapeproperties.cxx @@ -41,7 +41,7 @@ namespace sdr // change TextFrame flag when bResizeShapeToFitText changes (which is mapped // on the item SDRATTR_TEXT_AUTOGROWHEIGHT for custom shapes, argh) - rObj.bTextFrame = static_cast< const SdrOnOffItem& >(GetObjectItemSet().Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); + rObj.bTextFrame = GetObjectItemSet().Get(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue(); // check if it did change if(rObj.bTextFrame != bOld) diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 1e3344c26410..840c561c1193 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -1314,8 +1314,8 @@ void SdrDragObjOwn::MoveSdrDrag(const Point& rNoSnapPnt) // also this (pretty indirect) property change is possible. If it gets // changed, it needs to be copied to the original since nothing will // happen when it only changes in the drag clone - const bool bOldAutoGrowWidth(static_cast<const SdrOnOffItem&>(pObj->GetMergedItem(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue()); - const bool bNewAutoGrowWidth(static_cast<const SdrOnOffItem&>(mpClone->GetMergedItem(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue()); + const bool bOldAutoGrowWidth(pObj->GetMergedItem(SDRATTR_TEXT_AUTOGROWWIDTH).GetValue()); + const bool bNewAutoGrowWidth(mpClone->GetMergedItem(SDRATTR_TEXT_AUTOGROWWIDTH).GetValue()); if (bOldAutoGrowWidth != bNewAutoGrowWidth) { diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index cf04b96e9010..b6da423fb97b 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -1351,7 +1351,7 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const } SfxItemState eState=aMarkAttr.GetItemState(SDRATTR_TEXT_AUTOGROWWIDTH); - bool bAutoGrow=static_cast<const SdrOnOffItem&>(aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue(); + bool bAutoGrow=aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWWIDTH).GetValue(); if (eState==SfxItemState::DONTCARE) { aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_AUTOWIDTH); } else if (eState==SfxItemState::SET) { @@ -1359,7 +1359,7 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const } eState=aMarkAttr.GetItemState(SDRATTR_TEXT_AUTOGROWHEIGHT); - bAutoGrow=static_cast<const SdrOnOffItem&>(aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); + bAutoGrow=aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue(); if (eState==SfxItemState::DONTCARE) { aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_AUTOHEIGHT); } else if (eState==SfxItemState::SET) { @@ -1367,7 +1367,7 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const } eState=aMarkAttr.GetItemState(SDRATTR_ECKENRADIUS); - long nRadius=static_cast<const SdrMetricItem&>(aMarkAttr.Get(SDRATTR_ECKENRADIUS)).GetValue(); + long nRadius=aMarkAttr.Get(SDRATTR_ECKENRADIUS).GetValue(); if (eState==SfxItemState::DONTCARE) { aRetSet.InvalidateItem(SDRATTR_ECKENRADIUS); } else if (eState==SfxItemState::SET) { diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 25a8eeb6c50e..9af01a3954f8 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -1586,7 +1586,7 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, DBG_ASSERT(pCandidate, "SdrEditView::ImpDismantleOneObject: Could not clone SdrObject (!)"); pCandidate->SetModel(pCustomShape->GetModel()); - if(static_cast<const SdrOnOffItem&>(pCustomShape->GetMergedItem(SDRATTR_SHADOW)).GetValue()) + if(pCustomShape->GetMergedItem(SDRATTR_SHADOW).GetValue()) { if(dynamic_cast<const SdrObjGroup*>( pReplacement) != nullptr) { diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index d20912eb62d9..72938cf77f26 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -850,7 +850,7 @@ OutlinerView* SdrObjEditView::ImpMakeOutlinerView(vcl::Window* pWin, OutlinerVie if (pText!=nullptr) { pOutlView->SetAnchorMode(pText->GetOutlinerViewAnchorMode()); - pTextEditOutliner->SetFixedCellHeight(static_cast<const SdrTextFixedCellHeightItem&>(pText->GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + pTextEditOutliner->SetFixedCellHeight(pText->GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue()); } // do update before setting output area so that aTextEditArea can be recalculated pTextEditOutliner->SetUpdateMode(true); diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index a1c62229b792..d191331917ab 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -206,15 +206,15 @@ static bool ImpVerticalSwitch( const SdrObjCustomShape& rCustoShape ) SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemSet& rOriginalSet) { SdrObject* pRetval = nullptr; - const bool bShadow(static_cast<const SdrOnOffItem&>(rOriginalSet.Get(SDRATTR_SHADOW)).GetValue()); + const bool bShadow(rOriginalSet.Get(SDRATTR_SHADOW).GetValue()); if(bShadow) { // create a shadow representing object - const sal_Int32 nXDist(static_cast<const SdrMetricItem&>(rOriginalSet.Get(SDRATTR_SHADOWXDIST)).GetValue()); - const sal_Int32 nYDist(static_cast<const SdrMetricItem&>(rOriginalSet.Get(SDRATTR_SHADOWYDIST)).GetValue()); - const ::Color aShadowColor(static_cast<const XColorItem&>(rOriginalSet.Get(SDRATTR_SHADOWCOLOR)).GetColorValue()); - const sal_uInt16 nShadowTransparence(static_cast<const SdrPercentItem&>(rOriginalSet.Get(SDRATTR_SHADOWTRANSPARENCE)).GetValue()); + const sal_Int32 nXDist(rOriginalSet.Get(SDRATTR_SHADOWXDIST).GetValue()); + const sal_Int32 nYDist(rOriginalSet.Get(SDRATTR_SHADOWYDIST).GetValue()); + const ::Color aShadowColor(rOriginalSet.Get(SDRATTR_SHADOWCOLOR).GetColorValue()); + const sal_uInt16 nShadowTransparence(rOriginalSet.Get(SDRATTR_SHADOWTRANSPARENCE).GetValue()); pRetval = rOriginal.Clone(); DBG_ASSERT(pRetval, "ImpCreateShadowObjectClone: Could not clone object (!)"); @@ -455,7 +455,7 @@ const SdrObject* SdrObjCustomShape::GetSdrObjectShadowFromCustomShape() const if(pSdrObject) { const SfxItemSet& rOriginalSet = GetObjectItemSet(); - const bool bShadow(static_cast<const SdrOnOffItem&>(rOriginalSet.Get( SDRATTR_SHADOW )).GetValue()); + const bool bShadow(rOriginalSet.Get( SDRATTR_SHADOW ).GetValue()); if(bShadow) { @@ -2158,17 +2158,17 @@ basegfx::B2DPolyPolygon SdrObjCustomShape::TakeCreatePoly(const SdrDragStat& /*r bool SdrObjCustomShape::IsAutoGrowHeight() const { const SfxItemSet& rSet = GetMergedItemSet(); - bool bIsAutoGrowHeight = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); + bool bIsAutoGrowHeight = rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue(); if ( bIsAutoGrowHeight && IsVerticalWriting() ) - bIsAutoGrowHeight = !static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_WORDWRAP)).GetValue(); + bIsAutoGrowHeight = !rSet.Get(SDRATTR_TEXT_WORDWRAP).GetValue(); return bIsAutoGrowHeight; } bool SdrObjCustomShape::IsAutoGrowWidth() const { const SfxItemSet& rSet = GetMergedItemSet(); - bool bIsAutoGrowWidth = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); + bool bIsAutoGrowWidth = rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue(); if ( bIsAutoGrowWidth && !IsVerticalWriting() ) - bIsAutoGrowWidth = !static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_WORDWRAP)).GetValue(); + bIsAutoGrowWidth = !rSet.Get(SDRATTR_TEXT_WORDWRAP).GetValue(); return bIsAutoGrowWidth; } @@ -2192,8 +2192,8 @@ void SdrObjCustomShape::SetVerticalWriting( bool bVertical ) const SfxItemSet& rSet = GetObjectItemSet(); // Also exchange horizontal and vertical adjust items - SdrTextHorzAdjust eHorz = static_cast<const SdrTextHorzAdjustItem&>(rSet.Get(SDRATTR_TEXT_HORZADJUST)).GetValue(); - SdrTextVertAdjust eVert = static_cast<const SdrTextVertAdjustItem&>(rSet.Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); + SdrTextHorzAdjust eHorz = rSet.Get(SDRATTR_TEXT_HORZADJUST).GetValue(); + SdrTextVertAdjust eVert = rSet.Get(SDRATTR_TEXT_VERTADJUST).GetValue(); // rescue object size tools::Rectangle aObjectRect = GetSnapRect(); @@ -2307,7 +2307,7 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool if( pOutlinerParaObject != nullptr ) { rOutliner.SetText(*pOutlinerParaObject); - rOutliner.SetFixedCellHeight(static_cast<const SdrTextFixedCellHeightItem&>(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + rOutliner.SetFixedCellHeight(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue()); } if ( bWdtGrow ) { @@ -2529,7 +2529,7 @@ void SdrObjCustomShape::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools if ( nMaxHgt == 0 || nMaxHgt > aMaxSiz.Height() ) nMaxHgt=aMaxSiz.Height(); - if (static_cast<const SdrOnOffItem&>(GetMergedItem(SDRATTR_TEXT_WORDWRAP)).GetValue()) + if (GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue()) { if ( IsVerticalWriting() ) { @@ -2631,7 +2631,7 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& long nAnkWdt=aAnkRect.GetWidth(); long nAnkHgt=aAnkRect.GetHeight(); - if (static_cast<const SdrOnOffItem&>(GetMergedItem(SDRATTR_TEXT_WORDWRAP)).GetValue()) + if (GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue()) { if ( IsVerticalWriting() ) nMaxAutoPaperHeight = nAnkHgt; @@ -2834,7 +2834,7 @@ SdrObject* SdrObjCustomShape::DoConvertToPolyObj(bool bBezier, bool bAddText) co if(pRetval) { - const bool bShadow(static_cast<const SdrOnOffItem&>(GetMergedItem(SDRATTR_SHADOW)).GetValue()); + const bool bShadow(GetMergedItem(SDRATTR_SHADOW).GetValue()); if(bShadow) { pRetval->SetMergedItem(makeSdrShadowItem(true)); diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 803cc72b6313..9c62fa28067d 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -415,15 +415,15 @@ OUString SdrCaptionObj::getSpecialDragComment(const SdrDragStat& rDrag) const void SdrCaptionObj::ImpGetCaptParams(ImpCaptParams& rPara) const { const SfxItemSet& rSet = GetObjectItemSet(); - rPara.eType =static_cast<const SdrCaptionTypeItem&> (rSet.Get(SDRATTR_CAPTIONTYPE )).GetValue(); - rPara.bFixedAngle=static_cast<const SdrOnOffItem&> (rSet.Get(SDRATTR_CAPTIONFIXEDANGLE)).GetValue(); + rPara.eType =rSet.Get(SDRATTR_CAPTIONTYPE ).GetValue(); + rPara.bFixedAngle=rSet.Get(SDRATTR_CAPTIONFIXEDANGLE).GetValue(); rPara.nGap =static_cast<const SdrCaptionGapItem&> (rSet.Get(SDRATTR_CAPTIONGAP )).GetValue(); - rPara.eEscDir =static_cast<const SdrCaptionEscDirItem&> (rSet.Get(SDRATTR_CAPTIONESCDIR )).GetValue(); - rPara.bEscRel =static_cast<const SdrCaptionEscIsRelItem&> (rSet.Get(SDRATTR_CAPTIONESCISREL )).GetValue(); - rPara.nEscRel =static_cast<const SdrCaptionEscRelItem&> (rSet.Get(SDRATTR_CAPTIONESCREL )).GetValue(); - rPara.nEscAbs =static_cast<const SdrCaptionEscAbsItem&> (rSet.Get(SDRATTR_CAPTIONESCABS )).GetValue(); - rPara.nLineLen =static_cast<const SdrCaptionLineLenItem&> (rSet.Get(SDRATTR_CAPTIONLINELEN )).GetValue(); - rPara.bFitLineLen=static_cast<const SdrCaptionFitLineLenItem&>(rSet.Get(SDRATTR_CAPTIONFITLINELEN)).GetValue(); + rPara.eEscDir =rSet.Get(SDRATTR_CAPTIONESCDIR ).GetValue(); + rPara.bEscRel =rSet.Get(SDRATTR_CAPTIONESCISREL ).GetValue(); + rPara.nEscRel =rSet.Get(SDRATTR_CAPTIONESCREL ).GetValue(); + rPara.nEscAbs =rSet.Get(SDRATTR_CAPTIONESCABS ).GetValue(); + rPara.nLineLen =rSet.Get(SDRATTR_CAPTIONLINELEN ).GetValue(); + rPara.bFitLineLen=rSet.Get(SDRATTR_CAPTIONFITLINELEN).GetValue(); } void SdrCaptionObj::ImpRecalcTail() diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index a780086a9dda..9c943843d083 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -282,15 +282,15 @@ bool SdrTextObj::IsAutoGrowHeight() const return false; // AutoGrow only together with TextFrames const SfxItemSet& rSet = GetObjectItemSet(); - bool bRet = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); + bool bRet = rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue(); if(bRet) { - SdrTextAniKind eAniKind = static_cast<const SdrTextAniKindItem&>(rSet.Get(SDRATTR_TEXT_ANIKIND)).GetValue(); + SdrTextAniKind eAniKind = rSet.Get(SDRATTR_TEXT_ANIKIND).GetValue(); if(eAniKind == SdrTextAniKind::Scroll || eAniKind == SdrTextAniKind::Alternate || eAniKind == SdrTextAniKind::Slide) { - SdrTextAniDirection eDirection = static_cast<const SdrTextAniDirectionItem&>(rSet.Get(SDRATTR_TEXT_ANIDIRECTION)).GetValue(); + SdrTextAniDirection eDirection = rSet.Get(SDRATTR_TEXT_ANIDIRECTION).GetValue(); if(eDirection == SdrTextAniDirection::Up || eDirection == SdrTextAniDirection::Down) { @@ -307,17 +307,17 @@ bool SdrTextObj::IsAutoGrowWidth() const return false; // AutoGrow only together with TextFrames const SfxItemSet& rSet = GetObjectItemSet(); - bool bRet = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue(); + bool bRet = rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH).GetValue(); bool bInEditMOde = IsInEditMode(); if(!bInEditMOde && bRet) { - SdrTextAniKind eAniKind = static_cast<const SdrTextAniKindItem&>(rSet.Get(SDRATTR_TEXT_ANIKIND)).GetValue(); + SdrTextAniKind eAniKind = rSet.Get(SDRATTR_TEXT_ANIKIND).GetValue(); if(eAniKind == SdrTextAniKind::Scroll || eAniKind == SdrTextAniKind::Alternate || eAniKind == SdrTextAniKind::Slide) { - SdrTextAniDirection eDirection = static_cast<const SdrTextAniDirectionItem&>(rSet.Get(SDRATTR_TEXT_ANIDIRECTION)).GetValue(); + SdrTextAniDirection eDirection = rSet.Get(SDRATTR_TEXT_ANIDIRECTION).GetValue(); if(eDirection == SdrTextAniDirection::Left || eDirection == SdrTextAniDirection::Right) { @@ -338,17 +338,17 @@ SdrTextHorzAdjust SdrTextObj::GetTextHorizontalAdjust(const SfxItemSet& rSet) co if(IsContourTextFrame()) return SDRTEXTHORZADJUST_BLOCK; - SdrTextHorzAdjust eRet = static_cast<const SdrTextHorzAdjustItem&>(rSet.Get(SDRATTR_TEXT_HORZADJUST)).GetValue(); + SdrTextHorzAdjust eRet = rSet.Get(SDRATTR_TEXT_HORZADJUST).GetValue(); bool bInEditMode = IsInEditMode(); if(!bInEditMode && eRet == SDRTEXTHORZADJUST_BLOCK) { - SdrTextAniKind eAniKind = static_cast<const SdrTextAniKindItem&>(rSet.Get(SDRATTR_TEXT_ANIKIND)).GetValue(); + SdrTextAniKind eAniKind = rSet.Get(SDRATTR_TEXT_ANIKIND).GetValue(); if(eAniKind == SdrTextAniKind::Scroll || eAniKind == SdrTextAniKind::Alternate || eAniKind == SdrTextAniKind::Slide) { - SdrTextAniDirection eDirection = static_cast<const SdrTextAniDirectionItem&>(rSet.Get(SDRATTR_TEXT_ANIDIRECTION)).GetValue(); + SdrTextAniDirection eDirection = rSet.Get(SDRATTR_TEXT_ANIDIRECTION).GetValue(); if(eDirection == SdrTextAniDirection::Left || eDirection == SdrTextAniDirection::Right) { @@ -371,17 +371,17 @@ SdrTextVertAdjust SdrTextObj::GetTextVerticalAdjust(const SfxItemSet& rSet) cons return SDRTEXTVERTADJUST_TOP; // Take care for vertical text animation here - SdrTextVertAdjust eRet = static_cast<const SdrTextVertAdjustItem&>(rSet.Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); + SdrTextVertAdjust eRet = rSet.Get(SDRATTR_TEXT_VERTADJUST).GetValue(); bool bInEditMode = IsInEditMode(); // Take care for vertical text animation here if(!bInEditMode && eRet == SDRTEXTVERTADJUST_BLOCK) { - SdrTextAniKind eAniKind = static_cast<const SdrTextAniKindItem&>(rSet.Get(SDRATTR_TEXT_ANIKIND)).GetValue(); + SdrTextAniKind eAniKind = rSet.Get(SDRATTR_TEXT_ANIKIND).GetValue(); if(eAniKind == SdrTextAniKind::Scroll || eAniKind == SdrTextAniKind::Alternate || eAniKind == SdrTextAniKind::Slide) { - SdrTextAniDirection eDirection = static_cast<const SdrTextAniDirectionItem&>(rSet.Get(SDRATTR_TEXT_ANIDIRECTION)).GetValue(); + SdrTextAniDirection eDirection = rSet.Get(SDRATTR_TEXT_ANIDIRECTION).GetValue(); if(eDirection == SdrTextAniDirection::Left || eDirection == SdrTextAniDirection::Right) { @@ -596,7 +596,7 @@ void SdrTextObj::ImpSetContourPolygon( SdrOutliner& rOutliner, tools::Rectangle& // test if shadow needs to be avoided for TakeContour() const SfxItemSet& rSet = GetObjectItemSet(); - bool bShadowOn = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_SHADOW)).GetValue(); + bool bShadowOn = rSet.Get(SDRATTR_SHADOW).GetValue(); // #i33696# // Remember TextObject currently set at the DrawOutliner, it WILL be @@ -765,7 +765,7 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRe if( bHitTest ) // #i33696# take back fix #i27510# { rOutliner.SetTextObj( this ); - rOutliner.SetFixedCellHeight(static_cast<const SdrTextFixedCellHeightItem&>(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + rOutliner.SetFixedCellHeight(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue()); } rOutliner.SetUpdateMode(true); @@ -1240,7 +1240,7 @@ void SdrTextObj::ImpSetupDrawOutlinerForPaint( bool bContourFrame, rOutliner.SetControlWord(nStat); } } - rOutliner.SetFixedCellHeight(static_cast<const SdrTextFixedCellHeightItem&>(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + rOutliner.SetFixedCellHeight(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue()); TakeTextRect(rOutliner, rTextRect, false, &rAnchorRect); rPaintRect = rTextRect; @@ -1535,12 +1535,12 @@ void SdrTextObj::SetVerticalWriting(bool bVertical) { // get item settings const SfxItemSet& rSet = GetObjectItemSet(); - bool bAutoGrowWidth = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue(); - bool bAutoGrowHeight = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); + bool bAutoGrowWidth = rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH).GetValue(); + bool bAutoGrowHeight = rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue(); // Also exchange hor/ver adjust items - SdrTextHorzAdjust eHorz = static_cast<const SdrTextHorzAdjustItem&>(rSet.Get(SDRATTR_TEXT_HORZADJUST)).GetValue(); - SdrTextVertAdjust eVert = static_cast<const SdrTextVertAdjustItem&>(rSet.Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); + SdrTextHorzAdjust eHorz = rSet.Get(SDRATTR_TEXT_HORZADJUST).GetValue(); + SdrTextVertAdjust eVert = rSet.Get(SDRATTR_TEXT_VERTADJUST).GetValue(); // rescue object size tools::Rectangle aObjectRect = GetSnapRect(); @@ -1769,27 +1769,27 @@ bool SdrTextObj::IsReallyEdited() const long SdrTextObj::GetEckenradius() const { - return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_ECKENRADIUS)).GetValue(); + return GetObjectItemSet().Get(SDRATTR_ECKENRADIUS).GetValue(); } long SdrTextObj::GetMinTextFrameHeight() const { - return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEHEIGHT)).GetValue(); + return GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEHEIGHT).GetValue(); } long SdrTextObj::GetMaxTextFrameHeight() const { - return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEHEIGHT)).GetValue(); + return GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEHEIGHT).GetValue(); } long SdrTextObj::GetMinTextFrameWidth() const { - return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEWIDTH)).GetValue(); + return GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEWIDTH).GetValue(); } long SdrTextObj::GetMaxTextFrameWidth() const { - return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEWIDTH)).GetValue(); + return GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEWIDTH).GetValue(); } bool SdrTextObj::IsFontwork() const @@ -1807,37 +1807,37 @@ bool SdrTextObj::IsHideContour() const bool SdrTextObj::IsContourTextFrame() const { return !bTextFrame // ContourFrame not together with normal TextFrames - && static_cast<const SdrOnOffItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_CONTOURFRAME)).GetValue(); + && GetObjectItemSet().Get(SDRATTR_TEXT_CONTOURFRAME).GetValue(); } long SdrTextObj::GetTextLeftDistance() const { - return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_LEFTDIST)).GetValue(); + return GetObjectItemSet().Get(SDRATTR_TEXT_LEFTDIST).GetValue(); } long SdrTextObj::GetTextRightDistance() const { - return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_RIGHTDIST)).GetValue(); + return GetObjectItemSet().Get(SDRATTR_TEXT_RIGHTDIST).GetValue(); } long SdrTextObj::GetTextUpperDistance() const { - return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_UPPERDIST)).GetValue(); + return GetObjectItemSet().Get(SDRATTR_TEXT_UPPERDIST).GetValue(); } long SdrTextObj::GetTextLowerDistance() const { - return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_LOWERDIST)).GetValue(); + return GetObjectItemSet().Get(SDRATTR_TEXT_LOWERDIST).GetValue(); } SdrTextAniKind SdrTextObj::GetTextAniKind() const { - return static_cast<const SdrTextAniKindItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_ANIKIND)).GetValue(); + return GetObjectItemSet().Get(SDRATTR_TEXT_ANIKIND).GetValue(); } SdrTextAniDirection SdrTextObj::GetTextAniDirection() const { - return static_cast<const SdrTextAniDirectionItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_ANIDIRECTION)).GetValue(); + return GetObjectItemSet().Get(SDRATTR_TEXT_ANIDIRECTION).GetValue(); } // Get necessary data for text scroll animation. ATM base it on a Text-Metafile and a @@ -1862,7 +1862,7 @@ GDIMetaFile* SdrTextObj::GetTextScrollMetaFileAndRectangle( tools::Rectangle aScrollFrameRect(aPaintRect); const SfxItemSet& rSet = GetObjectItemSet(); - SdrTextAniDirection eDirection = static_cast<const SdrTextAniDirectionItem&>(rSet.Get(SDRATTR_TEXT_ANIDIRECTION)).GetValue(); + SdrTextAniDirection eDirection = rSet.Get(SDRATTR_TEXT_ANIDIRECTION).GetValue(); if(SdrTextAniDirection::Left == eDirection || SdrTextAniDirection::Right == eDirection) { @@ -1988,7 +1988,7 @@ bool SdrTextObj::IsChainable() const { // Read it as item const SfxItemSet& rSet = GetObjectItemSet(); - OUString aNextLinkName = static_cast<const SfxStringItem&>(rSet.Get(SDRATTR_TEXT_CHAINNEXTNAME)).GetValue(); + OUString aNextLinkName = rSet.Get(SDRATTR_TEXT_CHAINNEXTNAME).GetValue(); // Update links if any inconsistency is found bool bNextLinkUnsetYet = !aNextLinkName.isEmpty() && !mpNextInChain; diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 53a202e8c8be..859fc4639e63 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -1209,8 +1209,8 @@ void SdrTextObj::impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryLi { // get values const SfxItemSet& rSet = GetObjectItemSet(); - const sal_uInt32 nRepeat((sal_uInt32)static_cast<const SdrTextAniCountItem&>(rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue()); - double fDelay((double)static_cast<const SdrTextAniDelayItem&>(rSet.Get(SDRATTR_TEXT_ANIDELAY)).GetValue()); + const sal_uInt32 nRepeat((sal_uInt32)rSet.Get(SDRATTR_TEXT_ANICOUNT).GetValue()); + double fDelay((double)rSet.Get(SDRATTR_TEXT_ANIDELAY).GetValue()); if(0.0 == fDelay) { @@ -1229,7 +1229,7 @@ void SdrTextObj::impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryLi // add stopped state if loop is not endless if(0L != nRepeat) { - bool bVisibleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue()); + bool bVisibleWhenStopped(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE).GetValue()); drawinglayer::animation::AnimationEntryFixed aStop(ENDLESS_TIME, bVisibleWhenStopped ? 0.0 : 1.0); rAnimList.append(aStop); } @@ -1238,9 +1238,9 @@ void SdrTextObj::impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryLi void impCreateScrollTiming(const SfxItemSet& rSet, drawinglayer::animation::AnimationEntryList& rAnimList, bool bForward, double fTimeFullPath, double fFrequency) { - bool bVisibleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue()); - bool bVisibleWhenStarted(static_cast<const SdrTextAniStartInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTARTINSIDE)).GetValue()); - const sal_uInt32 nRepeat(static_cast<const SdrTextAniCountItem&>(rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue()); + bool bVisibleWhenStopped(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE).GetValue()); + bool bVisibleWhenStarted(rSet.Get(SDRATTR_TEXT_ANISTARTINSIDE).GetValue()); + const sal_uInt32 nRepeat(rSet.Get(SDRATTR_TEXT_ANICOUNT).GetValue()); if(bVisibleWhenStarted) { @@ -1278,8 +1278,8 @@ void impCreateAlternateTiming(const SfxItemSet& rSet, drawinglayer::animation::A const double fStartPosition(bForward ? fRelativeTextLength : 1.0 - fRelativeTextLength); const double fEndPosition(bForward ? 1.0 - fRelativeTextLength : fRelativeTextLength); - bool bVisibleWhenStarted(static_cast<const SdrTextAniStartInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTARTINSIDE)).GetValue()); - const sal_uInt32 nRepeat(static_cast<const SdrTextAniCountItem&>(rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue()); + bool bVisibleWhenStarted(rSet.Get(SDRATTR_TEXT_ANISTARTINSIDE).GetValue()); + const sal_uInt32 nRepeat(rSet.Get(SDRATTR_TEXT_ANICOUNT).GetValue()); if(!bVisibleWhenStarted) { @@ -1319,7 +1319,7 @@ void impCreateAlternateTiming(const SfxItemSet& rSet, drawinglayer::animation::A if(0L != nRepeat) { - bool bVisibleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue()); + bool bVisibleWhenStopped(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE).GetValue()); if(bVisibleWhenStopped) { // add timing for staying at the end @@ -1339,7 +1339,7 @@ void impCreateSlideTiming(const SfxItemSet& rSet, drawinglayer::animation::Anima { // move in from outside, start outside const double fStartPosition(bForward ? 0.0 : 1.0); - const sal_uInt32 nRepeat(static_cast<const SdrTextAniCountItem&>(rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue()); + const sal_uInt32 nRepeat(rSet.Get(SDRATTR_TEXT_ANICOUNT).GetValue()); // move from outside to center drawinglayer::animation::AnimationEntryLinear aOutIn(fTimeFullPath * 0.5, fFrequency, fStartPosition, 0.5); @@ -1373,8 +1373,8 @@ void SdrTextObj::impGetScrollTextTiming(drawinglayer::animation::AnimationEntryL // get data. Goal is to calculate fTimeFullPath which is the time needed to // move animation from (0.0) to (1.0) state const SfxItemSet& rSet = GetObjectItemSet(); - double fAnimationDelay((double)static_cast<const SdrTextAniDelayItem&>(rSet.Get(SDRATTR_TEXT_ANIDELAY)).GetValue()); - double fSingleStepWidth((double)static_cast<const SdrTextAniAmountItem&>(rSet.Get(SDRATTR_TEXT_ANIAMOUNT)).GetValue()); + double fAnimationDelay((double)rSet.Get(SDRATTR_TEXT_ANIDELAY).GetValue()); + double fSingleStepWidth((double)rSet.Get(SDRATTR_TEXT_ANIAMOUNT).GetValue()); const SdrTextAniDirection eDirection(GetTextAniDirection()); const bool bForward(SdrTextAniDirection::Right == eDirection || SdrTextAniDirection::Down == eDirection); diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx index b25ead77cc87..f6aa20a83961 100644 --- a/svx/source/svdraw/svdotxat.cxx +++ b/svx/source/svdraw/svdotxat.cxx @@ -169,7 +169,7 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight( tools::Rectangle& rR, bool bHgt, if (pOutlinerParaObject) { rOutliner.SetText(*pOutlinerParaObject); - rOutliner.SetFixedCellHeight(static_cast<const SdrTextFixedCellHeightItem&>(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + rOutliner.SetFixedCellHeight(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue()); } if (bWdtGrow) diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index 515277a4cd18..52a4dfa07ed2 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -77,7 +77,7 @@ bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl) if(pOutlinerParaObject!=nullptr) { rOutl.SetText(*GetOutlinerParaObject()); - rOutl.SetFixedCellHeight(static_cast<const SdrTextFixedCellHeightItem&>(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + rOutl.SetFixedCellHeight(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue()); } // if necessary, set frame attributes for the first (new) paragraph of the diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index f8a4855c66ad..fec8b197b43c 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -351,8 +351,8 @@ namespace sdr tools::Rectangle aObjectRect = rObj.GetSnapRect(); const SfxItemSet& rSet = rObj.GetObjectItemSet(); - bool bAutoGrowWidth = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue(); - bool bAutoGrowHeight = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); + bool bAutoGrowWidth = rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH).GetValue(); + bool bAutoGrowHeight = rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue(); // prepare ItemSet to set exchanged width and height items SfxItemSet aNewSet(*rSet.GetPool(), @@ -765,37 +765,37 @@ sal_Int32 Cell::getMinimumHeight() long Cell::GetTextLeftDistance() const { - return static_cast<const SdrMetricItem&>(GetItemSet().Get(SDRATTR_TEXT_LEFTDIST)).GetValue(); + return GetItemSet().Get(SDRATTR_TEXT_LEFTDIST).GetValue(); } long Cell::GetTextRightDistance() const { - return static_cast<const SdrMetricItem&>(GetItemSet().Get(SDRATTR_TEXT_RIGHTDIST)).GetValue(); + return GetItemSet().Get(SDRATTR_TEXT_RIGHTDIST).GetValue(); } long Cell::GetTextUpperDistance() const { - return static_cast<const SdrMetricItem&>(GetItemSet().Get(SDRATTR_TEXT_UPPERDIST)).GetValue(); + return GetItemSet().Get(SDRATTR_TEXT_UPPERDIST).GetValue(); } long Cell::GetTextLowerDistance() const { - return static_cast<const SdrMetricItem&>(GetItemSet().Get(SDRATTR_TEXT_LOWERDIST)).GetValue(); + return GetItemSet().Get(SDRATTR_TEXT_LOWERDIST).GetValue(); } SdrTextVertAdjust Cell::GetTextVerticalAdjust() const { - return static_cast<const SdrTextVertAdjustItem&>(GetItemSet().Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); + return GetItemSet().Get(SDRATTR_TEXT_VERTADJUST).GetValue(); } SdrTextHorzAdjust Cell::GetTextHorizontalAdjust() const { - return static_cast<const SdrTextHorzAdjustItem&>(GetItemSet().Get(SDRATTR_TEXT_HORZADJUST)).GetValue(); + return GetItemSet().Get(SDRATTR_TEXT_HORZADJUST).GetValue(); } diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 0677bccbb892..7f1dbc070254 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -447,7 +447,7 @@ void SvxTableController::GetState( SfxItemSet& rSet ) SdrTextVertAdjust eAdj = SDRTEXTVERTADJUST_BLOCK; if (xSet->GetItemState( SDRATTR_TEXT_VERTADJUST ) != SfxItemState::DONTCARE) - eAdj = static_cast<const SdrTextVertAdjustItem&>(xSet->Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); + eAdj = xSet->Get(SDRATTR_TEXT_VERTADJUST).GetValue(); rSet.Put(SfxBoolItem(SID_TABLE_VERT_BOTTOM, eAdj == SDRTEXTVERTADJUST_BOTTOM)); rSet.Put(SfxBoolItem(SID_TABLE_VERT_CENTER, eAdj == SDRTEXTVERTADJUST_CENTER)); @@ -883,10 +883,10 @@ namespace { // merge drawing layer text distance items into SvxBoxItem used by the dialog SvxBoxItem aBoxItem( static_cast< const SvxBoxItem& >( rAttrSet.Get( SDRATTR_TABLE_BORDER ) ) ); - aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(rAttrSet.Get(SDRATTR_TEXT_LEFTDIST)).GetValue()), SvxBoxItemLine::LEFT ); - aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(rAttrSet.Get(SDRATTR_TEXT_RIGHTDIST)).GetValue()), SvxBoxItemLine::RIGHT ); - aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(rAttrSet.Get(SDRATTR_TEXT_UPPERDIST)).GetValue()), SvxBoxItemLine::TOP ); - aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(rAttrSet.Get(SDRATTR_TEXT_LOWERDIST)).GetValue()), SvxBoxItemLine::BOTTOM ); + aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( rAttrSet.Get(SDRATTR_TEXT_LEFTDIST).GetValue()), SvxBoxItemLine::LEFT ); + aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( rAttrSet.Get(SDRATTR_TEXT_RIGHTDIST).GetValue()), SvxBoxItemLine::RIGHT ); + aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( rAttrSet.Get(SDRATTR_TEXT_UPPERDIST).GetValue()), SvxBoxItemLine::TOP ); + aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( rAttrSet.Get(SDRATTR_TEXT_LOWERDIST).GetValue()), SvxBoxItemLine::BOTTOM ); return aBoxItem; } } diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx index d7d35fb7c0be..161136f3482e 100644 --- a/svx/source/toolbars/fontworkbar.cxx +++ b/svx/source/toolbars/fontworkbar.cxx @@ -64,8 +64,8 @@ void SetAlignmentState( SdrView const * pSdrView, SfxItemSet& rSet ) if( dynamic_cast<const SdrObjCustomShape*>( pObj) != nullptr ) { sal_Int32 nOldAlignment = nAlignment; - const SdrTextHorzAdjustItem& rTextHorzAdjustItem = static_cast<const SdrTextHorzAdjustItem&>(pObj->GetMergedItem( SDRATTR_TEXT_HORZADJUST )); - const SdrTextFitToSizeTypeItem& rTextFitToSizeTypeItem = static_cast<const SdrTextFitToSizeTypeItem&>(pObj->GetMergedItem( SDRATTR_TEXT_FITTOSIZE )); + const SdrTextHorzAdjustItem& rTextHorzAdjustItem = pObj->GetMergedItem( SDRATTR_TEXT_HORZADJUST ); + const SdrTextFitToSizeTypeItem& rTextFitToSizeTypeItem = pObj->GetMergedItem( SDRATTR_TEXT_FITTOSIZE ); switch ( rTextHorzAdjustItem.GetValue() ) { case SDRTEXTHORZADJUST_LEFT : nAlignment = 0; break; |