summaryrefslogtreecommitdiff
path: root/svx/source/sidebar
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2016-11-05 13:28:17 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2016-11-05 13:42:40 -0500
commitdb380aab1063e8a5e40111c40ee9f7921aa82601 (patch)
treef5057dfb205a7d7409251742888dfeaf4bfbee61 /svx/source/sidebar
parentee2144aafc5b4be14630f723be9a2bb674671412 (diff)
Reverts a commit series that cripple windows ci.
Revert "SvxShadowTabPage::Construct was removed" f9a2c1c12ecad833c63b894c89d6008907477eb5. Revert "replace OColorPopup with SvxColorWindow" f300754bb1c6a347c92bb9548be7a65237176542. Revert "drop AutoColorInvalid/SID_ATTR_AUTO_COLOR_INVALID" 347c2c334589b18cc62af292674bb3df1dd54b71. Revert "replace last ColorLB use with a listbox of colors" 604b35bf55351751a396e34dcca3f85e75860fd5. Revert "simplify, its just a vector of colors" 351a97ce6bda3075677b59fa1387ba3d1ab17d7a. Revert "replace user draw with an Image of the color" df738e0f8ceedb4bad756960be14d9c41adc165d. Revert "strip down to the used pieces" commit 08d6cd788f2584ce10ab8fa10665245e953c59d9. Revert "move now combined ColorLB to location of last user" a19b18ad7c9eb0197c10e6d7e451ec4542e4bc9e. Revert "fold ColorListBox and ColorLB together" a989a0b1f2b425f05b58d0e44ce2de31c842ed65. Revert "move ColorListBox beside sole thing that uses it" 760a198e697f3070a5e0e029e4eff7be220eb9cd. Revert "extensions leaks out details of Color Selector, patch it up" 8bea644d6117a49405e6426dc97214220fc869d1. Revert "inherit FillAttrLB from ListBox not ColorListBox" d2ce812f1d3a7a2aad89ca0bd11948b63d2db7b0. Revert "unify color selectors" 43bc3031483d172eccd72c3804e2d4fc2ef37de4.
Diffstat (limited to 'svx/source/sidebar')
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanelBase.cxx97
-rw-r--r--svx/source/sidebar/shadow/ShadowPropertyPanel.cxx37
-rw-r--r--svx/source/sidebar/shadow/ShadowPropertyPanel.hxx11
3 files changed, 94 insertions, 51 deletions
diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index 318b95b20e23..5f90b223781a 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -167,11 +167,10 @@ void AreaPropertyPanelBase::Initialize()
mpLbFillType->SetSelectHdl( LINK( this, AreaPropertyPanelBase, SelectFillTypeHdl ) );
Link<ListBox&,void> aLink = LINK( this, AreaPropertyPanelBase, SelectFillAttrHdl );
- Link<SvxColorListBox&,void> aLink3 = LINK( this, AreaPropertyPanelBase, SelectFillColorHdl );
mpLbFillAttr->SetSelectHdl( aLink );
mpGradientStyle->SetSelectHdl( aLink );
- mpLbFillGradFrom->SetSelectHdl( aLink3 );
- mpLbFillGradTo->SetSelectHdl( aLink3 );
+ mpLbFillGradFrom->SetSelectHdl( aLink );
+ mpLbFillGradTo->SetSelectHdl( aLink );
mpMTRAngle->SetModifyHdl(LINK(this,AreaPropertyPanelBase, ChangeGradientAngle));
mpLBTransType->SetSelectHdl(LINK(this, AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl));
@@ -297,33 +296,61 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillTypeHdl, ListBox&, void)
mpToolBoxColor->Hide();
mpBmpImport->Hide();
- mpLbFillAttr->Enable();
- mpLbFillGradTo->Enable();
- mpLbFillGradFrom->Enable();
- mpGradientStyle->Enable();
- mpMTRAngle->Enable();
- mpLbFillAttr->Clear();
-
- if (LISTBOX_ENTRY_NOTFOUND != mnLastPosGradient)
+ const SvxColorListItem* pColorListItem = static_cast<const SvxColorListItem*>(pSh->GetItem(SID_COLOR_TABLE));
+ if(pColorListItem)
{
- const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
+ mpLbFillAttr->Enable();
+ mpLbFillGradTo->Enable();
+ mpLbFillGradFrom->Enable();
+ mpGradientStyle->Enable();
+ mpMTRAngle->Enable();
+ mpLbFillAttr->Clear();
+ mpLbFillGradTo->Clear();
+ mpLbFillGradFrom->Clear();
+ mpLbFillGradTo->Fill(pColorListItem->GetColorList());
+ mpLbFillGradFrom->Fill(pColorListItem->GetColorList());
- if(mnLastPosGradient < aItem.GetGradientList()->Count())
+ mpLbFillGradFrom->AdaptDropDownLineCountToMaximum();
+ mpLbFillGradTo->AdaptDropDownLineCountToMaximum();
+
+ if(LISTBOX_ENTRY_NOTFOUND != mnLastPosGradient)
{
- const XGradient aGradient = aItem.GetGradientList()->GetGradient(mnLastPosGradient)->GetGradient();
- const XFillGradientItem aXFillGradientItem(aGradient);
-
- // #i122676# change FillStyle and Gradient in one call
- XFillStyleItem aXFillStyleItem(drawing::FillStyle_GRADIENT);
- setFillStyleAndGradient(&aXFillStyleItem, aXFillGradientItem);
- mpLbFillGradFrom->SelectEntry(aGradient.GetStartColor());
- mpLbFillGradTo->SelectEntry(aGradient.GetEndColor());
-
- mpMTRAngle->SetValue(aGradient.GetAngle() / 10);
- css::awt::GradientStyle eXGS = aGradient.GetGradientStyle();
- mpGradientStyle->SelectEntryPos(sal::static_int_cast< sal_Int32 >( eXGS ));
+ const SvxGradientListItem aItem(*static_cast<const SvxGradientListItem*>(pSh->GetItem(SID_GRADIENT_LIST)));
+
+ if(mnLastPosGradient < aItem.GetGradientList()->Count())
+ {
+ const XGradient aGradient = aItem.GetGradientList()->GetGradient(mnLastPosGradient)->GetGradient();
+ const XFillGradientItem aXFillGradientItem(aGradient);
+
+ // #i122676# change FillStyle and Gradient in one call
+ XFillStyleItem aXFillStyleItem(drawing::FillStyle_GRADIENT);
+ setFillStyleAndGradient(&aXFillStyleItem, aXFillGradientItem);
+ mpLbFillGradFrom->SelectEntry(aGradient.GetStartColor());
+ if(mpLbFillGradFrom->GetSelectEntryCount() == 0)
+ {
+ mpLbFillGradFrom->InsertEntry(aGradient.GetStartColor(), OUString());
+ mpLbFillGradFrom->SelectEntry(aGradient.GetStartColor());
+ }
+ mpLbFillGradTo->SelectEntry(aGradient.GetEndColor());
+ if(mpLbFillGradTo->GetSelectEntryCount() == 0)
+ {
+ mpLbFillGradTo->InsertEntry(aGradient.GetEndColor(), OUString());
+ mpLbFillGradTo->SelectEntry(aGradient.GetEndColor());
+ }
+
+ mpMTRAngle->SetValue(aGradient.GetAngle() / 10);
+ css::awt::GradientStyle eXGS = aGradient.GetGradientStyle();
+ mpGradientStyle->SelectEntryPos(sal::static_int_cast< sal_Int32 >( eXGS ));
+ }
}
}
+ else
+ {
+ mpLbFillGradFrom->Disable();
+ mpLbFillGradTo->Disable();
+ mpMTRAngle->Disable();
+ mpGradientStyle->Disable();
+ }
break;
}
case HATCH:
@@ -448,11 +475,6 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillTypeHdl, ListBox&, void)
}
}
-IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillColorHdl, SvxColorListBox&, void)
-{
- SelectFillAttrHdl_Impl();
-}
-
IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillAttrHdl, ListBox&, void)
{
SelectFillAttrHdl_Impl();
@@ -1154,15 +1176,28 @@ void AreaPropertyPanelBase::Update()
mpLbFillAttr->Enable();
mpLbFillAttr->Clear();
mpLbFillAttr->Fill(aItem.GetGradientList());
+ const SvxColorListItem aColorItem(*static_cast<const SvxColorListItem*>(pSh->GetItem(SID_COLOR_TABLE)));
+ mpLbFillGradFrom->Fill(aColorItem.GetColorList());
+ mpLbFillGradTo->Fill(aColorItem.GetColorList());
mpLbFillGradTo->SetNoSelection();
mpLbFillGradFrom->SetNoSelection();
- if (mpFillGradientItem)
+ if(mpFillGradientItem)
{
const OUString aString(mpFillGradientItem->GetName());
mpLbFillAttr->SelectEntry(aString);
const XGradient aGradient = mpFillGradientItem->GetGradientValue();
mpLbFillGradFrom->SelectEntry(aGradient.GetStartColor());
+ if(mpLbFillGradFrom->GetSelectEntryCount() == 0)
+ {
+ mpLbFillGradFrom->InsertEntry(aGradient.GetStartColor(), OUString());
+ mpLbFillGradFrom->SelectEntry(aGradient.GetStartColor());
+ }
mpLbFillGradTo->SelectEntry(aGradient.GetEndColor());
+ if(mpLbFillGradTo->GetSelectEntryCount() == 0)
+ {
+ mpLbFillGradTo->InsertEntry(aGradient.GetEndColor(), OUString());
+ mpLbFillGradTo->SelectEntry(aGradient.GetEndColor());
+ }
mpGradientStyle->SelectEntryPos(sal::static_int_cast< sal_Int32 >( aGradient.GetGradientStyle() ));
if(mpGradientStyle->GetSelectEntryPos() == (sal_Int32)GradientStyle::Radial)
mpMTRAngle->Disable();
diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
index 0766550e29cd..a1ea3879f3dd 100644
--- a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
+++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
@@ -10,7 +10,6 @@
#include <ShadowPropertyPanel.hxx>
#include <comphelper/string.hxx>
#include <sfx2/sidebar/ControlFactory.hxx>
-#include <svx/colorbox.hxx>
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
#include <sfx2/objsh.hxx>
@@ -123,18 +122,25 @@ void ShadowPropertyPanel::dispose()
void ShadowPropertyPanel::Initialize()
{
- mpShowShadow->SetState( TRISTATE_FALSE );
- mpShowShadow->SetClickHdl( LINK(this, ShadowPropertyPanel, ClickShadowHdl ) );
- mpShadowTransMetric->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowTransMetricHdl) );
- mpLBShadowColor->SetSelectHdl( LINK( this, ShadowPropertyPanel, ModifyShadowColorHdl ) );
- mpShadowAngle->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowDistanceHdl) );
- mpShadowDistance->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowDistanceHdl) );
- mpShadowTransSlider->SetRange(Range(0,100));
- mpShadowTransSlider->SetUpdateMode(true);
- mpShadowTransSlider->SetSlideHdl( LINK(this, ShadowPropertyPanel, ModifyShadowTransSliderHdl) );
- for(sal_uInt16 i = 0; i <= 20 ; i++)
- mpShadowDistance->InsertValue(i*2,FUNIT_POINT);
- InsertAngleValues();
+ SfxObjectShell* pSh = SfxObjectShell::Current();
+
+ const SvxColorListItem* pColorListItem = static_cast<const SvxColorListItem*>(pSh ? pSh->GetItem(SID_COLOR_TABLE) : nullptr);
+ if (pColorListItem)
+ {
+ mpLBShadowColor->Fill(pColorListItem->GetColorList());
+ mpShowShadow->SetState( TRISTATE_FALSE );
+ mpShowShadow->SetClickHdl( LINK(this, ShadowPropertyPanel, ClickShadowHdl ) );
+ mpShadowTransMetric->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowTransMetricHdl) );
+ mpLBShadowColor->SetSelectHdl( LINK( this, ShadowPropertyPanel, ModifyShadowColorHdl ) );
+ mpShadowAngle->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowDistanceHdl) );
+ mpShadowDistance->SetModifyHdl( LINK(this, ShadowPropertyPanel, ModifyShadowDistanceHdl) );
+ mpShadowTransSlider->SetRange(Range(0,100));
+ mpShadowTransSlider->SetUpdateMode(true);
+ mpShadowTransSlider->SetSlideHdl( LINK(this, ShadowPropertyPanel, ModifyShadowTransSliderHdl) );
+ for(sal_uInt16 i = 0; i <= 20 ; i++)
+ mpShadowDistance->InsertValue(i*2,FUNIT_POINT);
+ InsertAngleValues();
+ }
}
IMPL_LINK_NOARG(ShadowPropertyPanel, ClickShadowHdl, Button*, void)
@@ -153,7 +159,7 @@ IMPL_LINK_NOARG(ShadowPropertyPanel, ClickShadowHdl, Button*, void)
}
}
-IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowColorHdl, SvxColorListBox&, void)
+IMPL_LINK_NOARG(ShadowPropertyPanel, ModifyShadowColorHdl, ListBox&, void)
{
XColorItem aItem(makeSdrShadowColorItem(mpLBShadowColor->GetSelectEntryColor()));
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_SHADOW_COLOR,
@@ -314,6 +320,9 @@ void ShadowPropertyPanel::NotifyItemUpdate(
{
mpLBShadowColor->SelectEntry(pColorItem->GetColorValue());
}
+ else
+ {
+ }
}
}
break;
diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx
index f3fd1c7e12eb..7e7288617d32 100644
--- a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx
+++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx
@@ -25,7 +25,6 @@
#include <sfx2/request.hxx>
#include <svx/dlgctrl.hxx>
-class SvxColorListBox;
namespace svx { namespace sidebar {
@@ -61,10 +60,10 @@ public:
SfxBindings* pBindings);
private:
- VclPtr<CheckBox> mpShowShadow;
- VclPtr<MetricBox> mpShadowDistance;
- VclPtr<SvxColorListBox> mpLBShadowColor;
- VclPtr<MetricBox> mpShadowAngle;
+ VclPtr<CheckBox> mpShowShadow;
+ VclPtr<MetricBox> mpShadowDistance;
+ VclPtr<ColorLB> mpLBShadowColor;
+ VclPtr<MetricBox> mpShadowAngle;
VclPtr<FixedText> mpFTAngle;
VclPtr<FixedText> mpFTDistance;
VclPtr<FixedText> mpFTTransparency;
@@ -85,7 +84,7 @@ private:
void SetTransparencyValue(long);
void UpdateControls();
DECL_LINK(ClickShadowHdl, Button*, void);
- DECL_LINK(ModifyShadowColorHdl, SvxColorListBox&, void);
+ DECL_LINK(ModifyShadowColorHdl, ListBox&, void);
DECL_LINK(ModifyShadowTransMetricHdl, Edit&, void);
DECL_LINK(ModifyShadowDistanceHdl, Edit&, void);
DECL_LINK(ModifyShadowTransSliderHdl, Slider*, void);