summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-06-28 10:37:21 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-06-28 11:17:57 +0200
commit540eba75564e2c04d6a13677ac87d10907bd422d (patch)
tree893f1c791a8928f96c50b6162bb7a35e5023f5d2 /sw
parentddd86d9ee9562ef781133abd0e6f5281d480a657 (diff)
sal_uInt16 to SwTwips and delay downcasts
Change-Id: I4a8a05905a779bb8c7fad830c049d1e403d79711
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/envelp/envfmt.cxx2
-rw-r--r--sw/source/uibase/inc/uitool.hxx2
-rw-r--r--sw/source/uibase/shells/textsh1.cxx2
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx8
-rw-r--r--sw/source/uibase/utlui/uiitems.cxx2
-rw-r--r--sw/source/uibase/utlui/uitool.cxx9
6 files changed, 9 insertions, 16 deletions
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index 072f619389f8..bdc199278157 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -282,7 +282,7 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
const SvxTabStopItem& rDefTabs = (const SvxTabStopItem&)
pSh->GetView().GetCurShell()->GetPool().GetDefaultItem(RES_PARATR_TABSTOP);
- const sal_uInt16 nDefDist = ::GetTabDist( rDefTabs );
+ const sal_uInt16 nDefDist = static_cast<sal_uInt16>(::GetTabDist( rDefTabs ));
SfxUInt16Item aDefDistItem( SID_ATTR_TABSTOP_DEFAULTS, nDefDist );
aTmpSet.Put( aDefDistItem );
diff --git a/sw/source/uibase/inc/uitool.hxx b/sw/source/uibase/inc/uitool.hxx
index 1bfc6c81d5db..8e2d596c3608 100644
--- a/sw/source/uibase/inc/uitool.hxx
+++ b/sw/source/uibase/inc/uitool.hxx
@@ -74,7 +74,7 @@ SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem& rTabs);
//void EraseDefTabs(SvxTabStopItem& rTabs);
// determine space between 1st and 2nd element
-SW_DLLPUBLIC sal_uInt16 GetTabDist(const SvxTabStopItem& rTabs);
+SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem& rTabs);
// determine whether a Sfx-PageDesc combination exists in the set
// and set this in the set and delete the transport items
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 90fcfb083525..a01bd9f8d267 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -915,7 +915,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
const SvxTabStopItem& rDefTabs = (const SvxTabStopItem&)
GetPool().GetDefaultItem(RES_PARATR_TABSTOP);
- sal_uInt16 nDefDist = ::GetTabDist( rDefTabs );
+ const sal_uInt16 nDefDist = static_cast<sal_uInt16>(::GetTabDist( rDefTabs ));
SfxUInt16Item aDefDistItem( SID_ATTR_TABSTOP_DEFAULTS, nDefDist );
aCoreSet.Put( aDefDistItem );
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index c47ed97f04f4..6a1b0f673ceb 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -640,8 +640,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
}
// Populate with default tabs.
- sal_uInt16 nDef = ::GetTabDist( rDefTabs );
- ::MakeDefTabs( nDef, aTabStops );
+ ::MakeDefTabs( ::GetTabDist( rDefTabs ), aTabStops );
SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl();
if( pColl && pColl->IsAutoUpdateFmt() )
@@ -720,8 +719,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
const SvxTabStopItem& rDefTabs =
(const SvxTabStopItem&)rSh.GetDefault(RES_PARATR_TABSTOP);
- sal_uInt16 nDef = ::GetTabDist(rDefTabs);
- ::MakeDefTabs( nDef, aTabStops );
+ ::MakeDefTabs( ::GetTabDist(rDefTabs), aTabStops );
if( pColl && pColl->IsAutoUpdateFmt())
{
@@ -1209,7 +1207,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
rSh.GetDefault(RES_PARATR_TABSTOP);
OSL_ENSURE(m_pHRuler, "why is there no ruler?");
- long nDefTabDist = ::GetTabDist(rDefTabs);
+ const long nDefTabDist = ::GetTabDist(rDefTabs);
m_pHRuler->SetDefTabDist( nDefTabDist );
m_pVRuler->SetDefTabDist( nDefTabDist );
::lcl_EraseDefTabs(aTabStops);
diff --git a/sw/source/uibase/utlui/uiitems.cxx b/sw/source/uibase/utlui/uiitems.cxx
index 1a7e3478aa0d..0490a93e85dc 100644
--- a/sw/source/uibase/utlui/uiitems.cxx
+++ b/sw/source/uibase/utlui/uiitems.cxx
@@ -76,7 +76,7 @@ SfxItemPresentation SwPageFtnInfoItem::GetPresentation
case SFX_ITEM_PRESENTATION_NAMELESS:
case SFX_ITEM_PRESENTATION_COMPLETE:
{
- sal_uInt16 nHght = (sal_uInt16) GetPageFtnInfo().GetHeight();
+ const SwTwips nHght = GetPageFtnInfo().GetHeight();
if ( nHght )
{
rText = SW_RESSTR( STR_MAX_FTN_HEIGHT ) + " " +
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index 678ef993c463..1327f482af25 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -557,14 +557,9 @@ void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem& rTabs)
// Distance between two tabs
-sal_uInt16 GetTabDist(const SvxTabStopItem& rTabs)
+SwTwips GetTabDist(const SvxTabStopItem& rTabs)
{
- sal_uInt16 nDefDist;
- if( rTabs.Count() )
- nDefDist = (sal_uInt16)( rTabs[0].GetTabPos() );
- else
- nDefDist = 1134; // 2cm
- return nDefDist;
+ return rTabs.Count() ? rTabs[0].GetTabPos() : 1134; // 1134 = 2 cm
}
// Inquire if in the set is a Sfx-PageDesc combination present and return it.