summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2014-10-22 22:11:31 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2014-10-22 23:25:52 +0300
commit9f06a0988d39dddcd14c9424dd48e2990cf8351f (patch)
treed791e7280ecaa19887c1a56a8516016ccecfed99 /svx
parente2b84636b3baf344cbc8f709478714ddea7caced (diff)
fdo#84844 Sidebar: Use SvxColorToolBoxControl for paragraph color
Change-Id: I0231a52288ca9a8a2a5e5cdb13fdff772b989640
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/helpid.hrc1
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.cxx93
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.hrc4
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.hxx16
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.src23
-rw-r--r--svx/uiconfig/ui/sidebarparagraph.ui2
6 files changed, 2 insertions, 137 deletions
diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc
index 5021cb8c63e4..6de49daafc3d 100644
--- a/svx/inc/helpid.hrc
+++ b/svx/inc/helpid.hrc
@@ -113,7 +113,6 @@
#define HID_PPROPERTYPANEL_AREA_BTN_LEFT_SECOND "SVX_HID_PPROPERTYPANEL_AREA_BTN_LEFT_SECOND"
#define HID_PPROPERTYPANEL_AREA_BTN_RIGHT_FIRST "SVX_HID_PPROPERTYPANEL_AREA_BTN_RIGHT_FIRST"
#define HID_PPROPERTYPANEL_TEXT_UNDERLINE_VS "SVX_HID_PPROPERTYPANEL_TEXT_UNDERLINE_VS"
-#define HID_PPROPERTYPANEL_PARA_BACK_COLOR_VS "SVX_HID_PPROPERTYPANEL_PARA_BACK_COLOR_VS"
#define HID_PPROPERTYPANEL_LINE_VS_WIDTH "SVX_HID_PPROPERTYPANEL_LINE_VS_WIDTH"
#define HID_PPROPERTYPANEL_LINE_MTR_WIDTH "SVX_HID_PPROPERTYPANEL_LINE_MTR_WIDTH"
#define HID_PPROPERTYPANEL_LINE_VS_COLOR "SVX_HID_PPROPERTYPANEL_LINE_VS_COLOR"
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index 017800c82e94..d90aa6559a03 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -16,8 +16,6 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <svx/sidebar/ColorControl.hxx>
-
#include "ParaPropertyPanel.hxx"
#include "ParaPropertyPanel.hrc"
@@ -31,8 +29,6 @@
#include <sfx2/sidebar/Tools.hxx>
#include <svx/sidebar/PopupContainer.hxx>
#include <sfx2/dispatch.hxx>
-#include <editeng/colritem.hxx>
-#include <editeng/brushitem.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/ulspitem.hxx>
#include <vcl/toolbox.hxx>
@@ -51,8 +47,6 @@ using namespace css::uno;
const char UNO_DEFAULTBULLET[] = ".uno:DefaultBullet";
const char UNO_DEFAULTNUMBERING[] = ".uno:DefaultNumbering";
-const char UNO_PARABACKCOLOR[] = ".uno:BackgroundColor";
-
const char UNO_INCREMENTINDENT[] = ".uno:IncrementIndent";
const char UNO_DECREMENTINDENT[] = ".uno:DecrementIndent";
const char UNO_HANGINGINDENT[] = ".uno:HangingIndent";
@@ -280,18 +274,6 @@ void ParaPropertyPanel::InitToolBoxIndent()
m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric();
}
-void ParaPropertyPanel::InitToolBoxBGColor()
-{
- const sal_uInt16 nIdBackColor = mpTBxBackColor->GetItemId(UNO_PARABACKCOLOR);
-
- mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(0 /* not defined, default is transparent */, nIdBackColor, mpTBxBackColor));
- mpTBxBackColor->SetItemBits( nIdBackColor, mpTBxBackColor->GetItemBits( nIdBackColor ) | ToolBoxItemBits::DROPDOWNONLY );
-
- Link aLink = LINK(this, ParaPropertyPanel, ToolBoxBackColorDDHandler);
- mpTBxBackColor->SetDropdownClickHdl ( aLink );
- mpTBxBackColor->SetSelectHdl ( aLink );
-}
-
void ParaPropertyPanel::InitToolBoxBulletsNumbering()
{
const sal_uInt16 nIdBullet = mpTBxNumBullet->GetItemId(UNO_DEFAULTBULLET);
@@ -347,7 +329,6 @@ void ParaPropertyPanel::initial()
{
//toolbox
InitToolBoxIndent();
- InitToolBoxBGColor();
InitToolBoxBulletsNumbering();
InitToolBoxSpacing();
InitToolBoxLineSpacing();
@@ -396,47 +377,6 @@ IMPL_LINK(ParaPropertyPanel, NumBTbxSelectHandler, ToolBox*, pToolBox)
return 0;
}
-// for Background color
-IMPL_LINK(ParaPropertyPanel, ToolBoxBackColorDDHandler,ToolBox*, pToolBox)
-{
- const sal_uInt16 nId = pToolBox->GetCurItemId();
- const OUString aCommand(pToolBox->GetItemCommand(nId));
-
- if(aCommand == UNO_PARABACKCOLOR)
- {
- pToolBox->SetItemDown( nId, true );
- maBGColorPopup.Show(*pToolBox);
- maBGColorPopup.SetCurrentColor(maColor, mbColorAvailable);
- }
- return 0;
-}
-
-void ParaPropertyPanel::ParaBKGStateChanged(sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState)
-{
- if( eState >= SfxItemState::DEFAULT && pState->ISA(SvxColorItem))
- {
- const SvxColorItem* pItem = static_cast<const SvxColorItem*>(pState);
- maColor = pItem->GetValue();
- mbColorAvailable = true;
- mpColorUpdater->Update(maColor);
- }
- else
- {
- mbColorAvailable = false;
- maColor.SetColor(COL_AUTO);
- mpColorUpdater->Update(maColor);
- }
-}
-
-void ParaPropertyPanel::SetBGColor (
- const OUString& /*rsColorName*/,
- const Color aColor)
-{
- SvxColorItem aColorItem(aColor, SID_BACKGROUND_COLOR);
- mpBindings->GetDispatcher()->Execute(SID_BACKGROUND_COLOR, SfxCallMode::RECORD, &aColorItem, 0L);
- maColor = aColor;
-}
-
// for Paragraph Indent
IMPL_LINK_NOARG( ParaPropertyPanel, ModifyIndentHdl_Impl)
{
@@ -690,10 +630,6 @@ void ParaPropertyPanel::NotifyItemUpdate(
case FN_NUM_NUM_RULE_INDEX:
StateChangeBulletNumRuleImpl( nSID, eState, pState );
break;
-
- case SID_BACKGROUND_COLOR:
- ParaBKGStateChanged(nSID, eState, pState);
- break;
}
}
@@ -1049,37 +985,12 @@ PopupControl* ParaPropertyPanel::CreateNumberingPopupControl (PopupContainer* pP
return new ParaNumberingControl(pParent, *this);
}
-namespace
-{
- Color GetNoBackgroundColor(void)
- {
- return COL_TRANSPARENT;
- }
-} // end of anonymous namespace
-
-PopupControl* ParaPropertyPanel::CreateBGColorPopupControl (PopupContainer* pParent)
-{
- const ResId aResId(SVX_RES(STR_NOFILL));
-
- return new ColorControl(
- pParent,
- mpBindings,
- SVX_RES(RID_POPUPPANEL_PARAPAGE_BACK_COLOR),
- SVX_RES(VS_FONT_COLOR),
- ::boost::bind(GetNoBackgroundColor),
- ::boost::bind(&ParaPropertyPanel::SetBGColor, this, _1,_2),
- pParent,
- &aResId);
-}
-
-
ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
: PanelLayout(pParent, "ParaPropertyPanel", "svx/ui/sidebarparagraph.ui", rxFrame),
- mpColorUpdater (),
maSpace3 (SVX_RES(IMG_SPACE3)),
maIndHang (SVX_RES(IMG_INDENT_HANG)),
maNumBImageList (SVX_RES(IL_NUM_BULLET)),
@@ -1093,8 +1004,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
maLower (0),
mnBulletTypeIndex ((sal_uInt16)0xFFFF),
mnNumTypeIndex ((sal_uInt16)0xFFFF),
- maColor (COL_AUTO),
- mbColorAvailable (true),
m_eMetricUnit(FUNIT_NONE),
m_last_eMetricUnit(FUNIT_NONE),
m_eLRSpaceUnit(),
@@ -1108,7 +1017,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
maIncIndentControl(SID_INC_INDENT, *pBindings,*this, OUString("IncrementIndent"), rxFrame),
maBulletOnOff(FN_NUM_BULLET_ON, *pBindings, *this, OUString("DefaultBullet"), rxFrame),
maNumberOnOff(FN_NUM_NUMBERING_ON, *pBindings, *this, OUString("DefaultNumbering"), rxFrame),
- maBackColorControl (SID_BACKGROUND_COLOR, *pBindings,*this),
m_aMetricCtl (SID_ATTR_METRIC, *pBindings,*this),
maBulletNumRuleIndex (FN_BUL_NUM_RULE_INDEX, *pBindings,*this),
maNumNumRuleIndex (FN_NUM_NUM_RULE_INDEX, *pBindings,*this),
@@ -1118,7 +1026,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
maLineSpacePopup(this, ::boost::bind(&ParaPropertyPanel::CreateLineSpacingControl, this, _1)),
maBulletsPopup(this, ::boost::bind(&ParaPropertyPanel::CreateBulletsPopupControl, this, _1)),
maNumberingPopup(this, ::boost::bind(&ParaPropertyPanel::CreateNumberingPopupControl, this, _1)),
- maBGColorPopup(this, ::boost::bind(&ParaPropertyPanel::CreateBGColorPopupControl, this, _1)),
mxSidebar(rxSidebar)
{
//Alignment
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc b/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc
index 25eda69aac25..3b76ca445a06 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc
@@ -22,7 +22,7 @@
//for numbering and bullet
#define IID_BULLET 1
#define IID_NUMBER 2
-//============================== popup bullet and numbering & back color =========================
+//============================== popup bullet and numbering =========================
#define VS_VALUES 1
#define CB_BULLET_MORE 4
#define BMP_BULLET_MORE 5
@@ -30,8 +30,6 @@
#define VS_NUMBERING 10
#define CB_NUMBERING_MORE 12
#define BMP_NUMERING_MORE 13
-#define VS_FONT_COLOR 1
-#define STR_NOFILL 2
//============================== line space popup page ==============================
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
index db00d8f0f372..b305b53086a0 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
@@ -25,7 +25,6 @@
#include <editeng/lspcitem.hxx>
#include <svtools/ctrlbox.hxx>
#include <svx/sidebar/PanelLayout.hxx>
-#include <svx/tbxcolorupdate.hxx>
#include <svx/relfld.hxx>
#include <editeng/svxenum.hxx>
#include <editeng/fhgtitem.hxx>
@@ -33,9 +32,6 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/ui/XSidebar.hpp>
-#include <boost/scoped_ptr.hpp>
-
-#include <svx/sidebar/ColorPopup.hxx>
#include <vcl/vclenum.hxx>
#include <vcl/fixed.hxx>
#include <svl/poolitem.hxx>
@@ -104,8 +100,6 @@ private:
SvxRelativeField* mpRightIndent;
SvxRelativeField* mpFLineIndent;
- ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater;
-
// Resources
Image maSpace3;
Image maIndHang;
@@ -125,8 +119,6 @@ private:
sal_uInt16 mnBulletTypeIndex;
sal_uInt16 mnNumTypeIndex;
- Color maColor;
- bool mbColorAvailable;
FieldUnit m_eMetricUnit;
FieldUnit m_last_eMetricUnit;
SfxMapUnit m_eLRSpaceUnit;
@@ -141,7 +133,6 @@ private:
::sfx2::sidebar::ControllerItem maIncIndentControl;
::sfx2::sidebar::ControllerItem maBulletOnOff;
::sfx2::sidebar::ControllerItem maNumberOnOff;
- ::sfx2::sidebar::ControllerItem maBackColorControl;
::sfx2::sidebar::ControllerItem m_aMetricCtl;
::sfx2::sidebar::ControllerItem maBulletNumRuleIndex;
::sfx2::sidebar::ControllerItem maNumNumRuleIndex;
@@ -152,7 +143,6 @@ private:
ParaLineSpacingPopup maLineSpacePopup;
ParaBulletsPopup maBulletsPopup;
ParaNumberingPopup maNumberingPopup;
- ColorPopup maBGColorPopup;
css::uno::Reference<css::ui::XSidebar> mxSidebar;
@@ -170,7 +160,6 @@ private:
DECL_LINK(ULSpaceHdl_Impl, void*);
DECL_LINK(ClickUL_IncDec_Hdl_Impl, ToolBox*);
- void ParaBKGStateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState);
void StateChangedIndentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
void StateChangedLnSPImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
void StateChangedULImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
@@ -189,18 +178,13 @@ private:
PopupControl* CreateLineSpacingControl (PopupContainer* pParent);
PopupControl* CreateBulletsPopupControl (PopupContainer* pParent);
PopupControl* CreateNumberingPopupControl (PopupContainer* pParent);
- PopupControl* CreateBGColorPopupControl (PopupContainer* pParent);
DECL_LINK(ClickLineSPDropDownHdl_Impl, ToolBox*);
DECL_LINK(NumBTbxDDHandler, ToolBox*);
- DECL_LINK(ToolBoxBackColorDDHandler, ToolBox *);
void InitToolBoxIndent();
- void InitToolBoxBGColor();
void InitToolBoxBulletsNumbering();
void InitToolBoxSpacing();
void InitToolBoxLineSpacing();
-
- void SetBGColor (const OUString& rsColorName, const Color aColor);
};
} } // end of namespace ::svx::sidebar
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.src b/svx/source/sidebar/paragraph/ParaPropertyPanel.src
index 677ade565745..21a3fdc5b8b9 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.src
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.src
@@ -60,29 +60,6 @@ ImageList IL_NUM_BULLET_RTL
SVX_PROPERTYPANEL_PARA_NUMBULLET_IDLIST_RTL
};
-//===========================================Back color page==============================
-Control RID_POPUPPANEL_PARAPAGE_BACK_COLOR
-{
- OutputSize = TRUE;
- DialogControl = TRUE;
- Border = FALSE;
- Size = MAP_APPFONT( POPUP_COLOR_PICKER_WIDTH , POPUP_COLOR_PICKER_HEIGHT );
-
- Control VS_FONT_COLOR
- {
- HelpID = HID_PPROPERTYPANEL_PARA_BACK_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 = "Color Picker";
- };
- String STR_NOFILL
- {
- Text [ en-US ] = "No Color";
- };
-};
-
//===========================================Bullet popup page==============================
Control RID_POPUPPANEL_PARAPAGE_BULLETS
{
diff --git a/svx/uiconfig/ui/sidebarparagraph.ui b/svx/uiconfig/ui/sidebarparagraph.ui
index 286d12a04583..cc58e51c285d 100644
--- a/svx/uiconfig/ui/sidebarparagraph.ui
+++ b/svx/uiconfig/ui/sidebarparagraph.ui
@@ -68,7 +68,7 @@
</packing>
</child>
<child>
- <object class="GtkToolbar" id="backgroundcolor">
+ <object class="sfxlo-SidebarToolBox" id="backgroundcolor">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>