summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2016-02-01 18:36:48 +0900
committerCaolán McNamara <caolanm@redhat.com>2016-02-02 12:25:22 +0000
commit59aee037e3cf33b253b6f5ebafe3872e420d3408 (patch)
treea87e34df34940bd290aac86557f5232f1f7b2373 /starmath
parent3534e361405ed86ce3534b0a85234d6431a88aaa (diff)
starmath: Avoid C-style cast
Change-Id: Ie8ae44e1b90796033847a892474f4de64e7f9328 Reviewed-on: https://gerrit.libreoffice.org/21984 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 'starmath')
-rw-r--r--starmath/inc/format.hxx2
-rw-r--r--starmath/inc/node.hxx6
-rw-r--r--starmath/source/cfgitem.cxx4
-rw-r--r--starmath/source/dialog.cxx24
-rw-r--r--starmath/source/node.cxx2
-rw-r--r--starmath/source/rect.cxx2
6 files changed, 20 insertions, 20 deletions
diff --git a/starmath/inc/format.hxx b/starmath/inc/format.hxx
index dccdded3879c..af1b24a0291f 100644
--- a/starmath/inc/format.hxx
+++ b/starmath/inc/format.hxx
@@ -26,7 +26,7 @@
#include <types.hxx>
-#define SM_FMT_VERSION_51 ((sal_uInt8) 0x01)
+#define SM_FMT_VERSION_51 (sal_uInt8(0x01))
#define SM_FMT_VERSION_NOW SM_FMT_VERSION_51
#define FNTNAME_TIMES "Times New Roman"
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 90e7a570351c..1dc5201700cb 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -165,8 +165,8 @@ public:
sal_Int32 GetAccessibleIndex() const { return mnAccIndex; }
const SmNode * FindNodeWithAccessibleIndex(sal_Int32 nAccIndex) const;
- sal_uInt16 GetRow() const { return (sal_uInt16)maNodeToken.nRow; }
- sal_uInt16 GetColumn() const { return (sal_uInt16)maNodeToken.nCol; }
+ sal_uInt16 GetRow() const { return sal::static_int_cast<sal_uInt16>(maNodeToken.nRow); }
+ sal_uInt16 GetColumn() const { return sal::static_int_cast<sal_uInt16>(maNodeToken.nCol); }
SmScaleMode GetScaleMode() const { return meScaleMode; }
void SetScaleMode(SmScaleMode eMode) { meScaleMode = eMode; }
@@ -559,7 +559,7 @@ protected:
: SmSpecialNode(eNodeType, rNodeToken, FNT_MATH)
{
sal_Unicode cChar = GetToken().cMathChar;
- if ((sal_Unicode) '\0' != cChar)
+ if (sal_Unicode('\0') != cChar)
SetText(OUString(cChar));
}
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 277f65eb7d03..313a33be0cfc 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -1220,9 +1220,9 @@ void SmMathConfig::ConfigToItemSet(SfxItemSet &rSet) const
const SfxItemPool *pPool = rSet.GetPool();
rSet.Put(SfxUInt16Item(pPool->GetWhich(SID_PRINTSIZE),
- (sal_uInt16) GetPrintSize()));
+ sal::static_int_cast<sal_uInt16>(GetPrintSize())));
rSet.Put(SfxUInt16Item(pPool->GetWhich(SID_PRINTZOOM),
- (sal_uInt16) GetPrintZoomFactor()));
+ GetPrintZoomFactor()));
rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTTITLE), IsPrintTitle()));
rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTTEXT), IsPrintFormulaText()));
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 5dcbf81e1d49..9f02fda27f42 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -218,7 +218,7 @@ bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet)
nPrintSize = PRINT_SIZE_ZOOMED;
rSet->Put(SfxUInt16Item(GetWhich(SID_PRINTSIZE), nPrintSize));
- rSet->Put(SfxUInt16Item(GetWhich(SID_PRINTZOOM), (sal_uInt16) m_pZoom->GetValue()));
+ rSet->Put(SfxUInt16Item(GetWhich(SID_PRINTZOOM), sal::static_int_cast<sal_uInt16>(m_pZoom->GetValue())));
rSet->Put(SfxBoolItem(GetWhich(SID_PRINTTITLE), m_pTitle->IsChecked()));
rSet->Put(SfxBoolItem(GetWhich(SID_PRINTTEXT), m_pText->IsChecked()));
rSet->Put(SfxBoolItem(GetWhich(SID_PRINTFRAME), m_pFrame->IsChecked()));
@@ -483,11 +483,11 @@ void SmFontSizeDialog::WriteTo(SmFormat &rFormat) const
{
rFormat.SetBaseSize( Size(0, SmPtsTo100th_mm( static_cast< long >(m_pBaseSize->GetValue()))) );
- rFormat.SetRelSize(SIZ_TEXT, (sal_uInt16) m_pTextSize->GetValue());
- rFormat.SetRelSize(SIZ_INDEX, (sal_uInt16) m_pIndexSize->GetValue());
- rFormat.SetRelSize(SIZ_FUNCTION, (sal_uInt16) m_pFunctionSize->GetValue());
- rFormat.SetRelSize(SIZ_OPERATOR, (sal_uInt16) m_pOperatorSize->GetValue());
- rFormat.SetRelSize(SIZ_LIMITS, (sal_uInt16) m_pBorderSize->GetValue());
+ rFormat.SetRelSize(SIZ_TEXT, sal::static_int_cast<sal_uInt16>(m_pTextSize->GetValue()));
+ rFormat.SetRelSize(SIZ_INDEX, sal::static_int_cast<sal_uInt16>(m_pIndexSize->GetValue()));
+ rFormat.SetRelSize(SIZ_FUNCTION, sal::static_int_cast<sal_uInt16>(m_pFunctionSize->GetValue()));
+ rFormat.SetRelSize(SIZ_OPERATOR, sal::static_int_cast<sal_uInt16>(m_pOperatorSize->GetValue()));
+ rFormat.SetRelSize(SIZ_LIMITS, sal::static_int_cast<sal_uInt16>(m_pBorderSize->GetValue()));
const Size aTmp (rFormat.GetBaseSize());
for (sal_uInt16 i = FNT_BEGIN; i <= FNT_END; i++)
@@ -805,10 +805,10 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory)
if (nActiveCategory != CATEGORY_NONE)
{
pCat = Categories[nActiveCategory];
- pCat->SetValue(0, (sal_uInt16) m_pMetricField1->GetValue());
- pCat->SetValue(1, (sal_uInt16) m_pMetricField2->GetValue());
- pCat->SetValue(2, (sal_uInt16) m_pMetricField3->GetValue());
- pCat->SetValue(3, (sal_uInt16) m_pMetricField4->GetValue());
+ pCat->SetValue(0, sal::static_int_cast<sal_uInt16>(m_pMetricField1->GetValue()));
+ pCat->SetValue(1, sal::static_int_cast<sal_uInt16>(m_pMetricField2->GetValue()));
+ pCat->SetValue(2, sal::static_int_cast<sal_uInt16>(m_pMetricField3->GetValue()));
+ pCat->SetValue(3, sal::static_int_cast<sal_uInt16>(m_pMetricField4->GetValue()));
if (nActiveCategory == 5)
bScaleAllBrackets = m_pCheckBox1->IsChecked();
@@ -1233,8 +1233,8 @@ void SmShowSymbolSetWindow::KeyInput(const KeyEvent& rKEvt)
n = nSelectSymbol;
// adjust scrollbar
- if ((n < (sal_uInt16) (m_pVScrollBar->GetThumbPos() * nColumns)) ||
- (n >= (sal_uInt16) ((m_pVScrollBar->GetThumbPos() + nRows) * nColumns)))
+ if ((n < sal::static_int_cast<sal_uInt16>(m_pVScrollBar->GetThumbPos() * nColumns)) ||
+ (n >= sal::static_int_cast<sal_uInt16>((m_pVScrollBar->GetThumbPos() + nRows) * nColumns)))
{
m_pVScrollBar->SetThumbPos(n / nColumns);
Invalidate();
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index d7a159260076..330b0fc4d3e3 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -598,7 +598,7 @@ bool SmStructureNode::IsVisible() const
sal_uInt16 SmStructureNode::GetNumSubNodes() const
{
- return (sal_uInt16) aSubNodes.size();
+ return sal::static_int_cast<sal_uInt16>(aSubNodes.size());
}
diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx
index 4ca941ae396e..e5e0696e4c3e 100644
--- a/starmath/source/rect.cxx
+++ b/starmath/source/rect.cxx
@@ -227,7 +227,7 @@ SmRect::SmRect(const OutputDevice &rDev, const SmFormat *pFormat,
OSL_ENSURE( nEBorderWidth >= 0, "BorderWidth is negative" );
if (nEBorderWidth < 0)
nEBorderWidth = 0;
- Init(rDev, pFormat, rText, (sal_uInt16) nEBorderWidth);
+ Init(rDev, pFormat, rText, sal::static_int_cast<sal_uInt16>(nEBorderWidth));
}