[Libreoffice-commits] core.git: include/svl svx/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 14 10:45:48 UTC 2021


 include/svl/itemset.hxx       |   18 ------------------
 svx/source/svdraw/svdedxv.cxx |   27 ++++++++++++---------------
 2 files changed, 12 insertions(+), 33 deletions(-)

New commits:
commit 90cb57eb53e28ecb983001bf8f018577abb6d145
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Jun 14 12:06:08 2021 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Jun 14 12:45:08 2021 +0200

    Workaround internal compiler error on tb77
    
    As reported in https://ci.libreoffice.org/job/gerrit_windows/98360/console :
    
      C:/cygwin/home/tdf/jenkins/workspace/gerrit_windows/svx/source/svdraw/svdedxv.cxx(2639): fatal error C1001: Internal compiler error.
      (compiler file 'msc1.cpp', line 1591)
       To work around this problem, try simplifying or changing the program near the locations listed above.
      If possible please provide a repro here: https://developercommunity.visualstudio.com
      Please choose the Technical Support command on the Visual C++
       Help menu, or open the Technical Support help file for more information
      C:/cygwin/home/tdf/jenkins/workspace/gerrit_windows/svx/source/svdraw/svdedxv.cxx(2631): note: while evaluating constexpr function 'svl::ItemsArray'
      INTERNAL COMPILER ERROR in 'C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x86\cl.exe'
          Please choose the Technical Support command on the Visual C++
          Help menu, or open the Technical Support help file for more information
    
    tb77 uses VS 16.7.7 (cl.exe is under Tools/MSVC/14.27.29110); tb68 with
    cl.exe under Tools/MSVC/14.28.29910 has no problems compiling this.
    
    Let's make the code simple for now, until we upgrade the tooling on CI.
    
    Change-Id: I10aaf289454c89b2f49b4be947627a9a3be30fde
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117137
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx
index d4a9304a85dd..e8bc88a13263 100644
--- a/include/svl/itemset.hxx
+++ b/include/svl/itemset.hxx
@@ -86,24 +86,6 @@ constexpr std::size_t rangesSize()
 
 template<sal_uInt16... WIDs> struct Items {};
 
-// This allows creating compile-time which id arrays using syntax like
-//
-//     constexpr auto aWids = svl::ItemsArray({ { widFrom1, widTo2 }, { widFrom2, widTo2 }, ... });
-//
-// so that e.g. clang-format would not try to rearrange the initializer sequence to break pairs.
-// Additionally, the array validity is checked in debug builds.
-template <size_t N> constexpr auto ItemsArray(const std::pair<sal_uInt16, sal_uInt16> (&wids)[N])
-{
-    std::array<sal_uInt16, N * 2 + 1> aArray{};
-    sal_uInt16* p = aArray.data();
-    for (const auto& [wid1, wid2] : wids)
-    {
-        *p++ = wid1;
-        *p++ = wid2;
-    }
-    assert(svl::detail::validRanges(aArray.data()));
-    return aArray;
-}
 }
 
 class SAL_WARN_UNUSED SVL_DLLPUBLIC SfxItemSet
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 50ac7499ee85..c83ae8b1746c 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2628,21 +2628,18 @@ bool SdrObjEditView::SupportsFormatPaintbrush(SdrInventor nObjectInventor,
 
 static const sal_uInt16* GetFormatRangeImpl(bool bTextOnly)
 {
-    static constexpr auto gFull
-        = svl::ItemsArray({ { XATTR_LINE_FIRST, XATTR_LINE_LAST },
-                            { XATTR_FILL_FIRST, XATTRSET_FILL },
-                            { SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST },
-                            { SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST }, // table cell formats
-                            { SDRATTR_GRAF_FIRST, SDRATTR_GRAF_LAST },
-                            { SDRATTR_TABLE_FIRST, SDRATTR_TABLE_LAST },
-                            { EE_PARA_START, EE_PARA_END },
-                            { EE_CHAR_START, EE_CHAR_END } });
-
-    static constexpr auto gTextOnly = svl::ItemsArray({ { SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST },
-                                                        { EE_PARA_START, EE_PARA_END },
-                                                        { EE_CHAR_START, EE_CHAR_END } });
-
-    return bTextOnly ? gTextOnly.data() : gFull.data();
+    static const sal_uInt16 gFull[]
+        = { XATTR_LINE_FIRST,   XATTR_LINE_LAST,      XATTR_FILL_FIRST,
+            XATTRSET_FILL,      SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST,
+            SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, // table cell formats
+            SDRATTR_GRAF_FIRST, SDRATTR_GRAF_LAST,    SDRATTR_TABLE_FIRST,
+            SDRATTR_TABLE_LAST, EE_PARA_START,        EE_PARA_END,
+            EE_CHAR_START,      EE_CHAR_END };
+
+    static const sal_uInt16 gTextOnly[] = { SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, EE_PARA_START,
+                                            EE_PARA_END,        EE_CHAR_START,     EE_CHAR_END };
+
+    return bTextOnly ? gTextOnly : gFull;
 }
 
 void SdrObjEditView::TakeFormatPaintBrush(std::shared_ptr<SfxItemSet>& rFormatSet)


More information about the Libreoffice-commits mailing list