desktop/source/lib/init.cxx                                  |   25 
 drawinglayer/source/primitive2d/structuretagprimitive2d.cxx  |    2 
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx   |   88 -
 drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx   |    4 
 drawinglayer/source/tools/primitive2dxmldump.cxx             |    3 
 editeng/source/editeng/impedit3.cxx                          |    2 
 filter/source/pdf/pdfexport.cxx                              |    4 
 filter/uiconfig/ui/impswfdialog.ui                           |   21 
 include/drawinglayer/primitive2d/structuretagprimitive2d.hxx |    6 
 include/vcl/filter/PDFiumLibrary.hxx                         |   29 
 include/vcl/pdfextoutdevdata.hxx                             |    4 
 include/vcl/pdfwriter.hxx                                    |   57 -
 sc/qa/unit/data/xlsx/freezePaneStartCell.xlsx                |binary
 sc/qa/unit/subsequent_export_test2.cxx                       |   17 
 sc/source/filter/excel/xeview.cxx                            |    7 
 sd/source/ui/view/drviews2.cxx                               |  206 +++
 sfx2/uiconfig/ui/templatepanel.ui                            |  106 +-
 svx/source/sdr/contact/viewobjectcontact.cxx                 |   22 
 svx/source/svdraw/svdmrkv.cxx                                |    3 
 svx/source/svdraw/svdograf.cxx                               |   49 
 svx/source/table/viewcontactoftableobj.cxx                   |    6 
 sw/inc/EnhancedPDFExportHelper.hxx                           |    6 
 sw/inc/crsrsh.hxx                                            |    1 
 sw/source/core/crsr/crsrsh.cxx                               |    8 
 sw/source/core/crsr/viscrs.cxx                               |    4 
 sw/source/core/text/EnhancedPDFExportHelper.cxx              |  207 ++-
 sw/source/core/text/itrform2.cxx                             |    2 
 sw/source/core/text/porfld.cxx                               |    2 
 sw/source/uibase/docvw/AnnotationWin2.cxx                    |    2 
 ucb/source/ucp/webdav-curl/CurlSession.cxx                   |   74 +
 vcl/inc/jsdialog/jsdialogbuilder.hxx                         |    1 
 vcl/inc/pdf/COSWriter.hxx                                    |    6 
 vcl/inc/pdf/XmpMetadata.hxx                                  |    2 
 vcl/inc/pdf/pdfwriter_impl.hxx                               |   14 
 vcl/jsdialog/jsdialogbuilder.cxx                             |    9 
 vcl/qa/cppunit/PDFiumLibraryTest.cxx                         |  145 ++
 vcl/qa/cppunit/data/StructureTreeExampleDocument.odt         |binary
 vcl/qa/cppunit/data/StructureTreeExampleDocument.pdf         |binary
 vcl/source/gdi/pdfextoutdevdata.cxx                          |    9 
 vcl/source/gdi/pdfwriter.cxx                                 |    2 
 vcl/source/gdi/pdfwriter_impl.cxx                            |  572 ++++++-----
 vcl/source/pdf/PDFiumLibrary.cxx                             |  168 +++
 vcl/source/pdf/XmpMetadata.cxx                               |   10 
 writerfilter/source/dmapper/DomainMapper.cxx                 |    2 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx            |    4 
 45 files changed, 1325 insertions(+), 586 deletions(-)

New commits:
commit 9cb545ac22ebc7005aead4c63ef5c4bf5e9737b5
Author:     Rashesh <[email protected]>
AuthorDate: Mon Feb 17 18:54:58 2025 +0530
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Feb 18 14:29:58 2025 +0100

    fix(sw-lokit): correctly load shared wordbooks
    
    - Fixes a regression introduced in commit 
89d86b64c93f2f47d7cfdefb928812e4de64fe3b.
    - Ensures dictionaries are reinitialized even when only shared wordbooks 
are uploaded.
    - Previously, reinitialization occurred only when user wordbooks were 
uploaded.
    
    Change-Id: I0f54b6b01fe1aefadc2c1fec2d9ae57db1c5d02a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181787
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 9266cb5648e8..9487a30839cb 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5046,6 +5046,17 @@ static void lo_sendDialogEvent(LibreOfficeKit* 
/*pThis*/, unsigned long long int
     lcl_sendDialogEvent(nWindowId, pArguments);
 }
 
+static void reInitDictionaryList()
+{
+    uno::Reference<css::linguistic2::XSearchableDictionaryList> xDicList
+        = LinguMgr::GetDictionaryList();
+    if (xDicList.is())
+    {
+        uno::Reference<lang::XInitialization> xReInitDictionaryList(xDicList, 
uno::UNO_QUERY_THROW);
+        xReInitDictionaryList->initialize({});
+    }
+};
+
 static void updateConfig(const OUString& rConfigPath)
 {
     osl::Directory aScanRootDir(rConfigPath);
@@ -5110,14 +5121,7 @@ static void updateConfig(const OUString& rConfigPath)
         }
         else if (sFileName == "wordbook")
         {
-            uno::Reference<css::linguistic2::XSearchableDictionaryList> 
xDicList
-                = LinguMgr::GetDictionaryList();
-            if (xDicList.is())
-            {
-                uno::Reference<lang::XInitialization> 
xReInitDictionaryList(xDicList,
-                                                                            
uno::UNO_QUERY_THROW);
-                xReInitDictionaryList->initialize({});
-            }
+            reInitDictionaryList();
         }
     }
 }
@@ -8195,7 +8199,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
             uno::Reference<css::util::XPathSettings> xPathSettings = 
util::thePathSettings::get(xContext);
             uno::Reference<lang::XInitialization> 
xReInitSettings(xPathSettings, uno::UNO_QUERY_THROW);
             xReInitSettings->initialize({});
-
+            reInitDictionaryList();
         }
     }
 
commit 0ce56531be7a2b67af916cb2dbb4508f76ddbea2
Author:     Rashesh <[email protected]>
AuthorDate: Sat Feb 15 18:15:54 2025 +0530
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Feb 18 14:29:39 2025 +0100

    svdraw: append SdrCropViewHdl instead of prepending in crop mode
    
    Previously, enabling crop mode caused the crop handle (SdrCropViewHdl) to 
be added
    at the start of the handlers list. This change in order led to a shift in 
handler IDs,
    which Collabora Online relies on for identifying and managing handlers.
    
    This patch fixes the bug by appending the SdrCropViewHdl to the end of the 
list,
    ensuring that the IDs for the main crop handles remain consistent.
    
    Change-Id: If082d292e32e242648cf5d04e278880bd457efb5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181705
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Gökay ŞATIR <[email protected]>

diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 0f7151e2957e..5406474b7c52 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -1168,9 +1168,26 @@ void SdrGrafObj::addCropHandles(SdrHdlList& rTarget) 
const
             aTranslate);
     }
 
+    basegfx::B2DPoint aPos;
+    aPos = aMatrix * basegfx::B2DPoint(0.0, 0.0);
+    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::UpperLeft, fShearX, fRotate));
+    aPos = aMatrix * basegfx::B2DPoint(0.5, 0.0);
+    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::Upper, fShearX, fRotate));
+    aPos = aMatrix * basegfx::B2DPoint(1.0, 0.0);
+    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::UpperRight, fShearX, fRotate));
+    aPos = aMatrix * basegfx::B2DPoint(0.0, 0.5);
+    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::Left , fShearX, fRotate));
+    aPos = aMatrix * basegfx::B2DPoint(1.0, 0.5);
+    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::Right, fShearX, fRotate));
+    aPos = aMatrix * basegfx::B2DPoint(0.0, 1.0);
+    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::LowerLeft, fShearX, fRotate));
+    aPos = aMatrix * basegfx::B2DPoint(0.5, 1.0);
+    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::Lower, fShearX, fRotate));
+    aPos = aMatrix * basegfx::B2DPoint(1.0, 1.0);
+    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::LowerRight, fShearX, fRotate));
+
     // get crop values
     const SdrGrafCropItem& rCrop = GetMergedItem(SDRATTR_GRAFCROP);
-
     if(rCrop.GetLeft() || rCrop.GetTop() || rCrop.GetRight() 
||rCrop.GetBottom())
     {
         // decompose object transformation to have current translate and scale
@@ -1218,35 +1235,11 @@ void SdrGrafObj::addCropHandles(SdrHdlList& rTarget) 
const
                 aMatrixForCropViewHdl = aMatrixForCropViewHdl * aPreMultiply;
             }
 
-            rTarget.AddHdl(
-                std::make_unique<SdrCropViewHdl>(
-                    aMatrixForCropViewHdl,
-                    GetGraphicObject().GetGraphic(),
-                    fCropLeft,
-                    fCropTop,
-                    fCropRight,
-                    fCropBottom));
+            rTarget.AddHdl(std::make_unique<SdrCropViewHdl>(
+                aMatrixForCropViewHdl, GetGraphicObject().GetGraphic(), 
fCropLeft, fCropTop,
+                fCropRight, fCropBottom));
         }
     }
-
-    basegfx::B2DPoint aPos;
-
-    aPos = aMatrix * basegfx::B2DPoint(0.0, 0.0);
-    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::UpperLeft, fShearX, fRotate));
-    aPos = aMatrix * basegfx::B2DPoint(0.5, 0.0);
-    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::Upper, fShearX, fRotate));
-    aPos = aMatrix * basegfx::B2DPoint(1.0, 0.0);
-    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::UpperRight, fShearX, fRotate));
-    aPos = aMatrix * basegfx::B2DPoint(0.0, 0.5);
-    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::Left , fShearX, fRotate));
-    aPos = aMatrix * basegfx::B2DPoint(1.0, 0.5);
-    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::Right, fShearX, fRotate));
-    aPos = aMatrix * basegfx::B2DPoint(0.0, 1.0);
-    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::LowerLeft, fShearX, fRotate));
-    aPos = aMatrix * basegfx::B2DPoint(0.5, 1.0);
-    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::Lower, fShearX, fRotate));
-    aPos = aMatrix * basegfx::B2DPoint(1.0, 1.0);
-    
rTarget.AddHdl(std::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), 
basegfx::fround(aPos.getY())), SdrHdlKind::LowerRight, fShearX, fRotate));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit a1fff3578d3970d15a6cf13a519929b8b2c83a52
Author:     Rashesh <[email protected]>
AuthorDate: Wed Feb 5 17:07:07 2025 +0530
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Feb 18 14:28:34 2025 +0100

    sw: lokit: add new `isCropMode` property to LOK_CALLBACK_TEXT_VIEW_SELECTION
    
    Change-Id: I788d0b56bfba2c150401a906c7442652e50da58e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181160
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Gökay ŞATIR <[email protected]>

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 20a9c1948c8b..1a11512e7ab2 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -980,6 +980,9 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
                     + OString::number(p.getY()));
             }
 
