make WB_LINESPACING a bool field on Toolbox
Change-Id: If9332993a4917b00c230d2a3693daf8c5d3f5559 Reviewed-on: https://gerrit.libreoffice.org/53521 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -2910,7 +2910,8 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( vcl::Window *pWindow,
|
|||||||
aTbSize = pTbSymbol->LogicToPixel(Size(160, 80), MapMode(MapUnit::MapAppFont));
|
aTbSize = pTbSymbol->LogicToPixel(Size(160, 80), MapMode(MapUnit::MapAppFont));
|
||||||
pTbSymbol->set_width_request(aTbSize.Width());
|
pTbSymbol->set_width_request(aTbSize.Width());
|
||||||
pTbSymbol->set_height_request(aTbSize.Height());
|
pTbSymbol->set_height_request(aTbSize.Height());
|
||||||
pTbSymbol->SetStyle(pTbSymbol->GetStyle() | WB_SCROLL | WB_LINESPACING);
|
pTbSymbol->SetStyle(pTbSymbol->GetStyle() | WB_SCROLL);
|
||||||
|
pTbSymbol->SetLineSpacing(true);
|
||||||
|
|
||||||
typedef std::unordered_map< OUString, bool > ImageInfo;
|
typedef std::unordered_map< OUString, bool > ImageInfo;
|
||||||
|
|
||||||
|
@@ -111,9 +111,10 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument
|
|||||||
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
|
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
|
||||||
if ( pWindow )
|
if ( pWindow )
|
||||||
{
|
{
|
||||||
sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE;
|
sal_uLong nStyles = WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE;
|
||||||
|
|
||||||
pToolBar = VclPtr<ToolBox>::Create( pWindow, nStyles );
|
pToolBar = VclPtr<ToolBox>::Create( pWindow, nStyles );
|
||||||
|
pToolBar->SetLineSpacing(true);
|
||||||
pToolBarManager = new AddonsToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar );
|
pToolBarManager = new AddonsToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar );
|
||||||
m_xToolBarManager.set( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY );
|
m_xToolBarManager.set( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY );
|
||||||
}
|
}
|
||||||
|
@@ -1552,7 +1552,8 @@ IMPL_LINK( ToolBarManager, MenuButton, ToolBox*, pToolBar, void )
|
|||||||
|
|
||||||
assert( !m_aOverflowManager.is() );
|
assert( !m_aOverflowManager.is() );
|
||||||
|
|
||||||
VclPtrInstance<ToolBox> pOverflowToolBar( pToolBar, WB_LINESPACING | WB_BORDER | WB_SCROLL );
|
VclPtrInstance<ToolBox> pOverflowToolBar( pToolBar, WB_BORDER | WB_SCROLL );
|
||||||
|
pOverflowToolBar->SetLineSpacing(true);
|
||||||
pOverflowToolBar->SetOutStyle( pToolBar->GetOutStyle() );
|
pOverflowToolBar->SetOutStyle( pToolBar->GetOutStyle() );
|
||||||
m_aOverflowManager.set( new ToolBarManager( m_xContext, m_xFrame, OUString(), pOverflowToolBar ) );
|
m_aOverflowManager.set( new ToolBarManager( m_xContext, m_xFrame, OUString(), pOverflowToolBar ) );
|
||||||
m_aOverflowManager->FillOverflowToolbar( pToolBar );
|
m_aOverflowManager->FillOverflowToolbar( pToolBar );
|
||||||
|
@@ -149,9 +149,10 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments )
|
|||||||
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xParentWindow );
|
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xParentWindow );
|
||||||
if ( pWindow )
|
if ( pWindow )
|
||||||
{
|
{
|
||||||
sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE;
|
sal_uLong nStyles = WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE;
|
||||||
|
|
||||||
pToolBar = VclPtr<ToolBox>::Create( pWindow, nStyles );
|
pToolBar = VclPtr<ToolBox>::Create( pWindow, nStyles );
|
||||||
|
pToolBar->SetLineSpacing(true);
|
||||||
pToolBarManager = new ToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar );
|
pToolBarManager = new ToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar );
|
||||||
m_xToolBarManager.set( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY );
|
m_xToolBarManager.set( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY );
|
||||||
pToolBar->WillUsePopupMode( bPopupMode );
|
pToolBar->WillUsePopupMode( bPopupMode );
|
||||||
|
@@ -208,7 +208,6 @@ WinBits const WB_SIMPLEMODE = 0x20000000;
|
|||||||
WinBits const WB_SCALE = 0x08000000;
|
WinBits const WB_SCALE = 0x08000000;
|
||||||
|
|
||||||
// Window-Bits for ToolBox
|
// Window-Bits for ToolBox
|
||||||
WinBits const WB_LINESPACING = 0x01000000;
|
|
||||||
WinBits const WB_SCROLL = 0x02000000;
|
WinBits const WB_SCROLL = 0x02000000;
|
||||||
|
|
||||||
// Window-Bits for SplitWindow
|
// Window-Bits for SplitWindow
|
||||||
|
@@ -147,7 +147,8 @@ private:
|
|||||||
mbDragging:1,
|
mbDragging:1,
|
||||||
mbIsKeyEvent:1,
|
mbIsKeyEvent:1,
|
||||||
mbChangingHighlight:1,
|
mbChangingHighlight:1,
|
||||||
mbImagesMirrored:1;
|
mbImagesMirrored:1,
|
||||||
|
mbLineSpacing:1;
|
||||||
WindowAlign meAlign;
|
WindowAlign meAlign;
|
||||||
WindowAlign meDockAlign;
|
WindowAlign meDockAlign;
|
||||||
ButtonType meButtonType;
|
ButtonType meButtonType;
|
||||||
@@ -518,6 +519,8 @@ public:
|
|||||||
void statusChanged(const css::frame::FeatureStateEvent& rEvent);
|
void statusChanged(const css::frame::FeatureStateEvent& rEvent);
|
||||||
|
|
||||||
void SetToolBoxTextPosition( ToolBoxTextPosition ePosition );
|
void SetToolBoxTextPosition( ToolBoxTextPosition ePosition );
|
||||||
|
|
||||||
|
void SetLineSpacing(bool b) { mbLineSpacing = b; }
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void ToolBox::CheckItem( sal_uInt16 nItemId, bool bCheck )
|
inline void ToolBox::CheckItem( sal_uInt16 nItemId, bool bCheck )
|
||||||
|
@@ -167,7 +167,7 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent ,const uno::Reference< bea
|
|||||||
SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
|
SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
|
||||||
SetMinOutputSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y));
|
SetMinOutputSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y));
|
||||||
|
|
||||||
m_aActions->SetStyle(m_aActions->GetStyle()|WB_LINESPACING);
|
m_aActions->SetLineSpacing(true);
|
||||||
m_aActions->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
|
m_aActions->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
|
||||||
|
|
||||||
m_aActions->SetSelectHdl(LINK(this, OAddFieldWindow, OnSortAction));
|
m_aActions->SetSelectHdl(LINK(this, OAddFieldWindow, OnSortAction));
|
||||||
|
@@ -128,7 +128,7 @@ Condition::Condition( vcl::Window* _pParent, IConditionalFormatAction& _rAction,
|
|||||||
get(m_pAddCondition, "addButton");
|
get(m_pAddCondition, "addButton");
|
||||||
get(m_pRemoveCondition, "removeButton");
|
get(m_pRemoveCondition, "removeButton");
|
||||||
|
|
||||||
m_pActions->SetStyle(m_pActions->GetStyle()|WB_LINESPACING);
|
m_pActions->SetLineSpacing(true);
|
||||||
m_pCondLHS->GrabFocus();
|
m_pCondLHS->GrabFocus();
|
||||||
|
|
||||||
m_pConditionType->SetSelectHdl( LINK( this, Condition, OnTypeSelected ) );
|
m_pConditionType->SetSelectHdl( LINK( this, Condition, OnTypeSelected ) );
|
||||||
|
@@ -845,7 +845,7 @@ OGroupsSortingDialog::OGroupsSortingDialog(vcl::Window* _pParent, bool _bReadOnl
|
|||||||
|
|
||||||
m_pHelpWindow->SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
|
m_pHelpWindow->SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
|
||||||
|
|
||||||
m_pToolBox->SetStyle(m_pToolBox->GetStyle()|WB_LINESPACING);
|
m_pToolBox->SetLineSpacing(true);
|
||||||
m_pToolBox->SetSelectHdl(LINK(this, OGroupsSortingDialog, OnFormatAction));
|
m_pToolBox->SetSelectHdl(LINK(this, OGroupsSortingDialog, OnFormatAction));
|
||||||
|
|
||||||
checkButtons(0);
|
checkButtons(0);
|
||||||
|
@@ -373,7 +373,7 @@ void ToolBox::ImplDrawGradientBackground(vcl::RenderContext& rRenderContext)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mnWinStyle & WB_LINESPACING)
|
if (mbLineSpacing)
|
||||||
{
|
{
|
||||||
if (mbHorz)
|
if (mbHorz)
|
||||||
{
|
{
|
||||||
@@ -691,7 +691,7 @@ Size ToolBox::ImplCalcSize( ImplToolItems::size_type nCalcLines, sal_uInt16 nCal
|
|||||||
else
|
else
|
||||||
aSize.setHeight( nCalcLines * mnMaxItemHeight );
|
aSize.setHeight( nCalcLines * mnMaxItemHeight );
|
||||||
|
|
||||||
if ( mnWinStyle & WB_LINESPACING )
|
if ( mbLineSpacing )
|
||||||
aSize.AdjustHeight((nCalcLines-1)*TB_LINESPACING );
|
aSize.AdjustHeight((nCalcLines-1)*TB_LINESPACING );
|
||||||
|
|
||||||
if ( mnWinStyle & WB_BORDER )
|
if ( mnWinStyle & WB_BORDER )
|
||||||
@@ -709,7 +709,7 @@ Size ToolBox::ImplCalcSize( ImplToolItems::size_type nCalcLines, sal_uInt16 nCal
|
|||||||
{
|
{
|
||||||
aSize.setWidth( nCalcLines * mnMaxItemWidth );
|
aSize.setWidth( nCalcLines * mnMaxItemWidth );
|
||||||
|
|
||||||
if ( mnWinStyle & WB_LINESPACING )
|
if ( mbLineSpacing )
|
||||||
aSize.AdjustWidth((nCalcLines-1)*TB_LINESPACING );
|
aSize.AdjustWidth((nCalcLines-1)*TB_LINESPACING );
|
||||||
|
|
||||||
if ( mnWinStyle & WB_BORDER )
|
if ( mnWinStyle & WB_BORDER )
|
||||||
@@ -882,7 +882,7 @@ ToolBox::ImplToolItems::size_type ToolBox::ImplCalcLines( long nToolSize ) const
|
|||||||
if ( mnWinStyle & WB_BORDER )
|
if ( mnWinStyle & WB_BORDER )
|
||||||
nToolSize -= TB_BORDER_OFFSET2*2;
|
nToolSize -= TB_BORDER_OFFSET2*2;
|
||||||
|
|
||||||
if ( mnWinStyle & WB_LINESPACING )
|
if ( mbLineSpacing )
|
||||||
{
|
{
|
||||||
nLineHeight += TB_LINESPACING;
|
nLineHeight += TB_LINESPACING;
|
||||||
nToolSize += TB_LINESPACING;
|
nToolSize += TB_LINESPACING;
|
||||||
@@ -1133,6 +1133,7 @@ void ToolBox::ImplInitToolBoxData()
|
|||||||
mbIsKeyEvent = false;
|
mbIsKeyEvent = false;
|
||||||
mbChangingHighlight = false;
|
mbChangingHighlight = false;
|
||||||
mbImagesMirrored = false;
|
mbImagesMirrored = false;
|
||||||
|
mbLineSpacing = false;
|
||||||
meButtonType = ButtonType::SYMBOLONLY;
|
meButtonType = ButtonType::SYMBOLONLY;
|
||||||
meAlign = WindowAlign::Top;
|
meAlign = WindowAlign::Top;
|
||||||
meDockAlign = WindowAlign::Top;
|
meDockAlign = WindowAlign::Top;
|
||||||
@@ -1875,7 +1876,7 @@ Size ToolBox::ImplGetOptimalFloatingSize()
|
|||||||
|
|
||||||
aSz.setHeight( nBorderY + nLineHeight * nLines );
|
aSz.setHeight( nBorderY + nLineHeight * nLines );
|
||||||
// line space when more than one line
|
// line space when more than one line
|
||||||
if ( mnWinStyle & WB_LINESPACING )
|
if ( mbLineSpacing )
|
||||||
aSz.AdjustHeight((nLines-1)*TB_LINESPACING );
|
aSz.AdjustHeight((nLines-1)*TB_LINESPACING );
|
||||||
|
|
||||||
aSz.setWidth( nBorderX + maxX );
|
aSz.setWidth( nBorderX + maxX );
|
||||||
@@ -2210,7 +2211,7 @@ void ToolBox::ImplFormat( bool bResize )
|
|||||||
if ( mbHorz )
|
if ( mbHorz )
|
||||||
{
|
{
|
||||||
nX = nLeft;
|
nX = nLeft;
|
||||||
if ( mnWinStyle & WB_LINESPACING )
|
if ( mbLineSpacing )
|
||||||
nY += nLineSize+TB_LINESPACING;
|
nY += nLineSize+TB_LINESPACING;
|
||||||
else
|
else
|
||||||
nY += nLineSize;
|
nY += nLineSize;
|
||||||
@@ -2218,7 +2219,7 @@ void ToolBox::ImplFormat( bool bResize )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
nY = nTop;
|
nY = nTop;
|
||||||
if ( mnWinStyle & WB_LINESPACING )
|
if ( mbLineSpacing )
|
||||||
nX += nLineSize+TB_LINESPACING;
|
nX += nLineSize+TB_LINESPACING;
|
||||||
else
|
else
|
||||||
nX += nLineSize;
|
nX += nLineSize;
|
||||||
|
Reference in New Issue
Block a user