18dcb2a10SAndre Fischer /************************************************************** 28dcb2a10SAndre Fischer * 38dcb2a10SAndre Fischer * Licensed to the Apache Software Foundation (ASF) under one 48dcb2a10SAndre Fischer * or more contributor license agreements. See the NOTICE file 58dcb2a10SAndre Fischer * distributed with this work for additional information 68dcb2a10SAndre Fischer * regarding copyright ownership. The ASF licenses this file 78dcb2a10SAndre Fischer * to you under the Apache License, Version 2.0 (the 88dcb2a10SAndre Fischer * "License"); you may not use this file except in compliance 98dcb2a10SAndre Fischer * with the License. You may obtain a copy of the License at 108dcb2a10SAndre Fischer * 118dcb2a10SAndre Fischer * http://www.apache.org/licenses/LICENSE-2.0 128dcb2a10SAndre Fischer * 138dcb2a10SAndre Fischer * Unless required by applicable law or agreed to in writing, 148dcb2a10SAndre Fischer * software distributed under the License is distributed on an 158dcb2a10SAndre Fischer * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 168dcb2a10SAndre Fischer * KIND, either express or implied. See the License for the 178dcb2a10SAndre Fischer * specific language governing permissions and limitations 188dcb2a10SAndre Fischer * under the License. 198dcb2a10SAndre Fischer * 208dcb2a10SAndre Fischer *************************************************************/ 218dcb2a10SAndre Fischer 228dcb2a10SAndre Fischer #include "LineWidthControl.hxx" 238dcb2a10SAndre Fischer #include "LinePropertyPanel.hrc" 248dcb2a10SAndre Fischer #include "LinePropertyPanel.hxx" 258dcb2a10SAndre Fischer 268dcb2a10SAndre Fischer #include <svx/dialogs.hrc> 278dcb2a10SAndre Fischer #include <svx/dialmgr.hxx> 288dcb2a10SAndre Fischer #include <sfx2/sidebar/propertypanel.hrc> 298dcb2a10SAndre Fischer #include <comphelper/processfactory.hxx> 308dcb2a10SAndre Fischer #include <vcl/svapp.hxx> 318dcb2a10SAndre Fischer #include <unotools/viewoptions.hxx> 328dcb2a10SAndre Fischer #include <svx/xlnwtit.hxx> 338dcb2a10SAndre Fischer #include <sfx2/bindings.hxx> 348dcb2a10SAndre Fischer #include <sfx2/dispatch.hxx> 358dcb2a10SAndre Fischer #include "svx/sidebar/PopupContainer.hxx" 368dcb2a10SAndre Fischer 378dcb2a10SAndre Fischer 388dcb2a10SAndre Fischer namespace svx { namespace sidebar { 398dcb2a10SAndre Fischer 408dcb2a10SAndre Fischer LineWidthControl::LineWidthControl ( 418dcb2a10SAndre Fischer Window* pParent, 428dcb2a10SAndre Fischer LinePropertyPanel& rPanel) 438dcb2a10SAndre Fischer : svx::sidebar::PopupControl(pParent,SVX_RES(RID_POPUPPANEL_LINEPAGE_WIDTH)), 448dcb2a10SAndre Fischer mrLinePropertyPanel(rPanel), 458dcb2a10SAndre Fischer mpBindings(NULL), 468dcb2a10SAndre Fischer maVSWidth( this, SVX_RES(VS_WIDTH)), 478dcb2a10SAndre Fischer maFTCus( this, SVX_RES(FT_CUSTOME)), 488dcb2a10SAndre Fischer maFTWidth( this, SVX_RES(FT_LINE_WIDTH)), 498dcb2a10SAndre Fischer maMFWidth( this, SVX_RES(MF_WIDTH)), 508dcb2a10SAndre Fischer meMapUnit(SFX_MAPUNIT_TWIP), 518dcb2a10SAndre Fischer rStr(NULL), 528dcb2a10SAndre Fischer mstrPT(SVX_RES(STR_PT)), 538dcb2a10SAndre Fischer mnCustomWidth(0), 548dcb2a10SAndre Fischer mbCustom(false), 558dcb2a10SAndre Fischer mbColseByEdit(false), 568dcb2a10SAndre Fischer mnTmpCusomWidth(0), 578dcb2a10SAndre Fischer mbVSFocus(true), 588dcb2a10SAndre Fischer maIMGCus(SVX_RES(IMG_WIDTH_CUSTOM)), 598dcb2a10SAndre Fischer maIMGCusGray(SVX_RES(IMG_WIDTH_CUSTOM_GRAY)) 608dcb2a10SAndre Fischer { 618dcb2a10SAndre Fischer Initialize(); 628dcb2a10SAndre Fischer FreeResource(); 638dcb2a10SAndre Fischer mpBindings = mrLinePropertyPanel.GetBindings(); 648dcb2a10SAndre Fischer } 658dcb2a10SAndre Fischer 668dcb2a10SAndre Fischer 678dcb2a10SAndre Fischer 688dcb2a10SAndre Fischer 698dcb2a10SAndre Fischer LineWidthControl::~LineWidthControl (void) 708dcb2a10SAndre Fischer { 718dcb2a10SAndre Fischer delete[] rStr; 728dcb2a10SAndre Fischer } 738dcb2a10SAndre Fischer 748dcb2a10SAndre Fischer 758dcb2a10SAndre Fischer 768dcb2a10SAndre Fischer 778dcb2a10SAndre Fischer void LineWidthControl::Paint(const Rectangle& rect) 788dcb2a10SAndre Fischer { 798dcb2a10SAndre Fischer svx::sidebar::PopupControl::Paint(rect); 808dcb2a10SAndre Fischer 818dcb2a10SAndre Fischer Color aOldLineColor = GetLineColor(); 828dcb2a10SAndre Fischer Color aOldFillColor = GetFillColor(); 838dcb2a10SAndre Fischer 848dcb2a10SAndre Fischer Point aPos( LogicToPixel( Point( CUSTOM_X, CUSTOM_Y), MAP_APPFONT )); 858dcb2a10SAndre Fischer Size aSize( LogicToPixel( Size( CUSTOM_W, CUSTOM_H ), MAP_APPFONT )); 868dcb2a10SAndre Fischer Rectangle aRect( aPos, aSize ); 878dcb2a10SAndre Fischer aRect.Left() -= 1; 888dcb2a10SAndre Fischer aRect.Top() -= 1; 898dcb2a10SAndre Fischer aRect.Right() += 1; 908dcb2a10SAndre Fischer aRect.Bottom() += 1; 918dcb2a10SAndre Fischer 928dcb2a10SAndre Fischer Color aLineColor(189,201,219); 938dcb2a10SAndre Fischer if(!GetSettings().GetStyleSettings().GetHighContrastMode()) 948dcb2a10SAndre Fischer SetLineColor(aLineColor); 958dcb2a10SAndre Fischer else 968dcb2a10SAndre Fischer SetLineColor(GetSettings().GetStyleSettings().GetShadowColor()); 978dcb2a10SAndre Fischer SetFillColor(COL_TRANSPARENT); 988dcb2a10SAndre Fischer DrawRect(aRect); 998dcb2a10SAndre Fischer 1008dcb2a10SAndre Fischer SetLineColor(aOldLineColor); 1018dcb2a10SAndre Fischer SetFillColor(aOldFillColor); 1028dcb2a10SAndre Fischer } 1038dcb2a10SAndre Fischer 1048dcb2a10SAndre Fischer 1058dcb2a10SAndre Fischer 1068dcb2a10SAndre Fischer 1078dcb2a10SAndre Fischer void LineWidthControl::Initialize() 1088dcb2a10SAndre Fischer { 1098dcb2a10SAndre Fischer maVSWidth.SetStyle( maVSWidth.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );// WB_NAMEFIELD | WB_ITEMBORDER |WB_DOUBLEBORDER | WB_NONEFIELD | 1108dcb2a10SAndre Fischer //for high contract wj 1118dcb2a10SAndre Fischer if(GetSettings().GetStyleSettings().GetHighContrastMode()) 1128dcb2a10SAndre Fischer { 1138dcb2a10SAndre Fischer maVSWidth.SetColor(GetSettings().GetStyleSettings().GetMenuColor()); 1148dcb2a10SAndre Fischer // maBorder.SetBackground(GetSettings().GetStyleSettings().GetMenuColor()); 1158dcb2a10SAndre Fischer maFTWidth.SetBackground(GetSettings().GetStyleSettings().GetMenuColor()); 1168dcb2a10SAndre Fischer } 1178dcb2a10SAndre Fischer else 1188dcb2a10SAndre Fischer { 1198dcb2a10SAndre Fischer maVSWidth.SetColor(COL_WHITE); 1208dcb2a10SAndre Fischer // maBorder.SetBackground(Wallpaper(COL_WHITE)); 1218dcb2a10SAndre Fischer maFTWidth.SetBackground(Wallpaper(COL_WHITE)); 1228dcb2a10SAndre Fischer } 1238dcb2a10SAndre Fischer 1248dcb2a10SAndre Fischer sal_Int64 nFirst= maMFWidth.Denormalize( maMFWidth.GetFirst( FUNIT_TWIP ) ); 1258dcb2a10SAndre Fischer sal_Int64 nLast = maMFWidth.Denormalize( maMFWidth.GetLast( FUNIT_TWIP ) ); 1268dcb2a10SAndre Fischer sal_Int64 nMin = maMFWidth.Denormalize( maMFWidth.GetMin( FUNIT_TWIP ) ); 1278dcb2a10SAndre Fischer sal_Int64 nMax = maMFWidth.Denormalize( maMFWidth.GetMax( FUNIT_TWIP ) ); 1288dcb2a10SAndre Fischer maMFWidth.SetSpinSize( 10 ); 1298dcb2a10SAndre Fischer maMFWidth.SetUnit( FUNIT_POINT ); 1308dcb2a10SAndre Fischer if( maMFWidth.GetDecimalDigits() > 1 ) 1318dcb2a10SAndre Fischer maMFWidth.SetDecimalDigits( 1 ); 1328dcb2a10SAndre Fischer maMFWidth.SetFirst( maMFWidth.Normalize( nFirst ), FUNIT_TWIP ); 1338dcb2a10SAndre Fischer maMFWidth.SetLast( maMFWidth.Normalize( nLast ), FUNIT_TWIP ); 1348dcb2a10SAndre Fischer maMFWidth.SetMin( maMFWidth.Normalize( nMin ), FUNIT_TWIP ); 1358dcb2a10SAndre Fischer maMFWidth.SetMax( maMFWidth.Normalize( nMax ), FUNIT_TWIP ); 1368dcb2a10SAndre Fischer 1378dcb2a10SAndre Fischer rStr = new XubString[9]; 1388dcb2a10SAndre Fischer //modify, 1398dcb2a10SAndre Fischer rStr[0] = String("05", 2, RTL_TEXTENCODING_ASCII_US); 1408dcb2a10SAndre Fischer rStr[1] = String("08", 2, RTL_TEXTENCODING_ASCII_US); 1418dcb2a10SAndre Fischer rStr[2] = String("10", 2, RTL_TEXTENCODING_ASCII_US); 1428dcb2a10SAndre Fischer rStr[3] = String("15", 2, RTL_TEXTENCODING_ASCII_US); 1438dcb2a10SAndre Fischer rStr[4] = String("23", 2, RTL_TEXTENCODING_ASCII_US); 1448dcb2a10SAndre Fischer rStr[5] = String("30", 2, RTL_TEXTENCODING_ASCII_US); 1458dcb2a10SAndre Fischer rStr[6] = String("45", 2, RTL_TEXTENCODING_ASCII_US); 1468dcb2a10SAndre Fischer rStr[7] = String("60", 2, RTL_TEXTENCODING_ASCII_US); 1478dcb2a10SAndre Fischer rStr[8] = String( SVX_RES(STR_WIDTH_LAST_CUSTOM) ); 1488dcb2a10SAndre Fischer 1498dcb2a10SAndre Fischer LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); 1508dcb2a10SAndre Fischer const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep().GetChar(0); 1518dcb2a10SAndre Fischer 1528dcb2a10SAndre Fischer for(int i = 0; i <= 7 ; i++) 1538dcb2a10SAndre Fischer { 1548dcb2a10SAndre Fischer rStr[i] = rStr[i].Insert(cSep, 1);//Modify 1558dcb2a10SAndre Fischer rStr[i].Append(mstrPT); 1568dcb2a10SAndre Fischer } 1578dcb2a10SAndre Fischer //end 1588dcb2a10SAndre Fischer 1598dcb2a10SAndre Fischer for(sal_uInt16 i = 1 ; i <= 9 ; i++) 1608dcb2a10SAndre Fischer { 1618dcb2a10SAndre Fischer maVSWidth.InsertItem(i); 1628dcb2a10SAndre Fischer maVSWidth.SetItemText(i, rStr[i-1]); 1638dcb2a10SAndre Fischer } 1648dcb2a10SAndre Fischer maVSWidth.SetUnit(rStr); 1658dcb2a10SAndre Fischer maVSWidth.SetItemData(1,(void*)5); 1668dcb2a10SAndre Fischer maVSWidth.SetItemData(2,(void*)8); 1678dcb2a10SAndre Fischer maVSWidth.SetItemData(3,(void*)10); 1688dcb2a10SAndre Fischer maVSWidth.SetItemData(4,(void*)15); 1698dcb2a10SAndre Fischer maVSWidth.SetItemData(5,(void*)23); 1708dcb2a10SAndre Fischer maVSWidth.SetItemData(6,(void*)30); 1718dcb2a10SAndre Fischer maVSWidth.SetItemData(7,(void*)45); 1728dcb2a10SAndre Fischer maVSWidth.SetItemData(8,(void*)60); 1738dcb2a10SAndre Fischer maVSWidth.SetImage(maIMGCusGray); 1748dcb2a10SAndre Fischer 1758dcb2a10SAndre Fischer maVSWidth.SetSelItem(0); 1768dcb2a10SAndre Fischer Link aLink = LINK( this, LineWidthControl, VSSelectHdl ) ; 1778dcb2a10SAndre Fischer maVSWidth.SetSelectHdl(aLink); 1788dcb2a10SAndre Fischer aLink = LINK(this, LineWidthControl, MFModifyHdl); 1798dcb2a10SAndre Fischer maMFWidth.SetModifyHdl(aLink); 1808dcb2a10SAndre Fischer 1818dcb2a10SAndre Fischer maVSWidth.StartSelection(); 1828dcb2a10SAndre Fischer maVSWidth.Show(); 1838dcb2a10SAndre Fischer } 1848dcb2a10SAndre Fischer 1858dcb2a10SAndre Fischer 1868dcb2a10SAndre Fischer 1878dcb2a10SAndre Fischer 1888dcb2a10SAndre Fischer void LineWidthControl::GetFocus() 1898dcb2a10SAndre Fischer { 1908dcb2a10SAndre Fischer if(!mbVSFocus) 1918dcb2a10SAndre Fischer maMFWidth.GrabFocus(); 1928dcb2a10SAndre Fischer else 1938dcb2a10SAndre Fischer maVSWidth.GrabFocus(); 1948dcb2a10SAndre Fischer } 1958dcb2a10SAndre Fischer 1968dcb2a10SAndre Fischer 1978dcb2a10SAndre Fischer 1988dcb2a10SAndre Fischer 1998dcb2a10SAndre Fischer ValueSet& LineWidthControl::GetValueSet() 2008dcb2a10SAndre Fischer { 2018dcb2a10SAndre Fischer return maVSWidth; 2028dcb2a10SAndre Fischer } 2038dcb2a10SAndre Fischer 2048dcb2a10SAndre Fischer 2058dcb2a10SAndre Fischer 2068dcb2a10SAndre Fischer 2078dcb2a10SAndre Fischer void LineWidthControl::SetWidthSelect( long lValue, bool bValuable, SfxMapUnit eMapUnit) 2088dcb2a10SAndre Fischer { 2098dcb2a10SAndre Fischer mbVSFocus = true; 2108dcb2a10SAndre Fischer maVSWidth.SetSelItem(0); 2118dcb2a10SAndre Fischer mbColseByEdit = false; 2128dcb2a10SAndre Fischer meMapUnit = eMapUnit; 2138dcb2a10SAndre Fischer SvtViewOptions aWinOpt( E_WINDOW, SIDEBAR_LINE_WIDTH_GLOBAL_VALUE ); 2148dcb2a10SAndre Fischer if ( aWinOpt.Exists() ) 2158dcb2a10SAndre Fischer { 2168dcb2a10SAndre Fischer ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt.GetUserData(); 2178dcb2a10SAndre Fischer ::rtl::OUString aTmp; 2188dcb2a10SAndre Fischer if ( aSeq.getLength()) 2198dcb2a10SAndre Fischer aSeq[0].Value >>= aTmp; 2208dcb2a10SAndre Fischer 2218dcb2a10SAndre Fischer String aWinData( aTmp ); 2228dcb2a10SAndre Fischer mnCustomWidth = aWinData.ToInt32(); 2238dcb2a10SAndre Fischer mbCustom = true; 2248dcb2a10SAndre Fischer maVSWidth.SetImage(maIMGCus); 2258dcb2a10SAndre Fischer maVSWidth.SetCusEnable(true); 2268dcb2a10SAndre Fischer 2278dcb2a10SAndre Fischer String aStrTip( String::CreateFromDouble( (double)mnCustomWidth / 10)); 2288dcb2a10SAndre Fischer aStrTip.Append(mstrPT); // 2298dcb2a10SAndre Fischer maVSWidth.SetItemText(9, aStrTip); 2308dcb2a10SAndre Fischer } 2318dcb2a10SAndre Fischer else 2328dcb2a10SAndre Fischer { 2338dcb2a10SAndre Fischer mbCustom = false; 2348dcb2a10SAndre Fischer maVSWidth.SetImage(maIMGCusGray); 2358dcb2a10SAndre Fischer maVSWidth.SetCusEnable(false); 2368dcb2a10SAndre Fischer //modify 2378dcb2a10SAndre Fischer //String aStrTip(String(SVX_RES(STR_WIDTH_LAST_CUSTOM))); 2388dcb2a10SAndre Fischer //maVSWidth.SetItemText(9, aStrTip); 2398dcb2a10SAndre Fischer maVSWidth.SetItemText(9, rStr[8]); 2408dcb2a10SAndre Fischer } 2418dcb2a10SAndre Fischer 2428dcb2a10SAndre Fischer if(bValuable) 2438dcb2a10SAndre Fischer { 2448dcb2a10SAndre Fischer sal_Int64 nVal = OutputDevice::LogicToLogic( lValue, (MapUnit)eMapUnit, MAP_100TH_MM ); 2458dcb2a10SAndre Fischer nVal = maMFWidth.Normalize( nVal ); 2468dcb2a10SAndre Fischer maMFWidth.SetValue( nVal, FUNIT_100TH_MM ); 2478dcb2a10SAndre Fischer } 2488dcb2a10SAndre Fischer else 2498dcb2a10SAndre Fischer { 2508dcb2a10SAndre Fischer maMFWidth.SetText( String() ); 2518dcb2a10SAndre Fischer } 2528dcb2a10SAndre Fischer 2538dcb2a10SAndre Fischer MapUnit eOrgUnit = (MapUnit)eMapUnit; 2548dcb2a10SAndre Fischer MapUnit ePntUnit( MAP_TWIP ); 2558dcb2a10SAndre Fischer lValue = LogicToLogic( lValue , eOrgUnit, ePntUnit ); 2568dcb2a10SAndre Fischer 2578dcb2a10SAndre Fischer XubString strCurrValue = maMFWidth.GetText(); 2588dcb2a10SAndre Fischer sal_uInt16 i = 0; 2598dcb2a10SAndre Fischer for(; i < 8; i++) 2608dcb2a10SAndre Fischer if(strCurrValue == rStr[i]) 2618dcb2a10SAndre Fischer { 2628dcb2a10SAndre Fischer maVSWidth.SetSelItem(i+1); 2638dcb2a10SAndre Fischer break; 2648dcb2a10SAndre Fischer } 2658dcb2a10SAndre Fischer if (i>=8) 2668dcb2a10SAndre Fischer { 2678dcb2a10SAndre Fischer mbVSFocus = false; 2688dcb2a10SAndre Fischer maVSWidth.SetSelItem(0); 2698dcb2a10SAndre Fischer } 2708dcb2a10SAndre Fischer maVSWidth.Format(); 2718dcb2a10SAndre Fischer maVSWidth.StartSelection(); 2728dcb2a10SAndre Fischer } 2738dcb2a10SAndre Fischer 2748dcb2a10SAndre Fischer 2758dcb2a10SAndre Fischer 2768dcb2a10SAndre Fischer 2778dcb2a10SAndre Fischer IMPL_LINK(LineWidthControl, VSSelectHdl, void *, pControl) 2788dcb2a10SAndre Fischer { 2798dcb2a10SAndre Fischer if(pControl == &maVSWidth) 2808dcb2a10SAndre Fischer { 2818dcb2a10SAndre Fischer sal_uInt16 iPos = maVSWidth.GetSelectItemId(); 2828dcb2a10SAndre Fischer if(iPos >= 1 && iPos <= 8) 2838dcb2a10SAndre Fischer { 2848dcb2a10SAndre Fischer long nVal = LogicToLogic((long)(unsigned long)maVSWidth.GetItemData( iPos ) , MAP_POINT, (MapUnit)meMapUnit); 2858dcb2a10SAndre Fischer nVal = maMFWidth.Denormalize(nVal); 2868dcb2a10SAndre Fischer XLineWidthItem aWidthItem( nVal ); 2878dcb2a10SAndre Fischer mpBindings->GetDispatcher()->Execute(SID_ATTR_LINE_WIDTH, SFX_CALLMODE_RECORD, &aWidthItem, 0L); 2888dcb2a10SAndre Fischer mrLinePropertyPanel.SetWidthIcon(iPos); 2898dcb2a10SAndre Fischer mrLinePropertyPanel.SetWidth(nVal); 2908dcb2a10SAndre Fischer mbColseByEdit = false; 2918dcb2a10SAndre Fischer mnTmpCusomWidth = 0; 2928dcb2a10SAndre Fischer } 2938dcb2a10SAndre Fischer else if(iPos == 9) 2948dcb2a10SAndre Fischer {//last custom 2958dcb2a10SAndre Fischer //modified 2968dcb2a10SAndre Fischer if(mbCustom) 2978dcb2a10SAndre Fischer { 2988dcb2a10SAndre Fischer long nVal = LogicToLogic(mnCustomWidth , MAP_POINT, (MapUnit)meMapUnit); 2998dcb2a10SAndre Fischer nVal = maMFWidth.Denormalize(nVal); 3008dcb2a10SAndre Fischer XLineWidthItem aWidthItem( nVal ); 3018dcb2a10SAndre Fischer mpBindings->GetDispatcher()->Execute(SID_ATTR_LINE_WIDTH, SFX_CALLMODE_RECORD, &aWidthItem, 0L); 3028dcb2a10SAndre Fischer mrLinePropertyPanel.SetWidth(nVal); 3038dcb2a10SAndre Fischer mbColseByEdit = false; 3048dcb2a10SAndre Fischer mnTmpCusomWidth = 0; 3058dcb2a10SAndre Fischer } 3068dcb2a10SAndre Fischer else 3078dcb2a10SAndre Fischer { 3088dcb2a10SAndre Fischer maVSWidth.SetNoSelection(); //add , set no selection and keep the last select item 3098dcb2a10SAndre Fischer maVSWidth.Format(); 3108dcb2a10SAndre Fischer Invalidate(); 3118dcb2a10SAndre Fischer maVSWidth.StartSelection(); 3128dcb2a10SAndre Fischer } 3138dcb2a10SAndre Fischer //modify end 3148dcb2a10SAndre Fischer } 3158dcb2a10SAndre Fischer if((iPos >= 1 && iPos <= 8) || (iPos == 9 && mbCustom)) //add 3168dcb2a10SAndre Fischer mrLinePropertyPanel.EndLineWidthPopupMode(); 3178dcb2a10SAndre Fischer } 3188dcb2a10SAndre Fischer return( 0L ); 3198dcb2a10SAndre Fischer } 3208dcb2a10SAndre Fischer 3218dcb2a10SAndre Fischer 3228dcb2a10SAndre Fischer 3238dcb2a10SAndre Fischer 3248dcb2a10SAndre Fischer IMPL_LINK(LineWidthControl, MFModifyHdl, void *, pControl) 3258dcb2a10SAndre Fischer { 3268dcb2a10SAndre Fischer if(pControl == &maMFWidth) 3278dcb2a10SAndre Fischer { 3288dcb2a10SAndre Fischer if(maVSWidth.GetSelItem()) 3298dcb2a10SAndre Fischer { 3308dcb2a10SAndre Fischer maVSWidth.SetSelItem(0); 3318dcb2a10SAndre Fischer maVSWidth.Format(); 3328dcb2a10SAndre Fischer Invalidate(); 3338dcb2a10SAndre Fischer maVSWidth.StartSelection(); 3348dcb2a10SAndre Fischer } 3358dcb2a10SAndre Fischer long nTmp = static_cast<long>(maMFWidth.GetValue()); 3368dcb2a10SAndre Fischer long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)meMapUnit ); 3378dcb2a10SAndre Fischer sal_Int32 nNewWidth = (short)maMFWidth.Denormalize( nVal ); 3388dcb2a10SAndre Fischer XLineWidthItem aWidthItem(nNewWidth); 3398dcb2a10SAndre Fischer mpBindings->GetDispatcher()->Execute(SID_ATTR_LINE_WIDTH, SFX_CALLMODE_RECORD, &aWidthItem, 0L); 3408dcb2a10SAndre Fischer 3418dcb2a10SAndre Fischer mbColseByEdit = true; 3428dcb2a10SAndre Fischer mnTmpCusomWidth = nTmp; 3438dcb2a10SAndre Fischer /*for(sal_uInt16 i = 0; i < 8; i++) 3448dcb2a10SAndre Fischer { 3458dcb2a10SAndre Fischer if(nTmp == (sal_Int32)maVSWidth.GetItemData(i)) 3468dcb2a10SAndre Fischer { 3478dcb2a10SAndre Fischer mbColseByEdit = false; 3488dcb2a10SAndre Fischer break; 3498dcb2a10SAndre Fischer } 3508dcb2a10SAndre Fischer }*/ 3518dcb2a10SAndre Fischer 3528dcb2a10SAndre Fischer } 3538dcb2a10SAndre Fischer return( 0L ); 3548dcb2a10SAndre Fischer } 3558dcb2a10SAndre Fischer 3568dcb2a10SAndre Fischer 3578dcb2a10SAndre Fischer 3588dcb2a10SAndre Fischer 3598dcb2a10SAndre Fischer bool LineWidthControl::IsCloseByEdit() 3608dcb2a10SAndre Fischer { 3618dcb2a10SAndre Fischer return mbColseByEdit; 3628dcb2a10SAndre Fischer } 3638dcb2a10SAndre Fischer 3648dcb2a10SAndre Fischer 3658dcb2a10SAndre Fischer 3668dcb2a10SAndre Fischer 3678dcb2a10SAndre Fischer long LineWidthControl::GetTmpCustomWidth() 3688dcb2a10SAndre Fischer { 3698dcb2a10SAndre Fischer return mnTmpCusomWidth; 3708dcb2a10SAndre Fischer } 3718dcb2a10SAndre Fischer 3728dcb2a10SAndre Fischer 3738dcb2a10SAndre Fischer 3748dcb2a10SAndre Fischer } } // end of namespace svx::sidebar 375*4e8031e0SArmin Le Grand 376*4e8031e0SArmin Le Grand // eof 377