diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-03-14 08:00:33 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-14 07:58:49 +0000 |
commit | 250995d2b8d8ad544110d3daeb2f61089bff0aa5 (patch) | |
tree | e67d3f5685831ec6207d78ab0bcdfc0dab7a4c4a /sw | |
parent | a09fc7dd097357b60931739b6ed281a0b931aa73 (diff) |
change SvxFrameDirectionItem base to SfxEnumItem
Change-Id: I82f01d0e3e4bf15ed6ba435406ae63b7c9110091
Reviewed-on: https://gerrit.libreoffice.org/35160
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docdraw.cxx | 9 | ||||
-rw-r--r-- | sw/source/ui/table/tabledlg.cxx | 15 | ||||
-rw-r--r-- | sw/source/uibase/shells/annotsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwtxtex.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/txtattr.cxx | 2 |
5 files changed, 19 insertions, 11 deletions
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index fad1edbe5a10..97ae882fb448 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -109,9 +109,9 @@ static void lcl_AdjustPositioningAttr( SwDrawFrameFormat* _pFrameFormat, aAnchorPos = _rSdrObj.GetAnchorPos(); // If no anchor frame exist - e.g. because no layout exists - the // default layout direction is taken. - const SvxFrameDirectionItem* pDirItem = - static_cast<const SvxFrameDirectionItem*>(&(_pFrameFormat->GetAttrSet().GetPool()->GetDefaultItem( RES_FRAMEDIR ))); - switch ( pDirItem->GetValue() ) + const SvxFrameDirectionItem& rDirItem = + static_cast<const SvxFrameDirectionItem&>(_pFrameFormat->GetAttrSet().GetPool()->GetDefaultItem( RES_FRAMEDIR )); + switch ( rDirItem.GetValue() ) { case FRMDIR_VERT_TOP_LEFT: { @@ -142,6 +142,9 @@ static void lcl_AdjustPositioningAttr( SwDrawFrameFormat* _pFrameFormat, bR2L = false; } break; + case FRMDIR_ENVIRONMENT: + SAL_WARN("sw.core", "lcl_AdjustPositioningAttr(..) FRMDIR_ENVIRONMENT not supported"); + break; } } diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index a2c73a8c452e..b06f51ab5188 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -438,9 +438,9 @@ bool SwFormatTablePage::FillItemSet( SfxItemSet* rCoreSet ) const sal_Int32 nPos = m_pTextDirectionLB->GetSelectEntryPos(); if ( m_pTextDirectionLB->IsValueChangedFromSaved() ) { - const sal_uInt32 nDirection = - (sal_uInt32)reinterpret_cast<sal_uIntPtr>(m_pTextDirectionLB->GetEntryData( nPos )); - rCoreSet->Put( SvxFrameDirectionItem( (SvxFrameDirection)nDirection, RES_FRAMEDIR)); + SvxFrameDirection nDirection = static_cast<SvxFrameDirection>( + reinterpret_cast<sal_IntPtr>(m_pTextDirectionLB->GetEntryData( nPos ))); + rCoreSet->Put( SvxFrameDirectionItem( nDirection, RES_FRAMEDIR)); bModified = true; } } @@ -580,7 +580,7 @@ void SwFormatTablePage::Reset( const SfxItemSet* ) //Text direction if( SfxItemState::SET == rSet.GetItemState( RES_FRAMEDIR, true, &pItem ) ) { - sal_uIntPtr nVal = static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue(); + SvxFrameDirection nVal = static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue(); const sal_Int32 nPos = m_pTextDirectionLB->GetEntryPos( reinterpret_cast<void*>(nVal) ); m_pTextDirectionLB->SelectEntryPos( nPos ); m_pTextDirectionLB->SaveValue(); @@ -1457,8 +1457,8 @@ bool SwTextFlowPage::FillItemSet( SfxItemSet* rSet ) if(m_pTextDirectionLB->IsValueChangedFromSaved()) { bModified |= nullptr != rSet->Put( - SvxFrameDirectionItem( - (SvxFrameDirection)reinterpret_cast<sal_uLong>(m_pTextDirectionLB->GetSelectEntryData()) + SvxFrameDirectionItem( static_cast<SvxFrameDirection>( + reinterpret_cast<sal_IntPtr>(m_pTextDirectionLB->GetSelectEntryData())) , FN_TABLE_BOX_TEXTORIENTATION)); } @@ -1646,7 +1646,8 @@ void SwTextFlowPage::Reset( const SfxItemSet* rSet ) } if ( rSet->GetItemState(FN_TABLE_BOX_TEXTORIENTATION) > SfxItemState::DEFAULT ) { - sal_uLong nDirection = static_cast<const SvxFrameDirectionItem&>(rSet->Get(FN_TABLE_BOX_TEXTORIENTATION)).GetValue(); + SvxFrameDirection nDirection = + static_cast<const SvxFrameDirectionItem&>(rSet->Get(FN_TABLE_BOX_TEXTORIENTATION)).GetValue(); m_pTextDirectionLB->SelectEntryPos(m_pTextDirectionLB->GetEntryPos( reinterpret_cast<void*>(nDirection) )); } diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index df7ce705bf7e..4bf14b35c692 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -833,6 +833,8 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) rSet.Put( SfxBoolItem( nWhich, bFlag )); break; } + default: + break; } } } diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 8cdfebd4bea8..cade0dfd07bc 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -822,6 +822,8 @@ ASK_ESCAPE: case FRMDIR_HORI_RIGHT_TOP: bFlag = nWhich != SID_ATTR_PARA_LEFT_TO_RIGHT; break; + default: + break; } } } diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index 1de085853431..b0f753760721 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -747,7 +747,7 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) if((!(nHtmlMode & HTMLMODE_ON) || (0 != (nHtmlMode & HTMLMODE_SOME_STYLES))) && aCoreSet.GetItemState( RES_FRAMEDIR, false ) >= SfxItemState::DEFAULT) { - SvxFrameDirection eFrameDir = (SvxFrameDirection) + SvxFrameDirection eFrameDir = static_cast<const SvxFrameDirectionItem& >(aCoreSet.Get(RES_FRAMEDIR)).GetValue(); if (FRMDIR_ENVIRONMENT == eFrameDir) { |