configure.ac                                           |    2 
 connectivity/source/parse/sqliterator.cxx              |    4 
 connectivity/source/parse/sqlnode.cxx                  |    7 
 dbaccess/source/core/api/SingleSelectQueryComposer.cxx |    2 
 dbaccess/source/core/inc/SingleSelectQueryComposer.hxx |    1 
 include/connectivity/sqlparse.hxx                      |   10 -
 include/svx/ParseContext.hxx                           |   11 +
 sc/qa/unit/helper/qahelper.cxx                         |   38 ++++
 sc/source/core/data/dpoutput.cxx                       |    6 
 sc/source/filter/inc/rtfexp.hxx                        |    8 -
 sc/source/filter/rtf/rtfexp.cxx                        |  135 +++++++++++++----
 svx/source/form/ParseContext.cxx                       |   16 ++
 sw/qa/extras/uiwriter/data/tdf62032_apply_style.odt    |binary
 sw/qa/extras/uiwriter/uiwriter7.cxx                    |   20 ++
 sw/source/core/doc/docfmt.cxx                          |    5 
 ucb/source/ucp/webdav-curl/CurlSession.cxx             |   15 +
 vcl/source/gdi/embeddedfontshelper.cxx                 |   31 +++
 17 files changed, 265 insertions(+), 46 deletions(-)

New commits:
commit 9d4bf91ba30c991aaed3b97dd4173f7705c6b5ae
Author:     Andras Timar <andras.ti...@collabora.com>
AuthorDate: Sat Oct 7 22:39:13 2023 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sat Oct 7 22:39:13 2023 +0200

    Bump version to 7.5.7.1.M1
    
    Change-Id: If271b729371e33867a99434bfc31bc07e1f7dd83

diff --git a/configure.ac b/configure.ac
index 58c53365d027..64168c1e1e1e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for 
the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no 
idea.
 
-AC_INIT([LibreOffice],[7.5.7.1],[],[],[http://documentfoundation.org/])
+AC_INIT([LibreOffice],[7.5.7.1.M1],[],[],[http://documentfoundation.org/])
 
 dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just 
fine if it is installed
 dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails 
hard
commit f4b6dcaa110be8c4e3e6a7dede73548766f8e907
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Aug 18 13:49:54 2023 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sat Oct 7 22:02:07 2023 +0200

    Fix curl proxy access for non-authenticated proxy
    
    If rSession.m_Proxy.aName is a simple host-name, the CurlUri constructor
    will fail with CURLUE_BAD_SCHEME, so just ignore the error here,
    we only care about parsing out the username/password
    
    Change-Id: Iec2d6e7315a5899ddddf6120a43199b75bf62db2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155834
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit 9b30b4b1678e8be15ba51d236bd9a3e693d8d3d6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157318
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 4b5e94e3d718b6afc571db3cff8321c44436c1ad)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157322
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Aron Budea <aron.bu...@collabora.com>

diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index 5773fd2398f6..4839a1f85e03 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -1207,11 +1207,18 @@ auto CurlProcessor::ProcessRequest(
     ::std::optional<Auth> oAuthProxy;
     if (pEnv && !rSession.m_isAuthenticatedProxy && 
!rSession.m_Proxy.aName.isEmpty())
     {
-        // the hope is that this must be a URI
-        CurlUri const uri(rSession.m_Proxy.aName);
-        if (!uri.GetUser().isEmpty() || !uri.GetPassword().isEmpty())
+        try
+        {
+            // the hope is that this must be a URI
+            CurlUri const uri(rSession.m_Proxy.aName);
+            if (!uri.GetUser().isEmpty() || !uri.GetPassword().isEmpty())
+            {
+                oAuthProxy.emplace(uri.GetUser(), uri.GetPassword(), 
CURLAUTH_ANY);
+            }
+        }
+        catch (DAVException&)
         {
-            oAuthProxy.emplace(uri.GetUser(), uri.GetPassword(), CURLAUTH_ANY);
+            // ignore any parsing failure here
         }
     }
     decltype(CURLAUTH_ANY) const authSystem(CURLAUTH_NEGOTIATE | CURLAUTH_NTLM 
| CURLAUTH_NTLM_WB);
commit 8f4206c07dfaf433ede718c3018a7e9697f3c349
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Wed Aug 30 10:25:51 2023 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sat Oct 7 22:02:06 2023 +0200

    connectiviy: fix to detect column data type
    
    if Base SQL query:
    
    SELECT COUNT("test"."id") from Test
    
    If changed to Spanish UI, detect the column type
    from a neutral context parser.
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: I1faa8ff8417a0fc4996b289bd2ce0baad52fc00c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156298
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/connectivity/source/parse/sqliterator.cxx 
b/connectivity/source/parse/sqliterator.cxx
index 64ea48d0351a..3428fba569e1 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -2109,7 +2109,11 @@ sal_Int32 
OSQLParseTreeIterator::getFunctionReturnType(const OSQLParseNode* _pNo
                 nType = DataType::DOUBLE;
         }
         else
+        {
             nType = ::connectivity::OSQLParser::getFunctionReturnType( 
sFunctionName, &m_rParser.getContext() );
+            if (nType == DataType::SQLNULL)
+                nType = ::connectivity::OSQLParser::getFunctionReturnType( 
sFunctionName, m_rParser.getNeutral() );
+        }
     }
 
     return nType;
commit 7ba81af8a2f703d0d36291b95dbf55eb7afe4f44
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Wed Aug 30 10:23:31 2023 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sat Oct 7 22:02:06 2023 +0200

    connectivity: add neutral context parser
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: I12b0fe811d141873aaa64af5b6c457051c3356b0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156297
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/connectivity/source/parse/sqlnode.cxx 
b/connectivity/source/parse/sqlnode.cxx
index 1cb631a80c78..e8e8b44f463b 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -1305,8 +1305,11 @@ std::unique_ptr<OSQLParseNode> 
OSQLParser::predicateTree(OUString& rErrorMessage
 }
 
 
-OSQLParser::OSQLParser(css::uno::Reference< css::uno::XComponentContext > 
xContext, const IParseContext* _pContext)
+OSQLParser::OSQLParser(css::uno::Reference< css::uno::XComponentContext > 
xContext,
+                       const IParseContext* _pContext,
+                       const IParseContext* _pNeutral)
     :m_pContext(_pContext)
+    ,m_pNeutral(_pNeutral)
     ,m_pData( new OSQLParser_Data )
     ,m_nFormatKey(0)
     ,m_nDateFormatKey(0)
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx 
b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index 45d9a8ce6595..15667d7d170b 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -217,7 +217,7 @@ 
OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc
                                const Reference<XComponentContext>& _rContext )
     :OSubComponent(m_aMutex,_xConnection)
     ,OPropertyContainer(m_aBHelper)
-    ,m_aSqlParser( _rContext, &m_aParseContext )
+    ,m_aSqlParser( _rContext, &m_aParseContext, &m_aNeutralContext )
     ,m_aSqlIterator( _xConnection, _rxTables, m_aSqlParser )
     ,m_aAdditiveIterator( _xConnection, _rxTables, m_aSqlParser )
     ,m_aElementaryParts( size_t(SQLPartCount) )
diff --git a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx 
b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx
index a0edfd195a69..fdde2d451d17 100644
--- a/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx
+++ b/dbaccess/source/core/inc/SingleSelectQueryComposer.hxx
@@ -76,6 +76,7 @@ namespace dbaccess
         typedef std::function<const 
::connectivity::OSQLParseNode*(::connectivity::OSQLParseTreeIterator *)>
                                                 TGetParseNode;
         ::svxform::OSystemParseContext          m_aParseContext;
+        ::svxform::ONeutralParseContext         m_aNeutralContext;
         ::connectivity::OSQLParser              m_aSqlParser;
         ::connectivity::OSQLParseTreeIterator   m_aSqlIterator;         // the 
iterator for the complete statement
         ::connectivity::OSQLParseTreeIterator   m_aAdditiveIterator;    // the 
iterator for the "additive statement" (means without the clauses of the 
elementary statement)
diff --git a/include/connectivity/sqlparse.hxx 
b/include/connectivity/sqlparse.hxx
index 7e55d41e339f..50c72f6ebcdc 100644
--- a/include/connectivity/sqlparse.hxx
+++ b/include/connectivity/sqlparse.hxx
@@ -124,7 +124,8 @@ namespace connectivity
         static sal_Int32                        s_nRefCount;
 
     // information on the current parse action
-        const IParseContext*        m_pContext;
+        const IParseContext*             m_pContext;
+        const IParseContext*             m_pNeutral;
         std::unique_ptr<OSQLParseNode> m_pParseTree;   // result from parsing
         ::std::unique_ptr< OSQLParser_Data >
                                     m_pData;
@@ -156,7 +157,9 @@ namespace connectivity
     public:
         // if NULL, a default context will be used
         // the context must live as long as the parser
-        OSQLParser(css::uno::Reference< css::uno::XComponentContext > 
xContext, const IParseContext* _pContext = nullptr);
+        OSQLParser(css::uno::Reference< css::uno::XComponentContext > xContext,
+                   const IParseContext* _pContext = nullptr,
+                   const IParseContext* _pNeutral = nullptr);
         ~OSQLParser();
 
         // Parsing an SQLStatement
@@ -173,7 +176,8 @@ namespace connectivity
                        bool bUseRealName = true);
 
         // Access to the context
-        const IParseContext& getContext() const {return *m_pContext;}
+        const IParseContext& getContext() const { return *m_pContext; }
+        const IParseContext* getNeutral() const { return m_pNeutral; }
 
         /// access to the SQLError instance owned by this parser
         const SQLError& getErrorHelper() const;
commit 7cf6fb1a6053ff106723bc96a4dea92a7e33c5ca
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Wed Aug 30 10:16:37 2023 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sat Oct 7 22:02:06 2023 +0200

    svx: add class "ONeutralParseContext"
    
    If Base SQL query:
    
    SELECT COUNT("test"."id") FROM Test
    
    Then changed to Spanish interface, it is required
    to have a neutral keyword localized, the "COUNT"
    will fail to detect column type, because the keyword
    in Spanish is "RECUENTO"
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: I191b9591ad796d0dd9509c0fb10b11c16f72e1ce
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156296
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/include/svx/ParseContext.hxx b/include/svx/ParseContext.hxx
index 4b8f451a8014..b5b8b7c84ea6 100644
--- a/include/svx/ParseContext.hxx
+++ b/include/svx/ParseContext.hxx
@@ -31,11 +31,12 @@ namespace svxform
 
     //= OSystemParseContext
 
-    class SAL_DLLPUBLIC_RTTI OSystemParseContext final : public 
::connectivity::IParseContext
+    class SAL_DLLPUBLIC_RTTI OSystemParseContext : public 
::connectivity::IParseContext
     {
-    private:
+    protected:
 
         ::std::vector< OUString > m_aLocalizedKeywords;
+        OSystemParseContext(bool bInit);
 
     public:
         SVXCORE_DLLPUBLIC OSystemParseContext();
@@ -57,6 +58,12 @@ namespace svxform
 
     };
 
+    class SAL_DLLPUBLIC_RTTI ONeutralParseContext final : public 
OSystemParseContext
+    {
+    public:
+        SVXCORE_DLLPUBLIC ONeutralParseContext();
+        SVXCORE_DLLPUBLIC virtual ~ONeutralParseContext();
+    };
 
     //= OParseContextClient
 
diff --git a/svx/source/form/ParseContext.cxx b/svx/source/form/ParseContext.cxx
index 63634179142e..d231bfb3cd52 100644
--- a/svx/source/form/ParseContext.cxx
+++ b/svx/source/form/ParseContext.cxx
@@ -41,6 +41,11 @@ OSystemParseContext::OSystemParseContext()
         m_aLocalizedKeywords.push_back(SvxResId(RID_RSC_SQL_INTERNATIONAL[i]));
 }
 
