summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/inc/swpossizetabpage.hxx5
-rw-r--r--cui/source/tabpages/swpossizetabpage.cxx19
-rw-r--r--cui/source/tabpages/tpline.cxx2
-rw-r--r--include/svx/fillctrl.hxx2
-rw-r--r--include/svx/swframeexample.hxx12
-rw-r--r--include/svx/swframevalidation.hxx6
-rw-r--r--svx/source/accessibility/DescriptionGenerator.cxx4
-rw-r--r--svx/source/dialog/rubydialog.cxx7
-rw-r--r--svx/source/dialog/swframeexample.cxx2
-rw-r--r--svx/source/form/formcontroller.cxx2
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanelBase.cxx2
-rw-r--r--svx/source/styles/CommonStylePreviewRenderer.cxx2
-rw-r--r--svx/source/table/svdotable.cxx2
-rw-r--r--svx/source/tbxctrls/fillctrl.cxx8
-rw-r--r--svx/source/tbxctrls/itemwin.cxx2
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx3
-rw-r--r--svx/source/toolbars/extrusionbar.cxx2
-rw-r--r--svx/source/unodraw/unoshap2.cxx40
-rw-r--r--svx/source/xoutdev/xattr.cxx14
-rw-r--r--svx/source/xoutdev/xattr2.cxx12
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx10
-rw-r--r--sw/source/ui/frmdlg/wrap.cxx4
22 files changed, 77 insertions, 85 deletions
diff --git a/cui/source/inc/swpossizetabpage.hxx b/cui/source/inc/swpossizetabpage.hxx
index 4442250f19cf..c11050f778d5 100644
--- a/cui/source/inc/swpossizetabpage.hxx
+++ b/cui/source/inc/swpossizetabpage.hxx
@@ -26,6 +26,7 @@
#include <vcl/lstbox.hxx>
#include <svx/swframeposstrings.hxx>
#include <svx/swframeexample.hxx>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
// SvxSwPosSizeTabPage - position and size page for Writer drawing objects
struct FrmMap;
@@ -109,13 +110,13 @@ class SvxSwPosSizeTabPage : public SfxTabPage
DECL_LINK( ModifyHdl, Edit&, void );
DECL_LINK(ProtectHdl, Button*, void);
- void InitPos(short nAnchorType, sal_uInt16 nH, sal_uInt16 nHRel,
+ void InitPos(css::text::TextContentAnchorType nAnchorType, sal_uInt16 nH, sal_uInt16 nHRel,
sal_uInt16 nV, sal_uInt16 nVRel,
long nX, long nY);
sal_uInt16 GetMapPos(FrmMap *pMap, ListBox &rAlignLB);
static short GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, ListBox &rAlignLB, ListBox &rRelationLB);
static short GetRelation(FrmMap *pMap, ListBox &rRelationLB);
- short GetAnchorType(bool* pbHasChanged = nullptr);
+ css::text::TextContentAnchorType GetAnchorType(bool* pbHasChanged = nullptr);
void FillRelLB(FrmMap *pMap, sal_uInt16 nLBSelPos, sal_uInt16 nAlign, sal_uInt16 nRel, ListBox &rLB, FixedText &rFT);
sal_uInt16 FillPosLB(FrmMap *pMap, sal_uInt16 nAlign, const sal_uInt16 _nRel, ListBox &rLB);
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index 2a4deffed663..4e669fd6dcf3 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -30,7 +30,6 @@
#include <svx/svdpagv.hxx>
#include <svx/rectenum.hxx>
#include <sal/macros.h>
-#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
@@ -772,11 +771,11 @@ const sal_uInt16* SvxSwPosSizeTabPage::GetRanges()
bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet* rSet)
{
bool bAnchorChanged = false;
- short nAnchor = GetAnchorType(&bAnchorChanged);
+ css::text::TextContentAnchorType nAnchor = GetAnchorType(&bAnchorChanged);
bool bModified = false;
if(bAnchorChanged)
{
- rSet->Put(SfxInt16Item(SID_ATTR_TRANSFORM_ANCHOR, nAnchor));
+ rSet->Put(SfxInt16Item(SID_ATTR_TRANSFORM_ANCHOR, (sal_Int16)nAnchor));
bModified = true;
}
if ( m_pPositionCB->IsValueChangedFromSaved() )
@@ -926,10 +925,10 @@ void SvxSwPosSizeTabPage::Reset( const SfxItemSet* rSet)
{
const SfxPoolItem* pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_ANCHOR );
bool bInvalidateAnchor = false;
- short nAnchorType = TextContentAnchorType_AT_PARAGRAPH;
+ TextContentAnchorType nAnchorType = TextContentAnchorType_AT_PARAGRAPH;
if(pItem)
{
- nAnchorType = static_cast<const SfxInt16Item*>(pItem)->GetValue();
+ nAnchorType = (TextContentAnchorType) static_cast<const SfxInt16Item*>(pItem)->GetValue();
switch(nAnchorType)
{
case TextContentAnchorType_AT_PAGE: m_pToPageRB->Check(); break;
@@ -1102,9 +1101,9 @@ void SvxSwPosSizeTabPage::EnableAnchorTypes(SvxAnchorIds nAnchorEnable)
m_pToPageRB->Enable(false);
}
-short SvxSwPosSizeTabPage::GetAnchorType(bool* pbHasChanged)
+TextContentAnchorType SvxSwPosSizeTabPage::GetAnchorType(bool* pbHasChanged)
{
- short nRet = -1;
+ TextContentAnchorType nRet = (TextContentAnchorType)-1;
RadioButton* pCheckedButton = nullptr;
if(m_pToParaRB->IsEnabled())
{
@@ -1234,7 +1233,7 @@ IMPL_LINK_NOARG(SvxSwPosSizeTabPage, AnchorTypeHdl, Button*, void)
// type to-paragraph' and to-character
m_pFollowCB->Enable( m_pToParaRB->IsChecked() || m_pToCharRB->IsChecked() );
- short nId = GetAnchorType();
+ TextContentAnchorType nId = GetAnchorType();
InitPos( nId, USHRT_MAX, 0, USHRT_MAX, 0, LONG_MAX, LONG_MAX);
RangeModifyHdl(*m_pWidthMF);
@@ -1248,7 +1247,7 @@ IMPL_LINK_NOARG(SvxSwPosSizeTabPage, AnchorTypeHdl, Button*, void)
IMPL_LINK_NOARG(SvxSwPosSizeTabPage, MirrorHdl, Button*, void)
{
- short nId = GetAnchorType();
+ TextContentAnchorType nId = GetAnchorType();
InitPos( nId, USHRT_MAX, 0, USHRT_MAX, 0, LONG_MAX, LONG_MAX);
}
@@ -1490,7 +1489,7 @@ sal_uInt16 SvxSwPosSizeTabPage::GetMapPos(FrmMap *pMap, ListBox &rAlignLB)
return nMapPos;
}
-void SvxSwPosSizeTabPage::InitPos(short nAnchor,
+void SvxSwPosSizeTabPage::InitPos(TextContentAnchorType nAnchor,
sal_uInt16 nH,
sal_uInt16 nHRel,
sal_uInt16 nV,
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index d01c4aa03f36..c9719e945f6a 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -1417,7 +1417,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
switch(eLineJoint)
{
- case css::drawing::LineJoint_MAKE_FIXED_SIZE: // fallback to round, unused value
+ case css::drawing::LineJoint::LineJoint_MAKE_FIXED_SIZE: // fallback to round, unused value
case css::drawing::LineJoint_ROUND : m_pLBEdgeStyle->SelectEntryPos(0); break;
case css::drawing::LineJoint_NONE : m_pLBEdgeStyle->SelectEntryPos(1); break;
case css::drawing::LineJoint_MIDDLE : // fallback to mitre, unused value
diff --git a/include/svx/fillctrl.hxx b/include/svx/fillctrl.hxx
index c7181a8a1ab3..3ee9d551a6ed 100644
--- a/include/svx/fillctrl.hxx
+++ b/include/svx/fillctrl.hxx
@@ -55,7 +55,7 @@ private:
VclPtr<ToolBox> mpToolBoxColor;
VclPtr<SvxFillAttrBox> mpLbFillAttr;
- sal_uInt16 meLastXFS;
+ css::drawing::FillStyle meLastXFS;
sal_Int32 mnLastPosGradient;
sal_Int32 mnLastPosHatch;
sal_Int32 mnLastPosBitmap;
diff --git a/include/svx/swframeexample.hxx b/include/svx/swframeexample.hxx
index bc1928029e18..a780f5770add 100644
--- a/include/svx/swframeexample.hxx
+++ b/include/svx/swframeexample.hxx
@@ -24,6 +24,8 @@
#include <tools/color.hxx>
#include <tools/gen.hxx>
#include <svx/svxdllapi.h>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
+#include <com/sun/star/text/WrapTextMode.hpp>
// class SwFrmPagePreview -------------------------------------------------------
@@ -55,8 +57,10 @@ class SVX_DLLPUBLIC SvxSwFrameExample : public vcl::Window
short nVAlign;
short nVRel;
- short nWrap;
- short nAnchor;
+ css::text::WrapTextMode
+ nWrap;
+ css::text::TextContentAnchorType
+ nAnchor;
bool bTrans;
Point aRelPos;
@@ -74,7 +78,7 @@ public:
SvxSwFrameExample(vcl::Window* pParent, WinBits nStyle);
- void SetWrap(sal_uInt16 nW) { nWrap = nW; }
+ void SetWrap(css::text::WrapTextMode nW) { nWrap = nW; }
void SetHAlign(short nH) { nHAlign = nH; }
void SetHoriRel(short nR) { nHRel = nR; }
@@ -83,7 +87,7 @@ public:
void SetVertRel(short nR) { nVRel = nR; }
void SetTransparent(bool bT) { bTrans = bT; }
- void SetAnchor(short nA) { nAnchor = nA; }
+ void SetAnchor(css::text::TextContentAnchorType nA) { nAnchor = nA; }
void SetRelPos(const Point& rP);
};
diff --git a/include/svx/swframevalidation.hxx b/include/svx/swframevalidation.hxx
index 124434f1e343..cb75145937c8 100644
--- a/include/svx/swframevalidation.hxx
+++ b/include/svx/swframevalidation.hxx
@@ -18,16 +18,18 @@
*/
#ifndef INCLUDED_SVX_SWFRAMEVALIDATION_HXX
#define INCLUDED_SVX_SWFRAMEVALIDATION_HXX
+
#include <sal/types.h>
#include <tools/gen.hxx>
#include <limits.h>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
/*
struct to determine min/max values for fly frame positioning in Writer
*/
struct SvxSwFrameValidation
{
- sal_Int16 nAnchorType; //css::text::TextContentAnchorType
+ css::text::TextContentAnchorType nAnchorType;
sal_Int16 nHoriOrient; //css::text::HoriOrientation
sal_Int16 nVertOrient; //css::text::VertOrientation
sal_Int16 nHRelOrient; //css::text::RelOrientation
@@ -56,7 +58,7 @@ struct SvxSwFrameValidation
Size aPercentSize; // Size for 100% value
SvxSwFrameValidation() :
- nAnchorType(0),
+ nAnchorType(css::text::TextContentAnchorType_AT_PARAGRAPH),
nHoriOrient(0),
nVertOrient(0),
nHRelOrient(0),
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;
}
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index dc9d86d4e8cd..f79265c3f34b 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -1814,7 +1814,7 @@ void SwFramePage::RangeModifyHdl()
SwFlyFrameAttrMgr aMgr( m_bNew, pSh, static_cast<const SwAttrSet&>(GetItemSet()) );
SvxSwFrameValidation aVal;
- aVal.nAnchorType = static_cast< sal_Int16 >(GetAnchor());
+ aVal.nAnchorType = (css::text::TextContentAnchorType)GetAnchor();
aVal.bAutoHeight = m_pAutoHeightCB->IsChecked();
aVal.bAutoWidth = m_pAutoWidthCB->IsChecked();
aVal.bMirror = m_pMirrorPagesCB->IsChecked();
@@ -1911,9 +1911,9 @@ void SwFramePage::RangeModifyHdl()
if ( aVal.nHPos != nAtHorzPosVal )
m_pAtHorzPosED->SetValue(m_pAtHorzPosED->Normalize(aVal.nHPos), FUNIT_TWIP);
- const SwTwips nUpperOffset = (aVal.nAnchorType == (sal_Int16)RndStdIds::FLY_AS_CHAR)
+ const SwTwips nUpperOffset = (aVal.nAnchorType == css::text::TextContentAnchorType_AS_CHARACTER)
? m_nUpperBorder : 0;
- const SwTwips nLowerOffset = (aVal.nAnchorType == (sal_Int16)RndStdIds::FLY_AS_CHAR)
+ const SwTwips nLowerOffset = (aVal.nAnchorType == css::text::TextContentAnchorType_AS_CHARACTER)
? m_nLowerBorder : 0;
m_pAtVertPosED->SetMin(m_pAtVertPosED->Normalize(aVal.nMinVPos + nLowerOffset + nUpperOffset), FUNIT_TWIP);
@@ -2144,7 +2144,7 @@ void SwFramePage::UpdateExample()
long nYPos = static_cast< long >(m_pAtVertPosED->Denormalize(m_pAtVertPosED->GetValue(FUNIT_TWIP)));
m_pExampleWN->SetRelPos(Point(nXPos, nYPos));
- m_pExampleWN->SetAnchor( static_cast< sal_Int16 >(GetAnchor()) );
+ m_pExampleWN->SetAnchor( (css::text::TextContentAnchorType)GetAnchor() );
m_pExampleWN->Invalidate();
}
@@ -2309,7 +2309,7 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset)
// transparent for example
// circulation for example
const SwFormatSurround& rSurround = static_cast<const SwFormatSurround&>(rSet.Get(RES_SURROUND));
- m_pExampleWN->SetWrap ( static_cast< sal_uInt16 >(rSurround.GetSurround()) );
+ m_pExampleWN->SetWrap( rSurround.GetSurround() );
if ( rSurround.GetSurround() == css::text::WrapTextMode_THROUGHT )
{
diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx
index fad4f66df930..f70090a1cba6 100644
--- a/sw/source/ui/frmdlg/wrap.cxx
+++ b/sw/source/ui/frmdlg/wrap.cxx
@@ -422,7 +422,7 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet)
const SwFormatHoriOrient& rHori = static_cast<const SwFormatHoriOrient&>(rSet.Get(RES_HORI_ORIENT));
const SwFormatVertOrient& rVert = static_cast<const SwFormatVertOrient&>(rSet.Get(RES_VERT_ORIENT));
- aVal.nAnchorType = static_cast< sal_Int16 >(m_nAnchorId);
+ aVal.nAnchorType = static_cast< css::text::TextContentAnchorType >(m_nAnchorId);
aVal.bAutoHeight = rFrameSize.GetHeightSizeType() == ATT_MIN_SIZE;
aVal.bAutoWidth = rFrameSize.GetWidthSizeType() == ATT_MIN_SIZE;
aVal.bMirror = rHori.IsPosToggle();
@@ -461,7 +461,7 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet)
nBottom = aVal.nMaxHeight - aVal.nHeight;
{
- if (aVal.nAnchorType == (sal_Int16)RndStdIds::FLY_AS_CHAR)
+ if (aVal.nAnchorType == (css::text::TextContentAnchorType)RndStdIds::FLY_AS_CHAR)
{
nLeft = nRight;