summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-04-12 14:51:13 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-04-13 11:11:51 +0100
commita10b4fd2bc08651d47bdb19bb8ab9c1f8f3d4851 (patch)
tree509dcb18c7d733e4f0c43e6316fbe617ec6e5fcb /sw/source/uibase
parent7bf1e66ac51a582527b35b852586cf7474bc7ba8 (diff)
convert annotation menu to .ui
Change-Id: Id15e1c2040d3d202e90984888598da4426b5fec4
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/docvw/AnnotationMenuButton.cxx30
-rw-r--r--sw/source/uibase/docvw/AnnotationWin.cxx12
-rw-r--r--sw/source/uibase/docvw/AnnotationWin2.cxx1
-rw-r--r--sw/source/uibase/docvw/HeaderFooterWin.cxx1
-rw-r--r--sw/source/uibase/docvw/PageBreakWin.cxx1
-rw-r--r--sw/source/uibase/inc/popup.hrc34
-rw-r--r--sw/source/uibase/shells/annotsh.cxx1
-rw-r--r--sw/source/uibase/shells/beziersh.cxx1
-rw-r--r--sw/source/uibase/shells/drawsh.cxx1
-rw-r--r--sw/source/uibase/shells/drformsh.cxx1
-rw-r--r--sw/source/uibase/shells/drwtxtsh.cxx1
-rw-r--r--sw/source/uibase/shells/frmsh.cxx1
-rw-r--r--sw/source/uibase/shells/grfsh.cxx1
-rw-r--r--sw/source/uibase/shells/mediash.cxx1
-rw-r--r--sw/source/uibase/shells/navsh.cxx1
-rw-r--r--sw/source/uibase/shells/olesh.cxx1
-rw-r--r--sw/source/uibase/shells/tabsh.cxx1
-rw-r--r--sw/source/uibase/shells/textsh.cxx1
-rw-r--r--sw/source/uibase/uiview/pview.cxx1
-rw-r--r--sw/source/uibase/uiview/srcview.cxx1
-rw-r--r--sw/source/uibase/uiview/view.src1
-rw-r--r--sw/source/uibase/web/wformsh.cxx1
-rw-r--r--sw/source/uibase/web/wfrmsh.cxx1
-rw-r--r--sw/source/uibase/web/wgrfsh.cxx1
-rw-r--r--sw/source/uibase/web/wolesh.cxx1
-rw-r--r--sw/source/uibase/web/wtabsh.cxx1
-rw-r--r--sw/source/uibase/web/wtextsh.cxx1
27 files changed, 27 insertions, 73 deletions
diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
index a7f56ffe650c..f0cf0645608c 100644
--- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
@@ -67,7 +67,17 @@ void AnnotationMenuButton::dispose()
void AnnotationMenuButton::Select()
{
- mrSidebarWin.ExecuteCommand( GetCurItemId() );
+ OString sIdent = GetCurItemIdent();
+ if (sIdent == "reply")
+ mrSidebarWin.ExecuteCommand(FN_REPLY);
+ else if (sIdent == "delete")
+ mrSidebarWin.ExecuteCommand(FN_DELETE_COMMENT);
+ else if (sIdent == "deleteby")
+ mrSidebarWin.ExecuteCommand(FN_DELETE_NOTE_AUTHOR);
+ else if (sIdent == "deleteall")
+ mrSidebarWin.ExecuteCommand(FN_DELETE_ALL_NOTES);
+ else if (sIdent == "formatall")
+ mrSidebarWin.ExecuteCommand(FN_FORMAT_ALL_NOTES);
}
void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt )
@@ -75,18 +85,18 @@ void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt )
PopupMenu* pButtonPopup(GetPopupMenu());
if (mrSidebarWin.IsReadOnly())
{
- pButtonPopup->EnableItem(FN_REPLY, false );
- pButtonPopup->EnableItem(FN_DELETE_COMMENT, false );
- pButtonPopup->EnableItem(FN_DELETE_NOTE_AUTHOR, false );
- pButtonPopup->EnableItem(FN_DELETE_ALL_NOTES, false );
- pButtonPopup->EnableItem(FN_FORMAT_ALL_NOTES, false );
+ pButtonPopup->EnableItem(pButtonPopup->GetItemId("reply"), false);
+ pButtonPopup->EnableItem(pButtonPopup->GetItemId("delete"), false );
+ pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteby"), false );
+ pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteall"), false );
+ pButtonPopup->EnableItem(pButtonPopup->GetItemId("formatall"), false );
}
else
{
- pButtonPopup->EnableItem(FN_DELETE_COMMENT, !mrSidebarWin.IsProtected() );
- pButtonPopup->EnableItem(FN_DELETE_NOTE_AUTHOR);
- pButtonPopup->EnableItem(FN_DELETE_ALL_NOTES);
- pButtonPopup->EnableItem(FN_FORMAT_ALL_NOTES);
+ pButtonPopup->EnableItem(pButtonPopup->GetItemId("delete"), !mrSidebarWin.IsProtected());
+ pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteby"));
+ pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteall"));
+ pButtonPopup->EnableItem(pButtonPopup->GetItemId("formatall"));
}
if (mrSidebarWin.IsProtected())
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx
index 241de71f81cc..8bbb502c5ce6 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -23,7 +23,6 @@
#include <PostItMgr.hxx>
#include <annotation.hrc>
-#include <popup.hrc>
#include <cmdid.h>
#include <vcl/menu.hxx>
@@ -67,6 +66,7 @@ SwAnnotationWin::SwAnnotationWin( SwEditWin& rEditWin,
SwSidebarItem& rSidebarItem,
SwFormatField* aField )
: Window(&rEditWin, nBits)
+ , maBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/swriter/ui/annotationmenu.ui", "")
, mrMgr(aMgr)
, mrView(rEditWin.GetView())
, mnEventId(nullptr)
@@ -122,7 +122,8 @@ SwAnnotationWin::~SwAnnotationWin()
void SwAnnotationWin::dispose()
{
- mpButtonPopup.disposeAndClear();
+ mpButtonPopup.clear();
+ maBuilder.disposeBuilder();
if (IsDisposed())
return;
@@ -342,12 +343,13 @@ sal_uInt32 SwAnnotationWin::CountFollowing()
VclPtr<MenuButton> SwAnnotationWin::CreateMenuButton()
{
- mpButtonPopup = VclPtr<PopupMenu>::Create(SW_RES(MN_ANNOTATION_BUTTON));
- OUString aText = mpButtonPopup->GetItemText( FN_DELETE_NOTE_AUTHOR );
+ mpButtonPopup = maBuilder.get_menu("menu");
+ sal_uInt16 nByAuthorId = mpButtonPopup->GetItemId("deleteby");
+ OUString aText = mpButtonPopup->GetItemText(nByAuthorId);
SwRewriter aRewriter;
aRewriter.AddRule(UndoArg1,GetAuthor());
aText = aRewriter.Apply(aText);
- mpButtonPopup->SetItemText(FN_DELETE_NOTE_AUTHOR,aText);
+ mpButtonPopup->SetItemText(nByAuthorId, aText);
VclPtrInstance<AnnotationMenuButton> pMenuButton( *this );
pMenuButton->SetPopupMenu( mpButtonPopup );
pMenuButton->Show();
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 84abbb3026fb..c61b7a82f45d 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -34,7 +34,6 @@
#include <OverlayRanges.hxx>
#include <annotation.hrc>
-#include <popup.hrc>
#include <docvw.hrc>
#include <app.hrc>
#include <access.hrc>
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 85e2836ab08e..635bf6fa0996 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -10,7 +10,6 @@
#include <app.hrc>
#include <docvw.hrc>
#include <globals.hrc>
-#include <popup.hrc>
#include <svtools/svtools.hrc>
#include <cmdid.h>
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index 10b91718b756..7aea3c768ac3 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -8,7 +8,6 @@
*/
#include <globals.hrc>
-#include <popup.hrc>
#include <utlui.hrc>
#include <cmdid.h>
diff --git a/sw/source/uibase/inc/popup.hrc b/sw/source/uibase/inc/popup.hrc
deleted file mode 100644
index 0bc6595a6eb3..000000000000
--- a/sw/source/uibase/inc/popup.hrc
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_POPUP_HRC
-#define INCLUDED_SW_SOURCE_UIBASE_INC_POPUP_HRC
-
-#include "rcid.hrc"
-
-#define MN_ANNOTATION_BUTTON (RC_POPUPS_BEGIN + 0)
-
-#if MN_ANNOTATION_BUTTON > RC_POPUPS_END
-
-#error Resource-Id Ueberlauf in #file, #line
-#endif
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index b58ef60fea11..c51072f5695c 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -75,7 +75,6 @@
#include <viewopt.hxx>
#include <wrtsh.hxx>
#include <uitool.hxx>
-#include <popup.hrc>
#include <chrdlgmodes.hxx>
#include <pardlg.hxx>
#include <swdtflvr.hxx>
diff --git a/sw/source/uibase/shells/beziersh.cxx b/sw/source/uibase/shells/beziersh.cxx
index c60d2417c27e..383acf740564 100644
--- a/sw/source/uibase/shells/beziersh.cxx
+++ b/sw/source/uibase/shells/beziersh.cxx
@@ -35,7 +35,6 @@
#include "globals.hrc"
#include "drawbase.hxx"
#include "beziersh.hxx"
-#include "popup.hrc"
#include "shells.hrc"
#define SwBezierShell
#include <sfx2/msg.hxx>
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx
index 1f978e99f7ca..fc0580ea85bd 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -55,7 +55,6 @@
#include "cmdid.h"
#include "globals.hrc"
#include "helpid.h"
-#include "popup.hrc"
#include "shells.hrc"
#include "drwbassh.hxx"
#include "drawsh.hxx"
diff --git a/sw/source/uibase/shells/drformsh.cxx b/sw/source/uibase/shells/drformsh.cxx
index 8cd842334412..cde7c347c86a 100644
--- a/sw/source/uibase/shells/drformsh.cxx
+++ b/sw/source/uibase/shells/drformsh.cxx
@@ -40,7 +40,6 @@
#include "cmdid.h"
#include "globals.hrc"
#include "helpid.h"
-#include "popup.hrc"
#include "shells.hrc"
#include "drwbassh.hxx"
#include "drformsh.hxx"
diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx
index 56d203bd19ba..af9becb17a1b 100644
--- a/sw/source/uibase/shells/drwtxtsh.cxx
+++ b/sw/source/uibase/shells/drwtxtsh.cxx
@@ -61,7 +61,6 @@
#define SwDrawTextShell
#include <sfx2/msg.hxx>
#include <swslots.hxx>
-#include <popup.hrc>
#include <uitool.hxx>
#include <wview.hxx>
#include <swmodule.hxx>
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 72811476b4b9..31778367ac9e 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -73,7 +73,6 @@
#include <cmdid.h>
#include <cfgitems.hxx>
#include <globals.hrc>
-#include <popup.hrc>
#include <shells.hrc>
#include "swabstdlg.hxx"
#include "misc.hrc"
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index 777be9f04156..a334edc3edf7 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -64,7 +64,6 @@
#include <edtwin.hxx>
#include <swwait.hxx>
#include <shells.hrc>
-#include <popup.hrc>
#include <svx/extedit.hxx>
#include <svx/graphichelper.hxx>
#include <doc.hxx>
diff --git a/sw/source/uibase/shells/mediash.cxx b/sw/source/uibase/shells/mediash.cxx
index 04fa43365382..8440025570db 100644
--- a/sw/source/uibase/shells/mediash.cxx
+++ b/sw/source/uibase/shells/mediash.cxx
@@ -55,7 +55,6 @@
#include <edtwin.hxx>
#include <swwait.hxx>
#include <shells.hrc>
-#include <popup.hrc>
#include <sfx2/objface.hxx>
#include <vcl/EnumContext.hxx>
diff --git a/sw/source/uibase/shells/navsh.cxx b/sw/source/uibase/shells/navsh.cxx
index edd99373c84f..073f22a7820c 100644
--- a/sw/source/uibase/shells/navsh.cxx
+++ b/sw/source/uibase/shells/navsh.cxx
@@ -22,7 +22,6 @@
#include "helpid.h"
#include "globals.hrc"
#include "navsh.hxx"
-#include "popup.hrc"
#include "shells.hrc"
#define SwNavigationShell
#include "swslots.hxx"
diff --git a/sw/source/uibase/shells/olesh.cxx b/sw/source/uibase/shells/olesh.cxx
index 5171612100c3..e9bd948d7d16 100644
--- a/sw/source/uibase/shells/olesh.cxx
+++ b/sw/source/uibase/shells/olesh.cxx
@@ -30,7 +30,6 @@
#include <olesh.hxx>
#include <cmdid.h>
-#include <popup.hrc>
#include <shells.hrc>
#define SwOleShell
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index f53c55927ffc..5106448688b4 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -73,7 +73,6 @@
#include <app.hrc>
#include <dialog.hrc>
-#include <popup.hrc>
#include <shells.hrc>
#include <cmdid.h>
#include <globals.hrc>
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index b512f5ed0e39..4ea1a236a19a 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -88,7 +88,6 @@
#include <column.hxx>
#include <edtwin.hxx>
#include <shells.hrc>
-#include <popup.hrc>
#include <swerror.h>
#include <unochart.hxx>
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index a5bb54adecdf..0d31ebe0ef8e 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -67,7 +67,6 @@
#include <helpid.h>
#include <cmdid.h>
#include <globals.hrc>
-#include <popup.hrc>
#include <view.hrc>
#define SwPagePreview
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index 31967bd56ed2..30f19297d1d1 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -73,7 +73,6 @@
#include <helpid.h>
#include <globals.hrc>
#include <shells.hrc>
-#include <popup.hrc>
#include <web.hrc>
#include <view.hrc>
#include <com/sun/star/ui/dialogs/XFilePicker2.hpp>
diff --git a/sw/source/uibase/uiview/view.src b/sw/source/uibase/uiview/view.src
index bcbe2b718d2f..8792b0158d93 100644
--- a/sw/source/uibase/uiview/view.src
+++ b/sw/source/uibase/uiview/view.src
@@ -21,7 +21,6 @@
#include "view.hrc"
#include "shells.hrc"
#include "globals.hrc"
-#include "popup.hrc"
#include "helpid.h"
#include "cmdid.h"
diff --git a/sw/source/uibase/web/wformsh.cxx b/sw/source/uibase/web/wformsh.cxx
index 7b11b3afe027..ec5c590b5b77 100644
--- a/sw/source/uibase/web/wformsh.cxx
+++ b/sw/source/uibase/web/wformsh.cxx
@@ -30,7 +30,6 @@
#include "wformsh.hxx"
#include "globals.hrc"
#include "web.hrc"
-#include "popup.hrc"
#include "shells.hrc"
#include <sfx2/request.hxx>
diff --git a/sw/source/uibase/web/wfrmsh.cxx b/sw/source/uibase/web/wfrmsh.cxx
index f70967ef844e..b0df1dd0ca11 100644
--- a/sw/source/uibase/web/wfrmsh.cxx
+++ b/sw/source/uibase/web/wfrmsh.cxx
@@ -26,7 +26,6 @@
#include "view.hxx"
#include "wfrmsh.hxx"
#include "globals.hrc"
-#include "popup.hrc"
#include "shells.hrc"
#include "web.hrc"
diff --git a/sw/source/uibase/web/wgrfsh.cxx b/sw/source/uibase/web/wgrfsh.cxx
index 745a2cf12261..9bd77670d3bb 100644
--- a/sw/source/uibase/web/wgrfsh.cxx
+++ b/sw/source/uibase/web/wgrfsh.cxx
@@ -30,7 +30,6 @@
#include "uitool.hxx"
#include "docsh.hxx"
#include "shells.hrc"
-#include "popup.hrc"
#include "globals.hrc"
#include "web.hrc"
#include "wgrfsh.hxx"
diff --git a/sw/source/uibase/web/wolesh.cxx b/sw/source/uibase/web/wolesh.cxx
index 0cdb514f8fe1..ef452e46d8a2 100644
--- a/sw/source/uibase/web/wolesh.cxx
+++ b/sw/source/uibase/web/wolesh.cxx
@@ -27,7 +27,6 @@
#include "helpid.h"
#include "globals.hrc"
#include "web.hrc"
-#include "popup.hrc"
#include "shells.hrc"
#include "wolesh.hxx"
#include "cmdid.h"
diff --git a/sw/source/uibase/web/wtabsh.cxx b/sw/source/uibase/web/wtabsh.cxx
index a6294f6e67e5..c660b6491a16 100644
--- a/sw/source/uibase/web/wtabsh.cxx
+++ b/sw/source/uibase/web/wtabsh.cxx
@@ -27,7 +27,6 @@
#include "globals.hrc"
#include "uitool.hxx"
#include "helpid.h"
-#include "popup.hrc"
#include "shells.hrc"
#include "table.hrc"
#include "wrtsh.hxx"
diff --git a/sw/source/uibase/web/wtextsh.cxx b/sw/source/uibase/web/wtextsh.cxx
index 837b7aea0f06..abdf4866ad85 100644
--- a/sw/source/uibase/web/wtextsh.cxx
+++ b/sw/source/uibase/web/wtextsh.cxx
@@ -30,7 +30,6 @@
#include "wtextsh.hxx"
#include "basesh.hxx"
#include "globals.hrc"
-#include "popup.hrc"
#include "shells.hrc"
#include "web.hrc"