diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/accessibility/DescriptionGenerator.cxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/rubydialog.cxx | 7 | ||||
-rw-r--r-- | svx/source/dialog/swframeexample.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/formcontroller.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/area/AreaPropertyPanelBase.cxx | 2 | ||||
-rw-r--r-- | svx/source/styles/CommonStylePreviewRenderer.cxx | 2 | ||||
-rw-r--r-- | svx/source/table/svdotable.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/fillctrl.cxx | 8 | ||||
-rw-r--r-- | svx/source/tbxctrls/itemwin.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 3 | ||||
-rw-r--r-- | svx/source/toolbars/extrusionbar.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap2.cxx | 40 | ||||
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 14 | ||||
-rw-r--r-- | svx/source/xoutdev/xattr2.cxx | 12 |
14 files changed, 44 insertions, 58 deletions
diff --git a/svx/source/accessibility/DescriptionGenerator.cxx b/svx/source/accessibility/DescriptionGenerator.cxx index 7f9ec19db36e..f75757d4c78a 100644 --- a/svx/source/accessibility/DescriptionGenerator.cxx +++ b/svx/source/accessibility/DescriptionGenerator.cxx @@ -339,7 +339,7 @@ void DescriptionGenerator::AddFillStyle (const OUString& sPropertyName, case drawing::FillStyle_BITMAP: sFillStyleName = SVX_RESSTR(RID_SVXSTR_A11Y_FILLSTYLE_BITMAP); break; - case drawing::FillStyle_MAKE_FIXED_SIZE: + default: break; } } @@ -366,7 +366,7 @@ void DescriptionGenerator::AddFillStyle (const OUString& sPropertyName, AddProperty ("FillBitmapName", PropertyType::String, SIP_XA_FILLBITMAP, XATTR_FILLBITMAP); break; - case drawing::FillStyle_MAKE_FIXED_SIZE: + default: break; } } diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 2b74ef1251f7..415e3d23eb92 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -807,10 +807,10 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang long nRubyWidth = rRenderContext.GetTextWidth(sRubyText); rRenderContext.SetFont(aSaveFont); - sal_Int32 nAdjust = m_pParentDlg->m_pAdjustLB->GetSelectEntryPos(); + RubyAdjust nAdjust = (RubyAdjust)m_pParentDlg->m_pAdjustLB->GetSelectEntryPos(); //use center if no adjustment is available - if (nAdjust > 4) - nAdjust = 1; + if (nAdjust > RubyAdjust_INDENT_BLOCK) + nAdjust = RubyAdjust_CENTER; //which part is stretched ? bool bRubyStretch = nBaseWidth >= nRubyWidth; @@ -892,6 +892,7 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang case RubyAdjust_CENTER: rRenderContext.DrawText(Point(nCenter - nOutTextWidth / 2 , nYOutput), sOutputText); break; + default: break; } rRenderContext.SetFont(aSaveFont); rRenderContext.Pop(); diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx index 8f0a9e5d8fb8..46f8db0778f1 100644 --- a/svx/source/dialog/swframeexample.cxx +++ b/svx/source/dialog/swframeexample.cxx @@ -28,7 +28,6 @@ #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/VertOrientation.hpp> #include <com/sun/star/text/RelOrientation.hpp> -#include <com/sun/star/text/WrapTextMode.hpp> using namespace ::com::sun::star::text; @@ -662,6 +661,7 @@ void SvxSwFrameExample::Paint(vcl::RenderContext& rRenderContext, const tools::R case WrapTextMode_RIGHT: aTxt.Left() = aFrmRect.Right(); break; + default: break; } } if (pOuterFrame->IsInside(aTxt)) diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index bd1b79ef4564..bd28d36b9a7e 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -2553,7 +2553,7 @@ void FormController::loaded(const EventObject& rEvent) Any aVal = xSet->getPropertyValue(FM_PROP_CYCLE); sal_Int32 aVal2 = 0; ::cppu::enum2int(aVal2,aVal); - m_bCycle = !aVal.hasValue() || aVal2 == TabulatorCycle_RECORDS; + m_bCycle = !aVal.hasValue() || (form::TabulatorCycle)aVal2 == TabulatorCycle_RECORDS; m_bCanUpdate = canUpdate(xSet); m_bCanInsert = canInsert(xSet); m_bCurrentRecordModified = ::comphelper::getBOOL(xSet->getPropertyValue(FM_PROP_ISMODIFIED)); diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx index dde9b0acc12c..53ec1bd87192 100644 --- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx @@ -1346,7 +1346,7 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl, ListBox&, void) XGradient aTmpGradient; - switch(nSelectType) + switch((css::awt::GradientStyle)nSelectType) { case css::awt::GradientStyle_LINEAR: aTmpGradient = maGradientLinear; diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx b/svx/source/styles/CommonStylePreviewRenderer.cxx index fdb41ecbec42..ab7133d8f8a7 100644 --- a/svx/source/styles/CommonStylePreviewRenderer.cxx +++ b/svx/source/styles/CommonStylePreviewRenderer.cxx @@ -119,7 +119,7 @@ bool CommonStylePreviewRenderer::recalculate() { if ((pItem = pItemSet->GetItem(XATTR_FILLSTYLE)) != nullptr) { - sal_uInt16 aFillStyle = static_cast<const XFillStyleItem*>(pItem)->GetValue(); + css::drawing::FillStyle aFillStyle = static_cast<const XFillStyleItem*>(pItem)->GetValue(); if (aFillStyle == drawing::FillStyle_SOLID) { if ((pItem = pItemSet->GetItem(XATTR_FILLCOLOR)) != nullptr) diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index ce2b7cbd49c2..a38d354b0289 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -1964,7 +1964,7 @@ WritingMode SdrTableObj::GetWritingMode() const const SfxPoolItem *pItem; if ( rSet.GetItemState( SDRATTR_TEXTDIRECTION, false, &pItem ) == SfxItemState::SET ) - eWritingMode = static_cast< WritingMode >( static_cast< const SvxWritingModeItem * >( pItem )->GetValue() ); + eWritingMode = static_cast< const SvxWritingModeItem * >( pItem )->GetValue(); if ( ( eWritingMode != WritingMode_TB_RL ) && ( rSet.GetItemState( EE_PARA_WRITINGDIR, false, &pItem ) == SfxItemState::SET ) ) diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index bbbaf61f47ff..0fdabe726ddd 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -64,7 +64,7 @@ SvxFillToolBoxControl::SvxFillToolBoxControl( , mpFillControl(nullptr) , mpLbFillType(nullptr) , mpLbFillAttr(nullptr) - , meLastXFS(static_cast<sal_uInt16>(-1)) + , meLastXFS(static_cast<drawing::FillStyle>(-1)) , mnLastPosGradient(0) , mnLastPosHatch(0) , mnLastPosBitmap(0) @@ -102,7 +102,7 @@ void SvxFillToolBoxControl::StateChanged( mpLbFillAttr->Disable(); mpLbFillAttr->SetNoSelection(); mpToolBoxColor->Hide(); - meLastXFS = static_cast<sal_uInt16>(-1); + meLastXFS = static_cast<drawing::FillStyle>(-1); mpStyleItem.reset(); } @@ -134,7 +134,7 @@ void SvxFillToolBoxControl::StateChanged( mpLbFillAttr->Disable(); mpLbFillAttr->SetNoSelection(); mpToolBoxColor->Hide(); - meLastXFS = static_cast<sal_uInt16>(-1); + meLastXFS = static_cast<drawing::FillStyle>(-1); mpStyleItem.reset(); break; } @@ -734,7 +734,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, ListBox&, void) } } - meLastXFS = (sal_uInt16)eXFS; + meLastXFS = eXFS; if(drawing::FillStyle_NONE != eXFS) { diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx index 6faa9fdeba40..fbbe17014c62 100644 --- a/svx/source/tbxctrls/itemwin.cxx +++ b/svx/source/tbxctrls/itemwin.cxx @@ -388,7 +388,7 @@ SvxFillTypeBox::SvxFillTypeBox( vcl::Window* pParent ) : { SetSizePixel( LogicToPixel( Size(40, 40 ),MapUnit::MapAppFont )); Fill(); - SelectEntryPos( drawing::FillStyle_SOLID ); + SelectEntryPos( (sal_Int32)drawing::FillStyle_SOLID ); Show(); } diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index c70d184c2810..46443440d640 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -745,7 +745,7 @@ void SvxStyleBox_Impl::SetupEntry(vcl::RenderContext& rRenderContext, vcl::Windo if ( (nullptr != pItem) && bIsNotSelected) aFontCol = Color( static_cast< const SvxColorItem* >( pItem )->GetValue() ); - sal_uInt16 style = drawing::FillStyle_NONE; + drawing::FillStyle style = drawing::FillStyle_NONE; // which kind of Fill style is selected pItem = pItemSet->GetItem( XATTR_FILLSTYLE ); // only when ok and not selected @@ -769,6 +769,7 @@ void SvxStyleBox_Impl::SetupEntry(vcl::RenderContext& rRenderContext, vcl::Windo } break; + default: break; //TODO Draw the other background styles: gradient, hatching and bitmap } diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx index 73097acd80e1..72f406b0a380 100644 --- a/svx/source/toolbars/extrusionbar.cxx +++ b/svx/source/toolbars/extrusionbar.cxx @@ -645,7 +645,7 @@ void getExtrusionDirectionState( SdrView* pSdrView, SfxItemSet& rSet ) pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "ProjectionMode" ); sal_Int16 nProjectionMode = sal_Int16(); if( pAny && ( *pAny >>= nProjectionMode ) ) - bParallel = nProjectionMode == ProjectionMode_PARALLEL; + bParallel = (ProjectionMode)nProjectionMode == ProjectionMode_PARALLEL; if( bParallel ) { diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index da4453058d24..1b1ad743f5fa 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -662,8 +662,8 @@ namespace struct EnumConversionMap { - sal_Int16 nAPIValue; - sal_Int16 nFormValue; + style::ParagraphAdjust nAPIValue; + sal_Int16 nFormValue; }; EnumConversionMap aMapAdjustToAlign[] = @@ -676,51 +676,33 @@ namespace {style::ParagraphAdjust_RIGHT, (sal_Int16)awt::TextAlign::RIGHT}, {style::ParagraphAdjust_BLOCK, (sal_Int16)awt::TextAlign::RIGHT}, {style::ParagraphAdjust_STRETCH, (sal_Int16)awt::TextAlign::LEFT}, - {-1,-1} + {(style::ParagraphAdjust)-1,-1} }; - void lcl_mapFormToAPIValue( Any& _rValue, const EnumConversionMap* _pMap ) + void lcl_convertTextAlignmentToParaAdjustment( Any& _rValue ) { sal_Int16 nValue = sal_Int16(); OSL_VERIFY( _rValue >>= nValue ); - const EnumConversionMap* pEntry = _pMap; - while ( pEntry && ( pEntry->nFormValue != -1 ) ) - { - if ( nValue == pEntry->nFormValue ) + for ( auto const & rEntry : aMapAdjustToAlign ) + if ( nValue == rEntry.nFormValue ) { - _rValue <<= pEntry->nAPIValue; + _rValue <<= rEntry.nAPIValue; return; } - ++pEntry; - } } - void lcl_mapAPIToFormValue( Any& _rValue, const EnumConversionMap* _pMap ) + void lcl_convertParaAdjustmentToTextAlignment( Any& _rValue ) { sal_Int32 nValue = 0; OSL_VERIFY( _rValue >>= nValue ); - const EnumConversionMap* pEntry = _pMap; - while ( pEntry && ( pEntry->nAPIValue != -1 ) ) - { - if ( nValue == pEntry->nAPIValue ) + for ( auto const & rEntry : aMapAdjustToAlign ) + if ( (style::ParagraphAdjust)nValue == rEntry.nAPIValue ) { - _rValue <<= pEntry->nFormValue; + _rValue <<= rEntry.nFormValue; return; } - ++pEntry; - } - } - - void lcl_convertTextAlignmentToParaAdjustment( Any& rValue ) - { - lcl_mapFormToAPIValue( rValue, aMapAdjustToAlign ); - } - - void lcl_convertParaAdjustmentToTextAlignment( Any& rValue ) - { - lcl_mapAPIToFormValue( rValue, aMapAdjustToAlign ); } void convertVerticalAdjustToVerticalAlign( Any& _rValue ) diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 9f42f5c2ad0c..2b9126ca8746 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -390,7 +390,7 @@ bool XLineStyleItem::GetPresentation sal_uInt16 nId = 0; - switch( (sal_uInt16)GetValue() ) + switch( GetValue() ) { case css::drawing::LineStyle_NONE: nId = RID_SVXSTR_INVISIBLE; @@ -398,6 +398,7 @@ bool XLineStyleItem::GetPresentation case css::drawing::LineStyle_SOLID: nId = RID_SVXSTR_SOLID; break; + default: break; } if ( nId ) @@ -707,7 +708,7 @@ SvStream& XLineDashItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const if (!IsIndex()) { - rOut.WriteInt32( aDash.GetDashStyle() ); + rOut.WriteInt32( (sal_Int32)aDash.GetDashStyle() ); rOut.WriteUInt16( aDash.GetDots() ); rOut.WriteUInt32( aDash.GetDotLen() ); rOut.WriteUInt16( aDash.GetDashes() ); @@ -2138,7 +2139,7 @@ bool XFillStyleItem::GetPresentation sal_uInt16 nId = 0; - switch( (sal_uInt16)GetValue() ) + switch( GetValue() ) { case drawing::FillStyle_NONE: nId = RID_SVXSTR_INVISIBLE; @@ -2155,6 +2156,7 @@ bool XFillStyleItem::GetPresentation case drawing::FillStyle_BITMAP: nId = RID_SVXSTR_BITMAP; break; + default: break; } if ( nId ) @@ -2197,7 +2199,7 @@ void XFillStyleItem::dumpAsXml(xmlTextWriterPtr pWriter) const { xmlTextWriterStartElement(pWriter, BAD_CAST("XFillStyleItem")); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number((sal_Int16)GetValue()).getStr())); OUString aPresentation; GetPresentation(SfxItemPresentation::Nameless, MapUnit::Map100thMM, MapUnit::Map100thMM, aPresentation); @@ -2449,7 +2451,7 @@ SvStream& XFillGradientItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) co if (!IsIndex()) { - rOut.WriteInt16( aGradient.GetGradientStyle() ); + rOut.WriteInt16( (sal_Int16)aGradient.GetGradientStyle() ); sal_uInt16 nTmp; @@ -2936,7 +2938,7 @@ SvStream& XFillHatchItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const if (!IsIndex()) { - rOut.WriteInt16( aHatch.GetHatchStyle() ); + rOut.WriteInt16( (sal_Int16)aHatch.GetHatchStyle() ); sal_uInt16 nTmp; nTmp = VCLTOSVCOL( aHatch.GetColor().GetRed() ); rOut.WriteUInt16( nTmp ); diff --git a/svx/source/xoutdev/xattr2.cxx b/svx/source/xoutdev/xattr2.cxx index a3cd82b9be36..d2460e16838e 100644 --- a/svx/source/xoutdev/xattr2.cxx +++ b/svx/source/xoutdev/xattr2.cxx @@ -120,27 +120,27 @@ bool XLineJointItem::GetPresentation( SfxItemPresentation /*ePres*/, MapUnit /*e switch( GetValue() ) { - case( css::drawing::LineJoint_MAKE_FIXED_SIZE ): - case( css::drawing::LineJoint_NONE ): + case css::drawing::LineJoint::LineJoint_MAKE_FIXED_SIZE: + case css::drawing::LineJoint_NONE: nId = RID_SVXSTR_LINEJOINT_NONE; break; - case( css::drawing::LineJoint_MIDDLE ): + case css::drawing::LineJoint_MIDDLE: nId = RID_SVXSTR_LINEJOINT_MIDDLE; break; - case( css::drawing::LineJoint_BEVEL ): + case css::drawing::LineJoint_BEVEL: nId = RID_SVXSTR_LINEJOINT_BEVEL; break; - case( css::drawing::LineJoint_MITER ): + case css::drawing::LineJoint_MITER: nId = RID_SVXSTR_LINEJOINT_MITER; break; - case( css::drawing::LineJoint_ROUND ): + case css::drawing::LineJoint_ROUND: nId = RID_SVXSTR_LINEJOINT_ROUND; break; } |