convert IconChoice flags to scoped enum
and removed unused entries Change-Id: Ibe7ebb7723d9418893a2e2768e2a84eb16d1a046 Reviewed-on: https://gerrit.libreoffice.org/24970 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
committed by
Noel Grandin
parent
1e55722988
commit
c6ca2fac56
@@ -48,18 +48,20 @@ class IcnGridMap_Impl;
|
|||||||
#define PAINTFLAG_HOR_CENTERED 0x0001
|
#define PAINTFLAG_HOR_CENTERED 0x0001
|
||||||
#define PAINTFLAG_VER_CENTERED 0x0002
|
#define PAINTFLAG_VER_CENTERED 0x0002
|
||||||
|
|
||||||
#define F_VER_SBARSIZE_WITH_HBAR 0x0001
|
enum class IconChoiceFlags {
|
||||||
#define F_HOR_SBARSIZE_WITH_VBAR 0x0002
|
NONE = 0x0000,
|
||||||
#define F_PAINTED 0x0004 // true after first paint
|
AddMode = 0x0001,
|
||||||
#define F_ADD_MODE 0x0008
|
SelectingRect = 0x0002,
|
||||||
#define F_SELECTING_RECT 0x0020
|
DownCtrl = 0x0004,
|
||||||
#define F_DOWN_CTRL 0x0080
|
DownDeselect = 0x0008,
|
||||||
#define F_DOWN_DESELECT 0x0100
|
StartEditTimerInMouseUp = 0x0010,
|
||||||
#define F_START_EDITTIMER_IN_MOUSEUP 0x0400
|
EntryListPosValid = 0x0020,
|
||||||
#define F_MOVED_ENTRIES 0x0800
|
ClearingSelection = 0x0040,
|
||||||
#define F_ENTRYLISTPOS_VALID 0x1000
|
Arranging = 0x0080
|
||||||
#define F_CLEARING_SELECTION 0x2000
|
};
|
||||||
#define F_ARRANGING 0x4000
|
namespace o3tl {
|
||||||
|
template<> struct typed_flags<IconChoiceFlags> : is_typed_flags<IconChoiceFlags, 0x00ff> {};
|
||||||
|
}
|
||||||
|
|
||||||
// unit = pixels
|
// unit = pixels
|
||||||
// distances from window borders
|
// distances from window borders
|
||||||
@@ -180,7 +182,7 @@ class SvxIconChoiceCtrl_Impl
|
|||||||
VclPtr<IcnViewEdit_Impl> pEdit;
|
VclPtr<IcnViewEdit_Impl> pEdit;
|
||||||
WinBits nWinBits;
|
WinBits nWinBits;
|
||||||
long nMaxBoundHeight; // height of highest BoundRects
|
long nMaxBoundHeight; // height of highest BoundRects
|
||||||
sal_uInt16 nFlags;
|
IconChoiceFlags nFlags;
|
||||||
DrawTextFlags nCurTextDrawFlags;
|
DrawTextFlags nCurTextDrawFlags;
|
||||||
ImplSVEvent * nUserEventAdjustScrBars;
|
ImplSVEvent * nUserEventAdjustScrBars;
|
||||||
ImplSVEvent * nUserEventShowCursor;
|
ImplSVEvent * nUserEventShowCursor;
|
||||||
@@ -464,13 +466,6 @@ public:
|
|||||||
SvxIconChoiceCtrlEntry* GetFirstSelectedEntry() const;
|
SvxIconChoiceCtrlEntry* GetFirstSelectedEntry() const;
|
||||||
SvxIconChoiceCtrlTextMode GetEntryTextModeSmart( const SvxIconChoiceCtrlEntry* pEntry ) const;
|
SvxIconChoiceCtrlTextMode GetEntryTextModeSmart( const SvxIconChoiceCtrlEntry* pEntry ) const;
|
||||||
void SetSelectionMode( SelectionMode eMode ) { eSelectionMode=eMode; }
|
void SetSelectionMode( SelectionMode eMode ) { eSelectionMode=eMode; }
|
||||||
void SetEntriesMoved( bool bMoved )
|
|
||||||
{
|
|
||||||
if( bMoved )
|
|
||||||
nFlags |= F_MOVED_ENTRIES;
|
|
||||||
else
|
|
||||||
nFlags &= ~(F_MOVED_ENTRIES);
|
|
||||||
}
|
|
||||||
sal_Int32 GetEntryListPos( SvxIconChoiceCtrlEntry* ) const;
|
sal_Int32 GetEntryListPos( SvxIconChoiceCtrlEntry* ) const;
|
||||||
void InitSettings();
|
void InitSettings();
|
||||||
Rectangle GetOutputRect() const;
|
Rectangle GetOutputRect() const;
|
||||||
|
@@ -120,7 +120,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl(
|
|||||||
pZOrderList = new SvxIconChoiceCtrlEntryList_impl();
|
pZOrderList = new SvxIconChoiceCtrlEntryList_impl();
|
||||||
ePositionMode = IcnViewPositionModeFree;
|
ePositionMode = IcnViewPositionModeFree;
|
||||||
SetStyle( nWinStyle );
|
SetStyle( nWinStyle );
|
||||||
nFlags = 0;
|
nFlags = IconChoiceFlags::NONE;
|
||||||
nUserEventAdjustScrBars = nullptr;
|
nUserEventAdjustScrBars = nullptr;
|
||||||
nUserEventShowCursor = nullptr;
|
nUserEventShowCursor = nullptr;
|
||||||
nMaxVirtWidth = DEFAULT_MAX_VIRT_WIDTH;
|
nMaxVirtWidth = DEFAULT_MAX_VIRT_WIDTH;
|
||||||
@@ -192,7 +192,6 @@ void SvxIconChoiceCtrl_Impl::Clear( bool bInCtor )
|
|||||||
bBoundRectsDirty = false;
|
bBoundRectsDirty = false;
|
||||||
nMaxBoundHeight = 0;
|
nMaxBoundHeight = 0;
|
||||||
|
|
||||||
nFlags &= ~(F_PAINTED | F_MOVED_ENTRIES);
|
|
||||||
pCursor = nullptr;
|
pCursor = nullptr;
|
||||||
if( !bInCtor )
|
if( !bInCtor )
|
||||||
{
|
{
|
||||||
@@ -273,10 +272,10 @@ void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, size_t
|
|||||||
{
|
{
|
||||||
StopEditTimer();
|
StopEditTimer();
|
||||||
aEntries.insert( nPos, pEntry );
|
aEntries.insert( nPos, pEntry );
|
||||||
if( (nFlags & F_ENTRYLISTPOS_VALID) && nPos >= aEntries.size() - 1 )
|
if( (nFlags & IconChoiceFlags::EntryListPosValid) && nPos >= aEntries.size() - 1 )
|
||||||
pEntry->nPos = aEntries.size() - 1;
|
pEntry->nPos = aEntries.size() - 1;
|
||||||
else
|
else
|
||||||
nFlags &= ~F_ENTRYLISTPOS_VALID;
|
nFlags &= ~IconChoiceFlags::EntryListPosValid;
|
||||||
|
|
||||||
pZOrderList->push_back( pEntry );
|
pZOrderList->push_back( pEntry );
|
||||||
pImpCursor->Clear();
|
pImpCursor->Clear();
|
||||||
@@ -339,7 +338,7 @@ Rectangle SvxIconChoiceCtrl_Impl::GetOutputRect() const
|
|||||||
|
|
||||||
void SvxIconChoiceCtrl_Impl::SetListPositions()
|
void SvxIconChoiceCtrl_Impl::SetListPositions()
|
||||||
{
|
{
|
||||||
if( nFlags & F_ENTRYLISTPOS_VALID )
|
if( nFlags & IconChoiceFlags::EntryListPosValid )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
size_t nCount = aEntries.size();
|
size_t nCount = aEntries.size();
|
||||||
@@ -348,7 +347,7 @@ void SvxIconChoiceCtrl_Impl::SetListPositions()
|
|||||||
SvxIconChoiceCtrlEntry* pEntry = aEntries[ nCur ];
|
SvxIconChoiceCtrlEntry* pEntry = aEntries[ nCur ];
|
||||||
pEntry->nPos = nCur;
|
pEntry->nPos = nCur;
|
||||||
}
|
}
|
||||||
nFlags |= F_ENTRYLISTPOS_VALID;
|
nFlags |= IconChoiceFlags::EntryListPosValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, bool bSelect,
|
void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, bool bSelect,
|
||||||
@@ -359,11 +358,11 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, bool b
|
|||||||
|
|
||||||
if( !bAdd )
|
if( !bAdd )
|
||||||
{
|
{
|
||||||
if ( 0 == ( nFlags & F_CLEARING_SELECTION ) )
|
if ( !( nFlags & IconChoiceFlags::ClearingSelection ) )
|
||||||
{
|
{
|
||||||
nFlags |= F_CLEARING_SELECTION;
|
nFlags |= IconChoiceFlags::ClearingSelection;
|
||||||
DeselectAllBut( pEntry, true );
|
DeselectAllBut( pEntry, true );
|
||||||
nFlags &= ~F_CLEARING_SELECTION;
|
nFlags &= ~IconChoiceFlags::ClearingSelection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( pEntry->IsSelected() != bSelect )
|
if( pEntry->IsSelected() != bSelect )
|
||||||
@@ -401,7 +400,7 @@ void SvxIconChoiceCtrl_Impl::EntrySelected(SvxIconChoiceCtrlEntry* pEntry, bool
|
|||||||
|
|
||||||
// Not when dragging though, else the loop in SelectRect doesn't work
|
// Not when dragging though, else the loop in SelectRect doesn't work
|
||||||
// correctly!
|
// correctly!
|
||||||
if (!(nFlags & F_SELECTING_RECT))
|
if (!(nFlags & IconChoiceFlags::SelectingRect))
|
||||||
ToTop(pEntry);
|
ToTop(pEntry);
|
||||||
if (bUpdateMode)
|
if (bUpdateMode)
|
||||||
{
|
{
|
||||||
@@ -518,7 +517,6 @@ void SvxIconChoiceCtrl_Impl::InitPredecessors()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
pHead = nullptr;
|
pHead = nullptr;
|
||||||
nFlags &= ~F_MOVED_ENTRIES;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SvxIconChoiceCtrl_Impl::ClearPredecessors()
|
void SvxIconChoiceCtrl_Impl::ClearPredecessors()
|
||||||
@@ -561,8 +559,7 @@ void SvxIconChoiceCtrl_Impl::ImpArrange( bool bKeepPredecessors )
|
|||||||
if( (nWinBits & WB_SMART_ARRANGE) && aCurOutputArea.TopLeft() != aEmptyPoint )
|
if( (nWinBits & WB_SMART_ARRANGE) && aCurOutputArea.TopLeft() != aEmptyPoint )
|
||||||
bUpdateMode = false;
|
bUpdateMode = false;
|
||||||
aAutoArrangeIdle.Stop();
|
aAutoArrangeIdle.Stop();
|
||||||
nFlags &= ~F_MOVED_ENTRIES;
|
nFlags |= IconChoiceFlags::Arranging;
|
||||||
nFlags |= F_ARRANGING;
|
|
||||||
StopEditTimer();
|
StopEditTimer();
|
||||||
ShowCursor( false );
|
ShowCursor( false );
|
||||||
ResetVirtSize();
|
ResetVirtSize();
|
||||||
@@ -575,7 +572,7 @@ void SvxIconChoiceCtrl_Impl::ImpArrange( bool bKeepPredecessors )
|
|||||||
// TODO: the invalidation in the detail view should be more intelligent
|
// TODO: the invalidation in the detail view should be more intelligent
|
||||||
//if( !(nWinBits & WB_DETAILS ))
|
//if( !(nWinBits & WB_DETAILS ))
|
||||||
pView->Invalidate( InvalidateFlags::NoChildren );
|
pView->Invalidate( InvalidateFlags::NoChildren );
|
||||||
nFlags &= ~F_ARRANGING;
|
nFlags &= ~IconChoiceFlags::Arranging;
|
||||||
if( (nWinBits & WB_SMART_ARRANGE) && aCurOutputArea.TopLeft() != aEmptyPoint )
|
if( (nWinBits & WB_SMART_ARRANGE) && aCurOutputArea.TopLeft() != aEmptyPoint )
|
||||||
{
|
{
|
||||||
MakeVisible( aCurOutputArea );
|
MakeVisible( aCurOutputArea );
|
||||||
@@ -627,7 +624,6 @@ void SvxIconChoiceCtrl_Impl::Paint(vcl::RenderContext& rRenderContext, const Rec
|
|||||||
}
|
}
|
||||||
rRenderContext.SetLineColor(aOldColor);
|
rRenderContext.SetLineColor(aOldColor);
|
||||||
#endif
|
#endif
|
||||||
nFlags |= F_PAINTED;
|
|
||||||
|
|
||||||
if (!aEntries.size())
|
if (!aEntries.size())
|
||||||
return;
|
return;
|
||||||
@@ -743,7 +739,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
|
|||||||
{
|
{
|
||||||
DBG_ASSERT(eSelectionMode != SINGLE_SELECTION,"Invalid selection mode");
|
DBG_ASSERT(eSelectionMode != SINGLE_SELECTION,"Invalid selection mode");
|
||||||
if( rMEvt.IsMod1() )
|
if( rMEvt.IsMod1() )
|
||||||
nFlags |= F_ADD_MODE;
|
nFlags |= IconChoiceFlags::AddMode;
|
||||||
|
|
||||||
if( rMEvt.IsShift() )
|
if( rMEvt.IsShift() )
|
||||||
{
|
{
|
||||||
@@ -756,7 +752,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
|
|||||||
aRect.Union( aTempRect );
|
aRect.Union( aTempRect );
|
||||||
}
|
}
|
||||||
aCurSelectionRect = aRect;
|
aCurSelectionRect = aRect;
|
||||||
SelectRect( aRect, (nFlags & F_ADD_MODE)!=0, &aSelectedRectList );
|
SelectRect( aRect, bool(nFlags & IconChoiceFlags::AddMode), &aSelectedRectList );
|
||||||
}
|
}
|
||||||
else if( rMEvt.IsMod1() )
|
else if( rMEvt.IsMod1() )
|
||||||
{
|
{
|
||||||
@@ -784,7 +780,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
nFlags |= F_ADD_MODE;
|
nFlags |= IconChoiceFlags::AddMode;
|
||||||
aCurSelectionRect.SetPos( aDocPos );
|
aCurSelectionRect.SetPos( aDocPos );
|
||||||
pView->StartTracking( StartTrackingFlags::ScrollRepeat );
|
pView->StartTracking( StartTrackingFlags::ScrollRepeat );
|
||||||
}
|
}
|
||||||
@@ -821,7 +817,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
|
|||||||
if( bEditingEnabled && bSelected && !rMEvt.GetModifier() &&
|
if( bEditingEnabled && bSelected && !rMEvt.GetModifier() &&
|
||||||
rMEvt.IsLeft() && IsTextHit( pEntry, aDocPos ) )
|
rMEvt.IsLeft() && IsTextHit( pEntry, aDocPos ) )
|
||||||
{
|
{
|
||||||
nFlags |= F_START_EDITTIMER_IN_MOUSEUP;
|
nFlags |= IconChoiceFlags::StartEditTimerInMouseUp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( eSelectionMode == NO_SELECTION )
|
else if( eSelectionMode == NO_SELECTION )
|
||||||
@@ -846,16 +842,16 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// deselect only in the Up, if the Move happened via D&D!
|
// deselect only in the Up, if the Move happened via D&D!
|
||||||
nFlags |= F_DOWN_DESELECT;
|
nFlags |= IconChoiceFlags::DownDeselect;
|
||||||
if( bEditingEnabled && IsTextHit( pEntry, aDocPos ) &&
|
if( bEditingEnabled && IsTextHit( pEntry, aDocPos ) &&
|
||||||
rMEvt.IsLeft())
|
rMEvt.IsLeft())
|
||||||
{
|
{
|
||||||
nFlags |= F_START_EDITTIMER_IN_MOUSEUP;
|
nFlags |= IconChoiceFlags::StartEditTimerInMouseUp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( rMEvt.IsMod1() )
|
else if( rMEvt.IsMod1() )
|
||||||
nFlags |= F_DOWN_CTRL;
|
nFlags |= IconChoiceFlags::DownCtrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return bHandled;
|
return bHandled;
|
||||||
@@ -864,9 +860,9 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt)
|
|||||||
bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt )
|
bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt )
|
||||||
{
|
{
|
||||||
bool bHandled = false;
|
bool bHandled = false;
|
||||||
if( rMEvt.IsRight() && (nFlags & (F_DOWN_CTRL | F_DOWN_DESELECT) ))
|
if( rMEvt.IsRight() && (nFlags & (IconChoiceFlags::DownCtrl | IconChoiceFlags::DownDeselect) ))
|
||||||
{
|
{
|
||||||
nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT);
|
nFlags &= ~IconChoiceFlags(IconChoiceFlags::DownCtrl | IconChoiceFlags::DownDeselect);
|
||||||
bHandled = true;
|
bHandled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -875,14 +871,14 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt )
|
|||||||
SvxIconChoiceCtrlEntry* pDocEntry = GetEntry( aDocPos );
|
SvxIconChoiceCtrlEntry* pDocEntry = GetEntry( aDocPos );
|
||||||
if( pDocEntry )
|
if( pDocEntry )
|
||||||
{
|
{
|
||||||
if( nFlags & F_DOWN_CTRL )
|
if( nFlags & IconChoiceFlags::DownCtrl )
|
||||||
{
|
{
|
||||||
// Ctrl & MultiSelection
|
// Ctrl & MultiSelection
|
||||||
ToggleSelection( pDocEntry );
|
ToggleSelection( pDocEntry );
|
||||||
SetCursor( pDocEntry );
|
SetCursor( pDocEntry );
|
||||||
bHandled = true;
|
bHandled = true;
|
||||||
}
|
}
|
||||||
else if( nFlags & F_DOWN_DESELECT )
|
else if( nFlags & IconChoiceFlags::DownDeselect )
|
||||||
{
|
{
|
||||||
DeselectAllBut( pDocEntry );
|
DeselectAllBut( pDocEntry );
|
||||||
SetCursor( pDocEntry );
|
SetCursor( pDocEntry );
|
||||||
@@ -891,12 +887,12 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT);
|
nFlags &= ~IconChoiceFlags(IconChoiceFlags::DownCtrl | IconChoiceFlags::DownDeselect);
|
||||||
if( nFlags & F_START_EDITTIMER_IN_MOUSEUP )
|
if( nFlags & IconChoiceFlags::StartEditTimerInMouseUp )
|
||||||
{
|
{
|
||||||
bHandled = true;
|
bHandled = true;
|
||||||
StartEditTimer();
|
StartEditTimer();
|
||||||
nFlags &= ~F_START_EDITTIMER_IN_MOUSEUP;
|
nFlags &= ~IconChoiceFlags::StartEditTimerInMouseUp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((nWinBits & WB_HIGHLIGHTFRAME) && bHighlightFramePressed && pCurHighlightFrame)
|
if((nWinBits & WB_HIGHLIGHTFRAME) && bHighlightFramePressed && pCurHighlightFrame)
|
||||||
@@ -970,9 +966,9 @@ void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor,
|
|||||||
if( !pAnchor )
|
if( !pAnchor )
|
||||||
pAnchor = pOldCursor;
|
pAnchor = pOldCursor;
|
||||||
if ( nWinBits & WB_ALIGN_LEFT )
|
if ( nWinBits & WB_ALIGN_LEFT )
|
||||||
SelectRange( pAnchor, pNewCursor, (nFlags & F_ADD_MODE)!=0 );
|
SelectRange( pAnchor, pNewCursor, bool(nFlags & IconChoiceFlags::AddMode) );
|
||||||
else
|
else
|
||||||
SelectRect(pAnchor,pNewCursor,(nFlags & F_ADD_MODE)!=0,&aSelectedRectList);
|
SelectRect(pAnchor,pNewCursor, bool(nFlags & IconChoiceFlags::AddMode), &aSelectedRectList);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1015,7 +1011,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( bMod1 )
|
if( bMod1 )
|
||||||
nFlags |= F_ADD_MODE;
|
nFlags |= IconChoiceFlags::AddMode;
|
||||||
|
|
||||||
SvxIconChoiceCtrlEntry* pNewCursor;
|
SvxIconChoiceCtrlEntry* pNewCursor;
|
||||||
SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
|
SvxIconChoiceCtrlEntry* pOldCursor = pCursor;
|
||||||
@@ -1111,10 +1107,10 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
|
|||||||
case KEY_F8:
|
case KEY_F8:
|
||||||
if( rKEvt.GetKeyCode().IsShift() )
|
if( rKEvt.GetKeyCode().IsShift() )
|
||||||
{
|
{
|
||||||
if( nFlags & F_ADD_MODE )
|
if( nFlags & IconChoiceFlags::AddMode )
|
||||||
nFlags &= (~F_ADD_MODE);
|
nFlags &= (~IconChoiceFlags::AddMode);
|
||||||
else
|
else
|
||||||
nFlags |= F_ADD_MODE;
|
nFlags |= IconChoiceFlags::AddMode;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
bKeyUsed = false;
|
bKeyUsed = false;
|
||||||
@@ -1269,8 +1265,6 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars()
|
|||||||
nVisibleWidth = nVirtWidth + aOrigin.X();
|
nVisibleWidth = nVirtWidth + aOrigin.X();
|
||||||
else
|
else
|
||||||
nVisibleWidth = nRealWidth;
|
nVisibleWidth = nRealWidth;
|
||||||
|
|
||||||
nFlags |= F_HOR_SBARSIZE_WITH_VBAR;
|
|
||||||
}
|
}
|
||||||
// activate horizontal scrollbar?
|
// activate horizontal scrollbar?
|
||||||
if( !bNoHorSBar && (bHorSBar || (nVirtWidth > nVisibleWidth)) )
|
if( !bNoHorSBar && (bHorSBar || (nVirtWidth > nVisibleWidth)) )
|
||||||
@@ -1294,8 +1288,6 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars()
|
|||||||
nVisibleWidth = nVirtWidth + aOrigin.X();
|
nVisibleWidth = nVirtWidth + aOrigin.X();
|
||||||
else
|
else
|
||||||
nVisibleWidth = nRealWidth;
|
nVisibleWidth = nRealWidth;
|
||||||
|
|
||||||
nFlags |= F_VER_SBARSIZE_WITH_HBAR;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1718,11 +1710,11 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const
|
|||||||
void SvxIconChoiceCtrl_Impl::SetNoSelection()
|
void SvxIconChoiceCtrl_Impl::SetNoSelection()
|
||||||
{
|
{
|
||||||
// block recursive calls via SelectEntry
|
// block recursive calls via SelectEntry
|
||||||
if( !(nFlags & F_CLEARING_SELECTION ))
|
if( !(nFlags & IconChoiceFlags::ClearingSelection ))
|
||||||
{
|
{
|
||||||
nFlags |= F_CLEARING_SELECTION;
|
nFlags |= IconChoiceFlags::ClearingSelection;
|
||||||
DeselectAllBut( nullptr, true );
|
DeselectAllBut( nullptr, true );
|
||||||
nFlags &= ~F_CLEARING_SELECTION;
|
nFlags &= ~IconChoiceFlags::ClearingSelection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2306,7 +2298,7 @@ void SvxIconChoiceCtrl_Impl::DeselectAllBut( SvxIconChoiceCtrlEntry* pThisEntryN
|
|||||||
SelectEntry( pEntry, false, true, bPaintSync );
|
SelectEntry( pEntry, false, true, bPaintSync );
|
||||||
}
|
}
|
||||||
pAnchor = nullptr;
|
pAnchor = nullptr;
|
||||||
nFlags &= (~F_ADD_MODE);
|
nFlags &= (~IconChoiceFlags::AddMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
Size SvxIconChoiceCtrl_Impl::GetMinGrid() const
|
Size SvxIconChoiceCtrl_Impl::GetMinGrid() const
|
||||||
@@ -2504,8 +2496,8 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, bool bAdd,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// set flag, so ToTop won't be called in Select
|
// set flag, so ToTop won't be called in Select
|
||||||
bool bAlreadySelectingRect = (nFlags & F_SELECTING_RECT) != 0;
|
bool bAlreadySelectingRect(nFlags & IconChoiceFlags::SelectingRect);
|
||||||
nFlags |= F_SELECTING_RECT;
|
nFlags |= IconChoiceFlags::SelectingRect;
|
||||||
|
|
||||||
CheckBoundingRects();
|
CheckBoundingRects();
|
||||||
pView->Update();
|
pView->Update();
|
||||||
@@ -2586,7 +2578,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, bool bAdd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !bAlreadySelectingRect )
|
if( !bAlreadySelectingRect )
|
||||||
nFlags &= ~F_SELECTING_RECT;
|
nFlags &= ~IconChoiceFlags::SelectingRect;
|
||||||
|
|
||||||
pView->Update();
|
pView->Update();
|
||||||
if( bResetClipRegion )
|
if( bResetClipRegion )
|
||||||
@@ -2764,7 +2756,6 @@ void SvxIconChoiceCtrl_Impl::AdjustAtGrid( const SvxIconChoiceCtrlEntryPtrVec& r
|
|||||||
{
|
{
|
||||||
SetEntryPos( pCur, aNewPos );
|
SetEntryPos( pCur, aNewPos );
|
||||||
pCur->SetFlags( SvxIconViewFlags::POS_MOVED );
|
pCur->SetFlags( SvxIconViewFlags::POS_MOVED );
|
||||||
nFlags |= F_MOVED_ENTRIES;
|
|
||||||
}
|
}
|
||||||
nCurRight = aNewPos.X() + nWidth;
|
nCurRight = aNewPos.X() + nWidth;
|
||||||
}
|
}
|
||||||
@@ -3052,7 +3043,7 @@ void SvxIconChoiceCtrl_Impl::SelectAll()
|
|||||||
SvxIconChoiceCtrlEntry* pEntry = aEntries[ nCur ];
|
SvxIconChoiceCtrlEntry* pEntry = aEntries[ nCur ];
|
||||||
SelectEntry( pEntry, true/*bSelect*/, true, bPaint );
|
SelectEntry( pEntry, true/*bSelect*/, true, bPaint );
|
||||||
}
|
}
|
||||||
nFlags &= (~F_ADD_MODE);
|
nFlags &= (~IconChoiceFlags::AddMode);
|
||||||
pAnchor = nullptr;
|
pAnchor = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3184,7 +3175,7 @@ void IcnViewEdit_Impl::StopEditing()
|
|||||||
|
|
||||||
sal_Int32 SvxIconChoiceCtrl_Impl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const
|
sal_Int32 SvxIconChoiceCtrl_Impl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const
|
||||||
{
|
{
|
||||||
if( !(nFlags & F_ENTRYLISTPOS_VALID ))
|
if( !(nFlags & IconChoiceFlags::EntryListPosValid ))
|
||||||
const_cast<SvxIconChoiceCtrl_Impl*>(this)->SetListPositions();
|
const_cast<SvxIconChoiceCtrl_Impl*>(this)->SetListPositions();
|
||||||
return pEntry->nPos;
|
return pEntry->nPos;
|
||||||
}
|
}
|
||||||
|
@@ -596,7 +596,7 @@ void IcnGridMap_Impl::GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const
|
|||||||
nX = _pView->nMaxVirtWidth;
|
nX = _pView->nMaxVirtWidth;
|
||||||
if( !nX )
|
if( !nX )
|
||||||
nX = _pView->pView->GetOutputSizePixel().Width();
|
nX = _pView->pView->GetOutputSizePixel().Width();
|
||||||
if( !(_pView->nFlags & F_ARRANGING) )
|
if( !(_pView->nFlags & IconChoiceFlags::Arranging) )
|
||||||
nX -= _pView->nVerSBarWidth;
|
nX -= _pView->nVerSBarWidth;
|
||||||
|
|
||||||
nY = _pView->aVirtOutputSize.Height();
|
nY = _pView->aVirtOutputSize.Height();
|
||||||
@@ -607,7 +607,7 @@ void IcnGridMap_Impl::GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const
|
|||||||
nY = _pView->nMaxVirtHeight;
|
nY = _pView->nMaxVirtHeight;
|
||||||
if( !nY )
|
if( !nY )
|
||||||
nY = _pView->pView->GetOutputSizePixel().Height();
|
nY = _pView->pView->GetOutputSizePixel().Height();
|
||||||
if( !(_pView->nFlags & F_ARRANGING) )
|
if( !(_pView->nFlags & IconChoiceFlags::Arranging) )
|
||||||
nY -= _pView->nHorSBarHeight;
|
nY -= _pView->nHorSBarHeight;
|
||||||
nX = _pView->aVirtOutputSize.Width();
|
nX = _pView->aVirtOutputSize.Width();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user