diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/helpids.h | 1 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 5 | ||||
-rw-r--r-- | sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx | 131 | ||||
-rw-r--r-- | sc/source/ui/sidebar/CellAppearancePropertyPanel.hrc | 2 | ||||
-rw-r--r-- | sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx | 20 | ||||
-rw-r--r-- | sc/source/ui/sidebar/CellAppearancePropertyPanel.src | 20 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/sidebarcellappearance.ui | 4 |
7 files changed, 7 insertions, 176 deletions
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h index 86c1c0e8bf89..6b23f9ab2bef 100644 --- a/sc/inc/helpids.h +++ b/sc/inc/helpids.h @@ -294,7 +294,6 @@ #define HID_PROPERTYPANEL_SC_TBX_LINECOLOR "SC_HID_PROPERTYPANEL_SC_TBX_LINECOLOR" #define HID_PROPERTYPANEL_SC_TBI_LINECOLOR "SC_HID_PROPERTYPANEL_SC_TBI_LINECOLOR" #define HID_PROPERTYPANEL_SC_CBOX_SHOWGRID "SC_HID_PROPERTYPANEL_SC_CBOX_SHOWGRID" -#define HID_PROPERTYPANEL_LINE_COLOR_VS "SC_HID_PROPERTYPANEL_LINE_COLOR_VS" #define HID_PROPERTYPANEL_SC_STYLE_VS "SC_HID_PROPERTYPANEL_SC_STYLE_VS" #define HID_PROPERTYPANEL_SC_STYLE_PB "SC_HID_PROPERTYPANEL_SC_STYLE_PB" #define HID_PROPERTYPANEL_SC_BORDER1_TBX "SC_HID_PROPERTYPANEL_SC_BORDER1_TBX" diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 57b7c520caae..0287773acd03 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1120,9 +1120,8 @@ #define RID_PROPERTYPANEL_SC_ALIGNMENT (SC_DIALOGS_START + 161) // defines for CellAppearancePropertyPanel -#define RID_POPUPPANEL_CELLAPPEARANCE_LINECOLOR (SC_DIALOGS_START + 163) -#define RID_POPUPPANEL_APPEARANCE_CELL_LINESTYLE (SC_DIALOGS_START + 164) -#define RID_POPUPPANEL_APPEARANCE_CELL_BORDERSTYLE (SC_DIALOGS_START + 165) +#define RID_POPUPPANEL_APPEARANCE_CELL_LINESTYLE (SC_DIALOGS_START + 162) +#define RID_POPUPPANEL_APPEARANCE_CELL_BORDERSTYLE (SC_DIALOGS_START + 163) #define SC_DIALOGS_END (RID_POPUPPANEL_APPEARANCE_CELL_BORDERSTYLE + 1) diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx index 2024f155d934..bf4e1b3e2740 100644 --- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx +++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx @@ -27,15 +27,12 @@ #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> #include <vcl/fixed.hxx> -#include <svx/tbxcolorupdate.hxx> #include <svl/eitem.hxx> #include <editeng/borderline.hxx> #include <editeng/boxitem.hxx> -#include <editeng/colritem.hxx> #include <editeng/lineitem.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> -#include <svx/sidebar/ColorControl.hxx> #include <boost/bind.hpp> #include <svx/sidebar/PopupContainer.hxx> #include "CellLineStyleControl.hxx" @@ -49,44 +46,11 @@ using namespace css::uno; const char UNO_SETBORDERSTYLE[] = ".uno:SetBorderStyle"; const char UNO_LINESTYLE[] = ".uno:LineStyle"; -const char UNO_FRAMELINECOLOR[] = ".uno:FrameLineColor"; - -// helpers - -namespace -{ - Color GetTransparentColor(void) - { - return COL_TRANSPARENT; - } -} // end of anonymous namespace // namespace open namespace sc { namespace sidebar { -svx::sidebar::PopupControl* CellAppearancePropertyPanel::CreateLineColorPopupControl(svx::sidebar::PopupContainer* pParent) -{ - return new svx::sidebar::ColorControl( - pParent, - mpBindings, - ScResId(RID_POPUPPANEL_CELLAPPEARANCE_LINECOLOR), - ScResId(VS_LINECOLOR), - ::boost::bind(GetTransparentColor), - ::boost::bind(&CellAppearancePropertyPanel::SetLineColor, this, _1, _2), - pParent, - 0); -} - -void CellAppearancePropertyPanel::SetLineColor( - const OUString& /*rsColorName*/, - const Color aColor) -{ - const SvxColorItem aColorItem(aColor, SID_FRAME_LINECOLOR); - mpBindings->GetDispatcher()->Execute(SID_FRAME_LINECOLOR, SfxCallMode::RECORD, &aColorItem, 0L); - maLineColor = aColor; -} - svx::sidebar::PopupControl* CellAppearancePropertyPanel::CreateCellLineStylePopupControl(svx::sidebar::PopupContainer* pParent) { return new CellLineStyleControl(pParent, *this); @@ -119,7 +83,6 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel( SfxBindings* pBindings) : PanelLayout(pParent, "CellAppearancePropertyPanel", "modules/scalc/ui/sidebarcellappearance.ui", rxFrame), - maLineColorControl(SID_FRAME_LINECOLOR, *pBindings, *this), maLineStyleControl(SID_FRAME_LINESTYLE, *pBindings, *this), maBorderOuterControl(SID_ATTR_BORDER_OUTER, *pBindings, *this), maBorderInnerControl(SID_ATTR_BORDER_INNER, *pBindings, *this), @@ -138,9 +101,6 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel( maIMGLineStyle8(ScResId(IMG_LINE_STYLE8)), maIMGLineStyle9(ScResId(IMG_LINE_STYLE9)), - maLineColor(COL_BLACK), - maTLBRColor(COL_BLACK), - maBLTRColor(COL_BLACK), mnIn(0), mnOut(0), mnDis(0), @@ -150,7 +110,6 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel( mnBLTRIn(0), mnBLTROut(0), mnBLTRDis(0), - mbLineColorAvailable(true), mbBorderStyleAvailable(true), mbLeft(false), mbRight(false), @@ -163,7 +122,6 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel( mbTLBR(false), mbBLTR(false), - maLineColorPopup(this, ::boost::bind(&CellAppearancePropertyPanel::CreateLineColorPopupControl, this, _1)), mpCellLineStylePopup(), mpCellBorderStylePopup(), @@ -176,9 +134,6 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel( get(mpTBLineColor, "borderlinecolor"); get(mpCBXShowGrid, "cellgridlines"); - mpLineColorUpdater.reset( new ::svx::ToolboxButtonColorUpdater(SID_FRAME_LINECOLOR, - mpTBLineColor->GetItemId( UNO_FRAMELINECOLOR ), - mpTBLineColor) ); mpCellBorderUpdater.reset( new CellBorderUpdater( mpTBCellBorder->GetItemId( UNO_SETBORDERSTYLE ), *mpTBCellBorder) ); @@ -206,11 +161,6 @@ void CellAppearancePropertyPanel::Initialize() mpTBLineStyle->SetSelectHdl ( aLink ); mpTBLineStyle->Disable(); - const sal_uInt16 nIdBorderLinecolor = mpTBLineColor->GetItemId( UNO_FRAMELINECOLOR ); - mpTBLineColor->SetItemBits( nIdBorderLinecolor, mpTBLineColor->GetItemBits( nIdBorderLinecolor ) | ToolBoxItemBits::DROPDOWNONLY ); - aLink = LINK(this, CellAppearancePropertyPanel, TbxLineColorSelectHdl); - mpTBLineColor->SetDropdownClickHdl ( aLink ); - mpTBLineColor->SetSelectHdl ( aLink ); mpTBLineColor->Disable(); aLink = LINK(this, CellAppearancePropertyPanel, CBOXGridShowClkHdl); @@ -220,18 +170,6 @@ void CellAppearancePropertyPanel::Initialize() mpTBLineStyle->SetAccessibleRelationLabeledBy(mpTBLineStyle); } -IMPL_LINK(CellAppearancePropertyPanel, TbxLineColorSelectHdl, ToolBox*, pToolBox) -{ - const OUString aCommand(pToolBox->GetItemCommand(pToolBox->GetCurItemId())); - - if(aCommand == UNO_FRAMELINECOLOR) - { - maLineColorPopup.Show(*pToolBox); - maLineColorPopup.SetCurrentColor(maLineColor, mbLineColorAvailable); - } - return 0; -} - IMPL_LINK(CellAppearancePropertyPanel, TbxCellBorderSelectHdl, ToolBox*, pToolBox) { const OUString aCommand(pToolBox->GetItemCommand(pToolBox->GetCurItemId())); @@ -335,40 +273,6 @@ void CellAppearancePropertyPanel::NotifyItemUpdate( switch(nSID) { - case SID_FRAME_LINECOLOR: - if( eState == SfxItemState::DONTCARE) - { - mbLineColorAvailable = true; - maLineColor.SetColor( COL_TRANSPARENT ); - UpdateControlState(); - break; - } - - if(eState >= SfxItemState::DEFAULT && pState && pState->ISA(SvxColorItem) ) - { - const SvxColorItem* pSvxColorItem = dynamic_cast< const SvxColorItem* >(pState); - - if(pSvxColorItem) - { - maLineColor = static_cast<const SvxColorItem*>(pState)->GetValue(); - if(maLineColor == COL_AUTO) - mbLineColorAvailable = false; - else - { - mbLineColorAvailable = true; - // mpLineColorUpdater->Update(maLineColor); - } - - UpdateControlState(); - break; - } - } - - mbLineColorAvailable = false; - maLineColor.SetColor(COL_AUTO); - // mpLineColorUpdater->Update(maLineColor); - UpdateControlState(); - break; case SID_FRAME_LINESTYLE: if( eState == SfxItemState::DONTCARE ) { @@ -486,7 +390,6 @@ void CellAppearancePropertyPanel::NotifyItemUpdate( if( eState == SfxItemState::DONTCARE ) { mbTLBR = true; - maTLBRColor.SetColor(COL_TRANSPARENT); mnTLBRIn = mnTLBROut = mnTLBRDis = 0; UpdateControlState(); break; @@ -507,7 +410,6 @@ void CellAppearancePropertyPanel::NotifyItemUpdate( else { mbTLBR = true; - maTLBRColor = aLine->GetColor(); mnTLBRIn = aLine->GetInWidth(); mnTLBROut = aLine->GetOutWidth(); mnTLBRDis = aLine->GetDistance(); @@ -528,7 +430,6 @@ void CellAppearancePropertyPanel::NotifyItemUpdate( if( eState == SfxItemState::DONTCARE ) { mbBLTR = true; - maBLTRColor.SetColor( COL_TRANSPARENT ); mnBLTRIn = mnBLTROut = mnBLTRDis = 0; UpdateControlState(); break; @@ -549,7 +450,6 @@ void CellAppearancePropertyPanel::NotifyItemUpdate( else { mbBLTR = true; - maBLTRColor = aLine->GetColor(); mnBLTRIn = aLine->GetInWidth(); mnBLTROut = aLine->GetOutWidth(); mnBLTRDis = aLine->GetDistance(); @@ -619,37 +519,6 @@ void CellAppearancePropertyPanel::UpdateControlState() mpTBLineColor->Enable(); mpTBLineStyle->Enable(); - //set line color state - if( mbLineColorAvailable && !mbTLBR && !mbBLTR ) - mpLineColorUpdater->Update(maLineColor); - else if( !mbLineColorAvailable && mbTLBR && !mbBLTR ) - mpLineColorUpdater->Update(maTLBRColor); - else if ( !mbLineColorAvailable && !mbTLBR && mbBLTR ) - mpLineColorUpdater->Update(maBLTRColor); - else if( !mbLineColorAvailable && mbTLBR && mbBLTR) - { - if( maTLBRColor == maBLTRColor) - mpLineColorUpdater->Update(maBLTRColor); - else - mpLineColorUpdater->Update(COL_TRANSPARENT); - } - else if( mbLineColorAvailable && mbTLBR && !mbBLTR ) - { - if( maTLBRColor == maLineColor) - mpLineColorUpdater->Update(maLineColor); - else - mpLineColorUpdater->Update(COL_TRANSPARENT); - } - else if( mbLineColorAvailable && !mbTLBR && mbBLTR ) - { - if( maBLTRColor == maLineColor) - mpLineColorUpdater->Update(maLineColor); - else - mpLineColorUpdater->Update(COL_TRANSPARENT); - } - else - mpLineColorUpdater->Update(COL_TRANSPARENT); - //set line style state if( mbBorderStyleAvailable && !mbTLBR && !mbBLTR ) { diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hrc b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hrc index 8a01cb2c7569..e9adcd655a1c 100644 --- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hrc +++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hrc @@ -72,6 +72,4 @@ #define STR_BORDER_7 47 #define STR_BORDER_8 48 -#define VS_LINECOLOR 1 - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx index ef92c5cae49b..60c2a5ba4998 100644 --- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx +++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx @@ -23,10 +23,12 @@ #include <sfx2/sidebar/IContextChangeReceiver.hxx> #include <svx/sidebar/PanelLayout.hxx> #include <boost/scoped_ptr.hpp> -#include <svx/sidebar/ColorPopup.hxx> class FixedText; -namespace svx { class ToolboxButtonColorUpdater; } +namespace svx { namespace sidebar { + class PopupControl; + class PopupContainer; +}} namespace sc { namespace sidebar { class CellLineStylePopup; class CellBorderStylePopup; @@ -73,11 +75,9 @@ private: ToolBox* mpTBCellBorder; ToolBox* mpTBLineStyle; ToolBox* mpTBLineColor; - ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpLineColorUpdater; ::boost::scoped_ptr< CellBorderUpdater > mpCellBorderUpdater; CheckBox* mpCBXShowGrid; - ::sfx2::sidebar::ControllerItem maLineColorControl; ::sfx2::sidebar::ControllerItem maLineStyleControl; ::sfx2::sidebar::ControllerItem maBorderOuterControl; ::sfx2::sidebar::ControllerItem maBorderInnerControl; @@ -97,11 +97,6 @@ private: Image maIMGLineStyle8; Image maIMGLineStyle9; - // cell line color(s) - Color maLineColor; - Color maTLBRColor; - Color maBLTRColor; - // BorderStyle defines sal_uInt16 mnIn; sal_uInt16 mnOut; @@ -114,7 +109,6 @@ private: sal_uInt16 mnBLTRDis; /// bitfield - bool mbLineColorAvailable : 1; bool mbBorderStyleAvailable : 1; // CellBorder defines @@ -132,7 +126,6 @@ private: bool mbBLTR : 1; // popups - svx::sidebar::ColorPopup maLineColorPopup; ::boost::scoped_ptr< CellLineStylePopup > mpCellLineStylePopup; ::boost::scoped_ptr< CellBorderStylePopup > mpCellBorderStylePopup; @@ -140,15 +133,10 @@ private: ::sfx2::sidebar::EnumContext maContext; SfxBindings* mpBindings; - DECL_LINK(TbxLineColorSelectHdl, ToolBox*); DECL_LINK(TbxCellBorderSelectHdl, ToolBox*); DECL_LINK(TbxLineStyleSelectHdl, ToolBox*); DECL_LINK(CBOXGridShowClkHdl, void*); - // for line color picker - svx::sidebar::PopupControl* CreateLineColorPopupControl(svx::sidebar::PopupContainer* pParent); - void SetLineColor(const OUString& rsColorName, const Color aColor); - // for CellLineStyle popup svx::sidebar::PopupControl* CreateCellLineStylePopupControl(svx::sidebar::PopupContainer* pParent); void EndCellLineStylePopupMode(void); diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.src b/sc/source/ui/sidebar/CellAppearancePropertyPanel.src index 18ef97164978..4049151ba8de 100644 --- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.src +++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.src @@ -65,26 +65,6 @@ Image IMG_LINE_STYLE9 ImageBitmap = Bitmap{File = "sidebar/CellBorderLineStyle_750.png";}; }; -// line color popup - -Control RID_POPUPPANEL_CELLAPPEARANCE_LINECOLOR -{ - OutputSize = TRUE; - DialogControl = TRUE; - Border = FALSE; - Size = MAP_APPFONT( POPUP_COLOR_PICKER_WIDTH , POPUP_COLOR_PICKER_HEIGHT ); - - Control VS_LINECOLOR - { - HelpID = HID_PROPERTYPANEL_LINE_COLOR_VS; - Hide = TRUE ; - Pos = MAP_APPFONT ( OFFSET_X , OFFSET_Y ); - Size = MAP_APPFONT ( POPUP_COLOR_PICKER_WIDTH - OFFSET_X * 2, POPUP_COLOR_PICKER_HEIGHT - OFFSET_Y * 2); - TabStop = TRUE ; - Text [ en-US ] = "Color"; - }; -}; - // cell line style popup Control RID_POPUPPANEL_APPEARANCE_CELL_LINESTYLE diff --git a/sc/uiconfig/scalc/ui/sidebarcellappearance.ui b/sc/uiconfig/scalc/ui/sidebarcellappearance.ui index 26a9bb109696..f82f4b628672 100644 --- a/sc/uiconfig/scalc/ui/sidebarcellappearance.ui +++ b/sc/uiconfig/scalc/ui/sidebarcellappearance.ui @@ -157,7 +157,7 @@ </packing> </child> <child> - <object class="GtkToolbar" id="borderlinecolor"> + <object class="sfxlo-SidebarToolBox" id="borderlinecolor"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="has_tooltip">True</property> @@ -165,7 +165,6 @@ <property name="tooltip_text" translatable="yes">Select the line color of the borders.</property> <child> <object class="GtkMenuToolButton" id="linecolor"> - <property name="use_action_appearance">False</property> <property name="width_request">105</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -176,7 +175,6 @@ <property name="hexpand">True</property> <property name="use_action_appearance">False</property> <property name="action_name">.uno:FrameLineColor</property> - <property name="label" translatable="no">toolbutton1</property> <property name="use_underline">True</property> </object> <packing> |