[Libreoffice-commits] core.git: 2 commits - extras/source include/svx sc/source sw/inc sw/source
Eike Rathke
erack at redhat.com
Fri Dec 1 10:22:05 UTC 2017
extras/source/misc_config/autotbl.fmt |binary
include/svx/strings.hrc | 12 ++++
sc/source/core/tool/autoform.cxx | 12 ++++
sw/inc/poolfmt.hxx | 12 ++++
sw/inc/strings.hrc | 18 ------
sw/source/core/doc/DocumentStylePoolManager.cxx | 63 ++++++++++++++++--------
sw/source/core/doc/SwStyleNameMapper.cxx | 13 ++++
7 files changed, 93 insertions(+), 37 deletions(-)
New commits:
commit b56cd8050137ed4555a5aca50d4949d941e1f132
Author: Eike Rathke <erack at redhat.com>
Date: Wed Nov 29 23:54:26 2017 +0100
Prepare for translated new AutoFormat Table Styles, tdf#101349
Stored in file are resource IDs for predefined style names, user
defined styles are stored with ID 0xffff and display the given
name. The 16 old styles have IDs 0..15, so add strings for the 10
new styles and append those to the already existing IDs assigning
them the range 16..25
Once the final autotbl.fmt file with only new styles will be
available, patch that to change the 0xffff user defined to those
16..25 (0x10 to 0x19) IDs, it is the uint16 immediately following
the style name (Little Endian). Order of styles should match the
one in this change, if not, change the change..
Also, this eliminates the duplicated translation entries in
sw/inc/strings.hrc and instead in
sw/source/core/doc/DocumentStylePoolManager.cxx pulls the
translations from include/svx/strings.hrc
Change-Id: I7827ae22ab05901e6580ff1b9cd812db55f94f7f
Reviewed-on: https://gerrit.libreoffice.org/45544
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Eike Rathke <erack at redhat.com>
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index 048cdc6c681e..2aad6c092bdc 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -640,6 +640,7 @@
#define RID_SVXSTR_COLOR_YELLOWGREEN NC_("RID_SVXSTR_COLOR_YELLOWGREEN", "Yellow green")
#define RID_SVXSTR_COLOR_PINK NC_("RID_SVXSTR_COLOR_PINK", "Pink")
#define RID_SVXSTR_COLOR_TURQUOISE NC_("RID_SVXSTR_COLOR_TURQUOISE", "Turquoise")
+/* 16 old AutoFormat Table Styles */
#define RID_SVXSTR_TBLAFMT_3D NC_("RID_SVXSTR_TBLAFMT_3D", "3D")
#define RID_SVXSTR_TBLAFMT_BLACK1 NC_("RID_SVXSTR_TBLAFMT_BLACK1", "Black 1")
#define RID_SVXSTR_TBLAFMT_BLACK2 NC_("RID_SVXSTR_TBLAFMT_BLACK2", "Black 2")
@@ -656,6 +657,17 @@
#define RID_SVXSTR_TBLAFMT_RED NC_("RID_SVXSTR_TBLAFMT_RED", "Red")
#define RID_SVXSTR_TBLAFMT_TURQUOISE NC_("RID_SVXSTR_TBLAFMT_TURQUOISE", "Turquoise")
#define RID_SVXSTR_TBLAFMT_YELLOW NC_("RID_SVXSTR_TBLAFMT_YELLOW", "Yellow")
+/* 10 new AutoFormat Table Styles since LibreOffice 6.0 */
+#define RID_SVXSTR_TBLAFMT_LO6_ACADEMIC NC_("RID_SVXSTR_TBLAFMT_LO6_ACADEMIC", "Academic")
+#define RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_BLUE NC_("RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_BLUE", "Box List Blue")
+#define RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_GREEN NC_("RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_GREEN", "Box List Green")
+#define RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_RED NC_("RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_RED", "Box List Red")
+#define RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_YELLOW NC_("RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_YELLOW", "Box List Yellow")
+#define RID_SVXSTR_TBLAFMT_LO6_ELEGANT NC_("RID_SVXSTR_TBLAFMT_LO6_ELEGANT", "Elegant")
+#define RID_SVXSTR_TBLAFMT_LO6_FINANCIAL NC_("RID_SVXSTR_TBLAFMT_LO6_FINANCIAL", "Financial")
+#define RID_SVXSTR_TBLAFMT_LO6_SIMPLE_GRID_COLUMNS NC_("RID_SVXSTR_TBLAFMT_LO6_SIMPLE_GRID_COLUMNS", "Simple Grid Columns")
+#define RID_SVXSTR_TBLAFMT_LO6_SIMPLE_GRID_ROWS NC_("RID_SVXSTR_TBLAFMT_LO6_SIMPLE_GRID_ROWS", "Simple Grid Rows")
+#define RID_SVXSTR_TBLAFMT_LO6_SIMPLE_LIST_SHADED NC_("RID_SVXSTR_TBLAFMT_LO6_SIMPLE_LIST_SHADED", "Simple List Shaded")
#define RID_SVXSTR_LINEJOINT_MIDDLE NC_("RID_SVXSTR_LINEJOINT_MIDDLE", "Line joint averaged")
#define RID_SVXSTR_LINEJOINT_BEVEL NC_("RID_SVXSTR_LINEJOINT_BEVEL", "Line joint bevel")
#define RID_SVXSTR_LINEJOINT_MITER NC_("RID_SVXSTR_LINEJOINT_MITER", "Line joint miter")
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index 296dae5b9026..371cf8c2347f 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -762,7 +762,17 @@ static const char* RID_SVXSTR_TBLAFMT[] =
RID_SVXSTR_TBLAFMT_LAVENDER,
RID_SVXSTR_TBLAFMT_RED,
RID_SVXSTR_TBLAFMT_TURQUOISE,
- RID_SVXSTR_TBLAFMT_YELLOW
+ RID_SVXSTR_TBLAFMT_YELLOW,
+ RID_SVXSTR_TBLAFMT_LO6_ACADEMIC,
+ RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_BLUE,
+ RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_GREEN,
+ RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_RED,
+ RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_YELLOW,
+ RID_SVXSTR_TBLAFMT_LO6_ELEGANT,
+ RID_SVXSTR_TBLAFMT_LO6_FINANCIAL,
+ RID_SVXSTR_TBLAFMT_LO6_SIMPLE_GRID_COLUMNS,
+ RID_SVXSTR_TBLAFMT_LO6_SIMPLE_GRID_ROWS,
+ RID_SVXSTR_TBLAFMT_LO6_SIMPLE_LIST_SHADED
};
bool ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions )
diff --git a/sw/inc/poolfmt.hxx b/sw/inc/poolfmt.hxx
index 6830faeee1ac..2ef34a0a9fa5 100644
--- a/sw/inc/poolfmt.hxx
+++ b/sw/inc/poolfmt.hxx
@@ -205,6 +205,7 @@ enum RES_POOL_TABSTYLE_TYPE
{
RES_POOLTABSTYLE_BEGIN = POOLGRP_TABSTYLE,
RES_POOLTABSTYLE_DEFAULT = RES_POOLTABSTYLE_BEGIN,
+// 16 old styles
RES_POOLTABLESTYLE_3D,
RES_POOLTABLESTYLE_BLACK1,
RES_POOLTABLESTYLE_BLACK2,
@@ -221,6 +222,17 @@ RES_POOLTABLESTYLE_LAVENDER,
RES_POOLTABLESTYLE_RED,
RES_POOLTABLESTYLE_TURQUOISE,
RES_POOLTABLESTYLE_YELLOW,
+// 10 new styles since LibreOffice 6.0
+RES_POOLTABLESTYLE_LO6_ACADEMIC,
+RES_POOLTABLESTYLE_LO6_BOX_LIST_BLUE,
+RES_POOLTABLESTYLE_LO6_BOX_LIST_GREEN,
+RES_POOLTABLESTYLE_LO6_BOX_LIST_RED,
+RES_POOLTABLESTYLE_LO6_BOX_LIST_YELLOW,
+RES_POOLTABLESTYLE_LO6_ELEGANT,
+RES_POOLTABLESTYLE_LO6_FINANCIAL,
+RES_POOLTABLESTYLE_LO6_SIMPLE_GRID_COLUMNS,
+RES_POOLTABLESTYLE_LO6_SIMPLE_GRID_ROWS,
+RES_POOLTABLESTYLE_LO6_SIMPLE_LIST_SHADED,
RES_POOLTABSTYLE_END
};
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 76388ee520ca..a0d2b3ae3bc4 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -211,24 +211,8 @@
#define STR_COLUMN_VALUESET_ITEM2 NC_("STR_COLUMN_VALUESET_ITEM2", "3 columns with equal size")
#define STR_COLUMN_VALUESET_ITEM3 NC_("STR_COLUMN_VALUESET_ITEM3", "2 columns with different size (left > right)")
#define STR_COLUMN_VALUESET_ITEM4 NC_("STR_COLUMN_VALUESET_ITEM4", "2 columns with different size (left < right)")
-// Table styles
+// Table styles, Writer internal, others are taken from Svx
#define STR_TABSTYLE_DEFAULT NC_("STR_TABSTYLE_DEFAULT", "Default Style")
-#define STR_TABSTYLE_3D NC_("STR_TABSTYLE_3D", "3D")
-#define STR_TABSTYLE_BLACK1 NC_("STR_TABSTYLE_BLACK1", "Black 1")
-#define STR_TABSTYLE_BLACK2 NC_("STR_TABSTYLE_BLACK2", "Black 2")
-#define STR_TABSTYLE_BLUE NC_("STR_TABSTYLE_BLUE", "Blue")
-#define STR_TABSTYLE_BROWN NC_("STR_TABSTYLE_BROWN", "Brown")
-#define STR_TABSTYLE_CURRENCY NC_("STR_TABSTYLE_CURRENCY", "Currency")
-#define STR_TABSTYLE_CURRENCY_3D NC_("STR_TABSTYLE_CURRENCY_3D", "Currency 3D")
-#define STR_TABSTYLE_CURRENCY_GRAY NC_("STR_TABSTYLE_CURRENCY_GRAY", "Currency Gray")
-#define STR_TABSTYLE_CURRENCY_LAVENDER NC_("STR_TABSTYLE_CURRENCY_LAVENDER", "Currency Lavender")
-#define STR_TABSTYLE_CURRENCY_TURQUOISE NC_("STR_TABSTYLE_CURRENCY_TURQUOISE", "Currency Turquoise")
-#define STR_TABSTYLE_GRAY NC_("STR_TABSTYLE_GRAY", "Gray")
-#define STR_TABSTYLE_GREEN NC_("STR_TABSTYLE_GREEN", "Green")
-#define STR_TABSTYLE_LAVENDER NC_("STR_TABSTYLE_LAVENDER", "Lavender")
-#define STR_TABSTYLE_RED NC_("STR_TABSTYLE_RED", "Red")
-#define STR_TABSTYLE_TURQUOISE NC_("STR_TABSTYLE_TURQUOISE", "Turquoise")
-#define STR_TABSTYLE_YELLOW NC_("STR_TABSTYLE_YELLOW", "Yellow")
#define STR_PARAGRAPHSTYLEFAMILY NC_("STR_PARAGRAPHSTYLEFAMILY", "Paragraph Styles")
#define STR_CHARACTERSTYLEFAMILY NC_("STR_CHARACTERSTYLEFAMILY", "Character Styles")
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx
index abcafa39111a..316217ba8907 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -58,6 +58,8 @@
#include <editeng/frmdiritem.hxx>
#include <editeng/emphasismarkitem.hxx>
#include <editeng/scriptspaceitem.hxx>
+#include <svx/strings.hrc>
+#include <svx/dialmgr.hxx>
#include <strings.hrc>
#include <com/sun/star/table/BorderLineStyle.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
@@ -516,25 +518,42 @@ static const char* STR_POOLNUMRULE_NUM_ARY[] =
STR_POOLNUMRULE_BUL5
};
+// XXX MUST match the entries of TableStyleProgNameTable in
+// sw/source/core/doc/SwStyleNameMapper.cxx and MUST match the order of
+// RES_POOL_TABSTYLE_TYPE in sw/inc/poolfmt.hxx
static const char* STR_TABSTYLE_ARY[] =
{
+ // XXX MUST be in order, Writer first, then Svx old, then Svx new
+ // 1 Writer resource string
STR_TABSTYLE_DEFAULT,
- STR_TABSTYLE_3D,
- STR_TABSTYLE_BLACK1,
- STR_TABSTYLE_BLACK2,
- STR_TABSTYLE_BLUE,
- STR_TABSTYLE_BROWN,
- STR_TABSTYLE_CURRENCY,
- STR_TABSTYLE_CURRENCY_3D,
- STR_TABSTYLE_CURRENCY_GRAY,
- STR_TABSTYLE_CURRENCY_LAVENDER,
- STR_TABSTYLE_CURRENCY_TURQUOISE,
- STR_TABSTYLE_GRAY,
- STR_TABSTYLE_GREEN,
- STR_TABSTYLE_LAVENDER,
- STR_TABSTYLE_RED,
- STR_TABSTYLE_TURQUOISE,
- STR_TABSTYLE_YELLOW
+ // 16 old styles Svx resource strings
+ RID_SVXSTR_TBLAFMT_3D,
+ RID_SVXSTR_TBLAFMT_BLACK1,
+ RID_SVXSTR_TBLAFMT_BLACK2,
+ RID_SVXSTR_TBLAFMT_BLUE,
+ RID_SVXSTR_TBLAFMT_BROWN,
+ RID_SVXSTR_TBLAFMT_CURRENCY,
+ RID_SVXSTR_TBLAFMT_CURRENCY_3D,
+ RID_SVXSTR_TBLAFMT_CURRENCY_GRAY,
+ RID_SVXSTR_TBLAFMT_CURRENCY_LAVENDER,
+ RID_SVXSTR_TBLAFMT_CURRENCY_TURQUOISE,
+ RID_SVXSTR_TBLAFMT_GRAY,
+ RID_SVXSTR_TBLAFMT_GREEN,
+ RID_SVXSTR_TBLAFMT_LAVENDER,
+ RID_SVXSTR_TBLAFMT_RED,
+ RID_SVXSTR_TBLAFMT_TURQUOISE,
+ RID_SVXSTR_TBLAFMT_YELLOW,
+ // 10 new styles since LibreOffice 6.0 Svx resource strings
+ RID_SVXSTR_TBLAFMT_LO6_ACADEMIC,
+ RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_BLUE,
+ RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_GREEN,
+ RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_RED,
+ RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_YELLOW,
+ RID_SVXSTR_TBLAFMT_LO6_ELEGANT,
+ RID_SVXSTR_TBLAFMT_LO6_FINANCIAL,
+ RID_SVXSTR_TBLAFMT_LO6_SIMPLE_GRID_COLUMNS,
+ RID_SVXSTR_TBLAFMT_LO6_SIMPLE_GRID_ROWS,
+ RID_SVXSTR_TBLAFMT_LO6_SIMPLE_LIST_SHADED
};
namespace sw
@@ -2517,12 +2536,16 @@ std::vector<OUString> *SwStyleNameMapper::s_pTextUINameArray = nullptr,
*SwStyleNameMapper::s_pCellStyleUINameArray = nullptr;
std::vector<OUString>*
-lcl_NewUINameArray(const char** pIds, const size_t nLen)
+lcl_NewUINameArray(const char** pIds, const size_t nLen, const size_t nSvxIds = 0)
{
+ assert(nSvxIds <= nLen);
+ const size_t nWriterIds = nLen - nSvxIds;
std::vector<OUString> *const pNameArray = new std::vector<OUString>;
pNameArray->reserve(nLen);
- for (size_t i = 0; i < nLen; ++i)
+ for (size_t i = 0; i < nWriterIds; ++i)
pNameArray->push_back(SwResId(pIds[i]));
+ for (size_t i = nWriterIds; i < nLen; ++i)
+ pNameArray->push_back(SvxResId(pIds[i]));
return pNameArray;
}
@@ -2606,7 +2629,9 @@ const std::vector<OUString>& SwStyleNameMapper::GetNumRuleUINameArray()
const std::vector<OUString>& SwStyleNameMapper::GetTableStyleUINameArray()
{
if (!s_pTableStyleUINameArray)
- s_pTableStyleUINameArray = lcl_NewUINameArray(STR_TABSTYLE_ARY, SAL_N_ELEMENTS(STR_TABSTYLE_ARY));
+ // 1 Writer resource string (XXX if this ever changes rather use offset math)
+ s_pTableStyleUINameArray = lcl_NewUINameArray(STR_TABSTYLE_ARY, SAL_N_ELEMENTS(STR_TABSTYLE_ARY),
+ static_cast<size_t>(SAL_N_ELEMENTS(STR_TABSTYLE_ARY) - 1));
return *s_pTableStyleUINameArray;
}
diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx
index 56f3f6934f1a..367fb68d7a6b 100644
--- a/sw/source/core/doc/SwStyleNameMapper.cxx
+++ b/sw/source/core/doc/SwStyleNameMapper.cxx
@@ -302,6 +302,9 @@ const struct SwTableEntry NumRuleProgNameTable [] =
{ 0, nullptr }
};
+// XXX MUST match the entries of STR_TABSTYLE_ARY in
+// sw/source/core/doc/DocumentStylePoolManager.cxx and MUST match the order of
+// RES_POOL_TABSTYLE_TYPE in sw/inc/poolfmt.hxx
const struct SwTableEntry TableStyleProgNameTable [] =
{
ENTRY( "Default Style" ), // RES_POOLTABLESTYLE_DEFAULT
@@ -321,6 +324,16 @@ const struct SwTableEntry TableStyleProgNameTable [] =
ENTRY( "Red" ), // RES_POOLTABLESTYLE_RED
ENTRY( "Turquoise" ), // RES_POOLTABLESTYLE_TURQUOISE
ENTRY( "Yellow" ), // RES_POOLTABLESTYLE_YELLOW
+ ENTRY( "Academic" ), // RES_POOLTABLESTYLE_LO6_ACADEMIC
+ ENTRY( "Box List Blue" ), // RES_POOLTABLESTYLE_LO6_BOX_LIST_BLUE
+ ENTRY( "Box List Green" ), // RES_POOLTABLESTYLE_LO6_BOX_LIST_GREEN
+ ENTRY( "Box List Red" ), // RES_POOLTABLESTYLE_LO6_BOX_LIST_RED
+ ENTRY( "Box List Yellow" ), // RES_POOLTABLESTYLE_LO6_BOX_LIST_YELLOW
+ ENTRY( "Elegant" ), // RES_POOLTABLESTYLE_LO6_ELEGANT
+ ENTRY( "Financial" ), // RES_POOLTABLESTYLE_LO6_FINANCIAL
+ ENTRY( "Simple Grid Columns" ), // RES_POOLTABLESTYLE_LO6_SIMPLE_GRID_COLUMNS
+ ENTRY( "Simple Grid Rows" ), // RES_POOLTABLESTYLE_LO6_SIMPLE_GRID_ROWS
+ ENTRY( "Simple List Shaded" ),// RES_POOLTABLESTYLE_LO6_SIMPLE_LIST_SHADED
{ 0, nullptr }
};
#undef ENTRY
commit 7d12aa833aec8e9a5c453104a23bff70cec54a45
Author: heiko tietze <tietze.heiko at gmail.com>
Date: Wed Nov 29 19:54:11 2017 +0100
tdf#101349 Rework of table styles for use in Calc
All table styles formatted with General number format
except first row/column as text; financial defined with Currency
Change-Id: Ib4085230b10d398838b42a449e1166780251f9b4
Reviewed-on: https://gerrit.libreoffice.org/45523
Reviewed-by: Heiko Tietze <tietze.heiko at googlemail.com>
Tested-by: Heiko Tietze <tietze.heiko at googlemail.com>
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Eike Rathke <erack at redhat.com>
diff --git a/extras/source/misc_config/autotbl.fmt b/extras/source/misc_config/autotbl.fmt
index 9d4ce085c146..395e2ac33114 100644
Binary files a/extras/source/misc_config/autotbl.fmt and b/extras/source/misc_config/autotbl.fmt differ
More information about the Libreoffice-commits
mailing list