summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-05 20:28:27 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-11-07 21:04:50 +0000
commit64a708cba9b954afe3331f63c58218eb53b3d0ce (patch)
treeddc1bea3b63f32a1c6d377c1d1dd7aee0803fb70 /sc
parentf01c49c4a89ecad2376fd0023625186e5cac642e (diff)
Revert "Reverts a commit series that cripple windows ci."
with addition of... - svxlo-SvxColorListBox + svxcorelo-SvxColorListBox This reverts commit db380aab1063e8a5e40111c40ee9f7921aa82601. Change-Id: I3af7aa0abb1a430bce64188244404fcbd480b128 Reviewed-on: https://gerrit.libreoffice.org/30598 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/sc.hrc2
-rw-r--r--sc/source/ui/condformat/colorformat.cxx57
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx79
-rw-r--r--sc/source/ui/dbgui/scendlg.cxx22
-rw-r--r--sc/source/ui/drawfunc/drawsh4.cxx25
-rw-r--r--sc/source/ui/drawfunc/drtxtob2.cxx25
-rw-r--r--sc/source/ui/inc/colorformat.hxx8
-rw-r--r--sc/source/ui/inc/condformatdlgentry.hxx11
-rw-r--r--sc/source/ui/inc/opredlin.hxx9
-rw-r--r--sc/source/ui/inc/scendlg.hxx4
-rw-r--r--sc/source/ui/inc/tpview.hxx3
-rw-r--r--sc/source/ui/optdlg/opredlin.cxx114
-rw-r--r--sc/source/ui/optdlg/tpview.cxx59
-rw-r--r--sc/source/ui/src/scstring.src5
-rw-r--r--sc/uiconfig/scalc/ui/conditionalentry.ui6
-rw-r--r--sc/uiconfig/scalc/ui/databaroptions.ui17
-rw-r--r--sc/uiconfig/scalc/ui/optchangespage.ui8
-rw-r--r--sc/uiconfig/scalc/ui/scenariodialog.ui2
-rw-r--r--sc/uiconfig/scalc/ui/tpviewpage.ui2
19 files changed, 77 insertions, 381 deletions
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 26bd9e97885e..64ae387c84e3 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -827,7 +827,7 @@
#define SCSTR_ORIENTATION_TOPBOTTOM (STR_START + 110)
#define SCSTR_ORIENTATION_BOTTOMTOP (STR_START + 111)
#define SCSTR_ORIENTATION_STANDARD (STR_START + 112)
-#define SCSTR_AUTHOR (STR_START + 113)
+//free
#define SCSTR_UNIT (STR_START + 114)
// print options
diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index ab2e08983b3f..f6e9ebc4eb9d 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -13,6 +13,7 @@
#include "document.hxx"
#include "sc.hrc"
+#include <svx/colorbox.hxx>
#include <svx/xtable.hxx>
#include <svx/drawitem.hxx>
#include <vcl/msgbox.hxx>
@@ -66,16 +67,6 @@ void SetValue( ScDocument* pDoc, ScColorScaleEntry* pEntry, Edit& aEdit)
aEdit.Disable();
}
-void SelectColor(const Color& aColor, const OUString & aCustomName, ColorListBox& rLstBox)
-{
- rLstBox.SelectEntry( aColor );
- if ( rLstBox.GetSelectEntryColor() != aColor )
- {
- rLstBox.InsertEntry( aColor, aCustomName );
- rLstBox.SelectEntry( aColor );
- }
-}
-
}
ScDataBarSettingsDlg::ScDataBarSettingsDlg(vcl::Window* pWindow, const ScDataBarFormatData& rData, ScDocument* pDoc, const ScAddress& rPos):
@@ -100,14 +91,13 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(vcl::Window* pWindow, const ScDataBar
get( mpCbOnlyBar, "only_bar");
maStrWarnSameValue = get<FixedText>("str_same_value")->GetText();
- maCustomColor = get<FixedText>("custom_color")->GetText();
Init();
- ::SelectColor( rData.maPositiveColor, maCustomColor, *mpLbPos);
+ mpLbPos->SelectEntry(rData.maPositiveColor);
mpLbFillType->SelectEntryPos( rData.mbGradient ? 1 : 0 );
- if(rData.mpNegativeColor)
- ::SelectColor( *rData.mpNegativeColor, maCustomColor, *mpLbNeg );
+ if (rData.mpNegativeColor)
+ mpLbNeg->SelectEntry(*rData.mpNegativeColor);
switch (rData.meAxisPosition)
{
@@ -160,42 +150,9 @@ void ScDataBarSettingsDlg::dispose()
void ScDataBarSettingsDlg::Init()
{
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
- XColorListRef pColorTable;
-
- DBG_ASSERT( pDocSh, "DocShell not found!" );
-
- if ( pDocSh )
- {
- const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
- if ( pItem != nullptr )
- pColorTable = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
- }
- if ( pColorTable.is() )
- {
- // filling the line color box
- mpLbPos->SetUpdateMode( false );
- mpLbNeg->SetUpdateMode( false );
- mpLbAxisCol->SetUpdateMode( false );
-
- for ( long i = 0; i < pColorTable->Count(); ++i )
- {
- const XColorEntry* pEntry = pColorTable->GetColor(i);
- mpLbPos->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- mpLbNeg->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- mpLbAxisCol->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
-
- if(pEntry->GetColor() == Color(COL_LIGHTRED))
- mpLbNeg->SelectEntryPos(i);
- if(pEntry->GetColor() == Color(COL_BLACK))
- mpLbAxisCol->SelectEntryPos(i);
- if(pEntry->GetColor() == Color(COL_LIGHTBLUE))
- mpLbPos->SelectEntryPos(i);
- }
- mpLbPos->SetUpdateMode( true );
- mpLbNeg->SetUpdateMode( true );
- mpLbAxisCol->SetUpdateMode( true );
- }
+ mpLbNeg->SelectEntry(Color(COL_LIGHTRED));
+ mpLbAxisCol->SelectEntry(Color(COL_BLACK));
+ mpLbPos->SelectEntry(Color(COL_LIGHTBLUE));
mpBtnOk->SetClickHdl( LINK( this, ScDataBarSettingsDlg, OkBtnHdl ) );
mpLbTypeMin->SetSelectHdl( LINK( this, ScDataBarSettingsDlg, TypeSelectHdl ) );
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 415aa11274e5..f4273992e9f4 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -18,6 +18,7 @@
#include <sfx2/dispatch.hxx>
#include <svl/stritem.hxx>
#include <svl/intitem.hxx>
+#include <svx/colorbox.hxx>
#include <svx/xtable.hxx>
#include <svx/drawitem.hxx>
#include <vcl/msgbox.hxx>
@@ -663,7 +664,7 @@ OUString convertNumberToString(double nVal, ScDocument* pDoc)
return aText;
}
-void SetColorScaleEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Edit& rEdit, ColorListBox& rLbCol, ScDocument* pDoc )
+void SetColorScaleEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Edit& rEdit, SvxColorListBox& rLbCol, ScDocument* pDoc )
{
// entry Automatic is not available for color scales
sal_Int32 nIndex = static_cast<sal_Int32>(rEntry.GetType());
@@ -726,7 +727,7 @@ void SetColorScaleEntry( ScColorScaleEntry* pEntry, const ListBox& rType, const
}
}
-ScColorScaleEntry* createColorScaleEntry( const ListBox& rType, const ColorListBox& rColor, const Edit& rValue, ScDocument* pDoc, const ScAddress& rPos )
+ScColorScaleEntry* createColorScaleEntry( const ListBox& rType, const SvxColorListBox& rColor, const Edit& rValue, ScDocument* pDoc, const ScAddress& rPos )
{
ScColorScaleEntry* pEntry = new ScColorScaleEntry();
@@ -796,38 +797,8 @@ void ScColorScale2FrmtEntry::Init()
{
maLbEntryTypeMin->SetSelectHdl( LINK( this, ScColorScale2FrmtEntry, EntryTypeHdl ) );
maLbEntryTypeMax->SetSelectHdl( LINK( this, ScColorScale2FrmtEntry, EntryTypeHdl ) );
-
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
- XColorListRef pColorTable;
-
- DBG_ASSERT( pDocSh, "DocShell not found!" );
-
- if ( pDocSh )
- {
- const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
- if ( pItem != nullptr )
- pColorTable = static_cast<const SvxColorListItem*>(pItem) ->GetColorList();
- }
- if ( pColorTable.is() )
- {
- // filling the line color box
- maLbColMin->SetUpdateMode( false );
- maLbColMax->SetUpdateMode( false );
-
- for ( long i = 0; i < pColorTable->Count(); ++i )
- {
- const XColorEntry* pEntry = pColorTable->GetColor(i);
- maLbColMin->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- maLbColMax->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
-
- if(pEntry->GetColor() == Color(COL_LIGHTRED))
- maLbColMin->SelectEntryPos(i);
- if(pEntry->GetColor() == Color(COL_LIGHTBLUE))
- maLbColMax->SelectEntryPos(i);
- }
- maLbColMin->SetUpdateMode( true );
- maLbColMax->SetUpdateMode( true );
- }
+ maLbColMin->SelectEntry(Color(COL_LIGHTRED));
+ maLbColMax->SelectEntry(Color(COL_LIGHTBLUE));
}
ScFormatEntry* ScColorScale2FrmtEntry::createColorscaleEntry() const
@@ -976,43 +947,9 @@ void ScColorScale3FrmtEntry::Init()
maLbEntryTypeMin->SetSelectHdl( LINK( this, ScColorScale3FrmtEntry, EntryTypeHdl ) );
maLbEntryTypeMax->SetSelectHdl( LINK( this, ScColorScale3FrmtEntry, EntryTypeHdl ) );
maLbEntryTypeMiddle->SetSelectHdl( LINK( this, ScColorScale3FrmtEntry, EntryTypeHdl ) );
-
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
- XColorListRef pColorTable;
-
- DBG_ASSERT( pDocSh, "DocShell not found!" );
-
- if ( pDocSh )
- {
- const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
- if ( pItem != nullptr )
- pColorTable = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
- }
- if ( pColorTable.is() )
- {
- // filling the line color box
- maLbColMin->SetUpdateMode( false );
- maLbColMiddle->SetUpdateMode( false );
- maLbColMax->SetUpdateMode( false );
-
- for ( long i = 0; i < pColorTable->Count(); ++i )
- {
- const XColorEntry* pEntry = pColorTable->GetColor(i);
- maLbColMin->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- maLbColMiddle->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- maLbColMax->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
-
- if(pEntry->GetColor() == Color(COL_LIGHTRED))
- maLbColMin->SelectEntryPos(i);
- if(pEntry->GetColor() == Color(COL_YELLOW))
- maLbColMiddle->SelectEntryPos(i);
- if(pEntry->GetColor() == Color(0x00CC00)) // Green 3
- maLbColMax->SelectEntryPos(i);
- }
- maLbColMin->SetUpdateMode( true );
- maLbColMiddle->SetUpdateMode( true );
- maLbColMax->SetUpdateMode( true );
- }
+ maLbColMin->SelectEntry(Color(COL_LIGHTRED));
+ maLbColMiddle->SelectEntry(Color(COL_YELLOW));
+ maLbColMax->SelectEntry(Color(0x00CC00));
}
ScFormatEntry* ScColorScale3FrmtEntry::createColorscaleEntry() const
diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx
index 3cd9044ca12d..efcd657caed7 100644
--- a/sc/source/ui/dbgui/scendlg.cxx
+++ b/sc/source/ui/dbgui/scendlg.cxx
@@ -21,6 +21,7 @@
#include "scitems.hxx"
#include <comphelper/string.hxx>
+#include <svx/colorbox.hxx>
#include <svx/drawitem.hxx>
#include <svx/xtable.hxx>
#include <sfx2/objsh.hxx>
@@ -58,27 +59,6 @@ ScNewScenarioDlg::ScNewScenarioDlg( vcl::Window* pParent, const OUString& rName,
if (bIsEdit)
SetText(get<FixedText>("alttitle")->GetText());
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
- if ( pDocSh )
- {
- const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
- if ( pItem )
- {
- XColorListRef pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
- if (pColorList.is())
- {
- m_pLbColor->SetUpdateMode( false );
- long nCount = pColorList->Count();
- for ( long n=0; n<nCount; n++ )
- {
- const XColorEntry* pEntry = pColorList->GetColor(n);
- m_pLbColor->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- }
- m_pLbColor->SetUpdateMode( true );
- }
- }
- }
-
SvtUserOptions aUserOpt;
OUString sCreatedBy(get<FixedText>("createdft")->GetText());
diff --git a/sc/source/ui/drawfunc/drawsh4.cxx b/sc/source/ui/drawfunc/drawsh4.cxx
index 9e620e5099b4..01d2576c7a61 100644
--- a/sc/source/ui/drawfunc/drawsh4.cxx
+++ b/sc/source/ui/drawfunc/drawsh4.cxx
@@ -34,17 +34,8 @@
void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
{
const SdrObject* pObj = nullptr;
- SvxFontWorkDialog* pDlg = nullptr;
ScDrawView* pDrView = pViewData->GetScDrawView();
const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
- sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
-
- SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
- if (pViewFrm->HasChildWindow(nId))
- {
- SfxChildWindow* pWnd = pViewFrm->GetChildWindow(nId);
- pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : nullptr;
- }
if ( rMarkList.GetMarkCount() == 1 )
pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
@@ -72,22 +63,6 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
}
else
{
- if ( pDlg )
- {
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
-
- if ( pDocSh )
- {
- const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
- XColorListRef pColorList;
-
- if ( pItem )
- pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
-
- if ( pColorList.is() )
- pDlg->SetColorList( pColorList );
- }
- }
SfxItemSet aViewAttr(pDrView->GetModel()->GetItemPool());
pDrView->GetAttributes(aViewAttr);
rSet.Set(aViewAttr);
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index 9a97a6aed7af..a7eb77aea3e7 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -202,17 +202,8 @@ void ScDrawTextObjectBar::ExecFormText(SfxRequest& rReq)
void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
{
const SdrObject* pObj = nullptr;
- SvxFontWorkDialog* pDlg = nullptr;
ScDrawView* pDrView = pViewData->GetView()->GetScDrawView();
const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
- sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId();
-
- SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
- if (pViewFrm->HasChildWindow(nId))
- {
- SfxChildWindow* pWnd = pViewFrm->GetChildWindow(nId);
- pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : nullptr;
- }
if ( rMarkList.GetMarkCount() == 1 )
pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
@@ -240,22 +231,6 @@ void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
}
else
{
- if ( pDlg )
- {
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
-
- if ( pDocSh )
- {
- const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
- XColorListRef pColorList;
-
- if ( pItem )
- pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
-
- if ( pColorList.is() )
- pDlg->SetColorList( pColorList );
- }
- }
SfxItemSet aViewAttr(pDrView->GetModel()->GetItemPool());
pDrView->GetAttributes(aViewAttr);
rSet.Set(aViewAttr);
diff --git a/sc/source/ui/inc/colorformat.hxx b/sc/source/ui/inc/colorformat.hxx
index 682be33c87ad..8838418cfc18 100644
--- a/sc/source/ui/inc/colorformat.hxx
+++ b/sc/source/ui/inc/colorformat.hxx
@@ -19,6 +19,7 @@
struct ScDataBarFormatData;
class ScDocument;
+class SvxColorListBox;
class ScDataBarSettingsDlg : public ModalDialog
{
@@ -26,9 +27,9 @@ private:
VclPtr<OKButton> mpBtnOk;
VclPtr<CancelButton> mpBtnCancel;
- VclPtr<ColorListBox> mpLbPos;
- VclPtr<ColorListBox> mpLbNeg;
- VclPtr<ColorListBox> mpLbAxisCol;
+ VclPtr<SvxColorListBox> mpLbPos;
+ VclPtr<SvxColorListBox> mpLbNeg;
+ VclPtr<SvxColorListBox> mpLbAxisCol;
VclPtr<ListBox> mpLbFillType;
VclPtr<ListBox> mpLbTypeMin;
@@ -43,7 +44,6 @@ private:
VclPtr<CheckBox> mpCbOnlyBar;
OUString maStrWarnSameValue;
- OUString maCustomColor;
SvNumberFormatter* mpNumberFormatter;
ScDocument* mpDoc;
diff --git a/sc/source/ui/inc/condformatdlgentry.hxx b/sc/source/ui/inc/condformatdlgentry.hxx
index cba12245772f..f7d446ff474b 100644
--- a/sc/source/ui/inc/condformatdlgentry.hxx
+++ b/sc/source/ui/inc/condformatdlgentry.hxx
@@ -18,6 +18,7 @@
class ScIconSetFrmtDataEntry;
class ScCondFormatDlg;
+class SvxColorListBox;
namespace condformat {
@@ -172,8 +173,8 @@ class ScColorScale2FrmtEntry : public ScCondFrmtEntry
VclPtr<Edit> maEdMin;
VclPtr<Edit> maEdMax;
- VclPtr<ColorListBox> maLbColMin;
- VclPtr<ColorListBox> maLbColMax;
+ VclPtr<SvxColorListBox> maLbColMin;
+ VclPtr<SvxColorListBox> maLbColMax;
ScFormatEntry* createColorscaleEntry() const;
@@ -206,9 +207,9 @@ class ScColorScale3FrmtEntry : public ScCondFrmtEntry
VclPtr<Edit> maEdMiddle;
VclPtr<Edit> maEdMax;
- VclPtr<ColorListBox> maLbColMin;
- VclPtr<ColorListBox> maLbColMiddle;
- VclPtr<ColorListBox> maLbColMax;
+ VclPtr<SvxColorListBox> maLbColMin;
+ VclPtr<SvxColorListBox> maLbColMiddle;
+ VclPtr<SvxColorListBox> maLbColMax;
ScFormatEntry* createColorscaleEntry() const;
diff --git a/sc/source/ui/inc/opredlin.hxx b/sc/source/ui/inc/opredlin.hxx
index a0a3e765c3be..69d1bfb31db4 100644
--- a/sc/source/ui/inc/opredlin.hxx
+++ b/sc/source/ui/inc/opredlin.hxx
@@ -36,11 +36,10 @@
class ScRedlineOptionsTabPage : public SfxTabPage
{
- VclPtr<ColorListBox> m_pContentColorLB;
- VclPtr<ColorListBox> m_pRemoveColorLB;
- VclPtr<ColorListBox> m_pInsertColorLB;
- VclPtr<ColorListBox> m_pMoveColorLB;
- OUString aAuthorStr;
+ VclPtr<SvxColorListBox> m_pContentColorLB;
+ VclPtr<SvxColorListBox> m_pRemoveColorLB;
+ VclPtr<SvxColorListBox> m_pInsertColorLB;
+ VclPtr<SvxColorListBox> m_pMoveColorLB;
public:
diff --git a/sc/source/ui/inc/scendlg.hxx b/sc/source/ui/inc/scendlg.hxx
index e20073c17882..3d5ecf4ce7e5 100644
--- a/sc/source/ui/inc/scendlg.hxx
+++ b/sc/source/ui/inc/scendlg.hxx
@@ -29,6 +29,8 @@
enum class ScScenarioFlags;
+class SvxColorListBox;
+
class ScNewScenarioDlg : public ModalDialog
{
public:
@@ -45,7 +47,7 @@ private:
VclPtr<Edit> m_pEdName;
VclPtr<VclMultiLineEdit> m_pEdComment;
VclPtr<CheckBox> m_pCbShowFrame;
- VclPtr<ColorListBox> m_pLbColor;
+ VclPtr<SvxColorListBox> m_pLbColor;
VclPtr<CheckBox> m_pCbTwoWay;
VclPtr<CheckBox> m_pCbCopyAll;
VclPtr<CheckBox> m_pCbProtect;
diff --git a/sc/source/ui/inc/tpview.hxx b/sc/source/ui/inc/tpview.hxx
index 359be4889d81..480d82432442 100644
--- a/sc/source/ui/inc/tpview.hxx
+++ b/sc/source/ui/inc/tpview.hxx
@@ -28,13 +28,14 @@
#include <svx/strarray.hxx>
class ScViewOptions;
+class SvxColorListBox;
class ScTpContentOptions : public SfxTabPage
{
friend class VclPtr<ScTpContentOptions>;
VclPtr<ListBox> pGridLB;
VclPtr<FixedText> pColorFT;
- VclPtr<ColorListBox> pColorLB;
+ VclPtr<SvxColorListBox> pColorLB;
VclPtr<CheckBox> pBreakCB;
VclPtr<CheckBox> pGuideLineCB;
diff --git a/sc/source/ui/optdlg/opredlin.cxx b/sc/source/ui/optdlg/opredlin.cxx
index f8fb21682a47..8a769ad24dab 100644
--- a/sc/source/ui/optdlg/opredlin.cxx
+++ b/sc/source/ui/optdlg/opredlin.cxx
@@ -19,6 +19,7 @@
#undef SC_DLLIMPLEMENTATION
+#include <svx/colorbox.hxx>
#include <svx/dlgutil.hxx>
#include <svx/drawitem.hxx>
#include <svx/xtable.hxx>
@@ -40,13 +41,16 @@
ScRedlineOptionsTabPage::ScRedlineOptionsTabPage( vcl::Window* pParent,
const SfxItemSet& rSet )
- : SfxTabPage(pParent,"OptChangesPage", "modules/scalc/ui/optchangespage.ui", &rSet),
- aAuthorStr (ScResId(SCSTR_AUTHOR))
+ : SfxTabPage(pParent,"OptChangesPage", "modules/scalc/ui/optchangespage.ui", &rSet)
{
get(m_pContentColorLB, "changes");
+ m_pContentColorLB->SetSlotId(SID_AUTHOR_COLOR);
get(m_pRemoveColorLB, "deletions");
+ m_pRemoveColorLB->SetSlotId(SID_AUTHOR_COLOR);
get(m_pInsertColorLB, "entries");
+ m_pInsertColorLB->SetSlotId(SID_AUTHOR_COLOR);
get(m_pMoveColorLB, "insertions");
+ m_pMoveColorLB->SetSlotId(SID_AUTHOR_COLOR);
}
ScRedlineOptionsTabPage::~ScRedlineOptionsTabPage()
@@ -72,53 +76,17 @@ bool ScRedlineOptionsTabPage::FillItemSet( SfxItemSet* /* rSet */ )
{
ScAppOptions aAppOptions=SC_MOD()->GetAppOptions();
- sal_uLong nNew=0;
- sal_Int32 nPos=0;
-
- nPos = m_pContentColorLB->GetSelectEntryPos();
- if (nPos != LISTBOX_ENTRY_NOTFOUND)
- {
- if (nPos!=0)
- nNew= m_pContentColorLB->GetEntryColor(nPos).GetColor();
- else
- nNew= COL_TRANSPARENT;
-
- aAppOptions.SetTrackContentColor(nNew);
-
- }
- nPos = m_pMoveColorLB->GetSelectEntryPos();
- if (nPos != LISTBOX_ENTRY_NOTFOUND)
- {
- if (nPos!=0)
- nNew= m_pMoveColorLB->GetEntryColor(nPos).GetColor();
- else
- nNew= COL_TRANSPARENT;
-
- aAppOptions.SetTrackMoveColor(nNew);
-
- }
- nPos = m_pInsertColorLB->GetSelectEntryPos();
- if (nPos != LISTBOX_ENTRY_NOTFOUND)
- {
- if (nPos!=0)
- nNew= m_pInsertColorLB->GetEntryColor(nPos).GetColor();
- else
- nNew= COL_TRANSPARENT;
-
- aAppOptions.SetTrackInsertColor(nNew);
-
- }
- nPos = m_pRemoveColorLB->GetSelectEntryPos();
- if (nPos != LISTBOX_ENTRY_NOTFOUND)
- {
- if (nPos!=0)
- nNew= m_pRemoveColorLB->GetEntryColor(nPos).GetColor();
- else
- nNew= COL_TRANSPARENT;
-
- aAppOptions.SetTrackDeleteColor(nNew);
-
- }
+ sal_uLong nNew = m_pContentColorLB->GetSelectEntryColor().GetColor();
+ aAppOptions.SetTrackContentColor(nNew);
+
+ nNew = m_pMoveColorLB->GetSelectEntryColor().GetColor();
+ aAppOptions.SetTrackMoveColor(nNew);
+
+ nNew = m_pInsertColorLB->GetSelectEntryColor().GetColor();
+ aAppOptions.SetTrackInsertColor(nNew);
+
+ nNew = m_pRemoveColorLB->GetSelectEntryColor().GetColor();
+ aAppOptions.SetTrackDeleteColor(nNew);
SC_MOD()->SetAppOptions(aAppOptions);
@@ -133,59 +101,19 @@ bool ScRedlineOptionsTabPage::FillItemSet( SfxItemSet* /* rSet */ )
void ScRedlineOptionsTabPage::Reset( const SfxItemSet* /* rSet */ )
{
- m_pContentColorLB->InsertEntry(aAuthorStr);
- m_pMoveColorLB->InsertEntry(aAuthorStr);
- m_pInsertColorLB->InsertEntry(aAuthorStr);
- m_pRemoveColorLB->InsertEntry(aAuthorStr);
-
- m_pContentColorLB->SetUpdateMode( false);
- m_pMoveColorLB->SetUpdateMode( false);
- m_pInsertColorLB->SetUpdateMode( false);
- m_pRemoveColorLB->SetUpdateMode( false);
-
- XColorListRef xColorLst = XColorList::GetStdColorList();
- for( long i = 0; i < xColorLst->Count(); ++i )
- {
- const XColorEntry* pEntry = xColorLst->GetColor(i);
- Color aColor = pEntry->GetColor();
- OUString sName = pEntry->GetName();
-
- m_pContentColorLB->InsertEntry( aColor, sName );
- m_pMoveColorLB->InsertEntry( aColor, sName );
- m_pInsertColorLB->InsertEntry( aColor, sName );
- m_pRemoveColorLB->InsertEntry( aColor, sName );
- }
- m_pContentColorLB->SetUpdateMode( true );
- m_pMoveColorLB->SetUpdateMode( true );
- m_pInsertColorLB->SetUpdateMode( true );
- m_pRemoveColorLB->SetUpdateMode( true );
-
ScAppOptions aAppOptions=SC_MOD()->GetAppOptions();
sal_uLong nColor = aAppOptions.GetTrackContentColor();
- if (nColor == COL_TRANSPARENT)
- m_pContentColorLB->SelectEntryPos(0);
- else
- m_pContentColorLB->SelectEntry(Color(nColor));
+ m_pContentColorLB->SelectEntry(Color(nColor));
nColor = aAppOptions.GetTrackMoveColor();
- if (nColor == COL_TRANSPARENT)
- m_pMoveColorLB->SelectEntryPos(0);
- else
- m_pMoveColorLB->SelectEntry(Color(nColor));
+ m_pMoveColorLB->SelectEntry(Color(nColor));
nColor = aAppOptions.GetTrackInsertColor();
- if (nColor == COL_TRANSPARENT)
- m_pInsertColorLB->SelectEntryPos(0);
- else
- m_pInsertColorLB->SelectEntry(Color(nColor));
+ m_pInsertColorLB->SelectEntry(Color(nColor));
nColor = aAppOptions.GetTrackDeleteColor();
- if (nColor == COL_TRANSPARENT)
- m_pRemoveColorLB->SelectEntryPos(0);
- else
- m_pRemoveColorLB->SelectEntry(Color(nColor));
-
+ m_pRemoveColorLB->SelectEntry(Color(nColor));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 9e254fb83c93..0257ff228bc6 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -31,6 +31,7 @@
#include "globstr.hrc"
#include <appoptio.hxx>
#include <scmod.hxx>
+#include <svx/colorbox.hxx>
#include <svx/dlgutil.hxx>
#include <svx/drawitem.hxx>
#include <svx/xtable.hxx>
@@ -151,8 +152,8 @@ bool ScTpContentOptions::FillItemSet( SfxItemSet* rCoreSet )
pBreakCB ->IsValueChangedFromSaved() ||
pGuideLineCB ->IsValueChangedFromSaved())
{
- pLocalOptions->SetGridColor( pColorLB->GetSelectEntryColor(),
- pColorLB->GetSelectEntry() );
+ NamedColor aNamedColor = pColorLB->GetSelectEntry();
+ pLocalOptions->SetGridColor(aNamedColor.first, aNamedColor.second);
rCoreSet->Put(ScTpViewItem(SID_SCVIEWOPTIONS, *pLocalOptions));
bRet = true;
}
@@ -302,58 +303,14 @@ void ScTpContentOptions::InitGridOpt()
pGridLB->SelectEntryPos (nSelPos);
- if ( pColorLB->GetEntryCount() == 0 )
- {
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
- // there might be another DocShell here
- pDocSh = dynamic_cast<ScDocShell*>( pDocSh );
-
- XColorListRef pColorList;
- if ( pDocSh )
- {
- const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
- if ( pItem )
- pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
- }
- else
- pColorList = XColorList::GetStdColorList();
-
- if ( !pColorList.is() )
- return;
-
- pColorLB->SetUpdateMode( false );
-
- // items from ColorTable
-
- long nCount = pColorList->Count();
- for ( long n=0; n<nCount; n++ )
- {
- const XColorEntry* pEntry = pColorList->GetColor(n);
- pColorLB->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- }
-
- // default GridColor
-
- Color aStdCol( SC_STD_GRIDCOLOR ); // same default as in ScViewOptions
- if ( LISTBOX_ENTRY_NOTFOUND ==
- pColorLB->GetEntryPos( aStdCol ) )
- pColorLB->InsertEntry( aStdCol, ScGlobal::GetRscString( STR_GRIDCOLOR ) );
-
- pColorLB->SetUpdateMode( true );
-
- Invalidate();
- }
-
- // also select grid color entry on subsequent calls
-
+ // select grid color entry
OUString aName;
Color aCol = pLocalOptions->GetGridColor( &aName );
- nSelPos = pColorLB->GetEntryPos( aCol );
- if ( LISTBOX_ENTRY_NOTFOUND != nSelPos )
- pColorLB->SelectEntryPos( nSelPos );
- else
- pColorLB->SelectEntryPos( pColorLB->InsertEntry( aCol, aName ) );
+ if (aName.trim().isEmpty() && aCol == Color(SC_STD_GRIDCOLOR))
+ aName = ScGlobal::GetRscString(STR_GRIDCOLOR);
+
+ pColorLB->SelectEntry(std::make_pair(aCol, aName));
}
IMPL_LINK( ScTpContentOptions, GridHdl, ListBox&, rLb, void )
diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index 70dc4327beae..e4e7e6ba9198 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -798,11 +798,6 @@ String SCSTR_ROW_LABEL
Text [ en-US ] = "Range contains ~row labels" ;
};
-String SCSTR_AUTHOR
-{
- Text [ en-US ] = "By author" ;
-};
-
StringArray SCSTR_UNIT
{
ItemList [ en-US ] =
diff --git a/sc/uiconfig/scalc/ui/conditionalentry.ui b/sc/uiconfig/scalc/ui/conditionalentry.ui
index 86d18e199b5a..c5803074e635 100644
--- a/sc/uiconfig/scalc/ui/conditionalentry.ui
+++ b/sc/uiconfig/scalc/ui/conditionalentry.ui
@@ -131,7 +131,7 @@
</packing>
</child>
<child>
- <object class="svtlo-ColorListBox" id="lbcolmin">
+ <object class="svxcorelo-SvxColorListBox" id="lbcolmin">
<property name="can_focus">False</property>
</object>
<packing>
@@ -140,7 +140,7 @@
</packing>
</child>
<child>
- <object class="svtlo-ColorListBox" id="lbcolmiddle">
+ <object class="svxcorelo-SvxColorListBox" id="lbcolmiddle">
<property name="can_focus">False</property>
</object>
<packing>
@@ -149,7 +149,7 @@
</packing>
</child>
<child>
- <object class="svtlo-ColorListBox" id="lbcolmax">
+ <object class="svxcorelo-SvxColorListBox" id="lbcolmax">
<property name="can_focus">False</property>
</object>
<packing>
diff --git a/sc/uiconfig/scalc/ui/databaroptions.ui b/sc/uiconfig/scalc/ui/databaroptions.ui
index c2a4ae233281..580f3053f5d5 100644
--- a/sc/uiconfig/scalc/ui/databaroptions.ui
+++ b/sc/uiconfig/scalc/ui/databaroptions.ui
@@ -241,7 +241,7 @@
</packing>
</child>
<child>
- <object class="svtlo-ColorListBox" id="positive_colour">
+ <object class="svxcorelo-SvxColorListBox" id="positive_colour">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
@@ -252,7 +252,7 @@
</packing>
</child>
<child>
- <object class="svtlo-ColorListBox" id="negative_colour">
+ <object class="svxcorelo-SvxColorListBox" id="negative_colour">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
@@ -374,7 +374,7 @@
</packing>
</child>
<child>
- <object class="svtlo-ColorListBox" id="axis_colour">
+ <object class="svxcorelo-SvxColorListBox" id="axis_colour">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
@@ -523,17 +523,6 @@
<property name="position">5</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="custom_color">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Custom</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">6</property>
- </packing>
- </child>
</object>
<packing>
<property name="expand">False</property>
diff --git a/sc/uiconfig/scalc/ui/optchangespage.ui b/sc/uiconfig/scalc/ui/optchangespage.ui
index df83ce92437f..c64f8726b2e0 100644
--- a/sc/uiconfig/scalc/ui/optchangespage.ui
+++ b/sc/uiconfig/scalc/ui/optchangespage.ui
@@ -87,7 +87,7 @@
</packing>
</child>
<child>
- <object class="svxlo-ColorLB" id="changes">
+ <object class="svxcorelo-SvxColorListBox" id="changes">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
@@ -97,7 +97,7 @@
</packing>
</child>
<child>
- <object class="svxlo-ColorLB" id="deletions">
+ <object class="svxcorelo-SvxColorListBox" id="deletions">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
@@ -107,7 +107,7 @@
</packing>
</child>
<child>
- <object class="svxlo-ColorLB" id="entries">
+ <object class="svxcorelo-SvxColorListBox" id="entries">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
@@ -117,7 +117,7 @@
</packing>
</child>
<child>
- <object class="svxlo-ColorLB" id="insertions">
+ <object class="svxcorelo-SvxColorListBox" id="insertions">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
diff --git a/sc/uiconfig/scalc/ui/scenariodialog.ui b/sc/uiconfig/scalc/ui/scenariodialog.ui
index 846c05e4691f..56b8186de491 100644
--- a/sc/uiconfig/scalc/ui/scenariodialog.ui
+++ b/sc/uiconfig/scalc/ui/scenariodialog.ui
@@ -253,7 +253,7 @@
</packing>
</child>
<child>
- <object class="svtlo-ColorListBox" id="bordercolor">
+ <object class="svxcorelo-SvxColorListBox" id="bordercolor">
<property name="visible">True</property>
<property name="can_focus">False</property>
<accessibility>
diff --git a/sc/uiconfig/scalc/ui/tpviewpage.ui b/sc/uiconfig/scalc/ui/tpviewpage.ui
index 1e39a39f2ea0..1f3ef716cb5e 100644
--- a/sc/uiconfig/scalc/ui/tpviewpage.ui
+++ b/sc/uiconfig/scalc/ui/tpviewpage.ui
@@ -345,7 +345,7 @@
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
- <object class="svxlo-ColorLB" id="color">
+ <object class="svxcorelo-SvxColorListBox" id="color">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>