summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2013-06-04 16:24:18 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-06-05 08:58:17 +0100
commit612924f24cb6cbcd688c28aecefee700840e2e96 (patch)
tree0b2f49fe00b0168e0693f8580c010c61576b2f68 /svx
parent956210bf1e9dded94f9c0b7b04b8e71f5385c2c7 (diff)
Resolves: #i122446# Use different icons in Paragraph panel for...
increasing or decreasing inter-paragraph spacing (cherry picked from commit 2dc77c47146c622ffbe37996c319000e55c2f697) Change-Id: I1f44c6a8a12853120016128975016572245c8981 (cherry picked from commit 701afd6b82dc4b9caec4db42a2d06b8d04fc433a)
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.cxx27
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.hrc2
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.hxx2
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.src28
4 files changed, 28 insertions, 31 deletions
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index 88d29c98ee29..50d1b8c523fe 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -29,8 +29,10 @@
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sidebar/ResourceDefinitions.hrc>
#include <sfx2/sidebar/ControlFactory.hxx>
+#include <sfx2/sidebar/Tools.hxx>
#include <svx/sidebar/PopupContainer.hxx>
#include <sfx2/dispatch.hxx>
+//#include <sfx2/imagemgr.hxx>
#include <editeng/colritem.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/lrspitem.hxx>
@@ -49,9 +51,6 @@ using namespace cssu;
using ::sfx2::sidebar::Theme;
using ::sfx2::sidebar::ControlFactory;
-#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
-
-
namespace svx {namespace sidebar {
#define DEFAULT_VALUE 0
#define TOOLBOX_ITEM1 1
@@ -65,8 +64,6 @@ namespace svx {namespace sidebar {
#define INDENT_DECREMENT 2
#define INDENT_STEP 706
#define UL_STEP 58
-#define UL_INCREMENT 1
-#define UL_DECREMENT 2
#define MAX_SW 1709400
#define MAX_SC_SD 116220200
@@ -474,8 +471,18 @@ void ParaPropertyPanel::InitToolBoxSpacing()
maTopDist->SetAccessibleName(maTopDist->GetQuickHelpText());
maBottomDist->SetAccessibleName(maBottomDist->GetQuickHelpText());
- maTbxUL_IncDec->SetItemImage(TOOLBOX_ITEM1, maParInc);
- maTbxUL_IncDec->SetItemImage(TOOLBOX_ITEM2, maParDec);
+ // Use a form of image loading that can handle both .uno:<command>
+ // and private:graphirepository... syntax. This is necessary to
+ // handle the workaround for accessing the images of commands
+ // ParaspaceIncrease and ParaspaceDecrease.
+ // See issue 122446 for more details.
+ maTbxUL_IncDec->SetItemImage(
+ BT_TBX_UL_INC,
+ sfx2::sidebar::Tools::GetImage(maTbxUL_IncDec->GetItemCommand(BT_TBX_UL_INC), mxFrame));
+ maTbxUL_IncDec->SetItemImage(
+ BT_TBX_UL_DEC,
+ sfx2::sidebar::Tools::GetImage(maTbxUL_IncDec->GetItemCommand(BT_TBX_UL_DEC), mxFrame));
+
aLink = LINK( this, ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl );
maTbxUL_IncDec->SetSelectHdl(aLink);
m_eULSpaceUnit = maULSpaceControl.GetCoreMetric();
@@ -967,7 +974,7 @@ IMPL_LINK(ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl, ToolBox *, pControl)
{
switch (pControl->GetCurItemId())
{
- case UL_INCREMENT:
+ case BT_TBX_UL_INC:
{
SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE );
@@ -985,7 +992,7 @@ IMPL_LINK(ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl, ToolBox *, pControl)
SID_ATTR_PARA_ULSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
}
break;
- case UL_DECREMENT:
+ case BT_TBX_UL_DEC:
{
SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE );
@@ -1583,8 +1590,6 @@ ParaPropertyPanel::ParaPropertyPanel(Window* pParent,
maIndent2 (SVX_RES(IMG_INDENT2)),
maIndent3 (SVX_RES(IMG_INDENT3)),
maIndHang (SVX_RES(IMG_INDENT_HANG)),
- maParInc (SVX_RES(IMG_PARA_INC)),
- maParDec (SVX_RES(IMG_PARA_DEC)),
maNumBImageList (SVX_RES(IL_NUM_BULLET)),
maNumBImageListH (SVX_RES(ILH_NUM_BULLET)),
maNumBImageListRTL (SVX_RES(IL_NUM_BULLET_RTL)),
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc b/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc
index 6ffb875f4ae0..7c0f46c82d57 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc
@@ -34,8 +34,6 @@
#define MF_AFTER_INDENT 4
#define MF_FL_INDENT 6
#define TBX_HORIZONTALALIGNMENT 5
-#define IMG_PARA_INC 13
-#define IMG_PARA_DEC 14
#define IMG_INDENT_HANG 15
#define FT_INDENT 16
#define TBX_INDENT_INC_DEC 17
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
index 3ed393b2d63d..3903d6d61701 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
@@ -143,8 +143,6 @@ private:
Image maIndent3;
Image maIndHang;
- Image maParInc;
- Image maParDec;
ImageList maNumBImageList;
ImageList maNumBImageListH;
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.src b/svx/source/sidebar/paragraph/ParaPropertyPanel.src
index fd1b2610a6d9..e0504ce875a9 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.src
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.src
@@ -192,20 +192,24 @@ Control RID_SIDEBAR_PARA_PANEL
Identifier = BT_TBX_UL_INC ;
HelpID = HID_PPROPERTYPANEL_PARA_TBI_INC ;
Text [ en-US ] = "Increase Spacing" ;
- ItemBitmap = Bitmap
- {
- File = "symphony/IncreaseSpace_16x16.png";
- };
+
+ /** The next line should be
+ Command = ".uno:ParaspaceIncrease";
+ The hack is necessary because the ParaspaceIncrease command is only
+ defined for Draw/Impress. It has to be defined in
+ GenericCommancs.xcu to be recognized. See issue 122446 for more details.
+ */
+ Command = "private:graphicrepository/res/commandimagelist/sc_paraspaceincrease.png";
};
ToolBoxItem
{
Identifier = BT_TBX_UL_DEC ;
HelpID = HID_PPROPERTYPANEL_PARA_TBI_DEC ;
Text [ en-US ] = "Decrease Spacing" ;
- ItemBitmap = Bitmap
- {
- File = "symphony/DecreaseSpace_16x16.png";
- };
+ /** See above or issue 122446 why the following line is not
+ Command = ".uno:ParaspaceDecrease";
+ */
+ Command = "private:graphicrepository/res/commandimagelist/sc_paraspacedecrease.png";
};
};
};
@@ -465,14 +469,6 @@ Control RID_SIDEBAR_PARA_PANEL
{
ImageBitmap = Bitmap{File = "symphony/Indent_Hanging.png";};
};
- Image IMG_PARA_INC
- {
- ImageBitmap = Bitmap{File = "symphony/IncreaseSpace_16x16.png";};
- };
- Image IMG_PARA_DEC
- {
- ImageBitmap = Bitmap{File = "symphony/DecreaseSpace_16x16.png";};
- };
};
//===========================================Back color page==============================