loplugin: cstylecast

Change-Id: Ic12c8b5ad5256b729b7cab8f78758b57f5316d3c
This commit is contained in:
Noel Grandin 2014-12-01 10:18:30 +02:00
parent cf16234a23
commit 83c97b2a1c
15 changed files with 97 additions and 96 deletions

View File

@ -352,15 +352,15 @@ void Writer::PutEditEngFontsInAttrPool( bool bIncl_CJK_CTL )
void Writer::_AddFontItems( SfxItemPool& rPool, sal_uInt16 nW ) void Writer::_AddFontItems( SfxItemPool& rPool, sal_uInt16 nW )
{ {
const SvxFontItem* pFont = (const SvxFontItem*)&rPool.GetDefaultItem( nW ); const SvxFontItem* pFont = static_cast<const SvxFontItem*>(&rPool.GetDefaultItem( nW ));
_AddFontItem( rPool, *pFont ); _AddFontItem( rPool, *pFont );
if( 0 != ( pFont = (const SvxFontItem*)rPool.GetPoolDefaultItem( nW )) ) if( 0 != ( pFont = static_cast<const SvxFontItem*>(rPool.GetPoolDefaultItem( nW ))) )
_AddFontItem( rPool, *pFont ); _AddFontItem( rPool, *pFont );
sal_uInt32 nMaxItem = rPool.GetItemCount2( nW ); sal_uInt32 nMaxItem = rPool.GetItemCount2( nW );
for( sal_uInt32 nGet = 0; nGet < nMaxItem; ++nGet ) for( sal_uInt32 nGet = 0; nGet < nMaxItem; ++nGet )
if( 0 != (pFont = (const SvxFontItem*)rPool.GetItem2( nW, nGet )) ) if( 0 != (pFont = static_cast<const SvxFontItem*>(rPool.GetItem2( nW, nGet ))) )
_AddFontItem( rPool, *pFont ); _AddFontItem( rPool, *pFont );
} }
@ -371,10 +371,10 @@ void Writer::_AddFontItem( SfxItemPool& rPool, const SvxFontItem& rFont )
{ {
SvxFontItem aFont( rFont ); SvxFontItem aFont( rFont );
aFont.SetWhich( RES_CHRATR_FONT ); aFont.SetWhich( RES_CHRATR_FONT );
pItem = (SvxFontItem*)&rPool.Put( aFont ); pItem = static_cast<const SvxFontItem*>(&rPool.Put( aFont ));
} }
else else
pItem = (SvxFontItem*)&rPool.Put( rFont ); pItem = static_cast<const SvxFontItem*>(&rPool.Put( rFont ));
if( 1 < pItem->GetRefCount() ) if( 1 < pItem->GetRefCount() )
rPool.Remove( *pItem ); rPool.Remove( *pItem );

View File

