summaryrefslogtreecommitdiff
path: root/vcl/source/control/edit.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-26 14:14:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-27 08:20:00 +0200
commitcca4d9ab39499562614f0f778a2fffe5a40fde88 (patch)
tree79f2482d1f1bf8acd8bd7e00769f259d8fb70825 /vcl/source/control/edit.cxx
parent49e39c9225cc9be201231d3a02fa49b6a7214d93 (diff)
convert WB_PASSWORD to a bool field on Edit
Change-Id: Ie1e03bcdf57e6ba3e2a6ba8596d70a2d7a88eaba Reviewed-on: https://gerrit.libreoffice.org/53520 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/control/edit.cxx')
-rw-r--r--vcl/source/control/edit.cxx19
1 files changed, 9 insertions, 10 deletions
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();