improve redundantcast loplugin

to find c-style casts where the expression is a templated method

Change-Id: Ifbd1e2cdc72d906fc95a7ec0f9408c3f6d2a836b
Reviewed-on: https://gerrit.libreoffice.org/42275
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2017-09-14 13:59:33 +02:00
parent 44bfe8fad4
commit 5685ee25aa
33 changed files with 78 additions and 65 deletions

View File

@ -294,6 +294,9 @@ bool RedundantCast::VisitCStyleCastExpr(CStyleCastExpr const * expr) {
} }
auto t1 = compat::getSubExprAsWritten(expr)->getType(); auto t1 = compat::getSubExprAsWritten(expr)->getType();
auto t2 = expr->getTypeAsWritten(); auto t2 = expr->getTypeAsWritten();
if (auto templateType = dyn_cast<SubstTemplateTypeParmType>(t1)) {
t1 = templateType->desugar();
}
if (t1 != t2) { if (t1 != t2) {
return true; return true;
} }

View File

@ -290,11 +290,23 @@ void testCStyleCast() {
(void)e; (void)e;
} }
template<typename T>
struct EnumItemInterface {
T GetValue() { return static_cast<T>(0); }
};
class Enum1Item : public EnumItemInterface<Enum1> {
};
bool testCStyleCastOfTemplateMethodResult(Enum1Item* item) {
return (Enum1)item->GetValue() == Enum1::X; // expected-error {{redundant cstyle cast from 'Enum1' to 'Enum1' [loplugin:redundantcast]}}
}
int main() { int main() {
testConstCast(); testConstCast();
testStaticCast(); testStaticCast();
testFunctionalCast(); testFunctionalCast();
testCStyleCast(); testCStyleCast();
testCStyleCastOfTemplateMethodResult(nullptr);
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */

View File

@ -1968,7 +1968,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
case SfxItemState::SET: case SfxItemState::SET:
{ {
const SvxCaseMapItem& rItem = static_cast<const SvxCaseMapItem&>(rSet->Get( nWhich )); const SvxCaseMapItem& rItem = static_cast<const SvxCaseMapItem&>(rSet->Get( nWhich ));
eCaseMap = (SvxCaseMap)rItem.GetValue(); eCaseMap = rItem.GetValue();
break; break;
} }
} }
@ -2333,7 +2333,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
SfxItemState::DEFAULT > rOldSet.GetItemState( nWhich ); SfxItemState::DEFAULT > rOldSet.GetItemState( nWhich );
const SvxCaseMapItem& rItem = *static_cast<const SvxCaseMapItem*>(pOld); const SvxCaseMapItem& rItem = *static_cast<const SvxCaseMapItem*>(pOld);
if ( (SvxCaseMap)rItem.GetValue() == eCaseMap && !bAllowChg ) if ( rItem.GetValue() == eCaseMap && !bAllowChg )
bChanged = false; bChanged = false;
} }

View File

@ -285,7 +285,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
SetMetricValue( *m_pMF_ABSTAND, nGap, eUnit ); SetMetricValue( *m_pMF_ABSTAND, nGap, eUnit );
nGap = static_cast<long>(m_pMF_ABSTAND->GetValue()); nGap = static_cast<long>(m_pMF_ABSTAND->GetValue());
nCaptionType = (SdrCaptionType)static_cast<const SdrCaptionTypeItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ) ).GetValue(); nCaptionType = static_cast<const SdrCaptionTypeItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ) ).GetValue();
bFitLineLen = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFITLINELEN ) ) ).GetValue(); bFitLineLen = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFITLINELEN ) ) ).GetValue();
nEscDir = static_cast<const SdrCaptionEscDirItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCDIR ) ) ).GetValue(); nEscDir = static_cast<const SdrCaptionEscDirItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCDIR ) ) ).GetValue();
bEscRel = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCISREL ) ) ).GetValue(); bEscRel = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCISREL ) ) ).GetValue();

View File

