chart2/source/controller/main/ChartController_Insert.cxx |   25 +++++++++++-
 chart2/source/model/main/Diagram.cxx                     |    2 +
 external/pdfium/pdfium_arm64.patch.1                     |   30 ++++++++++++---
 3 files changed, 49 insertions(+), 8 deletions(-)

New commits:
commit 777f1dbb96fc4499e682f2f67969410408f53b50
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Mon Aug 15 20:07:44 2022 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue Aug 16 08:12:25 2022 +0200

    pdfium: replace windows arm64 patch with a backport from upstream
    
    No functional changes intended, just this way the patch can be dropped
    trivially the next time we update pdfium.
    
    Change-Id: I3259e98ddd20a51e109e860e1a3ab4c138597436
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138323
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/external/pdfium/pdfium_arm64.patch.1 
b/external/pdfium/pdfium_arm64.patch.1
index 3a517ed1da52..14b6e94d8950 100644
--- a/external/pdfium/pdfium_arm64.patch.1
+++ b/external/pdfium/pdfium_arm64.patch.1
@@ -1,12 +1,32 @@
-diff -ur pdfium.org/third_party/libopenjpeg/ht_dec.c 
pdfium/third_party/libopenjpeg/ht_dec.c
---- pdfium.org/third_party/libopenjpeg/ht_dec.c        2022-07-28 
15:19:17.366247900 +0200
-+++ pdfium/third_party/libopenjpeg/ht_dec.c    2022-07-28 15:23:25.641843900 
+0200
-@@ -69,7 +69,7 @@
+From 51115e5055ff32bfb4447ad15f68f536480429df Mon Sep 17 00:00:00 2001
+From: Miklos Vajna <miklos.va...@collabora.com>
+Subject: [PATCH] libopenjpeg: fix Windows arm64 build
+
+Windows 64bit arm has no __popcnt(), see
+<https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics>.
+Falling back to the generic code seems to be good enough for our
+purposes.
+
+Change-Id: I61510569793a3df24734c58ffaa3ffc0c2451477
+Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/96010
+Reviewed-by: Lei Zhang <thes...@chromium.org>
+Commit-Queue: Lei Zhang <thes...@chromium.org>
+---
+ third_party/libopenjpeg/ht_dec.c              |  2 +-
+
+diff --git a/third_party/libopenjpeg/ht_dec.c 
b/third_party/libopenjpeg/ht_dec.c
+index 1eb4d525f..e2f3afd6a 100644
+--- a/third_party/libopenjpeg/ht_dec.c
++++ b/third_party/libopenjpeg/ht_dec.c
+@@ -69,7 +69,7 @@ static OPJ_BOOL only_cleanup_pass_is_decoded = OPJ_FALSE;
  static INLINE
  OPJ_UINT32 population_count(OPJ_UINT32 val)
  {
 -#ifdef OPJ_COMPILER_MSVC
-+#if defined(OPJ_COMPILER_MSVC) && !defined(_ARM64_)
++#if defined(OPJ_COMPILER_MSVC) && (defined(_M_IX86) || defined(_M_AMD64))
      return (OPJ_UINT32)__popcnt(val);
  #elif (defined OPJ_COMPILER_GNUC)
      return (OPJ_UINT32)__builtin_popcount(val);
+-- 
+2.35.3
+
commit fcf839cd4b76254d03426a849e17927b2a845352
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Wed Aug 10 12:06:42 2022 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Tue Aug 16 08:12:16 2022 +0200

    chart2: Add undo/redo for the data table
    
    Change-Id: I6b25a7a82957705481952bc3cd181a6d0c1fce0e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138298
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/chart2/source/controller/main/ChartController_Insert.cxx 
b/chart2/source/controller/main/ChartController_Insert.cxx
index 99b3e74fffac..6fd0dd19025d 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -161,6 +161,10 @@ void ChartController::executeDispatch_InsertGrid()
 void ChartController::executeDispatch_OpenInsertDataTableDialog()
 {
     SolarMutexGuard aGuard;
+
+    auto aUndoDescription = 
ActionDescriptionProvider::createDescription(ActionDescriptionProvider::ActionType::Insert,
 SchResId(STR_OBJECT_DATA_TABLE));
+    UndoGuard aUndoGuard(aUndoDescription, m_xUndoManager);
+
     rtl::Reference<Diagram> xDiagram = getFirstDiagram();
 
     InsertDataTableDialog aDialog(GetChartFrame());
@@ -195,12 +199,14 @@ void 
ChartController::executeDispatch_OpenInsertDataTableDialog()
     // show the dialog
     if (aDialog.run() == RET_OK)
     {
-        auto& rDialogData = aDialog.getDataTableDialogData();
+        bool bChanged = false;
 
+        auto& rDialogData = aDialog.getDataTableDialogData();
         auto xDataTable = xDiagram->getDataTable();
         if (!rDialogData.mbShow && xDataTable.is())
         {
             xDiagram->setDataTable(uno::Reference<chart2::XDataTable>());
+            bChanged = true;
         }
         else if (rDialogData.mbShow && !xDataTable.is())
         {
@@ -208,6 +214,7 @@ void 
ChartController::executeDispatch_OpenInsertDataTableDialog()
             if (xNewDataTable.is())
             {
                 xDiagram->setDataTable(xNewDataTable);
+                bChanged = true;
             }
         }
 
@@ -220,13 +227,20 @@ void 
ChartController::executeDispatch_OpenInsertDataTableDialog()
             xProperties->setPropertyValue("VBorder" , 
uno::Any(rDialogData.mbVerticalBorders));
             xProperties->setPropertyValue("Outline" , 
uno::Any(rDialogData.mbOutline));
             xProperties->setPropertyValue("Keys" , 
uno::Any(rDialogData.mbKeys));
+            bChanged = true;
         }
+
+        if (bChanged)
+            aUndoGuard.commit();
     }
 }
 
 void ChartController::executeDispatch_InsertDataTable()
 {
-    SolarMutexGuard aGuard;
+    auto aUndoDescription = 
ActionDescriptionProvider::createDescription(ActionDescriptionProvider::ActionType::Insert,
 SchResId(STR_OBJECT_DATA_TABLE));
+    UndoGuard aUndoGuard(aUndoDescription, m_xUndoManager);
+
+
     rtl::Reference<Diagram> xDiagram = getFirstDiagram();
     auto xDataTable = xDiagram->getDataTable();
     if (!xDataTable.is())
@@ -235,18 +249,23 @@ void ChartController::executeDispatch_InsertDataTable()
         if (xNewDataTable.is())
         {
             xDiagram->setDataTable(xNewDataTable);
+            aUndoGuard.commit();
         }
     }
 }
 
 void ChartController::executeDispatch_DeleteDataTable()
 {
-    SolarMutexGuard aGuard;
+    auto aUndoDescription = 
ActionDescriptionProvider::createDescription(ActionDescriptionProvider::ActionType::Delete,
 SchResId(STR_OBJECT_DATA_TABLE));
+    UndoGuard aUndoGuard(aUndoDescription, m_xUndoManager);
+
+
     rtl::Reference<Diagram> xDiagram = getFirstDiagram();
     auto xDataTable = xDiagram->getDataTable();
     if (xDataTable.is())
     {
         xDiagram->setDataTable(uno::Reference<chart2::XDataTable>());
+        aUndoGuard.commit();
     }
 }
 
diff --git a/chart2/source/model/main/Diagram.cxx 
b/chart2/source/model/main/Diagram.cxx
index de8244136642..cd83e5191ca0 100644
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -260,6 +260,8 @@ Diagram::Diagram( const Diagram & rOther ) :
     m_xTitle.set( CloneHelper::CreateRefClone< chart2::XTitle >()( 
rOther.m_xTitle ));
     if (rOther.m_xLegend)
         m_xLegend = new Legend(*rOther.m_xLegend);
+    if (rOther.m_xDataTable)
+        m_xDataTable = new DataTable(*rOther.m_xDataTable);
 
     if ( m_xWall )
         m_xWall->addModifyListener( m_xModifyEventForwarder );

Reply via email to