+            if (meDragMode == SdrDragMode::Crop)
+                aExtraInfo.append(", \"isCropMode\": true");
+
             if (bWriterGraphic)
             {
                 aExtraInfo.append(", \"isWriterGraphic\": true");
commit 0adbc2df157561f51d2cf0b4996c9be2f222c6f3
Author:     Attila Szűcs <[email protected]>
AuthorDate: Wed Feb 5 13:38:41 2025 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Feb 18 14:28:21 2025 +0100

    SD: fillapi-slide: format text parts
    
    Implemented way to select partial text in a text object, and use
    uno commands to format them.
    
    Tested several uno commands.
    
    to avoid some JSON validity issue:
    "Transforms"
    "SlideCommands"
    "EditTextObject."
    can have array value also, not just object values (as previously)
    
    New useable commands:
    { "EditTextObject.1": [   // start to edit the object-1 on the actual slide
    // multiple commands can be inside of it
    
    New useable commands inside of "EditTextObject.1"
    {"SelectParagraph": 1},   //select the paragraph-1 text in the edited 
textobject
    {"SelectText": [0,1,0,3] },  //select text
    // 0.paragraph,1.character - 0.paragraph 3.character
    // can be used with less parameter
    // [] = select all text (=[0,0,*,*])
    // [1] = select the full paragraph 1 text (=[1,0,1,*])
    // [1,2] = position cursor to paragraph 1, char 2.. no selection 
(=[1,2,1,2])
    // [1,2,3] = select the text between 1. para 2. char - 3.para last char 
(=[1,2,3,*])
    {"InsertText": "-Inserted-"},  //insert text "-Inserted-" into the actual 
textobject
    // to the selected place. It can insert multiple paragraps. "--
++" = 2 paragraph
    // if a text is selected, it will replace that,
    // if cursor was set without selection, then it will extend the text there.
    // It will select the newly inserted tex, so it can be formatted right away
    {"UnoCommand": ".uno:Bold"},   //run the uno command ".uno:Bold" that 
change the
    // selected text format to bold.
    
    several basic formatting unoCommands that worked:
    
    ".uno:Bold", ".uno:Italic", ".uno:Strikeout", ".uno:Shadowed", 
.uno:Underline
    ".uno:DefaultBullet", .uno:DefaultNumbering
    ".uno:SuperScript", ".uno:SubScript"
    // all previous commands are toggle command
    // useing them on a bold text will make it not-bold
    
    ".uno:CenterPara", ".uno:RightPara", ".uno:LeftPara", ".uno:JustifyPara"
    // these commands set the horizontal alignment of whole paragraphs.
    
    ".uno:Color {\"Color.Color\":{\"type\":\"long\",\"value\":2777241}}"
    // set the selected text color to: 2777241 it is a blue like color
    ".uno:CharBackColor 
{\"CharBackColor.Color\":{\"type\":\"long\",\"value\":6710886}}"
    // set the background color of the selected text to: 6710886 it is a gray 
color
    
    a sample transform:
    {
        "Transforms": [
            { "SlideCommands": [
                {"JumpToSlide": 0},
                {"EditTextObject.1": [
                    {"SelectParagraph": 1},
                    {"InsertText": "----
++++"},
                    {"UnoCommand": ".uno:DefaultNumbering"},
                    {"SelectText": [0,1,0,3] },
                    {"InsertText": "-Inserted-"},
                    {"UnoCommand": ".uno:Underline"},
                    {"UnoCommand": ".uno:Bold"},
                    {"UnoCommand": ".uno:Italic"},
                    {"UnoCommand": ".uno:Strikeout"},
                    {"UnoCommand": ".uno:Shadowed"},
                    {"UnoCommand": ".uno:JustifyPara"},
                    {"UnoCommand": ".uno:DefaultBullet"},
                    {"UnoCommand": ".uno:SuperScript"},
                    {"SelectText": [0,14,0,17] },
                    {"UnoCommand": ".uno:SubScript"},
                    {"UnoCommand": ".uno:Color 
{\"Color.Color\":{\"type\":\"long\",\"value\":2777241}}"},
                    {"UnoCommand": ".uno:CharBackColor 
{\"CharBackColor.Color\":{\"type\":\"long\",\"value\":6710886}}"},
                    {"SelectParagraph": 1},
                    {"UnoCommand": ".uno:CenterPara"},
                    {"SelectParagraph": 2},
                    {"UnoCommand": ".uno:RightPara"},
                    {"SelectParagraph": 3},
                    {"UnoCommand": ".uno:LeftPara"}
                ]  }
            ] }
        ]
    }
    
    Change-Id: I90eba60f8b31e48c681283fa27a6c7daa1886141
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181171
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 7803fe605f02..7626fb6427e3 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -79,6 +79,7 @@
 #include <svx/hlnkitem.hxx>
 #include <svx/imapdlg.hxx>
 #include <svx/sdtagitm.hxx>
+#include <svx/svdetc.hxx>
 #include <svx/svdograf.hxx>
 #include <svx/svdoole2.hxx>
 #include <svx/svdpagv.hxx>
@@ -203,6 +204,7 @@
 #include <iostream>
 #include <boost/property_tree/json_parser.hpp>
 #include <rtl/uri.hxx>
+#include <editeng/editeng.hxx>
 
 
 using namespace ::com::sun::star;
@@ -257,6 +259,55 @@ void lcl_LogWarning(const std::string& rWarning)
     LOK_WARN("sd.transform", rWarning);
 }
 
+void lcl_UnoCommand(const std::string& rText)
+{
+    if (rText.size() > 0)
+    {
+        OUString aCmd;
+        std::vector<beans::PropertyValue> aArg;
+        std::size_t nSpace = rText.find(' ');
+        if (nSpace != std::string::npos)
+        {
+            aCmd = OStringToOUString(rText.substr(0, nSpace), 
RTL_TEXTENCODING_UTF8);
+            std::string aArgText = rText.substr(nSpace + 1);
+
+            aArg = comphelper::JsonToPropertyValues(aArgText);
+        }
+        else
+        {
+            aCmd = OStringToOUString(rText, RTL_TEXTENCODING_UTF8);
+        }
+
+        OUString aCmdSub;
+        if (aCmd.startsWith(".uno:"))
+        {
+            aCmdSub = aCmd.subView(5);
+        }
+        else
+        {
+            lcl_LogWarning("FillApi SlideCmd: uno command not recognized'" + 
rText + "'");
+            return;
+        }
+
+        // Check if the uno command is allowed
+        const std::map<std::u16string_view, KitUnoCommand>& rUnoCommandList
+            = GetKitUnoCommandList();
+        auto aCmdData = rUnoCommandList.find(aCmdSub);
+        if (aCmdData != rUnoCommandList.end())
+        {
+            // Make the uno command synchron
+            aArg.push_back(comphelper::makePropertyValue("SynchronMode", 
true));
+
+            // Todo: check why it does not work on my windows system
+            comphelper::dispatchCommand(aCmd, 
comphelper::containerToSequence(aArg));
+        }
+        else
+        {
+            lcl_LogWarning("FillApi SlideCmd: uno command not recognized'" + 
rText + "'");
+        }
+    }
+}
+
 class ClassificationCommon
 {
 protected:
@@ -778,8 +829,13 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                 if (aItem.first == "Transforms")
                 {
                     // Handle all transformations
-                    for (const auto& aItem2 : aItem.second)
+                    for (const auto& aItem2Obj : aItem.second)
                     {
+                        // handle `"Transforms": { `  and `"Transforms": [` 
cases as well
+                        // if an element is an object `{...}`, then get the 
first element of the object
+                        const auto& aItem2
+                            = aItem2Obj.first == "" ? 
*aItem2Obj.second.ordered_begin() : aItem2Obj;
+
                         //jump to slide
                         if (aItem2.first == "SlideCommands")
                         {
@@ -787,7 +843,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                             int nNextPageId = 0;
                             for (const auto& aItem3Obj : aItem2.second)
                             {
-                                const auto& aItem3 = 
*aItem3Obj.second.ordered_begin();
+                                // It accept direct property, or object as well
+                                const auto& aItem3 = aItem3Obj.first == ""
+                                                         ? 
*aItem3Obj.second.ordered_begin()
+                                                         : aItem3Obj;
 
                                 sal_uInt16 nPageCount
                                     = 
GetDoc()->GetSdPageCount(PageKind::Standard);
@@ -1142,8 +1201,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                                          || aItem3.first == "UnMarkObject")
                                 {
                                     bool bUnMark = aItem3.first == 
"UnMarkObject";
-                                    int nObjId
-                                        = 
static_cast<AutoLayout>(aItem3.second.get_value<int>());
+                                    int nObjId = 
aItem3.second.get_value<int>();
 
                                     SdPage* pPageStandard
                                         = GetDoc()->GetSdPage(nActPageId, 
PageKind::Standard);
@@ -1170,48 +1228,122 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                                             + "' (Object Count = " + 
std::to_string(nObjId));
                                     }
                                 }
-                                else if (aItem3.first == "UnoCommand")
+
+                                else if 
(aItem3.first.starts_with("EditTextObject."))
                                 {
-                                    std::string aText = 
aItem3.second.get_value<std::string>();
-                                    if (aText.size() > 0)
+                                    int nObjId = stoi(aItem3.first.substr(15));
+                                    SdPage* pPageStandard
+                                        = GetDoc()->GetSdPage(nActPageId, 
PageKind::Standard);
+                                    int nObjCount = 
pPageStandard->GetObjCount();
+                                    if (nObjId < 0)
                                     {
-                                        OUString aCmd;
-                                        std::vector<beans::PropertyValue> aArg;
-                                        std::size_t nSpace = aText.find(' ');
-                                        if (nSpace != std::string::npos)
-                                        {
-                                            aCmd = 
OStringToOUString(aText.substr(0, nSpace),
-                                                                     
RTL_TEXTENCODING_UTF8);
-                                            std::string aArgText = 
aText.substr(nSpace + 1);
-
-                                            aArg = 
comphelper::JsonToPropertyValues(aArgText);
-                                        }
-                                        else
-                                        {
-                                            aCmd = OStringToOUString(aText, 
RTL_TEXTENCODING_UTF8);
-                                        }
-
-                                        // Check if the uno command is allowed
-                                        const std::map<std::u16string_view, 
KitUnoCommand>& rUnoCommandList = GetKitUnoCommandList();
-                                        const bool bSupportedCmd = 
rUnoCommandList.find(aCmd) != rUnoCommandList.end();
-                                        if (bSupportedCmd)
+                                        lcl_LogWarning(
+                                            "FillApi SlideCmd EditTextObject: 
Object idx < 0. '"
+                                            + aItem3.first + "'");
+                                    }
+                                    else if (nObjId >= nObjCount)
+                                    {
+                                        lcl_LogWarning(
+                                            "FillApi SlideCmd EditTextObject: 
Object idx >= "
+                                            "Object Count. '"
+                                            + aItem3.first
+                                            + "' (Object Count = " + 
std::to_string(nPageCount));
+                                    }
+                                    else
+                                    {
+                                        SdrObject* pSdrObj = 
pPageStandard->GetObj(nObjId);
+                                        if (!pSdrObj->IsSdrTextObj())
                                         {
-                                            // Make the uno command synchron
-                                            
aArg.push_back(comphelper::makePropertyValue(
-                                                "SynchronMode", true));
-
-                                            // Todo: check why it does not 
work on my windows system
-                                            comphelper::dispatchCommand(
-                                                aCmd, 
comphelper::containerToSequence(aArg));
+                                            lcl_LogWarning(
+                                                "FillApi SlideCmd 
EditTextObject: Object is "
+                                                "not a TextObject. '"
+                                                + aItem3.first + "'");
                                         }
                                         else
                                         {
-                                            lcl_LogWarning(
-                                                "FillApi SlideCmd: uno command 
not recognized'"
-                                                + aText + "'");
+                                            SdrTextObj* pSdrTxt = 
static_cast<SdrTextObj*>(pSdrObj);
+                                            SdrView* pView1 = GetView();
+                                            pView1->MarkObj(pSdrTxt, 
pView1->GetSdrPageView());
+                                            pView1->SdrBeginTextEdit(pSdrTxt);
+                                            EditView& rEditView
+                                                = 
pView1->GetTextEditOutlinerView()->GetEditView();
+                                            for (const auto& aItem4Obj : 
aItem3.second)
+                                            {
+                                                const auto& aItem4
+                                                    = aItem4Obj.first == ""
+                                                          ? 
*aItem4Obj.second.ordered_begin()
+                                                          : aItem4Obj;
+
+                                                if (aItem4.first == 
"SelectText")
+                                                {
+                                                    std::vector<int> aValues;
+                                                    for (const auto& aItem5 : 
aItem4.second)
+                                                    {
+                                                        //if == last?
+                                                        
aValues.push_back(aItem5.second.get_value<int>());
+                                                    }
+                                                    if (aValues.size() == 0)
+                                                    {
+                                                        //select the whole text
+                                                        aValues.push_back(0);
+                                                        aValues.push_back(0);
+                                                        
aValues.push_back(EE_PARA_MAX_COUNT);
+                                                        
aValues.push_back(EE_TEXTPOS_MAX_COUNT);
+                                                    }
+                                                    else if (aValues.size() == 
1)
+                                                    {
+                                                        //select the paragraph
+                                                        aValues.push_back(0);
+                                                        
aValues.push_back(aValues[0]);
+                                                        
aValues.push_back(EE_TEXTPOS_MAX_COUNT);
+                                                    }
+                                                    else if (aValues.size() == 
2)
+                                                    {
+                                                        // set the cursor 
without selecting anything
+                                                        
aValues.push_back(aValues[0]);
+                                                        
aValues.push_back(aValues[1]);
+                                                    }
+                                                    else if (aValues.size() == 
3)
+                                                    {
+                                                        
aValues.push_back(EE_TEXTPOS_MAX_COUNT);
+                                                    }
+
+                                                    const ESelection 
rNewSel(aValues[0], aValues[1],
+                                                                             
aValues[2], aValues[3]);
+                                                    
rEditView.SetSelection(rNewSel);
+                                                }
+                                                else if (aItem4.first == 
"SelectParagraph")
+                                                {
+                                                    int nParaId = 
aItem4.second.get_value<int>();
+
+                                                    const ESelection 
rNewSel(nParaId, 0, nParaId,
+                                                                             
EE_TEXTPOS_MAX_COUNT);
+                                                    
rEditView.SetSelection(rNewSel);
+                                                }
+                                                else if (aItem4.first == 
"InsertText")
+                                                {
+                                                    OUString aText = 
OStringToOUString(
+                                                        
aItem4.second.get_value<std::string>(),
+                                                        RTL_TEXTENCODING_UTF8);
+                                                    // It select the inserted 
text also
+                                                    
rEditView.InsertText(aText, true);
+                                                }
+                                                else if (aItem4.first == 
"UnoCommand")
+                                                {
+                                                    std::string aText
+                                                        = 
aItem4.second.get_value<std::string>();
+                                                    lcl_UnoCommand(aText);
+                                                }
+                                            }
+                                            pView1->SdrEndTextEdit();
                                         }
                                     }
                                 }
+                                else if (aItem3.first == "UnoCommand")
+                                {
+                                    std::string aText = 
aItem3.second.get_value<std::string>();
+                                    lcl_UnoCommand(aText);
+                                }
                             }
                         }
                     }
commit 5fcf43eae352290bd87f7771411de4b0d6706daf
Author:     Justin Luth <[email protected]>
AuthorDate: Sat Feb 8 20:00:38 2025 -0500
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Feb 18 14:27:38 2025 +0100

    tdf#164876 tdf#165117 writerfilter: no dummy paragraphs in header
    
    The problem was that an extra CR was being added
    (often every round-trip) to headers that started with a table.
    
    This is a long-standing bug (see moz1211781-1.docx)
    that got more exposure recently from changes to
    7.6.6 (via 86ad08f9d25110e91e92a0badf6de75e785b3644)
    and 24.8.0 (via ef77086255821d61838a7e26fee9baadaca0b9e0)
    
    Change-Id: Idb6a0efda246fa064822f01a9ce097f686810b5c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181307
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <[email protected]>
    (cherry picked from commit 44eda1f72b4d67b9627155741067d3e57a1f9747)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181354
    Reviewed-by: Xisco Fauli <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181368
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181420
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 479373de6660..8183dccd70a3 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3418,7 +3418,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
         if (m_pImpl->m_StreamStateStack.top().nTableDepth == 0
             && m_pImpl->GetIsFirstParagraphInSection()
                 && !m_pImpl->GetIsDummyParaAddedForTableInSection() && 
!m_pImpl->GetIsTextFrameInserted()
-                && !m_pImpl->GetIsPreviousParagraphFramed() && 
!IsInHeaderFooter())
+                && !m_pImpl->GetIsPreviousParagraphFramed())
         {
             m_pImpl->AddDummyParaForTableInSection();
         }
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 2247758d8ad0..0057799f99a2 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -691,8 +691,8 @@ void DomainMapper_Impl::RemoveDummyParaForTableInSection()
 }
 void DomainMapper_Impl::AddDummyParaForTableInSection()
 {
-    // Shapes and textboxes can't have sections.
-    if (IsInShape() || m_bIsInTextBox)
+    // Shapes, headers, and textboxes can't have sections.
+    if (IsInShape() || IsInHeaderFooter() || m_bIsInTextBox)
         return;
 
     if (!m_aTextAppendStack.empty())
commit 53d8f881df922082848f54978a97edaaece47c75
Author:     Justin Luth <[email protected]>
AuthorDate: Fri Feb 7 14:08:42 2025 -0500
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Feb 18 14:27:20 2025 +0100

    tdf#165130 sc: prevent pane's topLeftCell from being in frozen zone
    
    While Excel 2010 opens this unit test just fine
    (and looks like a split window)
    Excel 2019 complains it is corrupt.
    
    So, this patch just prevents writing an invalid topLeftCell
    which will avoid us from causing such a problem
    as well as fixing documents that already exhibit the problem.
    
    make CppunitTest_sc_subsequent_export_test2 \
        CPPUNIT_TEST_NAME=testFreezePaneStartCellXLSX
    
    Change-Id: I32888d7d020ec16dca436686cd76008ed417d699
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181275
    Reviewed-by: Justin Luth <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit 5ef44a0b2ad238fbd13196e2f602de71f42a34d1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181301
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/sc/qa/unit/data/xlsx/freezePaneStartCell.xlsx 
b/sc/qa/unit/data/xlsx/freezePaneStartCell.xlsx
new file mode 100644
index 000000000000..9bce2671009c
Binary files /dev/null and b/sc/qa/unit/data/xlsx/freezePaneStartCell.xlsx 
differ
diff --git a/sc/qa/unit/subsequent_export_test2.cxx 
b/sc/qa/unit/subsequent_export_test2.cxx
index a1d57e133e70..55908afd7558 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -50,6 +50,23 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testGroupShape)
     assertXPath(pDoc, 
"/xdr:wsDr/xdr:twoCellAnchor/xdr:grpSp/xdr:grpSpPr"_ostr);
 }
 
+CPPUNIT_TEST_FIXTURE(ScExportTest2, testFreezePaneStartCellXLSX)
+{
+    // given a hand-mangled document with a newly-invalid topLeftCell for the 
active pane
+    // where pane xSplit="5" ySplit="10" topLeftCell="A1" state="frozen"
+
+    createScDoc("xlsx/freezePaneStartCell.xlsx");
+
+    save(u"Calc Office Open XML"_ustr);
+
+    xmlDocUniquePtr pDoc = parseExport(u"xl/worksheets/sheet1.xml"_ustr);
+    OUString sFirstNonFrozenCell
+        = getXPath(pDoc, "//x:sheetViews//x:pane"_ostr, "topLeftCell"_ostr);
+
+    // new versions of Excel complain if the start of the non-frozen section 
is inside the freeze
+    CPPUNIT_ASSERT_EQUAL(u"F11"_ustr, sFirstNonFrozenCell);
+}
+
 CPPUNIT_TEST_FIXTURE(ScExportTest2, testMatrixMultiplicationXLSX)
 {
     createScDoc("xlsx/matrix-multiplication.xlsx");
diff --git a/sc/source/filter/excel/xeview.cxx 
b/sc/source/filter/excel/xeview.cxx
index 5db6de1c2fff..c5760fafcdb7 100644
--- a/sc/source/filter/excel/xeview.cxx
+++ b/sc/source/filter/excel/xeview.cxx
@@ -348,6 +348,13 @@ XclExpTabViewSettings::XclExpTabViewSettings( const 
XclExpRoot& rRoot, SCTAB nSc
                 maData.mnActivePane = EXC_PANE_TOPRIGHT;
             else if( maData.HasPane( EXC_PANE_BOTTOMLEFT ) )
                 maData.mnActivePane = EXC_PANE_BOTTOMLEFT;
+
+            // Starting cell for active, frozen pane must not be less than the 
split position
+            // i.e. it must not be in the frozen section (or Excel 2019 
considers the file corrupt).
+            if (maData.maSecondXclPos.mnCol < maData.mnSplitX)
+                maData.maSecondXclPos.mnCol = maData.mnSplitX;
+            if (maData.maSecondXclPos.mnRow < maData.mnSplitY)
+                maData.maSecondXclPos.mnRow = maData.mnSplitY;
         }
         else
         {
commit ca8ec6351f9265c08e507715f4f4b3aa2e30bbcf
Author:     Banobe Pascal <[email protected]>
AuthorDate: Sun Feb 9 23:19:04 2025 +0300
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Feb 18 14:27:07 2025 +0100

    jsdialog: reorganize style list sidebar panel information hierarchy
    
    The style list sidebar panel components were poorly organized,
    leading to confusion about the relationship between controls and
    their effects. This commit implements a standardized visual hierarchy:
    
    New hierarchy:
    - Toolbar (top-level actions)
    - Settings (show previews and spotlight)
    - Filter controls (filter list)
    - TreeView/FlatView (filtered content)
    
    Previous hierarchy:
    - Toolbar
    - TreeView/FlatView
    - Filter controls
    - Settings
    
    Signed-off-by: Banobe Pascal <[email protected]>
    Change-Id: I9eac2719ba3dd1bbf8f62b324b05d47ca418bd7b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181322
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Szymon Kłos <[email protected]>
    Reviewed-by: Pedro Silva <[email protected]>

diff --git a/sfx2/uiconfig/ui/templatepanel.ui 
b/sfx2/uiconfig/ui/templatepanel.ui
index d35533769b49..a8d2d61377f6 100644
--- a/sfx2/uiconfig/ui/templatepanel.ui
+++ b/sfx2/uiconfig/ui/templatepanel.ui
@@ -182,6 +182,58 @@
         <property name="position">0</property>
       </packing>
     </child>
+    <child>
+      <object class="GtkBox" id="settings">
+        <property name="visible">True</property>
+        <property name="can-focus">False</property>
+        <child>
+          <object class="GtkCheckButton" id="showpreview">
+            <property name="label" translatable="yes" 
context="commontemplate|STR_PREVIEW_CHECKBOX">Show previews</property>
+            <property name="visible">True</property>
+            <property name="can-focus">True</property>
+            <property name="receives-default">False</property>
+            <property name="use-underline">True</property>
+            <property name="draw-indicator">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="highlightstyles">
+            <property name="label" translatable="yes" 
context="commontemplate|STR_HIGHLIGHT_CHECKBOX">Spotlight</property>
+            <property name="can-focus">True</property>
+            <property name="receives-default">False</property>
+            <property name="use-underline">True</property>
+            <property name="draw-indicator">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="homogeneous">True</property>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkComboBoxText" id="filter">
+        <property name="visible">True</property>
+        <property name="can-focus">False</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">2</property>
+      </packing>
+    </child>
     <child>
       <object class="GtkScrolledWindow">
         <property name="can-focus">True</property>
@@ -235,7 +287,7 @@
       <packing>
         <property name="expand">False</property>
         <property name="fill">True</property>
-        <property name="position">1</property>
+        <property name="position">3</property>
       </packing>
     </child>
     <child>
@@ -289,58 +341,6 @@
           </object>
         </child>
       </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">2</property>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkBox" id="settings">
-        <property name="visible">True</property>
-        <property name="can-focus">False</property>
-        <child>
-          <object class="GtkCheckButton" id="showpreview">
-            <property name="label" translatable="yes" 
context="commontemplate|STR_PREVIEW_CHECKBOX">Show previews</property>
-            <property name="visible">True</property>
-            <property name="can-focus">True</property>
-            <property name="receives-default">False</property>
-            <property name="use-underline">True</property>
-            <property name="draw-indicator">True</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="highlightstyles">
-            <property name="label" translatable="yes" 
context="commontemplate|STR_HIGHLIGHT_CHECKBOX">Spotlight</property>
-            <property name="can-focus">True</property>
-            <property name="receives-default">False</property>
-            <property name="use-underline">True</property>
-            <property name="draw-indicator">True</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-      </object>
-      <packing>
-        <property name="homogeneous">True</property>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">5</property>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkComboBoxText" id="filter">
-        <property name="visible">True</property>
-        <property name="can-focus">False</property>
-      </object>
       <packing>
         <property name="expand">False</property>
         <property name="fill">True</property>
commit 2a49f4cd26b5938edfed79bfac42644e7183ee69
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue Feb 4 20:08:17 2025 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Feb 18 14:26:55 2025 +0100

    filter out instance metadata connections
    
    Change-Id: Iad8b06515700f88c07bd22fa31fb2deb85dde805
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181144
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Ashod Nakashian <[email protected]>

diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index 7089dcacdbdb..ff64fc6638e0 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -49,6 +49,11 @@
 #include <tuple>
 #include <utility>
 
+#ifndef _WIN32
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#endif
+
 using namespace ::com::sun::star;
 
 namespace
@@ -584,6 +589,67 @@ static auto ExtractRealm(ResponseHeaders const& rHeaders, 
char const* const pAut
     return buf.makeStringAndClear();
 }
 
+#ifndef _WIN32
+
+static std::string makeIPAddress(const sockaddr& ai_addr)
+{
+    char addrstr[INET6_ADDRSTRLEN];
+
+    static_assert(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN, "ipv6 addresses are 
longer than ipv4");
+    const void* inAddr = nullptr;
+    switch (ai_addr.sa_family)
+    {
+        case AF_INET:
+        {
+            auto ipv4 = reinterpret_cast<const sockaddr_in*>(&ai_addr);
+            inAddr = &(ipv4->sin_addr);
+            break;
+        }
+        case AF_INET6:
+        {
+            auto ipv6 = reinterpret_cast<const sockaddr_in6*>(&ai_addr);
+            inAddr = &(ipv6->sin6_addr);
+            break;
+        }
+    }
+
+    if (!inAddr)
+    {
+        SAL_WARN("ucb.ucp.webdav.curl", "Unknown sa_family: " << 
ai_addr.sa_family);
+        return std::string();
+    }
+
+    const char* result = inet_ntop(ai_addr.sa_family, inAddr, addrstr, 
sizeof(addrstr));
+    if (!result)
+    {
+        SAL_WARN("ucb.ucp.webdav.curl", "inet_ntop failure");
+        return std::string();
+    }
+    return std::string(result);
+}
+
+// filter out connections to instance metadata
+static curl_socket_t opensocket_callback(void* /*clientp*/, curlsocktype 
purpose,
+                                         struct curl_sockaddr* address)
+{
+    if (purpose == CURLSOCKTYPE_IPCXN)
+    {
+        if (address->family == AF_INET && makeIPAddress(address->addr) == 
"169.254.169.254")
+        {
+            SAL_WARN("ucb.ucp.webdav.curl", "ignoring instance metadata ip");
+            return CURL_SOCKET_BAD;
+        }
+        else if (address->family == AF_INET6 && makeIPAddress(address->addr) 
== "fd00:ec2::254")
+        {
+            SAL_WARN("ucb.ucp.webdav.curl", "ignoring instance metadata ip");
+            return CURL_SOCKET_BAD;
+        }
+    }
+    return socket(address->family, address->socktype, address->protocol);
+}
+
+#endif
+
 CurlSession::CurlSession(uno::Reference<uno::XComponentContext> xContext,
                          ::rtl::Reference<DAVSessionFactory> const& rpFactory, 
OUString const& rURI,
                          uno::Sequence<beans::NamedValue> const& rFlags,
@@ -699,6 +765,14 @@ 
CurlSession::CurlSession(uno::Reference<uno::XComponentContext> xContext,
         rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_SSL_VERIFYHOST, 0L);
         assert(rc == CURLE_OK);
     }
+
+#ifndef _WIN32
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_OPENSOCKETFUNCTION, 
opensocket_callback);
+        assert(rc == CURLE_OK);
+    }
+#endif
 }
 
 CurlSession::~CurlSession() {}
commit c074795a9f1f1009fc8b6fdfb47d4dd5362aa14b
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Feb 7 09:27:00 2025 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Feb 18 14:26:43 2025 +0100

    add Writer/Content/NonprintingCharacter to allowed list
    
    Change-Id: I18f44e52d2cd576cd5f94e77305c364f9379e45d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181234
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 7d402d9794d9..9266cb5648e8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5102,7 +5102,8 @@ static void updateConfig(const OUString& rConfigPath)
 
                     u"/org.openoffice.Office.Writer/Grid"_ustr,
                     u"/org.openoffice.Office.Writer/Print"_ustr,
-                    
u"/org.openoffice.Office.Writer/Content/Display/GraphicObject"_ustr
+                    
u"/org.openoffice.Office.Writer/Content/Display/GraphicObject"_ustr,
+                    
u"/org.openoffice.Office.Writer/Content/NonprintingCharacter"_ustr
                 };
                 xUpdate->insertModificationXcuFile(xcustat.getFileURL(), 
aAllowedSubset, {});
             }
