The 60 default ECMA-376 table styles had only machine IDs like "TableStyleLight1" as their names. For Online, generateJSON() sends GetUIName() which fell back to the raw ID. Desktop was unaffected because the sidebar/notebookbar .ui files have hardcoded display names. Add TableStyleCategory enum and number to the TableStyle data struct so assembleTableStyles() can compose translatable UI names like "Table Style Light 1" using 3 new string resources. The UI name is computed once at style generation time and stored in maUIName. Also fix the Python generator to handle the "TableStyleLight14 " trailing space bug from the OOXML spec XML, and force Unix line endings on output. Change-Id: Ia079a1f5f6e453cb729b5c26df4fe48c88642341 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203045 Reviewed-by: Banobe Pascal <banobe.pascal@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/176 Reviewed-by: Balázs Varga <balazs.varga@collabora.com> Tested-by: Jenkins CPCI <releng@collaboraoffice.com> (cherry picked from commit eaa07b76ba56b39b0346c0f7b7c28b86edcb7a9e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204567 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
88 lines
1.5 KiB
C++
88 lines
1.5 KiB
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
|
/*
|
|
* 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/.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "tablestyle.hxx"
|
|
|
|
// POD structs used by the script-generated constexpr data in defaulttablestyles.inc
|
|
// (generated from the ECMA-376 presetTableStyles.xml by generate_ooxml_tablestyle_info.py)
|
|
|
|
struct ThemeColor
|
|
{
|
|
int nThemeId;
|
|
float fTint;
|
|
};
|
|
|
|
struct Font
|
|
{
|
|
bool bBold;
|
|
int nThemeColorId;
|
|
};
|
|
|
|
struct Fill
|
|
{
|
|
int nFgColorId;
|
|
};
|
|
|
|
enum class BorderElementStyle
|
|
{
|
|
THIN,
|
|
MEDIUM,
|
|
THICK,
|
|
DOUBLE
|
|
};
|
|
|
|
struct BorderElement
|
|
{
|
|
BorderElementStyle eBorderStyle;
|
|
int nColorId;
|
|
};
|
|
|
|
struct Border
|
|
{
|
|
int nTopId;
|
|
int nBottomId;
|
|
int nLeftId;
|
|
int nRightId;
|
|
int nHorizontalId;
|
|
int nVerticalId;
|
|
};
|
|
|
|
struct Dxf
|
|
{
|
|
int nFillId;
|
|
int nBorderId;
|
|
int nFontId;
|
|
};
|
|
|
|
struct TableStyleElement
|
|
{
|
|
ScTableStyleElement eElement;
|
|
int nDxfId;
|
|
};
|
|
|
|
enum class TableStyleCategory
|
|
{
|
|
Light,
|
|
Medium,
|
|
Dark
|
|
};
|
|
|
|
struct TableStyle
|
|
{
|
|
const char* pName;
|
|
TableStyleCategory eCategory;
|
|
int nNumber;
|
|
size_t nElements;
|
|
int pTableStyleElementIds[9];
|
|
};
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|