diff options
-rw-r--r-- | cui/source/dialogs/SpellDialog.cxx | 9 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 11 | ||||
-rw-r--r-- | editeng/source/items/optitems.cxx | 52 | ||||
-rw-r--r-- | include/editeng/optitems.hxx | 34 | ||||
-rw-r--r-- | include/sfx2/sfxsids.hrc | 1 |
5 files changed, 6 insertions, 101 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index fc6d808b7b02..1939e2ca6f8d 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -488,14 +488,7 @@ IMPL_LINK( SpellDialog, CheckGrammarHdl, Button*, pBox, void ) void SpellDialog::StartSpellOptDlg_Impl() { - sal_uInt16 const aSpellInfos[] = - { - SID_ATTR_SPELL,SID_ATTR_SPELL, - SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK, - 0 - }; - SfxItemSet aSet( SfxGetpApp()->GetPool(), aSpellInfos); - aSet.Put(SfxSpellCheckItem( xSpell, SID_ATTR_SPELL )); + SfxItemSet aSet( SfxGetpApp()->GetPool(), svl::Items<SID_AUTOSPELL_CHECK,SID_AUTOSPELL_CHECK>{}); VclPtr<SfxSingleTabDialog> pDlg( VclPtr<SfxSingleTabDialog>::Create(this, aSet, "SpellOptionsDialog", "cui/ui/spelloptionsdialog.ui")); VclPtr<SfxTabPage> pPage = SvxLinguTabPage::Create( pDlg->get_content_area(), &aSet ); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 6efd3ae3966a..0cdfcbde2a95 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -1103,7 +1103,7 @@ std::unique_ptr<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId SfxGetpApp()->GetPool(), svl::Items< SID_HTML_MODE, SID_HTML_MODE, - SID_ATTR_METRIC, SID_ATTR_SPELL, + SID_ATTR_METRIC, SID_ATTR_METRIC, SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK, SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER, SID_ATTR_YEAR2000, SID_ATTR_YEAR2000>{} ); @@ -1143,15 +1143,14 @@ std::unique_ptr<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId pRet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(), svl::Items< - SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE, + SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CJK_LANGUAGE, + SID_ATTR_CHAR_CTL_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE, SID_SET_DOCUMENT_LANGUAGE, SID_SET_DOCUMENT_LANGUAGE, - SID_ATTR_LANGUAGE, SID_AUTOSPELL_CHECK, + SID_ATTR_LANGUAGE, SID_ATTR_LANGUAGE, + SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK, SID_OPT_LOCALE_CHANGED, SID_OPT_LOCALE_CHANGED>{}); // for linguistic - - Reference< XSpellChecker1 > xSpell = LinguMgr::GetSpellChecker(); - pRet->Put(SfxSpellCheckItem( xSpell, SID_ATTR_SPELL )); SfxHyphenRegionItem aHyphen( SID_ATTR_HYPHENREGION ); sal_Int16 nMinLead = 2, diff --git a/editeng/source/items/optitems.cxx b/editeng/source/items/optitems.cxx index 913bb679103e..fea69e09426b 100644 --- a/editeng/source/items/optitems.cxx +++ b/editeng/source/items/optitems.cxx @@ -17,62 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <tools/stream.hxx> -#include <com/sun/star/linguistic2/XSpellChecker1.hpp> - #include <editeng/optitems.hxx> #include <editeng/eerdll.hxx> #include <editeng/editrids.hrc> -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::linguistic2; - -// class SfxSpellCheckItem ----------------------------------------------- - -SfxSpellCheckItem::SfxSpellCheckItem -( - Reference< XSpellChecker1 > const &xChecker, - sal_uInt16 _nWhich -) : - - SfxPoolItem( _nWhich ) -{ - xSpellCheck = xChecker; -} - - -SfxSpellCheckItem::SfxSpellCheckItem( const SfxSpellCheckItem& rItem ) : - - SfxPoolItem( rItem ), - xSpellCheck( rItem.GetXSpellChecker() ) -{ -} - - -bool SfxSpellCheckItem::GetPresentation -( - SfxItemPresentation , - MapUnit , - MapUnit , - OUString& , - const IntlWrapper& -) const -{ - return true; -} - - -SfxPoolItem* SfxSpellCheckItem::Clone( SfxItemPool* ) const -{ - return new SfxSpellCheckItem( *this ); -} - - -bool SfxSpellCheckItem::operator==( const SfxPoolItem& rItem ) const -{ - assert(SfxPoolItem::operator==(rItem)); - return ( xSpellCheck == static_cast<const SfxSpellCheckItem&>( rItem ).GetXSpellChecker() ); -} // class SfxHyphenRegionItem ----------------------------------------------- diff --git a/include/editeng/optitems.hxx b/include/editeng/optitems.hxx index 7d9dbef070a7..2ecf91e8e8f1 100644 --- a/include/editeng/optitems.hxx +++ b/include/editeng/optitems.hxx @@ -20,42 +20,8 @@ #define INCLUDED_EDITENG_OPTITEMS_HXX #include <svl/poolitem.hxx> -#include <com/sun/star/uno/Reference.hxx> #include <editeng/editengdllapi.h> -// forward --------------------------------------------------------------- -namespace com { namespace sun { namespace star { -namespace linguistic2{ - class XSpellChecker1; -}}}} - - -// class SfxSpellCheckItem ----------------------------------------------- - -class EDITENG_DLLPUBLIC SfxSpellCheckItem: public SfxPoolItem -{ -public: - - SfxSpellCheckItem( css::uno::Reference< - css::linguistic2::XSpellChecker1 > const &xChecker, - sal_uInt16 nWhich ); - SfxSpellCheckItem( const SfxSpellCheckItem& rItem ); - - virtual bool GetPresentation( SfxItemPresentation ePres, - MapUnit eCoreMetric, - MapUnit ePresMetric, - OUString &rText, const IntlWrapper& ) const override; - - virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; - virtual bool operator==( const SfxPoolItem& ) const override; - - const css::uno::Reference< css::linguistic2::XSpellChecker1 >& - GetXSpellChecker() const { return xSpellCheck; } - -private: - css::uno::Reference< css::linguistic2::XSpellChecker1 > xSpellCheck; -}; - // class SfxHyphenRegionItem --------------------------------------------- diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc index ea38db1e3cea..6fdd02c4caf6 100644 --- a/include/sfx2/sfxsids.hrc +++ b/include/sfx2/sfxsids.hrc @@ -476,7 +476,6 @@ // LinguTabPage #define SID_ATTR_LANGUAGE (SID_OPTIONS_START + 7) -#define SID_ATTR_SPELL (SID_OPTIONS_START + 9) #define SID_ATTR_HYPHENREGION (SID_OPTIONS_START + 12) #define SID_AUTOSPELL_CHECK (SID_OPTIONS_START + 21) |