@ -235,8 +235,8 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState) if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState)
{ {
// VertAdjust and HorAdjust are unequivocal, thus // VertAdjust and HorAdjust are unequivocal, thus
SdrTextVertAdjust eTVA = (SdrTextVertAdjust)static_cast<const SdrTextVertAdjustItem&>(rAttrs->Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); SdrTextVertAdjust eTVA = static_cast<const SdrTextVertAdjustItem&>(rAttrs->Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
SdrTextHorzAdjust eTHA = (SdrTextHorzAdjust)static_cast<const SdrTextHorzAdjustItem&>(rAttrs->Get(SDRATTR_TEXT_HORZADJUST)).GetValue(); SdrTextHorzAdjust eTHA = static_cast<const SdrTextHorzAdjustItem&>(rAttrs->Get(SDRATTR_TEXT_HORZADJUST)).GetValue();
RectPoint eRP = RectPoint::LB; RectPoint eRP = RectPoint::LB;
m_pTsbFullWidth->EnableTriState( false ); m_pTsbFullWidth->EnableTriState( false );
@ -309,7 +309,7 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
// adjust to border // adjust to border
if ( rAttrs->GetItemState( SDRATTR_TEXT_FITTOSIZE ) != SfxItemState::DONTCARE ) if ( rAttrs->GetItemState( SDRATTR_TEXT_FITTOSIZE ) != SfxItemState::DONTCARE )
{ {
SdrFitToSizeType eFTS = (SdrFitToSizeType) SdrFitToSizeType eFTS =
static_cast<const SdrTextFitToSizeTypeItem&>( rAttrs->Get( SDRATTR_TEXT_FITTOSIZE ) ).GetValue(); static_cast<const SdrTextFitToSizeTypeItem&>( rAttrs->Get( SDRATTR_TEXT_FITTOSIZE ) ).GetValue();
if( eFTS == SdrFitToSizeType::Autofit || eFTS == SdrFitToSizeType::NONE ) if( eFTS == SdrFitToSizeType::Autofit || eFTS == SdrFitToSizeType::NONE )
m_pTsbFitToSize->SetState( TRISTATE_FALSE ); m_pTsbFitToSize->SetState( TRISTATE_FALSE );
@ -462,8 +462,7 @@ bool SvxTextAttrPage::FillItemSet( SfxItemSet* rAttrs)
if ( rOutAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST ) != SfxItemState::DONTCARE ) if ( rOutAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST ) != SfxItemState::DONTCARE )
{ {
eOldTVA = (SdrTextVertAdjust) eOldTVA = static_cast<const SdrTextVertAdjustItem&>( rOutAttrs.Get( SDRATTR_TEXT_VERTADJUST ) ).GetValue();
static_cast<const SdrTextVertAdjustItem&>( rOutAttrs.Get( SDRATTR_TEXT_VERTADJUST ) ).GetValue();
if( eOldTVA != eTVA ) if( eOldTVA != eTVA )
rAttrs->Put( SdrTextVertAdjustItem( eTVA ) ); rAttrs->Put( SdrTextVertAdjustItem( eTVA ) );
} }
@ -472,8 +471,7 @@ bool SvxTextAttrPage::FillItemSet( SfxItemSet* rAttrs)
if ( rOutAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST ) != SfxItemState::DONTCARE ) if ( rOutAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST ) != SfxItemState::DONTCARE )
{ {
eOldTHA = (SdrTextHorzAdjust) eOldTHA = static_cast<const SdrTextHorzAdjustItem&>( rOutAttrs.Get( SDRATTR_TEXT_HORZADJUST ) ).GetValue();
static_cast<const SdrTextHorzAdjustItem&>( rOutAttrs.Get( SDRATTR_TEXT_HORZADJUST ) ).GetValue();
if( eOldTHA != eTHA ) if( eOldTHA != eTHA )
rAttrs->Put( SdrTextHorzAdjustItem( eTHA ) ); rAttrs->Put( SdrTextHorzAdjustItem( eTHA ) );
} }

View File

@ -859,7 +859,7 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
// horizontal justify // horizontal justify
const SvxHorJustifyItem* pHorJustify = pSet->GetItem<SvxHorJustifyItem>(SBA_ATTR_ALIGN_HOR_JUSTIFY); const SvxHorJustifyItem* pHorJustify = pSet->GetItem<SvxHorJustifyItem>(SBA_ATTR_ALIGN_HOR_JUSTIFY);
_eJustify = (SvxCellHorJustify)pHorJustify->GetValue(); _eJustify = pHorJustify->GetValue();
// format key // format key
if (_bHasFormat) if (_bHasFormat)

View File

@ -473,7 +473,7 @@ EditCharAttribRelief::EditCharAttribRelief( const SvxCharReliefItem& rAttr, sal_
void EditCharAttribRelief::SetFont( SvxFont& rFont, OutputDevice* ) void EditCharAttribRelief::SetFont( SvxFont& rFont, OutputDevice* )
{ {
rFont.SetRelief( (FontRelief)static_cast<const SvxCharReliefItem*>(GetItem())->GetValue() ); rFont.SetRelief( static_cast<const SvxCharReliefItem*>(GetItem())->GetValue() );
} }
// class EditCharAttribGrabBag // class EditCharAttribGrabBag

View File

@ -2050,7 +2050,7 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, S
if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_EMPHASISMARK ) == SfxItemState::SET ) ) if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_EMPHASISMARK ) == SfxItemState::SET ) )
rFont.SetEmphasisMark( static_cast<const SvxEmphasisMarkItem&>(rSet.Get( EE_CHAR_EMPHASISMARK )).GetEmphasisMark() ); rFont.SetEmphasisMark( static_cast<const SvxEmphasisMarkItem&>(rSet.Get( EE_CHAR_EMPHASISMARK )).GetEmphasisMark() );
if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_RELIEF ) == SfxItemState::SET ) ) if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_RELIEF ) == SfxItemState::SET ) )
rFont.SetRelief( (FontRelief)static_cast<const SvxCharReliefItem&>(rSet.Get( EE_CHAR_RELIEF )).GetValue() ); rFont.SetRelief( static_cast<const SvxCharReliefItem&>(rSet.Get( EE_CHAR_RELIEF )).GetValue() );
// If comparing the entire font, or if checking before each alteration // If comparing the entire font, or if checking before each alteration
// whether the value changes, remains relatively the same thing. // whether the value changes, remains relatively the same thing.

View File

