Rebased ref, commits from common ancestor:
commit b13134f9142303db9516a3f28fd2234ad480c7d8
Author:     Ilmari Lauhakangas <[email protected]>
AuthorDate: Mon Jan 16 10:38:32 2023 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 16 22:01:20 2023 +0100

    readme.xrm: update for macOS
    
    Change-Id: Ie9b35086a438d6f1fe3be5a35481a66a4864b6e6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145581
    Tested-by: Ilmari Lauhakangas <[email protected]>
    Reviewed-by: Ilmari Lauhakangas <[email protected]>

diff --git a/readlicense_oo/docs/readme.xrm b/readlicense_oo/docs/readme.xrm
index d01823d780d7..4d99b7c4611a 100644
--- a/readlicense_oo/docs/readme.xrm
+++ b/readlicense_oo/docs/readme.xrm
@@ -34,7 +34,7 @@
                        <div class="MAC" id="SystemRequirements_OSX">
                                <ul>
                                        <li>
-                                               <p id="macxiOSX" 
xml:lang="en-US">macOS 10.10 (Yosemite) or higher</p>
+                                               <p id="macxiOSX" 
xml:lang="en-US">macOS 10.14 (Mojave) or higher</p>
                                        </li>
                                </ul>
                        </div>
commit 169892ad3c84b89389b999cfa5e090abe5550ef5
Author:     Andreas Heinisch <[email protected]>
AuthorDate: Thu Jan 12 07:46:43 2023 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 16 22:01:20 2023 +0100

    tdf#147122 - Return cell object when a simple selection is merged
    
    Change-Id: I4ddd3b3a804f8300a5ec15526f4c9c77aaf45fc5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145378
    Tested-by: Jenkins
    Reviewed-by: Andreas Heinisch <[email protected]>
    (cherry picked from commit b9411e587586750f36ba9009b5f1e29fe461d8b5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145452
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index f53389f40459..24379362bed5 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -71,6 +71,7 @@ public:
     void testTdf107572();
     void testShapeLayerId();
     void testFunctionAccessIndirect();
+    void testTdf147122();
 
     CPPUNIT_TEST_SUITE(ScMacrosTest);
     CPPUNIT_TEST(testStarBasic);
@@ -105,6 +106,7 @@ public:
     CPPUNIT_TEST(testTdf107572);
     CPPUNIT_TEST(testShapeLayerId);
     CPPUNIT_TEST(testFunctionAccessIndirect);
+    CPPUNIT_TEST(testTdf147122);
 
     CPPUNIT_TEST_SUITE_END();
 };
@@ -898,6 +900,38 @@ void ScMacrosTest::testFunctionAccessIndirect()
     CPPUNIT_ASSERT_EQUAL(css::uno::Any(OUString("a1")), aResult);
 }
 
