[Libreoffice-commits] .: 3 commits - editeng/inc editeng/source svtools/source sw/source
Caolán McNamara
caolan at kemper.freedesktop.org
Fri May 18 08:31:27 PDT 2012
editeng/inc/editeng.hrc | 1 +
editeng/inc/editeng/editview.hxx | 1 +
editeng/source/editeng/editeng.src | 6 ++++++
editeng/source/editeng/editview.cxx | 14 ++++++++++----
svtools/source/contnr/imivctl1.cxx | 2 --
sw/source/ui/inc/olmenu.hxx | 1 +
sw/source/ui/lingu/olmenu.cxx | 21 ++++++++++++++-------
sw/source/ui/lingu/olmenu.hrc | 1 +
sw/source/ui/lingu/olmenu.src | 6 ++++++
9 files changed, 40 insertions(+), 13 deletions(-)
New commits:
commit a78ee84360cd3bb9c806ceb8a5fc0794971334d4
Author: Rob Snelders <programming at ertai.nl>
Date: Thu May 17 17:47:20 2012 +0200
fd0#40778 - Remove dictionary choice when adding new entry
Change-Id: Id7bd039b505d30e71065c2cdf27eba1cb466be56
diff --git a/editeng/inc/editeng.hrc b/editeng/inc/editeng.hrc
index cc1f45c..453bf5c 100644
--- a/editeng/inc/editeng.hrc
+++ b/editeng/inc/editeng.hrc
@@ -35,6 +35,7 @@
#define MN_AUTOCORR 4
#define MN_WORDLANGUAGE 5
#define MN_PARALANGUAGE 6
+#define MN_INSERT_SINGLE 7
#define MN_ALTSTART 1000
#define MN_AUTOSTART 2000
diff --git a/editeng/inc/editeng/editview.hxx b/editeng/inc/editeng/editview.hxx
index 8e034c8..92b6d30 100644
--- a/editeng/inc/editeng/editview.hxx
+++ b/editeng/inc/editeng/editview.hxx
@@ -82,6 +82,7 @@ public: // Needed for Undo
private:
ImpEditView* pImpEditView;
+ String aDicNameSingle;
EDITENG_DLLPRIVATE EditView( const EditView& );
EDITENG_DLLPRIVATE EditView& operator=( const EditView& );
diff --git a/editeng/source/editeng/editeng.src b/editeng/source/editeng/editeng.src
index add1054..896f66f 100644
--- a/editeng/source/editeng/editeng.src
+++ b/editeng/source/editeng/editeng.src
@@ -95,6 +95,12 @@ Menu RID_MENU_SPELL
};
MenuItem
{
+ Identifier = MN_INSERT_SINGLE ;
+ HelpId = HID_EDITENG_SPELLER_ADDWORD;
+ Text [ en-US ] = "~Add" ;
+ };
+ MenuItem
+ {
Identifier = MN_IGNORE ;
HelpId = HID_EDITENG_SPELLER_IGNORE;
Text [ en-US ] = "Ignore All" ;
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 9e0fd27..8ff692f 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1037,6 +1037,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
// linguistic entry above
sal_uInt16 nPos = MN_DICTSTART + i;
pInsertMenu->InsertItem( nPos, xDicTmp->getName() );
+ aDicNameSingle = xDicTmp->getName();
uno::Reference< lang::XServiceInfo > xSvcInfo( xDicTmp, uno::UNO_QUERY );
if (xSvcInfo.is())
@@ -1052,8 +1053,9 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
}
}
}
-
- if ( !pInsertMenu->GetItemCount() )
+ if ( pInsertMenu->GetItemCount() != 1)
+ aPopupMenu.EnableItem( MN_INSERT_SINGLE, sal_False );
+ if ( pInsertMenu->GetItemCount() < 2 )
aPopupMenu.EnableItem( MN_INSERT, sal_False );
aPopupMenu.RemoveDisabledEntries( sal_True, sal_True );
@@ -1121,9 +1123,13 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
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;
if (xDicList.is())
commit c867a3037dbe01eeecdd7512e3a02249231cbacd
Author: Rob Snelders <programming at ertai.nl>
Date: Thu May 17 16:50:34 2012 +0200
fd0#40778 - Remove dictionary choice when adding new entry
Change-Id: Ieaaf2466474463d19f91c74ea7f164962ba19936
diff --git a/sw/source/ui/inc/olmenu.hxx b/sw/source/ui/inc/olmenu.hxx
index d0d45b7..3da80f3 100644
--- a/sw/source/ui/inc/olmenu.hxx
+++ b/sw/source/ui/inc/olmenu.hxx
@@ -62,6 +62,7 @@ class SwSpellPopup : public PopupMenu
std::map< sal_Int16, ::rtl::OUString > aLangTable_Paragraph;
// std::map< sal_Int16, ::rtl::OUString > aLangTable_Document;
+ String aDicNameSingle;
bool bGrammarResults; // show grammar results? Or show spellcheck results?
Image aInfo16;
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index 6abb921..1d53314 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -460,8 +460,8 @@ SwSpellPopup::SwSpellPopup(
pMenu = GetPopupMenu(MN_ADD_TO_DIC);
pMenu->SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS); //! necessary to retrieve the correct dictionary name in 'Execute' below
- bEnable = sal_False; // enable MN_ADD_TO_DIC?
uno::Reference< linguistic2::XDictionaryList > xDicList( SvxGetDictionaryList() );
+ sal_uInt16 nItemId = MN_DICTIONARIES_START;
if (xDicList.is())
{
// add the default positive dictionary to dic-list (if not already done).
@@ -475,7 +475,6 @@ SwSpellPopup::SwSpellPopup(
const uno::Reference< linguistic2::XDictionary > *pDic = aDics.getConstArray();
sal_uInt16 nDicCount = static_cast< sal_uInt16 >(aDics.getLength());
- sal_uInt16 nItemId = MN_DICTIONARIES_START;
for( sal_uInt16 i = 0; i < nDicCount; i++ )
{
uno::Reference< linguistic2::XDictionary > xDicTmp( pDic[i], uno::UNO_QUERY );
@@ -492,7 +491,7 @@ SwSpellPopup::SwSpellPopup(
// the extra 1 is because of the (possible) external
// linguistic entry above
pMenu->InsertItem( nItemId, xDicTmp->getName() );
- bEnable = sal_True;
+ aDicNameSingle = xDicTmp->getName();
uno::Reference< lang::XServiceInfo > xSvcInfo( xDicTmp, uno::UNO_QUERY );
if (xSvcInfo.is())
@@ -510,7 +509,8 @@ SwSpellPopup::SwSpellPopup(
}
}
}
- EnableItem( MN_ADD_TO_DIC, bEnable );
+ EnableItem( MN_ADD_TO_DIC, ((nItemId - MN_DICTIONARIES_START) > 1)?sal_True:sal_False );
+ EnableItem( MN_ADD_TO_DIC_SINGLE, ((nItemId - MN_DICTIONARIES_START) == 1)?sal_True:sal_False );
//ADD NEW LANGUAGE MENU ITEM
///////////////////////////////////////////////////////////////////////////
@@ -656,6 +656,7 @@ aInfo16( SW_RES(IMG_INFO_16) )
EnableItem( MN_IGNORE_WORD, false );
EnableItem( MN_ADD_TO_DIC, false );
+ EnableItem( MN_ADD_TO_DIC_SINGLE, false );
//ADD NEW LANGUAGE MENU ITEM
///////////////////////////////////////////////////////////////////////////
@@ -807,12 +808,18 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
linguistic::AddEntryToDic( xDictionary,
xSpellAlt->getWord(), sal_False, aEmptyStr, LANGUAGE_NONE );
}
- else if (MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END)
+ else if ((MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END) || nId == MN_ADD_TO_DIC_SINGLE)
{
OUString aWord( xSpellAlt->getWord() );
+ String aDicName;
- PopupMenu *pMenu = GetPopupMenu(MN_ADD_TO_DIC);
- String aDicName ( pMenu->GetItemText(nId) );
+ if (MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END)
+ {
+ PopupMenu *pMenu = GetPopupMenu(MN_ADD_TO_DIC);
+ aDicName = pMenu->GetItemText(nId);
+ }
+ else
+ aDicName = aDicNameSingle;
uno::Reference< linguistic2::XDictionary > xDic;
uno::Reference< linguistic2::XDictionaryList > xDicList( SvxGetDictionaryList() );
diff --git a/sw/source/ui/lingu/olmenu.hrc b/sw/source/ui/lingu/olmenu.hrc
index 1d65bbf..73fbac0 100644
--- a/sw/source/ui/lingu/olmenu.hrc
+++ b/sw/source/ui/lingu/olmenu.hrc
@@ -54,6 +54,7 @@
#define MN_SET_LANGUAGE_ALL_TEXT 207
#define MN_SHORT_COMMENT 208
#define MN_EXPLANATION_LINK 209
+#define MN_ADD_TO_DIC_SINGLE 210
// id range for dictionaries sub menu
#define MN_DICTIONARIES_START 300
diff --git a/sw/source/ui/lingu/olmenu.src b/sw/source/ui/lingu/olmenu.src
index 5b2d8b7..581bc1d 100644
--- a/sw/source/ui/lingu/olmenu.src
+++ b/sw/source/ui/lingu/olmenu.src
@@ -53,6 +53,12 @@ Menu MN_SPELL_POPUP
};
MenuItem
{
+ Identifier = MN_ADD_TO_DIC_SINGLE ;
+ HelpID = HID_LINGU_ADD_WORD ;
+ Text [ en-US ] = "~Add" ;
+ };
+ MenuItem
+ {
Identifier = MN_AUTOCORR ;
HelpID = HID_LINGU_AUTOCORR ;
SubMenu = Menu
commit 2f5a85a68d256018f11b0cca21f36a625e6a0851
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri May 18 15:04:59 2012 +0100
useless temporary
Change-Id: Ia7c1da0eedc5d64ef3f2b17fb999bec3b242af88
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 48e8b10..c5d33ce 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -1751,8 +1751,6 @@ void SvxIconChoiceCtrl_Impl::PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry* pEntr
aPaper.SetRect( aRect );
pEntryPaintDev->SetBackground( aPaper );
pEntryPaintDev->SetFont( pView->GetFont() );
- Rectangle aPix ( pEntryPaintDev->LogicToPixel(aRect) );
-
Size aSize( rRect.GetSize() );
pEntryPaintDev->SetOutputSizePixel( aSize );
More information about the Libreoffice-commits
mailing list