+OSystemParseContext::OSystemParseContext(bool /*bInit*/)
+    : IParseContext()
+{
+}
+
 OSystemParseContext::~OSystemParseContext()
 {
 }
@@ -140,6 +145,17 @@ IParseContext::InternationalKeyCode 
OSystemParseContext::getIntlKeyCode(const OS
     return InternationalKeyCode::None;
 }
 
+ONeutralParseContext::ONeutralParseContext()
+    : OSystemParseContext(false)
+{
+    std::locale aLocale = Translate::Create("svx", LanguageTag("en-US"));
+    for (size_t i = 0; i < SAL_N_ELEMENTS(RID_RSC_SQL_INTERNATIONAL); ++i)
+        
m_aLocalizedKeywords.push_back(Translate::get(RID_RSC_SQL_INTERNATIONAL[i], 
aLocale));
+}
+
+ONeutralParseContext::~ONeutralParseContext()
+{
+}
 
 namespace
 {
commit 5abe7a5683287af6bed4342742909ae20d1280de
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Wed Aug 30 10:09:05 2023 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sat Oct 7 22:02:06 2023 +0200

    connectivity: fix return column type "DataType::SQLNULL"
    
    The Base SQL query:
    
    SELECT COUNT( "Test"."id" ) FROM "Test"
    
    And the UI language is set to Spanish, the function
    "getFunctionReturnType" returns misleading column type.
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: I2b57d1dfc005711374d7ae0de66b412f4f551d89
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156295
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/connectivity/source/parse/sqlnode.cxx 
b/connectivity/source/parse/sqlnode.cxx
index d98e8cc80064..1cb631a80c78 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -2494,7 +2494,7 @@ void OSQLParseNode::parseLeaf(OUStringBuffer& rString, 
const SQLParseNodeParamet
 
 sal_Int32 OSQLParser::getFunctionReturnType(std::u16string_view 
_sFunctionName, const IParseContext* pContext)
 {
-    sal_Int32 nType = DataType::VARCHAR;
+    sal_Int32 nType = DataType::SQLNULL;
     OString 
sFunctionName(OUStringToOString(_sFunctionName,RTL_TEXTENCODING_UTF8));
 
     
if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_ASCII,pContext))) 
                    nType = DataType::INTEGER;
commit dd2c87e4eeec85f1717eefd0bcfab392cf8d8cd0
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Tue Jul 25 15:36:52 2023 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sat Oct 7 20:58:21 2023 +0200

    sc: filter: rtf: add method "WriteFontTable"
    
    Write the font table while visiting column/row and
    get the unique index to reference it.
    
    "The \fonttbl control word introduces the font table group.
    Unique \fN control words define each font available in the document,
    and are used to reference that font throughout the document."
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: I20c5d1128972f5ec9b9b2e246f466bdb173ef8a4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154906
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155261

diff --git a/sc/source/filter/inc/rtfexp.hxx b/sc/source/filter/inc/rtfexp.hxx
index 1c9f1bd7a4af..9d0b204540c7 100644
--- a/sc/source/filter/inc/rtfexp.hxx
+++ b/sc/source/filter/inc/rtfexp.hxx
@@ -28,12 +28,14 @@ class ScRTFExport : public ScExportBase
 {
     std::unique_ptr<sal_uLong[]>  m_pCellX;     // cumulative range in a table
     std::map<OUString, sal_Int32> m_pFontTable;
+    SvMemoryStream m_aFontStrm;
     SvMemoryStream m_aDocStrm;
 
     int                 AddFont( const SvxFontItem& rFontItem );
     void                WriteTab( SCTAB nTab );
     void                WriteRow( SCTAB nTab, SCROW nRow );
     void                WriteCell( SCTAB nTab,  SCROW nRow, SCCOL nCol );
+    void                WriteFontTable(const SvxFontItem& rFontItem, int 
nIndex);
 
 public:
 
diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx
index 59e67d6442b9..fd96f11d7b9b 100644
--- a/sc/source/filter/rtf/rtfexp.cxx
+++ b/sc/source/filter/rtf/rtfexp.cxx
@@ -19,6 +19,9 @@
 
 #include <scitems.hxx>
 
+#include <rtl/tencinfo.h>
+#include <osl/thread.h>
+
 #include <editeng/wghtitem.hxx>
 #include <editeng/postitem.hxx>
 #include <editeng/udlnitem.hxx>
@@ -60,6 +63,8 @@ void ScRTFExport::Write()
     rStrm.WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_RTF );
     rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_ANSI ).WriteCharPtr( 
SAL_NEWLINE_STRING );
 
+    m_aFontStrm.WriteChar( '{' ).WriteOString( OOO_STRING_SVTOOLS_RTF_FONTTBL 
);
+
     // Data
     for ( SCTAB nTab = aRange.aStart.Tab(); nTab <= aRange.aEnd.Tab(); nTab++ )
     {
@@ -68,6 +73,9 @@ void ScRTFExport::Write()
         WriteTab( nTab );
     }
 
+    m_aFontStrm.WriteChar( '}' );
+    m_aFontStrm.Seek(0);
+    rStrm.WriteStream(m_aFontStrm);
     m_aDocStrm.Seek(0);
     rStrm.WriteStream(m_aDocStrm);
     rStrm.WriteChar( '}' ).WriteOString( SAL_NEWLINE_STRING );
@@ -148,6 +156,51 @@ void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow )
     m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_ROW ).WriteOString( 
SAL_NEWLINE_STRING );
 }
 
+void ScRTFExport::WriteFontTable(const SvxFontItem& rFontItem, int nIndex)
+{
+    m_aFontStrm.WriteChar( '{' );
+    m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_F );
+    m_aFontStrm.WriteOString( OString::number(nIndex) );
+
+    FontFamily eFamily = rFontItem.GetFamily();
+    if (eFamily == FAMILY_DONTKNOW)
+        m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FNIL );
+    else if (eFamily == FAMILY_DECORATIVE)
+        m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FDECOR );
+    else if (eFamily == FAMILY_MODERN)
+        m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FMODERN );
+    else if (eFamily == FAMILY_ROMAN)
+        m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FROMAN );
+    else if (eFamily == FAMILY_SCRIPT)
+        m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FSCRIPT );
+    else if (eFamily == FAMILY_SWISS)
+        m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FSWISS );
+
+    m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FPRQ );
+
+    sal_uInt16 nVal = 0;
+    FontPitch ePitch = rFontItem.GetPitch();
+    if ( ePitch == PITCH_FIXED )
+        nVal = 1;
+    else if ( ePitch == PITCH_VARIABLE )
+        nVal = 2;
+    m_aFontStrm.WriteOString( OString::number(nVal) );
+
+    rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252;
+    rtl_TextEncoding eChrSet = rFontItem.GetCharSet();
+    if (IsOpenSymbol(rFontItem.GetFamilyName()))
+        eChrSet = RTL_TEXTENCODING_UTF8;
+    else if( RTL_TEXTENCODING_DONTKNOW == eChrSet )
+        eChrSet = osl_getThreadTextEncoding();
+
+    m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FCHARSET );
+    m_aFontStrm.WriteOString( 
OString::number(rtl_getBestWindowsCharsetFromTextEncoding( eChrSet )) );
+
+    m_aFontStrm.WriteChar( ' ' );
+    RTFOutFuncs::Out_String( m_aFontStrm, rFontItem.GetFamilyName(), eDestEnc 
);
+    m_aFontStrm.WriteOString( ";}" );
+}
+
 int ScRTFExport::AddFont(const SvxFontItem& rFontItem)
 {
     auto nRet = m_pFontTable.size();
@@ -155,6 +208,7 @@ int ScRTFExport::AddFont(const SvxFontItem& rFontItem)
     if (itFont == m_pFontTable.end())
     {
         m_pFontTable[rFontItem.GetFamilyName()] = nRet;
+        WriteFontTable(rFontItem, nRet);
     }
     else
     {
@@ -204,11 +258,15 @@ void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, 
SCCOL nCol )
 
     bool bResetAttr(false);
 
+    const SvxFontItem&          rFontItem       = pAttr->GetItem( ATTR_FONT );
     const SvxHorJustifyItem&    rHorJustifyItem = pAttr->GetItem( 
ATTR_HOR_JUSTIFY );
     const SvxWeightItem&        rWeightItem     = pAttr->GetItem( 
ATTR_FONT_WEIGHT );
     const SvxPostureItem&       rPostureItem    = pAttr->GetItem( 
ATTR_FONT_POSTURE );
     const SvxUnderlineItem&     rUnderlineItem  = pAttr->GetItem( 
ATTR_FONT_UNDERLINE );
 
+    m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_F )
+        .WriteOString( OString::number(AddFont(rFontItem)) );
+
     const char* pChar;
 
     switch( rHorJustifyItem.GetValue() )
commit 45415bd72d307fa28e634d1d8557b88ac515a455
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Tue Jul 25 15:31:22 2023 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sat Oct 7 20:58:21 2023 +0200

    sc: filter: rtf: add method "AddFont"
    
    Create a map font name associated with unique index.
    
    "The \fonttbl control word introduces the font table group.
    Unique \fN control words define each font available in the document,
    and are used to reference that font throughout the document"..
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: I028226cb539865f1980f953385c887a3bd4b8e3f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154905
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155260

diff --git a/sc/source/filter/inc/rtfexp.hxx b/sc/source/filter/inc/rtfexp.hxx
index 14ee8ec023f7..1c9f1bd7a4af 100644
--- a/sc/source/filter/inc/rtfexp.hxx
+++ b/sc/source/filter/inc/rtfexp.hxx
@@ -19,6 +19,7 @@
 
 #pragma once
 
+#include <map>
 #include <memory>
 #include "expbase.hxx"
 #include <tools/solar.h>
@@ -26,8 +27,10 @@
 class ScRTFExport : public ScExportBase
 {
     std::unique_ptr<sal_uLong[]>  m_pCellX;     // cumulative range in a table
+    std::map<OUString, sal_Int32> m_pFontTable;
     SvMemoryStream m_aDocStrm;
 
+    int                 AddFont( const SvxFontItem& rFontItem );
     void                WriteTab( SCTAB nTab );
     void                WriteRow( SCTAB nTab, SCROW nRow );
     void                WriteCell( SCTAB nTab,  SCROW nRow, SCCOL nCol );
diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx
index 487d3226a144..59e67d6442b9 100644
--- a/sc/source/filter/rtf/rtfexp.cxx
+++ b/sc/source/filter/rtf/rtfexp.cxx
@@ -22,6 +22,7 @@
 #include <editeng/wghtitem.hxx>
 #include <editeng/postitem.hxx>
 #include <editeng/udlnitem.hxx>
+#include <editeng/fontitem.hxx>
 #include <editeng/justifyitem.hxx>
 #include <svtools/rtfout.hxx>
 #include <svtools/rtfkeywd.hxx>
@@ -147,6 +148,22 @@ void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow )
     m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_ROW ).WriteOString( 
SAL_NEWLINE_STRING );
 }
 
+int ScRTFExport::AddFont(const SvxFontItem& rFontItem)
+{
+    auto nRet = m_pFontTable.size();
+    auto itFont(m_pFontTable.find(rFontItem.GetFamilyName()));
+    if (itFont == m_pFontTable.end())
+    {
+        m_pFontTable[rFontItem.GetFamilyName()] = nRet;
+    }
+    else
+    {
+        nRet = itFont->second;
+    }
+
+    return nRet;
+}
+
 void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, SCCOL nCol )
 {
     const ScPatternAttr* pAttr = pDoc->GetPattern( nCol, nRow, nTab );
commit 1f9ce41e1dd269969477f4e614926ec33e8a1b97
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Tue Jul 25 15:28:39 2023 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sat Oct 7 20:58:20 2023 +0200

    sc: filter: rtf: prefix m_* private members
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: If8389b6e63a90616131d0dd9fbb5a7b8b96ffe3d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154904
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155259

diff --git a/sc/source/filter/inc/rtfexp.hxx b/sc/source/filter/inc/rtfexp.hxx
index 9a4fe43d9d02..14ee8ec023f7 100644
--- a/sc/source/filter/inc/rtfexp.hxx
+++ b/sc/source/filter/inc/rtfexp.hxx
@@ -25,7 +25,7 @@
 
 class ScRTFExport : public ScExportBase
 {
-    std::unique_ptr<sal_uLong[]>  pCellX;     // cumulative range in a table
+    std::unique_ptr<sal_uLong[]>  m_pCellX;     // cumulative range in a table
     SvMemoryStream m_aDocStrm;
 
     void                WriteTab( SCTAB nTab );
diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx
index 63f006d5c1e0..487d3226a144 100644
--- a/sc/source/filter/rtf/rtfexp.cxx
+++ b/sc/source/filter/rtf/rtfexp.cxx
@@ -46,7 +46,7 @@ void ScFormatFilterPluginImpl::ScExportRTF( SvStream& rStrm, 
ScDocument* pDoc,
 ScRTFExport::ScRTFExport( SvStream& rStrmP, ScDocument* pDocP, const ScRange& 
rRangeP )
             :
             ScExportBase( rStrmP, pDocP, rRangeP ),
-            pCellX( new sal_uLong[ pDoc->MaxCol()+2 ] )
+            m_pCellX( new sal_uLong[ pDoc->MaxCol()+2 ] )
 {
 }
 
@@ -77,12 +77,12 @@ void ScRTFExport::WriteTab( SCTAB nTab )
     m_aDocStrm.WriteChar( '{' ).WriteOString( SAL_NEWLINE_STRING );
     if ( pDoc->HasTable( nTab ) )
     {
-        memset( &pCellX[0], 0, (pDoc->MaxCol()+2) * sizeof(sal_uLong) );
+        memset( &m_pCellX[0], 0, (pDoc->MaxCol()+2) * sizeof(sal_uLong) );
         SCCOL nCol;
         SCCOL nEndCol = aRange.aEnd.Col();
         for ( nCol = aRange.aStart.Col(); nCol <= nEndCol; nCol++ )
         {
-            pCellX[nCol+1] = pCellX[nCol] + pDoc->GetColWidth( nCol, nTab );
+            m_pCellX[nCol+1] = m_pCellX[nCol] + pDoc->GetColWidth( nCol, nTab 
);
         }
 
         SCROW nEndRow = aRange.aEnd.Row();
@@ -128,7 +128,7 @@ void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow )
         if ( pChar )
             m_aDocStrm.WriteOString( pChar );
 
-        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CELLX ).WriteOString( 
OString::number(pCellX[nCol+1]) );
+        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CELLX ).WriteOString( 
OString::number(m_pCellX[nCol+1]) );
         if ( (nCol & 0x0F) == 0x0F )
             m_aDocStrm.WriteOString( SAL_NEWLINE_STRING ); // Do not let lines 
get too long
     }
commit 5522ad5806c35358eb62ab347e80b4b68147a8a0
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Tue Jul 25 15:18:10 2023 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sat Oct 7 20:58:20 2023 +0200

    sc: filter: rtf: use a separate document stream
    
    "An RTF file has the following syntax:
    '{' <header> <document>'}' "
    
    In order to build the header:
    
    <header>
            \rtf <charset> \deff? <fonttbl> <filetbl>? <colortbl>? 
<stylesheet>? <listtables>? <revtbl>?
    
    The font table should be created while visiting the column/rows.
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: Id72a3c87acab6cfc7889cf81f7e83a0d73e378a2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154903
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155258

diff --git a/sc/source/filter/inc/rtfexp.hxx b/sc/source/filter/inc/rtfexp.hxx
index 0d5e69f79d8e..9a4fe43d9d02 100644
--- a/sc/source/filter/inc/rtfexp.hxx
+++ b/sc/source/filter/inc/rtfexp.hxx
@@ -26,6 +26,7 @@
 class ScRTFExport : public ScExportBase
 {
     std::unique_ptr<sal_uLong[]>  pCellX;     // cumulative range in a table
+    SvMemoryStream m_aDocStrm;
 
     void                WriteTab( SCTAB nTab );
     void                WriteRow( SCTAB nTab, SCROW nRow );
diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx
index 7129049475e6..63f006d5c1e0 100644
--- a/sc/source/filter/rtf/rtfexp.cxx
+++ b/sc/source/filter/rtf/rtfexp.cxx
@@ -63,16 +63,18 @@ void ScRTFExport::Write()
     for ( SCTAB nTab = aRange.aStart.Tab(); nTab <= aRange.aEnd.Tab(); nTab++ )
     {
         if ( nTab > aRange.aStart.Tab() )
-            rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PAR );
+            m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_PAR );
         WriteTab( nTab );
     }
 