+void ScMacrosTest::testTdf147122()
+{
+    mxComponent = loadFromDesktop("private:factory/scalc");
+
+    css::uno::Reference<css::document::XEmbeddedScripts> xDocScr(mxComponent, 
UNO_QUERY_THROW);
+    auto xLibs = xDocScr->getBasicLibraries();
+    auto xLibrary = xLibs->createLibrary("TestLibrary");
+    xLibrary->insertByName(
+        "TestModule",
+        uno::Any(
+            OUString("Function TestMergedSelection\n"
+                     // Insert test string into cell A1
+                     "  oActiveSheet = 
ThisComponent.CurrentController.ActiveSheet\n"
+                     "  oActiveCell = 
oActiveSheet.getCellRangeByName(\"A1\")\n"
+                     "  oActiveCell.setString(\"This is a test\")\n"
+                     // Merge A1:B2 cell range and return the content of the 
merged range
+                     "  oRange = oActiveSheet.getCellRangeByName(\"A1:B2\")\n"
+                     "  ThisComponent.getCurrentController.Select(oRange)\n"
+                     "  oActiveCell = ThisComponent.CurrentSelection\n"
+                     "  oActiveCell.Merge(True)\n"
+                     "  TestMergedSelection = 
ThisComponent.getCurrentSelection().getString()\n"
+                     "End Function\n")));
+
+    Any aRet = 
executeMacro("vnd.sun.Star.script:TestLibrary.TestModule.TestMergedSelection?"
+                            "language=Basic&location=document");
+    // Without the fix in place, this test would have failed with
+    // - Expression: false
+    // - Unexpected dialog: Error: BASIC runtime error.
+    // Property or method not found: getString.
+    CPPUNIT_ASSERT_EQUAL(Any(OUString("This is a test")), aRet);
+}
+
 ScMacrosTest::ScMacrosTest()
       : UnoApiXmlTest("/sc/qa/extras/testdocuments")
 {
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 5a7a8a391427..f8940594746c 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -70,6 +70,7 @@
 #include <svx/sdrhittesthelper.hxx>
 #include <formatsh.hxx>
 #include <sfx2/app.hxx>
+#include <scitems.hxx>
 
 using namespace com::sun::star;
 
@@ -872,7 +873,13 @@ uno::Any SAL_CALL ScTabViewObj::getSelection()
         ScMarkType eMarkType = rViewData.GetSimpleArea(aRange);
         if ( nTabs == 1 && (eMarkType == SC_MARK_SIMPLE) )
         {
-            if (aRange.aStart == aRange.aEnd)
+            // tdf#147122 - return cell object when a simple selection is 
merged
+            ScDocument& rDoc = pDocSh->GetDocument();
+            const ScPatternAttr* pMarkPattern = rDoc.GetPattern(aRange.aStart);
+            if (aRange.aStart == aRange.aEnd
+                || (pMarkPattern
+                    && pMarkPattern->GetItemSet().GetItemState(ATTR_MERGE, 
false)
+                           == SfxItemState::SET))
                 pObj = new ScCellObj( pDocSh, aRange.aStart );
             else
                 pObj = new ScCellRangeObj( pDocSh, aRange );
commit 3e4d1d5590811dae6e0d49b6f9a779335969adf5
Author:     Xisco Fauli <[email protected]>
AuthorDate: Fri Jan 13 11:42:38 2023 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 16 22:01:20 2023 +0100

    comphelper: check for nullptr
    
    See 
https://crashreport.libreoffice.org/stats/signature/comphelper::OSelectionChangeMultiplexer::dispose()
    
    Regression from 9931d6b1fb0406e16d56e186812884511738dcfa
    "tdf#150575: REPORTBUILDER: Crash when closing report when used report
    navigator"
    
    Change-Id: I6e4ada368254879d983f80026e9b42ddb4186c51
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145461
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>
    (cherry picked from commit e4e2c7a63217c797802045d326f732296e0af918)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145443
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/comphelper/source/misc/SelectionMultiplex.cxx 
b/comphelper/source/misc/SelectionMultiplex.cxx
index e4fb824a0ba3..438eaa80d718 100644
--- a/comphelper/source/misc/SelectionMultiplex.cxx
+++ b/comphelper/source/misc/SelectionMultiplex.cxx
@@ -100,7 +100,8 @@ void OSelectionChangeMultiplexer::dispose()
     osl_atomic_increment(&m_refCount);
     {
         Reference< XSelectionChangeListener> xPreventDelete(this);
-        m_xSet->removeSelectionChangeListener(xPreventDelete);
+        if(m_xSet.is())
+            m_xSet->removeSelectionChangeListener(xPreventDelete);
     }
     osl_atomic_decrement(&m_refCount);
 }
commit 5d78ccde7d1621bfdbac48b81afb13f7707f922f
Author:     Julien Nabet <[email protected]>
AuthorDate: Fri Jan 13 22:05:35 2023 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 16 22:01:20 2023 +0100

    Related tdf#153003: Copying a query and pasting as table in same DB 
impossible
    
    It might be a regression from ca82061c2cad00aeddb17b766063776fee0ee41a
    "make ValueTransfer easier to understand
    
    storing references to local variables makes it harder to figure out what
    the control flow is doing.
    "
    in peculiar:
    -            sal_Int32 nDestColumn( 0 );
    -            sal_Int32 nSourceColumn( 1 );
    -            ValueTransfer aTransfer( nSourceColumn, nDestColumn, 
std::vector(aSourceColTypes), xRow, xStatementParams );
    +            sal_Int32 nSourceColumn( 0 );
    +            ValueTransfer aTransfer( aSourceColTypes, xRow, 
xStatementParams );
    
    Change-Id: Iaa27c4f46fcc51ec12fff08f8e99f862c8b4ac2b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145499
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <[email protected]>
    (cherry picked from commit c9b0eacae71f111209cb77f14f2693d73e5e8d90)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145440
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx 
b/dbaccess/source/ui/uno/copytablewizard.cxx
index fab5e3966cbd..c886995398a7 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -1141,7 +1141,7 @@ void CopyTableWizard::impl_copyRows_throw( const 
Reference< XResultSet >& _rxSou
             // notify listeners
             m_aCopyTableListeners.notifyEach( &XCopyTableListener::copyingRow, 
aCopyEvent );
 
-            sal_Int32 nSourceColumn( 0 );
+            sal_Int32 nSourceColumn( 1 );
             ValueTransfer aTransfer( aSourceColTypes, xRow, xStatementParams );
 
             for ( auto const& rColumnPos : aColumnPositions )
commit 8f176370720a5f57b332dbac024b2521b258942b
Author:     Caolán McNamara <[email protected]>
AuthorDate: Thu Jan 12 16:36:56 2023 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 16 22:01:20 2023 +0100

    tdf#152994 only query dark mode in Windows >= 10.0.18362
    
    Change-Id: I8d8bd368d9d1ee38dac96dd369484ec74ce4835a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145414
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145498
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h
index bbf3506a723f..dedac6906467 100644
--- a/vcl/inc/win/salframe.h
+++ b/vcl/inc/win/salframe.h
@@ -148,6 +148,7 @@ public:
 void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect );
 
 bool UseDarkMode();
+bool OSSupportsDarkMode();
 
 // get foreign key names
 namespace vcl_sal {
diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h
index 35f2365fb166..7af6e007b562 100644
--- a/vcl/inc/win/salinst.h
+++ b/vcl/inc/win/salinst.h
@@ -85,7 +85,6 @@ public:
 SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, HWND hWndParent, 
SalFrameStyleFlags nSalFrameStyle );
 SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent );
 HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, bool bAsChild );
