summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-04-24 20:40:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-04-25 21:55:07 +0200
commitfadcfa51e7ef5d654607e39073405fbe6c0c9568 (patch)
tree0a6646e02a7d58cee3fc2d7a5c156d3ef092edca /svx
parent3d79f395ea6b0a960051615a98bfe58387c7d231 (diff)
remove newly unused SvxColorValueSet
Change-Id: Iaf7243430e50df4db84f7032eaf52728cc779c7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92896 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/SvxColorValueSet.cxx101
-rw-r--r--svx/source/tbxctrls/colrctrl.cxx8
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx2
3 files changed, 18 insertions, 93 deletions
diff --git a/svx/source/tbxctrls/SvxColorValueSet.cxx b/svx/source/tbxctrls/SvxColorValueSet.cxx
index fa67ac94428d..bed00e5f9d63 100644
--- a/svx/source/tbxctrls/SvxColorValueSet.cxx
+++ b/svx/source/tbxctrls/SvxColorValueSet.cxx
@@ -23,56 +23,31 @@
#include <vcl/settings.hxx>
#include <osl/diagnose.h>
-SvxColorValueSet::SvxColorValueSet(vcl::Window* _pParent)
-: ValueSet(_pParent, WB_ITEMBORDER)
-{
- SetEdgeBlending(true);
-}
-
ColorValueSet::ColorValueSet(std::unique_ptr<weld::ScrolledWindow> pWindow)
: SvtValueSet(std::move(pWindow))
{
SetEdgeBlending(true);
}
-sal_uInt32 SvxColorValueSet::getMaxRowCount()
+sal_uInt32 ColorValueSet::getMaxRowCount()
{
return StyleSettings::GetColorValueSetMaximumRowCount();
}
-sal_uInt32 SvxColorValueSet::getEntryEdgeLength()
+sal_uInt32 ColorValueSet::getEntryEdgeLength()
{
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
return rStyleSettings.GetListBoxPreviewDefaultPixelSize().Height() + 1;
}
-sal_uInt32 SvxColorValueSet::getColumnCount()
+sal_uInt32 ColorValueSet::getColumnCount()
{
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
return rStyleSettings.GetColorValueSetColumnCount();
}
-void SvxColorValueSet::addEntriesForXColorList(const XColorList& rXColorList, sal_uInt32 nStartIndex)
-{
- const sal_uInt32 nColorCount(rXColorList.Count());
-
- for(sal_uInt32 nIndex(0); nIndex < nColorCount; nIndex++, nStartIndex++)
- {
- const XColorEntry* pEntry = rXColorList.GetColor(nIndex);
-
- if(pEntry)
- {
- InsertItem(nStartIndex, pEntry->GetColor(), pEntry->GetName());
- }
- else
- {
- OSL_ENSURE(false, "OOps, XColorList with empty entries (!)");
- }
- }
-}
-
void ColorValueSet::addEntriesForXColorList(const XColorList& rXColorList, sal_uInt32 nStartIndex)
{
const sal_uInt32 nColorCount(rXColorList.Count());
@@ -120,11 +95,11 @@ Size ColorValueSet::layoutAllVisible(sal_uInt32 nEntryCount)
nEntryCount++;
}
- const sal_uInt32 nRowCount(ceil(double(nEntryCount)/SvxColorValueSet::getColumnCount()));
- const Size aItemSize(SvxColorValueSet::getEntryEdgeLength() - 2, SvxColorValueSet::getEntryEdgeLength() - 2);
+ const sal_uInt32 nRowCount(ceil(double(nEntryCount)/ColorValueSet::getColumnCount()));
+ const Size aItemSize(ColorValueSet::getEntryEdgeLength() - 2, ColorValueSet::getEntryEdgeLength() - 2);
const WinBits aWinBits(GetStyle() & ~WB_VSCROLL);
- if (nRowCount > SvxColorValueSet::getMaxRowCount())
+ if (nRowCount > ColorValueSet::getMaxRowCount())
{
SetStyle(aWinBits|WB_VSCROLL);
}
@@ -133,70 +108,20 @@ Size ColorValueSet::layoutAllVisible(sal_uInt32 nEntryCount)
SetStyle(aWinBits);
}
- SetColCount(SvxColorValueSet::getColumnCount());
- SetLineCount(std::min(nRowCount, SvxColorValueSet::getMaxRowCount()));
+ SetColCount(ColorValueSet::getColumnCount());
+ SetLineCount(std::min(nRowCount, ColorValueSet::getMaxRowCount()));
SetItemWidth(aItemSize.Width());
SetItemHeight(aItemSize.Height());
return CalcWindowSizePixel(aItemSize);
}
-void SvxColorValueSet::Resize()
-{
- layoutToGivenHeight(GetSizePixel().Height(), GetItemCount());
- ValueSet::Resize();
-}
-
void ColorValueSet::Resize()
{
layoutToGivenHeight(GetOutputSizePixel().Height(), GetItemCount());
SvtValueSet::Resize();
}
-Size SvxColorValueSet::layoutToGivenHeight(sal_uInt32 nHeight, sal_uInt32 nEntryCount)
-{
- if(!nEntryCount)
- {
- nEntryCount++;
- }
-
- const Size aItemSize(getEntryEdgeLength() - 2, getEntryEdgeLength() - 2);
- const WinBits aWinBits(GetStyle() & ~WB_VSCROLL);
-
- // get size with all fields disabled
- const WinBits aWinBitsNoScrollNoFields(GetStyle() & ~(WB_VSCROLL|WB_NAMEFIELD|WB_NONEFIELD));
- SetStyle(aWinBitsNoScrollNoFields);
- const Size aSizeNoScrollNoFields(CalcWindowSizePixel(aItemSize, getColumnCount()));
-
- // get size with all needed fields
- SetStyle(aWinBits);
- Size aNewSize(CalcWindowSizePixel(aItemSize, getColumnCount()));
-
- const Size aItemSizePixel(CalcItemSizePixel(aItemSize));
- // calculate field height and available height for requested height
- const sal_uInt32 nFieldHeight(aNewSize.Height() - aSizeNoScrollNoFields.Height());
- const sal_uInt32 nAvailableHeight(nHeight >= nFieldHeight ? nHeight - nFieldHeight + aItemSizePixel.Height() - 1 : 0);
-
- // calculate how many lines can be shown there
- const sal_uInt32 nLineCount(nAvailableHeight / aItemSizePixel.Height());
- const sal_uInt32 nLineMax(ceil(double(nEntryCount)/getColumnCount()));
-
- if(nLineMax > nLineCount)
- {
- SetStyle(aWinBits|WB_VSCROLL);
- }
-
- // set height to wanted height
- aNewSize.setHeight( nHeight );
-
- SetItemWidth(aItemSize.Width());
- SetItemHeight(aItemSize.Height());
- SetColCount(getColumnCount());
- SetLineCount(nLineCount);
-
- return aNewSize;
-}
-
Size ColorValueSet::layoutToGivenHeight(sal_uInt32 nHeight, sal_uInt32 nEntryCount)
{
if(!nEntryCount)
@@ -204,17 +129,17 @@ Size ColorValueSet::layoutToGivenHeight(sal_uInt32 nHeight, sal_uInt32 nEntryCou
nEntryCount++;
}
- const Size aItemSize(SvxColorValueSet::getEntryEdgeLength() - 2, SvxColorValueSet::getEntryEdgeLength() - 2);
+ const Size aItemSize(ColorValueSet::getEntryEdgeLength() - 2, ColorValueSet::getEntryEdgeLength() - 2);
const WinBits aWinBits(GetStyle() & ~WB_VSCROLL);
// get size with all fields disabled
const WinBits aWinBitsNoScrollNoFields(GetStyle() & ~(WB_VSCROLL|WB_NAMEFIELD|WB_NONEFIELD));
SetStyle(aWinBitsNoScrollNoFields);
- const Size aSizeNoScrollNoFields(CalcWindowSizePixel(aItemSize, SvxColorValueSet::getColumnCount()));
+ const Size aSizeNoScrollNoFields(CalcWindowSizePixel(aItemSize, ColorValueSet::getColumnCount()));
// get size with all needed fields
SetStyle(aWinBits);
- Size aNewSize(CalcWindowSizePixel(aItemSize, SvxColorValueSet::getColumnCount()));
+ Size aNewSize(CalcWindowSizePixel(aItemSize, ColorValueSet::getColumnCount()));
const Size aItemSizePixel(CalcItemSizePixel(aItemSize));
// calculate field height and available height for requested height
@@ -223,7 +148,7 @@ Size ColorValueSet::layoutToGivenHeight(sal_uInt32 nHeight, sal_uInt32 nEntryCou
// calculate how many lines can be shown there
const sal_uInt32 nLineCount(nAvailableHeight / aItemSizePixel.Height());
- const sal_uInt32 nLineMax(ceil(double(nEntryCount)/SvxColorValueSet::getColumnCount()));
+ const sal_uInt32 nLineMax(ceil(double(nEntryCount)/ColorValueSet::getColumnCount()));
if(nLineMax > nLineCount)
{
@@ -235,7 +160,7 @@ Size ColorValueSet::layoutToGivenHeight(sal_uInt32 nHeight, sal_uInt32 nEntryCou
SetItemWidth(aItemSize.Width());
SetItemHeight(aItemSize.Height());
- SetColCount(SvxColorValueSet::getColumnCount());
+ SetColCount(ColorValueSet::getColumnCount());
SetLineCount(nLineCount);
return aNewSize;
diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx
index 72120453eb70..71b637ea5937 100644
--- a/svx/source/tbxctrls/colrctrl.cxx
+++ b/svx/source/tbxctrls/colrctrl.cxx
@@ -208,10 +208,10 @@ SvxColorDockingWindow::SvxColorDockingWindow(SfxBindings* _pBindings, SfxChildWi
}
}
- aItemSize = xColorSet->CalcItemSizePixel(Size(SvxColorValueSet::getEntryEdgeLength(), SvxColorValueSet::getEntryEdgeLength()));
- aItemSize.setWidth( aItemSize.Width() + SvxColorValueSet::getEntryEdgeLength() );
+ aItemSize = xColorSet->CalcItemSizePixel(Size(ColorValueSet::getEntryEdgeLength(), ColorValueSet::getEntryEdgeLength()));
+ aItemSize.setWidth( aItemSize.Width() + ColorValueSet::getEntryEdgeLength() );
aItemSize.setWidth( aItemSize.Width() / 2 );
- aItemSize.setHeight( aItemSize.Height() + SvxColorValueSet::getEntryEdgeLength() );
+ aItemSize.setHeight( aItemSize.Height() + ColorValueSet::getEntryEdgeLength() );
aItemSize.setHeight( aItemSize.Height() / 2 );
fprintf(stderr, "size is %ld %ld\n", aItemSize.Width(), aItemSize.Height());
@@ -256,7 +256,7 @@ void SvxColorDockingWindow::FillValueSet()
xColorSet->addEntriesForXColorList(*pColorList, 2);
// create the last entry for 'invisible/none'
- const Size aColorSize(SvxColorValueSet::getEntryEdgeLength(), SvxColorValueSet::getEntryEdgeLength());
+ const Size aColorSize(ColorValueSet::getEntryEdgeLength(), ColorValueSet::getEntryEdgeLength());
long nPtX = aColorSize.Width() - 1;
long nPtY = aColorSize.Height() - 1;
ScopedVclPtrInstance< VirtualDevice > pVD;
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index a56ab368f12a..1b4961caae17 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1826,7 +1826,7 @@ ColorWindow::ColorWindow(const OUString& rCommand,
mxColorSet->SetHelpId(HID_POPUP_COLOR_CTRL);
mxPaletteManager->ReloadColorSet(*mxColorSet);
- const sal_uInt32 nMaxItems(SvxColorValueSet::getMaxRowCount() * SvxColorValueSet::getColumnCount());
+ const sal_uInt32 nMaxItems(ColorValueSet::getMaxRowCount() * ColorValueSet::getColumnCount());
Size aSize = mxColorSet->layoutAllVisible(nMaxItems);
mxColorSet->set_size_request(aSize.Width(), aSize.Height());