@ -69,7 +69,7 @@ bool SvxHorJustifyItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
case MID_HORJUST_HORJUST: case MID_HORJUST_HORJUST:
{ {
table::CellHoriJustify eUno = table::CellHoriJustify_STANDARD; table::CellHoriJustify eUno = table::CellHoriJustify_STANDARD;
switch ( (SvxCellHorJustify)GetValue() ) switch ( GetValue() )
{ {
case SvxCellHorJustify::Standard: eUno = table::CellHoriJustify_STANDARD; break; case SvxCellHorJustify::Standard: eUno = table::CellHoriJustify_STANDARD; break;
case SvxCellHorJustify::Left: eUno = table::CellHoriJustify_LEFT; break; case SvxCellHorJustify::Left: eUno = table::CellHoriJustify_LEFT; break;
@ -87,7 +87,7 @@ bool SvxHorJustifyItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
// (same value for ParaAdjust and ParaLastLineAdjust) // (same value for ParaAdjust and ParaLastLineAdjust)
style::ParagraphAdjust nAdjust = style::ParagraphAdjust_LEFT; style::ParagraphAdjust nAdjust = style::ParagraphAdjust_LEFT;
switch ( (SvxCellHorJustify)GetValue() ) switch ( GetValue() )
{ {
// ParagraphAdjust_LEFT is used for STANDARD and REPEAT // ParagraphAdjust_LEFT is used for STANDARD and REPEAT
case SvxCellHorJustify::Standard: case SvxCellHorJustify::Standard:
@ -218,7 +218,7 @@ bool SvxVerJustifyItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
case MID_HORJUST_ADJUST: case MID_HORJUST_ADJUST:
{ {
style::VerticalAlignment eUno = style::VerticalAlignment_TOP; style::VerticalAlignment eUno = style::VerticalAlignment_TOP;
switch ( (SvxCellVerJustify)GetValue() ) switch ( GetValue() )
{ {
case SVX_VER_JUSTIFY_TOP: eUno = style::VerticalAlignment_TOP; break; case SVX_VER_JUSTIFY_TOP: eUno = style::VerticalAlignment_TOP; break;
case SVX_VER_JUSTIFY_CENTER: eUno = style::VerticalAlignment_MIDDLE; break; case SVX_VER_JUSTIFY_CENTER: eUno = style::VerticalAlignment_MIDDLE; break;
@ -231,7 +231,7 @@ bool SvxVerJustifyItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
default: default:
{ {
sal_Int32 nUno = table::CellVertJustify2::STANDARD; sal_Int32 nUno = table::CellVertJustify2::STANDARD;
switch ( (SvxCellVerJustify)GetValue() ) switch ( GetValue() )
{ {
case SVX_VER_JUSTIFY_STANDARD: nUno = table::CellVertJustify2::STANDARD; break; case SVX_VER_JUSTIFY_STANDARD: nUno = table::CellVertJustify2::STANDARD; break;
case SVX_VER_JUSTIFY_TOP: nUno = table::CellVertJustify2::TOP; break; case SVX_VER_JUSTIFY_TOP: nUno = table::CellVertJustify2::TOP; break;

View File

@ -359,7 +359,7 @@ OUString SubstitutePathVariables::impl_substituteVariable( const OUString& rText
if ( pNTOIIter != m_aPreDefVarMap.end() ) if ( pNTOIIter != m_aPreDefVarMap.end() )
{ {
// Fixed/Predefined variable found // Fixed/Predefined variable found
PreDefVariable nIndex = (PreDefVariable)pNTOIIter->second; PreDefVariable nIndex = pNTOIIter->second;
// Determine variable value and length from array/table // Determine variable value and length from array/table
if ( nIndex == PREDEFVAR_WORK && !bWorkRetrieved ) if ( nIndex == PREDEFVAR_WORK && !bWorkRetrieved )
@ -592,7 +592,7 @@ OUString const & SubstitutePathVariables::impl_getSubstituteVariableValue( const
// Fixed/Predefined variable // Fixed/Predefined variable
if ( pNTOIIter != m_aPreDefVarMap.end() ) if ( pNTOIIter != m_aPreDefVarMap.end() )
{ {
PreDefVariable nIndex = (PreDefVariable)pNTOIIter->second; PreDefVariable nIndex = pNTOIIter->second;
return m_aPreDefVars.m_FixedVar[(sal_Int32)nIndex]; return m_aPreDefVars.m_FixedVar[(sal_Int32)nIndex];
} }
else else

View File

@ -1358,7 +1358,7 @@ bool ScAttrArray::HasAttrib_Impl(const ScPatternAttr* pPattern, HasAttrFlags nMa
bFound = true; bFound = true;
else if (static_cast<const SfxBoolItem&>(pPattern->GetItem( ATTR_LINEBREAK )).GetValue()) else if (static_cast<const SfxBoolItem&>(pPattern->GetItem( ATTR_LINEBREAK )).GetValue())
bFound = true; bFound = true;
else if ((SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>(pPattern-> else if (static_cast<const SvxHorJustifyItem&>(pPattern->
GetItem( ATTR_HOR_JUSTIFY )).GetValue() == SvxCellHorJustify::Block) GetItem( ATTR_HOR_JUSTIFY )).GetValue() == SvxCellHorJustify::Block)
bFound = true; bFound = true;
@ -1382,7 +1382,7 @@ bool ScAttrArray::HasAttrib_Impl(const ScPatternAttr* pPattern, HasAttrFlags nMa
if ( nMask & HasAttrFlags::RightOrCenter ) if ( nMask & HasAttrFlags::RightOrCenter )
{ {
// called only if the sheet is LTR, so physical=logical alignment can be assumed // called only if the sheet is LTR, so physical=logical alignment can be assumed
SvxCellHorJustify eHorJust = (SvxCellHorJustify) SvxCellHorJustify eHorJust =
static_cast<const SvxHorJustifyItem&>( pPattern->GetItem( ATTR_HOR_JUSTIFY )).GetValue(); static_cast<const SvxHorJustifyItem&>( pPattern->GetItem( ATTR_HOR_JUSTIFY )).GetValue();
if ( eHorJust == SvxCellHorJustify::Right || eHorJust == SvxCellHorJustify::Center ) if ( eHorJust == SvxCellHorJustify::Right || eHorJust == SvxCellHorJustify::Center )
bFound = true; bFound = true;

View File

@ -144,9 +144,9 @@ long ScColumn::GetNeededSize(
SvxCellHorJustify eHorJust; SvxCellHorJustify eHorJust;
if (pCondSet && if (pCondSet &&
pCondSet->GetItemState(ATTR_HOR_JUSTIFY, true, &pCondItem) == SfxItemState::SET) pCondSet->GetItemState(ATTR_HOR_JUSTIFY, true, &pCondItem) == SfxItemState::SET)
eHorJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem*>(pCondItem)->GetValue(); eHorJust = static_cast<const SvxHorJustifyItem*>(pCondItem)->GetValue();
else else
eHorJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>( eHorJust = static_cast<const SvxHorJustifyItem&>(
pPattern->GetItem( ATTR_HOR_JUSTIFY )).GetValue(); pPattern->GetItem( ATTR_HOR_JUSTIFY )).GetValue();
bool bBreak; bool bBreak;
if ( eHorJust == SvxCellHorJustify::Block ) if ( eHorJust == SvxCellHorJustify::Block )
@ -212,9 +212,9 @@ long ScColumn::GetNeededSize(
{ {
if (pCondSet && if (pCondSet &&
pCondSet->GetItemState(ATTR_ROTATE_MODE, true, &pCondItem) == SfxItemState::SET) pCondSet->GetItemState(ATTR_ROTATE_MODE, true, &pCondItem) == SfxItemState::SET)
eRotMode = (SvxRotateMode)static_cast<const SvxRotateModeItem*>(pCondItem)->GetValue(); eRotMode = static_cast<const SvxRotateModeItem*>(pCondItem)->GetValue();
else else
eRotMode = (SvxRotateMode)static_cast<const SvxRotateModeItem&>( eRotMode = static_cast<const SvxRotateModeItem&>(
pPattern->GetItem(ATTR_ROTATE_MODE)).GetValue(); pPattern->GetItem(ATTR_ROTATE_MODE)).GetValue();
if ( nRotate == 18000 ) if ( nRotate == 18000 )
@ -814,7 +814,7 @@ void ScColumn::GetOptimalHeight(
if (bStdAllowed) if (bStdAllowed)
{ {
bool bBreak = static_cast<const SfxBoolItem&>(pPattern->GetItem(ATTR_LINEBREAK)).GetValue() || bool bBreak = static_cast<const SfxBoolItem&>(pPattern->GetItem(ATTR_LINEBREAK)).GetValue() ||
((SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>(pPattern-> (static_cast<const SvxHorJustifyItem&>(pPattern->
GetItem( ATTR_HOR_JUSTIFY )).GetValue() == GetItem( ATTR_HOR_JUSTIFY )).GetValue() ==
SvxCellHorJustify::Block); SvxCellHorJustify::Block);
bStdOnly = !bBreak; bStdOnly = !bBreak;

View File

@ -909,7 +909,7 @@ void ScPatternAttr::FillEditParaItems( SfxItemSet* pEditSet ) const
const SfxItemSet& rMySet = GetItemSet(); const SfxItemSet& rMySet = GetItemSet();
SvxCellHorJustify eHorJust = (SvxCellHorJustify) SvxCellHorJustify eHorJust =
static_cast<const SvxHorJustifyItem&>(rMySet.Get(ATTR_HOR_JUSTIFY)).GetValue(); static_cast<const SvxHorJustifyItem&>(rMySet.Get(ATTR_HOR_JUSTIFY)).GetValue();
SvxAdjust eSvxAdjust; SvxAdjust eSvxAdjust;

View File

@ -1922,7 +1922,7 @@ void ScTable::MaybeAddExtraColumn(SCCOL& rCol, SCROW nRow, OutputDevice* pDev, d
const ScPatternAttr* pPattern = GetPattern( rCol, nRow ); const ScPatternAttr* pPattern = GetPattern( rCol, nRow );
const SfxItemSet* pCondSet = pDocument->GetCondResult( rCol, nRow, nTab ); const SfxItemSet* pCondSet = pDocument->GetCondResult( rCol, nRow, nTab );
SvxCellHorJustify eHorJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>( SvxCellHorJustify eHorJust = static_cast<const SvxHorJustifyItem&>(
pPattern->GetItem( ATTR_HOR_JUSTIFY, pCondSet )).GetValue(); pPattern->GetItem( ATTR_HOR_JUSTIFY, pCondSet )).GetValue();
if ( eHorJust == SvxCellHorJustify::Center ) if ( eHorJust == SvxCellHorJustify::Center )
nMissing /= 2; // distributed into both directions nMissing /= 2; // distributed into both directions

View File

@ -317,7 +317,7 @@ tools::Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, bool bF
long nPixDifY; long nPixDifY;
long nTopMargin = (long) ( pMargin->GetTopMargin() * nPPTY ); long nTopMargin = (long) ( pMargin->GetTopMargin() * nPPTY );
SvxCellVerJustify eJust = (SvxCellVerJustify) static_cast<const SvxVerJustifyItem&>(pPattern-> SvxCellVerJustify eJust = static_cast<const SvxVerJustifyItem&>(pPattern->
GetItem(ATTR_VER_JUSTIFY)).GetValue(); GetItem(ATTR_VER_JUSTIFY)).GetValue();
// asian vertical is always edited top-aligned // asian vertical is always edited top-aligned

View File

@ -2122,7 +2122,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn
mpEditEngine->SetBackgroundColor( aBackCol ); mpEditEngine->SetBackgroundColor( aBackCol );
// Adjustment // Adjustment
eAttrAdjust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>(pPattern-> eAttrAdjust = static_cast<const SvxHorJustifyItem&>(pPattern->
GetItem(ATTR_HOR_JUSTIFY)).GetValue(); GetItem(ATTR_HOR_JUSTIFY)).GetValue();
if ( eAttrAdjust == SvxCellHorJustify::Repeat && if ( eAttrAdjust == SvxCellHorJustify::Repeat &&
static_cast<const SfxBoolItem&>(pPattern->GetItem(ATTR_LINEBREAK)).GetValue() ) static_cast<const SfxBoolItem&>(pPattern->GetItem(ATTR_LINEBREAK)).GetValue() )

View File

@ -2069,7 +2069,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
if ( bFixedWidth ) if ( bFixedWidth )
{ {
SvxCellHorJustify eHorJust = (SvxCellHorJustify) SvxCellHorJustify eHorJust =
static_cast<const SvxHorJustifyItem*>( aDocument.GetAttr( nCol, nRow, static_cast<const SvxHorJustifyItem*>( aDocument.GetAttr( nCol, nRow,
nTab, ATTR_HOR_JUSTIFY ))->GetValue(); nTab, ATTR_HOR_JUSTIFY ))->GetValue();
lcl_ScDocShell_GetFixedWidthString( aString, aDocument, nTab, nCol, lcl_ScDocShell_GetFixedWidthString( aString, aDocument, nTab, nCol,

View File

@ -1237,7 +1237,7 @@ void ScDrawTextObjectBar::GetStatePropPanelAttr(SfxItemSet &rSet)
//if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState) //if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState)
if(SfxItemState::DONTCARE != eVState) if(SfxItemState::DONTCARE != eVState)
{ {
SdrTextVertAdjust eTVA = (SdrTextVertAdjust)static_cast<const SdrTextVertAdjustItem&>(aEditAttr.Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); SdrTextVertAdjust eTVA = static_cast<const SdrTextVertAdjustItem&>(aEditAttr.Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
bool bSet = (nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP) || bool bSet = (nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP) ||
(nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER) || (nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER) ||
(nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM); (nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM);

View File

@ -261,7 +261,7 @@ void ScAutoFmtPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCo
// Justification: // Justification:
eJustification = mbRTL ? SvxCellHorJustify::Right : bJustify ? eJustification = mbRTL ? SvxCellHorJustify::Right : bJustify ?
(SvxCellHorJustify) (static_cast<const SvxHorJustifyItem*>(pCurData->GetItem(nFmtIndex, ATTR_HOR_JUSTIFY))->GetValue()) : static_cast<const SvxHorJustifyItem*>(pCurData->GetItem(nFmtIndex, ATTR_HOR_JUSTIFY))->GetValue() :
SvxCellHorJustify::Standard; SvxCellHorJustify::Standard;
if (pCurData->GetIncludeFont()) if (pCurData->GetIncludeFont())

View File

@ -270,7 +270,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate(
if(eState >= SfxItemState::DEFAULT && pState && dynamic_cast<const SvxHorJustifyItem*>( pState) != nullptr ) if(eState >= SfxItemState::DEFAULT && pState && dynamic_cast<const SvxHorJustifyItem*>( pState) != nullptr )
{ {
const SvxHorJustifyItem* pItem = static_cast<const SvxHorJustifyItem*>(pState); const SvxHorJustifyItem* pItem = static_cast<const SvxHorJustifyItem*>(pState);
meHorAlignState = (SvxCellHorJustify)pItem->GetValue(); meHorAlignState = pItem->GetValue();
} }
if( meHorAlignState == SvxCellHorJustify::Repeat ) if( meHorAlignState == SvxCellHorJustify::Repeat )
@ -359,7 +359,7 @@ void AlignmentPropertyPanel::NotifyItemUpdate(
if( eState >= SfxItemState::DEFAULT) if( eState >= SfxItemState::DEFAULT)
{ {
const SvxRotateModeItem* pItem = static_cast<const SvxRotateModeItem*>(pState); const SvxRotateModeItem* pItem = static_cast<const SvxRotateModeItem*>(pState);
SvxRotateMode eMode = (SvxRotateMode)pItem->GetValue(); SvxRotateMode eMode = pItem->GetValue();
if(eMode == SVX_ROTATE_MODE_BOTTOM) if(eMode == SVX_ROTATE_MODE_BOTTOM)
{ {
mpRefEdgeBottom->SetState(true); mpRefEdgeBottom->SetState(true);

View File

@ -1347,14 +1347,14 @@ void ScFormatShell::ExecuteAlignment( SfxRequest& rReq )
case SID_H_ALIGNCELL: case SID_H_ALIGNCELL:
{ {
SvxCellHorJustify eJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem*>(pItem)->GetValue(); SvxCellHorJustify eJust = static_cast<const SvxHorJustifyItem*>(pItem)->GetValue();
// #i78476# update alignment of text in cell edit mode // #i78476# update alignment of text in cell edit mode
pTabViewShell->UpdateInputHandlerCellAdjust( eJust ); pTabViewShell->UpdateInputHandlerCellAdjust( eJust );
pTabViewShell->ApplyAttr( SvxHorJustifyItem( eJust, ATTR_HOR_JUSTIFY ) ); pTabViewShell->ApplyAttr( SvxHorJustifyItem( eJust, ATTR_HOR_JUSTIFY ) );
} }
break; break;
case SID_V_ALIGNCELL: case SID_V_ALIGNCELL:
pTabViewShell->ApplyAttr( SvxVerJustifyItem( (SvxCellVerJustify)static_cast<const SvxVerJustifyItem*>(pItem)->GetValue(), ATTR_VER_JUSTIFY ) ); pTabViewShell->ApplyAttr( SvxVerJustifyItem( static_cast<const SvxVerJustifyItem*>(pItem)->GetValue(), ATTR_VER_JUSTIFY ) );
break; break;
default: default:
OSL_FAIL( "ExecuteAlignment: invalid slot" ); OSL_FAIL( "ExecuteAlignment: invalid slot" );
@ -2443,12 +2443,12 @@ void ScFormatShell::GetAlignState( SfxItemSet& rSet )
SvxCellHorJustify eHAlign = SvxCellHorJustify::Standard; SvxCellHorJustify eHAlign = SvxCellHorJustify::Standard;
bool bHasHAlign = rAttrSet.GetItemState( ATTR_HOR_JUSTIFY ) != SfxItemState::DONTCARE; bool bHasHAlign = rAttrSet.GetItemState( ATTR_HOR_JUSTIFY ) != SfxItemState::DONTCARE;
if( bHasHAlign ) if( bHasHAlign )
eHAlign = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>(rAttrSet.Get( ATTR_HOR_JUSTIFY )).GetValue(); eHAlign = static_cast<const SvxHorJustifyItem&>(rAttrSet.Get( ATTR_HOR_JUSTIFY )).GetValue();
SvxCellVerJustify eVAlign = SVX_VER_JUSTIFY_STANDARD; SvxCellVerJustify eVAlign = SVX_VER_JUSTIFY_STANDARD;
bool bHasVAlign = rAttrSet.GetItemState( ATTR_VER_JUSTIFY ) != SfxItemState::DONTCARE; bool bHasVAlign = rAttrSet.GetItemState( ATTR_VER_JUSTIFY ) != SfxItemState::DONTCARE;
if( bHasVAlign ) if( bHasVAlign )
eVAlign = (SvxCellVerJustify)static_cast<const SvxVerJustifyItem&>(rAttrSet.Get( ATTR_VER_JUSTIFY )).GetValue(); eVAlign = static_cast<const SvxVerJustifyItem&>(rAttrSet.Get( ATTR_VER_JUSTIFY )).GetValue();
while ( nWhich ) while ( nWhich )
{ {

View File

@ -5078,9 +5078,9 @@ bool ScGridWindow::GetEditUrl( const Point& rPos,
return false; return false;
bool bBreak = static_cast<const SfxBoolItem&>(pPattern->GetItem(ATTR_LINEBREAK)).GetValue() || bool bBreak = static_cast<const SfxBoolItem&>(pPattern->GetItem(ATTR_LINEBREAK)).GetValue() ||
((SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>(pPattern-> (static_cast<const SvxHorJustifyItem&>(pPattern->
GetItem( ATTR_HOR_JUSTIFY )).GetValue() == SvxCellHorJustify::Block); GetItem( ATTR_HOR_JUSTIFY )).GetValue() == SvxCellHorJustify::Block);
SvxCellHorJustify eHorJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>(pPattern-> SvxCellHorJustify eHorJust = static_cast<const SvxHorJustifyItem&>(pPattern->
GetItem(ATTR_HOR_JUSTIFY)).GetValue(); GetItem(ATTR_HOR_JUSTIFY)).GetValue();
// EditEngine // EditEngine

View File

@ -656,7 +656,7 @@ void ScOutputData::SetCellRotations()
// add rotation info to Array information // add rotation info to Array information
const long nAttrRotate(pPattern->GetRotateVal(pCondSet)); const long nAttrRotate(pPattern->GetRotateVal(pCondSet));
const SvxRotateMode eRotMode((SvxRotateMode)static_cast<const SvxRotateModeItem&>(pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue()); const SvxRotateMode eRotMode(static_cast<const SvxRotateModeItem&>(pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue());
const double fOrient((bLayoutRTL ? -1.0 : 1.0) * nAttrRotate * F_PI18000); // 1/100th degrees -> [0..2PI] const double fOrient((bLayoutRTL ? -1.0 : 1.0) * nAttrRotate * F_PI18000); // 1/100th degrees -> [0..2PI]
svx::frame::Array& rArray = mrTabInfo.maArray; svx::frame::Array& rArray = mrTabInfo.maArray;
@ -678,7 +678,7 @@ static ScRotateDir lcl_GetRotateDir( const ScDocument* pDoc, SCCOL nCol, SCROW n
long nAttrRotate = pPattern->GetRotateVal( pCondSet ); long nAttrRotate = pPattern->GetRotateVal( pCondSet );
if ( nAttrRotate ) if ( nAttrRotate )
{ {
SvxRotateMode eRotMode = (SvxRotateMode)static_cast<const SvxRotateModeItem&>( SvxRotateMode eRotMode = static_cast<const SvxRotateModeItem&>(
pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue(); pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue();
if ( eRotMode == SVX_ROTATE_MODE_STANDARD ) if ( eRotMode == SVX_ROTATE_MODE_STANDARD )
@ -1548,7 +1548,7 @@ void ScOutputData::DrawRotatedFrame(vcl::RenderContext& rRenderContext)
//! LastPattern etc. //! LastPattern etc.
long nAttrRotate = pPattern->GetRotateVal( pCondSet ); long nAttrRotate = pPattern->GetRotateVal( pCondSet );
SvxRotateMode eRotMode = (SvxRotateMode)static_cast<const SvxRotateModeItem&>( SvxRotateMode eRotMode = static_cast<const SvxRotateModeItem&>(
pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue(); pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue();
if (nAttrRotate) if (nAttrRotate)

View File

@ -323,9 +323,9 @@ void ScDrawStringsVars::SetPattern(
// alignment // alignment
eAttrHorJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>(pPattern->GetItem( ATTR_HOR_JUSTIFY, pCondSet )).GetValue(); eAttrHorJust = static_cast<const SvxHorJustifyItem&>(pPattern->GetItem( ATTR_HOR_JUSTIFY, pCondSet )).GetValue();
eAttrVerJust = (SvxCellVerJustify)static_cast<const SvxVerJustifyItem&>(pPattern->GetItem( ATTR_VER_JUSTIFY, pCondSet )).GetValue(); eAttrVerJust = static_cast<const SvxVerJustifyItem&>(pPattern->GetItem( ATTR_VER_JUSTIFY, pCondSet )).GetValue();
if ( eAttrVerJust == SVX_VER_JUSTIFY_STANDARD ) if ( eAttrVerJust == SVX_VER_JUSTIFY_STANDARD )
eAttrVerJust = SVX_VER_JUSTIFY_BOTTOM; eAttrVerJust = SVX_VER_JUSTIFY_BOTTOM;
@ -4721,7 +4721,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
long nCellWidth = (long) pRowInfo[0].pCellInfo[nX+1].nWidth; long nCellWidth = (long) pRowInfo[0].pCellInfo[nX+1].nWidth;
SvxCellHorJustify eHorJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>( SvxCellHorJustify eHorJust = static_cast<const SvxHorJustifyItem&>(
pPattern->GetItem(ATTR_HOR_JUSTIFY, pCondSet)).GetValue(); pPattern->GetItem(ATTR_HOR_JUSTIFY, pCondSet)).GetValue();
bool bBreak = ( eHorJust == SvxCellHorJustify::Block ) || bool bBreak = ( eHorJust == SvxCellHorJustify::Block ) ||
static_cast<const SfxBoolItem&>(pPattern->GetItem(ATTR_LINEBREAK, pCondSet)).GetValue(); static_cast<const SfxBoolItem&>(pPattern->GetItem(ATTR_LINEBREAK, pCondSet)).GetValue();
@ -4769,7 +4769,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
nOutHeight += (long) mpDoc->GetScaledRowHeight( nY+1, nY+nCountY-1, nTab, mnPPTY); nOutHeight += (long) mpDoc->GetScaledRowHeight( nY+1, nY+nCountY-1, nTab, mnPPTY);
} }
SvxCellVerJustify eVerJust = (SvxCellVerJustify)static_cast<const SvxVerJustifyItem&>( SvxCellVerJustify eVerJust = static_cast<const SvxVerJustifyItem&>(
pPattern->GetItem(ATTR_VER_JUSTIFY, pCondSet)).GetValue(); pPattern->GetItem(ATTR_VER_JUSTIFY, pCondSet)).GetValue();
// syntax mode is ignored here... // syntax mode is ignored here...
@ -4848,7 +4848,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
GetItem(ATTR_ROTATE_VALUE, pCondSet)).GetValue(); GetItem(ATTR_ROTATE_VALUE, pCondSet)).GetValue();
if ( nAttrRotate ) if ( nAttrRotate )
{ {
eRotMode = (SvxRotateMode)static_cast<const SvxRotateModeItem&>( eRotMode = static_cast<const SvxRotateModeItem&>(
pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue(); pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue();
if ( nAttrRotate == 18000 ) if ( nAttrRotate == 18000 )

View File

@ -1050,7 +1050,7 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
bEditActive[eWhich] = true; bEditActive[eWhich] = true;
const ScPatternAttr* pPattern = pDoc->GetPattern( nNewX, nNewY, nTabNo ); const ScPatternAttr* pPattern = pDoc->GetPattern( nNewX, nNewY, nTabNo );
SvxCellHorJustify eJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>( SvxCellHorJustify eJust = static_cast<const SvxHorJustifyItem&>(
pPattern->GetItem( ATTR_HOR_JUSTIFY )).GetValue(); pPattern->GetItem( ATTR_HOR_JUSTIFY )).GetValue();
bool bBreak = ( eJust == SvxCellHorJustify::Block ) || bool bBreak = ( eJust == SvxCellHorJustify::Block ) ||
@ -1256,7 +1256,7 @@ void ScViewData::EditGrowX()
// get bGrow... variables the same way as in SetEditEngine // get bGrow... variables the same way as in SetEditEngine
const ScPatternAttr* pPattern = pLocalDoc->GetPattern( nEditCol, nEditRow, nTabNo ); const ScPatternAttr* pPattern = pLocalDoc->GetPattern( nEditCol, nEditRow, nTabNo );
SvxCellHorJustify eJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>( SvxCellHorJustify eJust = static_cast<const SvxHorJustifyItem&>(
pPattern->GetItem( ATTR_HOR_JUSTIFY )).GetValue(); pPattern->GetItem( ATTR_HOR_JUSTIFY )).GetValue();
bool bGrowCentered = ( eJust == SvxCellHorJustify::Center ); bool bGrowCentered = ( eJust == SvxCellHorJustify::Center );
bool bGrowToLeft = ( eJust == SvxCellHorJustify::Right ); // visual left bool bGrowToLeft = ( eJust == SvxCellHorJustify::Right ); // visual left

View File

@ -3202,7 +3202,7 @@ void DrawViewShell::GetStatePropPanelAttr(SfxItemSet& rSet)
//if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState) //if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState)
if(SfxItemState::DONTCARE != eVState) if(SfxItemState::DONTCARE != eVState)
{ {
SdrTextVertAdjust eTVA = (SdrTextVertAdjust)static_cast<const SdrTextVertAdjustItem&>(aAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); SdrTextVertAdjust eTVA = static_cast<const SdrTextVertAdjustItem&>(aAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
bool bSet = (nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP) || bool bSet = (nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP) ||
(nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER) || (nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER) ||
(nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM); (nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM);

View File

@ -197,19 +197,19 @@ void HTMLOption::GetColor( Color& rColor ) const
HTMLInputType HTMLOption::GetInputType() const HTMLInputType HTMLOption::GetInputType() const
{ {
DBG_ASSERT( nToken==HtmlOptionId::TYPE, "GetInputType: Option not TYPE" ); DBG_ASSERT( nToken==HtmlOptionId::TYPE, "GetInputType: Option not TYPE" );
return (HTMLInputType)GetEnum( aInputTypeOptEnums, HTMLInputType::Text ); return GetEnum( aInputTypeOptEnums, HTMLInputType::Text );
} }
HTMLTableFrame HTMLOption::GetTableFrame() const HTMLTableFrame HTMLOption::GetTableFrame() const
{ {
DBG_ASSERT( nToken==HtmlOptionId::FRAME, "GetTableFrame: Option not FRAME" ); DBG_ASSERT( nToken==HtmlOptionId::FRAME, "GetTableFrame: Option not FRAME" );
return (HTMLTableFrame)GetEnum( aTableFrameOptEnums ); return GetEnum( aTableFrameOptEnums );
} }
HTMLTableRules HTMLOption::GetTableRules() const HTMLTableRules HTMLOption::GetTableRules() const
{ {
DBG_ASSERT( nToken==HtmlOptionId::RULES, "GetTableRules: Option not RULES" ); DBG_ASSERT( nToken==HtmlOptionId::RULES, "GetTableRules: Option not RULES" );
return (HTMLTableRules)GetEnum( aTableRulesOptEnums ); return GetEnum( aTableRulesOptEnums );
} }
HTMLParser::HTMLParser( SvStream& rIn, bool bReadNewDoc ) : HTMLParser::HTMLParser( SvStream& rIn, bool bReadNewDoc ) :

View File

@ -1013,7 +1013,7 @@ void SvxFontPrevWindow::SetFromItemSet(const SfxItemSet &rSet, bool bPreviewBack
if( GetWhich( rSet, SID_ATTR_CHAR_CASEMAP, nWhich ) ) if( GetWhich( rSet, SID_ATTR_CHAR_CASEMAP, nWhich ) )
{ {
const SvxCaseMapItem& rItem = static_cast<const SvxCaseMapItem&>( rSet.Get( nWhich ) ); const SvxCaseMapItem& rItem = static_cast<const SvxCaseMapItem&>( rSet.Get( nWhich ) );
SvxCaseMap eCaseMap = ( SvxCaseMap ) rItem.GetValue(); SvxCaseMap eCaseMap = rItem.GetValue();
rFont.SetCaseMap( eCaseMap ); rFont.SetCaseMap( eCaseMap );
rCJKFont.SetCaseMap( eCaseMap ); rCJKFont.SetCaseMap( eCaseMap );
// #i78474# small caps do not exist in CTL fonts // #i78474# small caps do not exist in CTL fonts
@ -1255,7 +1255,7 @@ void SvxFontPrevWindow::Init(const SfxItemSet& rSet)
if( ISITEMSET ) if( ISITEMSET )
{ {
const SvxCaseMapItem& rItem = static_cast<const SvxCaseMapItem&>( rSet.Get( nWhich ) ); const SvxCaseMapItem& rItem = static_cast<const SvxCaseMapItem&>( rSet.Get( nWhich ) );
SvxCaseMap eCaseMap = ( SvxCaseMap ) rItem.GetValue(); SvxCaseMap eCaseMap = rItem.GetValue();
rFont.SetCaseMap( eCaseMap ); rFont.SetCaseMap( eCaseMap );
rCJKFont.SetCaseMap( eCaseMap ); rCJKFont.SetCaseMap( eCaseMap );
// #i78474# small caps do not exist in CTL fonts // #i78474# small caps do not exist in CTL fonts

View File

@ -82,7 +82,7 @@ bool SvxOrientationItem::GetPresentation
bool SvxOrientationItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const bool SvxOrientationItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
{ {
table::CellOrientation eUno = table::CellOrientation_STANDARD; table::CellOrientation eUno = table::CellOrientation_STANDARD;
switch ( (SvxCellOrientation)GetValue() ) switch ( GetValue() )
{ {
case SvxCellOrientation::Standard: eUno = table::CellOrientation_STANDARD; break; case SvxCellOrientation::Standard: eUno = table::CellOrientation_STANDARD; break;
case SvxCellOrientation::TopBottom: eUno = table::CellOrientation_TOPBOTTOM; break; case SvxCellOrientation::TopBottom: eUno = table::CellOrientation_TOPBOTTOM; break;

View File

@ -104,7 +104,7 @@ sal_uInt16 SvxRotateModeItem::GetVersion( sal_uInt16 /*nFileVersion*/ ) const
bool SvxRotateModeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const bool SvxRotateModeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
{ {
sal_Int32 nUno = table::CellVertJustify2::STANDARD; sal_Int32 nUno = table::CellVertJustify2::STANDARD;
switch ( (SvxRotateMode)GetValue() ) switch ( GetValue() )
{ {
case SVX_ROTATE_MODE_STANDARD: nUno = table::CellVertJustify2::STANDARD; break; case SVX_ROTATE_MODE_STANDARD: nUno = table::CellVertJustify2::STANDARD; break;
case SVX_ROTATE_MODE_TOP: nUno = table::CellVertJustify2::TOP; break; case SVX_ROTATE_MODE_TOP: nUno = table::CellVertJustify2::TOP; break;

View File

@ -1020,7 +1020,7 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA,
{ {
const SwAttrSet& rSet = GetSwAttrSet(); const SwAttrSet& rSet = GetSwAttrSet();
rGA.SetDrawMode( (GraphicDrawMode)rSet.GetDrawModeGrf().GetValue() ); rGA.SetDrawMode( rSet.GetDrawModeGrf().GetValue() );
const SwMirrorGrf & rMirror = rSet.GetMirrorGrf(); const SwMirrorGrf & rMirror = rSet.GetMirrorGrf();
BmpMirrorFlags nMirror = BmpMirrorFlags::NONE; BmpMirrorFlags nMirror = BmpMirrorFlags::NONE;

View File

@ -855,7 +855,7 @@ void SwDrawTextShell::GetStatePropPanelAttr(SfxItemSet &rSet)
//if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState) //if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState)
if(SfxItemState::DONTCARE != eVState) if(SfxItemState::DONTCARE != eVState)
{ {
SdrTextVertAdjust eTVA = (SdrTextVertAdjust)static_cast<const SdrTextVertAdjustItem&>(aAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); SdrTextVertAdjust eTVA = static_cast<const SdrTextVertAdjustItem&>(aAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
bool bSet = (nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP) || bool bSet = (nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP) ||
(nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER) || (nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER) ||
(nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM); (nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM);

View File

@ -796,15 +796,15 @@ void NeonSession::Init()
// set the timeout (in seconds) used when making a connection // set the timeout (in seconds) used when making a connection
sal_Int32 nConnectTimeout = officecfg::Inet::Settings::ConnectTimeout::get( rContext ); sal_Int32 nConnectTimeout = officecfg::Inet::Settings::ConnectTimeout::get( rContext );
ne_set_connect_timeout( m_pHttpSession, ne_set_connect_timeout( m_pHttpSession,
(int) ( std::max( nConnectTimeoutMin, std::max( nConnectTimeoutMin,
std::min( nConnectTimeout, nConnectTimeoutMax ) ) ) ); std::min( nConnectTimeout, nConnectTimeoutMax ) ) );
// provides a read time out facility as well // provides a read time out facility as well
// set the timeout (in seconds) used when reading from a socket. // set the timeout (in seconds) used when reading from a socket.
sal_Int32 nReadTimeout = officecfg::Inet::Settings::ReadTimeout::get( rContext ); sal_Int32 nReadTimeout = officecfg::Inet::Settings::ReadTimeout::get( rContext );
ne_set_read_timeout( m_pHttpSession, ne_set_read_timeout( m_pHttpSession,
(int) ( std::max( nReadTimeoutMin, std::max( nReadTimeoutMin,
std::min( nReadTimeout, nReadTimeoutMax ) ) ) ); std::min( nReadTimeout, nReadTimeoutMax ) ) );
} }
} }