[Libreoffice-commits] core.git: 3 commits - include/sfx2 officecfg/registry sfx2/source sw/sdi sw/source sw/uiconfig sw/UIConfig_sglobal.mk sw/UIConfig_sweb.mk sw/UIConfig_swform.mk sw/UIConfig_swreport.mk sw/UIConfig_swriter.mk sw/UIConfig_swxform.mk
Maxim Monastirsky
momonasmon at gmail.com
Wed Jan 20 07:44:45 PST 2016
include/sfx2/dispatch.hxx | 2
include/sfx2/mnumgr.hxx | 11 -
officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu | 3
officecfg/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu | 5
officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu | 5
officecfg/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu | 5
officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu | 5
officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu | 5
officecfg/registry/data/org/openoffice/Office/UI/XFormsWindowState.xcu | 5
sfx2/source/control/dispatch.cxx | 24 ----
sfx2/source/menu/mnumgr.cxx | 56 ----------
sw/UIConfig_sglobal.mk | 1
sw/UIConfig_sweb.mk | 1
sw/UIConfig_swform.mk | 1
sw/UIConfig_swreport.mk | 1
sw/UIConfig_swriter.mk | 1
sw/UIConfig_swxform.mk | 1
sw/sdi/swriter.sdi | 6 +
sw/source/ui/app/app.src | 10 +
sw/source/ui/app/mn.src | 8 -
sw/source/uibase/docvw/SidebarTxtControl.cxx | 35 ------
sw/source/uibase/docvw/SidebarTxtControl.hxx | 2
sw/source/uibase/inc/app.hrc | 15 --
sw/source/uibase/inc/popup.hrc | 7 -
sw/source/uibase/shells/annotsh.cxx | 30 ++++-
sw/uiconfig/sglobal/popupmenu/annotation.xml | 23 ++++
sw/uiconfig/sweb/popupmenu/annotation.xml | 23 ++++
sw/uiconfig/swform/popupmenu/annotation.xml | 23 ++++
sw/uiconfig/swreport/popupmenu/annotation.xml | 23 ++++
sw/uiconfig/swriter/popupmenu/annotation.xml | 23 ++++
sw/uiconfig/swxform/popupmenu/annotation.xml | 23 ++++
31 files changed, 225 insertions(+), 158 deletions(-)
New commits:
commit ad236a3e1b456531ea758c2a3c5075860d823109
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Wed Jan 20 14:39:22 2016 +0200
i#107205 Remove SfxDispatcher::Popup and SfxPopupMenuManager::Popup
Change-Id: I1a8bee75a2dbfb039ec32faf001b75b26ea1f3fe
diff --git a/include/sfx2/dispatch.hxx b/include/sfx2/dispatch.hxx
index c6bc458..47be2d7 100644
--- a/include/sfx2/dispatch.hxx
+++ b/include/sfx2/dispatch.hxx
@@ -154,8 +154,6 @@ public:
SfxShell* GetShell(sal_uInt16 nIdx) const;
SfxViewFrame* GetFrame() const;
SfxModule* GetModule() const;
- // caller has to clean up the Manager on his own
- static SfxPopupMenuManager* Popup( sal_uInt16 nConfigId, vcl::Window *pWin, const Point *pPos );
void ExecutePopup( const ResId &rId, vcl::Window *pWin = nullptr, const Point *pPos = nullptr );
void ExecutePopup( const OUString &rResName, vcl::Window *pWin = nullptr, const Point *pPos = nullptr );
diff --git a/include/sfx2/mnumgr.hxx b/include/sfx2/mnumgr.hxx
index 7682fc6..a1607b9 100644
--- a/include/sfx2/mnumgr.hxx
+++ b/include/sfx2/mnumgr.hxx
@@ -68,12 +68,6 @@ class SAL_DLLPUBLIC_EXPORT SfxPopupMenuManager : public SfxMenuManager
{
private:
Menu* pSVMenu;
-
- // when #i107205 gets fixed this one should be superfluous.
- // But right now we want to avoid the memory leak that would otherwise occur,
- // if we don't delete the pointer that got created in SfxPopupMenuManager::Popup
- static PopupMenu * pStaticThesSubMenu;
-
SfxPopupMenuManager( const SfxPopupMenuManager& ) = delete;
SfxPopupMenuManager& operator=( const SfxPopupMenuManager& ) = delete;
@@ -81,11 +75,6 @@ public:
SfxPopupMenuManager( PopupMenu*, SfxBindings& );
~SfxPopupMenuManager();
static void ExecutePopup( const ResId&, SfxViewFrame* pViewFrame, const Point& rPoint, vcl::Window* pWindow );
- // @deprecated!!
- // Don't use this method any longer. The whole class will be removed in the future.
- // Changing code which relies on Popup would need much more effort.
- static SfxPopupMenuManager* Popup( const ResId& rResId, SfxViewFrame* pFrame,const Point& rPoint, vcl::Window* pWindow );
-
void Execute( const Point& rPos, vcl::Window *pWindow );
void RemoveDisabledEntries();
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 12444ef..a4d73d5 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1849,30 +1849,6 @@ bool SfxDispatcher::_FillState(const SfxSlotServer& rSvr, SfxItemSet& rState,
return false;
}
-SfxPopupMenuManager* SfxDispatcher::Popup( sal_uInt16 nConfigId, vcl::Window *pWin, const Point *pPos )
-{
- SfxDispatcher &rDisp = *SfxGetpApp()->GetDispatcher_Impl();
- sal_uInt16 nShLevel = 0;
- SfxShell *pSh;
-
- if ( rDisp.xImp->bQuiet )
- {
- nConfigId = 0;
- nShLevel = rDisp.xImp->aStack.size();
- }
-
- vcl::Window *pWindow = pWin ? pWin : rDisp.xImp->pFrame->GetFrame().GetWorkWindow_Impl()->GetWindow();
- for ( pSh = rDisp.GetShell(nShLevel); pSh; ++nShLevel, pSh = rDisp.GetShell(nShLevel) )
- {
- const ResId& rResId = pSh->GetInterface()->GetPopupMenuResId();
- if ( ( nConfigId == 0 && rResId.GetId() ) || ( nConfigId != 0 && rResId.GetId() == nConfigId ) )
- {
- return SfxPopupMenuManager::Popup( rResId, rDisp.GetFrame(), pPos ? *pPos : pWindow->GetPointerPosPixel(), pWindow );
- }
- }
- return nullptr;
-}
-
void SfxDispatcher::ExecutePopup( vcl::Window *pWin, const Point *pPos )
{
SfxDispatcher &rDisp = *SfxGetpApp()->GetDispatcher_Impl();
diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
index 31a304d..ef2d375 100644
--- a/sfx2/source/menu/mnumgr.cxx
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -64,9 +64,6 @@
#include <sfx2/objface.hxx>
#include "thessubmenu.hxx"
-// static member initialization
-PopupMenu * SfxPopupMenuManager::pStaticThesSubMenu = nullptr;
-
using namespace com::sun::star;
void TryToHideDisabledEntries_Impl( Menu* pMenu )
@@ -254,7 +251,6 @@ void SfxPopupMenuManager::RemoveDisabledEntries()
void SfxPopupMenuManager::Execute( const Point& rPos, vcl::Window* pWindow )
{
static_cast<PopupMenu*>( GetMenu()->GetSVMenu() )->Execute( pWindow, rPos );
- delete pStaticThesSubMenu; pStaticThesSubMenu = nullptr;
}
@@ -274,58 +270,6 @@ SfxPopupMenuManager::SfxPopupMenuManager( PopupMenu* pMenuArg, SfxBindings& rBin
{
}
-SfxPopupMenuManager* SfxPopupMenuManager::Popup( const ResId& rResId, SfxViewFrame* pFrame,const Point& rPoint, vcl::Window* pWindow )
-{
- PopupMenu *pSVMenu = new PopupMenu( rResId );
- sal_uInt16 n, nCount = pSVMenu->GetItemCount();
- for ( n=0; n<nCount; n++ )
- {
- sal_uInt16 nId = pSVMenu->GetItemId( n );
- if ( nId == SID_COPY || nId == SID_CUT || nId == SID_PASTE )
- break;
- }
-
- PopupMenu* pThesSubMenu = InsertThesaurusSubmenu_Impl( &pFrame->GetBindings(), pSVMenu );
- // #i107205# (see comment in header file)
- pStaticThesSubMenu = pThesSubMenu;
-
- if ( n == nCount )
- {
- PopupMenu aPop( SfxResId( MN_CLIPBOARDFUNCS ) );
- nCount = aPop.GetItemCount();
- for ( n=0; n<nCount; n++ )
- {
- sal_uInt16 nId = aPop.GetItemId( n );
- pSVMenu->InsertItem( nId, aPop.GetItemText( nId ), aPop.GetItemBits( nId ), OString(), n );
- pSVMenu->SetHelpId( nId, aPop.GetHelpId( nId ));
- }
- pSVMenu->InsertSeparator( OString(), n );
- }
-
- InsertVerbs_Impl( &pFrame->GetBindings(), pFrame->GetViewShell()->GetVerbs(), pSVMenu );
- Menu* pMenu = nullptr;
- css::ui::ContextMenuExecuteEvent aEvent;
- aEvent.SourceWindow = VCLUnoHelper::GetInterface( pWindow );
- aEvent.ExecutePosition.X = rPoint.X();
- aEvent.ExecutePosition.Y = rPoint.Y();
- OUString sDummyMenuName;
- if ( pFrame->GetViewShell()->TryContextMenuInterception( *pSVMenu, sDummyMenuName, pMenu, aEvent ) )
- {
- if ( pMenu )
- {
- delete pSVMenu;
- pSVMenu = static_cast<PopupMenu*>( pMenu );
- }
-
- SfxPopupMenuManager* aMgr = new SfxPopupMenuManager( pSVMenu, pFrame->GetBindings());
- aMgr->RemoveDisabledEntries();
- return aMgr;
- }
-
- return nullptr;
-}
-
-
void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFrame, const Point& rPoint, vcl::Window* pWindow )
{
PopupMenu *pSVMenu = new PopupMenu( rResId );
commit c5a1278fa2bcc193a82d78ee408ea7a913420675
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Wed Jan 20 14:37:27 2016 +0200
tdf#93837 sw: Convert comment context menu to xml
Change-Id: If449bff057a78802ed0b74d75a3c1a8a23def31a
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 70cc697..7903030 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -2452,6 +2452,9 @@
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Comments...</value>
</prop>
+ <prop oor:name="PopupLabel" oor:type="xs:string">
+ <value xml:lang="en-US">~Format All Comments...</value>
+ </prop>
</node>
<node oor:name=".uno:WordCountDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu
index ef6999a..e65812d 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterFormWindowState.xcu
@@ -20,6 +20,11 @@
<oor:component-data xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="WriterFormWindowState" oor:package="org.openoffice.Office.UI">
<node oor:name="UIElements">
<node oor:name="States">
+ <node oor:name="private:resource/popupmenu/annotation" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Comment</value>
+ </prop>
+ </node>
<node oor:name="private:resource/popupmenu/draw" oor:op="replace">
<prop oor:name="UIName" oor:type="xs:string">
<value xml:lang="en-US">Shape</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
index 7e3f9c9..c3b4c20 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterGlobalWindowState.xcu
@@ -20,6 +20,11 @@
<oor:component-data xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="WriterGlobalWindowState" oor:package="org.openoffice.Office.UI">
<node oor:name="UIElements">
<node oor:name="States">
+ <node oor:name="private:resource/popupmenu/annotation" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Comment</value>
+ </prop>
+ </node>
<node oor:name="private:resource/popupmenu/draw" oor:op="replace">
<prop oor:name="UIName" oor:type="xs:string">
<value xml:lang="en-US">Shape</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu
index 0c6f004..7846594 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterReportWindowState.xcu
@@ -20,6 +20,11 @@
<oor:component-data xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="WriterReportWindowState" oor:package="org.openoffice.Office.UI">
<node oor:name="UIElements">
<node oor:name="States">
+ <node oor:name="private:resource/popupmenu/annotation" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Comment</value>
+ </prop>
+ </node>
<node oor:name="private:resource/popupmenu/draw" oor:op="replace">
<prop oor:name="UIName" oor:type="xs:string">
<value xml:lang="en-US">Shape</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu
index 4f3ee11..b6eca80 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterWebWindowState.xcu
@@ -20,6 +20,11 @@
<oor:component-data xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="WriterWebWindowState" oor:package="org.openoffice.Office.UI">
<node oor:name="UIElements">
<node oor:name="States">
+ <node oor:name="private:resource/popupmenu/annotation" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Comment</value>
+ </prop>
+ </node>
<node oor:name="private:resource/popupmenu/form" oor:op="replace">
<prop oor:name="UIName" oor:type="xs:string">
<value xml:lang="en-US">Form Control</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
index f54246e..a5bc600 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterWindowState.xcu
@@ -20,6 +20,11 @@
<oor:component-data xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="WriterWindowState" oor:package="org.openoffice.Office.UI">
<node oor:name="UIElements">
<node oor:name="States">
+ <node oor:name="private:resource/popupmenu/annotation" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Comment</value>
+ </prop>
+ </node>
<node oor:name="private:resource/popupmenu/draw" oor:op="replace">
<prop oor:name="UIName" oor:type="xs:string">
<value xml:lang="en-US">Shape</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/XFormsWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/XFormsWindowState.xcu
index b90debc..1c71f75 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/XFormsWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/XFormsWindowState.xcu
@@ -20,6 +20,11 @@
<oor:component-data xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="XFormsWindowState" oor:package="org.openoffice.Office.UI">
<node oor:name="UIElements">
<node oor:name="States">
+ <node oor:name="private:resource/popupmenu/annotation" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Comment</value>
+ </prop>
+ </node>
<node oor:name="private:resource/popupmenu/draw" oor:op="replace">
<prop oor:name="UIName" oor:type="xs:string">
<value xml:lang="en-US">Shape</value>
diff --git a/sw/UIConfig_sglobal.mk b/sw/UIConfig_sglobal.mk
index 6779f1d..8d831d3 100644
--- a/sw/UIConfig_sglobal.mk
+++ b/sw/UIConfig_sglobal.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/sglobal,\
))
$(eval $(call gb_UIConfig_add_popupmenufiles,modules/sglobal,\
+ sw/uiconfig/sglobal/popupmenu/annotation \
sw/uiconfig/sglobal/popupmenu/draw \
sw/uiconfig/sglobal/popupmenu/drawtext \
sw/uiconfig/sglobal/popupmenu/form \
diff --git a/sw/UIConfig_sweb.mk b/sw/UIConfig_sweb.mk
index daad88f..7b7b809 100644
--- a/sw/UIConfig_sweb.mk
+++ b/sw/UIConfig_sweb.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/sweb,\
))
$(eval $(call gb_UIConfig_add_popupmenufiles,modules/sweb,\
+ sw/uiconfig/sweb/popupmenu/annotation \
sw/uiconfig/sweb/popupmenu/form \
sw/uiconfig/sweb/popupmenu/frame \
sw/uiconfig/sweb/popupmenu/graphic \
diff --git a/sw/UIConfig_swform.mk b/sw/UIConfig_swform.mk
index 91474a4..11dd732 100644
--- a/sw/UIConfig_swform.mk
+++ b/sw/UIConfig_swform.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/swform,\
))
$(eval $(call gb_UIConfig_add_popupmenufiles,modules/swform,\
+ sw/uiconfig/swform/popupmenu/annotation \
sw/uiconfig/swform/popupmenu/draw \
sw/uiconfig/swform/popupmenu/drawtext \
sw/uiconfig/swform/popupmenu/form \
diff --git a/sw/UIConfig_swreport.mk b/sw/UIConfig_swreport.mk
index 8f7a792..aafac33 100644
--- a/sw/UIConfig_swreport.mk
+++ b/sw/UIConfig_swreport.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/swreport,\
))
$(eval $(call gb_UIConfig_add_popupmenufiles,modules/swreport,\
+ sw/uiconfig/swreport/popupmenu/annotation \
sw/uiconfig/swreport/popupmenu/draw \
sw/uiconfig/swreport/popupmenu/drawtext \
sw/uiconfig/swreport/popupmenu/form \
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 0adadbf..e34bbef 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/swriter,\
))
$(eval $(call gb_UIConfig_add_popupmenufiles,modules/swriter,\
+ sw/uiconfig/swriter/popupmenu/annotation \
sw/uiconfig/swriter/popupmenu/draw \
sw/uiconfig/swriter/popupmenu/drawtext \
sw/uiconfig/swriter/popupmenu/form \
diff --git a/sw/UIConfig_swxform.mk b/sw/UIConfig_swxform.mk
index cebe2c4..8c79944 100644
--- a/sw/UIConfig_swxform.mk
+++ b/sw/UIConfig_swxform.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/swxform,\
))
$(eval $(call gb_UIConfig_add_popupmenufiles,modules/swxform,\
+ sw/uiconfig/swxform/popupmenu/annotation \
sw/uiconfig/swxform/popupmenu/draw \
sw/uiconfig/swxform/popupmenu/drawtext \
sw/uiconfig/swxform/popupmenu/form \
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index f43ed50..2ad6d07 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -9746,6 +9746,9 @@ SfxVoidItem DeleteAuthor FN_DELETE_NOTE_AUTHOR ( SfxStringItem Author FN_DELETE_
RecordPerSet;
Synchron;
+ /* status: */
+ SlotType = SfxStringItem
+
/* config: */
AccelConfig = TRUE,
MenuConfig = TRUE,
@@ -9841,6 +9844,9 @@ SfxVoidItem HideAuthor FN_HIDE_NOTE_AUTHOR ( SfxStringItem Author FN_HIDE_NOTE_A
RecordPerSet;
Synchron;
+ /* status: */
+ SlotType = SfxStringItem
+
/* config: */
AccelConfig = FALSE,
MenuConfig = FALSE,
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src
index b60a7b0..b73d10c 100644
--- a/sw/source/ui/app/app.src
+++ b/sw/source/ui/app/app.src
@@ -466,6 +466,16 @@ String STR_REDLINE_UNKNOWN_AUTHOR
Text [ en-US ] = "Unknown Author";
};
+String STR_DELETE_NOTE_AUTHOR
+{
+ Text [ en-US ] = "Delete ~All Comments by $1";
+};
+
+String STR_HIDE_NOTE_AUTHOR
+{
+ Text [ en-US ] = "H~ide All Comments by $1";
+};
+
String STR_DONT_ASK_AGAIN
{
Text [ en-US ] = "~Do not show warning again" ;
diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src
index 7b19725..70031de 100644
--- a/sw/source/ui/app/mn.src
+++ b/sw/source/ui/app/mn.src
@@ -86,14 +86,6 @@
/*--Popups---------------------------------------------------------------*/
-Menu MN_ANNOTATION_POPUPMENU
-{
- ItemList =
- {
- MN_ANNOTATIONS
- };
-};
-
Menu MN_ANNOTATION_BUTTON
{
ItemList =
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index d8ff85a..51c2c04 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -35,7 +35,6 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
-#include <sfx2/mnumgr.hxx>
#include <vcl/svapp.hxx>
#include <vcl/help.hxx>
@@ -55,7 +54,6 @@
#include <view.hxx>
#include <wrtsh.hxx>
#include <shellres.hxx>
-#include <SwRewriter.hxx>
#include <memory>
namespace sw { namespace sidebarwindows {
@@ -366,12 +364,6 @@ IMPL_LINK_TYPED( SidebarTextControl, OnlineSpellCallback, SpellCallbackInfo&, rI
}
}
-IMPL_LINK_TYPED( SidebarTextControl, Select, Menu*, pSelMenu, bool )
-{
- mrSidebarWin.ExecuteCommand( pSelMenu->GetCurItemId() );
- return false;
-}
-
void SidebarTextControl::Command( const CommandEvent& rCEvt )
{
if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
@@ -384,32 +376,7 @@ void SidebarTextControl::Command( const CommandEvent& rCEvt )
GetTextView()->ExecuteSpellPopup(rCEvt.GetMousePosPixel(),&aLink);
}
else
- {
- std::unique_ptr<SfxPopupMenuManager> pMgr(SfxDispatcher::Popup(0, this,&rCEvt.GetMousePosPixel()));
- static_cast<PopupMenu*>(pMgr->GetSVMenu())->SetSelectHdl( LINK(this, SidebarTextControl, Select) );
-
- {
- OUString aText = static_cast<PopupMenu*>(pMgr->GetSVMenu())->GetItemText( FN_DELETE_NOTE_AUTHOR );
- SwRewriter aRewriter;
- aRewriter.AddRule(UndoArg1, mrSidebarWin.GetAuthor());
- aText = aRewriter.Apply(aText);
- static_cast<PopupMenu*>(pMgr->GetSVMenu())->SetItemText(FN_DELETE_NOTE_AUTHOR,aText);
- }
-
- Point aPos;
- if (rCEvt.IsMouseEvent())
- aPos = rCEvt.GetMousePosPixel();
- else
- {
- const Size aSize = GetSizePixel();
- aPos = Point( aSize.getWidth()/2, aSize.getHeight()/2 );
- }
-
- //!! call different Execute function to get rid of the new thesaurus sub menu
- //!! pointer created in the call to Popup.
- //!! Otherwise we would have a memory leak (see also #i107205#)
- pMgr->Execute( aPos, this );
- }
+ SfxDispatcher::ExecutePopup(this, &rCEvt.GetMousePosPixel());
}
else
if (rCEvt.GetCommand() == CommandEventId::Wheel)
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.hxx b/sw/source/uibase/docvw/SidebarTxtControl.hxx
index 7142898..a701942 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.hxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.hxx
@@ -48,8 +48,6 @@ class SidebarTextControl : public Control
virtual OUString GetSurroundingText() const override;
virtual Selection GetSurroundingTextSelection() const override;
- DECL_LINK_TYPED( Select, Menu*, bool );
-
public:
SidebarTextControl( SwSidebarWin& rSidebarWin,
WinBits nBits,
diff --git a/sw/source/uibase/inc/app.hrc b/sw/source/uibase/inc/app.hrc
index 6feb83f..b5264d6 100644
--- a/sw/source/uibase/inc/app.hrc
+++ b/sw/source/uibase/inc/app.hrc
@@ -39,6 +39,8 @@
#define STR_REDLINE_UNKNOWN_AUTHOR (RC_APP_BEGIN + 76)
#define STR_WESTERN_FONT (RC_APP_BEGIN + 77)
#define STR_CJK_FONT (RC_APP_BEGIN + 78)
+#define STR_DELETE_NOTE_AUTHOR (RC_APP_BEGIN + 79)
+#define STR_HIDE_NOTE_AUTHOR (RC_APP_BEGIN + 80)
#define STR_ENV_TITLE (RC_APP_BEGIN + 91)
#define STR_LAB_TITLE (RC_APP_BEGIN + 92)
diff --git a/sw/source/uibase/inc/popup.hrc b/sw/source/uibase/inc/popup.hrc
index 343b710..4f0e83f 100644
--- a/sw/source/uibase/inc/popup.hrc
+++ b/sw/source/uibase/inc/popup.hrc
@@ -22,10 +22,9 @@
#include "rcid.hrc"
-#define MN_ANNOTATION_POPUPMENU (RC_POPUPS_BEGIN + 0)
-#define MN_ANNOTATION_BUTTON (RC_POPUPS_BEGIN + 1)
-#define MN_HEADERFOOTER_BUTTON (RC_POPUPS_BEGIN + 2)
-#define MN_PAGEBREAK_BUTTON (RC_POPUPS_BEGIN + 3)
+#define MN_ANNOTATION_BUTTON (RC_POPUPS_BEGIN + 0)
+#define MN_HEADERFOOTER_BUTTON (RC_POPUPS_BEGIN + 1)
+#define MN_PAGEBREAK_BUTTON (RC_POPUPS_BEGIN + 2)
#if MN_PAGEBREAK_BUTTON > RC_POPUPS_END
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 23fc94c..7e3a3fa 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -85,6 +85,7 @@
#include <edtwin.hxx>
#include <swwait.hxx>
#include <docstat.hxx>
+#include <SwRewriter.hxx>
#include <cmdid.h>
#include <globals.hrc>
@@ -141,7 +142,7 @@ void SwAnnotationShell::InitInterface_Impl()
{
GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_TEXT_TOOLBOX);
- GetStaticInterface()->RegisterPopupMenu(SW_RES(MN_ANNOTATION_POPUPMENU));
+ GetStaticInterface()->RegisterPopupMenu("annotation");
}
@@ -1117,6 +1118,8 @@ void SwAnnotationShell::NoteExec(SfxRequest &rReq)
const SfxStringItem* pItem = rReq.GetArg<SfxStringItem>(nSlot);
if ( pItem )
pPostItMgr->Delete( pItem->GetValue() );
+ else
+ pPostItMgr->Delete( pPostItMgr->GetActiveSidebarWin()->GetAuthor() );
break;
}
case FN_HIDE_NOTE:
@@ -1129,6 +1132,8 @@ void SwAnnotationShell::NoteExec(SfxRequest &rReq)
const SfxStringItem* pItem = rReq.GetArg<SfxStringItem>(nSlot);
if ( pItem )
pPostItMgr->Hide( pItem->GetValue() );
+ else
+ pPostItMgr->Hide( pPostItMgr->GetActiveSidebarWin()->GetAuthor() );
}
}
}
@@ -1144,11 +1149,9 @@ void SwAnnotationShell::GetNoteState(SfxItemSet &rSet)
switch( nSlotId )
{
case FN_POSTIT:
- case FN_DELETE_NOTE_AUTHOR:
case FN_DELETE_ALL_NOTES:
case FN_FORMAT_ALL_NOTES:
case FN_HIDE_NOTE:
- case FN_HIDE_NOTE_AUTHOR:
case FN_HIDE_ALL_NOTES:
case FN_DELETE_COMMENT:
{
@@ -1159,7 +1162,26 @@ void SwAnnotationShell::GetNoteState(SfxItemSet &rSet)
}
break;
}
-
+ case FN_DELETE_NOTE_AUTHOR:
+ case FN_HIDE_NOTE_AUTHOR:
+ {
+ if( !pPostItMgr
+ || !pPostItMgr->HasActiveAnnotationWin() )
+ {
+ rSet.DisableItem(nWhich);
+ }
+ else
+ {
+ OUString aText( nSlotId == FN_DELETE_NOTE_AUTHOR ?
+ SW_RES( STR_DELETE_NOTE_AUTHOR ) : SW_RES( STR_HIDE_NOTE_AUTHOR ) );
+ SwRewriter aRewriter;
+ aRewriter.AddRule( UndoArg1, pPostItMgr->GetActiveSidebarWin()->GetAuthor() );
+ aText = aRewriter.Apply( aText );
+ SfxStringItem aItem( nSlotId, aText );
+ rSet.Put( aItem );
+ }
+ break;
+ }
case FN_REPLY:
{
if ( !pPostItMgr ||
diff --git a/sw/uiconfig/sglobal/popupmenu/annotation.xml b/sw/uiconfig/sglobal/popupmenu/annotation.xml
new file mode 100644
index 0000000..8bb8fdf
--- /dev/null
+++ b/sw/uiconfig/sglobal/popupmenu/annotation.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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/.
+ *
+-->
+<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
+ <menu:menuitem menu:id=".uno:Cut"/>
+ <menu:menuitem menu:id=".uno:Copy"/>
+ <menu:menuitem menu:id=".uno:Paste"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ReplyComment"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:DeleteComment"/>
+ <menu:menuitem menu:id=".uno:DeleteAuthor"/>
+ <menu:menuitem menu:id=".uno:DeleteAllNotes"/>
+ <menu:menuitem menu:id=".uno:FormatAllNotes"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
+</menu:menupopup>
diff --git a/sw/uiconfig/sweb/popupmenu/annotation.xml b/sw/uiconfig/sweb/popupmenu/annotation.xml
new file mode 100644
index 0000000..8bb8fdf
--- /dev/null
+++ b/sw/uiconfig/sweb/popupmenu/annotation.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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/.
+ *
+-->
+<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
+ <menu:menuitem menu:id=".uno:Cut"/>
+ <menu:menuitem menu:id=".uno:Copy"/>
+ <menu:menuitem menu:id=".uno:Paste"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ReplyComment"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:DeleteComment"/>
+ <menu:menuitem menu:id=".uno:DeleteAuthor"/>
+ <menu:menuitem menu:id=".uno:DeleteAllNotes"/>
+ <menu:menuitem menu:id=".uno:FormatAllNotes"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
+</menu:menupopup>
diff --git a/sw/uiconfig/swform/popupmenu/annotation.xml b/sw/uiconfig/swform/popupmenu/annotation.xml
new file mode 100644
index 0000000..8bb8fdf
--- /dev/null
+++ b/sw/uiconfig/swform/popupmenu/annotation.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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/.
+ *
+-->
+<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
+ <menu:menuitem menu:id=".uno:Cut"/>
+ <menu:menuitem menu:id=".uno:Copy"/>
+ <menu:menuitem menu:id=".uno:Paste"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ReplyComment"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:DeleteComment"/>
+ <menu:menuitem menu:id=".uno:DeleteAuthor"/>
+ <menu:menuitem menu:id=".uno:DeleteAllNotes"/>
+ <menu:menuitem menu:id=".uno:FormatAllNotes"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
+</menu:menupopup>
diff --git a/sw/uiconfig/swreport/popupmenu/annotation.xml b/sw/uiconfig/swreport/popupmenu/annotation.xml
new file mode 100644
index 0000000..8bb8fdf
--- /dev/null
+++ b/sw/uiconfig/swreport/popupmenu/annotation.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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/.
+ *
+-->
+<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
+ <menu:menuitem menu:id=".uno:Cut"/>
+ <menu:menuitem menu:id=".uno:Copy"/>
+ <menu:menuitem menu:id=".uno:Paste"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ReplyComment"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:DeleteComment"/>
+ <menu:menuitem menu:id=".uno:DeleteAuthor"/>
+ <menu:menuitem menu:id=".uno:DeleteAllNotes"/>
+ <menu:menuitem menu:id=".uno:FormatAllNotes"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
+</menu:menupopup>
diff --git a/sw/uiconfig/swriter/popupmenu/annotation.xml b/sw/uiconfig/swriter/popupmenu/annotation.xml
new file mode 100644
index 0000000..8bb8fdf
--- /dev/null
+++ b/sw/uiconfig/swriter/popupmenu/annotation.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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/.
+ *
+-->
+<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
+ <menu:menuitem menu:id=".uno:Cut"/>
+ <menu:menuitem menu:id=".uno:Copy"/>
+ <menu:menuitem menu:id=".uno:Paste"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ReplyComment"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:DeleteComment"/>
+ <menu:menuitem menu:id=".uno:DeleteAuthor"/>
+ <menu:menuitem menu:id=".uno:DeleteAllNotes"/>
+ <menu:menuitem menu:id=".uno:FormatAllNotes"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
+</menu:menupopup>
diff --git a/sw/uiconfig/swxform/popupmenu/annotation.xml b/sw/uiconfig/swxform/popupmenu/annotation.xml
new file mode 100644
index 0000000..8bb8fdf
--- /dev/null
+++ b/sw/uiconfig/swxform/popupmenu/annotation.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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/.
+ *
+-->
+<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
+ <menu:menuitem menu:id=".uno:Cut"/>
+ <menu:menuitem menu:id=".uno:Copy"/>
+ <menu:menuitem menu:id=".uno:Paste"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ReplyComment"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:DeleteComment"/>
+ <menu:menuitem menu:id=".uno:DeleteAuthor"/>
+ <menu:menuitem menu:id=".uno:DeleteAllNotes"/>
+ <menu:menuitem menu:id=".uno:FormatAllNotes"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
+</menu:menupopup>
commit 405a00949cd72784a5cc231e2552dfdbeaa19812
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Wed Jan 20 13:40:04 2016 +0200
Drop unused defines
Change-Id: Iab5c64c38ae0fb38ae87721d82f6743c74f18841
diff --git a/sw/source/uibase/inc/app.hrc b/sw/source/uibase/inc/app.hrc
index ff5e12d..6feb83f 100644
--- a/sw/source/uibase/inc/app.hrc
+++ b/sw/source/uibase/inc/app.hrc
@@ -50,19 +50,6 @@
#define STR_FDLG_TEMPLATE_BUTTON (RC_APP_BEGIN + 1)
#define STR_FDLG_TEMPLATE_NAME (RC_APP_BEGIN + 2)
-// Ids for all the PopUpMenues
-#define MN_FORMAT_STYLE (RC_APP_BEGIN + 17)
-#define MN_FORMAT_ALGN (RC_APP_BEGIN + 18)
-#define MN_FORMAT_LINESPACE (RC_APP_BEGIN + 19)
-#define MN_FORMAT_FRM_HORZ (RC_APP_BEGIN + 23)
-#define MN_CELL (RC_APP_BEGIN + 29)
-#define MN_WRAP (RC_APP_BEGIN + 38)
-#define MN_SUB_TBLROW (RC_APP_BEGIN + 39)
-#define MN_SUB_TBLCOL (RC_APP_BEGIN + 40)
-#define MN_SUB_ARRANGE (RC_APP_BEGIN + 46)
-
-#define MN_SUB_ALIGN (RC_APP_BEGIN + 50)
-
#define STR_WRITER_DOCUMENT_FULLTYPE (RC_APP_BEGIN + 100)
#define STR_CONVERT_TEXT_TABLE (RC_APP_BEGIN + 101)
#define STR_ABSTRACT_TITLE (RC_APP_BEGIN + 102)
More information about the Libreoffice-commits
mailing list