summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Repository.mk1
-rw-r--r--editeng/Module_editeng.mk1
-rw-r--r--editeng/UIConfig_editeng.mk16
-rw-r--r--editeng/inc/editeng.hrc11
-rw-r--r--editeng/inc/helpid.hrc4
-rw-r--r--editeng/source/editeng/editeng.src49
-rw-r--r--editeng/source/editeng/editview.cxx32
-rw-r--r--editeng/uiconfig/ui/spellmenu.ui74
-rw-r--r--include/editeng/editrids.hrc2
9 files changed, 115 insertions, 75 deletions
diff --git a/Repository.mk b/Repository.mk
index e612fc714a33..227274737f87 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -1105,6 +1105,7 @@ $(eval $(call gb_Helper_register_uiconfigs,\
cui \
$(call gb_Helper_optional,DBCONNECTIVITY,dbaccess) \
desktop \
+ editeng \
filter \
formula \
fps \
diff --git a/editeng/Module_editeng.mk b/editeng/Module_editeng.mk
index f48dde947341..4bed89d70b1b 100644
--- a/editeng/Module_editeng.mk
+++ b/editeng/Module_editeng.mk
@@ -26,6 +26,7 @@ $(eval $(call gb_Module_add_targets,editeng,\
$(eval $(call gb_Module_add_l10n_targets,editeng,\
AllLangResTarget_editeng \
+ UIConfig_editeng \
))
$(eval $(call gb_Module_add_check_targets,editeng,\
diff --git a/editeng/UIConfig_editeng.mk b/editeng/UIConfig_editeng.mk
new file mode 100644
index 000000000000..dbe62f5b2ce3
--- /dev/null
+++ b/editeng/UIConfig_editeng.mk
@@ -0,0 +1,16 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UIConfig_UIConfig,editeng))
+
+$(eval $(call gb_UIConfig_add_uifiles,editeng,\
+ editeng/uiconfig/ui/spellmenu \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/editeng/inc/editeng.hrc b/editeng/inc/editeng.hrc
index e4b00b478937..18c62082623e 100644
--- a/editeng/inc/editeng.hrc
+++ b/editeng/inc/editeng.hrc
@@ -21,15 +21,8 @@
#include <editeng/editrids.hrc>
-#define MN_SPELLING 1
-#define MN_INSERT 2
-#define MN_IGNORE 3
-#define MN_AUTOCORR 4
-#define MN_WORDLANGUAGE 5
-#define MN_PARALANGUAGE 6
-#define MN_INSERT_SINGLE 7
-#define MN_AUTO_CORRECT_DLG 8
-
+#define MN_WORDLANGUAGE 998
+#define MN_PARALANGUAGE 999
#define MN_ALTSTART 1000
#define MN_AUTOSTART 2000
#define MN_DICTSTART 3000
diff --git a/editeng/inc/helpid.hrc b/editeng/inc/helpid.hrc
index 60bba79f1c71..018a50f8e164 100644
--- a/editeng/inc/helpid.hrc
+++ b/editeng/inc/helpid.hrc
@@ -21,10 +21,6 @@
#define HID_EDITENG_SPELLER_WORDLANGUAGE "EDITENG_HID_EDITENG_SPELLER_WORDLANGUAGE"
#define HID_EDITENG_SPELLER_PARALANGUAGE "EDITENG_HID_EDITENG_SPELLER_PARALANGUAGE"
-#define HID_EDITENG_SPELLER_ADDWORD "EDITENG_HID_EDITENG_SPELLER_ADDWORD"
-#define HID_EDITENG_SPELLER_AUTOCORRECT "EDITENG_HID_EDITENG_SPELLER_AUTOCORRECT"
-#define HID_EDITENG_SPELLER_IGNORE "EDITENG_HID_EDITENG_SPELLER_IGNORE"
-#define HID_EDITENG_SPELLER_START "EDITENG_HID_EDITENG_SPELLER_START"
#endif
diff --git a/editeng/source/editeng/editeng.src b/editeng/source/editeng/editeng.src
index 36d92102ab3e..7d49a54f8fb8 100644
--- a/editeng/source/editeng/editeng.src
+++ b/editeng/source/editeng/editeng.src
@@ -65,55 +65,6 @@ String RID_EDITUNDO_TRANSLITERATE
Text [ en-US ] = "Change Case";
};
-Menu RID_MENU_SPELL
-{
- ItemList =
- {
- MenuItem
- {
- Identifier = MN_IGNORE ;
- HelpId = HID_EDITENG_SPELLER_IGNORE;
- Text [ en-US ] = "I~gnore All" ;
- };
- MenuItem
- {
- Identifier = MN_INSERT ;
- HelpId = HID_EDITENG_SPELLER_ADDWORD;
- SubMenu = Menu
- {
- };
- Text [ en-US ] = "~Add to Dictionary" ;
- };
- MenuItem
- {
- Identifier = MN_INSERT_SINGLE ;
- HelpId = HID_EDITENG_SPELLER_ADDWORD;
- Text [ en-US ] = "~Add to Dictionary" ;
- };
- MenuItem
- {
- Identifier = MN_SPELLING ;
- HelpId = HID_EDITENG_SPELLER_START;
- Text [ en-US ] = "~Spellcheck..." ;
- };
- MenuItem { Separator = TRUE ; };
- MenuItem
- {
- Identifier = MN_AUTOCORR ;
- HelpId = HID_EDITENG_SPELLER_AUTOCORRECT;
- SubMenu = Menu
- {
- };
- Text [ en-US ] = "AutoCorrect ~To" ;
- };
- MenuItem
- {
- Identifier = MN_AUTO_CORRECT_DLG ;
- Text [ en-US ] = "Auto~Correct Options..." ;
- };
- };
-};
-
String RID_STR_WORD
{
Text [ en-US ] = "Word is %x";
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 75774fb5ff29..4f72ae7bfcb0 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -817,10 +817,17 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo
ESelection aOldSel = GetSelection();
if ( xSpeller.is() && pImpEditView->IsWrongSpelledWord( aPaM, true ) )
{
- ScopedVclPtrInstance<PopupMenu> aPopupMenu( EditResId( RID_MENU_SPELL ) );
- PopupMenu *pAutoMenu = aPopupMenu->GetPopupMenu( MN_AUTOCORR );
- PopupMenu *pInsertMenu = aPopupMenu->GetPopupMenu( MN_INSERT ); // add word to user-dictionaries
+ VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "editeng/ui/spellmenu.ui", "");
+ VclPtr<PopupMenu> aPopupMenu(aBuilder.get_menu("menu"));
+ const sal_uInt16 nAutoCorrId = aPopupMenu->GetItemId("autocorrect");
+ PopupMenu *pAutoMenu = aPopupMenu->GetPopupMenu(nAutoCorrId);
+ const sal_uInt16 nInsertId = aPopupMenu->GetItemId("insert");
+ PopupMenu *pInsertMenu = aPopupMenu->GetPopupMenu(nInsertId); // add word to user-dictionaries
pInsertMenu->SetMenuFlags( MenuFlags::NoAutoMnemonics ); //! necessary to retrieve the correct dictionary names later
+ const sal_uInt16 nAddId = aPopupMenu->GetItemId("add");
+ const sal_uInt16 nIgnoreId = aPopupMenu->GetItemId("ignore");
+ const sal_uInt16 nCheckId = aPopupMenu->GetItemId("check");
+ const sal_uInt16 nAutoCorrectDlgId = aPopupMenu->GetItemId("autocorrectdlg");
EditPaM aPaM2( aPaM );
aPaM2.SetIndex( aPaM2.GetIndex()+1 );
@@ -910,7 +917,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo
aPopupMenu->InsertSeparator(OString(), nWords);
}
else
- aPopupMenu->RemoveItem( MN_AUTOCORR ); // delete?
+ aPopupMenu->RemoveItem(nAutoCorrId); // delete?
SvtLinguConfig aCfg;
@@ -963,10 +970,11 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo
}
}
}
- if ( pInsertMenu->GetItemCount() != 1)
- aPopupMenu->EnableItem( MN_INSERT_SINGLE, false );
- if ( pInsertMenu->GetItemCount() < 2 )
- aPopupMenu->EnableItem( MN_INSERT, false );
+
+ if (pInsertMenu->GetItemCount() != 1)
+ aPopupMenu->EnableItem(nAddId, false);
+ if (pInsertMenu->GetItemCount() < 2)
+ aPopupMenu->EnableItem(nInsertId, false);
aPopupMenu->RemoveDisabledEntries( true, true );
@@ -976,7 +984,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo
aTempRect = pImpEditView->GetWindow()->LogicToPixel( Rectangle(aScreenPos, aTempRect.GetSize() ));
sal_uInt16 nId = aPopupMenu->Execute( pImpEditView->GetWindow(), aTempRect, PopupMenuFlags::NoMouseUpClose );
- if ( nId == MN_IGNORE )
+ if (nId == nIgnoreId)
{
OUString aWord = pImpEditView->SpellIgnoreWord();
if ( pCallBack )
@@ -1015,7 +1023,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo
}
SetSelection( aOldSel );
}
- else if ( nId == MN_SPELLING )
+ else if (nId == nCheckId)
{
if ( !pCallBack )
{
@@ -1033,12 +1041,12 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo
pCallBack->Call( aInf );
}
}
- else if ( nId == MN_AUTO_CORRECT_DLG && pCallBack)
+ else if (nId == nAutoCorrectDlgId && pCallBack)
{
SpellCallbackInfo aInf( SpellCallbackCommand::AUTOCORRECT_OPTIONS, OUString() );
pCallBack->Call( aInf );
}
- else if ( nId >= MN_DICTSTART || nId == MN_INSERT_SINGLE )
+ else if ( nId >= MN_DICTSTART || nId == nAddId)
{
OUString aDicName;
if (nId >= MN_DICTSTART)
diff --git a/editeng/uiconfig/ui/spellmenu.ui b/editeng/uiconfig/ui/spellmenu.ui
new file mode 100644
index 000000000000..365de28b512f
--- /dev/null
+++ b/editeng/uiconfig/ui/spellmenu.ui
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
+<interface>
+ <requires lib="gtk+" version="3.10"/>
+ <object class="GtkMenu" id="menu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="ignore">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">I_gnore All</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="insert">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Add to Dictionary</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="add">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Add to Dictionary</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="check">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Spellcheck...</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="menuitem1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="autocorrect">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">AutoCorrect _To</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="autocorrectdlg">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Auto_Correct Options...</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/include/editeng/editrids.hrc b/include/editeng/editrids.hrc
index cff44d40c234..5a1defad9816 100644
--- a/include/editeng/editrids.hrc
+++ b/include/editeng/editrids.hrc
@@ -358,7 +358,7 @@
#define RID_EDITUNDO_RESETATTRIBS (RID_EDIT_START + 308)
#define RID_EDITUNDO_INDENT (RID_EDIT_START + 309)
#define RID_EDITUNDO_TRANSLITERATE (RID_EDIT_START + 310)
-#define RID_MENU_SPELL (RID_EDIT_START + 311)
+//free
#define RID_STR_PARAGRAPH (RID_EDIT_START + 312)
#define RID_STR_WORD (RID_EDIT_START + 313)
#define RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION (RID_EDIT_START + 314)