[Libreoffice-commits] core.git: 2 commits - sc/source sw/inc sw/source sw/uiconfig sw/UIConfig_swriter.mk

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Feb 25 02:22:07 UTC 2017


 sc/source/core/data/document.cxx    |    2 
 sw/UIConfig_swriter.mk              |    3 
 sw/inc/helpid.h                     |    3 
 sw/source/uibase/inc/olmenu.hxx     |   16 ----
 sw/source/uibase/lingu/olmenu.cxx   |  113 ++++++++--------------------
 sw/source/uibase/lingu/olmenu.hrc   |    9 ++
 sw/source/uibase/lingu/olmenu.src   |   90 ++++++++++++++++++++++
 sw/uiconfig/swriter/ui/spellmenu.ui |  142 ------------------------------------
 8 files changed, 140 insertions(+), 238 deletions(-)

New commits:
commit 73f2944618e637762125fabd214b09b4fa50fb90
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 25 03:21:12 2017 +0100

    Revert "convert spell menu to .ui"
    
    This reverts commit 51d5cb5de245245fc7a3498cf87743d33eede525.

diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 8d51e8c..95495a2 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -242,9 +242,8 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
 	sw/uiconfig/swriter/ui/pagefooterpanel \
 	sw/uiconfig/swriter/ui/sidebarwrap \
 	sw/uiconfig/swriter/ui/sidebarstylepresets \
-	sw/uiconfig/swriter/ui/sidebartheme \
+    sw/uiconfig/swriter/ui/sidebartheme \
 	sw/uiconfig/swriter/ui/sortdialog \
-	sw/uiconfig/swriter/ui/spellmenu \
 	sw/uiconfig/swriter/ui/splittable \
 	sw/uiconfig/swriter/ui/statisticsinfopage \
 	sw/uiconfig/swriter/ui/stringinput \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index f06dac6..559d40c 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -99,6 +99,9 @@
 #define HID_MN_READONLY_LOADGRAPHIC                             "SW_HID_MN_READONLY_LOADGRAPHIC"
 #define HID_MN_READONLY_GRAPHICOFF                              "SW_HID_MN_READONLY_GRAPHICOFF"
 
+#define HID_LINGU_ADD_WORD                                      "SW_HID_LINGU_ADD_WORD"
+#define HID_LINGU_IGNORE_WORD                                   "SW_HID_LINGU_IGNORE_WORD"
+#define HID_LINGU_SPELLING_DLG                                  "SW_HID_LINGU_SPELLING_DLG"
 #define HID_LINGU_AUTOCORR                                      "SW_HID_LINGU_AUTOCORR"
 #define HID_LINGU_REPLACE                                       "SW_HID_LINGU_REPLACE"
 #define HID_SMARTTAG_MAIN                                       "SW_HID_SMARTTAG_MAIN"    // SMARTTAGS
diff --git a/sw/source/uibase/inc/olmenu.hxx b/sw/source/uibase/inc/olmenu.hxx
index a2077cd..af1156b 100644
--- a/sw/source/uibase/inc/olmenu.hxx
+++ b/sw/source/uibase/inc/olmenu.hxx
@@ -25,7 +25,6 @@
 #include <com/sun/star/uno/Sequence.h>
 
 #include <rtl/ustring.hxx>
-#include <vcl/builder.hxx>
 #include <vcl/image.hxx>
 #include <vcl/menu.hxx>
 
