summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2013-04-19 08:51:45 +0000
committerMichael Meeks <michael.meeks@suse.com>2013-05-20 11:33:16 +0100
commit0b2c09a180f076230a1f1ac3ecf4725e82aada4c (patch)
treecd61de0a554320ae3c6c7c5ef9ef4c412e0dd3ac /svx
parentc991fb49aa174f300be0b978d89bc63e01e0aa2b (diff)
Resolves: #i121960# Extend the sidebar::ControllerItem to check Disabled state
Converted TextPropertyPanel to use this new functionality. (cherry picked from commit 5e32abe48b0833e4e370507a1e74fbb1ba98b5e3) Conflicts: officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu sfx2/inc/sfx2/sidebar/ControllerItem.hxx sfx2/source/sidebar/ControllerItem.cxx sfx2/source/sidebar/FocusManager.cxx sfx2/source/sidebar/SidebarChildWindow.cxx svx/Library_svx.mk svx/source/sidebar/text/TextPropertyPanel.cxx svx/source/sidebar/text/TextPropertyPanel.hrc svx/source/sidebar/text/TextPropertyPanel.hxx svx/source/sidebar/text/TextPropertyPanel.src svx/source/sidebar/text/TextUnderlineControl.hxx Change-Id: I3a25bb0a02e6165ceeb6dbd9e6ecd3e94051f594
Diffstat (limited to 'svx')
-rw-r--r--svx/Library_svx.mk1
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.cxx6
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.hxx3
-rw-r--r--svx/source/sidebar/graphic/GraphicPropertyPanel.cxx8
-rw-r--r--svx/source/sidebar/graphic/GraphicPropertyPanel.hxx3
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.cxx6
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.hxx3
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.cxx11
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.hxx3
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx6
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.hxx3
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingControl.cxx9
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingControl.hxx8
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.cxx708
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.hrc16
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.hxx37
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.src116
-rw-r--r--svx/source/sidebar/text/TextUnderlineControl.cxx8
-rw-r--r--svx/source/sidebar/text/TextUnderlineControl.hxx6
19 files changed, 334 insertions, 627 deletions
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index 420bb635df4e..6279f09f6992 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -44,6 +44,7 @@ $(eval $(call gb_Library_use_libraries,svx,\
cppu \
drawinglayer \
editeng \
+ fwk \
i18nlangtag \
sal \
sfx \
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index 0e746aa44d63..ee8d0cc2192d 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -735,8 +735,11 @@ void AreaPropertyPanel::ImpUpdateTransparencies()
void AreaPropertyPanel::NotifyItemUpdate(
sal_uInt16 nSID,
SfxItemState eState,
- const SfxPoolItem* pState)
+ const SfxPoolItem* pState,
+ const bool bIsEnabled)
{
+ (void)bIsEnabled;
+
XFillStyle eXFS;
SfxObjectShell* pSh = SfxObjectShell::Current();
bool bFillTransparenceChanged(false);
@@ -1042,6 +1045,7 @@ void AreaPropertyPanel::NotifyItemUpdate(
+
SfxBindings* AreaPropertyPanel::GetBindings()
{
return mpBindings;
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hxx b/svx/source/sidebar/area/AreaPropertyPanel.hxx
index 69617a0cc13a..4f8da6fdcd96 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.hxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.hxx
@@ -65,7 +65,8 @@ public:
virtual void NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
- const SfxPoolItem* pState);
+ const SfxPoolItem* pState,
+ const bool bIsEnabled);
SfxBindings* GetBindings();
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
index 1e5103d1a133..f55a408b4fdb 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
@@ -272,8 +272,11 @@ void GraphicPropertyPanel::DataChanged(
void GraphicPropertyPanel::NotifyItemUpdate(
sal_uInt16 nSID,
SfxItemState eState,
- const SfxPoolItem* pState)
+ const SfxPoolItem* pState,
+ const bool bIsEnabled)
{
+ (void)bIsEnabled;
+
switch( nSID )
{
case SID_ATTR_GRAF_LUMINANCE:
@@ -439,6 +442,9 @@ void GraphicPropertyPanel::NotifyItemUpdate(
}
}
+
+
+
//////////////////////////////////////////////////////////////////////////////
SfxBindings* GraphicPropertyPanel::GetBindings()
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
index c5bd01cd9bf4..d5e0c093c9c8 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
@@ -48,7 +48,8 @@ public:
virtual void NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
- const SfxPoolItem* pState);
+ const SfxPoolItem* pState,
+ const bool bIsEnabled);
SfxBindings* GetBindings();
diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx
index d58ad83f1362..4f39c5b6ab2c 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -383,8 +383,11 @@ void LinePropertyPanel::DataChanged(
void LinePropertyPanel::NotifyItemUpdate(
sal_uInt16 nSID,
SfxItemState eState,
- const SfxPoolItem* pState)
+ const SfxPoolItem* pState,
+ const bool bIsEnabled)
{
+ (void)bIsEnabled;
+
switch(nSID)
{
case SID_ATTR_LINE_COLOR:
@@ -684,6 +687,7 @@ void LinePropertyPanel::NotifyItemUpdate(
+
SfxBindings* LinePropertyPanel::GetBindings()
{
return mpBindings;
diff --git a/svx/source/sidebar/line/LinePropertyPanel.hxx b/svx/source/sidebar/line/LinePropertyPanel.hxx
index 327c18e54724..ba77e5a5dc21 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.hxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.hxx
@@ -76,7 +76,8 @@ public:
virtual void NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
- const SfxPoolItem* pState);
+ const SfxPoolItem* pState,
+ const bool bIsEnabled);
SfxBindings* GetBindings();
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index 76dd922b58db..c6b8809f2c7d 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -1022,8 +1022,14 @@ IMPL_LINK(ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl, ToolBox *, pControl)
}
//==================================for Paragraph State change=====================
-void ParaPropertyPanel::NotifyItemUpdate( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
+void ParaPropertyPanel::NotifyItemUpdate(
+ sal_uInt16 nSID,
+ SfxItemState eState,
+ const SfxPoolItem* pState,
+ const bool bIsEnabled)
{
+ (void)bIsEnabled;
+
if( nSID == SID_ATTR_METRIC )
{
m_eMetricUnit = GetCurrentUnit(eState,pState);
@@ -1073,6 +1079,9 @@ void ParaPropertyPanel::NotifyItemUpdate( sal_uInt16 nSID, SfxItemState eState,
}
}
+
+
+
void ParaPropertyPanel::StateChangedAlignmentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
{
if( eState >= SFX_ITEM_AVAILABLE )
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
index 7d6677d1d894..6a5aaa9fb616 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
@@ -76,7 +76,8 @@ public:
virtual void NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
- const SfxPoolItem* pState);
+ const SfxPoolItem* pState,
+ const bool bIsEnabled);
void ShowMenu (void);
sal_uInt16 GetBulletTypeIndex(){ return mnBulletTypeIndex; }
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 032537352e67..ff95a4da66bb 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -627,8 +627,11 @@ IMPL_LINK( PosSizePropertyPanel, FlipHdl, ToolBox*, pBox )
void PosSizePropertyPanel::NotifyItemUpdate(
sal_uInt16 nSID,
SfxItemState eState,
- const SfxPoolItem* pState)
+ const SfxPoolItem* pState,
+ const bool bIsEnabled)
{
+ (void)bIsEnabled;
+
mpFtAngle->Enable();
mpMtrAngle->Enable();
mpDial->Enable();
@@ -950,6 +953,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
+
SfxBindings* PosSizePropertyPanel::GetBindings()
{
return mpBindings;
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
index bbdff17e41c3..7beb0825f0a9 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
@@ -61,7 +61,8 @@ public:
virtual void NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
- const SfxPoolItem* pState);
+ const SfxPoolItem* pState,
+ const bool bIsEnabled);
SfxBindings* GetBindings();
void ShowMenu (void);
diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
index 59fdfdc0a5d1..96371cec632c 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
@@ -27,10 +27,14 @@
#include <sfx2/sidebar/Theme.hxx>
namespace svx { namespace sidebar {
-TextCharacterSpacingControl::TextCharacterSpacingControl(Window* pParent, svx::sidebar::TextPropertyPanel& rPanel)
+
+TextCharacterSpacingControl::TextCharacterSpacingControl (
+ Window* pParent,
+ svx::sidebar::TextPropertyPanel& rPanel,
+ SfxBindings* pBindings)
: PopupControl( pParent,SVX_RES(RID_POPUPPANEL_TEXTPAGE_SPACING))
, mrTextPropertyPanel(rPanel)
-, mpBindings(NULL)
+, mpBindings(pBindings)
, maVSSpacing (ValueSetWithTextControl::IMAGE_TEXT,this, SVX_RES(VS_SPACING))
, maLastCus (this, SVX_RES(FT_LASTCUSTOM))
//, maBorder (this, SVX_RES(CT_BORDER))
@@ -59,7 +63,6 @@ TextCharacterSpacingControl::TextCharacterSpacingControl(Window* pParent, svx::s
{
initial();
FreeResource();
- mpBindings = mrTextPropertyPanel.GetBindings();
Link aLink = LINK(this, TextCharacterSpacingControl, KerningSelectHdl);
maLBKerning.SetSelectHdl(aLink);
aLink =LINK(this, TextCharacterSpacingControl, KerningModifyHdl);
diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.hxx b/svx/source/sidebar/text/TextCharacterSpacingControl.hxx
index 89c07031da94..2e0aef983992 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingControl.hxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingControl.hxx
@@ -37,11 +37,15 @@ namespace svx { namespace sidebar {
#define SIDEBAR_SPACE_NORMAL 0
#define SIDEBAR_SPACE_EXPAND 1
#define SIDEBAR_SPACE_CONDENSED 2
+
class TextCharacterSpacingControl:public svx::sidebar::PopupControl
{
public:
- TextCharacterSpacingControl(Window* pParent, svx::sidebar::TextPropertyPanel& rPanel);
- ~TextCharacterSpacingControl();
+ TextCharacterSpacingControl (
+ Window* pParent,
+ svx::sidebar::TextPropertyPanel& rPanel,
+ SfxBindings* pBindings);
+ virtual ~TextCharacterSpacingControl();
void ToGetFocus();
void Rearrange(bool bLBAvailable,bool bAvailable, long nKerning);
//virtual void Paint(const Rectangle& rect);
diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx
index 79b24884766d..044bfa983b0c 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.cxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.cxx
@@ -54,7 +54,6 @@
#include <svx/sidebar/ColorControl.hxx>
#include <svx/sidebar/PopupContainer.hxx>
-
#include <boost/bind.hpp>
using namespace css;
@@ -77,12 +76,12 @@ namespace svx { namespace sidebar {
//end
PopupControl* TextPropertyPanel::CreateCharacterSpacingControl (PopupContainer* pParent)
{
- return new TextCharacterSpacingControl(pParent, *this);
+ return new TextCharacterSpacingControl(pParent, *this, mpBindings);
}
PopupControl* TextPropertyPanel::CreateUnderlinePopupControl (PopupContainer* pParent)
{
- return new TextUnderlineControl(pParent, *this);
+ return new TextUnderlineControl(pParent, *this, mpBindings);
}
namespace
@@ -199,35 +198,21 @@ TextPropertyPanel::TextPropertyPanel (
mpFontColorUpdater(),
mpHighlightUpdater(),
- maFontNameControl (SID_ATTR_CHAR_FONT, *pBindings, *this),
- maFontSizeControl (SID_ATTR_CHAR_FONTHEIGHT, *pBindings, *this),
- maWeightControl (SID_ATTR_CHAR_WEIGHT, *pBindings, *this),
- maItalicControl (SID_ATTR_CHAR_POSTURE, *pBindings, *this),
- maUnderlineControl (SID_ATTR_CHAR_UNDERLINE, *pBindings, *this),
- maStrikeControl (SID_ATTR_CHAR_STRIKEOUT, *pBindings, *this),
- maShadowControl (SID_ATTR_CHAR_SHADOWED, *pBindings, *this),
- maFontColorControl (SID_ATTR_CHAR_COLOR, *pBindings, *this),
- maScriptControlSw (SID_ATTR_CHAR_ESCAPEMENT, *pBindings, *this), //for sw
- maSuperScriptControl (SID_SET_SUPER_SCRIPT, *pBindings, *this),
- maSubScriptControl (SID_SET_SUB_SCRIPT, *pBindings, *this),
- maSpacingControl (SID_ATTR_CHAR_KERNING, *pBindings, *this),
- maHighlightControl (SID_ATTR_BRUSH_CHAR, *pBindings, *this),
- maSDFontGrow (SID_GROW_FONT_SIZE, *pBindings, *this),
- maSDFontShrink (SID_SHRINK_FONT_SIZE, *pBindings, *this),
-
- maImgIncrease (SVX_RES( IMG_INCREASE)),
- maImgDecrease (SVX_RES( IMG_DECREASE)),
- maImgBold (SVX_RES( IMG_BOLD )),
- maImgItalic (SVX_RES( IMG_ITALIC )),
- maImgUnderline (SVX_RES( IMG_UNDERLINE )),
- maImgStrike (SVX_RES( IMG_STRIKEOUT )),
- maImgShadow (SVX_RES( IMG_SHADOWED )),
- maImgFontColor (SVX_RES( IMG_FONTCOLOR)),
- maImgSupScript (SVX_RES( IMG_SUPSCRIPT)),
- maImgSubScript (SVX_RES( IMG_SUBSCRIPT)),
- maImgHighlight (SVX_RES( IMG_HIGHLIGHT)),
-
- maImgNormalIcon (SVX_RES( IMG_SPACING_D)),
+ maFontNameControl (SID_ATTR_CHAR_FONT, *pBindings, *this, A2S("CharFontName"), rxFrame),
+ maFontSizeControl (SID_ATTR_CHAR_FONTHEIGHT, *pBindings, *this, A2S("FontHeight"), rxFrame),
+ maWeightControl (SID_ATTR_CHAR_WEIGHT, *pBindings, *this, A2S("Bold"), rxFrame),
+ maItalicControl (SID_ATTR_CHAR_POSTURE, *pBindings, *this, A2S("Italic"), rxFrame),
+ maUnderlineControl (SID_ATTR_CHAR_UNDERLINE, *pBindings, *this, A2S("Underline"), rxFrame),
+ maStrikeControl (SID_ATTR_CHAR_STRIKEOUT, *pBindings, *this, A2S("Strikeout"), rxFrame),
+ maShadowControl (SID_ATTR_CHAR_SHADOWED, *pBindings, *this, A2S("Shadowed"), rxFrame),
+ maFontColorControl (SID_ATTR_CHAR_COLOR, *pBindings, *this, A2S("Color"), rxFrame),
+ maScriptControlSw (SID_ATTR_CHAR_ESCAPEMENT, *pBindings, *this, A2S("Escapement"), rxFrame),
+ maSuperScriptControl(SID_SET_SUPER_SCRIPT, *pBindings, *this, A2S("SuperScript"), rxFrame),
+ maSubScriptControl (SID_SET_SUB_SCRIPT, *pBindings, *this, A2S("SubScript"), rxFrame),
+ maSpacingControl (SID_ATTR_CHAR_KERNING, *pBindings, *this, A2S("Spacing"), rxFrame),
+ maHighlightControl (SID_ATTR_BRUSH_CHAR, *pBindings, *this, A2S("CharacterBackgroundPattern"),rxFrame),
+ maSDFontGrow (SID_GROW_FONT_SIZE, *pBindings, *this, A2S("Grow"), rxFrame),
+ maSDFontShrink (SID_SHRINK_FONT_SIZE, *pBindings, *this, A2S("Shrink"), rxFrame),
mpFontList (NULL),
mbMustDelete (false),
@@ -238,7 +223,6 @@ TextPropertyPanel::TextPropertyPanel (
maFontColorPopup(this, ::boost::bind(&TextPropertyPanel::CreateFontColorPopupControl, this, _1)),
maBrushColorPopup(this, ::boost::bind(&TextPropertyPanel::CreateBrushColorPopupControl, this, _1)),
-
mxFrame(rxFrame),
maContext(),
mpBindings(pBindings),
@@ -278,12 +262,6 @@ TextPropertyPanel::~TextPropertyPanel (void)
-Image TextPropertyPanel::GetIcon (const ::rtl::OUString& rsURL)
-{
- return GetImage(mxFrame, rsURL, sal_False);
-}
-
-
void TextPropertyPanel::SetSpacing(long nKern)
{
mlKerning = nKern;
@@ -382,17 +360,14 @@ void TextPropertyPanel::HandleContextChange (
}
}
-SfxBindings* TextPropertyPanel::GetBindings()
-{
- return mpBindings;
-}
+
void TextPropertyPanel::DataChanged (const DataChangedEvent& rEvent)
{
(void)rEvent;
- SetupIcons();
+ SetupToolboxItems();
}
@@ -410,7 +385,7 @@ void TextPropertyPanel::Initialize (void)
else
{
mpFontList = new FontList( Application::GetDefaultDevice() );
- mbMustDelete = 1;
+ mbMustDelete = true;
}
mpFontNameBox->SetAccessibleName(mpFontNameBox->GetQuickHelpText());
@@ -419,7 +394,7 @@ void TextPropertyPanel::Initialize (void)
maFontSizeBox.SetAccessibleName(maFontSizeBox.GetQuickHelpText());
//toolbox
- SetupIcons();
+ SetupToolboxItems();
InitToolBoxIncDec();
InitToolBoxFont();
InitToolBoxFontColor();
@@ -513,9 +488,6 @@ void TextPropertyPanel::EndUnderlinePopupMode (void)
void TextPropertyPanel::InitToolBoxFont()
{
- mpToolBoxFont->SetQuickHelpText(TBI_BOLD,String(SVX_RES(STR_QH_BOLD))); //Add
- mpToolBoxFont->SetQuickHelpText(TBI_ITALIC,String(SVX_RES(STR_QH_ITALIC))); //Add
- mpToolBoxFont->SetQuickHelpText(TBI_UNDERLINE,String(SVX_RES(STR_QH_UNDERLINE))); //Add
mpToolBoxFont->SetBackground(Wallpaper());
mpToolBoxFont->SetPaintTransparent(true);
@@ -592,48 +564,26 @@ void TextPropertyPanel::InitToolBoxHighlight()
-void TextPropertyPanel::SetupIcons (void)
+void TextPropertyPanel::SetupToolboxItems (void)
{
- if (Theme::GetBoolean(Theme::Bool_UseSymphonyIcons))
- {
- mpToolBoxIncDec->SetItemImage(TBI_INCREASE, maImgIncrease);
- mpToolBoxIncDec->SetItemImage(TBI_DECREASE, maImgDecrease);
- mpToolBoxFont->SetItemImage(TBI_BOLD, maImgBold);
- mpToolBoxFont->SetItemImage(TBI_ITALIC, maImgItalic);
- mpToolBoxFont->SetItemImage(TBI_UNDERLINE, maImgUnderline);
- mpToolBoxFont->SetItemImage(TBI_STRIKEOUT, maImgStrike);
- mpToolBoxFont->SetItemImage(TBI_SHADOWED, maImgShadow);
-
- mpToolBoxFontColor->SetItemImage(TBI_FONTCOLOR, maImgFontColor);
- //for sw
- mpToolBoxScriptSw->SetItemImage(TBI_SUPER_SW, maImgSupScript);
- mpToolBoxScriptSw->SetItemImage(TBI_SUB_SW, maImgSubScript);
- //for sc and sd
- mpToolBoxScript->SetItemImage(TBI_SUPER, maImgSupScript);
- mpToolBoxScript->SetItemImage(TBI_SUB, maImgSubScript);
- mpToolBoxSpacing->SetItemImage(TBI_SPACING, maImgNormalIcon);
- mpToolBoxHighlight->SetItemImage(TBI_HIGHLIGHT, maImgHighlight);
- }
- else
- {
- mpToolBoxIncDec->SetItemImage(TBI_INCREASE, GetIcon(A2S(".uno:Grow")));
- mpToolBoxIncDec->SetItemImage(TBI_DECREASE, GetIcon(A2S(".uno:Shrink")));
- mpToolBoxFont->SetItemImage(TBI_BOLD, GetIcon(A2S(".uno:Bold")));
- mpToolBoxFont->SetItemImage(TBI_ITALIC, GetIcon(A2S(".uno:Italic")));
- mpToolBoxFont->SetItemImage(TBI_UNDERLINE, GetIcon(A2S(".uno:Underline")));
- mpToolBoxFont->SetItemImage(TBI_STRIKEOUT, GetIcon(A2S(".uno:Strikeout")));
- mpToolBoxFont->SetItemImage(TBI_SHADOWED, GetIcon(A2S(".uno:Shadowed")));
-
- mpToolBoxFontColor->SetItemImage(TBI_FONTCOLOR, GetIcon(A2S(".uno:FontColor")));
- //for sw
- mpToolBoxScriptSw->SetItemImage(TBI_SUPER_SW, GetIcon(A2S(".uno:SuperScript")));
- mpToolBoxScriptSw->SetItemImage(TBI_SUB_SW, GetIcon(A2S(".uno:SubScript")));
- //for sc and sd
- mpToolBoxScript->SetItemImage(TBI_SUPER, GetIcon(A2S(".uno:SuperScript")));
- mpToolBoxScript->SetItemImage(TBI_SUB, GetIcon(A2S(".uno:SubScript")));
- mpToolBoxSpacing->SetItemImage(TBI_SPACING, GetIcon(A2S(".uno:FontworkCharacterSpacingFloater")));
- mpToolBoxHighlight->SetItemImage(TBI_HIGHLIGHT, GetIcon(A2S(".uno:BackColor")));
- }
+ maSDFontGrow.SetupToolBoxItem(*mpToolBoxIncDec, TBI_INCREASE);
+ maSDFontShrink.SetupToolBoxItem(*mpToolBoxIncDec, TBI_DECREASE);
+
+ maWeightControl.SetupToolBoxItem(*mpToolBoxFont, TBI_BOLD);
+ maItalicControl.SetupToolBoxItem(*mpToolBoxFont, TBI_ITALIC);
+ maUnderlineControl.SetupToolBoxItem(*mpToolBoxFont, TBI_UNDERLINE);
+ maStrikeControl.SetupToolBoxItem(*mpToolBoxFont, TBI_STRIKEOUT);
+ maShadowControl.SetupToolBoxItem(*mpToolBoxFont, TBI_SHADOWED);
+
+ maFontColorControl.SetupToolBoxItem(*mpToolBoxFontColor, TBI_FONTCOLOR);
+ //for sw
+ maSuperScriptControl.SetupToolBoxItem(*mpToolBoxScriptSw, TBI_SUPER_SW);
+ maSubScriptControl.SetupToolBoxItem(*mpToolBoxScriptSw, TBI_SUB_SW);
+ //for sc and sd
+ maSubScriptControl.SetupToolBoxItem(*mpToolBoxScript, TBI_SUPER);
+ maSubScriptControl.SetupToolBoxItem(*mpToolBoxScript, TBI_SUB);
+ maSpacingControl.SetupToolBoxItem(*mpToolBoxSpacing, TBI_SPACING);
+ maHighlightControl.SetupToolBoxItem(*mpToolBoxHighlight, TBI_HIGHLIGHT);
}
@@ -700,78 +650,71 @@ IMPL_LINK(TextPropertyPanel, ToolboxFontSelectHandler, ToolBox*, pToolBox)
{
const sal_uInt16 nId = pToolBox->GetCurItemId();
- //Bold
- if(nId == TBI_BOLD)
- {
- EndTracking();
- if(meWeight != WEIGHT_BOLD)
- meWeight = WEIGHT_BOLD;
- else
- meWeight = WEIGHT_NORMAL;
- SvxWeightItem aWeightItem(meWeight, SID_ATTR_CHAR_WEIGHT);
- mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_WEIGHT, SFX_CALLMODE_RECORD, &aWeightItem, 0L);
- UpdateFontBold();
- }
- //Italic
- else if(nId == TBI_ITALIC)
- {
- EndTracking();
- if(meItalic != ITALIC_NORMAL)
- meItalic = ITALIC_NORMAL;
- else
- meItalic = ITALIC_NONE;
- SvxPostureItem aPostureItem(meItalic, SID_ATTR_CHAR_POSTURE);
- mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_POSTURE, SFX_CALLMODE_RECORD, &aPostureItem, 0L);
- UpdateFontItalic();
- }
- //underline
- else if(nId == TBI_UNDERLINE)
+ switch (nId)
{
- EndTracking();
- //add , keep underline's color
- if(meUnderline == UNDERLINE_NONE)
+ case TBI_BOLD:
{
- //AF: meUnderline = GetDefaultUnderline();
- meUnderline = UNDERLINE_SINGLE;
- //<<modify
- //SvxTextLineItem aLineItem(meUnderline, SID_ATTR_CHAR_UNDERLINE);
- SvxUnderlineItem aLineItem(meUnderline, SID_ATTR_CHAR_UNDERLINE);
- //modify end>>
- aLineItem.SetColor(meUnderlineColor);
- mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_UNDERLINE, SFX_CALLMODE_RECORD, &aLineItem, 0L);
+ EndTracking();
+ if(meWeight != WEIGHT_BOLD)
+ meWeight = WEIGHT_BOLD;
+ else
+ meWeight = WEIGHT_NORMAL;
+ SvxWeightItem aWeightItem(meWeight, SID_ATTR_CHAR_WEIGHT);
+ mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_WEIGHT, SFX_CALLMODE_RECORD, &aWeightItem, 0L);
+ UpdateItem(SID_ATTR_CHAR_WEIGHT);
+ break;
}
- else
+ case TBI_ITALIC:
{
- meUnderline = UNDERLINE_NONE;
- //<<modify
- //SvxTextLineItem aLineItem(meUnderline, SID_ATTR_CHAR_UNDERLINE);
- SvxUnderlineItem aLineItem(meUnderline, SID_ATTR_CHAR_UNDERLINE);
- //modify end>>
- mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_UNDERLINE, SFX_CALLMODE_RECORD, &aLineItem, 0L);
+ EndTracking();
+ if(meItalic != ITALIC_NORMAL)
+ meItalic = ITALIC_NORMAL;
+ else
+ meItalic = ITALIC_NONE;
+ SvxPostureItem aPostureItem(meItalic, SID_ATTR_CHAR_POSTURE);
+ mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_POSTURE, SFX_CALLMODE_RECORD, &aPostureItem, 0L);
+ UpdateItem(SID_ATTR_CHAR_POSTURE);
+ break;
+ }
+ case TBI_UNDERLINE:
+ {
+ EndTracking();
+ if(meUnderline == UNDERLINE_NONE)
+ {
+ meUnderline = UNDERLINE_SINGLE;
+ SvxUnderlineItem aLineItem(meUnderline, SID_ATTR_CHAR_UNDERLINE);
+ aLineItem.SetColor(meUnderlineColor);
+ mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_UNDERLINE, SFX_CALLMODE_RECORD, &aLineItem, 0L);
+ }
+ else
+ {
+ meUnderline = UNDERLINE_NONE;
+ SvxUnderlineItem aLineItem(meUnderline, SID_ATTR_CHAR_UNDERLINE);
+ mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_UNDERLINE, SFX_CALLMODE_RECORD, &aLineItem, 0L);
+ }
+ UpdateItem(SID_ATTR_CHAR_UNDERLINE);
+ }
+ case TBI_STRIKEOUT:
+ {
+ EndTracking();
+ if(meStrike != STRIKEOUT_NONE && meStrike != STRIKEOUT_DONTKNOW)
+ meStrike = STRIKEOUT_NONE;
+ else
+ meStrike = STRIKEOUT_SINGLE;
+ SvxCrossedOutItem aStrikeItem(meStrike,SID_ATTR_CHAR_STRIKEOUT);
+ mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_STRIKEOUT, SFX_CALLMODE_RECORD, &aStrikeItem, 0L);
+ UpdateItem(SID_ATTR_CHAR_STRIKEOUT);
+ break;
+ }
+ case TBI_SHADOWED:
+ {
+ EndTracking();
+ mbShadow = !mbShadow;
+ SvxShadowedItem aShadowItem(mbShadow, SID_ATTR_CHAR_SHADOWED);
+ mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_SHADOWED, SFX_CALLMODE_RECORD, &aShadowItem, 0L);
+ UpdateItem(SID_ATTR_CHAR_SHADOWED);
+ break;
}
- UpdateFontUnderline();
- //add end
- }
- //strike out
- else if(nId == TBI_STRIKEOUT)
- {
- EndTracking();
- if(meStrike != STRIKEOUT_NONE && meStrike != STRIKEOUT_DONTKNOW)
- meStrike = STRIKEOUT_NONE;
- else
- meStrike = STRIKEOUT_SINGLE;
- SvxCrossedOutItem aStrikeItem(meStrike,SID_ATTR_CHAR_STRIKEOUT);
- mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_STRIKEOUT, SFX_CALLMODE_RECORD, &aStrikeItem, 0L);
- UpdateFontStrikeOut();
- }
- //shadowed
- else if(nId == TBI_SHADOWED)
- {
- EndTracking();
- mbShadow = !mbShadow;
- SvxShadowedItem aShadowItem(mbShadow, SID_ATTR_CHAR_SHADOWED);
- mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_SHADOWED, SFX_CALLMODE_RECORD, &aShadowItem, 0L);
- UpdateFontShadowed();
}
return 0;
}
@@ -784,22 +727,15 @@ IMPL_LINK(TextPropertyPanel, ToolboxIncDecSelectHdl, ToolBox*, pToolBox)
const sal_uInt16 nId = pToolBox->GetCurItemId();
// font size +/- enhancement in sd
- switch (maContext.GetCombinedContext())
+ switch (maContext.GetCombinedContext_DI())
{
- case CombinedEnumContext(Application_Draw, Context_DrawText):
- case CombinedEnumContext(Application_Draw, Context_Text):
- case CombinedEnumContext(Application_Draw, Context_Table):
- case CombinedEnumContext(Application_Draw, Context_OutlineText):
- case CombinedEnumContext(Application_Draw, Context_Draw):
- case CombinedEnumContext(Application_Draw, Context_TextObject):
- case CombinedEnumContext(Application_Draw, Context_Graphic):
- case CombinedEnumContext(Application_Impress, Context_DrawText):
- case CombinedEnumContext(Application_Impress, Context_Text):
- case CombinedEnumContext(Application_Impress, Context_Table):
- case CombinedEnumContext(Application_Impress, Context_OutlineText):
- case CombinedEnumContext(Application_Impress, Context_Draw):
- case CombinedEnumContext(Application_Impress, Context_TextObject):
- case CombinedEnumContext(Application_Impress, Context_Graphic):
+ case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
+ case CombinedEnumContext(Application_DrawImpress, Context_Text):
+ case CombinedEnumContext(Application_DrawImpress, Context_Table):
+ case CombinedEnumContext(Application_DrawImpress, Context_OutlineText):
+ case CombinedEnumContext(Application_DrawImpress, Context_Draw):
+ case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
+ case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
if(nId == TBI_INCREASE)
{
EndTracking();
@@ -846,24 +782,7 @@ IMPL_LINK(TextPropertyPanel, ToolboxIncDecSelectHdl, ToolBox*, pToolBox)
mpBindings->GetDispatcher()->Execute( SID_ATTR_CHAR_FONTHEIGHT, SFX_CALLMODE_RECORD, &aItem, 0L );
mpBindings->Invalidate(SID_ATTR_CHAR_FONTHEIGHT,true,false);
- //add , update ASAP
maFontSizeBox.SetValue( nSize );
- if(nSize >= 960)
- {
- mpToolBoxIncDec->EnableItem(TBI_INCREASE,false);
- mpToolBoxIncDec->EnableItem(TBI_DECREASE,true);
- }
- else if(nSize <= 60)
- {
- mpToolBoxIncDec->EnableItem(TBI_INCREASE,true);
- mpToolBoxIncDec->EnableItem(TBI_DECREASE,false);
- }
- else
- {
- mpToolBoxIncDec->EnableItem(TBI_INCREASE,true);
- mpToolBoxIncDec->EnableItem(TBI_DECREASE,true);
- }
- //add end
}
else if(nId == TBI_DECREASE)
{
@@ -900,26 +819,11 @@ IMPL_LINK(TextPropertyPanel, ToolboxIncDecSelectHdl, ToolBox*, pToolBox)
mpBindings->GetDispatcher()->Execute( SID_ATTR_CHAR_FONTHEIGHT, SFX_CALLMODE_RECORD, &aItem, 0L );
mpBindings->Invalidate(SID_ATTR_CHAR_FONTHEIGHT,true,false);
- //add
maFontSizeBox.SetValue( nSize );
- if(nSize >= 960)
- {
- mpToolBoxIncDec->EnableItem(TBI_INCREASE,false);
- mpToolBoxIncDec->EnableItem(TBI_DECREASE,true);
- }
- else if(nSize <= 60)
- {
- mpToolBoxIncDec->EnableItem(TBI_INCREASE,true);
- mpToolBoxIncDec->EnableItem(TBI_DECREASE,false);
- }
- else
- {
- mpToolBoxIncDec->EnableItem(TBI_INCREASE,true);
- mpToolBoxIncDec->EnableItem(TBI_DECREASE,true);
- }
- //add end
}
}
+ UpdateItem(SID_ATTR_CHAR_FONTHEIGHT);
+
return 0;
}
@@ -993,7 +897,7 @@ IMPL_LINK(TextPropertyPanel, ToolBoxSwScriptSelectHdl, ToolBox*, pToolBox)
mpBindings->GetDispatcher()->Execute( SID_ATTR_CHAR_ESCAPEMENT, SFX_CALLMODE_RECORD, &aNoneItem, 0L );
}
}
- UpdateFontScript();
+ UpdateItem(SID_ATTR_CHAR_ESCAPEMENT);
return 0;
}
@@ -1009,6 +913,7 @@ IMPL_LINK(TextPropertyPanel, ToolBoxScriptSelectHdl, ToolBox*, pToolBox)
mbSuper = !mbSuper;
SfxBoolItem aSupItem(SID_SET_SUPER_SCRIPT, mbSuper);
mpBindings->GetDispatcher()->Execute( SID_SET_SUPER_SCRIPT, SFX_CALLMODE_RECORD, &aSupItem, 0L );
+ UpdateItem(SID_SET_SUPER_SCRIPT);
}
else if(TBI_SUB == nId)
{
@@ -1016,8 +921,8 @@ IMPL_LINK(TextPropertyPanel, ToolBoxScriptSelectHdl, ToolBox*, pToolBox)
mbSub = !mbSub;
SfxBoolItem aSubItem(SID_SET_SUB_SCRIPT, mbSub );
mpBindings->GetDispatcher()->Execute( SID_SET_SUB_SCRIPT, SFX_CALLMODE_RECORD, &aSubItem, 0L );
+ UpdateItem(SID_SET_SUB_SCRIPT);
}
- UpdateFontScript();
return 0;
}
@@ -1066,21 +971,19 @@ IMPL_LINK( TextPropertyPanel, ImplPopupModeEndHdl, FloatingWindow*, EMPTYARG )
-
-
-
-
void TextPropertyPanel::NotifyItemUpdate (
const sal_uInt16 nSID,
const SfxItemState eState,
- const SfxPoolItem* pState)
+ const SfxPoolItem* pState,
+ const bool bIsEnabled)
{
switch(nSID)
{
case SID_ATTR_CHAR_FONT:
+ {
+ bool bIsControlEnabled (bIsEnabled);
if ( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxFontItem) )
{
- mpFontNameBox->Enable();
const SvxFontItem* pFontItem = (const SvxFontItem*)pState;
mpFontNameBox->SetText( pFontItem->GetFamilyName() );
}
@@ -1088,12 +991,14 @@ void TextPropertyPanel::NotifyItemUpdate (
{
mpFontNameBox->SetText( String() );
if (SFX_ITEM_DISABLED == eState)
- {
- mpFontNameBox->Disable();
- }
+ bIsControlEnabled = false;
}
+ mpFontNameBox->Enable(bIsControlEnabled);
break;
+ }
case SID_ATTR_CHAR_FONTHEIGHT:
+ {
+ bool bIsControlEnabled (bIsEnabled);
if ( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxFontHeightItem) )
{
mpHeightItem = (SvxFontHeightItem*)pState;//const SvxFontHeightItem*
@@ -1101,51 +1006,17 @@ void TextPropertyPanel::NotifyItemUpdate (
long iValue = (long)CalcToPoint( mpHeightItem->GetHeight(), eUnit, 10 );
mpToolBoxIncDec->Enable();
- // font size +/- enhancement in sd
- switch(maContext.GetCombinedContext())
- {
- case CombinedEnumContext(Application_Draw, Context_DrawText):
- case CombinedEnumContext(Application_Draw, Context_Text):
- case CombinedEnumContext(Application_Draw, Context_Table):
- case CombinedEnumContext(Application_Draw, Context_OutlineText):
- case CombinedEnumContext(Application_Draw, Context_Draw):
- case CombinedEnumContext(Application_Draw, Context_TextObject):
- case CombinedEnumContext(Application_Draw, Context_Graphic):
- case CombinedEnumContext(Application_Impress, Context_DrawText):
- case CombinedEnumContext(Application_Impress, Context_Text):
- case CombinedEnumContext(Application_Impress, Context_Table):
- case CombinedEnumContext(Application_Impress, Context_OutlineText):
- case CombinedEnumContext(Application_Impress, Context_Draw):
- case CombinedEnumContext(Application_Impress, Context_TextObject):
- case CombinedEnumContext(Application_Impress, Context_Graphic):
- break;
-
- default:
- if(iValue > 60 && iValue < 960 )
- {
- mpToolBoxIncDec->EnableItem(TBI_INCREASE,true);
- mpToolBoxIncDec->EnableItem(TBI_DECREASE,true);
- }
- else if (iValue <= 60)
- {
- mpToolBoxIncDec->EnableItem(TBI_INCREASE,true);
- mpToolBoxIncDec->EnableItem(TBI_DECREASE,false);
- }
- else if (iValue >= 960)
- {
- mpToolBoxIncDec->EnableItem(TBI_INCREASE,false);
- mpToolBoxIncDec->EnableItem(TBI_DECREASE,true);
- }
- }
mpToolBoxIncDec->SetItemState(TBI_INCREASE, STATE_NOCHECK);
mpToolBoxIncDec->SetItemState(TBI_DECREASE, STATE_NOCHECK);
if( mbFocusOnFontSizeCtrl )
return;
- maFontSizeBox.Enable( );
maFontSizeBox.SetValue( iValue );
maFontSizeBox.LoseFocus();
+
+ UpdateItem(SID_SHRINK_FONT_SIZE);
+ UpdateItem(SID_GROW_FONT_SIZE);
}
else
{
@@ -1154,118 +1025,106 @@ void TextPropertyPanel::NotifyItemUpdate (
//increase decrease diabled when multi-seletion have different font size
// font size +/- enhancement in sd
- switch(maContext.GetCombinedContext())
+ switch(maContext.GetCombinedContext_DI())
{
- case CombinedEnumContext(Application_Draw, Context_DrawText):
- case CombinedEnumContext(Application_Draw, Context_Text):
- case CombinedEnumContext(Application_Draw, Context_Table):
- case CombinedEnumContext(Application_Draw, Context_OutlineText):
- case CombinedEnumContext(Application_Draw, Context_Draw):
- case CombinedEnumContext(Application_Draw, Context_TextObject):
- case CombinedEnumContext(Application_Draw, Context_Graphic):
- case CombinedEnumContext(Application_Impress, Context_DrawText):
- case CombinedEnumContext(Application_Impress, Context_Text):
- case CombinedEnumContext(Application_Impress, Context_Table):
- case CombinedEnumContext(Application_Impress, Context_OutlineText):
- case CombinedEnumContext(Application_Impress, Context_Draw):
- case CombinedEnumContext(Application_Impress, Context_TextObject):
- case CombinedEnumContext(Application_Impress, Context_Graphic):
+ case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
+ case CombinedEnumContext(Application_DrawImpress, Context_Text):
+ case CombinedEnumContext(Application_DrawImpress, Context_Table):
+ case CombinedEnumContext(Application_DrawImpress, Context_OutlineText):
+ case CombinedEnumContext(Application_DrawImpress, Context_Draw):
+ case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
+ case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
break;
default:
mpToolBoxIncDec->Disable();
}
if ( eState <= SFX_ITEM_READONLY )
- {
- maFontSizeBox.Disable( );
- }
+ bIsControlEnabled = false;
}
+ maFontSizeBox.Enable(bIsControlEnabled);
break;
+ }
+
case SID_ATTR_CHAR_WEIGHT:
mbWeightAvailable = (eState >= SFX_ITEM_DONTCARE);
if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxWeightItem))
{
const SvxWeightItem* pItem = (const SvxWeightItem*)pState;
meWeight = (FontWeight)pItem->GetValue();
- TextStyleChanged();
}
else
{
meWeight = WEIGHT_NORMAL;
- TextStyleChanged();
}
+ mpToolBoxFont->EnableItem(TBI_BOLD, mbWeightAvailable && bIsEnabled);
+ mpToolBoxFont->SetItemState(TBI_BOLD, meWeight==WEIGHT_BOLD ? STATE_CHECK : STATE_NOCHECK);
break;
+
case SID_ATTR_CHAR_POSTURE:
mbPostureAvailable = (eState >= SFX_ITEM_DONTCARE);
if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxPostureItem))
{
const SvxPostureItem* pItem = (const SvxPostureItem*)pState;
meItalic = (FontItalic)pItem->GetValue();
- TextStyleChanged();
}
else
{
meItalic = ITALIC_NONE;
- TextStyleChanged();
}
+ mpToolBoxFont->EnableItem(TBI_ITALIC, mbPostureAvailable && bIsEnabled);
+ mpToolBoxFont->SetItemState(TBI_ITALIC, meItalic==ITALIC_NORMAL ? STATE_CHECK : STATE_NOCHECK);
break;
+
case SID_ATTR_CHAR_UNDERLINE:
- if( eState >= SFX_ITEM_DEFAULT) //SvxUnderlineItem
+ if( eState >= SFX_ITEM_DEFAULT)
{
- //<<delete
- //if(pState->ISA(SvxTextLineItem))
- //{
- // const SvxTextLineItem* pItem = (const SvxTextLineItem*)pState;
- // meUnderline = (FontUnderline)pItem->GetValue();
- // //add , need to record the underline's color, if not the color will turn to auto
- // meUnderlineColor = pItem->GetColor();
- // //add end
- //}
- //else
- //delete end>>
if(pState->ISA(SvxUnderlineItem))
{
const SvxUnderlineItem* pItem = (const SvxUnderlineItem*)pState;
meUnderline = (FontUnderline)pItem->GetValue();
- //add
meUnderlineColor = pItem->GetColor();
- //add end
}
- TextStyleChanged();
}
else
{
meUnderline = UNDERLINE_NONE;
- TextStyleChanged();
}
+ mpToolBoxFont->EnableItem(TBI_UNDERLINE, bIsEnabled);
+ mpToolBoxFont->SetItemState(TBI_UNDERLINE, meUnderline==UNDERLINE_NONE ? STATE_NOCHECK : STATE_CHECK);
break;
+
case SID_ATTR_CHAR_SHADOWED:
if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxShadowedItem))
{
const SvxShadowedItem* pItem = (const SvxShadowedItem*)pState;
mbShadow = pItem->GetValue();
- TextStyleChanged();
}
else
{
mbShadow = false;
- TextStyleChanged();
}
+ mpToolBoxFont->EnableItem(TBI_SHADOWED, bIsEnabled);
+ mpToolBoxFont->SetItemState(TBI_SHADOWED, mbShadow ? STATE_CHECK : STATE_NOCHECK);
break;
+
case SID_ATTR_CHAR_STRIKEOUT:
if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxCrossedOutItem))
{
const SvxCrossedOutItem* pItem = (const SvxCrossedOutItem*)pState;
meStrike = (FontStrikeout)pItem->GetValue();
-
- TextStyleChanged();
}
else
{
meStrike = STRIKEOUT_NONE;
- TextStyleChanged();
}
+ mpToolBoxFont->EnableItem(TBI_STRIKEOUT, bIsEnabled);
+ mpToolBoxFont->SetItemState(TBI_STRIKEOUT,
+ meStrike!=STRIKEOUT_NONE && meStrike!=STRIKEOUT_DONTKNOW
+ ? STATE_CHECK
+ : STATE_NOCHECK);
break;
+
case SID_ATTR_CHAR_COLOR:
if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxColorItem))
{
@@ -1282,7 +1141,9 @@ void TextPropertyPanel::NotifyItemUpdate (
if (mpFontColorUpdater)
mpFontColorUpdater->Update(maColor);
}
+ mpToolBoxFontColor->EnableItem(TBI_FONTCOLOR, bIsEnabled);
break;
+
case SID_ATTR_BRUSH_CHAR:
if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxBrushItem))
{
@@ -1299,64 +1160,85 @@ void TextPropertyPanel::NotifyItemUpdate (
if (mpHighlightUpdater)
mpHighlightUpdater->Update(maBackColor);
}
+ mpToolBoxHighlight->EnableItem(TBI_HIGHLIGHT, bIsEnabled);
break;
+
case SID_ATTR_CHAR_ESCAPEMENT:
- if( eState == SFX_ITEM_AVAILABLE)
+ {
+ bool bIsItemEnabled (true);
+ if (eState == SFX_ITEM_AVAILABLE)
{
- if( pState->ISA(SvxEscapementItem))
+ if (pState->ISA(SvxEscapementItem))
{
const SvxEscapementItem* pItem = (const SvxEscapementItem *)pState;
short nEsc = pItem->GetEsc();
if(nEsc == 0)
+ {
meEscape = SVX_ESCAPEMENT_OFF;
+ mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_NOCHECK);
+ mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_NOCHECK);
+ }
else if(nEsc > 0)
+ {
meEscape = SVX_ESCAPEMENT_SUPERSCRIPT;
+ mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_CHECK);
+ mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_NOCHECK);
+ }
else
+ {
meEscape = SVX_ESCAPEMENT_SUBSCRIPT;
+ mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_NOCHECK);
+ mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_CHECK);
+ }
}
else
{
meEscape = SVX_ESCAPEMENT_OFF;
+ mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_NOCHECK);
+ mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_NOCHECK);
}
- TextStyleChanged();
}
- else if(eState == SFX_ITEM_DISABLED)
+ else if (eState == SFX_ITEM_DISABLED)
{
- mpToolBoxScriptSw->EnableItem(TBI_SUPER,false);
- mpToolBoxScriptSw->EnableItem(TBI_SUB,false);
+ bIsItemEnabled = false;
}
else
{
meEscape = SVX_ESCAPEMENT_OFF;
- TextStyleChanged();
}
+ mpToolBoxScriptSw->EnableItem(TBI_SUPER, bIsItemEnabled && bIsEnabled);
+ mpToolBoxScriptSw->EnableItem(TBI_SUB, bIsItemEnabled && bIsEnabled);
break;
+ }
+
case SID_SET_SUB_SCRIPT:
if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SfxBoolItem))
{
const SfxBoolItem* pItem = (const SfxBoolItem*)pState;
mbSub = pItem->GetValue();
- TextStyleChanged();
}
else
{
mbSub = false;
- TextStyleChanged();
}
+ mpToolBoxScript->EnableItem(TBI_SUB, bIsEnabled);
+ mpToolBoxScript->SetItemState(TBI_SUB, mbSub ? STATE_CHECK : STATE_NOCHECK);
break;
+
case SID_SET_SUPER_SCRIPT:
if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SfxBoolItem))
{
const SfxBoolItem* pItem = (const SfxBoolItem*)pState;
mbSuper = pItem->GetValue();
- TextStyleChanged();
}
else
{
mbSuper = false;
- TextStyleChanged();
}
+ mpToolBoxScript->EnableItem(TBI_SUPER, bIsEnabled);
+ mpToolBoxScript->SetItemState(TBI_SUPER, mbSuper ? STATE_CHECK : STATE_NOCHECK);
break;
+
case SID_ATTR_CHAR_KERNING:
if ( SFX_ITEM_AVAILABLE == eState )
{
@@ -1386,162 +1268,94 @@ void TextPropertyPanel::NotifyItemUpdate (
mbKernAvailable = false;
mlKerning = 0;
}
+ mpToolBoxSpacing->EnableItem(TBI_SPACING, bIsEnabled);
break;
// font size +/- enhancement in sd
case SID_SHRINK_FONT_SIZE:
case SID_GROW_FONT_SIZE:
- switch(maContext.GetCombinedContext())
- {
- case CombinedEnumContext(Application_Draw, Context_DrawText):
- case CombinedEnumContext(Application_Draw, Context_Text):
- case CombinedEnumContext(Application_Draw, Context_Table):
- case CombinedEnumContext(Application_Draw, Context_OutlineText):
- case CombinedEnumContext(Application_Draw, Context_Draw):
- case CombinedEnumContext(Application_Draw, Context_TextObject):
- case CombinedEnumContext(Application_Draw, Context_Graphic):
- case CombinedEnumContext(Application_Impress, Context_DrawText):
- case CombinedEnumContext(Application_Impress, Context_Text):
- case CombinedEnumContext(Application_Impress, Context_Table):
- case CombinedEnumContext(Application_Impress, Context_OutlineText):
- case CombinedEnumContext(Application_Impress, Context_Draw):
- case CombinedEnumContext(Application_Impress, Context_TextObject):
- case CombinedEnumContext(Application_Impress, Context_Graphic):
- if(eState == SFX_ITEM_DISABLED)
- {
- mpToolBoxIncDec->Disable();
- }
- else
- {
- mpToolBoxIncDec->Enable();
- }
- break;
- }
+ switch(maContext.GetCombinedContext_DI())
+ {
+ case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
+ case CombinedEnumContext(Application_DrawImpress, Context_Text):
+ case CombinedEnumContext(Application_DrawImpress, Context_Table):
+ case CombinedEnumContext(Application_DrawImpress, Context_OutlineText):
+ case CombinedEnumContext(Application_DrawImpress, Context_Draw):
+ case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
+ case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
+ if(eState == SFX_ITEM_DISABLED)
+ mpToolBoxIncDec->Disable();
+ else
+ mpToolBoxIncDec->Enable();
break;
+ }
+ const sal_Int32 nSize (maFontSizeBox.GetValue());
+ if (nSID == SID_GROW_FONT_SIZE)
+ mpToolBoxIncDec->EnableItem(TBI_INCREASE, bIsEnabled && nSize<960);
+ else
+ mpToolBoxIncDec->EnableItem(TBI_DECREASE, bIsEnabled && nSize>60);
+ break;
}
}
-void TextPropertyPanel::TextStyleChanged()
+void TextPropertyPanel::UpdateItem (const sal_uInt16 nSlotId)
{
- if( !mbWeightAvailable )
- mpToolBoxFont->EnableItem(TBI_BOLD,false);
- else
- mpToolBoxFont->EnableItem(TBI_BOLD,true);
-
- if(!mbPostureAvailable )
- mpToolBoxFont->EnableItem(TBI_ITALIC,false);
- else
- mpToolBoxFont->EnableItem(TBI_ITALIC,true);
-
- UpdateFontBold();
- UpdateFontItalic();
- UpdateFontUnderline();
- UpdateFontStrikeOut();
- UpdateFontShadowed();
- UpdateFontScript();
+ switch (nSlotId)
+ {
+ case SID_ATTR_CHAR_FONT:
+ maFontNameControl.RequestUpdate();
+ break;
+ case SID_ATTR_CHAR_FONTHEIGHT:
+ maFontSizeControl.RequestUpdate();
+ break;
+ case SID_ATTR_CHAR_WEIGHT:
+ maWeightControl.RequestUpdate();
+ break;
+ case SID_ATTR_CHAR_POSTURE:
+ maItalicControl.RequestUpdate();
+ break;
+ case SID_ATTR_CHAR_UNDERLINE:
+ maUnderlineControl.RequestUpdate();
+ break;
+ case SID_ATTR_CHAR_STRIKEOUT:
+ maStrikeControl.RequestUpdate();
+ break;
+ case SID_ATTR_CHAR_SHADOWED:
+ maShadowControl.RequestUpdate();
+ break;
+ case SID_ATTR_CHAR_COLOR:
+ maFontColorControl.RequestUpdate();
+ break;
+ case SID_ATTR_CHAR_ESCAPEMENT:
+ maScriptControlSw.RequestUpdate();
+ break;
+ case SID_SET_SUPER_SCRIPT:
+ maSuperScriptControl.RequestUpdate();
+ break;
+ case SID_SET_SUB_SCRIPT:
+ maSubScriptControl.RequestUpdate();
+ break;
+ case SID_ATTR_CHAR_KERNING:
+ maSpacingControl.RequestUpdate();
+ break;
+ case SID_ATTR_BRUSH_CHAR:
+ maHighlightControl.RequestUpdate();
+ break;
+ case SID_GROW_FONT_SIZE:
+ maSDFontGrow.RequestUpdate();
+ break;
+ case SID_SHRINK_FONT_SIZE:
+ maSDFontShrink.RequestUpdate();
+ break;
+ }
}
-void TextPropertyPanel::UpdateFontBold()
-{
- if( meWeight == WEIGHT_BOLD )
- {
- mpToolBoxFont->SetItemState(TBI_BOLD, STATE_CHECK);
- }
- else
- {
- mpToolBoxFont->SetItemState(TBI_BOLD, STATE_NOCHECK);
- }
-}
-void TextPropertyPanel::UpdateFontItalic()
-{
- if(meItalic == ITALIC_NORMAL)
- {
- mpToolBoxFont->SetItemState(TBI_ITALIC, STATE_CHECK);
- }
- else
- {
- mpToolBoxFont->SetItemState(TBI_ITALIC, STATE_NOCHECK);
- }
-}
-void TextPropertyPanel::UpdateFontUnderline()
-{
- if(meUnderline == UNDERLINE_NONE)
- {
- mpToolBoxFont->SetItemState(TBI_UNDERLINE, STATE_NOCHECK);
- }
- else
- {
- mpToolBoxFont->SetItemState(TBI_UNDERLINE, STATE_CHECK);
- }
-}
-void TextPropertyPanel::UpdateFontStrikeOut()
-{
- if(meStrike != STRIKEOUT_NONE && meStrike != STRIKEOUT_DONTKNOW)
- {
- mpToolBoxFont->SetItemState(TBI_STRIKEOUT, STATE_CHECK);
- }
- else
- {
- mpToolBoxFont->SetItemState(TBI_STRIKEOUT, STATE_NOCHECK);
- }
-}
-void TextPropertyPanel::UpdateFontShadowed()
-{
- if(mbShadow)
- {
- mpToolBoxFont->SetItemState(TBI_SHADOWED, STATE_CHECK);
- }
- else
- {
- mpToolBoxFont->SetItemState(TBI_SHADOWED, STATE_NOCHECK);
- }
-}
-void TextPropertyPanel::UpdateFontScript()
-{
- //script for sw
- mpToolBoxScriptSw->EnableItem(TBI_SUPER,true);
- mpToolBoxScriptSw->EnableItem(TBI_SUB,true);
- if(meEscape == SVX_ESCAPEMENT_SUPERSCRIPT)
- {
- mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_CHECK);
- mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_NOCHECK);
- }
- else if(meEscape == SVX_ESCAPEMENT_SUBSCRIPT)
- {
- mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_NOCHECK);
- mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_CHECK);
- }
- else
- {
- mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_NOCHECK);
- mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_NOCHECK);
- }
-
- //script for sc sd
- mpToolBoxScript->EnableItem(TBI_SUPER,true);
- mpToolBoxScript->EnableItem(TBI_SUB,true);
- if(mbSuper)
- {
- mpToolBoxScript->SetItemState(TBI_SUPER, STATE_CHECK);
- mpToolBoxScript->SetItemState(TBI_SUB, STATE_NOCHECK);
- }
- else if(mbSub)
- {
- mpToolBoxScript->SetItemState(TBI_SUPER, STATE_NOCHECK);
- mpToolBoxScript->SetItemState(TBI_SUB, STATE_CHECK);
- }
- else
- {
- mpToolBoxScript->SetItemState(TBI_SUPER, STATE_NOCHECK);
- mpToolBoxScript->SetItemState(TBI_SUB, STATE_NOCHECK);
- }
-}
void TextPropertyPanel::SetFontColor (
const String& /*rsColorName*/,
@@ -1571,4 +1385,6 @@ void TextPropertyPanel::SetUnderline(FontUnderline eUnderline)
meUnderline = eUnderline;
}
+
+
} } // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/text/TextPropertyPanel.hrc b/svx/source/sidebar/text/TextPropertyPanel.hrc
index bfa0c821644b..146d51cdddef 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.hrc
+++ b/svx/source/sidebar/text/TextPropertyPanel.hrc
@@ -36,19 +36,6 @@
#define TB_SCRIPT 10
-#define IMG_INCREASE 11
-#define IMG_DECREASE 13
-#define IMG_BOLD 15
-#define IMG_ITALIC 17
-#define IMG_UNDERLINE 19
-#define IMG_STRIKEOUT 21
-#define IMG_SHADOWED 23
-#define IMG_FONTCOLOR 25
-#define IMG_SUPSCRIPT 27
-#define IMG_SUBSCRIPT 29
-//#define IMG_SPACING 31
-#define IMG_HIGHLIGHT 33
-
#define TBI_FONTCOLOR 50
#define TBI_BOLD 51
#define TBI_ITALIC 52
@@ -149,9 +136,6 @@
#define STR_CUSTOM_C_TIP 72
#define STR_CUSTOM_E_TIP 73
#define STR_PT 74
-#define STR_QH_BOLD 75
-#define STR_QH_ITALIC 76
-#define STR_QH_UNDERLINE 77
//help ids
#define HID_COMBO_FONT_NAME "SVX_HID_COMBO_FONT_NAME"
diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx
index b842e4fd5dad..4666918974d6 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.hxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.hxx
@@ -59,7 +59,6 @@ public:
const cssu::Reference<css::ui::XSidebar>& rxSidebar);
virtual void DataChanged (const DataChangedEvent& rEvent);
- SfxBindings* GetBindings();
::sfx2::sidebar::ControllerItem& GetSpaceController();
long GetSelFontSize();
void SetSpacing(long nKern);
@@ -81,10 +80,14 @@ public:
virtual void HandleContextChange (
const ::sfx2::sidebar::EnumContext aContext);
+
+ // ControllerItem::ItemUpdateReceiverInterface
+
virtual void NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
- const SfxPoolItem* pState);
+ const SfxPoolItem* pState,
+ const bool bIsEnabled);
private:
//ui controls
@@ -124,21 +127,6 @@ private:
::sfx2::sidebar::ControllerItem maSDFontGrow;
::sfx2::sidebar::ControllerItem maSDFontShrink;
- //Images
- Image maImgIncrease;
- Image maImgDecrease;
- Image maImgBold;
- Image maImgItalic;
- Image maImgUnderline;
- Image maImgStrike;
- Image maImgShadow;
- Image maImgFontColor;
- Image maImgSupScript;
- Image maImgSubScript;
- Image maImgHighlight;
-
- Image maImgNormalIcon;
-
FontWeight meWeight;
FontItalic meItalic;
FontUnderline meUnderline;
@@ -191,7 +179,7 @@ private:
DECL_LINK(ToolBoxUnderlineClickHdl, ToolBox* );
void Initialize (void);
- void SetupIcons (void);
+ void SetupToolboxItems (void);
void InitToolBoxFont();
void InitToolBoxIncDec();
void InitToolBoxFontColor();
@@ -199,13 +187,6 @@ private:
void InitToolBoxHighlight();
void InitToolBoxSpacing();
- void UpdateFontBold();
- void UpdateFontItalic();
- void UpdateFontUnderline();
- void UpdateFontStrikeOut();
- void UpdateFontShadowed();
- void UpdateFontScript();
-
DECL_LINK(FontSelHdl, FontNameBox *);
DECL_LINK(FontSizeModifyHdl, FontSizeBox *);
DECL_LINK(FontSizeSelHdl, FontSizeBox *);
@@ -216,11 +197,7 @@ private:
DECL_LINK(ToolBoxSwScriptSelectHdl, ToolBox *);
DECL_LINK(ToolBoxScriptSelectHdl, ToolBox *);
-
-
- void TextStyleChanged();
-
- Image GetIcon (const ::rtl::OUString& rsURL);
+ void UpdateItem (const sal_uInt16 nSlotId);
};
} } // end of namespace ::svx::sidebar
diff --git a/svx/source/sidebar/text/TextPropertyPanel.src b/svx/source/sidebar/text/TextPropertyPanel.src
index 633750fe1fee..3197bbcc8f6a 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.src
+++ b/svx/source/sidebar/text/TextPropertyPanel.src
@@ -68,7 +68,6 @@ Control RID_SIDEBAR_TEXT_PANEL
Pos = MAP_APPFONT ( PROPERTYPAGE_WIDTH - SECTIONPAGE_MARGIN_HORIZONTAL - TOOLBOX_ITEM_WIDTH * 2, SECTIONPAGE_MARGIN_VERTICAL_TOP) ;
Size = MAP_APPFONT ( TOOLBOX_ITEM_WIDTH * 2 ,TOOLBOX_ITEM_HEIGHT ) ;
TabStop = TRUE ;
-// HelpID = HID_TB_INCREASE_DECREASE;
HelpID = HID_PPROPERTYPANEL_TEXT_TBX_FONTSIZE_INDE;
Text = "Font Size Adjusting" ;
ItemList =
@@ -76,15 +75,11 @@ Control RID_SIDEBAR_TEXT_PANEL
ToolBoxItem
{
Identifier = TBI_INCREASE;
- Text [ en-US ] = "Increase Font Size" ;
-// HelpID = HID_TBI_INCREASE;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_INCREASE;
};
ToolBoxItem
{
Identifier = TBI_DECREASE;
- Text [ en-US ] = "Decrease Font Size" ;
-// HelpID = HID_TBI_DECREASE;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_DECREASE;
};
};
@@ -95,7 +90,6 @@ Control RID_SIDEBAR_TEXT_PANEL
Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL + 1, SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + CONTROL_SPACING_VERTICAL + 1) ;
Size = MAP_APPFONT ( TOOLBOX_ITEM_WIDTH * 4 + TOOLBOX_ITEM_DD_WIDTH, TOOLBOX_ITEM_HEIGHT ) ;
TabStop = TRUE ;
-// HelpID = HID_TB_FONT;
HelpID = HID_PPROPERTYPANEL_TEXT_TBX_FONT;
Text = "Font Effects" ;
ItemList =
@@ -103,59 +97,34 @@ Control RID_SIDEBAR_TEXT_PANEL
ToolBoxItem
{
Identifier = TBI_BOLD;
- Text [ en-US ] = "Bold" ;
-// HelpID = HID_TBI_FONT_BOLD;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_BOLD;
};
ToolBoxItem
{
Identifier = TBI_ITALIC;
- Text [ en-US ] = "Italic" ;
-// HelpID = HID_TBI_FONT_ITALIC;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_ITALIC;
};
ToolBoxItem
{
Identifier = TBI_UNDERLINE;
DropDown = TRUE ;
- Text [ en-US ] = "Underline" ;
-// HelpID = HID_TBI_FONT_UNDERLINE;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_UNDERLINE;
};
ToolBoxItem
{
Identifier = TBI_STRIKEOUT;
- Text [ en-US ] = "Strikethrough" ;
-// HelpID = HID_TBI_FONT_STRIKEOUT;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_STRIKEOUT;
};
ToolBoxItem
{
Identifier = TBI_SHADOWED;
- Text [ en-US ] = "Shadow" ;
-// HelpID = HID_TBI_FONT_SHADOWED;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SHADOWED;
};
};
};
- String STR_QH_BOLD
- {
- Text [ en-US ] = "Bold (Ctrl+B)";
- };
- String STR_QH_ITALIC
- {
- Text [ en-US ] = "Italic (Ctrl+I)";
- };
- String STR_QH_UNDERLINE
- {
- Text [ en-US ] = "Underline (Ctrl+U)";
- };
-
-
ToolBox TB_FONTCOLOR
{
-// HelpID = HID_TB_COLOR;
HelpID = HID_PPROPERTYPANEL_TEXT_TBX_FONT_COLOR;
SVLook = TRUE ;
Pos = MAP_APPFONT (PROPERTYPAGE_WIDTH - SECTIONPAGE_MARGIN_HORIZONTAL - TOOLBOX_ITEM_WIDTH * 2, SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + CONTROL_SPACING_VERTICAL + 1) ;
@@ -167,10 +136,8 @@ Control RID_SIDEBAR_TEXT_PANEL
ToolBoxItem
{
Identifier = TBI_FONTCOLOR ;
-// HelpID = HID_TBI_COLOR;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_FONT_COLOR;
DropDown = TRUE ;
- Text [ en-US ] = "Font Color" ;
};
};
};
@@ -181,7 +148,6 @@ Control RID_SIDEBAR_TEXT_PANEL
Pos = MAP_APPFONT (PROPERTYPAGE_WIDTH - SECTIONPAGE_MARGIN_HORIZONTAL - TOOLBOX_ITEM_WIDTH * 2 , SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + (TOOLBOX_ITEM_HEIGHT + 2) + CONTROL_SPACING_VERTICAL * 2 + 1) ;
Size = MAP_APPFONT (TOOLBOX_ITEM_DD_WIDTH ,TOOLBOX_ITEM_HEIGHT ) ;
TabStop = TRUE ;
-// HelpID = HID_TB_HIGHLIGHT;
HelpID = HID_PPROPERTYPANEL_TEXT_TBX_HIGHLIGHT_COLOR;
Text = "Highlight Color" ;
ItemList =
@@ -189,10 +155,8 @@ Control RID_SIDEBAR_TEXT_PANEL
ToolBoxItem
{
Identifier = TBI_HIGHLIGHT ;
-// HelpID = HID_TBI_HIGHLIGHT;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_HIGHLIGHT_COLOR;
DropDown = TRUE ;
- Text [ en-US ] = "Highlight Color" ;
};
};
};
@@ -203,7 +167,6 @@ Control RID_SIDEBAR_TEXT_PANEL
Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL + 1 , SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + CONTROL_SPACING_VERTICAL * 2 + (TOOLBOX_ITEM_HEIGHT + 2) + 1) ;
Size = MAP_APPFONT (TOOLBOX_ITEM_WIDTH * 2 ,TOOLBOX_ITEM_HEIGHT ) ;
TabStop = TRUE ;
-// HelpID = HID_TB_SCRIPT_SW;
HelpID = HID_PPROPERTYPANEL_TEXT_TBX_SCRIPT_SW;
Text = "Font Position" ;
ItemList =
@@ -211,15 +174,11 @@ Control RID_SIDEBAR_TEXT_PANEL
ToolBoxItem
{
Identifier = TBI_SUPER_SW;
- Text [ en-US ] = "Superscript" ;
-// HelpID = HID_TBI_SCRIPT_SW_SUPER;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUPER_SW;
};
ToolBoxItem
{
Identifier = TBI_SUB_SW;
- Text [ en-US ] = "Subscript" ;
-// HelpID = HID_TBI_SCRIPT_SW_SUB;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUB_SW;
};
};
@@ -230,7 +189,6 @@ Control RID_SIDEBAR_TEXT_PANEL
Pos = MAP_APPFONT (SECTIONPAGE_MARGIN_HORIZONTAL + 1 , SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + CONTROL_SPACING_VERTICAL * 2 + (TOOLBOX_ITEM_HEIGHT + 2) + 1) ;
Size = MAP_APPFONT (TOOLBOX_ITEM_WIDTH * 2 ,TOOLBOX_ITEM_HEIGHT ) ;
TabStop = TRUE ;
-// HelpID = HID_TB_SCRIPT;
HelpID = HID_PPROPERTYPANEL_TEXT_TBX_SCRIPT;
Text = "Font Position" ;
ItemList =
@@ -238,15 +196,11 @@ Control RID_SIDEBAR_TEXT_PANEL
ToolBoxItem
{
Identifier = TBI_SUPER;
- Text [ en-US ] = "Superscript" ;
-// HelpID = HID_TBI_SCRIPT_SUPER;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUPER;
};
ToolBoxItem
{
Identifier = TBI_SUB;
- Text [ en-US ] = "Subscript" ;
-// HelpID = HID_TBI_SCRIPT_SUB;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUB;
};
};
@@ -266,67 +220,10 @@ Control RID_SIDEBAR_TEXT_PANEL
{
Identifier = TBI_SPACING;
DropDown = TRUE ;
- Text [ en-US ] = "Character Spacing" ;
HelpID = HID_TBI_SPACING;
};
};
};
-
- Image IMG_INCREASE
- {
- ImageBitmap = Bitmap{File = "symphony/enlarge font.png";};
- // MaskColor = IMAGE_MASK_COLOR;
- };
- Image IMG_DECREASE
- {
- ImageBitmap = Bitmap{File = "symphony/decrease font.png";};
- };
- Image IMG_BOLD
- {
- ImageBitmap = Bitmap{File = "symphony/sc_bold.png";};//sc_bold.bmp
- };
- Image IMG_ITALIC
- {
- ImageBitmap = Bitmap{File = "symphony/sc_italic.png";};//sc_italic.bmp
- };
- Image IMG_UNDERLINE
- {
- ImageBitmap = Bitmap{File = "symphony/sc_underline.png";};//sc_underline.png
- };
- Image IMG_STRIKEOUT
- {
- ImageBitmap = Bitmap{File = "symphony/sc_strikeout.png";};//sc_strikeout.png
- };
- Image IMG_SHADOWED
- {
- ImageBitmap = Bitmap{File = "symphony/sc_shadowed.png";};//sc_shadowed.png
- };
- Image IMG_FONTCOLOR
- {
- ImageBitmap = Bitmap{File = "symphony/sc_color.png";};
- };
- Image IMG_SUPSCRIPT
- {
- ImageBitmap = Bitmap{File = "symphony/sc_superscript.png";};
- };
- Image IMG_SUBSCRIPT
- {
- ImageBitmap = Bitmap{File = "symphony/sc_subscript.png";};
- };
-// Image IMG_SPACING
-// {
-// ImageBitmap = Bitmap{File = "symphony/icon_normal.png";};
-// };
- Image IMG_HIGHLIGHT
- {
- ImageBitmap = Bitmap{File = "symphony/Highlight.png";};//sc_backcolor
- };
-
- //small icon for spacing
- Image IMG_SPACING_D
- {
- ImageBitmap = Bitmap{File = "symphony/icon_normal.png";};
- };
};
Control RID_POPUPPANEL_TEXTPAGE_UNDERLINE
@@ -338,7 +235,6 @@ Control RID_POPUPPANEL_TEXTPAGE_UNDERLINE
Size = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL * 2 + POPUP_BORDER_WIDTH + VS_UNDERLINE_WIDTH, 13+ VS_UNDERLINE_HEIGHT + POPUP_BORDER_HEIGHT + POPUPPANEL_MARGIN_SMALL * 2 + POPUPPANEL_MARGIN_LARGE);
Control VS_UNDERLINE
{
-// HelpID = HID_UNDERLINE_VS ;
HelpID = HID_PPROPERTYPANEL_TEXT_UNDERLINE_VS;
Hide = TRUE ;
Pos = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL + OFFSET_X , POPUPPANEL_MARGIN_SMALL + OFFSET_Y );
@@ -440,12 +336,6 @@ Control RID_POPUPPANEL_TEXTPAGE_UNDERLINE
ImageBitmap = Bitmap{File = "symphony/selected-line10.bmp";};
};
-// //more button bmps
-// Bitmap BMP_UNDERLINE_MORE
-// {
-// File = "symphony/morebutton.bmp";
-// };
-
//tips
String STR_SINGLE
{
@@ -539,12 +429,6 @@ Control RID_POPUPPANEL_TEXTPAGE_SPACING
Text [ en-US ] = "Custom:" ;
};
//custom area
-// Control CT_BORDER
-// {
-// Pos = MAP_APPFONT ( POPUPPANEL_MARGIN_LARGE + OFFSET_X + 1 , OFFSET_Y + POPUPPANEL_MARGIN_SMALL * 3 + 15 * 6 + TEXT_HEIGHT) ;
-// Size = MAP_APPFONT (CUSTOM_WIDTH , CUSTOM_HEIGHT ) ;// TOOLBOX_42_42_ITEM_DD_WIDTH * 2 + TB_SPACE * 2 - 5 + TEXT_WIDTH - 2
-// DialogControl = TRUE;
-// };
FixedText FT_SPACING
{
Pos = MAP_APPFONT ( CUSTOM_X + POPUPPANEL_MARGIN_LARGE, CUSTOM_Y + POPUPPANEL_MARGIN_LARGE);
diff --git a/svx/source/sidebar/text/TextUnderlineControl.cxx b/svx/source/sidebar/text/TextUnderlineControl.cxx
index 17e0c4b96a91..7d92179168c9 100644
--- a/svx/source/sidebar/text/TextUnderlineControl.cxx
+++ b/svx/source/sidebar/text/TextUnderlineControl.cxx
@@ -29,10 +29,13 @@
namespace svx { namespace sidebar {
-TextUnderlineControl::TextUnderlineControl(Window* pParent, svx::sidebar::TextPropertyPanel& rPanel)
+TextUnderlineControl::TextUnderlineControl (
+ Window* pParent,
+ svx::sidebar::TextPropertyPanel& rPanel,
+ SfxBindings* pBindings)
: svx::sidebar::PopupControl( pParent,SVX_RES(RID_POPUPPANEL_TEXTPAGE_UNDERLINE))
, mrTextPropertyPanel(rPanel)
-, mpBindings(NULL)
+, mpBindings(pBindings)
, maVSUnderline( this, SVX_RES(VS_UNDERLINE))
, maPBOptions (this, SVX_RES(PB_OPTIONS) )
@@ -61,7 +64,6 @@ TextUnderlineControl::TextUnderlineControl(Window* pParent, svx::sidebar::TextPr
{
initial();
FreeResource();
- mpBindings = mrTextPropertyPanel.GetBindings();
}
void TextUnderlineControl::initial()
diff --git a/svx/source/sidebar/text/TextUnderlineControl.hxx b/svx/source/sidebar/text/TextUnderlineControl.hxx
index 82bb9bec28d5..a57ee00cd2f7 100644
--- a/svx/source/sidebar/text/TextUnderlineControl.hxx
+++ b/svx/source/sidebar/text/TextUnderlineControl.hxx
@@ -15,6 +15,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+
#ifndef _SVX_SIDEBAR_UNDERLINE_CONTROL_HXX_
#define _SVX_SIDEBAR_UNDERLINE_CONTROL_HXX_
@@ -34,7 +35,10 @@ namespace svx{ namespace sidebar {
class TextUnderlineControl:public svx::sidebar::PopupControl
{
public:
- TextUnderlineControl(Window* pParent, svx::sidebar::TextPropertyPanel& rPanel);
+ TextUnderlineControl (
+ Window* pParent,
+ svx::sidebar::TextPropertyPanel& rPanel,
+ SfxBindings* pBindings);
void GetFocus();
void Rearrange(FontUnderline eLine);
ValueSet& GetValueSet();