Kaydet (Commit) cf991bf3 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

convert SWIB constants to scoped enum

Change-Id: If64368f22e748cc646a726cb962e60ad29a66df9
Reviewed-on: https://gerrit.libreoffice.org/15840Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst cb0b7ff3
......@@ -226,7 +226,7 @@ namespace bib
{
pToolBar= VclPtr<BibToolBar>::Create(this, LINK( this, BibBeamer, RecalcLayout_Impl ));
::Size aSize=pToolBar->GetSizePixel();
InsertItem(ID_TOOLBAR, pToolBar, aSize.Height(), 0, 0, SWIB_FIXED );
InsertItem(ID_TOOLBAR, pToolBar, aSize.Height(), 0, 0, SplitWindowItemFlags::Fixed );
if ( m_xController.is() )
pToolBar->SetXController( m_xController );
}
......@@ -235,7 +235,7 @@ namespace bib
{
pGridWin = VclPtr<BibGridwin>::Create(this,0);
InsertItem(ID_GRIDWIN, pGridWin, 40, 1, 0, SWIB_RELATIVESIZE );
InsertItem(ID_GRIDWIN, pGridWin, 40, 1, 0, SplitWindowItemFlags::RelativeSize );
pGridWin->createGridWin( pDatMan->updateGridModel() );
}
......
......@@ -186,7 +186,7 @@ void BibBookContainer::createTopFrame( BibShortCutHandler* pWin )
pTopWin->Show();
BibConfig* pConfig = BibModul::GetConfig();
long nSize = pConfig->getBeamerSize();
InsertItem(TOP_WINDOW, pTopWin, nSize, 1, 0, SWIB_PERCENTSIZE );
InsertItem(TOP_WINDOW, pTopWin, nSize, 1, 0, SplitWindowItemFlags::PercentSize );
}
......@@ -204,7 +204,7 @@ void BibBookContainer::createBottomFrame( BibShortCutHandler* pWin )
BibConfig* pConfig = BibModul::GetConfig();
long nSize = pConfig->getViewSize();
InsertItem(BOTTOM_WINDOW, pBottomWin, nSize, 1, 0, SWIB_PERCENTSIZE );
InsertItem(BOTTOM_WINDOW, pBottomWin, nSize, 1, 0, SplitWindowItemFlags::PercentSize );
}
......
......@@ -32,6 +32,7 @@
class SfxSplitWindow;
class SfxDockingWindow_Impl;
enum class SplitWindowItemFlags;
void SFX2_DLLPUBLIC SAL_CALL SfxDockingWindowFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const OUString& rDockingWindowName );
bool SFX2_DLLPUBLIC SAL_CALL IsDockingWindowVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const OUString& rDockingWindowName );
......@@ -107,7 +108,7 @@ public:
DECL_LINK_TYPED(TimerHdl, Idle *, void);
SAL_DLLPRIVATE void Initialize_Impl();
SAL_DLLPRIVATE sal_uInt16 GetWinBits_Impl() const;
SAL_DLLPRIVATE SplitWindowItemFlags GetWinBits_Impl() const;
SAL_DLLPRIVATE void SetItemSize_Impl( const Size& rSize );
SAL_DLLPRIVATE void Disappear_Impl();
SAL_DLLPRIVATE void Reappear_Impl();
......
......@@ -22,17 +22,24 @@
#include <vcl/dllapi.h>
#include <vcl/dockwin.hxx>
#include <o3tl/typed_flags_set.hxx>
class Wallpaper;
class ImplSplitSet;
typedef sal_uInt16 SplitWindowItemBits;
#define SWIB_FIXED ((SplitWindowItemBits)0x0001)
#define SWIB_RELATIVESIZE ((SplitWindowItemBits)0x0002)
#define SWIB_PERCENTSIZE ((SplitWindowItemBits)0x0004)
#define SWIB_COLSET ((SplitWindowItemBits)0x0008)
#define SWIB_INVISIBLE ((SplitWindowItemBits)0x0010)
enum class SplitWindowItemFlags
{
NONE = 0x0000,
Fixed = 0x0001,
RelativeSize = 0x0002,
PercentSize = 0x0004,
ColSet = 0x0008,
Invisible = 0x0010,
};
namespace o3tl
{
template<> struct typed_flags<SplitWindowItemFlags> : is_typed_flags<SplitWindowItemFlags, 0x1f> {};
}
#define SPLITWINDOW_APPEND ((sal_uInt16)0xFFFF)
#define SPLITWINDOW_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
......@@ -146,10 +153,10 @@ public:
void InsertItem( sal_uInt16 nId, vcl::Window* pWindow, long nSize,
sal_uInt16 nPos = SPLITWINDOW_APPEND, sal_uInt16 nIntoSetId = 0,
SplitWindowItemBits nBits = 0 );
SplitWindowItemFlags nBits = SplitWindowItemFlags::NONE );
void InsertItem( sal_uInt16 nId, long nSize,
sal_uInt16 nPos = SPLITWINDOW_APPEND, sal_uInt16 nIntoSetId = 0,
SplitWindowItemBits nBits = 0 );
SplitWindowItemFlags nBits = SplitWindowItemFlags::NONE );
void RemoveItem( sal_uInt16 nId, bool bHide = true );
void Clear();
......@@ -169,7 +176,7 @@ public:
void SetItemSizeRange (sal_uInt16 nId, const Range& rRange);
/** Return the current size limits for the specified item.
*/
long GetItemSize( sal_uInt16 nId, SplitWindowItemBits nBits ) const;
long GetItemSize( sal_uInt16 nId, SplitWindowItemFlags nBits ) const;
sal_uInt16 GetSet( sal_uInt16 nId ) const;
sal_uInt16 GetItemId( vcl::Window* pWindow ) const;
sal_uInt16 GetItemId( const Point& rPos ) const;
......
......@@ -111,8 +111,8 @@ ODesignView::ODesignView( vcl::Window* pParent,
// now create the task pane on the right side :-)
m_pTaskPane = VclPtr<OTaskWindow>::Create(this);
m_aSplitWin->InsertItem( COLSET_ID,100,SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE | SWIB_COLSET );
m_aSplitWin->InsertItem( REPORT_ID, m_aScrollWindow.get(), 100, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE);
m_aSplitWin->InsertItem( COLSET_ID,100,SPLITWINDOW_APPEND, 0, SplitWindowItemFlags::PercentSize | SplitWindowItemFlags::ColSet );
m_aSplitWin->InsertItem( REPORT_ID, m_aScrollWindow.get(), 100, SPLITWINDOW_APPEND, COLSET_ID, SplitWindowItemFlags::PercentSize);
// Splitter einrichten
m_aSplitWin->SetSplitHdl(LINK(this, ODesignView,SplitHdl));
......@@ -454,7 +454,7 @@ void ODesignView::togglePropertyBrowser(bool _bToogleOn)
m_pTaskPane->Invalidate();
if ( bWillBeVisible )
m_aSplitWin->InsertItem( TASKPANE_ID, m_pTaskPane,START_SIZE_TASKPANE, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE);
m_aSplitWin->InsertItem( TASKPANE_ID, m_pTaskPane,START_SIZE_TASKPANE, SPLITWINDOW_APPEND, COLSET_ID, SplitWindowItemFlags::PercentSize);
else
m_aSplitWin->RemoveItem(TASKPANE_ID);
......
......@@ -2763,15 +2763,15 @@ void SfxHelpWindow_Impl::MakeLayout()
if ( bIndex )
{
pIndexWin->Show();
InsertItem( COLSET_ID, 100, SPLITWINDOW_APPEND, SPLITSET_ID, SWIB_PERCENTSIZE | SWIB_COLSET );
InsertItem( INDEXWIN_ID, pIndexWin, nIndexSize, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE );
InsertItem( TEXTWIN_ID, pTextWin, nTextSize, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE );
InsertItem( COLSET_ID, 100, SPLITWINDOW_APPEND, SPLITSET_ID, SplitWindowItemFlags::PercentSize | SplitWindowItemFlags::ColSet );
InsertItem( INDEXWIN_ID, pIndexWin, nIndexSize, SPLITWINDOW_APPEND, COLSET_ID, SplitWindowItemFlags::PercentSize );
InsertItem( TEXTWIN_ID, pTextWin, nTextSize, SPLITWINDOW_APPEND, COLSET_ID, SplitWindowItemFlags::PercentSize );
}
else
{
pIndexWin->Hide();
InsertItem( COLSET_ID, 100, SPLITWINDOW_APPEND, SPLITSET_ID, SWIB_PERCENTSIZE | SWIB_COLSET );
InsertItem( TEXTWIN_ID, pTextWin, 100, SPLITWINDOW_APPEND, 1, SWIB_PERCENTSIZE );
InsertItem( COLSET_ID, 100, SPLITWINDOW_APPEND, SPLITSET_ID, SplitWindowItemFlags::PercentSize | SplitWindowItemFlags::ColSet );
InsertItem( TEXTWIN_ID, pTextWin, 100, SPLITWINDOW_APPEND, 1, SplitWindowItemFlags::PercentSize );
}
}
......
......@@ -1764,10 +1764,9 @@ bool SfxDockingWindow::Notify( NotifyEvent& rEvt )
}
sal_uInt16 SfxDockingWindow::GetWinBits_Impl() const
SplitWindowItemFlags SfxDockingWindow::GetWinBits_Impl() const
{
sal_uInt16 nBits = 0;
return nBits;
return SplitWindowItemFlags::NONE;
}
......
......@@ -423,7 +423,7 @@ void SfxSplitWindow::Split()
if ( rD.pWin )
{
const sal_uInt16 nId = rD.nType;
const long nSize = GetItemSize( nId, SWIB_FIXED );
const long nSize = GetItemSize( nId, SplitWindowItemFlags::Fixed );
const long nSetSize = GetItemSize( GetSet( nId ) );
Size aSize;
......@@ -682,7 +682,7 @@ void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl* pDock,
{
SfxDockingWindow* pDockWin = pDock->pWin;
sal_uInt16 nItemBits = pDockWin->GetWinBits_Impl();
SplitWindowItemFlags nItemBits = pDockWin->GetWinBits_Impl();
long nWinSize, nSetSize;
if ( IsHorizontal() )
......@@ -713,9 +713,9 @@ void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl* pDock,
}
// Create a new nLine:th line
sal_uInt16 nBits = nItemBits;
SplitWindowItemFlags nBits = nItemBits;
if ( GetAlign() == WINDOWALIGN_TOP || GetAlign() == WINDOWALIGN_BOTTOM )
nBits |= SWIB_COLSET;
nBits |= SplitWindowItemFlags::ColSet;
InsertItem( nId, nSetSize, nLine, 0, nBits );
}
......@@ -723,7 +723,7 @@ void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl* pDock,
// "percentage" share since the SV then does the re-sizing as expected,
// "pixel" actually only makes sense if also items with percentage or
// relative sizes are present.
nItemBits |= SWIB_PERCENTSIZE;
nItemBits |= SplitWindowItemFlags::PercentSize;
bLocked = true;
sal_uInt16 nSet = GetItemId( nLine );
InsertItem( pDockWin->GetType(), pDockWin, nWinSize, nPos, nSet, nItemBits );
......@@ -786,7 +786,7 @@ void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl* pDock,
if ( rD.pWin )
{
const sal_uInt16 nId = rD.nType;
const long nSize = GetItemSize( nId, SWIB_FIXED );
const long nSize = GetItemSize( nId, SplitWindowItemFlags::Fixed );
aNewOrgSizes.push_back( std::pair< sal_uInt16, long >( nId, nSize ) );
}
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment