Kaydet (Commit) 862395f6 authored tarafından Oliver-Rainer Wittmann's avatar Oliver-Rainer Wittmann Kaydeden (comit) Michael Meeks

Resolves: #i122182# TextPropertyPanel

- add missing <break> in handling click to character attribute controls
- remove superfluous code and comments
- adapt code formatting
(cherry picked from commit a1111d73)

Conflicts:
	svx/source/sidebar/text/TextUnderlineControl.cxx

Change-Id: I1aea184523f74dda78218a631a64ea192765e9d5
üst 672dc0cc
......@@ -70,10 +70,8 @@ namespace svx { namespace sidebar {
#define TEXT_SECTIONPAGE_HEIGHT SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + ( TOOLBOX_ITEM_HEIGHT + 2 ) * 2 + CONTROL_SPACING_VERTICAL * 2 + SECTIONPAGE_MARGIN_VERTICAL_BOT
//
//end
PopupControl* TextPropertyPanel::CreateCharacterSpacingControl (PopupContainer* pParent)
PopupControl* TextPropertyPanel::CreateCharacterSpacingControl (PopupContainer* pParent)
{
return new TextCharacterSpacingControl(pParent, *this, mpBindings);
}
......@@ -395,7 +393,6 @@ void TextPropertyPanel::Initialize (void)
mbColorAvailable = true;
maBackColor = COL_AUTO;
mbBackColorAvailable = true;
meColorType = FONT_COLOR;
meEscape = SVX_ESCAPEMENT_OFF;
mbSuper = false;
mbSub = false;
......@@ -415,17 +412,12 @@ void TextPropertyPanel::Initialize (void)
//set handler
mpFontNameBox->SetBindings(mpBindings);
//add
Link aLink = LINK(this, TextPropertyPanel, FontSelHdl);
mpFontNameBox->SetSelectHdl(aLink);
//add end
aLink = LINK(this, TextPropertyPanel, FontSizeModifyHdl);
maFontSizeBox.SetModifyHdl(aLink);
//add
aLink = LINK(this, TextPropertyPanel, FontSizeSelHdl);
maFontSizeBox.SetSelectHdl(aLink);
//add end
aLink = LINK(this, TextPropertyPanel, FontSizeLoseFocus);
maFontSizeBox.SetLoseFocusHdl(aLink);
......@@ -563,7 +555,7 @@ IMPL_LINK( TextPropertyPanel, FontSelHdl, FontNameBox*, pBox )
}
return 0;
}
//add end
IMPL_LINK( TextPropertyPanel, FontSizeModifyHdl, FontSizeBox*, pSizeBox )
{
if (pSizeBox == &maFontSizeBox)
......@@ -580,7 +572,7 @@ IMPL_LINK( TextPropertyPanel, FontSizeModifyHdl, FontSizeBox*, pSizeBox )
}
return 0;
}
//add
IMPL_LINK( TextPropertyPanel, FontSizeSelHdl, FontSizeBox*, pSizeBox )
{
if ( !pSizeBox->IsTravelSelect() )
......@@ -596,7 +588,7 @@ IMPL_LINK( TextPropertyPanel, FontSizeSelHdl, FontSizeBox*, pSizeBox )
return 0;
}
//add end
IMPL_LINK(TextPropertyPanel, FontSizeLoseFocus, FontSizeBox*, pSizeBox)
{
if(pSizeBox == &maFontSizeBox)
......@@ -653,6 +645,7 @@ IMPL_LINK(TextPropertyPanel, ToolboxFontSelectHandler, ToolBox*, pToolBox)
mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_UNDERLINE, SFX_CALLMODE_RECORD, &aLineItem, 0L);
}
UpdateItem(SID_ATTR_CHAR_UNDERLINE);
break;
}
case TBI_STRIKEOUT:
{
......@@ -811,8 +804,6 @@ IMPL_LINK(TextPropertyPanel, ToolBoxFontColorDropHdl,ToolBox*, pToolBox)
const sal_uInt16 nId = pToolBox->GetCurItemId();
if(nId == TBI_FONTCOLOR)
{
meColorType = FONT_COLOR;
pToolBox->SetItemDown( nId, true );
maFontColorPopup.Show(*pToolBox);
......@@ -894,8 +885,6 @@ IMPL_LINK(TextPropertyPanel, ToolBoxHighlightDropHdl, ToolBox*, pToolBox)
const sal_uInt16 nId = pToolBox->GetCurItemId();
if(nId == TBI_HIGHLIGHT)
{
meColorType = BACK_COLOR;
pToolBox->SetItemDown( nId, true );
maBrushColorPopup.Show(*pToolBox);
maBrushColorPopup.SetCurrentColor(maBackColor, mbBackColorAvailable);
......@@ -923,14 +912,6 @@ IMPL_LINK(TextPropertyPanel, SpacingClickHdl, ToolBox*, pToolBox)
IMPL_LINK( TextPropertyPanel, ImplPopupModeEndHdl, FloatingWindow*, EMPTYARG )
{
return 0;
}
void TextPropertyPanel::NotifyItemUpdate (
const sal_uInt16 nSID,
const SfxItemState eState,
......
......@@ -28,7 +28,6 @@
#include <editeng/svxenum.hxx>
#include <editeng/fhgtitem.hxx>
//#include <com/sun/star/ui/XUIElement.hpp>
#include <com/sun/star/ui/XSidebar.hpp>
#include <boost/scoped_ptr.hpp>
......@@ -70,18 +69,10 @@ public:
void SetDefaultUnderline(FontUnderline eUnderline);
enum ColorType
{
FONT_COLOR = 1,
BACK_COLOR = 2
};
virtual void HandleContextChange (
const ::sfx2::sidebar::EnumContext aContext);
// ControllerItem::ItemUpdateReceiverInterface
virtual void NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
......@@ -129,7 +120,7 @@ private:
FontWeight meWeight;
FontItalic meItalic;
FontUnderline meUnderline;
Color meUnderlineColor; //
Color meUnderlineColor;
bool mbShadow;
FontStrikeout meStrike;
bool mbWeightAvailable;
......@@ -138,7 +129,6 @@ private:
bool mbColorAvailable;
Color maBackColor;
bool mbBackColorAvailable;
ColorType meColorType;
SvxEscapement meEscape; //for sw
bool mbSuper;
bool mbSub;
......@@ -190,7 +180,6 @@ private:
DECL_LINK(FontSizeLoseFocus, FontSizeBox *);
DECL_LINK(ToolboxFontSelectHandler, ToolBox *);
DECL_LINK(ToolboxIncDecSelectHdl, ToolBox *);
DECL_LINK(ImplPopupModeEndHdl, FloatingWindow* );
DECL_LINK(ToolBoxSwScriptSelectHdl, ToolBox *);
DECL_LINK(ToolBoxScriptSelectHdl, ToolBox *);
......
......@@ -68,14 +68,6 @@ TextUnderlineControl::TextUnderlineControl (
void TextUnderlineControl::initial()
{
/*maPBOptions.SetDefBkColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
GetSettings().GetStyleSettings().GetMenuColor():
sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_DropDownBackground ));//Color(244,245,249)//for high contrast
maPBOptions.SetHoverBkColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
GetSettings().GetStyleSettings().GetMenuColor():
sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ) );//Color( 93, 120, 163 )
maPBOptions.SetHoverTxtColor( sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Color_PanelTitleFont ) );//Color( 255, 255, 255 )
maPBOptions.SetIcoPosX( 2);*/
maVSUnderline.SetColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
GetSettings().GetStyleSettings().GetMenuColor():
sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
......@@ -132,7 +124,6 @@ void TextUnderlineControl::GetFocus()
}
void TextUnderlineControl::Rearrange(FontUnderline eLine)
{
// high contrast
maVSUnderline.SetItemImage(1, maIMGSingle);
maVSUnderline.SetItemImage(2, maIMGDouble );
maVSUnderline.SetItemImage(3, maIMGBold);
......@@ -143,74 +134,66 @@ void TextUnderlineControl::Rearrange(FontUnderline eLine)
maVSUnderline.SetItemImage(8, maIMGDashDot);
maVSUnderline.SetItemImage(9, maIMGDashDotDot);
maVSUnderline.SetItemImage(10, maIMGWave);
// maVSUnderline.SelectItem(0); //delete
// maVSUnderline.SetNoSelection();
switch(eLine)
{
case UNDERLINE_SINGLE:
maVSUnderline.SetItemImage(1, maIMGSingleSel);
maVSUnderline.SelectItem(1); //add
maVSUnderline.SelectItem(1);
maVSUnderline.GrabFocus();
break;
case UNDERLINE_DOUBLE:
maVSUnderline.SetItemImage(2, maIMGDoubleSel);
maVSUnderline.SelectItem(2); //add
maVSUnderline.SelectItem(2);
maVSUnderline.GrabFocus();
break;
case UNDERLINE_BOLD:
maVSUnderline.SetItemImage(3, maIMGBoldSel);
maVSUnderline.SelectItem(3); //add
maVSUnderline.SelectItem(3);
maVSUnderline.GrabFocus();
break;
case UNDERLINE_DOTTED:
maVSUnderline.SetItemImage(4, maIMGDotSel);
maVSUnderline.SelectItem(4); //add
maVSUnderline.SelectItem(4);
maVSUnderline.GrabFocus();
break;
case UNDERLINE_BOLDDOTTED:
maVSUnderline.SetItemImage(5, maIMGDotBoldSel);
maVSUnderline.SelectItem(5); //add
maVSUnderline.SelectItem(5);
maVSUnderline.GrabFocus();
break;
case UNDERLINE_DASH:
maVSUnderline.SetItemImage(6, maIMGDashSel);
maVSUnderline.SelectItem(6); //add
maVSUnderline.SelectItem(6);
maVSUnderline.GrabFocus();
break;
case UNDERLINE_LONGDASH:
maVSUnderline.SetItemImage(7, maIMGDashLongSel);
maVSUnderline.SelectItem(7); //add
maVSUnderline.SelectItem(7);
maVSUnderline.GrabFocus();
break;
case UNDERLINE_DASHDOT:
maVSUnderline.SetItemImage(8, maIMGDashDotSel);
maVSUnderline.SelectItem(8); //add
maVSUnderline.SelectItem(8);
maVSUnderline.GrabFocus();
break;
case UNDERLINE_DASHDOTDOT:
maVSUnderline.SetItemImage(9, maIMGDashDotDotSel);
maVSUnderline.SelectItem(9); //add
maVSUnderline.SelectItem(9);
maVSUnderline.GrabFocus();
break;
case UNDERLINE_WAVE:
maVSUnderline.SetItemImage(10, maIMGWaveSel);
maVSUnderline.SelectItem(10); //add
maVSUnderline.SelectItem(10);
maVSUnderline.GrabFocus();
break;
case UNDERLINE_NONE:
default:
maVSUnderline.SelectItem(1);
maVSUnderline.SetNoSelection();//add
maVSUnderline.SetNoSelection();
maPBOptions.GrabFocus();
}
maVSUnderline.StartSelection();
//removed
//if(mpPage->meContextType == PROPERTY_CONTEXT_SC_CELL)
// maPBOptions.Disable();
//else
// maPBOptions.Enable();
//removed end
}
ValueSet& TextUnderlineControl::GetValueSet()
{
......@@ -227,20 +210,12 @@ IMPL_LINK(TextUnderlineControl, VSSelectHdl, void *, pControl)
sal_uInt16 iPos = maVSUnderline.GetSelectItemId();
FontUnderline eUnderline = (FontUnderline)(sal_uInt64)maVSUnderline.GetItemData( iPos );
//<<modified
//SvxTextLineItem aLineItem(eUnderline, SID_ATTR_CHAR_UNDERLINE);
SvxUnderlineItem aLineItem(eUnderline, SID_ATTR_CHAR_UNDERLINE);
//modify end>>
//<<add , this line of code will keep the new underline use pre-color
aLineItem.SetColor(mrTextPropertyPanel.GetUnderlineColor());
//add end>>
mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_UNDERLINE, SFX_CALLMODE_RECORD, &aLineItem, 0L);
//add , for the popup page not update immediately
mrTextPropertyPanel.SetUnderline(eUnderline);
//add end
//mrTextPropertyPanel.SetDefaultUnderline(eUnderline);
mrTextPropertyPanel.EndUnderlinePopupMode();
}
......@@ -256,9 +231,7 @@ IMPL_LINK(TextUnderlineControl, PBClickHdl, PushButton *, pPBtn)
SfxDispatcher* pDisp = mpBindings->GetDispatcher();
pDisp->Execute( SID_CHAR_DLG_EFFECT, SFX_CALLMODE_ASYNCHRON );
}
//add
mrTextPropertyPanel.EndUnderlinePopupMode();
//add end
}
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment