diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-18 15:37:39 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-18 15:55:02 +0900 |
commit | 29ea595d908523771ab3a4a2f940b616b314b0b2 (patch) | |
tree | 169675454522b8f73134836f174df05db1effe41 /svx | |
parent | 9b6057dcb9eaf1d6b90e86b9c562d9e6f4856acb (diff) |
cleanup LineWidthControl
Change-Id: I875af6213660ba0fa9831b76c4d72e2092cd0a3a
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sidebar/line/LineWidthControl.cxx | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/svx/source/sidebar/line/LineWidthControl.cxx b/svx/source/sidebar/line/LineWidthControl.cxx index 611829325f8a..6723f6b1286f 100644 --- a/svx/source/sidebar/line/LineWidthControl.cxx +++ b/svx/source/sidebar/line/LineWidthControl.cxx @@ -32,7 +32,6 @@ #include <sfx2/dispatch.hxx> #include "svx/sidebar/PopupContainer.hxx" - namespace svx { namespace sidebar { LineWidthControl::LineWidthControl ( @@ -76,9 +75,6 @@ void LineWidthControl::dispose() svx::sidebar::PopupControl::dispose(); } - - - void LineWidthControl::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rect) { svx::sidebar::PopupControl::Paint(rRenderContext, rect); @@ -104,9 +100,6 @@ void LineWidthControl::Paint(vcl::RenderContext& rRenderContext, const Rectangle rRenderContext.Pop(); } - - - void LineWidthControl::Initialize() { maVSWidth->SetStyle( maVSWidth->GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );// WB_NAMEFIELD | WB_ITEMBORDER |WB_DOUBLEBORDER | WB_NONEFIELD | @@ -197,9 +190,6 @@ void LineWidthControl::GetFocus() maVSWidth->GrabFocus(); } - - - void LineWidthControl::SetWidthSelect( long lValue, bool bValuable, SfxMapUnit eMapUnit) { mbVSFocus = true; @@ -207,10 +197,10 @@ void LineWidthControl::SetWidthSelect( long lValue, bool bValuable, SfxMapUnit e mbCloseByEdit = false; meMapUnit = eMapUnit; SvtViewOptions aWinOpt( E_WINDOW, SIDEBAR_LINE_WIDTH_GLOBAL_VALUE ); - if ( aWinOpt.Exists() ) + if (aWinOpt.Exists()) { - ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt.GetUserData(); - ::rtl::OUString aTmp; + css::uno::Sequence <css::beans::NamedValue> aSeq = aWinOpt.GetUserData(); + OUString aTmp; if ( aSeq.getLength()) aSeq[0].Value >>= aTmp; @@ -235,10 +225,10 @@ void LineWidthControl::SetWidthSelect( long lValue, bool bValuable, SfxMapUnit e maVSWidth->SetItemText(9, rStr[8]); } - if(bValuable) + if (bValuable) { - sal_Int64 nVal = OutputDevice::LogicToLogic( lValue, (MapUnit)eMapUnit, MAP_100TH_MM ); - nVal = maMFWidth->Normalize( nVal ); + sal_Int64 nVal = OutputDevice::LogicToLogic(lValue, (MapUnit) eMapUnit, MAP_100TH_MM ); + nVal = maMFWidth->Normalize(nVal); maMFWidth->SetValue( nVal, FUNIT_100TH_MM ); } else @@ -253,11 +243,14 @@ void LineWidthControl::SetWidthSelect( long lValue, bool bValuable, SfxMapUnit e OUString strCurrValue = maMFWidth->GetText(); sal_uInt16 i = 0; for(; i < 8; i++) + { if(strCurrValue == rStr[i]) { maVSWidth->SetSelItem(i+1); break; } + } + if (i>=8) { mbVSFocus = false; @@ -268,15 +261,12 @@ void LineWidthControl::SetWidthSelect( long lValue, bool bValuable, SfxMapUnit e maVSWidth->StartSelection(); } - - - IMPL_LINK(LineWidthControl, VSSelectHdl, void *, pControl) { - if(pControl == &maVSWidth) + if (pControl == &maVSWidth) { sal_uInt16 iPos = maVSWidth->GetSelectItemId(); - if(iPos >= 1 && iPos <= 8) + if (iPos >= 1 && iPos <= 8) { sal_IntPtr nVal = LogicToLogic(reinterpret_cast<sal_IntPtr>(maVSWidth->GetItemData( iPos )), MAP_POINT, (MapUnit)meMapUnit); nVal = maMFWidth->Denormalize(nVal); @@ -287,10 +277,10 @@ IMPL_LINK(LineWidthControl, VSSelectHdl, void *, pControl) mbCloseByEdit = false; mnTmpCustomWidth = 0; } - else if(iPos == 9) + else if (iPos == 9) {//last custom //modified - if(mbCustom) + if (mbCustom) { long nVal = LogicToLogic(mnCustomWidth , MAP_POINT, (MapUnit)meMapUnit); nVal = maMFWidth->Denormalize(nVal); @@ -310,15 +300,12 @@ IMPL_LINK(LineWidthControl, VSSelectHdl, void *, pControl) } //modify end } - if((iPos >= 1 && iPos <= 8) || (iPos == 9 && mbCustom)) //add + if ((iPos >= 1 && iPos <= 8) || (iPos == 9 && mbCustom)) //add mrLinePropertyPanel.EndLineWidthPopupMode(); } return 0L; } - - - IMPL_LINK(LineWidthControl, MFModifyHdl, void *, pControl) { if(pControl == &maMFWidth) |