-bool OSSupportsDarkMode();
 
 #endif // INCLUDED_VCL_INC_WIN_SALINST_H
 
diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx 
b/vcl/win/gdi/salnativewidgets-luna.cxx
index e3811020a42e..1c177a1b2a97 100644
--- a/vcl/win/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/gdi/salnativewidgets-luna.cxx
@@ -398,6 +398,10 @@ static bool implDrawNativeMenuMark(HDC hDC, HTHEME hTheme, 
RECT rc, ControlPart
 
 bool UseDarkMode()
 {
+    static bool bOSSupportsDarkMode = OSSupportsDarkMode();
+    if (!bOSSupportsDarkMode)
+        return false;
+
     HINSTANCE hUxthemeLib = LoadLibraryExW(L"uxtheme.dll", nullptr, 
LOAD_LIBRARY_SEARCH_SYSTEM32);
     if (!hUxthemeLib)
         return false;
commit c041c1fc7b02afa843412d930cdb466053d05d87
Author:     Winfried Donkers <[email protected]>
AuthorDate: Sat Dec 31 15:54:57 2022 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 16 22:01:20 2023 +0100

    tdf#152774 Fix incorrect result with MATCH, HLOOKUP and VLOOKUP.
    
     This is a combination of 2 commits.
    
    tdf#152774 Fix incorrect result with MATCH.
    
    Use case now complies with ODF 6.9.14 (MATCH).
    Added use case to unit test.
    
    xChange-Id: I749a979135fbc01a3bb1583092fb6d6a100e2d2d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144883
    Tested-by: Jenkins
    Reviewed-by: Eike Rathke <[email protected]>
    (cherry picked from commit 0ce4c1e6898ba83d487f1b225dc9ee0bbc00d9fc)
    
    tdf#152774 Fix incorrect result with HLOOKUP and VLOOKUP.
    
    Use case now complies with ODF 6.9.5 (HLOOKUP) and 6.9.12 (VLOOKUP).
    Added use case to unit test.
    
    xChange-Id: I19df718b6446098f614136f462662c753a515036
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145514
    Reviewed-by: Eike Rathke <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit bf432958c1d6d204511a6bb32e2c06161d811676)
    
    Change-Id: I749a979135fbc01a3bb1583092fb6d6a100e2d2d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145529
    Reviewed-by: Eike Rathke <[email protected]>
    Tested-by: Jenkins

diff --git a/sc/qa/unit/data/functions/spreadsheet/fods/hlookup.fods 
b/sc/qa/unit/data/functions/spreadsheet/fods/hlookup.fods
index e3b38cf6c85b..8e14a315ac2a 100644
--- a/sc/qa/unit/data/functions/spreadsheet/fods/hlookup.fods
+++ b/sc/qa/unit/data/functions/spreadsheet/fods/hlookup.fods
@@ -1304,10 +1304,41 @@
      <table:table-cell table:style-name="ce15" 
table:number-columns-repeated="5"/>
      <table:table-cell table:number-columns-repeated="18"/>
     </table:table-row>
-    <table:table-row table:style-name="ro2" table:number-rows-repeated="2">
-     <table:table-cell table:number-columns-repeated="2"/>
-     <table:table-cell table:style-name="ce12"/>
-     <table:table-cell table:number-columns-repeated="29"/>
+    <table:table-row table:style-name="ro5">
+     <table:table-cell 
table:formula="of:=HLOOKUP(&quot;a&quot;;{1|3|&quot;b&quot;|&quot;d&quot;};1;1)"
 office:value-type="string" office:string-value="" calcext:value-type="error">
+      <text:p>#N/A</text:p>
+     </table:table-cell>
+     <table:table-cell table:formula="of:#N/A" office:value-type="string" 
office:string-value="" calcext:value-type="error">
+      <text:p>#N/A</text:p>
+     </table:table-cell>
+     <table:table-cell table:style-name="ce25" 
table:formula="of:=ISERROR([.A39])" office:value-type="boolean" 
office:boolean-value="true" calcext:value-type="boolean">
+      <text:p>TRUE</text:p>
+     </table:table-cell>
+     <table:table-cell table:formula="of:=FORMULA([.A39])" 
office:value-type="string" 
office:string-value="=HLOOKUP(&quot;a&quot;,{1;3;&quot;b&quot;;&quot;d&quot;},1,1)"
 calcext:value-type="string">
+      
<text:p>=HLOOKUP(&quot;a&quot;,{1;3;&quot;b&quot;;&quot;d&quot;},1,1)</text:p>
+     </table:table-cell>
+     <table:table-cell office:value-type="string" calcext:value-type="string">
+      <text:p>tdf152774</text:p>
+     </table:table-cell>
+     <table:table-cell table:number-columns-repeated="27"/>
+    </table:table-row>
+    <table:table-row table:style-name="ro5">
+     <table:table-cell 
table:formula="of:=HLOOKUP(&quot;a&quot;;{1|3|&quot;b&quot;|&quot;d&quot;};1;0)"
 office:value-type="string" office:string-value="" calcext:value-type="error">
+      <text:p>#N/A</text:p>
+     </table:table-cell>
+     <table:table-cell table:formula="of:#N/A" office:value-type="string" 
office:string-value="" calcext:value-type="error">
+      <text:p>#N/A</text:p>
+     </table:table-cell>
+     <table:table-cell table:style-name="ce25" 
table:formula="of:=ISERROR([.A40])" office:value-type="boolean" 
office:boolean-value="true" calcext:value-type="boolean">
+      <text:p>TRUE</text:p>
+     </table:table-cell>
+     <table:table-cell table:formula="of:=FORMULA([.A40])" 
office:value-type="string" 
office:string-value="=HLOOKUP(&quot;a&quot;,{1;3;&quot;b&quot;;&quot;d&quot;},1,0)"
 calcext:value-type="string">
+      
<text:p>=HLOOKUP(&quot;a&quot;,{1;3;&quot;b&quot;;&quot;d&quot;},1,0)</text:p>
+     </table:table-cell>
+     <table:table-cell office:value-type="string" calcext:value-type="string">
+      <text:p>tdf152774</text:p>
+     </table:table-cell>
+     <table:table-cell table:number-columns-repeated="27"/>
     </table:table-row>
     <table:table-row table:style-name="ro2">
      <table:table-cell table:number-columns-repeated="2"/>
@@ -1391,4 +1422,4 @@
    <table:named-expressions/>
   </office:spreadsheet>
  </office:body>
-</office:document>
\ No newline at end of file
+</office:document>
diff --git a/sc/qa/unit/data/functions/spreadsheet/fods/match.fods 
b/sc/qa/unit/data/functions/spreadsheet/fods/match.fods
index a050773c07e3..d5debd0d6339 100644
--- a/sc/qa/unit/data/functions/spreadsheet/fods/match.fods
+++ b/sc/qa/unit/data/functions/spreadsheet/fods/match.fods
@@ -5716,11 +5716,23 @@
      <table:table-cell table:style-name="ce33"/>
      <table:table-cell table:number-columns-repeated="16"/>
     </table:table-row>
-    <table:table-row table:style-name="ro6">
-     <table:table-cell table:style-name="ce13" 
table:number-columns-repeated="2"/>
-     <table:table-cell table:style-name="ce16"/>
-     <table:table-cell table:style-name="ce19"/>
-     <table:table-cell table:number-columns-repeated="3"/>
+    <table:table-row table:style-name="ro2">
+     <table:table-cell table:style-name="ce13" 
table:formula="of:=MATCH(&quot;a&quot;;{1;3;&quot;b&quot;;&quot;d&quot;};1)" 
office:value-type="string" office:string-value="" calcext:value-type="error">
+      <text:p>#N/A</text:p>
+     </table:table-cell>
+     <table:table-cell table:style-name="ce13" table:formula="of:#N/A" 
office:value-type="string" office:string-value="" calcext:value-type="error">
+      <text:p>#N/A</text:p>
+     </table:table-cell>
+     <table:table-cell table:style-name="ce48" 
table:formula="of:=ISERROR([.A118])" office:value-type="boolean" 
office:boolean-value="true" calcext:value-type="boolean">
+      <text:p>TRUE</text:p>
+     </table:table-cell>
+     <table:table-cell table:formula="of:=FORMULA([.A118])" 
office:value-type="string" 
office:string-value="=MATCH(&quot;a&quot;,{1,3,&quot;b&quot;,&quot;d&quot;},1)" 
calcext:value-type="string">
+      
<text:p>=MATCH(&quot;a&quot;,{1,3,&quot;b&quot;,&quot;d&quot;},1)</text:p>
+     </table:table-cell>
+     <table:table-cell office:value-type="string" calcext:value-type="string">
+      <text:p>Tdf#152774</text:p>
+     </table:table-cell>
+     <table:table-cell table:number-columns-repeated="2"/>
      <table:table-cell office:value-type="float" office:value="4" 
calcext:value-type="float">
       <text:p>4</text:p>
      </table:table-cell>
@@ -5731,11 +5743,23 @@
      <table:table-cell table:style-name="ce33"/>
      <table:table-cell table:number-columns-repeated="16"/>
     </table:table-row>
-    <table:table-row table:style-name="ro6">
-     <table:table-cell table:style-name="ce13" 
table:number-columns-repeated="2"/>
-     <table:table-cell table:style-name="ce16"/>
-     <table:table-cell table:style-name="ce19"/>
-     <table:table-cell table:number-columns-repeated="3"/>
+    <table:table-row table:style-name="ro2">
+     <table:table-cell table:style-name="ce13" 
table:formula="of:=MATCH(4;{&quot;d&quot;;&quot;b&quot;;3;1};-1)" 
office:value-type="string" office:string-value="" calcext:value-type="error">
+      <text:p>#N/A</text:p>
+     </table:table-cell>
+     <table:table-cell table:style-name="ce13" table:formula="of:#N/A" 
office:value-type="string" office:string-value="" calcext:value-type="error">
+      <text:p>#N/A</text:p>
+     </table:table-cell>
+     <table:table-cell table:style-name="ce49" 
table:formula="of:=ISERROR([.A119])" office:value-type="boolean" 
office:boolean-value="true" calcext:value-type="boolean">
+      <text:p>TRUE</text:p>
+     </table:table-cell>
+     <table:table-cell table:formula="of:=FORMULA([.A119])" 
office:value-type="string" 
office:string-value="=MATCH(4,{&quot;d&quot;,&quot;b&quot;,3,1},-1)" 
calcext:value-type="string">
+      <text:p>=MATCH(4,{&quot;d&quot;,&quot;b&quot;,3,1},-1)</text:p>
+     </table:table-cell>
+     <table:table-cell office:value-type="string" calcext:value-type="string">
+      <text:p>Tdf#152774</text:p>
+     </table:table-cell>
+     <table:table-cell table:number-columns-repeated="2"/>
      <table:table-cell office:value-type="float" office:value="3" 
calcext:value-type="float">
       <text:p>3</text:p>
      </table:table-cell>
@@ -6255,4 +6279,4 @@
    </table:named-expressions>
   </office:spreadsheet>
  </office:body>
-</office:document>
\ No newline at end of file
+</office:document>
diff --git a/sc/qa/unit/data/functions/spreadsheet/fods/vlookup.fods 
b/sc/qa/unit/data/functions/spreadsheet/fods/vlookup.fods
index 354aff0d763d..e0a0530a65e7 100644
--- a/sc/qa/unit/data/functions/spreadsheet/fods/vlookup.fods
+++ b/sc/qa/unit/data/functions/spreadsheet/fods/vlookup.fods
@@ -2559,8 +2559,67 @@
      </table:table-cell>
      <table:table-cell table:number-columns-repeated="36"/>
     </table:table-row>
-    <table:table-row table:style-name="ro2" 
table:number-rows-repeated="1048502">
-     <table:table-cell table:number-columns-repeated="34"/>
+    <table:table-row table:style-name="ro5">
+     <table:table-cell 
table:formula="of:=VLOOKUP(&quot;a&quot;;{1|3|&quot;b&quot;|&quot;d&quot;};1;1)"
 office:value-type="string" office:string-value="" calcext:value-type="error">
+      <text:p>#N/A</text:p>
+     </table:table-cell>
+     <table:table-cell table:formula="of:=#N/A" office:value-type="string" 
office:string-value="" calcext:value-type="error">
+      <text:p>#N/A</text:p>
+     </table:table-cell>
+     <table:table-cell table:style-name="ce27" 
table:formula="of:=ISERROR([.A74])" office:value-type="boolean" 
office:boolean-value="true" calcext:value-type="boolean">
+      <text:p>TRUE</text:p>
+     </table:table-cell>
+     <table:table-cell table:formula="of:=FORMULA([.A74])" 
office:value-type="string" 
office:string-value="=VLOOKUP(&quot;a&quot;,{1;3;&quot;b&quot;;&quot;d&quot;},1,1)"
 calcext:value-type="string">
+      
<text:p>=VLOOKUP(&quot;a&quot;,{1;3;&quot;b&quot;;&quot;d&quot;},1,1)</text:p>
+     </table:table-cell>
+     <table:table-cell office:value-type="string" calcext:value-type="string">
+      <text:p>tdf152774</text:p>
+     </table:table-cell>
+     <table:table-cell table:number-columns-repeated="35"/>
+    </table:table-row>
+    <table:table-row table:style-name="ro5">
+     <table:table-cell 
table:formula="of:=VLOOKUP(&quot;a&quot;;{1|3|&quot;b&quot;|&quot;d&quot;};1;0)"
 office:value-type="string" office:string-value="" calcext:value-type="error">
+      <text:p>#N/A</text:p>
+     </table:table-cell>
+     <table:table-cell table:formula="of:=#N/A" office:value-type="string" 
office:string-value="" calcext:value-type="error">
+      <text:p>#N/A</text:p>
+     </table:table-cell>
+     <table:table-cell table:style-name="ce27" 
table:formula="of:=ISERROR([.A75])" office:value-type="boolean" 
office:boolean-value="true" calcext:value-type="boolean">
+      <text:p>TRUE</text:p>
+     </table:table-cell>
+     <table:table-cell table:formula="of:=FORMULA([.A75])" 
office:value-type="string" 
office:string-value="=VLOOKUP(&quot;a&quot;,{1;3;&quot;b&quot;;&quot;d&quot;},1,0)"
 calcext:value-type="string">
+      
<text:p>=VLOOKUP(&quot;a&quot;,{1;3;&quot;b&quot;;&quot;d&quot;},1,0)</text:p>
+     </table:table-cell>
+     <table:table-cell office:value-type="string" calcext:value-type="string">
+      <text:p>tdf152774</text:p>
+     </table:table-cell>
+     <table:table-cell table:number-columns-repeated="35"/>
+    </table:table-row>
+    <table:table-row table:style-name="ro9">
+     <table:table-cell table:style-name="ce21" table:formula="of:=VLOOKUP(3; 
{1;&quot;a&quot;;&quot;d&quot;|2;&quot;b&quot;;&quot;e&quot;|3;&quot;c&quot;;&quot;f&quot;};
 2; 1)" office:value-type="string" office:string-value="c" 
calcext:value-type="string">
+      <text:p>c</text:p>
+     </table:table-cell>
+     <table:table-cell office:value-type="string" calcext:value-type="string">
+      <text:p>c</text:p>
+     </table:table-cell>
+     <table:table-cell table:style-name="ce27" 
table:formula="of:=[.A76]=[.B76]" office:value-type="boolean" 
office:boolean-value="true" calcext:value-type="boolean">
+      <text:p>TRUE</text:p>
+     </table:table-cell>
+     <table:table-cell table:formula="of:=FORMULA([.A76])" 
office:value-type="string" office:string-value="=VLOOKUP(3, 
{1,&quot;a&quot;,&quot;d&quot;;2,&quot;b&quot;,&quot;e&quot;;3,&quot;c&quot;,&quot;f&quot;},
 2, 1)" calcext:value-type="string">
+      <text:p>=VLOOKUP(3, 
{1,&quot;a&quot;,&quot;d&quot;;2,&quot;b&quot;,&quot;e&quot;;3,&quot;c&quot;,&quot;f&quot;},
 2, 1)</text:p>
+     </table:table-cell>
+     <table:table-cell office:value-type="string" calcext:value-type="string">
+      <text:p>tdf152774</text:p>
+     </table:table-cell>
+     <table:table-cell table:number-columns-repeated="35"/>
+    </table:table-row>
+    <table:table-row table:style-name="ro2" table:number-rows-repeated="24">
+     <table:table-cell table:number-columns-repeated="2"/>
+     <table:table-cell table:style-name="ce23"/>
+     <table:table-cell table:number-columns-repeated="37"/>
+    </table:table-row>
+    <table:table-row table:style-name="ro2" 
table:number-rows-repeated="1048475">
+     <table:table-cell table:number-columns-repeated="40"/>
     </table:table-row>
     <table:table-row table:style-name="ro2">
      <table:table-cell table:number-columns-repeated="34"/>