-    rStrm.WriteChar( '}' ).WriteCharPtr( SAL_NEWLINE_STRING );
+    m_aDocStrm.Seek(0);
+    rStrm.WriteStream(m_aDocStrm);
+    rStrm.WriteChar( '}' ).WriteOString( SAL_NEWLINE_STRING );
 }
 
 void ScRTFExport::WriteTab( SCTAB nTab )
 {
-    rStrm.WriteChar( '{' ).WriteCharPtr( SAL_NEWLINE_STRING );
+    m_aDocStrm.WriteChar( '{' ).WriteOString( SAL_NEWLINE_STRING );
     if ( pDoc->HasTable( nTab ) )
     {
         memset( &pCellX[0], 0, (pDoc->MaxCol()+2) * sizeof(sal_uLong) );
@@ -89,13 +91,13 @@ void ScRTFExport::WriteTab( SCTAB nTab )
             WriteRow( nTab, nRow );
         }
     }
-    rStrm.WriteChar( '}' ).WriteCharPtr( SAL_NEWLINE_STRING );
+    m_aDocStrm.WriteChar( '}' ).WriteOString( SAL_NEWLINE_STRING );
 }
 
 void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow )
 {
-    rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TROWD ).WriteCharPtr( 
OOO_STRING_SVTOOLS_RTF_TRGAPH ).WriteCharPtr( "30" ).WriteCharPtr( 
OOO_STRING_SVTOOLS_RTF_TRLEFT ).WriteCharPtr( "-30" );
-    rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TRRH ).WriteOString( 
OString::number(pDoc->GetRowHeight(nRow, nTab)) );
+    m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_TROWD ).WriteOString( 
OOO_STRING_SVTOOLS_RTF_TRGAPH ).WriteOString( "30" ).WriteOString( 
OOO_STRING_SVTOOLS_RTF_TRLEFT ).WriteOString( "-30" );
+    m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_TRRH ).WriteOString( 
OString::number(pDoc->GetRowHeight(nRow, nTab)) );
     SCCOL nCol;
     SCCOL nEndCol = aRange.aEnd.Col();
     for ( nCol = aRange.aStart.Col(); nCol <= nEndCol; nCol++ )
@@ -107,12 +109,12 @@ void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow )
         const char* pChar;
 
         if ( rMergeAttr.GetColMerge() != 0 )
-            rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_CLMGF );
+            m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CLMGF );
         else
         {
             const ScMergeFlagAttr& rMergeFlagAttr = pAttr->GetItem( 
ATTR_MERGE_FLAG );
             if ( rMergeFlagAttr.IsHorOverlapped() )
-                rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_CLMRG );
+                m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CLMRG );
         }
 
         switch( rVerJustifyItem.GetValue() )
@@ -124,25 +126,25 @@ void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow )
             default:                           pChar = nullptr;           
break;
         }
         if ( pChar )
-            rStrm.WriteCharPtr( pChar );
+            m_aDocStrm.WriteOString( pChar );
 
-        rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_CELLX ).WriteOString( 
OString::number(pCellX[nCol+1]) );
+        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CELLX ).WriteOString( 
OString::number(pCellX[nCol+1]) );
         if ( (nCol & 0x0F) == 0x0F )
-            rStrm.WriteCharPtr( SAL_NEWLINE_STRING ); // Do not let lines get 
too long
+            m_aDocStrm.WriteOString( SAL_NEWLINE_STRING ); // Do not let lines 
get too long
     }
-    rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PARD ).WriteCharPtr( 
OOO_STRING_SVTOOLS_RTF_PLAIN ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_INTBL 
).WriteCharPtr( SAL_NEWLINE_STRING );
+    m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_PARD ).WriteOString( 
OOO_STRING_SVTOOLS_RTF_PLAIN ).WriteOString( OOO_STRING_SVTOOLS_RTF_INTBL 
).WriteOString( SAL_NEWLINE_STRING );
 
-    sal_uInt64 nStrmPos = rStrm.Tell();
+    sal_uInt64 nStrmPos = m_aDocStrm.Tell();
     for ( nCol = aRange.aStart.Col(); nCol <= nEndCol; nCol++ )
     {
         WriteCell( nTab, nRow, nCol );
-        if ( rStrm.Tell() - nStrmPos > 255 )
+        if ( m_aDocStrm.Tell() - nStrmPos > 255 )
         {   // Do not let lines get too long
-            rStrm.WriteCharPtr( SAL_NEWLINE_STRING );
-            nStrmPos = rStrm.Tell();
+            m_aDocStrm.WriteOString( SAL_NEWLINE_STRING );
+            nStrmPos = m_aDocStrm.Tell();
         }
     }
-    rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_ROW ).WriteCharPtr( 
SAL_NEWLINE_STRING );
+    m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_ROW ).WriteOString( 
SAL_NEWLINE_STRING );
 }
 
 void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, SCCOL nCol )
@@ -152,7 +154,7 @@ void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, SCCOL 
nCol )
     const ScMergeFlagAttr& rMergeFlagAttr = pAttr->GetItem( ATTR_MERGE_FLAG );
     if ( rMergeFlagAttr.IsHorOverlapped() )
     {
-        rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_CELL );
+        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CELL );
         return ;
     }
 
@@ -204,30 +206,30 @@ void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, 
SCCOL nCol )
         case SvxCellHorJustify::Repeat:
         default:                        pChar = OOO_STRING_SVTOOLS_RTF_QL;  
break;
     }
