core.git: sw/inc sw/qa sw/source sw/uiconfig

2026-04-01 Thread Nguyen Minh Tien (via logerrit)
 sw/inc/crsrsh.hxx|6 +--
 sw/qa/extras/uiwriter/uiwriter.cxx   |   52 +++
 sw/source/ui/dialog/wordcountdialog.cxx  |   30 +
 sw/source/uibase/inc/wordcountdialog.hxx |9 -
 sw/source/uibase/inc/wrtsh.hxx   |2 +
 sw/source/uibase/wrtsh/wrtsh1.cxx|   42 +
 sw/uiconfig/swriter/ui/wordcount.ui  |   45 ++
 7 files changed, 181 insertions(+), 5 deletions(-)

New commits:
commit dbdbca506c112e402001343fcc69352cc476361c
Author: Nguyen Minh Tien 
AuthorDate: Tue Mar 31 20:41:57 2026 +0700
Commit: Heiko Tietze 
CommitDate: Wed Apr 1 14:59:44 2026 +0200

tdf#123083 Add before/after cursor word count to Word Count dialog

Add word count before and after the cursor position to the Word Count
dialog (Tools > Word Count).
A new row "Words before cursor" show the count in Columns Before/After

A unit test is provided as well

Co-authored-by: Abdallah Elhdad 
Change-Id: I9d60a649fbd27f7d14bc300a02ef78f3332f2c03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202313
Reviewed-by: Heiko Tietze 
Tested-by: Jenkins

diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 87afc4f91264..f905e0e15a1a 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -802,9 +802,9 @@ public:
 void ExpandToSentenceBorders();
 
 // get position from current cursor
-bool IsStartWord( sal_Int16 nWordType = 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES )const;
-bool IsEndWord( sal_Int16 nWordType = 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const;
-bool IsInWord( sal_Int16 nWordType = 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const;
+SW_DLLPUBLIC bool IsStartWord( sal_Int16 nWordType = 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES )const;
+SW_DLLPUBLIC bool IsEndWord( sal_Int16 nWordType = 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const;
+SW_DLLPUBLIC bool IsInWord( sal_Int16 nWordType = 
css::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const;
 bool IsStartSentence() const;
 bool IsEndSentence() const;
 SW_DLLPUBLIC bool IsSttPara() const;
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index d7806bd229a0..74e5de84576d 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -65,6 +65,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace
 {
@@ -2198,6 +2199,57 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf168272)
 CPPUNIT_ASSERT_EQUAL(u"Landscape"_ustr, sActualStyle);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf123083WordCountBeforeAfterCursor)
+{
+createSwDoc();
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+CPPUNIT_ASSERT(pWrtShell);
+
+// "word1 word2 word3 word4" = 4 words
+pWrtShell->Insert(u"word1 word2 word3 word4"_ustr);
+
+// Test 1: cursor at start — all words after
+pWrtShell->SttPara();
+SwDocStat aBefore, aAfter;
+pWrtShell->CountWordsBeforeAfterCursor(aBefore, aAfter);
+CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), aBefore.nWord);
+CPPUNIT_ASSERT_EQUAL(sal_uInt32(4), aAfter.nWord);
+
+// Test 2: cursor mid-word (pos 2, inside "word1") — snaps to start, word1 
stays in "after"
+pWrtShell->Right(SwCursorSkipMode::Chars, false, 2, false);
+aBefore = SwDocStat();
+aAfter = SwDocStat();
+pWrtShell->CountWordsBeforeAfterCursor(aBefore, aAfter);
+CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), aBefore.nWord);
+CPPUNIT_ASSERT_EQUAL(sal_uInt32(4), aAfter.nWord);
+
+// Test 3: cursor at space after "word1" (pos 5) — word1 counted in 
"before"
+pWrtShell->SttPara();
+pWrtShell->Right(SwCursorSkipMode::Chars, false, 5, false);
+aBefore = SwDocStat();
+aAfter = SwDocStat();
+pWrtShell->CountWordsBeforeAfterCursor(aBefore, aAfter);
+CPPUNIT_ASSERT_EQUAL(sal_uInt32(1), aBefore.nWord);
+CPPUNIT_ASSERT_EQUAL(sal_uInt32(3), aAfter.nWord);
+
+// Test 4: cursor at end — all words before
+pWrtShell->EndPara();
+aBefore = SwDocStat();
+aAfter = SwDocStat();
+pWrtShell->CountWordsBeforeAfterCursor(aBefore, aAfter);
+CPPUNIT_ASSERT_EQUAL(sal_uInt32(4), aBefore.nWord);
+CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), aAfter.nWord);
+
+// Test 5: cursor inside last word (pos 20) — snaps to start, word4 in 
"after"
+pWrtShell->SttPara();
+pWrtShell->Right(SwCursorSkipMode::Chars, false, 20, false);
+aBefore = SwDocStat();
+aAfter = SwDocStat();
+pWrtShell->CountWordsBeforeAfterCursor(aBefore, aAfter);
+CPPUNIT_ASSERT_EQUAL(sal_uInt32(3), aBefore.nWord);
+CPPUNIT_ASSERT_EQUAL(sal_uInt32(1), aAfter.nWord);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx 
b/sw/source/ui/dialog/wordcountdialog.cxx
index 8a5996543915..1e97641c18e7 100644
--- a/sw/source/u

core.git: sw/inc sw/source

2026-03-29 Thread Jim Raykowski (via logerrit)
 sw/inc/bitmaps.hlst|1 
 sw/source/uibase/inc/content.hxx   |   16 ++
 sw/source/uibase/inc/conttree.hxx  |1 
 sw/source/uibase/inc/wrtsh.hxx |1 
 sw/source/uibase/utlui/content.cxx |  206 ++---
 sw/source/uibase/wrtsh/move.cxx|   24 
 6 files changed, 190 insertions(+), 59 deletions(-)

New commits:
commit 64a7d5179b84b9098de416b9d48d509ff552c0b6
Author: Jim Raykowski 
AuthorDate: Tue Mar 3 12:57:19 2026 -0900
Commit: Jim Raykowski 
CommitDate: Mon Mar 30 03:47:16 2026 +0200

tdf#140880 Navigator draw objects: Show group indicator

Enhancement for Writer Navigator to make grouped drawing object entries
expandable to show drawing objects in the group.

Change-Id: Iae6a20c50379e2f5473848bea649f4c0db593d72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200914
Reviewed-by: Jim Raykowski 
Tested-by: Jenkins

diff --git a/sw/inc/bitmaps.hlst b/sw/inc/bitmaps.hlst
index 11b0dab2d566..99ae5b0fae55 100644
--- a/sw/inc/bitmaps.hlst
+++ b/sw/inc/bitmaps.hlst
@@ -97,6 +97,7 @@ inline constexpr OUString RID_BMP_NAVI_TEXTFIELD = 
u"sw/res/nc20005.png"_ustr;
 inline constexpr OUString RID_BMP_NAVI_FOOTNOTE = u"sw/res/nc20012.png"_ustr;
 inline constexpr OUString RID_BMP_NAVI_ENDNOTE = u"sw/res/nc20013.png"_ustr;
 inline constexpr OUString RID_BMP_DROP_REGION = u"sw/res/sc20235.png"_ustr;
+inline constexpr OUString RID_BMP_NAVI_DRAWOBJECT_GROUP = 
u"sd/res/group.png"_ustr;
 
 inline constexpr OUString RID_BMP_WRAP_RIGHT = u"sw/res/wr03.png"_ustr;
 inline constexpr OUString RID_BMP_WRAP_CONTOUR_RIGHT = u"sw/res/wr09.png"_ustr;
diff --git a/sw/source/uibase/inc/content.hxx b/sw/source/uibase/inc/content.hxx
index 25f8341fe593..4ec293415dde 100644
--- a/sw/source/uibase/inc/content.hxx
+++ b/sw/source/uibase/inc/content.hxx
@@ -30,6 +30,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 class SwWrtShell;
 class SwContentArr;
 class SwContentType;
@@ -203,6 +206,19 @@ public:
 const SwTOXMark* GetTOXMark() const { return m_pMark; }
 };
 
+class SwDrawObjectContent final : public SwContent
+{
+const SdrObject* m_pSdrObject;
+
+public:
+SwDrawObjectContent(const SwContentType* pCnt, const SdrObject* 
pSdrObject, tools::Long nYPos)
+: SwContent(pCnt, pSdrObject->GetName(), nYPos)
+, m_pSdrObject(pSdrObject)
+{
+}
+const SdrObject* GetSdrObject() const { return m_pSdrObject; }
+};
+
 /**
  * Content type, knows it's contents and the WrtShell.
  *
diff --git a/sw/source/uibase/inc/conttree.hxx 
b/sw/source/uibase/inc/conttree.hxx
index ca20d55bfdeb..7eab67837c85 100644
--- a/sw/source/uibase/inc/conttree.hxx
+++ b/sw/source/uibase/inc/conttree.hxx
@@ -112,6 +112,7 @@ class SwContentTree final : public SfxListener
 std::map m_aRegionNodeExpandMap;
 std::map m_aPostItNodeExpandMap;
 std::map m_aIndexNodeExpandMap;
+std::unordered_set m_aDrawObjectNodeExpandSet;
 
 sal_Int32   m_nActiveBlock;  // used to restore content types 
expand state
 sal_Int32   m_nHiddenBlock;
diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index 884c9525a35d..2c1a9b24de98 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -514,6 +514,7 @@ typedef bool (SwWrtShell::*FNSimpleMove)();
 SW_DLLPUBLIC bool GotoTable( const UIName& rName );
 void GotoFormatField( const SwFormatField& rField );
 const SwRangeRedline* GotoRedline( SwRedlineTable::size_type nArrPos, bool 
bSelect);
+bool GotoDrawingObject(const SdrObject *pObj);
 SW_DLLPUBLIC bool GotoDrawingObject(std::u16string_view rName);
 void GotoFootnoteAnchor(const SwTextFootnote& rTextFootnote);
 SW_DLLPUBLIC void ChangeHeaderOrFooter(const UIName& rStyleName, bool 
bHeader, bool bOn, bool bShowWarning);
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index a44677cf0147..88ce46f5930c 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1273,24 +1273,22 @@ void SwContentType::FillMemberList(bool* 
pbContentChanged)
 case ContentTypeId::DRAWOBJECT:
 {
 IDocumentDrawModelAccess& rIDDMA = 
m_pWrtShell->getIDocumentDrawModelAccess();
-SwDrawModel* pModel = rIDDMA.GetDrawModel();
-if(pModel)
+if (SwDrawModel* pModel = rIDDMA.GetDrawModel())
 {
-SdrPage* pPage = pModel->GetPage(0);
-for (const rtl::Reference& pTemp : *pPage)
+SdrObjListIter aIter(pModel->GetPage(0), 
SdrIterMode::DeepWithGroups);
+while (aIter.IsMore())
 {
-// #i51726# - all drawing objects can be named now
-if (!pTemp->IsVirtualObj() && !pTemp->GetName().isEmpty())
-{
-tools::Long nYPos = LONG_MIN;
-const bool bIsVisible =

core.git: sw/inc sw/source

2026-03-24 Thread Andrea Gelmini (via logerrit)
 sw/inc/fesh.hxx|2 +-
 sw/source/core/frmedt/feshview.cxx |4 ++--
 sw/source/uibase/docvw/edtwin.cxx  |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 3ed41ef949446939f495c47a40eb45e793a0eca2
Author: Andrea Gelmini 
AuthorDate: Mon Mar 23 13:49:17 2026 +0100
Commit: Julien Nabet 
CommitDate: Tue Mar 24 15:34:04 2026 +0100

Change in code "klick->click"

Change-Id: I5c87ae80f10865eba47cfb936a91e408b3a95f0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202468
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index f280e3846f33..6d53d9d9f7c6 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -169,7 +169,7 @@ enum class SwPasteSdr
 #define SW_ALLOW_TEXTBOX  8
 /// SmartArt/Diagram SubSelection needs to know in SwFEShell::SelectObj
 /// if that action came from keyboard or mouse
-#define SW_FROM_KLICK  16
+#define SW_FROM_CLICK  16
 
 enum class SwMove
 {
diff --git a/sw/source/core/frmedt/feshview.cxx 
b/sw/source/core/frmedt/feshview.cxx
index 325ee7acdaf7..6e56c3758c6d 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -284,8 +284,8 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 
nFlag, SdrObject *pObj )
 
 // for Diagrams force to the svx MarkObj version below that will handle
 // SubSelection correctly. CAUTION: Keyboard travel calls the same method
-// so make sure to only do that on mouseklick and if we got a position
-if (pObj && 0 != rPt.getX() && 0 != rPt.getY() && (SW_FROM_KLICK & nFlag) 
&& pObj->isDiagram())
+// so make sure to only do that on mouseclick and if we got a position
+if (pObj && 0 != rPt.getX() && 0 != rPt.getY() && (SW_FROM_CLICK & nFlag) 
&& pObj->isDiagram())
 pObj = nullptr;
 
 if ( pObj )
diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 4295fb48fbd5..477f4c4b8c8e 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -4832,7 +4832,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
 if (!pShapeFormat)
 {
 pSdrView->UnmarkAllObj();
-rSh.SelectObj(aDocPos, SW_FROM_KLICK, pObj);
+rSh.SelectObj(aDocPos, SW_FROM_CLICK, pObj);
 if (rMEvt.IsLeft() && rMEvt.GetClicks() == 1 &&
 SwModule::get()->GetUsrPref(
 dynamic_cast(&m_rView) != 
nullptr)->


core.git: sw/inc sw/source

2026-03-23 Thread Noel Grandin (via logerrit)
 sw/inc/accmap.hxx |5 ++---
 sw/source/core/access/accmap.cxx  |8 
 sw/source/core/inc/viewimp.hxx|2 +-
 sw/source/core/view/pagepreviewlayout.cxx |2 +-
 sw/source/core/view/viewimp.cxx   |4 ++--
 sw/source/core/view/viewsh.cxx|2 +-
 6 files changed, 11 insertions(+), 12 deletions(-)

New commits:
commit 6432190d03e565924f0f131a5f7979448d936e65
Author: Noel Grandin 
AuthorDate: Mon Mar 23 08:17:31 2026 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 24 07:38:25 2026 +0100

Fraction->double in SwAccessibleMap

Change-Id: Ia51eeabf8c794d72539c744ecef68e2437378cfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202402
Reviewed-by: Noel Grandin 
Tested-by: Jenkins

diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx
index 810fccd5a550..790c87b509fb 100644
--- a/sw/inc/accmap.hxx
+++ b/sw/inc/accmap.hxx
@@ -48,7 +48,6 @@ class SwRect;
 class MapMode;
 class SwAccPreviewData;
 class SwFEShell;
-class Fraction;
 struct PreviewPage;
 namespace vcl { class Window; }
 namespace com::sun::star::accessibility { class XAccessible; }
@@ -150,7 +149,7 @@ public:
 
 rtl::Reference
 GetDocumentPreview(const std::vector>& 
_rPreviewPages,
-   const Fraction& _rScale, const SwPageFrame* 
_pSelectedPageFrame,
+   double _fScale, const SwPageFrame* _pSelectedPageFrame,
const Size& _rPreviewWinSize);
 
 ::rtl::Reference < SwAccessibleContext > GetContextImpl(
@@ -246,7 +245,7 @@ public:
 
 // update preview data (and fire events if necessary)
 void UpdatePreview( const std::vector>& 
_rPreviewPages,
-const Fraction&  _rScale,
+double _fScale,
 const SwPageFrame* _pSelectedPageFrame,
 const Size&  _rPreviewWinSize );
 
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 86feef20b84d..074937f1e0ff 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -668,7 +668,7 @@ public:
 
 void Update( const SwAccessibleMap& rAccMap,
  const std::vector>& 
_rPreviewPages,
- const Fraction&  _rScale,
+ double _fScale,
  const SwPageFrame* _pSelectedPageFrame,
  const Size&  _rPreviewWinSize );
 
@@ -695,7 +695,7 @@ SwAccPreviewData::SwAccPreviewData() :
 
 void SwAccPreviewData::Update( const SwAccessibleMap& rAccMap,
const 
std::vector>& _rPreviewPages,
-   const Fraction&  _rScale,
+   double  _rScale,
const SwPageFrame* _pSelectedPageFrame,
const Size&  _rPreviewWinSize )
 {
@@ -1648,7 +1648,7 @@ rtl::Reference 
SwAccessibleMap::GetDocumentView()
 
 rtl::Reference
 SwAccessibleMap::GetDocumentPreview(const 
std::vector>& _rPreviewPages,
-const Fraction& _rScale, const 
SwPageFrame* _pSelectedPageFrame,
+double _rScale, const SwPageFrame* 
_pSelectedPageFrame,
 const Size& _rPreviewWinSize)
 {
 // create & update preview data object
@@ -2634,7 +2634,7 @@ sal_Int32 SwAccessibleMap::GetChildIndex( const SwFrame& 
rParentFrame,
 }
 
 void SwAccessibleMap::UpdatePreview( const 
std::vector>& _rPreviewPages,
- const Fraction&  _rScale,
+ double  _rScale,
  const SwPageFrame* _pSelectedPageFrame,
  const Size&  _rPreviewWinSize )
 {
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index d47bf630406c..62d050c1ac44 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -281,7 +281,7 @@ public:
 /// update data for accessible preview
 /// change method signature due to new page preview functionality
 void UpdateAccessiblePreview( const 
std::vector>& _rPreviewPages,
-  const Fraction&  _rScale,
+  double _fScale,
   const SwPageFrame* _pSelectedPageFrame,
   const Size&  _rPreviewWinSize );
 
diff --git a/sw/source/core/view/pagepreviewlayout.cxx 
b/sw/source/core/view/pagepreviewlayout.cxx
index 513120033f96..017cd36b06a8 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -1141,7 +1141,7 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& 
rRenderContext, const tools:
 // update at accessibility interface
 mrParentViewShell.Imp()->UpdateAccessiblePreview(
 maPreviewPages,
-  

core.git: sw/inc sw/source

2026-03-23 Thread Noel Grandin (via logerrit)
 sw/inc/pagedesc.hxx  |6 +++---
 sw/source/core/layout/pagedesc.cxx   |2 +-
 sw/source/filter/ww8/docxattributeoutput.cxx |2 +-
 sw/source/filter/ww8/rtfexport.cxx   |2 +-
 sw/source/ui/misc/pgfnote.cxx|2 +-
 sw/source/uibase/utlui/uiitems.cxx   |7 +++
 6 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit bda2d1fb216577fc1e32b0ff693b78b96e063a44
Author: Noel Grandin 
AuthorDate: Sun Mar 22 20:08:46 2026 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 24 05:34:52 2026 +0100

Fraction->double in SwPageFootnoteInfo

Change-Id: I2766a5a97538240af16c7e5fbf520e6f2f39b978
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202401
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index 580279efbe18..7df2637b6a6a 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -51,7 +51,7 @@ private:
 sal_uLong   m_nLineWidth;   ///< width of separator line
 SvxBorderLineStyle m_eLineStyle;  ///< Style of the separator line
 Color   m_LineColor;///< color of the separator line
-Fractionm_Width;///< percentage width of the separator line.
+double  m_Width;///< percentage width of the separator line.
 css::text::HorizontalAdjust m_eAdjust;  ///< line adjustment.
 SwTwips m_nTopDist; ///< distance between body and separator.
 SwTwips m_nBottomDist;  ///< distance between separator and first 
footnote
@@ -61,7 +61,7 @@ public:
 sal_uLong   GetLineWidth() const{ return m_nLineWidth; }
 const Color& GetLineColor() const   { return m_LineColor;}
 SvxBorderLineStyle  GetLineStyle() const { return m_eLineStyle; }
-const Fraction& GetWidth() const{ return m_Width; }
+double GetWidth() const{ return m_Width; }
 css::text::HorizontalAdjust GetAdj() const { return m_eAdjust; }
 SwTwips GetTopDist() const  { return m_nTopDist; }
 SwTwips GetBottomDist() const   { return m_nBottomDist; }
@@ -70,7 +70,7 @@ public:
 void SetLineWidth(sal_uLong const nSet) { m_nLineWidth = nSet; }
 void SetLineStyle(SvxBorderLineStyle const eSet) {m_eLineStyle = eSet;}
 void SetLineColor(const Color& rCol){ m_LineColor = rCol;}
-void SetWidth(const Fraction & rNew){ m_Width = rNew; }
+void SetWidth(double rNew){ m_Width = rNew; }
 void SetAdj(css::text::HorizontalAdjust const eNew)   { m_eAdjust = eNew; }
 void SetTopDist   (SwTwips const nNew)  { m_nTopDist = nNew; }
 void SetBottomDist(SwTwips const nNew)  { m_nBottomDist = nNew; }
diff --git a/sw/source/core/layout/pagedesc.cxx 
b/sw/source/core/layout/pagedesc.cxx
index 9f9ce0b7e434..896b7687d1cc 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -701,7 +701,7 @@ SwPageFootnoteInfo::SwPageFootnoteInfo()
 : m_nMaxHeight( 0 )
 , m_nLineWidth(10)
 , m_eLineStyle( SvxBorderLineStyle::SOLID )
-, m_Width( 25, 100 )
+, m_Width( 25.0 / 100 )
 , m_nTopDist( 57 ) //1mm
 , m_nBottomDist( 57 )
 {
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index b1f14d97c795..532c4f524164 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -9185,7 +9185,7 @@ void DocxAttributeOutput::FootnotesEndnotes( bool 
bFootnotes )
 // Request separator only if both width and thickness are non-zero.
 bSeparator = rFootnoteInfo.GetLineStyle() != SvxBorderLineStyle::NONE
   && rFootnoteInfo.GetLineWidth() > 0
-  && double(rFootnoteInfo.GetWidth()) > 0;
+  && rFootnoteInfo.GetWidth() > 0;
 nHeight = sw::FootnoteSeparatorHeight(m_rExport.m_rDoc, rFootnoteInfo);
 
 const IDocumentSettingAccess& rIDSA = 
m_rExport.m_rDoc.getIDocumentSettingAccess();
diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index a7a3dd6c80e5..d27830ac2f90 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -468,7 +468,7 @@ void RtfExport::WriteFootnoteSettings()
 {
 const SwPageFootnoteInfo& rFootnoteInfo = 
m_rDoc.GetPageDesc(0).GetFootnoteInfo();
 // Request a separator only in case the width is larger than zero.
-bool bSeparator = double(rFootnoteInfo.GetWidth()) > 0;
+bool bSeparator = rFootnoteInfo.GetWidth() > 0;
 
 Strm()
 .WriteChar('{')
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index f21554b3eb8a..8c9a8eb5e248 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -278,7 +278,7 @@ bool SwFootNotePage::FillItemSet(SfxItemSet *rSet)
 
rFootnoteInfo.SetAdj(static_cast(m_xLinePosBox->get_active()));
 
 // Width
-
rFootnoteInfo.SetWidth(Fraction(m_x

core.git: sw/inc sw/source

2026-03-19 Thread Noel Grandin (via logerrit)
 sw/inc/SwNumberTree.hxx   |8 +-
 sw/source/core/SwNumberTree/SwNumberTree.cxx  |   81 +++---
 sw/source/core/doc/DocumentRedlineManager.cxx |3 
 3 files changed, 42 insertions(+), 50 deletions(-)

New commits:
commit 0e47a21503e6bb78a05334156d4c3a967e19122c
Author: Noel Grandin 
AuthorDate: Thu Mar 19 11:21:16 2026 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 19 16:28:33 2026 +0100

improve SwNumberTreeNode::MoveChildren perf (ofz#422030803 related)

Use o3tl::sorted_vector instead of std::set,
the sets are fairly small here,
and cache effects dominate.

Takes the test for this test file from 7.6s to 0.6s

Change-Id: I7fad3cd20ab1df01b11273e5f841109fc846433e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202152
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/SwNumberTree.hxx b/sw/inc/SwNumberTree.hxx
index f9e3a2745bb9..39ac9eef7cbe 100644
--- a/sw/inc/SwNumberTree.hxx
+++ b/sw/inc/SwNumberTree.hxx
@@ -19,8 +19,7 @@
 
 #pragma once
 
-#include 
-#include 
+#include 
 #include "SwNumberTreeTypes.hxx"
 
 class SwDoc;
@@ -113,7 +112,8 @@ struct compSwNumberTreeNodeLessThan
 class SAL_DLLPUBLIC_RTTI SwNumberTreeNode
 {
 protected:
-typedef std::set 
tSwNumberTreeChildren;
+typedef o3tl::sorted_vector
+tSwNumberTreeChildren;
 
 public:
 SwNumberTreeNode();
@@ -402,7 +402,7 @@ protected:
than or equal to the referenced child are valid. All children
greater than the referenced child are invalid.
  */
-mutable tSwNumberTreeChildren::const_iterator mItLastValid;
+mutable SwNumberTreeNode* mpLastValid{ nullptr };
 
 SwNumberTreeNode(const SwNumberTreeNode&);
 SwNumberTreeNode& operator=(const SwNumberTreeNode&);
diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx 
b/sw/source/core/SwNumberTree/SwNumberTree.cxx
index a035fbf89b64..9dbddcebad26 100644
--- a/sw/source/core/SwNumberTree/SwNumberTree.cxx
+++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx
@@ -33,7 +33,6 @@ SwNumberTreeNode::SwNumberTreeNode()
   mbContinueingPreviousSubTree( false ),
   mbPhantom( false )
 {
-mItLastValid = mChildren.end();
 }
 
 SwNumberTreeNode::~SwNumberTreeNode()
@@ -45,7 +44,7 @@ SwNumberTreeNode::~SwNumberTreeNode()
 delete *mChildren.begin();
 
 mChildren.clear();
-mItLastValid = mChildren.end();
+mpLastValid = nullptr;
 }
 else
 {
@@ -75,8 +74,7 @@ SwNumberTreeNode * SwNumberTreeNode::CreatePhantom()
 pNew->mbPhantom = true;
 pNew->mpParent = this;
 
-std::pair aInsert =
-mChildren.insert(pNew);
+auto aInsert = mChildren.insert(pNew);
 
 if (! aInsert.second)
 {
@@ -103,7 +101,7 @@ SwNumberTreeNode * SwNumberTreeNode::GetRoot() const
 
 void SwNumberTreeNode::ClearObsoletePhantoms()
 {
-tSwNumberTreeChildren::iterator aIt = mChildren.begin();
+auto aIt = mChildren.begin();
 
 if (!(aIt != mChildren.end() && (*aIt)->IsPhantom()))
 return;
@@ -114,8 +112,8 @@ void SwNumberTreeNode::ClearObsoletePhantoms()
 {
 // #i60652#
 // Because  could destroy the element, which
-// is referenced by , it's needed to adjust
-//  before erasing .
+// is referenced by , it's needed to adjust
+//  before erasing .
 SetLastValid(mChildren.end());
 
 delete *aIt;
@@ -133,7 +131,7 @@ void SwNumberTreeNode::ValidateHierarchical(const 
SwNumberTreeNode * pNode) cons
 
 OSL_ENSURE((*aValidateIt)->mpParent == this, "wrong parent");
 
-tSwNumberTreeChildren::const_iterator aIt = mItLastValid;
+auto aIt = mpLastValid == nullptr ? mChildren.end() : 
mChildren.find(mpLastValid);
 
 // -->
 // improvement:
@@ -228,7 +226,7 @@ void SwNumberTreeNode::ValidateHierarchical(const 
SwNumberTreeNode * pNode) cons
 
 void SwNumberTreeNode::ValidateContinuous(const SwNumberTreeNode * pNode) const
 {
-tSwNumberTreeChildren::const_iterator aIt = mItLastValid;
+auto aIt = mpLastValid == nullptr ? mChildren.end() : 
mChildren.find(mpLastValid);
 
 do
 {
@@ -322,7 +320,7 @@ void SwNumberTreeNode::MoveGreaterChildren( 
SwNumberTreeNode& _rCompareNode,
 return;
 
 // determine first child, which has to move to <_rDestNode>
-tSwNumberTreeChildren::iterator aItUpper( mChildren.end() );
+auto aItUpper( mChildren.end() );
 if ((*mChildren.begin())->IsPhantom() &&
 
_rCompareNode.LessThan(*(*mChildren.begin())->GetFirstNonPhantomChild()))
 {
@@ -337,16 +335,15 @@ void SwNumberTreeNode::MoveGreaterChildren( 
SwNumberTreeNode& _rCompareNode,
 if (aItUpper != mChildren.end())
 {
 // #i60652#
-// Adjust  before modifying mChildren, because
+// Adjust  before modifying mChildren, because
 // erase/extract could destroy the element it references.
 Set

core.git: sw/inc sw/source

2026-03-17 Thread Gökay Şatır (via logerrit)
 sw/inc/viscrs.hxx |2 +-
 sw/source/core/crsr/viscrs.cxx|   19 +--
 sw/source/uibase/wrtsh/wrtsh4.cxx |   31 +--
 3 files changed, 31 insertions(+), 21 deletions(-)

New commits:
commit 85057d938da564973d91336b8330bd6dc65b6ce4
Author: Gökay Şatır 
AuthorDate: Mon Mar 2 16:46:04 2026 +0300
Commit: Miklos Vajna 
CommitDate: Tue Mar 17 08:11:33 2026 +0100

Writer: Fix empty selection callback.

Issue: When selecting words using CTRL+Mouse click, core side needs to send 
the selection rectangles to Online side.
Rectangles are not sent but an empty message.

Fix: Aggregate selection rectangles from all cursors in the ring.
In add mode (CTRL+click multi-selection), the actual selections
are stored in ring cursors, while m_pCurrentCursor may be empty.
Without aggregation, callback only reads from m_pCurrentCursor and sends an 
empty payload,
clearing the selection on the online side.

Change-Id: I9af5d850ab59644f56358a9ecc5985b2ad529619
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201841
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx
index 66c7df3387bb..4f4ae8d06fc0 100644
--- a/sw/inc/viscrs.hxx
+++ b/sw/inc/viscrs.hxx
@@ -138,7 +138,7 @@ public:
 static void Get1PixelInLogic( const SwViewShell& rSh,
 tools::Long* pX = nullptr, tools::Long* pY 
= nullptr );
 
-std::optional getLOKPayload(int nType, int nViewId) const;
+std::optional getLOKPayload(int nType) const;
 };
 
 /// Represents the current text cursor of one opened edit window.
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 6d362dea4992..7f425448f299 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -531,7 +531,7 @@ void SwSelPaintRects::Show(std::vector* 
pSelectionRectangles)
 pSelectionRectangles->push_back(sRect);
 }
 
-std::optional SwSelPaintRects::getLOKPayload(int nType, int nViewId) 
const
+std::optional SwSelPaintRects::getLOKPayload(int nType) const
 {
 switch( nType )
 {
@@ -565,23 +565,6 @@ std::optional SwSelPaintRects::getLOKPayload(int 
nType, int nViewId) co
 }
 }
 break;
-case LOK_CALLBACK_TEXT_SELECTION:
-case LOK_CALLBACK_TEXT_VIEW_SELECTION:
-{
-std::vector aRect;
-aRect.reserve(size());
-for (size_type i = 0; i < size(); ++i)
-{
-const SwRect& rRect = (*this)[i];
-aRect.push_back(rRect.SVRect().toString());
-}
-OString sRect = comphelper::string::join("; ", aRect);
-if( nType == LOK_CALLBACK_TEXT_SELECTION )
-return sRect;
-else // LOK_CALLBACK_TEXT_VIEW_SELECTION
-return 
SfxLokHelper::makePayloadJSON(GetShell()->GetSfxViewShell(), nViewId, 
"selection", sRect);
-}
-break;
 }
 abort();
 }
diff --git a/sw/source/uibase/wrtsh/wrtsh4.cxx 
b/sw/source/uibase/wrtsh/wrtsh4.cxx
index 0442e3152bb6..7e7591c950c0 100644
--- a/sw/source/uibase/wrtsh/wrtsh4.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh4.cxx
@@ -18,8 +18,11 @@
  */
 
 #include 
+#include 
 
 #include 
+#include 
+#include 
 
 // Private methods, which move the cursor over search.
 // The removal of the selection must be made on the level above.
@@ -242,10 +245,34 @@ std::optional SwWrtShell::getLOKPayload(int 
nType, int nViewId) const
 case LOK_CALLBACK_INVALIDATE_VIEW_CURSOR:
 return GetVisibleCursor()->getLOKPayload(nType, nViewId);
 case LOK_CALLBACK_TEXT_SELECTION:
+case LOK_CALLBACK_TEXT_VIEW_SELECTION:
+{
+// Aggregate selection rectangles from all cursors in the ring.
+// In add mode (CTRL+click multi-selection), the actual selections
+// are stored in ring cursors, while m_pCurrentCursor may be empty.
+// Without aggregation, callback only reads from m_pCurrentCursor 
and send an empty payload,
+// clearing the selection on the online side.
+std::vector aAllRects;
+for (const SwPaM& rPaM : GetCursor_()->GetRingContainer())
+{
+const SwShellCursor* pShCursor = dynamic_cast(&rPaM);
+if (!pShCursor)
+continue;
+for (size_t i = 0; i < pShCursor->size(); ++i)
+{
+const SwRect& rRect = (*pShCursor)[i];
+aAllRects.push_back(rRect.SVRect().toString());
+}
+}
+OString sRect = comphelper::string::join("; ", aAllRects);
+if (nType == LOK_CALLBACK_TEXT_SELECTION)
+return sRect;
+else // LOK_CALLBACK_TEXT_VIEW_SELECTION
+return SfxLokHelper::makePayloadJSON(GetSfxViewShell(), 
nVie

core.git: sw/inc

2026-03-13 Thread yaswantpenapaka (via logerrit)
 sw/inc/expfld.hxx |6 ++
 sw/inc/finalthreadmanager.hxx |4 +---
 sw/inc/fldbas.hxx |6 ++
 sw/inc/flddat.hxx |5 +
 sw/inc/flddropdown.hxx|6 ++
 5 files changed, 8 insertions(+), 19 deletions(-)

New commits:
commit f5e5ac6a4493370b8080625d56e048baafd57f2b
Author: yaswantpenapaka 
AuthorDate: Thu Mar 12 23:11:16 2026 +0530
Commit: Ilmari Lauhakangas 
CommitDate: Fri Mar 13 18:57:11 2026 +0100

tdf#143148 replace include guards with pragma once

Replace include guards with pragma once in selected header files from
sw/inc folder.

Change-Id: Ibd0d5987121fc7e7ade0496c13fc9516625a178e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201571
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas 

diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index e04b66435261..e62719117bc2 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -16,8 +16,8 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SW_INC_EXPFLD_HXX
-#define INCLUDED_SW_INC_EXPFLD_HXX
+
+#pragma once
 
 #include "swdllapi.h"
 #include "fldbas.hxx"
@@ -424,6 +424,4 @@ public:
 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
-#endif // INCLUDED_SW_INC_EXPFLD_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/finalthreadmanager.hxx b/sw/inc/finalthreadmanager.hxx
index cf35dd731b47..10356b0aa140 100644
--- a/sw/inc/finalthreadmanager.hxx
+++ b/sw/inc/finalthreadmanager.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SW_SOURCE_CORE_INC_FINALTHREADMANAGER_HXX
-#define INCLUDED_SW_SOURCE_CORE_INC_FINALTHREADMANAGER_HXX
+#pragma once
 
 #include 
 #include 
@@ -82,6 +81,5 @@ private:
 
 bool mbRegisteredAtDesktop;
 };
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 5756dccae44b..5c4dd935d4a2 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -16,8 +16,8 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SW_INC_FLDBAS_HXX
-#define INCLUDED_SW_INC_FLDBAS_HXX
+
+#pragma once
 
 #include 
 #include "swdllapi.h"
@@ -482,6 +482,4 @@ public:
 OUStringGetInputOrDateTime() const;
 };
 
-#endif // INCLUDED_SW_INC_FLDBAS_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/flddat.hxx b/sw/inc/flddat.hxx
index f79801af968c..fb2001bc1d22 100644
--- a/sw/inc/flddat.hxx
+++ b/sw/inc/flddat.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SW_INC_FLDDAT_HXX
-#define INCLUDED_SW_INC_FLDDAT_HXX
+#pragma once
 
 #include 
 
@@ -74,6 +73,4 @@ public:
 virtual boolPutValue( const css::uno::Any& rVal, 
sal_uInt16 nMId ) override;
 };
 
-#endif // INCLUDED_SW_INC_FLDDAT_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/flddropdown.hxx b/sw/inc/flddropdown.hxx
index 5c336207219f..3a8cdc6ac867 100644
--- a/sw/inc/flddropdown.hxx
+++ b/sw/inc/flddropdown.hxx
@@ -16,8 +16,8 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SW_INC_FLDDROPDOWN_HXX
-#define INCLUDED_SW_INC_FLDDROPDOWN_HXX
+
+#pragma once
 
 #include 
 #include "swdllapi.h"
@@ -260,6 +260,4 @@ public:
 virtual bool PutValue(const css::uno::Any& rVal, sal_uInt16 nWhichId) 
override;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: sw/inc sw/source

2026-03-04 Thread Caolán McNamara (via logerrit)
 sw/inc/AnnotationWin.hxx  |1 +
 sw/source/uibase/docvw/AnnotationWin2.cxx |   13 +
 2 files changed, 14 insertions(+)

New commits:
commit 56f2abbf3f107d849305df507818f00e6f6086df
Author: Caolán McNamara 
AuthorDate: Tue Mar 3 11:58:45 2026 +
Commit: Caolán McNamara 
CommitDate: Wed Mar 4 09:31:57 2026 +0100

tdf#170645 During a save the comment can lose focus

During the save the ui is set disabled/insensitive, and the gtk
widget in the comment will lose focus, and not automatically regain
it when enabled/sensitive. So manually restore it when enabled and
it should still have focus.

Change-Id: Icf08d6695cb1d6883636747bb3d70e18f64fb75c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200884
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index 70ba4fa42d0c..47b5ab6209f7 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -213,6 +213,7 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public 
InterimItemWindow
 
 virtual voidLoseFocus() override;
 virtual voidGetFocus() override;
+virtual voidStateChanged(StateChangedType nStateChange) override;
 
 virtual void Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect) override;
 voidSetSizePixel( const Size& rNewSize ) override;
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 28fb6d9ff993..801e21892e6f 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -971,6 +971,19 @@ void SwAnnotationWin::Paint(vcl::RenderContext& 
rRenderContext, const tools::Rec
 }
 }
 
+// tdf#170645 During a save the UI is disabled/insensitive so in GTK the
+// widget with focus will lose it, so restore that when enabled/sensitive
+void SwAnnotationWin::StateChanged(StateChangedType nStateChange)
+{
+InterimItemWindow::StateChanged(nStateChange);
+if (nStateChange == StateChangedType::Enable && IsEnabled()
+&& mrMgr.GetActiveSidebarWin() == this
+&& mxSidebarTextControl && !mxSidebarTextControl->HasFocus())
+{
+mxSidebarTextControl->GrabFocus();
+}
+}
+
 void SwAnnotationWin::ShowNote()
 {
 SetPosAndSize();


core.git: sw/inc sw/source

2026-03-03 Thread Michael Weghorn (via logerrit)
 sw/inc/swtable.hxx|2 +-
 sw/source/core/table/swtable.cxx  |   11 +++
 sw/source/core/unocore/unotbl.cxx |3 +--
 sw/source/filter/xml/xmltble.cxx  |6 ++
 4 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 16bf64fc7691d22162036f3f9bef37ffb1fbd9c8
Author: Michael Weghorn 
AuthorDate: Tue Mar 3 11:48:33 2026 +0100
Commit: Michael Weghorn 
CommitDate: Wed Mar 4 07:19:04 2026 +0100

tdf#171086 sw: Only return col name in sw_GetTableBoxColStr

So far, sw_GetTableBoxColStr was taking a string ref
in/out param and prepending the column name to
that existing string.

Instead, just return the column name and let the only
caller that wants to prepend it to an existing string
do so itself.

This makes the method's semantic clearer and simplifies
the other callers.

Change-Id: I7b5fa2f38a82cc6a191d29e26aef62f8169a2eec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200878
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index 9401e43e42f5..0e82d80ebb72 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -57,7 +57,7 @@ struct Parm;
 class SwServerObject;
 class SwHistory;
 
-void sw_GetTableBoxColStr( sal_uInt16 nCol, OUString& rNm );
+OUString sw_GetTableBoxColStr(sal_uInt16 nCol);
 
 class SwTableLines
 {
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 25979b7d66eb..ce3da88f56c0 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2187,16 +2187,17 @@ void SwTableBox::ChgFrameFormat(SwTableBoxFormat* 
pNewFormat, bool bNeedToReregi
 
 // Return the name of this box. This is determined dynamically
 // resulting from the position in the lines/boxes/tables.
-void sw_GetTableBoxColStr( sal_uInt16 nCol, OUString& rNm )
+OUString sw_GetTableBoxColStr(sal_uInt16 nCol)
 {
 const sal_uInt16 coDiff = 52;   // 'A'-'Z' 'a' - 'z'
 
+OUString sName;
 do {
 const sal_uInt16 nCalc = nCol % coDiff;
 if( nCalc >= 26 )
-rNm = OUStringChar( sal_Unicode('a' - 26 + nCalc) ) + rNm;
+sName = OUStringChar(sal_Unicode('a' - 26 + nCalc)) + sName;
 else
-rNm = OUStringChar( sal_Unicode('A' + nCalc) ) + rNm;
+sName = OUStringChar(sal_Unicode('A' + nCalc)) + sName;
 
 nCol = nCol - nCalc;
 if( 0 == nCol )
@@ -2204,6 +2205,8 @@ void sw_GetTableBoxColStr( sal_uInt16 nCol, OUString& rNm 
)
 nCol /= coDiff;
 --nCol;
 } while( true );
+
+return sName;
 }
 
 Point SwTableBox::GetCoordinates() const
@@ -2260,7 +2263,7 @@ OUString SwTableBox::GetName() const
 if( nullptr != pBox )
 sNm = sTmp + "." + sNm;
 else
-sw_GetTableBoxColStr( nPos, sNm );
+sNm = sw_GetTableBoxColStr(nPos) + sNm;
 
 } while( pBox );
 return sNm;
diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index 26e9e0682cb7..a2cd1f205739 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -493,8 +493,7 @@ OUString sw_GetCellName( sal_Int32 nColumn, sal_Int32 nRow )
 {
 if (nColumn < 0 || nRow < 0)
 return OUString();
-OUString sCellName;
-sw_GetTableBoxColStr( static_cast< sal_uInt16 >(nColumn), sCellName );
+const OUString sCellName = 
sw_GetTableBoxColStr(static_cast(nColumn));
 return sCellName + OUString::number( nRow + 1 );
 }
 
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 45b882b8f0d7..b35a33a7a8d5 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -312,8 +312,7 @@ static OUString 
lcl_xmltble_appendBoxPrefix(std::u16string_view rNamePrefix,
 {
 if( bTop )
 {
-OUString sTmp;
-sw_GetTableBoxColStr( o3tl::narrowing(nCol), sTmp );
+const OUString sTmp = 
sw_GetTableBoxColStr(o3tl::narrowing(nCol));
 return OUString::Concat(rNamePrefix) + "." + sTmp + 
OUString::number(nRow + 1);
 }
 return OUString::Concat(rNamePrefix)
@@ -645,8 +644,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const 
SwTableLines& rLines,
 {
 if( bTop )
 {
-OUString sTmp;
-sw_GetTableBoxColStr( nColumn, sTmp );
+const OUString sTmp = sw_GetTableBoxColStr(nColumn);
 pColumn->SetStyleName( OUString::Concat(rNamePrefix) + "." 
+ sTmp );
 }
 else


core.git: sw/inc

2026-03-02 Thread Caolán McNamara (via logerrit)
 sw/inc/ndhints.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 12ff9cda71c6a4f83e8db0b3f3f9bcfb337d32ca
Author: Caolán McNamara 
AuthorDate: Sun Mar 1 21:31:18 2026 +
Commit: Caolán McNamara 
CommitDate: Mon Mar 2 09:12:16 2026 +0100

decode these assert lines to be more readable

Change-Id: I7bd0c4e9efe4b1625e52d0d1f1f6f3fc3e499d70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200734
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins

diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx
index e5d43d5973f7..ada0131a7274 100644
--- a/sw/inc/ndhints.hxx
+++ b/sw/inc/ndhints.hxx
@@ -163,7 +163,7 @@ public:
 int GetLastPosSortedByEnd(sal_Int32 nEndPos) const;
 SwTextAttr * GetSortedByEnd( size_t nPos ) const
 {
-assert( !(nPos != 0 && m_EndMapNeedsSortingRange.first != 
SAL_MAX_INT32) && "going to trigger a resort in the middle of an iteration, 
that's bad" );
+assert( (nPos == 0 || m_EndMapNeedsSortingRange.first == 
SAL_MAX_INT32) && "going to trigger a resort in the middle of an iteration, 
that's bad" );
 if (m_EndMapNeedsSortingRange.first != SAL_MAX_INT32)
 ResortEndMap();
 return m_HintsByEnd[nPos];
@@ -172,7 +172,7 @@ public:
 size_t GetFirstPosSortedByWhichAndStart(sal_uInt16 nWhich) const;
 SwTextAttr * GetSortedByWhichAndStart( size_t nPos ) const
 {
-assert( !(nPos != 0 && m_WhichMapNeedsSortingRange.first.first != 
SAL_MAX_INT32) && "going to trigger a resort in the middle of an iteration, 
that's bad" );
+assert( (nPos == 0 || m_WhichMapNeedsSortingRange.first.first == 
SAL_MAX_INT32) && "going to trigger a resort in the middle of an iteration, 
that's bad" );
 if (m_WhichMapNeedsSortingRange.first.first != SAL_MAX_INT32)
 ResortWhichMap();
 return m_HintsByWhichAndStart[nPos];


core.git: sw/inc sw/source

2026-02-25 Thread Sahil Gautam (via logerrit)
 sw/inc/unotxdoc.hxx   |1 +
 sw/source/uibase/uno/loktxdoc.cxx |1 +
 sw/source/uibase/uno/unotxdoc.cxx |   15 +++
 3 files changed, 17 insertions(+)

New commits:
commit ee612f2c1bcf94efc93e2548b93442a9973a3df6
Author: Sahil Gautam 
AuthorDate: Sun Feb 22 00:46:16 2026 +0530
Commit: Michael Stahl 
CommitDate: Wed Feb 25 14:49:06 2026 +0100

add whether partHasComments to the writer partInfo

Change-Id: Ia33910fbcf6609188299a9fbfb781f0b03322683
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199739
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index e440821d2e49..88c7505d5444 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -241,6 +241,7 @@ private:
 
 void ThrowIfInvalid() const;
 SwDoc& GetDocOrThrow() const;
+bool partHasComments() const;
 
 public:
 SwXTextDocument(SwDocShell* pShell);
diff --git a/sw/source/uibase/uno/loktxdoc.cxx 
b/sw/source/uibase/uno/loktxdoc.cxx
index 27f0ebca1d3c..5fa3ad62fff9 100644
--- a/sw/source/uibase/uno/loktxdoc.cxx
+++ b/sw/source/uibase/uno/loktxdoc.cxx
@@ -1172,6 +1172,7 @@ OUString SwXTextDocument::getPartInfo(int /*nPart*/)
 {
 tools::JsonWriter jsonWriter;
 jsonWriter.put("mode", getEditMode());
+jsonWriter.put("partHasComments", partHasComments() ? "true" : "false");
 return OUString::fromUtf8(jsonWriter.finishAndGetAsOString());
 }
 
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 121430651da7..077d27c499e2 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -390,6 +390,21 @@ SwDoc& SwXTextDocument::GetDocOrThrow() const
 const_cast(this)->getXWeak());
 }
 
+bool SwXTextDocument::partHasComments() const
+{
+if (!m_pDocShell)
+return false;
+
+for (auto const& sidebarItem : *m_pDocShell->GetView()->GetPostItMgr())
+{
+if (!sidebarItem->mpPostIt)
+continue;
+return true;
+}
+
+return false;
+}
+
 SdrModel& SwXTextDocument::getSdrModelFromUnoModel() const
 {
 return *GetDocOrThrow().getIDocumentDrawModelAccess().GetDrawModel();


core.git: sw/inc sw/qa sw/source xmloff/source

2026-02-23 Thread Karthik Godha (via logerrit)
 sw/inc/tblafmt.hxx |3 ++
 sw/qa/python/check_styles.py   |4 +--
 sw/source/core/doc/tblafmt.cxx |   39 +
 sw/source/core/unocore/unostyle.cxx|5 +++-
 xmloff/source/table/XMLTableExport.cxx |2 -
 5 files changed, 49 insertions(+), 4 deletions(-)

New commits:
commit aac70c14c9754108f485a0f06980a377954854ff
Author: Karthik Godha 
AuthorDate: Mon Feb 23 12:58:39 2026 +0530
Commit: Karthik Godha 
CommitDate: Mon Feb 23 12:08:21 2026 +0100

tdf#170771: Export only edited table styles

Instead of exporting all table styles, export only the ones which were
edited. Note that this will export the edited table style even when it
is not used in the document, this is intentional.

6fc9264fd967a51a91de401ba871d2642e57f9df was the original commit, but
got reverted because of a failing test

Change-Id: I3fcc5948a401e1ff4b2c620f21ae265476c89f0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200028
Reviewed-by: Karthik Godha 
Tested-by: Jenkins

diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index 069a8f65c8c5..a4540b1f1ba2 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -59,6 +59,7 @@ public:
 
 /// Comparing based of boxes backgrounds.
 bool operator==(const SwBoxAutoFormat& rRight) const;
+bool IsSameAs(const SwBoxAutoFormat& rBox) const;
 
 const SvxFrameDirectionItem& GetTextOrientation() const { return 
*m_aTextOrientation; }
 const SwFormatVertOrient& GetVerticalAlignment() const { return 
*m_aVerticalAlignment; }
@@ -145,6 +146,8 @@ public:
SvNumberFormatter const*);
 void FillToItemSet(size_t nIndex, SfxItemSet& rItemSet, SvNumberFormatter* 
pNFormatr) const;
 
+bool NeedsExport();
+
 /// These methods returns what style (row or column) is applied first on 
given Cell
 bool FirstRowEndColumnIsRow();
 bool FirstRowStartColumnIsRow();
diff --git a/sw/qa/python/check_styles.py b/sw/qa/python/check_styles.py
index 4145d8052b6e..d78664ac0177 100644
--- a/sw/qa/python/check_styles.py
+++ b/sw/qa/python/check_styles.py
@@ -199,11 +199,11 @@ class CheckStyle(unittest.TestCase):
 xTableStyle = xDoc.createInstance("com.sun.star.style.TableStyle")
 self.assertFalse(xTableStyle.isInUse())
 xDoc.StyleFamilies["TableStyles"].insertByName("Test Table Style", 
xTableStyle)
-self.assertFalse(xTableStyle.isInUse())
+self.assertTrue(xTableStyle.isInUse())
 xTable.setPropertyValue("TableTemplateName", "Test Table Style")
 self.assertTrue(xTableStyle.isInUse())
 xTable.setPropertyValue("TableTemplateName", "")
-self.assertFalse(xTableStyle.isInUse())
+self.assertTrue(xTableStyle.isInUse())
 xDoc.dispose()
 
 def test_CellFamily(self):
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 5005421b7236..0fcc2e27453c 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -209,6 +209,29 @@ bool SwBoxAutoFormat::operator==(const SwBoxAutoFormat& 
rRight) const
 return GetBackground().GetColor() == rRight.GetBackground().GetColor();
 }
 
+bool SwBoxAutoFormat::IsSameAs(const SwBoxAutoFormat& rRight) const
+{
+if (GetFont() == rRight.GetFont() && GetHeight() == rRight.GetHeight()
+&& GetWeight() == rRight.GetWeight() && GetPosture() == 
rRight.GetPosture() &&
+
+GetCJKFont() == rRight.GetCJKFont() && GetCJKHeight() == 
rRight.GetCJKHeight()
+&& GetCJKWeight() == rRight.GetCJKWeight() && GetCJKPosture() == 
rRight.GetCJKPosture() &&
+
+GetCTLFont() == rRight.GetCTLFont() && GetCTLHeight() == 
rRight.GetCTLHeight()
+&& GetCTLWeight() == rRight.GetCTLWeight() && GetCTLPosture() == 
rRight.GetCTLPosture() &&
+
+GetUnderline() == rRight.GetUnderline() && GetColor() == 
rRight.GetColor()
+&& GetAdjust() == rRight.GetAdjust() && GetVerJustify() == 
rRight.GetVerJustify() &&
+
+GetBackground() == rRight.GetBackground() &&
+
+GetBox() == rRight.GetBox())
+{
+return true;
+}
+return false;
+}
+
 void SwBoxAutoFormat::SetXObject(rtl::Reference const& 
xObject)
 {
 m_xAutoFormatUnoObject = xObject.get();
@@ -561,6 +584,22 @@ void SwTableAutoFormat::FillToItemSet(size_t nIndex, 
SfxItemSet& rItemSet,
 }
 }
 
+bool SwTableAutoFormat::NeedsExport()
+{
+const SwTableAutoFormat* rDefaultStyle
+= SwModule::get()->GetAutoFormatTable().FindAutoFormat(GetName());
+
+if (!rDefaultStyle || rDefaultStyle->GetParent() != GetParent())
+return true;
+
+for (size_t i = 0; i < ELEMENT_COUNT; i++)
+{
+if (!m_aBoxAutoFormat[i]->IsSameAs(*rDefaultStyle->GetField(i)))
+return true;
+}
+return false;
+}
+
 bool SwTableAutoFormat::FirstRowEndColumnIsRow()
 {
 if (*GetField(FIRST_ROW) != GetDefaultBoxFormat()
diff --git a/sw/sou

core.git: sw/inc sw/source xmloff/source

2026-02-18 Thread Heiko Tietze (via logerrit)
 sw/inc/tblafmt.hxx |3 --
 sw/source/core/doc/tblafmt.cxx |   39 -
 sw/source/core/unocore/unostyle.cxx|5 
 xmloff/source/table/XMLTableExport.cxx |2 -
 4 files changed, 2 insertions(+), 47 deletions(-)

New commits:
commit f6c642672d8461c65f735d403a4e55e5487504a2
Author: Heiko Tietze 
AuthorDate: Wed Feb 18 09:16:13 2026 +0100
Commit: Karthik Godha 
CommitDate: Wed Feb 18 11:05:27 2026 +0100

Revert "tdf#170771: Export only edited table styles"

This reverts commit 6fc9264fd967a51a91de401ba871d2642e57f9df.

Reason for revert: PythonTest_sw_python fails

Change-Id: Id15fca158e6395d9960bb272ab131f81419dfdfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199596
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins

diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index a4540b1f1ba2..069a8f65c8c5 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -59,7 +59,6 @@ public:
 
 /// Comparing based of boxes backgrounds.
 bool operator==(const SwBoxAutoFormat& rRight) const;
-bool IsSameAs(const SwBoxAutoFormat& rBox) const;
 
 const SvxFrameDirectionItem& GetTextOrientation() const { return 
*m_aTextOrientation; }
 const SwFormatVertOrient& GetVerticalAlignment() const { return 
*m_aVerticalAlignment; }
@@ -146,8 +145,6 @@ public:
SvNumberFormatter const*);
 void FillToItemSet(size_t nIndex, SfxItemSet& rItemSet, SvNumberFormatter* 
pNFormatr) const;
 
-bool NeedsExport();
-
 /// These methods returns what style (row or column) is applied first on 
given Cell
 bool FirstRowEndColumnIsRow();
 bool FirstRowStartColumnIsRow();
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 0fcc2e27453c..5005421b7236 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -209,29 +209,6 @@ bool SwBoxAutoFormat::operator==(const SwBoxAutoFormat& 
rRight) const
 return GetBackground().GetColor() == rRight.GetBackground().GetColor();
 }
 
-bool SwBoxAutoFormat::IsSameAs(const SwBoxAutoFormat& rRight) const
-{
-if (GetFont() == rRight.GetFont() && GetHeight() == rRight.GetHeight()
-&& GetWeight() == rRight.GetWeight() && GetPosture() == 
rRight.GetPosture() &&
-
-GetCJKFont() == rRight.GetCJKFont() && GetCJKHeight() == 
rRight.GetCJKHeight()
-&& GetCJKWeight() == rRight.GetCJKWeight() && GetCJKPosture() == 
rRight.GetCJKPosture() &&
-
-GetCTLFont() == rRight.GetCTLFont() && GetCTLHeight() == 
rRight.GetCTLHeight()
-&& GetCTLWeight() == rRight.GetCTLWeight() && GetCTLPosture() == 
rRight.GetCTLPosture() &&
-
-GetUnderline() == rRight.GetUnderline() && GetColor() == 
rRight.GetColor()
-&& GetAdjust() == rRight.GetAdjust() && GetVerJustify() == 
rRight.GetVerJustify() &&
-
-GetBackground() == rRight.GetBackground() &&
-
-GetBox() == rRight.GetBox())
-{
-return true;
-}
-return false;
-}
-
 void SwBoxAutoFormat::SetXObject(rtl::Reference const& 
xObject)
 {
 m_xAutoFormatUnoObject = xObject.get();
@@ -584,22 +561,6 @@ void SwTableAutoFormat::FillToItemSet(size_t nIndex, 
SfxItemSet& rItemSet,
 }
 }
 
-bool SwTableAutoFormat::NeedsExport()
-{
-const SwTableAutoFormat* rDefaultStyle
-= SwModule::get()->GetAutoFormatTable().FindAutoFormat(GetName());
-
-if (!rDefaultStyle || rDefaultStyle->GetParent() != GetParent())
-return true;
-
-for (size_t i = 0; i < ELEMENT_COUNT; i++)
-{
-if (!m_aBoxAutoFormat[i]->IsSameAs(*rDefaultStyle->GetField(i)))
-return true;
-}
-return false;
-}
-
 bool SwTableAutoFormat::FirstRowEndColumnIsRow()
 {
 if (*GetField(FIRST_ROW) != GetDefaultBoxFormat()
diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index c543a20cdf35..4aa6b2f8c0c9 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -4565,9 +4565,6 @@ sal_Bool SAL_CALL SwXTextTableStyle::isInUse()
 if (!m_bPhysical)
 return false;
 
-if (m_pTableAutoFormat->NeedsExport())
-return true;
-
 for (const SwTableFormat* pFormat : 
*m_pDocShell->GetDoc()->GetTableFrameFormats())
 {
 if(pFormat->IsUsed())
@@ -4937,7 +4934,7 @@ sal_Bool SAL_CALL SwXTextCellStyle::isInUse()
 if (!xStyle.is())
 return false;
 
-return xStyle->isInUse();
+return true;
 }
 
 OUString SAL_CALL SwXTextCellStyle::getParentStyle() { return m_sParentName; }
diff --git a/xmloff/source/table/XMLTableExport.cxx 
b/xmloff/source/table/XMLTableExport.cxx
index 455319dfcdf7..c22e68db1609 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -608,7 +608,7 @@ void XMLTableExport::exportTableTemplates()
 {
 }
 
-if (!xTableStyle->isInUse() && !bPhysical)
+

core.git: sw/inc sw/source xmloff/source

2026-02-17 Thread karthik (via logerrit)
 sw/inc/tblafmt.hxx |3 ++
 sw/source/core/doc/tblafmt.cxx |   39 +
 sw/source/core/unocore/unostyle.cxx|5 +++-
 xmloff/source/table/XMLTableExport.cxx |2 -
 4 files changed, 47 insertions(+), 2 deletions(-)

New commits:
commit 6fc9264fd967a51a91de401ba871d2642e57f9df
Author: karthik 
AuthorDate: Tue Feb 17 12:18:43 2026 +0530
Commit: Karthik Godha 
CommitDate: Tue Feb 17 14:26:05 2026 +0100

tdf#170771: Export only edited table styles

Instead of exporting all table styles, export only the ones which were
edited. Note that this will export the edited table style even when it
is not used in the document, this is intentional.

Change-Id: I3ad0587352defc81828e7de7015ee7cb5cb3af76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199514
Reviewed-by: Karthik Godha 
Reviewed-by: Heiko Tietze 
Tested-by: Heiko Tietze 

diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index 069a8f65c8c5..a4540b1f1ba2 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -59,6 +59,7 @@ public:
 
 /// Comparing based of boxes backgrounds.
 bool operator==(const SwBoxAutoFormat& rRight) const;
+bool IsSameAs(const SwBoxAutoFormat& rBox) const;
 
 const SvxFrameDirectionItem& GetTextOrientation() const { return 
*m_aTextOrientation; }
 const SwFormatVertOrient& GetVerticalAlignment() const { return 
*m_aVerticalAlignment; }
@@ -145,6 +146,8 @@ public:
SvNumberFormatter const*);
 void FillToItemSet(size_t nIndex, SfxItemSet& rItemSet, SvNumberFormatter* 
pNFormatr) const;
 
+bool NeedsExport();
+
 /// These methods returns what style (row or column) is applied first on 
given Cell
 bool FirstRowEndColumnIsRow();
 bool FirstRowStartColumnIsRow();
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 5005421b7236..0fcc2e27453c 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -209,6 +209,29 @@ bool SwBoxAutoFormat::operator==(const SwBoxAutoFormat& 
rRight) const
 return GetBackground().GetColor() == rRight.GetBackground().GetColor();
 }
 
+bool SwBoxAutoFormat::IsSameAs(const SwBoxAutoFormat& rRight) const
+{
+if (GetFont() == rRight.GetFont() && GetHeight() == rRight.GetHeight()
+&& GetWeight() == rRight.GetWeight() && GetPosture() == 
rRight.GetPosture() &&
+
+GetCJKFont() == rRight.GetCJKFont() && GetCJKHeight() == 
rRight.GetCJKHeight()
+&& GetCJKWeight() == rRight.GetCJKWeight() && GetCJKPosture() == 
rRight.GetCJKPosture() &&
+
+GetCTLFont() == rRight.GetCTLFont() && GetCTLHeight() == 
rRight.GetCTLHeight()
+&& GetCTLWeight() == rRight.GetCTLWeight() && GetCTLPosture() == 
rRight.GetCTLPosture() &&
+
+GetUnderline() == rRight.GetUnderline() && GetColor() == 
rRight.GetColor()
+&& GetAdjust() == rRight.GetAdjust() && GetVerJustify() == 
rRight.GetVerJustify() &&
+
+GetBackground() == rRight.GetBackground() &&
+
+GetBox() == rRight.GetBox())
+{
+return true;
+}
+return false;
+}
+
 void SwBoxAutoFormat::SetXObject(rtl::Reference const& 
xObject)
 {
 m_xAutoFormatUnoObject = xObject.get();
@@ -561,6 +584,22 @@ void SwTableAutoFormat::FillToItemSet(size_t nIndex, 
SfxItemSet& rItemSet,
 }
 }
 
+bool SwTableAutoFormat::NeedsExport()
+{
+const SwTableAutoFormat* rDefaultStyle
+= SwModule::get()->GetAutoFormatTable().FindAutoFormat(GetName());
+
+if (!rDefaultStyle || rDefaultStyle->GetParent() != GetParent())
+return true;
+
+for (size_t i = 0; i < ELEMENT_COUNT; i++)
+{
+if (!m_aBoxAutoFormat[i]->IsSameAs(*rDefaultStyle->GetField(i)))
+return true;
+}
+return false;
+}
+
 bool SwTableAutoFormat::FirstRowEndColumnIsRow()
 {
 if (*GetField(FIRST_ROW) != GetDefaultBoxFormat()
diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 4aa6b2f8c0c9..c543a20cdf35 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -4565,6 +4565,9 @@ sal_Bool SAL_CALL SwXTextTableStyle::isInUse()
 if (!m_bPhysical)
 return false;
 
+if (m_pTableAutoFormat->NeedsExport())
+return true;
+
 for (const SwTableFormat* pFormat : 
*m_pDocShell->GetDoc()->GetTableFrameFormats())
 {
 if(pFormat->IsUsed())
@@ -4934,7 +4937,7 @@ sal_Bool SAL_CALL SwXTextCellStyle::isInUse()
 if (!xStyle.is())
 return false;
 
-return true;
+return xStyle->isInUse();
 }
 
 OUString SAL_CALL SwXTextCellStyle::getParentStyle() { return m_sParentName; }
diff --git a/xmloff/source/table/XMLTableExport.cxx 
b/xmloff/source/table/XMLTableExport.cxx
index c22e68db1609..455319dfcdf7 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -608,7 +608,7 @@ void XMLTableExport::exportTabl

core.git: sw/inc sw/source

2026-02-16 Thread Noel Grandin (via logerrit)
 sw/inc/paratr.hxx  |1 -
 sw/source/core/para/paratr.cxx |7 ---
 2 files changed, 8 deletions(-)

New commits:
commit 9ab8f056c0a0ec0d3f7069bdf89823a4df1b60b9
Author: Noel Grandin 
AuthorDate: Fri Feb 13 12:55:30 2026 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 16 14:02:10 2026 +0100

tdf#170595 no need to have SwNumRuleItem::operator==

converting both sides of == to UIName and then comparing them,
is equivalent to just comparing the underlying strings,
so we can save ourselves some time here by skipping the creation
of temporary UIName objects

Change-Id: Ib04dae28e231665751bd3742d7b5c446a2ff6ccd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199450
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx
index d686f2fb86ef..125a0e079fbd 100644
--- a/sw/inc/paratr.hxx
+++ b/sw/inc/paratr.hxx
@@ -168,7 +168,6 @@ public:
 SwNumRuleItem(SwNumRuleItem const &) = default; // SfxPoolItem copy 
function dichotomy
 
 /// "pure virtual methods" of SfxPoolItem
-virtual booloperator==( const SfxPoolItem& ) const override;
 virtual SwNumRuleItem*  Clone( SfxItemPool *pPool = nullptr ) const 
override;
 // Marked as false since the SfxStringItem superclass supports hashing, but
 // this class has not been checked for safety under hashing yet.
diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx
index e19a0c02b17a..f3165b715693 100644
--- a/sw/source/core/para/paratr.cxx
+++ b/sw/source/core/para/paratr.cxx
@@ -201,13 +201,6 @@ SwNumRuleItem* SwNumRuleItem::Clone( SfxItemPool * ) const
 return new SwNumRuleItem( *this );
 }
 
-bool SwNumRuleItem::operator==( const SfxPoolItem& rAttr ) const
-{
-assert(SfxPoolItem::operator==(rAttr));
-
-return GetValue() == static_cast(rAttr).GetValue();
-}
-
 boolSwNumRuleItem::QueryValue( uno::Any& rVal, sal_uInt8 ) const
 {
 ProgName sRet = SwStyleNameMapper::GetProgName(GetValue(), 
SwGetPoolIdFromName::NumRule );


core.git: sw/inc sw/source

2026-02-12 Thread Noel Grandin (via logerrit)
 sw/inc/fmtcol.hxx   |   32 ++--
 sw/inc/shellio.hxx  |1 
 sw/source/core/doc/fmtcol.cxx   |   31 ++-
 sw/source/core/inc/swfntcch.hxx |   47 
 sw/source/core/layout/ftnfrm.cxx|4 +--
 sw/source/core/layout/pagechg.cxx   |4 +--
 sw/source/core/text/atrhndl.hxx |2 -
 sw/source/core/text/atrstck.cxx |2 -
 sw/source/core/text/frmcrsr.cxx |4 +--
 sw/source/core/text/frmpaint.cxx|4 +--
 sw/source/core/text/porrst.cxx  |4 +--
 sw/source/core/text/redlnitr.cxx|8 +++---
 sw/source/core/text/txtinit.cxx |2 -
 sw/source/core/txtnode/swfntcch.cxx |   35 ++
 sw/source/filter/html/swhtml.cxx|   13 -
 sw/source/filter/ww8/ww8par.cxx |   13 -
 16 files changed, 63 insertions(+), 143 deletions(-)

New commits:
commit ba462fddf5acb4db510aecb014614ff89aa433f0
Author: Noel Grandin 
AuthorDate: Thu Oct 9 16:27:12 2025 +0200
Commit: Noel Grandin 
CommitDate: Thu Feb 12 12:09:56 2026 +0100

remove SwFontObj cache

makes approx no difference to memory consumption when loading
a 100+ page document, and shaves 5% off the load time.

Change-Id: I72a19338ea52e806cc763e5cd9d2bb1c2dfd7033
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192107
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx
index 4a9e5ea739fa..4e09f0aefb8b 100644
--- a/sw/inc/fmtcol.hxx
+++ b/sw/inc/fmtcol.hxx
@@ -31,6 +31,8 @@
 #include 
 
 class SwAttrPool;
+class SwViewShell;
+class SwFontObj;
 namespace sw{ class DocumentStylePoolManager; }
 
 /// SwFormatColl is just an SwFormat subclass that defaults to 
m_bAutoFormat=false, expressing that
@@ -63,23 +65,17 @@ class SW_DLLPUBLIC SwTextFormatColl
 
 bool mbAssignedToOutlineStyle;
 
-bool m_bInSwFntCache;
-
 SwTextFormatColl *mpNextTextFormatColl;
 
 SwCharFormat* mpLinkedCharFormat = nullptr;
 
+/** cached/temporary font layout information */
+mutable std::unique_ptr mxFontObj;
+
 protected:
 SwTextFormatColl( SwAttrPool& rPool, const UIName &rFormatCollName,
 SwTextFormatColl* pDerFrom = nullptr,
-sal_uInt16 nFormatWh = RES_TXTFMTCOLL )
-: SwFormatColl(rPool, rFormatCollName, aTextFormatCollSetRange, 
pDerFrom, nFormatWh)
-, mbStayAssignedToListLevelOfOutlineStyle(false)
-, mbAssignedToOutlineStyle(false)
-, m_bInSwFntCache(false)
-{
-mpNextTextFormatColl = this;
-}
+sal_uInt16 nFormatWh = RES_TXTFMTCOLL );
 
 /// To get UL- / LR- / FontHeight-changes.
 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
@@ -136,19 +132,9 @@ public:
 if(HasWriterListeners() && !IsModifyLocked())
 CallSwClientNotify(sw::LegacyModifyHint(&rDrop, &rDrop));
 };
-bool IsInSwFntCache() const { return m_bInSwFntCache; };
-void SetInSwFntCache() { m_bInSwFntCache = true; };
-virtual void InvalidateInSwFntCache(sal_uInt16 nWhich) override
-{
-if(isCHRATR(nWhich))
-{
-m_bInSwFntCache = false;
-}
-};
-virtual void InvalidateInSwFntCache() override
-{
-m_bInSwFntCache = false;
-}
+virtual void InvalidateInSwFntCache(sal_uInt16 nWhich) override;
+virtual void InvalidateInSwFntCache() override;
+const SwFontObj & GetFontObj(SwViewShell *pSh) const;
 };
 
 class SwGrfFormatColl final : public SwFormatColl
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index f7c7cb3b292b..064a0d0f5741 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -206,7 +206,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool 
TestImportDOCX(SvStream &rStream);
 extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportRTF(SvStream &rStream);
 extern "C" SAL_DLLPUBLIC_EXPORT bool TestPDFExportRTF(SvStream &rStream);
 extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportHTML(SvStream &rStream);
-SAL_DLLPUBLIC_EXPORT void FlushFontCache();
 
 class SW_DLLPUBLIC Reader
 {
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index 32d76a11cae3..7463f6e3dc34 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -108,10 +108,19 @@ namespace TextFormatCollFunc
 }
 } // end of namespace TextFormatCollFunc
 
+SwTextFormatColl::SwTextFormatColl( SwAttrPool& rPool, const UIName 
&rFormatCollName,
+SwTextFormatColl* pDerFrom,
+sal_uInt16 nFormatWh )
+: SwFormatColl(rPool, rFormatCollName, aTextFormatCollSetRange, pDerFrom, 
nFormatWh)
+, mbStayAssignedToListLevelOfOutlineStyle(false)
+, mbAssignedToOutlineStyle(false)
+{
+mpNextTextFormatColl = this;
+}
+
 SwTextFormatColl::~SwTextFormatColl()
 {
-if(m_bInSwFntCache)
-pSwFontCache->Delete( this );
+mxFontObj.reset();
 
 if (GetDoc().IsInDtor(

core.git: sw/inc sw/qa sw/source

2026-02-11 Thread Justin Luth (via logerrit)
 sw/inc/formatcontentcontrol.hxx |4 -
 sw/qa/extras/ooxmlexport/data/tdf169101_datePicker.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport25.cxx  |   13 +
 sw/source/core/crsr/datecontentcontrolbutton.cxx|6 +-
 sw/source/core/txtnode/attrcontentcontrol.cxx   |   41 
 sw/source/filter/ww8/docxattributeoutput.cxx|   15 -
 sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx|3 -
 7 files changed, 54 insertions(+), 28 deletions(-)

New commits:
commit 9a16f47ccb3ee9ff509a56bba026568f29800120
Author: Justin Luth 
AuthorDate: Tue Feb 10 20:38:37 2026 -0500
Commit: Justin Luth 
CommitDate: Thu Feb 12 07:32:53 2026 +0100

tdf#169101 docx export: ensure valid ISO8601 Sdt fullDate

If the fullDate value is not a valid ISO8601 format string
then MS Word complains that the file is invalid.

To fix this, I needed a mechanism similar to
  std::pair DateFieldmark::GetCurrentDate()
that allows GetCurrentDate to know whether it is a valid date, and
  DateFieldmark::GetDateInStandardDateFormat
to get the date in a standard format.

In addition, I fixed a few other overlooked pieces.

make CppunitTest_sw_ooxmlexport25 \
CPPUNIT_TEST_NAME=testTdf169101_datePicker

This unit test forced me to create the fall-back mechanism:
make CppunitTest_sw_ooxmlexport13 \
CPPUNIT_TEST_NAME=testInvalidDateFormField

Change-Id: If6ea8022f82d70a10c9af9cede285855122ddf60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199118
Reviewed-by: Justin Luth 
Tested-by: Jenkins

diff --git a/sw/inc/formatcontentcontrol.hxx b/sw/inc/formatcontentcontrol.hxx
index 91efffd11e28..a53d6b3b7329 100644
--- a/sw/inc/formatcontentcontrol.hxx
+++ b/sw/inc/formatcontentcontrol.hxx
@@ -292,10 +292,10 @@ public:
 void SetCurrentDateValue(double fCurrentDate);
 
 /// Parses m_aCurrentDate and returns it.
-double GetCurrentDateValue() const;
+std::optional GetCurrentDateValue() const;
 
 /// Formats m_oSelectedDate, taking m_aDateFormat and m_aDateLanguage into 
account.
-OUString GetDateString() const;
+OUString GetDateString(bool bAsISO8601 = false) const;
 
 void SetPlainText(bool bPlainText) { m_bPlainText = bPlainText; }
 
diff --git a/sw/qa/extras/ooxmlexport/data/tdf169101_datePicker.docx 
b/sw/qa/extras/ooxmlexport/data/tdf169101_datePicker.docx
new file mode 100644
index ..0be76293c531
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf169101_datePicker.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx
index 0a4d2820d01e..c160cb326996 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx
@@ -212,6 +212,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf168988_grabbagDatePicker)
u" 2012./2013.");
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf169101_datePicker)
+{
+createSwDoc("tdf169101_datePicker.docx");
+
+save(TestFilter::DOCX);
+xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr);
+assertXPath(pXmlDoc, "//w:sdt", 1); // only one sdt
+assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:date", 1); // it is a date content 
control
+// there is no valid date, so fullDate must not be provided (or MS Word 
says 'corrupt file')
+assertXPathNoAttribute(pXmlDoc, "//w:sdt/w:sdtPr/w:date", "fullDate");
+assertXPathContent(pXmlDoc, "//w:sdt/w:sdtContent/w:r/w:t", u"Week #");
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testTdf170389_manyTabstops)
 {
 createSwDoc("tdf170389_manyTabstops.odt");
diff --git a/sw/source/core/crsr/datecontentcontrolbutton.cxx 
b/sw/source/core/crsr/datecontentcontrolbutton.cxx
index 06f5f92cd691..26bc21bc99a0 100644
--- a/sw/source/core/crsr/datecontentcontrolbutton.cxx
+++ b/sw/source/core/crsr/datecontentcontrolbutton.cxx
@@ -50,10 +50,10 @@ void SwDateContentControlButton::LaunchPopup()
 if (m_pContentControl)
 {
 const Date& rNullDate = m_pNumberFormatter->GetNullDate();
-double fCurrentDate = m_pContentControl->GetCurrentDateValue();
-if (fCurrentDate != 0)
+std::optional ofCurrentDate = 
m_pContentControl->GetCurrentDateValue();
+if (ofCurrentDate.has_value())
 {
-m_xCalendar->set_date(rNullDate + sal_Int32(fCurrentDate));
+m_xCalendar->set_date(rNullDate + sal_Int32(*ofCurrentDate));
 }
 }
 
diff --git a/sw/source/core/txtnode/attrcontentcontrol.cxx 
b/sw/source/core/txtnode/attrcontentcontrol.cxx
index c99b25b8b4f8..4f9d6407f5f2 100644
--- a/sw/source/core/txtnode/attrcontentcontrol.cxx
+++ b/sw/source/core/txtnode/attrcontentcontrol.cxx
@@ -369,41 +369,41 @@ void SwContentControl::ClearListItems()
 GetTextAttr()->Invalidate();
 }
 
-OUString SwContentControl::GetDateString() cons

core.git: sw/inc sw/qa sw/source

2026-02-10 Thread Andreas Heinisch (via logerrit)
 sw/inc/fldbas.hxx |3 +-
 sw/qa/uibase/fldui/fldui.cxx  |   55 --
 sw/source/uibase/fldui/fldmgr.cxx |3 +-
 3 files changed, 34 insertions(+), 27 deletions(-)

New commits:
commit 901f13195347b334319b87a7b7d4e9257f1c492c
Author: Andreas Heinisch 
AuthorDate: Tue Feb 10 10:15:16 2026 +0100
Commit: Andreas Heinisch 
CommitDate: Tue Feb 10 16:42:36 2026 +0100

tdf#170392 - Align file name format constants FilenameDisplayFormat.idl

Change-Id: If7679a2de049caf03865eef62ed5c4e8aa3b3aab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199028
Reviewed-by: Andreas Heinisch 
Tested-by: Jenkins

diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 1d29362b3caa..5756dccae44b 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -150,10 +150,11 @@ enum class SwFieldTypesEnum : sal_uInt16 {
 };
 
 // tdf#170392 - this should be aligned with FMT_FF_ARY in 
sw/source/uibase/fldui/fldmgr.cxx
+// including com::sun::star::text::FilenameDisplayFormat
 enum class SwFileNameFormat {
 // most of the constants are a regular enum
-Path,
 PathName,
+Path,
 NameNoExt,
 Name,
 UIName,
diff --git a/sw/qa/uibase/fldui/fldui.cxx b/sw/qa/uibase/fldui/fldui.cxx
index ea1168e89a36..7cad0330dccf 100644
--- a/sw/qa/uibase/fldui/fldui.cxx
+++ b/sw/qa/uibase/fldui/fldui.cxx
@@ -164,32 +164,37 @@ CPPUNIT_TEST_FIXTURE(Test, 
testTdf68364InsertConditionalFieldWithTwoDots)
 CPPUNIT_ASSERT_EQUAL(u"19.12.2023"_ustr, 
pWrtShell->GetCurField()->ExpandField(true, nullptr));
 }
 
-CPPUNIT_TEST_FIXTURE(Test, testTdf170392FilenameFormatConstants)
+CPPUNIT_TEST_FIXTURE(Test, testTdf170392FilenameFormatConstantsIdl)
 {
-// Create an empty document
-createSwDoc();
-SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
-
-// Insert a filename field containing SwFileNameFormat::Path
-SwFieldMgr aFieldMgr(pWrtShell);
-SwInsertField_Data aFieldData(SwFieldTypesEnum::Filename, 0, u""_ustr, 
u""_ustr, 3);
-CPPUNIT_ASSERT(aFieldMgr.InsertField(aFieldData));
-
-// First reload in order to get a value for the filename field
-saveAndReload(TestFilter::ODT);
-pWrtShell = getSwDocShell()->GetWrtShell();
-pWrtShell->SttEndDoc(true);
-const auto aExpandedField = pWrtShell->GetCurField()->ExpandField(true, 
nullptr);
-
-// Second reload in order to check consistency for the filename field
-saveAndReload(TestFilter::ODT);
-pWrtShell = getSwDocShell()->GetWrtShell();
-pWrtShell->SttEndDoc(true);
-
-// Without the accompanying fix in place, this test would have failed with:
-// - Expected: filename field is the same
-// - Actual  : filename field differ since the filename format constants 
differ
-CPPUNIT_ASSERT_EQUAL(aExpandedField, 
pWrtShell->GetCurField()->ExpandField(true, nullptr));
+SwFileNameFormat aFormats[] = { SwFileNameFormat::Name, 
SwFileNameFormat::Path };
+for (SwFileNameFormat eFormat : aFormats)
+{
+// Create an empty document
+createSwDoc();
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+
+// Insert a filename field containing a specific format
+SwFieldMgr aFieldMgr(pWrtShell);
+SwInsertField_Data aFieldData(SwFieldTypesEnum::Filename, 0, u""_ustr, 
u""_ustr,
+  static_cast(eFormat));
+CPPUNIT_ASSERT(aFieldMgr.InsertField(aFieldData));
+
+// First reload in order to get a value for the filename field
+saveAndReload(TestFilter::ODT);
+pWrtShell = getSwDocShell()->GetWrtShell();
+pWrtShell->SttEndDoc(true);
+const auto aExpandedField = 
pWrtShell->GetCurField()->ExpandField(true, nullptr);
+
+// Second reload in order to check consistency for the filename field
+saveAndReload(TestFilter::ODT);
+pWrtShell = getSwDocShell()->GetWrtShell();
+pWrtShell->SttEndDoc(true);
+
+// Without the accompanying fix in place, this test would have failed 
with:
+// - Expected: filename field is the same
+// - Actual  : filename field differ since the filename format 
constants differ
+CPPUNIT_ASSERT_EQUAL(aExpandedField, 
pWrtShell->GetCurField()->ExpandField(true, nullptr));
+}
 }
 
 CPPUNIT_TEST_FIXTURE(Test, testInsertRefmarkSelection)
diff --git a/sw/source/uibase/fldui/fldmgr.cxx 
b/sw/source/uibase/fldui/fldmgr.cxx
index 802d7f37f219..c4601be97783 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -189,10 +189,11 @@ const TranslateId FMT_NUM_ARY[] =
 };
 
 // tdf#170392 - this should be aligned with enum SwFileNameFormat in 
sw/inc/fldbas.hxx
+// including com::sun::star::text::FilenameDisplayFormat
 const TranslateId FMT_FF_ARY[] =
 {
-FMT_FF_PATH,
 FMT_FF_PATHNAME,
+FMT_FF_PATH,
 FMT_FF_NAME_NOEXT,
 FMT_FF_NAME,
 FMT_FF_UI_NAME,


core.git: sw/inc sw/qa sw/source

2026-02-08 Thread Andreas Heinisch (via logerrit)
 sw/inc/swtypes.hxx|1 +
 sw/qa/uibase/fldui/fldui.cxx  |   26 ++
 sw/source/core/fields/docufld.cxx |   10 +-
 sw/source/filter/ww8/ww8atr.cxx   |2 +-
 sw/source/ui/fldui/fldfunc.cxx|9 ++---
 5 files changed, 39 insertions(+), 9 deletions(-)

New commits:
commit a338ec1d3b2293ff34b159bb2a2da67e249d5655
Author: Andreas Heinisch 
AuthorDate: Fri Feb 6 08:36:36 2026 +0100
Commit: Andreas Heinisch 
CommitDate: Sun Feb 8 19:29:20 2026 +0100

tdf#56126 - Changed separator for conditional fields

In order to support the previosuly used vertical separator.

Change-Id: I62d05a1ce9e95d34879ac2970c57fd0e4f78f987
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198813
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index a6e54c491e9c..a111cec61540 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -129,6 +129,7 @@ const char cSequenceMarkSeparator = '!';
 sal_Unicode const toxMarkSeparator = '\u0019';
 
 #define DB_DELIM u'\x00ff'// Database <-> table separator.
+#define CONDITIONAL_FIELD_SEPARATOR u'
 
 enum class SetAttrMode
 {
diff --git a/sw/qa/uibase/fldui/fldui.cxx b/sw/qa/uibase/fldui/fldui.cxx
index 7290dbff605a..ea1168e89a36 100644
--- a/sw/qa/uibase/fldui/fldui.cxx
+++ b/sw/qa/uibase/fldui/fldui.cxx
@@ -119,6 +119,32 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertRefmark)
 CPPUNIT_ASSERT_EQUAL(u"aaabbbccc"_ustr, pTextNode->GetText());
 }
 
+CPPUNIT_TEST_FIXTURE(Test, 
testTdf56126InsertConditionalFieldWithVerticalSeparator)
+{
+// Create an empty document
+createSwDoc();
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+
+// Insert a conditional field containing exactly two dots for its condition
+SwFieldMgr aFieldMgr(pWrtShell);
+SwInsertField_Data aFieldData(SwFieldTypesEnum::ConditionalText, 0, 
u"true"_ustr,
+  u"foo|bar"_ustr, 0);
+CPPUNIT_ASSERT(aFieldMgr.InsertField(aFieldData));
+pWrtShell->SttEndDoc(true);
+
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: foo|bar
+// - Actual  : foo
+// i.e. the conditional text after the vertical separator disappeared
+CPPUNIT_ASSERT_EQUAL(u"foo|bar"_ustr, 
pWrtShell->GetCurField()->ExpandField(true, nullptr));
+
+// Reload document in order to check if the new separator will be saved in 
ODT
+saveAndReload(TestFilter::ODT);
+pWrtShell = getSwDocShell()->GetWrtShell();
+pWrtShell->SttEndDoc(true);
+CPPUNIT_ASSERT_EQUAL(u"foo|bar"_ustr, 
pWrtShell->GetCurField()->ExpandField(true, nullptr));
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testTdf68364InsertConditionalFieldWithTwoDots)
 {
 // Create an empty document
diff --git a/sw/source/core/fields/docufld.cxx 
b/sw/source/core/fields/docufld.cxx
index 7934cbf2795f..f3ee1a7acff4 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1352,14 +1352,14 @@ SwHiddenTextField::SwHiddenTextField( 
SwHiddenTextFieldType* pFieldType,
 if(m_nSubType == SwFieldTypesEnum::ConditionalText)
 {
 sal_Int32 nPos = 0;
-m_aTRUEText = rStr.getToken(0, '|', nPos);
+m_aTRUEText = rStr.getToken(0, CONDITIONAL_FIELD_SEPARATOR, nPos);
 
 if(nPos != -1)
 {
-m_aFALSEText = rStr.getToken(0, '|', nPos);
+m_aFALSEText = rStr.getToken(0, CONDITIONAL_FIELD_SEPARATOR, nPos);
 if(nPos != -1)
 {
-m_aContent = rStr.getToken(0, '|', nPos);
+m_aContent = rStr.getToken(0, CONDITIONAL_FIELD_SEPARATOR, 
nPos);
 m_bValid = true;
 }
 }
@@ -1493,7 +1493,7 @@ void SwHiddenTextField::SetPar2(const OUString& rStr)
 {
 if (m_nSubType == SwFieldTypesEnum::ConditionalText)
 {
-sal_Int32 nPos = rStr.indexOf('|');
+sal_Int32 nPos = rStr.indexOf(CONDITIONAL_FIELD_SEPARATOR);
 if (nPos == -1)
 m_aTRUEText = rStr;
 else
@@ -1513,7 +1513,7 @@ OUString SwHiddenTextField::GetPar2() const
 {
 return m_aTRUEText;
 }
-return m_aTRUEText + "|" + m_aFALSEText;
+return OUString::Concat(m_aTRUEText) + 
OUStringChar(CONDITIONAL_FIELD_SEPARATOR) + m_aFALSEText;
 }
 
 SwFieldTypesEnum SwHiddenTextField::GetSubType() const
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index e2b1749abe9a..20bd53cb94fd 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3501,7 +3501,7 @@ void AttributeOutputBase::TextField( const SwFormatField& 
rField )
 {
 OUString aCond = pField->GetPar1();
 OUString aTrueFalse = pField->GetPar2();
-sal_Int32 nPos = aTrueFalse.indexOf('|');
+sal_Int32 nPos = 
aTrueFalse.indexOf(CONDITIONAL_FIELD_SEPARATOR);

core.git: sw/inc sw/source

2026-02-08 Thread Noel Grandin (via logerrit)
 sw/inc/TextCursorHelper.hxx|   10 --
 sw/inc/unotbl.hxx  |8 
 sw/inc/unotextcursor.hxx   |8 +++-
 sw/source/core/unocore/unotext.cxx |2 +-
 sw/source/uibase/inc/unotxvw.hxx   |6 +++---
 5 files changed, 19 insertions(+), 15 deletions(-)

New commits:
commit 765bdfcf1b5fe3ed5e800ce1594315c3192d8e14
Author: Noel Grandin 
AuthorDate: Fri Feb 6 13:43:44 2026 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 8 11:51:27 2026 +0100

simplify Sw*Cursor inheritance structure

OTextCursorHelper can be a base class, no need for it to a mixin

Change-Id: I8a0ade963bddab4f805ffabb5e5bbc4f3a56c620
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198832
Reviewed-by: Noel Grandin 
Tested-by: Jenkins

diff --git a/sw/inc/TextCursorHelper.hxx b/sw/inc/TextCursorHelper.hxx
index 41a91ed47626..6982d2e76272 100644
--- a/sw/inc/TextCursorHelper.hxx
+++ b/sw/inc/TextCursorHelper.hxx
@@ -20,12 +20,18 @@
 
 #include "swdllapi.h"
 
-#include 
+#include 
+#include 
 
 class SwDoc;
 class SwPaM;
 
-class SW_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") OTextCursorHelper
+typedef cppu::WeakImplHelper OTextCursorHelper_Base;
+
+/**
+ base class for SwXTextViewCursor and SwXTextTableCursor and SwXTextCursor
+ */
+class SW_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") OTextCursorHelper : 
public OTextCursorHelper_Base
 {
 public:
 
diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index caae1436db59..94ecd2f80be2 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -182,14 +182,14 @@ public:
 void Notify(const SfxHint&) override;
 };
 
-typedef cppu::WeakImplHelper<
+
+typedef cppu::ImplInheritanceHelper<
+OTextCursorHelper,
 css::text::XTextTableCursor,
-css::lang::XServiceInfo,
-css::beans::XPropertySet> SwXTextTableCursor_Base;
+css::lang::XServiceInfo> SwXTextTableCursor_Base;
 class SW_DLLPUBLIC SwXTextTableCursor final
 : public SwXTextTableCursor_Base
 , public SvtListener
-, public OTextCursorHelper
 {
 SwFrameFormat* m_pFrameFormat;
 const SfxItemPropertySet* m_pPropSet;
diff --git a/sw/inc/unotextcursor.hxx b/sw/inc/unotextcursor.hxx
index 4d54d3072c68..ff46303c0b7b 100644
--- a/sw/inc/unotextcursor.hxx
+++ b/sw/inc/unotextcursor.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_SW_INC_UNOTEXTCURSOR_HXX
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -48,9 +47,9 @@ struct SwPosition;
 class SwXTextRange;
 class SfxItemPropertySet;
 
-typedef ::cppu::WeakImplHelper
-<   css::lang::XServiceInfo
-,   css::beans::XPropertySet
+typedef ::cppu::ImplInheritanceHelper
+<   OTextCursorHelper
+,   css::lang::XServiceInfo
 ,   css::beans::XPropertyState
 ,   css::beans::XMultiPropertySet
 ,   css::beans::XMultiPropertyStates
@@ -67,7 +66,6 @@ typedef ::cppu::WeakImplHelper
 
 class SW_DLLPUBLIC SwXTextCursor final
 : public SwXTextCursor_Base
-, public OTextCursorHelper
 {
 
 private:
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index e861d0396a94..e53e322aac70 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -527,7 +527,7 @@ SwXText::insertTextContent(
 pRange->DeleteAndInsert(u"", 
::sw::DeleteAndInsertMode::ForceReplace
 | (bForceExpandHints ? 
::sw::DeleteAndInsertMode::ForceExpandHints : 
::sw::DeleteAndInsertMode::Default));
 }
-else if (SwXTextCursor *const pCursor = 
dynamic_cast(dynamic_cast(xRange.get(
+else if (SwXTextCursor *const pCursor = 
dynamic_cast(xRange.get()))
 {
 pCursor->DeleteAndInsert(u"", 
::sw::DeleteAndInsertMode::ForceReplace
 | (bForceExpandHints ? 
::sw::DeleteAndInsertMode::ForceExpandHints : 
::sw::DeleteAndInsertMode::Default));
diff --git a/sw/source/uibase/inc/unotxvw.hxx b/sw/source/uibase/inc/unotxvw.hxx
index e4f8b1a1483e..db2a0bc05a63 100644
--- a/sw/source/uibase/inc/unotxvw.hxx
+++ b/sw/source/uibase/inc/unotxvw.hxx
@@ -149,18 +149,18 @@ public:
 SfxObjectShellLock  BuildTmpSelectionDoc();
 };
 
-typedef cppu::WeakImplHelper<
+typedef cppu::ImplInheritanceHelper<
+OTextCursorHelper,
 css::text::XTextViewCursor,
 css::lang::XServiceInfo,
 css::text::XPageCursor,
 css::view::XScreenCursor,
 css::view::XViewCursor,
 css::view::XLineCursor,
-css::beans::XPropertySet,
 css::beans::XPropertyState
 > SwXTextViewCursor_Base;
 
-class SwXTextViewCursor final: public SwXTextViewCursor_Base, public 
OTextCursorHelper
+class SwXTextViewCursor final: public SwXTextViewCursor_Base
 {
 SwView* m_pView;
 const SfxItemPropertySet*   m_pPropSet;


core.git: sw/inc sw/source

2026-02-05 Thread Noel Grandin (via logerrit)
 sw/inc/unoxstyle.hxx   |7 ++-
 sw/source/core/unocore/unostyle.cxx|   18 +++---
 sw/source/writerfilter/dmapper/StyleSheetTable.cxx |2 +-
 3 files changed, 22 insertions(+), 5 deletions(-)

New commits:
commit 572508a390f3c0ace9f6502db7becb997be19e3e
Author: Noel Grandin 
AuthorDate: Tue Feb 3 16:23:32 2026 +0200
Commit: Noel Grandin 
CommitDate: Thu Feb 5 09:28:05 2026 +0100

tdf#170595 elide some exception throw overhead

which we are just going to ignore

Change-Id: I4921a1871437f3d51733e790e631290aa40d1389
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198600
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/unoxstyle.hxx b/sw/inc/unoxstyle.hxx
index 896fd218c3bf..d11a761974a1 100644
--- a/sw/inc/unoxstyle.hxx
+++ b/sw/inc/unoxstyle.hxx
@@ -82,7 +82,8 @@ protected:
 void SetPropertyValue(const SfxItemPropertyMapEntry&, const 
SfxItemPropertySet&,
   const css::uno::Any&, SwStyleBase_Impl&);
 void SetPropertyValues_Impl(const css::uno::Sequence& 
aPropertyNames,
-const css::uno::Sequence& 
aValues);
+const css::uno::Sequence& 
aValues,
+bool bIgnoreUnknown);
 SfxStyleSheetBase* GetStyleSheetBase();
 void PrepareStyleBase(SwStyleBase_Impl& rBase);
 template 
@@ -219,6 +220,10 @@ public:
 css::awt::FontSlant& reCharStylePosture, css::awt::FontSlant& 
reCharStylePostureComplex,
 sal_Int16& rnCharStyleCaseMap, sal_Int16& rnCharStyleRelief, bool& 
rbCharStyleContoured,
 bool& rbCharStyleShadowed, sal_Int16& rnCharStyleStrikeThrough, bool& 
rbCharStyleHidden);
+// Set without throwing exceptions for unknown props, which is faster than 
throwing and then
+// ignoring.
+SW_DLLPUBLIC void setPropertyValueIgnoreUnknown(const OUString& 
aPropertyName,
+const css::uno::Any& 
aValue);
 };
 
 typedef cppu::ImplInheritanceHelper 
SwXFrameStyle_Base;
diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 969a56cfca03..e6a0028295ea 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -2046,7 +2046,7 @@ void SwXStyle::SetStyleProperty(const 
SfxItemPropertyMapEntry& rEntry, const Sfx
 }
 }
 
-void SwXStyle::SetPropertyValues_Impl(const uno::Sequence& 
rPropertyNames, const uno::Sequence& rValues)
+void SwXStyle::SetPropertyValues_Impl(const uno::Sequence& 
rPropertyNames, const uno::Sequence& rValues, bool bIgnoreUnknown)
 {
 if(!m_pDoc)
 throw uno::RuntimeException();
@@ -2074,7 +2074,11 @@ void SwXStyle::SetPropertyValues_Impl(const 
uno::Sequence& rPropertyNa
 {
 const SfxItemPropertyMapEntry* pEntry = rMap.getByName(pNames[nProp]);
 if(!pEntry || (!m_bIsConditional && pNames[nProp] == 
UNO_NAME_PARA_STYLE_CONDITIONS))
+{
+if (bIgnoreUnknown)
+continue;
 throw beans::UnknownPropertyException("Unknown property: " + 
pNames[nProp], getXWeak());
+}
 if(pEntry->nFlags & beans::PropertyAttribute::READONLY)
 throw beans::PropertyVetoException ("Property is read-only: " + 
pNames[nProp], getXWeak());
 if(aBaseImpl.getNewBase().is())
@@ -2093,7 +2097,7 @@ void SwXStyle::setPropertyValues(const 
uno::Sequence& rPropertyNames,
 // workaround for bad designed API
 try
 {
-SetPropertyValues_Impl( rPropertyNames, rValues );
+SetPropertyValues_Impl( rPropertyNames, rValues, 
/*bIgnoreUnknown*/false );
 }
 catch (const beans::UnknownPropertyException &rException)
 {
@@ -2565,7 +2569,15 @@ void SwXStyle::setPropertyValue(const OUString& 
rPropertyName, const uno::Any& r
 SolarMutexGuard aGuard;
 const uno::Sequence aProperties(&rPropertyName, 1);
 const uno::Sequence aValues(&rValue, 1);
-SetPropertyValues_Impl(aProperties, aValues);
+SetPropertyValues_Impl(aProperties, aValues, /*bIgnoreUnknown*/false);
+}
+
+void SwXStyle::setPropertyValueIgnoreUnknown(const OUString& rPropertyName, 
const uno::Any& rValue)
+{
+SolarMutexGuard aGuard;
+const uno::Sequence aProperties(&rPropertyName, 1);
+const uno::Sequence aValues(&rValue, 1);
+SetPropertyValues_Impl(aProperties, aValues, /*bIgnoreUnknown*/true);
 }
 
 beans::PropertyState SwXStyle::getPropertyState(const OUString& rPropertyName)
diff --git a/sw/source/writerfilter/dmapper/StyleSheetTable.cxx 
b/sw/source/writerfilter/dmapper/StyleSheetTable.cxx
index 10892b7b3f47..1cfa71e0043b 100644
--- a/sw/source/writerfilter/dmapper/StyleSheetTable.cxx
+++ b/sw/source/writerfilter/dmapper/StyleSheetTable.cxx
@@ -2204,7 +2204,7 @@ OUString StyleSheetTable::getOrCreateCharStyle( const 
PropertyValueVector_t& rCh
 {
 try
 {
-   

core.git: sw/inc sw/qa sw/source

2026-02-04 Thread Jim Raykowski (via logerrit)
 sw/inc/fesh.hxx  |2 
 sw/inc/strings.hrc   |2 
 sw/inc/swundo.hxx|1 
 sw/qa/extras/uiwriter/data/tdf169651.odt |binary
 sw/qa/extras/uiwriter/uiwriter11.cxx |   25 +++
 sw/source/core/draw/dcontact.cxx |1 
 sw/source/core/frmedt/fefly1.cxx |   67 +--
 sw/source/core/undo/undobj.cxx   |3 +
 8 files changed, 96 insertions(+), 5 deletions(-)

New commits:
commit ef597d2e1e0fa24c2bdcdde30faa416cef7bf9c1
Author: Jim Raykowski 
AuthorDate: Sat Dec 13 16:10:52 2025 -0900
Commit: Jim Raykowski 
CommitDate: Wed Feb 4 09:04:28 2026 +0100

tdf#169651 Avoid crash in SwLayAction::FormatContent

Here is effort to avoid a crash that occurs when a fly frame is
unfloated that has a drawing object or fly frame anchored to its frame.

To avoid the crash, this approach uses FN_TOOL_ANCHOR_PARAGRAPH to
change the anchor of frame anchored drawing and fly frame objects to be
paragraph anchored in the fly frame content. MoveObjToVisibleLayer is
added in SwDrawContact::SwClientNotify
sw::DrawFrameFormatHintId::POST_RESTORE_FLY_ANCHOR case handling to make
undo restored fly anchored objects visible. SwFEShell::SelectFlyFrame is
made SW_DLLPUBLIC to make the clang linker not complain about 'linker
cannot find symbol(s) for architecture x86_64' when used in the included
unit test.

Change-Id: Ie6791cb45e7dce31132d3b6a8dac79d63bc27eb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195650
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 085adf8dee52..3871507b9120 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -268,7 +268,7 @@ public:
 SW_DLLPUBLIC bool Copy( SwFEShell&, const Point& rSttPt, const Point& 
rInsPt,
bool bIsMove = false, bool bSelectInsert = true );
 
-void SelectFlyFrame( SwFlyFrame& rFrame );
+SW_DLLPUBLIC void SelectFlyFrame(SwFlyFrame& rFrame);
 
 SW_DLLPUBLIC void UnfloatFlyFrame();
 
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 0b70e22c6077..99e23aab3110 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -1577,6 +1577,8 @@
 
 #define STR_UNDO_SORT_CHAPTERS NC_("STR_UNDO_SORT_CHAPTERS", "Sort chapters")
 
+#define STR_UNDO_UNFLOAT_FRAME_CONTENT NC_("STR_UNDO_UNFLOAT_FRAME_CONTENT", 
"Unfloat frame content")
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx
index 76af157fd129..56bbd771fb25 100644
--- a/sw/inc/swundo.hxx
+++ b/sw/inc/swundo.hxx
@@ -186,6 +186,7 @@ enum class SwUndoId
 REINSTATE_REDLINE = 154,
 COPY_HEADER_FOOTER = 155,
 SORT_CHAPTERS = 156,
+UNFLOAT_FRAME_CONTENT = 157
 };
 
 OUString GetUndoComment(SwUndoId eId);
diff --git a/sw/qa/extras/uiwriter/data/tdf169651.odt 
b/sw/qa/extras/uiwriter/data/tdf169651.odt
new file mode 100644
index ..dccae694025f
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf169651.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter11.cxx 
b/sw/qa/extras/uiwriter/uiwriter11.cxx
index 9da790d04fde..92548813bd25 100644
--- a/sw/qa/extras/uiwriter/uiwriter11.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter11.cxx
@@ -30,6 +30,10 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 
 namespace
 {
@@ -621,6 +625,27 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest11, 
testTdf165206DirSwitchPreservesAlignment)
  getProperty(getRun(getParagraph(1), 1), 
u"ParaAdjust"_ustr));
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest11, testTdf169651)
+{
+// Given a document with a fly frame that has anchored FLY_AT_FLY, a shape 
object and a
+// fly frame that itself has a shape object anchored FLY_AT_FLY:
+createSwDoc("tdf169651.odt");
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+CPPUNIT_ASSERT(pWrtShell);
+
+const SwSortedObjs* pAnchoredObjs
+= 
pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower()->GetDrawObjs();
+CPPUNIT_ASSERT(pAnchoredObjs);
+SwAnchoredObject* pAnchoredObj = (*pAnchoredObjs)[0];
+SwFlyFrame* pFlyFrame = pAnchoredObj->DynCastFlyFrame();
+CPPUNIT_ASSERT(pFlyFrame);
+
+pWrtShell->SelectFlyFrame(*pFlyFrame);
+
+// Without the patch this test would crash during the following
+pWrtShell->UnfloatFlyFrame();
+}
+
 } // end of anonymous namespace
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 2421f2a3622c..129e6e1b12b2 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1573,6 +1573,7 @@ void SwDrawContact::SwClientNotify(const SwModify& rMod, 
const SfxHint& rHint)
  break;
 case sw::DrawFrameFormatHintId::POST_RESTORE_FLY_ANCHOR:
 GetAnchoredObj(GetMaster())->MakeObjPos();
+

core.git: sw/inc sw/qa sw/source

2026-01-31 Thread Mike Kaganski (via logerrit)
 sw/inc/AnnotationWin.hxx   |1 
 sw/inc/PostItMgr.hxx   |4 
 sw/qa/extras/uiwriter/data/tdf163194-two-comments.fodt |   41 +
 sw/qa/extras/uiwriter/uiwriter11.cxx   |  136 +
 sw/qa/extras/uiwriter/uiwriter8.cxx|2 
 sw/source/core/view/vprint.cxx |   10 +
 sw/source/uibase/docvw/AnnotationWin2.cxx  |   14 +
 sw/source/uibase/docvw/PostItMgr.cxx   |   36 +++-
 8 files changed, 229 insertions(+), 15 deletions(-)

New commits:
commit fb52efb4aecaf5034c2ef84c185e3d7a6ca8c416
Author: Mike Kaganski 
AuthorDate: Sat Jan 31 20:37:23 2026 +0500
Commit: Mike Kaganski 
CommitDate: Sat Jan 31 19:10:08 2026 +0100

tdf#163194: Make width of comments in margin fixed on print / PDF export

Previously, the width of the comments in margin on print / PDF export
was calculated using the same width factor, as when shown in the UI.
Before commit ac2720dcbe4e51e7f6733a385b5f7b571c6431e9 (tdf#73953 sw:
Allow resizing the comment section, 2024-01-11), there was no way to
change that, and the factor was hardcoded as 1.8 (and the print / PDF
export implementation in SwViewShell::PrintOrPDFExport relied on that).
The mentioned commit introduced a configuration DisplayWidthFactor,
that stored the user-defined width factor; and then in commit
cf9d8631ee5d4b894425446a9e6a8c939ab0309c (Related tdf#73953 Increase
default comment width, 2024-01-11), its default value was increased to
3.0, which immediately affected the width of the comments in print and
PDF output. The new default created comments that were too wide for
the page, even with default DPI.

There was another problem with existing implementation: the comment
width depended on DPI. It meant, that when a HiDPI monotor was used,
the comments printed / exported in margins were narrower, than when
it was done using a standard-DPI monitor. On HiDPI systems, a larger
width factor was necessary to see the "comment doesn't fit into the
page" problem.

Here, the old behavior is restored, where print and PDF output use a
fixed value of the comment width factor. Also, the output width now
doesn't depend on DPI.

Two other possibilities were considered:

1. Keep using user-defined width factor, as in UI, and calculate the
   correct comment position, as well as original page scaling factor,
   to fit them all on the output page;

2. Introduce a new configuration, dedicated for width of comments in
   margins of pages in print / PDF export (and, again, calculate the
   layout using that factor).

They both were rejected, because it doesn't make sense to reduce the
original page size too much. Currently, the original page is reduced
by factor of 0.75, to make room for the comments. Allowing more space
for comments could easily make the page reduced to one quarter of the
original size, or even smaller. And the text of comments will scale
down as well, making it unreadable with too wide comments area.

One problem that required solving was that dynamically changing the
width factor changed sizes of the comments, and that needed to be
restored (otherwise, exporting to PDF would change all UI sizes of
comments). For that, a good guess of the final comment text height
was needed; previously, it worked because comments were re-layouted
several times before they were finally shown, and that compensated
for the incorrect initial height used in SwPostItMgr::LayoutPostIts.
But for print / output, where there is only one layout for output,
and one layout for restoring the size, a new method was introduced
in SwAnnotationWin, GuessTextHeightForWidth.

This restores testTdf152575 to the original state before the commit
cf9d8631ee5d4b894425446a9e6a8c939ab0309c.

Change-Id: Ib0dd195d7594b51be86e489cc06cae00b26bf29b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198457
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins

diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index 0585b30292be..f82984b3c9d5 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -111,6 +111,7 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public 
InterimItemWindow
 ::sw::overlay::OverlayRanges* TextRange() { return 
mpTextRangeOverlay.get();}
 
 tools::LongGetPostItTextHeight();
+tools::Long GuessTextHeightForWidth(tools::Long nWidth) const;
 
 voidSwitchToPostIt(sal_uInt16 aDirection);
 voidSwitchToFieldPos();
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index 7ff84952c887..11c68d0e0cb8 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -99,7 +99,7 @@ class SAL_DLLPU

core.git: sw/inc sw/source

2026-01-31 Thread Andreas Heinisch (via logerrit)
 sw/inc/fldbas.hxx |6 --
 sw/source/uibase/fldui/fldmgr.cxx |5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit f7588e928a6de891e1fbf3b4d591e7d69347813a
Author: Andreas Heinisch 
AuthorDate: Fri Jan 23 18:24:45 2026 +0100
Commit: Andreas Heinisch 
CommitDate: Sat Jan 31 12:28:32 2026 +0100

tdf#170392 - Align file name format constants with translate constants

Otherwise, conversions during the save/insert process will change the
format of the file name field because the constants need to be converted
from SwFileNameFormat to FilenameDisplayFormat and vice versa.

Change-Id: I6ee3ae3adc34a86560381f8e9585a016d4f312ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198019
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 0f60a85a0e00..1d29362b3caa 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -148,12 +148,14 @@ enum class SwFieldTypesEnum : sal_uInt16 {
 LAST = ParagraphSignature,
 Unknown = USHRT_MAX // used by SwFieldMgr::GetCurTypeId
 };
+
+// tdf#170392 - this should be aligned with FMT_FF_ARY in 
sw/source/uibase/fldui/fldmgr.cxx
 enum class SwFileNameFormat {
 // most of the constants are a regular enum
-Name,
-PathName,
 Path,
+PathName,
 NameNoExt,
+Name,
 UIName,
 UIRange,
 End, // marker value, used for asserts
diff --git a/sw/source/uibase/fldui/fldmgr.cxx 
b/sw/source/uibase/fldui/fldmgr.cxx
index 0ad355618552..802d7f37f219 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -188,12 +188,13 @@ const TranslateId FMT_NUM_ARY[] =
 FMT_NUM_PAGESPECIAL
 };
 
+// tdf#170392 - this should be aligned with enum SwFileNameFormat in 
sw/inc/fldbas.hxx
 const TranslateId FMT_FF_ARY[] =
 {
-FMT_FF_NAME,
-FMT_FF_PATHNAME,
 FMT_FF_PATH,
+FMT_FF_PATHNAME,
 FMT_FF_NAME_NOEXT,
+FMT_FF_NAME,
 FMT_FF_UI_NAME,
 FMT_FF_UI_RANGE
 };


core.git: sw/inc sw/source

2026-01-30 Thread Gülşah Köse (via logerrit)
 sw/inc/expfld.hxx|4 +++
 sw/source/core/fields/expfld.cxx |   47 ++-
 2 files changed, 50 insertions(+), 1 deletion(-)

New commits:
commit 936ab761667feadc4e7dcb35a051e77bb281f1b1
Author: Gülşah Köse 
AuthorDate: Thu Jan 22 10:08:38 2026 +0300
Commit: Gülşah Köse 
CommitDate: Fri Jan 30 16:27:45 2026 +0100

tdf#127184 Use caption text instead of category in navigator

At first creating a caption, navigator just gets the last name (Figure) from
dialog without translated to UI language (as user type). But while
opening again the same file, Figure is translated to UI language in
sw::DocumentFieldsManager::InitFieldTypes.

The problem is when user inserts a new category name and the category
name is same with built in category names. Built in category names are
always in English. There is no way for navigator to choose translated
one or untranslated one.










Instead of we can use the caption directly just like inital caption insert
function did. In this patch we use first two word of the caption to prevent
long lines in the navigator.

Signed-off-by: Gülşah Köse 
Change-Id: I9bffdc3edad1eee91a000997b3ba9c8a3ea5b673
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197792
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198428
Tested-by: Jenkins

diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index 62b501ff160f..e04b66435261 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -223,6 +223,7 @@ public:
 
 void SetFormatField(SwFormatField & rFormatField);
 SwFormatField* GetFormatField() { return mpFormatField;}
+const SwFormatField* GetFormatField() const { return mpFormatField;}
 
 double  GetValue(SwRootFrame const* pLayout) const;
 voidSetValue(const double& rVal, SwRootFrame const* pLayout);
@@ -237,6 +238,9 @@ public:
 inline void SetInputFlag(bool bInp);
 inline bool GetInputFlag() const;
 
+OUStringGetFirstNWords(const OUString& rText, 
sal_Int32 nWords) const;
+SwTextField*GetTextField() const;
+
 virtual OUStringGetFieldName() const override;
 
 SwGetSetExpType GetSubType() const;
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 5ffe38a25f52..f060817e1876 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -30,6 +30,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -826,6 +829,43 @@ SwSetExpField::SwSetExpField(SwSetExpFieldType* pTyp, 
const OUString& rFormel,
 }
 }
 
+SwTextField* SwSetExpField::GetTextField() const
+{
+SwTextField* pTextField = nullptr;
+if(mpFormatField && mpFormatField->GetTextField())
+pTextField = mpFormatField->GetTextField();
+
+return pTextField;
+}
+
+OUString SwSetExpField::GetFirstNWords(const OUString& rText, sal_Int32 
nWords) const
+{
+if (rText.isEmpty())
+return rText;
+
+css::lang::Locale aLocale;
+if(GetTextField())
+aLocale = 
g_pBreakIt->GetLocale(GetTextField()->GetTextNode().GetLang(0));
+
+sal_Int32 nPos = 0;
+for (sal_Int32 i = 0; i < nWords; ++i)
+{
+css::i18n::Boundary b =
+g_pBreakIt->GetBreakIter()->getWordBoundary(
+rText, nPos, aLocale,
+css::i18n::WordType::ANY_WORD, true);
+
+if (b.endPos <= nPos)
+break;
+
+nPos = b.endPos;
+}
+
+auto sSub = rText.subView(0, nPos);
+OUString s(sSub.data(), sSub.size());
+return s.trim();
+}
+
 void SwSetExpField::SetFormatField(SwFormatField & rFormatField)
 {
 mpFormatField = &rFormatField;
@@ -853,10 +893,15 @@ OUString SwSetExpField::GetFieldName() const
 ? SwFieldTypesEnum::SetInput
 : SwFieldTypesEnum::Set   );
 
+OUString sFieldText = "";
+
+if(GetTextField())
+ sFieldText = GetFirstNWords(GetTextField()->GetTextNode().GetText(), 
2);
+
 OUString aStr(
 SwFieldType::GetTypeStr( nStrType )
 + " "
-+ GetTyp()->GetName().toString() );
++ (sFieldText.isEmpty() ? GetTyp()->GetName().toString() : 
sFieldText));
 
 // Sequence: without formula
 if (SwFieldTypesEnum::Sequence != nStrType)


core.git: sw/inc sw/qa

2026-01-28 Thread Tamás Zolnai (via logerrit)
 sw/inc/paratr.hxx|2 
 sw/qa/extras/pagelinespacing/pagelinespacing.cxx |  160 ---
 2 files changed, 147 insertions(+), 15 deletions(-)

New commits:
commit 9c56e440d80b74a8a2ffe22264f64d5a8f2ea361
Author: Tamás Zolnai 
AuthorDate: Tue Jan 27 16:42:42 2026 +0100
Commit: Tamás Zolnai 
CommitDate: Wed Jan 28 12:18:18 2026 +0100

Add more unit tests for page line-spacing.

Change-Id: I63ade0bac061925f667f1384181e328db718f6bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198228
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai 

diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx
index 77931bc207ad..d686f2fb86ef 100644
--- a/sw/inc/paratr.hxx
+++ b/sw/inc/paratr.hxx
@@ -134,7 +134,7 @@ public:
 { m_pDefinedIn = const_cast(pDefiner); };
 };
 
-class SwRegisterItem final : public SfxBoolItem
+class SW_DLLPUBLIC SwRegisterItem final : public SfxBoolItem
 {
 public:
 static SfxPoolItem* CreateDefault();
diff --git a/sw/qa/extras/pagelinespacing/pagelinespacing.cxx 
b/sw/qa/extras/pagelinespacing/pagelinespacing.cxx
index ca3429353d5a..e186a73321dc 100644
--- a/sw/qa/extras/pagelinespacing/pagelinespacing.cxx
+++ b/sw/qa/extras/pagelinespacing/pagelinespacing.cxx
@@ -37,8 +37,12 @@ protected:
 void applyPageLineSpacing(const uint16_t nPage, const bool bEnable,
   const OUString& rReferenceStyle);
 
+void applyPageLineSpacing(const OUString& rParagraphStyle);
+
 Size getTextFrameSize(const uint16_t nTextFrame, const OUString& 
rTextContent);
 
+void setLineHeightForReferenceStyle(const uint16_t nPage, const sal_uInt16 
nLineHeight);
+
 private:
 void checkTextAlignedToBaselineGrid(SwTextFrame* pTextFrame, const bool 
bAligned);
 };
@@ -156,6 +160,38 @@ void SwPageLineSpacingTest::applyPageLineSpacing(const 
uint16_t nPage, const boo
 calcLayout();
 }
 
+void SwPageLineSpacingTest::applyPageLineSpacing(const OUString& 
rParagraphStyle)
+{
+SwDocShell* pDocShell = getSwDocShell();
+CPPUNIT_ASSERT(pDocShell);
+
+SwDoc* pDoc = pDocShell->GetDoc();
+CPPUNIT_ASSERT(pDoc);
+
+// Enable page line-spacing for the given paragraph style.
+{
+SwTextFormatColl* pTextFormat = 
pDoc->FindTextFormatCollByName(UIName(rParagraphStyle));
+CPPUNIT_ASSERT(pTextFormat);
+
+const SwAttrSet& rAttrSet = pTextFormat->GetAttrSet();
+SwRegisterItem aRegisterItem = rAttrSet.GetRegister();
+aRegisterItem.SetValue(true);
+CPPUNIT_ASSERT_EQUAL(true, aRegisterItem.GetValue());
+
+std::unique_ptr pNewSet = rAttrSet.Clone();
+pNewSet->Put(aRegisterItem);
+pDoc->ChgFormat(*pTextFormat, *pNewSet);
+calcLayout();
+}
+
+// Verify the paragraph style was updated properly.
+{
+SwTextFormatColl* pTextFormat = 
pDoc->FindTextFormatCollByName(UIName(rParagraphStyle));
+const SwAttrSet& rAttrSet = pTextFormat->GetAttrSet();
+CPPUNIT_ASSERT_EQUAL(true, rAttrSet.GetRegister().GetValue());
+}
+}
+
 Size SwPageLineSpacingTest::getTextFrameSize(const uint16_t nTextFrame,
  const OUString& rTextContent)
 {
@@ -205,6 +241,79 @@ Size SwPageLineSpacingTest::getTextFrameSize(const 
uint16_t nTextFrame,
 return { 0, 0 };
 }
 
+void SwPageLineSpacingTest::setLineHeightForReferenceStyle(const uint16_t 
nPage,
+   const sal_uInt16 
nLineHeight)
+{
+SwDocShell* pDocShell = getSwDocShell();
+CPPUNIT_ASSERT(pDocShell);
+
+SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+CPPUNIT_ASSERT(pWrtShell);
+
+SwDoc* pDoc = pDocShell->GetDoc();
+CPPUNIT_ASSERT(pDoc);
+
+SwFrame* pNextFrame = pWrtShell->GetLayout();
+while (pNextFrame)
+{
+if (pNextFrame->IsPageFrame())
+{
+uint16_t nCurrentPage = 1;
+while (pNextFrame)
+{
+// Find the correct page.
+if (nCurrentPage == nPage)
+{
+CPPUNIT_ASSERT(pNextFrame->IsPageFrame());
+auto pPageFrame = dynamic_cast(pNextFrame);
+CPPUNIT_ASSERT(pPageFrame);
+SwPageDesc* pPageDesc = pPageFrame->GetPageDesc();
+CPPUNIT_ASSERT(pPageDesc);
+// Modify the reference style of the given page style.
+{
+const SwTextFormatColl* pRegisterFormat
+= pPageDesc->GetRegisterFormatColl();
+CPPUNIT_ASSERT(pRegisterFormat);
+SwTextFormatColl* pTextFormat
+= 
pDoc->FindTextFormatCollByName(pRegisterFormat->GetName());
+CPPUNIT_ASSERT(pTextFormat);
+
+const SwAttrSet& rAttrSet = pTextFormat->GetAttrSet();
+  

core.git: sw/inc

2026-01-26 Thread Mike Kaganski (via logerrit)
 sw/inc/ndtxt.hxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 204117b21d16ff28c7ee9b2f7e59b37310864c7e
Author: Mike Kaganski 
AuthorDate: Mon Jan 26 09:31:39 2026 +0100
Commit: Mike Kaganski 
CommitDate: Mon Jan 26 14:10:13 2026 +0100

Fix non-pch Windows build

... after commit c880d2bec8907db17ef92220a16f09a7c55c0e6a
(Fix some non self contained headers in module sw, 2026-01-25).

The change in sw/inc/ndtxt.hxx created circular dependency:

- sw/source/core/access/parachangetrackinginfo.cxx
  - #include  (executes #pragma once, will not be included again)
- #include  (at the beginning of wrong.hxx, only on Windows;
  before its classes are read)
  - #include "../source/core/inc/wrong.hxx" (ignored because of #pragma 
once)
  - #include "../source/core/inc/SwGrammarMarkUp.hxx" (needs access to
definitions in wrong.hxx, yet unavailable)

Resulting in

C:\loC:\loC:\loC:\loC:\loC:\loChange-Id: 
I868902d6d0552832c4db3aefdba8ee76fa19bce1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198124
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins

diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index e1f50bd6c450..dcbe11e4b7d6 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -30,8 +30,6 @@
 #include "ndhints.hxx"
 #include "node.hxx"
 #include "paratr.hxx"
-#include "../source/core/inc/wrong.hxx"
-#include "../source/core/inc/SwGrammarMarkUp.hxx"
 
 #include 
 #include 


core.git: sw/inc sw/qa sw/source

2026-01-25 Thread Gabor Kelemen (via logerrit)
 sw/inc/AnnotationWin.hxx |1 -
 sw/inc/dbgoutsw.hxx  |1 +
 sw/inc/docstyle.hxx  |1 +
 sw/inc/edimp.hxx |1 +
 sw/inc/fmtruby.hxx   |1 +
 sw/inc/ndtxt.hxx |2 ++
 sw/inc/reffldsubtype.hxx |2 ++
 sw/inc/unobasestyle.hxx  |5 +
 sw/inc/unocoll.hxx   |1 +
 sw/inc/unofieldcoll.hxx  |1 +
 sw/inc/unoxstyle.hxx |1 +
 sw/qa/extras/uiwriter/uiwriter5.cxx  |1 +
 sw/qa/filter/md/data/image-and-link.md   |2 +-
 sw/source/core/inc/UndoRedline.hxx   |1 +
 sw/source/core/inc/layact.hxx|1 +
 sw/source/core/inc/txttypes.hxx  |2 ++
 sw/source/core/inc/vprint.hxx|2 ++
 sw/source/core/txtnode/justify.hxx   |7 +++
 sw/source/filter/html/css1kywd.hxx   |2 ++
 sw/source/filter/html/htmlform.hxx   |2 ++
 sw/source/filter/html/swcss1.hxx |1 +
 sw/source/filter/html/swhtml.hxx |1 +
 sw/source/filter/xml/xmltexte.hxx|2 ++
 sw/source/filter/xml/xmltexti.hxx|2 ++
 sw/source/ui/vba/vbabookmarks.hxx|2 ++
 sw/source/ui/vba/vbacontentcontrollistentries.hxx|1 -
 sw/source/ui/vba/vbadialog.hxx   |2 ++
 sw/source/ui/vba/vbadialogs.hxx  |2 ++
 sw/source/ui/vba/vbafield.hxx|2 ++
 sw/source/ui/vba/vbaformfielddropdownlistentries.hxx |1 -
 sw/source/ui/vba/vbaformfields.hxx   |2 ++
 sw/source/ui/vba/vbaframes.hxx   |2 ++
 sw/source/ui/vba/vbaheaderfooter.hxx |2 ++
 sw/source/ui/vba/vbaheadersfooters.hxx   |2 ++
 sw/source/ui/vba/vbapagesetup.hxx|2 ++
 sw/source/ui/vba/vbaparagraph.hxx|2 ++
 sw/source/ui/vba/vbarevisions.hxx|2 ++
 sw/source/ui/vba/vbasections.hxx |2 ++
 sw/source/ui/vba/vbastyle.hxx|2 ++
 sw/source/ui/vba/vbastyles.hxx   |2 ++
 sw/source/ui/vba/vbatable.hxx|2 ++
 sw/source/ui/vba/vbatables.hxx   |2 ++
 sw/source/ui/vba/vbatablesofcontents.hxx |2 ++
 sw/source/ui/vba/vbawindow.hxx   |2 ++
 sw/source/ui/vba/vbawordbasic.hxx|3 +++
 sw/source/uibase/docvw/PostItMgr.cxx |1 +
 sw/source/uibase/inc/content.hxx |4 
 sw/source/uibase/inc/drwtxtsh.hxx|1 +
 sw/source/uibase/inc/frmpage.hxx |1 +
 sw/source/uibase/inc/langhelper.hxx  |1 +
 sw/source/uibase/inc/numprevw.hxx|1 +
 sw/source/uibase/inc/optload.hxx |1 +
 sw/source/uibase/utlui/content.cxx   |1 +
 53 files changed, 91 insertions(+), 4 deletions(-)

New commits:
commit c880d2bec8907db17ef92220a16f09a7c55c0e6a
Author: Gabor Kelemen 
AuthorDate: Tue Jan 6 11:25:41 2026 +0100
Commit: Gabor Kelemen 
CommitDate: Sun Jan 25 18:56:12 2026 +0100

Fix some non self contained headers in module sw

Change-Id: I9d6e3fbf5e1cdfe6818662823b5ef6cd25fb96d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196638
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen 

diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index 2db6f5b5fab7..0585b30292be 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -30,7 +30,6 @@
 #include "postithelper.hxx"
 #include "swrect.hxx"
 #include "SidebarWindowsTypes.hxx"
-#include 
 
 class OutlinerParaObject;
 class SwPostItMgr;
diff --git a/sw/inc/dbgoutsw.hxx b/sw/inc/dbgoutsw.hxx
index b02a4ad909ca..e2360f43e3de 100644
--- a/sw/inc/dbgoutsw.hxx
+++ b/sw/inc/dbgoutsw.hxx
@@ -22,6 +22,7 @@
 
 #include 
 #include 
+#include "frmfmt.hxx"
 #include "tox.hxx"
 #include 
 #include 
diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx
index 69054b9eb1a2..1f2bffef3ac7 100644
--- a/sw/inc/docstyle.hxx
+++ b/sw/inc/docstyle.hxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include "swdllapi.h"
+#include "names.hxx"
 
 #include 
 #include 
diff --git a/sw/inc/edimp.hxx b/sw/inc/edimp.hxx
index 7a564a76e609..cfa085bb170e 100644
--- a/sw/inc/edimp.hxx
+++ b/sw/inc/edimp.hxx
@@ -22,6 +22,7 @@
 #include 
 
 #include "nodeoffset.hxx"
+#include "node.hxx"
 
 class SwPaM;
 class SwNodeIndex;
diff --git a/sw/inc/fmtruby.hxx b/sw

core.git: sw/inc sw/qa sw/source

2026-01-20 Thread Noel Grandin (via logerrit)
 sw/inc/IDocumentStylePoolAccess.hxx |   20 
 sw/inc/SwStyleNameMapper.hxx|   25 
 sw/inc/ToxLinkProcessor.hxx |2 
 sw/inc/doc.hxx  |2 
 sw/inc/editsh.hxx   |   10 
 sw/inc/fmtinfmt.hxx |   13 
 sw/inc/fmtruby.hxx  |6 
 sw/inc/format.hxx   |7 
 sw/inc/numrule.hxx  |6 
 sw/inc/pagedesc.hxx |4 
 sw/inc/poolfmt.hxx  |  563 +++---
 sw/inc/redline.hxx  |4 
 sw/inc/tox.hxx  |5 
 sw/qa/core/test_ToxLinkProcessor.cxx|   13 
 sw/qa/filter/md/md.cxx  |   10 
 sw/qa/uibase/shells/textsh1.cxx |2 
 sw/source/core/attr/format.cxx  |3 
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   24 
 sw/source/core/doc/DocumentLayoutManager.cxx|   12 
 sw/source/core/doc/DocumentRedlineManager.cxx   |3 
 sw/source/core/doc/DocumentStylePoolManager.cxx |  633 
 sw/source/core/doc/SwStyleNameMapper.cxx|  252 +++---
 sw/source/core/doc/acmplwrd.cxx |4 
 sw/source/core/doc/doc.cxx  |6 
 sw/source/core/doc/docdesc.cxx  |8 
 sw/source/core/doc/docdraw.cxx  |6 
 sw/source/core/doc/docfmt.cxx   |2 
 sw/source/core/doc/docftn.cxx   |   32 
 sw/source/core/doc/doclay.cxx   |   20 
 sw/source/core/doc/docnew.cxx   |8 
 sw/source/core/doc/docnum.cxx   |6 
 sw/source/core/doc/docredln.cxx |   10 
 sw/source/core/doc/doctxm.cxx   |   30 
 sw/source/core/doc/htmltbl.cxx  |4 
 sw/source/core/doc/lineinfo.cxx |2 
 sw/source/core/doc/notxtfrm.cxx |4 
 sw/source/core/doc/number.cxx   |   11 
 sw/source/core/doc/poolfmt.cxx  |  140 +--
 sw/source/core/doc/tblafmt.cxx  |6 
 sw/source/core/doc/tblcpy.cxx   |   15 
 sw/source/core/doc/tblrwcl.cxx  |4 
 sw/source/core/docnode/ndnum.cxx|2 
 sw/source/core/docnode/ndtbl.cxx|   14 
 sw/source/core/docnode/section.cxx  |2 
 sw/source/core/edit/autofmt.cxx |   40 -
 sw/source/core/edit/edfcol.cxx  |8 
 sw/source/core/edit/edfmt.cxx   |6 
 sw/source/core/fields/docufld.cxx   |2 
 sw/source/core/fields/reffld.cxx|   28 
 sw/source/core/frmedt/fedesc.cxx|5 
 sw/source/core/inc/DocumentStylePoolManager.hxx |   18 
 sw/source/core/layout/ftnfrm.cxx|2 
 sw/source/core/layout/pagedesc.cxx  |4 
 sw/source/core/layout/paintfrm.cxx  |2 
 sw/source/core/swg/SwXMLTextBlocks.cxx  |2 
 sw/source/core/tox/ToxLinkProcessor.cxx |7 
 sw/source/core/tox/ToxTextGenerator.cxx |2 
 sw/source/core/tox/tox.cxx  |4 
 sw/source/core/txtnode/atrftn.cxx   |6 
 sw/source/core/txtnode/fmtatr2.cxx  |   14 
 sw/source/core/txtnode/ndtxt.cxx|2 
 sw/source/core/txtnode/thints.cxx   |4 
 sw/source/core/txtnode/txtatr2.cxx  |6 
 sw/source/core/undo/SwUndoFmt.cxx   |   18 
 sw/source/core/undo/undel.cxx   |2 
 sw/source/core/undo/unsect.cxx  |4 
 sw/source/core/undo/untbl.cxx   |2 
 sw/source/core/unocore/unocrsrhelper.cxx|8 
 sw/source/core/unocore/unofield.cxx |   14 
 sw/source/core/unocore/unoflatpara.cxx  |2 
 sw/source/core/unocore/unoframe.cxx |6 
 sw/source/core/unocore/unoobj.cxx   |4 
 sw/source/core/unocore/unoredline.cxx   |2 
 sw/source/core/unocore/unoredlines.cxx  |4 
 sw/source/core/unocore/unosett.cxx  |   16 
 sw/source/core/unocore/unostyle.cxx |   97 +-
 sw/source/filter

core.git: sw/inc sw/qa sw/source

2026-01-20 Thread Michael Weghorn (via logerrit)
 sw/inc/cellfml.hxx|6 ++---
 sw/qa/core/uwriter.cxx|2 -
 sw/source/core/fields/cellfml.cxx |   44 +++---
 sw/source/core/fields/tblcalc.cxx |4 +--
 4 files changed, 28 insertions(+), 28 deletions(-)

New commits:
commit ce6815a19fba1639db613a3027b9ba2ca5651b20
Author: Michael Weghorn 
AuthorDate: Mon Jan 19 17:25:36 2026 +0100
Commit: Michael Weghorn 
CommitDate: Tue Jan 20 10:39:51 2026 +0100

sw: Make SwTableFormula::NameType an enum class

Change-Id: Ia0e6d995005bfad1c3c05b273860045653069df8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197603
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sw/inc/cellfml.hxx b/sw/inc/cellfml.hxx
index 756e9de571ff..e0f421aa8ef5 100644
--- a/sw/inc/cellfml.hxx
+++ b/sw/inc/cellfml.hxx
@@ -89,7 +89,7 @@ typedef void (SwTableFormula::*FnScanFormula)( const 
SwTable&, OUStringBuffer&,
 static const SwTable* FindTable( SwDoc& rDoc, std::u16string_view rNm );
 
 protected:
-enum NameType { EXTRNL_NAME, INTRNL_NAME, REL_NAME };
+enum class NameType { External, Internal, Relative };
 
 OUStringm_sFormula; ///< current formula
 NameTypem_eNmType;  ///< current display method
@@ -128,7 +128,7 @@ public:
 /// gets called before/after merging/splitting of tables
 void ToSplitMergeBoxNm( SwTableFormulaUpdate& rTableUpd );
 
-bool IsIntrnlName() const   { return m_eNmType == INTRNL_NAME; 
}
+bool IsIntrnlName() const   { return m_eNmType == 
NameType::Internal; }
 NameType GetNameType() const{ return m_eNmType; }
 
 bool IsValid() const{ return m_bValidValue; }
@@ -138,7 +138,7 @@ public:
 void SetFormula( const OUString& rNew )
 {
 m_sFormula = rNew;
-m_eNmType = EXTRNL_NAME;
+m_eNmType = NameType::External;
 m_bValidValue = false;
 }
 
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 0c9fb7fdbd0b..7ea65e298d9d 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -1404,7 +1404,7 @@ namespace
 : SwTableFormula(rStr)
 , m_pNode(pNode)
 {
-m_eNmType = INTRNL_NAME;
+m_eNmType = NameType::Internal;
 }
 virtual const SwNode* GetNodeOfFormula() const override
 {
diff --git a/sw/source/core/fields/cellfml.cxx 
b/sw/source/core/fields/cellfml.cxx
index 2a82ed5eee69..613e1d2e0f5d 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -323,7 +323,7 @@ bool SwTableCalcPara::CalcWithStackOverflow()
 
 SwTableFormula::SwTableFormula( OUString aFormula )
 : m_sFormula( std::move(aFormula) )
-, m_eNmType( EXTRNL_NAME )
+, m_eNmType( NameType::External )
 , m_bValidValue( false )
 {
 }
@@ -511,13 +511,13 @@ void SwTableFormula::BoxNmsToRelNm( const SwTable& 
rTable, OUStringBuffer& rNewS
 if( pLastBox )
 {
 rNewStr.append(lcl_BoxNmToRel( rTable, *pTableNd, sRefBoxNm, *pLastBox,
-m_eNmType == EXTRNL_NAME ));
+m_eNmType == NameType::External ));
 rNewStr.append(":");
 rFirstBox = rFirstBox.copy( pLastBox->getLength()+1 );
 }
 
 rNewStr.append(lcl_BoxNmToRel( rTable, *pTableNd, sRefBoxNm, rFirstBox,
-m_eNmType == EXTRNL_NAME ));
+m_eNmType == NameType::External ));
 
 // get label for the box
 rNewStr.append(rFirstBox[ rFirstBox.getLength()-1 ]);
@@ -583,23 +583,23 @@ void SwTableFormula::PtrToBoxNm( const SwTable* pTable )
 FnScanFormula fnFormula = nullptr;
 switch (m_eNmType)
 {
-case INTRNL_NAME:
+case NameType::Internal:
 if( pTable )
 fnFormula = &SwTableFormula::PtrToBoxNms;
 break;
-case REL_NAME:
+case NameType::Relative:
 if( pTable )
 {
 fnFormula = &SwTableFormula::RelNmsToBoxNms;
 pNd = GetNodeOfFormula();
 }
 break;
-case EXTRNL_NAME:
+case NameType::External:
 return;
 }
 assert(pTable);
 m_sFormula = ScanString( fnFormula, *pTable, 
const_cast(static_cast(pNd)) );
-m_eNmType = EXTRNL_NAME;
+m_eNmType = NameType::External;
 }
 
 /// create internal formula (in CORE)
@@ -609,23 +609,23 @@ void SwTableFormula::BoxNmToPtr( const SwTable* pTable )
 FnScanFormula fnFormula = nullptr;
 switch (m_eNmType)
 {
-case EXTRNL_NAME:
+case NameType::External:
 if( pTable )
 fnFormula = &SwTableFormula::BoxNmsToPtr;
 break;
-case REL_NAME:
+case NameType::Relative:
 if( pTable )
 {
 fnFormula = &SwTableFormula::RelBoxNmsToPtr;
 pNd = GetNodeOfFormula();
 }
 break;
-case INTRNL_NAME:
+case NameType::Internal:
 return;
 }
 ass

core.git: sw/inc sw/Library_msword.mk sw/source

2026-01-14 Thread Jim Raykowski (via logerrit)
 sw/Library_msword.mk  |1 +
 sw/inc/viewsh.hxx |4 ++--
 sw/source/filter/ww8/docxexportfilter.cxx |4 
 sw/source/uibase/inc/wrtsh.hxx|4 ++--
 4 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 9cdb58822849805ca939e1079b01262e75a96bf2
Author: Jim Raykowski 
AuthorDate: Sat Jan 3 15:40:11 2026 -0900
Commit: Jim Raykowski 
CommitDate: Wed Jan 14 23:55:22 2026 +0100

tdf#169964 Fix folded OLE objects are not saved in docx

Examining DocxAttributeOutput::WriteFlyFrame case ww8::Frame::eOle,
it seems that OLE objects need to have their frames visible in
the document for them to be saved. This patch makes all folded
outline content visible during execution of the
DocxExportFilter:exportDocument function. SW_DLLPUBLIC's are added to
make linking succeed with clang.

Change-Id: I8fcaa98402ebd9a7a6135f65467a82bbca8731f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196516
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/sw/Library_msword.mk b/sw/Library_msword.mk
index 7d9d0c7f80f8..ba5ec835d642 100644
--- a/sw/Library_msword.mk
+++ b/sw/Library_msword.mk
@@ -32,6 +32,7 @@ $(eval $(call gb_Library_set_include,msword,\
 -I$(SRCDIR)/sw/source/core/inc \
 -I$(SRCDIR)/sw/source/filter/inc \
 -I$(SRCDIR)/sw/inc \
+-I$(SRCDIR)/sw/source/uibase/inc \
 $$(INCLUDE) \
 ))
 
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index cece0d0dfdfc..8da56ee9b75b 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -523,9 +523,9 @@ public:
 void LockView( bool b )   { mbViewLocked = b;}
 
 inline void LockPaint(LockPaintReason eReason);
-   void ImplLockPaint();
+SW_DLLPUBLIC void ImplLockPaint();
 inline void UnlockPaint(bool bVirDev = false );
-   void ImplUnlockPaint( std::vector& rReasons, bool 
bVirDev );
+SW_DLLPUBLIC void ImplUnlockPaint(std::vector& rReasons, 
bool bVirDev);
bool IsPaintLocked() const { return mnLockPaint != 0; }
 
 // Get/set DrawView and PageView.
diff --git a/sw/source/filter/ww8/docxexportfilter.cxx 
b/sw/source/filter/ww8/docxexportfilter.cxx
index c2ad2d0756e2..33502ad1f0c7 100644
--- a/sw/source/filter/ww8/docxexportfilter.cxx
+++ b/sw/source/filter/ww8/docxexportfilter.cxx
@@ -31,6 +31,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace ::comphelper;
 using namespace ::com::sun::star;
 
@@ -51,6 +53,8 @@ bool DocxExportFilter::exportDocument()
 if ( !pDoc )
 return false;
 
+MakeAllOutlineContentTemporarilyVisible a(pDoc);
+
 // update layout (if present), for SwWriteTable
 SwViewShell* pViewShell = 
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
 if (pViewShell != nullptr)
diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index 821a321f7a65..a8574a2806e7 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -524,7 +524,7 @@ typedef bool (SwWrtShell::*FNSimpleMove)();
 
 bool IsOutlineContentVisible(const size_t nPos);
 void MakeOutlineContentVisible(const size_t nPos, bool bMakeVisible = 
true, bool bSetAttrOutlineVisibility = true);
-void MakeAllFoldedOutlineContentVisible(bool bMakeVisible = true);
+SW_DLLPUBLIC void MakeAllFoldedOutlineContentVisible(bool bMakeVisible = 
true);
 void InvalidateOutlineContentVisibility();
 bool GetAttrOutlineContentVisible(const size_t nPos) const;
 
@@ -704,7 +704,7 @@ inline bool SwWrtShell::Is_FnDragEQBeginDrag() const
 #endif
 }
 
-class MakeAllOutlineContentTemporarilyVisible
+class SW_DLLPUBLIC MakeAllOutlineContentTemporarilyVisible
 {
 private:
 SwWrtShell* m_pWrtSh = nullptr;


core.git: sw/inc sw/source

2026-01-09 Thread Noel Grandin (via logerrit)
 sw/inc/formatcontentcontrol.hxx |4 
 sw/source/core/txtnode/attrcontentcontrol.cxx   |4 ++--
 sw/source/core/unocore/unocontentcontrol.cxx|2 +-
 sw/source/ui/misc/contentcontroldlg.cxx |2 +-
 sw/source/ui/vba/vbacontentcontrollistentry.cxx |8 
 5 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit 126f65b97d42cac400e9d8ff781488c44ef65fba
Author: Noel Grandin 
AuthorDate: Thu Jan 8 09:10:55 2026 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 9 22:15:17 2026 +0100

can move rather than copy this data

Change-Id: Ifa0124e1da72371b766fb89da9e823fbe21e3ca8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196902
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/formatcontentcontrol.hxx b/sw/inc/formatcontentcontrol.hxx
index 72383d76710d..91efffd11e28 100644
--- a/sw/inc/formatcontentcontrol.hxx
+++ b/sw/inc/formatcontentcontrol.hxx
@@ -259,6 +259,10 @@ public:
 {
 m_aListItems = rListItems;
 }
+void SetListItems(std::vector&& rListItems)
+{
+m_aListItems = std::move(rListItems);
+}
 
 bool AddListItem(size_t nZIndex, const OUString& rDisplayText, const 
OUString& rValue);
 void DeleteListItem(size_t nZIndex);
diff --git a/sw/source/core/txtnode/attrcontentcontrol.cxx 
b/sw/source/core/txtnode/attrcontentcontrol.cxx
index 901fa17013a3..c99b25b8b4f8 100644
--- a/sw/source/core/txtnode/attrcontentcontrol.cxx
+++ b/sw/source/core/txtnode/attrcontentcontrol.cxx
@@ -333,7 +333,7 @@ bool SwContentControl::AddListItem(size_t nZIndex, const 
OUString& rDisplayText,
 }
 std::vector vListItems = GetListItems();
 vListItems.insert(vListItems.begin() + nZIndex, aListItem);
-SetListItems(vListItems);
+SetListItems(std::move(vListItems));
 return true;
 }
 
@@ -357,7 +357,7 @@ void SwContentControl::DeleteListItem(size_t nZIndex)
 
 std::vector vListItems = GetListItems();
 vListItems.erase(vListItems.begin() + nZIndex);
-SetListItems(vListItems);
+SetListItems(std::move(vListItems));
 return;
 }
 
diff --git a/sw/source/core/unocore/unocontentcontrol.cxx 
b/sw/source/core/unocore/unocontentcontrol.cxx
index d0b4708a1d1b..1cb7256ac46b 100644
--- a/sw/source/core/unocore/unocontentcontrol.cxx
+++ b/sw/source/core/unocore/unocontentcontrol.cxx
@@ -715,7 +715,7 @@ void SAL_CALL SwXContentControl::setPropertyValue(const 
OUString& rPropertyName,
 }
 else
 {
-m_pImpl->m_pContentControl->SetListItems(aItems);
+m_pImpl->m_pContentControl->SetListItems(std::move(aItems));
 
 if (!m_pImpl->m_pContentControl->GetComboBox()
 && !m_pImpl->m_pContentControl->GetDropDown())
diff --git a/sw/source/ui/misc/contentcontroldlg.cxx 
b/sw/source/ui/misc/contentcontroldlg.cxx
index 08b846891f10..3d7f7dd9ec50 100644
--- a/sw/source/ui/misc/contentcontroldlg.cxx
+++ b/sw/source/ui/misc/contentcontroldlg.cxx
@@ -263,7 +263,7 @@ IMPL_LINK_NOARG(SwContentControlDlg, OkHdl, weld::Button&, 
void)
 }
 if (aItems != m_aSavedListItems)
 {
-m_pContentControl->SetListItems(aItems);
+m_pContentControl->SetListItems(std::move(aItems));
 bChanged = true;
 }
 
diff --git a/sw/source/ui/vba/vbacontentcontrollistentry.cxx 
b/sw/source/ui/vba/vbacontentcontrollistentry.cxx
index 311ab513c2f5..8b609f095518 100644
--- a/sw/source/ui/vba/vbacontentcontrollistentry.cxx
+++ b/sw/source/ui/vba/vbacontentcontrollistentry.cxx
@@ -64,7 +64,7 @@ void SwVbaContentControlListEntry::setText(const OUString& 
rSet)
 const bool bNeedsInvalidation = m_pCC->GetDropDown() && oSel && *oSel == 
m_nZIndex;
 
 vListItems[m_nZIndex].m_aDisplayText = rSet;
-m_pCC->SetListItems(vListItems);
+m_pCC->SetListItems(std::move(vListItems));
 
 if (bNeedsInvalidation)
 {
@@ -92,7 +92,7 @@ void SwVbaContentControlListEntry::setValue(const OUString& 
rSet)
 vListItems[m_nZIndex].m_aDisplayText = 
vListItems[m_nZIndex].ToString();
 
 vListItems[m_nZIndex].m_aValue = rSet;
-m_pCC->SetListItems(vListItems);
+m_pCC->SetListItems(std::move(vListItems));
 }
 
 void SwVbaContentControlListEntry::Delete() { 
m_pCC->DeleteListItem(m_nZIndex); }
@@ -113,7 +113,7 @@ void SwVbaContentControlListEntry::MoveDown()
 }
 std::vector vListItems = m_pCC->GetListItems();
 std::swap(vListItems[m_nZIndex], vListItems[m_nZIndex + 1]);
-m_pCC->SetListItems(vListItems);
+m_pCC->SetListItems(std::move(vListItems));
 ++m_nZIndex;
 }
 
@@ -133,7 +133,7 @@ void SwVbaContentControlListEntry::MoveUp()
 }
 std::vector vListItems = m_pCC->GetListItems();
 std::swap(vListItems[m_nZIndex], vListItems[m_nZIndex - 1]);
-m_pCC->SetListItems(vListItems);
+m_pCC->SetListItems(std::move(vListItems));
 --m_nZIndex;
 }
 


core.git: sw/inc

2025-12-20 Thread Miklos Vajna (via logerrit)
 sw/inc/paratr.hxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 3f8d153115cf5bba6a6f81d34f0db9c51fc6ab22
Author: Miklos Vajna 
AuthorDate: Fri Dec 19 08:29:23 2025 +0100
Commit: Miklos Vajna 
CommitDate: Sat Dec 20 16:12:56 2025 +0100

sw: extend the SwFormatDrop documentation

The old comment happened to focus on the SwClient part of it; also say
where it appears in the model & where to find it on the UI.

Change-Id: I4d91e4d77b1f9ded6cbe7d0f5b4a9232d697b73a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195909
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx
index 947e9a7c665e..77931bc207ad 100644
--- a/sw/inc/paratr.hxx
+++ b/sw/inc/paratr.hxx
@@ -60,7 +60,12 @@ namespace o3tl
 template<> struct typed_flags : 
is_typed_flags {};
 }
 
-/** If SwFormatDrop is a Client, it is the CharFormat that describes the font 
for the
+/**
+   This pool item is in the item set of a text node, for the Drop Caps feature.
+
+   Format -> Paragraph -> Drop Caps on the UI.
+
+   If SwFormatDrop is a Client, it is the CharFormat that describes the font 
for the
DropCaps. If it is not a Client, formatting uses the CharFormat of the 
paragraph.
If the CharFormat is modified, this change is propagated to the paragraphs
via the Modify of SwFormatDrop. */


core.git: sw/inc sw/qa sw/source

2025-12-16 Thread Szymon Kłos (via logerrit)
 sw/inc/format.hxx   |5 ++-
 sw/qa/uitest/writer_tests4/tdf167956.py |2 -
 sw/source/core/attr/format.cxx  |   45 ++--
 3 files changed, 31 insertions(+), 21 deletions(-)

New commits:
commit 236a12a1cf151869fc1a3b357d63f6486364f308
Author: Szymon Kłos 
AuthorDate: Mon Nov 24 13:01:55 2025 +
Commit: Szymon Kłos 
CommitDate: Tue Dec 16 09:55:30 2025 +0100

sw: setup favourite style once

- the GrabBag values don't change after import much
- better to parse qFormat once and setup favourite value
  we can cache and return quickly when requested
- it is more efficient than checking grab bag every time we do
  iteration over styles

Change-Id: I7b54831a84cd6528a40cf853f0d4f5061f05af82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194442
(cherry picked from commit 9fc06b81e954d91a63f80a54953d636139426ee2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194803
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins

diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index 9933a98926c8..bc1ddda6b3ca 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -63,6 +63,7 @@ class SW_DLLPUBLIC SwFormat : public sw::BorderCacheOwner, 
public sw::Broadcasti
 bool   m_bAutoUpdateOnDirectFormat : 1;/**< TRUE: Set attributes of a 
whole paragraph
at format (UI-side!). */
 bool m_bHidden : 1;
+bool m_bIsFavourite : 1;///< Show in the basic UI
 std::shared_ptr m_pGrabBagItem; ///< Style InteropGrabBag.
 virtual void InvalidateInSwFntCache(sal_uInt16) {};
 virtual void InvalidateInSwFntCache() {};
@@ -73,6 +74,7 @@ protected:
 SwFormat( const SwFormat& rFormat );
 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
 void Destr();
+void ParseFavourites();
 
 public:
 
@@ -179,7 +181,8 @@ public:
 bool IsAuto() const { return m_bAutoFormat; }
 void SetAuto( bool bNew )   { m_bAutoFormat = bNew; }
 
-bool IsFavourite() const;
+bool IsFavourite() const{ return m_bIsFavourite; }
+void SetFavourite(bool bValue)  { m_bIsFavourite = bValue; }
 
 bool IsHidden() const   { return m_bHidden; }
 void SetHidden( bool bValue )   { m_bHidden = bValue; }
diff --git a/sw/qa/uitest/writer_tests4/tdf167956.py 
b/sw/qa/uitest/writer_tests4/tdf167956.py
index 731808135ac9..ddf182ddc183 100644
--- a/sw/qa/uitest/writer_tests4/tdf167956.py
+++ b/sw/qa/uitest/writer_tests4/tdf167956.py
@@ -27,7 +27,7 @@ class tdf167956(UITestCase):
 xWriterDoc = self.xUITest.getTopFocusWindow()
 xStylesView = xWriterDoc.getChild("stylesview")
 self.wait_until_styles_are_displayed(xStylesView)
-self.assertEqual("10", get_state_as_dict(xStylesView)["Children"])
+self.assertLessEqual("10", 
get_state_as_dict(xStylesView)["Children"])
 self.assertEqual("Default Paragraph Style", 
get_state_as_dict(xStylesView)["SelectEntryText"])
 
 with self.ui_test.load_file(get_url_for_data_file("tdf167956.docx")):
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index e985b0822a0f..58e0680d86da 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -49,6 +49,7 @@ SwFormat::SwFormat( SwAttrPool& rPool, const UIName& 
rFormatNm,
 m_bAutoUpdateOnDirectFormat = false; // LAYER_IMPL
 m_bAutoFormat = true;
 m_bFormatInDTOR = m_bHidden = false;
+m_bIsFavourite = true;
 
 if( pDrvdFrame )
 {
@@ -69,6 +70,7 @@ SwFormat::SwFormat( const SwFormat& rFormat ) :
 m_bFormatInDTOR = false; // LAYER_IMPL
 m_bAutoFormat = rFormat.m_bAutoFormat;
 m_bHidden = rFormat.m_bHidden;
+m_bIsFavourite = rFormat.m_bIsFavourite;
 m_bAutoUpdateOnDirectFormat = rFormat.m_bAutoUpdateOnDirectFormat;
 
 if( auto pDerived = rFormat.DerivedFrom() )
@@ -117,6 +119,7 @@ SwFormat &SwFormat::operator=(const SwFormat& rFormat)
 
 m_bAutoFormat = rFormat.m_bAutoFormat;
 m_bHidden = rFormat.m_bHidden;
+m_bIsFavourite = rFormat.m_bIsFavourite;
 m_bAutoUpdateOnDirectFormat = rFormat.m_bAutoUpdateOnDirectFormat;
 return *this;
 }
@@ -727,6 +730,29 @@ void SwFormat::SetGrabBagItem(const uno::Any& rVal)
 m_pGrabBagItem = std::make_shared();
 
 m_pGrabBagItem->PutValue(rVal, 0);
+
+ParseFavourites();
+}
+
+void SwFormat::ParseFavourites()
+{
+const auto& rItems = m_pGrabBagItem->GetGrabBag();
+const auto aIt = rItems.find(u"qFormat"_ustr);
+if (aIt != rItems.end())
+{
+sal_Int32 nVal = 0;
+if (aIt->second >>= nVal)
+{
+if (nVal == 0)
+SetFavourite(false);
+else
+SetFavourite(true);
+}
+}
+else
+{
+SetFavourite(false);
+}
 }
 
 std::unique_ptr SwFormat::makeBackgroundBrush

core.git: sw/inc sw/source

2025-12-15 Thread Caolán McNamara (via logerrit)
 sw/inc/swabstdlg.hxx |1 +
 sw/source/ui/dialog/swdlgfact.cxx|3 ++-
 sw/source/uibase/inc/DropDownFieldDialog.hxx |2 +-
 sw/source/uibase/inc/wrtsh.hxx   |2 ++
 sw/source/uibase/wrtsh/wrtsh2.cxx|   22 +-
 5 files changed, 27 insertions(+), 3 deletions(-)

New commits:
commit 63b690ee20722081eb18563d0ffba33d7dcee908
Author: Caolán McNamara 
AuthorDate: Mon Dec 15 16:59:53 2025 +
Commit: Caolán McNamara 
CommitDate: Mon Dec 15 20:19:03 2025 +0100

make simple activate case of DropDownFieldDialog async

Change-Id: If3a36540976014774b4cbf84f52e2d3de28b96b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195679
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 48d806486d3c..bac073b696b1 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -299,6 +299,7 @@ protected:
 public:
 virtual bool  PrevButtonPressed() const = 0;
 virtual bool  NextButtonPressed() const = 0;
+virtual void Apply() = 0;
 };
 
 class AbstractSwLabDlg  : public SfxAbstractTabDialog
diff --git a/sw/source/ui/dialog/swdlgfact.cxx 
b/sw/source/ui/dialog/swdlgfact.cxx
index c1fec98137b7..e6217486002f 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -458,10 +458,11 @@ VclPtr 
SwAbstractDialogFactory_Impl::CreateSwFootNoteOptio
 namespace
 {
 class AbstractDropDownFieldDialog_Impl
-: public vcl::AbstractDialogImpl_Sync
+: public vcl::AbstractDialogImpl_Async
 {
 public:
 using AbstractDialogImpl_BASE::AbstractDialogImpl_BASE;
+void Apply() override { m_pDlg->Apply(); }
 bool PrevButtonPressed() const override { return 
m_pDlg->PrevButtonPressed(); }
 bool NextButtonPressed() const override { return 
m_pDlg->NextButtonPressed(); }
 };
diff --git a/sw/source/uibase/inc/DropDownFieldDialog.hxx 
b/sw/source/uibase/inc/DropDownFieldDialog.hxx
index b8b60f20c293..07b9e494d0a6 100644
--- a/sw/source/uibase/inc/DropDownFieldDialog.hxx
+++ b/sw/source/uibase/inc/DropDownFieldDialog.hxx
@@ -43,7 +43,6 @@ class DropDownFieldDialog final : public 
weld::GenericDialogController
 DECL_LINK(EditHdl, weld::Button&, void);
 DECL_LINK(PrevHdl, weld::Button&, void);
 DECL_LINK(NextHdl, weld::Button&, void);
-voidApply();
 DECL_LINK(DoubleClickHdl, weld::TreeView&, bool);
 public:
 DropDownFieldDialog(weld::Widget *pParent, SwWrtShell &rSh,
@@ -51,6 +50,7 @@ public:
 virtual ~DropDownFieldDialog() override;
 bool PrevButtonPressed() const;
 bool NextButtonPressed() const;
+void Apply();
 virtual short run() override
 {
 short nRet = GenericDialogController::run();
diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index 5e387dd30171..f623299e3ac6 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -427,6 +427,8 @@ typedef bool (SwWrtShell::*FNSimpleMove)();
 boolStartInputFieldDlg(SwField*, bool bPrevButton, bool bNextButton, 
weld::Widget* pParentWin, FieldDialogPressedButton* pPressedButton = nullptr);
 // update DropDown fields
 boolStartDropDownFieldDlg(SwField*, bool bPrevButton, bool 
bNextButton, weld::Widget* pParentWin, FieldDialogPressedButton* pPressedButton 
= nullptr);
+// update single DropDown field
+voidEditDropDownFieldDlg(SwField*, weld::Widget* pParentWin);
 
 //"Handler" for changes at DrawView - for controls.
 virtual void DrawSelChanged( ) override;
diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx 
b/sw/source/uibase/wrtsh/wrtsh2.cxx
index ddf3d5966ec0..3e61f3430702 100644
--- a/sw/source/uibase/wrtsh/wrtsh2.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh2.cxx
@@ -304,6 +304,26 @@ bool SwWrtShell::StartInputFieldDlg(SwField* pField, bool 
bPrevButton, bool bNex
 return bRet;
 }
 
+void SwWrtShell::EditDropDownFieldDlg(SwField* pField, weld::Widget* 
pParentWin)
+{
+SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
+VclPtr 
pDlg(pFact->CreateDropDownFieldDialog(pParentWin, *this, pField, false, false));
+
+pDlg->StartExecuteAsync([pDlg, this](sal_Int32 nRet) {
+if (nRet == RET_OK)
+pDlg->Apply();
+
+pDlg->disposeOnce();
+
+GetWin()->PaintImmediately();
+
+if (nRet == RET_YES)
+{
+GetView().GetViewFrame().GetDispatcher()->Execute(FN_EDIT_FIELD, 
SfxCallMode::SYNCHRON);
+}
+});
+}
+
 bool SwWrtShell::StartDropDownFieldDlg(SwField* pField, bool bPrevButton, bool 
bNextButton,
weld::Widget* pParentWin, 
SwWrtShell::FieldDialogPressedButton* pPressedButton)
 {
@@ -513,7 +533,7 @@ void SwWrtShell::ClickToField(const SwField& rField, bool 
bExecHyperlinks)
 StartInputFieldDlg(const_cast(&rField), false, false, 
GetView().GetFrameWeld());
 break

core.git: sw/inc sw/source

2025-12-15 Thread Mike Kaganski (via logerrit)
 sw/inc/swrect.hxx|   22 ++---
 sw/source/core/bastyp/swrect.cxx |   64 +++
 2 files changed, 43 insertions(+), 43 deletions(-)

New commits:
commit 9444976db797a8db9ce99113e9ef57d70b5d196c
Author: Mike Kaganski 
AuthorDate: Mon Dec 15 15:28:03 2025 +0100
Commit: Mike Kaganski 
CommitDate: Mon Dec 15 18:46:00 2025 +0100

Don't use get* methods of Point and Size in SwRect

In some of its methods, m_Size.Height() was called; in others,
m_Size.getHeight(). It was confusing; I kept checking if these
do the same. They do.

So standardize on underlying ones (those that are used in the
implementation of the get* variants).

Change-Id: I1d71624252570dea0ed15aacfbbac1243a7d9151
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195673
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index 3365434abb07..851df2ab57f7 100644
--- a/sw/inc/swrect.hxx
+++ b/sw/inc/swrect.hxx
@@ -28,7 +28,7 @@ class SvStream;
 typedef struct _xmlTextWriter* xmlTextWriterPtr;
 
 /// *Of course* Writer needs its own rectangles.
-/// This is half-open so m_Point.X() + m_Size.getWidth() is *not* included.
+/// This is half-open so m_Point.X() + m_Size.Width() is *not* included.
 /// Note the tools Rectangle is (usually? sometimes?) closed so there's a
 /// SVRect() to subtract 1 for the conversion.
 class SAL_WARN_UNUSED SwRect
@@ -196,21 +196,21 @@ inline void SwRect::Height( tools::Long nNew )
 }
 inline void SwRect::Left( const tools::Long nLeft )
 {
-m_Size.AdjustWidth( m_Point.getX() - nLeft );
+m_Size.AdjustWidth( m_Point.X() - nLeft );
 m_Point.setX(nLeft);
 }
 inline void SwRect::Right( const tools::Long nRight )
 {
-m_Size.setWidth(nRight - m_Point.getX() + 1);
+m_Size.setWidth(nRight - m_Point.X() + 1);
 }
 inline void SwRect::Top( const tools::Long nTop )
 {
-m_Size.AdjustHeight( m_Point.getY() - nTop );
+m_Size.AdjustHeight( m_Point.Y() - nTop );
 m_Point.setY(nTop);
 }
 inline void SwRect::Bottom( const tools::Long nBottom )
 {
-m_Size.setHeight(nBottom - m_Point.getY() + 1);
+m_Size.setHeight(nBottom - m_Point.Y() + 1);
 }
 
 // Get-Methods
@@ -240,7 +240,7 @@ inline tools::Long SwRect::Left()   const
 }
 inline tools::Long SwRect::Right()  const
 {
-return m_Size.getWidth() ? m_Point.getX() + m_Size.getWidth() - 1 : 
m_Point.getX();
+return m_Size.Width() ? m_Point.X() + m_Size.Width() - 1 : m_Point.X();
 }
 inline tools::Long SwRect::Top()const
 {
@@ -248,7 +248,7 @@ inline tools::Long SwRect::Top()const
 }
 inline tools::Long SwRect::Bottom() const
 {
-return m_Size.getHeight() ? m_Point.getY() + m_Size.getHeight() - 1 : 
m_Point.getY();
+return m_Size.Height() ? m_Point.Y() + m_Size.Height() - 1 : m_Point.Y();
 }
 
 inline Point SwRect::TopLeft() const
@@ -292,9 +292,9 @@ inline SwRect &SwRect::operator-=( const Point &rPt )
 inline tools::Rectangle SwRect::SVRect() const
 {
 SAL_INFO_IF( IsEmpty(), "sw.core", "SVRect() without Width or Height" );
-return tools::Rectangle( m_Point.getX(), m_Point.getY(),
-m_Point.getX() + m_Size.getWidth() - 1, //Right()
-m_Point.getY() + m_Size.getHeight() - 1 );  //Bottom()
+return tools::Rectangle( m_Point.X(), m_Point.Y(),
+m_Point.X() + m_Size.Width() - 1, //Right()
+m_Point.Y() + m_Size.Height() - 1 );  //Bottom()
 }
 
 inline bool SwRect::HasArea() const
@@ -303,7 +303,7 @@ inline bool SwRect::HasArea() const
 }
 inline bool SwRect::IsEmpty() const
 {
-return !(m_Size.getHeight() && m_Size.getWidth());
+return !(m_Size.Height() && m_Size.Width());
 }
 inline void SwRect::Clear()
 {
diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx
index 97e9683a59ab..29002a799976 100644
--- a/sw/source/core/bastyp/swrect.cxx
+++ b/sw/source/core/bastyp/swrect.cxx
@@ -93,60 +93,60 @@ SwRect& SwRect::Intersection_( const SwRect& rOther )
 
 void SwRect::Justify()
 {
-if ( m_Size.getHeight() < 0 )
+if ( m_Size.Height() < 0 )
 {
-m_Point.setY(m_Point.getY() + m_Size.getHeight() + 1);
-m_Size.setHeight(-m_Size.getHeight());
+m_Point.setY(m_Point.Y() + m_Size.Height() + 1);
+m_Size.setHeight(-m_Size.Height());
 }
-if ( m_Size.getWidth() < 0 )
+if ( m_Size.Width() < 0 )
 {
-m_Point.setX(m_Point.getX() + m_Size.getWidth() + 1);
-m_Size.setWidth(-m_Size.getWidth());
+m_Point.setX(m_Point.X() + m_Size.Width() + 1);
+m_Size.setWidth(-m_Size.Width());
 }
 }
 
 // Similar to the inline methods, but we need the function pointers
 void SwRect::Width_( const tools::Long nNew ) { m_Size.setWidth(nNew); }
 void SwRect::Height_( const tools::Long nNew ) { m_Size.setHeight(nNew); }
-void SwRect::Left_( const tools::Long nLeft ){ 
m_Size.AdjustWidth(m_Point.getX() - nLeft ); m_Point.setX(nLe

core.git: sw/inc sw/source

2025-12-12 Thread shlok3640 (via logerrit)
 sw/inc/crsrsh.hxx  |2 +-
 sw/source/core/crsr/crsrsh.cxx |4 ++--
 sw/source/core/crsr/viscrs.cxx |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit f80fc21dc57224a34b416d866f8930369ad54d7e
Author: shlok3640 
AuthorDate: Fri Dec 5 13:43:30 2025 +
Commit: Mike Kaganski 
CommitDate: Sat Dec 13 08:37:51 2025 +0100

tdf#90341 Clean up excessive const_cast in SwCursorShell

The GetPageNum function logically retrieves information without
modifying the document, so it should be marked as const.

This patch:
1. Marks GetPageNum as const in the header and source.
2. Removes the unnecessary const_cast at the call site in viscrs.cxx.
3. Handle the non-const requirement of CurrShell internally using
   const_cast to preserve logical constness of the API.

Change-Id: Id4ff5245d4160166bbddee7dce0b0999bb3fc5c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195084
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index c126d8a8e878..87afc4f91264 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -587,7 +587,7 @@ public:
 // true:  in which cursor is located.
 // false: which is visible at the upper margin.
 SW_DLLPUBLIC void GetPageNum( sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum,
- bool bAtCursorPos = true, const bool bCalcFrame = true );
+ bool bAtCursorPos = true, const bool bCalcFrame = true ) 
const;
 // Returns current page's sequential number (1-based),in which cursor is 
located, ignoring autoinserted empty pages.
 // Returns 0 on error
 SW_DLLPUBLIC sal_uInt16 GetPageNumSeqNonEmpty();
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index b84d6376fff1..04e52f41096f 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1565,9 +1565,9 @@ void SwCursorShell::GetCharRectAt(SwRect& rRect, const 
SwPosition* pPos)
 }
 
 void SwCursorShell::GetPageNum( sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum,
-  bool bAtCursorPos, const bool bCalcFrame )
+  bool bAtCursorPos, const bool bCalcFrame ) const
 {
-CurrShell aCurr( this );
+CurrShell aCurr(const_cast(this));
 // page number: first visible page or the one at the cursor
 const SwContentFrame* pCFrame;
 const SwPageFrame *pPg = nullptr;
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 150be2666e82..c301d7a9085c 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -229,7 +229,7 @@ void SwVisibleCursor::SetPosAndShow(SfxViewShell const * 
pViewShell)
 sal_uInt16 nPage, nVirtPage;
 // bCalcFrame=false is important to avoid calculating the layout when
 // we're in the middle of doing that already.
-const_cast(m_pCursorShell)->GetPageNum(nPage, 
nVirtPage, /*bAtCursorPos=*/true, /*bCalcFrame=*/false);
+m_pCursorShell->GetPageNum(nPage, nVirtPage, /*bAtCursorPos=*/true, 
/*bCalcFrame=*/false);
 if (nPage != m_nPageLastTime)
 {
 m_nPageLastTime = nPage;


core.git: sw/inc sw/source

2025-12-11 Thread Michael Weghorn (via logerrit)
 sw/inc/AnnotationWin.hxx|3 ++-
 sw/source/uibase/docvw/AnnotationMenuButton.cxx |5 +
 sw/source/uibase/docvw/AnnotationWin.cxx|2 ++
 sw/source/uibase/docvw/AnnotationWin2.cxx   |4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 9c9357a350d8e4ca532af36ea26a2fd90e6c9257
Author: Michael Weghorn 
AuthorDate: Wed Dec 10 12:36:55 2025 +0100
Commit: Michael Weghorn 
CommitDate: Thu Dec 11 18:45:20 2025 +0100

tdf#167385 sw: Keep AnnotationWin menu up to date

Since

commit f075fa01cb4f74185f13eb0a8d7f84cf1f47af49
Author: Michael Weghorn 
Date:   Tue Aug 22 10:26:32 2023 +0200

tdf#141101 tdf#101886 a11y: Restore previous focus on col/line 
popup close

, the menu button toggled handler is no more called before
the menu shows (at least for the vcl/SalInstanceMenuButton
implementation).

Therefore, instead of relying on that handler, update the
menu when initializing the AnnotationWin controls and in
SwAnnotationWin::UpdateData instead, to make sure it stays
up to date.

Change-Id: I0fe42b633679488fa0d9262c8a840fbe0b93f76a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195376
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index dbd20392c051..9be34683fc3d 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -215,10 +215,11 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public 
InterimItemWindow
 virtual void Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect) override;
 voidSetSizePixel( const Size& rNewSize ) override;
 
+void UpdateMenu();
+
 DECL_DLLPRIVATE_LINK(ModifyHdl, LinkParamNone*, void);
 DECL_DLLPRIVATE_LINK(ScrollHdl, weld::ScrolledWindow&, void);
 DECL_DLLPRIVATE_LINK(DeleteHdl, void*, void);
-DECL_DLLPRIVATE_LINK(ToggleHdl, weld::Toggleable&, void);
 DECL_DLLPRIVATE_LINK(SelectHdl, const OUString&, void);
 DECL_DLLPRIVATE_LINK(KeyInputHdl, const KeyEvent&, bool);
 DECL_DLLPRIVATE_LINK(MouseMoveHdl, const MouseEvent&, bool);
diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx 
b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
index 5dbe5f07beae..2db79c324d69 100644
--- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
@@ -63,11 +63,8 @@ IMPL_LINK(SwAnnotationWin, SelectHdl, const OUString&, 
rIdent, void)
 GrabFocusToDocument();
 }
 
-IMPL_LINK_NOARG(SwAnnotationWin, ToggleHdl, weld::Toggleable&, void)
+void SwAnnotationWin::UpdateMenu()
 {
-if (!mxMenuButton->get_active())
-return;
-
 bool bReadOnly = IsReadOnly();
 if (bReadOnly)
 {
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx 
b/sw/source/uibase/docvw/AnnotationWin.cxx
index 63c80ddcc3fc..a6374a75b99c 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -391,6 +391,8 @@ void SwAnnotationWin::UpdateData()
 else
 mpFormatField->Broadcast(SwFormatFieldHint( nullptr, 
SwFormatFieldHintWhich::CHANGED));
 mrView.GetDocShell()->SetModified();
+
+UpdateMenu();
 }
 mpOutliner->ClearModifyFlag();
 mpOutliner->GetUndoManager().Clear();
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index c42194786f78..1b0137a4e01d 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -419,8 +419,6 @@ void SwAnnotationWin::InitControls()
 
mxMenuButton->set_accessible_name(SwResId(STR_ACCESS_ANNOTATION_BUTTON_NAME));
 
mxMenuButton->set_accessible_description(SwResId(STR_ACCESS_ANNOTATION_BUTTON_DESC));
 mxMenuButton->set_tooltip_text(SwResId(STR_ACCESS_ANNOTATION_BUTTON_DESC));
-
-mxMenuButton->connect_toggled(LINK(this, SwAnnotationWin, ToggleHdl));
 mxMenuButton->connect_selected(LINK(this, SwAnnotationWin, SelectHdl));
 mxMenuButton->connect_key_press(LINK(this, SwAnnotationWin, KeyInputHdl));
 mxMenuButton->connect_mouse_move(LINK(this, SwAnnotationWin, 
MouseMoveHdl));
@@ -429,6 +427,8 @@ void SwAnnotationWin::InitControls()
 SetPostItText();
 mpOutliner->CompleteOnlineSpelling();
 
+UpdateMenu();
+
 mxSidebarTextControl->Show();
 mxMetadataAuthor->show();
 mxMetadataDate->show();


core.git: sw/inc

2025-12-10 Thread ayagamal-tech (via logerrit)
 sw/inc/fesh.hxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit cd5a5596bad170056fbd125e306157f553f63b6f
Author: ayagamal-tech 
AuthorDate: Wed Dec 10 00:21:14 2025 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Thu Dec 11 06:57:06 2025 +0100

tdf#143148 use #pragma once instead of include guards in sw

Replace include guards with "#pragma once" in sw/inc/fesh.hxx file.

Change-Id: I2b114a197cd65a9a7b008d631d25841619332369
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195339
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 1aaa5cd0dd25..085adf8dee52 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SW_INC_FESH_HXX
-#define INCLUDED_SW_INC_FESH_HXX
+#pragma once
 
 #include 
 #include 
@@ -829,6 +828,4 @@ public:
 
 void ClearFEShellTabCols(SwDoc & rDoc, SwTabFrame const*const pFrame);
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: sw/inc

2025-12-06 Thread Andrea Gelmini (via logerrit)
 sw/inc/docufld.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6b91047d48419ce53063f76c12ec41c2a917f870
Author: Andrea Gelmini 
AuthorDate: Thu Dec 4 21:38:40 2025 +0100
Commit: Julien Nabet 
CommitDate: Sat Dec 6 12:30:14 2025 +0100

Fix typo

Change-Id: If3bf1091315ae7ef2836d73d024c3a19a23d66c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195039
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 2a0f5b670896..59b07e80c728 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -228,7 +228,7 @@ public:
 virtual boolPutValue( const css::uno::Any& rVal, sal_uInt16 nWhich 
) override;
 };
 
-/// Provides the expansion of of an SwFileNameField to a string.
+/// Provides the expansion of an SwFileNameField to a string.
 class SAL_DLLPUBLIC_RTTI SwFileNameFieldType final : public SwFieldType
 {
 SwDoc& m_rDoc;


core.git: sw/inc sw/qa sw/source

2025-12-05 Thread Miklos Vajna (via logerrit)
 sw/inc/view.hxx  |4 +
 sw/qa/uibase/uiview/uiview.cxx   |   80 +++
 sw/source/uibase/uiview/view.cxx |   13 ++
 3 files changed, 97 insertions(+)

New commits:
commit 3b2ab404e21b648ddc9761c175dadb32b6459364
Author: Miklos Vajna 
AuthorDate: Thu Dec 4 08:27:37 2025 +0100
Commit: Miklos Vajna 
CommitDate: Fri Dec 5 09:28:15 2025 +0100

cool#13574 sw redline render mode: invalidate both omit modes together

The default SwRedlineRenderMode is unchanged, but in case there is a LOK
invalidate for the "omit deletes" mode, then issue invalidates for both
"omit insert" (1) and "omit delete" (2).

With this, a LOK client can do paintPartTile() calls in both modes, to
show the result in parallel.

This works, because the UNO command toggles between "standard" (0) and
"omit delete", so the additional invalidate we need to generate is "omit
insert".

Change-Id: If1b809ce32e8b4180765b9a56275cc00e7f255a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195013
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index 58dfe749b1cf..eaf65e7637d2 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -752,6 +752,10 @@ public:
 void BringToAttention(std::vector&& aRanges = {});
 void BringToAttention(const tools::Rectangle& rRect);
 void BringToAttention(const SwNode* pNode);
+
+/// See SfxViewShell::libreOfficeKitViewInvalidateTilesCallback().
+void libreOfficeKitViewInvalidateTilesCallback(const tools::Rectangle* 
pRect, int nPart,
+   int nMode) const override;
 };
 
 std::unique_ptr CreatePrintOptionsPage(weld::Container* pPage, 
weld::DialogController* pController,
diff --git a/sw/qa/uibase/uiview/uiview.cxx b/sw/qa/uibase/uiview/uiview.cxx
index 0f699341829e..ff6e777d1325 100644
--- a/sw/qa/uibase/uiview/uiview.cxx
+++ b/sw/qa/uibase/uiview/uiview.cxx
@@ -9,6 +9,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -16,6 +17,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -467,6 +471,82 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, 
testRedlineRenderModeCommand)
 CPPUNIT_ASSERT_EQUAL(SwRedlineRenderMode::Standard, eActual);
 }
 
+namespace
+{
+/// LOK view callback for test purposes.
+struct ViewCallback
+{
+std::set m_aInvalidationModes;
+
+static void callback(int nType, const char* pPayload, void* pData);
+void callbackImpl(int nType, const char* pPayload);
+};
+
+void ViewCallback::callback(int nType, const char* pPayload, void* pData)
+{
+static_cast(pData)->callbackImpl(nType, pPayload);
+}
+
+void ViewCallback::callbackImpl(int nType, const char* pPayload)
+{
+switch (nType)
+{
+case LOK_CALLBACK_INVALIDATE_TILES:
+{
+OUString aPayload = OUString::fromUtf8(pPayload);
+if (aPayload.startsWith("EMPTY"))
+{
+break;
+}
+uno::Sequence aSeq = 
comphelper::string::convertCommaSeparated(aPayload);
+// x y w h part mode
+CPPUNIT_ASSERT_EQUAL(static_cast(6), aSeq.getLength());
+
m_aInvalidationModes.insert(static_cast(aSeq[5].toInt32()));
+}
+break;
+}
+}
+}
+
+CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testRedlineRenderModeInvalidate)
+{
+// Set up LOK:
+comphelper::LibreOfficeKit::setActive(true);
+comphelper::LibreOfficeKit::setPartInInvalidation(true);
+
+// Given a document where redline render mode is set to "omit deletes":
+createSwDoc();
+getSwTextDoc()->initializeForTiledRendering({});
+SwDocShell* pDocShell = getSwDocShell();
+SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ViewCallback aCallback;
+TestLokCallbackWrapper aCallbackWrapper(&ViewCallback::callback, 
&aCallback);
+
pWrtShell->GetSfxViewShell()->setLibreOfficeKitViewCallback(&aCallbackWrapper);
+
aCallbackWrapper.setLOKViewId(SfxLokHelper::getView(*pWrtShell->GetSfxViewShell()));
+SwViewOption aOpt(*pWrtShell->GetViewOptions());
+aOpt.SetRedlineRenderMode(SwRedlineRenderMode::OmitDeletes);
+pWrtShell->ApplyViewOptions(aOpt);
+Scheduler::ProcessEventsToIdle();
+aCallback.m_aInvalidationModes.clear();
+
+// When typing a key:
+pWrtShell->Insert(u"x"_ustr);
+pWrtShell->GetSfxViewShell()->flushPendingLOKInvalidateTiles();
+
+// Then make sure that both the "omit inserts" and the "omit deletes" 
modes are invalidated:
+// Without the accompanying fix in place, this test would have failed, 
only the "omit deletes"
+// mode was invalidated.
+
CPPUNIT_ASSERT(aCallback.m_aInvalidationModes.contains(SwRedlineRenderMode::OmitInserts));
+
CPPUNIT_ASSERT(aCallback.m_aInvalidationModes.contains(SwRedlineRenderMode::OmitDeletes));
+
+// Tear down LOK:
+pWrtShell->GetSfxViewShell()

core.git: sw/inc

2025-12-04 Thread Miklos Vajna (via logerrit)
 sw/inc/docufld.hxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit b872dfe4f97ece3e1a52674dd5e3920defc04f10
Author: Miklos Vajna 
AuthorDate: Wed Dec 3 14:15:46 2025 +0100
Commit: Miklos Vajna 
CommitDate: Thu Dec 4 12:41:56 2025 +0100

sw: document SwFileNameField and SwFileNameFieldType

Where to find on the UI, how the shared SwField::m_nFormat is
interpreted for this field.

Change-Id: I149d3f7d9aeb1a663fc73df470f3292161a57665
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194980
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index af8e996abaf8..2a0f5b670896 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -228,6 +228,7 @@ public:
 virtual boolPutValue( const css::uno::Any& rVal, sal_uInt16 nWhich 
) override;
 };
 
+/// Provides the expansion of of an SwFileNameField to a string.
 class SAL_DLLPUBLIC_RTTI SwFileNameFieldType final : public SwFieldType
 {
 SwDoc& m_rDoc;
@@ -238,6 +239,10 @@ public:
 virtual std::unique_ptr Copy() const override;
 };
 
+/// Expands to the current file name. The format is stored in 
SwField::m_nFormat and is interpreted
+/// as an SwFileNameFormat.
+///
+/// 'Insert' -> 'Field' -> 'More Fields' -> 'Document' -> 'File name' on the 
UI.
 class SW_DLLPUBLIC SwFileNameField final : public SwField
 {
 OUString m_aContent;


core.git: sw/inc

2025-12-02 Thread Stephan Bergmann (via logerrit)
 sw/inc/unosett.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1b7fc8a6e8906de0f8206d7416bc8201c8208f6c
Author: Stephan Bergmann 
AuthorDate: Tue Dec 2 16:01:54 2025 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Dec 2 22:54:41 2025 +0100

UBSan apparently needs SwXLineNumberingProperties RTTI now

...seeing CppunitTest_sw_writerfilter_misc failing with

> DynamicLibraryManagerException: "Failed to load dynamic library: 
/home/tdf/lode/jenkins/workspace/lo_ubsan/workdir/LinkTarget/CppunitTest/libtest_sw_writerfilter_misc.so

/home/tdf/lode/jenkins/workspace/lo_ubsan/instdir/program/libsw_writerfilterlo.so:
 undefined symbol: _ZTI26SwXLineNumberingProperties"

()

Change-Id: Iab88c2172dd3aabf80bc7e826576e16620ac2fb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194928
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins

diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx
index 26b0d1aacd18..3a6d51a35644 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -100,7 +100,7 @@ public:
 voidInvalidate() {m_pDoc = nullptr;}
 };
 
-class SwXLineNumberingProperties final : public cppu::WeakImplHelper
+class SAL_DLLPUBLIC_RTTI SwXLineNumberingProperties final : public 
cppu::WeakImplHelper
 <
 css::beans::XPropertySet,
 css::lang::XServiceInfo


core.git: sw/inc sw/source

2025-12-02 Thread Miklos Vajna (via logerrit)
 sw/inc/cellatr.hxx|4 
 sw/inc/cellfml.hxx|2 ++
 sw/inc/expfld.hxx |2 ++
 sw/source/core/attr/cellatr.cxx   |   17 +
 sw/source/core/fields/cellfml.cxx |8 
 sw/source/core/fields/tblcalc.cxx |   13 +
 6 files changed, 46 insertions(+)

New commits:
commit d896b03b0aefee24bcb5c3c07809e59ff6bf1efa
Author: Miklos Vajna 
AuthorDate: Mon Dec 1 08:44:13 2025 +0100
Commit: Miklos Vajna 
CommitDate: Tue Dec 2 10:05:07 2025 +0100

sw doc model xml dump: handle SwTableBoxValue

And same for SwTableBoxFormula and SwTableFormula.

The formula string is a bit scary, "sum <1020213664:1020214688>"
seems to refer to SwTableBox* 0x3ccf39a0 and SwTableBox* 0x3ccf3da0.

SwTableField is similar, but it's a field, although it inherits from the
same SwTableFormula, so the code between the cell property and the field
is nicely shared.

Change-Id: I10d21198eb65630c98e9a666924924cd58a7840d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194902
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/cellatr.hxx b/sw/inc/cellatr.hxx
index a84760f20034..2e9603fb77bf 100644
--- a/sw/inc/cellatr.hxx
+++ b/sw/inc/cellatr.hxx
@@ -92,6 +92,8 @@ public:
 ChgValid(false);
 }
 void Calc( SwTableCalcPara& rCalcPara, double& rValue );
+
+void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
 class SW_DLLPUBLIC SwTableBoxValue final : public SfxPoolItem
@@ -113,6 +115,8 @@ public:
 }
 
 double GetValue() const { return m_nValue; }
+
+void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
 inline const SwTableBoxNumFormat  &SwAttrSet::GetTableBoxNumFormat(bool 
bInP) const
diff --git a/sw/inc/cellfml.hxx b/sw/inc/cellfml.hxx
index a4f6bb2e5366..756e9de571ff 100644
--- a/sw/inc/cellfml.hxx
+++ b/sw/inc/cellfml.hxx
@@ -56,6 +56,7 @@ public:
 void SetLastTableBox( const SwTableBox* pBox ){ m_pLastTableBox = 
pBox; }
 };
 
+typedef struct _xmlTextWriter* xmlTextWriterPtr;
 class SW_DLLPUBLIC SwTableFormula
 {
 typedef void (SwTableFormula::*FnScanFormula)( const SwTable&, OUStringBuffer&,
@@ -145,6 +146,7 @@ public:
 // are all boxes valid which this formula relies on?
 bool HasValidBoxes() const;
 static sal_uInt16 GetLnPosInTable( const SwTable& rTable, const 
SwTableBox* pBox );
+virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index 92bb4c343238..62b501ff160f 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -416,6 +416,8 @@ public:
 virtual voidSetPar2(const OUString& rStr) override;
 virtual boolQueryValue( css::uno::Any& rVal, sal_uInt16 nWhich ) 
const override;
 virtual boolPutValue( const css::uno::Any& rVal, sal_uInt16 nWhich 
) override;
+
+void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
 #endif // INCLUDED_SW_INC_EXPFLD_HXX
diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx
index a14d28a55d2f..e6db5de76dfe 100644
--- a/sw/source/core/attr/cellatr.cxx
+++ b/sw/source/core/attr/cellatr.cxx
@@ -155,6 +155,14 @@ void SwTableBoxFormula::Calc( SwTableCalcPara& rCalcPara, 
double& rValue )
 }
 }
 
+void SwTableBoxFormula::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwTableBoxFormula"));
+SfxPoolItem::dumpAsXml(pWriter);
+SwTableFormula::dumpAsXml(pWriter);
+(void)xmlTextWriterEndElement(pWriter);
+}
+
 SwTableBoxValue::SwTableBoxValue()
 : SfxPoolItem( RES_BOXATR_VALUE ), m_nValue( 0 )
 {
@@ -180,4 +188,13 @@ SwTableBoxValue* SwTableBoxValue::Clone( SfxItemPool* ) 
const
 return new SwTableBoxValue( m_nValue );
 }
 
+void SwTableBoxValue::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwTableBoxValue"));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
+  
BAD_CAST(OString::number(m_nValue).getStr()));
+SfxPoolItem::dumpAsXml(pWriter);
+(void)xmlTextWriterEndElement(pWriter);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/fields/cellfml.cxx 
b/sw/source/core/fields/cellfml.cxx
index 074a1221487c..2a82ed5eee69 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -1095,6 +1095,14 @@ sal_uInt16 SwTableFormula::GetLnPosInTable( const 
SwTable& rTable, const SwTable
 return nRet;
 }
 
+void SwTableFormula::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwTableFormula"));
+(void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", 
this);
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("formula"), 
BAD_CAST(m_sFormu

core.git: sw/inc sw/qa sw/sdi sw/source

2025-12-01 Thread Miklos Vajna (via logerrit)
 sw/inc/cmdid.h|2 ++
 sw/qa/uibase/uiview/uiview.cxx|   27 +++
 sw/sdi/_viewsh.sdi|6 ++
 sw/sdi/swriter.sdi|   18 ++
 sw/source/uibase/uiview/view0.cxx |   20 
 5 files changed, 73 insertions(+)

New commits:
commit 3c4da8d9fc1245b2b48d3b73ee88c29d2c1198ad
Author: Miklos Vajna 
AuthorDate: Mon Dec 1 09:49:25 2025 +0100
Commit: Miklos Vajna 
CommitDate: Mon Dec 1 18:39:28 2025 +0100

cool#13574 sw redline render mode: add uno command to switch from standard

So far a non-standard redline render mode was only available via the LOK
API. Now this UNO command allows to toggle between standard (default)
and ~omit deletes (kind of hide redlines, but only influence the
painting, not the layout).

Dispatching 2 times can be used to turn this on and off, i.e. toggle
works. Also the necessary invalidate is performed, so the content is
repainted with the new view option.

Change-Id: Id303b432179bf503e8073585868a65a314847d47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194884
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index ce9293a0b4ef..4757f9f50174 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -176,6 +176,8 @@ class SwUINumRuleItem;
 
 #define FN_SET_PAGE (FN_VIEW + 29)  /* Set page template to 
paragraph */
 
+#define FN_VIEW_REDLINE_RENDER_MODE (FN_VIEW + 30)
+
 #define FN_PRINT_LAYOUT (FN_VIEW + 37)  /* print layout */
 
 #define FN_SCROLL_NAVIGATION(FN_VIEW + 40)  /* Navigation Controller */
diff --git a/sw/qa/uibase/uiview/uiview.cxx b/sw/qa/uibase/uiview/uiview.cxx
index 4e074abdaa90..0f699341829e 100644
--- a/sw/qa/uibase/uiview/uiview.cxx
+++ b/sw/qa/uibase/uiview/uiview.cxx
@@ -440,6 +440,33 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, 
testReinstateTrackedChangeState)
 CPPUNIT_ASSERT_EQUAL(SfxItemState::DISABLED, eState);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testRedlineRenderModeCommand)
+{
+// Given a document with default view options:
+createSwDoc();
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+SwRedlineRenderMode eActual = 
pWrtShell->GetViewOptions()->GetRedlineRenderMode();
+CPPUNIT_ASSERT_EQUAL(SwRedlineRenderMode::Standard, eActual);
+
+// When toggling redline render mode to omit deletes:
+dispatchCommand(mxComponent, u".uno:RedlineRenderMode"_ustr, {});
+
+// Then make sure the view option is updated:
+eActual = pWrtShell->GetViewOptions()->GetRedlineRenderMode();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 2 (OmitDeletes)
+// - Actual  : 0 (Standard)
+// i.e. the view option wasn't set.
+CPPUNIT_ASSERT_EQUAL(SwRedlineRenderMode::OmitDeletes, eActual);
+
+// And when toggling off:
+dispatchCommand(mxComponent, u".uno:RedlineRenderMode"_ustr, {});
+
+// Then make sure the view option is back to its default:
+eActual = pWrtShell->GetViewOptions()->GetRedlineRenderMode();
+CPPUNIT_ASSERT_EQUAL(SwRedlineRenderMode::Standard, eActual);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index 8c51d3fadef6..5db24b03bc07 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -1003,6 +1003,12 @@ interface BaseTextEditView
 StateMethod = StateViewOptions ;
 ]
 
+FN_VIEW_REDLINE_RENDER_MODE // status()
+[
+ExecMethod = ExecViewOptions ;
+StateMethod = StateViewOptions ;
+]
+
 FN_VIEW_TABLEGRID // status()
 [
 ExecMethod = ExecViewOptions ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 7209b09ed571..2bf53f9ed34c 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -679,6 +679,24 @@ SfxBoolItem ControlCodes FN_VIEW_META_CHARS
 GroupId = SfxGroupId::View;
 ]
 
+SfxBoolItem RedlineRenderMode FN_VIEW_REDLINE_RENDER_MODE
+
+[
+AutoUpdate = TRUE,
+FastCall = FALSE,
+ReadOnlyDoc = TRUE,
+Toggle = FALSE,
+Container = FALSE,
+RecordAbsolute = FALSE,
+RecordPerSet;
+
+
+AccelConfig = TRUE,
+MenuConfig = TRUE,
+ToolBoxConfig = TRUE,
+GroupId = SfxGroupId::View;
+]
+
 SfxVoidItem ConvertTableText FN_CONVERT_TEXT_TABLE
 ()
 [
diff --git a/sw/source/uibase/uiview/view0.cxx 
b/sw/source/uibase/uiview/view0.cxx
index 4307b942dd93..0ee6dab7bf72 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -267,6 +267,11 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
 aBool.SetValue( lcl_IsViewMarks(*pOpt) ); break;
 case FN_VIEW_META_CHARS:
 aBool.SetValue( pOpt->IsViewMetaChars() ); break;
+case FN_VIEW_REDLINE_RENDER_MODE:
+{
+aBool.SetValue(pOpt->GetRedlineRenderMode(

core.git: sw/inc

2025-12-01 Thread Stephan Bergmann (via logerrit)
 sw/inc/unocoll.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9461a6a1cd8f54ffe94f7165551d44051f236288
Author: Stephan Bergmann 
AuthorDate: Mon Dec 1 16:18:36 2025 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Dec 1 17:56:17 2025 +0100

UBSan apparently needs SwXFrames and SwXTextSections RTTI now

...seeing CppunitTest_sw_uiwriter8 failing with

> warn:sal.osl:2288248:2288248:sal/osl/unx/module.cxx:103: 
dlopen(/home/sberg/lo/core/instdir/program/libsw_writerfilterlo.so, 257): 
/home/sberg/lo/core/instdir/program/libsw_writerfilterlo.so: undefined symbol: 
_ZTI9SwXFrames

and

> warn:sal.osl:2291977:2291977:sal/osl/unx/module.cxx:103: 
dlopen(/home/sberg/lo/core/instdir/program/libswuilo.so, 257): 
/home/sberg/lo/core/instdir/program/libswuilo.so: undefined symbol: 
_ZTI15SwXTextSections

Change-Id: Iffd0b1b40f3b8196b8912e1c6157bb7194f58dc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194892
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx
index c620f9e77fc4..fbb402d9a3ff 100644
--- a/sw/inc/unocoll.hxx
+++ b/sw/inc/unocoll.hxx
@@ -304,7 +304,7 @@ cppu::WeakImplHelper
 css::lang::XServiceInfo
 > SwXFramesBaseClass;
 
-class SwXFrames : public SwXFramesBaseClass,
+class SAL_DLLPUBLIC_RTTI SwXFrames : public SwXFramesBaseClass,
 public SwUnoCollection
 {
 const FlyCntTypem_eType;
@@ -374,7 +374,7 @@ public:
 
 };
 
-class SwXTextSections final : public SwCollectionBaseClass,
+class SAL_DLLPUBLIC_RTTI SwXTextSections final : public SwCollectionBaseClass,
 public SwUnoCollection
 {
 virtual ~SwXTextSections() override;


core.git: sw/inc sw/source

2025-12-01 Thread Noel Grandin (via logerrit)
 sw/inc/unocoll.hxx |2 +-
 sw/source/writerfilter/dmapper/StyleSheetTable.cxx |5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 2a141122eada200c2f55eefdc71bc54ec6f933e8
Author: Noel Grandin 
AuthorDate: Mon Dec 1 09:41:33 2025 +0200
Commit: Noel Grandin 
CommitDate: Mon Dec 1 10:53:27 2025 +0100

use more concrete UNO in StyleSheetTable

Change-Id: I532cbab01c514b83eec1161df26487205299585f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194852
Reviewed-by: Noel Grandin 
Tested-by: Jenkins

diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx
index c115254ade50..40ed1e61e776 100644
--- a/sw/inc/unocoll.hxx
+++ b/sw/inc/unocoll.hxx
@@ -313,7 +313,7 @@ public:
 SwXFrames(SwDoc* pDoc, FlyCntType eSet);
 
 //XEnumerationAccess
-virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL 
createEnumeration() override;
+virtual SW_DLLPUBLIC css::uno::Reference< css::container::XEnumeration > 
SAL_CALL createEnumeration() override;
 
 //XIndexAccess
 virtual sal_Int32 SAL_CALL getCount() override;
diff --git a/sw/source/writerfilter/dmapper/StyleSheetTable.cxx 
b/sw/source/writerfilter/dmapper/StyleSheetTable.cxx
index b3a63416ab5a..8cbc5e92e6cf 100644
--- a/sw/source/writerfilter/dmapper/StyleSheetTable.cxx
+++ b/sw/source/writerfilter/dmapper/StyleSheetTable.cxx
@@ -59,6 +59,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -1023,7 +1024,7 @@ void StyleSheetTable::ApplyClonedTOCStyles()
 // text frames
 if (!m_xTextDocument)
 throw uno::RuntimeException();
-uno::Reference const 
xFrames(m_xTextDocument->getTextFrames(), uno::UNO_QUERY_THROW);
+rtl::Reference const 
xFrames(m_xTextDocument->getSwTextFrames());
 uno::Reference const 
xFramesEnum(xFrames->createEnumeration());
 while (xFramesEnum->hasMoreElements())
 {
@@ -1031,7 +1032,7 @@ void StyleSheetTable::ApplyClonedTOCStyles()
 ApplyClonedTOCStylesToXText(xFrame);
 }
 // body
-uno::Reference const xBody(m_xTextDocument->getText());
+rtl::Reference const xBody(m_xTextDocument->getBodyText());
 ApplyClonedTOCStylesToXText(xBody);
 }
 


core.git: sw/inc sw/source

2025-11-30 Thread Noel Grandin (via logerrit)
 sw/inc/unocoll.hxx|1 +
 sw/source/core/unocore/unocoll.cxx|8 ++--
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |   12 ++--
 3 files changed, 13 insertions(+), 8 deletions(-)

New commits:
commit c3088c9a8be4fa553f07be3f5e26dc39389aa513
Author: Noel Grandin 
AuthorDate: Sun Nov 30 13:28:41 2025 +0200
Commit: Noel Grandin 
CommitDate: Sun Nov 30 20:48:53 2025 +0100

use more concrete UNO in UpdateTree

Change-Id: I9767e26456096f9ac01d6c396ee1ab55e183ec43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194841
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx
index f9f3261d298b..c115254ade50 100644
--- a/sw/inc/unocoll.hxx
+++ b/sw/inc/unocoll.hxx
@@ -399,6 +399,7 @@ public:
 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() 
override;
 
 SW_DLLPUBLIC rtl::Reference getSwTextSectionByName(const 
OUString& Name);
+rtl::Reference getSwTextSectionByIndex(sal_Int32 nIndex);
 };
 
 class SwXBookmarks final : public SwCollectionBaseClass,
diff --git a/sw/source/core/unocore/unocoll.cxx 
b/sw/source/core/unocore/unocoll.cxx
index 2ce0d3e2f269..4789297bc8ce 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -1370,6 +1370,11 @@ sal_Int32 SwXTextSections::getCount()
 }
 
 uno::Any SwXTextSections::getByIndex(sal_Int32 nIndex)
+{
+return 
Any(css::uno::Reference(getSwTextSectionByIndex(nIndex)));
+}
+
+rtl::Reference 
SwXTextSections::getSwTextSectionByIndex(sal_Int32 nIndex)
 {
 if (nIndex < 0)
 throw IndexOutOfBoundsException();
@@ -1383,8 +1388,7 @@ uno::Any SwXTextSections::getByIndex(sal_Int32 nIndex)
 if( !rSectFormats[i]->IsInNodesArr())
 nIndex2++;
 else if (nIndex2 == i)
-return Any(css::uno::Reference(
-SwXTextSection::CreateXTextSection(rSectFormats[i])));
+return SwXTextSection::CreateXTextSection(rSectFormats[i]);
 }
 throw IndexOutOfBoundsException();
 }
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx 
b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index e8eb46377abd..23747a064fd9 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -24,6 +24,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -692,14 +694,12 @@ static void UpdateTree(SwDocShell& rDocSh, const 
SwEditShell& rEditSh,
 }
 
 // Collect sections at character position
-uno::Reference 
xTextSections(pSwTextDocument->getTextSections(),
-  uno::UNO_QUERY);
+rtl::Reference 
xTextSections(pSwTextDocument->getSwTextSections());
 for (sal_Int32 i = 0; i < xTextSections->getCount(); ++i)
 {
 svx::sidebar::TreeNode aCurNode;
-uno::Reference section;
-xTextSections->getByIndex(i) >>= section;
-uno::Reference xTextSection(section, 
uno::UNO_QUERY);
+rtl::Reference section = 
xTextSections->getSwTextSectionByIndex(i);
+uno::Reference xTextSection(section);
 
 try
 {
@@ -710,7 +710,7 @@ static void UpdateTree(SwDocShell& rDocSh, const 
SwEditShell& rEditSh,
 && xTextRangeCompare->compareRegionStarts(sectionRange, 
xRange) != -1
 && xTextRangeCompare->compareRegionEnds(xRange, sectionRange) 
!= -1)
 {
-aCurNode.sNodeName = xTextSection->getName();
+aCurNode.sNodeName = section->getName();
 aCurNode.NodeType = svx::sidebar::TreeNode::ComplexProperty;
 
 MetadataToTreeNode(xTextSection, aCurNode);


core.git: sw/inc sw/qa sw/source

2025-11-28 Thread Miklos Vajna (via logerrit)
 sw/inc/swmodule.hxx   |5 +--
 sw/qa/core/text/itrpaint.cxx  |   61 +++---
 sw/source/core/text/itrpaint.cxx  |   31 ---
 sw/source/core/text/redlnitr.cxx  |   16 -
 sw/source/core/text/txtfld.cxx|4 +-
 sw/source/core/text/txtftn.cxx|5 +--
 sw/source/uibase/app/swmodul1.cxx |   33 +---
 7 files changed, 101 insertions(+), 54 deletions(-)

New commits:
commit b3656a81b40bd5012d6e9a52527e241cd6586571
Author: Miklos Vajna 
AuthorDate: Thu Nov 27 08:38:13 2025 +0100
Commit: Miklos Vajna 
CommitDate: Sat Nov 29 08:21:02 2025 +0100

cool#13574 sw lok: improve non-standard redline render mode colors

Instead of completely omitting insertions and deletions when requested,
just de-saturate the original colors when the content is to be
semi-hidden.

Do this by undoing the changes to SwTextPainter::DrawTextLine() and
instead let SwModule::GetInsertAuthorAttr() /
SwModule::GetDeletedAuthorAttr() decide if the standard rendering for
that redline is OK or we want a custom color.

If we want something custom, then halve the saturation in
lcl_FillAuthorAttr() to paint it semi-hidden.

Also adapt the testcase, to check the saturation instead of the number
of painted strings.

Change-Id: I62362463bd1b6d6968a503c802e17a56a1aea1b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194774
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index d860b75f62af..d3a42be17ba5 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -70,6 +70,7 @@ namespace com::sun::star::linguistic2 { class 
XLanguageGuessing; }
 namespace ooo::vba { class XSinkCaller; }
 class SwLinguServiceEventListener;
 class SwTableAutoFormatTable;
+enum class SwRedlineRenderMode;
 
 class SAL_DLLPUBLIC_RTTI SwModule final : public SfxModule, public 
SfxListener, public utl::ConfigurationListener
 {
@@ -207,8 +208,8 @@ public:
 std::size_t InsertRedlineAuthor(const OUString& rAuthor);
 SW_DLLPUBLIC void   SetRedlineAuthor(const OUString& rAuthor); // for unit 
tests
 
-voidGetInsertAuthorAttr(std::size_t nAuthor, SfxItemSet 
&rSet);
-voidGetDeletedAuthorAttr(std::size_t nAuthor, SfxItemSet 
&rSet);
+voidGetInsertAuthorAttr(std::size_t nAuthor, SfxItemSet 
&rSet, SwRedlineRenderMode eMode);
+voidGetDeletedAuthorAttr(std::size_t nAuthor, SfxItemSet 
&rSet, SwRedlineRenderMode eMode);
 voidGetFormatAuthorAttr(std::size_t nAuthor, SfxItemSet 
&rSet);
 
 sal_uInt16  GetRedlineMarkPos() const;
diff --git a/sw/qa/core/text/itrpaint.cxx b/sw/qa/core/text/itrpaint.cxx
index 6f08dfc82a89..7eaed14187c8 100644
--- a/sw/qa/core/text/itrpaint.cxx
+++ b/sw/qa/core/text/itrpaint.cxx
@@ -11,6 +11,8 @@
 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -27,9 +29,21 @@ public:
 }
 };
 
+/// #RRGGBB -> HSL saturation.
+sal_Int16 GetColorSaturation(std::u16string_view rRGB)
+{
+Color aColor(o3tl::toInt32(rRGB.substr(1, 2), 16), 
o3tl::toInt32(rRGB.substr(3, 2), 16),
+ o3tl::toInt32(rRGB.substr(5, 2), 16));
+sal_uInt16 nHue;
+sal_uInt16 nSaturation;
+sal_uInt16 nBrightness;
+aColor.RGBtoHSB(nHue, nSaturation, nBrightness);
+return nSaturation;
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testRedlineRenderModeOmitInsertDelete)
 {
-// Default rendering:
+// Default rendering: default, normal saturation, normal saturation.
 createSwDoc("redline.docx");
 
 SwDocShell* pDocShell = getSwDocShell();
@@ -42,14 +56,23 @@ CPPUNIT_TEST_FIXTURE(Test, 
testRedlineRenderModeOmitInsertDelete)
 sal_Int32 nIndex1 = getXPath(pXmlDoc, "(//textarray)[1]", 
"index").toInt32();
 sal_Int32 nLength1 = getXPath(pXmlDoc, "(//textarray)[1]", 
"length").toInt32();
 CPPUNIT_ASSERT_EQUAL(u"baseline "_ustr, aContent.copy(nIndex1, nLength1));
+OUString aColor1
+= getXPath(pXmlDoc, 
"(//textarray)[1]/preceding-sibling::textcolor[1]", "color");
+CPPUNIT_ASSERT_EQUAL(u"#00"_ustr, aColor1);
 sal_Int32 nIndex2 = getXPath(pXmlDoc, "(//textarray)[2]", 
"index").toInt32();
 sal_Int32 nLength2 = getXPath(pXmlDoc, "(//textarray)[2]", 
"length").toInt32();
 CPPUNIT_ASSERT_EQUAL(u"oldcontent"_ustr, aContent.copy(nIndex2, nLength2));
+OUString aColor2
+= getXPath(pXmlDoc, 
"(//textarray)[2]/preceding-sibling::textcolor[1]", "color");
+CPPUNIT_ASSERT_GREATER(static_cast(50), 
GetColorSaturation(aColor2));
 sal_Int32 nIndex3 = getXPath(pXmlDoc, "(//textarray)[3]", 
"index").toInt32();
 sal_Int32 nLength3 = getXPath(pXmlDoc, "(//textarray)[3]", 
"length").toInt32();
 CPPUNIT_ASSERT_EQUAL(u"newcontent"_ustr, aContent.copy(nIndex3, nLength3));
+OUString aColor3
+= getXPath(pXmlDoc, 
"(//textarray)[3]/prec

core.git: sw/inc

2025-11-28 Thread Szymon Kłos (via logerrit)
 sw/inc/strings.hrc |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 35c14f05061f9c32dfd66cacab33b1874a7e5d68
Author: Szymon Kłos 
AuthorDate: Tue Nov 25 07:02:47 2025 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Fri Nov 28 09:01:53 2025 +0100

tdf#169531 QuickFindPanel: Make result label shorter

Followup for commit 5a600355080b6b66842e07d22f14e89b161f1c00
tdf#169531 QuickFindPanel: Make result label shorter and easier to scan

It unifies the singular form in case of only one entry.

Change-Id: I6e629b12838c32497d17397243518e91fdbb4a60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194505
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Jenkins

diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 65aae7f8d4f2..7fb72a1d2840 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -1432,7 +1432,7 @@
 #define STR_EDIT_FOOTNOTE   NC_("STR_EDIT_FOOTNOTE", "Edit 
Footnote/Endnote")
 #define STR_NB_REPLACED NC_("STR_NB_REPLACED", "Search 
key replaced XX times.")
 #define STR_SEARCH_KEY_FOUND_TIMES  
NNC_("STR_SEARCH_KEY_FOUND_TIMES", "One match found.", "%1 results")
-#define STR_SEARCH_KEY_FOUND_XOFN   
NNC_("STR_SEARCH_KEY_FOUND_XOFN", "Match one of one match found.", "Result %1 
of %2")
+#define STR_SEARCH_KEY_FOUND_XOFN   
NNC_("STR_SEARCH_KEY_FOUND_XOFN", "One match found.", "Result %1 of %2")
 #define STR_SRCVIEW_ROW NC_("STR_SRCVIEW_ROW", "Row ")
 #define STR_SRCVIEW_COL NC_("STR_SRCVIEW_COL", "Column 
")
 #define STR_SAVEAS_SRC  NC_("STR_SAVEAS_SRC", "~Export 
source...")


core.git: sw/inc sw/qa sw/source

2025-11-26 Thread codemaestro (via logerrit)
 sw/inc/docstat.hxx   |   24 +++
 sw/qa/core/uwriter.cxx   |  118 +++
 sw/source/core/bastyp/calc.cxx   |   23 +++
 sw/source/filter/xml/xmlmeta.cxx |   32 --
 4 files changed, 95 insertions(+), 102 deletions(-)

New commits:
commit 6cbb7ae346966bc3f568972ce9ce0dd6e232a1c4
Author: codemaestro 
AuthorDate: Wed Nov 5 15:15:05 2025 +0530
Commit: Ilmari Lauhakangas 
CommitDate: Thu Nov 27 08:45:15 2025 +0100

tdf#114441: Convert use of sal_uLong to sal_uInt32

Using sal_uInt32 safely covers all possible counts.

Change-Id: Ia80747d21b1f84541693cfff44bfcc8891544b00
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193370
Reviewed-by: Hossein 
Code-Style: Hossein 
Tested-by: Jenkins

diff --git a/sw/inc/docstat.hxx b/sw/inc/docstat.hxx
index ba01ac57c220..16b017f9262e 100644
--- a/sw/inc/docstat.hxx
+++ b/sw/inc/docstat.hxx
@@ -23,20 +23,20 @@
 
 struct SW_DLLPUBLIC SwDocStat
 {
-sal_uInt16  nTable;
-sal_uInt16  nGrf;
-sal_uInt16  nOLE;
-sal_uLong   nPage;
+sal_uInt32  nTable;
+sal_uInt32  nGrf;
+sal_uInt32  nOLE;
+sal_uInt32  nPage;
 /// paragraphs for document statistic: non-empty and non-hidden ones
-sal_uLong   nPara;
+sal_uInt32   nPara;
 /// all paragraphs, including empty/hidden ones
-sal_uLong   nAllPara;
-sal_uLong   nWord;
-sal_uLong   nAsianWord;
-sal_uLong   nChar;
-sal_uLong   nCharExcludingSpaces;
-sal_uLong   nComments;
-boolbModified;
+sal_uInt32  nAllPara;
+sal_uInt32  nWord;
+sal_uInt32  nAsianWord;
+sal_uInt32  nChar;
+sal_uInt32  nCharExcludingSpaces;
+sal_uInt32  nComments;
+boolbModified;
 
 SwDocStat();
 void Reset();
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 9a2d06845394..b0f866386f23 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -261,7 +261,7 @@ void SwDocTest::testFileNameFields()
 //motivation
 void SwDocTest::testDocStat()
 {
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Expected initial 0 count", 
static_cast(0), m_pDoc->getIDocumentStatistics().GetDocStat().nChar);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Expected initial 0 count", 
static_cast(0), 
m_pDoc->getIDocumentStatistics().GetDocStat().nChar);
 
 SwNodeIndex aIdx(m_pDoc->GetNodes().GetEndOfContent(), -1);
 SwPaM aPaM(aIdx);
@@ -269,10 +269,10 @@ void SwDocTest::testDocStat()
 OUString sText(u"Hello World"_ustr);
 m_pDoc->getIDocumentContentOperations().InsertString(aPaM, sText);
 
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Should still be non-updated 0 count", 
static_cast(0), m_pDoc->getIDocumentStatistics().GetDocStat().nChar);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Should still be non-updated 0 count", 
static_cast(0), 
m_pDoc->getIDocumentStatistics().GetDocStat().nChar);
 
 SwDocStat aDocStat = m_pDoc->getIDocumentStatistics().GetUpdatedDocStat( 
false, true );
-sal_uLong nLen = static_cast(sText.getLength());
+sal_uInt32 nLen = static_cast(sText.getLength());
 
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Should now have updated count", nLen, 
aDocStat.nChar);
 
@@ -628,8 +628,8 @@ void SwDocTest::testSwScanner()
 pTextNode = aPaM.GetPointNode().GetTextNode();
 pTextNode->CountWords(aDocStat, 0, IDEOGRAPHICFULLSTOP_D.getLength());
 
-CPPUNIT_ASSERT_EQUAL(static_cast(2), aDocStat.nChar);
-CPPUNIT_ASSERT_EQUAL(static_cast(2), 
aDocStat.nCharExcludingSpaces);
+CPPUNIT_ASSERT_EQUAL(static_cast(2), aDocStat.nChar);
+CPPUNIT_ASSERT_EQUAL(static_cast(2), 
aDocStat.nCharExcludingSpaces);
 }
 {
 static constexpr OUString test =
@@ -660,10 +660,10 @@ void SwDocTest::testSwScanner()
 SwDocStat aDocStat;
 pTextNode = aPaM.GetPointNode().GetTextNode();
 pTextNode->CountWords(aDocStat, 0, test.getLength());
-CPPUNIT_ASSERT_EQUAL_MESSAGE("words", static_cast(58), 
aDocStat.nWord);
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Asian characters and Korean words", 
static_cast(43), aDocStat.nAsianWord);
-CPPUNIT_ASSERT_EQUAL_MESSAGE("non-whitespace chars", 
static_cast(105), aDocStat.nCharExcludingSpaces);
-CPPUNIT_ASSERT_EQUAL_MESSAGE("characters", 
static_cast(128), aDocStat.nChar);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("words", static_cast(58), 
aDocStat.nWord);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Asian characters and Korean words", 
static_cast(43), aDocStat.nAsianWord);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("non-whitespace chars", 
static_cast(105), aDocStat.nCharExcludingSpaces);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("characters", 
static_cast(128), aDocStat.nChar);
 }
 
 //See https://bz.apache.org/ooo/show_bug.cgi?id=89042
@@ -680,7 +680,7 @@ void SwDo

core.git: sw/inc sw/qa sw/source

2025-11-25 Thread David Hashe (via logerrit)
 sw/inc/doc.hxx |4 -
 sw/qa/core/undo/undo.cxx   |  109 +
 sw/source/core/inc/SwUndoPageDesc.hxx  |3 
 sw/source/core/inc/UndoAttribute.hxx   |1 
 sw/source/core/undo/SwUndoPageDesc.cxx |  108 
 sw/source/core/undo/unattr.cxx |   28 
 6 files changed, 251 insertions(+), 2 deletions(-)

New commits:
commit 6de1b56c576cafae0d9ee027f037e45533983a5b
Author: David Hashe 
AuthorDate: Thu Nov 20 18:11:33 2025 -0500
Commit: Mike Kaganski 
CommitDate: Tue Nov 25 19:45:03 2025 +0100

tdf#148703 Re-apply page desc to nodes when undoing

Creating and deleting page descs was not interacting well
with undo/redo. Redoing the creation or undoing the deletion
of a page desc did not restore it to the nodes that
previously had it, nor did it restore the page desc as the
follow to any other page descs that it previously followed.

This patch does four related things:

1) make SwUndoPageDescCreate do a linear scan of the undo
   nodes and record which nodes this page desc will apply
   to, and then make those nodes use the new page desc on
   redo
2) make SwUndoAttr look up page descs by UIName, so that it
   finds and is able to apply the recreated page desc (this
   class already did something similar for char styles).
3) make SwUndoPageDescDelete do a linear scan (linear in
   number of pages) of the document nodes and record which
   nodes this page desc applies do, and then make those
   nodes use the new page desc on undo
4) make SwUndoPageDescDelete record which other page descs
   in the document have this page desc as a follow, and then
   make those page desc use the new page desc as the follow
   on undo

Together, these changes make page descs play nice with
undo/redo.

This is necessary to complete tdf#148703 because a part of
that bug involves undoing and redoing the creation of a page
desc.

Testing:

CPPUNIT_TEST_NAME="SwCoreUndoTest testPageDescCreate" make 
CppunitTest_sw_core_undo
CPPUNIT_TEST_NAME="SwCoreUndoTest testPageDescDelete" make 
CppunitTest_sw_core_undo

I have also manually tested against the example docs from
this comment:

https://bugs.documentfoundation.org/show_bug.cgi?id=148703#c0

Change-Id: Ic80454bb364e45999bb8e92462eca473c5d1a328
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194295
Reviewed-by: Mike Kaganski 
Code-Style: Mike Kaganski 
Tested-by: Jenkins

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 3ee03fbe31f1..aaaccc335651 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -922,8 +922,8 @@ public:
 // For Reader
 SW_DLLPUBLIC void ChgPageDesc( const UIName & rName, const SwPageDesc& );
 SW_DLLPUBLIC void ChgPageDesc( size_t i, const SwPageDesc& );
-void DelPageDesc( const UIName & rName, bool bBroadcast = false);
-void DelPageDesc( size_t i, bool bBroadcast = false );
+SW_DLLPUBLIC void DelPageDesc( const UIName & rName, bool bBroadcast = 
false );
+SW_DLLPUBLIC void DelPageDesc( size_t i, bool bBroadcast = false );
 void PreDelPageDesc(SwPageDesc const * pDel);
 SW_DLLPUBLIC SwPageDesc* MakePageDesc(const UIName &rName, const 
SwPageDesc* pCpy = nullptr,
  bool bRegardLanguage = true);
diff --git a/sw/qa/core/undo/undo.cxx b/sw/qa/core/undo/undo.cxx
index ad8eeed2a27d..4ac1f0fe251a 100644
--- a/sw/qa/core/undo/undo.cxx
+++ b/sw/qa/core/undo/undo.cxx
@@ -17,6 +17,10 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 
 /// Covers sw/source/core/undo/ fixes.
 class SwCoreUndoTest : public SwModelTestBase
@@ -230,6 +234,111 @@ CPPUNIT_TEST_FIXTURE(SwCoreUndoTest, 
testTdf148703CopyFooterAcrossDocuments)
 xText->insertString(xCursor, u"test"_ustr, /*bAbsorb=*/false);
 }
 
+static const SwPageDesc* lcl_getLastPagePageDesc(SwDoc& rDoc)
+{
+SwRootFrame* pRootFrame = rDoc.GetAllLayouts()[0];
+const SwPageFrame* pPageFrameIter = pRootFrame->GetLastPage();
+const SwContentFrame* pContentFrame = 
pPageFrameIter->FindFirstBodyContent();
+const SwFormatPageDesc& rFormatPageDesc = pContentFrame->GetPageDescItem();
+const sw::BroadcastingModify* pMod = rFormatPageDesc.GetDefinedIn();
+
+if (auto pContentNode = dynamic_cast(pMod))
+return pContentNode->GetAttr(RES_PAGEDESC).GetPageDesc();
+
+return nullptr;
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreUndoTest, testPageDescDelete)
+{
+createSwDoc();
+
+SwDoc* pDoc = getSwDoc();
+
+// Create two custom page descs such that a page using customPageDesc1 
would be followed
+// by a page containing customPageDesc2, and then set the second page of 
the document
+// to use customPageDesc2. (the first page just uses the default page desc)
+
+SwPageDesc* pOldPageDesc2 = pDoc->Make

core.git: sw/inc sw/qa sw/source

2025-11-25 Thread David Hashe (via logerrit)
 sw/inc/strings.hrc  |1 
 sw/inc/swundo.hxx   |1 
 sw/inc/undobj.hxx   |   22 ++
 sw/qa/core/undo/data/tdf148703-dest.odt |binary
 sw/qa/core/undo/data/tdf148703-src.odt  |binary
 sw/qa/core/undo/undo.cxx|   33 ++
 sw/source/core/doc/docfmt.cxx   |6 +
 sw/source/core/undo/undobj.cxx  |3 
 sw/source/core/undo/untblk.cxx  |  103 
 9 files changed, 169 insertions(+)

New commits:
commit 68e1db614c8618f0155d157cb1dc4c6f259b8573
Author: David Hashe 
AuthorDate: Tue May 20 10:53:08 2025 -0400
Commit: Mike Kaganski 
CommitDate: Tue Nov 25 19:44:43 2025 +0100

tdf#148703 Fix Writer crash on undo after paste

When copy/pasting a selection from a source document with a
custom page style and a header/footer over a selection in a
destination document that does not have that custom page
style, the undo information was not recording the insertion
of the header/footer nodes into the destination document.

Then, when undoing the copy/paste, the header/footer nodes
remained in the destination document and messed up the
absolute indexing of the insertion point of the overwritten
destination selection, so re-inserting the destination
selection during the undo causes a crash.

This change modifies SwDoc::CopyPageDescHeaderFooterImpl to
record the insertion of the header/footer nodes so that they
are correctly undone and don't mess up the indexing.

This requires a new undo class SwUndoCopyHeaderFooter.

There is still a bit of work needed after this change; the
custom page style will be recreated correctly, but it still
will not be applied to the pages that should have it in the
destination document after the copy is undone and then
redone. See the ticket for more details.

Test plan:

I added a regression test based on a pair of minimal docs:

CPPUNIT_TEST_NAME="SwCoreUndoTest testTdf148703CopyFooterAcrossDocuments" 
make CppunitTest_sw_core_undo

I have also manually tested against the example docs from
this comment:

https://bugs.documentfoundation.org/show_bug.cgi?id=148703#c0

Change-Id: I8a07cd0bff45c50487d61953b1f66cd7c05905dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185940
Code-Style: Mike Kaganski 
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 135b7e1b9759..65aae7f8d4f2 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -495,6 +495,7 @@
 #define STR_ACCEPT_REDLINE  NC_("STR_ACCEPT_REDLINE", 
"Accept change: $1")
 #define STR_REJECT_REDLINE  NC_("STR_REJECT_REDLINE", 
"Reject change: $1")
 #define STR_REINSTATE_REDLINE   NC_("STR_REINSTATE_REDLINE", 
"Reject but track change: $1")
+#define STR_UNDO_COPY_HEADER_FOOTER 
NC_("STR_UNDO_COPY_HEADER_FOOTER", "Undo copy header or footer content")
 #define STR_SPLIT_TABLE NC_("STR_SPLIT_TABLE", "Split 
Table")
 #define STR_DONTEXPAND  NC_("STR_DONTEXPAND", "Stop 
attribute")
 #define STR_AUTOCORRECT NC_("STR_AUTOCORRECT", 
"AutoCorrect")
diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx
index 11255e7966cd..e19622a4f783 100644
--- a/sw/inc/swundo.hxx
+++ b/sw/inc/swundo.hxx
@@ -184,6 +184,7 @@ enum class SwUndoId
 MAKE_ENDNOTES_FOOTNOTES = 152,
 CONVERT_FIELD_TO_TEXT = 153,
 REINSTATE_REDLINE = 154,
+COPY_HEADER_FOOTER = 155,
 };
 
 OUString GetUndoComment(SwUndoId eId);
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index 885db7221593..93de6b198a87 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -295,6 +295,28 @@ public:
 SwUndoCpyDoc( const SwPaM& );
 };
 
+/// Undo for copying a header or footer from one document into another.
+/// This needs special handling because undoing the copy needs to completely
+/// remove it from the doc nodes; in other cases the header/footer content
+/// is just left in the doc nodes.
+class SwUndoCopyHeaderFooter final : public SwUndo, private SwUndoSaveSection
+{
+SwNodeOffset m_aOff;
+UIName m_aFmtName;
+
+bool m_bIsHeader;
+bool m_bIsMaster;
+bool m_bIsLeft;
+bool m_bIsFirstMaster;
+bool m_bIsFirstLeft;
+
+public:
+SwUndoCopyHeaderFooter(SwDoc& rDoc, SwNode& rSttNd, const UIName& 
rFmtName);
+
+virtual void UndoImpl(::sw::UndoRedoContext & rContext) override;
+virtual void RedoImpl(::sw::UndoRedoContext & rContext) override;
+};
+
 class SwUndoFlyBase : public SwUndo, private SwUndoSaveSection
 {
 protected:
diff --git a/sw/qa/core/undo/data/tdf148703-dest.odt 
b/sw/qa/core/undo/data/tdf148703-dest.odt
new file mode 100644
index ..29b32ea74437
Binary files /dev/null and b/sw/qa/core/undo/data/tdf148703-dest.o

core.git: sw/inc

2025-11-25 Thread Mike Kaganski (via logerrit)
 sw/inc/grfatr.hxx |   13 ++---
 1 file changed, 2 insertions(+), 11 deletions(-)

New commits:
commit 11640778262504f3575e97ceee1a02eee908c0f5
Author: Mike Kaganski 
AuthorDate: Mon Nov 24 20:25:04 2025 +0100
Commit: Mike Kaganski 
CommitDate: Tue Nov 25 15:17:39 2025 +0100

Drop a MSVC hack

Introduced in commit 5e3cca7b0ae81e2467fb306c1c707f6f5ba7d284
(More workaround for the MSVC "dllpublic base template" mis-
feature, 2017-03-17).

Seems to not affect MSVC 2022 anymore?

Change-Id: I1b3e8899b2fbdf643fb184eb7949303b2498ea40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194480
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins
Code-Style: Mike Kaganski 

diff --git a/sw/inc/grfatr.hxx b/sw/inc/grfatr.hxx
index 5eacf5d48004..7b2424d82928 100644
--- a/sw/inc/grfatr.hxx
+++ b/sw/inc/grfatr.hxx
@@ -261,21 +261,12 @@ public:
 sal_uInt8 nMemberId ) override;
 };
 
-// MSVC hack:
-class SwDrawModeGrf_Base: public SfxEnumItem {
-protected:
-SwDrawModeGrf_Base(GraphicDrawMode nMode):
-SfxEnumItem(RES_GRFATR_DRAWMODE, nMode) {}
-
-virtual SfxItemType ItemType() const override = 0;
-};
-
-class SW_DLLPUBLIC SwDrawModeGrf final : public SwDrawModeGrf_Base
+class SW_DLLPUBLIC SwDrawModeGrf final : public SfxEnumItem
 {
 public:
 DECLARE_ITEM_TYPE_FUNCTION(SwDrawModeGrf)
 SwDrawModeGrf( GraphicDrawMode nMode = GraphicDrawMode::Standard )
-: SwDrawModeGrf_Base( nMode )
+: SfxEnumItem(RES_GRFATR_DRAWMODE, nMode)
 {}
 
 // pure virtual methods of SfxPoolItem


core.git: sw/inc

2025-11-24 Thread Pedro Pinto Silva (via logerrit)
 sw/inc/strings.hrc |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5a600355080b6b66842e07d22f14e89b161f1c00
Author: Pedro Pinto Silva 
AuthorDate: Fri Aug 15 13:30:16 2025 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Nov 24 10:45:20 2025 +0100

tdf#169531 QuickFindPanel: Make result label shorter and easier to scan

- Shorten the sentence
- Remove full stop. It's a short label without element immediately
  after or before so the full stop seem unnecessary and a visual clutter
- Remove "found" as it's over-verbose and it seems to be obvious that
  what was matched was found.
- Use result instead of match: Users think in terms of "results" when
searching and not "matches" or what was "matched"

Signed-off-by: Pedro Pinto Silva 
Change-Id: I3da73acf482741c470df90f7459d50f6ff1255e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189683
Reviewed-by: Andras Timar 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194156
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 63bfd5e8363a..135b7e1b9759 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -1430,8 +1430,8 @@
 #define STR_NUM_OUTLINE NC_("STR_NUM_OUTLINE", 
"Outline ")
 #define STR_EDIT_FOOTNOTE   NC_("STR_EDIT_FOOTNOTE", "Edit 
Footnote/Endnote")
 #define STR_NB_REPLACED NC_("STR_NB_REPLACED", "Search 
key replaced XX times.")
-#define STR_SEARCH_KEY_FOUND_TIMES  
NNC_("STR_SEARCH_KEY_FOUND_TIMES", "One match found.", "%1 matches found.")
-#define STR_SEARCH_KEY_FOUND_XOFN   
NNC_("STR_SEARCH_KEY_FOUND_XOFN", "Match one of one match found.", "Match %1 of 
%2 matches found.")
+#define STR_SEARCH_KEY_FOUND_TIMES  
NNC_("STR_SEARCH_KEY_FOUND_TIMES", "One match found.", "%1 results")
+#define STR_SEARCH_KEY_FOUND_XOFN   
NNC_("STR_SEARCH_KEY_FOUND_XOFN", "Match one of one match found.", "Result %1 
of %2")
 #define STR_SRCVIEW_ROW NC_("STR_SRCVIEW_ROW", "Row ")
 #define STR_SRCVIEW_COL NC_("STR_SRCVIEW_COL", "Column 
")
 #define STR_SAVEAS_SRC  NC_("STR_SAVEAS_SRC", "~Export 
source...")


core.git: sw/inc

2025-11-21 Thread Miklos Vajna (via logerrit)
 sw/inc/reffld.hxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 7275d86ed5e52b775393447880411e847f600e6f
Author: Miklos Vajna 
AuthorDate: Fri Nov 21 09:19:57 2025 +0100
Commit: Miklos Vajna 
CommitDate: Fri Nov 21 14:39:54 2025 +0100

sw: document SwGetRefField

Mention that a cross-reference field can refer to things other than
reference marks, too.

Change-Id: I68ebb1c05d0558c73185483882eabd49024d2b3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194320
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx
index 6328c5551d20..fcd1f3af7a3e 100644
--- a/sw/inc/reffld.hxx
+++ b/sw/inc/reffld.hxx
@@ -108,6 +108,11 @@ private:
 const SwTextNode* pReference, 
std::u16string_view styleName);
 };
 
+/// A cross-reference field: refers to a property (page number, relative 
location, etc) of a
+/// bookmark or reference mark. When referring to headings, the bookmark is 
created implicitly by
+/// the UI.
+///
+/// Insert -> Field -> Cross-references on the UI.
 class SAL_DLLPUBLIC_RTTI SwGetRefField final : public SwField
 {
 private:


core.git: sw/inc

2025-11-19 Thread Miklos Vajna (via logerrit)
 sw/inc/expfld.hxx |4 
 sw/inc/txtfld.hxx |2 ++
 2 files changed, 6 insertions(+)

New commits:
commit 4100b27ba4436dd61c6055ae393c6a697d3345df
Author: Miklos Vajna 
AuthorDate: Wed Nov 19 08:40:49 2025 +0100
Commit: Miklos Vajna 
CommitDate: Wed Nov 19 18:01:14 2025 +0100

sw: document SwInputField and SwTextInputField

To make it more obvious how SwTextInputField owns an SwFormatField,
which then further owns an SwInputField.

Change-Id: I1b5e020e45a14eecff72b03ee63bb1ad1d55cfc4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194206
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index 5cc8b1d1923b..92bb4c343238 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -285,6 +285,10 @@ public:
 SwDoc* GetDoc() const { return mpDoc; }
 };
 
+/// SwField subclass for input fields, which are editable in-place. Typically 
owned by an
+/// SwFormatField, which is then further owned by SwTextInputField to track 
its location.
+///
+/// Insert -> Field -> More Fields -> Functions -> Input field on the UI.
 class SW_DLLPUBLIC SwInputField final : public SwField
 {
 mutable OUString maContent;
diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx
index a9a81ed397bd..d419e7ad4908 100644
--- a/sw/inc/txtfld.hxx
+++ b/sw/inc/txtfld.hxx
@@ -76,6 +76,8 @@ public:
 
 };
 
+/// SwTextAttr subclass that tracks the location of the wrapped SwFormatField, 
when the format
+/// field's field is an SwInputField.
 class SwTextInputField final
 : public SwTextAttrNesting
 , public SwTextField


core.git: sw/inc

2025-11-06 Thread codemaestro (via logerrit)
 sw/inc/ndtxt.hxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 08d788f5ff0dfd8cbfed1eb1b8b625a83516d076
Author: codemaestro 
AuthorDate: Mon Oct 27 10:18:28 2025 +0530
Commit: Ilmari Lauhakangas 
CommitDate: Thu Nov 6 14:50:39 2025 +0100

tdf#114441: Convert use of sal_uLong to better integer types

SwTextNode represents a single paragraph. ParagraphIdleData stores word
and character counts. Each paragraph's text is limited by the underlying
text buffer (OUString) index, which is sal_Int32 (~2.1B chars). Using
sal_uInt32 (4.3B capacity) safely covers all possible characters per
paragraph, voids overflow and halves memory compared to 64-bit counters.

Change-Id: I421e3b455ea5019d955db7c25edcac99eb927dbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193012
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas 

diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 93dfd3068996..247682b260ba 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -98,9 +98,9 @@ struct ParagraphIdleData
 std::unique_ptr pWrong;// for spell checking
 std::unique_ptr pGrammarCheck; // for grammar 
checking /  proof reading
 std::unique_ptr pSmartTags;
-sal_uLong nNumberOfWords  = 0;
-sal_uLong nNumberOfAsianWords  = 0;
-sal_uLong nNumberOfChars  = 0;
+sal_uInt32 nNumberOfWords  = 0;
+sal_uInt32 nNumberOfAsianWords  = 0;
+sal_uInt32 nNumberOfChars  = 0;
 sal_uLong nNumberOfCharsExcludingSpaces = 0;
 bool bWordCountDirty = true;
 WrongState eWrongDirty = WrongState::TODO; ///< online spell checking 
needed/done?


core.git: sw/inc sw/source

2025-11-06 Thread Miklos Vajna (via logerrit)
 sw/inc/expfld.hxx|1 +
 sw/source/core/fields/expfld.cxx |   13 +
 2 files changed, 14 insertions(+)

New commits:
commit 22a6748e0787ee49ebae9caf9ccbfac689a61961
Author: Miklos Vajna 
AuthorDate: Wed Nov 5 08:39:00 2025 +0100
Commit: Miklos Vajna 
CommitDate: Thu Nov 6 13:12:41 2025 +0100

sw doc model xml dump: handle SwSetExpField

Otherwise the expanded field value is not visible in the dump, which was
interesting when working on tdf#165472.

Change-Id: I024ab4293d6131367eaccefbc23dae318362ac6a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193515
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index de48331d0702..5cc8b1d1923b 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -256,6 +256,7 @@ public:
 virtual voidSetPar2(const OUString& rStr) override;
 virtual boolQueryValue( css::uno::Any& rVal, sal_uInt16 nWhich ) 
const override;
 virtual boolPutValue( const css::uno::Any& rVal, sal_uInt16 nWhich 
) override;
+void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
 inline void  SwSetExpField::SetPromptText(const OUString& rStr)
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index ab1321c14369..5ffe38a25f52 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -1158,6 +1158,19 @@ bool SwSetExpField::PutValue( const uno::Any& rAny, 
sal_uInt16 nWhichId )
 return true;
 }
 
+void SwSetExpField::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwSetExpField"));
+SwFormulaField::dumpAsXml(pWriter);
+
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("content"));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("expand"),
+  BAD_CAST(msExpand.toUtf8().getStr()));
+(void)xmlTextWriterEndElement(pWriter);
+
+(void)xmlTextWriterEndElement(pWriter);
+}
+
 bool SwSetExpField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
 {
 switch( nWhichId )


core.git: sw/inc sw/source

2025-10-24 Thread Mike Kaganski (via logerrit)
 sw/inc/dbfld.hxx |1 +
 sw/inc/ddefld.hxx|1 +
 sw/inc/expfld.hxx|1 +
 sw/inc/fldbas.hxx|1 +
 sw/inc/usrfld.hxx|1 +
 sw/source/core/doc/DocumentFieldsManager.cxx |2 +-
 sw/source/core/fields/dbfld.cxx  |2 ++
 sw/source/core/fields/ddefld.cxx |2 ++
 sw/source/core/fields/expfld.cxx |2 ++
 sw/source/core/fields/fldbas.cxx |2 ++
 sw/source/core/fields/usrfld.cxx |2 ++
 11 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 56f60453e788984627085ce65924a45e97a42ec2
Author: Mike Kaganski 
AuthorDate: Fri Oct 24 11:33:55 2025 +0500
Commit: Mike Kaganski 
CommitDate: Fri Oct 24 10:58:17 2025 +0200

Fix renaming field type in InsDeletedFieldType

The function has this comment:

  // - If the same type is found, the deleted one has to be renamed.

And obviously, the loop in it intends to do that. It searches the name;
when it finds one, it uses a counter to add a suffix to find an unused
name; and finally, it assigns the found unused new name.

The problem was, that it assigned it to a local variable, not to the
field type.

This happened in commit 263153842741d7ce21cc0bf1c5296a55a1138024
(String to OUString, 2013-07-16). Before that, SwFieldType::GetName
returned a const reference to a string; and that string was the field
actually representing name in the relevant field types. The function
InsDeletedFieldType took the name by const reference, and const_casted
it when renaming. The mentioned commit changed SwFieldType::GetName to
return by value, meaning that InsDeletedFieldType operated on a local
variable since then.

Later commits changed the local variable in InsDeletedFieldType to be
non-reference, and later the name in SwFieldType became a UIName.

This change introduces a normal setter for the field type name, to
avoid the hackish rename method, that led to this problem in the first
place.

This is a problem found by code reading. I don't know a user-visible
problem caused by this, so no unit test.

Change-Id: Ibe6fb1e0a11c5193cc253efe7241592d7ce9ca77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192931
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sw/inc/dbfld.hxx b/sw/inc/dbfld.hxx
index 132a5de5241c..9eab816b64ff 100644
--- a/sw/inc/dbfld.hxx
+++ b/sw/inc/dbfld.hxx
@@ -38,6 +38,7 @@ public:
 virtual ~SwDBFieldType() override;
 
 virtual UIName GetName() const override;
+virtual void SetName(const UIName& newName) override;
 virtual std::unique_ptr Copy() const override;
 
 void AddRef() { m_nRefCnt++; }
diff --git a/sw/inc/ddefld.hxx b/sw/inc/ddefld.hxx
index 278542e744db..18c8985a207f 100644
--- a/sw/inc/ddefld.hxx
+++ b/sw/inc/ddefld.hxx
@@ -72,6 +72,7 @@ public:
 
 virtual std::unique_ptr Copy() const override;
 virtual UIName GetName() const override;
+virtual void SetName(const UIName& newName) override;
 
 virtual void QueryValue( css::uno::Any& rVal, sal_uInt16 nWhich ) const 
override;
 virtual void PutValue( const css::uno::Any& rVal, sal_uInt16 nWhich ) 
override;
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index cdc738d775c9..de48331d0702 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -160,6 +160,7 @@ public:
 SwGetSetExpType nType = SwGetSetExpType::Expr );
 virtual std::unique_ptr Copy() const override;
 virtual UIName  GetName() const override;
+virtual void SetName(const UIName& newName) override;
 
 inline void SetType(SwGetSetExpType nTyp);
 inline SwGetSetExpType  GetType() const;
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index f91ccf30f99f..0f60a85a0e00 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -257,6 +257,7 @@ public:
 
 /// Only in derived classes.
 virtual UINameGetName() const;
+virtual void SetName(const UIName& newName);
 virtual std::unique_ptr Copy() const = 0;
 virtual void QueryValue( css::uno::Any& rVal, sal_uInt16 nWhich ) const;
 virtual void PutValue( const css::uno::Any& rVal, sal_uInt16 nWhich );
diff --git a/sw/inc/usrfld.hxx b/sw/inc/usrfld.hxx
index 718fd449b335..8b71f15cf355 100644
--- a/sw/inc/usrfld.hxx
+++ b/sw/inc/usrfld.hxx
@@ -47,6 +47,7 @@ public:
 SwUserFieldType( SwDoc* pDocPtr, const UIName& );
 
 virtual UIName  GetName() const override;
+virtual void SetName(const UIName& newName) override;
 virtual std::unique_ptr Copy() const override;
 
 OUStringExpand(sal_uInt32 nFormat, SwUserType nSubType, 
LanguageType nLng);
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx 
b/sw/source/core/doc/DocumentField

core.git: sw/inc sw/source

2025-10-21 Thread Miklos Vajna (via logerrit)
 sw/inc/dbfld.hxx|1 +
 sw/source/core/fields/dbfld.cxx |   13 +
 2 files changed, 14 insertions(+)

New commits:
commit 94a9dff34a0484b641fb898223de60c08c999a23
Author: Miklos Vajna 
AuthorDate: Tue Oct 21 08:23:15 2025 +0200
Commit: Miklos Vajna 
CommitDate: Tue Oct 21 12:52:08 2025 +0200

sw doc model xml dump: handle SwDBField

Otherwise the expanded field value is not visible in the dump, which was
interesting when working on tdf#168688.

Change-Id: I8ed84bbb233d18f97de3c519d6e07473d1ecd790
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192777
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sw/inc/dbfld.hxx b/sw/inc/dbfld.hxx
index 867804802806..132a5de5241c 100644
--- a/sw/inc/dbfld.hxx
+++ b/sw/inc/dbfld.hxx
@@ -108,6 +108,7 @@ public:
 
 static bool FormatValue( SvNumberFormatter const * pDocFormatter, OUString 
const &aString, sal_uInt32 nFormat,
  double &aNumber, sal_Int32 nColumnType, SwDBField 
*pField = nullptr );
+void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
 inline  void SwDBField::SetExpansion(const OUString& rStr)
diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx
index 573269e1ae01..119f34273e57 100644
--- a/sw/source/core/fields/dbfld.cxx
+++ b/sw/source/core/fields/dbfld.cxx
@@ -300,6 +300,19 @@ bool SwDBField::FormatValue( SvNumberFormatter const * 
pDocFormatter, OUString c
 return bValidValue;
 }
 
+void SwDBField::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwDBField"));
+SwValueField::dumpAsXml(pWriter);
+
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("content"));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
+  BAD_CAST(m_aContent.toUtf8().getStr()));
+(void)xmlTextWriterEndElement(pWriter);
+
+(void)xmlTextWriterEndElement(pWriter);
+}
+
 /// get current field value and cache it
 void SwDBField::Evaluate()
 {


core.git: sw/inc sw/source

2025-10-18 Thread Michael Stahl (via logerrit)
 sw/inc/IDocumentSettingAccess.hxx|1 
 sw/source/core/doc/DocumentSettingManager.cxx|   10 
 sw/source/core/inc/DocumentSettingManager.hxx|1 
 sw/source/core/inc/txtfrm.hxx|7 +-
 sw/source/core/layout/frmtool.cxx|6 ++
 sw/source/core/text/inftxt.cxx   |   24 ++
 sw/source/core/text/inftxt.hxx   |6 ++
 sw/source/core/text/itratr.cxx   |   40 -
 sw/source/core/text/itratr.hxx   |2 
 sw/source/core/text/itrpaint.cxx |1 
 sw/source/core/text/itrtxt.cxx   |   18 +++
 sw/source/core/text/redlnitr.cxx |   54 ++-
 sw/source/core/text/txtfrm.cxx   |   21 ++--
 sw/source/filter/ww8/ww8par.cxx  |1 
 sw/source/uibase/uno/SwXDocumentSettings.cxx |   18 +++
 sw/source/writerfilter/dmapper/SettingsTable.cxx |2 
 16 files changed, 180 insertions(+), 32 deletions(-)

New commits:
commit 0849ddd0b1b3c384c5f3de8fe0bbb9df558fa786
Author: Michael Stahl 
AuthorDate: Wed Oct 8 19:29:46 2025 +0200
Commit: Michael Stahl 
CommitDate: Thu Oct 9 13:07:17 2025 +0200

sw: text formatting: implement per-line paragraph properties like Word

This doesn't make a whole lot of sense.

Add compatibility setting "HiddenParagraphMarkPerLineProperties" for RTF
and DOCX compatibilityMode < 15.

Apparently what Word's "Compatibility Mode" is doing in case a paragraph
mark has hidden formatting is that it merges the last line of the first
paragraph and the first line of the second paragraph together, and
applies the first paragraph's properties to the line (and the preceding
lines); but for the second line of the second paragraph, it applies the
second paragraph's properties.

This is now implemented here; firstly, by adding a flag to the
MergedPara's Extents so that the situation can be distinguished (if the
paragraphs are joined by a delete redline, Word does something different
of course).  Because it's possible that the hidden paragraph break is on
a paragraph that doesn't have any extents, but a preceding paragraph has
extents that are affected, this sometimes requires 0-length dummy
extents.

FindParaPropsNodeIgnoreHidden() sets the last paragraph as
pParaPropsNode, which is used for all non-per-line properties.

Note that it's somewhat likely that the various Update functions in
txtfrm.cxx don't maintain the isHiddenParaMerge flag on extents
correctly, so it may look different than Word when editing.

Currently it affects these properties:

* line spacing

* tab stops

These are now set per line by SwTextIter::Next() calling
SwAttrIter::GetTextNodeForLinePropsWordCompat() and a factored out
SwLineInfo::InitLineInfo().

Evidently Word also does adjustment this way, but it's not implemented
here.

Change-Id: I216d9e2afdac9ab6f97c0ea822d4d501689df7a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192077
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/inc/IDocumentSettingAccess.hxx 
b/sw/inc/IDocumentSettingAccess.hxx
index 79884c24b17b..8ade13a9ba52 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -101,6 +101,7 @@ enum class DocumentSettingId
 JUSTIFY_LINES_WITH_SHRINKING,
 APPLY_TEXT_ATTR_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH,
 APPLY_PARAGRAPH_MARK_FORMAT_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH,
+HIDDEN_PARAGRAPH_MARK_PER_LINE_PROPERTIES,
 DO_NOT_MIRROR_RTL_DRAW_OBJS,
 // COMPATIBILITY FLAGS END
 BROWSE_MODE,
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index e448e8c0fda2..9a689fa9d005 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -269,6 +269,8 @@ bool sw::DocumentSettingManager::get(/*[in]*/ 
DocumentSettingId id) const
 return mbApplyTextAttrToEmptyLineAtEndOfParagraph;
 case 
DocumentSettingId::APPLY_PARAGRAPH_MARK_FORMAT_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH:
 return mbApplyParagraphMarkFormatToEmptyLineAtEndOfParagraph;
+case DocumentSettingId::HIDDEN_PARAGRAPH_MARK_PER_LINE_PROPERTIES:
+return mbHiddenParagraphMarkPerLineProperties;
 case DocumentSettingId::DO_NOT_BREAK_WRAPPED_TABLES:
 return mbDoNotBreakWrappedTables;
 case DocumentSettingId::ALLOW_TEXT_AFTER_FLOATING_TABLE_BREAK:
@@ -488,6 +490,9 @@ void sw::DocumentSettingManager::set(/*[in]*/ 
DocumentSettingId id, /*[in]*/ boo
 mbApplyParagraphMarkFormatToEmptyLineAtEndOfParagraph = value;
 break;
 
+case DocumentSettingId::HIDDEN_PARAGRAPH_MARK_PER_LINE_PROPERTIES:
+mb

core.git: sw/inc sw/qa sw/source

2025-10-18 Thread Miklos Vajna (via logerrit)
 sw/inc/formatcontentcontrol.hxx |5 ++
 sw/qa/filter/md/data/task-list-items.md |2 
 sw/qa/filter/md/md.cxx  |   76 
 sw/source/filter/md/swmd.cxx|   30 +++-
 sw/source/filter/md/swmd.hxx|3 -
 sw/source/filter/md/wrtmd.cxx   |   51 +
 sw/source/filter/md/wrtmd.hxx   |5 ++
 sw/source/uibase/wrtsh/wrtsh1.cxx   |6 --
 8 files changed, 168 insertions(+), 10 deletions(-)

New commits:
commit 7608d96302652eb48863da441e121e0c61350412
Author: Miklos Vajna 
AuthorDate: Tue Sep 30 08:23:34 2025 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 30 13:27:42 2025 +0200

tdf#168617 sw markdown filter: map tasks to checkbox content controls and 
back

Import the bugdoc, try to click on the unchecked checkbox to check it,
nothing happens, while this works in some other markdown renderers.

Writer has a checkbox content control type that can model a task list
item described at
.

Fix the problem by replacing the static checkboxes with a content
control so the user can interact with the checkbox.

And do the opposite during export.

Change-Id: I7ed66481bfffbf79aa828e7b3dbe34c0d753a817
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191657
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sw/inc/formatcontentcontrol.hxx b/sw/inc/formatcontentcontrol.hxx
index cc0d4d8e0724..72383d76710d 100644
--- a/sw/inc/formatcontentcontrol.hxx
+++ b/sw/inc/formatcontentcontrol.hxx
@@ -398,6 +398,11 @@ public:
 const OUString& GetMultiLine() const { return m_aMultiLine; }
 
 SwContentControlType GetType() const;
+
+// Ballot Box with X
+static constexpr OUString CHECKED_STATE = u"\u2612"_ustr;
+// Ballot Box
+static constexpr OUString UNCHECKED_STATE = u"\u2610"_ustr;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/filter/md/data/task-list-items.md 
b/sw/qa/filter/md/data/task-list-items.md
new file mode 100644
index ..2efcdf77ba62
--- /dev/null
+++ b/sw/qa/filter/md/data/task-list-items.md
@@ -0,0 +1,2 @@
+- [x] foo
+- [ ] bar
diff --git a/sw/qa/filter/md/md.cxx b/sw/qa/filter/md/md.cxx
index 157c03235316..217d212a90f8 100644
--- a/sw/qa/filter/md/md.cxx
+++ b/sw/qa/filter/md/md.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace
 {
@@ -741,6 +742,81 @@ CPPUNIT_TEST_FIXTURE(Test, testNestedTableMdExport)
 CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTastListItemsMdImport)
+{
+// Given a document with 2 task list items:
+setImportFilterName("Markdown");
+
+// When importing that document from markdown:
+createSwDoc("task-list-items.md");
+
+// Then make sure we have two checkbox content controls, first is checked, 
second is not:
+SwDocShell* pDocShell = getSwDocShell();
+SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+pWrtShell->SttEndDoc(/*bStt=*/true);
+pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, 
/*bBasicCall=*/false);
+{
+SwTextContentControl* pTextContentControl = 
pWrtShell->CursorInsideContentControl();
+// Without the accompanying fix in place, this test would have failed, 
the task list item
+// was imported as a static checkbox character.
+CPPUNIT_ASSERT(pTextContentControl);
+const SwFormatContentControl& rFormatContentControl
+= pTextContentControl->GetContentControl();
+const std::shared_ptr& pContentControl
+= rFormatContentControl.GetContentControl();
+CPPUNIT_ASSERT_EQUAL(SwContentControlType::CHECKBOX, 
pContentControl->GetType());
+CPPUNIT_ASSERT(pContentControl->GetChecked());
+}
+pWrtShell->Down(/*bSelect=*/false, 1);
+pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, 
/*bBasicCall=*/false);
+{
+SwTextContentControl* pTextContentControl = 
pWrtShell->CursorInsideContentControl();
+CPPUNIT_ASSERT(pTextContentControl);
+const SwFormatContentControl& rFormatContentControl
+= pTextContentControl->GetContentControl();
+const std::shared_ptr& pContentControl
+= rFormatContentControl.GetContentControl();
+CPPUNIT_ASSERT_EQUAL(SwContentControlType::CHECKBOX, 
pContentControl->GetType());
+CPPUNIT_ASSERT(!pContentControl->GetChecked());
+}
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testTastListItemsMdExport)
+{
+// Given a document with two content control checkboxes, first is checked, 
second is unchecked:
+createSwDoc();
+SwDocShell* pDocShell = getSwDocShell();
+SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+pWrtShell->InsertContentControl(SwContentControlType::CHECKBOX);
+{
+SwTextContentControl* pTextContentControl = 
pWrt

core.git: sw/inc

2025-10-18 Thread Gabor Kelemen (via logerrit)
 sw/inc/calbck.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 315c6873664b861ed8ece335b51602e66fe3f1ca
Author: Gabor Kelemen 
AuthorDate: Thu Oct 2 08:31:29 2025 +0200
Commit: Gabor Kelemen 
CommitDate: Fri Oct 10 22:11:34 2025 +0200

Add space to template declaration

to appease bin/find-unneeded-includes

For some reason, in the IWYU output this appears with a space
and --sanitycheck would indicate this line as unnecessary
in the yaml file

But in --fwdecl mode there is a false warning about it, so
it it necessary at least with IWYU 0.24

Adding the space here allows both mode to work correctly

Change-Id: Ice08e4dcbdbe79e9f86b81cff3d95fe5d6afb536
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191825
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen 

diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index 5c9dec7d389d..a86911f34e9b 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -73,7 +73,7 @@ namespace sw
 enum class IteratorMode { Exact, UnwrapMulti };
 }
 
-template 
class SwIterator;
+template  
class SwIterator;
 
 namespace sw
 {


core.git: sw/inc sw/qa sw/source

2025-10-18 Thread Miklos Vajna (via logerrit)
 sw/inc/IDocumentRedlineAccess.hxx |6 -
 sw/inc/editsh.hxx |4 
 sw/qa/core/doc/DocumentRedlineManager.cxx |  126 ++
 sw/source/core/doc/DocumentRedlineManager.cxx |   54 +--
 sw/source/core/edit/edredln.cxx   |8 -
 sw/source/core/inc/DocumentRedlineManager.hxx |   12 +-
 sw/source/uibase/misc/redlndlg.cxx|6 -
 7 files changed, 191 insertions(+), 25 deletions(-)

New commits:
commit 55640f9f0a4741f8e4b5b98096af822cee71da2c
Author: Miklos Vajna 
AuthorDate: Mon Sep 29 08:44:22 2025 +0200
Commit: Miklos Vajna 
CommitDate: Mon Sep 29 11:24:57 2025 +0200

tdf#166319 sw interdependent redlines: allow accept/reject for fmt on 
ins/del

When a format redline is on top of an insert/delete and the uno command
is dispatched to accept/reject the redline under cursor, then we always
interact with the insert/delete, ignoring the format. This is usually
wanted, but now there is no way to interact with the format redline,
even if you would explicitly ask for it.

Notice that the manage changes dialog/sidebar has a separate row for the
format redline and the ins/del redline under it (at the same document
model position), so that gives us a way to select the format redline
explicitly and interact with it.

Implement this by adding a "direct" mode to the edit shell's
AcceptRedline() / RejectRedline().

With this, all of the (insert or delete) then format, (accept or reject)
on it case works in direct mode. Undo also works, redo still needs
fixing.

Change-Id: I7947cd6c7264773d51e63ccd7c45acb001a79d88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191592
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/IDocumentRedlineAccess.hxx 
b/sw/inc/IDocumentRedlineAccess.hxx
index e270ad92c57e..92e8c3857210 100644
--- a/sw/inc/IDocumentRedlineAccess.hxx
+++ b/sw/inc/IDocumentRedlineAccess.hxx
@@ -200,7 +200,8 @@ public:
 virtual void SetRedlineMove(/*[in]*/bool bFlag) = 0;
 
 virtual bool AcceptRedline(/*[in]*/ SwRedlineTable::size_type nPos, 
/*[in]*/ bool bCallDelete,
-   /*[in]*/ bool bRange = false)
+   /*[in]*/ bool bRange = false,
+   bool bDirect = false)
 = 0;
 
 virtual bool AcceptRedline(/*[in]*/ const SwPaM& rPam, /*[in]*/ bool 
bCallDelete,
@@ -210,7 +211,8 @@ public:
 virtual void AcceptRedlineParagraphFormatting(/*[in]*/const SwPaM& rPam ) 
= 0;
 
 virtual bool RejectRedline(/*[in]*/ SwRedlineTable::size_type nPos,
-   /*[in]*/ bool bCallDelete, /*[in]*/ bool bRange 
= false)
+   /*[in]*/ bool bCallDelete, /*[in]*/ bool bRange 
= false,
+   bool bDirect = false)
 = 0;
 
 virtual bool RejectRedline(/*[in]*/ const SwPaM& rPam, /*[in]*/ bool 
bCallDelete,
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 990bb7adc07a..b631a1eb5e4a 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -958,8 +958,8 @@ public:
 SW_DLLPUBLIC SwRedlineTable::size_type GetRedlineCount() const;
 const SwRangeRedline& GetRedline( SwRedlineTable::size_type nPos ) const;
 SwRangeRedline& GetRedline( SwRedlineTable::size_type nPos );
-SW_DLLPUBLIC bool AcceptRedline( SwRedlineTable::size_type nPos );
-SW_DLLPUBLIC bool RejectRedline( SwRedlineTable::size_type nPos );
+SW_DLLPUBLIC bool AcceptRedline( SwRedlineTable::size_type nPos, bool 
bDirect = false );
+SW_DLLPUBLIC bool RejectRedline( SwRedlineTable::size_type nPos, bool 
bDirect = false );
 bool AcceptRedlinesInSelection();
 bool RejectRedlinesInSelection();
 SW_DLLPUBLIC void ReinstateRedline(SwRedlineTable::size_type nPos);
diff --git a/sw/qa/core/doc/DocumentRedlineManager.cxx 
b/sw/qa/core/doc/DocumentRedlineManager.cxx
index 10221f79664a..bec423d64351 100644
--- a/sw/qa/core/doc/DocumentRedlineManager.cxx
+++ b/sw/qa/core/doc/DocumentRedlineManager.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace
 {
@@ -172,6 +173,131 @@ CPPUNIT_TEST_FIXTURE(Test, 
testFormatRedlineRecordOldCharStyle)
 const SwFormatCharFormat& rOldCharFormat = 
pRedlineSet->Get(RES_TXTATR_CHARFMT);
 CPPUNIT_ASSERT_EQUAL(u"Emphasis"_ustr, 
rOldCharFormat.GetCharFormat()->GetName().toString());
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testDelThenFormatDirect)
+{
+// Given a document with a delete redline, part of it has a format redline 
on top:
+createSwDoc("del-then-format.docx");
+
+// When "directly" accepting the delete-then-format redline:
+SwDocShell* pDocShell = getSwDocShell();
+SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+pWrtShell->AcceptRedline(1, /*bDirect=*/true);
+
+// Then make sure that the format gets accepted, and the delete redline is 
kept:
+Sw

core.git: sw/inc sw/source

2025-10-18 Thread Noel Grandin (via logerrit)
 sw/inc/node.hxx |   13 +
 sw/source/core/inc/swfntcch.hxx |5 +++--
 sw/source/core/text/frmpaint.cxx|2 +-
 sw/source/core/text/porrst.cxx  |2 +-
 sw/source/core/text/redlnitr.cxx|2 +-
 sw/source/core/txtnode/swfntcch.cxx |   13 ++---
 6 files changed, 25 insertions(+), 12 deletions(-)

New commits:
commit e40c363049cc6264e7b074c13e8194c70b46772b
Author: Noel Grandin 
AuthorDate: Thu Oct 9 16:40:52 2025 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 10 09:03:17 2025 +0200

make SwFontObj/SwFontAccess more explicit

we are already static casting the owner to SwTextFormatColl,
so make that explicit, which reveals that the callers actually
want SwTextFormatColl and not just any SwFormatColl.

Change-Id: If52b7b76878392595ad567bff30937487f6cb0af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192109
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 456dc8e8a1e9..2e481d794d93 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -501,6 +501,7 @@ public:
 SwFormatColl* GetFormatColl() const { return 
const_cast(static_cast(GetRegisteredIn())); 
}
 
 inline SwFormatColl& GetAnyFormatColl() const;
+inline SwTextFormatColl& GetTextFormatColl() const;
 void SetCondFormatColl( SwFormatColl* );
 inline SwFormatColl* GetCondFormatColl() const;
 
@@ -728,6 +729,18 @@ inline SwFormatColl& SwContentNode::GetAnyFormatColl() 
const
 : *const_cast(static_cast(GetRegisteredIn()));
 }
 
+inline SwTextFormatColl& SwContentNode::GetTextFormatColl() const
+{
+if (m_pCondColl)
+{
+assert(dynamic_cast(m_pCondColl));
+return *static_cast(m_pCondColl);
+}
+auto pRegistered = GetRegisteredIn();
+assert(dynamic_cast(pRegistered));
+return *const_cast(static_cast(pRegistered));
+}
+
 inline const SwAttrSet& SwContentNode::GetSwAttrSet() const
 {
 return mpAttrSet ? *GetpSwAttrSet() : GetAnyFormatColl().GetAttrSet();
diff --git a/sw/source/core/inc/swfntcch.hxx b/sw/source/core/inc/swfntcch.hxx
index 75716db3143d..844e9f3590a2 100644
--- a/sw/source/core/inc/swfntcch.hxx
+++ b/sw/source/core/inc/swfntcch.hxx
@@ -26,6 +26,7 @@
 
 class SwViewShell;
 class SfxPoolItem;
+class SwTextFormatColl;
 
 class SwFontCache : public SwCache
 {
@@ -51,7 +52,7 @@ private:
 const SfxPoolItem* m_pDefaultArray[ NUM_DEFAULT_VALUES ];
 
 public:
-SwFontObj( const void* pOwner, SwViewShell *pSh );
+SwFontObj( const SwTextFormatColl* pOwner, SwViewShell *pSh );
 
 virtual ~SwFontObj() override;
 
@@ -67,7 +68,7 @@ class SwFontAccess final : public SwCacheAccess
 virtual SwCacheObj *NewObj( ) override;
 
 public:
-SwFontAccess( const void *pOwner, SwViewShell *pSh );
+SwFontAccess( const SwTextFormatColl *pOwner, SwViewShell *pSh );
 SwFontObj *Get();
 };
 
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index e7b35b8a49ff..007e0dfda7d3 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -537,7 +537,7 @@ bool SwTextFrame::PaintEmpty( const SwRect &rRect, bool 
bCheck ) const
 }
 else
 {
-SwFontAccess aFontAccess( &rTextNode.GetAnyFormatColl(), pSh );
+SwFontAccess aFontAccess( &rTextNode.GetTextFormatColl(), pSh 
);
 pFnt.reset(new SwFont( aFontAccess.Get()->GetFont() ));
 }
 
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index e7054c6a6d27..5d5146e2f8c1 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -372,7 +372,7 @@ SwTwips SwTextFrame::EmptyHeight() const
 }
 else
 {
-SwFontAccess aFontAccess( &rTextNode.GetAnyFormatColl(), pSh);
+SwFontAccess aFontAccess( &rTextNode.GetTextFormatColl(), pSh);
 pFnt.reset(new SwFont( aFontAccess.Get()->GetFont() ));
 pFnt->CheckFontCacheId( pSh, pFnt->GetActual() );
 }
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index 5c88502ed2c9..ff03cc5452ce 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -594,7 +594,7 @@ void SwAttrIter::InitFontAndAttrHandler(
 bool const*const pbVertLayoutLRBT)
 {
 // Build a font matching the default paragraph style:
-SwFontAccess aFontAccess( &rPropsNode.GetAnyFormatColl(), m_pViewShell );
+SwFontAccess aFontAccess( &rPropsNode.GetTextFormatColl(), m_pViewShell );
 // It is possible that Init is called more than once, e.g., in a
 // SwTextFrame::FormatOnceMore situation or (since sw_redlinehide)
 // from SwAttrIter::Seek(); in the latter case SwTextSizeInfo::m_pFnt
diff --git a/sw/source/core/txtnode/swfntcch.cxx 
b/sw/source/core/txtnode/swfntcch.cxx
index 100a0e7a7965..34c796d4fbd0 100644
--- a/sw/source/core/txtnode/swfntcch.cxx
+++ b/

core.git: sw/inc sw/qa sw/source

2025-10-18 Thread David Hashe (via logerrit)
 sw/inc/pagedesc.hxx|1 +
 sw/qa/core/undo/undo.cxx   |   23 +++
 sw/source/core/layout/pagedesc.cxx |5 +
 sw/source/core/undo/SwUndoPageDesc.cxx |8 ++--
 4 files changed, 35 insertions(+), 2 deletions(-)

New commits:
commit 434cf190c7dcf0e8b99d473eaff2acfd70b6e82e
Author: David Hashe 
AuthorDate: Sun Oct 5 21:20:48 2025 -0400
Commit: Noel Grandin 
CommitDate: Tue Oct 7 08:19:19 2025 +0200

tdf#148703 fix follow links for recreated page descs

When the creation of a SwPageDesc is undone and then redone,
and that page desc had itself as its own follow, then the
follow link was not being set correctly.

I noticed this when working on tdf#148703, and it is a
small part of that fix that can be merged independently.

Tested with:

CPPUNIT_TEST_NAME="SwCoreUndoTest testPageDescThatFollowsItself" make 
CppunitTest_sw_core_undo

Change-Id: I798197de78e32694a5819da9025fa84b44e30e98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191979
Reviewed-by: Noel Grandin 
Tested-by: Jenkins

diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index 0113371b7de8..a9bfa1379269 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -395,6 +395,7 @@ public:
 SwPageDescExt & operator = (const SwPageDesc & rSrc);
 
 UIName const & GetName() const;
+UIName const & GetFollowName() const;
 
 explicit operator SwPageDesc() const; // #i7983#
 };
diff --git a/sw/qa/core/undo/undo.cxx b/sw/qa/core/undo/undo.cxx
index 3a4c86976bf9..094432d3f344 100644
--- a/sw/qa/core/undo/undo.cxx
+++ b/sw/qa/core/undo/undo.cxx
@@ -174,6 +174,29 @@ CPPUNIT_TEST_FIXTURE(SwCoreUndoTest, 
testAnchorTypeChangePosition)
 CPPUNIT_ASSERT_EQUAL(aOldPos, aNewPos);
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreUndoTest, testPageDescThatFollowsItself)
+{
+createSwDoc();
+
+SwDoc* pDoc = getSwDoc();
+
+// Create a custom page desc that has its follow page desc set to itself
+// (that happens by default). This means that, if the current page uses 
this
+// page desc, then the next page will as well.
+SwPageDesc* pOldPageDesc = pDoc->MakePageDesc(UIName("customPageDesc"), 
nullptr, true);
+CPPUNIT_ASSERT(pOldPageDesc);
+CPPUNIT_ASSERT_EQUAL(pOldPageDesc, pOldPageDesc->GetFollow());
+
+dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
+dispatchCommand(mxComponent, u".uno:Redo"_ustr, {});
+
+// Without the fix, the follow page desc no longer matches, and the next 
page
+// would not use the correct page desc.
+SwPageDesc* pNewPageDesc = pDoc->FindPageDesc(UIName("customPageDesc"));
+CPPUNIT_ASSERT(pNewPageDesc);
+CPPUNIT_ASSERT_EQUAL(pNewPageDesc, pNewPageDesc->GetFollow());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/pagedesc.cxx 
b/sw/source/core/layout/pagedesc.cxx
index 780123d62452..2bb7059ffe22 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -770,6 +770,11 @@ UIName const & SwPageDescExt::GetName() const
 return m_PageDesc.GetName();
 }
 
+UIName const & SwPageDescExt::GetFollowName() const
+{
+return m_sFollow;
+}
+
 void SwPageDescExt::SetPageDesc(const SwPageDesc & rPageDesc)
 {
 m_PageDesc = rPageDesc;
diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx 
b/sw/source/core/undo/SwUndoPageDesc.cxx
index f61db8b38336..3df5d986c691 100644
--- a/sw/source/core/undo/SwUndoPageDesc.cxx
+++ b/sw/source/core/undo/SwUndoPageDesc.cxx
@@ -278,7 +278,9 @@ void SwUndoPageDescCreate::UndoImpl(::sw::UndoRedoContext &)
 void SwUndoPageDescCreate::DoImpl()
 {
 SwPageDesc aPageDesc(m_aNew);
-m_rDoc.MakePageDesc(m_aNew.GetName(), &aPageDesc, false);
+SwPageDesc* pNewPageDesc = m_rDoc.MakePageDesc(m_aNew.GetName(), 
&aPageDesc, false);
+if (m_aNew.GetName() == m_aNew.GetFollowName())
+pNewPageDesc->SetFollow(pNewPageDesc);
 }
 
 void SwUndoPageDescCreate::RedoImpl(::sw::UndoRedoContext &)
@@ -317,7 +319,9 @@ SwUndoPageDescDelete::~SwUndoPageDescDelete()
 void SwUndoPageDescDelete::UndoImpl(::sw::UndoRedoContext &)
 {
 SwPageDesc aPageDesc(m_aOld);
-m_rDoc.MakePageDesc(m_aOld.GetName(), &aPageDesc, false);
+SwPageDesc* pNewPageDesc = m_rDoc.MakePageDesc(m_aOld.GetName(), 
&aPageDesc, false);
+if (m_aOld.GetName() == m_aOld.GetFollowName())
+pNewPageDesc->SetFollow(pNewPageDesc);
 }
 
 void SwUndoPageDescDelete::DoImpl()


core.git: sw/inc sw/source

2025-10-17 Thread Michael Stahl (via logerrit)
 sw/inc/fesh.hxx  |4 +-
 sw/source/core/doc/doclay.cxx|1 
 sw/source/core/frmedt/fecopy.cxx |   15 +++--
 sw/source/uibase/dochdl/swdtflvr.cxx |   58 ++-
 sw/source/uibase/inc/swdtflvr.hxx|   10 --
 5 files changed, 62 insertions(+), 26 deletions(-)

New commits:
commit d072b5e09e1c7f759c797b7ba1ee89a3bfef8858
Author: Michael Stahl 
AuthorDate: Fri Oct 10 13:41:22 2025 +0200
Commit: Michael Stahl 
CommitDate: Fri Oct 10 15:36:01 2025 +0200

tdf#51850 sw: AutoCaption for a single pasted image

AutoCaption mostly isn't enabled for clipboard paste, except for one
special case.

For the case when the source is outside LO, let
SwTransferable::PasteGrf() set a flag that the caption should be
inserted (the SwPasteSdr::Insert case), which can then be handled at the
end.

PasteFileList() appears to be used when an image file is copied from
Nautilus.

For internal paste, it gets more complicated because SwFEShell::Paste()
knows what was inserted, but caption can only be added later, outside of
any StartAction()/EndAction(), because if an action is pending,
SwWrtShell::GetSelectionType() does not return useful results, and the
lcl_InsertLabel() ends up erroneously inserting a text node next to the
SwGrfNode.

Change-Id: I3e16f407fd409a0f315be139376ad9e5f0b526cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192165
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index ae25ec87b3ab..1aaa5cd0dd25 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -258,7 +258,9 @@ public:
 /// Copy and Paste methods for internal clipboard.
 /// bDeleteRedlines: if content inside a delete redline should be stripped 
away in rClpDoc.
 SW_DLLPUBLIC void Copy( SwDoc& rClpDoc, const OUString* pNewClpText = 
nullptr, bool bDeleteRedlines = true );
-SW_DLLPUBLIC bool Paste( SwDoc& rClpDoc, bool bNestedTable = false );
+// @return possibly a pasted fly frame to be captioned
+SW_DLLPUBLIC ::std::pair
+Paste(SwDoc& rClpDoc, bool bNestedTable = false);
 
 /// Paste some pages into another doc - used in mailmerge.
 SW_DLLPUBLIC void PastePages( SwFEShell& rToFill, sal_uInt16 nStartPage, 
sal_uInt16 nEndPage);
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index b6ceedb74674..fdef5c76f427 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -685,6 +685,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const 
pTextFormatCollTable,
 {
 SwStartNode *pSttNd = rDoc.GetNodes()[nNdIdx]->GetStartNode();
 assert(pSttNd && "No StartNode in InsertLabel.");
+assert(!rDoc.GetNodes()[nNdIdx+1]->IsGrfNode() && 
!rDoc.GetNodes()[nNdIdx+1]->IsOLENode()); // these need to be 
SwLabelType::Object
 SwNodeOffset nNode;
 if( bBefore )
 {
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 174e60b3187a..c0ee3c3f6e1c 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -844,7 +844,8 @@ namespace {
 }
 }
 
-bool SwFEShell::Paste(SwDoc& rClpDoc, bool bNestedTable)
+::std::pair
+SwFEShell::Paste(SwDoc& rClpDoc, bool const bNestedTable)
 {
 CurrShell aCurr( this );
 // then till end of the nodes array
@@ -864,6 +865,8 @@ bool SwFEShell::Paste(SwDoc& rClpDoc, bool bNestedTable)
 SwTableNode *const pSrcNd = aCpyPam.GetMarkNode().GetTableNode();
 
 bool bRet = true;
+SwFrameFormat const* pNewFlyToCaption{nullptr};
+
 StartAllAction();
 GetDoc()->GetIDocumentUndoRedo().StartUndo( SwUndoId::INSGLOSSARY, nullptr 
);
 GetDoc()->getIDocumentFieldsAccess().LockExpFields();
@@ -1076,6 +1079,14 @@ bool SwFEShell::Paste(SwDoc& rClpDoc, bool bNestedTable)
 {
 lcl_InitSelectFlyOrDrawFormat(pFlyFormat, *this, isSelect);
 }
+if (isSelect && inserted.size() == 1)
+{
+if (inserted.front()->Which() == RES_FLYFRMFMT
+&& 
GetDoc()->GetNodes()[inserted.front()->GetContent().GetContentIdx()->GetIndex() 
+ 1]->IsGrfNode())
+{
+pNewFlyToCaption = inserted.front();
+}
+}
 }
 else
 {
@@ -1166,7 +1177,7 @@ bool SwFEShell::Paste(SwDoc& rClpDoc, bool bNestedTable)
 GetDoc()->getIDocumentFieldsAccess().UpdateFields(false);
 EndAllAction();
 
-return bRet;
+return {bRet, pNewFlyToCaption};
 }
 
 void SwFEShell::PastePages( SwFEShell& rToFill, sal_uInt16 nStartPage, 
sal_uInt16 nEndPage)
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index 9b9bf0574496..0167b7e6f42

core.git: sw/inc sw/qa sw/source

2025-10-17 Thread Miklos Vajna (via logerrit)
 sw/inc/IDocumentRedlineAccess.hxx |3 +-
 sw/qa/core/doc/DocumentRedlineManager.cxx |   28 ++
 sw/source/core/doc/DocumentRedlineManager.cxx |   27 +
 sw/source/core/inc/DocumentRedlineManager.hxx |3 +-
 sw/source/core/inc/UndoRedline.hxx|   11 ++
 sw/source/core/undo/unredln.cxx   |   15 +
 6 files changed, 72 insertions(+), 15 deletions(-)

New commits:
commit d04ab0febcf660e87d19574adc08f9f2af75509f
Author: Miklos Vajna 
AuthorDate: Mon Oct 6 08:40:26 2025 +0200
Commit: Miklos Vajna 
CommitDate: Mon Oct 6 14:45:24 2025 +0200

tdf#166319 sw interdependent redlines: fix redo of accept for fmt on ins/del

The bugdoc has AABBCC content, accepting the
BB part "directly (via the sidebar or the manage changes dialog, so you
accept the format, not the underlying insert), then undo, then redo
resulted in AABBCC instead of a
single insert, as expected.

What happens is that the UI action uses
sw::DocumentRedlineManager::AcceptRedlineRange(), while the redo uses
sw::DocumentRedlineManager::AcceptRedline(), and while the first
supported direct accepts, the later did not.

Fix the problem by:
1) Extending SwUndoRedline with a flag to know if the accept/reject to
   be performed by redo should be a direct action or not
2) Fixing sw::DocumentRedlineManager::AcceptRedlineRange() to create an
   undo action with the correct depth (should be 0, was 1) & save the
   direct flag into the undo action
3) In sw::DocumentRedlineManager::AcceptRedline(), use
   lcl_AcceptOuterFormat() to accept a format redline directly instead
   of the usual lcl_AcceptRejectRedl().

This also fixes the case where you have a format on top of a delete
(instead of an insert).

Change-Id: I78d7ae9eebf8525191a3d9b3a1731d80ad04a75b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191960
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/IDocumentRedlineAccess.hxx 
b/sw/inc/IDocumentRedlineAccess.hxx
index 92e8c3857210..dd37a92c9fc7 100644
--- a/sw/inc/IDocumentRedlineAccess.hxx
+++ b/sw/inc/IDocumentRedlineAccess.hxx
@@ -205,7 +205,8 @@ public:
 = 0;
 
 virtual bool AcceptRedline(/*[in]*/ const SwPaM& rPam, /*[in]*/ bool 
bCallDelete,
-   /*[in]*/ sal_Int8 nDepth = 0)
+   /*[in]*/ sal_Int8 nDepth = 0,
+   bool bDirect = false)
 = 0;
 
 virtual void AcceptRedlineParagraphFormatting(/*[in]*/const SwPaM& rPam ) 
= 0;
diff --git a/sw/qa/core/doc/DocumentRedlineManager.cxx 
b/sw/qa/core/doc/DocumentRedlineManager.cxx
index bec423d64351..5f4d0b796023 100644
--- a/sw/qa/core/doc/DocumentRedlineManager.cxx
+++ b/sw/qa/core/doc/DocumentRedlineManager.cxx
@@ -208,6 +208,20 @@ CPPUNIT_TEST_FIXTURE(Test, testDelThenFormatDirect)
 CPPUNIT_ASSERT_EQUAL(WEIGHT_BOLD, rWeightItem.GetValue());
 }
 
+// And given an undo, so we can redo:
+pWrtShell->Undo();
+CPPUNIT_ASSERT_EQUAL(static_cast(3), rRedlines.size());
+
+// When doing the same again via redo:
+pWrtShell->Redo();
+
+// Then make sure we again have a single large delete:
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 2
+// i.e. instead of a large delete redline, we have 2 small ones for AAA 
and CCC only.
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rRedlines.size());
+
 // And given a reset state:
 pWrtShell->Undo();
 CPPUNIT_ASSERT_EQUAL(static_cast(3), rRedlines.size());
@@ -269,6 +283,20 @@ CPPUNIT_TEST_FIXTURE(Test, testInsThenFormatDirect)
 CPPUNIT_ASSERT_EQUAL(WEIGHT_BOLD, rWeightItem.GetValue());
 }
 
+// And given an undo, so we can redo:
+pWrtShell->Undo();
+CPPUNIT_ASSERT_EQUAL(static_cast(3), rRedlines.size());
+
+// When doing the same again via redo:
+pWrtShell->Redo();
+
+// Then make sure we again have a single large insert:
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 3
+// i.e. redo was broken, the middle part was a format redline instead of 
an insert redline.
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rRedlines.size());
+
 // And given a reset state:
 pWrtShell->Undo();
 CPPUNIT_ASSERT_EQUAL(static_cast(3), rRedlines.size());
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index dd5c52074313..00cb23fe6ffc 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -3393,15 +3393,16 @@ bool 
DocumentRedlineManager::AcceptRedlineRange(SwRedlineTable::size_type nPosOr
 bool bHierarchicalFormat = pTmp->GetType() == RedlineType::Format 
&& pTmp->GetStackC

core.git: sw/inc sw/qa sw/source

2025-10-17 Thread Justin Luth (via logerrit)
 sw/inc/editsh.hxx   |2 +-
 sw/qa/extras/uiwriter/uiwriter6.cxx |3 +++
 sw/source/core/edit/editsh.cxx  |5 +
 sw/source/uibase/wrtsh/wrtsh1.cxx   |   10 +++---
 4 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit 906ee7050702e36b7509398cd33fd35597eaf528
Author: Justin Luth 
AuthorDate: Tue Oct 7 18:07:31 2025 -0400
Commit: Justin Luth 
CommitDate: Wed Oct 8 13:58:13 2025 +0200

tdf#165973 sw undo: separate AUTOFORMAT after SPLITNODE

When the user presses RETURN,
they almost certainly want a new paragraph,
but there is much less certainty
that they want the autocorrect.

Since 6.2, these have been a single undo event.
This patch splits it into two undo items,
and places the AUTOFORMAT item last,
so that the first undo restores before the autoformat
and the second undo removes the new paragraph marker.

It was not NECESSARY to affect SwEditShell::SplitNode,
but it seemed prudent to move everything to a higher level,
especially since there was no other time bAutoformat was used.

Change-Id: Ia828e3373608e1e5ecf7792dee2bc04321843d6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192053
Reviewed-by: Justin Luth 
Tested-by: Jenkins

diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index b631a1eb5e4a..a44b9e78eb73 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -210,7 +210,7 @@ public:
Copy all selections to the document. */
 bool CopySelToDoc( SwDoc& rInsDoc );
 
-SW_DLLPUBLIC void SplitNode( bool bAutoFormat = false, bool 
bCheckTableStart = true );
+SW_DLLPUBLIC void SplitNode(bool bCheckTableStart = true);
 SW_DLLPUBLIC bool AppendTextNode();
 void AutoFormatBySplitNode();
 
diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx 
b/sw/qa/extras/uiwriter/uiwriter6.cxx
index e6c94420349e..f2b673a8c84a 100644
--- a/sw/qa/extras/uiwriter/uiwriter6.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter6.cxx
@@ -2295,6 +2295,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf51223)
 CPPUNIT_ASSERT_EQUAL(u"I"_ustr, 
static_cast(pDoc->GetNodes()[nIndex])->GetText());
 rUndoManager.Undo();
 CPPUNIT_ASSERT_EQUAL(u"i"_ustr, 
static_cast(pDoc->GetNodes()[nIndex])->GetText());
+
+// tdf#165973: undo should only remove autoformat - a second undo 
necessary to undo split
+CPPUNIT_ASSERT_EQUAL(2, getParagraphs());
 }
 
 // Unit test for fix inconsistent bookmark behavior around at-char/as-char 
anchored frames
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 58ea61e5c21d..9a69d60e1565 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -179,7 +179,7 @@ void SwEditShell::Overwrite(const OUString &rStr)
 EndAllAction();
 }
 
-void SwEditShell::SplitNode( bool bAutoFormat, bool bCheckTableStart )
+void SwEditShell::SplitNode(bool bCheckTableStart)
 {
 StartAllAction();
 GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::EMPTY, nullptr);
@@ -193,9 +193,6 @@ void SwEditShell::SplitNode( bool bAutoFormat, bool 
bCheckTableStart )
 
 GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::EMPTY, nullptr);
 
-if( bAutoFormat )
-AutoFormatBySplitNode();
-
 ClearTableBoxContent();
 
 EndAllAction();
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index d3787d5dcf44..d8ca509844bd 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -584,7 +584,7 @@ bool SwWrtShell::InsertOleObject( const 
svt::EmbeddedObjectRef& xRef, SwFlyFrame
 }
 
 if ( !bStarMath )
-SwFEShell::SplitNode( false, false );
+SwFEShell::SplitNode(false);
 
 EnterSelFrameMode();
 
@@ -1110,7 +1110,7 @@ void SwWrtShell::InsertColumnBreak()
 {
 if(HasSelection())
 DelRight();
-SwFEShell::SplitNode( false, false );
+SwFEShell::SplitNode(false);
 }
 SetAttrItem(SvxFormatBreakItem(SvxBreak::ColumnBefore, RES_BREAK));
 
@@ -1444,9 +1444,13 @@ void SwWrtShell::SplitNode( bool bAutoFormat )
 bHandled = lcl_FoldedOutlineNodeEndOfParaSplit(this);
 
 if (!bHandled)
-SwFEShell::SplitNode( bAutoFormat );
+SwFEShell::SplitNode();
 
 EndUndo(SwUndoId::SPLITNODE);
+
+// run autoformat after "New Paragraph" undo, so it can be undone 
separately from the newline
+if (!bHandled && bAutoFormat)
+AutoFormatBySplitNode();
 }
 
 // Turn on numbering


core.git: sw/inc

2025-10-10 Thread Mike Kaganski (via logerrit)
 sw/inc/ndtxt.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1f9bf6cf6eb5026b4c5c7c5bb4493afc00ceb598
Author: Mike Kaganski 
AuthorDate: Thu Oct 9 13:35:54 2025 +0200
Commit: Mike Kaganski 
CommitDate: Fri Oct 10 17:46:12 2025 +0200

Use IsTextNode instead of explicit check of m_nNodeType

Change-Id: Iaa46311bcffbc2f2ebea690899d0176dc5bb7385
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192099
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins

diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 78115ffadf8b..93dfd3068996 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -931,12 +931,12 @@ inline SwTextFormatColl* SwTextNode::GetTextColl() const
 /// Inline methods from Node.hxx
 inline SwTextNode *SwNode::GetTextNode()
 {
- return SwNodeType::Text == m_nNodeType ? static_cast(this) : 
nullptr;
+return IsTextNode() ? static_cast(this) : nullptr;
 }
 
 inline const SwTextNode *SwNode::GetTextNode() const
 {
- return SwNodeType::Text == m_nNodeType ? static_cast(this) : nullptr;
+return IsTextNode() ? static_cast(this) : nullptr;
 }
 
 inline void


core.git: sw/inc sw/source

2025-10-09 Thread Noel Grandin (via logerrit)
 sw/inc/fldbas.hxx |2 +-
 sw/source/uibase/fldui/fldmgr.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 966085740e85a3f72084ebf89b2a016e9f094fee
Author: Noel Grandin 
AuthorDate: Thu Oct 9 10:30:46 2025 +0200
Commit: Noel Grandin 
CommitDate: Thu Oct 9 12:28:20 2025 +0200

fix definition of SwFieldTypesEnum::LAST

normally this is used as a special marker for when we
use enum classes with o3tl::enumarray, but I did not convert this correctly
in
  commit ebdf70cc68989d209965768edc8a3bdf27543c48
  Author: Noel Grandin 
  Date:   Fri Sep 20 15:18:01 2019 +0200
  convert SwFieldTypesEnum to scoped enum

Change-Id: I6818d7e0949697b0fce79fa4b9463486199da57b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192091
Reviewed-by: Noel Grandin 
Tested-by: Jenkins

diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 78025f4779c0..425cf1bc2b94 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -144,7 +144,7 @@ enum class SwFieldTypesEnum : sal_uInt16 {
 Dropdown,
 Custom, // Unused - necessary for alignment with aSwFields in 
fldmgr.cxx
 ParagraphSignature,
-LAST,
+LAST = ParagraphSignature,
 Unknown = USHRT_MAX // used by SwFieldMgr::GetCurTypeId
 };
 enum class SwFileNameFormat {
diff --git a/sw/source/uibase/fldui/fldmgr.cxx 
b/sw/source/uibase/fldui/fldmgr.cxx
index d5773e0a5a35..143db366f7d5 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -668,7 +668,7 @@ void SwFieldMgr::GetSubTypes(SwFieldTypesEnum nTypeId, 
std::vector& rT
 //  ACCESS over TYP_...
 sal_uInt16 SwFieldMgr::GetFormatCount(SwFieldTypesEnum nTypeId, bool 
bHtmlMode) const
 {
-assert(nTypeId < SwFieldTypesEnum::LAST && "forbidden TypeId");
+assert(nTypeId <= SwFieldTypesEnum::LAST && "forbidden TypeId");
 {
 const sal_uInt16 nPos = GetPos(nTypeId);
 
@@ -717,7 +717,7 @@ OUString SwFieldMgr::GetFormatStr(const SwField& rField) 
const
 // determine FormatString to a type
 OUString SwFieldMgr::GetFormatStr(SwFieldTypesEnum nTypeId, sal_uInt32 
nFormatId) const
 {
-assert(nTypeId < SwFieldTypesEnum::LAST && "forbidden TypeId");
+assert(nTypeId <= SwFieldTypesEnum::LAST && "forbidden TypeId");
 const sal_uInt16 nPos = GetPos(nTypeId);
 
 if (nPos == USHRT_MAX)


core.git: sw/inc sw/source

2025-09-23 Thread Jim Raykowski (via logerrit)
 sw/inc/strings.hrc |2 +
 sw/source/uibase/utlui/content.cxx |   45 -
 2 files changed, 41 insertions(+), 6 deletions(-)

New commits:
commit d8b0567bb6d86ccba5387e2c6132d915e7c431d0
Author: Jim Raykowski 
AuthorDate: Sun Sep 21 02:05:27 2025 -0800
Commit: Jim Raykowski 
CommitDate: Tue Sep 23 17:46:37 2025 +0200

tdf#166048 Show pages from/to in the Navigator's heading tooltip

Change-Id: If6501e55ee2fd35b4d379c13d789dea0c1d73747
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191306
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 0303d4c509ae..70a339639f9e 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -1573,6 +1573,8 @@
 #define STR_QUERY_CLOSE_TEXT NC_("STR_QUERY_CLOSE_TEXT", "The current index 
entry was modified.")
 #define STR_QUERY_CLOSE_QUESTION NC_("STR_QUERY_CLOSE_QUESTION", "Do you want 
to save changes?")
 
+#define STR_PAGES NNC_("STR_PAGES", "Page: %1", "Pages: %1-%2")
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 2186155012c7..c383efb93290 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -5680,11 +5680,20 @@ IMPL_LINK(SwContentTree, QueryTooltipHdl, const 
weld::TreeIter&, rEntry, OUStrin
 {
 
assert(dynamic_cast(static_cast(pUserData)));
 SwOutlineContent* pOutlineContent = 
static_cast(pUserData);
-SwOutlineNodes::size_type nOutlinePos = 
pOutlineContent->GetOutlinePos();
-const OUString& rOutlineName = pOutlineContent->GetName();
+
+sEntry = pOutlineContent->GetName();
+
 const SwNodes& rNodes = m_pActiveShell->GetDoc()->GetNodes();
 const SwOutlineNodes& rOutlineNodes = rNodes.GetOutLineNds();
-SwNode* pStartNode = rOutlineNodes[nOutlinePos];
+
+SwNode* pStartNode = 
rOutlineNodes[pOutlineContent->GetOutlinePos()];
+
+// Don't show additional info in the tooltip if the outline is 
in footnote/endnote.
+const SwFrame* pFrame
+= 
pStartNode->GetContentNode()->getLayoutFrame(m_pActiveShell->GetLayout());
+if (!pFrame || pFrame->IsInFootnote())
+break;
+
 SwNode* pEndNode = &rNodes.GetEndOfContent();
 
 // tdf#163646 - Show in the tooltip for heading entries in 
Writer Navigator the
@@ -5708,9 +5717,33 @@ IMPL_LINK(SwContentTree, QueryTooltipHdl, const 
weld::TreeIter&, rEntry, OUStrin
 SwPaM aPaM(*pStartNode, *pEndNode);
 SwDocStat aDocStat;
 SwDoc::CountWords(aPaM, aDocStat);
-sEntry = rOutlineName + "
" + SwResId(FLD_STAT_WORD) + ": "
- + OUString::number(aDocStat.nWord) + "
" + SwResId(FLD_STAT_CHAR) + ": "
- + OUString::number(aDocStat.nChar);
+sEntry += "
" + SwResId(FLD_STAT_WORD) + ": " + OUString::number(aDocStat.nWord)
++ "
" + SwResId(FLD_STAT_CHAR) + ": " + OUString::number(aDocStat.nChar);
+
+// tdf#166048 - Show pages from/to in the Navigator's heading 
tooltip
+if (pEndNode != pStartNode)
+{
+SwNodeIndex aIdx(*pEndNode, -1);
+while (aIdx.GetNode().GetEndNode())
+--aIdx;
+pEndNode = &aIdx.GetNode();
+}
+aPaM.GetPoint()->Assign(
+*pEndNode, pEndNode->IsTextNode() ? 
pEndNode->GetTextNode()->Len() : 0);
+
+auto nFirstPage = aPaM.GetPageNum(false);
+if (nFirstPage != 0)
+{
+auto nLastPage = aPaM.GetPageNum();
+sEntry += "
" + SwResId(STR_PAGES, nLastPage ? nLastPage - nFirstPage + 1 : 1);
+if (nLastPage != 0 && nFirstPage < nLastPage)
+{
+sEntry = sEntry.replaceFirst("%1", 
OUString::number(nFirstPage));
+sEntry = sEntry.replaceFirst("%2", 
OUString::number(nLastPage));
+}
+else
+sEntry = sEntry.replaceFirst("%1", 
OUString::number(nFirstPage));
+}
 }
 break;
 case ContentTypeId::GRAPHIC:


core.git: sw/inc sw/source

2025-09-20 Thread Caolán McNamara (via logerrit)
 sw/inc/init.hxx   |2 +-
 sw/inc/swatrset.hxx   |3 ++-
 sw/inc/swmodule.hxx   |7 +++
 sw/source/core/attr/hints.cxx |5 +++--
 sw/source/core/attr/swatrset.cxx  |4 ++--
 sw/source/core/bastyp/init.cxx|8 ++--
 sw/source/core/doc/docnew.cxx |3 ++-
 sw/source/uibase/app/swdll.cxx|8 +++-
 sw/source/uibase/app/swmodule.cxx |   18 ++
 9 files changed, 44 insertions(+), 14 deletions(-)

New commits:
commit 2827bd9e46b697641ddbfac0e698ba67c3965202
Author: Caolán McNamara 
AuthorDate: Tue Aug 26 10:14:28 2025 +0100
Commit: Caolán McNamara 
CommitDate: Wed Sep 10 13:04:00 2025 +0200

move ItemInfoPackageSwAttributes to SwModule

for the edgecase that DeInitVCL isn't called during lokit teardown,
so in a dbgutil version the SolarMutex assert fires when the
g_aItemInfoPackageSwAttributes is destroyed on exit because DeInitVCL
unsets the pDbgTestSolarMutex pointer

In this scenario the SwDLL is still destoyed at a sensible time due
to the unique_disposing_solar_mutex_reset_ptr SwDLLInstance. So move
the ItemInfoPackageSwAttributes to someplace which SwDLLInstance
shutdown can clear it, SwModule seems like the sensible place as
its the owner of the primorial SwAttrPool, so make SwModule
own the ItemInfoPackageSwAttributes

Change-Id: I0f075ee5b488df5a8011648457779eddbbd95c37
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190207
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190736
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/inc/init.hxx b/sw/inc/init.hxx
index 5c6e358c0a01..11c9936b14b6 100644
--- a/sw/inc/init.hxx
+++ b/sw/inc/init.hxx
@@ -32,7 +32,7 @@ class ItemInfoPackage;
 
 void InitCore();   // bastyp/init.cxx
 void FinitCore();
-ItemInfoPackage& getItemInfoPackageSwAttributes();
+std::unique_ptr createItemInfoPackageSwAttributes();
 
 namespace sw {
 
diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx
index ead0d7dcb11c..8e3df5fcb145 100644
--- a/sw/inc/swatrset.hxx
+++ b/sw/inc/swatrset.hxx
@@ -27,6 +27,7 @@
 class SwDoc;
 class OutputDevice;
 class IDocumentSettingAccess;
+class ItemInfoPackage;
 class SvxPostureItem;
 class SvxWeightItem;
 class SvxShadowedItem;
@@ -149,7 +150,7 @@ private:
 SwDoc& m_rDoc;
 
 public:
-SwAttrPool( SwDoc& rDoc );
+SwAttrPool(ItemInfoPackage& rInfoPackage, SwDoc& rDoc);
 private:
 virtual ~SwAttrPool() override;
 public:
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index fbd29640a160..d860b75f62af 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -36,6 +36,7 @@
 #include "fldupde.hxx"
 
 class Color;
+class ItemInfoPackage;
 class SfxItemSet;
 class SfxRequest;
 class SfxErrorHandler;
@@ -94,6 +95,7 @@ class SAL_DLLPUBLIC_RTTI SwModule final : public SfxModule, 
public SfxListener,
 
 std::unique_ptr m_xTableAutoFormatTable;
 
+std::unique_ptr m_xItemInfoPackageSwAttributes;
 
 // Current view is held here in order to avoid one's being forced
 // to work via GetActiveView.
@@ -233,6 +235,11 @@ public:
 virtual std::unique_ptr CreateTabPage( sal_uInt16 nId, 
weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& 
rSet ) override;
 SW_DLLPUBLIC virtual SfxStyleFamilies CreateStyleFamilies() override;
 
+voidInitItemInfoPackageSwAttributes();
+voidRemoveItemInfoPackageSwAttributes();
+
+ItemInfoPackage& getItemInfoPackageSwAttributes();
+
 // Invalidates online spell-wrong-lists if necessary.
 static void  CheckSpellChanges( bool bOnlineSpelling,
 bool bIsSpellWrongAgain, bool bIsSpellAllAgain, bool 
bSmartTags );
diff --git a/sw/source/core/attr/hints.cxx b/sw/source/core/attr/hints.cxx
index 8aaabaf26816..a585aa81453a 100644
--- a/sw/source/core/attr/hints.cxx
+++ b/sw/source/core/attr/hints.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -136,11 +137,11 @@ const SfxPoolItem* GetDfltAttr(sal_uInt16 nWhich)
 {
 #ifdef DBG_UTIL
 OSL_ASSERT(nWhich < POOLATTR_END && nWhich >= POOLATTR_BEGIN);
-const SfxPoolItem* 
pRetval(getItemInfoPackageSwAttributes().getExistingItemInfo(nWhich - 
POOLATTR_BEGIN).getItem());
+const SfxPoolItem* 
pRetval(SwModule::get()->getItemInfoPackageSwAttributes().getExistingItemInfo(nWhich
 - POOLATTR_BEGIN).getItem());
 OSL_ENSURE(pRetval, "GetDfltFormatAttr(): Dflt == 0");
 return pRetval;
 #else
-return getItemInfoPackageSwAttributes().getExistingItemInfo(nWhich - 
POOLATTR_BEGIN).getItem();
+return 
SwModule::get()->getItemInfoPackageSwAttributes().getExistingItemInfo(nWhich - 
POOLATTR_BEGIN).getItem();
 #endif
 }
 
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index 76865e745aac..f7f49dcef96e 100644
--- a

core.git: sw/inc sw/qa sw/source

2025-09-19 Thread Justin Luth (via logerrit)
 sw/inc/editsh.hxx|8 +--
 sw/qa/uitest/data/tdf114343_titlePageDialog.odt  |binary
 sw/qa/uitest/data/tdf114343_titlePageDialogB.odt |binary
 sw/qa/uitest/writer_tests5/titlePageWizard3.py   |   52 +++
 sw/source/ui/misc/titlepage.cxx  |3 +
 5 files changed, 59 insertions(+), 4 deletions(-)

New commits:
commit 932c8227717f44877d77659c444845d39f4156ce
Author: Justin Luth 
AuthorDate: Thu Sep 18 11:34:59 2025 -0400
Commit: Justin Luth 
CommitDate: Fri Sep 19 22:41:54 2025 +0200

tdf#114343 titlepage: DoSpecialInsert (Alt-Enter) when necessary

If the document starts with a TOC or a table,
then the title page wizard (Format - Title page)
fails to (properly) insert a page before.

(note that while it DID insert a page before the TOC,
that para-with-page-break is all still "part of the TOC"
and so when the TOC is refreshed, the page break is lost.)

make -srj1 UITest_writer_tests5 \
UITEST_TEST_NAME=titlePageWizard3.tdf114343.test_tdf114343 \
SAL_USE_VCLPLUGIN=gen

make -srj1 UITest_writer_tests5 \
UITEST_TEST_NAME=titlePageWizard3.tdf114343.test2_tdf114343 \
SAL_USE_VCLPLUGIN=gen

Change-Id: I0eb865259889601c0918096d8dd51fc50d0dca52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191164
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index f66ede9d56e2..990bb7adc07a 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -911,10 +911,10 @@ public:
 
 /** Special insert: Insert a new text node just before or after a section 
or
  table, if the cursor is positioned at the start/end of said
- section/table. The purpose of the method is to allow users to inert text
- at certain 'impossible' position, e.g. before a table at the document
- start or between to sections. */
-void DoSpecialInsert();
+ section/table. The purpose of the method is to allow users to insert text
+ at certain 'impossible' positions, e.g. before a table at the document
+ start or between two sections. */
+SW_DLLPUBLIC void DoSpecialInsert();
 bool CanSpecialInsert() const;
 
 /// Optimizing UI.
diff --git a/sw/qa/uitest/data/tdf114343_titlePageDialog.odt 
b/sw/qa/uitest/data/tdf114343_titlePageDialog.odt
new file mode 100644
index ..ca943ce51799
Binary files /dev/null and b/sw/qa/uitest/data/tdf114343_titlePageDialog.odt 
differ
diff --git a/sw/qa/uitest/data/tdf114343_titlePageDialogB.odt 
b/sw/qa/uitest/data/tdf114343_titlePageDialogB.odt
new file mode 100644
index ..3b1d1bbb21fb
Binary files /dev/null and b/sw/qa/uitest/data/tdf114343_titlePageDialogB.odt 
differ
diff --git a/sw/qa/uitest/writer_tests5/titlePageWizard3.py 
b/sw/qa/uitest/writer_tests5/titlePageWizard3.py
new file mode 100644
index ..599733d0ae2f
--- /dev/null
+++ b/sw/qa/uitest/writer_tests5/titlePageWizard3.py
@@ -0,0 +1,52 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_url_for_data_file
+#import time
+
+# This tests the Format->Title Page wizard, specifically inserting pages 
before a TOC or table,
+# which are edge cases. (The TOC is harder to test because it works but gets 
lost on a TOC update.)
+class tdf114343(UITestCase):
+def test_tdf114343(self):  # table test
+with 
self.ui_test.load_file(get_url_for_data_file("tdf114343_titlePageDialog.odt")) 
as document:
+
+# Confirm the starting state.
+self.assertEqual(document.CurrentController.PageCount, 1)
+#time.sleep(2)
+
+#dialog Title Page
+with 
self.ui_test.execute_dialog_through_command(".uno:TitlePageDialog") as xDialog:
+#Insert three title/index pages at the end of the document 
(plus a content page).
+newPages = xDialog.getChild("RB_INSERT_NEW_PAGES")
+newPages.executeAction("CLICK", tuple())
+#time.sleep(4)
+
+# an extra paragraph was added before TOC/Table so splitNode could 
work.
+self.assertEqual(document.CurrentController.PageCount, 2)
+#time.sleep(5)
+
+def test2_tdf114343(self):  # TOC test
+with 
self.ui_test.load_file(get_url_for_data_file("tdf114343_titlePageDialogB.odt")) 
as document:
+
+# Confirm the starting state.
+self.assertEqual(document.CurrentController.PageCount, 1)
+
+#dialog Title Page
+with 
self.ui_test.execute_dialog_through_command(".uno:TitlePageDialog") as xDialog:
+  

core.git: sw/inc

2025-09-17 Thread Miklos Vajna (via logerrit)
 sw/inc/docufld.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit fde51a00cc17d3bbc279b27ac730b7c9f4f0b920
Author: Miklos Vajna 
AuthorDate: Wed Sep 17 08:53:40 2025 +0200
Commit: Miklos Vajna 
CommitDate: Wed Sep 17 14:37:11 2025 +0200

sw: document SwAuthorField

I.e. current user on the UI is an author field, not a doc info field.

Change-Id: I9bb4c7e01697cbb786b9edd9ba59253053e10c2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191081
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index a0d3a4873429..af8e996abaf8 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -206,6 +206,8 @@ public:
 virtual std::unique_ptr Copy() const override;
 };
 
+/// Insert -> Field -> More fields -> Document -> Author -> Name on the UI.  
This expands to the
+/// name of the current user, first author would be an SwDocInfoField.
 class SAL_DLLPUBLIC_RTTI SwAuthorField final : public SwField
 {
 OUString m_aContent;


core.git: sw/inc sw/source

2025-09-16 Thread Miklos Vajna (via logerrit)
 sw/inc/frmfmt.hxx|2 ++
 sw/source/core/layout/atrfrm.cxx |   14 ++
 2 files changed, 16 insertions(+)

New commits:
commit d59b4fd985f147eda04746e27678762598add6f4
Author: Miklos Vajna 
AuthorDate: Tue Sep 16 08:17:24 2025 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 16 18:33:08 2025 +0200

sw doc model xml dump: handle SwFlyFrameFormat

Turns out this can have an own title/description which is not on the
underlying SdrObject, show this.

Change-Id: I536d9d6b65c2eb65140d8aeb3a1ff65cf29f6995
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191039
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 43f94cfaf7e8..2644f912a4d0 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -269,6 +269,8 @@ public:
 void SetLastFlyFramePrtRectPos( const Point &rPoint ) { 
m_aLastFlyFramePrtRectPos = rPoint; }
 
 SwFlyDrawContact* GetOrCreateContact();
+
+void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
 //The DrawFrame-Format
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index cc5bcf24599f..3fd54049de1b 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -3052,6 +3052,20 @@ SwFlyDrawContact* SwFlyFrameFormat::GetOrCreateContact()
 return m_pContact.get();
 }
 
+void SwFlyFrameFormat::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFlyFrameFormat"));
+(void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", 
this);
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("title"),
+  BAD_CAST(msTitle.toUtf8().getStr()));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("desc"),
+  BAD_CAST(msDesc.toUtf8().getStr()));
+
+sw::SpzFrameFormat::dumpAsXml(pWriter);
+
+(void)xmlTextWriterEndElement(pWriter);
+}
+
 /// Creates the Frames if the format describes a paragraph-bound frame.
 /// MA: 1994-02-14: creates the Frames also for frames anchored at page.
 void SwFlyFrameFormat::MakeFrames()


core.git: sw/inc sw/source

2025-09-10 Thread Justin Luth (via logerrit)
 sw/inc/pagedesc.hxx|3 +
 sw/source/core/layout/pagedesc.cxx |   54 +
 sw/source/uibase/app/docst.cxx |3 +
 sw/source/uibase/app/docstyle.cxx  |7 ++-
 sw/source/uibase/docvw/HeaderFooterWin.cxx |8 ++--
 sw/source/uibase/inc/uitool.hxx|3 +
 sw/source/uibase/utlui/uitool.cxx  |   35 --
 7 files changed, 94 insertions(+), 19 deletions(-)

New commits:
commit 7d6bdb4e2aa08a829b0ecb5fbe990d0abdadfd75
Author: Justin Luth 
AuthorDate: Sat Aug 30 09:48:17 2025 -0400
Commit: Justin Luth 
CommitDate: Thu Sep 11 01:41:13 2025 +0200

tdf#168196 sw: copy header properties to all (first, even, odd)

Although a page style can have different CONTENTS
on left, right, and first pages,
the other header properties are the same/duplicated.

This patch tries to set up the plumbing,
and implements it for both the Borders and Background context dialog
as well as for the general Page Style dialog.

Unfortunately, our current implementation
does not use an actual shared format,
so the properties must be duplicated 4 times,
and yet sadly I couldn't find any existing mechanism
that attempted to keep them in sync.

Doing it properly doesn't sound like copy/paste,
so not something that I would attempt.

I don't see any interoperability reasons in DOC/DOCX
that would force the properties to be kept separate.
Certainly for ODF, it appears that only Master is exported
(in terms of the header and footer properties).

tdf#18 was a nice duplicate report that pointed out the need
for FillHdFt to be used in order for Height/Spacing
to also be affected.
Otherwise SID_ATTR_PAGE_SIZE and SID_ATTR_PAGE_DYNAMIC
were just ignored as !GetRanges().doesContainWhich(nWhich)

Change-Id: I94f8cdf8bc6006dbea80941a2d6756e162f82411
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190420
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index c213b03bf34c..0113371b7de8 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -244,6 +244,9 @@ public:
 const SwFrameFormat &GetFirstMaster() const { return m_FirstMaster; }
 const SwFrameFormat &GetFirstLeft()   const { return m_FirstLeft; }
 
+/// Set format properties on all non-shared odd/even/first headers (or 
footers)
+bool SetFormatAttrOnAll(const SfxItemSet& rSet, const bool bHeader);
+
 /** Reset all attrs of the format but keep the ones a pagedesc
cannot live without. */
 inline void ResetAllMasterAttr();
diff --git a/sw/source/core/layout/pagedesc.cxx 
b/sw/source/core/layout/pagedesc.cxx
index a65f3332a792..780123d62452 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -423,6 +424,59 @@ void SwPageDesc::ChgFirstShare( bool bNew )
 m_eUse &= UseOnPage::NoFirstShare;
 }
 
+bool SwPageDesc::SetFormatAttrOnAll(const SfxItemSet& rSet, const bool bHeader)
+{
+if( !rSet.Count() )
+return false;
+
+// Warning: no attempt is made here to limit rSet to properties that are 
"safe"
+// to duplicate to all of the different headers/footers.
+assert(!rSet.HasItem(RES_CNTNT) && "unexpected use of 
SwPageDesc::SetFormatAttrOnAll");
+
+bool bRet = false;
+if (bHeader)
+{
+auto pHF = 
const_cast(GetMaster().GetHeader().GetHeaderFormat());
+bRet = pHF && pHF->SetFormatAttr(rSet);
+if (bRet && !IsFirstShared())
+{
+pHF = 
const_cast(GetFirstMaster().GetHeader().GetHeaderFormat());
+pHF && pHF->SetFormatAttr(rSet);
+}
+if (bRet && !IsHeaderShared())
+{
+pHF = 
const_cast(GetLeft().GetHeader().GetHeaderFormat());
+pHF && pHF->SetFormatAttr(rSet);
+if (!IsFirstShared())
+{
+pHF = 
const_cast(GetFirstLeft().GetHeader().GetHeaderFormat());
+pHF && pHF->SetFormatAttr(rSet);
+}
+}
+}
+else // footer
+{
+auto pHF = 
const_cast(GetMaster().GetFooter().GetFooterFormat());
+bRet = pHF && pHF->SetFormatAttr(rSet);
+if (bRet && !IsFirstShared())
+{
+pHF = 
const_cast(GetFirstMaster().GetFooter().GetFooterFormat());
+pHF && pHF->SetFormatAttr(rSet);
+}
+if (bRet && !IsFooterShared())
+{
+pHF = 
const_cast(GetLeft().GetFooter().GetFooterFormat());
+pHF && pHF->SetFormatAttr(rSet);
+if (bRet && !IsFirstShared())
+{
+pHF= 
const_cast(GetFirstLeft().GetFooter().GetFooterFormat());
+pHF && pHF->SetFormatAttr(rSet);
+}
+}
+}
+ 

core.git: sw/inc sw/source

2025-09-10 Thread Xisco Fauli (via logerrit)
 sw/inc/view.hxx|4 ++--
 sw/source/core/text/inftxt.cxx |4 ++--
 sw/source/uibase/docvw/edtwin2.cxx |4 ++--
 sw/source/uibase/uiview/view0.cxx  |6 +++---
 4 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit c2930f9721f5186c5cc96d6ff28eeaa10c205e60
Author: Xisco Fauli 
AuthorDate: Wed Sep 10 10:34:06 2025 +0200
Commit: Xisco Fauli 
CommitDate: Wed Sep 10 12:23:07 2025 +0200

sw: rename variable

To be inline with the other ones
after
commit 6fc54eea2f904a6704495f6b53fd5eff0dff1496
Author: Xisco Fauli 
Date:   Mon Sep 8 19:55:45 2025 +0200

crashreport: avoid crash in InspectorTextPanel

Change-Id: If3ac530ee069a9d1ed308c96a0633cad40cbe78c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190737
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index 7380d225139c..843536a5026d 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -272,7 +272,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
 
 int m_nMaxOutlineLevelShown = 10;
 
-bool m_bIsHighlightCharDF = false;
+bool m_bIsSpotlightCharDF = false;
 bool m_bIsSpotlightParaStyles = false;
 bool m_bIsSpotlightCharStyles = false;
 
@@ -734,7 +734,7 @@ public:
 virtual void flushPendingLOKInvalidateTiles() override;
 virtual std::optional getLOKPayload(int nType, int nViewId) const 
override;
 
-bool IsHighlightCharDF() const { return m_bIsHighlightCharDF; }
+bool IsSpotlightCharDF() const { return m_bIsSpotlightCharDF; }
 bool IsSpotlightParaStyles() const { return m_bIsSpotlightParaStyles; }
 bool IsSpotlightCharStyles() const { return m_bIsSpotlightCharStyles; }
 
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index a9333e66b9b4..4f6eca343c12 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1375,7 +1375,7 @@ void SwTextPaintInfo::DrawCSDFHighlighting(const 
SwLinePortion &rPor) const
 if (!pView)
 return;
 
-if (!pView->IsSpotlightCharStyles() && !pView->IsHighlightCharDF())
+if (!pView->IsSpotlightCharStyles() && !pView->IsSpotlightCharDF())
 return;
 
 SwRect aRect;
@@ -1430,7 +1430,7 @@ void SwTextPaintInfo::DrawCSDFHighlighting(const 
SwLinePortion &rPor) const
 }
 }
 // not character style formatted
-else if (pView->IsHighlightCharDF())
+else if (pView->IsSpotlightCharDF())
 {
 const std::vector aHiddenProperties{ UNO_NAME_RSID,
 UNO_NAME_PARA_IS_NUMBERING_RESTART,
diff --git a/sw/source/uibase/docvw/edtwin2.cxx 
b/sw/source/uibase/docvw/edtwin2.cxx
index d087cc2c666c..7da57f94f37c 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -105,7 +105,7 @@ bool PSCSDFPropsQuickHelp(const HelpEvent &rEvt, 
SwWrtShell& rSh)
 UIName sText;
 SwView& rView = rSh.GetView();
 
-if (rView.IsHighlightCharDF() || rView.IsSpotlightParaStyles()
+if (rView.IsSpotlightCharDF() || rView.IsSpotlightParaStyles()
 || rView.IsSpotlightCharStyles())
 {
 SwPosition aPos(rSh.GetDoc()->GetNodes());
@@ -150,7 +150,7 @@ bool PSCSDFPropsQuickHelp(const HelpEvent &rEvt, 
SwWrtShell& rSh)
 sText = SwStyleNameMapper::GetUIName(ProgName(sCharStyle), 
SwGetPoolIdFromName::ChrFmt);
 }
 
-if (sText.isEmpty() && rView.IsHighlightCharDF())
+if (sText.isEmpty() && rView.IsSpotlightCharDF())
 {
 // check if in direct formatting highlighted area
 const std::vector aHiddenProperties{ UNO_NAME_RSID,
diff --git a/sw/source/uibase/uiview/view0.cxx 
b/sw/source/uibase/uiview/view0.cxx
index 0147e3679cba..e88730ce0ba7 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -360,7 +360,7 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
   aBool.SetValue( pOpt->IsShowChangesInMargin() );
 break;
 case SID_SPOTLIGHT_CHAR_DF:
-  aBool.SetValue(m_bIsHighlightCharDF);
+  aBool.SetValue(m_bIsSpotlightCharDF);
 break;
 case SID_SPOTLIGHT_PARASTYLES:
 aBool.SetValue(m_bIsSpotlightParaStyles);
@@ -596,8 +596,8 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
 
 case SID_SPOTLIGHT_CHAR_DF:
 if (STATE_TOGGLE == eState)
-bFlag = !m_bIsHighlightCharDF;
-m_bIsHighlightCharDF = bFlag;
+bFlag = !m_bIsSpotlightCharDF;
+m_bIsSpotlightCharDF = bFlag;
 break;
 
 case SID_SPOTLIGHT_PARASTYLES:


core.git: sw/inc sw/qa sw/source

2025-09-03 Thread Michael Stahl (via logerrit)
 sw/inc/ndarr.hxx |7 -
 sw/qa/extras/uiwriter/data/floattable-split.docx |binary
 sw/qa/extras/uiwriter/uiwriter9.cxx  |  148 +++
 sw/source/core/docnode/ndtbl.cxx |  141 -
 sw/source/core/inc/UndoTable.hxx |7 -
 sw/source/core/undo/untbl.cxx|   25 +++
 sw/source/uibase/inc/wrtsh.hxx   |2 
 7 files changed, 315 insertions(+), 15 deletions(-)

New commits:
commit fc53ab8e76fb49141fe48e4b82ba318b4334de9b
Author: Michael Stahl 
AuthorDate: Thu Aug 21 18:00:02 2025 +0200
Commit: Miklos Vajna 
CommitDate: Wed Sep 3 11:22:11 2025 +0200

sw: floating table split

The problem is that the Table Split feature on a floating table results
in 2 tables inside 1 frame, which then cannot be exported to DOCX as a
floating table.

Split the fly frame in this case, and add an anchor node because every
floating table needs its own anchor node.

Change-Id: I7444a75a953fcea60ffc92c2fa7eaca1b044f54b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190009
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
(cherry picked from commit 6f55b9a74f8fdd8609e1aa72388a5f8b97dfcea0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190075
Tested-by: Jenkins

diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index b70f4af211f2..e674cc70ff88 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "bparr.hxx"
 #include "ndtyp.hxx"
@@ -38,6 +39,7 @@ class SwAttrSet;
 class SfxItemSet;
 class SwContentNode;
 class SwDoc;
+class SwFrameFormat;
 class SwGrfFormatColl;
 class SwGrfNode;
 class SwNode;
@@ -301,11 +303,14 @@ public:
Is the flag bCalcNewSize set to TRUE, the new SSize for both
tables is calculated from the Maximum of the boxes, provided
SSize is set "absolute" (LONG_MAX).
-   (Momentarily this is needed only for the RTF-parser.) */
+ */
 SwTableNode* SplitTable( SwNode& rPos, bool bAfter = true,
 bool bCalcNewSize = false );
+void SplitFloatingTableFrame(SwTableNode & rNewTableNode,
+::std::tuple 
floatingFrame);
 /// Two Tables that are following one another are merged.
 bool MergeTable( SwNode& rPos, bool bWithPrev = true );
+void MergeFloatingTableFrame(SwNodeOffset nEndOfOldFlyIndex);
 
 /// Insert a new SwSection.
 SwSectionNode* InsertTextSection(SwNode& rNd,
diff --git a/sw/qa/extras/uiwriter/data/floattable-split.docx 
b/sw/qa/extras/uiwriter/data/floattable-split.docx
new file mode 100644
index ..2e2c9c705df9
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/floattable-split.docx 
differ
diff --git a/sw/qa/extras/uiwriter/uiwriter9.cxx 
b/sw/qa/extras/uiwriter/uiwriter9.cxx
index ef1ad2deb2ae..ebf852b7dc1b 100644
--- a/sw/qa/extras/uiwriter/uiwriter9.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter9.cxx
@@ -271,6 +271,154 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf159377)
 CPPUNIT_ASSERT_EQUAL(SwNodeOffset(28), pDoc->GetNodes().Count());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testSplitFloatingTable)
+{
+createSwDoc("floattable-split.docx");
+
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+
+{
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+// apparently follow fly is on the text frame of page 1 even though
+// positioned on page 2...
+assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly", 2);
+assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly/txt", 0);
+assertXPath(pXmlDoc,
+"/root/page[1]/body/txt[2]/anchored/fly[infos/bounds/@top 
< "
+"/root/page[2]/infos/bounds/@top]/tab",
+1);
+assertXPath(pXmlDoc,
+"/root/page[1]/body/txt[2]/anchored/fly[infos/bounds/@top 
> "
+"/root/page[2]/infos/bounds/@top]/tab",
+1);
+assertXPath(pXmlDoc,
+"/root/page[1]/body/txt[2]/anchored/fly[infos/bounds/@top 
< "
+"/root/page[2]/infos/bounds/@top]/tab/row",
+5);
+assertXPath(pXmlDoc,
+"/root/page[1]/body/txt[2]/anchored/fly[infos/bounds/@top 
> "
+"/root/page[2]/infos/bounds/@top]/tab/row",
+4);
+}
+
+pWrtShell->GotoFly(UIName{ u"Frame1"_ustr });
+pWrtShell->Down(/*bSelect=*/false, 3);
+
+pWrtShell->SplitTable(SplitTable_HeadlineOption::BorderCopy);
+
+{
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly", 1);
+assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly/txt", 0);
+assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/anchored/fly/tab", 1

core.git: sw/inc sw/qa sw/source

2025-09-02 Thread Mike Kaganski (via logerrit)
 sw/inc/PostItMgr.hxx|   16 
 sw/qa/extras/uiwriter/data/tdf108791_comments_with_tracked_changes.docx |binary
 sw/qa/extras/uiwriter/data/tdf108791_comments_with_tracked_changes.fodt |   40 
+
 sw/qa/extras/uiwriter/uiwriter11.cxx|  290 
++
 sw/source/uibase/docvw/AnnotationWin.cxx|1 
 sw/source/uibase/docvw/PostItMgr.cxx|   44 
+
 6 files changed, 390 insertions(+), 1 deletion(-)

New commits:
commit 3bf75e92e9ea089b707cb4e163def156ad28f7e0
Author: Mike Kaganski 
AuthorDate: Fri Aug 29 19:11:39 2025 +0500
Commit: Mike Kaganski 
CommitDate: Tue Sep 2 19:53:45 2025 +0200

tdf#108791: Ignore deleted comments in redlines of non-native documents

ODF (and its native applications) can properly handle redline data of
deleted comments. Other formats (or rather, respective applications
like MS Word) don't understand the "comment anchor deletion" markup,
and show the deleted comment as normal.

Commit 419b70b5d4db227509614bdea5b4b89bcf7a6032 (tdf#105485 DOCX: import
deleted comments as deleted, 2019-08-26) had implemented correct round-
trip of the redline through DOCX. However, since Word doesn't support
that, it created a situation when users can't correctly collaborate on
documents.

This change introduces a special handling of all non-native file formats
in Writer, where deletion of a comment is handled just as in Word: it is
deleted immediately, instead of marking as deleted. This doesn't affect
deleting ranges of text, which contain comments: they are handled by
both Writer and Word correctly.

The solution works without any compatibility flags. This allows to have
consistent behavior (same types of files will work the same way on all
systems), zero configuration, and maximum functionality using native
formats, unaffected by any settings.

Change-Id: I2f8d3caaecd78af38e11a1ab6900d0afd73ed614
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190376
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index 02acfcdd7b99..9ea58c7fa1d5 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -206,7 +206,7 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr final : public 
SfxListener,
 tools::Long GetNextBorder();
 
 sw::annotation::SwAnnotationWin* GetActiveSidebarWin() { return 
mpActivePostIt; }
-void SetActiveSidebarWin( sw::annotation::SwAnnotationWin* p);
+SW_DLLPUBLIC void SetActiveSidebarWin( 
sw::annotation::SwAnnotationWin* p);
 SW_DLLPUBLIC bool HasActiveSidebarWin() const;
 bool HasActiveAnnotationWin() const;
 void GrabFocusOnActiveSidebarWin();
@@ -253,6 +253,20 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr final : public 
SfxListener,
 void PaintTile(OutputDevice& rRenderContext);
 
 sw::sidebarwindows::SidebarPosition GetSidebarPos(const Point& 
rPointLogic);
+
+// The commands that directly delete comments (as opposed to deletion 
of the text that the
+// comments are anchored to) behave differently, depending on the 
document type, when the
+// change tracking is on. For ODF, we allow comments to be marked as 
deleted; for external
+// document types, we delete them immediately, as if change tracking 
os off.
+class CommentDeleteFlagsRestore
+{
+public:
+virtual ~CommentDeleteFlagsRestore() = default;
+};
+// Checks if the respective configuration must be changed for 'delete' 
operation, makes the
+// change if needed, and returns a RAII object that will restore the 
original configuration
+// in its dtor.
+[[nodiscard]] std::unique_ptr 
ConfigureForCommentDelete();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git 
a/sw/qa/extras/uiwriter/data/tdf108791_comments_with_tracked_changes.docx 
b/sw/qa/extras/uiwriter/data/tdf108791_comments_with_tracked_changes.docx
new file mode 100644
index ..9eefbdd403b0
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf108791_comments_with_tracked_changes.docx differ
diff --git 
a/sw/qa/extras/uiwriter/data/tdf108791_comments_with_tracked_changes.fodt 
b/sw/qa/extras/uiwriter/data/tdf108791_comments_with_tracked_changes.fodt
new file mode 100644
index ..ed727ab0fd69
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf108791_comments_with_tracked_changes.fodt
@@ -0,0 +1,40 @@
+
+
+http://openoffice.org/2004/office"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:sty

core.git: sw/inc sw/source

2025-09-01 Thread Justin Luth (via logerrit)
 sw/inc/editsh.hxx  |2 +-
 sw/inc/swtypes.hxx |3 ++-
 sw/source/core/edit/edfcol.cxx |8 
 sw/source/uibase/app/docst.cxx |   10 +-
 4 files changed, 12 insertions(+), 11 deletions(-)

New commits:
commit 1dbab9fe00e6fd0b1fa881fabcac2488ade00a37
Author: Justin Luth 
AuthorDate: Wed Aug 27 15:45:58 2025 -0400
Commit: Justin Luth 
CommitDate: Mon Sep 1 15:56:11 2025 +0200

related tdf#162326: fix missed bResetListAttrs when bResetAllCharAttrs

Although more flexible,
there was no need to pass a SetAttrMode to SetTextFormatColl,
and it introduced a situation
where bResetListAttrs was NOT forced to true
despite what REMOVE_ALL_ATTRS (should have) documented
after commit 075560420a7aa238182e2d80dfe1c5fbaad3edbd.

Instead of choosing to set bRestListAttrs |= bResetAllCharAttrs
I decided to simply pass in a boolean instead.
Everything is much more readable that way.

Change-Id: I4aa2256dd2cdefc962682067f51ca26de253
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190311
Reviewed-by: Justin Luth 
Tested-by: Jenkins

diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index b78e16336ba7..f66ede9d56e2 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -339,7 +339,7 @@ public:
 /// Add 2nd optional parameter  - see also 

 SW_DLLPUBLIC void SetTextFormatColl(SwTextFormatColl*,
 const bool bResetListAttrs = false,
-SetAttrMode nMode = SetAttrMode::DEFAULT);
+const bool bResetAllCharAttrs = false);
 SW_DLLPUBLIC SwTextFormatColl *MakeTextFormatColl(const UIName 
&rFormatCollName,
 SwTextFormatColl *pDerivedFrom = nullptr);
 void FillByEx(SwTextFormatColl*);
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 8f61ef20a63a..a6e54c491e9c 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -153,7 +153,8 @@ enum class SetAttrMode
 NOHINTEXPAND= 0x0100,
 /// don't change the cursor position
 NO_CURSOR_CHANGE = 0x0200,
-// remove all char attributes and char styles when para/char styles are 
applied
+/// remove all char attributes and char styles when para/char styles are 
applied
+/// as well as removing list attributes (when para styles are applied)
 REMOVE_ALL_ATTR = 0x0400
 };
 namespace o3tl
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index c18893a9ee8b..fc4bb02073ee 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -2204,9 +2204,8 @@ void SwEditShell::ClassifyDocPerHighestParagraphClass()
 }
 
 // #i62675#
-void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat,
-const bool bResetListAttrs,
-SetAttrMode nMode)
+void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat, const bool 
bResetListAttrs,
+const bool bResetAllCharAttrs)
 {
 SwTextFormatColl *pLocal = pFormat? pFormat: 
(*GetDoc()->GetTextFormatColls())[0];
 StartAllAction();
@@ -2236,7 +2235,8 @@ void SwEditShell::SetTextFormatColl(SwTextFormatColl 
*pFormat,
 }
 
 // Change the paragraph style to pLocal and remove all direct 
paragraph formatting.
-GetDoc()->SetTextFormatColl(rPaM, pLocal, true, bResetListAttrs, 
!!(nMode & SetAttrMode::REMOVE_ALL_ATTR), GetLayout());
+GetDoc()->SetTextFormatColl(rPaM, pLocal, true, bResetListAttrs, 
bResetAllCharAttrs,
+GetLayout());
 
 // If there are hints on the nodes which cover the whole node, 
then remove those, too.
 SwPaM aPaM(*rPaM.Start(), *rPaM.End());
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 37f3d8a35220..989eeaa871ec 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -1221,7 +1221,8 @@ bool SwDocShell::MakeInlineHeading(SwWrtShell *pSh, 
SwTextFormatColl* pColl, con
 pSh->MoveSection( GoCurrSection, fnSectionEnd );
 pSh->SelAll();
 
-pSh->SetTextFormatColl( pColl, true, (nMode & KEY_MOD1) ? 
SetAttrMode::REMOVE_ALL_ATTR : SetAttrMode::DEFAULT);
+const bool bResetAllCharAttrs(nMode & KEY_MOD1);
+pSh->SetTextFormatColl(pColl, true, bResetAllCharAttrs);
 
 // zero the upper and lower margins of the paragraph (also an 
interoperability issue)
 SfxItemSetFixed 
aSet2(pSh->GetAttrPool());
@@ -1292,12 +1293,11 @@ SfxStyleFamily SwDocShell::ApplyStyles(const OUString 
&rName, SfxStyleFamily nFa
 // #i62675#
 // clear also list attributes at affected text nodes, if 
paragraph
 // style has the list style attribute set.
-const SetAttrMode nAttrModeFlag
-= (nMode & KEY_MOD1) ? SetAttrMode::REMOVE_ALL_ATTR : 
SetAttrMode::DEFAULT;
+const bool bRes

core.git: sw/inc sw/qa sw/source

2025-08-29 Thread Miklos Vajna (via logerrit)
 sw/inc/editsh.hxx  |2 -
 sw/qa/filter/md/md.cxx |   51 +
 sw/source/filter/md/wrtmd.cxx  |   32 -
 sw/source/filter/md/wrtmd.hxx  |6 
 sw/source/uibase/inc/wrtsh.hxx |2 -
 5 files changed, 90 insertions(+), 3 deletions(-)

New commits:
commit bcef97f29a7126cb3469066de4bacafaae30f86a
Author: Miklos Vajna 
AuthorDate: Fri Aug 29 09:03:06 2025 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 29 13:35:14 2025 +0200

tdf#168152 sw markdown export: handle lists

Support the following cases:

1) Toplevel bullet list

2) Nested bullet list (needs indentation)

3) Toplevel numbered list

4) Nested numbered list

This is similar to how the ascii export adds an indent, bullets and
numbering for text nodes with a numbering rule, but
 examples 294 -> 297
shows that the markdown indent has to be dynamic, based on the size of
the parent prefix, so write dynamic amount of indent, instead of the
ascii export's fixed 4 spaces.

Change-Id: Ia9eb0c718fc5f5334f19b592245b50bd32e8bd3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190361
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 1abfe2c85134..b78e16336ba7 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -529,7 +529,7 @@ public:
 void NoNum();
 
 /// Delete, split enumeration list.
-void DelNumRules();
+SW_DLLPUBLIC void DelNumRules();
 
 SW_DLLPUBLIC void NumUpDown( bool bDown = true );
 
diff --git a/sw/qa/filter/md/md.cxx b/sw/qa/filter/md/md.cxx
index 352bc6d35847..94d4fa618df1 100644
--- a/sw/qa/filter/md/md.cxx
+++ b/sw/qa/filter/md/md.cxx
@@ -218,6 +218,57 @@ CPPUNIT_TEST_FIXTURE(Test, testExportingCodeSpan)
 CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testExportingList)
+{
+// Given a document that has both toplevel/nested bullets/numberings:
+createSwDoc();
+SwDocShell* pDocShell = getSwDocShell();
+SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+pWrtShell->Insert(u"A"_ustr);
+pWrtShell->SplitNode();
+pWrtShell->Insert(u"B"_ustr);
+pWrtShell->BulletOn();
+pWrtShell->SplitNode();
+pWrtShell->Insert(u"C"_ustr);
+pWrtShell->NumUpDown(/*bDown=*/true);
+pWrtShell->SplitNode();
+pWrtShell->Insert(u"D"_ustr);
+pWrtShell->DelNumRules();
+pWrtShell->SplitNode();
+pWrtShell->Insert(u"E"_ustr);
+pWrtShell->NumOn();
+pWrtShell->SplitNode();
+pWrtShell->Insert(u"F"_ustr);
+pWrtShell->SplitNode();
+pWrtShell->Insert(u"G"_ustr);
+pWrtShell->NumUpDown(/*bDown=*/true);
+
+// When saving that to markdown:
+save(mpFilter);
+
+// Then make sure list type and level is exported:
+SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ);
+std::vector aBuffer(aStream.remainingSize());
+aStream.ReadBytes(aBuffer.data(), aBuffer.size());
+std::string_view aActual(aBuffer.data(), aBuffer.size());
+std::string_view aExpected(
+// clang-format off
+"A" SAL_NEWLINE_STRING SAL_NEWLINE_STRING
+"- B" SAL_NEWLINE_STRING SAL_NEWLINE_STRING
+// indent is 2 spaces
+"  - C" SAL_NEWLINE_STRING SAL_NEWLINE_STRING
+"D" SAL_NEWLINE_STRING SAL_NEWLINE_STRING
+"1. E" SAL_NEWLINE_STRING SAL_NEWLINE_STRING
+"2. F" SAL_NEWLINE_STRING SAL_NEWLINE_STRING
+// indent is 3 spaces
+"   1. G" SAL_NEWLINE_STRING
+// clang-format on
+);
+// Without the accompanying fix in place, this test would have failed, all 
the "- " and "1. "
+// style prefixes were lost.
+CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sw/source/filter/md/wrtmd.cxx b/sw/source/filter/md/wrtmd.cxx
index fccba16353c6..38452c7eb5be 100644
--- a/sw/source/filter/md/wrtmd.cxx
+++ b/sw/source/filter/md/wrtmd.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -424,8 +425,32 @@ void OutMarkdown_SwTextNode(SwMDWriter& rWrt, const 
SwTextNode& rNode, bool bFir
 rWrt.Strm().WriteUniOrByteChar('#');
 rWrt.Strm().WriteUniOrByteChar(' ');
 }
+else if (rNode.GetNumRule())
+{
+// , the amount of 
indent we have to use
+// depends on the parent's prefix size.
+OUStringBuffer aLevel;
+auto it = 
rWrt.GetListLevelPrefixSizes().find(rNode.GetActualListLevel() - 1);
+if (it != rWrt.GetListLevelPrefixSizes().end())
+{
+comphelper::string::padToLength(aLevel, it->second, ' ');
+}
+
+// In "1." form, shoul

core.git: sw/inc sw/source

2025-08-25 Thread Justin Luth (via logerrit)
 sw/inc/ndarr.hxx |2 +-
 sw/source/filter/ww8/attributeoutputbase.hxx |2 +-
 sw/source/filter/ww8/wrtw8nds.cxx|   19 ++-
 sw/source/filter/ww8/wrtww8.cxx  |2 +-
 4 files changed, 21 insertions(+), 4 deletions(-)

New commits:
commit 79a41e301209eb0f15af397e10ce2838965408d6
Author: Justin Luth 
AuthorDate: Mon Aug 25 15:00:19 2025 -0400
Commit: Justin Luth 
CommitDate: Tue Aug 26 02:45:20 2025 +0200

tdf#104827 doc export: Keep CR when justified text before section

This patch only benefits Micrsoft Word.
MS Word has a bug where even the last line of the paragraph
is justified when it ends with a continuous break.

This change could probably be made
for (almost) all continuous section breaks,
but it likely has other implications or side effects,
so just minimize the change to this one specific use-case.

Change-Id: Ifd16b78a95d8cb52d37f948a6f6fe5fcdaf2a254
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190193
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index c72a6de9191f..b70f4af211f2 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -210,7 +210,7 @@ public:
bool bSkipProtect = true );
 static SwContentNode* GoNextSection( SwPosition *, bool bSkipHidden  = 
true,
bool bSkipProtect = true );
-static SwContentNode* GoPrevSection( SwNodeIndex *, bool bSkipHidden  = 
true,
+SW_DLLPUBLIC static SwContentNode* GoPrevSection( SwNodeIndex *, bool 
bSkipHidden  = true,
bool bSkipProtect = true );
 static SwContentNode* GoPrevSection( SwPosition *, bool bSkipHidden  = 
true,
bool bSkipProtect = true );
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx 
b/sw/source/filter/ww8/attributeoutputbase.hxx
index a05f4fe221f7..0f30865b0425 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -110,7 +110,7 @@ namespace ww8 { class Frame; }
 
 namespace msword {
 const sal_uInt8 ColumnBreak = 0xE;
-const sal_uInt8 PageBreak   = 0xC;
+const sal_uInt8 PageBreak = 0xC; // can indicate either a page or 
continuous break!
 }
 
 /// Type of a style in the style table.
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index f713f4eceda6..3c9b1a30ce14 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -3444,10 +3444,27 @@ void MSWordExportBase::OutputSectionNode( const 
SwSectionNode& rSectionNode )
 const bool bInTOX = rSection.GetType() == SectionType::ToxContent || 
rSection.GetType() == SectionType::ToxHeader;
 if ( !pSet && !bInTOX )
 {
+if (GetExportFormat() == MSWordExportBase::ExportFormat::DOC)
+{
+bool bJustifiedTextBeforeContinuousSectionBreak = false;
+SwNodeIndex aDummy(rSectionNode);
+const SwContentNode* pLastContent
+= SwNodes::GoPrevSection(&aDummy, /*SkipHidden*/ true, 
/*SkipProtected*/ false);
+if (pLastContent && pLastContent->IsTextNode() && 
!pLastContent->FindTableNode())
+{
+// avoid MS Word bug justifying the last line in this 
instance
+bJustifiedTextBeforeContinuousSectionBreak
+= pLastContent->GetSwAttrSet().GetAdjust().GetAdjust() 
== SvxAdjust::Block;
+}
+if (bJustifiedTextBeforeContinuousSectionBreak)
+WriteChar(msword::PageBreak); // indicates a continuous 
section break here
+else
+ReplaceCr(msword::PageBreak); // indicates a continuous 
section break here
+}
+
 // new Section with no own PageDesc/-Break
 //  -> write follow section break;
 const SwSectionFormat* pFormat = rSection.GetFormat();
-ReplaceCr( msword::PageBreak ); // Indicator for Page/Section-Break
 
 // Get the page in use at the top of this section
 const SwPageDesc *pCurrent = SwPageDesc::GetPageDescOfNode(rNd);
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 58624c61eb5d..766f53434c1e 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3021,7 +3021,7 @@ void MSWordExportBase::WriteText()
 
 if (bNeedExportBreakHere)  //#120140# End of check
 {
-ReplaceCr( char(0xc) ); // indicator for Page/Section-Break
+ReplaceCr(msword::PageBreak); // either page or continuous 
break
 
 const SwSectionFormat* pParentFormat = 
rSect.GetFormat()->GetParent();
  

core.git: sw/inc sw/source

2025-08-25 Thread Mike Kaganski (via logerrit)
 sw/inc/docsh.hxx   |3 ++-
 sw/source/core/docnode/section.cxx |2 +-
 sw/source/uibase/app/docsh2.cxx|5 -
 sw/source/uibase/uiview/view2.cxx  |2 +-
 4 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit be6aa7ca0a3d9d444956c0e19a262a2ef91bdd5a
Author: Mike Kaganski 
AuthorDate: Mon Aug 25 17:54:14 2025 +0500
Commit: Mike Kaganski 
CommitDate: Mon Aug 25 17:13:00 2025 +0200

tdf#168070: SwFindDocShell may need an interaction handler

It may attempt to open the passed document, and then it would create
an SfxMedium, that will define how to interact e.g. on errors. When
caller has an interaction handler, it should pass it.

Change-Id: Icd0881ecf31b1e1a4731e1776413c1f62803c256
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190173
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins

diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index a4a650b3a4ee..189f6296bfef 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -359,6 +359,7 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh,
 const OUString& rPasswd,
 const OUString& rFilter,
 sal_Int16 nVersion,
-SwDocShell* pDestSh );
+SwDocShell* pDestSh,
+const css::uno::Reference& 
xIHandler);
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/section.cxx 
b/sw/source/core/docnode/section.cxx
index a53eaff1fecd..13e61eaf0caf 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -1200,7 +1200,7 @@ static void lcl_UpdateLinksInSect( const SwBaseLink& 
rUpdLnk, SwSectionNode& rSe
 {
 nRet = SwFindDocShell( xDocSh, xLockRef, sFileName,
 rSection.GetLinkFilePassword(),
-sFilter, 0, rDoc.GetDocShell() );
+sFilter, 0, rDoc.GetDocShell(), {} );
 if( nRet )
 {
 SwDoc* pSrcDoc = static_cast( xDocSh.get() 
)->GetDoc();
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index e43c3500b657..6a462c700b19 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -1714,7 +1714,8 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh,
 const OUString& rPasswd,
 const OUString& rFilter,
 sal_Int16 nVersion,
-SwDocShell* pDestSh )
+SwDocShell* pDestSh,
+const uno::Reference& xIHandler 
)
 {
 if ( rFileName.empty() )
 return 0;
@@ -1762,6 +1763,8 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh,
 // 2. Open the file ourselves
 std::unique_ptr xMed(new SfxMedium( aTmpObj.GetMainURL(
  INetURLObject::DecodeMechanism::NONE ), 
StreamMode::READ ));
+if (xIHandler)
+xMed->GetItemSet().Put(SfxUnoAnyItem(SID_INTERACTIONHANDLER, 
uno::Any(xIHandler)));
 if( INetProtocol::File == aTmpObj.GetProtocol() )
 xMed->Download(); // Touch the medium (download it)
 
diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index 6fb0897cead7..3a03899e3597 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -2952,7 +2952,7 @@ tools::Long SwView::InsertMedium( sal_uInt16 nSlotId, 
std::unique_ptr
 SfxObjectShellLock xLockRef;
 
 const int nRet = SwFindDocShell( xDocSh, xLockRef, pMedium->GetName(), 
OUString(),
-OUString(), nVersion, pDocSh );
+OUString(), nVersion, pDocSh, 
pMedium->GetInteractionHandler() );
 if( nRet )
 {
 SwWait aWait( *GetDocShell(), true );


core.git: sw/inc

2025-08-21 Thread Michael Stahl (via logerrit)
 sw/inc/unoframe.hxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit e00e1410eef40c203a8b90a5283bfdefa4f06de2
Author: Michael Stahl 
AuthorDate: Wed Aug 20 17:59:30 2025 +0200
Commit: Michael Stahl 
CommitDate: Thu Aug 21 18:07:20 2025 +0200

sw: remove another obsolete comment

Change-Id: Ia424d39562421a7945d6206dbb715973ab44019b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189972
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx
index 3da0a1f6387d..0bdfc8c265e7 100644
--- a/sw/inc/unoframe.hxx
+++ b/sw/inc/unoframe.hxx
@@ -159,7 +159,6 @@ public:
 
 bool IsDescriptor() const {return m_bIsDescriptor;}
 voidResetDescriptor();
-//copy text from a given source PaM
 static SdrObject *GetOrCreateSdrObject(SwFlyFrameFormat &rFormat);
 };
 


core.git: sw/inc

2025-08-18 Thread Michael Stahl (via logerrit)
 sw/inc/frmfmt.hxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 1261c20004befb168569966e0086314006c81f38
Author: Michael Stahl 
AuthorDate: Fri Aug 15 17:43:45 2025 +0200
Commit: Michael Stahl 
CommitDate: Mon Aug 18 13:13:33 2025 +0200

sw: fix mismerged and redundant comment

Change-Id: I745dc8415936e4140be1dcbd76f0b2c626af48eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189698
Reviewed-by: Michael Stahl 
Tested-by: Jenkins

diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 22108028ca4c..43f94cfaf7e8 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -208,8 +208,7 @@ class SW_DLLPUBLIC SwFlyFrameFormat final : public 
sw::SpzFrameFormat
 /// A tooltip has priority over an SwFormatURL and is not persisted to 
files.
 OUString msTooltip;
 
-/** Both not existent.
-   it stores the previous position of Prt rectangle from 
RequestObjectResize
+/** Stores the previous position of Prt rectangle from RequestObjectResize
so it can be used to move frames of non-resizable objects to align them 
correctly
when they get borders (this is done in SwWrtShell::CalcAndGetScale) */
 Point   m_aLastFlyFramePrtRectPos;


core.git: sw/inc

2025-08-15 Thread Miklos Vajna (via logerrit)
 sw/inc/txtfld.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 7deb178cae919ddecb9e02dc66cbce713b0f455c
Author: Miklos Vajna 
AuthorDate: Fri Aug 15 13:10:04 2025 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 15 22:31:27 2025 +0200

sw: document SwTextField

It wasn't too obvious that the SwFormatField is accessible via the
parent class m_aAttr + downcasting.

Change-Id: I33cbcc92573d2959efc50fcd074505b476ef65fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189693
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx
index 5e812f8682d9..a9a81ed397bd 100644
--- a/sw/inc/txtfld.hxx
+++ b/sw/inc/txtfld.hxx
@@ -28,6 +28,8 @@
 class SwPaM;
 class SwTextNode;
 
+/// SwTextAttr subclass for fields, i.e. this is a 'hint' on a dummy character 
that will be expanded
+/// to a string by the layout. GetFormatField() gives access to the underlying 
SwFormatField.
 class SAL_DLLPUBLIC_RTTI SwTextField : public virtual SwTextAttr
 {
 mutable OUString m_aExpand; // only used to determine, if field content is 
changing in 


core.git: sw/inc sw/source

2025-08-13 Thread Miklos Vajna (via logerrit)
 sw/inc/redline.hxx  |8 
 sw/source/core/doc/DocumentContentOperationsManager.cxx |6 --
 sw/source/core/doc/DocumentRedlineManager.cxx   |7 ++-
 sw/source/core/doc/docfmt.cxx   |5 -
 sw/source/core/doc/docredln.cxx |   12 ++--
 sw/source/core/unocore/unocrsrhelper.cxx|5 -
 sw/source/filter/ww8/docxattributeoutput.cxx|4 ++--
 7 files changed, 30 insertions(+), 17 deletions(-)

New commits:
commit 2db0a779944f9496371b3ba68f7494c635ad431d
Author: Miklos Vajna 
AuthorDate: Wed Aug 13 09:40:40 2025 +0200
Commit: Miklos Vajna 
CommitDate: Wed Aug 13 18:16:47 2025 +0200

tdf#167761 sw format redline: register the item set in the autostyle pool

Load the DOCX bugdoc, save to ODT, open it, go to the 36pt font size
format redline, click reject, should be 24th, but it's now 12pt instead.

What happens is that SwRedlineExtraData_FormatColl SfxItemSet is not
part of the autoformat mechanism, so the ODF markup can't even refer to
it. So reject works correctly after DOCX open, but not after ODF
roundtrip.

The first step here is to replace the std::unique_ptr with a
shared pointer, similar to what SwFormatAutoFormat does for normal
character direct formatting (the redline just stores the old direct
formatting).

This allows producing the std::shared_ptr in the autostyle
pool, so the ODF export will be able to export the old direct formatting
as a next step (not yet done here.)

Change-Id: I1f7a8083ce766bd2ec06bb8e19bfce0eaebfe405
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189509
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 1eb738e370bb..0eca2fb5481f 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -54,20 +54,20 @@ public:
 class SW_DLLPUBLIC SwRedlineExtraData_FormatColl final : public 
SwRedlineExtraData
 {
 UIName m_sFormatNm;
-std::unique_ptr m_pSet;
+std::shared_ptr m_pSet;
 sal_uInt16 m_nPoolId;
 bool m_bFormatAll; // don't strip the last paragraph mark
 public:
 SwRedlineExtraData_FormatColl( UIName aColl, sal_uInt16 nPoolFormatId,
-const SfxItemSet* pSet = nullptr, bool 
bFormatAll = true );
+const std::shared_ptr& pSet = 
nullptr, bool bFormatAll = true );
 virtual ~SwRedlineExtraData_FormatColl() override;
 virtual SwRedlineExtraData* CreateNew() const override;
 virtual void Reject( SwPaM& rPam ) const override;
 virtual bool operator == ( const SwRedlineExtraData& ) const override;
 
 const UIName& GetFormatName() const{ return m_sFormatNm; }
-void SetItemSet( const SfxItemSet& rSet );
-SfxItemSet* GetItemSet( ) const { return m_pSet.get(); }
+void SetItemSet( const std::shared_ptr& pSet );
+std::shared_ptr GetItemSet( ) const { return m_pSet; }
 void SetFormatAll( bool bAll )   { m_bFormatAll = bAll; }
 
 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index c85591483dc9..912ea1eb33cd 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -1281,7 +1281,7 @@ namespace //local functions originally from docfmt.cxx
 if (pFormattingChanges)
 {
 // Get the item set that holds all the changes 
properties
-const SfxItemSet *pChangesSet = 
pFormattingChanges->GetItemSet();
+std::shared_ptr pChangesSet = 
pFormattingChanges->GetItemSet();
 xExtra.reset(new 
SwRedlineExtraData_FormatColl(UIName(u""_ustr), USHRT_MAX, pChangesSet));
 break;
 }
@@ -1318,7 +1318,9 @@ namespace //local functions originally from docfmt.cxx
 // which doesn't handle invalid/dontcare items so clear them here
 aSet.ClearInvalidItems();
 
-xExtra.reset(new SwRedlineExtraData_FormatColl(UIName(u""_ustr), 
USHRT_MAX, &aSet));
+IStyleAccess& rStyleAccess = rDoc.GetIStyleAccess();
+std::shared_ptr pAutoStyle = 
rStyleAccess.getAutomaticStyle(aSet, IStyleAccess::AUTO_STYLE_CHAR);
+xExtra.reset(new SwRedlineExtraData_FormatColl(UIName(u""_ustr), 
USHRT_MAX, pAutoStyle));
 }
 
 pRedline->SetExtraData(xExtra.get() );
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 9771d1bbbd66..d05a4b38b013 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRed

core.git: sw/inc sw/source

2025-08-13 Thread Sahil Gautam (via logerrit)
 sw/inc/viewsh.hxx  |3 ++-
 sw/source/core/doc/notxtfrm.cxx|3 ++-
 sw/source/core/layout/paintfrm.cxx |4 ++--
 sw/source/core/view/viewsh.cxx |   16 
 4 files changed, 14 insertions(+), 12 deletions(-)

New commits:
commit 8fe92e9a17c682d577fba44479ffe412d75e8454
Author: Sahil Gautam 
AuthorDate: Tue Aug 12 23:16:22 2025 +0530
Commit: Noel Grandin 
CommitDate: Wed Aug 13 10:27:53 2025 +0200

refactor SwViewShell::GetReplacementBitmapSplit(bool)

Change-Id: I69365d0488078f268a2b23b7c4fbb2b9d4479ae9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189446
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 8e8700ea5f37..cece0d0dfdfc 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -609,7 +609,8 @@ public:
 
 bool IsInConstructor() const { return mbInConstructor; }
 
-const Bitmap& GetReplacementBitmap(bool bIsErrorState);
+const Bitmap& GetErrorBitmap();
+const Bitmap& GetReplacementBitmap();
 void DeleteReplacementBitmaps();
 
 const SwPostItMgr* GetPostItMgr() const { return 
const_cast(this)->GetPostItMgr(); }
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index fd2927d0c414..9d0175f14608 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -143,7 +143,8 @@ static void lcl_PaintReplacement( const SwRect &rRect, 
const OUString &rText,
 aFont.SetUnderline( eUnderline );
 aFont.SetColor( aCol );
 
-const Bitmap& rBmp = 
const_cast(rSh).GetReplacementBitmap(bDefect);
+const Bitmap& rBmp = bDefect ? 
const_cast(rSh).GetErrorBitmap()
+ : 
const_cast(rSh).GetReplacementBitmap();
 Graphic::DrawEx(*rSh.GetOut(), rText, aFont, BitmapEx(rBmp), rRect.Pos(), 
rRect.SSize());
 }
 
diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 43a60e563c69..eed388c8f408 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2116,7 +2116,7 @@ void DrawGraphic(
 
 if( bReplaceGrfNum )
 {
-const Bitmap& rBmp = rSh.GetReplacementBitmap(false);
+const Bitmap& rBmp = rSh.GetReplacementBitmap();
 vcl::Font aTmp( rOutDev.GetFont() );
 Graphic::DrawEx(rOutDev, OUString(), aTmp, BitmapEx(rBmp), rOrg.Pos(), 
rOrg.SSize());
 }
@@ -4101,7 +4101,7 @@ bool SwFlyFrame::IsBackgroundTransparent() const
 
 static void lcl_PaintReplacement( const SwRect &rRect, const SwViewShell &rSh )
 {
-const Bitmap& rBmp = 
const_cast(rSh).GetReplacementBitmap(false);
+const Bitmap& rBmp = const_cast(rSh).GetReplacementBitmap();
 vcl::Font aFont(rSh.GetOut()->GetFont() );
 Graphic::DrawEx(*rSh.GetOut(), OUString(), aFont, BitmapEx(rBmp), 
rRect.Pos(), rRect.SSize());
 }
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 1e9ee0218893..9985cc0e5f0b 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -2927,16 +2927,16 @@ sal_Int32 SwViewShell::GetPageNumAndSetOffsetForPDF( 
OutputDevice& rOut, const S
 return nRet;
 }
 
-// --> PB 2007-05-30 #146850#
-const Bitmap& SwViewShell::GetReplacementBitmap( bool bIsErrorState )
+const Bitmap& SwViewShell::GetErrorBitmap()
 {
-if (bIsErrorState)
-{
-if (maErrorBmp.IsEmpty())
-maErrorBmp = Bitmap(RID_GRAPHIC_ERRORBMP);
-return maErrorBmp;
-}
+if (maErrorBmp.IsEmpty())
+maErrorBmp = Bitmap(RID_GRAPHIC_ERRORBMP);
+return maErrorBmp;
+}
 
+// --> PB 2007-05-30 #146850#
+const Bitmap& SwViewShell::GetReplacementBitmap()
+{
 if (maReplaceBmp.IsEmpty())
 maReplaceBmp = Bitmap(RID_GRAPHIC_REPLACEBMP);
 return maReplaceBmp;


core.git: sw/inc sw/qa sw/source

2025-08-01 Thread Miklos Vajna (via logerrit)
 sw/inc/editsh.hxx   |2 -
 sw/qa/core/edit/edit.cxx|   27 
 sw/source/core/doc/DocumentContentOperationsManager.cxx |9 -
 sw/source/core/edit/edredln.cxx |6 +++
 4 files changed, 41 insertions(+), 3 deletions(-)

New commits:
commit e545ada3501780ee6552bbfa19954794e0440d46
Author: Miklos Vajna 
AuthorDate: Fri Aug 1 09:28:19 2025 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 1 19:58:50 2025 +0200

tdf#167194 sw redline reinstate: fix handling of self-inserts

Create an insert in a document, then Edit -> Track changes -> Reinstate,
you get an empty document instead of an "insert-then-delete" as
expected.

This happens because
sw::DocumentRedlineManager::PreAppendDeleteRedline() has a call to
IsOwnRedline(), which compresses the insert and the delete, which is
wanted in general for self-inserts, but not while reinstating.

Fix the problem by disabling redline compression in
SwEditShell::ReinstatePaM() for the insert case.

This requires extending
sw::DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl()
which probably just wants to turn on redline recording, but dropped
RedlineFlags::DontCombineRedlines while doing so.

Change-Id: I629d4d65dc966af934c7ecc672925d0fc11a3ef9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188768
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 0de50413d3cc..1abfe2c85134 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -962,7 +962,7 @@ public:
 SW_DLLPUBLIC bool RejectRedline( SwRedlineTable::size_type nPos );
 bool AcceptRedlinesInSelection();
 bool RejectRedlinesInSelection();
-void ReinstateRedline(SwRedlineTable::size_type nPos);
+SW_DLLPUBLIC void ReinstateRedline(SwRedlineTable::size_type nPos);
 void ReinstateRedlinesInSelection();
 
 /** Search Redline for this Data and @return position in array.
diff --git a/sw/qa/core/edit/edit.cxx b/sw/qa/core/edit/edit.cxx
index 35a278b37ec2..270490688315 100644
--- a/sw/qa/core/edit/edit.cxx
+++ b/sw/qa/core/edit/edit.cxx
@@ -424,6 +424,33 @@ CPPUNIT_TEST_FIXTURE(Test, testRedlineReinstateAll)
 CPPUNIT_ASSERT_EQUAL(static_cast(4), rRedlines.size());
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testRedlineReinstateSelf)
+{
+// Given a document with a self-insert:
+createSwDoc();
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+SwModule* pModule = SwModule::get();
+pModule->SetRedlineAuthor("Alice");
+RedlineFlags nMode = pWrtShell->GetRedlineFlags();
+pWrtShell->SetRedlineFlags(nMode | RedlineFlags::On);
+pWrtShell->Insert("x");
+
+// When reinstating that insert:
+pWrtShell->SttPara(/*bSelect=*/false);
+pWrtShell->ReinstateRedline(0);
+
+// Then make sure the insert and the newly created delete redlines are not 
compressed:
+SwDoc* pDoc = pWrtShell->GetDoc();
+IDocumentRedlineAccess& rIDRA = pDoc->getIDocumentRedlineAccess();
+SwRedlineTable& rRedlines = rIDRA.GetRedlineTable();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// i.e. the original redline was lost instead of replacing that with an 
insert-then-delete
+// redline.
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rRedlines.size());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index b6ebdc0fee7f..c85591483dc9 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -4406,8 +4406,13 @@ bool 
DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl(SwPaM & rPam
 // (randomTest and testTdf54819 triggers it)
 SAL_WARN_IF((eOld & RedlineFlags::ShowMask) != RedlineFlags::ShowMask,
 "sw.core", "redlines will be moved in DeleteAndJoin");
-m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags(
-RedlineFlags::On | RedlineFlags::ShowInsert | 
RedlineFlags::ShowDelete);
+RedlineFlags eFlags = RedlineFlags::On | RedlineFlags::ShowInsert | 
RedlineFlags::ShowDelete;
+if (eOld & RedlineFlags::DontCombineRedlines)
+{
+// Reinstate disables redline compressing, don't drop that here.
+eFlags |= RedlineFlags::DontCombineRedlines;
+}
+m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags(eFlags);
 
 for (std::unique_ptr & pRedline : redlines)
 {
diff --git a/sw/source/core/edit/edredln.cxx b/sw/source/core/edit/edredln.cxx
index e9284a14da26..74d1a8d3def1 100644
--- a/sw/source/core/edit/edredln.cxx
+++ b/sw/sour

core.git: sw/inc

2025-07-23 Thread Michael Stahl (via logerrit)
 sw/inc/swtypes.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0fad4a4a27cfdea59c76d4f729d48a1ce01b16b1
Author: Michael Stahl 
AuthorDate: Wed Jul 23 11:22:00 2025 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Jul 23 23:53:30 2025 +0200

sw: better type for UNO_TABLE_COLUMN_SUM

As Mike Kaganski points out it's not really a size but a unitless value.

Change-Id: I0e24a18c3553a3f560a849bc3f8b781c2e94d857
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188211
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 
(cherry picked from commit 7748d38241c543b468e9d4d1bfaa5cae01a6159d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188245
Reviewed-by: Michael Stahl 
Tested-by: Jenkins

diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 84c544951788..8f61ef20a63a 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -60,7 +60,7 @@ constexpr SwTwips cMinHdFtHeight = 56; // ~1mm
 #define MINLAY 23   // Minimal size for other Frames.
 
 /// hard-coded value of read-only TableColumnRelativeSum property
-constexpr SwTwips UNO_TABLE_COLUMN_SUM{1};
+constexpr int UNO_TABLE_COLUMN_SUM{1};
 
 // Default column distance of two text columns corresponds to 0.3 cm.
 constexpr SwTwips DEF_GUTTER_WIDTH = o3tl::toTwips(3, o3tl::Length::mm);


core.git: sw/inc

2025-07-20 Thread Paul McQuade (via logerrit)
 sw/inc/edimp.hxx|5 +
 sw/inc/editsh.hxx   |5 +
 sw/inc/extinput.hxx |5 +
 sw/inc/fchrfmt.hxx  |4 +---
 4 files changed, 4 insertions(+), 15 deletions(-)

New commits:
commit a37d19efa3cb4f2b0448b3f0bafe59458bc76a6f
Author: Paul McQuade 
AuthorDate: Sat Jul 19 21:31:40 2025 +0100
Commit: Ilmari Lauhakangas 
CommitDate: Sun Jul 20 19:35:49 2025 +0200

tdf#143148: Use pragma once instead of include guards

Change-Id: Iafb001d644fc7760e10a98edcd28351ee06dad66
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188077
Reviewed-by: Ilmari Lauhakangas 
Tested-by: Jenkins

diff --git a/sw/inc/edimp.hxx b/sw/inc/edimp.hxx
index 50888ce339c3..7a564a76e609 100644
--- a/sw/inc/edimp.hxx
+++ b/sw/inc/edimp.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SW_INC_EDIMP_HXX
-#define INCLUDED_SW_INC_EDIMP_HXX
+#pragma once
 
 #include 
 
@@ -53,6 +52,4 @@ private:
 o3tl::sorted_vector maVector;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 30d35c966ba4..0de50413d3cc 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SW_INC_EDITSH_HXX
-#define INCLUDED_SW_INC_EDITSH_HXX
+#pragma once
 
 #include 
 
@@ -1062,6 +1061,4 @@ public:
 ~SwMvContext() COVERITY_NOEXCEPT_FALSE;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/extinput.hxx b/sw/inc/extinput.hxx
index c2fe02adbbdf..f59c35e5bec6 100644
--- a/sw/inc/extinput.hxx
+++ b/sw/inc/extinput.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SW_INC_EXTINPUT_HXX
-#define INCLUDED_SW_INC_EXTINPUT_HXX
+#pragma once
 
 #include "pam.hxx"
 #include 
@@ -48,6 +47,4 @@ public:
 const SwExtTextInput* GetPrev() const { return static_cast(GetPrevInRing()); }
 };
 
-#endif // INCLUDED_SW_INC_EXTINPUT_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/fchrfmt.hxx b/sw/inc/fchrfmt.hxx
index 0fd676dfebe9..a5f86fef0d3c 100644
--- a/sw/inc/fchrfmt.hxx
+++ b/sw/inc/fchrfmt.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SW_INC_FCHRFMT_HXX
-#define INCLUDED_SW_INC_FCHRFMT_HXX
+#pragma once
 
 #include 
 #include 
@@ -74,6 +73,5 @@ public:
 
 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: sw/inc sw/qa sw/source

2025-07-17 Thread Mike Kaganski (via logerrit)
 sw/inc/ndtxt.hxx|3 +++
 sw/qa/extras/layout/data/tdf167526.docx |binary
 sw/qa/extras/layout/layout5.cxx |   12 
 sw/source/core/inc/txtfrm.hxx   |3 +++
 sw/source/core/text/txtfrm.cxx  |8 +++-
 sw/source/core/txtnode/ndtxt.cxx|   13 +
 sw/source/filter/ww8/docxexport.cxx |   19 +--
 7 files changed, 39 insertions(+), 19 deletions(-)

New commits:
commit 14f4ea109d4cd8fe50fd419f51e3370c74169343
Author: Mike Kaganski 
AuthorDate: Thu Jul 17 12:13:14 2025 +0500
Commit: Mike Kaganski 
CommitDate: Thu Jul 17 10:23:24 2025 +0200

tdf#167535: Ignore dummy anchor nodes in line numbering

Commit 441aed20b95ee40dec1df72fb8e8167d0e48c0c4 (tdf#167379 sw floattable:
make dummy paragraph from DOCX import less visible, 2025-07-10) introduced
dummy nodes as invisible anchors for floating tables without normal anchor
nodes. These nodes are not part of actual content; take that into account
in SwTextFrame::ChgThisLines, which calculates line numbering.

Added SwTextNode::IsDummyAnchorNode and SwTextFrame::IsDummyAnchorFrame to
avoid code duplication.

Change-Id: I872df4d1f02a4abc75f7bd6316795cae2f951b0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187982
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 78115ffadf8b..4086a8fdb8dc 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -893,6 +893,9 @@ public:
 { TriggerNodeUpdate(sw::LegacyModifyHint(&rDrop, &rDrop)); };
 
 void SetInSwUndo(bool bInUndo);
+
+// For nodes created to provide anchor points for floating tables
+bool IsDummyAnchorNode() const;
 };
 
 inline SwpHints & SwTextNode::GetSwpHints()
diff --git a/sw/qa/extras/layout/data/tdf167526.docx 
b/sw/qa/extras/layout/data/tdf167526.docx
index 050f081ff8e3..47c0fe5d2a01 100644
Binary files a/sw/qa/extras/layout/data/tdf167526.docx and 
b/sw/qa/extras/layout/data/tdf167526.docx differ
diff --git a/sw/qa/extras/layout/layout5.cxx b/sw/qa/extras/layout/layout5.cxx
index 50212f60cf19..8cc0fe737155 100644
--- a/sw/qa/extras/layout/layout5.cxx
+++ b/sw/qa/extras/layout/layout5.cxx
@@ -1867,6 +1867,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf167526)
 // Without a fix, this would fail, because the third element was the 
wrongly emitted 
 assertXPathNodeName(pXmlDoc, "/w:document/w:body/*[3]", "tbl");
 }
+
+// tdf#167535: check line numbering; the dummy node must not interfere 
with it
+{
+// Dump the rendering of the first page as an XML file.
+SwDocShell* pShell = getSwDocShell();
+std::shared_ptr xMetaFile = pShell->GetPreviewMetaFile();
+MetafileXmlDump dumper;
+xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+// Without a fix, this was 3
+assertXPathContent(
+pXmlDoc, "/metafile/push/push/push/textarray[@index=0 and 
@length=1][2]/text", u"2");
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 7b61c8029d82..acc4c2c4f390 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -345,6 +345,9 @@ class SW_DLLPUBLIC SwTextFrame final : public SwContentFrame
 /// Like GetDrawObjs(), but limit to fly frames which are allowed to split.
 std::vector GetSplitFlyDrawObjs() const;
 
+// For zero-height frames created to provide anchor points for floating 
tables
+bool IsDummyAnchorFrame() const;
+
 public:
 
 virtual const SvxFormatBreakItem& GetBreakItem() const override;
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index bea6d81e3b44..2f6780af0f97 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -4038,6 +4038,12 @@ SwTwips SwTextFrame::FirstLineHeight() const
 return nHeight;
 }
 
+bool SwTextFrame::IsDummyAnchorFrame() const
+{
+// I *think* that when there is m_pMergedPara, it can't be a dummy frame.
+return !GetMergedPara() && GetTextNodeForParaProps()->IsDummyAnchorNode();
+}
+
 sal_Int32 SwTextFrame::GetLineCount(TextFrameIndex const nPos)
 {
 sal_Int32 nRet = 0;
@@ -4082,7 +4088,7 @@ void SwTextFrame::ChgThisLines()
 } while ( aLine.NextLine() );
 }
 }
-else if ( rInf.IsCountBlankLines() )
+else if (!IsDummyAnchorFrame() && rInf.IsCountBlankLines())
 nNew = 1;
 
 if ( nNew == mnThisLines )
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 91edfd7ee129..cdb46a3f644b 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -4950,6 +4950,19 @@ bool SwTextNode::IsHidden() const
 return pSectNd && pSectNd->GetSection().IsHiddenFlag();
 }
 
+bool SwTextNode::IsDummyAnchorNode() const
+{
+// See OOXMLFastContextHandlerTextTable::lcl_s

core.git: sw/inc

2025-07-16 Thread Miklos Vajna (via logerrit)
 sw/inc/docufld.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit a4ae800f2fbbd33ec09d642052d3551ca6f3a431
Author: Miklos Vajna 
AuthorDate: Wed Jul 16 08:56:52 2025 +0200
Commit: Miklos Vajna 
CommitDate: Wed Jul 16 11:45:49 2025 +0200

sw: document SwDocInfoField

I.e. first author on the UI is a doc info field, not an SwAuthorField.

Change-Id: I7fcd4d1115ebcea582fd55db0d0020ac39ae3671
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187946
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index a423be9beaa8..a0d3a4873429 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -581,6 +581,8 @@ public:
 virtual std::unique_ptr Copy() const override;
 };
 
+/// A field that expands to the value of some document information, e.g. 
Insert -> Field -> First
+/// Author on the UI.
 class SW_DLLPUBLIC SwDocInfoField final : public SwValueField
 {
 SwDocInfoSubType  m_nSubType;


core.git: sw/inc sw/source

2025-07-13 Thread Noel Grandin (via logerrit)
 sw/inc/unofieldcoll.hxx   |3 +++
 sw/source/core/inc/unofield.hxx   |2 +-
 sw/source/core/unocore/unofield.cxx   |6 ++
 sw/source/writerfilter/dmapper/ModelEventListener.cxx |   17 +
 4 files changed, 19 insertions(+), 9 deletions(-)

New commits:
commit 4409ab659064e3d10e281d718a06b1ebf566
Author: Noel Grandin 
AuthorDate: Sat Jul 12 20:25:10 2025 +0200
Commit: Noel Grandin 
CommitDate: Sun Jul 13 11:50:05 2025 +0200

use more concrete UNO in sw

Change-Id: I97dcef112cb16fb14c5b02f5a2a6e21a4a44abf2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187783
Reviewed-by: Noel Grandin 
Tested-by: Jenkins

diff --git a/sw/inc/unofieldcoll.hxx b/sw/inc/unofieldcoll.hxx
index 392b15028dc0..1b4eb3f59df8 100644
--- a/sw/inc/unofieldcoll.hxx
+++ b/sw/inc/unofieldcoll.hxx
@@ -28,6 +28,7 @@
 #include "unocoll.hxx"
 
 class SwFieldType;
+class SwXFieldEnumeration;
 
 typedef ::cppu::WeakImplHelper
 <   css::container::XNameAccess
@@ -117,6 +118,8 @@ public:
 // container::XUniqueIDAccess
 virtual css::uno::Any SAL_CALL getByUniqueID( const OUString& ID ) 
override;
 virtual void SAL_CALL removeByUniqueID( const OUString& ID ) override;
+
+rtl::Reference createFieldEnumeration();
 };
 
 #endif
diff --git a/sw/source/core/inc/unofield.hxx b/sw/source/core/inc/unofield.hxx
index e16476a798dc..bd8e2d88e580 100644
--- a/sw/source/core/inc/unofield.hxx
+++ b/sw/source/core/inc/unofield.hxx
@@ -202,7 +202,7 @@ typedef ::cppu::WeakImplHelper
 ,   css::lang::XServiceInfo
 > SwXFieldEnumeration_Base;
 
-class SwXFieldEnumeration final
+class SW_DLLPUBLIC SwXFieldEnumeration final
 : public SwXFieldEnumeration_Base
 {
 
diff --git a/sw/source/core/unocore/unofield.cxx 
b/sw/source/core/unocore/unofield.cxx
index bc2bb7a6cbd7..63334c2cfc86 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -2914,6 +2914,12 @@ uno::Reference< container::XEnumeration >  
SwXTextFieldTypes::createEnumeration(
 return new SwXFieldEnumeration(GetDoc());
 }
 
+rtl::Reference< SwXFieldEnumeration >  
SwXTextFieldTypes::createFieldEnumeration()
+{
+SolarMutexGuard aGuard;
+return new SwXFieldEnumeration(GetDoc());
+}
+
 uno::Type  SwXTextFieldTypes::getElementType()
 {
 return cppu::UnoType::get();
diff --git a/sw/source/writerfilter/dmapper/ModelEventListener.cxx 
b/sw/source/writerfilter/dmapper/ModelEventListener.cxx
index f097220ba760..9d04b82a751c 100644
--- a/sw/source/writerfilter/dmapper/ModelEventListener.cxx
+++ b/sw/source/writerfilter/dmapper/ModelEventListener.cxx
@@ -28,6 +28,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 namespace writerfilter::dmapper {
 
@@ -53,12 +56,13 @@ void ModelEventListener::notifyEvent( const 
document::EventObject& rEvent )
 try
 {
 //remove listener
-uno::Reference(rEvent.Source, 
uno::UNO_QUERY_THROW )->removeEventListener(
-uno::Reference(this));
+SwXTextDocument* pDoc = 
dynamic_cast(rEvent.Source.get());
+assert(pDoc);
+
pDoc->removeEventListener(uno::Reference(this));
 
 // If we have PAGEREF fields, update fields as well.
-uno::Reference 
xTextFieldsSupplier(rEvent.Source, uno::UNO_QUERY);
-uno::Reference xEnumeration = 
xTextFieldsSupplier->getTextFields()->createEnumeration();
+rtl::Reference pTextFields = 
pDoc->getSwTextFields();
+rtl::Reference xEnumeration = 
pTextFields->createFieldEnumeration();
 sal_Int32 nIndex = 0;
 while(xEnumeration->hasMoreElements())
 {
@@ -78,10 +82,7 @@ void ModelEventListener::notifyEvent( const 
document::EventObject& rEvent )
 }
 }
 if (nIndex)
-{
-uno::Reference 
xRefreshable(xTextFieldsSupplier->getTextFields(), uno::UNO_QUERY);
-xRefreshable->refresh();
-}
+pTextFields->refresh();
 }
 catch( const uno::Exception& )
 {


core.git: sw/inc sw/qa sw/source

2025-07-11 Thread Jonathan Clark (via logerrit)
 sw/inc/hintids.hxx 
  |2 
 
sw/qa/extras/layout/data/tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx
 |binary
 sw/qa/extras/ooxmlexport/data/tdf167297.fodt   
  |  112 
 sw/qa/extras/ooxmlexport/ooxmlexport22.cxx 
  |7 
 sw/qa/extras/ooxmlexport/ooxmlexport25.cxx 
  |   18 
 sw/qa/extras/ww8export/data/tdf167297.fodt 
  |  112 
 sw/qa/extras/ww8export/data/tdf92281.doc   
  |binary
 sw/qa/extras/ww8export/ww8export4.cxx  
  |   19 
 sw/source/core/bastyp/init.cxx 
  |2 
 sw/source/core/text/atrstck.cxx
  |2 
 sw/source/filter/html/css1atr.cxx  
  |2 
 sw/source/filter/html/htmlatr.cxx  
  |2 
 sw/source/filter/ww8/attributeoutputbase.hxx   
  |7 
 sw/source/filter/ww8/docxattributeoutput.cxx   
  |   22 
 sw/source/filter/ww8/docxattributeoutput.hxx   
  |6 
 sw/source/filter/ww8/rtfattributeoutput.cxx
  |7 
 sw/source/filter/ww8/rtfattributeoutput.hxx
  |6 
 sw/source/filter/ww8/ww8atr.cxx
  |   33 +
 sw/source/filter/ww8/ww8attributeoutput.hxx
  |6 
 sw/source/filter/ww8/ww8par.cxx
  |  225 --
 sw/source/filter/ww8/ww8par.hxx
  |1 
 sw/source/filter/ww8/ww8par6.cxx   
  |   26 -
 sw/source/writerfilter/dmapper/DomainMapper.cxx
  |   26 -
 sw/source/writerfilter/dmapper/PropertyIds.cxx 
  |1 
 sw/source/writerfilter/dmapper/PropertyIds.hxx 
  |1 
 25 files changed, 376 insertions(+), 269 deletions(-)

New commits:
commit 38ae7a6e1cb9adfd3fe67be409fb7b5bcaba3c82
Author: Jonathan Clark 
AuthorDate: Thu Jul 10 13:51:18 2025 -0600
Commit: Jonathan Clark 
CommitDate: Sat Jul 12 06:28:51 2025 +0200

tdf#167297 sw: Add support for DOC/DOCX script type hinting

Extends the Writer script type hinting mechanism to natively support
DOC/DOCX script type hinting.

Implements the OOXML w:hint attribute, in both import and export.

Implements the DOC sprmCIdctHint property, in both import and export.
This change also removes the previously-implemented IdctHint emulation,
based on breaking the input text into smaller spans. Writer's script
type hinting mechanism is sufficient to replace this code.

Change-Id: I08f934358164dc5814bfac010d4fac9b3334f947
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187755
Tested-by: Jenkins
Reviewed-by: Jonathan Clark 

diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index 61d5d546f079..9636779a1cc6 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -241,7 +241,7 @@ inline constexpr TypedWhichId 
RES_CHRATR_SHADOW(RES_CHRATR_BEGIN
 inline constexpr TypedWhichId 
RES_CHRATR_HIGHLIGHT(RES_CHRATR_BEGIN + 41);
 inline constexpr TypedWhichId 
RES_CHRATR_GRABBAG(RES_CHRATR_BEGIN + 42);
 inline constexpr TypedWhichId 
RES_CHRATR_BIDIRTL(RES_CHRATR_BEGIN + 43);
-inline constexpr TypedWhichId 
RES_CHRATR_IDCTHINT(RES_CHRATR_BEGIN + 44);
+inline constexpr TypedWhichId 
RES_CHRATR_UNUSED3(RES_CHRATR_BEGIN + 44);
 inline constexpr TypedWhichId 
RES_CHRATR_SCRIPT_HINT(RES_CHRATR_BEGIN + 45);
 inline constexpr sal_uInt16 RES_CHRATR_END(RES_CHRATR_BEGIN + 46);
 
diff --git 
a/sw/qa/extras/layout/data/tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx
 
b/sw/qa/extras/layout/data/tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx
index a44ff4047111..f556c31b10ed 100644
Binary files 
a/sw/qa/extras/layout/data/tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx
 and 
b/sw/qa/extras/layout/data/tdf139336_ColumnsWithFootnoteDoNotOccupyEntirePage.docx
 differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf167297.fodt 
b/sw/qa/extras/ooxmlexport/data/tdf167297.fodt
new file mode 100644
index ..7916f4ee3e86
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf167297.fodt
@@ -0,0 +1,112 @@
+
+http://www.w3.org/TR/css3-text/"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:dom="http://w

core.git: sw/inc sw/qa sw/source

2025-07-10 Thread Noel Grandin (via logerrit)
 sw/inc/reffld.hxx   |   34 ++---
 sw/qa/extras/uiwriter/uiwriter7.cxx |   72 ++---
 sw/source/core/fields/fldbas.cxx|4 -
 sw/source/core/fields/reffld.cxx|   89 +---
 sw/source/core/unocore/unofield.cxx |2 
 sw/source/filter/ww8/ww8atr.cxx |   67 ++-
 sw/source/filter/ww8/ww8par5.cxx|   18 +++
 sw/source/uibase/fldui/fldmgr.cxx   |2 
 sw/source/uibase/wrtsh/wrtsh2.cxx   |   26 +-
 9 files changed, 158 insertions(+), 156 deletions(-)

New commits:
commit 9d1c9c4d1d41ba2631ba71c48e1a10f86e2a2bf1
Author: Noel Grandin 
AuthorDate: Mon Jul 7 08:49:23 2025 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 10 13:52:36 2025 +0200

convert REFERENCEMARK to scoped enum

Change-Id: Ic4adb7353e4688252a684918b29b37aed761b396
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187597
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx
index 8d6cbdc1fe6e..6328c5551d20 100644
--- a/sw/inc/reffld.hxx
+++ b/sw/inc/reffld.hxx
@@ -48,22 +48,22 @@ bool IsFrameBehind( const SwTextNode& rMyNd, sal_Int32 
nMySttPos,
 #define REFFLDFLAG_STYLE_FROM_BOTTOM   0xc100
 #define REFFLDFLAG_STYLE_HIDE_NON_NUMERICAL0xc200
 
-enum REFERENCEMARK
+enum class RefFieldFormat : sal_uInt16
 {
-REF_BEGIN,
-REF_PAGE = REF_BEGIN, ///< "Page"
-REF_CHAPTER,  ///< "Chapter"
-REF_CONTENT,  ///< "Reference"
-REF_UPDOWN,   ///< "Above/Below"
-REF_PAGE_PGDESC,  ///< "As Page Style"
-REF_ONLYNUMBER,   ///< "Category and Number"
-REF_ONLYCAPTION,  ///< "Caption Text"
-REF_ONLYSEQNO,///< "Numbering"
+Begin,
+Page = Begin,  ///< "Page"
+Chapter,   ///< "Chapter"
+Content,   ///< "Reference"
+UpDown,///< "Above/Below"
+AsPageStyle,   ///< "As Page Style"
+CategoryAndNumber, ///< "Category and Number"
+CaptionText,   ///< "Caption Text"
+Numbering, ///< "Numbering"
 // --> #i81002#
 /// new reference format types for referencing bookmarks and set references
-REF_NUMBER,  ///< "Number"
-REF_NUMBER_NO_CONTEXT,   ///< "Number (no context)"
-REF_NUMBER_FULL_CONTEXT, ///< "Number (full context)"
+Number,///< "Number"
+NumberNoContext,   ///< "Number (no context)"
+NumberFullContext, ///< "Number (full context)"
 };
 
 /// Get reference.
@@ -119,18 +119,18 @@ private:
 /// reference to either a SwTextFootnote::m_nSeqNo or a 
SwSetExpField::mnSeqNo
 sal_uInt16 m_nSeqNo;
 sal_uInt16 m_nFlags;
-sal_uInt32 m_nFormat;
+RefFieldFormat m_nFormat;
 
 virtual OUStringExpandImpl(SwRootFrame const* pLayout) const override;
 virtual std::unique_ptr Copy() const override;
 public:
 SW_DLLPUBLIC SwGetRefField( SwGetRefFieldType*, SwMarkName aSetRef, 
OUString aReferenceLanguage,
-ReferencesSubtype nSubType, sal_uInt16 nSeqNo, sal_uInt16 
nFlags, sal_uInt32 nFormat );
+ReferencesSubtype nSubType, sal_uInt16 nSeqNo, sal_uInt16 
nFlags, RefFieldFormat nFormat );
 
 SW_DLLPUBLIC virtual ~SwGetRefField() override;
 
-sal_uInt32 GetFormat() const { return m_nFormat; }
-void SetFormat(sal_uInt32 n) { m_nFormat = n; }
+RefFieldFormat GetFormat() const { return m_nFormat; }
+void SetFormat(RefFieldFormat n) { m_nFormat = n; }
 
 virtual OUString GetFieldName() const override;
 
diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx 
b/sw/qa/extras/uiwriter/uiwriter7.cxx
index 44cf3ece6763..400a4eca199c 100644
--- a/sw/qa/extras/uiwriter/uiwriter7.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter7.cxx
@@ -822,7 +822,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342)
 pWrtShell->StartOfSection();
 //inserting reference field 1
 SwGetRefField aField1(pRefType, SwMarkName(u""_ustr), u""_ustr, 
ReferencesSubtype::Footnote,
-  sal_uInt16(0), sal_uInt16(0), REF_CONTENT);
+  sal_uInt16(0), sal_uInt16(0), 
RefFieldFormat::Content);
 pWrtShell->InsertField2(aField1);
 //inserting second footnote
 pWrtShell->InsertFootnote(u""_ustr);
@@ -830,7 +830,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342)
 pCursor->Move(fnMoveForward);
 //inserting reference field 2
 SwGetRefField aField2(pRefType, SwMarkName(u""_ustr), u""_ustr, 
ReferencesSubtype::Footnote,
-  sal_uInt16(1), sal_uInt16(0), REF_CONTENT);
+  sal_uInt16(1), sal_uInt16(0), 
RefFieldFormat::Content);
 pWrtShell->InsertField2(aField2);
 //inserting third footnote
 pWrtShell->InsertFootnote(u""_ustr);
@@ -839,7 +839,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf77342)
 pCursor->Move(fnMoveForward);
 //inserting reference field 3
 SwGetRefField aFiel

core.git: sw/inc sw/qa sw/source

2025-07-10 Thread Noel Grandin (via logerrit)
 sw/inc/crsrsh.hxx   |3 -
 sw/inc/fldbas.hxx   |3 -
 sw/inc/fmtfld.hxx   |4 -
 sw/inc/reffld.hxx   |   28 +++---
 sw/inc/reffldsubtype.hxx|   32 +++
 sw/qa/extras/uiwriter/uiwriter7.cxx |   27 +-
 sw/qa/extras/uiwriter/uiwriter8.cxx |   12 ++--
 sw/source/core/access/accpara.cxx   |   13 ++--
 sw/source/core/crsr/crstrvl.cxx |2 
 sw/source/core/fields/fldbas.cxx|6 +-
 sw/source/core/fields/reffld.cxx|   97 ++--
 sw/source/core/text/txtfld.cxx  |2 
 sw/source/core/txtnode/atrfld.cxx   |7 ++
 sw/source/core/unocore/unofield.cxx |2 
 sw/source/filter/ww8/wrtw8nds.cxx   |2 
 sw/source/filter/ww8/wrtww8.hxx |3 -
 sw/source/filter/ww8/ww8atr.cxx |   54 ++--
 sw/source/filter/ww8/ww8par.cxx |6 +-
 sw/source/filter/ww8/ww8par5.cxx|8 +-
 sw/source/ui/fldui/fldref.cxx   |   39 +++---
 sw/source/uibase/fldui/fldmgr.cxx   |8 +-
 sw/source/uibase/inc/wrtsh.hxx  |3 -
 sw/source/uibase/uiview/view2.cxx   |2 
 sw/source/uibase/utlui/content.cxx  |   22 
 sw/source/uibase/wrtsh/move.cxx |2 
 sw/source/uibase/wrtsh/wrtsh2.cxx   |   22 
 26 files changed, 224 insertions(+), 185 deletions(-)

New commits:
commit 0d276227903b18a067010f917e999053fbeded11
Author: Noel Grandin 
AuthorDate: Mon Jul 7 08:04:41 2025 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 10 11:07:57 2025 +0200

convert REFERENCESUBTYPE to scoped enum

and move it to its own header file, so I can include that
header file in one of the sw/inc/ header files that everything uses,
without needing to pull in all of reffld.hxx

which flushes out a minor issue in
IMPL_LINK_NOARG(SwFieldRefPage, TypeHdl, weld::TreeView&, void)
the code does
nFlag = REF_SETREFATTR;
but then nFlag is treated as one of the REFFLDFLAG_* constants
However, REF_SETREFATTR evaluates to zero, and nFlag was zero at
that point, so that code is effectively useless, so remove it.

Change-Id: I620661ab932a4a85f6203365e4e877c3d8c97078
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187596
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index aa26d834d3c8..c126d8a8e878 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -62,6 +62,7 @@ class SwTextField;
 class SwTextFootnote;
 class SwTextContentControl;
 class SwMarkName;
+enum class ReferencesSubtype : sal_uInt16;
 
 namespace i18nutil {
 struct SearchOptions2;
@@ -740,7 +741,7 @@ public:
 // on graphics
 bool SelectNxtPrvHyperlink( bool bNext );
 
-bool GotoRefMark( const SwMarkName& rRefMark, sal_uInt16 nSubType,
+bool GotoRefMark( const SwMarkName& rRefMark, ReferencesSubtype nSubType,
 sal_uInt16 nSeqNo, sal_uInt16 nFlags );
 
 // get the nth character from the start or end of the  current selection
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 124a9062317e..78025f4779c0 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -43,6 +43,7 @@ class SvNumberFormatter;
 class IDocumentRedlineAccess;
 class SwGetRefField;
 class SwXFieldMaster;
+enum class ReferencesSubtype : sal_uInt16;
 namespace com::sun::star::uno { class Any; }
 
 typedef struct _xmlTextWriter* xmlTextWriterPtr;
@@ -268,7 +269,7 @@ public:
 void CollectPostIts(std::vector& rvFormatFields, 
IDocumentRedlineAccess const& rIDRA, bool HideRedlines);
 bool HasHiddenInformationNotes() const;
 void GatherNodeIndex(std::vector& rvNodeIndex);
-void GatherRefFields(std::vector& rvRFields, const 
sal_uInt16 nTyp);
+void GatherRefFields(std::vector& rvRFields, const 
ReferencesSubtype nTyp);
 void GatherFields(std::vector& rvFormatFields, bool 
bCollectOnlyInDocNodes=true) const;
 void GatherDdeTables(std::vector& rvTables) const;
 void UpdateDocPos(const SwTwips nDocPos);
diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx
index e74888f5907c..d1742f20bec9 100644
--- a/sw/inc/fmtfld.hxx
+++ b/sw/inc/fmtfld.hxx
@@ -74,8 +74,8 @@ namespace sw {
 };
 struct GatherRefFieldsHint final : SfxHint {
 std::vector& m_rvRFields;
-const sal_uInt16 m_nType;
-GatherRefFieldsHint(std::vector& rvRFields, const 
sal_uInt16 nType)
+const ReferencesSubtype m_nType;
+GatherRefFieldsHint(std::vector& rvRFields, const 
ReferencesSubtype nType)
 : SfxHint(SfxHintId::SwGatherRefFields),
   m_rvRFields(rvRFields), m_nType(nType) {};
 };
diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx
index 601adc4d8555..8d6cbdc1fe6e 100644
--- a/sw/inc/reffld.hxx
+++ b/sw/inc/reffld.hxx
@@ -23,6 +23,7 @@
 
 #include "fldbas.hxx"
 #include "names.hxx"
+#include "reffldsubtype.hxx"
 
 class SwDoc;
 class SwTextNode;
@@ -47,17 +48,6 @@ 

  1   2   3   4   5   6   7   8   9   10   >