From a65211ad92d62caad426a17dcbe81bec9da5bc4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 10 Feb 2017 14:03:08 +0000 Subject: [PATCH] unwind RID_POPUP_FILTER local resource Change-Id: I7369b3eb0e0d937c135fe591beafe9ec96ea9c17 --- sc/inc/sc.hrc | 12 ++++-- sc/source/ui/cctrl/checklistmenu.cxx | 10 ++--- sc/source/ui/cctrl/checklistmenu.src | 57 +++++++++++++--------------- sc/source/ui/inc/checklistmenu.hrc | 35 ----------------- sc/source/ui/view/gridwin.cxx | 5 +-- sc/source/ui/view/gridwin2.cxx | 7 ++-- 6 files changed, 46 insertions(+), 80 deletions(-) delete mode 100644 sc/source/ui/inc/checklistmenu.hrc diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 3521e20f113d..4d1e380c6acf 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1105,7 +1105,15 @@ #define STR_ZTEST_P_TWO_TAIL (STR_START + 546) #define STR_ZTEST_Z_CRITICAL_TWO_TAIL (STR_START + 547) -#define STR_END (STR_ZTEST_Z_CRITICAL_TWO_TAIL) +#define STR_MENU_SORT_ASC (STR_START + 548) +#define STR_MENU_SORT_DESC (STR_START + 549) +#define STR_MENU_SORT_CUSTOM (STR_START + 550) +#define STR_BTN_TOGGLE_ALL (STR_START + 551) +#define STR_BTN_SELECT_CURRENT (STR_START + 552) +#define STR_BTN_UNSELECT_CURRENT (STR_START + 553) +#define STR_EDIT_SEARCH_ITEMS (STR_START + 554) + +#define STR_END (STR_EDIT_SEARCH_ITEMS) #define BMP_START (STR_END) @@ -1222,8 +1230,6 @@ #define BMP_STYLES_FAMILY_CELL (SC_DIALOGS_START + 140) #define BMP_STYLES_FAMILY_PAGE (SC_DIALOGS_START + 141) -#define RID_POPUP_FILTER (SC_DIALOGS_START + 153) - #define RID_SCDLG_COND_FORMAT_MANAGER (SC_DIALOGS_START + 159) #define WID_CONDFRMT_REF (SC_DIALOGS_START + 163) diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 68afaffb9451..5cca65beefcf 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -18,9 +18,9 @@ */ #include "checklistmenu.hxx" -#include "checklistmenu.hrc" #include "strload.hxx" #include "globstr.hrc" +#include "sc.hrc" #include #include @@ -1075,7 +1075,7 @@ void ScCheckListMenuWindow::packWindow() maEdSearch->SetPosSizePixel(aPos, aSize); maEdSearch->SetFont(getLabelFont()); maEdSearch->SetControlBackground(rStyle.GetFieldColor()); - maEdSearch->SetPlaceholderText(SC_STRLOAD(RID_POPUP_FILTER, STR_EDIT_SEARCH_ITEMS)); + maEdSearch->SetPlaceholderText(SC_RESSTR(STR_EDIT_SEARCH_ITEMS)); maEdSearch->SetModifyHdl( LINK(this, ScCheckListMenuWindow, EdModifyHdl) ); maEdSearch->Show(); @@ -1088,7 +1088,7 @@ void ScCheckListMenuWindow::packWindow() getSectionPosSize(aPos, aSize, CHECK_TOGGLE_ALL); maChkToggleAll->SetPosSizePixel(aPos, aSize); maChkToggleAll->SetFont(getLabelFont()); - maChkToggleAll->SetText(SC_STRLOAD(RID_POPUP_FILTER, STR_BTN_TOGGLE_ALL)); + maChkToggleAll->SetText(SC_RESSTR(STR_BTN_TOGGLE_ALL)); maChkToggleAll->SetTextColor(rStyle.GetMenuTextColor()); maChkToggleAll->SetControlBackground(rStyle.GetMenuColor()); maChkToggleAll->SetClickHdl( LINK(this, ScCheckListMenuWindow, TriStateHdl) ); @@ -1103,7 +1103,7 @@ void ScCheckListMenuWindow::packWindow() getSectionPosSize(aPos, aSize, BTN_SINGLE_SELECT); maBtnSelectSingle->SetPosSizePixel(aPos, aSize); - maBtnSelectSingle->SetQuickHelpText(SC_STRLOAD(RID_POPUP_FILTER, STR_BTN_SELECT_CURRENT)); + maBtnSelectSingle->SetQuickHelpText(SC_RESSTR(STR_BTN_SELECT_CURRENT)); maBtnSelectSingle->SetModeImage(aSingleSelect); maBtnSelectSingle->SetClickHdl( LINK(this, ScCheckListMenuWindow, ButtonHdl) ); maBtnSelectSingle->Show(); @@ -1115,7 +1115,7 @@ void ScCheckListMenuWindow::packWindow() getSectionPosSize(aPos, aSize, BTN_SINGLE_UNSELECT); maBtnUnselectSingle->SetPosSizePixel(aPos, aSize); - maBtnUnselectSingle->SetQuickHelpText(SC_STRLOAD(RID_POPUP_FILTER, STR_BTN_UNSELECT_CURRENT)); + maBtnUnselectSingle->SetQuickHelpText(SC_RESSTR(STR_BTN_UNSELECT_CURRENT)); maBtnUnselectSingle->SetModeImage(aSingleUnselect); maBtnUnselectSingle->SetClickHdl( LINK(this, ScCheckListMenuWindow, ButtonHdl) ); maBtnUnselectSingle->Show(); diff --git a/sc/source/ui/cctrl/checklistmenu.src b/sc/source/ui/cctrl/checklistmenu.src index 55323c06ddac..387431f89702 100644 --- a/sc/source/ui/cctrl/checklistmenu.src +++ b/sc/source/ui/cctrl/checklistmenu.src @@ -17,44 +17,41 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "checklistmenu.hrc" +#include "sc.hrc" -Resource RID_POPUP_FILTER +String STR_MENU_SORT_ASC { - String STR_MENU_SORT_ASC - { - Text [ en-US ] = "Sort Ascending" ; - }; + Text [ en-US ] = "Sort Ascending" ; +}; - String STR_MENU_SORT_DESC - { - Text [ en-US ] = "Sort Descending" ; - }; +String STR_MENU_SORT_DESC +{ + Text [ en-US ] = "Sort Descending" ; +}; - String STR_MENU_SORT_CUSTOM - { - Text [ en-US ] = "Custom Sort" ; - }; +String STR_MENU_SORT_CUSTOM +{ + Text [ en-US ] = "Custom Sort" ; +}; - String STR_BTN_TOGGLE_ALL - { - Text [ en-US ] = "All" ; - }; +String STR_BTN_TOGGLE_ALL +{ + Text [ en-US ] = "All" ; +}; - String STR_BTN_SELECT_CURRENT - { - Text [ en-US ] = "Show only the current item." ; - }; +String STR_BTN_SELECT_CURRENT +{ + Text [ en-US ] = "Show only the current item." ; +}; - String STR_BTN_UNSELECT_CURRENT - { - Text [ en-US ] = "Hide only the current item." ; - }; +String STR_BTN_UNSELECT_CURRENT +{ + Text [ en-US ] = "Hide only the current item." ; +}; - String STR_EDIT_SEARCH_ITEMS - { - Text [ en-US ] = "Search items..." ; - }; +String STR_EDIT_SEARCH_ITEMS +{ + Text [ en-US ] = "Search items..." ; }; Bitmap RID_BMP_SELECT_CURRENT diff --git a/sc/source/ui/inc/checklistmenu.hrc b/sc/source/ui/inc/checklistmenu.hrc deleted file mode 100644 index 7d009576f1dd..000000000000 --- a/sc/source/ui/inc/checklistmenu.hrc +++ /dev/null @@ -1,35 +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_SC_SOURCE_UI_INC_CHECKLISTMENU_HRC -#define INCLUDED_SC_SOURCE_UI_INC_CHECKLISTMENU_HRC - -#include - -#define STR_MENU_SORT_ASC 1 -#define STR_MENU_SORT_DESC 2 -#define STR_MENU_SORT_CUSTOM 3 -#define STR_BTN_TOGGLE_ALL 4 -#define STR_BTN_SELECT_CURRENT 5 -#define STR_BTN_UNSELECT_CURRENT 6 -#define STR_EDIT_SEARCH_ITEMS 7 - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 8f1697c9fee8..227847653509 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -123,7 +123,6 @@ #include "cliputil.hxx" #include "queryentry.hxx" #include "markdata.hxx" -#include "checklistmenu.hrc" #include "strload.hxx" #include "externalrefmgr.hxx" #include "dociter.hxx" @@ -726,10 +725,10 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) // Populate the menu. mpAutoFilterPopup->addMenuItem( - SC_STRLOAD(RID_POPUP_FILTER, STR_MENU_SORT_ASC), + SC_RESSTR(STR_MENU_SORT_ASC), new AutoFilterAction(this, SortAscending)); mpAutoFilterPopup->addMenuItem( - SC_STRLOAD(RID_POPUP_FILTER, STR_MENU_SORT_DESC), + SC_RESSTR(STR_MENU_SORT_DESC), new AutoFilterAction(this, SortDescending)); mpAutoFilterPopup->addSeparator(); mpAutoFilterPopup->addMenuItem( diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index c2e34db084ea..270a568e9f90 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -39,7 +39,6 @@ #include "dbdocfun.hxx" #include "checklistmenu.hxx" #include "dpcontrol.hxx" -#include "checklistmenu.hrc" #include "strload.hxx" #include "userlist.hxx" #include "scabstdlg.hxx" @@ -493,13 +492,13 @@ void ScGridWindow::DPLaunchFieldPopupMenu( // Populate the menus. ScTabViewShell* pViewShell = pViewData->GetViewShell(); mpDPFieldPopup->addMenuItem( - SC_STRLOAD(RID_POPUP_FILTER, STR_MENU_SORT_ASC), + SC_RESSTR(STR_MENU_SORT_ASC), new PopupSortAction(rPos, PopupSortAction::ASCENDING, 0, pViewShell)); mpDPFieldPopup->addMenuItem( - SC_STRLOAD(RID_POPUP_FILTER, STR_MENU_SORT_DESC), + SC_RESSTR(STR_MENU_SORT_DESC), new PopupSortAction(rPos, PopupSortAction::DESCENDING, 0, pViewShell)); ScMenuFloatingWindow* pSubMenu = mpDPFieldPopup->addSubMenuItem( - SC_STRLOAD(RID_POPUP_FILTER, STR_MENU_SORT_CUSTOM), !aUserSortNames.empty()); + SC_RESSTR(STR_MENU_SORT_CUSTOM), !aUserSortNames.empty()); if (pSubMenu && !aUserSortNames.empty()) {