From 07f355c95d7e317ce3878b88d87ac82f20f58ab7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 24 Aug 2016 10:40:02 +0200 Subject: [PATCH] convert FrameBorderType to scoped enum Change-Id: I089a981d1d33e15460d66b30ee2b9a91081da781 --- cui/source/tabpages/border.cxx | 68 ++++----- include/svx/framebordertype.hxx | 22 +-- .../accessibility/AccessibleFrameSelector.cxx | 30 ++-- svx/source/dialog/frmsel.cxx | 132 +++++++++--------- 4 files changed, 126 insertions(+), 126 deletions(-) diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index 9653c93a7a1c..baf52c3c3d23 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -335,10 +335,10 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore if( mbUseMarginItem ) AddItemConnection( svx::CreateMarginConnection( rCoreAttrs, *m_pLeftMF, *m_pRightMF, *m_pTopMF, *m_pBottomMF ) ); - if( m_pFrameSel->IsBorderEnabled( svx::FRAMEBORDER_TLBR ) ) - AddItemConnection( svx::CreateFrameLineConnection( SID_ATTR_BORDER_DIAG_TLBR, *m_pFrameSel, svx::FRAMEBORDER_TLBR ) ); - if( m_pFrameSel->IsBorderEnabled( svx::FRAMEBORDER_BLTR ) ) - AddItemConnection( svx::CreateFrameLineConnection( SID_ATTR_BORDER_DIAG_BLTR, *m_pFrameSel, svx::FRAMEBORDER_BLTR ) ); + if( m_pFrameSel->IsBorderEnabled( svx::FrameBorderType::TLBR ) ) + AddItemConnection( svx::CreateFrameLineConnection( SID_ATTR_BORDER_DIAG_TLBR, *m_pFrameSel, svx::FrameBorderType::TLBR ) ); + if( m_pFrameSel->IsBorderEnabled( svx::FrameBorderType::BLTR ) ) + AddItemConnection( svx::CreateFrameLineConnection( SID_ATTR_BORDER_DIAG_BLTR, *m_pFrameSel, svx::FrameBorderType::BLTR ) ); // #i43593# - item connection doesn't work for Writer, // because the Writer item sets contain these items // checkbox "Merge with next paragraph" only visible for Writer dialog format.paragraph @@ -444,12 +444,12 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet ) if ( pBoxItem && pBoxInfoItem ) // -> Don't Care { - ResetFrameLine_Impl( svx::FRAMEBORDER_LEFT, pBoxItem->GetLeft(), pBoxInfoItem->IsValid( SvxBoxInfoItemValidFlags::LEFT ) ); - ResetFrameLine_Impl( svx::FRAMEBORDER_RIGHT, pBoxItem->GetRight(), pBoxInfoItem->IsValid( SvxBoxInfoItemValidFlags::RIGHT ) ); - ResetFrameLine_Impl( svx::FRAMEBORDER_TOP, pBoxItem->GetTop(), pBoxInfoItem->IsValid( SvxBoxInfoItemValidFlags::TOP ) ); - ResetFrameLine_Impl( svx::FRAMEBORDER_BOTTOM, pBoxItem->GetBottom(), pBoxInfoItem->IsValid( SvxBoxInfoItemValidFlags::BOTTOM ) ); - ResetFrameLine_Impl( svx::FRAMEBORDER_VER, pBoxInfoItem->GetVert(), pBoxInfoItem->IsValid( SvxBoxInfoItemValidFlags::VERT ) ); - ResetFrameLine_Impl( svx::FRAMEBORDER_HOR, pBoxInfoItem->GetHori(), pBoxInfoItem->IsValid( SvxBoxInfoItemValidFlags::HORI ) ); + ResetFrameLine_Impl( svx::FrameBorderType::Left, pBoxItem->GetLeft(), pBoxInfoItem->IsValid( SvxBoxInfoItemValidFlags::LEFT ) ); + ResetFrameLine_Impl( svx::FrameBorderType::Right, pBoxItem->GetRight(), pBoxInfoItem->IsValid( SvxBoxInfoItemValidFlags::RIGHT ) ); + ResetFrameLine_Impl( svx::FrameBorderType::Top, pBoxItem->GetTop(), pBoxInfoItem->IsValid( SvxBoxInfoItemValidFlags::TOP ) ); + ResetFrameLine_Impl( svx::FrameBorderType::Bottom, pBoxItem->GetBottom(), pBoxInfoItem->IsValid( SvxBoxInfoItemValidFlags::BOTTOM ) ); + ResetFrameLine_Impl( svx::FrameBorderType::Vertical, pBoxInfoItem->GetVert(), pBoxInfoItem->IsValid( SvxBoxInfoItemValidFlags::VERT ) ); + ResetFrameLine_Impl( svx::FrameBorderType::Horizontal, pBoxInfoItem->GetHori(), pBoxInfoItem->IsValid( SvxBoxInfoItemValidFlags::HORI ) ); // distance inside @@ -669,10 +669,10 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs ) // outer border: ::std::pair eTypes1[] = { - { svx::FRAMEBORDER_TOP,SvxBoxItemLine::TOP }, - { svx::FRAMEBORDER_BOTTOM,SvxBoxItemLine::BOTTOM }, - { svx::FRAMEBORDER_LEFT,SvxBoxItemLine::LEFT }, - { svx::FRAMEBORDER_RIGHT,SvxBoxItemLine::RIGHT }, + { svx::FrameBorderType::Top,SvxBoxItemLine::TOP }, + { svx::FrameBorderType::Bottom,SvxBoxItemLine::BOTTOM }, + { svx::FrameBorderType::Left,SvxBoxItemLine::LEFT }, + { svx::FrameBorderType::Right,SvxBoxItemLine::RIGHT }, }; for (std::pair const & i : eTypes1) @@ -683,8 +683,8 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs ) // border hor/ver and TableFlag ::std::pair eTypes2[] = { - { svx::FRAMEBORDER_HOR,SvxBoxInfoItemLine::HORI }, - { svx::FRAMEBORDER_VER,SvxBoxInfoItemLine::VERT } + { svx::FrameBorderType::Horizontal,SvxBoxInfoItemLine::HORI }, + { svx::FrameBorderType::Vertical,SvxBoxInfoItemLine::VERT } }; for (std::pair const & j : eTypes2) aBoxInfoItem.SetLine( m_pFrameSel->GetFrameBorderStyle( j.first ), j.second ); @@ -709,10 +709,10 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs ) if ( ((mbHorEnabled || mbVerEnabled || (nSWMode & SwBorderModes::TABLE)) && (m_pLeftMF->IsModified()||m_pRightMF->IsModified()|| m_pTopMF->IsModified()||m_pBottomMF->IsModified()) )|| - m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_TOP ) != svx::FrameBorderState::Hide - || m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_BOTTOM ) != svx::FrameBorderState::Hide - || m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_LEFT ) != svx::FrameBorderState::Hide - || m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_RIGHT ) != svx::FrameBorderState::Hide ) + m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Top ) != svx::FrameBorderState::Hide + || m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Bottom ) != svx::FrameBorderState::Hide + || m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Left ) != svx::FrameBorderState::Hide + || m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Right ) != svx::FrameBorderState::Hide ) { const SvxBoxInfoItem* pOldBoxInfoItem = static_cast(GetOldItem( *rCoreAttrs, SID_ATTR_BORDER_INNER )); @@ -752,12 +752,12 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs ) // note Don't Care Status in the Info-Item: - aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::TOP, m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_TOP ) != svx::FrameBorderState::DontCare ); - aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::BOTTOM, m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_BOTTOM ) != svx::FrameBorderState::DontCare ); - aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::LEFT, m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_LEFT ) != svx::FrameBorderState::DontCare ); - aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::RIGHT, m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_RIGHT ) != svx::FrameBorderState::DontCare ); - aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::HORI, m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_HOR ) != svx::FrameBorderState::DontCare ); - aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::VERT, m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_VER ) != svx::FrameBorderState::DontCare ); + aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::TOP, m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Top ) != svx::FrameBorderState::DontCare ); + aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::BOTTOM, m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Bottom ) != svx::FrameBorderState::DontCare ); + aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::LEFT, m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Left ) != svx::FrameBorderState::DontCare ); + aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::RIGHT, m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Right ) != svx::FrameBorderState::DontCare ); + aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::HORI, m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Horizontal ) != svx::FrameBorderState::DontCare ); + aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::VERT, m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Vertical ) != svx::FrameBorderState::DontCare ); // Put or Clear of the border? @@ -1180,10 +1180,10 @@ IMPL_LINK_NOARG_TYPED(SvxBorderTabPage, LinesChanged_Impl, LinkParamNone*, void) { if(bLineSet) { - nValid = (m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_TOP) == svx::FrameBorderState::Show) ? SvxBoxInfoItemValidFlags::TOP : SvxBoxInfoItemValidFlags::NONE; - nValid |= (m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_BOTTOM) == svx::FrameBorderState::Show) ? SvxBoxInfoItemValidFlags::BOTTOM : SvxBoxInfoItemValidFlags::NONE; - nValid |= (m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_LEFT) == svx::FrameBorderState::Show) ? SvxBoxInfoItemValidFlags::LEFT : SvxBoxInfoItemValidFlags::NONE; - nValid |= (m_pFrameSel->GetFrameBorderState( svx::FRAMEBORDER_RIGHT ) == svx::FrameBorderState::Show) ? SvxBoxInfoItemValidFlags::RIGHT : SvxBoxInfoItemValidFlags::NONE; + nValid = (m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Top) == svx::FrameBorderState::Show) ? SvxBoxInfoItemValidFlags::TOP : SvxBoxInfoItemValidFlags::NONE; + nValid |= (m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Bottom) == svx::FrameBorderState::Show) ? SvxBoxInfoItemValidFlags::BOTTOM : SvxBoxInfoItemValidFlags::NONE; + nValid |= (m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Left) == svx::FrameBorderState::Show) ? SvxBoxInfoItemValidFlags::LEFT : SvxBoxInfoItemValidFlags::NONE; + nValid |= (m_pFrameSel->GetFrameBorderState( svx::FrameBorderType::Right ) == svx::FrameBorderState::Show) ? SvxBoxInfoItemValidFlags::RIGHT : SvxBoxInfoItemValidFlags::NONE; } else nValid = SvxBoxInfoItemValidFlags::NONE; @@ -1239,10 +1239,10 @@ void SvxBorderTabPage::UpdateRemoveAdjCellBorderCB( sal_uInt16 nPreset ) if( !pOldBoxInfoItem || !pOldBoxItem ) return; ::std::pair eTypes1[] = { - { svx::FRAMEBORDER_TOP,SvxBoxInfoItemValidFlags::TOP }, - { svx::FRAMEBORDER_BOTTOM,SvxBoxInfoItemValidFlags::BOTTOM }, - { svx::FRAMEBORDER_LEFT,SvxBoxInfoItemValidFlags::LEFT }, - { svx::FRAMEBORDER_RIGHT,SvxBoxInfoItemValidFlags::RIGHT }, + { svx::FrameBorderType::Top,SvxBoxInfoItemValidFlags::TOP }, + { svx::FrameBorderType::Bottom,SvxBoxInfoItemValidFlags::BOTTOM }, + { svx::FrameBorderType::Left,SvxBoxInfoItemValidFlags::LEFT }, + { svx::FrameBorderType::Right,SvxBoxInfoItemValidFlags::RIGHT }, }; SvxBoxItemLine eTypes2[] = { SvxBoxItemLine::TOP, diff --git a/include/svx/framebordertype.hxx b/include/svx/framebordertype.hxx index fa4385d246b6..2eda996062f1 100644 --- a/include/svx/framebordertype.hxx +++ b/include/svx/framebordertype.hxx @@ -26,20 +26,20 @@ namespace svx { /** Enumerates all borders a frame selection control can contain. */ -enum FrameBorderType +enum class FrameBorderType { - FRAMEBORDER_NONE, /// No border (special state). - FRAMEBORDER_LEFT, /// Left frame border. - FRAMEBORDER_RIGHT, /// Right frame border. - FRAMEBORDER_TOP, /// Top frame border. - FRAMEBORDER_BOTTOM, /// Bottom frame border. - FRAMEBORDER_HOR, /// Inner horizontal frame border. - FRAMEBORDER_VER, /// Inner vertical frame border. - FRAMEBORDER_TLBR, /// Top-left to bottom-right frame border. - FRAMEBORDER_BLTR /// Bottom-left to top-right frame border. + NONE, /// No border (special state). + Left, /// Left frame border. + Right, /// Right frame border. + Top, /// Top frame border. + Bottom, /// Bottom frame border. + Horizontal, /// Inner horizontal frame border. + Vertical, /// Inner vertical frame border. + TLBR, /// Top-left to bottom-right frame border. + BLTR /// Bottom-left to top-right frame border. }; -/** The number of valid frame border types (excluding FRAMEBORDER_NONE). */ +/** The number of valid frame border types (excluding FrameBorderType::NONE). */ const int FRAMEBORDERTYPE_COUNT = 8; /** Returns the frame border type from a 0-based integer index. */ diff --git a/svx/source/accessibility/AccessibleFrameSelector.cxx b/svx/source/accessibility/AccessibleFrameSelector.cxx index 55d6688aaf05..14032e30cddd 100644 --- a/svx/source/accessibility/AccessibleFrameSelector.cxx +++ b/svx/source/accessibility/AccessibleFrameSelector.cxx @@ -100,7 +100,7 @@ sal_Int32 AccFrameSelector::getAccessibleChildCount( ) throw (RuntimeException, { SolarMutexGuard aGuard; IsValid(); - return (meBorder == FRAMEBORDER_NONE) ? mpFrameSel->GetEnabledBorderCount() : 0; + return (meBorder == FrameBorderType::NONE) ? mpFrameSel->GetEnabledBorderCount() : 0; } Reference< XAccessible > AccFrameSelector::getAccessibleChild( sal_Int32 i ) @@ -109,7 +109,7 @@ Reference< XAccessible > AccFrameSelector::getAccessibleChild( sal_Int32 i ) SolarMutexGuard aGuard; IsValid(); Reference< XAccessible > xRet; - if( meBorder == FRAMEBORDER_NONE ) + if( meBorder == FrameBorderType::NONE ) xRet = mpFrameSel->GetChildAccessible( i ); if( !xRet.is() ) throw RuntimeException(); @@ -122,7 +122,7 @@ Reference< XAccessible > AccFrameSelector::getAccessibleParent( ) SolarMutexGuard aGuard; IsValid(); Reference< XAccessible > xRet; - if(meBorder == FRAMEBORDER_NONE) + if(meBorder == FrameBorderType::NONE) xRet = mpFrameSel->GetParent()->GetAccessible(); else xRet = mpFrameSel->CreateAccessible(); @@ -136,7 +136,7 @@ sal_Int32 AccFrameSelector::getAccessibleIndexInParent( ) IsValid(); sal_Int32 nIdx = 0; - if( meBorder == FRAMEBORDER_NONE ) + if( meBorder == FrameBorderType::NONE ) { vcl::Window* pTabPage = mpFrameSel->GetParent(); sal_Int32 nChildren = pTabPage->GetChildCount(); @@ -154,7 +154,7 @@ sal_Int32 AccFrameSelector::getAccessibleIndexInParent( ) sal_Int16 AccFrameSelector::getAccessibleRole( ) throw (RuntimeException, std::exception) { - return meBorder == FRAMEBORDER_NONE ? AccessibleRole::OPTION_PANE : AccessibleRole::CHECK_BOX; + return meBorder == FrameBorderType::NONE ? AccessibleRole::OPTION_PANE : AccessibleRole::CHECK_BOX; } OUString AccFrameSelector::getAccessibleDescription( ) @@ -162,7 +162,7 @@ OUString AccFrameSelector::getAccessibleDescription( ) { SolarMutexGuard aGuard; IsValid(); - return maDescriptions.GetString(meBorder); + return maDescriptions.GetString((sal_uInt32)meBorder); } OUString AccFrameSelector::getAccessibleName( ) @@ -170,7 +170,7 @@ OUString AccFrameSelector::getAccessibleName( ) { SolarMutexGuard aGuard; IsValid(); - return maNames.GetString(meBorder); + return maNames.GetString((sal_uInt32)meBorder); } Reference< XAccessibleRelationSet > AccFrameSelector::getAccessibleRelationSet( ) @@ -180,7 +180,7 @@ Reference< XAccessibleRelationSet > AccFrameSelector::getAccessibleRelationSet( IsValid(); utl::AccessibleRelationSetHelper* pHelper; Reference< XAccessibleRelationSet > xRet = pHelper = new utl::AccessibleRelationSetHelper; - if(meBorder == FRAMEBORDER_NONE) + if(meBorder == FrameBorderType::NONE) { //add the label relation vcl::Window *pLabeledBy = mpFrameSel->GetAccessibleRelationLabeledBy(); @@ -237,7 +237,7 @@ Reference< XAccessibleStateSet > AccFrameSelector::getAccessibleStateSet( ) pStateSetHelper->AddState(AccessibleStateType::SENSITIVE); } - bool bIsParent = meBorder == FRAMEBORDER_NONE; + bool bIsParent = meBorder == FrameBorderType::NONE; if(mpFrameSel->HasFocus() && (bIsParent || mpFrameSel->IsBorderSelected(meBorder))) { @@ -282,7 +282,7 @@ css::awt::Rectangle AccFrameSelector::getBounds( ) throw (RuntimeException, std Point aPos; switch(meBorder) { - case FRAMEBORDER_NONE: + case FrameBorderType::NONE: aSz = mpFrameSel->GetSizePixel(); aPos = mpFrameSel->GetPosPixel(); break; @@ -307,7 +307,7 @@ css::awt::Point AccFrameSelector::getLocation( ) throw (RuntimeException, std:: Point aPos; switch(meBorder) { - case FRAMEBORDER_NONE: + case FrameBorderType::NONE: aPos = mpFrameSel->GetPosPixel(); break; default: @@ -326,7 +326,7 @@ css::awt::Point AccFrameSelector::getLocationOnScreen( ) throw (RuntimeExceptio Point aPos; switch(meBorder) { - case FRAMEBORDER_NONE: + case FrameBorderType::NONE: aPos = mpFrameSel->GetPosPixel(); break; default: @@ -346,7 +346,7 @@ css::awt::Size AccFrameSelector::getSize( ) throw (RuntimeException, std::excep Size aSz; switch(meBorder) { - case FRAMEBORDER_NONE: + case FrameBorderType::NONE: aSz = mpFrameSel->GetSizePixel(); break; default: @@ -496,7 +496,7 @@ void AccFrameSelector::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent { case VCLEVENT_WINDOW_GETFOCUS: { - if ( meBorder == FRAMEBORDER_NONE ) + if ( meBorder == FrameBorderType::NONE ) { Any aOldValue, aNewValue; aNewValue <<= AccessibleStateType::FOCUSED; @@ -506,7 +506,7 @@ void AccFrameSelector::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent break; case VCLEVENT_WINDOW_LOSEFOCUS: { - if ( meBorder == FRAMEBORDER_NONE ) + if ( meBorder == FrameBorderType::NONE ) { Any aOldValue, aNewValue; aOldValue <<= AccessibleStateType::FOCUSED; diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index ce7cae62c853..1a2fe8a8c343 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -55,7 +55,7 @@ FrameBorderType GetFrameBorderTypeFromIndex( size_t nIndex ) size_t GetIndexFromFrameBorderType( FrameBorderType eBorder ) { - DBG_ASSERT( eBorder != FRAMEBORDER_NONE, + DBG_ASSERT( eBorder != FrameBorderType::NONE, "svx::GetIndexFromFrameBorderType - invalid frame border type" ); return static_cast< size_t >( eBorder ) - 1; } @@ -84,15 +84,15 @@ FrameSelFlags lclGetFlagFromType( FrameBorderType eBorder ) { switch( eBorder ) { - case FRAMEBORDER_LEFT: return FrameSelFlags::Left; - case FRAMEBORDER_RIGHT: return FrameSelFlags::Right; - case FRAMEBORDER_TOP: return FrameSelFlags::Top; - case FRAMEBORDER_BOTTOM: return FrameSelFlags::Bottom; - case FRAMEBORDER_HOR: return FrameSelFlags::InnerHorizontal; - case FRAMEBORDER_VER: return FrameSelFlags::InnerVertical; - case FRAMEBORDER_TLBR: return FrameSelFlags::DiagonalTLBR; - case FRAMEBORDER_BLTR: return FrameSelFlags::DiagonalBLTR; - case FRAMEBORDER_NONE : break; + case FrameBorderType::Left: return FrameSelFlags::Left; + case FrameBorderType::Right: return FrameSelFlags::Right; + case FrameBorderType::Top: return FrameSelFlags::Top; + case FrameBorderType::Bottom: return FrameSelFlags::Bottom; + case FrameBorderType::Horizontal: return FrameSelFlags::InnerHorizontal; + case FrameBorderType::Vertical: return FrameSelFlags::InnerVertical; + case FrameBorderType::TLBR: return FrameSelFlags::DiagonalTLBR; + case FrameBorderType::BLTR: return FrameSelFlags::DiagonalBLTR; + case FrameBorderType::NONE : break; } return FrameSelFlags::NONE; } @@ -109,10 +109,10 @@ inline void lclPolyPolyUnion( tools::PolyPolygon& rDest, const tools::PolyPolygo FrameBorder::FrameBorder( FrameBorderType eType ) : meType( eType ), meState( FrameBorderState::Hide ), - meKeyLeft( FRAMEBORDER_NONE ), - meKeyRight( FRAMEBORDER_NONE ), - meKeyTop( FRAMEBORDER_NONE ), - meKeyBottom( FRAMEBORDER_NONE ), + meKeyLeft( FrameBorderType::NONE ), + meKeyRight( FrameBorderType::NONE ), + meKeyTop( FrameBorderType::NONE ), + meKeyBottom( FrameBorderType::NONE ), mbEnabled( false ), mbSelected( false ) { @@ -192,7 +192,7 @@ void FrameBorder::SetKeyboardNeighbors( FrameBorderType FrameBorder::GetKeyboardNeighbor( sal_uInt16 nKeyCode ) const { - FrameBorderType eBorder = FRAMEBORDER_NONE; + FrameBorderType eBorder = FrameBorderType::NONE; switch( nKeyCode ) { case KEY_LEFT: eBorder = meKeyLeft; break; @@ -209,14 +209,14 @@ FrameSelectorImpl::FrameSelectorImpl( FrameSelector& rFrameSel ) : mrFrameSel( rFrameSel ), mpVirDev( VclPtr::Create() ), maILArrows(), - maLeft( FRAMEBORDER_LEFT ), - maRight( FRAMEBORDER_RIGHT ), - maTop( FRAMEBORDER_TOP ), - maBottom( FRAMEBORDER_BOTTOM ), - maHor( FRAMEBORDER_HOR ), - maVer( FRAMEBORDER_VER ), - maTLBR( FRAMEBORDER_TLBR ), - maBLTR( FRAMEBORDER_BLTR ), + maLeft( FrameBorderType::Left ), + maRight( FrameBorderType::Right ), + maTop( FrameBorderType::Top ), + maBottom( FrameBorderType::Bottom ), + maHor( FrameBorderType::Horizontal ), + maVer( FrameBorderType::Vertical ), + maTLBR( FrameBorderType::TLBR ), + maBLTR( FrameBorderType::BLTR ), mnFlags( FrameSelFlags::Outer ), mnCtrlSize( 0 ), mnArrowSize( 0 ), @@ -239,14 +239,14 @@ FrameSelectorImpl::FrameSelectorImpl( FrameSelector& rFrameSel ) : FreeResource(); maAllBorders.resize( FRAMEBORDERTYPE_COUNT, nullptr ); - maAllBorders[ GetIndexFromFrameBorderType( FRAMEBORDER_LEFT ) ] = &maLeft; - maAllBorders[ GetIndexFromFrameBorderType( FRAMEBORDER_RIGHT ) ] = &maRight; - maAllBorders[ GetIndexFromFrameBorderType( FRAMEBORDER_TOP ) ] = &maTop; - maAllBorders[ GetIndexFromFrameBorderType( FRAMEBORDER_BOTTOM ) ] = &maBottom; - maAllBorders[ GetIndexFromFrameBorderType( FRAMEBORDER_HOR ) ] = &maHor; - maAllBorders[ GetIndexFromFrameBorderType( FRAMEBORDER_VER ) ] = &maVer; - maAllBorders[ GetIndexFromFrameBorderType( FRAMEBORDER_TLBR ) ] = &maTLBR; - maAllBorders[ GetIndexFromFrameBorderType( FRAMEBORDER_BLTR ) ] = &maBLTR; + maAllBorders[ GetIndexFromFrameBorderType( FrameBorderType::Left ) ] = &maLeft; + maAllBorders[ GetIndexFromFrameBorderType( FrameBorderType::Right ) ] = &maRight; + maAllBorders[ GetIndexFromFrameBorderType( FrameBorderType::Top ) ] = &maTop; + maAllBorders[ GetIndexFromFrameBorderType( FrameBorderType::Bottom ) ] = &maBottom; + maAllBorders[ GetIndexFromFrameBorderType( FrameBorderType::Horizontal ) ] = &maHor; + maAllBorders[ GetIndexFromFrameBorderType( FrameBorderType::Vertical ) ] = &maVer; + maAllBorders[ GetIndexFromFrameBorderType( FrameBorderType::TLBR ) ] = &maTLBR; + maAllBorders[ GetIndexFromFrameBorderType( FrameBorderType::BLTR ) ] = &maBLTR; #if OSL_DEBUG_LEVEL >= 2 { bool bOk = true; @@ -255,14 +255,14 @@ FrameSelectorImpl::FrameSelectorImpl( FrameSelector& rFrameSel ) : } #endif // left neighbor right neighbor upper neighbor lower neighbor - maLeft.SetKeyboardNeighbors( FRAMEBORDER_NONE, FRAMEBORDER_TLBR, FRAMEBORDER_TOP, FRAMEBORDER_BOTTOM ); - maRight.SetKeyboardNeighbors( FRAMEBORDER_BLTR, FRAMEBORDER_NONE, FRAMEBORDER_TOP, FRAMEBORDER_BOTTOM ); - maTop.SetKeyboardNeighbors( FRAMEBORDER_LEFT, FRAMEBORDER_RIGHT, FRAMEBORDER_NONE, FRAMEBORDER_TLBR ); - maBottom.SetKeyboardNeighbors( FRAMEBORDER_LEFT, FRAMEBORDER_RIGHT, FRAMEBORDER_BLTR, FRAMEBORDER_NONE ); - maHor.SetKeyboardNeighbors( FRAMEBORDER_LEFT, FRAMEBORDER_RIGHT, FRAMEBORDER_TLBR, FRAMEBORDER_BLTR ); - maVer.SetKeyboardNeighbors( FRAMEBORDER_TLBR, FRAMEBORDER_BLTR, FRAMEBORDER_TOP, FRAMEBORDER_BOTTOM ); - maTLBR.SetKeyboardNeighbors( FRAMEBORDER_LEFT, FRAMEBORDER_VER, FRAMEBORDER_TOP, FRAMEBORDER_HOR ); - maBLTR.SetKeyboardNeighbors( FRAMEBORDER_VER, FRAMEBORDER_RIGHT, FRAMEBORDER_HOR, FRAMEBORDER_BOTTOM ); + maLeft.SetKeyboardNeighbors( FrameBorderType::NONE, FrameBorderType::TLBR, FrameBorderType::Top, FrameBorderType::Bottom ); + maRight.SetKeyboardNeighbors( FrameBorderType::BLTR, FrameBorderType::NONE, FrameBorderType::Top, FrameBorderType::Bottom ); + maTop.SetKeyboardNeighbors( FrameBorderType::Left, FrameBorderType::Right, FrameBorderType::NONE, FrameBorderType::TLBR ); + maBottom.SetKeyboardNeighbors( FrameBorderType::Left, FrameBorderType::Right, FrameBorderType::BLTR, FrameBorderType::NONE ); + maHor.SetKeyboardNeighbors( FrameBorderType::Left, FrameBorderType::Right, FrameBorderType::TLBR, FrameBorderType::BLTR ); + maVer.SetKeyboardNeighbors( FrameBorderType::TLBR, FrameBorderType::BLTR, FrameBorderType::Top, FrameBorderType::Bottom ); + maTLBR.SetKeyboardNeighbors( FrameBorderType::Left, FrameBorderType::Vertical, FrameBorderType::Top, FrameBorderType::Horizontal ); + maBLTR.SetKeyboardNeighbors( FrameBorderType::Vertical, FrameBorderType::Right, FrameBorderType::Horizontal, FrameBorderType::Bottom ); Initialize(mnFlags); } @@ -544,12 +544,12 @@ void FrameSelectorImpl::DrawArrows( const FrameBorder& rBorder ) long nLinePos = 0; switch( rBorder.GetType() ) { - case FRAMEBORDER_LEFT: - case FRAMEBORDER_TOP: nLinePos = mnLine1; break; - case FRAMEBORDER_VER: - case FRAMEBORDER_HOR: nLinePos = mnLine2; break; - case FRAMEBORDER_RIGHT: - case FRAMEBORDER_BOTTOM: nLinePos = mnLine3; break; + case FrameBorderType::Left: + case FrameBorderType::Top: nLinePos = mnLine1; break; + case FrameBorderType::Vertical: + case FrameBorderType::Horizontal: nLinePos = mnLine2; break; + case FrameBorderType::Right: + case FrameBorderType::Bottom: nLinePos = mnLine3; break; default: ; //prevent warning } nLinePos -= mnArrowSize / 2; @@ -560,25 +560,25 @@ void FrameSelectorImpl::DrawArrows( const FrameBorder& rBorder ) sal_uInt16 nImgId1 = 0, nImgId2 = 0; switch( rBorder.GetType() ) { - case FRAMEBORDER_LEFT: - case FRAMEBORDER_RIGHT: - case FRAMEBORDER_VER: + case FrameBorderType::Left: + case FrameBorderType::Right: + case FrameBorderType::Vertical: aPos1 = Point( nLinePos, nTLPos ); nImgId1 = 1; aPos2 = Point( nLinePos, nBRPos ); nImgId2 = 2; break; - case FRAMEBORDER_TOP: - case FRAMEBORDER_BOTTOM: - case FRAMEBORDER_HOR: + case FrameBorderType::Top: + case FrameBorderType::Bottom: + case FrameBorderType::Horizontal: aPos1 = Point( nTLPos, nLinePos ); nImgId1 = 3; aPos2 = Point( nBRPos, nLinePos ); nImgId2 = 4; break; - case FRAMEBORDER_TLBR: + case FrameBorderType::TLBR: aPos1 = Point( nTLPos, nTLPos ); nImgId1 = 5; aPos2 = Point( nBRPos, nBRPos ); nImgId2 = 6; break; - case FRAMEBORDER_BLTR: + case FrameBorderType::BLTR: aPos1 = Point( nTLPos, nBRPos ); nImgId1 = 7; aPos2 = Point( nBRPos, nTLPos ); nImgId2 = 8; break; @@ -819,7 +819,7 @@ sal_Int32 FrameSelector::GetEnabledBorderCount() const FrameBorderType FrameSelector::GetEnabledBorderType( sal_Int32 nIndex ) const { - FrameBorderType eBorder = FRAMEBORDER_NONE; + FrameBorderType eBorder = FrameBorderType::NONE; if( nIndex >= 0 ) { size_t nVecIdx = static_cast< size_t >( nIndex ); @@ -991,7 +991,7 @@ Reference< XAccessible > FrameSelector::CreateAccessible() { if( !mxImpl->mxAccess.is() ) mxImpl->mxAccess = mxImpl->mpAccess = - new a11y::AccFrameSelector( *this, FRAMEBORDER_NONE ); + new a11y::AccFrameSelector( *this, FrameBorderType::NONE ); return mxImpl->mxAccess; } @@ -1168,10 +1168,10 @@ void FrameSelector::KeyInput( const KeyEvent& rKEvt ) { eBorder = mxImpl->GetBorder( eBorder ).GetKeyboardNeighbor( nCode ); } - while( (eBorder != FRAMEBORDER_NONE) && !IsBorderEnabled( eBorder ) ); + while( (eBorder != FrameBorderType::NONE) && !IsBorderEnabled( eBorder ) ); // select the frame border - if( eBorder != FRAMEBORDER_NONE ) + if( eBorder != FrameBorderType::NONE ) { DeselectAllBorders(); SelectBorder( eBorder ); @@ -1196,23 +1196,23 @@ void FrameSelector::GetFocus() mxImpl->mpAccess->NotifyFocusListeners( true ); if (IsAnyBorderSelected()) { - FrameBorderType borderType = FRAMEBORDER_NONE; + FrameBorderType borderType = FrameBorderType::NONE; if (mxImpl->maLeft.IsSelected()) - borderType = FRAMEBORDER_LEFT; + borderType = FrameBorderType::Left; else if (mxImpl->maRight.IsSelected()) - borderType = FRAMEBORDER_RIGHT; + borderType = FrameBorderType::Right; else if (mxImpl->maTop.IsSelected()) - borderType = FRAMEBORDER_TOP; + borderType = FrameBorderType::Top; else if (mxImpl->maBottom.IsSelected()) - borderType = FRAMEBORDER_BOTTOM; + borderType = FrameBorderType::Bottom; else if (mxImpl->maHor.IsSelected()) - borderType = FRAMEBORDER_HOR; + borderType = FrameBorderType::Horizontal; else if (mxImpl->maVer.IsSelected()) - borderType = FRAMEBORDER_VER; + borderType = FrameBorderType::Vertical; else if (mxImpl->maTLBR.IsSelected()) - borderType = FRAMEBORDER_TLBR; + borderType = FrameBorderType::TLBR; else if (mxImpl->maBLTR.IsSelected()) - borderType = FRAMEBORDER_BLTR; + borderType = FrameBorderType::BLTR; SelectBorder(borderType); } for( SelFrameBorderIter aIt( mxImpl->maEnabBorders ); aIt.Is(); ++aIt )