summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-21 14:22:13 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-21 16:18:07 +0000
commit7660d45dc3884e910d619d0e7551f5f58346ab04 (patch)
tree82a77637e0e352f45bc9b519d84d8b20930671f3
parentwe want selected radio entries to default unselect the others (diff)
downloadcore-7660d45dc3884e910d619d0e7551f5f58346ab04.tar.gz
core-7660d45dc3884e910d619d0e7551f5f58346ab04.zip
convert calc changes menu to .ui
Change-Id: I65c07995ab7a63bcefeb1612e86bf3fedc33f4a5
-rw-r--r--sc/inc/helpids.h8
-rw-r--r--sc/inc/scres.hrc2
-rw-r--r--sc/source/ui/inc/acredlin.hrc30
-rw-r--r--sc/source/ui/inc/acredlin.hxx2
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx52
-rw-r--r--sc/source/ui/miscdlgs/acredlin.src62
-rw-r--r--svx/uiconfig/ui/acceptrejectchangesdialog.ui68
7 files changed, 93 insertions, 131 deletions
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 6298137f28cf..aff92df68d95 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -64,13 +64,7 @@
#define HID_SC_REN_AFMT_DLG "SC_HID_SC_REN_AFMT_DLG"
-// Hilfe IDs fuer Submenus (max.50) ------------------------------------------
-#define HID_SC_SORT_ACTION "SC_HID_SC_SORT_ACTION"
-#define HID_SC_SORT_AUTHOR "SC_HID_SC_SORT_AUTHOR"
-#define HID_SC_SORT_DATE "SC_HID_SC_SORT_DATE"
-#define HID_SC_SORT_COMMENT "SC_HID_SC_SORT_COMMENT"
-#define HID_SORT_POSITION "SC_HID_SORT_POSITION"
-#define HID_SC_CHANGES_COMMENT "SC_HID_SC_CHANGES_COMMENT"
+// Help IDs for Submenus (max.50) --------------------------------------------
#define HID_PASSWD_TABLE "SC_HID_PASSWD_TABLE"
#define HID_PASSWD_DOC "SC_HID_PASSWD_DOC"
diff --git a/sc/inc/scres.hrc b/sc/inc/scres.hrc
index 51fd648c55c8..af981aef10be 100644
--- a/sc/inc/scres.hrc
+++ b/sc/inc/scres.hrc
@@ -530,8 +530,6 @@
#define RID_NAVIPI_SCENARIO_DELETE (SC_DIALOGS_START + 121)
#define RID_NAVIPI_SCENARIO_EDIT (SC_DIALOGS_START + 122)
-#define RID_POPUP_CHANGES (SC_DIALOGS_START + 127)
-
#define RID_CELLSTYLEFAMILY (SC_DIALOGS_START + 138)
#define RID_PAGESTYLEFAMILY (SC_DIALOGS_START + 139)
#define BMP_STYLES_FAMILY_CELL (SC_DIALOGS_START + 140)
diff --git a/sc/source/ui/inc/acredlin.hrc b/sc/source/ui/inc/acredlin.hrc
deleted file mode 100644
index 9813c19fabfb..000000000000
--- a/sc/source/ui/inc/acredlin.hrc
+++ /dev/null
@@ -1,30 +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 .
- */
-
-#include "scres.hrc"
-
-#define SC_CHANGES_COMMENT 49
-#define SC_SUB_SORT 50
-#define SC_SORT_ACTION 51
-#define SC_SORT_POSITION 52
-#define SC_SORT_AUTHOR 53
-#define SC_SORT_DATE 54
-#define SC_SORT_COMMENT 55
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/acredlin.hxx b/sc/source/ui/inc/acredlin.hxx
index 10f50fddccaf..f4bead09c04b 100644
--- a/sc/source/ui/inc/acredlin.hxx
+++ b/sc/source/ui/inc/acredlin.hxx
@@ -55,9 +55,9 @@ public:
class ScAcceptChgDlg : public SfxModelessDialog
{
private:
-
Idle aSelectionIdle;
Idle aReOpenIdle;
+ VclPtr<PopupMenu> m_xPopup;
VclPtr<SvxAcceptChgCtr> m_pAcceptChgCtr;
ScViewData* pViewData;
ScDocument* pDoc;
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index ae7875806f28..0dea04e32790 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -33,7 +33,7 @@
#include "docsh.hxx"
#include "scresid.hxx"
#include "globstr.hrc"
-#include "acredlin.hrc"
+#include "scres.hrc"
#include "simpref.hxx"
#include "scmod.hxx"
#include "popmenu.hxx"
@@ -79,6 +79,7 @@ ScAcceptChgDlg::ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window
"AcceptRejectChangesDialog", "svx/ui/acceptrejectchangesdialog.ui"),
aSelectionIdle("ScAcceptChgDlg SelectionIdle"),
aReOpenIdle("ScAcceptChgDlg ReOpenIdle"),
+ m_xPopup(get_menu("calcmenu")),
pViewData ( ptrViewData ),
pDoc ( ptrViewData->GetDocument() ),
aStrInsertCols (SC_RESSTR(STR_CHG_INSERT_COLS)),
@@ -162,6 +163,7 @@ void ScAcceptChgDlg::dispose()
pChanges->SetModifiedLink(aLink);
}
+ m_xPopup.clear();
m_pAcceptChgCtr.disposeAndClear();
pTPFilter.clear();
pTPView.clear();
@@ -1665,9 +1667,7 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, CommandHdl, SvSimpleTable*, void)
if(aCEvt.GetCommand()==CommandEventId::ContextMenu)
{
- ScopedVclPtrInstance<PopupMenu> aPopup(ScResId(RID_POPUP_CHANGES));
-
- aPopup->SetMenuFlags(MenuFlags::HideDisabledEntries);
+ m_xPopup->SetMenuFlags(MenuFlags::HideDisabledEntries);
SvTreeListEntry* pEntry=pTheView->GetCurEntry();
if(pEntry!=nullptr)
@@ -1676,24 +1676,20 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, CommandHdl, SvSimpleTable*, void)
}
else
{
- aPopup->Deactivate();
+ m_xPopup->Deactivate();
}
- sal_uInt16 nSortedCol= pTheView->GetSortedCol();
-
- if(nSortedCol!=0xFFFF)
- {
- sal_uInt16 nItemId=nSortedCol+SC_SUB_SORT+1;
+ const sal_uInt16 nSubSortId = m_xPopup->GetItemId("sort");
+ PopupMenu *pSubMenu = m_xPopup->GetPopupMenu(nSubSortId);
+ const sal_uInt16 nActionId = pSubMenu->GetItemId("action");
- aPopup->CheckItem(nItemId);
+ sal_uInt16 nSortedCol = pTheView->GetSortedCol();
+ if (nSortedCol != 0xFFFF)
+ pSubMenu->CheckItem(nActionId + nSortedCol);
- PopupMenu *pSubMenu = aPopup->GetPopupMenu(SC_SUB_SORT);
-
- if (pSubMenu)
- pSubMenu->CheckItem(nItemId);
- }
+ const sal_uInt16 nEditId = m_xPopup->GetItemId("edit");
- aPopup->EnableItem(SC_CHANGES_COMMENT,false);
+ m_xPopup->EnableItem(nEditId, false);
if(pDoc->IsDocEditable() && pEntry!=nullptr)
{
@@ -1702,16 +1698,16 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, CommandHdl, SvSimpleTable*, void)
{
ScChangeAction* pScChangeAction=
static_cast<ScChangeAction*>(pEntryData->pData);
- if(pScChangeAction!=nullptr && !pTheView->GetParent(pEntry))
- aPopup->EnableItem(SC_CHANGES_COMMENT);
+ if (pScChangeAction!=nullptr && !pTheView->GetParent(pEntry))
+ m_xPopup->EnableItem(nEditId);
}
}
- sal_uInt16 nCommand = aPopup->Execute( this, GetPointerPosPixel() );
+ sal_uInt16 nCommand = m_xPopup->Execute(this, GetPointerPosPixel());
if(nCommand)
{
- if(nCommand==SC_CHANGES_COMMENT)
+ if (nCommand == nEditId)
{
if(pEntry!=nullptr)
{
@@ -1728,16 +1724,16 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, CommandHdl, SvSimpleTable*, void)
else
{
bool bSortDir = pTheView->GetSortDirection();
- sal_uInt16 nDialogCol=nCommand-SC_SUB_SORT-1;
+ sal_uInt16 nDialogCol = nCommand - nActionId;
+ fprintf(stderr, "sort by %d\n", nDialogCol);
if(nSortedCol==nDialogCol) bSortDir=!bSortDir;
pTheView->SortByCol(nDialogCol,bSortDir);
/*
- SC_SUB_SORT
- SC_SORT_ACTION
- SC_SORT_POSITION
- SC_SORT_AUTHOR
- SC_SORT_DATE
- SC_SORT_COMMENT
+ 0, sort by action
+ 1, sort by position
+ 2, sort by author
+ 3, sort by date
+ 4, sort by comment
*/
}
}
diff --git a/sc/source/ui/miscdlgs/acredlin.src b/sc/source/ui/miscdlgs/acredlin.src
index 42967bea88f6..3c0dbcae18f2 100644
--- a/sc/source/ui/miscdlgs/acredlin.src
+++ b/sc/source/ui/miscdlgs/acredlin.src
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "acredlin.hrc"
#include "globstr.hrc"
String STR_CHG_INSERT_COLS
@@ -84,65 +83,4 @@ String STR_CHG_EMPTY
{
Text [ en-US ] = "<empty>" ;
};
-
-Menu RID_POPUP_CHANGES
-{
- ItemList =
- {
- MenuItem
- {
- Identifier = SC_CHANGES_COMMENT ;
- HelpId = HID_SC_CHANGES_COMMENT ;
- Text [ en-US ] = "Edit Comment..." ;
-
- };
- MenuItem
- {
- Identifier = SC_SUB_SORT ;
- SubMenu = Menu
- {
- ItemList =
- {
- MenuItem
- {
- Identifier = SC_SORT_ACTION ;
- HelpID = HID_SC_SORT_ACTION ;
- RadioCheck = TRUE ;
- Text [ en-US ] = "Action" ;
- };
- MenuItem
- {
- Identifier = SC_SORT_POSITION ;
- HelpID = HID_SORT_POSITION ;
- RadioCheck = TRUE ;
- Text [ en-US ] = "Position" ;
- };
- MenuItem
- {
- Identifier = SC_SORT_AUTHOR ;
- HelpID = HID_SC_SORT_AUTHOR ;
- RadioCheck = TRUE ;
- Text [ en-US ] = "Author" ;
- };
- MenuItem
- {
- Identifier = SC_SORT_DATE ;
- HelpID = HID_SC_SORT_DATE ;
- RadioCheck = TRUE ;
- Text [ en-US ] = "Date" ;
- };
- MenuItem
- {
- Identifier = SC_SORT_COMMENT ;
- HelpID = HID_SC_SORT_COMMENT ;
- RadioCheck = TRUE ;
- Text [ en-US ] = "Description" ;
- };
- };
- };
- Text [ en-US ] = "Sorting" ;
- };
- };
-};
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/uiconfig/ui/acceptrejectchangesdialog.ui b/svx/uiconfig/ui/acceptrejectchangesdialog.ui
index d1ccf116a483..af4ddf28a16f 100644
--- a/svx/uiconfig/ui/acceptrejectchangesdialog.ui
+++ b/svx/uiconfig/ui/acceptrejectchangesdialog.ui
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
<interface>
- <!-- interface-requires gtk+ 3.0 -->
+ <requires lib="gtk+" version="3.0"/>
<object class="GtkDialog" id="AcceptRejectChangesDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
@@ -123,4 +124,69 @@
<action-widget response="0">close</action-widget>
</action-widgets>
</object>
+ <object class="GtkMenu" id="calcmenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="edit">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Edit Comment...</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="sort">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Sorting</property>
+ <property name="use_underline">True</property>
+ <child type="submenu">
+ <object class="GtkMenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkRadioMenuItem" id="action">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Action</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkRadioMenuItem" id="position">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Position</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkRadioMenuItem" id="author">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Author</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkRadioMenuItem" id="date">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Date</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkRadioMenuItem" id="desc">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Description</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
</interface>