@@ -2592,4 +2651,4 @@
    </table:named-expressions>
   </office:spreadsheet>
  </office:body>
-</office:document>
\ No newline at end of file
+</office:document>
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 0785318da871..d82acb37494c 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -5052,7 +5052,11 @@ void ScInterpreter::ScMatch()
 
             if (nHitIndex > 0) // valid hit must be 2nd item or higher
             {
-                PushDouble( nHitIndex); // non-exact match
+                if ( ! ( rItem.meType == ScQueryEntry::ByString &&  
aMatAcc.IsValue( nHitIndex-1 ) ) &&
+                     ! ( rItem.meType == ScQueryEntry::ByValue  && 
!aMatAcc.IsValue( nHitIndex-1 ) ) )
+                    PushDouble( nHitIndex); // non-exact match
+                else
+                    PushNA();
                 return;
             }
 
@@ -5060,6 +5064,7 @@ void ScInterpreter::ScMatch()
             return;
         }
 
+        // The source data is cell range.
         SCCOLROW nDelta = 0;
         if (nCol1 == nCol2)
         {                                           // search row in column
@@ -7504,16 +7509,26 @@ void ScInterpreter::CalculateLookup(bool bHLookup)
         {
             SCSIZE nX = static_cast<SCSIZE>(nSpIndex);
             SCSIZE nY = nDelta;
+            SCSIZE nXs = 0;
+            SCSIZE nYs = nY;
             if ( bHLookup )
             {
                 nX = nDelta;
                 nY = static_cast<SCSIZE>(nZIndex);
+                nXs = nX;
+                nYs = 0;
             }
             assert( nX < nC && nY < nR );
-            if ( pMat->IsStringOrEmpty( nX, nY) )
-                PushString(pMat->GetString( nX,nY).getString());
+            if (!(rItem.meType == ScQueryEntry::ByString && pMat->IsValue( 
nXs, nYs)))
+            {
+                if (pMat->IsStringOrEmpty( nX, nY))
+                    PushString(pMat->GetString( nX, nY).getString());
+                else
+                    PushDouble(pMat->GetDouble( nX, nY));
+            }
             else
-                PushDouble(pMat->GetDouble( nX,nY));
+                PushNA();
+            return;
         }
         else
             PushNA();
commit 0b603c6163afd8117f3f9063a1a8231175f3f85c
Author:     Julien Nabet <[email protected]>
AuthorDate: Fri Jan 13 19:08:47 2023 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 16 22:01:20 2023 +0100

    tdf#153000: file types MSO_SPT=25 to 31 are wrongly rendered
    
    Description and analysis with MS ref + code pointer + solution here:
    https://bugs.documentfoundation.org/show_bug.cgi?id=153000#c0
    all this thanks to Regina.
    
    Change-Id: I63a66e075bc67e3c7d833756026933b3447d0cd8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145491
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <[email protected]>
    (cherry picked from commit 11319f419988443af85cf3c60dbed12d67fc183f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145449
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx 
b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx
index 0f999ed42209..c2ae1c20f268 100644
--- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx
@@ -8506,19 +8506,14 @@ const mso_CustomShape* GetCustomShapeContent( MSO_SPT 
eSpType )
         case mso_sptCurvedConnector5 :          pCustomShape = 
&msoCurvedConnector5; break;
 
         // Don't know, simply mapping to TextSimple
-        case mso_sptTextOnRing :
-        case mso_sptTextOnCurve :
-        case mso_sptTextRing :
-        case mso_sptTextWave :
-        case mso_sptTextCurve :
-        case mso_sptTextHexagon :
-        case mso_sptTextOctagon :
         case mso_sptTextBox :                   pCustomShape = &msoTextSimple; 
break;
 
         // FontWork
         case mso_sptTextSimple :
         case mso_sptTextPlainText :             pCustomShape = 
&msoTextPlainText; break;
+        case mso_sptTextOctagon :
         case mso_sptTextStop :                  pCustomShape = &msoTextStop; 
break;
+        case mso_sptTextHexagon :
         case mso_sptTextTriangle :              pCustomShape = 
&msoTextTriangle; break;
         case mso_sptTextTriangleInverted :      pCustomShape = 
&msoTextTriangleInverted; break;
         case mso_sptTextChevron :               pCustomShape = 
&msoTextChevron; break;
@@ -8533,10 +8528,12 @@ const mso_CustomShape* GetCustomShapeContent( MSO_SPT 
eSpType )
         case mso_sptTextSlantDown :             pCustomShape = 
&msoTextSlantDown; break;
         case mso_sptTextCascadeUp :             pCustomShape = 
&msoTextCascadeUp; break;
         case mso_sptTextCascadeDown :           pCustomShape = 
&msoTextCascadeDown; break;
+        case mso_sptTextOnRing :
         case mso_sptTextArchUpCurve :           pCustomShape = 
&msoTextArchUpCurve; break;
         case mso_sptTextArchDownCurve :         pCustomShape = 
&msoTextArchDownCurve; break;
         case mso_sptTextCircleCurve :           pCustomShape = 
&msoTextCircleCurve; break;
         case mso_sptTextButtonCurve :           pCustomShape = 
&msoTextButtonCurve; break;
+        case mso_sptTextRing :
         case mso_sptTextArchUpPour :            pCustomShape = 
&msoTextArchUpPour; break;
         case mso_sptTextArchDownPour :          pCustomShape = 
&msoTextArchDownPour; break;
         case mso_sptTextCirclePour :            pCustomShape = 
&msoTextCirclePour; break;
@@ -8544,6 +8541,8 @@ const mso_CustomShape* GetCustomShapeContent( MSO_SPT 
eSpType )
         case mso_sptTextCurveUp :               pCustomShape = 
&msoTextCurveUp; break;
         case mso_sptTextCurveDown :             pCustomShape = 
&msoTextCurveDown; break;
         case mso_sptTextCanUp :                 pCustomShape = &msoTextCanUp; 
break;
+        case mso_sptTextCurve :
+        case mso_sptTextOnCurve :
         case mso_sptTextCanDown :               pCustomShape = 
&msoTextCanDown; break;
         case mso_sptTextInflate :               pCustomShape = 
&msoTextInflate; break;
         case mso_sptTextDeflate :               pCustomShape = 
&msoTextDeflate; break;
@@ -8553,6 +8552,7 @@ const mso_CustomShape* GetCustomShapeContent( MSO_SPT 
eSpType )
         case mso_sptTextDeflateTop :            pCustomShape = 
&msoTextDeflateTop; break;
         case mso_sptTextDeflateInflate :        pCustomShape = 
&msoTextDeflateInflate; break;
         case mso_sptTextDeflateInflateDeflate : pCustomShape = 
&msoTextDeflateInflateDeflate; break;
+        case mso_sptTextWave :
         case mso_sptTextWave1 :                 pCustomShape = &msoTextWave1; 
break;
         case mso_sptTextWave2 :                 pCustomShape = &msoTextWave2; 
break;
         case mso_sptTextWave3 :                 pCustomShape = &msoTextWave3; 
break;
commit bc42fbc70836d2e744083af80c74962abf920c2e
Author:     Taichi Haradaguchi <[email protected]>
AuthorDate: Mon Jan 2 02:54:58 2023 +0900
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 16 22:01:19 2023 +0100

    external/python3: fix line offsets in internal-zlib.patch.0
    
    "@@ -11607,13 +11607,13 @@" -> "@@ -12333,13 +12333,13 @@"
    
    Change-Id: I03542ad3171814f6869bccab4dde77673eaa90f7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145446
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <[email protected]>

diff --git a/external/python3/internal-zlib.patch.0 
b/external/python3/internal-zlib.patch.0
index 27bb737db0c7..d4305c6df95d 100644
--- a/external/python3/internal-zlib.patch.0
+++ b/external/python3/internal-zlib.patch.0
@@ -1,6 +1,6 @@
 --- configure
 +++ configure
-@@ -11607,13 +11607,13 @@
+@@ -12333,13 +12333,13 @@
        ;;
  esac
  

Reply via email to