[Libreoffice-commits] core.git: chart2/source include/tools include/vcl sc/source vcl/source
Noel Grandin
noel.grandin at collabora.co.uk
Tue Oct 3 11:46:50 UTC 2017
chart2/source/controller/dialogs/tp_DataSource.cxx | 4 ++--
chart2/source/controller/dialogs/tp_RangeChooser.cxx | 2 +-
include/tools/wintypes.hxx | 1 -
include/vcl/edit.hxx | 5 ++++-
sc/source/ui/condformat/condformatdlgentry.cxx | 4 ++--
vcl/source/control/edit.cxx | 5 +++--
6 files changed, 12 insertions(+), 9 deletions(-)
New commits:
commit bbb1975d9c56b410023580a0e5fe95ed3e43496b
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Oct 3 12:06:05 2017 +0200
convert WB_FORCECTRLBACKGROUND to bool field on Edit
Change-Id: I7a8731635bd22926df98cd70c8bb850408c1854c
Reviewed-on: https://gerrit.libreoffice.org/43076
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index 627b96aae979..e3e2ebfcbdc6 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -241,8 +241,8 @@ DataSourceTabPage::DataSourceTabPage(
m_pEDT_CATEGORIES->SetUpdateDataHdl( LINK( this, DataSourceTabPage, RangeUpdateDataHdl ));
// #i75179# enable setting the background to a different color
- m_pEDT_RANGE->SetStyle( m_pEDT_RANGE->GetStyle() | WB_FORCECTRLBACKGROUND );
- m_pEDT_CATEGORIES->SetStyle( m_pEDT_CATEGORIES->GetStyle() | WB_FORCECTRLBACKGROUND );
+ m_pEDT_RANGE->SetForceControlBackground(true);
+ m_pEDT_CATEGORIES->SetForceControlBackground(true);
// set symbol font for arrows
// note: StarSymbol is substituted to OpenSymbol for OOo
diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.cxx b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
index c4ec2b3f24f1..877a023a987b 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
@@ -112,7 +112,7 @@ RangeChooserTabPage::RangeChooserTabPage( vcl::Window* pParent
m_pIB_Range->SetClickHdl( LINK( this, RangeChooserTabPage, ChooseRangeHdl ));
// #i75179# enable setting the background to a different color
- m_pED_Range->SetStyle( m_pED_Range->GetStyle() | WB_FORCECTRLBACKGROUND );
+ m_pED_Range->SetForceControlBackground(true);
m_pED_Range->SetUpdateDataHdl( LINK( this, RangeChooserTabPage, ControlChangedHdl ));
m_pED_Range->SetModifyHdl( LINK( this, RangeChooserTabPage, ControlEditedHdl ));
diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx
index 3c53438c4384..897e63e520e1 100644
--- a/include/tools/wintypes.hxx
+++ b/include/tools/wintypes.hxx
@@ -198,7 +198,6 @@ WinBits const WB_EARLYTOGGLE = SAL_CONST_INT64(0x4000000000);
WinBits const WB_PASSWORD = 0x01000000;
WinBits const WB_READONLY = 0x02000000;
WinBits const WB_NOHIDESELECTION = SAL_CONST_INT64(0x1000000000);
-WinBits const WB_FORCECTRLBACKGROUND = 0x80000000;
// Window-Bits for MultiLineEdit
WinBits const WB_IGNORETAB = 0x20000000;
diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx
index 75b571ff87ca..9588da8b6fe6 100644
--- a/include/vcl/edit.hxx
+++ b/include/vcl/edit.hxx
@@ -89,7 +89,8 @@ private:
mbInsertMode:1,
mbClickedInSelection:1,
mbIsSubEdit:1,
- mbActivePopup:1;
+ mbActivePopup:1,
+ mbForceControlBackground:1;
Link<Edit&,void> maModifyHdl;
Link<Edit&,void> maUpdateDataHdl;
Link<Edit&,void> maAutocompleteHdl;
@@ -266,6 +267,8 @@ public:
// returns the minimum size a bordered Edit should have given the current
// global style settings (needed by sc's inputwin.cxx)
static Size GetMinimumEditSize();
+
+ void SetForceControlBackground(bool b) { mbForceControlBackground = b; }
};
#endif // INCLUDED_VCL_EDIT_HXX
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index af081bf65606..3eb26f737e8d 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -270,8 +270,8 @@ void ScConditionFrmtEntry::Init(ScCondFormatDlg* pDialogParent)
maEdVal1->SetGetFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeGetFocusHdl ) );
maEdVal2->SetGetFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeGetFocusHdl ) );
- maEdVal1->SetStyle( maEdVal1->GetStyle() | WB_FORCECTRLBACKGROUND );
- maEdVal2->SetStyle( maEdVal2->GetStyle() | WB_FORCECTRLBACKGROUND );
+ maEdVal1->SetForceControlBackground(true);
+ maEdVal2->SetForceControlBackground(true);
maEdVal1->SetModifyHdl( LINK( this, ScConditionFrmtEntry, OnEdChanged ) );
maEdVal2->SetModifyHdl( LINK( this, ScConditionFrmtEntry, OnEdChanged ) );
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 96e4eb76962d..8edf98b274e1 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -282,6 +282,7 @@ void Edit::ImplInitEditData()
mbClickedInSelection = false;
mbActivePopup = false;
mbIsSubEdit = false;
+ mbForceControlBackground = false;
mpDDInfo = nullptr;
mpIMEInfos = nullptr;
mcEchoChar = 0;
@@ -512,7 +513,7 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const tools::Rectangl
rRenderContext.SetTextColor(rStyleSettings.GetDisableColor());
// Set background color of the normal text
- if ((GetStyle() & WB_FORCECTRLBACKGROUND) != 0 && IsControlBackground())
+ if (mbForceControlBackground && IsControlBackground())
{
// check if we need to set ControlBackground even in NWF case
rRenderContext.Push(PushFlags::FILLCOLOR | PushFlags::LINECOLOR);
@@ -584,7 +585,7 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const tools::Rectangl
// Set background color when part of the text is selected
if (ImplUseNativeBorder(rRenderContext, GetStyle()))
{
- if( (GetStyle() & WB_FORCECTRLBACKGROUND) != 0 && IsControlBackground() )
+ if( mbForceControlBackground && IsControlBackground() )
rRenderContext.SetTextFillColor(GetControlBackground());
else
rRenderContext.SetTextFillColor();
More information about the Libreoffice-commits
mailing list