@@ -36,20 +35,7 @@ class SwWrtShell;
 
 class SW_DLLPUBLIC SwSpellPopup
 {
-    VclBuilder m_aBuilder;
-    VclPtr<PopupMenu> m_xPopupMenu;
-    sal_uInt16 m_nIgnoreWordId;
-    sal_uInt16 m_nAddMenuId;
-    sal_uInt16 m_nAddId;
-    sal_uInt16 m_nSpellDialogId;
-    sal_uInt16 m_nCorrectMenuId;
-    sal_uInt16 m_nCorrectDialogId;
-    sal_uInt16 m_nLangSelectionMenuId;
-    sal_uInt16 m_nLangParaMenuId;
-    sal_uInt16 m_nRedlineAcceptId;
-    sal_uInt16 m_nRedlineRejectId;
-    sal_uInt16 m_nRedlineNextId;
-    sal_uInt16 m_nRedlinePrevId;
+    ScopedVclPtrInstance<PopupMenu> m_xPopupMenu;
     SwWrtShell* m_pSh;
     css::uno::Sequence< css::uno::Reference< css::linguistic2::XDictionary >  >     m_aDics;
     css::uno::Reference< css::linguistic2::XSpellAlternatives > m_xSpellAlt;
diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx
index 39a52d8..2932585 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -259,20 +259,7 @@ SwSpellPopup::SwSpellPopup(
         SwWrtShell* pWrtSh,
         const uno::Reference< linguistic2::XSpellAlternatives >  &xAlt,
         const OUString &rParaText)
-    : m_aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/swriter/ui/spellmenu.ui", "")
-    , m_xPopupMenu(m_aBuilder.get_menu("menu"))
-    , m_nIgnoreWordId(m_xPopupMenu->GetItemId("ignoreall"))
-    , m_nAddMenuId(m_xPopupMenu->GetItemId("addmenu"))
-    , m_nAddId(m_xPopupMenu->GetItemId("add"))
-    , m_nSpellDialogId(m_xPopupMenu->GetItemId("spelldialog"))
-    , m_nCorrectMenuId(m_xPopupMenu->GetItemId("correctmenu"))
-    , m_nCorrectDialogId(m_xPopupMenu->GetItemId("correctdialog"))
-    , m_nLangSelectionMenuId(m_xPopupMenu->GetItemId("langselection"))
-    , m_nLangParaMenuId(m_xPopupMenu->GetItemId("langpara"))
-    , m_nRedlineAcceptId(m_xPopupMenu->GetItemId("accept"))
-    , m_nRedlineRejectId(m_xPopupMenu->GetItemId("reject"))
-    , m_nRedlineNextId(m_xPopupMenu->GetItemId("next"))
-    , m_nRedlinePrevId(m_xPopupMenu->GetItemId("prev"))
+    : m_xPopupMenu( SW_RES(MN_SPELL_POPUP) )
     , m_pSh( pWrtSh )
     , m_xSpellAlt(xAlt)
     , m_nGrammarError(0)
@@ -293,7 +280,7 @@ SwSpellPopup::SwSpellPopup(
 
     SvtLinguConfig aCfg;
 
-    PopupMenu *pMenu = m_xPopupMenu->GetPopupMenu(m_nCorrectMenuId);
+    PopupMenu *pMenu = m_xPopupMenu->GetPopupMenu(MN_AUTOCORR);
     pMenu->SetMenuFlags(MenuFlags::NoAutoMnemonics);
     bool bEnable = false;
     if( nStringCount )
@@ -333,13 +320,13 @@ SwSpellPopup::SwSpellPopup(
 
     OUString aIgnoreSelection( SW_RES( STR_IGNORE_SELECTION ) );
     OUString aSpellingAndGrammar = RetrieveLabelFromCommand( ".uno:SpellingAndGrammarDialog" );
-    m_xPopupMenu->SetItemText(m_nSpellDialogId, aSpellingAndGrammar);
-    m_xPopupMenu->SetItemText(m_nCorrectDialogId, RetrieveLabelFromCommand(".uno:AutoCorrectDlg"));
-    sal_uInt16 nItemPos = m_xPopupMenu->GetItemPos(m_nIgnoreWordId);
+    m_xPopupMenu->SetItemText(MN_SPELLING_DLG, aSpellingAndGrammar);
+    m_xPopupMenu->SetItemText(MN_AUTO_CORRECT_DLG, RetrieveLabelFromCommand(".uno:AutoCorrectDlg"));
+    sal_uInt16 nItemPos = m_xPopupMenu->GetItemPos( MN_IGNORE_WORD );
     m_xPopupMenu->InsertItem(MN_IGNORE_SELECTION, aIgnoreSelection, MenuItemBits::NONE, OString(), nItemPos);
     m_xPopupMenu->SetHelpId(MN_IGNORE_SELECTION, HID_LINGU_IGNORE_SELECTION);
 
-    m_xPopupMenu->EnableItem(m_nCorrectMenuId, bEnable);
+    m_xPopupMenu->EnableItem(MN_AUTOCORR, bEnable);
 
     uno::Reference< linguistic2::XLanguageGuessing > xLG = SW_MOD()->GetLanguageGuesser();
     m_nGuessLangWord = LANGUAGE_NONE;
@@ -358,7 +345,7 @@ SwSpellPopup::SwSpellPopup(
             m_nGuessLangPara = m_nGuessLangWord;
     }
 
-    pMenu = m_xPopupMenu->GetPopupMenu(m_nAddMenuId);
+    pMenu = m_xPopupMenu->GetPopupMenu(MN_ADD_TO_DIC);
     pMenu->SetMenuFlags(MenuFlags::NoAutoMnemonics);     //! necessary to retrieve the correct dictionary name in 'Execute' below
     uno::Reference< linguistic2::XSearchableDictionaryList >    xDicList( LinguMgr::GetDictionaryList() );
     sal_uInt16 nItemId = MN_DICTIONARIES_START;
@@ -412,8 +399,8 @@ SwSpellPopup::SwSpellPopup(
             }
         }
     }
-    m_xPopupMenu->EnableItem(m_nAddMenuId, (nItemId - MN_DICTIONARIES_START) > 1);
-    m_xPopupMenu->EnableItem(m_nAddId, (nItemId - MN_DICTIONARIES_START) == 1);
+    m_xPopupMenu->EnableItem(MN_ADD_TO_DIC, (nItemId - MN_DICTIONARIES_START) > 1);
+    m_xPopupMenu->EnableItem(MN_ADD_TO_DIC_SINGLE, (nItemId - MN_DICTIONARIES_START) == 1);
 
     //ADD NEW LANGUAGE MENU ITEM
 
@@ -439,19 +426,19 @@ SwSpellPopup::SwSpellPopup(
     aSeq[2] = aKeyboardLang;
     aSeq[3] = SvtLanguageTable::GetLanguageString(m_nGuessLangWord);
 
-    pMenu = m_xPopupMenu->GetPopupMenu(m_nLangSelectionMenuId);
+    pMenu = m_xPopupMenu->GetPopupMenu(MN_SET_LANGUAGE_SELECTION);
     fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_SELECTION_START, aSeq, pWrtSh, m_aLangTable_Text );
-    m_xPopupMenu->EnableItem(m_nLangSelectionMenuId);
+    m_xPopupMenu->EnableItem(MN_SET_LANGUAGE_SELECTION);
 
-    pMenu = m_xPopupMenu->GetPopupMenu(m_nLangParaMenuId);
+    pMenu = m_xPopupMenu->GetPopupMenu(MN_SET_LANGUAGE_PARAGRAPH);
     fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_PARAGRAPH_START, aSeq, pWrtSh, m_aLangTable_Paragraph );
-    m_xPopupMenu->EnableItem(m_nLangParaMenuId);
+    m_xPopupMenu->EnableItem(MN_SET_LANGUAGE_PARAGRAPH);
 
     if (bUseImagesInMenus)
     {
         uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface();
         Image rImg = ::GetImage( xFrame, ".uno:SpellingAndGrammarDialog", false );
-        m_xPopupMenu->SetItemImage(m_nSpellDialogId, rImg);
+        m_xPopupMenu->SetItemImage( MN_SPELLING_DLG, rImg );
     }
 
     checkRedline();
@@ -464,20 +451,7 @@ SwSpellPopup::SwSpellPopup(
     sal_Int32 nErrorInResult,
     const uno::Sequence< OUString > &rSuggestions,
     const OUString &rParaText )
-    : m_aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/swriter/ui/spellmenu.ui", "")
-    , m_xPopupMenu(m_aBuilder.get_menu("menu"))
-    , m_nIgnoreWordId(m_xPopupMenu->GetItemId("ignoreall"))
-    , m_nAddMenuId(m_xPopupMenu->GetItemId("addmenu"))
-    , m_nAddId(m_xPopupMenu->GetItemId("add"))
-    , m_nSpellDialogId(m_xPopupMenu->GetItemId("spelldialog"))
-    , m_nCorrectMenuId(m_xPopupMenu->GetItemId("correctmenu"))
-    , m_nCorrectDialogId(m_xPopupMenu->GetItemId("correctdialog"))
-    , m_nLangSelectionMenuId(m_xPopupMenu->GetItemId("langselection"))
-    , m_nLangParaMenuId(m_xPopupMenu->GetItemId("langpara"))
-    , m_nRedlineAcceptId(m_xPopupMenu->GetItemId("accept"))
-    , m_nRedlineRejectId(m_xPopupMenu->GetItemId("reject"))
-    , m_nRedlineNextId(m_xPopupMenu->GetItemId("next"))
-    , m_nRedlinePrevId(m_xPopupMenu->GetItemId("prev"))
+    : m_xPopupMenu(SW_RES(MN_SPELL_POPUP))
     , m_pSh(pWrtSh)
     , m_xGrammarResult(rResult)
     , m_aSuggestions(rSuggestions)
@@ -550,13 +524,13 @@ SwSpellPopup::SwSpellPopup(
 
     OUString aIgnoreSelection( SW_RES( STR_IGNORE_SELECTION ) );
     OUString aSpellingAndGrammar = RetrieveLabelFromCommand( ".uno:SpellingAndGrammarDialog" );
-    m_xPopupMenu->SetItemText(m_nSpellDialogId, aSpellingAndGrammar);
-    sal_uInt16 nItemPos = m_xPopupMenu->GetItemPos(m_nIgnoreWordId);
+    m_xPopupMenu->SetItemText(MN_SPELLING_DLG, aSpellingAndGrammar);
+    sal_uInt16 nItemPos = m_xPopupMenu->GetItemPos(MN_IGNORE_WORD);
     m_xPopupMenu->InsertItem(MN_IGNORE_SELECTION, aIgnoreSelection, MenuItemBits::NONE, OString(), nItemPos);
     m_xPopupMenu->SetHelpId(MN_IGNORE_SELECTION, HID_LINGU_IGNORE_SELECTION);
 
-    m_xPopupMenu->EnableItem(m_nCorrectMenuId, false);
-    m_xPopupMenu->EnableItem(m_nCorrectDialogId, false);
+    m_xPopupMenu->EnableItem(MN_AUTOCORR, false);
+    m_xPopupMenu->EnableItem(MN_AUTO_CORRECT_DLG, false);
 
     uno::Reference< linguistic2::XLanguageGuessing > xLG = SW_MOD()->GetLanguageGuesser();
     m_nGuessLangWord = LANGUAGE_NONE;
@@ -574,8 +548,8 @@ SwSpellPopup::SwSpellPopup(
             m_nGuessLangPara = m_nGuessLangWord;
     }
 
-    m_xPopupMenu->EnableItem(m_nAddMenuId, false);
-    m_xPopupMenu->EnableItem(m_nAddId, false);
+    m_xPopupMenu->EnableItem(MN_ADD_TO_DIC, false);
+    m_xPopupMenu->EnableItem(MN_ADD_TO_DIC_SINGLE, false);
 
     //ADD NEW LANGUAGE MENU ITEM
 
@@ -601,19 +575,19 @@ SwSpellPopup::SwSpellPopup(
     aSeq[2] = aKeyboardLang;
     aSeq[3] = SvtLanguageTable::GetLanguageString(m_nGuessLangWord);
 
-    PopupMenu *pMenu = m_xPopupMenu->GetPopupMenu(m_nLangSelectionMenuId);
+    PopupMenu *pMenu = m_xPopupMenu->GetPopupMenu(MN_SET_LANGUAGE_SELECTION);
     fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_SELECTION_START, aSeq, pWrtSh, m_aLangTable_Text );
-    m_xPopupMenu->EnableItem(m_nLangSelectionMenuId);
+    m_xPopupMenu->EnableItem( MN_SET_LANGUAGE_SELECTION );
 
-    pMenu = m_xPopupMenu->GetPopupMenu(m_nLangParaMenuId);
+    pMenu = m_xPopupMenu->GetPopupMenu(MN_SET_LANGUAGE_PARAGRAPH);
     fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_PARAGRAPH_START, aSeq, pWrtSh, m_aLangTable_Paragraph );
