[Libreoffice-commits] core.git: 2 commits - accessibility/source cui/source framework/source include/svtools include/tools include/vcl reportdesign/source vcl/source
Noel Grandin
noel.grandin at collabora.co.uk
Fri Apr 27 06:21:57 UTC 2018
accessibility/source/standard/vclxaccessibleedit.cxx | 2 +-
cui/source/customize/cfg.cxx | 3 ++-
framework/source/uielement/addonstoolbarwrapper.cxx | 3 ++-
framework/source/uielement/toolbarmanager.cxx | 3 ++-
framework/source/uielement/toolbarwrapper.cxx | 3 ++-
include/svtools/ivctrl.hxx | 2 +-
include/tools/wintypes.hxx | 2 --
include/vcl/edit.hxx | 6 +++++-
include/vcl/toolbox.hxx | 5 ++++-
reportdesign/source/ui/dlg/AddField.cxx | 2 +-
reportdesign/source/ui/dlg/Condition.cxx | 2 +-
reportdesign/source/ui/dlg/GroupsSorting.cxx | 2 +-
vcl/source/control/edit.cxx | 19 +++++++++----------
vcl/source/window/accessibility.cxx | 2 +-
vcl/source/window/toolbox.cxx | 15 ++++++++-------
15 files changed, 40 insertions(+), 31 deletions(-)
New commits:
commit 1cf751c787f135597b4151c5a7d9c4afe69ede9c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Apr 26 14:24:54 2018 +0200
make WB_LINESPACING a bool field on Toolbox
Change-Id: If9332993a4917b00c230d2a3693daf8c5d3f5559
Reviewed-on: https://gerrit.libreoffice.org/53521
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index fb1195c73b39..6070a7be05ee 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2910,7 +2910,8 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( vcl::Window *pWindow,
aTbSize = pTbSymbol->LogicToPixel(Size(160, 80), MapMode(MapUnit::MapAppFont));
pTbSymbol->set_width_request(aTbSize.Width());
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;
diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx b/framework/source/uielement/addonstoolbarwrapper.cxx
index 9062c4b72c13..379f2a4d16be 100644
--- a/framework/source/uielement/addonstoolbarwrapper.cxx
+++ b/framework/source/uielement/addonstoolbarwrapper.cxx
@@ -111,9 +111,10 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
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->SetLineSpacing(true);
pToolBarManager = new AddonsToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar );
m_xToolBarManager.set( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY );
}
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index ea77c92a70a8..cae4dacd7295 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1552,7 +1552,8 @@ IMPL_LINK( ToolBarManager, MenuButton, ToolBox*, pToolBar, void )
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() );
m_aOverflowManager.set( new ToolBarManager( m_xContext, m_xFrame, OUString(), pOverflowToolBar ) );
m_aOverflowManager->FillOverflowToolbar( pToolBar );
diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx
index 9d99ea280c14..951fb3bacec7 100644
--- a/framework/source/uielement/toolbarwrapper.cxx
+++ b/framework/source/uielement/toolbarwrapper.cxx
@@ -149,9 +149,10 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments )
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xParentWindow );
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->SetLineSpacing(true);
pToolBarManager = new ToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar );
m_xToolBarManager.set( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY );
pToolBar->WillUsePopupMode( bPopupMode );
diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx
index f80334966b76..b9e7d007fc55 100644
--- a/include/tools/wintypes.hxx
+++ b/include/tools/wintypes.hxx
@@ -208,7 +208,6 @@ WinBits const WB_SIMPLEMODE = 0x20000000;
WinBits const WB_SCALE = 0x08000000;
// Window-Bits for ToolBox
-WinBits const WB_LINESPACING = 0x01000000;
WinBits const WB_SCROLL = 0x02000000;
// Window-Bits for SplitWindow
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 2018be7986d4..74db39f4af55 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -147,7 +147,8 @@ private:
mbDragging:1,
mbIsKeyEvent:1,
mbChangingHighlight:1,
- mbImagesMirrored:1;
+ mbImagesMirrored:1,
+ mbLineSpacing:1;
WindowAlign meAlign;
WindowAlign meDockAlign;
ButtonType meButtonType;
@@ -518,6 +519,8 @@ public:
void statusChanged(const css::frame::FeatureStateEvent& rEvent);
void SetToolBoxTextPosition( ToolBoxTextPosition ePosition );
+
+ void SetLineSpacing(bool b) { mbLineSpacing = b; }
};
inline void ToolBox::CheckItem( sal_uInt16 nItemId, bool bCheck )
diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx
index 0299f5cabe94..46b8850ac552 100644
--- a/reportdesign/source/ui/dlg/AddField.cxx
+++ b/reportdesign/source/ui/dlg/AddField.cxx
@@ -167,7 +167,7 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent ,const uno::Reference< bea
SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
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->SetSelectHdl(LINK(this, OAddFieldWindow, OnSortAction));
diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx
index 0d76f42744ff..5a934f9bd0fa 100644
--- a/reportdesign/source/ui/dlg/Condition.cxx
+++ b/reportdesign/source/ui/dlg/Condition.cxx
@@ -128,7 +128,7 @@ Condition::Condition( vcl::Window* _pParent, IConditionalFormatAction& _rAction,
get(m_pAddCondition, "addButton");
get(m_pRemoveCondition, "removeButton");
- m_pActions->SetStyle(m_pActions->GetStyle()|WB_LINESPACING);
+ m_pActions->SetLineSpacing(true);
m_pCondLHS->GrabFocus();
m_pConditionType->SetSelectHdl( LINK( this, Condition, OnTypeSelected ) );
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index afd90c6d54be..816c5df9dcce 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -845,7 +845,7 @@ OGroupsSortingDialog::OGroupsSortingDialog(vcl::Window* _pParent, bool _bReadOnl
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));
checkButtons(0);
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 458c7c6e9566..a90b1d4814e4 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -373,7 +373,7 @@ void ToolBox::ImplDrawGradientBackground(vcl::RenderContext& rRenderContext)
}
}
- if (mnWinStyle & WB_LINESPACING)
+ if (mbLineSpacing)
{
if (mbHorz)
{
@@ -691,7 +691,7 @@ Size ToolBox::ImplCalcSize( ImplToolItems::size_type nCalcLines, sal_uInt16 nCal
else
aSize.setHeight( nCalcLines * mnMaxItemHeight );
- if ( mnWinStyle & WB_LINESPACING )
+ if ( mbLineSpacing )
aSize.AdjustHeight((nCalcLines-1)*TB_LINESPACING );
if ( mnWinStyle & WB_BORDER )
@@ -709,7 +709,7 @@ Size ToolBox::ImplCalcSize( ImplToolItems::size_type nCalcLines, sal_uInt16 nCal
{
aSize.setWidth( nCalcLines * mnMaxItemWidth );
- if ( mnWinStyle & WB_LINESPACING )
+ if ( mbLineSpacing )
aSize.AdjustWidth((nCalcLines-1)*TB_LINESPACING );
if ( mnWinStyle & WB_BORDER )
@@ -882,7 +882,7 @@ ToolBox::ImplToolItems::size_type ToolBox::ImplCalcLines( long nToolSize ) const
if ( mnWinStyle & WB_BORDER )
nToolSize -= TB_BORDER_OFFSET2*2;
- if ( mnWinStyle & WB_LINESPACING )
+ if ( mbLineSpacing )
{
nLineHeight += TB_LINESPACING;
nToolSize += TB_LINESPACING;
@@ -1133,6 +1133,7 @@ void ToolBox::ImplInitToolBoxData()
mbIsKeyEvent = false;
mbChangingHighlight = false;
mbImagesMirrored = false;
+ mbLineSpacing = false;
meButtonType = ButtonType::SYMBOLONLY;
meAlign = WindowAlign::Top;
meDockAlign = WindowAlign::Top;
@@ -1875,7 +1876,7 @@ Size ToolBox::ImplGetOptimalFloatingSize()
aSz.setHeight( nBorderY + nLineHeight * nLines );
// line space when more than one line
- if ( mnWinStyle & WB_LINESPACING )
+ if ( mbLineSpacing )
aSz.AdjustHeight((nLines-1)*TB_LINESPACING );
aSz.setWidth( nBorderX + maxX );
@@ -2210,7 +2211,7 @@ void ToolBox::ImplFormat( bool bResize )
if ( mbHorz )
{
nX = nLeft;
- if ( mnWinStyle & WB_LINESPACING )
+ if ( mbLineSpacing )
nY += nLineSize+TB_LINESPACING;
else
nY += nLineSize;
@@ -2218,7 +2219,7 @@ void ToolBox::ImplFormat( bool bResize )
else
{
nY = nTop;
- if ( mnWinStyle & WB_LINESPACING )
+ if ( mbLineSpacing )
nX += nLineSize+TB_LINESPACING;
else
nX += nLineSize;
commit cca4d9ab39499562614f0f778a2fffe5a40fde88
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Apr 26 14:14:04 2018 +0200
convert WB_PASSWORD to a bool field on Edit
Change-Id: Ie1e03bcdf57e6ba3e2a6ba8596d70a2d7a88eaba
Reviewed-on: https://gerrit.libreoffice.org/53520
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx b/accessibility/source/standard/vclxaccessibleedit.cxx
index 850238c55a94..118c9d85f6d0 100644
--- a/accessibility/source/standard/vclxaccessibleedit.cxx
+++ b/accessibility/source/standard/vclxaccessibleedit.cxx
@@ -214,7 +214,7 @@ sal_Int16 VCLXAccessibleEdit::implGetAccessibleRole( )
{
sal_Int16 nRole;
VclPtr< Edit > pEdit = GetAs< Edit >();
- if ( pEdit && ( ( pEdit->GetStyle() & WB_PASSWORD ) || pEdit->GetEchoChar() ) )
+ if ( pEdit && ( pEdit->IsPassword() || pEdit->GetEchoChar() ) )
nRole = AccessibleRole::PASSWORD_TEXT;
else if ( pEdit && ( pEdit->GetStyle() & WB_READONLY ) )
nRole = AccessibleRole::LABEL;
diff --git a/include/svtools/ivctrl.hxx b/include/svtools/ivctrl.hxx
index 18641b419422..11ba7f1dee1f 100644
--- a/include/svtools/ivctrl.hxx
+++ b/include/svtools/ivctrl.hxx
@@ -176,7 +176,7 @@ public:
#define WB_NOVSCROLL WB_DRAG
#define WB_NOSELECTION WB_REPEAT
#define WB_NODRAGSELECTION WB_PATHELLIPSIS
-#define WB_SMART_ARRANGE WB_PASSWORD
+#define WB_SMART_ARRANGE 0x01000000 // used to be WB_PASSWORD
#define WB_ALIGN_TOP WB_TOP
#define WB_ALIGN_LEFT WB_LEFT
#define WB_NOCOLUMNHEADER WB_CENTER
diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx
index 897e63e520e1..f80334966b76 100644
--- a/include/tools/wintypes.hxx
+++ b/include/tools/wintypes.hxx
@@ -195,7 +195,6 @@ WinBits const WB_NOMULTILINE = 0x10000000;
WinBits const WB_EARLYTOGGLE = SAL_CONST_INT64(0x4000000000);
// Window-Bits for Edit
-WinBits const WB_PASSWORD = 0x01000000;
WinBits const WB_READONLY = 0x02000000;
WinBits const WB_NOHIDESELECTION = SAL_CONST_INT64(0x1000000000);
diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx
index 0d353c379f35..72e3e2273581 100644
--- a/include/vcl/edit.hxx
+++ b/include/vcl/edit.hxx
@@ -93,7 +93,8 @@ private:
mbClickedInSelection:1,
mbIsSubEdit:1,
mbActivePopup:1,
- mbForceControlBackground:1;
+ mbForceControlBackground:1,
+ mbPassword;
Link<Edit&,void> maModifyHdl;
Link<Edit&,void> maUpdateDataHdl;
Link<Edit&,void> maAutocompleteHdl;
@@ -275,6 +276,9 @@ public:
static Size GetMinimumEditSize();
void SetForceControlBackground(bool b) { mbForceControlBackground = b; }
+
+ void SetPassword(bool b) { mbPassword = b; }
+ bool IsPassword() const { return mbPassword; }
};
#endif // INCLUDED_VCL_EDIT_HXX
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 2effdcd3594a..9d5204b82760 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -206,11 +206,9 @@ bool Edit::set_property(const OString &rKey, const OUString &rValue)
}
else if (rKey == "visibility")
{
- WinBits nBits = GetStyle();
- nBits &= ~WB_PASSWORD;
+ mbPassword = false;
if (!toBool(rValue))
- nBits |= WB_PASSWORD;
- SetStyle(nBits);
+ mbPassword = true;
}
else if (rKey == "placeholder-text")
SetPlaceholderText(rValue);
@@ -281,6 +279,7 @@ void Edit::ImplInitEditData()
mbActivePopup = false;
mbIsSubEdit = false;
mbForceControlBackground = false;
+ mbPassword = false;
mpDDInfo = nullptr;
mpIMEInfos = nullptr;
mcEchoChar = 0;
@@ -431,7 +430,7 @@ long Edit::ImplGetExtraYOffset() const
OUString Edit::ImplGetText() const
{
- if ( mcEchoChar || (GetStyle() & WB_PASSWORD) )
+ if ( mcEchoChar || mbPassword )
{
sal_Unicode cEchoChar;
if ( mcEchoChar )
@@ -1406,7 +1405,7 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
case KeyFuncType::CUT:
{
- if ( !mbReadOnly && maSelection.Len() && !(GetStyle() & WB_PASSWORD) )
+ if ( !mbReadOnly && maSelection.Len() && !mbPassword )
{
Cut();
ImplModified();
@@ -1417,7 +1416,7 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
case KeyFuncType::COPY:
{
- if ( !(GetStyle() & WB_PASSWORD) )
+ if ( !mbPassword )
{
Copy();
bDone = true;
@@ -2564,7 +2563,7 @@ OUString Edit::GetSelected() const
void Edit::Cut()
{
- if ( !(GetStyle() & WB_PASSWORD ) )
+ if ( !mbPassword )
{
Copy();
ReplaceSelected( OUString() );
@@ -2573,7 +2572,7 @@ void Edit::Cut()
void Edit::Copy()
{
- if ( !(GetStyle() & WB_PASSWORD ) )
+ if ( !mbPassword )
{
css::uno::Reference<css::datatransfer::clipboard::XClipboard> aClipboard(GetClipboard());
ImplCopy( aClipboard );
@@ -2811,7 +2810,7 @@ void Edit::dragGestureRecognized( const css::datatransfer::dnd::DragGestureEvent
SolarMutexGuard aVclGuard;
if ( !IsTracking() && maSelection.Len() &&
- !(GetStyle() & WB_PASSWORD) && (!mpDDInfo || !mpDDInfo->bStarterOfDD) ) // no repeated D&D
+ !mbPassword && (!mpDDInfo || !mpDDInfo->bStarterOfDD) ) // no repeated D&D
{
Selection aSel( maSelection );
aSel.Justify();
diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx
index 22698064a399..37ff8ddcff82 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -318,7 +318,7 @@ sal_uInt16 Window::getDefaultAccessibleRole() const
case WindowType::PATTERNFIELD:
case WindowType::CALCINPUTLINE:
- case WindowType::EDIT: nRole = ( GetStyle() & WB_PASSWORD ) ? accessibility::AccessibleRole::PASSWORD_TEXT : accessibility::AccessibleRole::TEXT; break;
+ case WindowType::EDIT: nRole = static_cast<Edit const *>(this)->IsPassword() ? accessibility::AccessibleRole::PASSWORD_TEXT : accessibility::AccessibleRole::TEXT; break;
case WindowType::PATTERNBOX:
case WindowType::NUMERICBOX:
More information about the Libreoffice-commits
mailing list