LCOV - code coverage report
Current view: top level - svx/source/sidebar/text - TextCharacterSpacingControl.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 1 277 0.4 %
Date: 2014-11-03 Functions: 2 13 15.4 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : #include "TextCharacterSpacingControl.hxx"
      20             : #include "TextPropertyPanel.hrc"
      21             : #include <sfx2/sidebar/ResourceDefinitions.hrc>
      22             : #include <svx/dialogs.hrc>
      23             : #include <svx/dialmgr.hxx>
      24             : #include <unotools/viewoptions.hxx>
      25             : #include <editeng/kernitem.hxx>
      26             : #include <sfx2/dispatch.hxx>
      27             : #include <sfx2/sidebar/Theme.hxx>
      28             : #include <vcl/settings.hxx>
      29             : 
      30             : namespace svx { namespace sidebar {
      31             : 
      32           0 : TextCharacterSpacingControl::TextCharacterSpacingControl (
      33             :     vcl::Window* pParent,
      34             :     svx::sidebar::TextPropertyPanel& rPanel,
      35             :     SfxBindings* pBindings)
      36           0 : :   PopupControl( pParent,SVX_RES(RID_POPUPPANEL_TEXTPAGE_SPACING))
      37             : ,   mrTextPropertyPanel(rPanel)
      38             : ,   mpBindings(pBindings)
      39           0 : ,   maVSSpacing     (ValueSetWithTextControl::IMAGE_TEXT,this, SVX_RES(VS_SPACING))
      40           0 : ,   maLastCus       (this, SVX_RES(FT_LASTCUSTOM))
      41             : //, maBorder        (this, SVX_RES(CT_BORDER))
      42           0 : ,   maFTSpacing     (this, SVX_RES(FT_SPACING))
      43           0 : ,   maLBKerning     (this, SVX_RES(LB_KERNING))
      44           0 : ,   maFTBy          (this, SVX_RES(FT_BY))
      45           0 : ,   maEditKerning   (this, SVX_RES(ED_KERNING))
      46             : 
      47             : ,   mpImg           (NULL)
      48             : ,   mpImgSel        (NULL)
      49             : ,   mpStr           (NULL)
      50             : ,   mpStrTip        (NULL)
      51             : 
      52           0 : ,   maImgCus        (SVX_RES(IMG_CUSTOM))
      53           0 : ,   maImgCusGrey    (SVX_RES(IMG_CUSTOM_GRAY))
      54           0 : ,   maStrCus        (SVX_RESSTR(STR_CUSTOM))
      55           0 : ,   maStrCusE       (SVX_RESSTR(STR_CUSTOM_E_TIP)) //add
      56           0 : ,   maStrCusC       (SVX_RESSTR(STR_CUSTOM_C_TIP)) //add
      57           0 : ,   maStrCusN       (SVX_RESSTR(STR_NORMAL_TIP))   //add
      58           0 : ,   maStrUnit       (SVX_RESSTR(STR_PT))           //add
      59             : 
      60             : ,   mnCustomKern(0)
      61             : ,   mnLastCus ( SPACING_NOCUSTOM )
      62             : ,   mbCusEnable(false)
      63           0 : ,   mbVS(true)
      64             : {
      65           0 :     initial();
      66           0 :     FreeResource();
      67           0 :     Link aLink = LINK(this, TextCharacterSpacingControl, KerningSelectHdl);
      68           0 :     maLBKerning.SetSelectHdl(aLink);
      69           0 :     aLink =LINK(this, TextCharacterSpacingControl, KerningModifyHdl);
      70           0 :     maEditKerning.SetModifyHdl(aLink);
      71             : 
      72           0 : }
      73           0 : TextCharacterSpacingControl::~TextCharacterSpacingControl()
      74             : {
      75           0 :     delete[] mpImg;
      76           0 :     delete[] mpImgSel;
      77           0 :     delete[] mpStr;
      78           0 :     delete[] mpStrTip;
      79           0 : }
      80             : 
      81           0 : void TextCharacterSpacingControl::initial()
      82             : {
      83           0 :     maVSSpacing.SetStyle( maVSSpacing.GetStyle()| WB_3DLOOK |  WB_NO_DIRECTSELECT  );
      84             :     {
      85           0 :         maVSSpacing.SetControlBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
      86           0 :         GetSettings().GetStyleSettings().GetMenuColor():
      87           0 :         sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
      88           0 :         maVSSpacing.SetColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
      89           0 :         GetSettings().GetStyleSettings().GetMenuColor():
      90           0 :         sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
      91           0 :         maVSSpacing.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
      92           0 :         GetSettings().GetStyleSettings().GetMenuColor():
      93           0 :         sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
      94           0 :         maFTSpacing.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
      95           0 :         GetSettings().GetStyleSettings().GetMenuColor():
      96           0 :         sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
      97           0 :         maFTBy.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
      98           0 :         GetSettings().GetStyleSettings().GetMenuColor():
      99           0 :         sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
     100             :     }
     101           0 :     mpImg = new Image[5];
     102           0 :     mpImg[0] = Image(SVX_RES(IMG_VERY_TIGHT));
     103           0 :     mpImg[1] = Image(SVX_RES(IMG_TIGHT));
     104           0 :     mpImg[2] = Image(SVX_RES(IMG_NORMAL));
     105           0 :     mpImg[3] = Image(SVX_RES(IMG_LOOSE));
     106           0 :     mpImg[4] = Image(SVX_RES(IMG_VERY_LOOSE));
     107             : 
     108           0 :     mpImgSel = new Image[5];
     109           0 :     mpImgSel[0] = Image(SVX_RES(IMG_VERY_TIGHT_S));
     110           0 :     mpImgSel[1] = Image(SVX_RES(IMG_TIGHT_S));
     111           0 :     mpImgSel[2] = Image(SVX_RES(IMG_NORMAL_S));
     112           0 :     mpImgSel[3] = Image(SVX_RES(IMG_LOOSE_S));
     113           0 :     mpImgSel[4] = Image(SVX_RES(IMG_VERY_LOOSE_S));
     114             : 
     115           0 :     mpStr = new OUString[5];
     116           0 :     mpStr[0] = SVX_RESSTR(STR_VERY_TIGHT);
     117           0 :     mpStr[1] = SVX_RESSTR(STR_TIGHT);
     118           0 :     mpStr[2] = SVX_RESSTR(STR_NORMAL);
     119           0 :     mpStr[3] = SVX_RESSTR(STR_LOOSE);
     120           0 :     mpStr[4] = SVX_RESSTR(STR_VERY_LOOSE);
     121             : 
     122             : 
     123           0 :     mpStrTip = new OUString[5];
     124           0 :     mpStrTip[0] = SVX_RESSTR(STR_VERY_TIGHT_TIP);
     125           0 :     mpStrTip[1] = SVX_RESSTR(STR_TIGHT_TIP);
     126           0 :     mpStrTip[2] = SVX_RESSTR(STR_NORMAL_TIP);
     127           0 :     mpStrTip[3] = SVX_RESSTR(STR_LOOSE_TIP);
     128           0 :     mpStrTip[4] = SVX_RESSTR(STR_VERY_LOOSE_TIP);
     129             : 
     130           0 :     for (int i=0;i<5;i++)
     131           0 :         maVSSpacing.AddItem(mpImg[i], &mpImgSel[i],mpStr[i],&mpStrTip[i]);
     132             : 
     133           0 :     maVSSpacing.AddItem( maImgCus, 0, maStrCus, 0 );
     134             : 
     135           0 :     maVSSpacing.SetNoSelection();
     136           0 :     Link aLink = LINK(this, TextCharacterSpacingControl,VSSelHdl );
     137           0 :     maVSSpacing.SetSelectHdl(aLink);
     138           0 :     maVSSpacing.StartSelection();
     139           0 :     maVSSpacing.Show();
     140           0 : }
     141             : 
     142           0 : void TextCharacterSpacingControl::Rearrange(bool bLBAvailable,bool bAvailable, long nKerning)
     143             : {
     144           0 :     mbVS = true;
     145           0 :     maVSSpacing.SetNoSelection();
     146           0 :     SvtViewOptions aWinOpt( E_WINDOW, SIDEBAR_SPACING_GLOBAL_VALUE );
     147           0 :     if ( aWinOpt.Exists() )
     148             :     {
     149           0 :         ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt.GetUserData();
     150           0 :         ::rtl::OUString aTmp;
     151           0 :         if ( aSeq.getLength())
     152           0 :             aSeq[0].Value >>= aTmp;
     153             : 
     154           0 :         OUString aWinData( aTmp );
     155           0 :         mnCustomKern = aWinData.toInt32();
     156           0 :         mnLastCus = SPACING_CLOSE_BY_CUS_EDIT;
     157           0 :         mbCusEnable = true;
     158             :     }
     159             :     else
     160             :     {
     161           0 :         mnLastCus = SPACING_NOCUSTOM;
     162           0 :         mbCusEnable = false;
     163             :     }
     164             : 
     165           0 :     if( !mnLastCus )
     166             :     {
     167           0 :         maVSSpacing.ReplaceItemImages(6, maImgCusGrey,0);
     168             :     }
     169             :     else
     170             :     {
     171             :         //set custom tips
     172           0 :         maVSSpacing.ReplaceItemImages(6, maImgCus,0);
     173           0 :         if(mnCustomKern > 0)
     174             :         {
     175           0 :             OUString aStrTip( maStrCusE);   //LAST CUSTOM no tip defect //add
     176           0 :             aStrTip += OUString::number( (double)mnCustomKern / 10);
     177           0 :             aStrTip += " " + maStrUnit;      // modify
     178           0 :             maVSSpacing.SetItemText(6,aStrTip);
     179             :         }
     180           0 :         else if(mnCustomKern < 0)
     181             :         {
     182           0 :             OUString aStrTip(maStrCusC) ;     //LAST CUSTOM no tip defect //add
     183           0 :             aStrTip += OUString::number( (double)-mnCustomKern / 10);
     184           0 :             aStrTip += " " + maStrUnit;      // modify
     185           0 :             maVSSpacing.SetItemText( 6, aStrTip );
     186             :         }
     187             :         else
     188             :         {
     189           0 :             OUString aStrTip(maStrCusN) ;     //LAST CUSTOM no tip defect //add
     190           0 :             maVSSpacing.SetItemText( 6, aStrTip );
     191             :         }
     192             : 
     193             :     }
     194             : 
     195           0 :     if(bLBAvailable && bAvailable)
     196             :     {
     197           0 :         maLBKerning.Enable();
     198           0 :         maFTSpacing.Enable();
     199             : 
     200           0 :         SfxMapUnit eUnit = mrTextPropertyPanel.GetSpaceController().GetCoreMetric();
     201           0 :         MapUnit eOrgUnit = (MapUnit)eUnit;
     202           0 :         MapUnit ePntUnit( MAP_POINT );
     203           0 :         long nBig = maEditKerning.Normalize(nKerning);
     204           0 :         nKerning = LogicToLogic( nBig, eOrgUnit, ePntUnit );
     205             : 
     206           0 :         if ( nKerning > 0 )
     207             :         {
     208           0 :             maFTBy.Enable();
     209           0 :             maEditKerning.Enable();
     210           0 :             maEditKerning.SetMax( 9999 );
     211           0 :             maEditKerning.SetLast( 9999 );
     212           0 :             maEditKerning.SetValue( nKerning );
     213           0 :             maLBKerning.SelectEntryPos( SIDEBAR_SPACE_EXPAND );
     214           0 :             if(nKerning == 30)
     215             :             {
     216           0 :                 maVSSpacing.SelectItem(4);
     217             :             }
     218           0 :             else if(nKerning == 60)
     219             :             {
     220           0 :                 maVSSpacing.SelectItem(5);
     221             :             }
     222             :             else
     223             :             {
     224           0 :                 maVSSpacing.SetNoSelection();
     225           0 :                 maVSSpacing.SelectItem(0);
     226           0 :                 mbVS = false;
     227             :             }
     228             :         }
     229           0 :         else if ( nKerning < 0 )
     230             :         {
     231           0 :             maFTBy.Enable();
     232           0 :             maEditKerning.Enable();
     233           0 :             maEditKerning.SetValue( -nKerning );
     234           0 :             maLBKerning.SelectEntryPos( SIDEBAR_SPACE_CONDENSED );
     235           0 :             long nMax = mrTextPropertyPanel.GetSelFontSize()/6;
     236           0 :             maEditKerning.SetMax( maEditKerning.Normalize( nMax ), FUNIT_POINT );
     237           0 :             maEditKerning.SetLast( maEditKerning.GetMax( maEditKerning.GetUnit() ) );
     238           0 :             if( nKerning == -30 )
     239             :             {
     240           0 :                 maVSSpacing.SelectItem(1);
     241             :             }
     242           0 :             else if( nKerning == -15 )
     243             :             {
     244           0 :                 maVSSpacing.SelectItem(2);
     245             :             }
     246             :             else
     247             :             {
     248           0 :                 maVSSpacing.SetNoSelection();
     249           0 :                 maVSSpacing.SelectItem(0);
     250           0 :                 mbVS = false;
     251             :             }
     252             :         }
     253             :         else
     254             :         {
     255           0 :             maVSSpacing.SelectItem(3);
     256           0 :             maLBKerning.SelectEntryPos( SIDEBAR_SPACE_NORMAL );
     257           0 :             maFTBy.Disable();
     258           0 :             maEditKerning.Disable();
     259           0 :             maEditKerning.SetValue( 0 );
     260           0 :             maEditKerning.SetMax( 9999 );
     261           0 :             maEditKerning.SetLast( 9999 );
     262           0 :         }
     263             :     }
     264           0 :     else if(bLBAvailable && !bAvailable)
     265             :     {
     266             :         //modified
     267           0 :         maVSSpacing.SetNoSelection();
     268           0 :         maVSSpacing.SelectItem(0);
     269           0 :         mbVS = false;
     270           0 :         maLBKerning.Enable();
     271           0 :         maFTSpacing.Enable();
     272           0 :         maLBKerning.SetNoSelection();
     273           0 :         maEditKerning.SetText(OUString());
     274           0 :         maEditKerning.Disable();
     275           0 :         maFTBy.Disable();
     276             :     }
     277             :     else
     278             :     {
     279           0 :         maVSSpacing.SetNoSelection();
     280           0 :         maVSSpacing.SelectItem(0);
     281           0 :         mbVS = false;
     282           0 :         maEditKerning.SetText(OUString());
     283           0 :         maLBKerning.SetNoSelection();
     284           0 :         maLBKerning.Disable();
     285           0 :         maFTSpacing.Disable();
     286           0 :         maEditKerning.Disable();
     287           0 :         maFTBy.Disable();
     288             :     }
     289           0 :     GetFocus();
     290           0 :     maVSSpacing.Format();
     291           0 :     maVSSpacing.StartSelection();
     292           0 : }
     293           0 : IMPL_LINK(TextCharacterSpacingControl, VSSelHdl, void *, pControl)
     294             : {
     295           0 :     mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
     296             : 
     297           0 :     if(pControl == &maVSSpacing)
     298             :     {
     299           0 :         sal_uInt16 iPos = maVSSpacing.GetSelectItemId();
     300           0 :         short nKern = 0;
     301           0 :         SfxMapUnit eUnit = mrTextPropertyPanel.GetSpaceController().GetCoreMetric();
     302           0 :         long nVal = 0;
     303           0 :         if(iPos == 1)
     304             :         {
     305           0 :             nVal = LogicToLogic(30, MAP_POINT, (MapUnit)eUnit);
     306           0 :             nKern = (short)maEditKerning.Denormalize(nVal);
     307           0 :             SvxKerningItem aKernItem(-nKern, SID_ATTR_CHAR_KERNING);
     308           0 :             mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SfxCallMode::RECORD, &aKernItem, 0L);
     309           0 :             mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
     310             :         }
     311           0 :         else if(iPos == 2)
     312             :         {
     313           0 :             nVal = LogicToLogic(15, MAP_POINT, (MapUnit)eUnit);
     314           0 :             nKern = (short)maEditKerning.Denormalize(nVal);
     315           0 :             SvxKerningItem aKernItem(-nKern, SID_ATTR_CHAR_KERNING);
     316           0 :             mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SfxCallMode::RECORD, &aKernItem, 0L);
     317           0 :             mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
     318             :         }
     319           0 :         else if(iPos == 3)
     320             :         {
     321           0 :             SvxKerningItem aKernItem(0, SID_ATTR_CHAR_KERNING);
     322           0 :             mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SfxCallMode::RECORD, &aKernItem, 0L);
     323           0 :             mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
     324             :         }
     325           0 :         else if(iPos == 4)
     326             :         {
     327           0 :             nVal = LogicToLogic(30, MAP_POINT, (MapUnit)eUnit);
     328           0 :             nKern = (short)maEditKerning.Denormalize(nVal);
     329           0 :             SvxKerningItem aKernItem(nKern, SID_ATTR_CHAR_KERNING);
     330           0 :             mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SfxCallMode::RECORD, &aKernItem, 0L);
     331           0 :             mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
     332             :         }
     333           0 :         else if(iPos == 5)
     334             :         {
     335           0 :             nVal = LogicToLogic(60, MAP_POINT, (MapUnit)eUnit);
     336           0 :             nKern = (short)maEditKerning.Denormalize(nVal);
     337           0 :             SvxKerningItem aKernItem(nKern, SID_ATTR_CHAR_KERNING);
     338           0 :             mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SfxCallMode::RECORD, &aKernItem, 0L);
     339           0 :             mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
     340             :         }
     341           0 :         else if(iPos == 6)
     342             :         {
     343             :             //modified
     344           0 :             if(mbCusEnable)
     345             :             {
     346           0 :                 nVal = LogicToLogic(mnCustomKern, MAP_POINT, (MapUnit)eUnit);
     347           0 :                 nKern = (short)maEditKerning.Denormalize(nVal);
     348           0 :                 SvxKerningItem aKernItem(nKern , SID_ATTR_CHAR_KERNING);
     349           0 :                 mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SfxCallMode::RECORD, &aKernItem, 0L);
     350           0 :                 mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
     351             :             }
     352             :             else
     353             :             {
     354           0 :                 maVSSpacing.SetNoSelection();       //add , set no selection and keep the last select item
     355           0 :                 maVSSpacing.Format();
     356           0 :                 Invalidate();
     357           0 :                 maVSSpacing.StartSelection();
     358             :             }
     359             :             //modify end
     360             :         }
     361             : 
     362           0 :         if(iPos < 6 || (iPos == 6 && mbCusEnable)) //add
     363           0 :             mrTextPropertyPanel.EndSpacingPopupMode();
     364             :     }
     365             : 
     366             : 
     367             : 
     368           0 :     return 0;
     369             : }
     370             : 
     371           0 : IMPL_LINK(TextCharacterSpacingControl, KerningSelectHdl, ListBox*, EMPTYARG)
     372             : {
     373           0 :     if ( maLBKerning.GetSelectEntryPos() > 0 )
     374             :     {
     375           0 :         maFTBy.Enable();
     376           0 :         maEditKerning.Enable();
     377             :     }
     378             :     else
     379             :     {
     380           0 :         maEditKerning.SetValue( 0 );
     381           0 :         maFTBy.Disable();
     382           0 :         maEditKerning.Disable();
     383             :     }
     384             : 
     385           0 :     if ( maVSSpacing.GetSelectItemId() > 0 )
     386             :     {
     387           0 :         maVSSpacing.SetNoSelection();
     388           0 :         maVSSpacing.SelectItem(0);
     389           0 :         maVSSpacing.Format();
     390           0 :         Invalidate();
     391           0 :         maVSSpacing.StartSelection();
     392             :     }
     393           0 :     KerningModifyHdl( NULL );
     394           0 :     return 0;
     395             : }
     396           0 : IMPL_LINK(TextCharacterSpacingControl, KerningModifyHdl, MetricField*, EMPTYARG)
     397             : {
     398           0 :     if ( maVSSpacing.GetSelectItemId() > 0 )
     399             :     {
     400           0 :         maVSSpacing.SetNoSelection();
     401           0 :         maVSSpacing.SelectItem(0);
     402           0 :         maVSSpacing.Format();
     403           0 :         Invalidate();
     404           0 :         maVSSpacing.StartSelection();
     405             :     }
     406           0 :     sal_uInt16 nPos = maLBKerning.GetSelectEntryPos();
     407           0 :     short nKern = 0;
     408           0 :     SfxMapUnit eUnit = mrTextPropertyPanel.GetSpaceController().GetCoreMetric();
     409           0 :     mnLastCus = SPACING_CLOSE_BY_CUS_EDIT;
     410           0 :     if ( nPos == SIDEBAR_SPACE_EXPAND || nPos == SIDEBAR_SPACE_CONDENSED )
     411             :     {
     412           0 :         long nTmp = static_cast<long>(maEditKerning.GetValue());
     413           0 :         if ( nPos == SIDEBAR_SPACE_CONDENSED )
     414             :         {
     415           0 :             long nMax =  mrTextPropertyPanel.GetSelFontSize()/6;
     416           0 :             maEditKerning.SetMax( maEditKerning.Normalize( nMax ), FUNIT_TWIP );
     417           0 :             maEditKerning.SetLast( maEditKerning.GetMax( maEditKerning.GetUnit() ) );
     418           0 :             if(nTmp > maEditKerning.GetMax())
     419           0 :                 nTmp = maEditKerning.GetMax();
     420           0 :             mnCustomKern = -nTmp;
     421           0 :             long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)eUnit );
     422           0 :             nKern = (short)maEditKerning.Denormalize( nVal );
     423           0 :             nKern *= - 1;
     424             :         }
     425             :         else
     426             :         {
     427           0 :             maEditKerning.SetMax( 9999 );
     428           0 :             maEditKerning.SetLast( 9999 );
     429           0 :             if(nTmp > maEditKerning.GetMax(FUNIT_TWIP))
     430           0 :                 nTmp = maEditKerning.GetMax(FUNIT_TWIP);
     431           0 :             mnCustomKern = nTmp;
     432           0 :             long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)eUnit );
     433           0 :             nKern = (short)maEditKerning.Denormalize( nVal );
     434           0 :         }
     435             :     }
     436             :     else
     437             :     {
     438           0 :         mnCustomKern = 0;
     439             :     }
     440           0 :     SvxKerningItem aKernItem(nKern, SID_ATTR_CHAR_KERNING);
     441           0 :     mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SfxCallMode::RECORD, &aKernItem, 0L);
     442           0 :     return 0;
     443             : }
     444             : 
     445         594 : }} // end of namespace sidebar
     446             : 
     447             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10