-    m_xPopupMenu->EnableItem(m_nLangParaMenuId);
+    m_xPopupMenu->EnableItem(MN_SET_LANGUAGE_PARAGRAPH);
 
     if (bUseImagesInMenus)
     {
         uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface();
         Image rImg = ::GetImage( xFrame, ".uno:SpellingAndGrammarDialog", false );
-        m_xPopupMenu->SetItemImage(m_nSpellDialogId, rImg);
+        m_xPopupMenu->SetItemImage(MN_SPELLING_DLG, rImg);
     }
 
     checkRedline();
@@ -647,20 +621,11 @@ void SwSpellPopup::checkRedline()
     // cleared or not.
     for (sal_uInt16 nWhich : pRedlineIds)
     {
-        sal_uInt16 nId(0);
-        if (nWhich == FN_REDLINE_ACCEPT_DIRECT)
-            nId = m_nRedlineAcceptId;
-        else if (nWhich == FN_REDLINE_REJECT_DIRECT)
-            nId = m_nRedlineRejectId;
-        else if (nWhich == FN_REDLINE_NEXT_CHANGE)
-            nId = m_nRedlineNextId;
-        else if (nWhich == FN_REDLINE_PREV_CHANGE)
-            nId = m_nRedlinePrevId;
-        m_xPopupMenu->EnableItem(nId, aSet.Get(nWhich).Which());
+        m_xPopupMenu->EnableItem(nWhich, aSet.Get(nWhich).Which());
     }
 }
 
-void SwSpellPopup::Execute( const Rectangle& rWordPos, vcl::Window* pWin )
+void  SwSpellPopup::Execute( const Rectangle& rWordPos, vcl::Window* pWin )
 {
     sal_uInt16 nRet = m_xPopupMenu->Execute(pWin, pWin->LogicToPixel(rWordPos));
     Execute( nRet );
@@ -736,7 +701,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
             m_pSh->SetInsMode( bOldIns );
         }
     }
-    else if (nId == m_nSpellDialogId)
+    else if (nId == MN_SPELLING_DLG)
     {
         if (m_bGrammarResults)
         {
@@ -750,7 +715,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
                 Execute( FN_SPELL_GRAMMAR_DIALOG, SfxCallMode::ASYNCHRON );
         }
     }
-    else if (nId == m_nCorrectDialogId)
+    else if (nId == MN_AUTO_CORRECT_DLG)
     {
         m_pSh->GetView().GetViewFrame()->GetDispatcher()->Execute( SID_AUTO_CORRECT_DLG, SfxCallMode::ASYNCHRON );
     }
@@ -760,7 +725,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
         if (pPaM)
             SwEditShell::IgnoreGrammarErrorAt( *pPaM );
     }
-    else if (nId == m_nIgnoreWordId)
+    else if (nId == MN_IGNORE_WORD)
     {
         uno::Reference< linguistic2::XDictionary > xDictionary( LinguMgr::GetIgnoreAllList(), uno::UNO_QUERY );
         if (m_bGrammarResults) {
@@ -790,14 +755,14 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
             }
         }
     }
-    else if ((MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END) || nId == m_nAddId)
+    else if ((MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END) || nId == MN_ADD_TO_DIC_SINGLE)
     {
         OUString sWord( m_xSpellAlt->getWord() );
         OUString aDicName;
 
         if (MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END)
         {
-            PopupMenu *pMenu = m_xPopupMenu->GetPopupMenu(m_nAddMenuId);
+            PopupMenu *pMenu = m_xPopupMenu->GetPopupMenu(MN_ADD_TO_DIC);
             aDicName = pMenu->GetItemText(nId);
         }
         else
@@ -841,17 +806,9 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
             aErrorBox->Execute();
         }
     }
