diff options
-rw-r--r-- | cui/source/tabpages/page.cxx | 6 | ||||
-rw-r--r-- | cui/source/tabpages/paragrph.cxx | 2 | ||||
-rw-r--r-- | editeng/source/items/frmitems.cxx | 14 | ||||
-rw-r--r-- | include/editeng/frmdiritem.hxx | 9 | ||||
-rw-r--r-- | include/svx/frmdirlbox.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 2 | ||||
-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 |
11 files changed, 34 insertions, 31 deletions
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index 81b367bfeeb1..d85c1aa62a8e 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -649,10 +649,10 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) true, &pItem ); if( SfxItemState::UNKNOWN != eState ) { - sal_uInt32 nVal = SfxItemState::SET == eState + SvxFrameDirection nVal = SfxItemState::SET == eState ? static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue() - : 0; - m_pTextFlowBox->SelectEntryValue( static_cast< SvxFrameDirection >( nVal ) ); + : FRMDIR_HORI_LEFT_TOP; + m_pTextFlowBox->SelectEntryValue(nVal); m_pTextFlowBox->SaveValue(); m_pBspWin->SetFrameDirection(nVal); diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 63876219713c..e92a056b512f 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -1259,7 +1259,7 @@ void SvxParaAlignTabPage::Reset( const SfxItemSet* rSet ) if( SfxItemState::DEFAULT <= rSet->GetItemState( _nWhich ) ) { const SvxFrameDirectionItem& rFrameDirItem = static_cast<const SvxFrameDirectionItem&>( rSet->Get( _nWhich ) ); - m_pTextDirectionLB->SelectEntryValue( (SvxFrameDirection)rFrameDirItem.GetValue() ); + m_pTextDirectionLB->SelectEntryValue( rFrameDirItem.GetValue() ); m_pTextDirectionLB->SaveValue(); } diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index b10159ba64c6..7e01d0c42418 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -4041,7 +4041,7 @@ void SvxBrushItem::dumpAsXml(xmlTextWriterPtr pWriter) const SvxFrameDirectionItem::SvxFrameDirectionItem( SvxFrameDirection nValue , sal_uInt16 _nWhich ) - : SfxUInt16Item( _nWhich, (sal_uInt16)nValue ) + : SfxEnumItem<SvxFrameDirection>( _nWhich, nValue ) { } @@ -4069,15 +4069,7 @@ SfxPoolItem* SvxFrameDirectionItem::Create( SvStream & rStrm, sal_uInt16 /*nVer* { sal_uInt16 nValue; rStrm.ReadUInt16( nValue ); - return new SvxFrameDirectionItem( (SvxFrameDirection)nValue, Which() ); -} - - -SvStream& SvxFrameDirectionItem::Store( SvStream & rStrm, sal_uInt16 /*nIVer*/ ) const -{ - sal_uInt16 nValue = GetValue(); - rStrm.WriteUInt16( nValue ); - return rStrm; + return new SvxFrameDirectionItem( static_cast<SvxFrameDirection>(nValue), Which() ); } @@ -4093,7 +4085,7 @@ bool SvxFrameDirectionItem::GetPresentation( MapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper *) const { - rText = EE_RESSTR( RID_SVXITEMS_FRMDIR_BEGIN + GetValue() ); + rText = EE_RESSTR( RID_SVXITEMS_FRMDIR_BEGIN + GetEnumValue() ); return true; } diff --git a/include/editeng/frmdiritem.hxx b/include/editeng/frmdiritem.hxx index c1b6b36134fb..949b151d5a62 100644 --- a/include/editeng/frmdiritem.hxx +++ b/include/editeng/frmdiritem.hxx @@ -19,7 +19,7 @@ #ifndef INCLUDED_EDITENG_FRMDIRITEM_HXX #define INCLUDED_EDITENG_FRMDIRITEM_HXX -#include <svl/intitem.hxx> +#include <svl/eitem.hxx> #include <editeng/frmdir.hxx> #include <editeng/editengdllapi.h> @@ -32,7 +32,7 @@ layout text for Western, CJK and CTL languages. */ -class EDITENG_DLLPUBLIC SvxFrameDirectionItem : public SfxUInt16Item +class EDITENG_DLLPUBLIC SvxFrameDirectionItem : public SfxEnumItem<SvxFrameDirection> { public: SvxFrameDirectionItem( SvxFrameDirection nValue /*= FRMDIR_HORI_LEFT_TOP*/, @@ -41,7 +41,6 @@ public: virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const override; - virtual SvStream& Store(SvStream & rStrm, sal_uInt16 nIVer) const override; virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const override; virtual bool operator==( const SfxPoolItem& ) const override; @@ -54,6 +53,10 @@ public: virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + virtual sal_uInt16 GetValueCount() const override + { + return FRMDIR_ENVIRONMENT + 1; + } SvxFrameDirectionItem& operator=( const SvxFrameDirectionItem& rItem ) { SetValue( rItem.GetValue() ); diff --git a/include/svx/frmdirlbox.hxx b/include/svx/frmdirlbox.hxx index 18989a121ca4..8f2a5c191f12 100644 --- a/include/svx/frmdirlbox.hxx +++ b/include/svx/frmdirlbox.hxx @@ -76,7 +76,7 @@ public: }; /** Wrapper for usage of a SvxFrameDirectionItem in item connections. */ -typedef sfx::ValueItemWrapper< SvxFrameDirectionItem, SvxFrameDirection, sal_uInt16 > FrameDirItemWrapper; +typedef sfx::ValueItemWrapper< SvxFrameDirectionItem, SvxFrameDirection > FrameDirItemWrapper; /** An item<->control connection for a FrameDirectionListBox. */ typedef sfx::ItemControlConnection< FrameDirItemWrapper, FrameDirListBoxWrapper > FrameDirListBoxConnection; diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index ca9098978f74..2a0984239648 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -1488,7 +1488,7 @@ bool XclExpCellAlign::FillFromItemSet( bUsed |= ScfTools::CheckItem( rItemSet, ATTR_SHRINKTOFIT, bStyle ); // CTL text direction - SetScFrameDir( GETITEMVALUE( rItemSet, SvxFrameDirectionItem, ATTR_WRITINGDIR, SvxFrameDirection ) ); + SetScFrameDir(GETITEM( rItemSet, SvxFrameDirectionItem, ATTR_WRITINGDIR ).GetValue()); bUsed |= ScfTools::CheckItem( rItemSet, ATTR_WRITINGDIR, bStyle ); SAL_FALLTHROUGH; 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) { |