commit 48398303b3c15619c6e88585547156a05afb657f
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Fri Jan 10 23:26:03 2025 +0900
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Feb 18 14:26:32 2025 +0100

    pdfium: add support for reading the structure tree
    
    + add test for reading the tree
    
    Change-Id: I2f0e9d1852d20b3aa20ec0bcdd3ebc65370d15dd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180124
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180880
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/include/vcl/filter/PDFiumLibrary.hxx 
b/include/vcl/filter/PDFiumLibrary.hxx
index 40895a0f402c..22d656e4c367 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -183,6 +183,34 @@ public:
     virtual basegfx::B2DRectangle getCharBox(int nIndex, double fPageHeight) = 
0;
 };
 
+class VCL_DLLPUBLIC PDFiumStructureElement
+{
+public:
+    virtual ~PDFiumStructureElement() = default;
+
+    virtual OUString getAltText() = 0;
+    virtual OUString getActualText() = 0;
+    virtual OUString getID() = 0;
+    virtual OUString getLang() = 0;
+    virtual OUString getTitle() = 0;
+    virtual OUString getType() = 0;
+    virtual OUString getObjectType() = 0;
+
+    virtual int getNumberOfChildren() = 0;
+    virtual int getChildMarkedContentID(int nIndex) = 0;
+    virtual std::unique_ptr<PDFiumStructureElement> getChild(int nIndex) = 0;
+    virtual std::unique_ptr<PDFiumStructureElement> getParent() = 0;
+};
+
+class VCL_DLLPUBLIC PDFiumStructureTree
+{
+public:
+    virtual ~PDFiumStructureTree() = default;
+
+    virtual int getNumberOfChildren() = 0;
+    virtual std::unique_ptr<PDFiumStructureElement> getChild(int nIndex) = 0;
+};
+
 class VCL_DLLPUBLIC PDFiumPage
 {
 public:
@@ -197,6 +225,7 @@ public:
     virtual std::unique_ptr<PDFiumAnnotation> getAnnotation(int nIndex) = 0;
 
     virtual std::unique_ptr<PDFiumTextPage> getTextPage() = 0;
+    virtual std::unique_ptr<PDFiumStructureTree> getStructureTree() = 0;
 
     /// Get bitmap checksum of the page, without annotations/commenting.
     virtual BitmapChecksum getChecksum(int nMDPPerm) = 0;
diff --git a/vcl/qa/cppunit/PDFiumLibraryTest.cxx 
b/vcl/qa/cppunit/PDFiumLibraryTest.cxx
index 45c59b46d447..1db325dbe889 100644
--- a/vcl/qa/cppunit/PDFiumLibraryTest.cxx
+++ b/vcl/qa/cppunit/PDFiumLibraryTest.cxx
@@ -486,6 +486,151 @@ CPPUNIT_TEST_FIXTURE(PDFiumLibraryTest, testTools)
     CPPUNIT_ASSERT_EQUAL(false, bool(aDateTime.IsUTC));
 }
 