-    rStrm.WriteCharPtr( pChar );
+    m_aDocStrm.WriteOString( pChar );
 
     if ( rWeightItem.GetWeight() >= WEIGHT_BOLD )
     {   // bold
         bResetAttr = true;
-        rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_B );
+        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_B );
     }
     if ( rPostureItem.GetPosture() != ITALIC_NONE )
     {   // italic
         bResetAttr = true;
-        rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_I );
+        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_I );
     }
     if ( rUnderlineItem.GetLineStyle() != LINESTYLE_NONE )
     {   // underline
         bResetAttr = true;
-        rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_UL );
+        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_UL );
     }
 
-    rStrm.WriteChar( ' ' );
-    RTFOutFuncs::Out_String( rStrm, aContent );
-    rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_CELL );
+    m_aDocStrm.WriteChar( ' ' );
+    RTFOutFuncs::Out_String( m_aDocStrm, aContent );
+    m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CELL );
 
     if ( bResetAttr )
-        rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PLAIN );
+        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_PLAIN );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 61fb1d82b6887b1b8a093a91e407d0db113fb557
Author:     luigiiucci <luigi.iu...@collabora.com>
AuthorDate: Thu Jun 15 23:31:26 2023 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sat Oct 7 20:56:54 2023 +0200

    tdf#62032 use style list level when changing style
    
    If a style S1 has a list level L1, and we
    change the style to S1 in a text node that
    has list level L2, the new text node
    list level must be L1
    
    Change-Id: Ic25b222202cb2da3153fc5c3723998c9f7f01247
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153161
    Reviewed-by: Ashod Nakashian <a...@collabora.com>
    Tested-by: Jenkins
    (cherry picked from commit c1cfe85f8bba10d367ef9ef1d6d569f53969dd34)

diff --git a/sw/qa/extras/uiwriter/data/tdf62032_apply_style.odt 
b/sw/qa/extras/uiwriter/data/tdf62032_apply_style.odt
new file mode 100644
index 000000000000..86cda167ee8a
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf62032_apply_style.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx 
b/sw/qa/extras/uiwriter/uiwriter7.cxx
index 8c14e7184f44..d78021bd9e72 100644
--- a/sw/qa/extras/uiwriter/uiwriter7.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter7.cxx
@@ -2823,6 +2823,26 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf149089)
     CPPUNIT_ASSERT_EQUAL(nGridWidth1, nGridWidth2);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf62032ApplyStyle)
+{
+    SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf62032_apply_style.odt");
+    SwWrtShell* pWrtSh = pDoc->GetDocShell()->GetWrtShell();
+
+    pWrtSh->Down(/*bSelect=*/false);
+
+    uno::Sequence<beans::PropertyValue> aPropertyValues = 
comphelper::InitPropertySequence({
+        { "Style", uno::Any(OUString("A 2")) },
+        { "FamilyName", uno::Any(OUString("ParagraphStyles")) },
+    });
+    dispatchCommand(mxComponent, ".uno:StyleApply", aPropertyValues);
+
+    // Without the fix in place, it fails with:
+    // - Expected: 1.1
+    // - Actual  : 2
+    CPPUNIT_ASSERT_EQUAL(OUString("1.1"),
+                         getProperty<OUString>(getParagraph(2), 
"ListLabelString").trim());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 9e8df615959a..d9fac7ebb052 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1069,6 +1069,11 @@ static bool lcl_SetTextFormatColl( SwNode* pNode, void* 
pArgs )
                 pCNd->ResetAttr( RES_PARATR_LIST_ISCOUNTED );
                 pCNd->ResetAttr( RES_PARATR_LIST_ID );
             }
+            else
+            {
+                // forcing reset of list level from parapgaph
+                pCNd->SetAttr(pFormat->GetFormatAttr(RES_PARATR_LIST_LEVEL));
+            }
         }
     }
 
commit 08945829bd89dd41888a63ddcca0a06fab10e3a2
Author:     luigiiucci <luigi.iu...@collabora.com>
AuthorDate: Wed May 17 11:02:37 2023 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sat Oct 7 20:54:45 2023 +0200

    Header columns can disappear with filtered data in pivot tables
    
    When we set on a pivot table a filter that filters all the rows,
    the pivot table showed only the first header columns and computed
    column, but all the columns headers should still be shown so we can
    adjust the filter for the column. This fixes this issue.
    
    Also add more debug output and prevent a crash when running pivot
    table tests.
    
    Change-Id: I30b4ee72cf8436c4522ab4ba0781462b214816dd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151871
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    (cherry picked from commit 3551d18404cb19cdaa8edb170a549f5c5405d0cb)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153686
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index f9c7af04a813..d21571def5a3 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -32,6 +32,7 @@
 #include <scitems.hxx>
 #include <stringutil.hxx>
 #include <tokenarray.hxx>
+#include <o3tl/safeint.hxx>
 
 #include <orcus/csv_parser.hpp>
 
