summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-29 12:25:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-02 08:47:48 +0200
commitd98f1e4e0373782ad71b945dcc92c1c3d6dcf6c8 (patch)
treea39deddf841d478d7baa5e96829891447383a597 /svx
parent683fa7b68673c8c6563ee493b8b5682bb6fd1b8a (diff)
loplugin:unusedfields improve checking for write-only fields
we trade off a little accuracy for finding more possible write-only fields. Change-Id: I9f7edba99481fe4ded0a9d8e45e911b0ee99d269 Reviewed-on: https://gerrit.libreoffice.org/56715 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/fntctrl.cxx6
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx24
2 files changed, 8 insertions, 22 deletions
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 311cfdd10d7b..0168c02d7e0c 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -1571,7 +1571,7 @@ void FontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
else
{
if (pImpl->mbUseResText)
- pImpl->maText = GetText();
+ pImpl->maText = OUString();
else if (!pImpl->mbSelection && !pImpl->mbTextInited)
{
using namespace css::i18n::ScriptType;
@@ -1611,7 +1611,7 @@ void FontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
}
if (pImpl->maText.isEmpty())
- pImpl->maText = GetText();
+ pImpl->maText = OUString();
if (pImpl->maText.isEmpty())
{ // fdo#58427: still no text? let's try that one...
@@ -1620,7 +1620,7 @@ void FontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
bool bEmpty = CleanAndCheckEmpty(pImpl->maText);
if (bEmpty)
- pImpl->maText = GetText();
+ pImpl->maText = OUString();
if (pImpl->maText.getLength() > (TEXT_WIDTH - 1))
{
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 325ca4359d7d..84a704ba8a75 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3762,10 +3762,8 @@ ColorListBox::ColorListBox(weld::MenuButton* pControl, weld::Window* pTopLevel)
, m_pTopLevel(pTopLevel)
, m_aColorWrapper(this)
, m_aAutoDisplayColor(Application::GetSettings().GetStyleSettings().GetDialogColor())
- , m_nSlotId(0)
- , m_bShowNoneButton(false)
{
- m_aSelectedColor = GetAutoColor(m_nSlotId);
+ m_aSelectedColor = GetAutoColor(0);
LockWidthRequest();
ShowPreview(m_aSelectedColor);
}
@@ -3793,15 +3791,13 @@ void ColorListBox::createColorWindow()
OUString() /*m_aCommandURL*/,
m_xPaletteManager,
m_aBorderColorStatus,
- m_nSlotId,
+ 0, // slotID
xFrame,
m_pTopLevel,
m_xButton.get(),
m_aColorWrapper));
SetNoSelection();
- if (m_bShowNoneButton)
- m_xColorWindow->ShowNoneButton();
m_xButton->set_popover(m_xColorWindow->GetWidget());
m_xColorWindow->SelectEntry(m_aSelectedColor);
}
@@ -3865,20 +3861,10 @@ void ColorListBox::ShowPreview(const NamedColor &rColor)
ScopedVclPtrInstance<VirtualDevice> xDevice;
xDevice->SetOutputSize(aImageSize);
const tools::Rectangle aRect(Point(0, 0), aImageSize);
- if (m_bShowNoneButton && rColor.first == COL_NONE_COLOR)
- {
- const Color aW(COL_WHITE);
- const Color aG(0xef, 0xef, 0xef);
- xDevice->DrawCheckered(aRect.TopLeft(), aRect.GetSize(), 8, aW, aG);
- xDevice->SetFillColor();
- }
+ if (rColor.first == COL_AUTO)
+ xDevice->SetFillColor(m_aAutoDisplayColor);
else
- {
- if (rColor.first == COL_AUTO)
- xDevice->SetFillColor(m_aAutoDisplayColor);
- else
- xDevice->SetFillColor(rColor.first);
- }
+ xDevice->SetFillColor(rColor.first);
xDevice->SetLineColor(rStyleSettings.GetDisableColor());
xDevice->DrawRect(aRect);