ridljar/com/sun/star/lib/util/NativeLibraryLoader.java |    9 ------
 sc/qa/unit/data/ods/tdf150815.ods                      |binary
 sc/qa/unit/subsequent_filters_test3.cxx                |   22 ++++++++++++++++-
 sc/source/ui/inc/viewfunc.hxx                          |    4 +--
 sc/source/ui/view/viewfunc.cxx                         |   22 +++++++++++++++++
 5 files changed, 45 insertions(+), 12 deletions(-)

New commits:
commit b0ef63638b31ae3fcc5e4a6bbf5298040a878ee3
Author:     Hossein <hoss...@libreoffice.org>
AuthorDate: Thu Aug 31 11:02:09 2023 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Sep 1 13:34:20 2023 +0200

    tdf#149069 Revert "ridljar: check UnoClassLoader used for 
NativeLibraryLoader"
    
    This reverts commit 97b61ea3297e04e64aab1e1a4ec50202e9f86fff. It checked
    that the NativeLibraryLoader is an instance of the class
    com.sun.star.lib.unoloader.UnoClassLoader. If this is not the case, a
    warning was displayed. This was for java_uno bridge to work.
    
    On the other hand, as the comment in the code implies, "not a problem
    if this is using Java remote bridge or (in a) unit test". But, in the
    code there was no check for that. As a result, this warning is displayed
    in many places like the simple examples that want to connect to the
    LibreOffice process via Java API.
    
    Change-Id: I056ed372ad071573051024a63e51afd6b4425ce5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156302
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Tested-by: Jenkins
    Reviewed-by: Hossein <hoss...@libreoffice.org>
    (cherry picked from commit 345b214c37d1f645dd0e6e084358f8ca81d9ed66)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156373
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java 
b/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
index d255a71ea5d1..eb5c6af34e90 100644
--- a/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
+++ b/ridljar/com/sun/star/lib/util/NativeLibraryLoader.java
@@ -21,7 +21,6 @@ package com.sun.star.lib.util;
 import java.io.File;
 import java.net.URL;
 import java.net.URLClassLoader;