-    else if (nId == m_nRedlineAcceptId || nId == m_nRedlineRejectId
-            || nId == m_nRedlineNextId || nId == m_nRedlinePrevId)
+    else if (nId == FN_REDLINE_ACCEPT_DIRECT || nId == FN_REDLINE_REJECT_DIRECT
+            || nId == FN_REDLINE_NEXT_CHANGE || nId == FN_REDLINE_PREV_CHANGE)
     {
-        if (nId == m_nRedlineAcceptId)
-            nId = FN_REDLINE_ACCEPT_DIRECT;
-        else if (nId == m_nRedlineRejectId)
-            nId = FN_REDLINE_REJECT_DIRECT;
-        else if (nId == m_nRedlineNextId)
-            nId = FN_REDLINE_NEXT_CHANGE;
-        else if (nId == m_nRedlinePrevId)
-            nId = FN_REDLINE_PREV_CHANGE;
         // Let SwView::Execute() handle the redline actions.
         SfxRequest aReq(m_pSh->GetView().GetViewFrame(), nId);
         m_pSh->GetView().Execute(aReq);
diff --git a/sw/source/uibase/lingu/olmenu.hrc b/sw/source/uibase/lingu/olmenu.hrc
index e106269..a0cd367 100644
--- a/sw/source/uibase/lingu/olmenu.hrc
+++ b/sw/source/uibase/lingu/olmenu.hrc
@@ -22,6 +22,7 @@
 
 #include "rcid.hrc"
 
+#define MN_SPELL_POPUP                  (RC_LINGU_BEGIN + 1)
 #define STR_SPELL_OK                    (RC_LINGU_BEGIN + 2)
 #define STR_HYP_OK                      (RC_LINGU_BEGIN + 3)
 #define STR_WORD                        (RC_LINGU_BEGIN + 4)
@@ -35,9 +36,17 @@
 #define BMP_INFO_16                     (RC_LINGU_BEGIN + 100)
 
 //! Don't change these values. You may break context menu modifying extensions!
+#define MN_SPELLING_DLG                 200
 #define MN_IGNORE_SELECTION             201
+#define MN_IGNORE_WORD                  202
+#define MN_ADD_TO_DIC                   203
+#define MN_AUTOCORR                     204
+#define MN_SET_LANGUAGE_SELECTION       205
+#define MN_SET_LANGUAGE_PARAGRAPH       206
 #define MN_SHORT_COMMENT                208
 #define MN_EXPLANATION_LINK             209
+#define MN_ADD_TO_DIC_SINGLE            210
+#define MN_AUTO_CORRECT_DLG             211
 
 // id range for dictionaries sub menu
 #define MN_DICTIONARIES_START               300
diff --git a/sw/source/uibase/lingu/olmenu.src b/sw/source/uibase/lingu/olmenu.src
index 9dc16ca..53ec2b4 100644
--- a/sw/source/uibase/lingu/olmenu.src
+++ b/sw/source/uibase/lingu/olmenu.src
@@ -22,6 +22,96 @@
 #include "cmdid.h"
 #include "helpid.h"
 
+#define SEPARATOR   MenuItem { Separator = TRUE; };
+
+Menu MN_SPELL_POPUP
+{
+    ItemList =
+    {
+        MenuItem
+        {
+            Identifier = MN_IGNORE_WORD ;
+            HelpID = HID_LINGU_IGNORE_WORD ;
+            Text [ en-US ] = "I~gnore All" ;
+        };
+        MenuItem
+        {
+            Identifier = MN_ADD_TO_DIC ;
+            HelpID = HID_LINGU_ADD_WORD ;
+            SubMenu = Menu
+            {
+            };
+            Text [ en-US ] = "~Add to Dictionary" ;
+        };
+        MenuItem
+        {
+            Identifier = MN_ADD_TO_DIC_SINGLE ;
+            HelpID = HID_LINGU_ADD_WORD ;
+            Text [ en-US ] = "~Add to Dictionary" ;
+        };
+        MenuItem
+        {
+            Identifier = MN_SPELLING_DLG ;
+            HelpID = HID_LINGU_SPELLING_DLG ;
+        };
+        SEPARATOR
+        MenuItem
+        {
+            Identifier = MN_AUTOCORR ;
+            HelpID = HID_LINGU_AUTOCORR ;
+            SubMenu = Menu
+            {
+            };
+            Text [ en-US ] = "Always correct ~to" ;
+        };
+        MenuItem
+        {
+            Identifier = MN_AUTO_CORRECT_DLG ;
+        };
+        SEPARATOR
+        MenuItem
+        {
+            Identifier = MN_SET_LANGUAGE_SELECTION ;
+            SubMenu = Menu
+            {
+            };
+            Text [ en-US ] = "Set Language for Selection" ;
+        };
+        MenuItem
+        {
+            Identifier = MN_SET_LANGUAGE_PARAGRAPH ;
+            SubMenu = Menu
+            {
+            };
+            Text [ en-US ] = "Set Language for Paragraph" ;
+        };
+        SEPARATOR
+        MenuItem
+        {
+            Identifier = FN_REDLINE_ACCEPT_DIRECT;
+            HelpId = CMD_FN_REDLINE_ACCEPT_DIRECT ;
+            Text [ en-US ] = "Accept Change" ;
+        };
+        MenuItem
+        {
+            Identifier = FN_REDLINE_REJECT_DIRECT ;
+            HelpId = CMD_FN_REDLINE_REJECT_DIRECT ;
+            Text [ en-US ] = "Reject Change" ;
+        };
+        MenuItem
+        {
+            Identifier = FN_REDLINE_NEXT_CHANGE;
+            HelpId = CMD_FN_REDLINE_NEXT_CHANGE ;
+            Text [ en-US ] = "Next Change" ;
+        };
+        MenuItem
+        {
+            Identifier = FN_REDLINE_PREV_CHANGE;
+            HelpId = CMD_FN_REDLINE_PREV_CHANGE ;
+            Text [ en-US ] = "Previous Change" ;
+        };
+    };
+};
 String STR_WORD
 {
     Text [ en-US ] = "Word is " ;
diff --git a/sw/uiconfig/swriter/ui/spellmenu.ui b/sw/uiconfig/swriter/ui/spellmenu.ui
deleted file mode 100644
index 91c09f7..0000000
--- a/sw/uiconfig/swriter/ui/spellmenu.ui
+++ /dev/null
@@ -1,142 +0,0 @@
-<?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="ignoreall">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">I_gnore All</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkMenuItem" id="addmenu">
-        <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="spelldialog">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkSeparatorMenuItem" id="separator1">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkMenuItem" id="correctmenu">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Always correct _to</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="correctdialog">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkSeparatorMenuItem" id="separator2">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkMenuItem" id="langselection">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Set Language for Selection</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="langpara">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Set Language for Paragraph</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="GtkSeparatorMenuItem" id="separator3">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkMenuItem" id="accept">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Accept Change</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkMenuItem" id="reject">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Reject Change</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkMenuItem" id="next">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Next Change</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkMenuItem" id="prev">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">Previous Change</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-  </object>
-</interface>
commit c63ff2a769f4601f67ffd13cb36df63c70fdd601
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Feb 24 23:10:57 2017 +0100

    xPoolHelper is empty in a clipboard doc
    
    Found by the crashreporter:
    http://crashreport.libreoffice.org/stats/signature/ScDocument::IsClipboardSource()
    
    Change-Id: I3fb030921b653396deb46a9e98d30d5df9c9ce15

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 5f3ae62..9df69da 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2515,7 +2515,7 @@ void ScDocument::SetClipParam(const ScClipParam& rParam)
 bool ScDocument::IsClipboardSource() const
 {
     ScDocument* pClipDoc = ScModule::GetClipDoc();
-    return pClipDoc && pClipDoc->xPoolHelper.is() &&
+    return xPoolHelper.is() && pClipDoc && pClipDoc->xPoolHelper.is() &&
             xPoolHelper->GetDocPool() == pClipDoc->xPoolHelper->GetDocPool();
 }
 


More information about the Libreoffice-commits mailing list