[Libreoffice-commits] core.git: include/xmloff xmloff/qa xmloff/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Mon May 11 08:22:58 UTC 2020


 include/xmloff/xmltoken.hxx      |    2 ++
 xmloff/qa/unit/tokenmap-test.cxx |    2 ++
 xmloff/source/core/xmltoken.cxx  |    3 +++
 3 files changed, 7 insertions(+)

New commits:
commit 5814f08c01ab7973cc83e6721ef434f5acc63a1a
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Sat May 9 11:11:13 2020 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon May 11 10:22:20 2020 +0200

    Document relation between three lists that must be in sync
    
    Change-Id: I9fc44b6878450d147d21f77ff4daa6939edfa0c2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93837
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index d04776be3265..4e23277dd485 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -40,6 +40,8 @@
 
 namespace xmloff::token {
 
+    // IMPORTANT! XMLTokenEnum order MUST be in synch with aTokenList in
+    // xmloff/source/core/xmltoken.cxx, and with xmloff/source/token/tokens.txt.
 
     /**
      * The enumeration of all XML tokens.
diff --git a/xmloff/qa/unit/tokenmap-test.cxx b/xmloff/qa/unit/tokenmap-test.cxx
index fb6916444454..476416fc3933 100644
--- a/xmloff/qa/unit/tokenmap-test.cxx
+++ b/xmloff/qa/unit/tokenmap-test.cxx
@@ -62,6 +62,8 @@ void TokenmapTest::test_roundTrip()
 void TokenmapTest::test_listEquality()
 {
     //make sure the two token lists stay in sync
+    // This depends on same order in three places: XMLTokenEnum in include/xmloff/xmltoken.hxx,
+    // aTokenList in xmloff/source/core/xmltoken.cxx, and xmloff/source/token/tokens.txt
     for ( sal_Int32 nToken = 0; nToken < XML_TOKEN_COUNT; ++nToken )
     {
         Sequence< sal_Int8 > rUtf8Name = pTokenMap->getUtf8TokenName(nToken);
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 4f7428dc431f..9c774c5ee46d 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -49,6 +49,9 @@ namespace xmloff::token {
     #define TOKEN( s, e ) { sizeof(s)-1, s, std::nullopt }
 #endif
 
+    // IMPORTANT! aTokenList order MUST be in synch with XMLTokenEnum in include/xmloff/xmltoken.hxx
+    // and with xmloff/source/token/tokens.txt.
+
     struct XMLTokenEntry aTokenList[] =
     {
 #if OSL_DEBUG_LEVEL > 0


More information about the Libreoffice-commits mailing list