summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-08-19 09:31:35 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-08-19 11:25:18 +0000
commit396138a6bc7192abe0837b419283860d3331f607 (patch)
treef80818ba86220abb8db205b402429e3d45aa62d1 /cui
parent8b4705e0e0c76503b1ca61cb567d222f49466fc5 (diff)
Resolves: coverity#705366 Mixing enum types
and coverity#705367 Mixing enum types coverity#705371 Mixing enum types coverity#982694 Mixing enum types coverity#1027717 Mixing enum types coverity#1371228 Mixing enum types coverity#1371242 Mixing enum types coverity#1371280 Mixing enum types coverity#1371310 Mixing enum types MapUnit and SfxMapUnit share the same values and are freely cast from one to the other. Now that commit d30a4298bdb5ba53cd1fe659f2b742f218a2e527 Date: Thu Aug 11 15:02:19 2016 +0200 loplugin:unusedenumconstants in package..svtools removed the SfxMapUnit entries that were directly unused, they don't match anymore and casting from one to the other is dangerous. Why there was two of these anyway escapes me, get rid of SfxMapUnit and just use MapUnit universally Change-Id: I4db5dcd04b59be2f85b62b728f96c90afe00c57e Reviewed-on: https://gerrit.libreoffice.org/28234 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/inc/connect.hxx2
-rw-r--r--cui/source/inc/cuitabarea.hxx8
-rw-r--r--cui/source/inc/cuitabline.hxx4
-rw-r--r--cui/source/inc/measure.hxx2
-rw-r--r--cui/source/inc/numpages.hxx12
-rw-r--r--cui/source/inc/textanim.hxx2
-rw-r--r--cui/source/inc/transfrm.hxx6
-rw-r--r--cui/source/tabpages/border.cxx8
-rw-r--r--cui/source/tabpages/chardlg.cxx20
-rw-r--r--cui/source/tabpages/labdlg.cxx6
-rw-r--r--cui/source/tabpages/measure.cxx2
-rw-r--r--cui/source/tabpages/page.cxx68
-rw-r--r--cui/source/tabpages/paragrph.cxx16
-rw-r--r--cui/source/tabpages/textattr.cxx4
14 files changed, 80 insertions, 80 deletions
diff --git a/cui/source/inc/connect.hxx b/cui/source/inc/connect.hxx
index 1b481f92907c..afb0624916f5 100644
--- a/cui/source/inc/connect.hxx
+++ b/cui/source/inc/connect.hxx
@@ -53,7 +53,7 @@ private:
const SfxItemSet& rOutAttrs;
SfxItemSet aAttrSet;
const SdrView* pView;
- SfxMapUnit eUnit;
+ MapUnit eUnit;
void FillTypeLB();
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 590cd6eeb2c6..1c2afd77739b 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -249,7 +249,7 @@ private:
XFillAttrSetItem m_aXFillAttr;
SfxItemSet& m_rXFSet;
- SfxMapUnit m_ePoolUnit;
+ MapUnit m_ePoolUnit;
DECL_LINK_TYPED(SelectDialogTypeHdl_Impl, ListBox&, void);
DECL_LINK_TYPED( ModifyColorHdl_Impl, ListBox&, void );
@@ -328,7 +328,7 @@ private:
XFillAttrSetItem m_aXFillAttr;
SfxItemSet& m_rXFSet;
- SfxMapUnit m_ePoolUnit;
+ MapUnit m_ePoolUnit;
DECL_LINK_TYPED( ClickShadowHdl_Impl, Button*, void );
DECL_LINK_TYPED( ModifyShadowHdl_Impl, Edit&, void );
@@ -481,7 +481,7 @@ private:
XFillAttrSetItem m_aXFillAttr;
SfxItemSet& m_rXFSet;
- SfxMapUnit m_ePoolUnit;
+ MapUnit m_ePoolUnit;
DECL_LINK_TYPED( ChangeHatchHdl, ValueSet*, void );
void ChangeHatchHdl_Impl();
@@ -574,7 +574,7 @@ private:
XFillAttrSetItem m_aXFillAttr;
SfxItemSet& m_rXFSet;
const SdrView* mpView;
- SfxMapUnit mePoolUnit;
+ MapUnit mePoolUnit;
Size rBitmapSize;
Size rFilledSize;
Size rZoomedSize;
diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx
index f2398ad17c1c..639e5117598c 100644
--- a/cui/source/inc/cuitabline.hxx
+++ b/cui/source/inc/cuitabline.hxx
@@ -164,7 +164,7 @@ private:
sal_Int32* m_pPosDashLb;
sal_Int32* m_pPosLineEndLb;
- SfxMapUnit m_ePoolUnit;
+ MapUnit m_ePoolUnit;
sal_Int32 m_nActLineWidth;
@@ -280,7 +280,7 @@ private:
sal_uInt16 nDlgType;
sal_Int32* pPosDashLb;
- SfxMapUnit ePoolUnit;
+ MapUnit ePoolUnit;
FieldUnit eFUnit;
void FillDash_Impl();
diff --git a/cui/source/inc/measure.hxx b/cui/source/inc/measure.hxx
index 90dbfa82602f..184ad5cca81e 100644
--- a/cui/source/inc/measure.hxx
+++ b/cui/source/inc/measure.hxx
@@ -54,7 +54,7 @@ private:
const SfxItemSet& rOutAttrs;
SfxItemSet aAttrSet;
const SdrView* pView;
- SfxMapUnit eUnit;
+ MapUnit eUnit;
bool bPositionModified;
diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx
index 5344aaf177cd..42bcf2969646 100644
--- a/cui/source/inc/numpages.hxx
+++ b/cui/source/inc/numpages.hxx
@@ -213,7 +213,7 @@ class SvxBitmapPickTabPage : public SfxTabPage
SvxNumRule* pSaveNum;
sal_uInt16 nActNumLvl;
sal_uInt16 nNumItemId;
- SfxMapUnit eCoreUnit;
+ MapUnit eCoreUnit;
bool bModified : 1;
bool bPreset : 1;
@@ -303,10 +303,10 @@ class SvxNumOptionsTabPage : public SfxTabPage
std::vector<OUString> aGrfNames;
vcl::Font aActBulletFont;
- sal_uInt8 nBullet;
- sal_uInt16 nActNumLvl;
- sal_uInt16 nNumItemId;
- SfxMapUnit eCoreUnit;
+ sal_uInt8 nBullet;
+ sal_uInt16 nActNumLvl;
+ sal_uInt16 nNumItemId;
+ MapUnit eCoreUnit;
void InitControls();
/** To switch between the numbering type
@@ -402,7 +402,7 @@ class SvxNumPositionTabPage : public SfxTabPage
sal_uInt16 nActNumLvl;
sal_uInt16 nNumItemId;
- SfxMapUnit eCoreUnit;
+ MapUnit eCoreUnit;
bool bModified : 1;
bool bPreset : 1;
diff --git a/cui/source/inc/textanim.hxx b/cui/source/inc/textanim.hxx
index c76c39d93a3d..688bd2a5ec47 100644
--- a/cui/source/inc/textanim.hxx
+++ b/cui/source/inc/textanim.hxx
@@ -63,7 +63,7 @@ private:
const SfxItemSet& rOutAttrs;
SdrTextAniKind eAniKind;
FieldUnit eFUnit;
- SfxMapUnit eUnit;
+ MapUnit eUnit;
DECL_LINK_TYPED( SelectEffectHdl_Impl, ListBox&, void );
DECL_LINK_TYPED( ClickEndlessHdl_Impl, Button*, void );
diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx
index b2e5157dac53..2857e451cc76 100644
--- a/cui/source/inc/transfrm.hxx
+++ b/cui/source/inc/transfrm.hxx
@@ -116,7 +116,7 @@ private:
basegfx::B2DRange maWorkRange;
basegfx::B2DPoint maAnchor;
- SfxMapUnit mePoolUnit;
+ MapUnit mePoolUnit;
FieldUnit meDlgUnit;
TriState mnProtectSizeState;
bool mbPageDisabled;
@@ -197,7 +197,7 @@ private:
basegfx::B2DRange maRange;
basegfx::B2DPoint maAnchor;
- SfxMapUnit ePoolUnit;
+ MapUnit ePoolUnit;
FieldUnit eDlgUnit;
public:
@@ -250,7 +250,7 @@ private:
// #i75273#
basegfx::B2DRange maRange;
- SfxMapUnit ePoolUnit;
+ MapUnit ePoolUnit;
FieldUnit eDlgUnit;
public:
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index c07f7dd9b43b..e28f03fc57cb 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -261,7 +261,7 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
}
bIsDontCare = !pBoxInfo->IsValid( SvxBoxInfoItemValidFlags::DISABLE );
}
- if(!mbUseMarginItem && eFUnit == FUNIT_MM && SFX_MAPUNIT_TWIP == rCoreAttrs.GetPool()->GetMetric( GetWhich( SID_ATTR_BORDER_INNER ) ))
+ if(!mbUseMarginItem && eFUnit == FUNIT_MM && MAP_TWIP == rCoreAttrs.GetPool()->GetMetric( GetWhich( SID_ATTR_BORDER_INNER ) ))
{
//#i91548# changing the number of decimal digits changes the minimum values, too
lcl_SetDecimalDigitsTo1(*m_pLeftMF);
@@ -433,8 +433,8 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
const SvxBoxItem* pBoxItem;
const SvxBoxInfoItem* pBoxInfoItem;
- sal_uInt16 nWhichBox = GetWhich(SID_ATTR_BORDER_OUTER);
- SfxMapUnit eCoreUnit;
+ sal_uInt16 nWhichBox = GetWhich(SID_ATTR_BORDER_OUTER);
+ MapUnit eCoreUnit;
pBoxItem = static_cast<const SvxBoxItem*>(GetItem( *rSet, SID_ATTR_BORDER_OUTER ));
@@ -663,7 +663,7 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
SvxBoxInfoItem aBoxInfoItem ( nBoxInfoWhich );
const SvxBoxItem* pOldBoxItem = static_cast<const SvxBoxItem*>(GetOldItem( *rCoreAttrs, SID_ATTR_BORDER_OUTER ));
- SfxMapUnit eCoreUnit = rOldSet.GetPool()->GetMetric( nBoxWhich );
+ MapUnit eCoreUnit = rOldSet.GetPool()->GetMetric( nBoxWhich );
// outer border:
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 99563d6a9afb..2ec8336769da 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -777,12 +777,12 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
if ( pSizeBox->IsRelativeMode() )
{
- SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
+ MapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
const SvxFontHeightItem& rItem = static_cast<const SvxFontHeightItem&>(rSet.Get( nWhich ));
- if( rItem.GetProp() != 100 || SFX_MAPUNIT_RELATIVE != rItem.GetPropUnit() )
+ if( rItem.GetProp() != 100 || MAP_RELATIVE != rItem.GetPropUnit() )
{
- bool bPtRel = SFX_MAPUNIT_POINT == rItem.GetPropUnit();
+ bool bPtRel = MAP_POINT == rItem.GetPropUnit();
pSizeBox->SetPtRelative( bPtRel );
pSizeBox->SetValue( bPtRel ? ((short)rItem.GetProp()) * 10 : rItem.GetProp() );
}
@@ -794,7 +794,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
}
else if ( eState >= SfxItemState::DEFAULT )
{
- SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
+ MapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
const SvxFontHeightItem& rItem = static_cast<const SvxFontHeightItem&>(rSet.Get( nWhich ));
pSizeBox->SetValue( (long)CalcToPoint( rItem.GetHeight(), eUnit, 10 ) );
}
@@ -1079,9 +1079,9 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
}
if ( bChanged || !pOldHeight ||
- bRel != ( SFX_MAPUNIT_RELATIVE != pOldHeight->GetPropUnit() || 100 != pOldHeight->GetProp() ) )
+ bRel != ( MAP_RELATIVE != pOldHeight->GetPropUnit() || 100 != pOldHeight->GetProp() ) )
{
- SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
+ MapUnit eUnit = rSet.GetPool()->GetMetric( nWhich );
if ( pSizeBox->IsRelative() )
{
DBG_ASSERT( GetItemSet().GetParent(), "No parent set" );
@@ -1090,7 +1090,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
SvxFontHeightItem aHeight( 240, 100, nWhich );
if ( pSizeBox->IsPtRelative() )
- aHeight.SetHeight( rOldItem.GetHeight(), (sal_uInt16)( nSize / 10 ), SFX_MAPUNIT_POINT, eUnit );
+ aHeight.SetHeight( rOldItem.GetHeight(), (sal_uInt16)( nSize / 10 ), MAP_POINT, eUnit );
else
aHeight.SetHeight( rOldItem.GetHeight(), (sal_uInt16)nSize );
rSet.Put( aHeight );
@@ -1269,7 +1269,7 @@ namespace
const SvxFontHeightItem& rHeightItem =
static_cast<const SvxFontHeightItem&>(_pPage->GetItemSet().GetParent()->Get( _nHeightWhich ));
- SfxMapUnit eUnit = _pPage->GetItemSet().GetPool()->GetMetric( _nHeightWhich );
+ MapUnit eUnit = _pPage->GetItemSet().GetPool()->GetMetric( _nHeightWhich );
short nCurHeight =
static_cast< short >( CalcToPoint( rHeightItem.GetHeight(), eUnit, 1 ) * 10 );
@@ -3003,7 +3003,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
if ( rSet->GetItemState( nWhich ) >= SfxItemState::DEFAULT )
{
const SvxKerningItem& rItem = static_cast<const SvxKerningItem&>(rSet->Get( nWhich ));
- SfxMapUnit eUnit = rSet->GetPool()->GetMetric( nWhich );
+ MapUnit eUnit = rSet->GetPool()->GetMetric( nWhich );
MapUnit eOrgUnit = (MapUnit)eUnit;
MapUnit ePntUnit( MAP_POINT );
long nBig = static_cast<long>(m_pKerningMF->Normalize( static_cast<long>(rItem.GetValue()) ));
@@ -3176,7 +3176,7 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
nWhich = GetWhich( SID_ATTR_CHAR_KERNING );
pOld = GetOldItem( *rSet, SID_ATTR_CHAR_KERNING );
short nKerning = 0;
- SfxMapUnit eUnit = rSet->GetPool()->GetMetric( nWhich );
+ MapUnit eUnit = rSet->GetPool()->GetMetric( nWhich );
long nTmp = static_cast<long>(m_pKerningMF->GetValue());
long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)eUnit );
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index 1b18c5bdf076..2c01f5381630 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -170,7 +170,7 @@ bool SvxCaptionTabPage::FillItemSet( SfxItemSet* _rOutAttrs)
SfxItemPool* pPool = _rOutAttrs->GetPool();
DBG_ASSERT( pPool, "Wo ist der Pool" );
- SfxMapUnit eUnit;
+ MapUnit eUnit;
nCaptionType = (SdrCaptionType) (m_pCT_CAPTTYPE->GetSelectItemId()-1);
@@ -260,8 +260,8 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
SfxItemPool* pPool = rOutAttrs.GetPool();
DBG_ASSERT( pPool, "Wo ist der Pool" );
- sal_uInt16 nWhich;
- SfxMapUnit eUnit;
+ sal_uInt16 nWhich;
+ MapUnit eUnit;
nWhich = GetWhich( SDRATTR_CAPTIONESCABS );
eUnit = pPool->GetMetric( nWhich );
diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index 4cfe577b7272..714a362af017 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -86,7 +86,7 @@ SvxMeasurePage::SvxMeasurePage( vcl::Window* pWindow, const SfxItemSet& rInAttrs
rOutAttrs ( rInAttrs ),
aAttrSet ( *rInAttrs.GetPool() ),
pView( nullptr ),
- eUnit( SFX_MAPUNIT_100TH_MM ),
+ eUnit( MAP_100TH_MM ),
bPositionModified ( false )
{
get(m_pMtrFldLineDist, "MTR_LINE_DIST");
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 2fdee55b1b53..61d5da6243a6 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -116,9 +116,9 @@ Size GetMinBorderSpace_Impl( const SvxShadowItem& rShadow, const SvxBoxItem& rBo
}
-long ConvertLong_Impl( const long nIn, SfxMapUnit eUnit )
+long ConvertLong_Impl( const long nIn, MapUnit eUnit )
{
- return OutputDevice::LogicToLogic( nIn, (MapUnit)eUnit, MAP_TWIP );
+ return OutputDevice::LogicToLogic( nIn, eUnit, MAP_TWIP );
}
bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize )
@@ -435,7 +435,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
{
SfxItemPool* pPool = rSet->GetPool();
DBG_ASSERT( pPool, "Wo ist der Pool" );
- SfxMapUnit eUnit = pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) );
+ MapUnit eUnit = pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) );
// adjust margins (right/left)
const SfxPoolItem* pItem = GetItem( *rSet, SID_ATTR_LRSPACE );
@@ -549,8 +549,8 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
Swap( aPaperSize );
// write values into the edits
- SetMetricValue( *m_pPaperHeightEdit, aPaperSize.Height(), SFX_MAPUNIT_100TH_MM );
- SetMetricValue( *m_pPaperWidthEdit, aPaperSize.Width(), SFX_MAPUNIT_100TH_MM );
+ SetMetricValue( *m_pPaperHeightEdit, aPaperSize.Height(), MAP_100TH_MM );
+ SetMetricValue( *m_pPaperWidthEdit, aPaperSize.Width(), MAP_100TH_MM );
m_pPaperSizeBox->Clear();
m_pPaperSizeBox->FillPaperSizeEntries( ( ePaperStart == PAPER_A3 ) ? PaperSizeStd : PaperSizeDraw );
@@ -675,7 +675,7 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
SfxItemPool* pPool = rOldSet.GetPool();
DBG_ASSERT( pPool, "Wo ist der Pool" );
sal_uInt16 nWhich = GetWhich( SID_ATTR_LRSPACE );
- SfxMapUnit eUnit = pPool->GetMetric( nWhich );
+ MapUnit eUnit = pPool->GetMetric( nWhich );
const SfxPoolItem* pOld = nullptr;
// copy old left and right margins
@@ -964,8 +964,8 @@ IMPL_LINK_TYPED( SvxPageDescPage, PaperSizeSelect_Impl, ListBox&, rBox, void )
if ( aSize.Width() < m_pPaperWidthEdit->GetMin( FUNIT_100TH_MM ) )
m_pPaperWidthEdit->SetMin(
m_pPaperWidthEdit->Normalize( aSize.Width() ), FUNIT_100TH_MM );
- SetMetricValue( *m_pPaperHeightEdit, aSize.Height(), SFX_MAPUNIT_100TH_MM );
- SetMetricValue( *m_pPaperWidthEdit, aSize.Width(), SFX_MAPUNIT_100TH_MM );
+ SetMetricValue( *m_pPaperHeightEdit, aSize.Height(), MAP_100TH_MM );
+ SetMetricValue( *m_pPaperWidthEdit, aSize.Width(), MAP_100TH_MM );
CalcMargin_Impl();
@@ -984,28 +984,28 @@ IMPL_LINK_TYPED( SvxPageDescPage, PaperSizeSelect_Impl, ListBox&, rBox, void )
if ( bScreen || m_pRightMarginEdit->GetValue() == 0 )
{
- SetMetricValue( *m_pRightMarginEdit, nTmp, SFX_MAPUNIT_CM );
+ SetMetricValue( *m_pRightMarginEdit, nTmp, MAP_CM );
if ( !bScreen &&
m_pRightMarginEdit->GetFirst() > m_pRightMarginEdit->GetValue() )
m_pRightMarginEdit->SetValue( m_pRightMarginEdit->GetFirst() );
}
if ( bScreen || m_pLeftMarginEdit->GetValue() == 0 )
{
- SetMetricValue( *m_pLeftMarginEdit, nTmp, SFX_MAPUNIT_CM );
+ SetMetricValue( *m_pLeftMarginEdit, nTmp, MAP_CM );
if ( !bScreen &&
m_pLeftMarginEdit->GetFirst() > m_pLeftMarginEdit->GetValue() )
m_pLeftMarginEdit->SetValue( m_pLeftMarginEdit->GetFirst() );
}
if ( bScreen || m_pBottomMarginEdit->GetValue() == 0 )
{
- SetMetricValue( *m_pBottomMarginEdit, nTmp, SFX_MAPUNIT_CM );
+ SetMetricValue( *m_pBottomMarginEdit, nTmp, MAP_CM );
if ( !bScreen &&
m_pBottomMarginEdit->GetFirst() > m_pBottomMarginEdit->GetValue() )
m_pBottomMarginEdit->SetValue( m_pBottomMarginEdit->GetFirst() );
}
if ( bScreen || m_pTopMarginEdit->GetValue() == 0 )
{
- SetMetricValue( *m_pTopMarginEdit, nTmp, SFX_MAPUNIT_CM );
+ SetMetricValue( *m_pTopMarginEdit, nTmp, MAP_CM );
if ( !bScreen &&
m_pTopMarginEdit->GetFirst() > m_pTopMarginEdit->GetValue() )
m_pTopMarginEdit->SetValue( m_pTopMarginEdit->GetFirst() );
@@ -1019,7 +1019,7 @@ IMPL_LINK_TYPED( SvxPageDescPage, PaperSizeSelect_Impl, ListBox&, rBox, void )
IMPL_LINK_NOARG_TYPED(SvxPageDescPage, PaperSizeModify_Impl, Edit&, void)
{
sal_uInt16 nWhich = GetWhich( SID_ATTR_LRSPACE );
- SfxMapUnit eUnit = GetItemSet().GetPool()->GetMetric( nWhich );
+ MapUnit eUnit = GetItemSet().GetPool()->GetMetric( nWhich );
Size aSize( GetCoreValue( *m_pPaperWidthEdit, eUnit ),
GetCoreValue( *m_pPaperHeightEdit, eUnit ) );
Paper ePaper = SvxPaperInfo::GetSvxPaper( aSize, (MapUnit)eUnit, true );
@@ -1038,12 +1038,12 @@ IMPL_LINK_TYPED( SvxPageDescPage, SwapOrientation_Impl, Button *, pBtn, void )
{
bLandscape = m_pLandscapeBtn->IsChecked();
- const long lWidth = GetCoreValue( *m_pPaperWidthEdit, SFX_MAPUNIT_100TH_MM );
- const long lHeight = GetCoreValue( *m_pPaperHeightEdit, SFX_MAPUNIT_100TH_MM );
+ const long lWidth = GetCoreValue( *m_pPaperWidthEdit, MAP_100TH_MM );
+ const long lHeight = GetCoreValue( *m_pPaperHeightEdit, MAP_100TH_MM );
// swap width and height
- SetMetricValue( *m_pPaperWidthEdit, lHeight, SFX_MAPUNIT_100TH_MM );
- SetMetricValue( *m_pPaperHeightEdit, lWidth, SFX_MAPUNIT_100TH_MM );
+ SetMetricValue( *m_pPaperWidthEdit, lHeight, MAP_100TH_MM );
+ SetMetricValue( *m_pPaperHeightEdit, lWidth, MAP_100TH_MM );
// recalculate margins if necessary
CalcMargin_Impl();
@@ -1133,16 +1133,16 @@ IMPL_LINK_NOARG_TYPED(SvxPageDescPage, BorderModify_Impl, Edit&, void)
void SvxPageDescPage::UpdateExample_Impl( bool bResetbackground )
{
// Size
- Size aSize( GetCoreValue( *m_pPaperWidthEdit, SFX_MAPUNIT_TWIP ),
- GetCoreValue( *m_pPaperHeightEdit, SFX_MAPUNIT_TWIP ) );
+ Size aSize( GetCoreValue( *m_pPaperWidthEdit, MAP_TWIP ),
+ GetCoreValue( *m_pPaperHeightEdit, MAP_TWIP ) );
m_pBspWin->SetSize( aSize );
// Margins
- m_pBspWin->SetTop( GetCoreValue( *m_pTopMarginEdit, SFX_MAPUNIT_TWIP ) );
- m_pBspWin->SetBottom( GetCoreValue( *m_pBottomMarginEdit, SFX_MAPUNIT_TWIP ) );
- m_pBspWin->SetLeft( GetCoreValue( *m_pLeftMarginEdit, SFX_MAPUNIT_TWIP ) );
- m_pBspWin->SetRight( GetCoreValue( *m_pRightMarginEdit, SFX_MAPUNIT_TWIP ) );
+ m_pBspWin->SetTop( GetCoreValue( *m_pTopMarginEdit, MAP_TWIP ) );
+ m_pBspWin->SetBottom( GetCoreValue( *m_pBottomMarginEdit, MAP_TWIP ) );
+ m_pBspWin->SetLeft( GetCoreValue( *m_pLeftMarginEdit, MAP_TWIP ) );
+ m_pBspWin->SetRight( GetCoreValue( *m_pRightMarginEdit, MAP_TWIP ) );
// Layout
m_pBspWin->SetUsage( PosToPageUsage_Impl( m_pLayoutBox->GetSelectEntryPos() ) );
@@ -1456,7 +1456,7 @@ DeactivateRC SvxPageDescPage::DeactivatePage( SfxItemSet* _pSet )
// put portray/landscape if applicable
sal_uInt16 nWh = GetWhich( SID_ATTR_PAGE_SIZE );
- SfxMapUnit eUnit = GetItemSet().GetPool()->GetMetric( nWh );
+ MapUnit eUnit = GetItemSet().GetPool()->GetMetric( nWh );
Size aSize( GetCoreValue( *m_pPaperWidthEdit, eUnit ),
GetCoreValue( *m_pPaperHeightEdit, eUnit ) );
@@ -1540,14 +1540,14 @@ IMPL_LINK_NOARG_TYPED(SvxPageDescPage, RangeHdl_Impl, Control&, void)
void SvxPageDescPage::CalcMargin_Impl()
{
// current values for page margins
- long nBT = GetCoreValue( *m_pTopMarginEdit, SFX_MAPUNIT_TWIP );
- long nBB = GetCoreValue( *m_pBottomMarginEdit, SFX_MAPUNIT_TWIP );
+ long nBT = GetCoreValue( *m_pTopMarginEdit, MAP_TWIP );
+ long nBB = GetCoreValue( *m_pBottomMarginEdit, MAP_TWIP );
- long nBL = GetCoreValue( *m_pLeftMarginEdit, SFX_MAPUNIT_TWIP );
- long nBR = GetCoreValue( *m_pRightMarginEdit, SFX_MAPUNIT_TWIP );
+ long nBL = GetCoreValue( *m_pLeftMarginEdit, MAP_TWIP );
+ long nBR = GetCoreValue( *m_pRightMarginEdit, MAP_TWIP );
- long nH = GetCoreValue( *m_pPaperHeightEdit, SFX_MAPUNIT_TWIP );
- long nW = GetCoreValue( *m_pPaperWidthEdit, SFX_MAPUNIT_TWIP );
+ long nH = GetCoreValue( *m_pPaperHeightEdit, MAP_TWIP );
+ long nW = GetCoreValue( *m_pPaperWidthEdit, MAP_TWIP );
long nWidth = nBL + nBR + MINBODY;
long nHeight = nBT + nBB + MINBODY;
@@ -1560,9 +1560,9 @@ void SvxPageDescPage::CalcMargin_Impl()
nTmp -= nWidth - nW;
if ( nBL <= nBR )
- SetMetricValue( *m_pRightMarginEdit, nTmp, SFX_MAPUNIT_TWIP );
+ SetMetricValue( *m_pRightMarginEdit, nTmp, MAP_TWIP );
else
- SetMetricValue( *m_pLeftMarginEdit, nTmp, SFX_MAPUNIT_TWIP );
+ SetMetricValue( *m_pLeftMarginEdit, nTmp, MAP_TWIP );
}
if ( nHeight > nH )
@@ -1571,9 +1571,9 @@ void SvxPageDescPage::CalcMargin_Impl()
nTmp -= nHeight - nH;
if ( nBT <= nBB )
- SetMetricValue( *m_pBottomMarginEdit, nTmp, SFX_MAPUNIT_TWIP );
+ SetMetricValue( *m_pBottomMarginEdit, nTmp, MAP_TWIP );
else
- SetMetricValue( *m_pTopMarginEdit, nTmp, SFX_MAPUNIT_TWIP );
+ SetMetricValue( *m_pTopMarginEdit, nTmp, MAP_TWIP );
}
}
}
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 7bc84037e078..b48e7934f0cf 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -220,7 +220,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
m_pLineDistAtMetricBox->IsValueModified() ) )
{
nWhich = GetWhich( SID_ATTR_PARA_LINESPACE );
- SfxMapUnit eUnit = pPool->GetMetric( nWhich );
+ MapUnit eUnit = pPool->GetMetric( nWhich );
SvxLineSpacingItem aSpacing(
static_cast<const SvxLineSpacingItem&>(GetItemSet().Get( nWhich )) );
@@ -265,7 +265,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
|| m_pContextualCB->IsValueChangedFromSaved())
{
nWhich = GetWhich( SID_ATTR_ULSPACE );
- SfxMapUnit eUnit = pPool->GetMetric( nWhich );
+ MapUnit eUnit = pPool->GetMetric( nWhich );
pOld = GetOldItem( *rOutSet, SID_ATTR_ULSPACE );
SvxULSpaceItem aMargin( nWhich );
@@ -312,7 +312,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
m_pAutoCB->IsValueChangedFromSaved() )
{
nWhich = GetWhich( SID_ATTR_LRSPACE );
- SfxMapUnit eUnit = pPool->GetMetric( nWhich );
+ MapUnit eUnit = pPool->GetMetric( nWhich );
SvxLRSpaceItem aMargin( nWhich );
pOld = GetOldItem( *rOutSet, SID_ATTR_LRSPACE );
@@ -441,7 +441,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet )
if ( eItemState >= SfxItemState::DEFAULT )
{
- SfxMapUnit eUnit = pPool->GetMetric( _nWhich );
+ MapUnit eUnit = pPool->GetMetric( _nWhich );
if ( bRelativeMode )
{
@@ -511,7 +511,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet )
if ( eItemState >= SfxItemState::DEFAULT )
{
- SfxMapUnit eUnit = pPool->GetMetric( _nWhich );
+ MapUnit eUnit = pPool->GetMetric( _nWhich );
const SvxULSpaceItem& rOldItem =
static_cast<const SvxULSpaceItem&>(rSet->Get( _nWhich ));
@@ -714,7 +714,7 @@ void SvxStdParagraphTabPage::SetLineSpacing_Impl
const SvxLineSpacingItem &rAttr
)
{
- SfxMapUnit eUnit = GetItemSet().GetPool()->GetMetric( rAttr.Which() );
+ MapUnit eUnit = GetItemSet().GetPool()->GetMetric( rAttr.Which() );
switch( rAttr.GetLineSpaceRule() )
{
@@ -837,7 +837,7 @@ IMPL_LINK_TYPED( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox&, rBox, void
// if the value has been changed at SetMin,
// it is time for the default
if ( m_pLineDistAtMetricBox->GetValue() != nTemp )
- SetMetricValue( *m_pLineDistAtMetricBox, FIX_DIST_DEF, SFX_MAPUNIT_TWIP ); // fix is only in Writer
+ SetMetricValue( *m_pLineDistAtMetricBox, FIX_DIST_DEF, MAP_TWIP ); // fix is only in Writer
m_pLineDistAtPercentBox->Hide();
m_pLineDistAtMetricBox->Show();
m_pLineDistAtMetricBox->Enable();
@@ -908,7 +908,7 @@ void SvxStdParagraphTabPage::UpdateExample_Impl()
case LLINESPACE_DURCH:
case LLINESPACE_FIX:
m_pExampleWin->SetLineSpace( (SvxPrevLineSpace)nPos,
- (sal_uInt16)GetCoreValue( *m_pLineDistAtMetricBox, SFX_MAPUNIT_TWIP ) );
+ (sal_uInt16)GetCoreValue( *m_pLineDistAtMetricBox, MAP_TWIP ) );
break;
}
m_pExampleWin->Invalidate();
diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx
index d7d8008f523d..49eca66e4648 100644
--- a/cui/source/tabpages/textattr.cxx
+++ b/cui/source/tabpages/textattr.cxx
@@ -135,7 +135,7 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
{
SfxItemPool* pPool = rAttrs->GetPool();
DBG_ASSERT( pPool, "Wo ist der Pool" );
- SfxMapUnit eUnit = pPool->GetMetric( SDRATTR_TEXT_LEFTDIST );
+ MapUnit eUnit = pPool->GetMetric( SDRATTR_TEXT_LEFTDIST );
const SfxPoolItem* pItem = GetItem( *rAttrs, SDRATTR_TEXT_LEFTDIST );
@@ -342,7 +342,7 @@ bool SvxTextAttrPage::FillItemSet( SfxItemSet* rAttrs)
{
SfxItemPool* pPool = rAttrs->GetPool();
DBG_ASSERT( pPool, "Wo ist der Pool" );
- SfxMapUnit eUnit = pPool->GetMetric( SDRATTR_TEXT_LEFTDIST );
+ MapUnit eUnit = pPool->GetMetric( SDRATTR_TEXT_LEFTDIST );
sal_Int32 nValue;
TriState eState;