+CPPUNIT_TEST_FIXTURE(PDFiumLibraryTest, testStructureTree)
+{
+    OUString aURL = getFullUrl(u"StructureTreeExampleDocument.pdf");
+    SvFileStream aStream(aURL, StreamMode::READ);
+    GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
+    Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream);
+    auto pVectorGraphicData = aGraphic.getVectorGraphicData();
+    CPPUNIT_ASSERT(pVectorGraphicData);
+    CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, 
pVectorGraphicData->getType());
+    auto& rDataContainer = pVectorGraphicData->getBinaryDataContainer();
+
+    auto pPdfium = vcl::pdf::PDFiumLibrary::get();
+    CPPUNIT_ASSERT(pPdfium);
+
+    auto pDocument
+        = pPdfium->openDocument(rDataContainer.getData(), 
rDataContainer.getSize(), OString());
+    CPPUNIT_ASSERT(pDocument);
+
+    CPPUNIT_ASSERT_EQUAL(1, pDocument->getPageCount());
+
+    auto pPage = pDocument->openPage(0);
+    CPPUNIT_ASSERT(pPage);
+
+    auto pTree = pPage->getStructureTree();
+    CPPUNIT_ASSERT(pTree);
+    CPPUNIT_ASSERT_EQUAL(1, pTree->getNumberOfChildren());
+
+    // Check the structure
+    {
+        auto pChildDocument = pTree->getChild(0);
+        CPPUNIT_ASSERT(pChildDocument);
+        CPPUNIT_ASSERT_EQUAL(5, pChildDocument->getNumberOfChildren());
+
+        CPPUNIT_ASSERT_EQUAL(u""_ustr, pChildDocument->getAltText());
+        CPPUNIT_ASSERT_EQUAL(u""_ustr, pChildDocument->getActualText());
+        CPPUNIT_ASSERT_EQUAL(u""_ustr, pChildDocument->getID());
+        CPPUNIT_ASSERT_EQUAL(u""_ustr, pChildDocument->getLang());
+        CPPUNIT_ASSERT_EQUAL(u""_ustr, pChildDocument->getTitle());
+        CPPUNIT_ASSERT_EQUAL(u"Document"_ustr, pChildDocument->getType());
+        CPPUNIT_ASSERT_EQUAL(u"StructElem"_ustr, 
pChildDocument->getObjectType());
+
+        {
+            auto pThis = pChildDocument->getChild(0);
+            CPPUNIT_ASSERT(pThis);
+            CPPUNIT_ASSERT_EQUAL(u"P"_ustr, pThis->getType());
+            CPPUNIT_ASSERT_EQUAL(1, pThis->getNumberOfChildren());
+            CPPUNIT_ASSERT_EQUAL(0, pThis->getChildMarkedContentID(0));
+        }
+
+        {
+            auto pThis = pChildDocument->getChild(1);
+            CPPUNIT_ASSERT(pThis);
+            CPPUNIT_ASSERT_EQUAL(u"H1"_ustr, pThis->getType());
+            CPPUNIT_ASSERT_EQUAL(2, pThis->getNumberOfChildren());
+            CPPUNIT_ASSERT_EQUAL(1, pThis->getChildMarkedContentID(0));
+            CPPUNIT_ASSERT_EQUAL(2, pThis->getChildMarkedContentID(1));
+        }
+
+        {
+            auto pThis = pChildDocument->getChild(2);
+            CPPUNIT_ASSERT(pThis);
+            CPPUNIT_ASSERT_EQUAL(u"P"_ustr, pThis->getType());
+            CPPUNIT_ASSERT_EQUAL(13, pThis->getNumberOfChildren());
+            CPPUNIT_ASSERT_EQUAL(3, pThis->getChildMarkedContentID(0));
+            {
+                auto pChild = pThis->getChild(1);
+                CPPUNIT_ASSERT_EQUAL(u"Code"_ustr, pChild->getType());
+                CPPUNIT_ASSERT_EQUAL(4, pChild->getChildMarkedContentID(0));
+
+                // Check getParent
+                auto pThis2 = pChild->getParent();
+                CPPUNIT_ASSERT_EQUAL(u"P"_ustr, pThis2->getType());
+                CPPUNIT_ASSERT_EQUAL(13, pThis2->getNumberOfChildren());
+            }
+            CPPUNIT_ASSERT_EQUAL(5, pThis->getChildMarkedContentID(2));
+            CPPUNIT_ASSERT_EQUAL(6, pThis->getChildMarkedContentID(3));
+            {
+                auto pChild = pThis->getChild(4);
+                CPPUNIT_ASSERT_EQUAL(u"Span"_ustr, pChild->getType());
+                CPPUNIT_ASSERT_EQUAL(7, pChild->getChildMarkedContentID(0));
+            }
+            CPPUNIT_ASSERT_EQUAL(8, pThis->getChildMarkedContentID(5));
+            CPPUNIT_ASSERT_EQUAL(9, pThis->getChildMarkedContentID(6));
+            {
+                auto pChild = pThis->getChild(7);
+                CPPUNIT_ASSERT_EQUAL(u"Span"_ustr, pChild->getType());
+                CPPUNIT_ASSERT_EQUAL(10, pChild->getChildMarkedContentID(0));
+            }
+            CPPUNIT_ASSERT_EQUAL(11, pThis->getChildMarkedContentID(8));
+            CPPUNIT_ASSERT_EQUAL(12, pThis->getChildMarkedContentID(9));
+            {
+                auto pChild = pThis->getChild(10);
+                CPPUNIT_ASSERT_EQUAL(u"Span"_ustr, pChild->getType());
+                CPPUNIT_ASSERT_EQUAL(13, pChild->getChildMarkedContentID(0));
+            }
+            CPPUNIT_ASSERT_EQUAL(14, pThis->getChildMarkedContentID(11));
+            {
+                auto pChild = pThis->getChild(12);
+                CPPUNIT_ASSERT_EQUAL(u"Span"_ustr, pChild->getType());
+                CPPUNIT_ASSERT_EQUAL(15, pChild->getChildMarkedContentID(0));
+            }
+        }
+
+        {
+            auto pThis = pChildDocument->getChild(3);
+            CPPUNIT_ASSERT(pThis);
+            CPPUNIT_ASSERT_EQUAL(u"P"_ustr, pThis->getType());
+            CPPUNIT_ASSERT_EQUAL(4, pThis->getNumberOfChildren());
+            CPPUNIT_ASSERT_EQUAL(16, pThis->getChildMarkedContentID(0));
+            {
+                auto pChild = pThis->getChild(1);
+                CPPUNIT_ASSERT_EQUAL(u"Quote"_ustr, pChild->getType());
+                CPPUNIT_ASSERT_EQUAL(17, pChild->getChildMarkedContentID(0));
+            }
+            CPPUNIT_ASSERT_EQUAL(18, pThis->getChildMarkedContentID(2));
+            {
+                auto pChild = pThis->getChild(3);
+                // Rectangle
+                CPPUNIT_ASSERT_EQUAL(u"Div"_ustr, pChild->getType());
+                CPPUNIT_ASSERT_EQUAL(u"Only Text! - The Alt Text!"_ustr, 
pChild->getAltText());
+                CPPUNIT_ASSERT_EQUAL(20, pChild->getChildMarkedContentID(0));
+                {
+                    // Text in rectangle
+                    auto pRectangleElement = pChild->getChild(1);
+                    CPPUNIT_ASSERT_EQUAL(u"P"_ustr, 
pRectangleElement->getType());
+                    CPPUNIT_ASSERT_EQUAL(21, 
pRectangleElement->getChildMarkedContentID(0));
+                }
+            }
+        }
+
+        {
+            auto pThis = pChildDocument->getChild(4);
+            CPPUNIT_ASSERT(pThis);
+            CPPUNIT_ASSERT_EQUAL(u"P"_ustr, pThis->getType());
+            CPPUNIT_ASSERT_EQUAL(1, pThis->getNumberOfChildren());
+            CPPUNIT_ASSERT_EQUAL(19, pThis->getChildMarkedContentID(0));
+        }
+
+        {
+            auto pThis = pChildDocument->getChild(5);
+            CPPUNIT_ASSERT(!pThis);
+        }
+    }
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qa/cppunit/data/StructureTreeExampleDocument.odt 
b/vcl/qa/cppunit/data/StructureTreeExampleDocument.odt
new file mode 100644
index 000000000000..18631b2df570
Binary files /dev/null and 
b/vcl/qa/cppunit/data/StructureTreeExampleDocument.odt differ
diff --git a/vcl/qa/cppunit/data/StructureTreeExampleDocument.pdf 
b/vcl/qa/cppunit/data/StructureTreeExampleDocument.pdf
new file mode 100644
index 000000000000..a89fb067060a
Binary files /dev/null and 
b/vcl/qa/cppunit/data/StructureTreeExampleDocument.pdf differ
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx
index d56562f34b74..c23db7ebc84d 100644
--- a/vcl/source/pdf/PDFiumLibrary.cxx
+++ b/vcl/source/pdf/PDFiumLibrary.cxx
@@ -21,6 +21,7 @@
 #include <fpdf_signature.h>
 #include <fpdf_formfill.h>
 #include <fpdf_attachment.h>
+#include <fpdf_structtree.h>
 
 #include <osl/endian.h>
 #include <vcl/bitmap.hxx>
@@ -337,6 +338,47 @@ public:
     int getOptionCount(PDFiumDocument* pDoc) override;
 };
 
+class PDFiumStructureElementImpl final : public PDFiumStructureElement
+{
+private:
+    FPDF_STRUCTELEMENT mpStructureElement;
+
+    PDFiumStructureElementImpl(const PDFiumStructureElementImpl&) = delete;
+    PDFiumStructureElementImpl& operator=(const PDFiumStructureElementImpl&) = 
delete;
+
+public:
+    PDFiumStructureElementImpl(FPDF_STRUCTELEMENT pStructureElement);
+
+    OUString getAltText() override;
+    OUString getActualText() override;
+    OUString getID() override;
+    OUString getLang() override;
+    OUString getTitle() override;
+    OUString getType() override;
+    OUString getObjectType() override;
+
+    int getNumberOfChildren() override;
+    int getChildMarkedContentID(int nIndex) override;
+    std::unique_ptr<PDFiumStructureElement> getChild(int nIndex) override;
+    std::unique_ptr<PDFiumStructureElement> getParent() override;
+};
+
+class PDFiumStructureTreeImpl final : public PDFiumStructureTree
+{
+private:
+    FPDF_STRUCTTREE mpStructureTree;
+
+    PDFiumStructureTreeImpl(const PDFiumStructureTreeImpl&) = delete;
+    PDFiumStructureTreeImpl& operator=(const PDFiumStructureTreeImpl&) = 
delete;
+
+public:
+    PDFiumStructureTreeImpl(FPDF_STRUCTTREE pStructureTree);
+    ~PDFiumStructureTreeImpl();
+
+    int getNumberOfChildren() override;
+    std::unique_ptr<PDFiumStructureElement> getChild(int nIndex) override;
+};
+
 class PDFiumPageObjectImpl final : public PDFiumPageObject
 {
 private:
@@ -462,6 +504,8 @@ public:
 
     std::unique_ptr<PDFiumTextPage> getTextPage() override;
 
+    std::unique_ptr<PDFiumStructureTree> getStructureTree() override;
+
     BitmapChecksum getChecksum(int nMDPPerm) override;
 
     double getWidth() override;
@@ -910,6 +954,17 @@ std::unique_ptr<PDFiumTextPage> 
PDFiumPageImpl::getTextPage()
     return pPDFiumTextPage;
 }
 
+std::unique_ptr<PDFiumStructureTree> PDFiumPageImpl::getStructureTree()
+{
+    std::unique_ptr<PDFiumStructureTree> pPDFiumStructureTree;
+    FPDF_STRUCTTREE pStructTree = FPDF_StructTree_GetForPage(mpPage);
+    if (pStructTree)
+    {
+        pPDFiumStructureTree = 
std::make_unique<PDFiumStructureTreeImpl>(pStructTree);
+    }
+    return pPDFiumStructureTree;
+}
+
 bool PDFiumPageImpl::hasLinks()
 {
     // This could be a full iterator, but at the moment we just determine if 
the list is empty or
@@ -1546,6 +1601,119 @@ std::unique_ptr<PDFiumPageObject> 
PDFiumAnnotationImpl::getObject(int nIndex)
     return pPDFiumPageObject;
 }
 
