Kaydet (Commit) 59aee037 authored tarafından Takeshi Abe's avatar Takeshi Abe Kaydeden (comit) Caolán McNamara

starmath: Avoid C-style cast

Change-Id: Ie8ae44e1b90796033847a892474f4de64e7f9328
Reviewed-on: https://gerrit.libreoffice.org/21984Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 3534e361
......@@ -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"
......
......@@ -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));
}
......
......@@ -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()));
......
......@@ -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();
......
......@@ -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());
}
......
......@@ -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));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment