summaryrefslogtreecommitdiff
path: root/sw/source/uibase/utlui
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:13:41 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:13:41 +0100
commit0ae2d98d1f6d29c80bd1ee830db4c333e4ee1e1d (patch)
treed9b77eece17b7b144a4ea50592b639b9f7c87095 /sw/source/uibase/utlui
parent506856ca50e676520bcc80a8b498355663d0388f (diff)
More loplugin:cstylecast: sw
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I0f49d21dfdf82742f11b27709f74294feb1e419e
Diffstat (limited to 'sw/source/uibase/utlui')
-rw-r--r--sw/source/uibase/utlui/content.cxx6
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx6
-rw-r--r--sw/source/uibase/utlui/gloslst.cxx2
-rw-r--r--sw/source/uibase/utlui/navipi.cxx2
-rw-r--r--sw/source/uibase/utlui/uiitems.cxx12
-rw-r--r--sw/source/uibase/utlui/unotools.cxx8
6 files changed, 18 insertions, 18 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 29b0b19ffb2d..d924f7058b47 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -522,7 +522,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
size_t nPos = 0;
for (size_t i = 0; i < nOutlineCount; ++i)
{
- const sal_Int8 nLevel = (sal_Int8)pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineLevel(i);
+ const sal_Int8 nLevel = static_cast<sal_Int8>(pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineLevel(i));
if(nLevel >= nOutlineLevel )
nMemberCount--;
else
@@ -1802,7 +1802,7 @@ void SwContentTree::Display( bool bActive )
&& pVScroll->GetThumbPos() != nOldScrollPos)
{
sal_Int32 nDelta = pVScroll->GetThumbPos() - nOldScrollPos;
- ScrollOutputArea( (short)nDelta );
+ ScrollOutputArea( static_cast<short>(nDelta) );
}
}
@@ -3015,7 +3015,7 @@ void SwContentTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry )
case 110:
nSelectedPopupEntry -= 100;
if(m_nOutlineLevel != nSelectedPopupEntry )
- SetOutlineLevel((sal_Int8)nSelectedPopupEntry);
+ SetOutlineLevel(static_cast<sal_Int8>(nSelectedPopupEntry));
break;
case 201:
case 202:
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index 357ec98cc461..6eab5a4aac29 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -253,7 +253,7 @@ sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt )
nRet = rEvt.mnAction;
std::unique_ptr<SwGlblDocContents> pTempContents(new SwGlblDocContents);
int nAbsContPos = pDropEntry ?
- (int) GetModel()->GetAbsPos(pDropEntry):
+ static_cast<int>(GetModel()->GetAbsPos(pDropEntry)):
- 1;
sal_uLong nEntryCount = GetEntryCount();
@@ -944,7 +944,7 @@ void SwGlobalTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry )
SfxViewFrame* pGlobFrame = m_pActiveShell->GetView().GetViewFrame();
SwGlobalFrameListener_Impl aFrameListener(*pGlobFrame);
- sal_uLong nEntryPos = pEntry ? GetModel()->GetAbsPos(pEntry) : (sal_uLong)-1;
+ sal_uLong nEntryPos = pEntry ? GetModel()->GetAbsPos(pEntry) : sal_uLong(-1);
// Creating a new doc
SfxStringItem aFactory(SID_NEWDOCDIRECT,
SwDocShell::Factory().GetFilterContainer()->GetName());
@@ -970,7 +970,7 @@ void SwGlobalTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry )
{
pGlobFrame->ToTop();
// Due to the update the entries are invalid
- if(nEntryPos != (sal_uLong)-1)
+ if(nEntryPos != sal_uLong(-1))
{
Update( false );
Display();
diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx
index 785b0fbfd59b..9f2a54830503 100644
--- a/sw/source/uibase/utlui/gloslst.cxx
+++ b/sw/source/uibase/utlui/gloslst.cxx
@@ -38,7 +38,7 @@
#include <strings.hrc>
-#define STRING_DELIM (char)0x0A
+#define STRING_DELIM char(0x0A)
#define GLOS_TIMEOUT 30000 // update every 30 seconds
#define FIND_MAX_GLOS 20
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index c98dba2dafb1..26785145dbaf 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -465,7 +465,7 @@ IMPL_LINK( SwNavigationPI, EditAction, NumEditAction&, rEdit, void )
{
if(m_aPageChgIdle.IsActive())
m_aPageChgIdle.Stop();
- m_pCreateView->GetWrtShell().GotoPage((sal_uInt16)rEdit.GetValue(), true);
+ m_pCreateView->GetWrtShell().GotoPage(static_cast<sal_uInt16>(rEdit.GetValue()), true);
m_pCreateView->GetEditWin().GrabFocus();
m_pCreateView->GetViewFrame()->GetBindings().Invalidate(FN_STAT_PAGE);
}
diff --git a/sw/source/uibase/utlui/uiitems.cxx b/sw/source/uibase/utlui/uiitems.cxx
index c94fb328ca48..cf14a67ed9aa 100644
--- a/sw/source/uibase/utlui/uiitems.cxx
+++ b/sw/source/uibase/utlui/uiitems.cxx
@@ -76,19 +76,19 @@ bool SwPageFootnoteInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const
bool bRet = true;
switch(nMemberId & ~CONVERT_TWIPS)
{
- case MID_FTN_HEIGHT : rVal <<= (sal_Int32)convertTwipToMm100(aFootnoteInfo.GetHeight());break;
- case MID_LINE_WEIGHT : rVal <<= (sal_Int16)convertTwipToMm100(aFootnoteInfo.GetLineWidth());break;
- case MID_LINE_COLOR : rVal <<= (sal_Int32)aFootnoteInfo.GetLineColor().GetColor();break;
+ case MID_FTN_HEIGHT : rVal <<= static_cast<sal_Int32>(convertTwipToMm100(aFootnoteInfo.GetHeight()));break;
+ case MID_LINE_WEIGHT : rVal <<= static_cast<sal_Int16>(convertTwipToMm100(aFootnoteInfo.GetLineWidth()));break;
+ case MID_LINE_COLOR : rVal <<= static_cast<sal_Int32>(aFootnoteInfo.GetLineColor().GetColor());break;
case MID_LINE_RELWIDTH :
{
Fraction aTmp( 100, 1 );
aTmp *= aFootnoteInfo.GetWidth();
- rVal <<= (sal_Int8)(long)aTmp;
+ rVal <<= static_cast<sal_Int8>(static_cast<long>(aTmp));
}
break;
case MID_LINE_ADJUST : rVal <<= (sal_Int16)aFootnoteInfo.GetAdj();break;//text::HorizontalAdjust
- case MID_LINE_TEXT_DIST : rVal <<= (sal_Int32)convertTwipToMm100(aFootnoteInfo.GetTopDist());break;
- case MID_LINE_FOOTNOTE_DIST: rVal <<= (sal_Int32)convertTwipToMm100(aFootnoteInfo.GetBottomDist());break;
+ case MID_LINE_TEXT_DIST : rVal <<= static_cast<sal_Int32>(convertTwipToMm100(aFootnoteInfo.GetTopDist()));break;
+ case MID_LINE_FOOTNOTE_DIST: rVal <<= static_cast<sal_Int32>(convertTwipToMm100(aFootnoteInfo.GetBottomDist()));break;
case MID_FTN_LINE_STYLE :
{
switch ( aFootnoteInfo.GetLineStyle( ) )
diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx
index 64107830e955..70cbb0994e6b 100644
--- a/sw/source/uibase/utlui/unotools.cxx
+++ b/sw/source/uibase/utlui/unotools.cxx
@@ -247,13 +247,13 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer, void )
if(0 ==(m_nStyleFlags&EX_SHOW_ONLINE_LAYOUT))
{
uno::Any aZoom;
- aZoom <<= (sal_Int16)view::DocumentZoomType::PAGE_WIDTH_EXACT;
+ aZoom <<= sal_Int16(view::DocumentZoomType::PAGE_WIDTH_EXACT);
xViewProps->setPropertyValue(UNO_NAME_ZOOM_TYPE, aZoom);
}
else
{
uno::Any aZoom;
- aZoom <<= (sal_Int16)view::DocumentZoomType::BY_VALUE;
+ aZoom <<= sal_Int16(view::DocumentZoomType::BY_VALUE);
xViewProps->setPropertyValue(UNO_NAME_ZOOM_TYPE, aZoom);
sal_Int16 nZoomValue = 50;
@@ -352,7 +352,7 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer, void )
aSize <<= aPSize;
xPProp->setPropertyValue(UNO_NAME_SIZE, aSize);
- uno::Any aZero; aZero <<= (sal_Int32)0;
+ uno::Any aZero; aZero <<= sal_Int32(0);
xPProp->setPropertyValue(UNO_NAME_LEFT_MARGIN, aZero);
xPProp->setPropertyValue(UNO_NAME_RIGHT_MARGIN, aZero);
}
@@ -490,7 +490,7 @@ IMPL_LINK(SwOneExampleFrame, PopupHdl, Menu*, pMenu, bool )
uno::Any aZoom;
aZoom <<= nZoom;
xViewProps->setPropertyValue(UNO_NAME_ZOOM_VALUE, aZoom);
- aZoom <<= (sal_Int16)view::DocumentZoomType::BY_VALUE;
+ aZoom <<= sal_Int16(view::DocumentZoomType::BY_VALUE);
xViewProps->setPropertyValue(UNO_NAME_ZOOM_TYPE, aZoom);
}
else if(ITEM_UP == nId || ITEM_DOWN == nId)