+PDFiumStructureElementImpl::PDFiumStructureElementImpl(FPDF_STRUCTELEMENT 
pStructureElement)
+    : mpStructureElement(pStructureElement)
+{
+}
+
+OUString PDFiumStructureElementImpl::getAltText()
+{
+    return getUnicodeString([this](FPDF_WCHAR* buffer, unsigned long length) {
+        return FPDF_StructElement_GetAltText(mpStructureElement, buffer, 
length);
+    });
+}
+
+OUString PDFiumStructureElementImpl::getActualText()
+{
+    return getUnicodeString([this](FPDF_WCHAR* buffer, unsigned long length) {
+        return FPDF_StructElement_GetActualText(mpStructureElement, buffer, 
length);
+    });
+}
+
+OUString PDFiumStructureElementImpl::getID()
+{
+    return getUnicodeString([this](FPDF_WCHAR* buffer, unsigned long length) {
+        return FPDF_StructElement_GetID(mpStructureElement, buffer, length);
+    });
+}
+
+OUString PDFiumStructureElementImpl::getLang()
+{
+    return getUnicodeString([this](FPDF_WCHAR* buffer, unsigned long length) {
+        return FPDF_StructElement_GetLang(mpStructureElement, buffer, length);
+    });
+}
+
+OUString PDFiumStructureElementImpl::getType()
+{
+    return getUnicodeString([this](FPDF_WCHAR* buffer, unsigned long length) {
+        return FPDF_StructElement_GetType(mpStructureElement, buffer, length);
+    });
+}
+
+OUString PDFiumStructureElementImpl::getObjectType()
+{
+    return getUnicodeString([this](FPDF_WCHAR* buffer, unsigned long length) {
+        return FPDF_StructElement_GetObjType(mpStructureElement, buffer, 
length);
+    });
+}
+
+int PDFiumStructureElementImpl::getChildMarkedContentID(int nIndex)
+{
+    return FPDF_StructElement_GetChildMarkedContentID(mpStructureElement, 
nIndex);
+}
+
+OUString PDFiumStructureElementImpl::getTitle()
+{
+    return getUnicodeString([this](FPDF_WCHAR* buffer, unsigned long length) {
+        return FPDF_StructElement_GetTitle(mpStructureElement, buffer, length);
+    });
+}
+
+int PDFiumStructureElementImpl::getNumberOfChildren()
+{
+    return FPDF_StructElement_CountChildren(mpStructureElement);
+}
+
+std::unique_ptr<PDFiumStructureElement> 
PDFiumStructureElementImpl::getChild(int nIndex)
+{
+    std::unique_ptr<PDFiumStructureElement> pPDFiumStructureElement;
+    FPDF_STRUCTELEMENT pElement = 
FPDF_StructElement_GetChildAtIndex(mpStructureElement, nIndex);
+    if (pElement)
+    {
+        pPDFiumStructureElement = 
std::make_unique<PDFiumStructureElementImpl>(pElement);
+    }
+    return pPDFiumStructureElement;
+}
+
+std::unique_ptr<PDFiumStructureElement> PDFiumStructureElementImpl::getParent()
+{
+    std::unique_ptr<PDFiumStructureElement> pPDFiumStructureElement;
+    FPDF_STRUCTELEMENT pElement = 
FPDF_StructElement_GetParent(mpStructureElement);
+    if (pElement)
+    {
+        pPDFiumStructureElement = 
std::make_unique<PDFiumStructureElementImpl>(pElement);
+    }
+    return pPDFiumStructureElement;
+}
+
+PDFiumStructureTreeImpl::PDFiumStructureTreeImpl(FPDF_STRUCTTREE 
pStructureTree)
+    : mpStructureTree(pStructureTree)
+{
+}
+
+PDFiumStructureTreeImpl::~PDFiumStructureTreeImpl()
+{
+    if (mpStructureTree)
+        FPDF_StructTree_Close(mpStructureTree);
+}
+
+int PDFiumStructureTreeImpl::getNumberOfChildren()
+{
+    return FPDF_StructTree_CountChildren(mpStructureTree);
+}
+
+std::unique_ptr<PDFiumStructureElement> PDFiumStructureTreeImpl::getChild(int 
nIndex)
+{
+    std::unique_ptr<PDFiumStructureElement> pPDFiumStructureElement;
+    FPDF_STRUCTELEMENT pElement = 
FPDF_StructTree_GetChildAtIndex(mpStructureTree, nIndex);
+    if (pElement)
+    {
+        pPDFiumStructureElement = 
std::make_unique<PDFiumStructureElementImpl>(pElement);
+    }
+    return pPDFiumStructureElement;
+}
+
 PDFiumTextPageImpl::PDFiumTextPageImpl(FPDF_TEXTPAGE pTextPage)
     : mpTextPage(pTextPage)
 {
commit dde8db189afbc350e27ce41aeb2777f4f7b236f6
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Fri Jan 10 14:24:11 2025 +0900
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Feb 18 14:26:24 2025 +0100

    pdf: add PDF 2.0 support for /Em and /Strongstructure element
    
    Add support to PDF export to handle /Em (Emphasis) and /Strong
    structure element and fallback to /Span if the PDF version is not
    PDF 2.0.
    
    Use /Em if "Emphasis" char style is used and /Strong if "Strong
    Emphasis" char style is used.
    
    Change-Id: I33d572748592bb20c7daf55716d1f2cc3e6bd989
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180123
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180879
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 92c3fa28ad39..75f428c23042 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -177,6 +177,7 @@ enum class StructElement
     // Inline level elements
     Span, Quote, Note, Reference, BibEntry, Code, Link, Annot,
     Ruby, RB, RT, RP, Warichu, WT, WP,
+    Emphasis, Strong, // PDF 2.0
 
     // Illustration elements
     Figure, Formula, Form
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx 
b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 58be893db3af..f05f3b1bc105 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -176,6 +176,8 @@ const char aHeading[]           = "Heading";
 const char aQuotation[]         = "Quotation";
 const char aSourceText[]        = "Source Text";
 constexpr OUString constTitleStyleName = u"Title"_ustr;
+constexpr OUString constEmphasisStyleName = u"Emphasis"_ustr;
+constexpr OUString constStrongEmphasisStyleName = u"Strong Emphasis"_ustr;
 
 // PDF Tag Names:
 constexpr OUStringLiteral aDocumentString = u"Document";
@@ -1881,6 +1883,26 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
                         --m_nEndStructureElement;
                     }
                 }
+                // Emphasis
+                else if (sStyleName == constEmphasisStyleName)
+                {
+                    if (!isContinueSpan)
+                    {
+                        nPDFType = 
sal_uInt16(vcl::pdf::StructElement::Emphasis);
+                        aPDFType = constEmphasisStyleName;
+                        CreateCurrentSpan(rInf, sStyleName);
+                    }
+                }
+                // Strong
+                else if (sStyleName == constStrongEmphasisStyleName)
+                {
+                    if (!isContinueSpan)
+                    {
+                        nPDFType = sal_uInt16(vcl::pdf::StructElement::Strong);
+                        aPDFType = constStrongEmphasisStyleName;
+                        CreateCurrentSpan(rInf, sStyleName);
+                    }
+                }
                 // Check for Quote/Code character style:
                 else if (sStyleName == aQuotation)
                 {
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 5e632421eeb5..3060557b13fb 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -10748,7 +10748,9 @@ const char* 
PDFWriterImpl::getStructureTag(vcl::pdf::StructElement eType)
         { StructElement::Figure,      "Figure" },
         { StructElement::Formula,     "Formula"},
         { StructElement::Form,        "Form" },
-        { StructElement::Title,       "Title" },
+        { StructElement::Title, "Title" },
+        { StructElement::Emphasis, "Em" },
+        { StructElement::Strong, "Strong" },
     });
 
     // First handle fallbacks for elements that were added in a certain PDF 
version
@@ -10760,11 +10762,14 @@ const char* 
PDFWriterImpl::getStructureTag(vcl::pdf::StructElement eType)
     // PDF 2.0 fallbacks
     if (m_aContext.Version < PDFWriter::PDFVersion::PDF_2_0)
     {
-        switch(eType)
+        switch (eType)
         {
             case StructElement::Title:
-                eType = StructElement::Paragraph;
-                break;
+                eType = StructElement::Paragraph; break;
+            case StructElement::Emphasis:
+                eType = StructElement::Span; break;
+            case StructElement::Strong:
+                eType = StructElement::Span; break;
             default:
                 break;
         }
@@ -11362,6 +11367,8 @@ bool PDFWriterImpl::setStructureAttribute( enum 
PDFWriter::StructAttribute eAttr
                         eType == vcl::pdf::StructElement::TableData   ||
                         eType == vcl::pdf::StructElement::Span        ||
                         eType == vcl::pdf::StructElement::Quote       ||
+                        eType == vcl::pdf::StructElement::Emphasis ||
+                        eType == vcl::pdf::StructElement::Strong ||
                         eType == vcl::pdf::StructElement::Note        ||
                         eType == vcl::pdf::StructElement::Reference   ||
                         eType == vcl::pdf::StructElement::BibEntry    ||
@@ -11398,6 +11405,8 @@ bool PDFWriterImpl::setStructureAttribute( enum 
PDFWriter::StructAttribute eAttr
                         eType == vcl::pdf::StructElement::TableData   ||
                         eType == vcl::pdf::StructElement::Span        ||
                         eType == vcl::pdf::StructElement::Quote       ||
+                        eType == vcl::pdf::StructElement::Emphasis ||
+                        eType == vcl::pdf::StructElement::Strong ||
                         eType == vcl::pdf::StructElement::Note        ||
                         eType == vcl::pdf::StructElement::Reference   ||
                         eType == vcl::pdf::StructElement::BibEntry    ||
@@ -11597,6 +11606,8 @@ bool PDFWriterImpl::setStructureAttributeNumerical( 
enum PDFWriter::StructAttrib
                     eType == vcl::pdf::StructElement::TableData   ||
                     eType == vcl::pdf::StructElement::Span        ||
                     eType == vcl::pdf::StructElement::Quote       ||
+                    eType == vcl::pdf::StructElement::Emphasis ||
+                    eType == vcl::pdf::StructElement::Strong ||
                     eType == vcl::pdf::StructElement::Note        ||
                     eType == vcl::pdf::StructElement::Reference   ||
                     eType == vcl::pdf::StructElement::BibEntry    ||
commit 1d7eb26f27109f103d37faaccd0caf7a5a481cb9
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Fri Jan 10 13:19:09 2025 +0900
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Feb 18 14:26:13 2025 +0100

    pdf: add PDF 2.0 support for /Title structure element
    
    Add support to PDF export to handle /Title structure element and
    fallback to /P (paragraph) if the PDF version is not PDF 2.0.
    Then add /Title structure element in writer if the style name of
    the paragraph is "Title".
    
    Change-Id: Ia8faab09bf3c97423d154deb7f1eb69860ce857a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180122
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180878
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index e2129f53f654..ccfcfdc136fb 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2580,6 +2580,7 @@ void 
VclMetafileProcessor2D::processStructureTagPrimitive2D(
                 case vcl::pdf::StructElement::H6:
                 case vcl::pdf::StructElement::Paragraph:
                 case vcl::pdf::StructElement::Heading:
+                case vcl::pdf::StructElement::Title:
                 case vcl::pdf::StructElement::Caption:
                 case vcl::pdf::StructElement::BlockQuote:
                 case vcl::pdf::StructElement::Table:
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index dc72cb5c44e8..92c3fa28ad39 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -155,26 +155,30 @@ struct PDFEncryptionProperties
 
 namespace pdf
 {
-// for a definition of structural element types please refer to
-// PDF Reference, 3rd ed. section 9.7.4
+// For a definition of structural element types please refer to
+// PDF Reference, 3rd ed. section 9.7.4.
+//
+// In PDF 2.0 specification (ISO 32000-2) refer to section 14.8.4
 enum class StructElement
 {
-    // special element to place outside the structure hierarchy
+    // Special element to place outside the structure hierarchy
     NonStructElement,
+
     // Grouping elements
     Document, Part, Article, Section, Division, BlockQuote,
     Caption, TOC, TOCI, Index,
 
-    // block level elements
+    // Block level elements
     Paragraph, Heading, H1, H2, H3, H4, H5, H6,
     List, ListItem, LILabel, LIBody,
     Table, TableRow, TableHeader, TableData,
+    Title, // PDF 2.0
 
-    // inline level elements
+    // Inline level elements
     Span, Quote, Note, Reference, BibEntry, Code, Link, Annot,
     Ruby, RB, RT, RP, Warichu, WT, WP,
 
-    // illustration elements
+    // Illustration elements
     Figure, Formula, Form
 };
 
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx 
b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index d95a26bc1941..58be893db3af 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -175,6 +175,7 @@ const char aCaption[]           = "Caption";
 const char aHeading[]           = "Heading";
 const char aQuotation[]         = "Quotation";
 const char aSourceText[]        = "Source Text";
+constexpr OUString constTitleStyleName = u"Title"_ustr;
 
 // PDF Tag Names:
 constexpr OUStringLiteral aDocumentString = u"Document";
@@ -717,7 +718,7 @@ void 
SwTaggedPDFHelper::SetAttributes(vcl::pdf::StructElement eType)
             case vcl::pdf::StructElement::Paragraph:
             case vcl::pdf::StructElement::Heading:
             case vcl::pdf::StructElement::BlockQuote:
-
+            case vcl::pdf::StructElement::Title:
                 bPlacement =
                 bWritingMode =
                 bSpaceBefore =
@@ -1424,6 +1425,14 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
                 nPDFType = sal_uInt16(vcl::pdf::StructElement::Paragraph);
                 aPDFType = sStyleName;
 
+                // Title
+
+                if (sStyleName == constTitleStyleName)
+                {
+                    nPDFType = sal_uInt16(vcl::pdf::StructElement::Title);
+                    aPDFType = constTitleStyleName;
+                }
+
                 // Quotations: BlockQuote
 
                 if (sStyleName == aQuotations)
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 264d4ed6d5da..5e632421eeb5 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -10698,7 +10698,7 @@ void PDFWriterImpl::setOutlineItemDest( sal_Int32 
nItem, sal_Int32 nDestID )
     m_aOutline[nItem].m_nDestID = nDestID;
 }
 
-const char* PDFWriterImpl::getStructureTag(vcl::pdf::StructElement eType )
+const char* PDFWriterImpl::getStructureTag(vcl::pdf::StructElement eType)
 {
     using namespace vcl::pdf;
 
@@ -10747,18 +10747,35 @@ const char* 
PDFWriterImpl::getStructureTag(vcl::pdf::StructElement eType )
         { StructElement::WP,          "WP" },
         { StructElement::Figure,      "Figure" },
         { StructElement::Formula,     "Formula"},
-        { StructElement::Form,        "Form" }
+        { StructElement::Form,        "Form" },
+        { StructElement::Title,       "Title" },
     });
 
-    if (eType == StructElement::Annot
-        && m_aContext.Version < PDFWriter::PDFVersion::PDF_1_5)
+    // First handle fallbacks for elements that were added in a certain PDF 
version
+
+    // PDF 1.5 fallbacks
+    if (m_aContext.Version < PDFWriter::PDFVersion::PDF_1_5 && eType == 
StructElement::Annot)
+        eType = StructElement::Figure;
+
+    // PDF 2.0 fallbacks
+    if (m_aContext.Version < PDFWriter::PDFVersion::PDF_2_0)
     {
-        return "Figure"; // fallback
+        switch(eType)
+        {
+            case StructElement::Title:
+                eType = StructElement::Paragraph;
+                break;
+            default:
+                break;
+        }
     }
 
-    auto it = aTagStrings.find( eType );
+    auto it = aTagStrings.find(eType);
+
+    if (it == aTagStrings.end())
+        return "Div";
 
-    return it != aTagStrings.end() ? it->second : "Div";
+    return it->second;
 }
 
 void PDFWriterImpl::addRoleMap(OString aAlias, vcl::pdf::StructElement eType)
@@ -11260,6 +11277,7 @@ bool PDFWriterImpl::setStructureAttribute( enum 
PDFWriter::StructAttribute eAttr
                     eVal == PDFWriter::Justify )
                 {
                     if (eType == vcl::pdf::StructElement::Paragraph   ||
+                        eType == vcl::pdf::StructElement::Title ||
                         eType == vcl::pdf::StructElement::Heading     ||
                         eType == vcl::pdf::StructElement::H1          ||
                         eType == vcl::pdf::StructElement::H2          ||
@@ -11326,6 +11344,7 @@ bool PDFWriterImpl::setStructureAttribute( enum 
PDFWriter::StructAttribute eAttr
                 {
                     // only for ILSE and BLSE
                     if (eType == vcl::pdf::StructElement::Paragraph   ||
+                        eType == vcl::pdf::StructElement::Title ||
                         eType == vcl::pdf::StructElement::Heading     ||
                         eType == vcl::pdf::StructElement::H1          ||
                         eType == vcl::pdf::StructElement::H2          ||
@@ -11361,6 +11380,7 @@ bool PDFWriterImpl::setStructureAttribute( enum 
PDFWriter::StructAttribute eAttr
                 {
                     // only for ILSE and BLSE
                     if (eType == vcl::pdf::StructElement::Paragraph   ||
+                        eType == vcl::pdf::StructElement::Title ||
                         eType == vcl::pdf::StructElement::Heading     ||
                         eType == vcl::pdf::StructElement::H1          ||
                         eType == vcl::pdf::StructElement::H2          ||
@@ -11504,6 +11524,7 @@ bool PDFWriterImpl::setStructureAttributeNumerical( 
enum PDFWriter::StructAttrib
             case PDFWriter::EndIndent:
                 // just for BLSE
                 if (eType == vcl::pdf::StructElement::Paragraph   ||
+                    eType == vcl::pdf::StructElement::Title ||
                     eType == vcl::pdf::StructElement::Heading     ||
                     eType == vcl::pdf::StructElement::H1          ||
                     eType == vcl::pdf::StructElement::H2          ||
@@ -11526,6 +11547,7 @@ bool PDFWriterImpl::setStructureAttributeNumerical( 
enum PDFWriter::StructAttrib
             case PDFWriter::TextIndent:
                 // paragraph like BLSE and additional elements
                 if (eType == vcl::pdf::StructElement::Paragraph   ||
+                    eType == vcl::pdf::StructElement::Title ||
                     eType == vcl::pdf::StructElement::Heading     ||
                     eType == vcl::pdf::StructElement::H1          ||
                     eType == vcl::pdf::StructElement::H2          ||
@@ -11557,6 +11579,7 @@ bool PDFWriterImpl::setStructureAttributeNumerical( 
enum PDFWriter::StructAttrib
             case PDFWriter::BaselineShift:
                 // only for ILSE and BLSE
                 if (eType == vcl::pdf::StructElement::Paragraph   ||
+                    eType == vcl::pdf::StructElement::Title ||
                     eType == vcl::pdf::StructElement::Heading     ||
                     eType == vcl::pdf::StructElement::H1          ||
                     eType == vcl::pdf::StructElement::H2          ||
commit 626cf19b29e4ffef336643f28791680f3a9e3446
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Thu Jan 9 09:23:41 2025 +0900
Commit:     Andras Timar <[email protected]>
CommitDate: Tue Feb 18 14:26:02 2025 +0100

    pdf: change StructElement to enum class, move out of PDFWriter
    
    Moves the StructElement out of PDFWriter and changes it to enum
    class. This makes it mroe type safe, easier to search and more
    clear what type we are using.
    
    Change-Id: Icf469319a01f58397b131c3517bc75fba4072500
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179977
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180877
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx 
b/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx
index 47af55ab9b57..5655d482ea09 100644
--- a/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx
@@ -27,7 +27,7 @@ using namespace com::sun::star;
 namespace drawinglayer::primitive2d
 {
         StructureTagPrimitive2D::StructureTagPrimitive2D(
-            const vcl::PDFWriter::StructElement& rStructureElement,
+            const vcl::pdf::StructElement& rStructureElement,
             bool bBackground,
             bool bIsImage,
             Primitive2DContainer&& aChildren,
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 61958120474a..e2129f53f654 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -498,7 +498,7 @@ void 
VclMetafileProcessor2D::impEndSvtGraphicStroke(SvtGraphicStroke const* pSvt
     }
 }
 
-void VclMetafileProcessor2D::popStructureElement(vcl::PDFWriter::StructElement 
eElem)
+void VclMetafileProcessor2D::popStructureElement(vcl::pdf::StructElement eElem)
 {
     if (!maListElements.empty() && maListElements.top() == eElem)
     {
@@ -509,14 +509,14 @@ void 
VclMetafileProcessor2D::popStructureElement(vcl::PDFWriter::StructElement e
 
 void VclMetafileProcessor2D::popListItem()
 {
-    popStructureElement(vcl::PDFWriter::LIBody);
-    popStructureElement(vcl::PDFWriter::ListItem);
+    popStructureElement(vcl::pdf::StructElement::LIBody);
+    popStructureElement(vcl::pdf::StructElement::ListItem);
 }
 
 void VclMetafileProcessor2D::popList()
 {
     popListItem();
-    popStructureElement(vcl::PDFWriter::List);
+    popStructureElement(vcl::pdf::StructElement::List);
 }
 
 // init static break iterator
@@ -1139,7 +1139,7 @@ void VclMetafileProcessor2D::processControlPrimitive2D(
                                                    
mpOutputDevice->GetMapMode());
             pPDFControl->TextFont.SetFontSize(aFontSize);
 
-            
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::Form);
+            
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::pdf::StructElement::Form);
             vcl::PDFWriter::StructAttributeValue role;
             switch (pPDFControl->Type)
             {
@@ -1190,7 +1190,7 @@ void VclMetafileProcessor2D::processControlPrimitive2D(
 
     if (mpPDFExtOutDevData)
     { // no corresponding PDF Form, use Figure instead
-        mpPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::Figure);
+        
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::pdf::StructElement::Figure);
         mpPDFExtOutDevData->SetStructureAttribute(vcl::PDFWriter::Placement, 
vcl::PDFWriter::Block);
         auto const 
range(rControlPrimitive.getB2DRange(getViewInformation2D()));
         tools::Rectangle const aLogicRect(
@@ -1334,8 +1334,8 @@ void 
VclMetafileProcessor2D::processTextHierarchyBulletPrimitive2D(
     // this is a part of list item, start LILabel ( = bullet)
     if (mbInListItem)
     {
-        maListElements.push(vcl::PDFWriter::LILabel);
-        mpPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::LILabel);
+        maListElements.push(vcl::pdf::StructElement::LILabel);
+        
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::pdf::StructElement::LILabel);
     }
 
     // process recursively and add MetaFile comment
@@ -1346,7 +1346,7 @@ void 
VclMetafileProcessor2D::processTextHierarchyBulletPrimitive2D(
 
     if (mbInListItem)
     {
-        if (maListElements.top() == vcl::PDFWriter::LILabel)
+        if (maListElements.top() == vcl::pdf::StructElement::LILabel)
         {
             maListElements.pop();
             mpPDFExtOutDevData->EndStructureElement(); // end LILabel
@@ -1374,7 +1374,7 @@ void 
VclMetafileProcessor2D::processTextHierarchyParagraphPrimitive2D(
     {
         // No Tagged PDF -> Dump as Paragraph
         // Emulate data handling from old ImpEditEngine::Paint
-        
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::Paragraph);
+        
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::pdf::StructElement::Paragraph);
 
         // Process recursively and add MetaFile comment
         process(rParagraphPrimitive);
@@ -1399,8 +1399,8 @@ void 
VclMetafileProcessor2D::processTextHierarchyParagraphPrimitive2D(
             // increase List level
             for (sal_Int16 a(mnCurrentOutlineLevel); a != nNewOutlineLevel; 
++a)
             {
-                maListElements.push(vcl::PDFWriter::List);
-                
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::List);
+                maListElements.push(vcl::pdf::StructElement::List);
+                
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::pdf::StructElement::List);
             }
         }
         else // if(nNewOutlineLevel < mnCurrentOutlineLevel)
@@ -1430,14 +1430,14 @@ void 
VclMetafileProcessor2D::processTextHierarchyParagraphPrimitive2D(
     if (bDumpAsListItem)
     {
         // Dump as ListItem
-        maListElements.push(vcl::PDFWriter::ListItem);
-        
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::ListItem);
+        maListElements.push(vcl::pdf::StructElement::ListItem);
+        
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::pdf::StructElement::ListItem);
         mbInListItem = true;
     }
     else
     {
         // Dump as Paragraph
-        
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::Paragraph);
+        
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::pdf::StructElement::Paragraph);
     }
 
     // Process recursively and add MetaFile comment
@@ -1480,8 +1480,8 @@ void 
VclMetafileProcessor2D::processTextSimplePortionPrimitive2D(
     // bullet has been already processed, start LIBody
     if (mbInListItem && mbBulletPresent)
     {
-        maListElements.push(vcl::PDFWriter::LIBody);
-        mpPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::LIBody);
+        maListElements.push(vcl::pdf::StructElement::LIBody);
+        
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::pdf::StructElement::LIBody);
     }
 
     // directdraw of text simple portion; use default processing
@@ -2548,8 +2548,8 @@ void 
VclMetafileProcessor2D::processStructureTagPrimitive2D(
     ::comphelper::ValueRestorationGuard const g(mpCurrentStructureTag, 
&rStructureTagCandidate);
 
     // structured tag primitive
-    const vcl::PDFWriter::StructElement& 
rTagElement(rStructureTagCandidate.getStructureElement());
-    bool bTagUsed((vcl::PDFWriter::NonStructElement != rTagElement));
+    const vcl::pdf::StructElement& 
rTagElement(rStructureTagCandidate.getStructureElement());
+    bool bTagUsed((vcl::pdf::StructElement::NonStructElement != rTagElement));
     ::std::optional<sal_Int32> oAnchorParent;
 
     if (!rStructureTagCandidate.isTaggedSdrObject())
@@ -2572,26 +2572,26 @@ void 
VclMetafileProcessor2D::processStructureTagPrimitive2D(
             mpPDFExtOutDevData->WrapBeginStructureElement(rTagElement);
             switch (rTagElement)
             {
-                case vcl::PDFWriter::H1:
-                case vcl::PDFWriter::H2:
-                case vcl::PDFWriter::H3:
-                case vcl::PDFWriter::H4:
-                case vcl::PDFWriter::H5:
-                case vcl::PDFWriter::H6:
-                case vcl::PDFWriter::Paragraph:
-                case vcl::PDFWriter::Heading:
-                case vcl::PDFWriter::Caption:
-                case vcl::PDFWriter::BlockQuote:
-                case vcl::PDFWriter::Table:
-                case vcl::PDFWriter::TableRow:
-                case vcl::PDFWriter::Formula:
-                case vcl::PDFWriter::Figure:
-                case vcl::PDFWriter::Annot:
+                case vcl::pdf::StructElement::H1:
+                case vcl::pdf::StructElement::H2:
+                case vcl::pdf::StructElement::H3:
+                case vcl::pdf::StructElement::H4:
+                case vcl::pdf::StructElement::H5:
+                case vcl::pdf::StructElement::H6:
+                case vcl::pdf::StructElement::Paragraph:
+                case vcl::pdf::StructElement::Heading:
+                case vcl::pdf::StructElement::Caption:
+                case vcl::pdf::StructElement::BlockQuote:
+                case vcl::pdf::StructElement::Table:
+                case vcl::pdf::StructElement::TableRow:
+                case vcl::pdf::StructElement::Formula:
+                case vcl::pdf::StructElement::Figure:
+                case vcl::pdf::StructElement::Annot:
                     
mpPDFExtOutDevData->SetStructureAttribute(vcl::PDFWriter::Placement,
                                                               
vcl::PDFWriter::Block);
                     break;
-                case vcl::PDFWriter::TableData:
-                case vcl::PDFWriter::TableHeader:
+                case vcl::pdf::StructElement::TableData:
+                case vcl::pdf::StructElement::TableHeader:
                     
mpPDFExtOutDevData->SetStructureAttribute(vcl::PDFWriter::Placement,
                                                               
vcl::PDFWriter::Inline);
                     break;
@@ -2600,10 +2600,10 @@ void 
VclMetafileProcessor2D::processStructureTagPrimitive2D(
             }
             switch (rTagElement)
             {
-                case vcl::PDFWriter::Table:
-                case vcl::PDFWriter::Formula:
-                case vcl::PDFWriter::Figure:
-                case vcl::PDFWriter::Annot:
+                case vcl::pdf::StructElement::Table:
+                case vcl::pdf::StructElement::Formula:
+                case vcl::pdf::StructElement::Figure:
+                case vcl::pdf::StructElement::Annot:
                 {
                     auto const 
range(rStructureTagCandidate.getB2DRange(getViewInformation2D()));
                     tools::Rectangle const aLogicRect(
@@ -2615,11 +2615,11 @@ void 
VclMetafileProcessor2D::processStructureTagPrimitive2D(
                 default:
                     break;
             }
-            if (rTagElement == vcl::PDFWriter::Annot)
+            if (rTagElement == vcl::pdf::StructElement::Annot)
             {
                 
mpPDFExtOutDevData->SetStructureAnnotIds(rStructureTagCandidate.GetAnnotIds());
             }
-            if (rTagElement == vcl::PDFWriter::TableHeader)
+            if (rTagElement == vcl::pdf::StructElement::TableHeader)
             {
                 
mpPDFExtOutDevData->SetStructureAttribute(vcl::PDFWriter::Scope,
                                                           
vcl::PDFWriter::Column);
@@ -2630,7 +2630,8 @@ void 
VclMetafileProcessor2D::processStructureTagPrimitive2D(
         {
             // background image: tag as artifact
             if (rStructureTagCandidate.isImage())
-                
mpPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::NonStructElement);
+                mpPDFExtOutDevData->WrapBeginStructureElement(
+                    vcl::pdf::StructElement::NonStructElement);
             // any other background object: do not tag
             else
                 assert(false);
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
index c315281ebf61..54bd80842fa5 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
@@ -107,7 +107,7 @@ private:
                                    const attribute::LineStartEndAttribute* 
pEnd);
     void impStartSvtGraphicStroke(SvtGraphicStroke const* pSvtGraphicStroke);
     void impEndSvtGraphicStroke(SvtGraphicStroke const* pSvtGraphicStroke);
-    void popStructureElement(vcl::PDFWriter::StructElement eElem);
+    void popStructureElement(vcl::pdf::StructElement eElem);
     void popListItem();
     void popList();
 
@@ -193,7 +193,7 @@ private:
     bool mbInListItem;
     bool mbBulletPresent;
 
-    std::stack<vcl::PDFWriter::StructElement> maListElements;
+    std::stack<vcl::pdf::StructElement> maListElements;
 
     primitive2d::StructureTagPrimitive2D const* mpCurrentStructureTag = 
nullptr;
 
diff --git a/drawinglayer/source/tools/primitive2dxmldump.cxx 
b/drawinglayer/source/tools/primitive2dxmldump.cxx
index 54569c4cf7f5..c93d5c0bc77b 100644
--- a/drawinglayer/source/tools/primitive2dxmldump.cxx
+++ b/drawinglayer/source/tools/primitive2dxmldump.cxx
@@ -984,8 +984,7 @@ void Primitive2dXmlDump::decomposeAndWrite(
                     = dynamic_cast<const 
StructureTagPrimitive2D&>(*pBasePrimitive);
                 rWriter.startElement("structuretag");
                 rWriter.attribute("structureelement",
-                                  
rStructureTagPrimitive2D.getStructureElement());
-
+                                  
sal_Int32(rStructureTagPrimitive2D.getStructureElement()));
                 decomposeAndWrite(rStructureTagPrimitive2D.getChildren(), 
rWriter);
                 rWriter.endElement();
             }
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 096550bde30d..c27f9355d9f4 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -3411,7 +3411,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, 
tools::Rectangle aClipRect, Po
             return;
 
         if ( pPDFExtOutDevData )
-            
pPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::Paragraph);
+            
pPDFExtOutDevData->WrapBeginStructureElement(vcl::pdf::StructElement::Paragraph);
 
         const tools::Long nParaHeight = pPortion->GetHeight();
         if ( pPortion->IsVisible() && (
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 7dc2426a1e75..92e813349435 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -1354,7 +1354,7 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& 
rWriter, const Size& rPageSi
     rWriter.Push();
     // tdf#152235 tag around the reference to the XObject on the page
     sal_Int32 const id = rWriter.EnsureStructureElement();
-    rWriter.InitStructureElement(id, vcl::PDFWriter::NonStructElement, 
::std::u16string_view());
+    rWriter.InitStructureElement(id, 
vcl::pdf::StructElement::NonStructElement, ::std::u16string_view());
     rWriter.BeginStructureElement(id);
     rWriter.SetStructureAttribute(vcl::PDFWriter::Type, 
vcl::PDFWriter::Pagination);
     rWriter.SetStructureAttribute(vcl::PDFWriter::Subtype, 
vcl::PDFWriter::Watermark);
@@ -1452,7 +1452,7 @@ void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& 
rWriter, const Size& rP
     rWriter.Push();
     // tdf#152235 tag around the reference to the XObject on the page
     sal_Int32 const id = rWriter.EnsureStructureElement();
-    rWriter.InitStructureElement(id, vcl::PDFWriter::NonStructElement, 
::std::u16string_view());
+    rWriter.InitStructureElement(id, 
vcl::pdf::StructElement::NonStructElement, ::std::u16string_view());
     rWriter.BeginStructureElement(id);
     rWriter.SetStructureAttribute(vcl::PDFWriter::Type, 
vcl::PDFWriter::Pagination);
     rWriter.SetStructureAttribute(vcl::PDFWriter::Subtype, 
vcl::PDFWriter::Watermark);
diff --git a/include/drawinglayer/primitive2d/structuretagprimitive2d.hxx 
b/include/drawinglayer/primitive2d/structuretagprimitive2d.hxx
index 0d7e6ba57735..2857ea570b4b 100644
--- a/include/drawinglayer/primitive2d/structuretagprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/structuretagprimitive2d.hxx
@@ -43,7 +43,7 @@ namespace drawinglayer::primitive2d
         {
         private:
             /// the PDF structure element this grouping represents
-            vcl::PDFWriter::StructElement           maStructureElement;
+            vcl::pdf::StructElement maStructureElement;
 
             /// flag for background object
             bool                                    mbBackground;
@@ -57,7 +57,7 @@ namespace drawinglayer::primitive2d
         public:
             /// constructor
             StructureTagPrimitive2D(
-                const vcl::PDFWriter::StructElement& rStructureElement,
+                const vcl::pdf::StructElement& rStructureElement,
                 bool bBackground,
                 bool bIsImage,
                 Primitive2DContainer&& aChildren,
@@ -65,7 +65,7 @@ namespace drawinglayer::primitive2d
                 ::std::vector<sal_Int32> const* pAnnotIds = nullptr);
 
             /// data read access
-            const vcl::PDFWriter::StructElement& getStructureElement() const { 
return maStructureElement; }
+            const vcl::pdf::StructElement& getStructureElement() const { 
return maStructureElement; }
             bool isBackground() const { return mbBackground; }
             bool isImage() const { return mbIsImage; }
             bool isTaggedSdrObject() const;
diff --git a/include/vcl/pdfextoutdevdata.hxx b/include/vcl/pdfextoutdevdata.hxx
index e5615da7b260..a7422d3a441f 100644
--- a/include/vcl/pdfextoutdevdata.hxx
+++ b/include/vcl/pdfextoutdevdata.hxx
@@ -383,9 +383,9 @@ public:
     @returns
     the id of the newly created structural element
      */
-    sal_Int32 WrapBeginStructureElement(PDFWriter::StructElement eType, const 
OUString& rAlias = OUString());
+    sal_Int32 WrapBeginStructureElement(vcl::pdf::StructElement eType, const 
OUString& rAlias = OUString());
     sal_Int32 EnsureStructureElement(void const* key);
-    void InitStructureElement(sal_Int32 id, PDFWriter::StructElement eType, 
const OUString& rAlias);
+    void InitStructureElement(sal_Int32 id, vcl::pdf::StructElement eType, 
const OUString& rAlias);
     void BeginStructureElement(sal_Int32 id);
 
     /** end a logical structure element
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 0748bf6df933..dc72cb5c44e8 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -153,6 +153,33 @@ struct PDFEncryptionProperties
     }
 };
 
+namespace pdf
+{
+// for a definition of structural element types please refer to
+// PDF Reference, 3rd ed. section 9.7.4
+enum class StructElement
+{
+    // special element to place outside the structure hierarchy
+    NonStructElement,
+    // Grouping elements
+    Document, Part, Article, Section, Division, BlockQuote,
+    Caption, TOC, TOCI, Index,
+
+    // block level elements
+    Paragraph, Heading, H1, H2, H3, H4, H5, H6,
+    List, ListItem, LILabel, LIBody,
+    Table, TableRow, TableHeader, TableData,
+
+    // inline level elements
-e 
... etc. - the rest is truncated

Reply via email to