@@ -404,6 +405,43 @@ bool checkOutput(
     svl::GridPrinter printer(e.Row() - s.Row() + 1, e.Col() - s.Col() + 1, 
CALC_DEBUG_OUTPUT != 0);
     SCROW nOutRowSize = e.Row() - s.Row() + 1;
     SCCOL nOutColSize = e.Col() - s.Col() + 1;
+
+    // Check if expected size iz smaller than actual size (and prevent a crash)
+    if (aCheck.size() < o3tl::make_unsigned(nOutRowSize) || aCheck[0].size() < 
o3tl::make_unsigned(nOutColSize))
+    {
+        // Dump the arrays to console, so we can compare
+        std::cout << "Expected data:" << std::endl;
+        for (size_t nRow = 0; nRow < aCheck.size(); ++nRow)
+        {
+            for (size_t nCol = 0; nCol < aCheck[nRow].size(); ++nCol)
+            {
+                const char* p = aCheck[nRow][nCol];
+                if (p)
+                {
+                    OUString aCheckVal = OUString::createFromAscii(p);
+                    std::cout << "'" << aCheckVal << "', ";
+                }
+                else
+                    std::cout << "null, ";
+            }
+            std::cout << std::endl;
+        }
+
+        std::cout << "Actual data:" << std::endl;
+        for (SCROW nRow = 0; nRow < nOutRowSize; ++nRow)
+        {
+            for (SCCOL nCol = 0; nCol < nOutColSize; ++nCol)
+            {
+                OUString aVal = pDoc->GetString(nCol + s.Col(), nRow + 
s.Row(), s.Tab());
+                std::cout << "'" << aVal << "', ";
+            }
+            std::cout << std::endl;
+        }
+        std::cout << std::endl;
+
+        return false;
+    }
+
     for (SCROW nRow = 0; nRow < nOutRowSize; ++nRow)
     {
         for (SCCOL nCol = 0; nCol < nOutColSize; ++nCol)
diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index ce2ccb3a05dd..1dac940fe604 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -601,7 +601,11 @@ ScDPOutput::ScDPOutput( ScDocument* pD, 
uno::Reference<sheet::XDimensionsSupplie
                                     case sheet::DataPilotFieldOrientation_ROW:
                                     {
                                         uno::Sequence<sheet::MemberResult> 
aResult = xLevRes->getResults();
-                                        if (!lcl_MemberEmpty(aResult))
+                                        // We want only to remove the DATA 
column if it is empty
+                                        // and not any other empty columns (to 
still show the
+                                        // header columns)
+                                        bool bSkip = lcl_MemberEmpty(aResult) 
&& bIsDataLayout;
+                                        if (!bSkip)
                                         {
                                             ScDPOutLevelData tmp(nDim, 
nHierarchy, nLev, nDimPos, nNumFmt, aResult, aName,
                                                                    aCaption, 
bHasHiddenMember, bIsDataLayout, false);
commit cd2d3a8975d3b32571141f7db540889d08048551
Author:     luigiiucci <luigi.iu...@collabora.com>
AuthorDate: Tue Jun 13 22:10:00 2023 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sat Oct 7 20:51:19 2023 +0200

    tdf#155486 Adding fonts to .odt when there is "no perfect match"
    
    Problem does not seem to have any
     relation with .otf files management.
    Problem arises when:
      - we use a font with setting certain
        family/bold/italic/pitch values
      - we have this font installed, but
        we don't have a version with
        matching
        family/bold/italic/pitch
    In this case the "not a perfect match"
     fonts were not saved in the .odt
    
    Change-Id: Ie4e2b9c34b79ac99f03c57bed4fdc5f4d718dcc2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153007
    Tested-by: Jenkins
    Reviewed-by: خالد حسني <kha...@libreoffice.org>
    (cherry picked from commit e7c885389bfb9387acf8a21ea38769e678a76aac)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153606
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/vcl/source/gdi/embeddedfontshelper.cxx 
b/vcl/source/gdi/embeddedfontshelper.cxx
index aeb30aa20dee..afddbf41387c 100644
--- a/vcl/source/gdi/embeddedfontshelper.cxx
+++ b/vcl/source/gdi/embeddedfontshelper.cxx
@@ -261,6 +261,15 @@ OUString EmbeddedFontsHelper::fontFileUrl( 
std::u16string_view familyName, FontF
     graphics->GetDevFontList( &fonts );
     std::unique_ptr< vcl::font::PhysicalFontFaceCollection > fontInfo( 
fonts.GetFontFaceCollection());
     vcl::font::PhysicalFontFace* selected = nullptr;
+
+    // Maybe we don't find the perfect match for the font. E.G. we have fonts 
with the same family name
+    // but not same bold or italic etc..
+    // In this case we add all the fonts having the family name of tyhe used 
font:
+    //  - we store all these fonts in familyNameFonts during loop
+    //  - if we haven't found the perfect match we store all fonts in 
familyNameFonts
+    typedef std::vector<vcl::font::PhysicalFontFace*> FontList;
+    FontList familyNameFonts;
+
     for( int i = 0;
          i < fontInfo->Count();
          ++i )
@@ -288,11 +297,29 @@ OUString EmbeddedFontsHelper::fontFileUrl( 
std::u16string_view familyName, FontF
             { // Some fonts specify 'DONTKNOW' for some things, still a good 
match, if we don't find a better one.
                 selected = f;
             }
+            // adding "not perfact match" to familyNameFonts vector
+            familyNameFonts.push_back(f);
+
         }
     }
-    if( selected != nullptr )
+
+    // if we have found a perfect match we will add only "selected", otherwise 
all familyNameFonts
+    FontList fontsToAdd = (selected ? FontList(1, selected) : 
std::move(familyNameFonts));
+
+    for (vcl::font::PhysicalFontFace* f : fontsToAdd)
     {
-        auto aFontData(selected->GetRawFontData(0));
+        if (!selected) { // recalculate file not for "not perfect match"
+            filename = OUString::Concat(familyName) + "_" + 
OUString::number(f->GetFamilyType()) + "_" +
+                OUString::number(f->GetItalic()) + "_" + 
OUString::number(f->GetWeight()) + "_" +
+                OUString::number(f->GetPitch()) + ".ttf"; // TODO is it always 
ttf?
+            url = path + filename;
+            if (osl::File(url).open(osl_File_OpenFlag_Read) == 
osl::File::E_None) // = exists()
+            {
+                // File with contents of the font file already exists, assume 
it's been created by a previous call.
+                continue;
+            }
+        }
+        auto aFontData(f->GetRawFontData(0));
         if (!aFontData.empty())
         {
             auto data = aFontData.data();

Reply via email to