[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - svx/source
Caolán McNamara
caolanm at redhat.com
Tue Feb 28 10:54:23 UTC 2017
svx/source/tbxctrls/tbcontrl.cxx | 61 +++++++++++++++++++++++----------------
1 file changed, 36 insertions(+), 25 deletions(-)
New commits:
commit 14ac9a27ff8ab198d002bafde7923bf2b833254a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Feb 20 21:24:25 2017 +0000
Resolves: tdf#106099 tweak to restore old behaviour
wrt initial default color if none gets set.
This doesn't fix the various bizarre things in font and replace by formats, just
restore to its historical initial behaviour
(cherry picked from commit 0fa4efec2e58ecd8d749972f1e8c2a20d1c3a6bc)
Change-Id: I82cc3f05d2f205947a140483537baae882e91530
Reviewed-on: https://gerrit.libreoffice.org/34510
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 6e7b8e0..4c93b9b 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1477,35 +1477,44 @@ NamedColor SvxColorWindow::GetNoneColor() const
return std::make_pair(aColor, sColorName);
}
-NamedColor SvxColorWindow::GetAutoColor() const
+namespace
{
- Color aColor;
- OUString sColorName;
- switch (theSlotId)
+ NamedColor GetAutoColor(sal_uInt16 nSlotId)
{
- case SID_ATTR_CHAR_COLOR_BACKGROUND:
- case SID_BACKGROUND_COLOR:
- case SID_ATTR_CHAR_BACK_COLOR:
- aColor = COL_TRANSPARENT;
- sColorName = SVX_RESSTR(RID_SVXSTR_NOFILL);
- break;
- case SID_AUTHOR_COLOR:
- aColor = COL_TRANSPARENT;
- sColorName = SVX_RESSTR(RID_SVXSTR_BY_AUTHOR);
- break;
- case SID_BMPMASK_COLOR:
- aColor = COL_TRANSPARENT;
- sColorName = SVX_RESSTR(RID_SVXSTR_TRANSPARENT);
- break;
- case SID_ATTR_CHAR_COLOR:
- case SID_ATTR_CHAR_COLOR2:
- case SID_EXTRUSION_3D_COLOR:
- aColor = COL_AUTO;
- sColorName = SVX_RESSTR(RID_SVXSTR_AUTOMATIC);
- break;
+ Color aColor;
+ OUString sColorName;
+ switch (nSlotId)
+ {
+ case SID_ATTR_CHAR_COLOR_BACKGROUND:
+ case SID_BACKGROUND_COLOR:
+ case SID_ATTR_CHAR_BACK_COLOR:
+ aColor = COL_TRANSPARENT;
+ sColorName = SVX_RESSTR(RID_SVXSTR_NOFILL);
+ break;
+ case SID_AUTHOR_COLOR:
+ aColor = COL_TRANSPARENT;
+ sColorName = SVX_RESSTR(RID_SVXSTR_BY_AUTHOR);
+ break;
+ case SID_BMPMASK_COLOR:
+ aColor = COL_TRANSPARENT;
+ sColorName = SVX_RESSTR(RID_SVXSTR_TRANSPARENT);
+ break;
+ case SID_ATTR_CHAR_COLOR:
+ case SID_ATTR_CHAR_COLOR2:
+ case SID_EXTRUSION_3D_COLOR:
+ default:
+ aColor = COL_AUTO;
+ sColorName = SVX_RESSTR(RID_SVXSTR_AUTOMATIC);
+ break;
+ }
+
+ return std::make_pair(aColor, sColorName);
}
+}
- return std::make_pair(aColor, sColorName);
+NamedColor SvxColorWindow::GetAutoColor() const
+{
+ return ::GetAutoColor(theSlotId);
}
IMPL_LINK(SvxColorWindow, AutoColorClickHdl, Button*, pButton, void)
@@ -3213,7 +3222,9 @@ SvxColorListBox::SvxColorListBox(vcl::Window* pParent, WinBits nStyle)
, m_nSlotId(0)
, m_bShowNoneButton(false)
{
+ m_aSelectedColor = GetAutoColor(m_nSlotId);
LockWidthRequest();
+ ShowPreview(m_aSelectedColor);
m_aPaletteManager.SetColorSelectFunction(m_aColorWrapper);
SetActivateHdl(LINK(this, SvxColorListBox, MenuActivateHdl));
SetNoSelection();
More information about the Libreoffice-commits
mailing list