LCOV - code coverage report
Current view: top level - cui/source/dialogs - hangulhanjadlg.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 963 0.0 %
Date: 2012-08-25 Functions: 0 144 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 1455 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #include "hangulhanjadlg.hxx"
      30                 :            : #include "hangulhanjadlg.hrc"
      31                 :            : #include "commonlingui.hxx"
      32                 :            : #include <dialmgr.hxx>
      33                 :            : 
      34                 :            : #include <cuires.hrc>
      35                 :            : #include "helpid.hrc"
      36                 :            : 
      37                 :            : #include <algorithm>
      38                 :            : #include <vcl/controllayout.hxx>
      39                 :            : #include <vcl/msgbox.hxx>
      40                 :            : #include <unotools/lingucfg.hxx>
      41                 :            : #include <unotools/linguprops.hxx>
      42                 :            : #include <com/sun/star/linguistic2/ConversionDictionaryType.hpp>
      43                 :            : #include <com/sun/star/linguistic2/ConversionDirection.hpp>
      44                 :            : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      45                 :            : #include <com/sun/star/i18n/TextConversionOption.hpp>
      46                 :            : #include <com/sun/star/util/XFlushable.hpp>
      47                 :            : 
      48                 :            : #include <comphelper/processfactory.hxx>
      49                 :            : #include <comphelper/string.hxx>
      50                 :            : 
      51                 :            : #define HHC editeng::HangulHanjaConversion
      52                 :            : #define LINE_CNT        static_cast< sal_uInt16 >(2)
      53                 :            : 
      54                 :            : //.............................................................................
      55                 :            : namespace svx
      56                 :            : {
      57                 :            : //.............................................................................
      58                 :            :     using namespace ::com::sun::star;
      59                 :            :     using namespace ::com::sun::star::uno;
      60                 :            :     using namespace ::com::sun::star::linguistic2;
      61                 :            :     using namespace ::com::sun::star::lang;
      62                 :            :     using namespace ::com::sun::star::container;
      63                 :            :     using ::rtl::OUString;
      64                 :            : 
      65                 :            :     //-------------------------------------------------------------------------
      66                 :            :     namespace
      67                 :            :     {
      68                 :            :         class FontSwitch
      69                 :            :         {
      70                 :            :         private:
      71                 :            :             OutputDevice& m_rDev;
      72                 :            : 
      73                 :            :         public:
      74                 :          0 :             inline FontSwitch( OutputDevice& _rDev, const Font& _rTemporaryFont )
      75                 :          0 :                 :m_rDev( _rDev )
      76                 :            :             {
      77                 :          0 :                 m_rDev.Push( PUSH_FONT );
      78                 :          0 :                 m_rDev.SetFont( _rTemporaryFont );
      79                 :          0 :             }
      80                 :          0 :             inline ~FontSwitch( )
      81                 :            :             {
      82                 :          0 :                 m_rDev.Pop( );
      83                 :          0 :             }
      84                 :            :         };
      85                 :            :     }
      86                 :            : 
      87                 :            :     //=========================================================================
      88                 :            :     //= PseudoRubyText
      89                 :            :     //=========================================================================
      90                 :            :     /** a class which allows to draw two texts in a pseudo-ruby way (which basically
      91                 :            :         means one text above or below the other, and a little bit smaller)
      92                 :            :     */
      93         [ #  # ]:          0 :     class PseudoRubyText
      94                 :            :     {
      95                 :            :     public:
      96                 :            :         enum RubyPosition
      97                 :            :         {
      98                 :            :             eAbove, eBelow
      99                 :            :         };
     100                 :            : 
     101                 :            :     protected:
     102                 :            :         const String        m_sPrimaryText;
     103                 :            :         const String        m_sSecondaryText;
     104                 :            :         const RubyPosition  m_ePosition;
     105                 :            : 
     106                 :            :     public:
     107                 :            :         PseudoRubyText( const String& _rPrimary, const String& _rSecondary, const RubyPosition _ePosition );
     108                 :            : 
     109                 :            :     public:
     110                 :            :         void Paint( OutputDevice& _rDevice, const Rectangle& _rRect, sal_uInt16 _nTextStyle,
     111                 :            :             Rectangle* _pPrimaryLocation = NULL, Rectangle* _pSecondaryLocation = NULL,
     112                 :            :             ::vcl::ControlLayoutData* _pLayoutData = NULL );
     113                 :            :     };
     114                 :            : 
     115                 :            :     //-------------------------------------------------------------------------
     116                 :          0 :     PseudoRubyText::PseudoRubyText( const String& _rPrimary, const String& _rSecondary, const RubyPosition _ePosition )
     117                 :            :         :m_sPrimaryText( _rPrimary )
     118                 :            :         ,m_sSecondaryText( _rSecondary )
     119         [ #  # ]:          0 :         ,m_ePosition( _ePosition )
     120                 :            :     {
     121                 :          0 :     }
     122                 :            : 
     123                 :            :     //-------------------------------------------------------------------------
     124                 :          0 :     void PseudoRubyText::Paint( OutputDevice& _rDevice, const Rectangle& _rRect, sal_uInt16 _nTextStyle,
     125                 :            :         Rectangle* _pPrimaryLocation, Rectangle* _pSecondaryLocation, ::vcl::ControlLayoutData* _pLayoutData )
     126                 :            :     {
     127                 :          0 :         bool            bLayoutOnly  = NULL != _pLayoutData;
     128         [ #  # ]:          0 :         MetricVector*   pTextMetrics = bLayoutOnly ? &_pLayoutData->m_aUnicodeBoundRects : NULL;
     129         [ #  # ]:          0 :         String*         pDisplayText = bLayoutOnly ? &_pLayoutData->m_aDisplayText       : NULL;
     130                 :            : 
     131         [ #  # ]:          0 :         Size aPlaygroundSize( _rRect.GetSize() );
     132                 :            : 
     133                 :            :         // the font for the secondary text:
     134         [ #  # ]:          0 :         Font aSmallerFont( _rDevice.GetFont() );
     135                 :            :         // heuristic: 80% of the original size
     136 [ #  # ][ #  # ]:          0 :         aSmallerFont.SetHeight( (long)( 0.8 * aSmallerFont.GetHeight() ) );
     137                 :            : 
     138                 :            :         // let's calculate the size of our two texts
     139         [ #  # ]:          0 :         Rectangle aPrimaryRect = _rDevice.GetTextRect( _rRect, m_sPrimaryText, _nTextStyle );
     140         [ #  # ]:          0 :         Rectangle aSecondaryRect;
     141                 :            :         {
     142         [ #  # ]:          0 :             FontSwitch aFontRestore( _rDevice, aSmallerFont );
     143 [ #  # ][ #  # ]:          0 :             aSecondaryRect = _rDevice.GetTextRect( _rRect, m_sSecondaryText, _nTextStyle );
     144                 :            :         }
     145                 :            : 
     146                 :            :         // position these rectangles properly
     147                 :            :         // x-axis:
     148 [ #  # ][ #  # ]:          0 :         sal_Int32 nCombinedWidth = ::std::max( aSecondaryRect.GetWidth(), aPrimaryRect.GetWidth() );
                 [ #  # ]
     149                 :            :             // the rectangle where both texts will reside is as high as possible, and as wide as the
     150                 :            :             // widest of both text rects
     151                 :          0 :         aPrimaryRect.Left() = aSecondaryRect.Left() = _rRect.Left();
     152                 :          0 :         aPrimaryRect.Right() = aSecondaryRect.Right() = _rRect.Left() + nCombinedWidth;
     153         [ #  # ]:          0 :         if ( TEXT_DRAW_RIGHT & _nTextStyle )
     154                 :            :         {
     155                 :            :             // move the rectangles to the right
     156         [ #  # ]:          0 :             aPrimaryRect.Move( aPlaygroundSize.Width() - nCombinedWidth, 0 );
     157         [ #  # ]:          0 :             aSecondaryRect.Move( aPlaygroundSize.Width() - nCombinedWidth, 0 );
     158                 :            :         }
     159         [ #  # ]:          0 :         else if ( TEXT_DRAW_CENTER & _nTextStyle )
     160                 :            :         {
     161                 :            :             // center the rectangles
     162         [ #  # ]:          0 :             aPrimaryRect.Move( ( aPlaygroundSize.Width() - nCombinedWidth ) / 2, 0 );
     163         [ #  # ]:          0 :             aSecondaryRect.Move( ( aPlaygroundSize.Width() - nCombinedWidth ) / 2, 0 );
     164                 :            :         }
     165                 :            : 
     166                 :            :         // y-axis:
     167 [ #  # ][ #  # ]:          0 :         sal_Int32 nCombinedHeight = aPrimaryRect.GetHeight() + aSecondaryRect.GetHeight();
     168                 :            :         // align to the top, for the moment
     169         [ #  # ]:          0 :         aPrimaryRect.Move( 0, _rRect.Top() - aPrimaryRect.Top() );
     170 [ #  # ][ #  # ]:          0 :         aSecondaryRect.Move( 0, aPrimaryRect.Top() + aPrimaryRect.GetHeight() - aSecondaryRect.Top() );
     171         [ #  # ]:          0 :         if ( TEXT_DRAW_BOTTOM & _nTextStyle )
     172                 :            :         {
     173                 :            :             // move the rects to the bottom
     174         [ #  # ]:          0 :             aPrimaryRect.Move( 0, aPlaygroundSize.Height() - nCombinedHeight );
     175         [ #  # ]:          0 :             aSecondaryRect.Move( 0, aPlaygroundSize.Height() - nCombinedHeight );
     176                 :            :         }
     177         [ #  # ]:          0 :         else if ( TEXT_DRAW_VCENTER & _nTextStyle )
     178                 :            :         {
     179                 :            :             // move the rects to the bottom
     180         [ #  # ]:          0 :             aPrimaryRect.Move( 0, ( aPlaygroundSize.Height() - nCombinedHeight ) / 2 );
     181         [ #  # ]:          0 :             aSecondaryRect.Move( 0, ( aPlaygroundSize.Height() - nCombinedHeight ) / 2 );
     182                 :            :         }
     183                 :            : 
     184                 :            :         // 'til here, everything we did assumes that the secondary text is painted _below_ the primary
     185                 :            :         // text. If this isn't the case, we need to correct the rectangles
     186         [ #  # ]:          0 :         if ( eAbove == m_ePosition )
     187                 :            :         {
     188                 :          0 :             sal_Int32 nVertDistance = aSecondaryRect.Top() - aPrimaryRect.Top();
     189         [ #  # ]:          0 :             aSecondaryRect.Move( 0, -nVertDistance );
     190         [ #  # ]:          0 :             aPrimaryRect.Move( 0, nCombinedHeight - nVertDistance );
     191                 :            :         }
     192                 :            : 
     193                 :            :         // now draw the texts
     194                 :            :         // as we already calculated the precise rectangles for the texts, we don't want to
     195                 :            :         // use the alignment flags given - within it's rect, every text is centered
     196                 :          0 :         sal_uInt16 nDrawTextStyle( _nTextStyle );
     197                 :          0 :         nDrawTextStyle &= ~( TEXT_DRAW_RIGHT | TEXT_DRAW_LEFT | TEXT_DRAW_BOTTOM | TEXT_DRAW_TOP );
     198                 :          0 :         nDrawTextStyle |= TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER;
     199                 :            : 
     200         [ #  # ]:          0 :         _rDevice.DrawText( aPrimaryRect, m_sPrimaryText, nDrawTextStyle, pTextMetrics, pDisplayText );
     201                 :            :         {
     202         [ #  # ]:          0 :             FontSwitch aFontRestore( _rDevice, aSmallerFont );
     203 [ #  # ][ #  # ]:          0 :             _rDevice.DrawText( aSecondaryRect, m_sSecondaryText, nDrawTextStyle, pTextMetrics, pDisplayText );
     204                 :            :         }
     205                 :            : 
     206                 :            :         // outta here
     207         [ #  # ]:          0 :         if ( _pPrimaryLocation )
     208                 :          0 :             *_pPrimaryLocation = aPrimaryRect;
     209         [ #  # ]:          0 :         if ( _pSecondaryLocation )
     210         [ #  # ]:          0 :             *_pSecondaryLocation = aSecondaryRect;
     211                 :          0 :     }
     212                 :            : 
     213                 :            :     //=========================================================================
     214                 :            :     //= RubyRadioButton
     215                 :            :     //=========================================================================
     216 [ #  # ][ #  # ]:          0 :     class RubyRadioButton   :public RadioButton
     217                 :            :                             ,protected PseudoRubyText
     218                 :            :     {
     219                 :            :         using svx::PseudoRubyText::Paint;
     220                 :            : 
     221                 :            :     public:
     222                 :            :         RubyRadioButton(
     223                 :            :             Window* _pParent,
     224                 :            :             const ResId& _rId,          // the text in the resource will be taken as primary text
     225                 :            :             const String& _rSecondary,  // this will be the secondary text which will be printed somewhat smaller
     226                 :            :             const PseudoRubyText::RubyPosition _ePosition );
     227                 :            : 
     228                 :            :     protected:
     229                 :            :         virtual void    Paint( const Rectangle& _rRect );
     230                 :            :     };
     231                 :            : 
     232                 :            :     //-------------------------------------------------------------------------
     233                 :          0 :     RubyRadioButton::RubyRadioButton( Window* _pParent, const ResId& _rId,
     234                 :            :         const String& _rSecondary, const PseudoRubyText::RubyPosition _ePosition )
     235                 :            :         :RadioButton( _pParent, _rId )
     236 [ #  # ][ #  # ]:          0 :         ,PseudoRubyText( RadioButton::GetText(), _rSecondary, _ePosition )
                 [ #  # ]
     237                 :            :     {
     238                 :          0 :     }
     239                 :            : 
     240                 :            :     //-------------------------------------------------------------------------
     241                 :          0 :     void RubyRadioButton::Paint( const Rectangle& )
     242                 :            :     {
     243         [ #  # ]:          0 :         HideFocus();
     244                 :            : 
     245                 :            :         // calculate the size of the radio image - we're to paint our text _after_ this image
     246                 :            :         DBG_ASSERT( !GetModeRadioImage(), "RubyRadioButton::Paint: images not supported!" );
     247 [ #  # ][ #  # ]:          0 :         Size aImageSize = GetRadioImage( GetSettings(), 0 ).GetSizePixel();
                 [ #  # ]
     248         [ #  # ]:          0 :         aImageSize.Width()  = CalcZoom( aImageSize.Width() );
     249         [ #  # ]:          0 :         aImageSize.Height()  = CalcZoom( aImageSize.Height() );
     250                 :            : 
     251         [ #  # ]:          0 :         Rectangle aOverallRect( Point( 0, 0 ), GetOutputSizePixel() );
     252                 :          0 :         aOverallRect.Left() += aImageSize.Width() + 4;  // 4 is the separator between the image and the text
     253                 :            :         // inflate the rect a little bit (because the VCL radio button does the same)
     254                 :          0 :         Rectangle aTextRect( aOverallRect );
     255                 :          0 :         ++aTextRect.Left(); --aTextRect.Right();
     256                 :          0 :         ++aTextRect.Top(); --aTextRect.Bottom();
     257                 :            : 
     258                 :            :         // calculate the text flags for the painting
     259                 :          0 :         sal_uInt16 nTextStyle = TEXT_DRAW_MNEMONIC;
     260         [ #  # ]:          0 :         WinBits nStyle = GetStyle( );
     261                 :            : 
     262                 :            :         // the horizontal alignment
     263         [ #  # ]:          0 :         if ( nStyle & WB_RIGHT )
     264                 :          0 :             nTextStyle |= TEXT_DRAW_RIGHT;
     265         [ #  # ]:          0 :         else if ( nStyle & WB_CENTER )
     266                 :          0 :             nTextStyle |= TEXT_DRAW_CENTER;
     267                 :            :         else
     268                 :          0 :             nTextStyle |= TEXT_DRAW_LEFT;
     269                 :            :         // the vertical alignment
     270         [ #  # ]:          0 :         if ( nStyle & WB_BOTTOM )
     271                 :          0 :             nTextStyle |= TEXT_DRAW_BOTTOM;
     272         [ #  # ]:          0 :         else if ( nStyle & WB_VCENTER )
     273                 :          0 :             nTextStyle |= TEXT_DRAW_VCENTER;
     274                 :            :         else
     275                 :          0 :             nTextStyle |= TEXT_DRAW_TOP;
     276                 :            :         // mnemonics
     277         [ #  # ]:          0 :         if ( 0 == ( nStyle & WB_NOLABEL ) )
     278                 :          0 :             nTextStyle |= TEXT_DRAW_MNEMONIC;
     279                 :            : 
     280                 :            :         // paint the ruby text
     281 [ #  # ][ #  # ]:          0 :         Rectangle aPrimaryTextLocation, aSecondaryTextLocation;
     282         [ #  # ]:          0 :         PseudoRubyText::Paint( *this, aTextRect, nTextStyle, &aPrimaryTextLocation, &aSecondaryTextLocation );
     283                 :            : 
     284                 :            :         // the focus rectangle is to be painted around both texts
     285                 :          0 :         Rectangle aCombinedRect( aPrimaryTextLocation );
     286         [ #  # ]:          0 :         aCombinedRect.Union( aSecondaryTextLocation );
     287         [ #  # ]:          0 :         SetFocusRect( aCombinedRect );
     288                 :            : 
     289                 :            :         // let the base class paint the radio button
     290                 :            :         // for this, give it the proper location to paint the image (vertically centered, relative to our text)
     291         [ #  # ]:          0 :         Rectangle aImageLocation( Point( 0, 0 ), aImageSize );
     292                 :          0 :         sal_Int32 nTextHeight = aSecondaryTextLocation.Bottom() - aPrimaryTextLocation.Top();
     293                 :          0 :         aImageLocation.Top() = aPrimaryTextLocation.Top() + ( nTextHeight - aImageSize.Height() ) / 2;
     294                 :          0 :         aImageLocation.Bottom() = aImageLocation.Top() + aImageSize.Height();
     295                 :          0 :         SetStateRect( aImageLocation );
     296         [ #  # ]:          0 :         DrawRadioButtonState( );
     297                 :            : 
     298                 :            :         // mouse clicks should be recognized in a rect which is one pixel larger in each direction, plus
     299                 :            :         // includes the image
     300                 :          0 :         aCombinedRect.Left() = aImageLocation.Left(); ++aCombinedRect.Right();
     301                 :          0 :         --aCombinedRect.Top(); ++aCombinedRect.Bottom();
     302                 :          0 :         SetMouseRect( aCombinedRect );
     303                 :            : 
     304                 :            :         // paint the focus rect, if necessary
     305 [ #  # ][ #  # ]:          0 :         if ( HasFocus() )
     306         [ #  # ]:          0 :             ShowFocus( aTextRect );
     307                 :          0 :     }
     308                 :            : 
     309                 :            :     //=========================================================================
     310                 :            :     //= SuggestionSet
     311                 :            :     //=========================================================================
     312                 :            :     //-------------------------------------------------------------------------
     313                 :            : 
     314                 :          0 :     SuggestionSet::SuggestionSet( Window* pParent )
     315                 :          0 :                     : ValueSet( pParent, pParent->GetStyle() | WB_BORDER )
     316                 :            : 
     317                 :            :     {
     318                 :          0 :     }
     319                 :            : 
     320                 :          0 :     SuggestionSet::~SuggestionSet()
     321                 :            :     {
     322         [ #  # ]:          0 :         ClearSet();
     323         [ #  # ]:          0 :     }
     324                 :            : 
     325                 :          0 :     void SuggestionSet::UserDraw( const UserDrawEvent& rUDEvt )
     326                 :            :     {
     327                 :          0 :         OutputDevice*  pDev = rUDEvt.GetDevice();
     328                 :          0 :         Rectangle aRect = rUDEvt.GetRect();
     329                 :          0 :         sal_uInt16  nItemId = rUDEvt.GetItemId();
     330                 :            : 
     331 [ #  # ][ #  # ]:          0 :         String sText = *static_cast< String* >( GetItemData( nItemId ) );
     332 [ #  # ][ #  # ]:          0 :         pDev->DrawText( aRect, sText, TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER );
     333                 :          0 :     }
     334                 :            : 
     335                 :          0 :     void SuggestionSet::ClearSet()
     336                 :            :     {
     337                 :          0 :         sal_uInt16 i, nCount = GetItemCount();
     338         [ #  # ]:          0 :         for ( i = 0; i < nCount; ++i )
     339         [ #  # ]:          0 :             delete static_cast< String* >( GetItemData(i) );
     340                 :          0 :         Clear();
     341                 :          0 :     }
     342                 :            : 
     343                 :            :     //=========================================================================
     344                 :            :     //= SuggestionDisplay
     345                 :            :     //=========================================================================
     346                 :            :     //-------------------------------------------------------------------------
     347                 :            : 
     348                 :          0 :     SuggestionDisplay::SuggestionDisplay( Window* pParent, const ResId& rResId )
     349                 :            :         : Control( pParent, rResId )
     350                 :            :         , m_bDisplayListBox(true)
     351                 :            :         , m_aValueSet(this)
     352         [ #  # ]:          0 :         , m_aListBox(this,GetStyle() | WB_BORDER )
     353 [ #  # ][ #  # ]:          0 :         , m_bInSelectionUpdate(false)
                 [ #  # ]
     354                 :            :     {
     355         [ #  # ]:          0 :         m_aValueSet.SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionHdl ) );
     356         [ #  # ]:          0 :         m_aListBox.SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionHdl ) );
     357                 :            : 
     358         [ #  # ]:          0 :         m_aValueSet.SetLineCount( LINE_CNT );
     359 [ #  # ][ #  # ]:          0 :         m_aValueSet.SetStyle( m_aValueSet.GetStyle() | WB_ITEMBORDER | WB_FLATVALUESET | WB_VSCROLL );
     360         [ #  # ]:          0 :         m_aValueSet.SetBorderStyle( WINDOW_BORDER_MONO );
     361         [ #  # ]:          0 :         String aOneCharacter(RTL_CONSTASCII_USTRINGPARAM("AU"));
     362         [ #  # ]:          0 :         long nItemWidth = 2*GetTextWidth( aOneCharacter );
     363         [ #  # ]:          0 :         m_aValueSet.SetItemWidth( nItemWidth );
     364                 :            : 
     365                 :          0 :         Point aPos(0,0);
     366         [ #  # ]:          0 :         Size aSize(GetSizePixel());
     367         [ #  # ]:          0 :         m_aValueSet.SetSizePixel(aSize);
     368         [ #  # ]:          0 :         m_aListBox.SetSizePixel(aSize);
     369                 :            : 
     370 [ #  # ][ #  # ]:          0 :         implUpdateDisplay();
     371                 :          0 :     }
     372                 :            : 
     373 [ #  # ][ #  # ]:          0 :     SuggestionDisplay::~SuggestionDisplay()
     374                 :            :     {
     375         [ #  # ]:          0 :     }
     376                 :            : 
     377                 :          0 :     void SuggestionDisplay::implUpdateDisplay()
     378                 :            :     {
     379 [ #  # ][ #  # ]:          0 :         bool bShowBox = IsVisible() && m_bDisplayListBox;
     380 [ #  # ][ #  # ]:          0 :         bool bShowSet = IsVisible() && !m_bDisplayListBox;
     381                 :            : 
     382                 :          0 :         m_aListBox.Show(bShowBox);
     383                 :          0 :         m_aValueSet.Show(bShowSet);
     384                 :          0 :     }
     385                 :            : 
     386                 :          0 :     void SuggestionDisplay::StateChanged( StateChangedType nStateChange )
     387                 :            :     {
     388         [ #  # ]:          0 :         if( STATE_CHANGE_VISIBLE == nStateChange )
     389                 :          0 :             implUpdateDisplay();
     390                 :          0 :     }
     391                 :            : 
     392                 :          0 :     Control& SuggestionDisplay::implGetCurrentControl()
     393                 :            :     {
     394         [ #  # ]:          0 :         if( m_bDisplayListBox )
     395                 :          0 :             return m_aListBox;
     396                 :          0 :         return m_aValueSet;
     397                 :            :     }
     398                 :            : 
     399                 :          0 :     void SuggestionDisplay::KeyInput( const KeyEvent& rKEvt )
     400                 :            :     {
     401                 :          0 :         implGetCurrentControl().KeyInput( rKEvt );
     402                 :          0 :     }
     403                 :          0 :     void SuggestionDisplay::KeyUp( const KeyEvent& rKEvt )
     404                 :            :     {
     405                 :          0 :         implGetCurrentControl().KeyUp( rKEvt );
     406                 :          0 :     }
     407                 :          0 :     void SuggestionDisplay::Activate()
     408                 :            :     {
     409                 :          0 :         implGetCurrentControl().Activate();
     410                 :          0 :     }
     411                 :          0 :     void SuggestionDisplay::Deactivate()
     412                 :            :     {
     413                 :          0 :         implGetCurrentControl().Deactivate();
     414                 :          0 :     }
     415                 :          0 :     void SuggestionDisplay::GetFocus()
     416                 :            :     {
     417                 :          0 :         implGetCurrentControl().GetFocus();
     418                 :          0 :     }
     419                 :          0 :     void SuggestionDisplay::LoseFocus()
     420                 :            :     {
     421                 :          0 :         implGetCurrentControl().LoseFocus();
     422                 :          0 :     }
     423                 :          0 :     void SuggestionDisplay::Command( const CommandEvent& rCEvt )
     424                 :            :     {
     425                 :          0 :         implGetCurrentControl().Command( rCEvt );
     426                 :          0 :     }
     427                 :            : 
     428                 :          0 :     void SuggestionDisplay::DisplayListBox( bool bDisplayListBox )
     429                 :            :     {
     430         [ #  # ]:          0 :         if( m_bDisplayListBox != bDisplayListBox )
     431                 :            :         {
     432                 :          0 :             Control& rOldControl = implGetCurrentControl();
     433                 :          0 :             sal_Bool bHasFocus = rOldControl.HasFocus();
     434                 :            : 
     435                 :          0 :             m_bDisplayListBox = bDisplayListBox;
     436                 :            : 
     437         [ #  # ]:          0 :             if( bHasFocus )
     438                 :            :             {
     439                 :          0 :                 Control& rNewControl = implGetCurrentControl();
     440                 :          0 :                 rNewControl.GrabFocus();
     441                 :            :             }
     442                 :            : 
     443                 :          0 :             implUpdateDisplay();
     444                 :            :         }
     445                 :          0 :     }
     446                 :            : 
     447                 :          0 :     IMPL_LINK( SuggestionDisplay, SelectSuggestionHdl, Control*, pControl )
     448                 :            :     {
     449         [ #  # ]:          0 :         if( m_bInSelectionUpdate )
     450                 :          0 :             return 0L;
     451                 :            : 
     452                 :          0 :         m_bInSelectionUpdate = true;
     453         [ #  # ]:          0 :         if(pControl==&m_aListBox)
     454                 :            :         {
     455                 :          0 :             sal_uInt16 nPos = m_aListBox.GetSelectEntryPos();
     456                 :          0 :             m_aValueSet.SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
     457                 :            :         }
     458                 :            :         else
     459                 :            :         {
     460                 :          0 :             sal_uInt16 nPos = m_aValueSet.GetSelectItemId()-1; //itemid == pos+1 (id 0 has special meaning)
     461                 :          0 :             m_aListBox.SelectEntryPos( nPos );
     462                 :            :         }
     463                 :          0 :         m_bInSelectionUpdate = false;
     464                 :          0 :         m_aSelectLink.Call(this);
     465                 :          0 :         return 0L;
     466                 :            :     }
     467                 :            : 
     468                 :          0 :     void SuggestionDisplay::SetSelectHdl( const Link& rLink )
     469                 :            :     {
     470                 :          0 :         m_aSelectLink = rLink;
     471                 :          0 :     }
     472                 :          0 :     void SuggestionDisplay::Clear()
     473                 :            :     {
     474                 :          0 :         m_aListBox.Clear();
     475                 :          0 :         m_aValueSet.Clear();
     476                 :          0 :     }
     477                 :          0 :     void SuggestionDisplay::InsertEntry( const XubString& rStr )
     478                 :            :     {
     479                 :          0 :         sal_uInt16 nItemId = m_aListBox.InsertEntry( rStr ) + 1; //itemid == pos+1 (id 0 has special meaning)
     480                 :          0 :         m_aValueSet.InsertItem( nItemId );
     481         [ #  # ]:          0 :         String* pItemData = new String(rStr);
     482                 :          0 :         m_aValueSet.SetItemData( nItemId, pItemData );
     483                 :          0 :     }
     484                 :          0 :     void SuggestionDisplay::SelectEntryPos( sal_uInt16 nPos )
     485                 :            :     {
     486                 :          0 :         m_aListBox.SelectEntryPos( nPos );
     487                 :          0 :         m_aValueSet.SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
     488                 :          0 :     }
     489                 :          0 :     sal_uInt16 SuggestionDisplay::GetEntryCount() const
     490                 :            :     {
     491                 :          0 :         return m_aListBox.GetEntryCount();
     492                 :            :     }
     493                 :          0 :     XubString SuggestionDisplay::GetEntry( sal_uInt16 nPos ) const
     494                 :            :     {
     495                 :          0 :         return m_aListBox.GetEntry( nPos );
     496                 :            :     }
     497                 :          0 :     XubString SuggestionDisplay::GetSelectEntry() const
     498                 :            :     {
     499                 :          0 :         return m_aListBox.GetSelectEntry();
     500                 :            :     }
     501                 :          0 :     void SuggestionDisplay::SetHelpIds()
     502                 :            :     {
     503         [ #  # ]:          0 :         this->SetHelpId( HID_HANGULDLG_SUGGESTIONS );
     504         [ #  # ]:          0 :         m_aValueSet.SetHelpId( HID_HANGULDLG_SUGGESTIONS_GRID );
     505         [ #  # ]:          0 :         m_aListBox.SetHelpId( HID_HANGULDLG_SUGGESTIONS_LIST );
     506                 :          0 :     }
     507                 :            : 
     508                 :            :     //=========================================================================
     509                 :            :     //= HangulHanjaConversionDialog
     510                 :            :     //=========================================================================
     511                 :            :     //-------------------------------------------------------------------------
     512                 :          0 :     HangulHanjaConversionDialog::HangulHanjaConversionDialog( Window* _pParent, HHC::ConversionDirection _ePrimaryDirection )
     513                 :          0 :         :ModalDialog( _pParent, CUI_RES( RID_SVX_MDLG_HANGULHANJA ) )
     514         [ #  # ]:          0 :         ,m_pPlayground( new SvxCommonLinguisticControl( this ) )
     515         [ #  # ]:          0 :         ,m_aFind            ( m_pPlayground.get(), CUI_RES( PB_FIND ) )
     516         [ #  # ]:          0 :         ,m_aSuggestions     ( m_pPlayground.get(), CUI_RES( CTL_SUGGESTIONS ) )
     517         [ #  # ]:          0 :         ,m_aFormat          ( m_pPlayground.get(), CUI_RES( FT_FORMAT ) )
     518         [ #  # ]:          0 :         ,m_aSimpleConversion( m_pPlayground.get(), CUI_RES( RB_SIMPLE_CONVERSION ) )
     519         [ #  # ]:          0 :         ,m_aHangulBracketed ( m_pPlayground.get(), CUI_RES( RB_HANJA_HANGUL_BRACKETED ) )
     520         [ #  # ]:          0 :         ,m_aHanjaBracketed  ( m_pPlayground.get(), CUI_RES( RB_HANGUL_HANJA_BRACKETED ) )
     521         [ #  # ]:          0 :         ,m_aConversion      ( m_pPlayground.get(), CUI_RES( FT_CONVERSION ) )
     522         [ #  # ]:          0 :         ,m_aHangulOnly      ( m_pPlayground.get(), CUI_RES( CB_HANGUL_ONLY ) )
     523         [ #  # ]:          0 :         ,m_aHanjaOnly       ( m_pPlayground.get(), CUI_RES( CB_HANJA_ONLY ) )
     524         [ #  # ]:          0 :         ,m_aReplaceByChar   ( m_pPlayground.get(), CUI_RES( CB_REPLACE_BY_CHARACTER ) )
     525                 :            :         ,m_pIgnoreNonPrimary( NULL )
     526 [ #  # ][ #  # ]:          0 :         ,m_bDocumentMode( true )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     527                 :            :     {
     528                 :            :         // special creation of the 4 pseudo-ruby radio buttons
     529 [ #  # ][ #  # ]:          0 :         String sSecondaryHangul( CUI_RES( STR_HANGUL ) );
     530 [ #  # ][ #  # ]:          0 :         String sSecondaryHanja( CUI_RES( STR_HANJA ) );
     531 [ #  # ][ #  # ]:          0 :         m_pHanjaAbove.reset( new RubyRadioButton( m_pPlayground.get(), CUI_RES( RB_HANGUL_HANJA_ABOVE ), sSecondaryHanja, PseudoRubyText::eAbove ) );
                 [ #  # ]
     532 [ #  # ][ #  # ]:          0 :         m_pHanjaBelow.reset( new RubyRadioButton( m_pPlayground.get(), CUI_RES( RB_HANGUL_HANJA_BELOW ), sSecondaryHanja, PseudoRubyText::eBelow ) );
                 [ #  # ]
     533 [ #  # ][ #  # ]:          0 :         m_pHangulAbove.reset( new RubyRadioButton( m_pPlayground.get(), CUI_RES( RB_HANJA_HANGUL_ABOVE ), sSecondaryHangul, PseudoRubyText::eAbove ) );
                 [ #  # ]
     534 [ #  # ][ #  # ]:          0 :         m_pHangulBelow.reset( new RubyRadioButton( m_pPlayground.get(), CUI_RES( RB_HANJA_HANGUL_BELOW ), sSecondaryHangul, PseudoRubyText::eBelow ) );
                 [ #  # ]
     535                 :            : 
     536                 :            :         // since these 4 buttons are not created within the other members, they have a wrong initial Z-Order
     537                 :            :         // correct this
     538         [ #  # ]:          0 :         m_pHanjaAbove->SetZOrder( &m_aHanjaBracketed, WINDOW_ZORDER_BEHIND );
     539         [ #  # ]:          0 :         m_pHanjaBelow->SetZOrder( m_pHanjaAbove.get(), WINDOW_ZORDER_BEHIND );
     540         [ #  # ]:          0 :         m_pHangulAbove->SetZOrder( m_pHanjaBelow.get(), WINDOW_ZORDER_BEHIND );
     541         [ #  # ]:          0 :         m_pHangulBelow->SetZOrder( m_pHangulAbove.get(), WINDOW_ZORDER_BEHIND );
     542                 :            : 
     543                 :            :         // VCL automatically sets the WB_GROUP bit, if the previous sibling (at the moment of creation)
     544                 :            :         // is no radion button
     545 [ #  # ][ #  # ]:          0 :         m_pHanjaAbove->SetStyle( m_pHanjaAbove->GetStyle() & ~WB_GROUP );
     546                 :            : 
     547                 :            :         // the "Find" button and the word input control may not have the proper distance/extensions
     548                 :            :         // -> correct this
     549 [ #  # ][ #  # ]:          0 :         Point aDistance = LogicToPixel( Point( 3, 0 ), MAP_APPFONT );
                 [ #  # ]
     550                 :            :         sal_Int32 nTooLargeByPixels =
     551                 :            :             // right margin of the word input control
     552         [ #  # ]:          0 :             (   m_pPlayground->GetWordInputControl().GetPosPixel().X()
     553         [ #  # ]:          0 :             +   m_pPlayground->GetWordInputControl().GetSizePixel().Width()
     554                 :            :             )
     555                 :            :             // minus left margin of the find button
     556         [ #  # ]:          0 :             -   m_aFind.GetPosPixel().X()
     557                 :            :             // plus desired distance between the both
     558                 :          0 :             +   aDistance.X();
     559                 :            :         // make the word input control smaller
     560         [ #  # ]:          0 :         Size aSize = m_pPlayground->GetWordInputControl().GetSizePixel();
     561                 :          0 :         aSize.Width() -= nTooLargeByPixels;
     562         [ #  # ]:          0 :         m_pPlayground->GetWordInputControl().SetSizePixel( aSize );
     563                 :            : 
     564                 :            :         // additionall, the playground is not wide enough (in it's default size)
     565                 :          0 :         sal_Int32 nEnlargeWidth = 0;
     566                 :            :         {
     567 [ #  # ][ #  # ]:          0 :             FixedText aBottomAnchor( m_pPlayground.get(), CUI_RES( FT_RESIZE_ANCHOR ) );
     568         [ #  # ]:          0 :             Point aAnchorPos = aBottomAnchor.GetPosPixel();
     569                 :            : 
     570 [ #  # ][ #  # ]:          0 :             nEnlargeWidth = aAnchorPos.X() - m_pPlayground->GetActionButtonsLocation().X();
     571                 :            :         }
     572         [ #  # ]:          0 :         m_pPlayground->Enlarge( nEnlargeWidth, 0 );
     573                 :            : 
     574                 :            :         // insert our controls into the z-order of the playground
     575         [ #  # ]:          0 :         m_pPlayground->InsertControlGroup( m_aFind, m_aFind, SvxCommonLinguisticControl::eLeftRightWords );
     576         [ #  # ]:          0 :         m_pPlayground->InsertControlGroup( m_aSuggestions, m_aHanjaOnly, SvxCommonLinguisticControl::eSuggestionLabel );
     577         [ #  # ]:          0 :         m_pPlayground->InsertControlGroup( m_aReplaceByChar, m_aReplaceByChar, SvxCommonLinguisticControl::eActionButtons );
     578                 :            : 
     579 [ #  # ][ #  # ]:          0 :         m_pPlayground->SetButtonHandler( SvxCommonLinguisticControl::eClose, LINK( this, HangulHanjaConversionDialog, OnClose ) );
     580 [ #  # ][ #  # ]:          0 :         m_pPlayground->GetWordInputControl().SetModifyHdl( LINK( this,  HangulHanjaConversionDialog, OnSuggestionModified ) );
     581         [ #  # ]:          0 :         m_aSuggestions.SetSelectHdl( LINK( this,  HangulHanjaConversionDialog, OnSuggestionSelected ) );
     582                 :            : 
     583         [ #  # ]:          0 :         m_aReplaceByChar.SetClickHdl( LINK( this, HangulHanjaConversionDialog, ClickByCharacterHdl ) );
     584                 :            : 
     585         [ #  # ]:          0 :         m_aHangulOnly.SetClickHdl( LINK( this,  HangulHanjaConversionDialog, OnConversionDirectionClicked ) );
     586         [ #  # ]:          0 :         m_aHanjaOnly.SetClickHdl(  LINK( this,  HangulHanjaConversionDialog, OnConversionDirectionClicked ) );
     587                 :            : 
     588                 :            :         m_pPlayground->SetButtonHandler( SvxCommonLinguisticControl::eOptions,
     589 [ #  # ][ #  # ]:          0 :                                         LINK( this, HangulHanjaConversionDialog, OnOption ) );
     590 [ #  # ][ #  # ]:          0 :         m_pPlayground->GetButton( SvxCommonLinguisticControl::eOptions )->Show();
     591                 :            : 
     592         [ #  # ]:          0 :         if ( editeng::HangulHanjaConversion::eHangulToHanja == _ePrimaryDirection )
     593                 :            :         {
     594                 :          0 :             m_pIgnoreNonPrimary = &m_aHangulOnly;
     595                 :            :         }
     596                 :            :         else
     597                 :            :         {
     598                 :          0 :             m_pIgnoreNonPrimary = &m_aHanjaOnly;
     599                 :            :         }
     600                 :            : 
     601                 :            :         // initial focus
     602         [ #  # ]:          0 :         FocusSuggestion( );
     603                 :            : 
     604                 :            :         // initial control values
     605         [ #  # ]:          0 :         m_aSimpleConversion.Check();
     606                 :            : 
     607 [ #  # ][ #  # ]:          0 :         m_pPlayground->GetButton(SvxCommonLinguisticControl::eClose     )->SetHelpId(HID_HANGULDLG_BUTTON_CLOSE    );
     608 [ #  # ][ #  # ]:          0 :         m_pPlayground->GetButton(SvxCommonLinguisticControl::eIgnore    )->SetHelpId(HID_HANGULDLG_BUTTON_IGNORE   );
     609 [ #  # ][ #  # ]:          0 :         m_pPlayground->GetButton(SvxCommonLinguisticControl::eIgnoreAll )->SetHelpId(HID_HANGULDLG_BUTTON_IGNOREALL);
     610 [ #  # ][ #  # ]:          0 :         m_pPlayground->GetButton(SvxCommonLinguisticControl::eChange    )->SetHelpId(HID_HANGULDLG_BUTTON_CHANGE   );
     611 [ #  # ][ #  # ]:          0 :         m_pPlayground->GetButton(SvxCommonLinguisticControl::eChangeAll )->SetHelpId(HID_HANGULDLG_BUTTON_CHANGEALL);
     612 [ #  # ][ #  # ]:          0 :         m_pPlayground->GetButton(SvxCommonLinguisticControl::eOptions   )->SetHelpId(HID_HANGULDLG_BUTTON_OPTIONS  );
     613         [ #  # ]:          0 :         m_pPlayground->GetWordInputControl().SetHelpId(HID_HANGULDLG_EDIT_NEWWORD);
     614                 :            : 
     615         [ #  # ]:          0 :         FreeResource();
     616                 :            : 
     617 [ #  # ][ #  # ]:          0 :         m_aSuggestions.SetHelpIds();
                 [ #  # ]
     618                 :          0 :     }
     619                 :            : 
     620                 :            :     //-------------------------------------------------------------------------
     621 [ #  # ][ #  # ]:          0 :     HangulHanjaConversionDialog::~HangulHanjaConversionDialog( )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     622                 :            :     {
     623         [ #  # ]:          0 :     }
     624                 :            : 
     625                 :            :     //-------------------------------------------------------------------------
     626                 :          0 :     void HangulHanjaConversionDialog::FillSuggestions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rSuggestions )
     627                 :            :     {
     628         [ #  # ]:          0 :         m_aSuggestions.Clear();
     629                 :            : 
     630                 :          0 :         const ::rtl::OUString* pSuggestions = _rSuggestions.getConstArray();
     631                 :          0 :         const ::rtl::OUString* pSuggestionsEnd = _rSuggestions.getConstArray() + _rSuggestions.getLength();
     632         [ #  # ]:          0 :         while ( pSuggestions != pSuggestionsEnd )
     633 [ #  # ][ #  # ]:          0 :             m_aSuggestions.InsertEntry( *pSuggestions++ );
                 [ #  # ]
     634                 :            : 
     635                 :            :         // select the first suggestion, and fill in the suggestion edit field
     636         [ #  # ]:          0 :         String sFirstSuggestion;
     637 [ #  # ][ #  # ]:          0 :         if ( m_aSuggestions.GetEntryCount() )
     638                 :            :         {
     639 [ #  # ][ #  # ]:          0 :             sFirstSuggestion = m_aSuggestions.GetEntry( 0 );
                 [ #  # ]
     640         [ #  # ]:          0 :             m_aSuggestions.SelectEntryPos( 0 );
     641                 :            :         }
     642         [ #  # ]:          0 :         m_pPlayground->GetWordInputControl().SetText( sFirstSuggestion );
     643         [ #  # ]:          0 :         m_pPlayground->GetWordInputControl().SaveValue();
     644 [ #  # ][ #  # ]:          0 :         OnSuggestionModified( &m_pPlayground->GetWordInputControl() );
     645                 :          0 :     }
     646                 :            : 
     647                 :            :     //-------------------------------------------------------------------------
     648                 :          0 :     void HangulHanjaConversionDialog::SetOptionsChangedHdl( const Link& _rHdl )
     649                 :            :     {
     650                 :          0 :         m_aOptionsChangedLink = _rHdl;
     651                 :          0 :     }
     652                 :            : 
     653                 :            :     //-------------------------------------------------------------------------
     654                 :          0 :     void HangulHanjaConversionDialog::SetIgnoreHdl( const Link& _rHdl )
     655                 :            :     {
     656                 :          0 :         m_pPlayground->SetButtonHandler( SvxCommonLinguisticControl::eIgnore, _rHdl );
     657                 :          0 :     }
     658                 :            : 
     659                 :            :     //-------------------------------------------------------------------------
     660                 :          0 :     void HangulHanjaConversionDialog::SetIgnoreAllHdl( const Link& _rHdl )
     661                 :            :     {
     662                 :          0 :         m_pPlayground->SetButtonHandler( SvxCommonLinguisticControl::eIgnoreAll, _rHdl );
     663                 :          0 :     }
     664                 :            : 
     665                 :            :     //-------------------------------------------------------------------------
     666                 :          0 :     void HangulHanjaConversionDialog::SetChangeHdl( const Link& _rHdl )
     667                 :            :     {
     668                 :          0 :         m_pPlayground->SetButtonHandler( SvxCommonLinguisticControl::eChange, _rHdl );
     669                 :          0 :     }
     670                 :            : 
     671                 :            :     //-------------------------------------------------------------------------
     672                 :          0 :     void HangulHanjaConversionDialog::SetChangeAllHdl( const Link& _rHdl )
     673                 :            :     {
     674                 :          0 :         m_pPlayground->SetButtonHandler( SvxCommonLinguisticControl::eChangeAll, _rHdl );
     675                 :          0 :     }
     676                 :            : 
     677                 :            :     //-------------------------------------------------------------------------
     678                 :          0 :     void HangulHanjaConversionDialog::SetFindHdl( const Link& _rHdl )
     679                 :            :     {
     680                 :          0 :         m_aFind.SetClickHdl( _rHdl );
     681                 :          0 :     }
     682                 :            : 
     683                 :            :     //-------------------------------------------------------------------------
     684                 :          0 :     void HangulHanjaConversionDialog::SetConversionFormatChangedHdl( const Link& _rHdl )
     685                 :            :     {
     686                 :          0 :         m_aSimpleConversion.SetClickHdl( _rHdl );
     687                 :          0 :         m_aHangulBracketed.SetClickHdl( _rHdl );
     688                 :          0 :         m_aHanjaBracketed.SetClickHdl( _rHdl );
     689                 :          0 :         m_pHanjaAbove->SetClickHdl( _rHdl );
     690                 :          0 :         m_pHanjaBelow->SetClickHdl( _rHdl );
     691                 :          0 :         m_pHangulAbove->SetClickHdl( _rHdl );
     692                 :          0 :         m_pHangulBelow->SetClickHdl( _rHdl );
     693                 :          0 :     }
     694                 :            : 
     695                 :            :     //-------------------------------------------------------------------------
     696                 :          0 :     void HangulHanjaConversionDialog::SetClickByCharacterHdl( const Link& _rHdl )
     697                 :            :     {
     698                 :          0 :         m_aClickByCharacterLink = _rHdl;
     699                 :          0 :     }
     700                 :            : 
     701                 :            :     //-------------------------------------------------------------------------
     702                 :          0 :     IMPL_LINK_NOARG(HangulHanjaConversionDialog, OnSuggestionSelected)
     703                 :            :     {
     704         [ #  # ]:          0 :         m_pPlayground->GetWordInputControl().SetText( m_aSuggestions.GetSelectEntry() );
     705                 :          0 :         OnSuggestionModified( NULL );
     706                 :          0 :         return 0L;
     707                 :            :     }
     708                 :            : 
     709                 :            :     //-------------------------------------------------------------------------
     710                 :          0 :     IMPL_LINK_NOARG(HangulHanjaConversionDialog, OnSuggestionModified)
     711                 :            :     {
     712 [ #  # ][ #  # ]:          0 :         m_aFind.Enable( m_pPlayground->GetWordInputControl().GetSavedValue() != m_pPlayground->GetWordInputControl().GetText() );
     713                 :            : 
     714 [ #  # ][ #  # ]:          0 :         bool bSameLen = m_pPlayground->GetWordInputControl().GetText().Len() == m_pPlayground->GetCurrentText().Len();
     715 [ #  # ][ #  # ]:          0 :         m_pPlayground->EnableButton( SvxCommonLinguisticControl::eChange, m_bDocumentMode && bSameLen );
     716 [ #  # ][ #  # ]:          0 :         m_pPlayground->EnableButton( SvxCommonLinguisticControl::eChangeAll, m_bDocumentMode && bSameLen );
     717                 :            : 
     718                 :          0 :         return 0L;
     719                 :            :     }
     720                 :            : 
     721                 :            :     //-------------------------------------------------------------------------
     722                 :          0 :     IMPL_LINK( HangulHanjaConversionDialog, ClickByCharacterHdl, CheckBox *, pBox )
     723                 :            :     {
     724                 :          0 :         m_aClickByCharacterLink.Call(pBox);
     725                 :            : 
     726                 :          0 :         bool bByCharacter = pBox->IsChecked();
     727                 :          0 :         m_aSuggestions.DisplayListBox( !bByCharacter );
     728                 :            : 
     729                 :          0 :         return 0L;
     730                 :            :     }
     731                 :            : 
     732                 :            :     //-------------------------------------------------------------------------
     733                 :          0 :     IMPL_LINK( HangulHanjaConversionDialog, OnConversionDirectionClicked, CheckBox *, pBox )
     734                 :            :     {
     735                 :          0 :         CheckBox *pOtherBox = 0;
     736         [ #  # ]:          0 :         if (pBox == &m_aHangulOnly)
     737                 :          0 :             pOtherBox = &m_aHanjaOnly;
     738         [ #  # ]:          0 :         else if (pBox == &m_aHanjaOnly)
     739                 :          0 :             pOtherBox = &m_aHangulOnly;
     740 [ #  # ][ #  # ]:          0 :         if (pBox && pOtherBox)
     741                 :            :         {
     742                 :          0 :             sal_Bool bBoxChecked = pBox->IsChecked();
     743         [ #  # ]:          0 :             if (bBoxChecked)
     744                 :          0 :                 pOtherBox->Check( sal_False );
     745                 :          0 :             pOtherBox->Enable( !bBoxChecked );
     746                 :            :         }
     747                 :            : 
     748                 :          0 :         return 0L;
     749                 :            :     }
     750                 :            : 
     751                 :            :     //-------------------------------------------------------------------------
     752                 :          0 :     IMPL_LINK_NOARG(HangulHanjaConversionDialog, OnClose)
     753                 :            :     {
     754                 :          0 :         Close();
     755                 :          0 :         return 0L;
     756                 :            :     }
     757                 :            : 
     758                 :          0 :     IMPL_LINK_NOARG(HangulHanjaConversionDialog, OnOption)
     759                 :            :     {
     760         [ #  # ]:          0 :         HangulHanjaOptionsDialog        aOptDlg( this );
     761         [ #  # ]:          0 :         aOptDlg.Execute();
     762         [ #  # ]:          0 :         m_aOptionsChangedLink.Call(this);
     763         [ #  # ]:          0 :         return 0L;
     764                 :            :     }
     765                 :            : 
     766                 :            :     //-------------------------------------------------------------------------
     767                 :          0 :     String HangulHanjaConversionDialog::GetCurrentString( ) const
     768                 :            :     {
     769                 :          0 :         return m_pPlayground->GetCurrentText( );
     770                 :            :     }
     771                 :            : 
     772                 :            :     //-------------------------------------------------------------------------
     773                 :          0 :     void HangulHanjaConversionDialog::FocusSuggestion( )
     774                 :            :     {
     775                 :          0 :         m_pPlayground->GetWordInputControl().GrabFocus();
     776                 :          0 :     }
     777                 :            : 
     778                 :            :     //-------------------------------------------------------------------------
     779                 :            :     namespace
     780                 :            :     {
     781                 :          0 :         void lcl_modifyWindowStyle( Window* _pWin, WinBits _nSet, WinBits _nReset )
     782                 :            :         {
     783                 :            :             DBG_ASSERT( 0 == ( _nSet & _nReset ), "lcl_modifyWindowStyle: set _and_ reset the same bit?" );
     784         [ #  # ]:          0 :             if ( _pWin )
     785                 :          0 :                 _pWin->SetStyle( ( _pWin->GetStyle() | _nSet ) & ~_nReset );
     786                 :          0 :         }
     787                 :            :     }
     788                 :            : 
     789                 :            :     //-------------------------------------------------------------------------
     790                 :          0 :     void HangulHanjaConversionDialog::SetCurrentString( const String& _rNewString,
     791                 :            :         const Sequence< ::rtl::OUString >& _rSuggestions, bool _bOriginatesFromDocument )
     792                 :            :     {
     793                 :          0 :         m_pPlayground->SetCurrentText( _rNewString );
     794                 :            : 
     795                 :          0 :         bool bOldDocumentMode = m_bDocumentMode;
     796                 :          0 :         m_bDocumentMode = _bOriginatesFromDocument; // before FillSuggestions!
     797                 :          0 :         FillSuggestions( _rSuggestions );
     798                 :            : 
     799                 :          0 :         m_pPlayground->EnableButton( SvxCommonLinguisticControl::eIgnoreAll, m_bDocumentMode );
     800                 :            :             // all other buttons have been implicitly enabled or disabled during filling in the suggestions
     801                 :            : 
     802                 :            :         // switch the def button depending if we're working for document text
     803         [ #  # ]:          0 :         if ( bOldDocumentMode != m_bDocumentMode )
     804                 :            :         {
     805                 :          0 :             Window* pOldDefButton = NULL;
     806                 :          0 :             Window* pNewDefButton = NULL;
     807         [ #  # ]:          0 :             if ( m_bDocumentMode )
     808                 :            :             {
     809                 :          0 :                 pOldDefButton = &m_aFind;
     810                 :          0 :                 pNewDefButton = m_pPlayground->GetButton( SvxCommonLinguisticControl::eChange );
     811                 :            :             }
     812                 :            :             else
     813                 :            :             {
     814                 :          0 :                 pOldDefButton = m_pPlayground->GetButton( SvxCommonLinguisticControl::eChange );
     815                 :          0 :                 pNewDefButton = &m_aFind;
     816                 :            :             }
     817                 :            : 
     818                 :            :             DBG_ASSERT( WB_DEFBUTTON == ( pOldDefButton->GetStyle( ) & WB_DEFBUTTON ),
     819                 :            :                 "HangulHanjaConversionDialog::SetCurrentString: wrong previous default button (1)!" );
     820                 :            :             DBG_ASSERT( 0 == ( pNewDefButton->GetStyle( ) & WB_DEFBUTTON ),
     821                 :            :                 "HangulHanjaConversionDialog::SetCurrentString: wrong previous default button (2)!" );
     822                 :            : 
     823                 :          0 :             lcl_modifyWindowStyle( pOldDefButton, 0, WB_DEFBUTTON );
     824                 :          0 :             lcl_modifyWindowStyle( pNewDefButton, WB_DEFBUTTON, 0 );
     825                 :            : 
     826                 :            :             // give the focus to the new def button temporarily - VCL is somewhat peculiar
     827                 :            :             // in recognizing a new default button
     828                 :          0 :             sal_uInt32 nSaveFocusId = Window::SaveFocus();
     829                 :          0 :             pNewDefButton->GrabFocus();
     830                 :          0 :             Window::EndSaveFocus( nSaveFocusId );
     831                 :            :         }
     832                 :          0 :     }
     833                 :            : 
     834                 :            :     //-------------------------------------------------------------------------
     835                 :          0 :     String HangulHanjaConversionDialog::GetCurrentSuggestion( ) const
     836                 :            :     {
     837                 :          0 :         return m_pPlayground->GetWordInputControl().GetText();
     838                 :            :     }
     839                 :            : 
     840                 :            :     //-------------------------------------------------------------------------
     841                 :          0 :     void HangulHanjaConversionDialog::SetByCharacter( sal_Bool _bByCharacter )
     842                 :            :     {
     843                 :          0 :         m_aReplaceByChar.Check( _bByCharacter );
     844                 :          0 :         m_aSuggestions.DisplayListBox( !_bByCharacter );
     845                 :          0 :     }
     846                 :            : 
     847                 :            :     //-------------------------------------------------------------------------
     848                 :          0 :     void HangulHanjaConversionDialog::SetConversionDirectionState(
     849                 :            :             sal_Bool _bTryBothDirections,
     850                 :            :             HHC::ConversionDirection _ePrimaryConversionDirection )
     851                 :            :     {
     852                 :            :         // default state: try both direction
     853                 :          0 :         m_aHangulOnly.Check( sal_False );
     854                 :          0 :         m_aHangulOnly.Enable( sal_True );
     855                 :          0 :         m_aHanjaOnly.Check( sal_False );
     856                 :          0 :         m_aHanjaOnly.Enable( sal_True );
     857                 :            : 
     858         [ #  # ]:          0 :         if (!_bTryBothDirections)
     859                 :            :         {
     860                 :            :             CheckBox *pBox = _ePrimaryConversionDirection == HHC::eHangulToHanja?
     861         [ #  # ]:          0 :                                     &m_aHangulOnly : &m_aHanjaOnly;
     862                 :          0 :             pBox->Check( sal_True );
     863                 :          0 :             OnConversionDirectionClicked( pBox );
     864                 :            :         }
     865                 :          0 :     }
     866                 :            : 
     867                 :            :     //-------------------------------------------------------------------------
     868                 :          0 :     sal_Bool HangulHanjaConversionDialog::GetUseBothDirections( ) const
     869                 :            :     {
     870 [ #  # ][ #  # ]:          0 :         return !m_aHangulOnly.IsChecked() && !m_aHanjaOnly.IsChecked();
     871                 :            :     }
     872                 :            : 
     873                 :            :     //-------------------------------------------------------------------------
     874                 :          0 :     HHC::ConversionDirection HangulHanjaConversionDialog::GetDirection(
     875                 :            :             HHC::ConversionDirection eDefaultDirection ) const
     876                 :            :     {
     877                 :          0 :         HHC::ConversionDirection eDirection = eDefaultDirection;
     878 [ #  # ][ #  # ]:          0 :         if (m_aHangulOnly.IsChecked() && !m_aHanjaOnly.IsChecked())
                 [ #  # ]
     879                 :          0 :             eDirection = HHC::eHangulToHanja;
     880 [ #  # ][ #  # ]:          0 :         else if (!m_aHangulOnly.IsChecked() && m_aHanjaOnly.IsChecked())
                 [ #  # ]
     881                 :          0 :             eDirection = HHC::eHanjaToHangul;
     882                 :          0 :         return eDirection;
     883                 :            :     }
     884                 :            : 
     885                 :            :     //-------------------------------------------------------------------------
     886                 :          0 :     void HangulHanjaConversionDialog::SetConversionFormat( HHC::ConversionFormat _eType )
     887                 :            :     {
     888   [ #  #  #  #  :          0 :         switch ( _eType )
             #  #  #  # ]
     889                 :            :         {
     890                 :          0 :             case HHC::eSimpleConversion: m_aSimpleConversion.Check(); break;
     891                 :          0 :             case HHC::eHangulBracketed: m_aHangulBracketed.Check(); break;
     892                 :          0 :             case HHC::eHanjaBracketed:  m_aHanjaBracketed.Check(); break;
     893                 :          0 :             case HHC::eRubyHanjaAbove:  m_pHanjaAbove->Check(); break;
     894                 :          0 :             case HHC::eRubyHanjaBelow:  m_pHanjaBelow->Check(); break;
     895                 :          0 :             case HHC::eRubyHangulAbove: m_pHangulAbove->Check(); break;
     896                 :          0 :             case HHC::eRubyHangulBelow: m_pHangulBelow->Check(); break;
     897                 :            :         default:
     898                 :            :             OSL_FAIL( "HangulHanjaConversionDialog::SetConversionFormat: unknown type!" );
     899                 :            :         }
     900                 :          0 :     }
     901                 :            : 
     902                 :            :     //-------------------------------------------------------------------------
     903                 :          0 :     HHC::ConversionFormat HangulHanjaConversionDialog::GetConversionFormat( ) const
     904                 :            :     {
     905         [ #  # ]:          0 :         if ( m_aSimpleConversion.IsChecked() )
     906                 :          0 :             return HHC::eSimpleConversion;
     907         [ #  # ]:          0 :         if ( m_aHangulBracketed.IsChecked() )
     908                 :          0 :             return HHC::eHangulBracketed;
     909         [ #  # ]:          0 :         if ( m_aHanjaBracketed.IsChecked() )
     910                 :          0 :             return HHC::eHanjaBracketed;
     911         [ #  # ]:          0 :         if ( m_pHanjaAbove->IsChecked() )
     912                 :          0 :             return HHC::eRubyHanjaAbove;
     913         [ #  # ]:          0 :         if ( m_pHanjaBelow->IsChecked() )
     914                 :          0 :             return HHC::eRubyHanjaBelow;
     915         [ #  # ]:          0 :         if ( m_pHangulAbove->IsChecked() )
     916                 :          0 :             return HHC::eRubyHangulAbove;
     917         [ #  # ]:          0 :         if ( m_pHangulBelow->IsChecked() )
     918                 :          0 :             return HHC::eRubyHangulBelow;
     919                 :            : 
     920                 :            :         OSL_FAIL( "HangulHanjaConversionDialog::GetConversionFormat: no radio checked?" );
     921                 :          0 :         return HHC::eSimpleConversion;
     922                 :            :     }
     923                 :            : 
     924                 :            :     //-------------------------------------------------------------------------
     925                 :          0 :     void HangulHanjaConversionDialog::EnableRubySupport( sal_Bool bVal )
     926                 :            :     {
     927                 :          0 :         m_pHanjaAbove->Enable( bVal );
     928                 :          0 :         m_pHanjaBelow->Enable( bVal );
     929                 :          0 :         m_pHangulAbove->Enable( bVal );
     930                 :          0 :         m_pHangulBelow->Enable( bVal );
     931                 :          0 :     }
     932                 :            : 
     933                 :            : 
     934                 :            :     //=========================================================================
     935                 :            :     //= HangulHanjaOptionsDialog
     936                 :            :     //=========================================================================
     937                 :            :     //-------------------------------------------------------------------------
     938                 :            : 
     939                 :          0 :     void HangulHanjaOptionsDialog::Init( void )
     940                 :            :     {
     941         [ #  # ]:          0 :         if( !m_xConversionDictionaryList.is() )
     942                 :            :         {
     943         [ #  # ]:          0 :             Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
     944         [ #  # ]:          0 :             if( xMgr.is() )
     945                 :            :             {
     946         [ #  # ]:          0 :                 m_xConversionDictionaryList = Reference< XConversionDictionaryList >( xMgr->createInstance(
     947                 :          0 :                     OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.ConversionDictionaryList")) ),
     948 [ #  # ][ #  # ]:          0 :                     UNO_QUERY );
         [ #  # ][ #  # ]
     949                 :          0 :             }
     950                 :            :         }
     951                 :            : 
     952                 :          0 :         m_aDictList.clear();
     953                 :          0 :         m_aDictsLB.Clear();
     954                 :            : 
     955         [ #  # ]:          0 :         if( m_xConversionDictionaryList.is() )
     956                 :            :         {
     957 [ #  # ][ #  # ]:          0 :             Reference< XNameContainer > xNameCont = m_xConversionDictionaryList->getDictionaryContainer();
     958         [ #  # ]:          0 :             Reference< XNameAccess >    xNameAccess = Reference< XNameAccess >( xNameCont, UNO_QUERY );
     959         [ #  # ]:          0 :             if( xNameAccess.is() )
     960                 :            :             {
     961 [ #  # ][ #  # ]:          0 :                 Sequence< ::rtl::OUString >     aDictNames( xNameAccess->getElementNames() );
     962                 :            : 
     963                 :          0 :                 const ::rtl::OUString*          pDic = aDictNames.getConstArray();
     964                 :          0 :                 sal_Int32                       nCount = aDictNames.getLength();
     965                 :            : 
     966                 :            :                 sal_Int32                       i;
     967         [ #  # ]:          0 :                 for( i = 0 ; i < nCount ; ++i )
     968                 :            :                 {
     969 [ #  # ][ #  # ]:          0 :                     Any                                 aAny( xNameAccess->getByName( pDic[ i ] ) );
     970                 :          0 :                     Reference< XConversionDictionary >  xDic;
     971 [ #  # ][ #  # ]:          0 :                     if( ( aAny >>= xDic ) && xDic.is() )
         [ #  # ][ #  # ]
     972                 :            :                     {
     973 [ #  # ][ #  # ]:          0 :                         if( LANGUAGE_KOREAN == SvxLocaleToLanguage( xDic->getLocale() ) )
         [ #  # ][ #  # ]
     974                 :            :                         {
     975         [ #  # ]:          0 :                             m_aDictList.push_back( xDic );
     976 [ #  # ][ #  # ]:          0 :                             AddDict( xDic->getName(), xDic->isActive() );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     977                 :            :                         }
     978                 :            :                     }
     979         [ #  # ]:          0 :                 }
     980                 :          0 :             }
     981                 :            :         }
     982                 :          0 :     }
     983                 :            : 
     984                 :          0 :     IMPL_LINK_NOARG(HangulHanjaOptionsDialog, OkHdl)
     985                 :            :     {
     986                 :          0 :         sal_uInt32              nCnt = m_aDictList.size();
     987                 :          0 :         sal_uInt32              n = 0;
     988                 :          0 :         sal_uInt32              nActiveDics = 0;
     989         [ #  # ]:          0 :         Sequence< OUString >    aActiveDics;
     990                 :            : 
     991         [ #  # ]:          0 :         aActiveDics.realloc( nCnt );
     992         [ #  # ]:          0 :         OUString*               pActActiveDic = aActiveDics.getArray();
     993                 :            : 
     994         [ #  # ]:          0 :         while( nCnt )
     995                 :            :         {
     996                 :          0 :             Reference< XConversionDictionary >  xDict = m_aDictList[ n ];
     997         [ #  # ]:          0 :             SvLBoxEntry*                        pEntry = m_aDictsLB.SvTreeListBox::GetEntry( n );
     998                 :            : 
     999                 :            :             DBG_ASSERT( xDict.is(), "-HangulHanjaOptionsDialog::OkHdl(): someone is evaporated..." );
    1000                 :            :             DBG_ASSERT( pEntry, "-HangulHanjaOptionsDialog::OkHdl(): no one there in list?" );
    1001                 :            : 
    1002         [ #  # ]:          0 :             bool    bActive = m_aDictsLB.GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED;
    1003 [ #  # ][ #  # ]:          0 :             xDict->setActive( bActive );
    1004         [ #  # ]:          0 :             Reference< util::XFlushable > xFlush( xDict, uno::UNO_QUERY );
    1005         [ #  # ]:          0 :             if( xFlush.is() )
    1006 [ #  # ][ #  # ]:          0 :                 xFlush->flush();
    1007                 :            : 
    1008         [ #  # ]:          0 :             if( bActive )
    1009                 :            :             {
    1010 [ #  # ][ #  # ]:          0 :                 pActActiveDic[ nActiveDics ] = xDict->getName();
    1011                 :          0 :                 ++nActiveDics;
    1012                 :            :             }
    1013                 :            : 
    1014                 :          0 :             ++n;
    1015                 :          0 :             --nCnt;
    1016                 :          0 :         }
    1017                 :            : 
    1018                 :            :         // save configuration
    1019         [ #  # ]:          0 :         aActiveDics.realloc( nActiveDics );
    1020                 :          0 :         Any             aTmp;
    1021         [ #  # ]:          0 :         SvtLinguConfig  aLngCfg;
    1022         [ #  # ]:          0 :         aTmp <<= aActiveDics;
    1023         [ #  # ]:          0 :         aLngCfg.SetProperty( UPH_ACTIVE_CONVERSION_DICTIONARIES, aTmp );
    1024                 :            : 
    1025 [ #  # ][ #  # ]:          0 :         aTmp <<= bool( m_aIgnorepostCB.IsChecked() );
    1026         [ #  # ]:          0 :         aLngCfg.SetProperty( UPH_IS_IGNORE_POST_POSITIONAL_WORD, aTmp );
    1027                 :            : 
    1028 [ #  # ][ #  # ]:          0 :         aTmp <<= bool( m_aShowrecentlyfirstCB.IsChecked() );
    1029         [ #  # ]:          0 :         aLngCfg.SetProperty( UPH_IS_SHOW_ENTRIES_RECENTLY_USED_FIRST, aTmp );
    1030                 :            : 
    1031 [ #  # ][ #  # ]:          0 :         aTmp <<= bool( m_aAutoreplaceuniqueCB.IsChecked() );
    1032         [ #  # ]:          0 :         aLngCfg.SetProperty( UPH_IS_AUTO_REPLACE_UNIQUE_ENTRIES, aTmp );
    1033                 :            : 
    1034         [ #  # ]:          0 :         EndDialog( RET_OK );
    1035 [ #  # ][ #  # ]:          0 :         return 0;
    1036                 :            :     }
    1037                 :            : 
    1038                 :          0 :     IMPL_LINK_NOARG(HangulHanjaOptionsDialog, DictsLB_SelectHdl)
    1039                 :            :     {
    1040                 :          0 :         bool    bSel = m_aDictsLB.FirstSelected() != NULL;
    1041                 :            : 
    1042                 :          0 :         m_aEditPB.Enable( bSel );
    1043                 :          0 :         m_aDeletePB.Enable( bSel );
    1044                 :            : 
    1045                 :          0 :         return 0;
    1046                 :            :     }
    1047                 :            : 
    1048                 :          0 :     IMPL_LINK_NOARG(HangulHanjaOptionsDialog, NewDictHdl)
    1049                 :            :     {
    1050         [ #  # ]:          0 :         String                      aName;
    1051         [ #  # ]:          0 :         HangulHanjaNewDictDialog    aNewDlg( this );
    1052         [ #  # ]:          0 :         aNewDlg.Execute();
    1053 [ #  # ][ #  # ]:          0 :         if( aNewDlg.GetName( aName ) )
    1054                 :            :         {
    1055         [ #  # ]:          0 :             if( m_xConversionDictionaryList.is() )
    1056                 :            :             {
    1057                 :            :                 try
    1058                 :            :                 {
    1059                 :            :                     Reference< XConversionDictionary >  xDic =
    1060 [ #  # ][ #  # ]:          0 :                         m_xConversionDictionaryList->addNewDictionary( aName, SvxCreateLocale( LANGUAGE_KOREAN ), ConversionDictionaryType::HANGUL_HANJA );
         [ #  # ][ #  # ]
    1061                 :            : 
    1062         [ #  # ]:          0 :                     if( xDic.is() )
    1063                 :            :                     {
    1064                 :            :                         //adapt local caches:
    1065         [ #  # ]:          0 :                         m_aDictList.push_back( xDic );
    1066 [ #  # ][ #  # ]:          0 :                         AddDict( xDic->getName(), xDic->isActive() );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
    1067      [ #  #  # ]:          0 :                     }
    1068                 :            :                 }
    1069         [ #  # ]:          0 :                 catch( const ElementExistException& )
    1070                 :            :                 {
    1071                 :            :                 }
    1072         [ #  # ]:          0 :                 catch( const NoSupportException& )
    1073                 :            :                 {
    1074                 :            :                 }
    1075                 :            :             }
    1076                 :            :         }
    1077                 :            : 
    1078 [ #  # ][ #  # ]:          0 :         return 0L;
    1079                 :            :     }
    1080                 :            : 
    1081                 :          0 :     IMPL_LINK_NOARG(HangulHanjaOptionsDialog, EditDictHdl)
    1082                 :            :     {
    1083                 :          0 :         SvLBoxEntry*    pEntry = m_aDictsLB.FirstSelected();
    1084                 :            :         DBG_ASSERT( pEntry, "+HangulHanjaEditDictDialog::EditDictHdl(): call of edit should not be possible with no selection!" );
    1085         [ #  # ]:          0 :         if( pEntry )
    1086                 :            :         {
    1087 [ #  # ][ #  # ]:          0 :             HangulHanjaEditDictDialog   aEdDlg( this, m_aDictList, m_aDictsLB.GetSelectEntryPos() );
    1088 [ #  # ][ #  # ]:          0 :             aEdDlg.Execute();
    1089                 :            :         }
    1090                 :          0 :         return 0L;
    1091                 :            :     }
    1092                 :            : 
    1093                 :          0 :     IMPL_LINK_NOARG(HangulHanjaOptionsDialog, DeleteDictHdl)
    1094                 :            :     {
    1095                 :          0 :         sal_uInt16 nSelPos = m_aDictsLB.GetSelectEntryPos();
    1096         [ #  # ]:          0 :         if( nSelPos != LISTBOX_ENTRY_NOTFOUND )
    1097                 :            :         {
    1098                 :          0 :             Reference< XConversionDictionary >  xDic( m_aDictList[ nSelPos ] );
    1099 [ #  # ][ #  # ]:          0 :             if( m_xConversionDictionaryList.is() && xDic.is() )
                 [ #  # ]
    1100                 :            :             {
    1101 [ #  # ][ #  # ]:          0 :                 Reference< XNameContainer >     xNameCont = m_xConversionDictionaryList->getDictionaryContainer();
    1102         [ #  # ]:          0 :                 if( xNameCont.is() )
    1103                 :            :                 {
    1104                 :            :                     try
    1105                 :            :                     {
    1106 [ #  # ][ #  # ]:          0 :                         xNameCont->removeByName( xDic->getName() );
         [ #  # ][ #  # ]
    1107                 :            : 
    1108                 :            :                         //adapt local caches:
    1109                 :          0 :                         HHDictList::iterator aIter(m_aDictList.begin());
    1110   [ #  #  #  #  :          0 :                         m_aDictList.erase(aIter+nSelPos );
              # ][ #  # ]
    1111         [ #  # ]:          0 :                         m_aDictsLB.RemoveEntry( nSelPos );
    1112                 :            :                     }
    1113         [ #  # ]:          0 :                     catch( const ElementExistException& )
    1114                 :            :                     {
    1115                 :            :                     }
    1116         [ #  # ]:          0 :                     catch( const NoSupportException& )
    1117                 :            :                     {
    1118                 :            :                     }
    1119                 :          0 :                 }
    1120                 :          0 :             }
    1121                 :            :         }
    1122                 :            : 
    1123                 :          0 :         return 0L;
    1124                 :            :     }
    1125                 :            : 
    1126                 :          0 :     HangulHanjaOptionsDialog::HangulHanjaOptionsDialog( Window* _pParent )
    1127                 :          0 :         :ModalDialog            ( _pParent, CUI_RES( RID_SVX_MDLG_HANGULHANJA_OPT ) )
    1128         [ #  # ]:          0 :         ,m_aUserdefdictFT       ( this, CUI_RES( FT_USERDEFDICT ) )
    1129         [ #  # ]:          0 :         ,m_aDictsLB             ( this, CUI_RES( LB_DICTS ) )
    1130         [ #  # ]:          0 :         ,m_aOptionsFL           ( this, CUI_RES( FL_OPTIONS ) )
    1131         [ #  # ]:          0 :         ,m_aIgnorepostCB        ( this, CUI_RES( CB_IGNOREPOST ) )
    1132         [ #  # ]:          0 :         ,m_aShowrecentlyfirstCB ( this, CUI_RES( CB_SHOWRECENTLYFIRST ) )
    1133         [ #  # ]:          0 :         ,m_aAutoreplaceuniqueCB ( this, CUI_RES( CB_AUTOREPLACEUNIQUE ) )
    1134         [ #  # ]:          0 :         ,m_aNewPB               ( this, CUI_RES( PB_HHO_NEW ) )
    1135         [ #  # ]:          0 :         ,m_aEditPB              ( this, CUI_RES( PB_HHO_EDIT ) )
    1136         [ #  # ]:          0 :         ,m_aDeletePB            ( this, CUI_RES( PB_HHO_DELETE ) )
    1137         [ #  # ]:          0 :         ,m_aOkPB                ( this, CUI_RES( PB_HHO_OK ) )
    1138         [ #  # ]:          0 :         ,m_aCancelPB            ( this, CUI_RES( PB_HHO_CANCEL ) )
    1139         [ #  # ]:          0 :         ,m_aHelpPB              ( this, CUI_RES( PB_HHO_HELP ) )
    1140                 :            : 
    1141                 :            :         ,m_pCheckButtonData     ( NULL )
    1142 [ #  # ][ #  # ]:          0 :         ,m_xConversionDictionaryList( NULL )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
    1143                 :            :     {
    1144 [ #  # ][ #  # ]:          0 :         m_aDictsLB.SetStyle( m_aDictsLB.GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_FORCE_MAKEVISIBLE );
    1145         [ #  # ]:          0 :         m_aDictsLB.SetSelectionMode( SINGLE_SELECTION );
    1146         [ #  # ]:          0 :         m_aDictsLB.SetHighlightRange();
    1147         [ #  # ]:          0 :         m_aDictsLB.SetSelectHdl( LINK( this, HangulHanjaOptionsDialog, DictsLB_SelectHdl ) );
    1148         [ #  # ]:          0 :         m_aDictsLB.SetDeselectHdl( LINK( this, HangulHanjaOptionsDialog, DictsLB_SelectHdl ) );
    1149                 :            : 
    1150         [ #  # ]:          0 :         m_aOkPB.SetClickHdl( LINK( this, HangulHanjaOptionsDialog, OkHdl ) );
    1151         [ #  # ]:          0 :         m_aNewPB.SetClickHdl( LINK( this, HangulHanjaOptionsDialog, NewDictHdl ) );
    1152         [ #  # ]:          0 :         m_aEditPB.SetClickHdl( LINK( this, HangulHanjaOptionsDialog, EditDictHdl ) );
    1153         [ #  # ]:          0 :         m_aDeletePB.SetClickHdl( LINK( this, HangulHanjaOptionsDialog, DeleteDictHdl ) );
    1154                 :            : 
    1155         [ #  # ]:          0 :         FreeResource();
    1156                 :            : 
    1157         [ #  # ]:          0 :         SvtLinguConfig  aLngCfg;
    1158                 :          0 :         Any             aTmp;
    1159                 :          0 :         bool            bVal = bool();
    1160         [ #  # ]:          0 :         aTmp = aLngCfg.GetProperty( UPH_IS_IGNORE_POST_POSITIONAL_WORD );
    1161         [ #  # ]:          0 :         if( aTmp >>= bVal )
    1162         [ #  # ]:          0 :             m_aIgnorepostCB.Check( bVal );
    1163                 :            : 
    1164         [ #  # ]:          0 :         aTmp = aLngCfg.GetProperty( UPH_IS_SHOW_ENTRIES_RECENTLY_USED_FIRST );
    1165         [ #  # ]:          0 :         if( aTmp >>= bVal )
    1166         [ #  # ]:          0 :             m_aShowrecentlyfirstCB.Check( bVal );
    1167                 :            : 
    1168         [ #  # ]:          0 :         aTmp = aLngCfg.GetProperty( UPH_IS_AUTO_REPLACE_UNIQUE_ENTRIES );
    1169         [ #  # ]:          0 :         if( aTmp >>= bVal )
    1170         [ #  # ]:          0 :             m_aAutoreplaceuniqueCB.Check( bVal );
    1171                 :            : 
    1172 [ #  # ][ #  # ]:          0 :         Init();
    1173                 :          0 :     }
    1174                 :            : 
    1175 [ #  # ][ #  # ]:          0 :     HangulHanjaOptionsDialog::~HangulHanjaOptionsDialog()
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
    1176                 :            :     {
    1177         [ #  # ]:          0 :         SvLBoxEntry*    pEntry = m_aDictsLB.First();
    1178                 :            :         String*         pDel;
    1179         [ #  # ]:          0 :         while( pEntry )
    1180                 :            :         {
    1181                 :          0 :             pDel = ( String* ) pEntry->GetUserData();
    1182         [ #  # ]:          0 :             if( pDel )
    1183 [ #  # ][ #  # ]:          0 :                 delete pDel;
    1184         [ #  # ]:          0 :             pEntry = m_aDictsLB.Next( pEntry );
    1185                 :            :         }
    1186                 :            : 
    1187         [ #  # ]:          0 :         if( m_pCheckButtonData )
    1188 [ #  # ][ #  # ]:          0 :             delete m_pCheckButtonData;
    1189         [ #  # ]:          0 :     }
    1190                 :            : 
    1191                 :          0 :     void HangulHanjaOptionsDialog::AddDict( const String& _rName, bool _bChecked )
    1192                 :            :     {
    1193                 :          0 :         SvLBoxEntry*    pEntry = m_aDictsLB.SvTreeListBox::InsertEntry( _rName );
    1194         [ #  # ]:          0 :         m_aDictsLB.SetCheckButtonState( pEntry, _bChecked? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED );
    1195         [ #  # ]:          0 :         pEntry->SetUserData( new String( _rName ) );
    1196                 :          0 :     }
    1197                 :            : 
    1198                 :            :     //=========================================================================
    1199                 :            :     //= HangulHanjaNewDictDialog
    1200                 :            :     //=========================================================================
    1201                 :            :     //-------------------------------------------------------------------------
    1202                 :            : 
    1203                 :          0 :     IMPL_LINK_NOARG(HangulHanjaNewDictDialog, OKHdl)
    1204                 :            :     {
    1205 [ #  # ][ #  # ]:          0 :         String  aName(comphelper::string::stripEnd(m_aDictNameED.GetText(), ' '));
         [ #  # ][ #  # ]
                 [ #  # ]
    1206                 :            : 
    1207                 :          0 :         m_bEntered = aName.Len() > 0;
    1208         [ #  # ]:          0 :         if( m_bEntered )
    1209         [ #  # ]:          0 :             m_aDictNameED.SetText( aName );     // do this in case of trailing chars have been deleted
    1210                 :            : 
    1211         [ #  # ]:          0 :         EndDialog( RET_OK );
    1212         [ #  # ]:          0 :         return 0;
    1213                 :            :     }
    1214                 :            : 
    1215                 :          0 :     IMPL_LINK_NOARG(HangulHanjaNewDictDialog, ModifyHdl)
    1216                 :            :     {
    1217 [ #  # ][ #  # ]:          0 :         String aName(comphelper::string::stripEnd(m_aDictNameED.GetText(), ' '));
         [ #  # ][ #  # ]
                 [ #  # ]
    1218                 :            : 
    1219         [ #  # ]:          0 :         m_aOkBtn.Enable( aName.Len() > 0 );
    1220                 :            : 
    1221         [ #  # ]:          0 :         return 0;
    1222                 :            :     }
    1223                 :            : 
    1224                 :          0 :     HangulHanjaNewDictDialog::HangulHanjaNewDictDialog( Window* _pParent )
    1225                 :          0 :         :ModalDialog    ( _pParent, CUI_RES( RID_SVX_MDLG_HANGULHANJA_NEWDICT ) )
    1226         [ #  # ]:          0 :         ,m_aNewDictFL   ( this, CUI_RES( FL_NEWDICT ) )
    1227         [ #  # ]:          0 :         ,m_aDictNameFT  ( this, CUI_RES( FT_DICTNAME ) )
    1228         [ #  # ]:          0 :         ,m_aDictNameED  ( this, CUI_RES( ED_DICTNAME ) )
    1229         [ #  # ]:          0 :         ,m_aOkBtn       ( this, CUI_RES( PB_NEWDICT_OK ) )
    1230         [ #  # ]:          0 :         ,m_aCancelBtn   ( this, CUI_RES( PB_NEWDICT_ESC ) )
    1231         [ #  # ]:          0 :         ,m_aHelpBtn     ( this, CUI_RES( PB_NEWDICT_HLP ) )
    1232                 :            : 
    1233 [ #  # ][ #  # ]:          0 :         ,m_bEntered     ( false )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
    1234                 :            :     {
    1235         [ #  # ]:          0 :         m_aOkBtn.SetClickHdl( LINK( this, HangulHanjaNewDictDialog, OKHdl ) );
    1236                 :            : 
    1237         [ #  # ]:          0 :         m_aDictNameED.SetModifyHdl( LINK( this, HangulHanjaNewDictDialog, ModifyHdl ) );
    1238                 :            : 
    1239         [ #  # ]:          0 :         FreeResource();
    1240                 :          0 :     }
    1241                 :            : 
    1242 [ #  # ][ #  # ]:          0 :     HangulHanjaNewDictDialog::~HangulHanjaNewDictDialog()
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
    1243                 :            :     {
    1244         [ #  # ]:          0 :     }
    1245                 :            : 
    1246                 :          0 :     bool HangulHanjaNewDictDialog::GetName( String& _rRetName ) const
    1247                 :            :     {
    1248         [ #  # ]:          0 :         if( m_bEntered )
    1249 [ #  # ][ #  # ]:          0 :             _rRetName = comphelper::string::stripEnd(m_aDictNameED.GetText(), ' ');
                 [ #  # ]
    1250                 :            : 
    1251                 :          0 :         return m_bEntered;
    1252                 :            :     }
    1253                 :            : 
    1254                 :            :     //=========================================================================
    1255                 :            :     //= HangulHanjaEditDictDialog
    1256                 :            :     //=========================================================================
    1257                 :            :     //-------------------------------------------------------------------------
    1258                 :            : 
    1259                 :            :     class SuggestionList
    1260                 :            :     {
    1261                 :            :     private:
    1262                 :            :     protected:
    1263                 :            :         sal_uInt16          m_nSize;
    1264                 :            :         String**            m_ppElements;
    1265                 :            :         sal_uInt16          m_nNumOfEntries;
    1266                 :            :         sal_uInt16          m_nAct;
    1267                 :            : 
    1268                 :            :         const String*       _Next( void );
    1269                 :            :     public:
    1270                 :            :                             SuggestionList( sal_uInt16 _nNumOfElements );
    1271                 :            :         virtual             ~SuggestionList();
    1272                 :            : 
    1273                 :            :         bool                Set( const String& _rElement, sal_uInt16 _nNumOfElement );
    1274                 :            :         bool                Reset( sal_uInt16 _nNumOfElement );
    1275                 :            :         const String*       Get( sal_uInt16 _nNumOfElement ) const;
    1276                 :            :         void                Clear( void );
    1277                 :            : 
    1278                 :            :         const String*       First( void );
    1279                 :            :         const String*       Next( void );
    1280                 :            : 
    1281                 :            :         inline sal_uInt16   GetCount( void ) const;
    1282                 :            :     };
    1283                 :            : 
    1284                 :          0 :     inline sal_uInt16 SuggestionList::GetCount( void ) const
    1285                 :            :     {
    1286                 :          0 :         return m_nNumOfEntries;
    1287                 :            :     }
    1288                 :            : 
    1289                 :          0 :     SuggestionList::SuggestionList( sal_uInt16 _nNumOfElements )
    1290                 :            :     {
    1291         [ #  # ]:          0 :         if( !_nNumOfElements )
    1292                 :          0 :             _nNumOfElements = 1;
    1293                 :            : 
    1294                 :          0 :         m_nSize = _nNumOfElements;
    1295                 :            : 
    1296                 :          0 :         m_ppElements = new String*[ m_nSize ];
    1297                 :          0 :         m_nAct = m_nNumOfEntries = 0;
    1298                 :            : 
    1299                 :          0 :         String**    ppNull = m_ppElements;
    1300                 :          0 :         sal_uInt16  n = _nNumOfElements;
    1301         [ #  # ]:          0 :         while( n )
    1302                 :            :         {
    1303                 :          0 :             *ppNull = NULL;
    1304                 :          0 :             ++ppNull;
    1305                 :          0 :             --n;
    1306                 :            :         }
    1307                 :          0 :     }
    1308                 :            : 
    1309                 :          0 :     SuggestionList::~SuggestionList()
    1310                 :            :     {
    1311                 :          0 :         Clear();
    1312         [ #  # ]:          0 :     }
    1313                 :            : 
    1314                 :          0 :     bool SuggestionList::Set( const String& _rElement, sal_uInt16 _nNumOfElement )
    1315                 :            :     {
    1316                 :          0 :         bool    bRet = _nNumOfElement < m_nSize;
    1317         [ #  # ]:          0 :         if( bRet )
    1318                 :            :         {
    1319                 :          0 :             String**    ppElem = m_ppElements + _nNumOfElement;
    1320         [ #  # ]:          0 :             if( *ppElem )
    1321                 :          0 :                 **ppElem = _rElement;
    1322                 :            :             else
    1323                 :            :             {
    1324         [ #  # ]:          0 :                 *ppElem = new String( _rElement );
    1325                 :          0 :                 ++m_nNumOfEntries;
    1326                 :            :             }
    1327                 :            :         }
    1328                 :            : 
    1329                 :          0 :         return bRet;
    1330                 :            :     }
    1331                 :            : 
    1332                 :          0 :     bool SuggestionList::Reset( sal_uInt16 _nNumOfElement )
    1333                 :            :     {
    1334                 :          0 :         bool    bRet = _nNumOfElement < m_nSize;
    1335         [ #  # ]:          0 :         if( bRet )
    1336                 :            :         {
    1337                 :          0 :             String**    ppElem = m_ppElements + _nNumOfElement;
    1338         [ #  # ]:          0 :             if( *ppElem )
    1339                 :            :             {
    1340         [ #  # ]:          0 :                 delete *ppElem;
    1341                 :          0 :                 *ppElem = NULL;
    1342                 :          0 :                 --m_nNumOfEntries;
    1343                 :            :             }
    1344                 :            :         }
    1345                 :            : 
    1346                 :          0 :         return bRet;
    1347                 :            :     }
    1348                 :            : 
    1349                 :          0 :     const String* SuggestionList::Get( sal_uInt16 _nNumOfElement ) const
    1350                 :            :     {
    1351                 :            :         const String*   pRet;
    1352                 :            : 
    1353         [ #  # ]:          0 :         if( _nNumOfElement < m_nSize )
    1354                 :          0 :             pRet = m_ppElements[ _nNumOfElement ];
    1355                 :            :         else
    1356                 :          0 :             pRet = NULL;
    1357                 :            : 
    1358                 :          0 :         return pRet;
    1359                 :            :     }
    1360                 :            : 
    1361                 :          0 :     void SuggestionList::Clear( void )
    1362                 :            :     {
    1363         [ #  # ]:          0 :         if( m_nNumOfEntries )
    1364                 :            :         {
    1365                 :          0 :             String**    ppDel = m_ppElements;
    1366                 :          0 :             sal_uInt16  nCnt = m_nSize;
    1367         [ #  # ]:          0 :             while( nCnt )
    1368                 :            :             {
    1369         [ #  # ]:          0 :                 if( *ppDel )
    1370                 :            :                 {
    1371         [ #  # ]:          0 :                     delete *ppDel;
    1372                 :          0 :                     *ppDel = NULL;
    1373                 :            :                 }
    1374                 :            : 
    1375                 :          0 :                 ++ppDel;
    1376                 :          0 :                 --nCnt;
    1377                 :            :             }
    1378                 :            : 
    1379                 :          0 :             m_nNumOfEntries = m_nAct = 0;
    1380                 :            :         }
    1381                 :          0 :     }
    1382                 :            : 
    1383                 :          0 :     const String* SuggestionList::_Next( void )
    1384                 :            :     {
    1385                 :          0 :         const String*   pRet = NULL;
    1386 [ #  # ][ #  # ]:          0 :         while( m_nAct < m_nSize && !pRet )
                 [ #  # ]
    1387                 :            :         {
    1388                 :          0 :             pRet = m_ppElements[ m_nAct ];
    1389         [ #  # ]:          0 :             if( !pRet )
    1390                 :          0 :                 ++m_nAct;
    1391                 :            :         }
    1392                 :            : 
    1393                 :          0 :         return pRet;
    1394                 :            :     }
    1395                 :            : 
    1396                 :          0 :     const String* SuggestionList::First( void )
    1397                 :            :     {
    1398                 :          0 :         m_nAct = 0;
    1399                 :          0 :         return _Next();
    1400                 :            :     }
    1401                 :            : 
    1402                 :          0 :     const String* SuggestionList::Next( void )
    1403                 :            :     {
    1404                 :            :         const String*   pRet;
    1405                 :            : 
    1406         [ #  # ]:          0 :         if( m_nAct < m_nNumOfEntries )
    1407                 :            :         {
    1408                 :          0 :             ++m_nAct;
    1409                 :          0 :             pRet = _Next();
    1410                 :            :         }
    1411                 :            :         else
    1412                 :          0 :             pRet = NULL;
    1413                 :            : 
    1414                 :          0 :         return pRet;
    1415                 :            :     }
    1416                 :            : 
    1417                 :            : 
    1418                 :          0 :     bool SuggestionEdit::ShouldScroll( bool _bUp ) const
    1419                 :            :     {
    1420                 :          0 :         bool    bRet = false;
    1421                 :            : 
    1422         [ #  # ]:          0 :         if( _bUp )
    1423                 :            :         {
    1424         [ #  # ]:          0 :             if( !m_pPrev )
    1425                 :          0 :                 bRet = m_rScrollBar.GetThumbPos() > m_rScrollBar.GetRangeMin();
    1426                 :            :         }
    1427                 :            :         else
    1428                 :            :         {
    1429         [ #  # ]:          0 :             if( !m_pNext )
    1430                 :          0 :                 bRet = m_rScrollBar.GetThumbPos() < ( m_rScrollBar.GetRangeMax() - 4 );
    1431                 :            :         }
    1432                 :            : 
    1433                 :          0 :         return bRet;
    1434                 :            :     }
    1435                 :            : 
    1436                 :          0 :     void SuggestionEdit::DoJump( bool _bUp )
    1437                 :            :     {
    1438                 :          0 :         const Link&     rLoseFocusHdl = GetLoseFocusHdl();
    1439         [ #  # ]:          0 :         if( rLoseFocusHdl.IsSet() )
    1440                 :          0 :             rLoseFocusHdl.Call( this );
    1441         [ #  # ]:          0 :         m_rScrollBar.SetThumbPos( m_rScrollBar.GetThumbPos() + ( _bUp? -1 : 1 ) );
    1442                 :            : 
    1443                 :          0 :         ( static_cast< HangulHanjaEditDictDialog* >( GetParent() ) )->UpdateScrollbar();
    1444                 :          0 :     }
    1445                 :            : 
    1446                 :          0 :     SuggestionEdit::SuggestionEdit( Window* pParent, const ResId& rResId,
    1447                 :            :         ScrollBar& _rScrollBar, SuggestionEdit* _pPrev, SuggestionEdit* _pNext  )
    1448                 :            :         :Edit( pParent, rResId )
    1449                 :            :         ,m_pPrev( _pPrev )
    1450                 :            :         ,m_pNext( _pNext )
    1451                 :          0 :         ,m_rScrollBar( _rScrollBar )
    1452                 :            :     {
    1453                 :          0 :     }
    1454                 :            : 
    1455                 :          0 :     SuggestionEdit::~SuggestionEdit()
    1456                 :            :     {
    1457         [ #  # ]:          0 :     }
    1458                 :            : 
    1459                 :          0 :     long SuggestionEdit::PreNotify( NotifyEvent& rNEvt )
    1460                 :            :     {
    1461                 :          0 :         long    nHandled = 0;
    1462         [ #  # ]:          0 :         if( rNEvt.GetType() == EVENT_KEYINPUT )
    1463                 :            :         {
    1464                 :          0 :             const KeyEvent*             pKEvt = rNEvt.GetKeyEvent();
    1465                 :          0 :             const KeyCode&              rKeyCode = pKEvt->GetKeyCode();
    1466                 :          0 :             sal_uInt16                      nMod = rKeyCode.GetModifier();
    1467                 :          0 :             sal_uInt16                      nCode = rKeyCode.GetCode();
    1468 [ #  # ][ #  # ]:          0 :             if( nCode == KEY_TAB && ( !nMod || KEY_SHIFT == nMod ) )
                 [ #  # ]
    1469                 :            :             {
    1470                 :          0 :                 bool        bUp = KEY_SHIFT == nMod;
    1471         [ #  # ]:          0 :                 if( ShouldScroll( bUp ) )
    1472                 :            :                 {
    1473                 :          0 :                     DoJump( bUp );
    1474         [ #  # ]:          0 :                     SetSelection( Selection( 0, SELECTION_MAX ) );
    1475                 :            :                         // Tab-travel doesn't really happen, so emulate it by setting a selection manually
    1476                 :          0 :                     nHandled = 1;
    1477                 :          0 :                 }
    1478                 :            :             }
    1479 [ #  # ][ #  # ]:          0 :             else if( KEY_UP == nCode || KEY_DOWN == nCode )
    1480                 :            :             {
    1481                 :          0 :                 bool        bUp = KEY_UP == nCode;
    1482         [ #  # ]:          0 :                 if( ShouldScroll( bUp ) )
    1483                 :            :                 {
    1484                 :          0 :                     DoJump( bUp );
    1485                 :          0 :                     nHandled = 1;
    1486                 :            :                 }
    1487         [ #  # ]:          0 :                 else if( bUp )
    1488                 :            :                 {
    1489         [ #  # ]:          0 :                     if( m_pPrev )
    1490                 :            :                     {
    1491                 :          0 :                         m_pPrev->GrabFocus();
    1492                 :          0 :                         nHandled = 1;
    1493                 :            :                     }
    1494                 :            :                 }
    1495         [ #  # ]:          0 :                 else if( m_pNext )
    1496                 :            :                 {
    1497                 :          0 :                     m_pNext->GrabFocus();
    1498                 :          0 :                     nHandled = 1;
    1499                 :            :                 }
    1500                 :            :             }
    1501                 :            :         }
    1502                 :            : 
    1503         [ #  # ]:          0 :         if( !nHandled )
    1504                 :          0 :             nHandled = Edit::PreNotify( rNEvt );
    1505                 :          0 :         return nHandled;
    1506                 :            :     }
    1507                 :            : 
    1508                 :            : 
    1509                 :            :     namespace
    1510                 :            :     {
    1511                 :          0 :         bool GetConversions(    Reference< XConversionDictionary >  _xDict,
    1512                 :            :                                 const OUString& _rOrg,
    1513                 :            :                                 Sequence< OUString >& _rEntries )
    1514                 :            :         {
    1515                 :          0 :             bool    bRet = false;
    1516 [ #  # ][ #  # ]:          0 :             if( _xDict.is() && !_rOrg.isEmpty() )
                 [ #  # ]
    1517                 :            :             {
    1518                 :            :                 try
    1519                 :            :                 {
    1520         [ #  # ]:          0 :                     _rEntries = _xDict->getConversions( _rOrg,
    1521                 :            :                                                         0,
    1522                 :            :                                                         _rOrg.getLength(),
    1523                 :            :                                                         ConversionDirection_FROM_LEFT,
    1524 [ #  # ][ #  # ]:          0 :                                                         ::com::sun::star::i18n::TextConversionOption::NONE );
           [ #  #  #  # ]
    1525                 :          0 :                     bRet = _rEntries.getLength() > 0;
    1526                 :            :                 }
    1527                 :          0 :                 catch( const IllegalArgumentException& )
    1528                 :            :                 {
    1529                 :            :                 }
    1530                 :            :             }
    1531                 :            : 
    1532                 :          0 :             return bRet;
    1533                 :            :         }
    1534                 :            :     }
    1535                 :            : 
    1536                 :            : 
    1537                 :          0 :     IMPL_LINK_NOARG(HangulHanjaEditDictDialog, ScrollHdl)
    1538                 :            :     {
    1539                 :          0 :         UpdateScrollbar();
    1540                 :            : 
    1541                 :          0 :         return 0;
    1542                 :            :     }
    1543                 :            : 
    1544                 :          0 :     IMPL_LINK_NOARG(HangulHanjaEditDictDialog, OriginalModifyHdl)
    1545                 :            :     {
    1546                 :          0 :         m_bModifiedOriginal = true;
    1547 [ #  # ][ #  # ]:          0 :         m_aOriginal = comphelper::string::stripEnd(m_aOriginalLB.GetText(), ' ');
                 [ #  # ]
    1548                 :            : 
    1549                 :          0 :         UpdateSuggestions();
    1550                 :          0 :         UpdateButtonStates();
    1551                 :            : 
    1552                 :          0 :         return 0;
    1553                 :            :     }
    1554                 :            : 
    1555                 :          0 :     IMPL_LINK( HangulHanjaEditDictDialog, EditModifyHdl1, Edit*, pEdit )
    1556                 :            :     {
    1557                 :          0 :         EditModify( pEdit, 0 );
    1558                 :          0 :         return 0;
    1559                 :            :     }
    1560                 :            : 
    1561                 :          0 :     IMPL_LINK( HangulHanjaEditDictDialog, EditModifyHdl2, Edit*, pEdit )
    1562                 :            :     {
    1563                 :          0 :         EditModify( pEdit, 1 );
    1564                 :          0 :         return 0;
    1565                 :            :     }
    1566                 :            : 
    1567                 :          0 :     IMPL_LINK( HangulHanjaEditDictDialog, EditModifyHdl3, Edit*, pEdit )
    1568                 :            :     {
    1569                 :          0 :         EditModify( pEdit, 2 );
    1570                 :          0 :         return 0;
    1571                 :            :     }
    1572                 :            : 
    1573                 :          0 :     IMPL_LINK( HangulHanjaEditDictDialog, EditModifyHdl4, Edit*, pEdit )
    1574                 :            :     {
    1575                 :          0 :         EditModify( pEdit, 3 );
    1576                 :          0 :         return 0;
    1577                 :            :     }
    1578                 :            : 
    1579                 :          0 :     IMPL_LINK_NOARG(HangulHanjaEditDictDialog, BookLBSelectHdl)
    1580                 :            :     {
    1581                 :          0 :         InitEditDictDialog( m_aBookLB.GetSelectEntryPos() );
    1582                 :          0 :         return 0;
    1583                 :            :     }
    1584                 :            : 
    1585                 :          0 :     IMPL_LINK_NOARG(HangulHanjaEditDictDialog, NewPBPushHdl)
    1586                 :            :     {
    1587                 :            :         DBG_ASSERT( m_pSuggestions, "-HangulHanjaEditDictDialog::NewPBPushHdl(): no suggestions... search in hell..." );
    1588                 :          0 :         Reference< XConversionDictionary >  xDict = m_rDictList[ m_nCurrentDict ];
    1589 [ #  # ][ #  # ]:          0 :         if( xDict.is() && m_pSuggestions )
                 [ #  # ]
    1590                 :            :         {
    1591                 :            :             //delete old entry
    1592 [ #  # ][ #  # ]:          0 :             bool bRemovedSomething = DeleteEntryFromDictionary( m_aOriginal, xDict );
    1593                 :            : 
    1594         [ #  # ]:          0 :             OUString                aLeft( m_aOriginal );
    1595                 :          0 :             const String*           pRight = m_pSuggestions->First();
    1596                 :          0 :             bool bAddedSomething = false;
    1597         [ #  # ]:          0 :             while( pRight )
    1598                 :            :             {
    1599                 :            :                 try
    1600                 :            :                 {
    1601                 :            :                     //add new entry
    1602 [ #  # ][ #  # ]:          0 :                     xDict->addEntry( aLeft, *pRight );
                 [ #  # ]
              [ #  #  # ]
    1603                 :          0 :                     bAddedSomething = true;
    1604                 :            :                 }
    1605         [ #  # ]:          0 :                 catch( const IllegalArgumentException& )
    1606                 :            :                 {
    1607                 :            :                 }
    1608         [ #  # ]:          0 :                 catch( const ElementExistException& )
    1609                 :            :                 {
    1610                 :            :                 }
    1611                 :            : 
    1612                 :          0 :                 pRight = m_pSuggestions->Next();
    1613                 :            :             }
    1614                 :            : 
    1615 [ #  # ][ #  # ]:          0 :             if(bAddedSomething||bRemovedSomething)
    1616         [ #  # ]:          0 :                 InitEditDictDialog( m_nCurrentDict );
    1617                 :            :         }
    1618                 :            :         else
    1619                 :            :         {
    1620                 :            :             DBG_WARNING( "+HangulHanjaEditDictDialog::NewPBPushHdl(): dictionary faded away..." );
    1621                 :            :         }
    1622                 :          0 :         return 0;
    1623                 :            :     }
    1624                 :            : 
    1625                 :          0 :     bool HangulHanjaEditDictDialog::DeleteEntryFromDictionary( const OUString&, const Reference< XConversionDictionary >& xDict  )
    1626                 :            :     {
    1627                 :          0 :         bool bRemovedSomething = false;
    1628         [ #  # ]:          0 :         if( xDict.is() )
    1629                 :            :         {
    1630         [ #  # ]:          0 :             OUString                aOrg( m_aOriginal );
    1631         [ #  # ]:          0 :             Sequence< OUString >    aEntries;
    1632 [ #  # ][ #  # ]:          0 :             GetConversions( xDict, m_aOriginal, aEntries );
                 [ #  # ]
    1633                 :            : 
    1634                 :          0 :             sal_uInt32  n = aEntries.getLength();
    1635         [ #  # ]:          0 :             OUString*   pEntry = aEntries.getArray();
    1636         [ #  # ]:          0 :             while( n )
    1637                 :            :             {
    1638                 :            :                 try
    1639                 :            :                 {
    1640 [ #  # ][ #  # ]:          0 :                     xDict->removeEntry( aOrg, *pEntry );
    1641                 :          0 :                     bRemovedSomething = true;
    1642                 :            :                 }
    1643         [ #  # ]:          0 :                 catch( const NoSuchElementException& )
    1644                 :            :                 {   // can not be...
    1645                 :            :                 }
    1646                 :            : 
    1647                 :          0 :                 ++pEntry;
    1648                 :          0 :                 --n;
    1649         [ #  # ]:          0 :             }
    1650                 :            :         }
    1651                 :          0 :         return bRemovedSomething;
    1652                 :            :     }
    1653                 :            : 
    1654                 :          0 :     IMPL_LINK_NOARG(HangulHanjaEditDictDialog, DeletePBPushHdl)
    1655                 :            :     {
    1656 [ #  # ][ #  # ]:          0 :         if( DeleteEntryFromDictionary( m_aOriginal, m_rDictList[ m_nCurrentDict ] ) )
    1657                 :            :         {
    1658                 :          0 :             m_aOriginal.Erase();
    1659                 :          0 :             m_bModifiedOriginal = true;
    1660                 :          0 :             InitEditDictDialog( m_nCurrentDict );
    1661                 :            :         }
    1662                 :          0 :         return 0;
    1663                 :            :     }
    1664                 :            : 
    1665                 :          0 :     void HangulHanjaEditDictDialog::InitEditDictDialog( sal_uInt32 _nSelDict )
    1666                 :            :     {
    1667         [ #  # ]:          0 :         if( m_pSuggestions )
    1668                 :          0 :             m_pSuggestions->Clear();
    1669                 :            : 
    1670         [ #  # ]:          0 :         if( m_nCurrentDict != _nSelDict )
    1671                 :            :         {
    1672                 :          0 :             m_nCurrentDict = _nSelDict;
    1673                 :          0 :             m_aOriginal.Erase();
    1674                 :          0 :             m_bModifiedOriginal = true;
    1675                 :            :         }
    1676                 :            : 
    1677                 :          0 :         UpdateOriginalLB();
    1678                 :            : 
    1679 [ #  # ][ #  # ]:          0 :         m_aOriginalLB.SetText( m_aOriginal.Len()? m_aOriginal : m_aEditHintText, Selection( 0, SELECTION_MAX ) );
    1680                 :          0 :         m_aOriginalLB.GrabFocus();
    1681                 :            : 
    1682                 :          0 :         UpdateSuggestions();
    1683                 :          0 :         UpdateButtonStates();
    1684                 :          0 :     }
    1685                 :            : 
    1686                 :          0 :     void HangulHanjaEditDictDialog::UpdateOriginalLB( void )
    1687                 :            :     {
    1688         [ #  # ]:          0 :         m_aOriginalLB.Clear();
    1689                 :          0 :         Reference< XConversionDictionary >  xDict = m_rDictList[ m_nCurrentDict ];
    1690         [ #  # ]:          0 :         if( xDict.is() )
    1691                 :            :         {
    1692 [ #  # ][ #  # ]:          0 :             Sequence< OUString >    aEntries = xDict->getConversionEntries( ConversionDirection_FROM_LEFT );
    1693                 :          0 :             sal_uInt32              n = aEntries.getLength();
    1694         [ #  # ]:          0 :             OUString*               pEntry = aEntries.getArray();
    1695         [ #  # ]:          0 :             while( n )
    1696                 :            :             {
    1697 [ #  # ][ #  # ]:          0 :                 m_aOriginalLB.InsertEntry( *pEntry );
                 [ #  # ]
    1698                 :            : 
    1699                 :          0 :                 ++pEntry;
    1700                 :          0 :                 --n;
    1701         [ #  # ]:          0 :             }
    1702                 :            :         }
    1703                 :            :         else
    1704                 :            :         {
    1705                 :            :             DBG_WARNING( "+HangulHanjaEditDictDialog::UpdateOriginalLB(): dictionary faded away..." );
    1706                 :          0 :         }
    1707                 :          0 :     }
    1708                 :            : 
    1709                 :          0 :     void HangulHanjaEditDictDialog::UpdateButtonStates()
    1710                 :            :     {
    1711 [ #  # ][ #  # ]:          0 :         bool bHaveValidOriginalString = m_aOriginal.Len() && m_aOriginal != m_aEditHintText;
    1712 [ #  # ][ #  # ]:          0 :         bool bNew = bHaveValidOriginalString && m_pSuggestions && m_pSuggestions->GetCount() > 0;
                 [ #  # ]
    1713 [ #  # ][ #  # ]:          0 :         bNew = bNew && (m_bModifiedSuggestions || m_bModifiedOriginal);
                 [ #  # ]
    1714                 :            : 
    1715                 :          0 :         m_aNewPB.Enable( bNew );
    1716 [ #  # ][ #  # ]:          0 :         m_aDeletePB.Enable( !m_bModifiedOriginal && bHaveValidOriginalString );
    1717                 :          0 :     }
    1718                 :            : 
    1719                 :          0 :     void HangulHanjaEditDictDialog::UpdateSuggestions( void )
    1720                 :            :     {
    1721         [ #  # ]:          0 :         Sequence< OUString > aEntries;
    1722 [ #  # ][ #  # ]:          0 :         bool bFound = GetConversions( m_rDictList[ m_nCurrentDict ], m_aOriginal, aEntries );
    1723         [ #  # ]:          0 :         if( bFound )
    1724                 :            :         {
    1725                 :          0 :             m_bModifiedOriginal = false;
    1726                 :            : 
    1727         [ #  # ]:          0 :             if( m_pSuggestions )
    1728         [ #  # ]:          0 :                 m_pSuggestions->Clear();
    1729                 :            : 
    1730                 :            :             //fill found entries into boxes
    1731                 :          0 :             sal_uInt32 nCnt = aEntries.getLength();
    1732         [ #  # ]:          0 :             if( nCnt )
    1733                 :            :             {
    1734         [ #  # ]:          0 :                 if( !m_pSuggestions )
    1735 [ #  # ][ #  # ]:          0 :                     m_pSuggestions = new SuggestionList( MAXNUM_SUGGESTIONS );
    1736                 :            : 
    1737                 :          0 :                 const OUString* pSugg = aEntries.getConstArray();
    1738                 :          0 :                 sal_uInt32 n = 0;
    1739         [ #  # ]:          0 :                 while( nCnt )
    1740                 :            :                 {
    1741 [ #  # ][ #  # ]:          0 :                     m_pSuggestions->Set( pSugg[ n ], sal_uInt16( n ) );
                 [ #  # ]
    1742                 :          0 :                     ++n;
    1743                 :          0 :                     --nCnt;
    1744                 :            :                 }
    1745                 :            :             }
    1746                 :          0 :             m_bModifiedSuggestions=false;
    1747                 :            :         }
    1748                 :            : 
    1749         [ #  # ]:          0 :         m_aScrollSB.SetThumbPos( 0 );
    1750 [ #  # ][ #  # ]:          0 :         UpdateScrollbar();              // will force edits to be filled new
    1751                 :          0 :     }
    1752                 :            : 
    1753                 :          0 :     void HangulHanjaEditDictDialog::SetEditText( Edit& _rEdit, sal_uInt16 _nEntryNum )
    1754                 :            :     {
    1755         [ #  # ]:          0 :         String  aStr;
    1756         [ #  # ]:          0 :         if( m_pSuggestions )
    1757                 :            :         {
    1758                 :          0 :             const String*   p = m_pSuggestions->Get( _nEntryNum );
    1759         [ #  # ]:          0 :             if( p )
    1760         [ #  # ]:          0 :                 aStr = *p;
    1761                 :            :         }
    1762                 :            : 
    1763 [ #  # ][ #  # ]:          0 :         _rEdit.SetText( aStr );
    1764                 :          0 :     }
    1765                 :            : 
    1766                 :          0 :     void HangulHanjaEditDictDialog::EditModify( Edit* _pEdit, sal_uInt8 _nEntryOffset )
    1767                 :            :     {
    1768                 :          0 :         m_bModifiedSuggestions = true;
    1769                 :            : 
    1770         [ #  # ]:          0 :         String  aTxt( _pEdit->GetText() );
    1771                 :          0 :         sal_uInt16 nEntryNum = m_nTopPos + _nEntryOffset;
    1772         [ #  # ]:          0 :         if( aTxt.Len() == 0 )
    1773                 :            :         {
    1774                 :            :             //reset suggestion
    1775         [ #  # ]:          0 :             if( m_pSuggestions )
    1776         [ #  # ]:          0 :                 m_pSuggestions->Reset( nEntryNum );
    1777                 :            :         }
    1778                 :            :         else
    1779                 :            :         {
    1780                 :            :             //set suggestion
    1781         [ #  # ]:          0 :             if( !m_pSuggestions )
    1782 [ #  # ][ #  # ]:          0 :                 m_pSuggestions = new SuggestionList( MAXNUM_SUGGESTIONS );
    1783         [ #  # ]:          0 :             m_pSuggestions->Set( aTxt, nEntryNum );
    1784                 :            :         }
    1785                 :            : 
    1786 [ #  # ][ #  # ]:          0 :         UpdateButtonStates();
    1787                 :          0 :     }
    1788                 :            : 
    1789                 :          0 :     HangulHanjaEditDictDialog::HangulHanjaEditDictDialog( Window* _pParent, HHDictList& _rDictList, sal_uInt32 _nSelDict )
    1790                 :          0 :         :ModalDialog            ( _pParent, CUI_RES( RID_SVX_MDLG_HANGULHANJA_EDIT ) )
    1791         [ #  # ]:          0 :         ,m_aEditHintText        ( CUI_RES( STR_EDITHINT ) )
    1792                 :            :         ,m_rDictList            ( _rDictList )
    1793                 :            :         ,m_nCurrentDict         ( 0xFFFFFFFF )
    1794                 :            :         ,m_pSuggestions         ( NULL )
    1795         [ #  # ]:          0 :         ,m_aBookFT              ( this, CUI_RES( FT_BOOK ) )
    1796         [ #  # ]:          0 :         ,m_aBookLB              ( this, CUI_RES( LB_BOOK ) )
    1797         [ #  # ]:          0 :         ,m_aOriginalFT          ( this, CUI_RES( FT_ORIGINAL ) )
    1798         [ #  # ]:          0 :         ,m_aOriginalLB          ( this, CUI_RES( LB_ORIGINAL ) )
    1799         [ #  # ]:          0 :         ,m_aSuggestionsFT       ( this, CUI_RES( FT_SUGGESTIONS ) )
    1800         [ #  # ]:          0 :         ,m_aEdit1               ( this, CUI_RES( ED_1 ), m_aScrollSB, NULL, &m_aEdit2 )
    1801         [ #  # ]:          0 :         ,m_aEdit2               ( this, CUI_RES( ED_2 ), m_aScrollSB, &m_aEdit1, &m_aEdit3 )
    1802         [ #  # ]:          0 :         ,m_aEdit3               ( this, CUI_RES( ED_3 ), m_aScrollSB, &m_aEdit2, &m_aEdit4 )
    1803         [ #  # ]:          0 :         ,m_aEdit4               ( this, CUI_RES( ED_4 ), m_aScrollSB, &m_aEdit3, NULL )
    1804         [ #  # ]:          0 :         ,m_aScrollSB            ( this, CUI_RES( SB_SCROLL ) )
    1805         [ #  # ]:          0 :         ,m_aNewPB               ( this, CUI_RES( PB_HHE_NEW ) )
    1806         [ #  # ]:          0 :         ,m_aDeletePB            ( this, CUI_RES( PB_HHE_DELETE ) )
    1807         [ #  # ]:          0 :         ,m_aHelpPB              ( this, CUI_RES( PB_HHE_HELP ) )
    1808         [ #  # ]:          0 :         ,m_aClosePB             ( this, CUI_RES( PB_HHE_CLOSE ) )
    1809                 :            :         ,m_nTopPos              ( 0 )
    1810                 :            :         ,m_bModifiedSuggestions ( false )
    1811 [ #  # ][ #  # ]:          0 :         ,m_bModifiedOriginal    ( false )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
    1812                 :            :     {
    1813         [ #  # ]:          0 :         m_aOriginalLB.SetModifyHdl( LINK( this, HangulHanjaEditDictDialog, OriginalModifyHdl ) );
    1814                 :            : 
    1815         [ #  # ]:          0 :         m_aNewPB.SetClickHdl( LINK( this, HangulHanjaEditDictDialog, NewPBPushHdl ) );
    1816         [ #  # ]:          0 :         m_aNewPB.Enable( false );
    1817                 :            : 
    1818         [ #  # ]:          0 :         m_aDeletePB.SetClickHdl( LINK( this, HangulHanjaEditDictDialog, DeletePBPushHdl ) );
    1819                 :            : 
    1820         [ #  # ]:          0 :         m_aDeletePB.Enable( false );
    1821                 :            : 
    1822                 :            :     #if( MAXNUM_SUGGESTIONS <= 4 )
    1823                 :            :         #error number of suggestions should not under-run the value of 5
    1824                 :            :     #endif
    1825                 :            : 
    1826         [ #  # ]:          0 :         Link    aScrLk( LINK( this, HangulHanjaEditDictDialog, ScrollHdl ) );
    1827                 :          0 :         m_aScrollSB.SetScrollHdl( aScrLk );
    1828                 :          0 :         m_aScrollSB.SetEndScrollHdl( aScrLk );
    1829         [ #  # ]:          0 :         m_aScrollSB.SetRangeMin( 0 );
    1830         [ #  # ]:          0 :         m_aScrollSB.SetRangeMax( MAXNUM_SUGGESTIONS );
    1831                 :          0 :         m_aScrollSB.SetPageSize( 4 );       // because we have 4 edits / page
    1832         [ #  # ]:          0 :         m_aScrollSB.SetVisibleSize( 4 );
    1833                 :            : 
    1834         [ #  # ]:          0 :         m_aEdit1.SetModifyHdl( LINK( this, HangulHanjaEditDictDialog, EditModifyHdl1 ) );
    1835         [ #  # ]:          0 :         m_aEdit2.SetModifyHdl( LINK( this, HangulHanjaEditDictDialog, EditModifyHdl2 ) );
    1836         [ #  # ]:          0 :         m_aEdit3.SetModifyHdl( LINK( this, HangulHanjaEditDictDialog, EditModifyHdl3 ) );
    1837         [ #  # ]:          0 :         m_aEdit4.SetModifyHdl( LINK( this, HangulHanjaEditDictDialog, EditModifyHdl4 ) );
    1838                 :            : 
    1839         [ #  # ]:          0 :         m_aBookLB.SetSelectHdl( LINK( this, HangulHanjaEditDictDialog, BookLBSelectHdl ) );
    1840                 :          0 :         sal_uInt32  nDictCnt = m_rDictList.size();
    1841         [ #  # ]:          0 :         for( sal_uInt32 n = 0 ; n < nDictCnt ; ++n )
    1842                 :            :         {
    1843                 :          0 :             Reference< XConversionDictionary >  xDic( m_rDictList[n] );
    1844         [ #  # ]:          0 :             String aName;
    1845         [ #  # ]:          0 :             if(xDic.is())
    1846 [ #  # ][ #  # ]:          0 :                 aName = xDic->getName();
                 [ #  # ]
    1847         [ #  # ]:          0 :             m_aBookLB.InsertEntry( aName );
    1848         [ #  # ]:          0 :         }
    1849         [ #  # ]:          0 :         m_aBookLB.SelectEntryPos( sal_uInt16( _nSelDict ) );
    1850                 :            : 
    1851         [ #  # ]:          0 :         FreeResource();
    1852                 :            : 
    1853         [ #  # ]:          0 :         InitEditDictDialog( _nSelDict );
    1854                 :          0 :     }
    1855                 :            : 
    1856 [ #  # ][ #  # ]:          0 :     HangulHanjaEditDictDialog::~HangulHanjaEditDictDialog()
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
    1857                 :            :     {
    1858         [ #  # ]:          0 :         if( m_pSuggestions )
    1859 [ #  # ][ #  # ]:          0 :             delete m_pSuggestions;
    1860         [ #  # ]:          0 :     }
    1861                 :            : 
    1862                 :          0 :     void HangulHanjaEditDictDialog::UpdateScrollbar( void )
    1863                 :            :     {
    1864                 :          0 :         sal_uInt16  nPos = sal_uInt16( m_aScrollSB.GetThumbPos() );
    1865                 :          0 :         m_nTopPos = nPos;
    1866                 :            : 
    1867                 :          0 :         SetEditText( m_aEdit1, nPos++ );
    1868                 :          0 :         SetEditText( m_aEdit2, nPos++ );
    1869                 :          0 :         SetEditText( m_aEdit3, nPos++ );
    1870                 :          0 :         SetEditText( m_aEdit4, nPos );
    1871                 :          0 :     }
    1872                 :            : 
    1873                 :            : //.............................................................................
    1874                 :            : }   // namespace svx
    1875                 :            : //.............................................................................
    1876                 :            : 
    1877                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10