-import com.sun.star.lib.unoloader.UnoClassLoader;
 
 /**
  * Helper functions to locate and load native files.
@@ -36,14 +35,6 @@ import com.sun.star.lib.unoloader.UnoClassLoader;
  * algorithm.</p>
  */
 public final class NativeLibraryLoader {
-    static {
-        // if it's some other class loader, then resolving the symbol
-        // Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call in
-        // java_uno will not work and result in UnsatisfiedLinkError
-        if (!(NativeLibraryLoader.class.getClassLoader() instanceof 
com.sun.star.lib.unoloader.UnoClassLoader)) {
-            System.err.println("warning: 
com.sun.star.lib.util.NativeLibraryLoader must be loaded by 
com.sun.star.lib.unoloader.UnoClassLoader for java_uno bridge to work (not a 
problem if this is using Java remote bridge or unit test)");
-        }
-    }
     /**
      * Load a system library, using a given class loader to locate the library.
      *
commit 009ea5c6bcf34b877dddfe4080b9bb2450844adb
Author:     Tibor Nagy <nagy.tib...@nisz.hu>
AuthorDate: Wed Aug 30 16:22:02 2023 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Sep 1 13:34:15 2023 +0200

    tdf#150815 sc: fix repainting sparkline
    
    On Windows, if the input range of the sparkline is not in the
    same row as the output range, the sparkline wasn't repainted
    after changing the data within its range. Force the update
    to avoid of showing obsolete data.
    
    Change-Id: Id56209b20387ee68144507a0102d3a0d093ff1ea
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156304
    Reviewed-by: László Németh <nem...@numbertext.org>
    Tested-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit 0d41e2e2e3af5b6e3c80116fa90c6a000ca291c9)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156229
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/qa/unit/data/ods/tdf150815.ods 
b/sc/qa/unit/data/ods/tdf150815.ods
new file mode 100644
index 000000000000..2dd407b6cea5
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf150815.ods differ
diff --git a/sc/qa/unit/subsequent_filters_test3.cxx 
b/sc/qa/unit/subsequent_filters_test3.cxx
index 54d5061d2cd9..b4b918164d09 100644
--- a/sc/qa/unit/subsequent_filters_test3.cxx
+++ b/sc/qa/unit/subsequent_filters_test3.cxx
@@ -393,7 +393,8 @@ struct PaintListener : public SfxListener
         {
             if ((pPaintHint->GetStartCol() <= 0 && pPaintHint->GetEndCol() >= 
0)
                 && ((pPaintHint->GetStartRow() <= 9 && pPaintHint->GetEndRow() 
>= 9)
-                    || (pPaintHint->GetStartRow() == 2 && 
pPaintHint->GetEndRow() == 3)))
+                    || (pPaintHint->GetStartRow() == 2 && 
pPaintHint->GetEndRow() == 3)
+                    || (pPaintHint->GetStartRow() == 1 && 
pPaintHint->GetEndRow() == 1)))
             {
                 mbCalled = true;
             }
@@ -441,6 +442,25 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf131471)
     CPPUNIT_ASSERT(aListener.mbCalled);
 }
 
+CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf150815_RepaintSparkline)
+{
+    createScDoc("ods/tdf150815.ods");
+
+    ScDocument* pDoc = getScDoc();
+    ScDocShell* pDocSh = getScDocShell();
+
+    PaintListener aListener;
+    aListener.StartListening(*pDocSh);
+
+    auto pSparkline = pDoc->GetSparkline(ScAddress(0, 1, 0));
+    CPPUNIT_ASSERT(pSparkline);
+
+    ScTabViewShell* pViewShell = getViewShell();
+    pViewShell->EnterData(0, 0, 0, "10");
+
+    CPPUNIT_ASSERT(aListener.mbCalled);
+}
+
 CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf137091)
 {
     // Set the system locale to Turkish
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 0d8d7515441a..323e7cbbe793 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -90,8 +90,8 @@ public:
     bool            AutoSum( const ScRange& rRange, bool bSubTotal, bool 
bSetCursor, bool bContinue, const OpCode eCode );
     OUString        GetAutoSumFormula( const ScRangeList& rRangeList, bool 
bSubTotal, const ScAddress& rAddr, const OpCode eCode );
 
-    void            EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const 
OUString& rString,
-                               const EditTextObject* pData = nullptr, bool 
bMatrixExpand = false );
+    SC_DLLPUBLIC void EnterData(SCCOL nCol, SCROW nRow, SCTAB nTab, const 
OUString& rString,
+                                const EditTextObject* pData = nullptr, bool 
bMatrixExpand = false);
     void            EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
                                const EditTextObject& rData, bool bTestSimple = 
false );
     void            EnterValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const 
double& rValue );
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index bc149f62b40e..c7eb76e64d1b 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -77,6 +77,7 @@
 #include <conditio.hxx>
 #include <columnspanset.hxx>
 #include <stringutil.hxx>
+#include <SparklineList.hxx>
 
 #include <memory>
 
@@ -103,6 +104,26 @@ static void lcl_PostRepaintCondFormat( const 
ScConditionalFormat *pCondFmt, ScDo
     }
 }
 
+static void lcl_PostRepaintSparkLine(sc::SparklineList* pSparklineList, const 
ScRange& rRange,
+                                     ScDocShell* pDocSh)
+{
+    if (pSparklineList)
+    {
+        for (auto& rSparkLineGroup : pSparklineList->getSparklineGroups())
+        {
+            for (auto& rSparkline : 
pSparklineList->getSparklinesFor(rSparkLineGroup))
+            {
+                if (rSparkline->getInputRange().Contains(rRange))
+                {
+                    pDocSh->PostPaint(
+                        ScRange(rSparkline->getColumn(), rSparkline->getRow(), 
rRange.aStart.Tab()),
+                        PaintPartFlags::All, SC_PF_TESTMERGE);
+                }
+            }
+        }
+    }
+}
+
 ScViewFunc::ScViewFunc( vcl::Window* pParent, ScDocShell& rDocSh, 
ScTabViewShell* pViewShell ) :
     ScTabView( pParent, rDocSh, pViewShell ),
     bFormatValid( false )
@@ -662,6 +683,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB 
nTab,
 
     aModificator.SetDocumentModified();
     lcl_PostRepaintCondFormat( rDoc.GetCondFormat( nCol, nRow, nTab ), pDocSh 
);
+    lcl_PostRepaintSparkLine(rDoc.GetSparklineList(nTab), ScRange(nCol, nRow, 
nTab), pDocSh);
 }
 
 // enter value in single cell (on nTab only)

Reply via email to