summaryrefslogtreecommitdiff
path: root/svx/source/sidebar/text
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/sidebar/text')
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.cxx63
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.hxx1
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.src16
3 files changed, 61 insertions, 19 deletions
diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx
index 3a9d605450f0..3a671937ff68 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.cxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.cxx
@@ -68,10 +68,7 @@ namespace svx { namespace sidebar {
#undef HAS_IA2
-#define TEXT_SECTIONPAGE_HEIGHT SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + ( TOOLBOX_ITEM_HEIGHT + 2 ) * 2 + CONTROL_SPACING_VERTICAL * 2 + SECTIONPAGE_MARGIN_VERTICAL_BOT
-
-
- PopupControl* TextPropertyPanel::CreateCharacterSpacingControl (PopupContainer* pParent)
+PopupControl* TextPropertyPanel::CreateCharacterSpacingControl (PopupContainer* pParent)
{
return new TextCharacterSpacingControl(pParent, *this, mpBindings);
}
@@ -335,6 +332,7 @@ void TextPropertyPanel::DataChanged (const DataChangedEvent& rEvent)
+
void TextPropertyPanel::Initialize (void)
{
//<<modify fill font list
@@ -420,11 +418,6 @@ void TextPropertyPanel::Initialize (void)
maFontSizeBox.SetSelectHdl(aLink);
aLink = LINK(this, TextPropertyPanel, FontSizeLoseFocus);
maFontSizeBox.SetLoseFocusHdl(aLink);
-
- Size aSize(PROPERTYPAGE_WIDTH, TEXT_SECTIONPAGE_HEIGHT);
- aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
- aSize.setWidth(GetOutputSizePixel().Width());
- SetSizePixel(aSize);
}
void TextPropertyPanel::EndSpacingPopupMode (void)
@@ -944,16 +937,38 @@ void TextPropertyPanel::NotifyItemUpdate (
{
mpHeightItem = (SvxFontHeightItem*)pState;//const SvxFontHeightItem*
SfxMapUnit eUnit = maFontSizeControl.GetCoreMetric();
- long iValue = (long)CalcToPoint( mpHeightItem->GetHeight(), eUnit, 10 );
+ const sal_Int64 nValue (CalcToPoint(mpHeightItem->GetHeight(), eUnit, 10 ));
mpToolBoxIncDec->Enable();
mpToolBoxIncDec->SetItemState(TBI_INCREASE, STATE_NOCHECK);
mpToolBoxIncDec->SetItemState(TBI_DECREASE, STATE_NOCHECK);
+ // For Writer we have to update the states of the
+ // increase and decrease buttons here, because we have
+ // no access to the slots used by Writer.
+ 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):
+ break;
+
+ default:
+ {
+ mpToolBoxIncDec->EnableItem(TBI_INCREASE, bIsEnabled && nValue<960);
+ mpToolBoxIncDec->EnableItem(TBI_DECREASE, bIsEnabled && nValue>60);
+ break;
+ }
+ }
+
if( mbFocusOnFontSizeCtrl )
return;
- maFontSizeBox.SetValue( iValue );
+ maFontSizeBox.SetValue(nValue);
maFontSizeBox.LoseFocus();
UpdateItem(SID_SHRINK_FONT_SIZE);
@@ -1147,8 +1162,8 @@ void TextPropertyPanel::NotifyItemUpdate (
{
meEscape = SVX_ESCAPEMENT_OFF;
}
- mpToolBoxScriptSw->EnableItem(TBI_SUPER, bIsItemEnabled && bIsEnabled);
- mpToolBoxScriptSw->EnableItem(TBI_SUB, bIsItemEnabled && bIsEnabled);
+ mpToolBoxScriptSw->EnableItem(TBI_SUPER_SW, bIsItemEnabled && bIsEnabled);
+ mpToolBoxScriptSw->EnableItem(TBI_SUB_SW, bIsItemEnabled && bIsEnabled);
break;
}
@@ -1224,17 +1239,27 @@ void TextPropertyPanel::NotifyItemUpdate (
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_Int64 nSize (maFontSizeBox.GetValue());
+ switch(nSID)
+ {
+ case SID_GROW_FONT_SIZE:
+ mpToolBoxIncDec->EnableItem(TBI_INCREASE, bIsEnabled && nSize<960);
+ break;
+
+ case SID_SHRINK_FONT_SIZE:
+ mpToolBoxIncDec->EnableItem(TBI_DECREASE, bIsEnabled && nSize>60);
+ break;
+
+ default:
+ 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;
}
}
diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx
index cb097d6a5ccc..e2f4dac2124c 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.hxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.hxx
@@ -57,6 +57,7 @@ public:
SfxBindings* pBindings);
virtual void DataChanged (const DataChangedEvent& rEvent);
+
::sfx2::sidebar::ControllerItem& GetSpaceController();
long GetSelFontSize();
void SetSpacing(long nKern);
diff --git a/svx/source/sidebar/text/TextPropertyPanel.src b/svx/source/sidebar/text/TextPropertyPanel.src
index d1ca9c30973b..f4038fe65a1c 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.src
+++ b/svx/source/sidebar/text/TextPropertyPanel.src
@@ -60,6 +60,7 @@ Control RID_SIDEBAR_TEXT_PANEL
DropDown = TRUE;
HelpID = HID_COMBO_FONT_NAME ;
QuickHelpText [ en-US ] = "Font";
+// Command = ".uno:CharFontName";
};
MetricBox MB_SBFONT_FONTSIZE
{
@@ -70,6 +71,7 @@ Control RID_SIDEBAR_TEXT_PANEL
DropDown = TRUE;
HelpID = HID_METRIC_FONT_SIZE;
QuickHelpText [ en-US ] = "Font Size";
+// Command = ".uno:FontHeight";
};
ToolBox TB_INCREASE_DECREASE
@@ -86,11 +88,13 @@ Control RID_SIDEBAR_TEXT_PANEL
{
Identifier = TBI_INCREASE;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_INCREASE;
+ Command = ".uno:Grow";
};
ToolBoxItem
{
Identifier = TBI_DECREASE;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_DECREASE;
+ Command = ".uno:Shrink";
};
};
};
@@ -108,27 +112,32 @@ Control RID_SIDEBAR_TEXT_PANEL
{
Identifier = TBI_BOLD;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_BOLD;
+ Command = ".uno:Bold";
};
ToolBoxItem
{
Identifier = TBI_ITALIC;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_ITALIC;
+ Command = ".uno:Italic";
};
ToolBoxItem
{
Identifier = TBI_UNDERLINE;
DropDown = TRUE ;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_UNDERLINE;
+ Command = ".uno:Underline";
};
ToolBoxItem
{
Identifier = TBI_STRIKEOUT;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_STRIKEOUT;
+ Command = ".uno:Strikeout";
};
ToolBoxItem
{
Identifier = TBI_SHADOWED;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SHADOWED;
+ Command = ".uno:Shadowed";
};
};
};
@@ -148,6 +157,7 @@ Control RID_SIDEBAR_TEXT_PANEL
Identifier = TBI_FONTCOLOR ;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_FONT_COLOR;
DropDown = TRUE ;
+ Command = ".uno:Color";
};
};
};
@@ -167,6 +177,7 @@ Control RID_SIDEBAR_TEXT_PANEL
Identifier = TBI_HIGHLIGHT ;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_HIGHLIGHT_COLOR;
DropDown = TRUE ;
+ Command = ".uno:CharacterBackgroundPattern";
};
};
};
@@ -185,11 +196,13 @@ Control RID_SIDEBAR_TEXT_PANEL
{
Identifier = TBI_SUPER_SW;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUPER_SW;
+ Command = ".uno:SuperScript";
};
ToolBoxItem
{
Identifier = TBI_SUB_SW;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUB_SW;
+ Command = ".uno:SubScript";
};
};
};
@@ -207,11 +220,13 @@ Control RID_SIDEBAR_TEXT_PANEL
{
Identifier = TBI_SUPER;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUPER;
+ Command = ".uno:SuperScript";
};
ToolBoxItem
{
Identifier = TBI_SUB;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_SUB;
+ Command = ".uno:SubScript";
};
};
};
@@ -231,6 +246,7 @@ Control RID_SIDEBAR_TEXT_PANEL
Identifier = TBI_SPACING;
DropDown = TRUE ;
HelpID = HID_TBI_SPACING;
+ Command = ".uno:Spacing";
};
};
};