connectivity/source/manager/mdrivermanager.cxx           |    4 -
 download.lst                                             |    4 -
 hwpfilter/source/hstyle.cxx                              |    4 -
 sal/osl/unx/thread.cxx                                   |    2 
 sal/rtl/byteseq.cxx                                      |    7 ++
 sal/rtl/hash.cxx                                         |    2 
 sc/source/core/tool/compiler.cxx                         |    6 +-
 sw/qa/extras/uiwriter/uiwriter7.cxx                      |    4 -
 sw/qa/extras/unowriter/data/textboxInColumn2.fodt        |   39 +++++++++++++++
 sw/qa/extras/unowriter/unowriter.cxx                     |   19 +++++++
 sw/source/core/doc/textboxhelper.cxx                     |   36 +++++++++++--
 sw/source/uibase/inc/textsh.hxx                          |    2 
 sw/source/uibase/shells/textsh.cxx                       |   34 ++++++-------
 vcl/source/window/layout.cxx                             |   12 ++--
 writerfilter/source/dmapper/DomainMapperTableManager.cxx |    9 ++-
 15 files changed, 140 insertions(+), 44 deletions(-)

New commits:
commit ee7138afe13f0f3a53447605e3f019520507a284
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Wed Apr 3 23:58:18 2024 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Aug 28 16:12:17 2024 +0200

    A number of bogus GCC 13 warnings still hit with recent GCC 14 trunk
    
    Change-Id: I0ec7743cd79429591fcfc3eb9715ff36d06fc00b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165765
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>
    (cherry picked from commit 6b7245f51274424a6c634424161e8766f8827033)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172464
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/connectivity/source/manager/mdrivermanager.cxx 
b/connectivity/source/manager/mdrivermanager.cxx
index ee80460621f5..d301b2c4841b 100644
--- a/connectivity/source/manager/mdrivermanager.cxx
+++ b/connectivity/source/manager/mdrivermanager.cxx
@@ -601,12 +601,12 @@ Reference< XDriver > 
OSDBCDriverManager::implGetDriverForURL(const OUString& _rU
                 m_aDriversBS.end(),         // end of search range
                 [&_rURL, this] (const DriverAccessArray::value_type& 
driverAccess) {
                     // extract the driver from the access, then ask the 
resulting driver for acceptance
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdangling-reference"
 #endif
                     const DriverAccess& ensuredAccess = 
EnsureDriver(m_xContext)(driverAccess);
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic pop
 #endif
                     const Reference<XDriver> driver = 
ExtractDriverFromAccess()(ensuredAccess);
diff --git a/hwpfilter/source/hstyle.cxx b/hwpfilter/source/hstyle.cxx
index 013f755496a5..9a0040edcf08 100644
--- a/hwpfilter/source/hstyle.cxx
+++ b/hwpfilter/source/hstyle.cxx
@@ -68,14 +68,14 @@ void HWPStyle::SetName(int n, char const* name)
 
     if (name)
     {
-#if defined __GNUC__ && (__GNUC__ >= 8 && __GNUC__ <= 13) && !defined __clang__
+#if defined __GNUC__ && (__GNUC__ >= 8 && __GNUC__ <= 14) && !defined __clang__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wstringop-truncation"
 #endif
         auto const p = style[n].name;
         strncpy(p, name, MAXSTYLENAME);
         p[MAXSTYLENAME] = '
-#if defined __GNUC__ && (__GNUC__ >= 8 && __GNUC__ <= 13) && !defined __clang__
+#if defined __GNUC__ && (__GNUC__ >= 8 && __GNUC__ <= 14) && !defined __clang__
 #pragma GCC diagnostic pop
 #endif
     }
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 5639d8e62d57..ec4331528f9a 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -954,12 +954,12 @@ array_type assembleGrid(const VclGrid &rGrid)
     {
         for (sal_Int32 y = 0; y < nMaxY; ++y)
         {
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdangling-reference"
 #endif
             const GridEntry &rEntry = A[x][y];
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic pop
 #endif
             const vcl::Window *pChild = rEntry.pChild;
@@ -1084,12 +1084,12 @@ static void calcMaxs(const array_type &A, 
std::vector<VclGrid::Value> &rWidths,
     {
         for (sal_Int32 y = 0; y < nMaxY; ++y)
         {
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdangling-reference"
 #endif
             const GridEntry &rEntry = A[x][y];
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic pop
 #endif
             const vcl::Window *pChild = rEntry.pChild;
@@ -1122,12 +1122,12 @@ static void calcMaxs(const array_type &A, 
std::vector<VclGrid::Value> &rWidths,
     {
         for (sal_Int32 y = 0; y < nMaxY; ++y)
         {
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdangling-reference"
 #endif
             const GridEntry &rEntry = A[x][y];
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 13
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 13 && __GNUC__ <= 14
 #pragma GCC diagnostic pop
 #endif
             const vcl::Window *pChild = rEntry.pChild;
commit 82e2031cfca575025baee113d4a3af4252850e84
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Sun Dec 24 13:12:52 2023 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Aug 28 16:12:17 2024 +0200

    -Werror=calloc-transposed-args
    
    Change-Id: I7b8b020bdbcd5b4db4cb478cc5fe1225f19ae0cf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161268
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>
    (cherry picked from commit 4663c56edf788a37545f253e028db99e480feb34)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172463
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sal/osl/unx/thread.cxx b/sal/osl/unx/thread.cxx
index b17f363511c6..3d51f4ab2a33 100644
--- a/sal/osl/unx/thread.cxx
+++ b/sal/osl/unx/thread.cxx
@@ -624,7 +624,7 @@ static oslThreadIdentifier insertThreadId (pthread_t 
hThread)
 
     if (pEntry == nullptr)
     {
-        pEntry = static_cast<HashEntry*>(calloc(sizeof(HashEntry), 1));
+        pEntry = static_cast<HashEntry*>(calloc(1, sizeof(HashEntry)));
 
         pEntry->Handle = hThread;
 
diff --git a/sal/rtl/hash.cxx b/sal/rtl/hash.cxx
index 7cfc443cb972..4e255d965e17 100644
--- a/sal/rtl/hash.cxx
+++ b/sal/rtl/hash.cxx
@@ -79,7 +79,7 @@ static StringHashTable * rtl_str_hash_new(sal_uInt32 nSize)
 
     pHash->nEntries = 0;
     pHash->nSize = getNextSize (nSize);
-    pHash->pData = static_cast< rtl_uString ** >(calloc(sizeof(rtl_uString *), 
pHash->nSize));
+    pHash->pData = static_cast< rtl_uString ** >(calloc(pHash->nSize, 
sizeof(rtl_uString *)));
 
     return pHash;
 }
commit 6ceabeaf43a1a149bd85ecaaef729c037f0005fc
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Sun Dec 24 13:14:53 2023 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Aug 28 16:12:17 2024 +0200

    Silence new GCC 14 trunk -Werror=alloc-size
    
    > sal/rtl/byteseq.cxx: In function ‘void 
rtl_byte_sequence_reference2One(sal_Sequence**)’:
    > sal/rtl/byteseq.cxx:63:20: error: allocation of insufficient size ‘8’ for 
type ‘sal_Sequence’ {aka ‘_sal_Sequence’} with size ‘12’ [-Werror=alloc-size]
    >    63 |             pNew = static_cast<sal_Sequence *>(malloc( 
SAL_SEQUENCE_HEADER_SIZE ));
    >       |                    
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Change-Id: I9d4081ed2938fffdf282c852250a3eed5f0d9e25
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161269
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>
    (cherry picked from commit 5e3af4aec40531b490950da5ed49342a01c1477b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172462
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sal/rtl/byteseq.cxx b/sal/rtl/byteseq.cxx
index 3c4967d5456d..0084f3969812 100644
--- a/sal/rtl/byteseq.cxx
+++ b/sal/rtl/byteseq.cxx
@@ -60,7 +60,14 @@ void SAL_CALL rtl_byte_sequence_reference2One(
         }
         else
         {
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 14
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Walloc-size"
+#endif
             pNew = static_cast<sal_Sequence *>(malloc( 
SAL_SEQUENCE_HEADER_SIZE ));
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ >= 14
+#pragma GCC diagnostic pop
+#endif
         }
 
         if ( pNew != nullptr )
commit 1bf32a4ba186fd022ade3b3c365e42d5537daf91
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sat Aug 24 10:40:34 2024 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Aug 28 16:12:17 2024 +0200

    cid#1616924 Dereference after null check
    
    Change-Id: Ia326d99b11d18f7c561c988f0299feb2ebf84b6c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172346
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    (cherry picked from commit cb115be987c4aa3dc2daed02dcd1b419e8d6a61e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172281
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172461

diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx 
b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 2bbdfe86540e..20a8a6833e3f 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -240,9 +240,12 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
             break;
             case NS_ooxml::LN_CT_TblPrBase_tblStyle: //table style name
             {
-                TablePropertyMapPtr pPropMap( new TablePropertyMap );
-                pPropMap->Insert( META_PROP_TABLE_STYLE_NAME, uno::Any( 
pValue->getString() ));
-                insertTableProps(pPropMap);
+                if (pValue)
+                {
+                    TablePropertyMapPtr pPropMap( new TablePropertyMap );
+                    pPropMap->Insert( META_PROP_TABLE_STYLE_NAME, uno::Any( 
pValue->getString() ));
+                    insertTableProps(pPropMap);
+                }
             }
             break;
             case NS_ooxml::LN_CT_TblGridBase_gridCol:
commit 927de2758b3cbcf0e454a326666dd560cecd07a5
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Thu Aug 15 14:53:27 2024 +0500
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Aug 28 16:12:17 2024 +0200

    tdf#162480: Make sure to use correct anchor point for text box creation
    
    In the ODF import, when importing a table, initially a placeholder 1x1
    table is created. When this is done from SwView::InsertMedium, frames
    are created for the table and its single cell at that stage. Then the
    actual table nodes are created, but frames are not created in parallel,
    until the table import is finished.
    
    Importing a text box, it used to be created anchored at the end of the
    document, and then the anchor was moved to the correct place.
    
    When a text box was anchored to a cell, the process was like this: the
    text content was inserted in the last paragraph outside of the current
    table;  and then it was moved to the current cell.  When this was done
    from  SwView::InsertMedium,  creation of the text content also created
    the frame; then the movement fired client notifications, including the
    SwFlyAtContentFrame::SwClientNotify,  which needs the new anchor frame.
    With cell other than A1, there was no frames for the new anchor in the
    table, and that crashed.
    
    This change inserts the text content into the correct place from start,
    which avoids the need to move the anchor later.
    
    Co-authored-by: Miklos Vajna <vmik...@collabora.com>
    Change-Id: I9dd3a2c5527f3c2dd860244456c617558943453a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171898
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172058
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172101

diff --git a/sw/qa/extras/unowriter/data/textboxInColumn2.fodt 
b/sw/qa/extras/unowriter/data/textboxInColumn2.fodt
new file mode 100644
index 000000000000..cdd9ba9999ab
--- /dev/null
+++ b/sw/qa/extras/unowriter/data/textboxInColumn2.fodt
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:styles>
+  <style:style style:name="Frame" style:family="graphic">
+   <style:graphic-properties style:wrap="parallel" 
style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" 
fo:padding="1.5mm" draw:stroke="solid" svg:stroke-color="#000000" 
draw:fill="none" draw:textarea-vertical-align="top" 
draw:auto-grow-height="true" fo:min-height="0mm" fo:min-width="0mm" 
fo:wrap-option="wrap" style:run-through="foreground" 
style:vertical-pos="from-top" style:vertical-rel="paragraph" 
style:flow-with-text="true"/>
+  </style:style>
+ </office:styles>
+ <office:automatic-styles>
+  <style:style style:name="gr1" style:family="graphic" 
style:parent-style-name="Frame">
+   <style:graphic-properties draw:stroke="solid" svg:stroke-color="#000000" 
draw:fill="none" draw:textarea-vertical-align="top" 
draw:auto-grow-height="true" fo:min-height="0mm" fo:min-width="0mm" 
fo:wrap-option="wrap" style:run-through="foreground" 
style:vertical-pos="from-top" style:vertical-rel="paragraph" 
style:flow-with-text="true"/>
+  </style:style>
+ </office:automatic-styles>
+ <office:body>
+  <office:text>
+   <table:table>
+    <table:table-column table:number-columns-repeated="2"/>
+    <table:table-row>
+     <table:table-cell/>
+     <table:table-cell>
+      <text:p/>
+      <text:p><draw:custom-shape text:anchor-type="char" draw:z-index="0" 
draw:name="Text Box 1" draw:style-name="gr1" svg:width="30mm" svg:x="6mm" 
svg:y="5mm">
+        <text:p>hello</text:p>
+        <draw:enhanced-geometry draw:mirror-horizontal="false" 
draw:mirror-vertical="false" svg:viewBox="0 0 0 0" draw:text-areas="0 0 ?f3 
?f2" draw:type="ooxml-rect" draw:enhanced-path="M 0 0 L ?f3 0 ?f3 ?f2 0 ?f2 Z 
N">
+         <draw:equation draw:name="f0" draw:formula="logwidth/2"/>
+         <draw:equation draw:name="f1" draw:formula="logheight/2"/>
+         <draw:equation draw:name="f2" draw:formula="logheight"/>
+         <draw:equation draw:name="f3" draw:formula="logwidth"/>
+        </draw:enhanced-geometry>
+       </draw:custom-shape></text:p>
+      <text:p/>
+      <text:p/>
+     </table:table-cell>
+    </table:table-row>
+   </table:table>
+   <text:p/>
+  </office:text>
+ </office:body>
+</office:document>
\ No newline at end of file
diff --git a/sw/qa/extras/unowriter/unowriter.cxx 
b/sw/qa/extras/unowriter/unowriter.cxx
index 7175e702d709..a2c03bbaaf02 100644
--- a/sw/qa/extras/unowriter/unowriter.cxx
+++ b/sw/qa/extras/unowriter/unowriter.cxx
@@ -36,6 +36,7 @@
 #include <com/sun/star/text/XTextTable.hpp>
 #include <com/sun/star/text/XPageCursor.hpp>
 
+#include <comphelper/propertysequence.hxx>
 #include <comphelper/propertyvalue.hxx>
 #include <tools/UnitConversion.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
@@ -1249,6 +1250,24 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testTdf161035)
     CPPUNIT_ASSERT(!xRunEnum->hasMoreElements()); // Empty enumeration for 
empty selection
 }
 
+CPPUNIT_TEST_FIXTURE(SwUnoWriter, testTdf162480)
+{
+    createSwDoc();
+
+    uno::Sequence<beans::PropertyValue> aPropertyValues = 
comphelper::InitPropertySequence({
+        { "Name", uno::Any(createFileURL(u"textboxInColumn2.fodt")) },
+    });
+
+    // Inserting a document with text box attached in a table's second column 
must not crash
+    dispatchCommand(mxComponent, u".uno:InsertDoc"_ustr, aPropertyValues);
+
+    auto xTextBox = getShape(1).queryThrow<css::text::XTextContent>();
+    auto xTable = getParagraphOrTable(2).queryThrow<css::text::XTextTable>();
+    auto xAnchorRange = xTextBox->getAnchor();
+    auto xCellText = 
xTable->getCellByName("B1").queryThrow<css::text::XText>();
+    CPPUNIT_ASSERT_EQUAL(xCellText, xAnchorRange->getText());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/textboxhelper.cxx 
b/sw/source/core/doc/textboxhelper.cxx
index 74de839f22bf..538a1ba96a24 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -8,6 +8,7 @@
  */
 
 #include <textboxhelper.hxx>
+#include <dcontact.hxx>
 #include <fmtcntnt.hxx>
 #include <fmtanchr.hxx>
 #include <fmtcnct.hxx>
@@ -64,6 +65,7 @@ void SwTextBoxHelper::create(SwFrameFormat* pShape, 
SdrObject* pObject, bool bCo
 {
     assert(pShape);
     assert(pObject);
+    assert(pShape == ::FindFrameFormat(pObject));
 
     // If TextBox wasn't enabled previously
     if (pShape->GetOtherTextBoxFormats() && 
pShape->GetOtherTextBoxFormats()->GetTextBox(pObject))
@@ -88,11 +90,35 @@ void SwTextBoxHelper::create(SwFrameFormat* pShape, 
SdrObject* pObject, bool bCo
     uno::Reference<text::XTextContent> xTextFrame(
         SwXServiceProvider::MakeInstance(SwServiceType::TypeTextFrame, 
*pShape->GetDoc()),
         uno::UNO_QUERY);
-    uno::Reference<text::XTextDocument> xTextDocument(
-        pShape->GetDoc()->GetDocShell()->GetBaseModel(), uno::UNO_QUERY);
-    uno::Reference<text::XTextContentAppend> 
xTextContentAppend(xTextDocument->getText(),
-                                                                
uno::UNO_QUERY);
-    xTextContentAppend->appendTextContent(xTextFrame, 
uno::Sequence<beans::PropertyValue>());
+
+    uno::Reference<text::XTextRange> xAnchor;
+    uno::Reference<text::XTextContent> 
xAnchorProvider(pObject->getWeakUnoShape().get(),
+                                                       uno::UNO_QUERY);
+    assert(xAnchorProvider.is());
+    if (xAnchorProvider.is())
+        xAnchor = xAnchorProvider->getAnchor();
+
+    uno::Reference<text::XTextContentAppend> xTextContentAppend;
+    if (xAnchor)
+        xTextContentAppend.set(xAnchor->getText(), uno::UNO_QUERY);
+
+    if (!xTextContentAppend)
+    {
+        uno::Reference<text::XTextDocument> xTextDocument(
+            pShape->GetDoc()->GetDocShell()->GetBaseModel(), 
uno::UNO_QUERY_THROW);
+        xTextContentAppend.set(xTextDocument->getText(), uno::UNO_QUERY_THROW);
+    }
+
+    if (xAnchor)
+    {
+        // insertTextContentWithProperties would fail if xAnchor is in a 
different XText
+        assert(xAnchor->getText() == xTextContentAppend);
+        xTextContentAppend->insertTextContentWithProperties(xTextFrame, {}, 
xAnchor);
+    }
+    else
+    {
+        xTextContentAppend->appendTextContent(xTextFrame, 
uno::Sequence<beans::PropertyValue>());
+    }
 
     // Link FLY and DRAW formats, so it becomes a text box (needed for 
syncProperty calls).
     uno::Reference<text::XTextFrame> xRealTextFrame(xTextFrame, 
uno::UNO_QUERY);
commit edf1a745b988112b3344fd6ad0f9f87844743cf1
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Thu Jul 25 13:05:30 2024 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Aug 28 16:12:17 2024 +0200

    Resolves: tdf#162093 TableRef item specifier may occur standalone
    
     This is a combination of 2 commits.
    
    Resolves: tdf#162093 TableRef item specifier may occur standalone
    
    This is what
    
https://learn.microsoft.com/en-us/openspecs/office_standards/ms-xlsx/3d025add-118d-4413-9856-ab65712ec1b0
    specifies as  keyword  in
    
     intra-table-reference = spaced-lbracket inner-reference spaced-rbracket / 
keyword / ("[" [simple-column-name] "]")
    
    with
    
     keyword = "[#All]" / "[#Data]" / "[#Headers]" / "[#Totals]" / "[#This Row]"
    
    xChange-Id: I52b200aad41d53a49e662d6238576f6f4f0deb37
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170986
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit f1f5e9c8d7be16a969e58ebf7cfae99eef5bcb6e)
    
    Related: tdf#162093 TableRef item specifier may occur standalone
    
    also in lexical canner.
    
    xChange-Id: Ic265bbd8a0d9baa81039b8d1748c63ad6686bfc2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170989
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 4aa2d5ede17ddf7345804deb200983367990a7e2)
    
    Change-Id: I52b200aad41d53a49e662d6238576f6f4f0deb37
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170953
    Tested-by: Jenkins
    Reviewed-by: Eike Rathke <er...@redhat.com>
    (cherry picked from commit 25a42da1f94cfd0555fc83126888eb605a9014f2)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171026
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 451956922c29..7cb696b7d8f1 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2318,7 +2318,8 @@ Label_MaskStateMachine:
                 else if( nMask & ScCharFlags::CharErrConst )
                 {
                     *pSym++ = c;
-                    if (!maTableRefs.empty() && maTableRefs.back().mnLevel == 
2)
+                    sal_uInt16 nLevel;
+                    if (!maTableRefs.empty() && ((nLevel = 
maTableRefs.back().mnLevel) == 2 || nLevel == 1))
                         eState = ssGetTableRefItem;
                     else
                         eState = ssGetErrorConstant;
@@ -4518,7 +4519,8 @@ Label_Rewind:
             if (cSymbol[0] == '#')
             {
                 // Check for TableRef item specifiers first.
-                if (!maTableRefs.empty() && maTableRefs.back().mnLevel == 2)
+                sal_uInt16 nLevel;
+                if (!maTableRefs.empty() && ((nLevel = 
maTableRefs.back().mnLevel) == 2 || nLevel == 1))
                 {
                     if (ParseTableRefItem( aUpper ))
                         return true;
commit 1a624e151ffeed65ca6dd4e2e2be2cefc10aa665
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Aug 26 17:35:08 2024 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Aug 28 16:12:17 2024 +0200

    cid#1557116 dangling reference
    
    CreateFrameTabDialog takes an argument of a reference
    to the aSet ItemSet and SwFrameDlg keeps that reference
    but the SwFrameDlg will outlive that local.
    
    Change-Id: I9a0c55b86baf84cfa586952755e5a470a44562c7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172435
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Tested-by: Jenkins

diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx 
b/sw/qa/extras/uiwriter/uiwriter7.cxx
index 844e9ff06c42..13ee93322dd9 100644
--- a/sw/qa/extras/uiwriter/uiwriter7.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter7.cxx
@@ -2431,10 +2431,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf88986)
     // Create the item set that is normally passed to the insert frame dialog.
     SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
     SwFlyFrameAttrMgr aMgr(true, pWrtShell, Frmmgr_Type::TEXT, nullptr);
-    SfxItemSet aSet = aShell.CreateInsertFrameItemSet(aMgr);
+    auto xSet = aShell.CreateInsertFrameItemSet(aMgr);
 
     // This was missing along with the gradient and other tables.
-    CPPUNIT_ASSERT(aSet.HasItem(SID_COLOR_TABLE));
+    CPPUNIT_ASSERT(xSet->HasItem(SID_COLOR_TABLE));
 }
 
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf78150)
diff --git a/sw/source/uibase/inc/textsh.hxx b/sw/source/uibase/inc/textsh.hxx
index f965370e08c6..5bafaa2ea16b 100644
--- a/sw/source/uibase/inc/textsh.hxx
+++ b/sw/source/uibase/inc/textsh.hxx
@@ -83,7 +83,7 @@ public:
              SwTextShell(SwView &rView);
     virtual ~SwTextShell() override;
     /// Create item set for the insert frame dialog.
-    SfxItemSet CreateInsertFrameItemSet(SwFlyFrameAttrMgr& rMgr);
+    std::shared_ptr<SfxItemSet> CreateInsertFrameItemSet(SwFlyFrameAttrMgr& 
rMgr);
 };
 
 #endif
diff --git a/sw/source/uibase/shells/textsh.cxx 
b/sw/source/uibase/shells/textsh.cxx
index 38a39151b8c8..51e17e41fa4b 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -522,7 +522,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
         }
         else
         {
-            SfxItemSet aSet = CreateInsertFrameItemSet(aMgr);
+            auto xSet = CreateInsertFrameItemSet(aMgr);
 
             FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebDocShell*>( 
GetView().GetDocShell()) != nullptr );
             SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< 
sal_uInt16 >(eMetric)));
@@ -530,8 +530,8 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
             VclPtr<SfxAbstractTabDialog> 
pDlg(pFact->CreateFrameTabDialog("FrameDialog",
                                                   GetView().GetViewFrame(),
                                                   GetView().GetFrameWeld(),
-                                                  aSet));
-            pDlg->StartExecuteAsync([aSet, pDlg, nSlot, this](sal_Int32 
nResult) {
+                                                  *xSet));
+            pDlg->StartExecuteAsync([xSet=std::move(xSet), pDlg, nSlot, 
this](sal_Int32 nResult) {
                 if (nResult == RET_OK && pDlg->GetOutputItemSet())
                 {
                     SwFlyFrameAttrMgr aAttrMgr( true, GetShellPtr(), 
Frmmgr_Type::TEXT, nullptr );
@@ -542,7 +542,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
                     rShell.StartUndo(SwUndoId::INSERT);
 
                     SfxItemSet aOutSet(*pDlg->GetOutputItemSet());
-                    const SvxBoxItem* pBox = aSet.GetItem(RES_BOX);
+                    const SvxBoxItem* pBox = xSet->GetItem(RES_BOX);
                     if (pBox && !aOutSet.HasItem(RES_BOX))
                     {
                         // The input set had border info but the output set 
not, then copy it over
@@ -907,9 +907,9 @@ SwTextShell::~SwTextShell()
 {
 }
 
-SfxItemSet SwTextShell::CreateInsertFrameItemSet(SwFlyFrameAttrMgr& rMgr)
+std::shared_ptr<SfxItemSet> 
SwTextShell::CreateInsertFrameItemSet(SwFlyFrameAttrMgr& rMgr)
 {
-    SfxItemSet aSet(GetPool(), svl::Items<
+    auto xSet = std::make_shared<SfxItemSet>(GetPool(), svl::Items<
         RES_FRMATR_BEGIN,       RES_FRMATR_END-1,
         XATTR_FILL_FIRST,       XATTR_FILL_LAST, // tdf#95003
         SID_ATTR_BORDER_INNER,  SID_ATTR_BORDER_INNER,
@@ -918,38 +918,38 @@ SfxItemSet 
SwTextShell::CreateInsertFrameItemSet(SwFlyFrameAttrMgr& rMgr)
         SID_HTML_MODE,          SID_HTML_MODE,
         FN_GET_PRINT_AREA,      FN_GET_PRINT_AREA,
         FN_SET_FRM_NAME,        FN_SET_FRM_NAME>);
-    aSet.Put(SfxUInt16Item(SID_HTML_MODE, 
::GetHtmlMode(GetView().GetDocShell())));
+    xSet->Put(SfxUInt16Item(SID_HTML_MODE, 
::GetHtmlMode(GetView().GetDocShell())));
 
     // For the Area tab page.
-    
GetShell().GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->PutAreaListItems(aSet);
+    
GetShell().GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->PutAreaListItems(*xSet);
 
     const SwRect &rPg = GetShell().GetAnyCurRect(CurRectType::Page);
     SwFormatFrameSize aFrameSize(SwFrameSize::Variable, rPg.Width(), 
rPg.Height());
     aFrameSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE));
-    aSet.Put(aFrameSize);
+    xSet->Put(aFrameSize);
 
     const SwRect &rPr = GetShell().GetAnyCurRect(CurRectType::PagePrt);
     SwFormatFrameSize aPrtSize(SwFrameSize::Variable, rPr.Width(), 
rPr.Height());
     aPrtSize.SetWhich(GetPool().GetWhich(FN_GET_PRINT_AREA));
-    aSet.Put(aPrtSize);
+    xSet->Put(aPrtSize);
 
-    aSet.Put(rMgr.GetAttrSet());
-    aSet.SetParent( rMgr.GetAttrSet().GetParent() );
+    xSet->Put(rMgr.GetAttrSet());
+    xSet->SetParent( rMgr.GetAttrSet().GetParent() );
 
     // Delete minimum size in columns.
-    SvxBoxInfoItem aBoxInfo(aSet.Get(SID_ATTR_BORDER_INNER));
-    const SvxBoxItem& rBox = aSet.Get(RES_BOX);
+    SvxBoxInfoItem aBoxInfo(xSet->Get(SID_ATTR_BORDER_INNER));
+    const SvxBoxItem& rBox = xSet->Get(RES_BOX);
     aBoxInfo.SetMinDist(false);
     aBoxInfo.SetDefDist(rBox.GetDistance(SvxBoxItemLine::LEFT));
-    aSet.Put(aBoxInfo);
+    xSet->Put(aBoxInfo);
 
     if (!SwFlyFrameAttrMgr::SingleTableSelected(GetShell()))
     {
         SwFormatAnchor aAnchor(RndStdIds::FLY_AT_CHAR);
-        aSet.Put(aAnchor);
+        xSet->Put(aAnchor);
     }
 
-    return aSet;
+    return xSet;
 }
 
 void SwTextShell::InsertSymbol( SfxRequest& rReq )
commit 4a9874f44181b2108d5615f6e017e12962755675
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Mon Aug 19 13:57:47 2024 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Aug 28 16:12:17 2024 +0200

    postgresql: Upgrade to 13.16
    
    Downloaded from 
https://ftp.postgresql.org/pub/source/v13.16/postgresql-13.16.tar.bz2
    
    Change-Id: I2854bca1ba3ac0a9beda61718d3a2e2002a2815c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172035
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Tested-by: Jenkins
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172045
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/download.lst b/download.lst
index 167c115b1c63..fa9a7419cdf2 100644
--- a/download.lst
+++ b/download.lst
@@ -653,8 +653,8 @@ POPPLER_DATA_TARBALL := poppler-data-0.4.12.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-POSTGRESQL_SHA256SUM := 
b8df078551898960bd500dc5d38a177e9905376df81fe7f2b660a1407fa6a5ed
-POSTGRESQL_TARBALL := postgresql-13.14.tar.bz2
+POSTGRESQL_SHA256SUM := 
c9cbbb6129f02328204828066bb3785c00a85c8ca8fd329c2a8a53c1f5cd8865
+POSTGRESQL_TARBALL := postgresql-13.16.tar.bz2
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts

Reply via email to