@ -82,7 +82,7 @@ sal_uInt32 SwWriteTable::GetBoxWidth( const SwTableBox *pBox )
{ {
const SwFrmFmt *pFmt = pBox->GetFrmFmt(); const SwFrmFmt *pFmt = pBox->GetFrmFmt();
const SwFmtFrmSize& aFrmSize= const SwFmtFrmSize& aFrmSize=
(const SwFmtFrmSize&)pFmt->GetFmtAttr( RES_FRM_SIZE ); static_cast<const SwFmtFrmSize&>(pFmt->GetFmtAttr( RES_FRM_SIZE ));
return sal::static_int_cast<sal_uInt32>(aFrmSize.GetSize().Width()); return sal::static_int_cast<sal_uInt32>(aFrmSize.GetSize().Width());
} }
@ -176,11 +176,11 @@ const SvxBrushItem *SwWriteTable::GetLineBrush( const SwTableBox *pBox,
if( !pLine->GetUpper() ) if( !pLine->GetUpper() )
{ {
if( !pRow->GetBackground() ) if( !pRow->GetBackground() )
pRow->SetBackground( (const SvxBrushItem *)pItem ); pRow->SetBackground( static_cast<const SvxBrushItem *>(pItem) );
pItem = 0; pItem = 0;
} }
return (const SvxBrushItem *)pItem; return static_cast<const SvxBrushItem *>(pItem);
} }
pBox = pLine->GetUpper(); pBox = pLine->GetUpper();
@ -230,7 +230,7 @@ sal_uInt16 SwWriteTable::MergeBoxBorders( const SwTableBox *pBox,
sal_uInt16 nBorderMask = 0; sal_uInt16 nBorderMask = 0;
const SwFrmFmt *pFrmFmt = pBox->GetFrmFmt(); const SwFrmFmt *pFrmFmt = pBox->GetFrmFmt();
const SvxBoxItem& rBoxItem = (const SvxBoxItem&)pFrmFmt->GetFmtAttr( RES_BOX ); const SvxBoxItem& rBoxItem = static_cast<const SvxBoxItem&>(pFrmFmt->GetFmtAttr( RES_BOX ));
if( rBoxItem.GetTop() ) if( rBoxItem.GetTop() )
{ {
@ -596,7 +596,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow,
if( SfxItemState::SET == rItemSet.GetItemState( RES_BACKGROUND, false, if( SfxItemState::SET == rItemSet.GetItemState( RES_BACKGROUND, false,
&pItem ) ) &pItem ) )
{ {
pLineBrush = (const SvxBrushItem *)pItem; pLineBrush = static_cast<const SvxBrushItem *>(pItem);
// If the row spans the entire table, we can // If the row spans the entire table, we can
// print out the background to the row. Otherwise // print out the background to the row. Otherwise

View File

@ -1424,7 +1424,7 @@ void DocxAttributeOutput::StartField_Impl( FieldInfos& rInfos, bool bWriteRun )
WriteFFData( rInfos ); WriteFFData( rInfos );
if ( rInfos.pField ) if ( rInfos.pField )
{ {
const SwDropDownField& rFld2 = *(SwDropDownField*)rInfos.pField; const SwDropDownField& rFld2 = *static_cast<const SwDropDownField*>(rInfos.pField);
uno::Sequence<OUString> aItems = uno::Sequence<OUString> aItems =
rFld2.GetItemSequence(); rFld2.GetItemSequence();
GetExport().DoComboBox(rFld2.GetName(), GetExport().DoComboBox(rFld2.GetName(),
@ -3590,7 +3590,7 @@ void DocxAttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer
aPam.GetPoint()->nNode++; aPam.GetPoint()->nNode++;
if (aPam.GetPoint()->nNode.GetNode().IsTxtNode()) if (aPam.GetPoint()->nNode.GetNode().IsTxtNode())
{ {
const SwTxtNode& rTxtNode = (const SwTxtNode&)aPam.GetPoint()->nNode.GetNode(); const SwTxtNode& rTxtNode = static_cast<const SwTxtNode&>(aPam.GetPoint()->nNode.GetNode());
if( const SwAttrSet* pAttrSet = rTxtNode.GetpSwAttrSet()) if( const SwAttrSet* pAttrSet = rTxtNode.GetpSwAttrSet())
{ {
const SvxCharRotateItem& rCharRotate = pAttrSet->GetCharRotate(); const SvxCharRotateItem& rCharRotate = pAttrSet->GetCharRotate();
@ -5494,7 +5494,7 @@ void DocxAttributeOutput::SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmF
const SfxPoolItem* pItem = GetExport().HasItem( RES_SHADOW ); const SfxPoolItem* pItem = GetExport().HasItem( RES_SHADOW );
if ( pItem ) if ( pItem )
{ {
const SvxShadowItem* pShadowItem = (const SvxShadowItem*)pItem; const SvxShadowItem* pShadowItem = static_cast<const SvxShadowItem*>(pItem);
aOutputBorderOptions.aShadowLocation = pShadowItem->GetLocation(); aOutputBorderOptions.aShadowLocation = pShadowItem->GetLocation();
} }
@ -5570,7 +5570,7 @@ static OString impl_LevelNFC( sal_uInt16 nNumberingType , const SfxItemSet *pOut
case style::NumberingType::NUMBER_LOWER_ZH: case style::NumberingType::NUMBER_LOWER_ZH:
aType="taiwaneseCountingThousand"; aType="taiwaneseCountingThousand";
if (pOutSet) { if (pOutSet) {
const SvxLanguageItem rLang = (const SvxLanguageItem&) pOutSet->Get( RES_CHRATR_CJK_LANGUAGE,true); const SvxLanguageItem rLang = static_cast<const SvxLanguageItem&>( pOutSet->Get( RES_CHRATR_CJK_LANGUAGE,true) );
const LanguageType eLang = rLang.GetLanguage(); const LanguageType eLang = rLang.GetLanguage();
if (LANGUAGE_CHINESE_SIMPLIFIED == eLang) { if (LANGUAGE_CHINESE_SIMPLIFIED == eLang) {
@ -6596,12 +6596,12 @@ void DocxAttributeOutput::WriteField_Impl( const SwField* pFld, ww::eField eType
// TODO Any other field types here ? // TODO Any other field types here ?
if ( ( nType == RES_SETEXPFLD ) && ( nSubType & nsSwGetSetExpType::GSE_STRING ) ) if ( ( nType == RES_SETEXPFLD ) && ( nSubType & nsSwGetSetExpType::GSE_STRING ) )
{ {
const SwSetExpField *pSet = ( const SwSetExpField* )( pFld ); const SwSetExpField *pSet = static_cast<const SwSetExpField*>( pFld );
m_sFieldBkm = pSet->GetPar1( ); m_sFieldBkm = pSet->GetPar1( );
} }
else if ( nType == RES_DROPDOWN ) else if ( nType == RES_DROPDOWN )
{ {
const SwDropDownField* pDropDown = ( const SwDropDownField* )( pFld ); const SwDropDownField* pDropDown = static_cast<const SwDropDownField*>( pFld );
m_sFieldBkm = pDropDown->GetName( ); m_sFieldBkm = pDropDown->GetName( );
} }
} }
@ -7762,7 +7762,7 @@ void DocxAttributeOutput::FormatBox( const SvxBoxItem& rBox )
const SfxPoolItem* pItem = GetExport().HasItem( RES_SHADOW ); const SfxPoolItem* pItem = GetExport().HasItem( RES_SHADOW );
if ( pItem ) if ( pItem )
{ {
const SvxShadowItem* pShadowItem = (const SvxShadowItem*)pItem; const SvxShadowItem* pShadowItem = static_cast<const SvxShadowItem*>(pItem);
aOutputBorderOptions.aShadowLocation = pShadowItem->GetLocation(); aOutputBorderOptions.aShadowLocation = pShadowItem->GetLocation();
} }

View File

@ -489,7 +489,7 @@ void DocxExport::OutputEndNode( const SwEndNode& rEndNode )
{ {
const SwSectionFmt* pParentFmt = rSect.GetFmt()->GetParent(); const SwSectionFmt* pParentFmt = rSect.GetFmt()->GetParent();
if( !pParentFmt ) if( !pParentFmt )
pParentFmt = (SwSectionFmt*)0xFFFFFFFF; pParentFmt = reinterpret_cast<SwSectionFmt*>(0xFFFFFFFF) ;
sal_uLong nRstLnNum; sal_uLong nRstLnNum;
if( rNd.IsCntntNode() ) if( rNd.IsCntntNode() )

View File

@ -651,7 +651,7 @@ void RtfAttributeOutput::TableDefaultBorders(ww8::WW8TableNodeInfoInner::Pointer
const SfxPoolItem* pItem; const SfxPoolItem* pItem;
if (pCellFmt->GetAttrSet().HasItem(RES_BOX, &pItem)) if (pCellFmt->GetAttrSet().HasItem(RES_BOX, &pItem))
{ {
const SvxBoxItem& rBox = (SvxBoxItem&)*pItem; const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(*pItem);
static const sal_uInt16 aBorders[] = static const sal_uInt16 aBorders[] =
{ {
BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT
@ -695,7 +695,7 @@ void RtfAttributeOutput::TableBackgrounds(ww8::WW8TableNodeInfoInner::Pointer_t
const SfxPoolItem* pItem; const SfxPoolItem* pItem;
if (pCellFmt->GetAttrSet().HasItem(RES_BACKGROUND, &pItem)) if (pCellFmt->GetAttrSet().HasItem(RES_BACKGROUND, &pItem))
{ {
const SvxBrushItem& rBack = (SvxBrushItem&)*pItem; const SvxBrushItem& rBack = static_cast<const SvxBrushItem&>(*pItem);
if (!rBack.GetColor().GetTransparency()) if (!rBack.GetColor().GetTransparency())
{ {
m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLCBPAT); m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLCBPAT);
@ -782,7 +782,7 @@ void RtfAttributeOutput::TableVerticalCell(ww8::WW8TableNodeInfoInner::Pointer_t
// vertical alignment // vertical alignment
if (pCellFmt->GetAttrSet().HasItem(RES_VERT_ORIENT, &pItem)) if (pCellFmt->GetAttrSet().HasItem(RES_VERT_ORIENT, &pItem))
switch (((SwFmtVertOrient*)pItem)->GetVertOrient()) switch (static_cast<const SwFmtVertOrient*>(pItem)->GetVertOrient())
{ {
case text::VertOrientation::CENTER: case text::VertOrientation::CENTER:
m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALC); m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALC);
@ -1311,7 +1311,7 @@ void RtfAttributeOutput::NumberingLevel(sal_uInt8 nLevel,
nVal=35; nVal=35;
if (pOutSet) if (pOutSet)
{ {
const SvxLanguageItem rlang = (const SvxLanguageItem&) pOutSet->Get(RES_CHRATR_CJK_LANGUAGE,true); const SvxLanguageItem rlang = static_cast<const SvxLanguageItem&>( pOutSet->Get(RES_CHRATR_CJK_LANGUAGE,true) );
if (LANGUAGE_CHINESE_SIMPLIFIED == rlang.GetLanguage()) if (LANGUAGE_CHINESE_SIMPLIFIED == rlang.GetLanguage())
{ {
nVal=39; nVal=39;
@ -2098,7 +2098,7 @@ void RtfAttributeOutput::CharEscapement(const SvxEscapementItem& rEsc)
const char* pUpDn; const char* pUpDn;
SwTwips nH = ((SvxFontHeightItem&)m_rExport.GetItem(RES_CHRATR_FONTSIZE)).GetHeight(); SwTwips nH = static_cast<const SvxFontHeightItem&>(m_rExport.GetItem(RES_CHRATR_FONTSIZE)).GetHeight();
if (0 < rEsc.GetEsc()) if (0 < rEsc.GetEsc())
pUpDn = OOO_STRING_SVTOOLS_RTF_UP; pUpDn = OOO_STRING_SVTOOLS_RTF_UP;
@ -2600,7 +2600,7 @@ void RtfAttributeOutput::ParaWidows(const SvxWidowsItem& rWidows)
void RtfAttributeOutput::ParaTabStop(const SvxTabStopItem& rTabStop) void RtfAttributeOutput::ParaTabStop(const SvxTabStopItem& rTabStop)
{ {
long nOffset = ((SvxLRSpaceItem&)m_rExport.GetItem(RES_LR_SPACE)).GetTxtLeft(); long nOffset = static_cast<const SvxLRSpaceItem&>(m_rExport.GetItem(RES_LR_SPACE)).GetTxtLeft();
for (sal_uInt16 n = 0; n < rTabStop.Count(); n++) for (sal_uInt16 n = 0; n < rTabStop.Count(); n++)
{ {
const SvxTabStop& rTS = rTabStop[ n ]; const SvxTabStop& rTS = rTabStop[ n ];
@ -2699,7 +2699,7 @@ void RtfAttributeOutput::ParaNumRule_Impl(const SwTxtNode* pTxtNd, sal_Int32 nLv
m_aStyles.append(OOO_STRING_SVTOOLS_RTF_PLAIN); m_aStyles.append(OOO_STRING_SVTOOLS_RTF_PLAIN);
m_aStyles.append(' '); m_aStyles.append(' ');
SvxLRSpaceItem aLR((SvxLRSpaceItem&)rNdSet.Get(RES_LR_SPACE)); SvxLRSpaceItem aLR(static_cast<const SvxLRSpaceItem&>(rNdSet.Get(RES_LR_SPACE)));
aLR.SetTxtLeft(aLR.GetTxtLeft() + pFmt->GetIndentAt()); aLR.SetTxtLeft(aLR.GetTxtLeft() + pFmt->GetIndentAt());
aLR.SetTxtFirstLineOfst(pFmt->GetFirstLineOffset()); aLR.SetTxtFirstLineOfst(pFmt->GetFirstLineOffset());
@ -3297,7 +3297,7 @@ void RtfAttributeOutput::SetField(const SwField& /*rFld*/, ww::eField /*eType*/,
void RtfAttributeOutput::PostitField(const SwField* pFld) void RtfAttributeOutput::PostitField(const SwField* pFld)
{ {
const SwPostItField& rPFld = *(SwPostItField*)pFld; const SwPostItField& rPFld = *static_cast<const SwPostItField*>(pFld);
OString aName = OUStringToOString(rPFld.GetName(), RTL_TEXTENCODING_UTF8); OString aName = OUStringToOString(rPFld.GetName(), RTL_TEXTENCODING_UTF8);
std::map<OString, sal_uInt16>::iterator it = m_rOpenedAnnotationMarksIds.find(aName); std::map<OString, sal_uInt16>::iterator it = m_rOpenedAnnotationMarksIds.find(aName);
@ -3628,7 +3628,7 @@ void RtfAttributeOutput::FlyFrameOLEReplacement(const SwFlyFrmFmt* pFlyFrmFmt, S
aRendered.Height() = rSize.Height(); aRendered.Height() = rSize.Height();
const Graphic* pGraphic = rOLENode.GetGraphic(); const Graphic* pGraphic = rOLENode.GetGraphic();
Size aMapped(pGraphic->GetPrefSize()); Size aMapped(pGraphic->GetPrefSize());
const SwCropGrf& rCr = (const SwCropGrf&)rOLENode.GetAttr(RES_GRFATR_CROPGRF); const SwCropGrf& rCr = static_cast<const SwCropGrf&>(rOLENode.GetAttr(RES_GRFATR_CROPGRF));
const sal_Char* pBLIPType = OOO_STRING_SVTOOLS_RTF_PNGBLIP; const sal_Char* pBLIPType = OOO_STRING_SVTOOLS_RTF_PNGBLIP;
const sal_uInt8* pGraphicAry = 0; const sal_uInt8* pGraphicAry = 0;
SvMemoryStream aStream; SvMemoryStream aStream;
@ -3756,7 +3756,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrmFmt* pFlyFrmFmt, const Sw
Size aMapped(eGraphicType == GRAPHIC_BITMAP ? rGraphic.GetSizePixel() : rGraphic.GetPrefSize()); Size aMapped(eGraphicType == GRAPHIC_BITMAP ? rGraphic.GetSizePixel() : rGraphic.GetPrefSize());
const SwCropGrf& rCr = (const SwCropGrf&)pGrfNode->GetAttr(RES_GRFATR_CROPGRF); const SwCropGrf& rCr = static_cast<const SwCropGrf&>(pGrfNode->GetAttr(RES_GRFATR_CROPGRF));
//Get original size in twips //Get original size in twips
Size aSize(pGrfNode->GetTwipSize()); Size aSize(pGrfNode->GetTwipSize());

View File

@ -35,6 +35,7 @@
#include <editeng/udlnitem.hxx> #include <editeng/udlnitem.hxx>
#include <editeng/boxitem.hxx> #include <editeng/boxitem.hxx>
#include <editeng/brushitem.hxx> #include <editeng/brushitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/shaditem.hxx> #include <editeng/shaditem.hxx>
#include <editeng/ulspitem.hxx> #include <editeng/ulspitem.hxx>
#include <editeng/paperinf.hxx> #include <editeng/paperinf.hxx>
@ -491,7 +492,7 @@ void RtfExport::ExportDocument_Impl()
Strm().WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_RTF).WriteChar('1') Strm().WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_RTF).WriteChar('1')
.WriteCharPtr(OOO_STRING_SVTOOLS_RTF_ANSI); .WriteCharPtr(OOO_STRING_SVTOOLS_RTF_ANSI);
Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_DEFF); Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_DEFF);
OutULong(maFontHelper.GetId((SvxFontItem&)pDoc->GetAttrPool().GetDefaultItem(RES_CHRATR_FONT))); OutULong(maFontHelper.GetId(static_cast<const SvxFontItem&>(pDoc->GetAttrPool().GetDefaultItem(RES_CHRATR_FONT))));
// If this not exist, MS don't understand our ansi characters (0x80-0xff). // If this not exist, MS don't understand our ansi characters (0x80-0xff).
Strm().WriteCharPtr("\\adeflang1025"); Strm().WriteCharPtr("\\adeflang1025");
@ -536,7 +537,7 @@ void RtfExport::ExportDocument_Impl()
sal_uInt32 const nMaxItem = rPool.GetItemCount2(RES_PROTECT); sal_uInt32 const nMaxItem = rPool.GetItemCount2(RES_PROTECT);
for (sal_uInt32 n = 0; n < nMaxItem; ++n) for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{ {
const SvxProtectItem* pProtect = (const SvxProtectItem*)rPool.GetItem2(RES_PROTECT, n); const SvxProtectItem* pProtect = static_cast<const SvxProtectItem*>(rPool.GetItem2(RES_PROTECT, n));
if (pProtect && pProtect->IsCntntProtected()) if (pProtect && pProtect->IsCntntProtected())
{ {
Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_FORMPROT); Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_FORMPROT);
@ -570,7 +571,7 @@ void RtfExport::ExportDocument_Impl()
if (pSet) if (pSet)
{ {
sal_uInt16 nPosInDoc; sal_uInt16 nPosInDoc;
pSttPgDsc = (SwFmtPageDesc*)&pSet->Get(RES_PAGEDESC); pSttPgDsc = static_cast<const SwFmtPageDesc*>(&pSet->Get(RES_PAGEDESC));
if (!pSttPgDsc->GetPageDesc()) if (!pSttPgDsc->GetPageDesc())
pSttPgDsc = 0; pSttPgDsc = 0;
else if (pDoc->FindPageDesc(pSttPgDsc->GetPageDesc()->GetName(), &nPosInDoc)) else if (pDoc->FindPageDesc(pSttPgDsc->GetPageDesc()->GetName(), &nPosInDoc))
@ -946,33 +947,33 @@ void RtfExport::OutColorTable()
// char color // char color
{ {
const SvxColorItem* pCol = (const SvxColorItem*)GetDfltAttr(RES_CHRATR_COLOR); const SvxColorItem* pCol = static_cast<const SvxColorItem*>(GetDfltAttr(RES_CHRATR_COLOR));
InsColor(pCol->GetValue()); InsColor(pCol->GetValue());
if (0 != (pCol = (const SvxColorItem*)rPool.GetPoolDefaultItem(RES_CHRATR_COLOR))) if (0 != (pCol = static_cast<const SvxColorItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_COLOR))))
InsColor(pCol->GetValue()); InsColor(pCol->GetValue());
nMaxItem = rPool.GetItemCount2(RES_CHRATR_COLOR); nMaxItem = rPool.GetItemCount2(RES_CHRATR_COLOR);
for (sal_uInt32 n = 0; n < nMaxItem; ++n) for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{ {
if (0 != (pCol = (const SvxColorItem*)rPool.GetItem2(RES_CHRATR_COLOR, n))) if (0 != (pCol = static_cast<const SvxColorItem*>(rPool.GetItem2(RES_CHRATR_COLOR, n))))
InsColor(pCol->GetValue()); InsColor(pCol->GetValue());
} }
const SvxUnderlineItem* pUnder = (const SvxUnderlineItem*)GetDfltAttr(RES_CHRATR_UNDERLINE); const SvxUnderlineItem* pUnder = static_cast<const SvxUnderlineItem*>(GetDfltAttr(RES_CHRATR_UNDERLINE));
InsColor(pUnder->GetColor()); InsColor(pUnder->GetColor());
nMaxItem = rPool.GetItemCount2(RES_CHRATR_UNDERLINE); nMaxItem = rPool.GetItemCount2(RES_CHRATR_UNDERLINE);
for (sal_uInt32 n = 0; n < nMaxItem; ++n) for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{ {
if (0 != (pUnder = (const SvxUnderlineItem*)rPool.GetItem2(RES_CHRATR_UNDERLINE, n))) if (0 != (pUnder = static_cast<const SvxUnderlineItem*>(rPool.GetItem2(RES_CHRATR_UNDERLINE, n))))
InsColor(pUnder->GetColor()); InsColor(pUnder->GetColor());
} }
const SvxOverlineItem* pOver = (const SvxOverlineItem*)GetDfltAttr(RES_CHRATR_OVERLINE); const SvxOverlineItem* pOver = static_cast<const SvxOverlineItem*>(GetDfltAttr(RES_CHRATR_OVERLINE));
InsColor(pOver->GetColor()); InsColor(pOver->GetColor());
nMaxItem = rPool.GetItemCount2(RES_CHRATR_OVERLINE); nMaxItem = rPool.GetItemCount2(RES_CHRATR_OVERLINE);
for (sal_uInt32 n = 0; n < nMaxItem; ++n) for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{ {
if (0 != (pOver = (const SvxOverlineItem*)rPool.GetItem2(RES_CHRATR_OVERLINE, n))) if (0 != (pOver = static_cast<const SvxOverlineItem*>(rPool.GetItem2(RES_CHRATR_OVERLINE, n))))
InsColor(pOver->GetColor()); InsColor(pOver->GetColor());
} }
@ -987,16 +988,16 @@ void RtfExport::OutColorTable()
for (const sal_uInt16* pIds = aBrushIds; *pIds; ++pIds) for (const sal_uInt16* pIds = aBrushIds; *pIds; ++pIds)
{ {
const SvxBrushItem* pBkgrd = (const SvxBrushItem*)GetDfltAttr(*pIds); const SvxBrushItem* pBkgrd = static_cast<const SvxBrushItem*>(GetDfltAttr(*pIds));
InsColor(pBkgrd->GetColor()); InsColor(pBkgrd->GetColor());
if (0 != (pBkgrd = (const SvxBrushItem*)rPool.GetPoolDefaultItem(*pIds))) if (0 != (pBkgrd = static_cast<const SvxBrushItem*>(rPool.GetPoolDefaultItem(*pIds))))
{ {
InsColor(pBkgrd->GetColor()); InsColor(pBkgrd->GetColor());
} }
nMaxItem = rPool.GetItemCount2(*pIds); nMaxItem = rPool.GetItemCount2(*pIds);
for (sal_uInt32 n = 0; n < nMaxItem; ++n) for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{ {
if (0 != (pBkgrd = (const SvxBrushItem*)rPool.GetItem2(*pIds , n))) if (0 != (pBkgrd = static_cast<const SvxBrushItem*>(rPool.GetItem2(*pIds , n))))
{ {
InsColor(pBkgrd->GetColor()); InsColor(pBkgrd->GetColor());
} }
@ -1005,16 +1006,16 @@ void RtfExport::OutColorTable()
// shadow color // shadow color
{ {
const SvxShadowItem* pShadow = (const SvxShadowItem*)GetDfltAttr(RES_SHADOW); const SvxShadowItem* pShadow = static_cast<const SvxShadowItem*>(GetDfltAttr(RES_SHADOW));
InsColor(pShadow->GetColor()); InsColor(pShadow->GetColor());
if (0 != (pShadow = (const SvxShadowItem*)rPool.GetPoolDefaultItem(RES_SHADOW))) if (0 != (pShadow = static_cast<const SvxShadowItem*>(rPool.GetPoolDefaultItem(RES_SHADOW))))
{ {
InsColor(pShadow->GetColor()); InsColor(pShadow->GetColor());
} }
nMaxItem = rPool.GetItemCount2(RES_SHADOW); nMaxItem = rPool.GetItemCount2(RES_SHADOW);
for (sal_uInt32 n = 0; n < nMaxItem; ++n) for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{ {
if (0 != (pShadow = (const SvxShadowItem*)rPool.GetItem2(RES_SHADOW, n))) if (0 != (pShadow = static_cast<const SvxShadowItem*>(rPool.GetItem2(RES_SHADOW, n))))
{ {
InsColor(pShadow->GetColor()); InsColor(pShadow->GetColor());
} }
@ -1024,24 +1025,24 @@ void RtfExport::OutColorTable()
// frame border color // frame border color
{ {
const SvxBoxItem* pBox; const SvxBoxItem* pBox;
if (0 != (pBox = (const SvxBoxItem*)rPool.GetPoolDefaultItem(RES_BOX))) if (0 != (pBox = static_cast<const SvxBoxItem*>(rPool.GetPoolDefaultItem(RES_BOX))))
InsColorLine(*pBox); InsColorLine(*pBox);
nMaxItem = rPool.GetItemCount2(RES_BOX); nMaxItem = rPool.GetItemCount2(RES_BOX);
for (sal_uInt32 n = 0; n < nMaxItem; ++n) for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{ {
if (0 != (pBox = (const SvxBoxItem*)rPool.GetItem2(RES_BOX, n))) if (0 != (pBox = static_cast<const SvxBoxItem*>(rPool.GetItem2(RES_BOX, n))))
InsColorLine(*pBox); InsColorLine(*pBox);
} }
} }
{ {
const SvxBoxItem* pCharBox; const SvxBoxItem* pCharBox;
if (0 != (pCharBox = (const SvxBoxItem*)rPool.GetPoolDefaultItem(RES_CHRATR_BOX))) if (0 != (pCharBox = static_cast<const SvxBoxItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_BOX))))
InsColorLine(*pCharBox); InsColorLine(*pCharBox);
nMaxItem = rPool.GetItemCount2(RES_CHRATR_BOX); nMaxItem = rPool.GetItemCount2(RES_CHRATR_BOX);
for (sal_uInt32 n = 0; n < nMaxItem; ++n) for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{ {
if (0 != (pCharBox = (const SvxBoxItem*)rPool.GetItem2(RES_CHRATR_BOX, n))) if (0 != (pCharBox = static_cast<const SvxBoxItem*>(rPool.GetItem2(RES_CHRATR_BOX, n))))
InsColorLine(*pCharBox); InsColorLine(*pCharBox);
} }
} }
@ -1153,13 +1154,13 @@ void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader)
{ {
if (bHeader) if (bHeader)
{ {
const SwFmtHeader& rHeader = (const SwFmtHeader&)rItem; const SwFmtHeader& rHeader = static_cast<const SwFmtHeader&>(rItem);
if (!rHeader.IsActive()) if (!rHeader.IsActive())
return; return;
} }
else else
{ {
const SwFmtFooter& rFooter = (const SwFmtFooter&)rItem; const SwFmtFooter& rFooter = static_cast<const SwFmtFooter&>(rItem);
if (!rFooter.IsActive()) if (!rFooter.IsActive())
return; return;
} }

View File

@ -35,7 +35,7 @@ using namespace css;
RtfSdrExport::RtfSdrExport(RtfExport& rExport) RtfSdrExport::RtfSdrExport(RtfExport& rExport)
: EscherEx(EscherExGlobalRef(new EscherExGlobal), 0), : EscherEx(EscherExGlobalRef(new EscherExGlobal), 0),
m_rExport(rExport), m_rExport(rExport),
m_rAttrOutput((RtfAttributeOutput&)m_rExport.AttrOutput()), m_rAttrOutput(static_cast<RtfAttributeOutput&>(m_rExport.AttrOutput())),
m_pSdrObject(NULL), m_pSdrObject(NULL),
m_nShapeType(ESCHER_ShpInst_Nil), m_nShapeType(ESCHER_ShpInst_Nil),
m_nShapeFlags(0) , m_nShapeFlags(0) ,

View File

@ -1143,13 +1143,13 @@ void MSWord_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart)
void MSWord_SdrAttrIter::OutEEField(const SfxPoolItem& rHt) void MSWord_SdrAttrIter::OutEEField(const SfxPoolItem& rHt)
{ {
const SvxFieldItem &rField = (const SvxFieldItem &)rHt; const SvxFieldItem &rField = static_cast<const SvxFieldItem &>(rHt);
const SvxFieldData *pFld = rField.GetField(); const SvxFieldData *pFld = rField.GetField();
if (pFld && pFld->ISA(SvxURLField)) if (pFld && pFld->ISA(SvxURLField))
{ {
sal_uInt8 nOldTxtTyp = m_rExport.nTxtTyp; sal_uInt8 nOldTxtTyp = m_rExport.nTxtTyp;
m_rExport.nTxtTyp = mnTyp; m_rExport.nTxtTyp = mnTyp;
const SvxURLField *pURL = (const SvxURLField *)pFld; const SvxURLField *pURL = static_cast<const SvxURLField *>(pFld);
m_rExport.AttrOutput().StartURL( pURL->GetURL(), pURL->GetTargetFrame() ); m_rExport.AttrOutput().StartURL( pURL->GetURL(), pURL->GetTargetFrame() );
const OUString &rStr = pURL->GetRepresentation(); const OUString &rStr = pURL->GetRepresentation();
@ -1988,14 +1988,14 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrmFmt& rFmt,
const SwAttrSet& rAttrSet = rFmt.GetAttrSet(); const SwAttrSet& rAttrSet = rFmt.GetAttrSet();
if (SfxItemState::SET == rAttrSet.GetItemState(RES_BOX, false, &pItem)) if (SfxItemState::SET == rAttrSet.GetItemState(RES_BOX, false, &pItem))
{ {
const SvxBoxItem* pBox = (const SvxBoxItem*)pItem; const SvxBoxItem* pBox = static_cast<const SvxBoxItem*>(pItem);
if( pBox ) if( pBox )
{ {
const SfxPoolItem* pShadItem; const SfxPoolItem* pShadItem;
if (SfxItemState::SET if (SfxItemState::SET
== rAttrSet.GetItemState(RES_SHADOW, true, &pShadItem)) == rAttrSet.GetItemState(RES_SHADOW, true, &pShadItem))
{ {
const SvxShadowItem* pSI = (const SvxShadowItem*)pShadItem; const SvxShadowItem* pSI = static_cast<const SvxShadowItem*>(pShadItem);
const sal_uInt16 nCstScale = 635; // unit scale between AOO and MS Word const sal_uInt16 nCstScale = 635; // unit scale between AOO and MS Word
const sal_uInt32 nShadowType = 131074; // shadow type of ms word. need to set the default value. const sal_uInt32 nShadowType = 131074; // shadow type of ms word. need to set the default value.
@ -2325,7 +2325,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt)
&pItem); &pItem);
if (SfxItemState::SET == eState && pItem) if (SfxItemState::SET == eState && pItem)
{ {
const SvxBrushItem* pBrush = (const SvxBrushItem*)pItem; const SvxBrushItem* pBrush = static_cast<const SvxBrushItem*>(pItem);
WriteBrushAttr(*pBrush, aPropOpt); WriteBrushAttr(*pBrush, aPropOpt);
SvxGraphicPosition ePos = pBrush->GetGraphicPos(); SvxGraphicPosition ePos = pBrush->GetGraphicPos();

View File

@ -393,7 +393,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby )
sal_uInt16 nFontId = GetWhichOfScript( RES_CHRATR_FONT, GetScript() ); sal_uInt16 nFontId = GetWhichOfScript( RES_CHRATR_FONT, GetScript() );
const SvxFontItem &rParentFont = ItemGet<SvxFontItem>( const SvxFontItem &rParentFont = ItemGet<SvxFontItem>(
(const SwTxtFmtColl&)rNd.GetAnyFmtColl(), nFontId); static_cast<const SwTxtFmtColl&>(rNd.GetAnyFmtColl()), nFontId);
const SvxFontItem *pFont = &rParentFont; const SvxFontItem *pFont = &rParentFont;
const SfxPoolItem *pGrabBag = 0; const SfxPoolItem *pGrabBag = 0;
@ -811,8 +811,8 @@ void WW8AttributeOutput::StartRuby( const SwTxtNode& rNode, sal_Int32 /*nPos*/,
const SwAttrSet& rSet = rNode.GetSwAttrSet(); const SwAttrSet& rSet = rNode.GetSwAttrSet();
const SvxFontHeightItem &rHeightItem = const SvxFontHeightItem &rHeightItem =
( const SvxFontHeightItem& )rSet.Get( static_cast< const SvxFontHeightItem& >(rSet.Get(
GetWhichOfScript( RES_CHRATR_FONTSIZE, nRubyScript ) ); GetWhichOfScript( RES_CHRATR_FONTSIZE, nRubyScript ) ));
nHeight = (rHeightItem.GetHeight() + 10)/20-1; nHeight = (rHeightItem.GetHeight() + 10)/20-1;
aStr += OUString::number(nHeight); aStr += OUString::number(nHeight);
aStr += "("; aStr += "(";
@ -1433,11 +1433,11 @@ short MSWordExportBase::GetDefaultFrameDirection( ) const
{ {
if ( bOutFlyFrmAttrs ) //frame if ( bOutFlyFrmAttrs ) //frame
{ {
nDir = TrueFrameDirection( *( const SwFrmFmt * ) pOutFmtNode ); nDir = TrueFrameDirection( *static_cast< const SwFrmFmt * >(pOutFmtNode) );
} }
else if ( pOutFmtNode->ISA( SwCntntNode ) ) //pagagraph else if ( pOutFmtNode->ISA( SwCntntNode ) ) //pagagraph
{ {
const SwCntntNode *pNd = ( const SwCntntNode * ) pOutFmtNode; const SwCntntNode *pNd = static_cast<const SwCntntNode *>(pOutFmtNode);
SwPosition aPos( *pNd ); SwPosition aPos( *pNd );
nDir = pDoc->GetTextDirection( aPos ); nDir = pDoc->GetTextDirection( aPos );
} }
@ -1505,7 +1505,7 @@ const SvxBrushItem* WW8Export::GetCurrentPageBgBrush() const
//If not set, or "no fill", get real bg //If not set, or "no fill", get real bg
SfxItemState eState = rFmt.GetItemState(RES_BACKGROUND, true, &pItem); SfxItemState eState = rFmt.GetItemState(RES_BACKGROUND, true, &pItem);
const SvxBrushItem* pRet = (const SvxBrushItem*)pItem; const SvxBrushItem* pRet = static_cast<const SvxBrushItem*>(pItem);
if (SfxItemState::SET != eState || (!pRet->GetGraphic() && if (SfxItemState::SET != eState || (!pRet->GetGraphic() &&
pRet->GetColor() == COL_TRANSPARENT)) pRet->GetColor() == COL_TRANSPARENT))
{ {
@ -1525,7 +1525,7 @@ SvxBrushItem WW8Export::TrueFrameBgBrush(const SwFrmFmt &rFlyFmt) const
const SfxPoolItem* pItem = 0; const SfxPoolItem* pItem = 0;
SfxItemState eState = SfxItemState eState =
pFlyFmt->GetItemState(RES_BACKGROUND, true, &pItem); pFlyFmt->GetItemState(RES_BACKGROUND, true, &pItem);
pRet = (const SvxBrushItem*)pItem; pRet = static_cast<const SvxBrushItem*>(pItem);
if (SfxItemState::SET != eState || (!pRet->GetGraphic() && if (SfxItemState::SET != eState || (!pRet->GetGraphic() &&
pRet->GetColor() == COL_TRANSPARENT)) pRet->GetColor() == COL_TRANSPARENT))
{ {
@ -2433,7 +2433,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
static_cast<const SvxULSpaceItem*>(pItem)->GetLower()) )) static_cast<const SvxULSpaceItem*>(pItem)->GetLower()) ))
{ {
pTmpSet = new SfxItemSet( rNode.GetSwAttrSet() ); pTmpSet = new SfxItemSet( rNode.GetSwAttrSet() );
SvxULSpaceItem aUL( *(SvxULSpaceItem*)pItem ); SvxULSpaceItem aUL( *static_cast<const SvxULSpaceItem*>(pItem) );
// #i25901#- consider compatibility option // #i25901#- consider compatibility option
if (!pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::PARA_SPACE_MAX_AT_PAGES)) if (!pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::PARA_SPACE_MAX_AT_PAGES))
{ {
@ -2531,8 +2531,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
cannot export that, its its ltr then that's ok as thats word's cannot export that, its its ltr then that's ok as thats word's
default. Otherwise we must add a RTL attribute to our export list default. Otherwise we must add a RTL attribute to our export list
*/ */
const SvxFrameDirectionItem* pItem = (const SvxFrameDirectionItem*) const SvxFrameDirectionItem* pItem = static_cast<const SvxFrameDirectionItem*>(
rNode.GetSwAttrSet().GetItem(RES_FRAMEDIR); rNode.GetSwAttrSet().GetItem(RES_FRAMEDIR));
if ( if (
(!pItem || pItem->GetValue() == FRMDIR_ENVIRONMENT) && (!pItem || pItem->GetValue() == FRMDIR_ENVIRONMENT) &&
aAttrIter.IsParaRTL() aAttrIter.IsParaRTL()
@ -2894,7 +2894,7 @@ void WW8Export::OutWW6FlyFrmsInCntnt( const SwTxtNode& rNd )
{ {
// attribute bound to a character // attribute bound to a character
const SwFmtFlyCnt& rFlyCntnt = pAttr->GetFlyCnt(); const SwFmtFlyCnt& rFlyCntnt = pAttr->GetFlyCnt();
const SwFlyFrmFmt& rFlyFrmFmt = *(SwFlyFrmFmt*)rFlyCntnt.GetFrmFmt(); const SwFlyFrmFmt& rFlyFrmFmt = *static_cast<SwFlyFrmFmt*>(rFlyCntnt.GetFrmFmt());
const SwNodeIndex* pNodeIndex = rFlyFrmFmt.GetCntnt().GetCntntIdx(); const SwNodeIndex* pNodeIndex = rFlyFrmFmt.GetCntnt().GetCntntIdx();
if( pNodeIndex ) if( pNodeIndex )

View File

@ -204,7 +204,7 @@ static sal_uInt8 GetLevelNFC( sal_uInt16 eNumType, const SfxItemSet *pOutSet)
case SVX_NUM_NUMBER_LOWER_ZH: case SVX_NUM_NUMBER_LOWER_ZH:
nRet = 35; nRet = 35;
if ( pOutSet ) { if ( pOutSet ) {
const SvxLanguageItem rLang = (const SvxLanguageItem&) pOutSet->Get( RES_CHRATR_CJK_LANGUAGE,true); const SvxLanguageItem rLang = static_cast<const SvxLanguageItem&>( pOutSet->Get( RES_CHRATR_CJK_LANGUAGE,true) );
const LanguageType eLang = rLang.GetLanguage(); const LanguageType eLang = rLang.GetLanguage();
if (LANGUAGE_CHINESE_SIMPLIFIED ==eLang) { if (LANGUAGE_CHINESE_SIMPLIFIED ==eLang) {
nRet = 39; nRet = 39;

View File

@ -548,7 +548,7 @@ void MSWordStyles::GetStyleData( SwFmt* pFmt, bool& bFmtColl, sal_uInt16& nBase,
SwFmt* pNext; SwFmt* pNext;
if ( bFmtColl ) if ( bFmtColl )
pNext = &((SwTxtFmtColl*)pFmt)->GetNextTxtFmtColl(); pNext = &static_cast<SwTxtFmtColl*>(pFmt)->GetNextTxtFmtColl();
else else
pNext = pFmt; // CharFmt: next CharFmt == self pNext = pFmt; // CharFmt: next CharFmt == self
@ -902,13 +902,13 @@ void wwFontHelper::InitFontTable(bool bWrtWW8,const SwDoc& rDoc)
GetId(wwFont(OUString("Arial"), PITCH_VARIABLE, FAMILY_SWISS, GetId(wwFont(OUString("Arial"), PITCH_VARIABLE, FAMILY_SWISS,
RTL_TEXTENCODING_MS_1252,bWrtWW8)); RTL_TEXTENCODING_MS_1252,bWrtWW8));
const SvxFontItem* pFont = (const SvxFontItem*)GetDfltAttr(RES_CHRATR_FONT); const SvxFontItem* pFont = static_cast<const SvxFontItem*>(GetDfltAttr(RES_CHRATR_FONT));
GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(), GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(),
pFont->GetFamily(), pFont->GetCharSet(),bWrtWW8)); pFont->GetFamily(), pFont->GetCharSet(),bWrtWW8));
const SfxItemPool& rPool = rDoc.GetAttrPool(); const SfxItemPool& rPool = rDoc.GetAttrPool();
if (0 != (pFont = (const SvxFontItem*)rPool.GetPoolDefaultItem(RES_CHRATR_FONT))) if (0 != (pFont = static_cast<const SvxFontItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_FONT))))
{ {
GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(), GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(),
pFont->GetFamily(), pFont->GetCharSet(),bWrtWW8)); pFont->GetFamily(), pFont->GetCharSet(),bWrtWW8));
@ -923,7 +923,7 @@ void wwFontHelper::InitFontTable(bool bWrtWW8,const SwDoc& rDoc)
sal_uInt32 const nMaxItem = rPool.GetItemCount2( *pId ); sal_uInt32 const nMaxItem = rPool.GetItemCount2( *pId );
for (sal_uInt32 nGet = 0; nGet < nMaxItem; ++nGet) for (sal_uInt32 nGet = 0; nGet < nMaxItem; ++nGet)
{ {
pFont = (const SvxFontItem*)rPool.GetItem2( *pId, nGet ); pFont = static_cast<const SvxFontItem*>(rPool.GetItem2( *pId, nGet ));
if (0 != pFont) if (0 != pFont)
{ {
GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(), GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(),
@ -1043,9 +1043,9 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport )
const SfxPoolItem* pI; const SfxPoolItem* pI;
const SwNode* pNd = rExport.pCurPam->GetCntntNode(); const SwNode* pNd = rExport.pCurPam->GetCntntNode();
const SfxItemSet* pSet = pNd ? &((SwCntntNode*)pNd)->GetSwAttrSet() : 0; const SfxItemSet* pSet = pNd ? &static_cast<const SwCntntNode*>(pNd)->GetSwAttrSet() : 0;
sal_uLong nRstLnNum = pSet ? ((SwFmtLineNumber&)pSet->Get( RES_LINENUMBER )).GetStartValue() : 0; sal_uLong nRstLnNum = pSet ? static_cast<const SwFmtLineNumber&>(pSet->Get( RES_LINENUMBER )).GetStartValue() : 0;
const SwTableNode* pTblNd = rExport.pCurPam->GetNode().FindTableNode(); const SwTableNode* pTblNd = rExport.pCurPam->GetNode().FindTableNode();
const SwSectionNode* pSectNd; const SwSectionNode* pSectNd;
@ -1075,9 +1075,9 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport )
// Hole evtl. Pagedesc des 1. Nodes // Hole evtl. Pagedesc des 1. Nodes
if ( pSet && if ( pSet &&
SfxItemState::SET == pSet->GetItemState( RES_PAGEDESC, true, &pI ) && SfxItemState::SET == pSet->GetItemState( RES_PAGEDESC, true, &pI ) &&
( (SwFmtPageDesc*)pI )->GetPageDesc() ) static_cast<const SwFmtPageDesc*>(pI)->GetPageDesc() )
{ {
AppendSection( *(SwFmtPageDesc*)pI, *pNd, pFmt, nRstLnNum ); AppendSection( *static_cast<const SwFmtPageDesc*>(pI), *pNd, pFmt, nRstLnNum );
} }
else else
AppendSection( rExport.pAktPageDesc, pFmt, nRstLnNum ); AppendSection( rExport.pAktPageDesc, pFmt, nRstLnNum );
@ -1138,10 +1138,10 @@ sal_uInt16 MSWordSections::NumberOfColumns( const SwDoc &rDoc, const WW8_SepInfo
aSet.SetParent( &rSet ); aSet.SetParent( &rSet );
//0xffffffff, what the hell is going on with that!, fixme most terribly //0xffffffff, what the hell is going on with that!, fixme most terribly
if ( rInfo.pSectionFmt && (SwSectionFmt*)0xFFFFFFFF != rInfo.pSectionFmt ) if ( rInfo.pSectionFmt && reinterpret_cast<SwSectionFmt*>(0xFFFFFFFF) != rInfo.pSectionFmt )
aSet.Put( rInfo.pSectionFmt->GetFmtAttr( RES_COL ) ); aSet.Put( rInfo.pSectionFmt->GetFmtAttr( RES_COL ) );
const SwFmtCol& rCol = (const SwFmtCol&)aSet.Get( RES_COL ); const SwFmtCol& rCol = static_cast<const SwFmtCol&>(aSet.Get( RES_COL ));
const SwColumns& rColumns = rCol.GetColumns(); const SwColumns& rColumns = rCol.GetColumns();
return rColumns.size(); return rColumns.size();
} }
@ -1276,8 +1276,8 @@ void MSWordSections::SetHeaderFlag( sal_uInt8& rHeadFootFlags, const SwFmt& rFmt
{ {
const SfxPoolItem* pItem; const SfxPoolItem* pItem;
if( SfxItemState::SET == rFmt.GetItemState(RES_HEADER, true, &pItem) if( SfxItemState::SET == rFmt.GetItemState(RES_HEADER, true, &pItem)
&& ((SwFmtHeader*)pItem)->IsActive() && && static_cast<const SwFmtHeader*>(pItem)->IsActive() &&
((SwFmtHeader*)pItem)->GetHeaderFmt() ) static_cast<const SwFmtHeader*>(pItem)->GetHeaderFmt() )
rHeadFootFlags |= nFlag; rHeadFootFlags |= nFlag;
} }
@ -1286,8 +1286,8 @@ void MSWordSections::SetFooterFlag( sal_uInt8& rHeadFootFlags, const SwFmt& rFmt
{ {
const SfxPoolItem* pItem; const SfxPoolItem* pItem;
if( SfxItemState::SET == rFmt.GetItemState(RES_FOOTER, true, &pItem) if( SfxItemState::SET == rFmt.GetItemState(RES_FOOTER, true, &pItem)
&& ((SwFmtFooter*)pItem)->IsActive() && && static_cast<const SwFmtFooter*>(pItem)->IsActive() &&
((SwFmtFooter*)pItem)->GetFooterFmt() ) static_cast<const SwFmtFooter*>(pItem)->GetFooterFmt() )
rHeadFootFlags |= nFlag; rHeadFootFlags |= nFlag;
} }
@ -1325,7 +1325,7 @@ bool WW8_SepInfo::IsProtected() const
bool bRet = false; bool bRet = false;
if ( if (
pSectionFmt && pSectionFmt &&
((SwSectionFmt*)0xFFFFFFFF != pSectionFmt) (reinterpret_cast<SwSectionFmt*>(0xFFFFFFFF) != pSectionFmt)
) )
{ {
const SwSection *pSection = pSectionFmt->GetSection(); const SwSection *pSection = pSectionFmt->GetSection();
@ -1394,10 +1394,10 @@ bool MSWordSections::HasBorderItem( const SwFmt& rFmt )
{ {
const SfxPoolItem* pItem; const SfxPoolItem* pItem;
return SfxItemState::SET == rFmt.GetItemState(RES_BOX, true, &pItem) && return SfxItemState::SET == rFmt.GetItemState(RES_BOX, true, &pItem) &&
( ((SvxBoxItem*)pItem)->GetTop() || ( static_cast<const SvxBoxItem*>(pItem)->GetTop() ||
((SvxBoxItem*)pItem)->GetBottom() || static_cast<const SvxBoxItem*>(pItem)->GetBottom() ||
((SvxBoxItem*)pItem)->GetLeft() || static_cast<const SvxBoxItem*>(pItem)->GetLeft() ||
((SvxBoxItem*)pItem)->GetRight() ); static_cast<const SvxBoxItem*>(pItem)->GetRight() );
} }
void WW8AttributeOutput::StartSection() void WW8AttributeOutput::StartSection()
@ -1661,7 +1661,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
} }
} }
if ( (SwSectionFmt*)0xFFFFFFFF != rSepInfo.pSectionFmt ) if ( reinterpret_cast<SwSectionFmt*>(0xFFFFFFFF) != rSepInfo.pSectionFmt )
{ {
if ( nBreakCode == 0 ) if ( nBreakCode == 0 )
bOutPgDscSet = false; bOutPgDscSet = false;

View File

@ -52,7 +52,7 @@ bool SwWrtShell::TryRemoveIndent()
SfxItemSet aAttrSet(GetAttrPool(), RES_LR_SPACE, RES_LR_SPACE); SfxItemSet aAttrSet(GetAttrPool(), RES_LR_SPACE, RES_LR_SPACE);
GetCurAttr(aAttrSet); GetCurAttr(aAttrSet);
SvxLRSpaceItem aItem = (const SvxLRSpaceItem &)aAttrSet.Get(RES_LR_SPACE); SvxLRSpaceItem aItem = static_cast<const SvxLRSpaceItem &>(aAttrSet.Get(RES_LR_SPACE));
short aOldFirstLineOfst = aItem.GetTxtFirstLineOfst(); short aOldFirstLineOfst = aItem.GetTxtFirstLineOfst();
if (aOldFirstLineOfst > 0) if (aOldFirstLineOfst > 0)

View File

@ -55,7 +55,7 @@ void SwWrtShell::Invalidate()
// to avoid making the slot volatile, invalidate it every time if something could have been changed // to avoid making the slot volatile, invalidate it every time if something could have been changed
// this is still much cheaper than asking for the state every 200 ms (and avoid background processing) // this is still much cheaper than asking for the state every 200 ms (and avoid background processing)
GetView().GetViewFrame()->GetBindings().Invalidate( FN_STAT_SELMODE ); GetView().GetViewFrame()->GetBindings().Invalidate( FN_STAT_SELMODE );
SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)GetView().GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()); SwWordCountWrapper *pWrdCnt = static_cast<SwWordCountWrapper*>(GetView().GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()));
if (pWrdCnt) if (pWrdCnt)
pWrdCnt->UpdateCounts(); pWrdCnt->UpdateCounts();
} }
@ -396,7 +396,7 @@ void SwWrtShell::EndSelect()
fnKillSel = &SwWrtShell::ResetSelect; fnKillSel = &SwWrtShell::ResetSelect;
} }
} }
SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)GetView().GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()); SwWordCountWrapper *pWrdCnt = static_cast<SwWordCountWrapper*>(GetView().GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()));
if (pWrdCnt) if (pWrdCnt)
pWrdCnt->UpdateCounts(); pWrdCnt->UpdateCounts();
} }

View File

@ -311,13 +311,13 @@ void SwWrtShell::Insert( const OUString &rPath, const OUString &rFilter,
if( aGrfSize.Width() > aBound.Width() ) if( aGrfSize.Width() > aBound.Width() )
{ {
aGrfSize.Width() = aBound.Width(); aGrfSize.Width() = aBound.Width();
aGrfSize.Height() = ((BigInt)aBound.Width()) * aTempHeight / aTempWidth; aGrfSize.Height() = BigInt(aBound.Width()) * aTempHeight / aTempWidth;
} }
// Fit hight if necessary, scale down the width proportional thereafter. // Fit hight if necessary, scale down the width proportional thereafter.
if( aGrfSize.Height() > aBound.Height() ) if( aGrfSize.Height() > aBound.Height() )
{ {
aGrfSize.Height() = aBound.Height(); aGrfSize.Height() = aBound.Height();
aGrfSize.Width() = ((BigInt)aBound.Height()) * aTempWidth / aTempHeight; aGrfSize.Width() = BigInt(aBound.Height()) * aTempWidth / aTempHeight;
} }
pFrmMgr->SetSize( aGrfSize ); pFrmMgr->SetSize( aGrfSize );
pFrmMgr->UpdateFlyFrm(); pFrmMgr->UpdateFlyFrm();
@ -1462,7 +1462,7 @@ SwCharFmt *SwWrtShell::GetCharStyle(const OUString &rFmtName, GetStyle eCreate )
{ {
sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName( rFmtName, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ); sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName( rFmtName, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );
if( USHRT_MAX != nId || GETSTYLE_CREATEANY == eCreate ) if( USHRT_MAX != nId || GETSTYLE_CREATEANY == eCreate )
pFmt = (SwCharFmt*)GetFmtFromPool( nId ); pFmt = static_cast<SwCharFmt*>(GetFmtFromPool( nId ));
} }
return pFmt; return pFmt;
} }

View File

@ -348,7 +348,7 @@ void SwWrtShell::ClickToField( const SwField& rFld )
case RES_MACROFLD: case RES_MACROFLD:
{ {
const SwMacroField *pFld = (const SwMacroField*)&rFld; const SwMacroField *pFld = static_cast<const SwMacroField*>(&rFld);
const OUString sText( rFld.GetPar2() ); const OUString sText( rFld.GetPar2() );
OUString sRet( sText ); OUString sRet( sText );
ExecMacro( pFld->GetSvxMacro(), &sRet ); ExecMacro( pFld->GetSvxMacro(), &sRet );
@ -459,7 +459,7 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, sal_uInt16 nFilter,
return; return;
//A CrsrShell is always a WrtShell //A CrsrShell is always a WrtShell
SwWrtShell &rSh = (SwWrtShell&)rVSh; SwWrtShell &rSh = static_cast<SwWrtShell&>(rVSh);
SwDocShell* pDShell = rSh.GetView().GetDocShell(); SwDocShell* pDShell = rSh.GetView().GetDocShell();
OSL_ENSURE( pDShell, "No DocShell?!"); OSL_ENSURE( pDShell, "No DocShell?!");