i18nutil/source/utility/paper.cxx | 3 include/i18nutil/paper.hxx | 5 - svx/source/dialog/page.h | 69 --------------------- svx/source/dialog/page.hrc | 124 +++++++++++++++++++------------------- 4 files changed, 67 insertions(+), 134 deletions(-)
New commits: commit 4b63977c98245efcedd905f37a85f988c3bb44e2 Author: Tor Lillqvist <t...@collabora.com> Date: Fri Nov 10 14:56:22 2017 +0200 Remove duplication of Paper enum as #defines Not needed any more. We still have the fragile requirement that the order of entries in the aDinTab array in i18nutil/source/utility/paper.cxx has to match the enum order. Change-Id: I858fd56ad6bb1a3f3c2c39f7830b4dc6aea7cc1f Reviewed-on: https://gerrit.libreoffice.org/44600 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Tor Lillqvist <t...@collabora.com> diff --git a/i18nutil/source/utility/paper.cxx b/i18nutil/source/utility/paper.cxx index 1d252c43d3a7..c12ac29704ef 100644 --- a/i18nutil/source/utility/paper.cxx +++ b/i18nutil/source/utility/paper.cxx @@ -61,6 +61,9 @@ struct PageDesc //http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf //https://web.archive.org/web/20040912070512/http://www.y-adagio.com/public/committees/docsii/doc_00-49/symp_ulaan/china_ppr.pdf (Kai) //http://www.sls.psi.ch/controls/help/howto/Howto_Print_a_A0_Poster_at_WSLA_012_2.pdf (Dia) + +//!! The order of these entries must correspond to enum Paper in <i18nutil/paper.hxx> + static const PageDesc aDinTab[] = { { MM2MM100( 841 ), MM2MM100( 1189 ), "A0", nullptr }, diff --git a/include/i18nutil/paper.hxx b/include/i18nutil/paper.hxx index adb539fce6e3..cbd13a56c818 100644 --- a/include/i18nutil/paper.hxx +++ b/include/i18nutil/paper.hxx @@ -24,9 +24,8 @@ #include <rtl/string.hxx> #include <com/sun/star/lang/Locale.hpp> -//!! WARNING: be aware of svx/source/dialog/page.h where someone had the broken idea -//!! of duplicating the values of this enum in order to use those defines within -//!! src files. +//!! The values of the following enumerators must correspond to the array position +//!! of the respective paper size in the file i18nutil/source/utility/paper.cxx //!! Thus don't reorder the enum values here without changing the code there as well. enum Paper { diff --git a/svx/source/dialog/page.h b/svx/source/dialog/page.h deleted file mode 100644 index 266f82ef81fb..000000000000 --- a/svx/source/dialog/page.h +++ /dev/null @@ -1,69 +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_SVX_SOURCE_DIALOGS_PAGE_H -#define INCLUDED_SVX_SOURCE_DIALOGS_PAGE_H - -// define ---------------------------------------------------------------- - -//!! the values of the following defines must correspond to the array position -//!! of the respective paper size in the file i18nutil/source/utility/paper.cxx -//!! There are enums for them in include/i18nutil/paper.hxx but unfortunately -//!! the resource compiler does not understand enums, thus the enum values need -//!! to be duplicated here for use in the src file. -#define PAPERSIZE_A0 0 -#define PAPERSIZE_A1 1 -#define PAPERSIZE_A2 2 -#define PAPERSIZE_A3 3 -#define PAPERSIZE_A4 4 -#define PAPERSIZE_A5 5 -#define PAPERSIZE_B4_ISO 6 -#define PAPERSIZE_B5_ISO 7 -#define PAPERSIZE_LETTER 8 -#define PAPERSIZE_LEGAL 9 -#define PAPERSIZE_TABLOID 10 -#define PAPERSIZE_USER 11 -#define PAPERSIZE_B6_ISO 12 -#define PAPERSIZE_C4 13 -#define PAPERSIZE_C5 14 -#define PAPERSIZE_C6 15 -#define PAPERSIZE_C65 16 -#define PAPERSIZE_DL 17 -#define PAPERSIZE_DIA 18 -#define PAPERSIZE_SCREEN_4_3 19 -#define PAPERSIZE_LEGAL2 24 -#define PAPERSIZE_MONARCH 25 -#define PAPERSIZE_COM675 26 -#define PAPERSIZE_COM9 27 -#define PAPERSIZE_COM10 28 -#define PAPERSIZE_COM11 29 -#define PAPERSIZE_COM12 30 -#define PAPERSIZE_KAI16 31 -#define PAPERSIZE_KAI32 32 -#define PAPERSIZE_KAI32BIG 33 -#define PAPERSIZE_B4_JIS 34 -#define PAPERSIZE_B5_JIS 35 -#define PAPERSIZE_B6_JIS 36 -#define PAPERSIZE_POSTCARD_JP 46 -#define PAPERSIZE_A6 56 -#define PAPERSIZE_SCREEN_16_9 78 -#define PAPERSIZE_SCREEN_16_10 79 - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/page.hrc b/svx/source/dialog/page.hrc index fc42b08e21f3..f4d3e9518f1e 100644 --- a/svx/source/dialog/page.hrc +++ b/svx/source/dialog/page.hrc @@ -20,78 +20,78 @@ #ifndef INCLUDED_SVX_SOURCE_DIALOG_PAGE_HRC #define INCLUDED_SVX_SOURCE_DIALOG_PAGE_HRC -#include "page.h" +#include <i18nutil/paper.hxx> #include <utility> #define NC_(Context, String) (Context "\004" u8##String) const std::pair<const char*, int> RID_SVXSTRARY_PAPERSIZE_STD[] = { - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "A6") , PAPERSIZE_A6 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "A5") , PAPERSIZE_A5 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "A4") , PAPERSIZE_A4 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "A3") , PAPERSIZE_A3 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "B6 (ISO)") , PAPERSIZE_B6_ISO }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "B5 (ISO)") , PAPERSIZE_B5_ISO }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "B4 (ISO)") , PAPERSIZE_B4_ISO }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "Letter") , PAPERSIZE_LETTER }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "Legal") , PAPERSIZE_LEGAL }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "Long Bond") , PAPERSIZE_LEGAL2 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "Tabloid") , PAPERSIZE_TABLOID }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "B6 (JIS)") , PAPERSIZE_B6_JIS }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "B5 (JIS)") , PAPERSIZE_B5_JIS }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "B4 (JIS)") , PAPERSIZE_B4_JIS }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "16 Kai") , PAPERSIZE_KAI16}, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "32 Kai") , PAPERSIZE_KAI32}, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "Big 32 Kai") , PAPERSIZE_KAI32BIG}, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "User") , PAPERSIZE_USER }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "DL Envelope") , PAPERSIZE_DL }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "C6 Envelope") , PAPERSIZE_C6 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "C6/5 Envelope") , PAPERSIZE_C65 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "C5 Envelope") , PAPERSIZE_C5 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "C4 Envelope") , PAPERSIZE_C4 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "#6¾ Envelope") , PAPERSIZE_COM675}, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "#7¾ (Monarch) Envelope") , PAPERSIZE_MONARCH}, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "#9 Envelope") , PAPERSIZE_COM9}, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "#10 Envelope") , PAPERSIZE_COM10}, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "#11 Envelope") , PAPERSIZE_COM11}, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "#12 Envelope") , PAPERSIZE_COM12}, - { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "Japanese Postcard") , PAPERSIZE_POSTCARD_JP} + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "A6") , PAPER_A6 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "A5") , PAPER_A5 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "A4") , PAPER_A4 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "A3") , PAPER_A3 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "B6 (ISO)") , PAPER_B6_ISO }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "B5 (ISO)") , PAPER_B5_ISO }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "B4 (ISO)") , PAPER_B4_ISO }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "Letter") , PAPER_LETTER }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "Legal") , PAPER_LEGAL }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "Long Bond") , PAPER_FANFOLD_LEGAL_DE }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "Tabloid") , PAPER_TABLOID }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "B6 (JIS)") , PAPER_B6_JIS }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "B5 (JIS)") , PAPER_B5_JIS }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "B4 (JIS)") , PAPER_B4_JIS }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "16 Kai") , PAPER_KAI16}, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "32 Kai") , PAPER_KAI32}, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "Big 32 Kai") , PAPER_KAI32BIG}, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "User") , PAPER_USER }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "DL Envelope") , PAPER_ENV_DL }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "C6 Envelope") , PAPER_ENV_C6 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "C6/5 Envelope") , PAPER_ENV_C65 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "C5 Envelope") , PAPER_ENV_C5 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "C4 Envelope") , PAPER_ENV_C4 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "#6¾ Envelope") , PAPER_ENV_PERSONAL}, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "#7¾ (Monarch) Envelope") , PAPER_ENV_MONARCH}, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "#9 Envelope") , PAPER_ENV_9}, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "#10 Envelope") , PAPER_ENV_10}, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "#11 Envelope") , PAPER_ENV_11}, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "#12 Envelope") , PAPER_ENV_12}, + { NC_("RID_SVXSTRARY_PAPERSIZE_STD", "Japanese Postcard") , PAPER_POSTCARD_JP} }; const std::pair<const char*, int> RID_SVXSTRARY_PAPERSIZE_DRAW[] = { - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "A6") , PAPERSIZE_A6 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "A5") , PAPERSIZE_A5 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "A4") , PAPERSIZE_A4 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "A3") , PAPERSIZE_A3 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "A2") , PAPERSIZE_A2 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "A1") , PAPERSIZE_A1 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "A0") , PAPERSIZE_A0 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "B6 (ISO)") , PAPERSIZE_B6_ISO }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "B5 (ISO)") , PAPERSIZE_B5_ISO }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "B4 (ISO)") , PAPERSIZE_B4_ISO }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Letter") , PAPERSIZE_LETTER }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Legal") , PAPERSIZE_LEGAL }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Long Bond") , PAPERSIZE_LEGAL2 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Tabloid") , PAPERSIZE_TABLOID }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "B6 (JIS)") , PAPERSIZE_B6_JIS }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "B5 (JIS)") , PAPERSIZE_B5_JIS }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "B4 (JIS)") , PAPERSIZE_B4_JIS }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "16 Kai") , PAPERSIZE_KAI16}, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "32 Kai") , PAPERSIZE_KAI32}, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Big 32 Kai") , PAPERSIZE_KAI32BIG}, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "User") , PAPERSIZE_USER }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "DL Envelope") , PAPERSIZE_DL }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "C6 Envelope") , PAPERSIZE_C6 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "C6/5 Envelope") , PAPERSIZE_C65 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "C5 Envelope") , PAPERSIZE_C5 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "C4 Envelope") , PAPERSIZE_C4 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Dia Slide") , PAPERSIZE_DIA }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Screen 4:3") , PAPERSIZE_SCREEN_4_3 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Screen 16:9") , PAPERSIZE_SCREEN_16_9 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Screen 16:10") , PAPERSIZE_SCREEN_16_10 }, - { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Japanese Postcard") , PAPERSIZE_POSTCARD_JP} + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "A6") , PAPER_A6 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "A5") , PAPER_A5 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "A4") , PAPER_A4 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "A3") , PAPER_A3 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "A2") , PAPER_A2 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "A1") , PAPER_A1 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "A0") , PAPER_A0 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "B6 (ISO)") , PAPER_B6_ISO }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "B5 (ISO)") , PAPER_B5_ISO }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "B4 (ISO)") , PAPER_B4_ISO }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Letter") , PAPER_LETTER }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Legal") , PAPER_LEGAL }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Long Bond") , PAPER_FANFOLD_LEGAL_DE }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Tabloid") , PAPER_TABLOID }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "B6 (JIS)") , PAPER_B6_JIS }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "B5 (JIS)") , PAPER_B5_JIS }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "B4 (JIS)") , PAPER_B4_JIS }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "16 Kai") , PAPER_KAI16}, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "32 Kai") , PAPER_KAI32}, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Big 32 Kai") , PAPER_KAI32BIG}, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "User") , PAPER_USER }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "DL Envelope") , PAPER_ENV_DL }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "C6 Envelope") , PAPER_ENV_C6 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "C6/5 Envelope") , PAPER_ENV_C65 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "C5 Envelope") , PAPER_ENV_C5 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "C4 Envelope") , PAPER_ENV_C4 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Dia Slide") , PAPER_SLIDE_DIA }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Screen 4:3") , PAPER_SCREEN_4_3 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Screen 16:9") , PAPER_SCREEN_16_9 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Screen 16:10") , PAPER_SCREEN_16_10 }, + { NC_("RID_SVXSTRARY_PAPERSIZE_DRAW", "Japanese Postcard") , PAPER_POSTCARD_JP} }; #endif
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits