Kaydet (Commit) a78ee843 authored tarafından Rob Snelders's avatar Rob Snelders Kaydeden (comit) Caolán McNamara

fd0#40778 - Remove dictionary choice when adding new entry

Change-Id: Id7bd039b505d30e71065c2cdf27eba1cb466be56
üst c867a303
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#define MN_AUTOCORR 4 #define MN_AUTOCORR 4
#define MN_WORDLANGUAGE 5 #define MN_WORDLANGUAGE 5
#define MN_PARALANGUAGE 6 #define MN_PARALANGUAGE 6
#define MN_INSERT_SINGLE 7
#define MN_ALTSTART 1000 #define MN_ALTSTART 1000
#define MN_AUTOSTART 2000 #define MN_AUTOSTART 2000
......
...@@ -82,6 +82,7 @@ public: // Needed for Undo ...@@ -82,6 +82,7 @@ public: // Needed for Undo
private: private:
ImpEditView* pImpEditView; ImpEditView* pImpEditView;
String aDicNameSingle;
EDITENG_DLLPRIVATE EditView( const EditView& ); EDITENG_DLLPRIVATE EditView( const EditView& );
EDITENG_DLLPRIVATE EditView& operator=( const EditView& ); EDITENG_DLLPRIVATE EditView& operator=( const EditView& );
......
...@@ -94,6 +94,12 @@ Menu RID_MENU_SPELL ...@@ -94,6 +94,12 @@ Menu RID_MENU_SPELL
Text [ en-US ] = "~Add" ; Text [ en-US ] = "~Add" ;
}; };
MenuItem MenuItem
{
Identifier = MN_INSERT_SINGLE ;
HelpId = HID_EDITENG_SPELLER_ADDWORD;
Text [ en-US ] = "~Add" ;
};
MenuItem
{ {
Identifier = MN_IGNORE ; Identifier = MN_IGNORE ;
HelpId = HID_EDITENG_SPELLER_IGNORE; HelpId = HID_EDITENG_SPELLER_IGNORE;
......
...@@ -1037,6 +1037,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) ...@@ -1037,6 +1037,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
// linguistic entry above // linguistic entry above
sal_uInt16 nPos = MN_DICTSTART + i; sal_uInt16 nPos = MN_DICTSTART + i;
pInsertMenu->InsertItem( nPos, xDicTmp->getName() ); pInsertMenu->InsertItem( nPos, xDicTmp->getName() );
aDicNameSingle = xDicTmp->getName();
uno::Reference< lang::XServiceInfo > xSvcInfo( xDicTmp, uno::UNO_QUERY ); uno::Reference< lang::XServiceInfo > xSvcInfo( xDicTmp, uno::UNO_QUERY );
if (xSvcInfo.is()) if (xSvcInfo.is())
...@@ -1052,8 +1053,9 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) ...@@ -1052,8 +1053,9 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
} }
} }
} }
if ( pInsertMenu->GetItemCount() != 1)
if ( !pInsertMenu->GetItemCount() ) aPopupMenu.EnableItem( MN_INSERT_SINGLE, sal_False );
if ( pInsertMenu->GetItemCount() < 2 )
aPopupMenu.EnableItem( MN_INSERT, sal_False ); aPopupMenu.EnableItem( MN_INSERT, sal_False );
aPopupMenu.RemoveDisabledEntries( sal_True, sal_True ); aPopupMenu.RemoveDisabledEntries( sal_True, sal_True );
...@@ -1121,9 +1123,13 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) ...@@ -1121,9 +1123,13 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
pCallBack->Call( &aInf ); pCallBack->Call( &aInf );
} }
} }
else if ( nId >= MN_DICTSTART ) else if ( nId >= MN_DICTSTART || nId == MN_INSERT_SINGLE )
{ {
String aDicName ( pInsertMenu->GetItemText(nId) ); String aDicName;
if (nId >= MN_DICTSTART)
aDicName = pInsertMenu->GetItemText(nId);
else
aDicName = aDicNameSingle;
uno::Reference< linguistic2::XDictionary > xDic; uno::Reference< linguistic2::XDictionary > xDic;
if (xDicList.is()) if (xDicList.is())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment