diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/helpid.hrc | 4 | ||||
-rw-r--r-- | svx/inc/svx/dialogs.hrc | 16 | ||||
-rw-r--r-- | svx/inc/svx/hangulhanja.hxx | 2 | ||||
-rw-r--r-- | svx/inc/svx/splwrap.hxx | 2 | ||||
-rw-r--r-- | svx/inc/svx/svxdlg.hxx | 28 | ||||
-rw-r--r-- | svx/inc/svx/thesdlg.hxx | 137 | ||||
-rw-r--r-- | svx/source/dialog/hyphen.cxx | 520 | ||||
-rw-r--r-- | svx/source/dialog/hyphen.hrc | 48 | ||||
-rw-r--r-- | svx/source/dialog/hyphen.hxx | 126 | ||||
-rw-r--r-- | svx/source/dialog/hyphen.src | 140 | ||||
-rw-r--r-- | svx/source/dialog/lingu.src | 41 | ||||
-rw-r--r-- | svx/source/dialog/makefile.mk | 4 | ||||
-rw-r--r-- | svx/source/dialog/splwrap.cxx | 23 | ||||
-rw-r--r-- | svx/source/dialog/thesdlg.cxx | 500 | ||||
-rw-r--r-- | svx/source/dialog/thesdlg.hrc | 62 | ||||
-rw-r--r-- | svx/source/dialog/thesdlg.src | 210 | ||||
-rw-r--r-- | svx/source/editeng/eeng_pch.hxx | 4 | ||||
-rw-r--r-- | svx/source/editeng/impedit4.cxx | 10 |
18 files changed, 48 insertions, 1829 deletions
diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc index bc36634e24c3..fdb7c00ba6c0 100644 --- a/svx/inc/helpid.hrc +++ b/svx/inc/helpid.hrc @@ -122,7 +122,7 @@ #define HID_GRFFILTER_SMOOTH (HID_SVX_START + 84) #define HID_GRFFILTER_SOBEL (HID_SVX_START + 85) #define HID_GRFFILTER_SOLARIZE (HID_SVX_START + 86) -#define HID_HYPHENATE (HID_SVX_START + 87) + #define HID_IMAPDLG_ACTIVE (HID_SVX_START + 88) #define HID_IMAPDLG_APPLY (HID_SVX_START + 89) #define HID_IMAPDLG_CIRCLE (HID_SVX_START + 90) @@ -226,7 +226,7 @@ #define HID_SVX_TP_DOCRECOVERY_SAVE (HID_SVX_START + 188) #define HID_SVX_TP_ERR_REP_SEND (HID_SVX_START + 189) #define HID_SVX_TP_ERR_REP_WELCOME (HID_SVX_START + 190) -#define HID_THES_LANGUAGE (HID_SVX_START + 191) + #define HID_VALUESET_EXTRUSION_DIRECTION (HID_SVX_START + 192) #define HID_VALUESET_EXTRUSION_LIGHTING (HID_SVX_START + 193) #define HID_WIN_FONTWORK_ALIGN (HID_SVX_START + 194) diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc index c7cddf48e27c..fa498eabfd47 100644 --- a/svx/inc/svx/dialogs.hrc +++ b/svx/inc/svx/dialogs.hrc @@ -179,11 +179,6 @@ #define RID_SVXPAGE_HEADER (RID_SVX_START + 27) #define RID_SVXQBX_DELETE_HEADFOOT (RID_SVX_START + 28) -// ResId fuer die Linguistik-Dialoge -#define RID_SVXDLG_HYPHENATE (RID_SVX_START + 30) -#define RID_SVXDLG_THESAURUS (RID_SVX_START + 31) -#define RID_SVXDLG_THES_LANGUAGE (RID_SVX_START + 38) - // ResIds fuer HM-QueryBoxen und Error-Strings #define RID_SVXQB_THESAURUS (RID_SVX_START + 33) #define RID_SVXQB_CONTINUE (RID_SVX_START + 34) @@ -427,16 +422,6 @@ #define RID_SVXSTR_SEARCH (RID_SVX_START + 81) #define RID_SVXSTR_REPLACE (RID_SVX_START + 82) -// Strings fuer die HM-Strings -#define RID_SVXSTR_HMSTATUS_BEGIN (RID_SVX_START + 90) -#define RID_SVXSTR_HMSTATUS_OK (RID_SVX_START + 90) -#define RID_SVXSTR_HMSTATUS_DONTUSE (RID_SVX_START + 91) -#define RID_SVXSTR_HMSTATUS_WRONG (RID_SVX_START + 92) -#define RID_SVXSTR_HMSTATUS_CAPERROR (RID_SVX_START + 93) -#define RID_SVXSTR_HMERR_CHECKINSTALL (RID_SVX_START + 94) -#define RID_SVXSTR_HMERR_ADDWORD (RID_SVX_START + 95) -#define RID_SVXSTR_HMSTATUS_INVALID_LANG (RID_SVX_START + 96) - // paper formats #define RID_SVXSTR_PAPER_A0 (RID_SVX_START + 100) #define RID_SVXSTR_PAPER_A1 (RID_SVX_START + 101) @@ -484,7 +469,6 @@ // HM_ERR #define RID_SVXSTR_HMERR_THESAURUS (RID_SVX_START + 150) -#define RID_SVXSTR_HMERR_HYPH (RID_SVX_START + 151) // Strings der ToolBox-Controls aus tbcontrl.cxx #define RID_SVXSTR_FILLPATTERN (RID_SVX_START + 191) diff --git a/svx/inc/svx/hangulhanja.hxx b/svx/inc/svx/hangulhanja.hxx index e4eefce17ea3..239edb9e74a2 100644 --- a/svx/inc/svx/hangulhanja.hxx +++ b/svx/inc/svx/hangulhanja.hxx @@ -31,8 +31,6 @@ #define SVX_HANGUL_HANJA_CONVERSION_HXX #include <vcl/window.hxx> -#include <svx/svxenum.hxx> - #include <memory> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/Locale.hpp> diff --git a/svx/inc/svx/splwrap.hxx b/svx/inc/svx/splwrap.hxx index e9b71d12320f..731e2ba24991 100644 --- a/svx/inc/svx/splwrap.hxx +++ b/svx/inc/svx/splwrap.hxx @@ -81,7 +81,7 @@ private: // aufnehmen und nicht den Dialog starten. SVX_DLLPRIVATE sal_Bool SpellNext(); // naechsten Bereich anwaehlen - SVX_DLLPRIVATE sal_Bool FindSpellError(); // Suche nach Fehlern ( ueber Bereiche hinweg ) + sal_Bool FindSpellError(); // Suche nach Fehlern ( ueber Bereiche hinweg ) public: SvxSpellWrapper( Window* pWn, diff --git a/svx/inc/svx/svxdlg.hxx b/svx/inc/svx/svxdlg.hxx index 23db741f0991..6f287153f0f8 100644 --- a/svx/inc/svx/svxdlg.hxx +++ b/svx/inc/svx/svxdlg.hxx @@ -47,6 +47,8 @@ namespace linguistic2{ class XDictionary; class XSpellChecker1; class XSpellChecker; + class XThesaurus; + class XHyphenator; }}}} class SvxSpellWrapper; //add for SvxSpellCheckDialog typedef SfxTabPage* (*CreateSvxDistributePage)(Window *pParent, const SfxItemSet &rAttrSet, SvxDistributeHorizontal eHor, SvxDistributeVertical eVer); @@ -61,6 +63,8 @@ class SearchAttrItemList; class FmFormShell; class Graphic; class SdrObject; +class SvxSpellWrapper; + namespace svx{ class SpellDialogChildWindow;} #define EMPTY_FRAME_REF com::sun::star::uno::Reference < com::sun::star::frame::XFrame >() @@ -100,6 +104,22 @@ class AbstractHangulHanjaConversionDialog : public VclAbstractTerminatedDialog / virtual String GetCurrentSuggestion( ) const =0; }; +class AbstractThesaurusDialog : public VclAbstractDialog +{ +public: + virtual String GetWord() = 0; + virtual sal_uInt16 GetLanguage() const = 0; + virtual Window* GetWindow() = 0; +}; + +class AbstractHyphenWordDialog : public VclAbstractDialog +{ +public: + virtual void SelLeft() = 0; + virtual void SelRight() = 0; + virtual Window* GetWindow() = 0; +}; + class AbstractFmShowColsDialog : public VclAbstractDialog //add for FmShowColsDialog { public: @@ -381,6 +401,14 @@ public: virtual AbstractHangulHanjaConversionDialog * CreateHangulHanjaConversionDialog( Window* _pParent, //add for HangulHanjaConversionDialog CHINA001 HangulHanjaConversion::ConversionDirection _ePrimaryDirection ) = 0; + virtual AbstractThesaurusDialog* CreateThesaurusDialog( Window*, ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XThesaurus > xThesaurus, + const String &rWord, sal_Int16 nLanguage ) = 0; + + virtual AbstractHyphenWordDialog* CreateHyphenWordDialog( Window*, + const String &rWord, LanguageType nLang, + ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > &xHyphen, + SvxSpellWrapper* pWrapper ) = 0; + virtual AbstractFmShowColsDialog * CreateFmShowColsDialog( Window* pParent ) = 0; virtual AbstractSvxZoomDialog * CreateSvxZoomDialog( Window* pParent, //add for SvxZoomDialog diff --git a/svx/inc/svx/thesdlg.hxx b/svx/inc/svx/thesdlg.hxx deleted file mode 100644 index 4ca5376ad8a7..000000000000 --- a/svx/inc/svx/thesdlg.hxx +++ /dev/null @@ -1,137 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: thesdlg.hxx,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SVX_THESDLG_HXX -#define _SVX_THESDLG_HXX -// include --------------------------------------------------------------- - -#ifndef _EDIT_HXX //autogen -#include <vcl/edit.hxx> -#endif -#ifndef _BUTTON_HXX //autogen -#include <vcl/button.hxx> -#endif -#ifndef _LSTBOX_HXX //autogen -#include <vcl/lstbox.hxx> -#endif -#ifndef _FIXED_HXX //autogen -#include <vcl/fixed.hxx> -#endif -#include <svx/stddlg.hxx> -#include <com/sun/star/uno/Sequence.hxx> -#include <com/sun/star/uno/Reference.hxx> -#include <com/sun/star/beans/PropertyValues.hpp> -#include "svx/svxdllapi.h" - -// forward --------------------------------------------------------------- - -struct ThesDlg_Impl; - -class SvxThesaurusLanguageDlg_Impl; - -namespace com { namespace sun { namespace star { - namespace linguistic2 { - class XThesaurus; - class XMeaning; - } - namespace lang { - struct Locale; - } -}}} - -// class SvxThesaurusDialog ---------------------------------------------- - -class SVX_DLLPUBLIC SvxThesaurusDialog : public SvxStandardDialog -{ -public: - friend class SvxThesaurusLanguageDlg_Impl; - - SvxThesaurusDialog( Window* pParent, - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XThesaurus > xThesaurus, - const String &rWord, sal_Int16 nLanguage ); - ~SvxThesaurusDialog(); - - String GetWord() { return aReplaceEdit.GetText(); } - - sal_uInt16 GetLanguage() const; - -private: - FixedText aWordText; - ListBox aWordLB; - FixedText aReplaceText; - Edit aReplaceEdit; - FixedText aMeanText; - ListBox aMeanLB; - FixedText aSynonymText; - ListBox aSynonymLB; - FixedLine aVarFL; - - OKButton aOkBtn; - CancelButton aCancelBtn; - PushButton aLookUpBtn; - PushButton aLangBtn; - HelpButton aHelpBtn; - - String aErrStr; - - ThesDlg_Impl* pImpl; // always != NULL - - SVX_DLLPRIVATE virtual void Apply(); - -#ifdef _SVX_THESDLG_CXX - SVX_DLLPRIVATE void UpdateSynonymBox_Impl(); - SVX_DLLPRIVATE void UpdateMeaningBox_Impl( - ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XMeaning > > *pMeaningSeq = NULL ); - SVX_DLLPRIVATE void Init_Impl(sal_Int16 nLanguage); - - ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XMeaning > > SAL_CALL - queryMeanings_Impl( - ::rtl::OUString& rTerm, - const ::com::sun::star::lang::Locale& rLocale, - const ::com::sun::star::beans::PropertyValues& rProperties ) - throw(::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); - - // Handler - DECL_LINK( SelectHdl_Impl, ListBox * ); - DECL_LINK( SynonymHdl_Impl, ListBox * ); - DECL_LINK( LookUpHdl_Impl, Button * ); - DECL_LINK( LanguageHdl_Impl, Button * ); - DECL_LINK( EntryHdl_Impl, ListBox * ); - DECL_LINK( SpellErrorHdl_Impl, void * ); -#endif -}; - -#endif - diff --git a/svx/source/dialog/hyphen.cxx b/svx/source/dialog/hyphen.cxx deleted file mode 100644 index a637fca091e5..000000000000 --- a/svx/source/dialog/hyphen.cxx +++ /dev/null @@ -1,520 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: hyphen.cxx,v $ - * $Revision: 1.14 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svx.hxx" - -// include --------------------------------------------------------------- -#include <tools/shl.hxx> -#include <tools/list.hxx> -#include <com/sun/star/linguistic2/XPossibleHyphens.hpp> -#include <vcl/msgbox.hxx> - - -#define _SVX_HYPHEN_CXX - -#include <svx/dialogs.hrc> -#include "hyphen.hrc" - -#include <svx/svxenum.hxx> -#include "hyphen.hxx" -#include <svx/splwrap.hxx> -#include "dlgutil.hxx" -#include <svx/dialmgr.hxx> -#include <unolingu.hxx> -#include <svtools/langtab.hxx> - -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::linguistic2; - -#undef S2U -#undef U2S -//#define S2U(s) StringToOUString(s, CHARSET_SYSTEM) -//#define U2S(s) OUStringToString(s, CHARSET_SYSTEM) - -// define ---------------------------------------------------------------- - -#define HYPHHERE '-' -#define CONTINUE_HYPH USHRT_MAX - -// Dies ist nur ein Hack, weil an dieser Stelle das extern char aus hmwrap -// nicht bekannt ist, wird demnaechst in hmwrap durch ein define ersetzt. -#define SW_SOFT_HYPHEN '=' - -// class SvxHyphenEdit --------------------------------------------------- - -SvxHyphenEdit::SvxHyphenEdit( Window* pParent, const ResId& rResId ) : - - Edit( pParent, rResId ) -{ -} - -// ----------------------------------------------------------------------- - -void SvxHyphenEdit::KeyInput( const KeyEvent& rKEvt ) -{ -// sal_uInt16 nMod = rKEvt.GetKeyCode().GetModifier(); - sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); - - switch ( nCode ) - { - case KEY_LEFT: - ( (SvxHyphenWordDialog*)GetParent() )->SelLeft(); - break; - - case KEY_RIGHT: - ( (SvxHyphenWordDialog*)GetParent() )->SelRight(); - break; - - case KEY_TAB: - case KEY_ESCAPE: - case KEY_RETURN: - Edit::KeyInput(rKEvt); - break; - default: - Control::KeyInput( rKEvt ); // An den Dialog weiterleiten - break; - } -} - -// class SvxHyphenWordDialog --------------------------------------------- - -SvxHyphenWordDialog::SvxHyphenWordDialog( const String &rWord, LanguageType nLang, - Window* pParent, - Reference< XHyphenator > &xHyphen, - SvxSpellWrapper* pWrapper ) : - SfxModalDialog( pParent, SVX_RES( RID_SVXDLG_HYPHENATE ) ), - - aWordFT ( this, SVX_RES( FT_WORD ) ), - aWordEdit ( this, SVX_RES( ED_WORD ) ), - aLeftBtn ( this, SVX_RES( BTN_LEFT ) ), - aRightBtn ( this, SVX_RES( BTN_RIGHT ) ), - aOkBtn ( this, SVX_RES( BTN_HYPH_CUT ) ), - aCancelBtn ( this, SVX_RES( BTN_HYPH_CANCEL ) ), - aContBtn ( this, SVX_RES( BTN_HYPH_CONTINUE ) ), - aDelBtn ( this, SVX_RES( BTN_HYPH_DELETE ) ), - aHelpBtn ( this, SVX_RES( BTN_HYPH_HELP ) ), - aLabel ( GetText() ), - pHyphWrapper ( pWrapper ), - xHyphenator ( xHyphen ), - aActWord ( rWord ), - nActLanguage ( nLang ), - nHyphPos ( 0 ), - nOldPos ( 0 ), - bBusy ( sal_False ) -{ - aContBtn.SetClickHdl( - LINK( this, SvxHyphenWordDialog, ContinueHdl_Impl ) ); - aOkBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, CutHdl_Impl ) ); - aDelBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, DeleteHdl_Impl ) ); - aCancelBtn.SetClickHdl( - LINK( this, SvxHyphenWordDialog, CancelHdl_Impl ) ); - aLeftBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, Left_Impl ) ); - aRightBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, Right_Impl ) ); - - aWordEdit.SetGetFocusHdl( - LINK( this, SvxHyphenWordDialog, GetFocusHdl_Impl ) ); - - Reference< XHyphenatedWord > xHyphWord( pWrapper ? - pWrapper->GetLast() : Reference< XInterface > () , UNO_QUERY ); - DBG_ASSERT(xHyphWord.is(), "missing hyphenated word"); - nMaxHyphenationPos = xHyphWord.is() ? xHyphWord->getHyphenationPos() : 0; - SetLabel_Impl( nLang ); - - InitControls_Impl(); - aWordEdit.GrabFocus(); - - FreeResource(); - - // disable controls if service is not available - if (!xHyphenator.is()) - Enable( sal_False ); -} - -// ----------------------------------------------------------------------- - -void SvxHyphenWordDialog::SelLeft() -{ - String aTxt( aWordEdit.GetText() ); - - for ( xub_StrLen i = nOldPos + 1; i-- > 0 ; ) - { - DBG_ASSERT(i <= aTxt.Len(), "index out of range"); - if( aTxt.GetChar( i ) == sal_Unicode( SW_SOFT_HYPHEN ) ) - { - aTxt.SetChar( i, sal_Unicode( HYPHHERE ) ); - - if ( nOldPos != 0 && nOldPos != aTxt.Len() ) - aTxt.SetChar( nOldPos, sal_Unicode( SW_SOFT_HYPHEN ) ); - nOldPos = i; - aWordEdit.SetText( aTxt ); - aWordEdit.GrabFocus(); - aWordEdit.SetSelection( Selection( i, i + 1 ) ); - break; - } - } - nHyphPos = GetHyphIndex_Impl(); - EnableLRBtn_Impl(); -} - -// ----------------------------------------------------------------------- - -void SvxHyphenWordDialog::SelRight() -{ - String aTxt( aWordEdit.GetText() ); - - for ( xub_StrLen i = nOldPos + 1; i < aTxt.Len(); ++i ) - { - if( aTxt.GetChar( i ) == sal_Unicode( SW_SOFT_HYPHEN ) ) - { - aTxt.SetChar( i, sal_Unicode( HYPHHERE ) ); - - if ( nOldPos != 0 && nOldPos != aTxt.Len() ) - aTxt.SetChar( nOldPos, sal_Unicode( SW_SOFT_HYPHEN ) ); - nOldPos = i; - aWordEdit.SetText( aTxt ); - aWordEdit.GrabFocus(); - aWordEdit.SetSelection( Selection( i, i + 1 ) ); - break; - } - } - nHyphPos = GetHyphIndex_Impl(); - EnableLRBtn_Impl(); -} - -// ----------------------------------------------------------------------- - -void SvxHyphenWordDialog::EnableLRBtn_Impl() -{ - String aTxt( aWordEdit.GetText() ); - xub_StrLen nLen = aTxt.Len(); - xub_StrLen i; - - aRightBtn.Disable(); - for ( i = nOldPos + 2; i < nLen; ++i ) - { - if ( aTxt.GetChar( i ) == sal_Unicode( SW_SOFT_HYPHEN ) ) - { - aRightBtn.Enable(); - break; - } - } - - DBG_ASSERT(nOldPos < aTxt.Len(), "nOldPos out of range"); - if (nOldPos >= aTxt.Len()) - nOldPos = aTxt.Len() - 1; - aLeftBtn.Disable(); - for ( i = nOldPos; i-- > 0; ) - { - if ( aTxt.GetChar( i ) == sal_Unicode( SW_SOFT_HYPHEN ) ) - { - aLeftBtn.Enable(); - break; - } - } -} - -// ----------------------------------------------------------------------- - - -void SvxHyphenWordDialog::SetLabel_Impl( LanguageType nLang ) -{ - String aLangStr( SvtLanguageTable::GetLanguageString( nLang ) ); - String aTmp( aLabel ); - aTmp.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " (" ) ); - aTmp.Append( aLangStr ); - aTmp.Append( sal_Unicode( ')' ) ); - SetText( aTmp ); -} - -// ----------------------------------------------------------------------- - -String SvxHyphenWordDialog::EraseUnusableHyphens_Impl( - Reference< XPossibleHyphens > &rxPossHyph, - sal_uInt16 _nMaxHyphenationPos ) -{ - // returns a String showing only those hyphen positions which will result - // in a line break if hyphenation is done there - - String aTxt; - DBG_ASSERT(rxPossHyph.is(), "missing possible hyphens"); - if (rxPossHyph.is()) - { - aTxt = String( rxPossHyph->getPossibleHyphens() ); - - Sequence< sal_Int16 > aHyphenationPositions( - rxPossHyph->getHyphenationPositions() ); - sal_Int32 nLen = aHyphenationPositions.getLength(); - const sal_Int16 *pHyphenationPos = aHyphenationPositions.getConstArray(); - - // find position nIdx after which all hyphen positions are unusable - xub_StrLen nIdx = STRING_NOTFOUND, - nPos; - if (nLen) - { - xub_StrLen nStart = 0; - for (sal_Int32 i = 0; i < nLen; ++i) - { - if (pHyphenationPos[i] > _nMaxHyphenationPos) - break; - else - { - // find corresponding hyphen pos in string - nPos = aTxt.Search( sal_Unicode( SW_SOFT_HYPHEN ), nStart ); - - if (nStart == STRING_NOTFOUND) - break; - else - { - nIdx = nPos; - nStart = nPos + 1; - } - } - } - } - DBG_ASSERT(nIdx != STRING_NOTFOUND, "no usable hyphenation position"); - - // remove not usable hyphens from string - nPos = nIdx == STRING_NOTFOUND ? 0 : nIdx + 1; - String aTmp( sal_Unicode( SW_SOFT_HYPHEN ) ), - aEmpty; - while (nPos != STRING_NOTFOUND) - nPos = aTxt.SearchAndReplace( aTmp, aEmpty, nPos + 1 ); - } - return aTxt; -} - -// ----------------------------------------------------------------------- - -void SvxHyphenWordDialog::InitControls_Impl() -{ - String aTxt; - xPossHyph = NULL; - if (xHyphenator.is()) - { - lang::Locale aLocale( SvxCreateLocale(nActLanguage) ); - xPossHyph = xHyphenator->createPossibleHyphens( aActWord, aLocale, - Sequence< PropertyValue >() ); - if (xPossHyph.is()) - { - aTxt = EraseUnusableHyphens_Impl( xPossHyph, nMaxHyphenationPos ); - } - SetLabel_Impl( nActLanguage ); - } - aWordEdit.SetText( aTxt ); - - nOldPos = aTxt.Len(); - SelLeft(); - EnableLRBtn_Impl(); -} - -// ----------------------------------------------------------------------- - -void SvxHyphenWordDialog::ContinueHyph_Impl( sal_uInt16 nInsPos ) -{ - if ( nInsPos != CONTINUE_HYPH && xPossHyph.is()) - { - if (nInsPos) - { - //String aTmp( U2S( xPossHyph->getPossibleHyphens() ) ); - String aTmp( aWordEdit.GetText() ); - DBG_ASSERT(nInsPos <= aTmp.Len() - 2, "wrong hyphen position"); - - sal_uInt16 nIdxPos = 0; - sal_uInt16 i = 0; - sal_Unicode c; - while (i < aTmp.Len() && HYPHHERE != (c = aTmp.GetChar(i++)) ) - { - if (SW_SOFT_HYPHEN == c) - nIdxPos++; - } - - Sequence< sal_Int16 > aSeq = xPossHyph->getHyphenationPositions(); - sal_Int32 nLen = aSeq.getLength(); - DBG_ASSERT(nLen, "empty sequence"); - DBG_ASSERT(nIdxPos < nLen, "index out of range"); - if (nLen && nIdxPos < nLen) - { - nInsPos = aSeq.getConstArray()[ nIdxPos ]; - pHyphWrapper->InsertHyphen( nInsPos ); - } - } - else - { - //! calling with 0 as argument will remove hyphens! - pHyphWrapper->InsertHyphen( nInsPos ); - } - } - - if ( pHyphWrapper->FindSpellError() ) - { - Reference< XHyphenatedWord > xHyphWord( pHyphWrapper->GetLast(), UNO_QUERY ); - - // adapt actual word and language to new found hyphenation result - if(xHyphWord.is()) - { - aActWord = String( xHyphWord->getWord() ); - nActLanguage = SvxLocaleToLanguage( xHyphWord->getLocale() ); - nMaxHyphenationPos = xHyphWord->getHyphenationPos(); - InitControls_Impl(); - } - } - else - EndDialog( RET_OK ); -} - -// ----------------------------------------------------------------------- - -sal_uInt16 SvxHyphenWordDialog::GetHyphIndex_Impl() -{ - sal_uInt16 nPos = 0; - String aTxt(aWordEdit.GetText()); - - for ( sal_uInt16 i=0 ; i < aTxt.Len(); ++i ) - { - sal_Unicode nChar = aTxt.GetChar( i ); - - if ( nChar == HYPHHERE ) - break; - - if ( nChar != SW_SOFT_HYPHEN ) - nPos++; - } - return nPos; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK_INLINE_START( SvxHyphenWordDialog, CutHdl_Impl, Button *, EMPTYARG ) -{ - if( !bBusy ) - { - bBusy = sal_True; - ContinueHyph_Impl( nHyphPos ); - bBusy = sal_False; - } - return 0; -} -IMPL_LINK_INLINE_END( SvxHyphenWordDialog, CutHdl_Impl, Button *, EMPTYARG ) - -// ----------------------------------------------------------------------- - -IMPL_LINK_INLINE_START( SvxHyphenWordDialog, DeleteHdl_Impl, Button *, EMPTYARG ) -{ - if( !bBusy ) - { - bBusy = sal_True; - ContinueHyph_Impl(); - bBusy = sal_False; - } - return 0; -} -IMPL_LINK_INLINE_END( SvxHyphenWordDialog, DeleteHdl_Impl, Button *, EMPTYARG ) - -// ----------------------------------------------------------------------- - -IMPL_LINK_INLINE_START( SvxHyphenWordDialog, ContinueHdl_Impl, Button *, EMPTYARG ) -{ - if( !bBusy ) - { - bBusy = sal_True; - ContinueHyph_Impl( CONTINUE_HYPH ); - bBusy = sal_False; - } - return 0; -} -IMPL_LINK_INLINE_END( SvxHyphenWordDialog, ContinueHdl_Impl, Button *, EMPTYARG ) - -// ----------------------------------------------------------------------- - -IMPL_LINK_INLINE_START( SvxHyphenWordDialog, CancelHdl_Impl, Button *, EMPTYARG ) -{ - if( !bBusy ) - { - bBusy = sal_True; - pHyphWrapper->SpellEnd(); - EndDialog( RET_CANCEL ); - bBusy = sal_False; - } - return 0; -} -IMPL_LINK_INLINE_END( SvxHyphenWordDialog, CancelHdl_Impl, Button *, EMPTYARG ) - -// ----------------------------------------------------------------------- - -IMPL_LINK_INLINE_START( SvxHyphenWordDialog, Left_Impl, Button *, EMPTYARG ) -{ - if( !bBusy ) - { - bBusy = sal_True; - SelLeft(); - bBusy = sal_False; - } - return 0; -} -IMPL_LINK_INLINE_END( SvxHyphenWordDialog, Left_Impl, Button *, EMPTYARG ) - -// ----------------------------------------------------------------------- - -IMPL_LINK_INLINE_START( SvxHyphenWordDialog, Right_Impl, Button *, EMPTYARG ) -{ - if( !bBusy ) - { - bBusy = sal_True; - SelRight(); - bBusy = sal_False; - } - return 0; -} -IMPL_LINK_INLINE_END( SvxHyphenWordDialog, Right_Impl, Button *, EMPTYARG ) - -// ----------------------------------------------------------------------- - -IMPL_LINK_INLINE_START( SvxHyphenWordDialog, GetFocusHdl_Impl, Edit *, EMPTYARG ) -{ - aWordEdit.SetSelection( Selection( nOldPos, nOldPos + 1 ) ); - return 0; -} -IMPL_LINK_INLINE_END( SvxHyphenWordDialog, GetFocusHdl_Impl, Edit *, EMPTYARG ) - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxHyphenWordDialog, LangError_Impl, void *, nLang ) -{ - // Status anzeigen - String aErr( SvtLanguageTable::GetLanguageString( (LanguageType)(sal_IntPtr)nLang ) ); - aErr += SVX_RESSTR( RID_SVXSTR_HMERR_CHECKINSTALL ); - InfoBox( this, aErr ).Execute(); - return 0; -} - - diff --git a/svx/source/dialog/hyphen.hrc b/svx/source/dialog/hyphen.hrc deleted file mode 100644 index a87b7b6588b8..000000000000 --- a/svx/source/dialog/hyphen.hrc +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: hyphen.hrc,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SVX_HYPHEN_HRC -#define _SVX_HYPHEN_HRC - -// defines ------------------------------------------------------------------ - -#define ED_WORD 10 -#define BTN_LEFT 11 -#define BTN_RIGHT 12 -#define FT_WORD 13 - -#define BTN_HYPH_CONTINUE 20 -#define BTN_HYPH_DELETE 21 -#define BTN_HYPH_CUT 22 -#define BTN_HYPH_CANCEL 23 -#define BTN_HYPH_HELP 24 - - -#endif - diff --git a/svx/source/dialog/hyphen.hxx b/svx/source/dialog/hyphen.hxx deleted file mode 100644 index 5508183c2d3e..000000000000 --- a/svx/source/dialog/hyphen.hxx +++ /dev/null @@ -1,126 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: hyphen.hxx,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SVX_HYPHEN_HXX -#define _SVX_HYPHEN_HXX - -// include --------------------------------------------------------------- - -#include <vcl/edit.hxx> -#ifndef _SV_BUTTON_HXX -#include <vcl/button.hxx> -#endif -#include <vcl/fixed.hxx> -#include <sfx2/basedlgs.hxx> -#include <com/sun/star/uno/Reference.hxx> -// forward --------------------------------------------------------------- - -namespace com{namespace sun{namespace star{ -namespace linguistic2{ - class XHyphenator; - class XPossibleHyphens; -}}}} - -class SvxSpellWrapper; - -// class SvxHyphenEdit --------------------------------------------------- - -class SvxHyphenEdit : public Edit -{ -public: - SvxHyphenEdit( Window* pParent, const ResId& rResId ); - -protected: - virtual void KeyInput( const KeyEvent &rKEvt ); -}; - -// class SvxHyphenWordDialog --------------------------------------------- - -class SvxHyphenWordDialog : public SfxModalDialog -{ -public: - SvxHyphenWordDialog( const String &rWord, LanguageType nLang, - Window* pParent, - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XHyphenator > &xHyphen, - SvxSpellWrapper* pWrapper ); - - void SelLeft(); - void SelRight(); - -private: - FixedText aWordFT; - SvxHyphenEdit aWordEdit; - ImageButton aLeftBtn; - ImageButton aRightBtn; - OKButton aOkBtn; - CancelButton aCancelBtn; - PushButton aContBtn; - PushButton aDelBtn; - HelpButton aHelpBtn; - String aLabel; - SvxSpellWrapper* pHyphWrapper; - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XHyphenator > xHyphenator; - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XPossibleHyphens > xPossHyph; - String aActWord; // actual (to be displayed) word - LanguageType nActLanguage; // and language - sal_uInt16 nMaxHyphenationPos; // right most valid hyphenation pos - sal_uInt16 nHyphPos; - sal_uInt16 nOldPos; - sal_Bool bBusy; - -#ifdef _SVX_HYPHEN_CXX - void EnableLRBtn_Impl(); - //void EnableCutBtn_Impl(); - void SetLabel_Impl( LanguageType nLang ); - String EraseUnusableHyphens_Impl( - ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XPossibleHyphens > &rxPossHyph, - sal_uInt16 nMaxHyphenationPos ); - - void InitControls_Impl(); - void ContinueHyph_Impl( sal_uInt16 nInsPos = 0 ); - sal_uInt16 GetHyphIndex_Impl(); - - DECL_LINK( CutHdl_Impl, Button* ); - DECL_LINK( DeleteHdl_Impl, Button* ); - DECL_LINK( ContinueHdl_Impl, Button* ); - DECL_LINK( CancelHdl_Impl, Button* ); - DECL_LINK( Left_Impl, Button* ); - DECL_LINK( Right_Impl, Button* ); - DECL_LINK( GetFocusHdl_Impl, Edit* ); - DECL_LINK( LangError_Impl, void* ); -#endif -}; - - -#endif - diff --git a/svx/source/dialog/hyphen.src b/svx/source/dialog/hyphen.src deleted file mode 100644 index aa423028e6e2..000000000000 --- a/svx/source/dialog/hyphen.src +++ /dev/null @@ -1,140 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: hyphen.src,v $ - * $Revision: 1.24 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include "helpid.hrc" -#include <svx/dialogs.hrc> -#include "hyphen.hrc" - // pragma ---------------------------------------------------------------- - - // RID_SVXDLG_HYPHENATE -------------------------------------------------- -ModalDialog RID_SVXDLG_HYPHENATE -{ - HelpId = HID_HYPHENATE ; - Size = MAP_APPFONT ( 188 , 100 ) ; - OutputSize = TRUE ; - SvLook = TRUE ; - Text [ en-US ] = "Hyphenation" ; - Moveable = TRUE ; - Edit ED_WORD - { - BORDER = TRUE ; - Pos = MAP_APPFONT ( 6 , 17 ) ; - Size = MAP_APPFONT ( 120 , 12 ) ; - TABSTOP = TRUE ; - LEFT = TRUE ; - }; - ImageButton BTN_LEFT - { - Pos = MAP_APPFONT ( 6 , 33 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - TABSTOP = TRUE ; - SYMBOL = IMAGEBUTTON_ARROW_LEFT ; - }; - ImageButton BTN_RIGHT - { - Pos = MAP_APPFONT ( 22 , 33 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - TABSTOP = TRUE ; - Symbol = IMAGEBUTTON_ARROW_RIGHT ; - }; - FixedText FT_WORD - { - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Text [ en-US ] = "~Word" ; - }; - PushButton BTN_HYPH_CONTINUE - { - Pos = MAP_APPFONT ( 132 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Next" ; - TABSTOP = TRUE ; - }; - PushButton BTN_HYPH_DELETE - { - Pos = MAP_APPFONT ( 132 , 60 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Remove" ; - TABSTOP = TRUE ; - }; - OKButton BTN_HYPH_CUT - { - Pos = MAP_APPFONT ( 132 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Hyphenate" ; - TABSTOP = TRUE ; - DEFBUTTON = TRUE ; - }; - CancelButton BTN_HYPH_CANCEL - { - Pos = MAP_APPFONT ( 132 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TABSTOP = TRUE ; - }; - HelpButton BTN_HYPH_HELP - { - Pos = MAP_APPFONT ( 132 , 80 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TABSTOP = TRUE ; - }; -}; - // ******************************************************************* EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svx/source/dialog/lingu.src b/svx/source/dialog/lingu.src index 0ad46765b258..73b2bd02f51a 100644 --- a/svx/source/dialog/lingu.src +++ b/svx/source/dialog/lingu.src @@ -80,47 +80,6 @@ QueryBox RID_SVXQB_SPECIAL_FORCED /* ### ACHTUNG: Neuer Text in Resource? Sonderbereichprfung ist ausgeschaltet, Trotzdem prfen? : Sonderbereichprfung ist ausgeschaltet, Trotzdem prfen? */ Message [ en-US ] = "Check special regions is deactivated. Check anyway?" ; }; - // Strings --------------------------------------------------------------- -String RID_SVXSTR_HMSTATUS_OK -{ - Text [ en-US ] = "The word is spelled correctly" ; -}; -String RID_SVXSTR_HMSTATUS_DONTUSE -{ - Text [ en-US ] = "Avoid using this word" ; -}; -String RID_SVXSTR_HMSTATUS_WRONG -{ - Text [ en-US ] = "Unknown word." ; -}; -String RID_SVXSTR_HMSTATUS_CAPERROR -{ - /* ### ACHTUNG: Neuer Text in Resource? Gro- / Kleinschreibungs - Fehler : Gro- / Kleinschreibungs - Fehler */ - /* ### ACHTUNG: Neuer Text in Resource? Gro- / Kleinschreibungs - Fehler : Gro- / Kleinschreibungs - Fehler */ - Text [ en-US ] = "Capitalization error" ; -}; -String RID_SVXSTR_HMSTATUS_INVALID_LANG -{ - Text [ en-US ] = "Language not supported"; -}; -String RID_SVXSTR_HMERR_CHECKINSTALL -{ - /* ### ACHTUNG: Neuer Text in Resource? ist fr die Prfung nicht verfgbar. \nberprfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewnschte Sprache : ist fr die Prfung nicht verfgbar. \nberprfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewnschte Sprache */ - /* ### ACHTUNG: Neuer Text in Resource? ist fr die Prfung nicht verfgbar. \nberprfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewnschte Sprache : ist fr die Prfung nicht verfgbar. \nberprfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewnschte Sprache */ - Text [ en-US ] = "is not available for spellchecking\nPlease check your installation and install the desired language\n" ; -}; -String RID_SVXSTR_HMERR_ADDWORD -{ - /* ### ACHTUNG: Neuer Text in Resource? Das Wort konnte nicht ins Wrterbuch aufgenommen werden. : Das Wort konnte nicht ins Wrterbuch aufgenommen werden. */ - /* ### ACHTUNG: Neuer Text in Resource? Das Wort konnte nicht ins Wrterbuch aufgenommen werden. : Das Wort konnte nicht ins Wrterbuch aufgenommen werden. */ - Text [ en-US ] = "The word could not be added to dictionary" ; -}; -String RID_SVXSTR_HMERR_HYPH -{ - /* ### ACHTUNG: Neuer Text in Resource? Die Trennhilfe ist nicht verfgbar : Die Trennhilfe ist nicht verfgbar */ - /* ### ACHTUNG: Neuer Text in Resource? Die Trennhilfe ist nicht verfgbar : Die Trennhilfe ist nicht verfgbar */ - Text [ en-US ] = "Hyphenation not available" ; -}; String RID_SVXSTR_HMERR_THESAURUS { /* ### ACHTUNG: Neuer Text in Resource? Ein Thesaurus fr die eingestellte Sprache ist nicht verfgbar. \nberprfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewnschte Sprache : Ein Thesaurus fr die eingestellte Sprache ist nicht verfgbar. \nberprfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewnschte Sprache */ diff --git a/svx/source/dialog/makefile.mk b/svx/source/dialog/makefile.mk index 7bcdcf4a4c1f..cc4c2f968beb 100644 --- a/svx/source/dialog/makefile.mk +++ b/svx/source/dialog/makefile.mk @@ -56,7 +56,6 @@ SRC1FILES = \ fontwork.src \ frmsel.src \ hdft.src \ - hyphen.src \ hyprlink.src \ imapdlg.src \ impgrf.src \ @@ -70,7 +69,6 @@ SRC1FILES = \ srchdlg.src \ svxbmpnumvalueset.src \ swframeposstrings.src \ - thesdlg.src \ txenctab.src \ ucsubset.src @@ -85,7 +83,6 @@ LIB1OBJFILES= \ $(SLO)$/dlgutil.obj \ $(SLO)$/framelink.obj\ $(SLO)$/hangulhanja.obj \ - $(SLO)$/hyphen.obj \ $(SLO)$/impgrf.obj \ $(SLO)$/langbox.obj \ $(SLO)$/opengrf.obj \ @@ -93,7 +90,6 @@ LIB1OBJFILES= \ $(SLO)$/splwrap.obj \ $(SLO)$/svxdlg.obj \ $(SLO)$/stddlg.obj \ - $(SLO)$/thesdlg.obj LIB2TARGET=$(SLB)$/$(TARGET).lib diff --git a/svx/source/dialog/splwrap.cxx b/svx/source/dialog/splwrap.cxx index bd9f5fe0d12c..babe0d438b4f 100644 --- a/svx/source/dialog/splwrap.cxx +++ b/svx/source/dialog/splwrap.cxx @@ -51,9 +51,8 @@ #include <map> #include <svx/svxenum.hxx> -#include "hyphen.hxx" // Der HyphenDialog #include <svx/splwrap.hxx> // Der Wrapper -#include <svx/thesdlg.hxx> // ThesaurusDlg +#include <svx/svxdlg.hxx> #include <svx/dialmgr.hxx> #include <svx/dialogs.hrc> @@ -358,14 +357,14 @@ void SvxSpellWrapper::StartThesaurus( const String &rWord, sal_uInt16 nLanguage } WAIT_ON(); // while looking up for initial word - SvxThesaurusDialog aDlg(pWin, xThes, rWord, nLanguage); + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + AbstractThesaurusDialog* pDlg = pFact->CreateThesaurusDialog( pWin, xThes, rWord, nLanguage ); WAIT_OFF(); - - if ( aDlg.Execute()== RET_OK ) + if ( pDlg->Execute()== RET_OK ) { - ChangeThesWord( aDlg.GetWord() ); + ChangeThesWord( pDlg->GetWord() ); } - + delete pDlg; } // ----------------------------------------------------------------------- @@ -414,12 +413,12 @@ void SvxSpellWrapper::SpellDocument( ) bDialog = sal_True; if (xHyphWord.is()) { - DBG_ASSERT(xHyphWord.is(), "NULL pointer"); - SvxHyphenWordDialog* pDlg = - new SvxHyphenWordDialog( xHyphWord->getWord(), + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + AbstractHyphenWordDialog* pDlg = pFact->CreateHyphenWordDialog( pWin, + xHyphWord->getWord(), SvxLocaleToLanguage( xHyphWord->getLocale() ), - pWin, xHyph, this ); - pWin = pDlg; + xHyph, this ); + pWin = pDlg->GetWindow(); pDlg->Execute(); delete pDlg; } diff --git a/svx/source/dialog/thesdlg.cxx b/svx/source/dialog/thesdlg.cxx deleted file mode 100644 index dd0a7a228078..000000000000 --- a/svx/source/dialog/thesdlg.cxx +++ /dev/null @@ -1,500 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: thesdlg.cxx,v $ - * $Revision: 1.21 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svx.hxx" -#include <tools/shl.hxx> -#include <svl/lngmisc.hxx> -#include <vcl/wrkwin.hxx> -#ifndef _MSGBOX_HXX //autogen -#include <vcl/msgbox.hxx> -#endif -#ifndef _APP_HXX //autogen -#include <vcl/svapp.hxx> -#endif -#include <com/sun/star/linguistic2/XThesaurus.hpp> -#include <com/sun/star/linguistic2/XMeaning.hpp> - - -#define _SVX_THESDLG_CXX - -#include <svx/thesdlg.hxx> -#include "dlgutil.hxx" -#include <svx/dialmgr.hxx> -#include "svxerr.hxx" - -#include <svx/dialogs.hrc> -#include "thesdlg.hrc" -#include <unolingu.hxx> -#include <svx/langbox.hxx> -#include <svtools/langtab.hxx> - -using namespace ::com::sun::star; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::linguistic2; - -#undef S2U -#undef U2S -//#define S2U(s) StringToOUString(s, CHARSET_SYSTEM) -//#define U2S(s) OUStringToString(s, CHARSET_SYSTEM) - - -// GetReplaceEditString ------------------------------- - -static void GetReplaceEditString( String &rText ) -{ - // The strings returned by the thesaurus saometimes have some - // explanation text put in between '(' and ')' or a trailing '*'. - // These parts should not be put in the ReplaceEdit Text that may get - // inserted into the document. Thus we strip them from the text. - - xub_StrLen nPos = rText.Search( sal_Unicode('(') ); - while (STRING_NOTFOUND != nPos) - { - xub_StrLen nEnd = rText.Search( sal_Unicode(')'), nPos ); - if (STRING_NOTFOUND != nEnd) - rText.Erase( nPos, nEnd-nPos+1 ); - else - break; - nPos = rText.Search( sal_Unicode('(') ); - } - - nPos = rText.Search( sal_Unicode('*') ); - if (STRING_NOTFOUND != nPos) - rText.Erase( nPos ); - - // remove any possible remaining ' ' that may confuse the thesaurus - // when it gets called with the text - rText.EraseLeadingAndTrailingChars( sal_Unicode(' ') ); -} - -// struct ThesDlg_Impl --------------------------------------------------- - -struct ThesDlg_Impl -{ - Reference< XThesaurus > xThesaurus; - ::rtl::OUString aLookUpText; - sal_Int16 nLookUpLanguage; - - ThesDlg_Impl( Reference< XThesaurus > & xThes ); - SfxErrorContext* pErrContext; // ErrorContext, - // w"ahrend der Dialog oben ist -}; - -ThesDlg_Impl::ThesDlg_Impl(Reference< XThesaurus > & xThes) : - xThesaurus (xThes) -{ - pErrContext = NULL; - nLookUpLanguage = LANGUAGE_NONE; -} - - -// class SvxThesaurusLanguageDlg_Impl ------------------------------------ - -class SvxThesaurusLanguageDlg_Impl : public ModalDialog -{ -private: - SvxLanguageBox aLangLB; - FixedLine aLangFL; - OKButton aOKBtn; - CancelButton aCancelBtn; - HelpButton aHelpBtn; - - DECL_LINK( DoubleClickHdl_Impl, ListBox * ); - -public: - SvxThesaurusLanguageDlg_Impl( Window* pParent ); - - sal_uInt16 GetLanguage() const; - void SetLanguage( sal_uInt16 nLang ); -}; - -// ----------------------------------------------------------------------- - - -SvxThesaurusLanguageDlg_Impl::SvxThesaurusLanguageDlg_Impl( Window* pParent ) : - - ModalDialog( pParent, SVX_RES( RID_SVXDLG_THES_LANGUAGE ) ), - - aLangLB ( this, SVX_RES( LB_THES_LANGUAGE ) ), - aLangFL ( this, SVX_RES( FL_THES_LANGUAGE ) ), - aOKBtn ( this, SVX_RES( BTN_LANG_OK ) ), - aCancelBtn ( this, SVX_RES( BTN_LANG_CANCEL ) ), - aHelpBtn ( this, SVX_RES( BTN_LANG_HELP ) ) -{ - FreeResource(); - - aLangLB.SetLanguageList( LANG_LIST_THES_USED, FALSE, FALSE ); - aLangLB.SetDoubleClickHdl( - LINK( this, SvxThesaurusLanguageDlg_Impl, DoubleClickHdl_Impl ) ); -} - - -// ----------------------------------------------------------------------- - -sal_uInt16 SvxThesaurusLanguageDlg_Impl::GetLanguage() const -{ - sal_uInt16 nLang = aLangLB.GetSelectLanguage(); - return nLang; -} - -// ----------------------------------------------------------------------- - -void SvxThesaurusLanguageDlg_Impl::SetLanguage( sal_uInt16 nLang ) -{ - aLangLB.SelectLanguage( nLang ); -} - -// ----------------------------------------------------------------------- - -IMPL_LINK_INLINE_START( SvxThesaurusLanguageDlg_Impl, DoubleClickHdl_Impl, ListBox *, EMPTYARG ) -{ - EndDialog( RET_OK ); - return 0; -} -IMPL_LINK_INLINE_END( SvxThesaurusLanguageDlg_Impl, DoubleClickHdl_Impl, ListBox *, EMPTYARG ) - -// class SvxThesaurusDialog ---------------------------------------------- - - -// ----------------------------------------------------------------------- - - -SvxThesaurusDialog::SvxThesaurusDialog( Window* pParent, Reference< XThesaurus > xThes, - const String &rWord, sal_Int16 nLanguage) : - - SvxStandardDialog( pParent, SVX_RES( RID_SVXDLG_THESAURUS ) ), - - aWordText ( this, SVX_RES( FT_WORD ) ), - aWordLB ( this, SVX_RES( LB_WORD ) ), - aReplaceText( this, SVX_RES( FT_REPL ) ), - aReplaceEdit( this, SVX_RES( ED_REPL ) ), - aMeanText ( this, SVX_RES( FT_MEAN ) ), - aMeanLB ( this, SVX_RES( LB_MEAN ) ), - aSynonymText( this, SVX_RES( FT_SYNON ) ), - aSynonymLB ( this, SVX_RES( LB_SYNON ) ), - aVarFL ( this, SVX_RES( FL_VAR ) ), - aOkBtn ( this, SVX_RES( BTN_THES_OK ) ), - aCancelBtn ( this, SVX_RES( BTN_THES_CANCEL ) ), - aLookUpBtn ( this, SVX_RES( BTN_LOOKUP ) ), - aLangBtn ( this, SVX_RES( BTN_LANGUAGE ) ), - aHelpBtn ( this, SVX_RES( BTN_THES_HELP ) ), - aErrStr ( SVX_RES( STR_ERR_WORDNOTFOUND ) ) -{ - pImpl = new ThesDlg_Impl( xThes ); - pImpl->aLookUpText = ::rtl::OUString( rWord ); - pImpl->nLookUpLanguage = nLanguage; - pImpl->pErrContext = - new SfxErrorContext( ERRCTX_SVX_LINGU_THESAURUS, String(), this, - RID_SVXERRCTX, &DIALOG_MGR() ); - - aLangBtn.SetClickHdl( LINK( this, SvxThesaurusDialog, LanguageHdl_Impl ) ); - aLookUpBtn.SetClickHdl( LINK( this, SvxThesaurusDialog, LookUpHdl_Impl ) ); - aMeanLB.SetSelectHdl( LINK( this, SvxThesaurusDialog, EntryHdl_Impl ) ); - aSynonymLB.SetSelectHdl( LINK( this, SvxThesaurusDialog, SynonymHdl_Impl ) ); - Link aLink = LINK( this, SvxThesaurusDialog, SelectHdl_Impl ); - aMeanLB.SetDoubleClickHdl( aLink ); - aSynonymLB.SetDoubleClickHdl( aLink ); - aWordLB.SetSelectHdl( aLink ); - - FreeResource(); - - ::rtl::OUString aTmp( rWord ); - linguistic::RemoveHyphens( aTmp ); - linguistic::ReplaceControlChars( aTmp ); - aReplaceEdit.SetText( aTmp ); - aWordLB.InsertEntry( aTmp ); - aWordLB.SelectEntry( aTmp ); - - Init_Impl( nLanguage ); - - // disable controls if service is missing - if (!pImpl->xThesaurus.is()) - Enable( sal_False ); -} - - -// ----------------------------------------------------------------------- - -SvxThesaurusDialog::~SvxThesaurusDialog() -{ - delete pImpl->pErrContext; - delete pImpl; -} - -// ----------------------------------------------------------------------- - -uno::Sequence< Reference< XMeaning > > SAL_CALL - SvxThesaurusDialog::queryMeanings_Impl( - ::rtl::OUString& rTerm, - const Locale& rLocale, - const beans::PropertyValues& rProperties ) - throw(lang::IllegalArgumentException, uno::RuntimeException) -{ - uno::Sequence< Reference< XMeaning > > aMeanings( - pImpl->xThesaurus->queryMeanings( rTerm, rLocale, rProperties ) ); - - // text with '.' at the end? - if (0 == aMeanings.getLength() && rTerm.getLength() && - rTerm.getStr()[ rTerm.getLength() - 1 ] == '.') - { - // try again without trailing '.' chars. It may be a word at the - // end of a sentence and not an abbreviation... - String aTxt( rTerm ); - aTxt.EraseTrailingChars( '.' ); - aMeanings = pImpl->xThesaurus->queryMeanings( aTxt, rLocale, rProperties ); - if (aMeanings.getLength()) - { - rTerm = aTxt; - } - } - - return aMeanings; -} - -// ----------------------------------------------------------------------- - -sal_uInt16 SvxThesaurusDialog::GetLanguage() const -{ - return pImpl->nLookUpLanguage; -} - -// ----------------------------------------------------------------------- - -void SvxThesaurusDialog::UpdateMeaningBox_Impl( uno::Sequence< Reference< XMeaning > > *pMeaningSeq ) -{ - // create temporary meaning list if not supplied from somewhere else - sal_Bool bTmpSeq = sal_False; - if (!pMeaningSeq && pImpl->xThesaurus.is()) - { - bTmpSeq = sal_True; - lang::Locale aLocale( SvxCreateLocale( pImpl->nLookUpLanguage ) ); - uno::Sequence< Reference< XMeaning > > aTmpMean = queryMeanings_Impl( - pImpl->aLookUpText, aLocale, Sequence< PropertyValue >() ); - - pMeaningSeq = new Sequence< Reference< XMeaning > > ( aTmpMean ); - - // set new replace edit text if a different look up text was used - // see: queryMeanings_Impl - aReplaceEdit.SetText( pImpl->aLookUpText ); - } - - sal_Int32 nMeaningCount = pMeaningSeq ? pMeaningSeq->getLength() : 0; - const Reference< XMeaning > *pMeaning = pMeaningSeq ? pMeaningSeq->getConstArray() : NULL; - aMeanLB.Clear(); - for ( sal_Int32 i = 0; i < nMeaningCount; ++i ) - aMeanLB.InsertEntry( pMeaning[i]->getMeaning() ); - - // remove temporary meaning list - if (bTmpSeq) - delete pMeaningSeq; - - if (aMeanLB.GetEntryCount() > 0) - aMeanLB.SelectEntryPos(0); - UpdateSynonymBox_Impl(); -} - - -// ----------------------------------------------------------------------- -void SvxThesaurusDialog::UpdateSynonymBox_Impl() -{ - - aSynonymLB.Clear(); - - sal_uInt16 nPos = aMeanLB.GetSelectEntryPos(); // active meaning pos - if (nPos != LISTBOX_ENTRY_NOTFOUND && pImpl->xThesaurus.is()) - { - // get Reference< XMeaning > for selected meaning - lang::Locale aLocale( SvxCreateLocale( pImpl->nLookUpLanguage ) ); - Reference< XMeaning > xMeaning = queryMeanings_Impl( - pImpl->aLookUpText, aLocale, Sequence< PropertyValue >() ) - .getConstArray()[ nPos ]; - - uno::Sequence< ::rtl::OUString > aSynonyms; - if (xMeaning.is()) - aSynonyms = xMeaning->querySynonyms(); - - sal_Int32 nSynonymCount = aSynonyms.getLength(); - const ::rtl::OUString *pSynonym = aSynonyms.getConstArray(); - for ( sal_Int32 i=0; i < nSynonymCount; ++i ) - aSynonymLB.InsertEntry( pSynonym[i] ); - } - -} - -// ----------------------------------------------------------------------- - -void SvxThesaurusDialog::Apply() -{ -} - -// ----------------------------------------------------------------------- -void SvxThesaurusDialog::Init_Impl(sal_Int16 nLanguage) -{ - // Sprache anpassen - String aStr( GetText() ); - aStr.Erase( aStr.Search( sal_Unicode( '(' ) ) - 1 ); - aStr.Append( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( " (" ) ) ); - //aStr += GetLanguageString( (LanguageType)pImpl->pThesaurus->GetLanguage() ); - aStr += SvtLanguageTable::GetLanguageString( (LanguageType) nLanguage ); - aStr.Append( sal_Unicode( ')' ) ); - SetText( aStr ); // Text der Window-Leiste setzen (Wort + Sprache) - - // adapt meanings according to (new) language - UpdateMeaningBox_Impl(); -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxThesaurusDialog, LookUpHdl_Impl, Button *, pBtn ) -{ - - EnterWait(); - - String aText( aReplaceEdit.GetText() ); - - ::rtl::OUString aOldLookUpText = pImpl->aLookUpText; - pImpl->aLookUpText = ::rtl::OUString( aText ); - - uno::Sequence< Reference< XMeaning > > aMeanings; - if (pImpl->xThesaurus.is()) - aMeanings = queryMeanings_Impl( - pImpl->aLookUpText, - SvxCreateLocale( pImpl->nLookUpLanguage ), - Sequence< PropertyValue >() ); - - LeaveWait(); - if ( aMeanings.getLength() == 0 ) - { - if( pBtn == &aCancelBtn ) // called via double click - { - pImpl->aLookUpText = aOldLookUpText; - } - else - { - UpdateMeaningBox_Impl( &aMeanings ); - if( pBtn == &aLookUpBtn ) - InfoBox( this, aErrStr ).Execute(); - } - return 0; - } - - UpdateMeaningBox_Impl( &aMeanings ); - - if ( aWordLB.GetEntryPos( aText ) == LISTBOX_ENTRY_NOTFOUND ) - aWordLB.InsertEntry( aText ); - - aWordLB.SelectEntry( aText ); - aMeanLB.SelectEntryPos( 0 ); - - String aStr( aMeanLB.GetSelectEntry() ); - GetReplaceEditString( aStr ); - aReplaceEdit.SetText( aStr ); - aSynonymLB.SetNoSelection(); - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxThesaurusDialog, LanguageHdl_Impl, Button *, EMPTYARG ) -{ - if (!pImpl->xThesaurus.is()) - return 0; - - SvxThesaurusLanguageDlg_Impl aDlg( this ); - sal_uInt16 nLang = pImpl->nLookUpLanguage; - aDlg.SetLanguage( nLang ); - - if ( aDlg.Execute() == RET_OK ) - { - nLang = aDlg.GetLanguage(); - if (pImpl->xThesaurus->hasLocale( SvxCreateLocale( nLang ) )) - pImpl->nLookUpLanguage = nLang; - UpdateMeaningBox_Impl(); - Init_Impl( nLang ); - } - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxThesaurusDialog, SynonymHdl_Impl, ListBox *, EMPTYARG ) -{ - if ( aSynonymLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ) - { - String aStr( aSynonymLB.GetSelectEntry() ); - GetReplaceEditString( aStr ); - aReplaceEdit.SetText( aStr ); - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxThesaurusDialog, SelectHdl_Impl, ListBox *, pBox ) -{ - String aStr( pBox->GetSelectEntry() ); - GetReplaceEditString( aStr ); - aReplaceEdit.SetText( aStr ); - - //! 'aCancelBtn' is used to indicate that the handler is called as result - //! of a double click action. - LookUpHdl_Impl( &aCancelBtn /* ??? &aLookUpBtn */ ); - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxThesaurusDialog, EntryHdl_Impl, ListBox *, EMPTYARG ) -{ - - UpdateSynonymBox_Impl(); - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxThesaurusDialog, SpellErrorHdl_Impl, void *, pError ) -{ - // Der "ubergebene Pointer pError ist die falsche Sprachen-Nummer - LanguageType eLang = (LanguageType)(sal_uIntPtr)pError; - String aErr( SvtLanguageTable::GetLanguageString( eLang ) ); - // Fehlermeldung ausgeben - ErrorHandler::HandleError( - *new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ) ); - return 0; -} - diff --git a/svx/source/dialog/thesdlg.hrc b/svx/source/dialog/thesdlg.hrc deleted file mode 100644 index 4292de929236..000000000000 --- a/svx/source/dialog/thesdlg.hrc +++ /dev/null @@ -1,62 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: thesdlg.hrc,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SVX_THESDLG_HRC -#define _SVX_THESDLG_HRC - -// defines --------------------------------------------------------------- - -#define BTN_THES_OK 10 -#define BTN_THES_CANCEL 11 -#define BTN_LANGUAGE 12 -#define BTN_THES_HELP 13 -#define BTN_LOOKUP 14 -#define FT_WORD 15 -#define LB_WORD 16 -#define FT_MEAN 17 -#define LB_MEAN 18 -#define FT_SYNON 19 -#define LB_SYNON 20 -#define FT_REPL 21 -#define ED_REPL 22 -#define FL_VAR 23 - -#define STR_ERR_WORDNOTFOUND 30 - -// LanguageDialog -------------------------------------------------------- - -#define LB_THES_LANGUAGE 10 -#define FL_THES_LANGUAGE 11 -#define BTN_LANG_OK 12 -#define BTN_LANG_CANCEL 12 -#define BTN_LANG_HELP 13 - - -#endif - diff --git a/svx/source/dialog/thesdlg.src b/svx/source/dialog/thesdlg.src deleted file mode 100644 index 661a046175e2..000000000000 --- a/svx/source/dialog/thesdlg.src +++ /dev/null @@ -1,210 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: thesdlg.src,v $ - * $Revision: 1.23 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include <svx/svxids.hrc> -#include <svx/dialogs.hrc> -#include "thesdlg.hrc" -#include "helpid.hrc" - // pragma ---------------------------------------------------------------- - - // RID_SVXDLG_THES ------------------------------------------------------- -ModalDialog RID_SVXDLG_THESAURUS -{ - HelpId = SID_THESAURUS ; - OutputSize = TRUE ; - Size = MAP_APPFONT ( 285 , 116 ) ; - Text [ en-US ] = "Thesaurus" ; - Moveable = TRUE ; - SvLook = TRUE ; - OkButton BTN_THES_OK - { - Pos = MAP_APPFONT ( 219 , 6 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - DefButton = TRUE ; - }; - CancelButton BTN_THES_CANCEL - { - Pos = MAP_APPFONT ( 219 , 23 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - }; - PushButton BTN_LOOKUP - { - Pos = MAP_APPFONT ( 219 , 40 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "~Search" ; - }; - PushButton BTN_LANGUAGE - { - Pos = MAP_APPFONT ( 219 , 57 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "~Language..." ; - }; - HelpButton BTN_THES_HELP - { - Pos = MAP_APPFONT ( 219 , 77 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - }; - FixedText FT_WORD - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 96 , 8 ) ; - Text [ en-US ] = "~Word" ; - LEFT = TRUE ; - }; - ListBox LB_WORD - { - DropDown = TRUE ; - Pos = MAP_APPFONT ( 12 , 25 ) ; - Size = MAP_APPFONT ( 96 , 65 ) ; - }; - FixedText FT_MEAN - { - Pos = MAP_APPFONT ( 12 , 43 ) ; - Size = MAP_APPFONT ( 96 , 8 ) ; - Text [ en-US ] = "~Meaning " ; - LEFT = TRUE ; - }; - ListBox LB_MEAN - { - BORDER = TRUE ; - Pos = MAP_APPFONT ( 12 , 55 ) ; - Size = MAP_APPFONT ( 96 , 50 ) ; - AutoHScroll = TRUE ; - }; - FixedText FT_SYNON - { - Pos = MAP_APPFONT ( 111 , 43 ) ; - Size = MAP_APPFONT ( 96 , 8 ) ; - Text [ en-US ] = "Sy~nonym" ; - LEFT = TRUE ; - }; - ListBox LB_SYNON - { - BORDER = TRUE ; - Pos = MAP_APPFONT ( 111 , 55 ) ; - Size = MAP_APPFONT ( 96 , 50 ) ; - AutoHScroll = TRUE ; - }; - FixedText FT_REPL - { - Pos = MAP_APPFONT ( 111 , 14 ) ; - Size = MAP_APPFONT ( 96 , 8 ) ; - Text [ en-US ] = "~Replace" ; - LEFT = TRUE ; - }; - Edit ED_REPL - { - BORDER = TRUE ; - Pos = MAP_APPFONT ( 111 , 25 ) ; - Size = MAP_APPFONT ( 96 , 12 ) ; - LEFT = TRUE ; - }; - FixedLine FL_VAR - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 207 , 8 ) ; - Text [ en-US ] = "Variations" ; - }; - String STR_ERR_WORDNOTFOUND - { - Text [ en-US ] = "Word not found in thesaurus" ; - }; -}; - // RID_SVXDLG_THES_LANGUAGE ---------------------------------------------- -ModalDialog RID_SVXDLG_THES_LANGUAGE -{ - HelpId = HID_THES_LANGUAGE ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 170 , 86 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Sprache auswhlen : Sprache auswhlen */ - /* ### ACHTUNG: Neuer Text in Resource? Sprache auswhlen : Sprache auswhlen */ - Text [ en-US ] = "Select Language" ; - Moveable = TRUE ; - ListBox LB_THES_LANGUAGE - { - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 90 , 60 ) ; - Sort = TRUE ; - }; - FixedLine FL_THES_LANGUAGE - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 102 , 8 ) ; - Text [ en-US ] = "Selection" ; - }; - OKButton BTN_LANG_OK - { - Pos = MAP_APPFONT ( 114 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - DefButton = TRUE ; - }; - CancelButton BTN_LANG_CANCEL - { - Pos = MAP_APPFONT ( 114 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; - HelpButton BTN_LANG_HELP - { - Pos = MAP_APPFONT ( 114 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; -}; - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svx/source/editeng/eeng_pch.hxx b/svx/source/editeng/eeng_pch.hxx index c971dcdb22c1..faff1e7b7fe8 100644 --- a/svx/source/editeng/eeng_pch.hxx +++ b/svx/source/editeng/eeng_pch.hxx @@ -37,7 +37,3 @@ #include <svx/svxids.hrc> #include <svx/dialogs.hrc> -#ifndef SVX_LIGHT -#include <svx/thesdlg.hxx> -#endif - diff --git a/svx/source/editeng/impedit4.cxx b/svx/source/editeng/impedit4.cxx index 35dca280fdf5..6b0eb745d9c2 100644 --- a/svx/source/editeng/impedit4.cxx +++ b/svx/source/editeng/impedit4.cxx @@ -73,6 +73,7 @@ #include <svx/frmdiritem.hxx> #include <svx/emphitem.hxx> #include <textconv.hxx> +#include <svx/svxdlg.hxx> #include <rtl/tencinfo.h> @@ -2563,18 +2564,19 @@ EESpellState ImpEditEngine::StartThesaurus( EditView* pEditView ) if (!xThes.is()) return EE_SPELL_ERRORFOUND; - SvxThesaurusDialog aDialog( pEditView->GetWindow(), xThes, aWord, GetLanguage( aCurSel.Max() ) ); - - if ( aDialog.Execute() == RET_OK ) + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + AbstractThesaurusDialog* pDlg = pFact->CreateThesaurusDialog( pEditView->GetWindow(), xThes, aWord, GetLanguage( aCurSel.Max() ) ); + if ( pDlg->Execute() == RET_OK ) { // Wort ersetzen... pEditView->pImpEditView->DrawSelection(); pEditView->pImpEditView->SetEditSelection( aCurSel ); pEditView->pImpEditView->DrawSelection(); - pEditView->InsertText( aDialog.GetWord() ); + pEditView->InsertText( pDlg->GetWord() ); pEditView->ShowCursor( sal_True, sal_False ); } + delete pDlg; return EE_SPELL_OK; #else return EE_SPELL_NOSPELLER; |