core.git: sw/source

2026-04-11 Thread Aryan Mishra (via logerrit)
 sw/source/ui/frmdlg/frmpage.cxx|2 +-
 sw/source/uibase/utlui/content.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 148640a41f0245d4ec078ba6ed2f59749828daa9
Author: Aryan Mishra 
AuthorDate: Sat Apr 11 03:58:13 2026 +0530
Commit: Ilmari Lauhakangas 
CommitDate: Sat Apr 11 15:48:44 2026 +0200

tdf#114441 Convert sal_uLong to size_t and sal_uInt32

Converts the use of sal_uLong to size_t and sal_uInt32 in
content.cxx and frmpage.cxx respectively.

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

diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 2cb0dd8afcf1..4c5d902bbe3d 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -1647,7 +1647,7 @@ void SwFramePage::FillRelLB(const FrameMap* _pMap,
 nLBRelations = _pMap[_nLBSelPos].nLBRelations;
 }
 
-for (sal_uLong nBit = 1; nBit < 0x8000; nBit <<= 1)
+for (sal_uInt32 nBit = 1; nBit < 0x8000; nBit <<= 1)
 {
 if (nLBRelations & static_cast(nBit))
 {
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 812efd18cc1b..5715752f74de 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3808,7 +3808,7 @@ void SwContentTree::Display( bool bActive )
 {
 std::unique_ptr 
xIter(m_xTreeView->make_iterator(xCntTypeEntry.get()));
 std::unique_ptr 
xTemp(m_xTreeView->make_iterator(xIter.get()));
-sal_uLong nPos = 1;
+size_t nPos = 1;
 bool bNext;
 while ((bNext = m_xTreeView->iter_next(*xIter) && 
lcl_IsContent(*xIter, *m_xTreeView)))
 {


core.git: sw/source

2026-04-09 Thread Michael Weghorn (via logerrit)
 sw/source/ui/misc/num.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 8b43eb49e9aa209d08fd0bd101aaeb1912fde6ed
Author: Michael Weghorn 
AuthorDate: Thu Apr 9 13:25:10 2026 +0200
Commit: Michael Weghorn 
CommitDate: Fri Apr 10 06:35:45 2026 +0200

sw: Use SwNumPositionTabPage member instead of TreeView param in hdl

Use SwNumPositionTabPage::m_xLevelLB directly instead of
the weld::TreeView& param passed to the handler.
That is the weld::TreeView that the handler is connected to.

This prepares for switching the signal/handler param to
weld::ItemView& in an upcoming commit, in order to deduplicate
the weld::TreeView and weld::IconView implementations by moving
the logic to their shared weld::ItemView base class.

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

diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index c8eb31576fa9..8f7a0cb87144 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -553,17 +553,17 @@ IMPL_LINK_NOARG(SwNumPositionTabPage, EditModifyHdl, 
weld::ComboBox&, void)
 SetModified();
 }
 
-IMPL_LINK( SwNumPositionTabPage, LevelHdl, weld::TreeView&, rBox, void )
+IMPL_LINK_NOARG(SwNumPositionTabPage, LevelHdl, weld::TreeView&, void)
 {
 sal_uInt16 nSaveNumLvl = m_nActNumLvl;
 m_nActNumLvl = 0;
-auto aRows = rBox.get_selected_rows();
+auto aRows = m_xLevelLB->get_selected_rows();
 if ((std::find(aRows.begin(), aRows.end(), MAXLEVEL) != aRows.end()) &&
 (aRows.size() == 1 || nSaveNumLvl != 0x))
 {
 m_nActNumLvl = 0x;
 for (sal_uInt16 i = 0; i < MAXLEVEL; ++i)
-rBox.unselect(i);
+m_xLevelLB->unselect(i);
 }
 else if (!aRows.empty())
 {
@@ -574,7 +574,7 @@ IMPL_LINK( SwNumPositionTabPage, LevelHdl, weld::TreeView&, 
rBox, void )
 m_nActNumLvl |= nMask;
 nMask <<= 1;
 }
-rBox.unselect(MAXLEVEL);
+m_xLevelLB->unselect(MAXLEVEL);
 }
 else
 {
@@ -584,7 +584,7 @@ IMPL_LINK( SwNumPositionTabPage, LevelHdl, weld::TreeView&, 
rBox, void )
 {
 if(m_nActNumLvl & nMask)
 {
-rBox.select(i);
+m_xLevelLB->select(i);
 break;
 }
 nMask <<=1;


core.git: sw/source

2026-04-09 Thread Michael Weghorn (via logerrit)
 sw/source/ui/misc/outline.cxx|   11 ---
 sw/source/uibase/inc/outline.hxx |1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 7232ab56f7d32d6bd1bc9bc1fc73c5b20abce399
Author: Michael Weghorn 
AuthorDate: Thu Apr 9 13:11:00 2026 +0200
Commit: Michael Weghorn 
CommitDate: Fri Apr 10 06:35:28 2026 +0200

sw: Extract SwOutlineSettingsTabPage::ApplyLevelSelection helper

Extract the SwOutlineSettingsTabPage::LevelHdl logic to a new
helper method SwOutlineSettingsTabPage::ApplyLevelSelection
that doesn't require passing the
SwOutlineSettingsTabPage::m_xLevelLB member, but uses it directly.

This is also in preparation for switching the signal/handler param to
weld::ItemView& in an upcoming commit, in order to deduplicate
the weld::TreeView and weld::IconView implementations by moving
the logic to their shared weld::ItemView base class.

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

diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 7acffc0aa3cc..6cb03eb9bb52 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -546,9 +546,9 @@ voidSwOutlineSettingsTabPage::Update()
 SetModified();
 }
 
-IMPL_LINK( SwOutlineSettingsTabPage, LevelHdl, weld::TreeView&, rBox, void )
+void SwOutlineSettingsTabPage::ApplyLevelSelection()
 {
-auto aRows = rBox.get_selected_rows();
+auto aRows = m_xLevelLB->get_selected_rows();
 assert(aRows.empty() || aRows.size() == 1); // Single selection only
 if (aRows.empty() || aRows[0] == MAXLEVEL)
 {
@@ -561,6 +561,11 @@ IMPL_LINK( SwOutlineSettingsTabPage, LevelHdl, 
weld::TreeView&, rBox, void )
 Update();
 }
 
+IMPL_LINK_NOARG(SwOutlineSettingsTabPage, LevelHdl, weld::TreeView&, void)
+{
+ApplyLevelSelection();
+}
+
 IMPL_LINK(SwOutlineSettingsTabPage, ToggleComplete, weld::SpinButton&, rEdit, 
void)
 {
 sal_uInt16 nMask = 1;
@@ -791,7 +796,7 @@ void SwOutlineSettingsTabPage::ActivatePage(const 
SfxItemSet& )
 m_xLevelLB->select(lcl_BitToLevel(m_nActLevel));
 else
 m_xLevelLB->select(MAXLEVEL);
-LevelHdl(*m_xLevelLB);
+ApplyLevelSelection();
 }
 
 DeactivateRC SwOutlineSettingsTabPage::DeactivatePage(SfxItemSet*)
diff --git a/sw/source/uibase/inc/outline.hxx b/sw/source/uibase/inc/outline.hxx
index 0eef8978e53c..f35157ffcf73 100644
--- a/sw/source/uibase/inc/outline.hxx
+++ b/sw/source/uibase/inc/outline.hxx
@@ -88,6 +88,7 @@ class SwOutlineSettingsTabPage final : public SfxTabPage
 std::unique_ptr m_xStartEdit;
 std::unique_ptr m_xPreviewWIN;
 
+void ApplyLevelSelection();
 DECL_LINK( LevelHdl, weld::TreeView&, void );
 DECL_LINK( ToggleComplete, weld::SpinButton&, void );
 DECL_LINK( CollSelect, weld::ComboBox&, void );


core.git: sw/source

2026-04-09 Thread Michael Weghorn (via logerrit)
 sw/source/ui/misc/glossary.cxx|   27 ---
 sw/source/uibase/inc/glossary.hxx |1 +
 2 files changed, 17 insertions(+), 11 deletions(-)

New commits:
commit 5b9333b66a1a2f268bb2c080b3aa218712d9bb3f
Author: Michael Weghorn 
AuthorDate: Thu Apr 9 12:55:53 2026 +0200
Commit: Michael Weghorn 
CommitDate: Fri Apr 10 06:35:02 2026 +0200

sw: Extract SwGlossaryDlg::SelectGroup helper

Extract the SwGlossaryDlg::GrpSelect logic to a new
helper method SwGlossaryDlg::SelectGroup
that doesn't require passing the
SwEditRegionDlg::m_xCategoryBox member every time, but
uses it directly.

This is also in preparation for switching the signal/handler param to
weld::ItemView& in an upcoming commit, in order to deduplicate
the weld::TreeView and weld::IconView implementations by moving
the logic to their shared weld::ItemView base class.

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

diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index a0a9b6519a0d..eb80d389 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -387,22 +387,22 @@ OUString getCurrentGlossary()
 }
 
 // select new group
-IMPL_LINK(SwGlossaryDlg, GrpSelect, weld::TreeView&, rBox, void)
+void SwGlossaryDlg::SelectGroup()
 {
-std::unique_ptr xEntry = rBox.get_selected();
+std::unique_ptr xEntry = m_xCategoryBox->get_selected();
 if (!xEntry)
 return;
 
-std::unique_ptr xParent = rBox.make_iterator(xEntry.get());
+std::unique_ptr xParent = 
m_xCategoryBox->make_iterator(xEntry.get());
 weld::TreeIter* pParent;
-if (rBox.get_iter_depth(*xParent))
+if (m_xCategoryBox->get_iter_depth(*xParent))
 {
-rBox.iter_parent(*xParent);
+m_xCategoryBox->iter_parent(*xParent);
 pParent = xParent.get();
 }
 else
 pParent = xEntry.get();
-GroupUserData* pGroupData = 
weld::fromId(rBox.get_id(*pParent));
+GroupUserData* pGroupData = 
weld::fromId(m_xCategoryBox->get_id(*pParent));
 ::SetCurrGlosGroup(pGroupData->sGroupName
 + OUStringChar(GLOS_DELIM)
 + OUString::number(pGroupData->nPathIdx));
@@ -414,9 +414,9 @@ IMPL_LINK(SwGlossaryDlg, GrpSelect, weld::TreeView&, rBox, 
void)
 m_bIsOld = m_pGlossaryHdl->IsOld();
 if( pParent != xEntry.get())
 {
-OUString aName(rBox.get_text(*xEntry));
+OUString aName(m_xCategoryBox->get_text(*xEntry));
 m_xNameED->set_text(aName);
-m_xShortNameEdit->set_text(rBox.get_id(*xEntry));
+m_xShortNameEdit->set_text(m_xCategoryBox->get_id(*xEntry));
 m_xInsertBtn->set_sensitive( !m_bIsDocReadOnly);
 ShowAutoText(::GetCurrGlosGroup(), m_xShortNameEdit->get_text());
 }
@@ -432,6 +432,11 @@ IMPL_LINK(SwGlossaryDlg, GrpSelect, weld::TreeView&, rBox, 
void)
 }
 }
 
+IMPL_LINK_NOARG(SwGlossaryDlg, GrpSelect, weld::TreeView&, void)
+{
+SelectGroup();
+}
+
 void SwGlossaryDlg::Apply()
 {
 const OUString aGlosName(m_xShortNameEdit->get_text());
@@ -632,7 +637,7 @@ IMPL_LINK(SwGlossaryDlg, MenuHdl, const OUString&, 
rItemIdent, void)
 m_xCategoryBox->scroll_to_row(*xNewEntry);
 }
 }
-GrpSelect(*m_xCategoryBox);
+SelectGroup();
 }
 else if (rItemIdent == "delete")
 {
@@ -780,7 +785,7 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl, weld::Button&, void)
 {
 m_xCategoryBox->select(*xEntry);
 m_xCategoryBox->scroll_to_row(*xEntry);
-GrpSelect(*m_xCategoryBox);
+SelectGroup();
 break;
 }
 }
@@ -894,7 +899,7 @@ void SwGlossaryDlg::Init()
 m_xCategoryBox->expand_row(*xSelEntry);
 m_xCategoryBox->select(*xSelEntry);
 m_xCategoryBox->scroll_to_row(*xSelEntry);
-GrpSelect(*m_xCategoryBox);
+SelectGroup();
 }
 
 const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
diff --git a/sw/source/uibase/inc/glossary.hxx 
b/sw/source/uibase/inc/glossary.hxx
index 2cd2ab97fd0f..0749a21afcd1 100644
--- a/sw/source/uibase/inc/glossary.hxx
+++ b/sw/source/uibase/inc/glossary.hxx
@@ -82,6 +82,7 @@ class SwGlossaryDlg final : public SfxDialogController
 
 void EnableShortName(bool bOn = true);
 void ShowPreview();
+void SelectGroup();
 
 DECL_LINK( NameModify, weld::Entry&, void );
 DECL_LINK(NameDoubleClick, const weld::TreeIter&, bool);


core.git: sw/source

2026-04-09 Thread Michael Weghorn (via logerrit)
 sw/source/ui/dialog/uiregionsw.cxx |   30 ++
 sw/source/ui/inc/regionsw.hxx  |1 +
 2 files changed, 19 insertions(+), 12 deletions(-)

New commits:
commit c1fcfa408a5b0ed54b4275ced32cfa2c078135bd
Author: Michael Weghorn 
AuthorDate: Thu Apr 9 12:33:17 2026 +0200
Commit: Michael Weghorn 
CommitDate: Fri Apr 10 06:34:35 2026 +0200

sw: Extract SwEditRegionDlg::UpdateFromSelection helper

Extract the SwEditRegionDlg::GetFirstEntryHdl logic to a new
helper method SwEditRegionDlg::UpdateFromSelection
that doesn't require passing the
SwEditRegionDlg::m_xTree member every time, but
uses it directly.

This is also in preparation for switching the signal/handler param to
weld::ItemView& in an upcoming commit, in order to deduplicate
the weld::TreeView and weld::IconView implementations by moving
the logic to their shared weld::ItemView base class.

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

diff --git a/sw/source/ui/dialog/uiregionsw.cxx 
b/sw/source/ui/dialog/uiregionsw.cxx
index 998cfc60e0d3..97f14def6c56 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -415,7 +415,7 @@ SwEditRegionDlg::SwEditRegionDlg(weld::Window* pParent, 
SwWrtShell& rWrtSh)
 if (m_xTree->get_iter_first(*xIter))
 {
 m_xTree->select(*xIter);
-GetFirstEntryHdl(*m_xTree);
+UpdateFromSelection();
 }
 }
 
@@ -509,7 +509,7 @@ void SwEditRegionDlg::RecurseList(const SwSectionFormat* 
pFormat, const weld::Tr
 {
 m_xTree->select(*xIter);
 m_xTree->scroll_to_row(*xIter);
-GetFirstEntryHdl(*m_xTree);
+UpdateFromSelection();
 }
 }
 }
@@ -542,7 +542,7 @@ void SwEditRegionDlg::RecurseList(const SwSectionFormat* 
pFormat, const weld::Tr
 {
 m_xTree->select(*xIter);
 m_xTree->scroll_to_row(*xIter);
-GetFirstEntryHdl(*m_xTree);
+UpdateFromSelection();
 }
 }
 }
@@ -586,7 +586,7 @@ void SwEditRegionDlg::SelectSection(std::u16string_view 
rSectionName)
 m_xTree->unselect_all();
 m_xTree->select(*xIter);
 m_xTree->scroll_to_row(*xIter);
-GetFirstEntryHdl(*m_xTree);
+UpdateFromSelection();
 break;
 }
 } while (m_xTree->iter_next(*xIter));
@@ -594,10 +594,10 @@ void SwEditRegionDlg::SelectSection(std::u16string_view 
rSectionName)
 
 // selected entry in TreeListBox is showed in Edit window in case of
 // multiselection some controls are disabled
-IMPL_LINK(SwEditRegionDlg, GetFirstEntryHdl, weld::TreeView&, rBox, void)
+void SwEditRegionDlg::UpdateFromSelection()
 {
 m_bDontCheckPasswd = true;
-std::unique_ptr xIter = rBox.get_selected();
+std::unique_ptr xIter = m_xTree->get_selected();
 m_xHideCB->set_sensitive(true);
 // edit in readonly sections
 m_xEditInReadonlyCB->set_sensitive(true);
@@ -605,7 +605,7 @@ IMPL_LINK(SwEditRegionDlg, GetFirstEntryHdl, 
weld::TreeView&, rBox, void)
 m_xProtectCB->set_sensitive(true);
 m_xFileCB->set_sensitive(true);
 css::uno::Sequence  aCurPasswd;
-if (1 < rBox.count_selected_rows())
+if (1 < m_xTree->count_selected_rows())
 {
 m_xHideCB->set_state(TRISTATE_INDET);
 m_xProtectCB->set_state(TRISTATE_INDET);
@@ -688,10 +688,10 @@ IMPL_LINK(SwEditRegionDlg, GetFirstEntryHdl, 
weld::TreeView&, rBox, void)
 m_xPasswdPB->set_sensitive(bPasswdEnabled);
 if(!bPasswdValid)
 {
-xIter = rBox.get_selected();
-rBox.unselect_all();
-rBox.select(*xIter);
-GetFirstEntryHdl(rBox);
+xIter = m_xTree->get_selected();
+m_xTree->unselect_all();
+m_xTree->select(*xIter);
+UpdateFromSelection();
 return;
 }
 else
@@ -713,7 +713,7 @@ IMPL_LINK(SwEditRegionDlg, GetFirstEntryHdl, 
weld::TreeView&, rBox, void)
 
 m_xOK->set_sensitive(true);
 m_xPasswdCB->set_sensitive(true);
-m_xCurName->set_text(rBox.get_text(*xIter));
+m_xCurName->set_text(m_xTree->get_text(*xIter));
 m_xCurName->set_sensitive(true);
 m_xDismiss->set_sensitive(true);
 const OUString aFile = pRepr->GetFile();
@@ -753,6 +753,12 @@ IMPL_LINK(SwEditRegionDlg, GetFirstEntryHdl, 
weld::TreeView&, rBox, void)
 m_bDontCheckPasswd = false;
 }
 
+
+IMPL_LINK_NOARG(SwEditRegionDlg, GetFirstEntryHdl, weld::TreeView&, void)
+{
+UpdateFromSelection();
+}
+
 // in OkHdl the modified settings are being applied and reversed regions are 
deleted
 IMPL_LINK_N

core.git: sw/source

2026-04-09 Thread Michael Weghorn (via logerrit)
 sw/source/ui/dbui/dbinsdlg.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 38fc24860098009327b49bf87467054626787a92
Author: Michael Weghorn 
AuthorDate: Thu Apr 9 12:21:32 2026 +0200
Commit: Michael Weghorn 
CommitDate: Fri Apr 10 06:33:52 2026 +0200

sw: Use reference directly, drop extra pointer var

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

diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 4f7c406d8932..86063d610137 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -754,9 +754,7 @@ IMPL_LINK_NOARG(SwInsertDBColAutoPilot, AutoFormatHdl, 
weld::Button&, void)
 
 IMPL_LINK(SwInsertDBColAutoPilot, TVSelectHdl, weld::TreeView&, rBox, void)
 {
-weld::TreeView* pGetBox = &rBox;
-
-SwInsDBColumn aSrch(pGetBox->get_selected_text());
+SwInsDBColumn aSrch(rBox.get_selected_text());
 SwInsDBColumns::const_iterator it = m_aDBColumns.find( &aSrch );
 
 // set the selected FieldName at the FormatGroupBox, so that


core.git: sw/source

2026-04-09 Thread Michael Weghorn (via logerrit)
 sw/source/ui/misc/glossary.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 19f214fb57daf9e23d3c41b0790ed3a8c94a0624
Author: Michael Weghorn 
AuthorDate: Wed Apr 8 09:02:10 2026 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 9 10:19:00 2026 +0200

sw: Use SwGlossaryDlg member instead of TreeView param in hdl

Use SwGlossaryDlg::m_xCategoryBox directly instead of
the weld::TreeView& param passed to the handler.
That is the weld::TreeView that the handler is connected to.

This also prepares for adjusting weld::TreeView::m_aRowActivatedHdl
to pass the weld::TreeIter of the activated entry instead of just the
weld::TreeView itself.

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

diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 113cb007ab28..b276bfc1de86 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -517,10 +517,10 @@ IMPL_LINK(SwGlossaryDlg, NameModify, weld::Entry&, rEdit, 
void)
 }
 }
 
-IMPL_LINK( SwGlossaryDlg, NameDoubleClick, weld::TreeView&, rBox, bool )
+IMPL_LINK_NOARG(SwGlossaryDlg, NameDoubleClick, weld::TreeView&, bool)
 {
-std::unique_ptr xEntry = rBox.get_selected();
-if (xEntry && rBox.get_iter_depth(*xEntry) && !m_bIsDocReadOnly)
+std::unique_ptr xEntry = m_xCategoryBox->get_selected();
+if (xEntry && m_xCategoryBox->get_iter_depth(*xEntry) && !m_bIsDocReadOnly)
 m_xDialog->response(RET_OK);
 return true;
 }


core.git: sw/source

2026-04-03 Thread Xisco Fauli (via logerrit)
 sw/source/core/access/accmap.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit ef4dbb27ab835f51df5b14bbfd1d2cb834d41e15
Author: Xisco Fauli 
AuthorDate: Thu Apr 2 18:02:00 2026 +0200
Commit: Xisco Fauli 
CommitDate: Fri Apr 3 09:43:48 2026 +0200

cid#1690678: Uninitialized scalar field

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

diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 68c79d28ea0e..fd59f68150a7 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -688,8 +688,9 @@ public:
 void DisposePage(const SwPageFrame *pPageFrame );
 };
 
-SwAccPreviewData::SwAccPreviewData() :
-mpSelPage( nullptr )
+SwAccPreviewData::SwAccPreviewData()
+: mfScale(0.0)
+, mpSelPage( nullptr )
 {
 }
 


core.git: sw/source

2026-03-31 Thread RashmiVid (via logerrit)
 sw/source/core/doc/tblafmt.cxx|   18 +-
 sw/source/core/docnode/ndtbl1.cxx |   16 +++-
 2 files changed, 16 insertions(+), 18 deletions(-)

New commits:
commit 9f2e368e763a4ae595804567137dcd2537a3d60f
Author: RashmiVid 
AuthorDate: Fri Mar 27 03:33:54 2026 -0400
Commit: Ilmari Lauhakangas 
CommitDate: Tue Mar 31 17:35:47 2026 +0200

tdf#145538 Use range based for loops in tblafmt.cxx and ndtbl1.cxx

Replace index basedloops with range based loops where safe.
No functional change intended.

Change-Id: I9b6ed9a03d4a35d809f3049c371efa7d1f43e060
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202787
Reviewed-by: Dmitriy Usov 
Tested-by: Jenkins
Reviewed-by: Jonathan Clark 

diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index e6d65ab7c8ed..89c97483f72c 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -854,10 +854,10 @@ void SwCellStyleTable::RemoveBoxFormat(const OUString& 
sName)
 
 UIName SwCellStyleTable::GetBoxFormatName(const SwBoxAutoFormat& rBoxFormat) 
const
 {
-for (size_t i = 0; i < m_aCellStyles.size(); ++i)
+for (const auto& rCellStyle : m_aCellStyles)
 {
-if (m_aCellStyles[i].second.get() == &rBoxFormat)
-return m_aCellStyles[i].first;
+if (rCellStyle.second.get() == &rBoxFormat)
+return rCellStyle.first;
 }
 
 // box format not found
@@ -866,10 +866,10 @@ UIName SwCellStyleTable::GetBoxFormatName(const 
SwBoxAutoFormat& rBoxFormat) con
 
 SwBoxAutoFormat* SwCellStyleTable::GetBoxFormat(const UIName& sName) const
 {
-for (size_t i = 0; i < m_aCellStyles.size(); ++i)
+for (const auto& rCellStyle : m_aCellStyles)
 {
-if (m_aCellStyles[i].first == sName)
-return m_aCellStyles[i].second.get();
+if (rCellStyle.first == sName)
+return rCellStyle.second.get();
 }
 
 return nullptr;
@@ -882,11 +882,11 @@ void 
SwCellStyleTable::ChangeBoxFormatName(std::u16string_view sFromName, const
 SAL_INFO("sw.core", "SwCellStyleTable::ChangeBoxName, box with given 
name already exists");
 return;
 }
-for (size_t i = 0; i < m_aCellStyles.size(); ++i)
+for (auto& rCellStyle : m_aCellStyles)
 {
-if (m_aCellStyles[i].first == sFromName)
+if (rCellStyle.first == sFromName)
 {
-m_aCellStyles[i].first = sToName;
+rCellStyle.first = sToName;
 // changed successfully
 return;
 }
diff --git a/sw/source/core/docnode/ndtbl1.cxx 
b/sw/source/core/docnode/ndtbl1.cxx
index 65e27964d4e6..ee7005f73d6b 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -1288,10 +1288,8 @@ void SwDoc::SetBoxAttr( const SwCursor& rCursor, const 
SfxPoolItem &rNew )
 
 std::vector> aFormatCmp;
 aFormatCmp.reserve(std::max(255, aBoxes.size()));
-for (size_t i = 0; i < aBoxes.size(); ++i)
+for (auto pBox : aBoxes)
 {
-SwTableBox *pBox = aBoxes[i];
-
 SwFrameFormat *pNewFormat = SwTableFormatCmp::FindNewFormat( 
aFormatCmp, pBox->GetFrameFormat(), 0 );
 if ( nullptr != pNewFormat )
 pBox->ChgFrameFormat( static_cast(pNewFormat) );
@@ -1330,14 +1328,14 @@ bool SwDoc::GetBoxAttr( const SwCursor& rCursor, 
std::unique_ptr& r
 bRet = true;
 bool bOneFound = false;
 const sal_uInt16 nWhich = rToFill->Which();
-for (size_t i = 0; i < aBoxes.size(); ++i)
+for (auto pBox : aBoxes)
 {
 switch ( nWhich )
 {
 case RES_BACKGROUND:
 {
 std::unique_ptr xBack =
-aBoxes[i]->GetFrameFormat()->makeBackgroundBrushItem();
+pBox->GetFrameFormat()->makeBackgroundBrushItem();
 if( !bOneFound )
 {
 rToFill = std::move(xBack);
@@ -1351,7 +1349,7 @@ bool SwDoc::GetBoxAttr( const SwCursor& rCursor, 
std::unique_ptr& r
 case RES_FRAMEDIR:
 {
 const SvxFrameDirectionItem& rDir =
-aBoxes[i]->GetFrameFormat()->GetFrameDir();
+pBox->GetFrameFormat()->GetFrameDir();
 if( !bOneFound )
 {
 rToFill.reset(rDir.Clone());
@@ -1364,7 +1362,7 @@ bool SwDoc::GetBoxAttr( const SwCursor& rCursor, 
std::unique_ptr& r
 case RES_VERT_ORIENT:
 {
 const SwFormatVertOrient& rOrient =
-
aBoxes[i]->GetFrameFormat()->GetVertOrient();
+pBox->GetFrameFormat()->GetVertOrient();
 if( !bOneFound )
 {
 rToFill.reset(rOrient.Clone());
@@ -1399,10 

core.git: sw/source

2026-03-30 Thread RaquelZuelke (via logerrit)
 sw/source/core/access/accframebase.hxx |5 +
 sw/source/core/access/accfrmobj.hxx|5 +
 2 files changed, 2 insertions(+), 8 deletions(-)

New commits:
commit 9eacb83ec52bf85a48fbd9969f6ecf24afe01d27
Author: RaquelZuelke 
AuthorDate: Sat Mar 21 22:51:33 2026 -0700
Commit: Ilmari Lauhakangas 
CommitDate: Tue Mar 31 07:40:55 2026 +0200

tdf#143148 Replace include guards with pragma once

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

diff --git a/sw/source/core/access/accframebase.hxx 
b/sw/source/core/access/accframebase.hxx
index 1487073c3b5e..f6310eed4c2c 100644
--- a/sw/source/core/access/accframebase.hxx
+++ b/sw/source/core/access/accframebase.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SW_SOURCE_CORE_ACCESS_ACCFRAMEBASE_HXX
-#define INCLUDED_SW_SOURCE_CORE_ACCESS_ACCFRAMEBASE_HXX
+#pragma once
 
 #include "acccontext.hxx"
 #include 
@@ -60,6 +59,4 @@ public:
 virtual bool SetSelectedState( bool bSelected ) override;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accfrmobj.hxx 
b/sw/source/core/access/accfrmobj.hxx
index 5b76a79ed3cb..390d3496b5b0 100644
--- a/sw/source/core/access/accfrmobj.hxx
+++ b/sw/source/core/access/accfrmobj.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SW_SOURCE_CORE_ACCESS_ACCFRMOBJ_HXX
-#define INCLUDED_SW_SOURCE_CORE_ACCESS_ACCFRMOBJ_HXX
+#pragma once
 
 #include 
 
@@ -90,6 +89,4 @@ class SwAccessibleChild
 
 } // eof of namespace sw::access
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: sw/source

2026-03-29 Thread Jan Luethi (via logerrit)
 sw/source/uibase/sidebar/WrapPropertyPanel.hxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit c6cdc6dff5f20acccfbc9ecebd1f4183e59c2342
Author: Jan Luethi 
AuthorDate: Thu Mar 26 20:55:27 2026 +0100
Commit: Ilmari Lauhakangas 
CommitDate: Mon Mar 30 07:35:56 2026 +0200

tdf#143148: Use pragma once instead of include guards

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

diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.hxx 
b/sw/source/uibase/sidebar/WrapPropertyPanel.hxx
index 193a749dd6fd..2170c497047f 100644
--- a/sw/source/uibase/sidebar/WrapPropertyPanel.hxx
+++ b/sw/source/uibase/sidebar/WrapPropertyPanel.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_SOURCE_UIBASE_SIDEBAR_WRAPPROPERTYPANEL_HXX
-#define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_WRAPPROPERTYPANEL_HXX
+
+#pragma once
 
 #include 
 #include 
@@ -84,6 +84,4 @@ namespace sw::sidebar {
 
 } // end of namespace ::sw::sidebar
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: sw/source

2026-03-29 Thread Jan Luethi (via logerrit)
 sw/source/uibase/sidebar/PageColumnControl.hxx |6 ++
 sw/source/uibase/sidebar/PageFooterPanel.hxx   |6 ++
 sw/source/uibase/sidebar/PageMarginControl.hxx |6 ++
 sw/source/uibase/sidebar/PageStylesPanel.hxx   |6 ++
 4 files changed, 8 insertions(+), 16 deletions(-)

New commits:
commit 1ee5a42fffa14a569c5c88381bc9945872776e0c
Author: Jan Luethi 
AuthorDate: Thu Mar 26 21:04:22 2026 +0100
Commit: Ilmari Lauhakangas 
CommitDate: Mon Mar 30 07:35:37 2026 +0200

tdf#143148: Use pragma once instead of include guards

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

diff --git a/sw/source/uibase/sidebar/PageColumnControl.hxx 
b/sw/source/uibase/sidebar/PageColumnControl.hxx
index 428a83d5ccc4..1e20753e1d37 100644
--- a/sw/source/uibase/sidebar/PageColumnControl.hxx
+++ b/sw/source/uibase/sidebar/PageColumnControl.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_SOURCE_UIBASE_SIDEBAR_PAGECOLUMNCONTROL_HXX
-#define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGECOLUMNCONTROL_HXX
+
+#pragma once
 
 #include 
 #include 
@@ -51,6 +51,4 @@ private:
 
 } // end of namespace sw::sidebar
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/sidebar/PageFooterPanel.hxx 
b/sw/source/uibase/sidebar/PageFooterPanel.hxx
index 6f5397a16cc7..105e2db4da43 100644
--- a/sw/source/uibase/sidebar/PageFooterPanel.hxx
+++ b/sw/source/uibase/sidebar/PageFooterPanel.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_SOURCE_UIBASE_SIDEBAR_PAGEFOOTERPANEL_HXX
-#define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEFOOTERPANEL_HXX
+
+#pragma once
 
 #include 
 
@@ -96,6 +96,4 @@ private:
 
 } //end of namespace sw::sidebar
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/sidebar/PageMarginControl.hxx 
b/sw/source/uibase/sidebar/PageMarginControl.hxx
index 0ff3af4cbd91..a8bf6d289625 100644
--- a/sw/source/uibase/sidebar/PageMarginControl.hxx
+++ b/sw/source/uibase/sidebar/PageMarginControl.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_SOURCE_UIBASE_SIDEBAR_PAGEMARGINCONTROL_HXX
-#define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEMARGINCONTROL_HXX
+
+#pragma once
 
 #include 
 
@@ -110,6 +110,4 @@ private:
 
 } // end of namespace sw::sidebar
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/sidebar/PageStylesPanel.hxx 
b/sw/source/uibase/sidebar/PageStylesPanel.hxx
index 11089cf09f10..625bb4b80db4 100644
--- a/sw/source/uibase/sidebar/PageStylesPanel.hxx
+++ b/sw/source/uibase/sidebar/PageStylesPanel.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_SOURCE_UIBASE_SIDEBAR_PAGESTYLESPANEL_HXX
-#define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGESTYLESPANEL_HXX
+
+#pragma once
 
 #include 
 
@@ -109,6 +109,4 @@ private:
 
 } //end of namespace sw::sidebar
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: sw/source

2026-03-26 Thread discotechnology (via logerrit)
 sw/source/uibase/inc/concustomshape.hxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit e8301fdf0b96eb3e4f0d5570b69f3f8b1cc9a95a
Author: discotechnology 
AuthorDate: Wed Mar 25 14:36:12 2026 -0700
Commit: Ilmari Lauhakangas 
CommitDate: Thu Mar 26 09:14:18 2026 +0100

tdf#143148: Replace include guards with #pragma once

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

diff --git a/sw/source/uibase/inc/concustomshape.hxx 
b/sw/source/uibase/inc/concustomshape.hxx
index 8d2b7007d5b0..cd52a6237815 100644
--- a/sw/source/uibase/inc/concustomshape.hxx
+++ b/sw/source/uibase/inc/concustomshape.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_CONCUSTOMSHAPE_HXX
-#define INCLUDED_SW_SOURCE_UIBASE_INC_CONCUSTOMSHAPE_HXX
+#pragma once
 
 #include 
 #include "drawbase.hxx"
@@ -53,6 +52,4 @@ class ConstCustomShape final : public SwDrawBase
 virtual bool doConstructOrthogonal() const override;
 };
 
-#endif // INCLUDED_SW_SOURCE_UIBASE_INC_CONCUSTOMSHAPE_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: sw/source

2026-03-25 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/inc/QuickFindPanel.hxx |2 -
 sw/source/uibase/sidebar/QuickFindPanel.cxx |   51 +---
 2 files changed, 41 insertions(+), 12 deletions(-)

New commits:
commit 44a0fa54b8da6408336507d0f2fe49e6bd752e43
Author: Jim Raykowski 
AuthorDate: Mon Mar 23 06:06:30 2026 -0800
Commit: Jim Raykowski 
CommitDate: Wed Mar 25 23:28:05 2026 +0100

tdf#171142 Quickfind page separator entries should not receive focus

 * Makes clicking on a page separator entry select the next entry in the
finds list.

 * Makes up/down arrow key movements skip over page separator entries.

 * Makes movements that result in selecting a page separator entry
select the next entry in the finds list. Movements that can do this are
the page up/down and home keys.

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

diff --git a/sw/source/uibase/inc/QuickFindPanel.hxx 
b/sw/source/uibase/inc/QuickFindPanel.hxx
index f530f77d3946..5e38c9df9406 100644
--- a/sw/source/uibase/inc/QuickFindPanel.hxx
+++ b/sw/source/uibase/inc/QuickFindPanel.hxx
@@ -78,7 +78,7 @@ private:
 DECL_LINK(SearchFindsListRender, weld::TreeView::render_args, void);
 DECL_LINK(SearchFindsListSelectionChangedHandler, weld::TreeView&, void);
 DECL_LINK(SearchFindsListRowActivatedHandler, weld::TreeView&, bool);
-DECL_LINK(SearchFindsListMousePressHandler, const MouseEvent&, bool);
+DECL_LINK(SearchFindsListKeyPressHandler, const KeyEvent&, bool);
 DECL_LINK(SearchOptionsToolbarClickedHandler, const OUString&, void);
 DECL_LINK(FindAndReplaceToolbarClickedHandler, const OUString&, void);
 DECL_LINK(SimilarityCheckButtonToggledHandler, weld::Toggleable&, void);
diff --git a/sw/source/uibase/sidebar/QuickFindPanel.cxx 
b/sw/source/uibase/sidebar/QuickFindPanel.cxx
index 16ae8b891ab4..e0edf0e72083 100644
--- a/sw/source/uibase/sidebar/QuickFindPanel.cxx
+++ b/sw/source/uibase/sidebar/QuickFindPanel.cxx
@@ -194,8 +194,8 @@ QuickFindPanel::QuickFindPanel(weld::Widget* pParent, const 
uno::Referenceconnect_row_activated(
 LINK(this, QuickFindPanel, SearchFindsListRowActivatedHandler));
-m_xSearchFindsList->connect_mouse_press(
-LINK(this, QuickFindPanel, SearchFindsListMousePressHandler));
+m_xSearchFindsList->connect_key_press(
+LINK(this, QuickFindPanel, SearchFindsListKeyPressHandler));
 }
 
 // tdf#162580 related: When upgrading from Find toolbar search to advanced 
Find and Replace
@@ -275,13 +275,40 @@ IMPL_LINK_NOARG(QuickFindPanel, 
SearchComboBoxActivateHandler, weld::ComboBox&,
 return true;
 }
 
-IMPL_LINK(QuickFindPanel, SearchFindsListMousePressHandler, const MouseEvent&, 
rMEvt, bool)
+IMPL_LINK(QuickFindPanel, SearchFindsListKeyPressHandler, const KeyEvent&, 
rKeyEvt, bool)
 {
-if (std::unique_ptr xEntry
-= m_xSearchFindsList->get_dest_row_at_pos(rMEvt.GetPosPixel(), false, 
false))
+vcl::KeyCode aCode = rKeyEvt.GetKeyCode();
+sal_uInt16 nCode = aCode.GetCode();
+
+if (nCode == KEY_DOWN)
 {
-return m_xSearchFindsList->get_id(*xEntry)[0] == '-';
+if (std::unique_ptr xEntry = 
m_xSearchFindsList->get_cursor();
+xEntry && m_xSearchFindsList->iter_next(*xEntry)
+&& m_xSearchFindsList->get_id(*xEntry)[0] == '-'
+&& m_xSearchFindsList->iter_next(*xEntry))
+{
+m_xSearchFindsList->set_cursor(*xEntry);
+SearchFindsListSelectionChangedHandler(*m_xSearchFindsList);
+return true;
+}
 }
+else if (nCode == KEY_UP)
+{
+if (std::unique_ptr xEntry = 
m_xSearchFindsList->get_cursor();
+xEntry && m_xSearchFindsList->iter_previous(*xEntry)
+&& m_xSearchFindsList->get_id(*xEntry)[0] == '-')
+{
+if (m_xSearchFindsList->iter_previous(*xEntry))
+{
+m_xSearchFindsList->set_cursor(*xEntry);
+SearchFindsListSelectionChangedHandler(*m_xSearchFindsList);
+}
+else
+m_xSearchFindsList->scroll_to_row(0);
+return true;
+}
+}
+
 return false;
 }
 
@@ -417,7 +444,13 @@ IMPL_LINK_NOARG(QuickFindPanel, 
SearchFindsListSelectionChangedHandler, weld::Tr
 
 // check for page number entry
 if (sId[0] == '-')
-return;
+{
+int nRow = m_xSearchFindsList->get_selected_index();
+(void)m_xSearchFindsList->iter_next(*xEntry);
+m_xSearchFindsList->set_cursor(*xEntry);
+m_xSearchFindsList->scroll_to_row(nRow);
+sId = m_xSearchFindsList->get_id(*xEntry);
+}
 
 std::unique_ptr& rxPaM = m_vPaMs[sId.toUInt64()];
 
@@ -463,10 +496,6 @@ IMPL_LINK_NOARG(QuickFindPanel, 
SearchFindsListRowActivatedHandler, weld::TreeVi
 if (!xEntry)
 return false;
 
-// chec

core.git: sw/source

2026-03-25 Thread Caolán McNamara (via logerrit)
 sw/source/filter/html/htmlcss1.cxx |   16 +---
 sw/source/filter/html/htmlctxt.cxx |   52 +++--
 sw/source/filter/html/htmlgrin.cxx |8 ++--
 sw/source/filter/html/htmltab.cxx  |9 ++---
 sw/source/filter/html/swhtml.cxx   |   66 -
 5 files changed, 84 insertions(+), 67 deletions(-)

New commits:
commit 1bc864c291cf8eefc596b2f5ba70d6fb5ffc7d61
Author: Caolán McNamara 
AuthorDate: Wed Mar 25 13:20:15 2026 +
Commit: Caolán McNamara 
CommitDate: Wed Mar 25 16:05:37 2026 +0100

ofz#495483120 check NewAttr return

an issue since:

commit 9a79d74342a05f87365ab60ad057b1329a3bf216
Date:   Fri Mar 6 09:00:40 2026 +

ofz#390465661 Timeout on deeply nested tags

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

diff --git a/sw/source/filter/html/htmlcss1.cxx 
b/sw/source/filter/html/htmlcss1.cxx
index cc0bb8d90cd8..6f742db176c7 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -2262,13 +2262,15 @@ void SwHTMLParser::InsertParaAttrs( const SfxItemSet& 
rItemSet )
 
 if( ppAttr )
 {
-NewAttr(m_xAttrTab, ppAttr, *pItem);
-if( RES_PARATR_BEGIN > nWhich )
-(*ppAttr)->SetLikePara();
-m_aParaAttrs.push_back( *ppAttr );
-bool bSuccess = EndAttr( *ppAttr, false );
-if (!bSuccess)
-m_aParaAttrs.pop_back();
+if (NewAttr(m_xAttrTab, ppAttr, *pItem))
+{
+if( RES_PARATR_BEGIN > nWhich )
+(*ppAttr)->SetLikePara();
+m_aParaAttrs.push_back( *ppAttr );
+bool bSuccess = EndAttr( *ppAttr, false );
+if (!bSuccess)
+m_aParaAttrs.pop_back();
+}
 }
 }
 }
diff --git a/sw/source/filter/html/htmlctxt.cxx 
b/sw/source/filter/html/htmlctxt.cxx
index ac8b70f61ad7..85d1ec4a7d45 100644
--- a/sw/source/filter/html/htmlctxt.cxx
+++ b/sw/source/filter/html/htmlctxt.cxx
@@ -564,10 +564,11 @@ void SwHTMLParser::InsertAttrs( SfxItemSet &rItemSet,
 // We only set the DropCap attribute if the initial spans multiple 
lines
 if( aDrop.GetLines() > 1 )
 {
-NewAttr(m_xAttrTab, &m_xAttrTab->pDropCap, aDrop);
-
-HTMLAttrs &rAttrs = pContext->GetAttrs();
-rAttrs.push_back( m_xAttrTab->pDropCap );
+if (NewAttr(m_xAttrTab, &m_xAttrTab->pDropCap, aDrop))
+{
+HTMLAttrs &rAttrs = pContext->GetAttrs();
+rAttrs.push_back( m_xAttrTab->pDropCap );
+}
 
 return;
 }
@@ -661,16 +662,16 @@ void SwHTMLParser::InsertAttrs( SfxItemSet &rItemSet,
 // Set the attribute on the current paragraph
 SvxFirstLineIndentItem 
firstLine(SvxIndentValue::twips(nIndent),
  RES_MARGIN_FIRSTLINE);
-NewAttr(m_xAttrTab, &m_xAttrTab->pFirstLineIndent, firstLine);
-EndAttr(m_xAttrTab->pFirstLineIndent, false);
+if (NewAttr(m_xAttrTab, &m_xAttrTab->pFirstLineIndent, 
firstLine))
+EndAttr(m_xAttrTab->pFirstLineIndent, false);
 SvxTextLeftMarginItem const 
leftMargin(SvxIndentValue::twips(nLeft),
RES_MARGIN_TEXTLEFT);
-NewAttr(m_xAttrTab, &m_xAttrTab->pTextLeftMargin, leftMargin);
-EndAttr(m_xAttrTab->pTextLeftMargin, false);
+if (NewAttr(m_xAttrTab, &m_xAttrTab->pTextLeftMargin, 
leftMargin))
+EndAttr(m_xAttrTab->pTextLeftMargin, false);
 SvxRightMarginItem const 
rightMargin(SvxIndentValue::twips(nRight),
  RES_MARGIN_RIGHT);
-NewAttr(m_xAttrTab, &m_xAttrTab->pRightMargin, rightMargin);
-EndAttr(m_xAttrTab->pRightMargin, false);
+if (NewAttr(m_xAttrTab, &m_xAttrTab->pRightMargin, 
rightMargin))
+EndAttr(m_xAttrTab->pRightMargin, false);
 }
 #endif
 
@@ -693,11 +694,12 @@ void SwHTMLParser::InsertAttrs( SfxItemSet &rItemSet,
 if( !rPropInfo.m_bBottomMargin )
 aULSpace.SetLower( nLower );
 
-NewAttr(m_xAttrTab, &m_xAttrTab->pULSpace, aULSpace);
-
-// save context information
-HTMLAttrs &rAttrs = pContext->GetAttrs();
-rAttrs.push_back( m_xAttrTab->pULSpace );
+if (NewAttr(m_xAttrTab, &m_xAttrTab->pULSpace, aULSpace))
+{
+// save context information
+HTMLAttrs &rAttrs = pContext->GetAttrs();
+r

core.git: sw/source

2026-03-24 Thread Aron Budea (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |   15 ---
 sw/source/filter/ww8/docxattributeoutput.hxx |2 +-
 sw/source/filter/ww8/wrtw8sty.cxx|2 +-
 3 files changed, 6 insertions(+), 13 deletions(-)

New commits:
commit 5cb71a2ffd7044f472cbf9f761ec44601bb62f13
Author: Aron Budea 
AuthorDate: Mon Mar 23 23:21:24 2026 +1030
Commit: Aron Budea 
CommitDate: Tue Mar 24 18:28:17 2026 +0100

sw: Write only val attribute for charset

Office only writes characterSet attribute for charset
to word/fontTable.xml if file is strict OOXML,
which LO doesn't support anyway.

Commit ae8530c5b717206c1092af9d1a11bc226acd4aef added
conditional export of characterSet depending on OOXML
version, sometimes exporting both characterSet and val.

OOXML validator complains about this:
{"Description":"The attribute
'http://schemas.openxmlformats.org/wordprocessingml/2006/main:characterSet'
has invalid value 'windows-1252'. The Enumeration constraint
failed.","Path":{"Namespaces":{},"XPath":
"/w:fonts[1]/w:font[1]/w:charset[1]",
"PartUri":"/word/fontTable.xml"},
"Id":"Sch_AttributeValueDataTypeDetailed","ErrorType":"Schema"}

This reverts commit ae8530c5b717206c1092af9d1a11bc226acd4aef.

Change-Id: Ic1fdb46724a2a8713286d02b65d6a052e207e8c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202471
Reviewed-by: Aron Budea 
Tested-by: Jenkins

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 532c4f524164..ac98faf14201 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7760,22 +7760,15 @@ void DocxAttributeOutput::FontAlternateName( const 
OUString& rName ) const
 m_pSerializer->singleElementNS(XML_w, XML_altName, FSNS(XML_w, XML_val), 
rName);
 }
 
-void DocxAttributeOutput::FontCharset( sal_uInt8 nCharSet, rtl_TextEncoding 
nEncoding ) const
+void DocxAttributeOutput::FontCharset( sal_uInt8 nCharSet ) const
 {
-rtl::Reference pAttr = 
FastSerializerHelper::createAttrList();
-
 OString aCharSet( OString::number( nCharSet, 16 ) );
 if ( aCharSet.getLength() == 1 )
 aCharSet = "0" + aCharSet;
-pAttr->add(FSNS(XML_w, XML_val), aCharSet);
-
-if (GetExport().GetFilter().getVersion() != 
oox::core::ECMA_376_1ST_EDITION)
-{
-if( const char* charset = rtl_getMimeCharsetFromTextEncoding( 
nEncoding ))
-pAttr->add( FSNS( XML_w, XML_characterSet ), charset );
-}
 
-m_pSerializer->singleElementNS( XML_w, XML_charset, pAttr );
+// An old change also added w:characterSet to the export conditionally, 
but it's only for
+// strict OOXML that LO doesn't support and the condition couldn't cover, 
so it's removed now
+m_pSerializer->singleElementNS( XML_w, XML_charset, FSNS(XML_w, XML_val), 
aCharSet );
 }
 
 void DocxAttributeOutput::FontFamilyType( FontFamily eFamily ) const
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx 
b/sw/source/filter/ww8/docxattributeoutput.hxx
index fe72836b49bc..92fdc89c1f45 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -409,7 +409,7 @@ public:
 void FontAlternateName( const OUString& rName ) const;
 
 /// Font charset.
-void FontCharset( sal_uInt8 nCharSet, rtl_TextEncoding nEncoding ) const;
+void FontCharset( sal_uInt8 nCharSet ) const;
 
 /// Font family.
 void FontFamilyType( FontFamily eFamily ) const;
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index 01040c2adeb7..c985b555ef8a 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -875,7 +875,7 @@ void wwFont::WriteDocx( DocxAttributeOutput* rAttrOutput ) 
const
 
 if ( mbAlt )
 rAttrOutput->FontAlternateName( msAltNm );
-rAttrOutput->FontCharset( sw::ms::rtl_TextEncodingToWinCharset( meChrSet 
), meChrSet );
+rAttrOutput->FontCharset( sw::ms::rtl_TextEncodingToWinCharset( meChrSet ) 
);
 rAttrOutput->FontFamilyType( meFamily );
 rAttrOutput->FontPitchType( mePitch );
 rAttrOutput->EmbedFont( msFamilyNm, meFamily, mePitch );


core.git: sw/source

2026-03-24 Thread Ujjawal Kumar (via logerrit)
 sw/source/uibase/dochdl/swdtflvr.cxx |   57 ++-
 1 file changed, 24 insertions(+), 33 deletions(-)

New commits:
commit c75975d1ac46f27bf104fb591e892b397deaa5ca
Author: Ujjawal Kumar 
AuthorDate: Sat Mar 21 16:43:40 2026 +0530
Commit: Mike Kaganski 
CommitDate: Tue Mar 24 09:43:39 2026 +0100

Change paste special behaviour for markdown

To mimic plain text paste behaviour for markdown as it is just
plain text with some additional formatting elements.

Changed the type of DataFlavor from 
cppu::UnoType>::get() to
cppu::UnoType::get() and the corresponding handling in 
sw/source/uibase/dochdl/swdtflvr.cxx
which allows us to use the same conditions for markdown as text/plaintext 
with utf16 encoding as
the mimetype for markdown is not detected on most of the system.

1. https://gerrit.libreoffice.org/c/core/+/187792: Initial commit which 
added markdown
   into the clipboard registry with DataFlavor type as 
cppu::UnoType>::get()

2. https://gerrit.libreoffice.org/c/core/+/188067: This patch introduced a 
new dialog
   which added the feature to select between plain text and markdown when 
using paste special -> unformatted text.

After the previous patch the design team suggested to remove the dialog.

3. https://gerrit.libreoffice.org/c/core/+/191225: Removed the dialog and 
added heuristic
   detection of markdown when pasting as plain text.

Backtracking to point 2: Mike Kaganski suggested to add markdown under 
paste special explicitly
removing the need of heuristic detection.

This is a followup patch for the previous suggestion.

cherry pick note
master and distro/collabora/co-25.04, distro/collabora/co-26.04
branches diverged while cherry-picking 
I423bfa356c337e7a6365beda0dcf1fff233f3edd
on 25.04 branch due to code review suggestions which introduced
an additional patch I44ffb00e240425701c4677bb58667141658845a5(this change)
being merged on distro/collabora branches.

This patch is to sync the changes between master and disto/collabora
branches.

Change-Id: I44ffb00e240425701c4677bb58667141658845a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199975
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201493
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202306
Tested-by: Jenkins

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index e3dbd4f1b468..f35c5e35bfa7 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -2211,50 +2211,42 @@ bool SwTransferable::PasteFileContent( const 
TransferableDataHelper& rData,
 Reader* pRead = nullptr;
 OUString sData;
 bool bSkipInvalidateNumRules = false;
-switch( nFormat )
+bool bCheckStream = true;
+
+if (nFormat == SotClipboardFormatId::STRING || nFormat == 
SotClipboardFormatId::MARKDOWN)
 {
-case SotClipboardFormatId::STRING:
+if( rData.GetString( nFormat, sData ) )
 {
-pRead = ReadAscii;
-
-const SwPosition& rInsertPosition = *rSh.GetCursor()->Start();
-if (CanSkipInvalidateNumRules(rInsertPosition))
-{
-// Insertion point is not a numbering and we paste plain text: 
then no need to
-// invalidate all numberings.
-bSkipInvalidateNumRules = true;
-}
+bCheckStream = false;
+pStream = new SvMemoryStream( const_cast(sData.getStr()),
+sData.getLength() * sizeof( sal_Unicode ),
+StreamMode::READ );
+pStream->ResetEndianSwap();
 
-if( rData.GetString( nFormat, sData ) )
+if (nFormat == SotClipboardFormatId::STRING)
 {
-pStream = new SvMemoryStream( const_cast(sData.getStr()),
-  sData.getLength() * sizeof( 
sal_Unicode ),
-  StreamMode::READ );
-pStream->ResetEndianSwap();
+const SwPosition& rInsertPosition = *rSh.GetCursor()->Start();
+if (CanSkipInvalidateNumRules(rInsertPosition))
+{
+// Insertion point is not a numbering and we paste plain 
text: then no need to
+// invalidate all numberings.
+bSkipInvalidateNumRules = true;
+}
 
+pRead = ReadAscii;
 SwAsciiOptions aAOpt;
 aAOpt.SetCharSet( RTL_TEXTENCODING_UCS2 );
 pRead->GetReaderOpt().SetASCIIOpts( aAOpt );
-break;
 }
-}
-[[fallthrough]]; // because then test if we get a stream
-
-case SotClipboardFormatId::MARKDOWN

core.git: sw/source

2026-03-24 Thread Noel Grandin (via logerrit)
 sw/source/uibase/inc/pview.hxx|2 +-
 sw/source/uibase/uiview/pview.cxx |   22 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 8dd5c09b19a692d1924124afb75b5d5cf2461547
Author: Noel Grandin 
AuthorDate: Mon Mar 23 11:43:49 2026 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 24 09:27:38 2026 +0100

Fraction->double in SwPagePreviewWin

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

diff --git a/sw/source/uibase/inc/pview.hxx b/sw/source/uibase/inc/pview.hxx
index 78b281690c7c..036b24f1183f 100644
--- a/sw/source/uibase/inc/pview.hxx
+++ b/sw/source/uibase/inc/pview.hxx
@@ -45,7 +45,7 @@ class SAL_DLLPUBLIC_RTTI SwPagePreviewWin final : public 
vcl::Window
 sal_Int16 mnRow;
 sal_Int16 mnCol;
 Size maPxWinSize;
-Fraction maScale;
+double mfScale;
 SwPagePreview& mrView;
 bool mbCalcScaleForPreviewLayout;
 tools::Rectangle maPaintedPreviewDocRect;
diff --git a/sw/source/uibase/uiview/pview.cxx 
b/sw/source/uibase/uiview/pview.cxx
index e087fe635018..29c259a8b7d5 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -208,8 +208,8 @@ void  SwPagePreviewWin::Paint(vcl::RenderContext& 
rRenderContext, const tools::R
 else
 {
 MapMode aMM(rRenderContext.GetMapMode());
-aMM.SetScaleX(maScale);
-aMM.SetScaleY(maScale);
+aMM.SetScaleX(Fraction(mfScale));
+aMM.SetScaleY(Fraction(mfScale));
 rRenderContext.SetMapMode(aMM);
 mpPgPreviewLayout->GetParentViewShell().setOutputToWindow(true);
 mpPgPreviewLayout->Paint(rRenderContext, rRect);
@@ -236,7 +236,7 @@ void SwPagePreviewWin::CalcWish( sal_Int16 nNewRow, 
sal_Int16 nNewCol )
   mnSttPage, maPaintedPreviewDocRect );
 SetSelectedPage( mnSttPage );
 SetPagePreview(mnRow, mnCol);
-maScale = GetMapMode().GetScaleX();
+mfScale = double(GetMapMode().GetScaleX());
 
 // If changes have taken place at the columns, the special case "single 
column"
 // must be considered and corrected if necessary.
@@ -379,7 +379,7 @@ void SwPagePreviewWin::SetWinSize( const Size& rNewSize )
 if ( mbCalcScaleForPreviewLayout )
 {
 mpPgPreviewLayout->Init( mnCol, mnRow, maPxWinSize );
-maScale = GetMapMode().GetScaleX();
+mfScale = double(GetMapMode().GetScaleX());
 }
 mpPgPreviewLayout->Prepare( mnSttPage, Point(0,0), maPxWinSize,
   mnSttPage, maPaintedPreviewDocRect );
@@ -389,7 +389,7 @@ void SwPagePreviewWin::SetWinSize( const Size& rNewSize )
 mbCalcScaleForPreviewLayout = false;
 }
 SetPagePreview(mnRow, mnCol);
-maScale = GetMapMode().GetScaleX();
+mfScale = double(GetMapMode().GetScaleX());
 }
 
 OUString SwPagePreviewWin::GetStatusStr( sal_uInt16 nPageCnt ) const
@@ -1751,26 +1751,26 @@ void SwPagePreviewWin::AdjustPreviewToNewZoom( const 
sal_uInt16 _nZoomFactor,
   mnSttPage, maPaintedPreviewDocRect );
 SetSelectedPage( mnSttPage );
 SetPagePreview(mnRow, mnCol);
-maScale = GetMapMode().GetScaleX();
+mfScale = double(GetMapMode().GetScaleX());
 }
 else if ( _nZoomFactor != 0 )
 {
 // calculate new scaling and set mapping mode appropriately.
-Fraction aNewScale( _nZoomFactor, 100 );
+double fNewScale = double(_nZoomFactor) / 100;
 MapMode aNewMapMode = GetMapMode();
-aNewMapMode.SetScaleX( aNewScale );
-aNewMapMode.SetScaleY( aNewScale );
+aNewMapMode.SetScaleX( Fraction(fNewScale) );
+aNewMapMode.SetScaleY( Fraction(fNewScale) );
 SetMapMode( aNewMapMode );
 
 // calculate new start position for preview paint
 Size aNewWinSize = PixelToLogic( maPxWinSize );
 Point aNewPaintStartPos =
-mpPgPreviewLayout->GetPreviewStartPosForNewScale( 
double(aNewScale), double(maScale), aNewWinSize );
+mpPgPreviewLayout->GetPreviewStartPosForNewScale( fNewScale, 
mfScale, aNewWinSize );
 
 // remember new scaling and prepare preview paint
 // Note: paint of preview will be performed by a corresponding 
invalidate
 //  due to property changes.
-maScale = aNewScale;
+mfScale = fNewScale;
 mpPgPreviewLayout->Prepare( 0, aNewPaintStartPos, maPxWinSize,
   mnSttPage, maPaintedPreviewDocRect );
 }


core.git: sw/source

2026-03-22 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/uiview/view2.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 7e0ffb4b0b3c4d9ab757fd5b9ec6f648914cb30e
Author: Jim Raykowski 
AuthorDate: Sat Mar 14 21:43:33 2026 -0800
Commit: Jim Raykowski 
CommitDate: Sun Mar 22 08:14:06 2026 +0100

related tdf#171259: Go to Page dialog: Align top of page with viewport

Currently the result of the Writer "Go to Page" dialog splits the
viewport between pages. This patch makes the result match the behavior
of the Navigator "by Page". It aligns the viewport to the top of the
target page.

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

diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index ca152172329b..7fa649697f97 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1321,7 +1321,15 @@ void SwView::Execute(SfxRequest &rReq)
 SwResId(ST_PGE) + ":", nPhyPage, GetWrtShell().GetPageCnt());
 weld::DialogController::runAsync(xDialog,[this, xDialog, 
xRequest=std::move(xRequest)](sal_uInt32 nResult) {
 if (nResult == RET_OK)
+{
+const bool bWasLocked = m_pWrtShell->IsViewLocked();
+m_pWrtShell->LockView(true);
 GetWrtShell().GotoPage(xDialog->GetPageSelection(), true);
+const Point aPt(m_pWrtShell->GetView().GetVisArea().Left(),
+
m_pWrtShell->GetPagePos(xDialog->GetPageSelection()).Y());
+m_pWrtShell->GetView().SetVisArea(aPt);
+m_pWrtShell->LockView(bWasLocked);
+}
 
 xRequest->Done();
 });


core.git: sw/source

2026-03-20 Thread Oliver Specht (via logerrit)
 sw/source/core/doc/DocumentStatisticsManager.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 4c957e514cb591fb876a6dc46d404aeea7d8fb9a
Author: Oliver Specht 
AuthorDate: Wed Mar 18 16:22:58 2026 +0100
Commit: Oliver Specht 
CommitDate: Fri Mar 20 13:39:13 2026 +0100

tdf#171046: fix update of document statistics

Document statistics should be considered as initialized only
if the call to IncrementalDocStatCalculate() came to an end.

Change-Id: I3d83e99fb8b1cfa6c63ca0ee120275fe80c00e47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202041
Reviewed-by: Oliver Specht 
Tested-by: Jenkins

diff --git a/sw/source/core/doc/DocumentStatisticsManager.cxx 
b/sw/source/core/doc/DocumentStatisticsManager.cxx
index d99ea52bcf6c..07ce961292e1 100644
--- a/sw/source/core/doc/DocumentStatisticsManager.cxx
+++ b/sw/source/core/doc/DocumentStatisticsManager.cxx
@@ -103,7 +103,6 @@ void DocumentStatisticsManager::UpdateDocStat( bool 
bCompleteAsync, bool bFields
 // returns true while there is more to do
 bool DocumentStatisticsManager::IncrementalDocStatCalculate(tools::Long 
nChars, bool bFields)
 {
-mbInitialized = true;
 mpDocStat->Reset();
 mpDocStat->nPara = 0; // default is 1!
 
@@ -196,7 +195,7 @@ bool 
DocumentStatisticsManager::IncrementalDocStatCalculate(tools::Long nChars,
 SwFieldType *pType = 
m_rDoc.getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::DocStat);
 pType->UpdateFields();
 }
-
+mbInitialized = nChars > 0;
 return nChars < 0;
 }
 


core.git: sw/source

2026-03-19 Thread Nguyen Minh Tien (via logerrit)
 sw/source/core/txtnode/thints.cxx |   32 
 1 file changed, 16 insertions(+), 16 deletions(-)

New commits:
commit 60b267464c7caff85103c68d4e3ade74427cdbc2
Author: Nguyen Minh Tien 
AuthorDate: Tue Mar 17 22:57:24 2026 +0700
Commit: Ilmari Lauhakangas 
CommitDate: Thu Mar 19 15:23:39 2026 +0100

tdf#168771 Convert enum MergeResult to enum class in thints.cxx

Convert plain enum MergeResult to scoped enum class in
sw/source/core/txtnode/thints.cxx for better type safety
and namespace cleanliness. Rename values to follow
CamelCase convention: MATCH -> Match, DIFFER_ONLY_RSID ->
DifferOnlyRsid, DIFFER -> Differ.

Change-Id: If12bfe09e109571cad4afa63bc6cf552b272bf09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201936
Tested-by: Jenkins
Reviewed-by: Tien Nguyen Minh 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 7742b518bacf..42013a73b65c 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -2728,7 +2728,7 @@ struct Portion {
 bool isRsidOnlyAutoFormat;
 };
 typedef std::vector< Portion > PortionMap;
-enum MergeResult { MATCH, DIFFER_ONLY_RSID, DIFFER };
+enum class MergeResult { Match, DifferOnlyRsid, Differ };
 }
 
 static MergeResult lcl_Compare_Attributes(
@@ -2835,7 +2835,7 @@ bool SwpHints::MergePortions( SwTextNode& rNode )
 
 MergeResult eMerge = lcl_Compare_Attributes(i, j, aRange1, aRange2, 
RsidOnlyAutoFormatFlagMap);
 
-if (MATCH == eMerge)
+if (MergeResult::Match == eMerge)
 {
 // important: delete second range so any IgnoreStart on the first
 // range is still valid
@@ -2876,7 +2876,7 @@ bool SwpHints::MergePortions( SwTextNode& rNode )
 {
 // when not merging the ignore flags need to be either set or reset
 // (reset too in case one of the autofmts was recently changed)
-bool const bSetIgnoreFlag(DIFFER_ONLY_RSID == eMerge);
+bool const bSetIgnoreFlag(MergeResult::DifferOnlyRsid == eMerge);
 for (auto aIter1 = aRange1.first; aIter1 != aRange1.second; 
++aIter1)
 {
 if (!aIter1->isRsidOnlyAutoFormat) // already set above, don't 
change
@@ -2903,7 +2903,7 @@ bool SwpHints::MergePortions( SwTextNode& rNode )
 }
 }
 }
-i = j; // ++i not enough: i + 1 may have been deleted (MATCH)!
+i = j; // ++i not enough: i + 1 may have been deleted (Match)!
 ++j;
 }
 }
@@ -2936,10 +2936,10 @@ static MergeResult lcl_Compare_Attributes(
  (nAttributesInPor2 - (isRsidOnlyAutoFormat2 ? 1 : 0))
  && (nAttributesInPor1 != 0 || nAttributesInPor2 != 0)))
 {
-return DIFFER;
+return MergeResult::Differ;
 }
 
-MergeResult eMerge(MATCH);
+MergeResult eMerge(MergeResult::Match);
 
 // _if_ there is one element more either in aRange1 or aRange2
 // it _must_ be an RSID-only AUTOFMT, which can be ignored here...
@@ -2950,22 +2950,22 @@ static MergeResult lcl_Compare_Attributes(
 if (aIter1 != aRange1.second && aIter2 != aRange2.second &&
 *aIter1->pTextAttr->End() < aIter2->pTextAttr->GetStart())
 {
-return DIFFER;
+return MergeResult::Differ;
 }
 // skip it - cannot be equal if bSkipRsidOnlyAutoFormat is set
 if (bSkipRsidOnlyAutoFormat
 && aIter1 != aRange1.second && aIter1->isRsidOnlyAutoFormat)
 {
-assert(DIFFER != eMerge);
-eMerge = DIFFER_ONLY_RSID;
+assert(MergeResult::Differ != eMerge);
+eMerge = MergeResult::DifferOnlyRsid;
 ++aIter1;
 continue;
 }
 if (bSkipRsidOnlyAutoFormat
 && aIter2 != aRange2.second && aIter2->isRsidOnlyAutoFormat)
 {
-assert(DIFFER != eMerge);
-eMerge = DIFFER_ONLY_RSID;
+assert(MergeResult::Differ != eMerge);
+eMerge = MergeResult::DifferOnlyRsid;
 ++aIter2;
 continue;
 }
@@ -2974,14 +2974,14 @@ static MergeResult lcl_Compare_Attributes(
 SwTextAttr const*const p2 = aIter2->pTextAttr;
 if (p1->Which() != p2->Which())
 {
-return DIFFER;
+return MergeResult::Differ;
 }
 if (!(*p1 == *p2))
 {
 // fdo#52028: for auto styles, check if they differ only
 // in the RSID, which should have no effect on text layout
 if (RES_TXTATR_AUTOFMT != p1->Which())
-return DIFFER;
+return MergeResult::Differ;
 
 const SfxItemSet& rSet1 = *p1->GetAutoFormat().GetStyleHandle();
 const SfxItemSet& rSet2 = *p2->GetAutoFormat().GetStyleHandle();
@@ -3000,7 +3000,7 @@ s

core.git: sw/source

2026-03-19 Thread Andrea Gelmini (via logerrit)
 sw/source/core/text/inftxt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d2f81981fc10ce45edc7bba1870c65419e0a3c3e
Author: Andrea Gelmini 
AuthorDate: Fri Mar 13 15:41:24 2026 +0100
Commit: Julien Nabet 
CommitDate: Thu Mar 19 09:51:21 2026 +0100

Fix typo

Change-Id: Ide9a3fe115321df1fc0f7fce4a6217ac16e41a77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201648
Reviewed-by: Julien Nabet 
Reviewed-by: Simon Chenery 
Tested-by: Julien Nabet 

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 4b112a34f8e9..2042d6d3f4d7 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -815,7 +815,7 @@ void SwTextPaintInfo::DrawText_( const OUString &rText, 
const SwLinePortion &rPo
 
 const SwAttrSet& rAttrSet = 
GetTextFrame()->GetTextNodeForParaProps()->GetSwAttrSet();
 const SvxAdjustItem* pAdjust = rAttrSet.GetItem(RES_PARATR_ADJUST);
-// microtypograpy: line-level automatic scaling between the custom 
range
+// microtypography: line-level automatic scaling between the 
custom range
 if ( pAdjust->GetPropScaleWidthMinimum() != 100 ||
 pAdjust->GetPropScaleWidthMaximum() != 100 )
 {


core.git: sw/source

2026-03-19 Thread Caolán McNamara (via logerrit)
 sw/source/core/layout/paintfrm.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit b6cff68e34d1adec21965e02d9e43c8bc7f3123a
Author: Caolán McNamara 
AuthorDate: Mon Mar 2 17:24:48 2026 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 19 09:22:29 2026 +0100

Resolves: tdf#140349 writer gradient fills not staying inside their area

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

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index baebde837ba6..fa389187f344 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1772,6 +1772,18 @@ bool DrawFillAttributes(
 }
 assert(pPrimitives && pPrimitives->size());
 
+// tdf#140349 For gradient fills, clip to the non-expanded
+// 'aPaintRange' paint region. The expansion above ensures the
+// rendered gradient fully covers the area but can produce a
+// visible spillover fringe in the expanded margins.
+const bool bClipGradient(rFillAttributes->hasSdrFillAttribute()
+&& 
!rFillAttributes->getFillAttribute().getGradient().isDefault());
+if (bClipGradient)
+{
+rOut.Push(vcl::PushFlags::CLIPREGION);
+
rOut.IntersectClipRegion(rPaintRegion.GetOrigin().SVRect());
+}
+
 drawinglayer::geometry::ViewInformation2D aViewInformation2D;
 
aViewInformation2D.setViewTransformation(rOut.GetViewTransformation());
 aViewInformation2D.setViewport(aPaintRange);
@@ -1780,6 +1792,10 @@ bool DrawFillAttributes(
 rOut,
 aViewInformation2D) );
 pProcessor->process(*pPrimitives);
+
+if (bClipGradient)
+rOut.Pop();
+
 return true;
 }
 }


core.git: sw/source

2026-03-18 Thread László Németh (via logerrit)
 sw/source/core/inc/drawfont.hxx   |2 +-
 sw/source/core/text/inftxt.cxx|3 ---
 sw/source/core/txtnode/swfont.cxx |2 +-
 3 files changed, 2 insertions(+), 5 deletions(-)

New commits:
commit f25371fa95b2c46ff4a73ef6995c341c157e62d4
Author: László Németh 
AuthorDate: Wed Mar 18 00:03:30 2026 +0100
Commit: László Németh 
CommitDate: Thu Mar 19 04:04:32 2026 +0100

tdf#169491 tdf#168251 sw glyph scaling: fix all scale width regressions

Do not disable scale width character setting, if it is applied in a text
span (except when the paragraph uses automatic glyph scaling, yet).

Regression since commit 45ec7bd76196dcc60b4c2db2f6f00623ecbaf5a4
"tdf#168251 cui offapi xmloff sw glyph scaling: extend UNO/UX/ODF".

Follow-up to commit 7ed8a8ee39951f74e364091fafff20269359ba15
"tdf#171161 tdf#168251 sw glyph scaling: fix scale width regression".

Change-Id: Ic42e58d1b96d9697eb0ddd0d7b999171fc0f39eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201946
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx
index 1a15be30f316..4962de107ee9 100644
--- a/sw/source/core/inc/drawfont.hxx
+++ b/sw/source/core/inc/drawfont.hxx
@@ -75,7 +75,7 @@ class SW_DLLPUBLIC SwDrawTextInfo
 tools::Long m_nSpace = 0;
 tools::Long m_nKern = 0;
 tools::Long m_nLetterSpacing = 0;
-sal_Int16 m_nScaleWidth = 100;
+sal_Int16 m_nScaleWidth = -1;
 TextFrameIndex m_nNumberOfBlanks = TextFrameIndex{ 0 };
 sal_uInt8 m_nCursorBidiLevel = 0;
 bool m_bBullet : 1;
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 60a5652748f1..4b112a34f8e9 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -822,9 +822,6 @@ void SwTextPaintInfo::DrawText_( const OUString &rText, 
const SwLinePortion &rPo
 // Note: set 100 percent, too (to reset the automatic scaling 
of the previous line)
 aDrawInf.SetScaleWidth( GetScaleWidth() );
 }
-else
-   // tdf#171161 otherwise use the user-defined scale width value
-   aDrawInf.SetScaleWidth( rAttrSet.GetCharScaleW().GetValue()  );
 
 m_pFnt->DrawText_( aDrawInf );
 }
diff --git a/sw/source/core/txtnode/swfont.cxx 
b/sw/source/core/txtnode/swfont.cxx
index e7cc710827af..92b37538f5f8 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -1149,7 +1149,7 @@ void SwSubFont::DrawText_( SwDrawTextInfo &rInf, const 
bool bGrey )
 ChgFnt( rInf.GetShell(), rInf.GetOut() );
 
 // change glyph scaling, if needed
-if ( GetPropWidth() != rInf.GetScaleWidth() )
+if ( rInf.GetScaleWidth() > 0 && GetPropWidth() != rInf.GetScaleWidth() )
 {
 SetPropWidth( rInf.GetScaleWidth() );
 ChgFnt( rInf.GetShell(), rInf.GetOut() );


core.git: sw/source

2026-03-16 Thread Darshan Upadhyay (via logerrit)
 sw/source/core/edit/autofmt.cxx |   19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

New commits:
commit 6f14a11a7ccc78e0fcb8c84de04fd06f20dae11f
Author: Darshan Upadhyay 
AuthorDate: Wed Mar 4 12:35:35 2026 +0530
Commit: Szymon Kłos 
CommitDate: Tue Mar 17 04:46:29 2026 +0100

sw: block multi-level auto-numbering to avoid false positives

This fix prevents multi-level patterns like "1.2.3" from being caught
by the auto-format numbering logic. This avoids unwanted conversions
when users type version numbers or other decimal-heavy sequences.

Only single-level numbering (e.g., "1.") is now allowed to trigger
the auto-format numbered list.

Signed-off-by: Darshan-upadhyay1110 
Change-Id: Ica7ec7ac166d32a08a6f36cb5e8d8f21ba8b6d03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201353
(cherry picked from commit ef359613d63031dd38c1a76a9fb5cabdde07322c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201803
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins

diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 37adf8c74d62..e295dbe64d15 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1612,14 +1612,19 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, 
sal_uInt16 nDigitLevel )
 &aPrefix, &aPostfix, &aNumTypes);
 if (USHRT_MAX != nDigitLevel)
 {
-bChgEnum = true;
-
-// Level 0 and Indentation, determine level by left indentation 
and default NumIndent
-if( !nDigitLevel && nLeftTextPos )
-nLvl = std::min( sal_uInt16( nLeftTextPos / lNumberIndent ),
-sal_uInt16( MAXLEVEL - 1 ) );
+if (nDigitLevel > 0)
+{
+bChgEnum = false;
+}
 else
-nLvl = nDigitLevel;
+{
+bChgEnum = true;
+
+// Level 0 and Indentation, determine level by left 
indentation and default NumIndent
+if( nLeftTextPos )
+nLvl = std::min( sal_uInt16( nLeftTextPos / lNumberIndent 
),
+sal_uInt16( MAXLEVEL - 1 ) );
+}
 }
 
 if( bChgEnum && m_aFlags.bSetNumRule )


core.git: sw/source

2026-03-16 Thread Ethan Garcia (via logerrit)
 sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 991b49bdb027b381c767fc3532c420a882eb2661
Author: Ethan Garcia 
AuthorDate: Sun Mar 15 18:52:32 2026 -0700
Commit: Ilmari Lauhakangas 
CommitDate: Mon Mar 16 18:58:49 2026 +0100

tdf#145538 Use range based for loops in DomainMapper_Impl.cxx

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

diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
index e12251e86e15..642a83d63b9c 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
@@ -3982,16 +3982,16 @@ void 
DomainMapper_Impl::fillEmptyFrameProperties(std::vector aBorderIds
 = { PROP_BOTTOM_BORDER, PROP_LEFT_BORDER, PROP_RIGHT_BORDER, 
PROP_TOP_BORDER };
-for (size_t i = 0; i < aBorderIds.size(); ++i)
-
rFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(aBorderIds[i]),
 aEmptyBorder));
+for (const auto& rBorderId : aBorderIds)
+
rFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(rBorderId),
 aEmptyBorder));
 
 static const std::vector aMarginIds
 = { PROP_BOTTOM_MARGIN, PROP_BOTTOM_BORDER_DISTANCE,
 PROP_LEFT_MARGIN,   PROP_LEFT_BORDER_DISTANCE,
 PROP_RIGHT_MARGIN,  PROP_RIGHT_BORDER_DISTANCE,
 PROP_TOP_MARGIN,PROP_TOP_BORDER_DISTANCE };
-for (size_t i = 0; i < aMarginIds.size(); ++i)
-
rFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(aMarginIds[i]),
 static_cast(0)));
+for (const auto& rMarginId : aMarginIds)
+
rFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(rMarginId),
 static_cast(0)));
 }
 
 bool DomainMapper_Impl::IsInTOC() const


core.git: sw/source

2026-03-16 Thread Mo Amr (via logerrit)
 sw/source/uibase/uiview/viewport.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 80b8209060d5b468f2c2d0901ad2e2223866055b
Author: Mo Amr 
AuthorDate: Sun Mar 15 09:55:53 2026 +
Commit: Ilmari Lauhakangas 
CommitDate: Mon Mar 16 11:35:15 2026 +0100

tdf#164962 sw: fix m_pWrtShell check in H scrollbar

make code changes to check if m_pWrtShell is not null

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

diff --git a/sw/source/uibase/uiview/viewport.cxx 
b/sw/source/uibase/uiview/viewport.cxx
index ae242b38b376..37cc7b48ae93 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -1189,10 +1189,10 @@ bool SwView::UpdateScrollbars()
 if ( bVScrollVisible != m_pVScrollbar->IsScrollbarVisible(true) )
 bRet = true;
 }
-if (m_pHScrollbar && m_pWrtShell)
+if (m_pHScrollbar)
 {
 const bool bHScrollVisible = 
m_pHScrollbar->IsScrollbarVisible(true);
-if( m_pWrtShell->GetViewOptions()->GetZoomType() == 
SvxZoomType::PAGEWIDTH)
+if(m_pWrtShell && m_pWrtShell->GetViewOptions()->GetZoomType() == 
SvxZoomType::PAGEWIDTH)
 {
 ShowHScrollbar(false);
 if (bHScrollVisible)


core.git: sw/source

2026-03-15 Thread Mo Amr (via logerrit)
 sw/source/uibase/uiview/viewport.cxx |   19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

New commits:
commit 99e000e7ea1294ff04d9460e072ba6aed11f050f
Author: Mo Amr 
AuthorDate: Sat Mar 7 20:27:46 2026 +
Commit: Ilmari Lauhakangas 
CommitDate: Sun Mar 15 09:09:13 2026 +0100

tdf#164962 sw: Prevent horizontal scrollbar showing up in the

Page Width mode

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

diff --git a/sw/source/uibase/uiview/viewport.cxx 
b/sw/source/uibase/uiview/viewport.cxx
index 3e9f90d182f5..ae242b38b376 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -1189,13 +1189,22 @@ bool SwView::UpdateScrollbars()
 if ( bVScrollVisible != m_pVScrollbar->IsScrollbarVisible(true) )
 bRet = true;
 }
-if (m_pHScrollbar)
+if (m_pHScrollbar && m_pWrtShell)
 {
 const bool bHScrollVisible = 
m_pHScrollbar->IsScrollbarVisible(true);
-m_pHScrollbar->DocSzChgd( aTmpSz );
-m_pHScrollbar->ViewPortChgd( aTmpRect );
-if ( bHScrollVisible != m_pHScrollbar->IsScrollbarVisible(true) )
-bRet = true;
+if( m_pWrtShell->GetViewOptions()->GetZoomType() == 
SvxZoomType::PAGEWIDTH)
+{
+ShowHScrollbar(false);
+if (bHScrollVisible)
+bRet = true;
+}
+else
+{
+m_pHScrollbar->DocSzChgd( aTmpSz );
+m_pHScrollbar->ViewPortChgd( aTmpRect );
+if ( bHScrollVisible != 
m_pHScrollbar->IsScrollbarVisible(true) )
+bRet = true;
+}
 }
 }
 return bRet;


core.git: sw/source

2026-03-13 Thread Saburo Yoshida (via logerrit)
 sw/source/filter/ww8/docxtablestyleexport.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d4574c029e40e2edbc6670b72a582410ac21ae90
Author: Saburo Yoshida 
AuthorDate: Sun Mar 8 14:06:41 2026 +0900
Commit: Xisco Fauli 
CommitDate: Fri Mar 13 11:51:07 2026 +0100

tdf#167506 docxtablestyleexport: add themeShade

Table styles lose their themeShade after roundtrip, so MS Word applies
the themeColor background1 style, which makes the lines invisible.

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

diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx 
b/sw/source/filter/ww8/docxtablestyleexport.cxx
index b1dd48005fdd..0643432d2f8b 100644
--- a/sw/source/filter/ww8/docxtablestyleexport.cxx
+++ b/sw/source/filter/ww8/docxtablestyleexport.cxx
@@ -189,6 +189,7 @@ void DocxTableStyleExport::Impl::tableStyleTcBorder(
   { "space", XML_space 
},
   { "themeColor", 
XML_themeColor },
   { "themeTint", 
XML_themeTint },
+  { "themeShade", 
XML_themeShade },
   { nullptr, 0 } };
 
 if (!rTcBorder.hasElements())


core.git: sw/source

2026-03-12 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/misc/glosdoc.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 251d494c6e7a52e125eb05f3981c778c5c67a6f5
Author: Mike Kaganski 
AuthorDate: Thu Mar 12 13:57:03 2026 +0100
Commit: Mike Kaganski 
CommitDate: Thu Mar 12 18:59:48 2026 +0100

Fix no-pch Windows build

 C:/lo/core/sw/source/uibase/misc/glosdoc.cxx(452): error C3083: 
'FileBase': the symbol to the left of a '::' must be a type
 C:/lo/core/sw/source/uibase/misc/glosdoc.cxx(452): error C2039: 
'getSystemPathFromFileURL': is not a member of 'osl'
 C:\lo C:/lo/core/sw/source/uibase/misc/glosdoc.cxx(452): error C3861: 
'getSystemPathFromFileURL': identifier not found
 C:/lo/core/sw/source/uibase/misc/glosdoc.cxx(452): error C3083: 
'FileBase': the symbol to the left of a '::' must be a type
 C:/lo/core/sw/source/uibase/misc/glosdoc.cxx(452): error C2039: 'E_None': 
is not a member of 'osl'
 C:\lo C:/lo/core/sw/source/uibase/misc/glosdoc.cxx(452): error C2065: 
'E_None': undeclared identifier

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

diff --git a/sw/source/uibase/misc/glosdoc.cxx 
b/sw/source/uibase/misc/glosdoc.cxx
index 57858c67baf9..a0c29d64cc61 100644
--- a/sw/source/uibase/misc/glosdoc.cxx
+++ b/sw/source/uibase/misc/glosdoc.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 


core.git: sw/source

2026-03-11 Thread Mike Kaganski (via logerrit)
 sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 44bc72607eea3df8f49f377fe53f4b001c5bdf40
Author: Mike Kaganski 
AuthorDate: Wed Mar 11 07:55:59 2026 +0100
Commit: Mike Kaganski 
CommitDate: Wed Mar 11 09:35:18 2026 +0100

Simplify a bit

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

diff --git a/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx 
b/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx
index 7312f3498719..667283a1bc05 100644
--- a/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx
+++ b/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -807,7 +808,6 @@ void OOXMLDocument::resolveEmbeddingsStream(const 
OOXMLStream::Pointer_t& pStrea
 }
 }
 
-beans::PropertyValue embeddingsTemp;
 // This will add all .xlsx and .bin to grabbag list.
 if(bFound && mxEmbeddings.is())
 {
@@ -818,9 +818,8 @@ void OOXMLDocument::resolveEmbeddingsStream(const 
OOXMLStream::Pointer_t& pStrea
   { return rValue.Name == 
embeddingsTarget; });
 if (!bAlreadyExists)
 {
-embeddingsTemp.Name = embeddingsTarget;
-embeddingsTemp.Value <<= mxEmbeddings;
-m_aEmbeddings.push_back(embeddingsTemp);
+m_aEmbeddings.push_back(
+comphelper::makePropertyValue(embeddingsTarget, 
mxEmbeddings));
 }
 mxEmbeddings.clear();
 }


core.git: sw/source

2026-03-10 Thread Manish Bera (via logerrit)
 sw/source/ui/index/cnttab.cxx |   14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 87c68c17afc4c7b9d2fd2164f91b0df8bbb20155
Author: Manish Bera 
AuthorDate: Sun Mar 1 14:27:24 2026 +0530
Commit: Michael Weghorn 
CommitDate: Tue Mar 10 09:17:02 2026 +0100

tdf#50050 Make LE component character style match LS

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

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 664d4bb6dc69..6251a5450732 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -3008,10 +3008,10 @@ void SwTokenWindow::InsertAtSelection(const 
SwFormToken& rToken)
 // LS
 // LE
 //
-bool bPreStartLinkFound = false;
 bool bPreEndLinkFound = false;
 
 SwTOXButton* pExchange = nullptr;
+SwTOXButton* pMatchingLinkStart = nullptr; // track unmatched LS 
before cursor
 
 auto it = m_aControlList.cbegin();
 for( ; it != m_aControlList.cend() && m_pActiveCtrl != it->get(); ++it 
)
@@ -3025,13 +3025,13 @@ void SwTokenWindow::InsertAtSelection(const 
SwFormToken& rToken)
 
 if( TOKEN_LINK_START == rNewToken.eTokenType )
 {
-bPreStartLinkFound = true;
+pMatchingLinkStart = pButton;
 pExchange = nullptr;
 }
 else if(TOKEN_LINK_END == rNewToken.eTokenType)
 {
-if( bPreStartLinkFound )
-bPreStartLinkFound = false;
+if (pMatchingLinkStart)
+pMatchingLinkStart = nullptr;
 else
 {
 bPreEndLinkFound = false;
@@ -3043,7 +3043,7 @@ void SwTokenWindow::InsertAtSelection(const SwFormToken& 
rToken)
 
 bool bPostLinkStartFound = false;
 
-if(!bPreStartLinkFound && !bPreEndLinkFound)
+if(!pMatchingLinkStart && !bPreEndLinkFound)
 {
 for( ; it != m_aControlList.cend(); ++it )
 {
@@ -3075,10 +3075,12 @@ void SwTokenWindow::InsertAtSelection(const 
SwFormToken& rToken)
 }
 }
 
-if(bPreStartLinkFound)
+if(pMatchingLinkStart)
 {
 aToInsertToken.eTokenType = TOKEN_LINK_END;
 aToInsertToken.sText =  m_aButtonTexts[TOKEN_LINK_END];
+const SwFormToken& rStartTok = pMatchingLinkStart->GetFormToken();
+aToInsertToken.sCharStyleName = rStartTok.sCharStyleName;
 }
 
 if(bPostLinkStartFound)


core.git: sw/source

2026-03-09 Thread Justin Luth (via logerrit)
 sw/source/filter/ww8/docxexport.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 526c0c1bf3de4b9a3782e8227bee19baa32bfcd2
Author: Justin Luth 
AuthorDate: Fri Mar 6 12:04:14 2026 -0500
Commit: Justin Luth 
CommitDate: Mon Mar 9 13:42:58 2026 +0100

tdf#143269 docx export: no LinkToExternalData followup

addressing reviewer comments

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

diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index dc1c54bcf77e..e81bf3079b6a 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -454,12 +454,12 @@ OString DocxExport::OutputChart( uno::Reference< 
frame::XModel > const & xModel,
 {
 // missing or zero-sized embedded files are reported as corrupt by MS 
Word
 aChartExport.mbLinkToExternalData = false; // assume something wrong 
until proven valid
-const OUString rExternalDataPath = aChartExport.GetExternalDataPath();
-if (!rExternalDataPath.isEmpty())
+const OUString sExternalDataPath = aChartExport.GetExternalDataPath();
+if (!sExternalDataPath.isEmpty())
 {
 for (const auto& rEmbedding : lcl_getEmbeddingsList(m_xTextDoc))
 {
-if (rEmbedding.Name == rExternalDataPath)
+if (rEmbedding.Name == sExternalDataPath)
 {
 uno::Reference embeddingsStream;
 rEmbedding.Value >>= embeddingsStream;
@@ -467,7 +467,10 @@ OString DocxExport::OutputChart( uno::Reference< 
frame::XModel > const & xModel,
 {
 uno::Reference 
xSeekable(embeddingsStream, uno::UNO_QUERY);
 if (xSeekable && xSeekable->getLength())
+{
 aChartExport.mbLinkToExternalData = true;
+break;
+}
 }
 }
 }


core.git: sw/source

2026-03-09 Thread Justin Luth (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |   11 +++
 sw/source/filter/ww8/docxsdrexport.cxx   |   10 +++---
 2 files changed, 14 insertions(+), 7 deletions(-)

New commits:
commit 0c872e6973f1ed0a2386e3534f2cb69db6a693b5
Author: Justin Luth 
AuthorDate: Fri Mar 6 09:48:11 2026 -0500
Commit: Justin Luth 
CommitDate: Mon Mar 9 13:41:57 2026 +0100

tdf#169487: docx export: invalid values in a:Ext

This patch is similar to a prior one,
just applied in a different section of code.

MS Office is not accepting values greater than 2147483647
for 'x' and 'y' attributes inside a:off,
or 'cx' and 'cy' attributes inside 'a:chExt'

MSO was reporting those documents as corrupt. Specifically:
-ooo112797-1.odt
-tdf128906-1.odt
-tdf128906-2.odt
-tdf128828-1.odt

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index dc5292d71cec..ba3fd8d76cb2 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5749,10 +5749,13 @@ void DocxAttributeOutput::FlyFrameGraphic( const 
SwGrfNode* pGrfNode, const Size
 m_pSerializer->startElementNS(XML_a, XML_xfrm, xFrameAttributes);
 
 m_pSerializer->singleElementNS(XML_a, XML_off, XML_x, "0", XML_y, "0");
-// clamp to >=0, negative values are not valid here
-OString aWidth( OString::number( std::max(sal_Int64(0), TwipsToEMU( 
aSize.Width() )) ) );
-OString aHeight( OString::number( std::max(sal_Int64(0), TwipsToEMU( 
aSize.Height() )) ) );
-m_pSerializer->singleElementNS(XML_a, XML_ext, XML_cx, aWidth, XML_cy, 
aHeight);
+
+// MS Word reports the document as corrupt if not positive, Int32 value
+const sal_Int32 nWidth = std::clamp(TwipsToEMU(aSize.Width()), 
0, SAL_MAX_INT32);
+const sal_Int32 nHeight = 
std::clamp(TwipsToEMU(aSize.Height()), 0, SAL_MAX_INT32);
+m_pSerializer->singleElementNS(
+XML_a, XML_ext, XML_cx, OString::number(nWidth), XML_cy, 
OString::number(nHeight));
+
 m_pSerializer->endElementNS( XML_a, XML_xfrm );
 m_pSerializer->startElementNS(XML_a, XML_prstGeom, XML_prst, "rect");
 m_pSerializer->singleElementNS(XML_a, XML_avLst);
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index 13fe56ad7f24..29600ca26ac3 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1885,9 +1885,13 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* 
pParentFrame, bool bText
 pFS->startElementNS(XML_a, XML_xfrm);
 }
 pFS->singleElementNS(XML_a, XML_off, XML_x, "0", XML_y, "0");
-OString aWidth(OString::number(TwipsToEMU(aSize.Width(;
-OString aHeight(OString::number(TwipsToEMU(aSize.Height(;
-pFS->singleElementNS(XML_a, XML_ext, XML_cx, aWidth, XML_cy, aHeight);
+
+// MS Word reports the document as corrupt if not positive, Int32 value
+const sal_Int32 nW = std::clamp(TwipsToEMU(aSize.Width()), 
0, SAL_MAX_INT32);
+const sal_Int32 nH = std::clamp(TwipsToEMU(aSize.Height()), 
0, SAL_MAX_INT32);
+pFS->singleElementNS(XML_a, XML_ext, XML_cx, OString::number(nW), 
XML_cy,
+ OString::number(nH));
+
 pFS->endElementNS(XML_a, XML_xfrm);
 OUString shapeType = u"rect"_ustr;
 if (xPropSetInfo.is() && 
xPropSetInfo->hasPropertyByName(u"FrameInteropGrabBag"_ustr))


core.git: sw/source

2026-03-09 Thread Caolán McNamara (via logerrit)
 sw/source/filter/ww8/rtfattributeoutput.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 8c298cd88b294a7cb4c8c4addba1932181962453
Author: Caolán McNamara 
AuthorDate: Sun Mar 8 19:11:25 2026 +
Commit: Caolán McNamara 
CommitDate: Mon Mar 9 09:19:56 2026 +0100

crashtesting: column break exported in rtf header/footer

column break appearing in a header/footer on conversion of
bugtrackers/odt/fdo70624-1.odt to rtf

The other cases of column breaks in headers/footers are
suppressed, so do the same here

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

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 9e1c91879c31..23955f07887c 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1669,7 +1669,8 @@ void RtfAttributeOutput::SectionBreak(sal_uInt8 nC, bool 
/*bBreakAfter*/,
 switch (nC)
 {
 case msword::ColumnBreak:
-m_nColBreakNeeded = true;
+if (!m_rExport.m_bOutKF)
+m_nColBreakNeeded = true;
 break;
 case msword::PageBreak:
 if (pSectionInfo)


core.git: sw/source

2026-03-07 Thread Caolán McNamara (via logerrit)
 sw/source/core/txtnode/fntcache.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5975554699121046fe21bd376b2922b347fc94fd
Author: Caolán McNamara 
AuthorDate: Fri Mar 6 19:20:27 2026 +
Commit: Caolán McNamara 
CommitDate: Sat Mar 7 20:32:41 2026 +0100

crashtesting: assert in SwTextGuess::Guess

new break position result is before start index of text to break

presumably since:

commit 0d28097fadf44ed58cb5e3e9b9c04a65a7a33fd6
Date:   Tue Sep 22 16:37:22 2020 +0200

tdf#136588 sw: fix line break regression with small caps

There are tests for
SwLayoutWriter::TestTdf136588
and
SwLayoutWriter6::testTdf112290
that continue to work after this fix.

I think 1 worked because rInf.GetIdx was 1 in the testcases.

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

diff --git a/sw/source/core/txtnode/fntcache.cxx 
b/sw/source/core/txtnode/fntcache.cxx
index f0b14aa01118..0e04f48cfe5f 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2300,7 +2300,7 @@ TextFrameIndex SwFont::GetTextBreak(SwDrawTextInfo const 
& rInf, tools::Long nTe
 if (GetCaseMap() == SvxCaseMap::SmallCaps && 
TextFrameIndex(COMPLETE_STRING) == nTextBreak2 &&
 ! bCompress && nTextWidth == 0)
 // If nTextWidth == 0 means the line is full, we have to break it
-nTextBreak2 = TextFrameIndex(1);
+nTextBreak2 = rInf.GetIdx();
 
 if ( ! bCompress )
 return nTextBreak2;


core.git: sw/source

2026-03-07 Thread Gabor Kelemen (via logerrit)
 sw/source/core/doc/DocumentStateManager.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ab6f22b162377272a7996402ea7b2e69f753af47
Author: Gabor Kelemen 
AuthorDate: Sat Mar 7 12:37:15 2026 +0100
Commit: Gabor Kelemen 
CommitDate: Sat Mar 7 19:13:40 2026 +0100

sw: fix missing include in --with-yrs mode

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

diff --git a/sw/source/core/doc/DocumentStateManager.cxx 
b/sw/source/core/doc/DocumentStateManager.cxx
index 6250778ca7fb..544cd322f55d 100644
--- a/sw/source/core/doc/DocumentStateManager.cxx
+++ b/sw/source/core/doc/DocumentStateManager.cxx
@@ -56,6 +56,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 


core.git: sw/source

2026-03-06 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/utlui/content.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b9053154e21ef8e446564ec2edb792c0370a1df0
Author: Caolán McNamara 
AuthorDate: Fri Mar 6 09:44:26 2026 +
Commit: Caolán McNamara 
CommitDate: Fri Mar 6 18:16:16 2026 +0100

cid#1665122 silence Bad bit shift operation

since the additional neg numbers were added to the enum at:

commit a66fd0b6d9300a7def03658c1661cb6d5f609ab9
Date:   Sun Dec 21 23:31:53 2025 -0900

tdf#164864 SwNavigator should show index entries

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

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 1b3a6faaefe9..6778bd267310 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3598,8 +3598,8 @@ void SwContentTree::Display( bool bActive )
 
 for( ContentTypeId nCntType : o3tl::enumrange() )
 {
-// starts at 0 so ContentTypeId::UNKNOWN of -1 is skipped
-assert(nCntType != ContentTypeId::UNKNOWN);
+// starts at 0 so negative ContentTypeId values are skipped
+assert(nCntType > ContentTypeId::UNKNOWN);
 
 std::unique_ptr& rpContentT = bActive ?
 m_aActiveContentArr[nCntType] :


core.git: sw/source

2026-03-06 Thread Caolán McNamara (via logerrit)
 sw/source/filter/html/htmlctxt.cxx |   14 --
 sw/source/filter/html/swhtml.cxx   |   13 ++---
 sw/source/filter/html/swhtml.hxx   |4 +++-
 3 files changed, 21 insertions(+), 10 deletions(-)

New commits:
commit 9a79d74342a05f87365ab60ad057b1329a3bf216
Author: Caolán McNamara 
AuthorDate: Fri Mar 6 09:00:40 2026 +
Commit: Caolán McNamara 
CommitDate: Fri Mar 6 13:55:17 2026 +0100

ofz#390465661 Timeout on deeply nested tags

Try a nested element depth of 1024.

Browsers have some: "adoption agency algorithm" thing that might be
relevant to this:

https://html.spec.whatwg.org/multipage/parsing.html#adoption-agency-algorithm
but that's a complicated thing.

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

diff --git a/sw/source/filter/html/htmlctxt.cxx 
b/sw/source/filter/html/htmlctxt.cxx
index b32ce055efb2..ac8b70f61ad7 100644
--- a/sw/source/filter/html/htmlctxt.cxx
+++ b/sw/source/filter/html/htmlctxt.cxx
@@ -768,11 +768,12 @@ void SwHTMLParser::InsertAttrs( SfxItemSet &rItemSet,
 if( ppAttr )
 {
 // Set the attribute
-NewAttr(m_xAttrTab, ppAttr, *pItem);
-
-// and save context information
-HTMLAttrs &rAttrs = pContext->GetAttrs();
-rAttrs.push_back( *ppAttr );
+if (NewAttr(m_xAttrTab, ppAttr, *pItem))
+{
+// and save context information
+HTMLAttrs &rAttrs = pContext->GetAttrs();
+rAttrs.push_back( *ppAttr );
+}
 }
 }
 
@@ -791,7 +792,8 @@ void SwHTMLParser::InsertAttr( HTMLAttr **ppAttr, const 
SfxPoolItem & rItem,
 }
 
 // Set the attribute
-NewAttr(m_xAttrTab, ppAttr, rItem);
+if (!NewAttr(m_xAttrTab, ppAttr, rItem))
+return;
 
 // save context information
 HTMLAttrs &rAttrs = pCntxt->GetAttrs();
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index df2bfcb1dcd7..11fe83cd96cb 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -3105,7 +3105,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool 
bBeforeTable,
 aFields.clear();
 }
 
-void SwHTMLParser::NewAttr(const std::shared_ptr& rAttrTable, 
HTMLAttr **ppAttr, const SfxPoolItem& rItem )
+bool SwHTMLParser::NewAttr(const std::shared_ptr& rAttrTable, 
HTMLAttr **ppAttr, const SfxPoolItem& rItem )
 {
 // Font height and font colour as well as escape attributes may not be
 // combined. Therefore they're saved in a list and in it the last opened
@@ -3113,12 +3113,17 @@ void SwHTMLParser::NewAttr(const 
std::shared_ptr& rAttrTable, HTM
 // attributes count is just incremented.
 if( *ppAttr )
 {
+// limit chain depth to avoid getting stuck in BuildPortions
+if ((*ppAttr)->m_nChainDepth >= HTMLAttr::MAX_CHAIN_DEPTH)
+return false;
 HTMLAttr *pAttr = new HTMLAttr(*m_pPam->GetPoint(), rItem, ppAttr, 
rAttrTable);
+pAttr->m_nChainDepth = (*ppAttr)->m_nChainDepth + 1;
 pAttr->InsertNext( *ppAttr );
 (*ppAttr) = pAttr;
 }
 else
 (*ppAttr) = new HTMLAttr(*m_pPam->GetPoint(), rItem, ppAttr, 
rAttrTable);
+return true;
 }
 
 bool SwHTMLParser::EndAttr( HTMLAttr* pAttr, bool bChkEmpty )
@@ -5539,7 +5544,8 @@ HTMLAttr::HTMLAttr( const SwPosition& rPos, const 
SfxPoolItem& rItem,
 m_xAttrTab(std::move( xAttrTab )),
 m_pNext( nullptr ),
 m_pPrev( nullptr ),
-m_ppHead( ppHd )
+m_ppHead( ppHd ),
+m_nChainDepth( 0 )
 {
 }
 
@@ -5556,7 +5562,8 @@ HTMLAttr::HTMLAttr( const HTMLAttr &rAttr, const SwNode 
&rEndPara,
 m_xAttrTab(std::move( xAttrTab )),
 m_pNext( nullptr ),
 m_pPrev( nullptr ),
-m_ppHead( ppHd )
+m_ppHead( ppHd ),
+m_nChainDepth( 0 )
 {
 }
 
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 5147d8e8c6fa..08d6e052ab81 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -149,6 +149,8 @@ class HTMLAttr
 HTMLAttr *m_pNext;   // still to close attributes with different values
 HTMLAttr *m_pPrev;   // already closed but not set attributes
 HTMLAttr **m_ppHead; // list head
+sal_uInt16 m_nChainDepth; // depth of m_pNext chain
+static constexpr sal_uInt16 MAX_CHAIN_DEPTH = 1024;
 
 HTMLAttr( const SwPosition& rPos, const SfxPoolItem& rItem,
HTMLAttr **pHd, std::shared_ptr xAttrTab );
@@ -533,7 +535,7 @@ class SwHTMLParser : public SfxHTMLParser, public 
SvtListener
 // start/end an attribute
 // ppDepAttr indicated an attribute table entry, which attribute has to be
 // set, before the attribute is closed
-void NewAttr(const std::shared_ptr& rAttrTab, HTMLAttr 
**ppAttr, const SfxPoolItem& rItem);
+bool NewAttr(const std::sh

core.git: sw/source

2026-03-06 Thread Michael Weghorn (via logerrit)
 sw/source/core/access/acccell.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d57e03e2640d273e4dd3d0ba68666f33c50c2432
Author: Michael Weghorn 
AuthorDate: Fri Mar 6 10:05:02 2026 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 6 13:29:23 2026 +0100

tdf#171086 sw a11y: Use npos for string_view index check

std::basic_string_view::find_first_of returns
npos [1] (which is size_type(-1) [2]) if the string is
not found, so use that in the check.

Fixes this build error seen in a local gcc build on Debian
testing after

commit 43bf1cab57e7ac65ff376c46b2e3bd6b3cd91806
Author: Michael Weghorn 
Date:   Thu Mar 5 18:23:57 2026 +0100

tdf#171086 sw a11y: Report "{row,col}indextext" for Writer cells

:

In file included from /usr/include/c++/15/cassert:46,
 from 
/home/michi/development/git/libreoffice/include/rtl/ustrbuf.hxx:29,
 from 
/home/michi/development/git/libreoffice/include/svl/zforlist.hxx:24,
 from 
/home/michi/development/git/libreoffice/sw/inc/cellatr.hxx:23,
 from 
/home/michi/development/git/libreoffice/sw/source/core/access/acccell.cxx:35:

/home/michi/development/git/libreoffice/sw/source/core/access/acccell.cxx: In 
member function ‘virtual std::__debug::unordered_map SwAccessibleCell::implGetExtendedAttributes()’:

/home/michi/development/git/libreoffice/sw/source/core/access/acccell.cxx:321:35:
 error: comparison of unsigned expression in ‘>= 0’ is always true 
[-Werror=type-limits]
  321 | assert(nRowNameStartIndex >= 0 && "Cell name doesn't 
contain a row number");
  |~~~^~~~

[1] 
https://en.cppreference.com/w/cpp/string/basic_string_view/find_first_of.html
[2] https://en.cppreference.com/w/cpp/string/basic_string_view/npos.html

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

diff --git a/sw/source/core/access/acccell.cxx 
b/sw/source/core/access/acccell.cxx
index 1df76fbe7dcc..f258c883ef7c 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -318,7 +318,7 @@ std::unordered_map 
SwAccessibleCell::implGetExtendedAttribut
 }
 // cell name consists of column name (using letters) and row name 
(using digits)
 const size_t nRowNameStartIndex = 
sCellName.find_first_of(u"0123456789");
-assert(nRowNameStartIndex >= 0 && "Cell name doesn't contain a row 
number");
+assert(nRowNameStartIndex != std::u16string_view::npos && "Cell name 
doesn't contain a row number");
 aAttributes.emplace(AccessibleAttribute::ColIndexText, 
sCellName.substr(0, nRowNameStartIndex));
 aAttributes.emplace(AccessibleAttribute::RowIndexText, 
sCellName.substr(nRowNameStartIndex));
 }


core.git: sw/source

2026-03-06 Thread Caolán McNamara (via logerrit)
 sw/source/core/layout/sectfrm.cxx |   13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 61a0ed0a8d34207e153cb2acf9bb29bf2e500a3c
Author: Caolán McNamara 
AuthorDate: Thu Mar 5 23:43:28 2026 +
Commit: Caolán McNamara 
CommitDate: Fri Mar 6 09:27:42 2026 +0100

ofz#490136913 Direct-leak

this went wrong in:

commit ab7c81f55621d7b0d1468c63305163016dd78837
Date:   Wed Oct 4 15:42:27 2023 +0200

ITEM: Get away from classic 'poolable' Item flag

where the old pointer compare thing to detect this was a temp
object to destroy was misidentied as something more complicated.

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

diff --git a/sw/source/core/layout/sectfrm.cxx 
b/sw/source/core/layout/sectfrm.cxx
index 7a331d3d9fce..a175ed070f57 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -147,10 +147,15 @@ void SwSectionFrame::Init()
 const SwFormatCol &rCol = GetFormat()->GetCol();
 if( ( rCol.GetNumCols() > 1 || IsAnyNoteAtEnd() ) && !IsInFootnote() )
 {
-const SwFormatCol *pOld = Lower() ? &rCol : new SwFormatCol;
-ChgColumns( *pOld, rCol, IsAnyNoteAtEnd() );
-if (!SfxPoolItem::areSame( pOld, &rCol ))
-delete pOld;
+if (Lower())
+{
+ChgColumns( rCol, rCol, IsAnyNoteAtEnd() );
+}
+else
+{
+SwFormatCol aOld;
+ChgColumns( aOld, rCol, IsAnyNoteAtEnd() );
+}
 }
 }
 


core.git: sw/source

2026-03-05 Thread Michael Weghorn (via logerrit)
 sw/source/core/access/acccell.cxx |   30 ++
 1 file changed, 26 insertions(+), 4 deletions(-)

New commits:
commit 43bf1cab57e7ac65ff376c46b2e3bd6b3cd91806
Author: Michael Weghorn 
AuthorDate: Thu Mar 5 18:23:57 2026 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 6 07:19:40 2026 +0100

tdf#171086 sw a11y: Report "{row,col}indextext" for Writer cells

Similar to how

commit c2165ec33c5549dcc494ad9197727e096678fc3c
Author: Michael Weghorn 
Date:   Tue Nov 14 10:18:37 2023 +0100

tdf#158030 sc a11y: Report cell coords via {row,col}indextext obj 
attr

had done for cells in Calc, also report the
"rowindextext" and "colindextext" object attributes
for cells in Writer tables.

Determine them by extracting them from the cell name,
which consists of the column name (containing only
letters) and the row number (containing only digits).

Sample steps to test:

* start Writer with the qt6 VCL plugin
* insert a table
* start Accerciser
* in Accerciser's treeview of the LO a11y hierarchy, select
  the first table cell (which has an a11y name of "A1")
* check the object attributes in Accerciser's IPython console:

In [2]: acc.getAttributes()
Out[2]: ['colindextext:A', 'rowindextext:1']

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

diff --git a/sw/source/core/access/acccell.cxx 
b/sw/source/core/access/acccell.cxx
index 940190a71898..1df76fbe7dcc 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -301,14 +302,33 @@ uno::Any SwAccessibleCell::getMinimumIncrement(  )
 
 std::unordered_map 
SwAccessibleCell::implGetExtendedAttributes()
 {
+std::unordered_map aAttributes;
+
+// extract row/col index name attributes from cell name
+const OUString sQualifiedName = GetCellFrame().GetTabBox().GetName();
+if (!sQualifiedName.isEmpty())
+{
+// SwTableBox::GetName returns path including hierarchy, only last 
part is of interest
+std::u16string_view sCellName = sQualifiedName;
+const int nLastCellNameIndex = sQualifiedName.lastIndexOf(u'.');
+if (nLastCellNameIndex >= 0)
+{
+assert(sQualifiedName.getLength() > nLastCellNameIndex);
+sCellName = sQualifiedName.subView(nLastCellNameIndex + 1);
+}
+// cell name consists of column name (using letters) and row name 
(using digits)
+const size_t nRowNameStartIndex = 
sCellName.find_first_of(u"0123456789");
+assert(nRowNameStartIndex >= 0 && "Cell name doesn't contain a row 
number");
+aAttributes.emplace(AccessibleAttribute::ColIndexText, 
sCellName.substr(0, nRowNameStartIndex));
+aAttributes.emplace(AccessibleAttribute::RowIndexText, 
sCellName.substr(nRowNameStartIndex));
+}
+
 SwFrameFormat *pFrameFormat = GetTableBoxFormat();
 assert(pFrameFormat);
-
 const SwTableBoxFormula& tbl_formula = pFrameFormat->GetTableBoxFormula();
-
 OUString sFormula = tbl_formula.GetFormula();
 if (sFormula.isEmpty())
-return {};
+return aAttributes;
 
 // ensure the use of readable cell references (like "") instead of 
internal pointers
 if (const SwTabFrame* pTabFrame = m_pAccTable ? m_pAccTable->GetTabFrame() 
: nullptr)
@@ -326,7 +346,9 @@ std::unordered_map 
SwAccessibleCell::implGetExtendedAttribut
.replaceAll(u"=", u"\=")
.replaceAll(u",", u"\,")
.replaceAll(u":", u"\:");
-return { { u"Formula"_ustr, sFormula } };
+aAttributes.emplace(u"Formula"_ustr, sFormula);
+
+return aAttributes;
 }
 
 sal_Int32 SAL_CALL SwAccessibleCell::getBackground()


core.git: sw/source

2026-03-05 Thread Caolán McNamara (via logerrit)
 sw/source/core/SwNumberTree/SwNumberTree.cxx |   19 +--
 1 file changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 56f0d066499aedbbce8725e73ab2d6cd1c580eee
Author: Caolán McNamara 
AuthorDate: Sun Mar 1 19:12:11 2026 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 5 22:08:17 2026 +0100

Related: ofz#422030803 Timeout, use extract/insert

Change-Id: Icb40c3218a34b7423dfdb1261b29c76954c062ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200727
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx 
b/sw/source/core/SwNumberTree/SwNumberTree.cxx
index 1b5b3646934d..a035fbf89b64 100644
--- a/sw/source/core/SwNumberTree/SwNumberTree.cxx
+++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx
@@ -336,19 +336,18 @@ void SwNumberTreeNode::MoveGreaterChildren( 
SwNumberTreeNode& _rCompareNode,
 // move children
 if (aItUpper != mChildren.end())
 {
-tSwNumberTreeChildren::iterator aIt;
-for (aIt = aItUpper; aIt != mChildren.end(); ++aIt)
-(*aIt)->mpParent = &_rDestNode;
-
-_rDestNode.mChildren.insert(aItUpper, mChildren.end());
-
 // #i60652#
-// Because  could destroy
-// the element, which is referenced by , it's needed to
-// adjust  before erasing .
+// Adjust  before modifying mChildren, because
+// erase/extract could destroy the element it references.
 SetLastValid( mChildren.end() );
 
-mChildren.erase(aItUpper, mChildren.end());
+for (auto aIt = aItUpper; aIt != mChildren.end(); )
+{
+(*aIt)->mpParent = &_rDestNode;
+auto aItNext = std::next(aIt);
+_rDestNode.mChildren.insert(mChildren.extract(aIt));
+aIt = aItNext;
+}
 
 // #i60652#
 if ( !mChildren.empty() )


core.git: sw/source

2026-03-05 Thread Michael Weghorn (via logerrit)
 sw/source/core/table/swtable.cxx |   12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

New commits:
commit bdf3114180a1d35d5018b5b6bf73db983df68162
Author: Michael Weghorn 
AuthorDate: Thu Mar 5 08:45:56 2026 +0100
Commit: Michael Weghorn 
CommitDate: Thu Mar 5 14:52:10 2026 +0100

sw: Avoid intermediate string allocation

As Mike Kaganski points out in [1]:

> OUString::number returns an on-stack object; but then the result is
> converted to OUString - that is allocated from heap.
> [...]; in case of concatenations, using the original
> object returned from OUString::number would be better, not requiring
> intermediate allocations.

[1] 
https://gerrit.libreoffice.org/c/core/+/200942/comment/d4f6bdf4_1772d643/

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

diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 58ecc0896bdb..a24cfe8ef32a 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2251,23 +2251,17 @@ OUString SwTableBox::GetName() const
 ? &pLine->GetUpper()->GetTabLines() : &rTable.GetTabLines();
 
 sal_uInt16 nPos = pLines->GetPos(pLine) + 1;
-OUString sTmp = OUString::number(nPos);
 if( !sNm.isEmpty() )
-sNm = sTmp + "." + sNm;
+sNm = OUString::number(nPos) + "." + sNm;
 else
-sNm = sTmp;
+sNm = OUString::number(nPos);
 
 nPos = pBox->GetUpper()->GetBoxPos( pBox );
 pBox = pLine->GetUpper();
 if (pBox)
-{
-sTmp = OUString::number(nPos + 1);
-sNm = sTmp + "." + sNm;
-}
+sNm = OUString::number(nPos + 1) + "." + sNm;
 else
-{
 sNm = sw_GetTableBoxColStr(nPos) + sNm;
-}
 
 } while( pBox );
 return sNm;


core.git: sw/source sw/uiconfig sw/UIConfig_swriter.mk

2026-03-04 Thread Vojtěch Doležal (via logerrit)
 sw/UIConfig_swriter.mk  |1 
 sw/source/uibase/inc/QuickFindPanel.hxx |   66 +---
 sw/source/uibase/sidebar/QuickFindPanel.cxx |  140 --
 sw/uiconfig/swriter/ui/sidebarquickfind.ui  |  210 ++-
 sw/uiconfig/swriter/ui/sidebarquickfindoptionsdialog.ui |  215 
 5 files changed, 279 insertions(+), 353 deletions(-)

New commits:
commit 76ce5b6615219b177e619ebba36316389bfb8797
Author: Vojtěch Doležal 
AuthorDate: Fri Feb 20 16:39:19 2026 +0100
Commit: Jim Raykowski 
CommitDate: Thu Mar 5 07:21:35 2026 +0100

tdf#170980: Writer QuickFind history and options "expander"

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

diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 20bb54773c89..627588d85690 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -298,7 +298,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/sidebartableedit \
sw/uiconfig/swriter/ui/sidebartheme \
sw/uiconfig/swriter/ui/sidebarquickfind \
-sw/uiconfig/swriter/ui/sidebarquickfindoptionsdialog \
sw/uiconfig/swriter/ui/sortdialog \
sw/uiconfig/swriter/ui/spellmenu \
sw/uiconfig/swriter/ui/splittable \
diff --git a/sw/source/uibase/inc/QuickFindPanel.hxx 
b/sw/source/uibase/inc/QuickFindPanel.hxx
index 27346e88bdec..f530f77d3946 100644
--- a/sw/source/uibase/inc/QuickFindPanel.hxx
+++ b/sw/source/uibase/inc/QuickFindPanel.hxx
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -26,33 +27,6 @@ namespace sw::sidebar
 {
 class QuickFindPanel : public PanelLayout
 {
-class SearchOptionsDialog final : public weld::GenericDialogController
-{
-friend class QuickFindPanel;
-
-std::unique_ptr m_xMatchCaseCheckButton;
-std::unique_ptr m_xWholeWordsOnlyCheckButton;
-std::unique_ptr m_xCommentsCheckButton;
-std::unique_ptr m_xRegularExpressionsCheckButton;
-std::unique_ptr m_xSimilarityCheckButton;
-std::unique_ptr m_xSimilaritySettingsDialogButton;
-
-DECL_LINK(SimilarityCheckButtonToggledHandler, weld::Toggleable&, 
void);
-DECL_LINK(SimilaritySettingsDialogButtonClickedHandler, weld::Button&, 
void);
-
-short executeSubDialog(VclAbstractDialog* pVclAbstractDialog);
-
-bool m_executingSubDialog = false;
-
-bool m_bIsLEVRelaxed = true;
-sal_uInt16 m_nLEVOther = 2;
-sal_uInt16 m_nLEVShorter = 2;
-sal_uInt16 m_nLEVLonger = 2;
-
-public:
-SearchOptionsDialog(weld::Window* pParent);
-};
-
 public:
 static std::unique_ptr Create(weld::Widget* pParent,
const 
uno::Reference& rxFrame,
@@ -66,35 +40,40 @@ private:
 friend class QuickFindPanelWindow;
 std::vector> m_vPaMs;
 
-std::unique_ptr m_xSearchFindEntry;
+std::unique_ptr m_xSearchComboBox;
 std::unique_ptr m_xSearchOptionsToolbar;
 std::unique_ptr m_xFindAndReplaceToolbar;
 std::unique_ptr m_xFindAndReplaceToolbarDispatch;
 std::unique_ptr m_xTopbar;
+std::unique_ptr m_xSearchOptionsBox;
 std::unique_ptr m_xSearchFindsList;
 std::unique_ptr m_xSearchFindFoundTimesLabel;
 
-SwWrtShell* m_pWrtShell;
-std::unique_ptr m_xAcceleratorExecute;
+std::unique_ptr m_xMatchCaseCheckButton;
+std::unique_ptr m_xWholeWordsOnlyCheckButton;
+std::unique_ptr m_xCommentsCheckButton;
+std::unique_ptr m_xRegularExpressionsCheckButton;
+std::unique_ptr m_xSimilarityCheckButton;
+std::unique_ptr m_xSimilaritySettingsDialogButton;
 
-SfxBindings* m_pBindings;
+bool m_executingSubDialog = false;
 
-int m_nMinimumPanelWidth;
-
-bool m_bMatchCase = false;
-bool m_bWholeWordsOnly = false;
-bool m_bComments = true;
-bool m_bRegularExpression = false;
-bool m_bSimilarity = false;
 bool m_bIsLEVRelaxed = true;
 sal_uInt16 m_nLEVOther = 2;
 sal_uInt16 m_nLEVShorter = 2;
 sal_uInt16 m_nLEVLonger = 2;
 
-DECL_LINK(SearchFindEntryFocusInHandler, weld::Widget&, void);
-DECL_LINK(SearchFindEntryActivateHandler, weld::Entry&, bool);
-DECL_LINK(SearchFindEntryChangedHandler, weld::Entry&, void);
-DECL_LINK(SearchFindEntryKeyInputHandler, const KeyEvent&, bool);
+SwWrtShell* m_pWrtShell;
+std::unique_ptr m_xAcceleratorExecute;
+
+SfxBindings* m_pBindings;
+
+int m_nMinimumPanelWidth;
+
+DECL_LINK(SearchComboBoxFocusInHandler, weld::Widget&, void);
+DECL_LINK(SearchComboBoxActivateHandler, weld::ComboBox&, bool);
+DECL_LINK(SearchComboBoxChangedHandler, weld::ComboBox&, void);
+DECL_LINK(SearchComboBoxKeyInputHandler, const KeyEvent&, bool);
 DECL_LINK(SearchFindsListCustomGe

core.git: sw/source

2026-03-03 Thread Didier Vidal (via logerrit)
 sw/source/core/layout/flycnt.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 49c81d7de23be67f31d6c29281c0e52a84d1e6a1
Author: Didier Vidal 
AuthorDate: Tue Mar 3 20:32:22 2026 +0100
Commit: Miklos Vajna 
CommitDate: Wed Mar 4 08:45:39 2026 +0100

tdf#164218 time to insert an image increases the further the image

When an image is inserted with Insert/Image a virtual frame
representing the selection is created at the FAR_AWAY position.
Further in the process, while setting a format to the inserted graphic,
an anchor search is performed for that position, starting from the
layoutFrame of the insertion point. That search includes a search in
the up chain of the layout that can be very long (more than a minute)
if the insertions page is at a page number larger than a few hundreds,
and that always fails when the point is FAR_AWAY.
The fix deactivates this upward anchor search when the point
to anchor is FAR AWAY (which means not inserted yet in the
document)

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

diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 80c01412b479..25c354dc24cc 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -1140,6 +1140,9 @@ const SwContentFrame *FindAnchor( const SwFrame 
*pOldAnch, const Point &rNew,
 ::lcl_CalcDownDist( nUp, aNew, pUpFrame );
 SwDistance nDown = nUp;
 bool bNegAllowed = true;// Make it possible to leave the negative section 
once.
+// if rNew is FAR_AWAY the up search will always fail and can be very long
+// on large documents
+const bool bNewFarAway = rNew.getX() == FAR_AWAY  && rNew.getY() == 
FAR_AWAY;
 do
 {
 pUpLst = pUpFrame; nUpLst = nUp;
@@ -1174,7 +1177,7 @@ const SwContentFrame *FindAnchor( const SwFrame 
*pOldAnch, const Point &rNew,
 nUpLst = nUp;
 }
 }
-} while (pUpFrame && ((bNegAllowed && nUp.m_nMain < 0) || (nUp <= 
nUpLst)));
+} while (!bNewFarAway && pUpFrame && ((bNegAllowed && nUp.m_nMain < 0) || 
(nUp <= nUpLst)));
 
 const SwContentFrame *pDownLst;
 const SwContentFrame *pDownFrame = pCnt;


core.git: sw/source

2026-03-03 Thread Kashif (via logerrit)
 sw/source/core/docnode/ndnum.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 05007e451ca960a8f91c93839725bed5125dbb07
Author: Kashif 
AuthorDate: Wed Feb 18 23:36:18 2026 +0530
Commit: Ilmari Lauhakangas 
CommitDate: Tue Mar 3 20:12:09 2026 +0100

tdf#158237 sw: use contains() instead of find() != end()

Change associative container's find() and end() comparisons to the simpler
C++20 contains() method to improve readability.

Change-Id: Ia35944a323dfeb640d3de335380a3002152a993a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199637
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas 
Reviewed-by: Simon Chenery 

diff --git a/sw/source/core/docnode/ndnum.cxx b/sw/source/core/docnode/ndnum.cxx
index dcdc6ffbb9f5..cf62116a277e 100644
--- a/sw/source/core/docnode/ndnum.cxx
+++ b/sw/source/core/docnode/ndnum.cxx
@@ -100,7 +100,7 @@ void SwNodes::UpdateOutlineNode(SwNode & rNd)
 if (!pTextNd || !pTextNd->IsOutlineStateChanged())
 return;
 
-bool bFound = m_aOutlineNodes.find(pTextNd) != m_aOutlineNodes.end();
+bool bFound = m_aOutlineNodes.contains(pTextNd);
 
 if (pTextNd->IsOutline())
 {


core.git: sw/source

2026-03-02 Thread Caolán McNamara (via logerrit)
 sw/source/core/SwNumberTree/SwNumberTree.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0c6268be360086f0f1026c655998a82b6cb8
Author: Caolán McNamara 
AuthorDate: Sun Mar 1 16:41:45 2026 +
Commit: Caolán McNamara 
CommitDate: Mon Mar 2 09:13:10 2026 +0100

ofz#422030803 Timeout

std::set::merge can be used here because we are clearing mChildren
anyway.

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

diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx 
b/sw/source/core/SwNumberTree/SwNumberTree.cxx
index b45daf55bff8..1b5b3646934d 100644
--- a/sw/source/core/SwNumberTree/SwNumberTree.cxx
+++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx
@@ -396,7 +396,7 @@ void SwNumberTreeNode::MoveChildren(SwNumberTreeNode * 
pDest)
 for (auto& rpChild : mChildren)
 rpChild->mpParent = pDest;
 
-pDest->mChildren.insert(mChildren.begin(), mChildren.end());
+pDest->mChildren.merge(mChildren);
 mChildren.clear();
 //  destroys all existing iterators.
 // Thus,  is also destroyed and reset becomes necessary


core.git: sw/source

2026-03-01 Thread Samuel Mehrbrodt (via logerrit)
 sw/source/core/unocore/unodraw.cxx  |2 +-
 sw/source/core/unocore/unoframe.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d12f7b60b2c96db507c2a8ed5c75666d970ce5ab
Author: Samuel Mehrbrodt 
AuthorDate: Mon Feb 23 16:06:33 2026 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Mar 2 07:57:26 2026 +0100

Downgrade RelOrientation warnings to infos

Change-Id: Ifdd56b52bcbe288797a74bc448683a65d05152ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200067
Reviewed-by: Michael Stahl 
Reviewed-by: Samuel Mehrbrodt 
Tested-by: Jenkins

diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index 1160153162b8..a75fa9531c92 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1284,7 +1284,7 @@ void SwXShape::setPropertyValue(const OUString& 
rPropertyName, const uno::Any& a
 aValue >>= nRelOrient;
 if (sw::GetAtPageRelOrientation(nRelOrient, true))
 {
-SAL_WARN("sw.core", "SwXShape: fixing invalid horizontal 
RelOrientation for at-page anchor");
+SAL_INFO("sw.core", "SwXShape: fixing invalid horizontal 
RelOrientation for at-page anchor");
 value <<= nRelOrient;
 }
 SfxItemPropertySet::setPropertyValue( *pEntry, value, aSet );
diff --git a/sw/source/core/unocore/unoframe.cxx 
b/sw/source/core/unocore/unoframe.cxx
index 969788c871a0..3a8a4a2d6c5d 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -2749,7 +2749,7 @@ void 
SwXFrame::attachToRange(uno::Reference const& xTextRange,
 sal_Int16 
nRelOrient(aFrameSet.Get(RES_HORI_ORIENT).GetRelationOrient());
 if (sw::GetAtPageRelOrientation(nRelOrient, true))
 {
-SAL_WARN("sw.core", "SwXFrame: fixing invalid horizontal 
RelOrientation for at-page anchor");
+SAL_INFO("sw.core", "SwXFrame: fixing invalid horizontal 
RelOrientation for at-page anchor");
 
 SwFormatHoriOrient item(aFrameSet.Get(RES_HORI_ORIENT));
 item.SetRelationOrient(nRelOrient);


core.git: sw/source

2026-03-01 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/utlui/content.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 8586dd0d0fdea5ebe9f70173c91c864f2c82dd55
Author: Jim Raykowski 
AuthorDate: Sat Feb 28 20:35:27 2026 -0900
Commit: Jim Raykowski 
CommitDate: Mon Mar 2 03:17:45 2026 +0100

SwNavigator: Improve bring drawing objects to attention

Makes the position of the attention overlay rectangle correct for
drawing objects having rotation angle and/or shear set.

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

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index c98ceb334ed9..1b3a6faaefe9 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -8264,9 +8264,9 @@ void 
SwContentTree::BringDrawingObjectsToAttention(std::vector
 {
 if (pObject)
 {
-tools::Rectangle aRect(pObject->GetLogicRect());
-if (!aRect.IsEmpty())
-aRanges.emplace_back(aRect.Left(), aRect.Top(), aRect.Right(), 
aRect.Bottom());
+const tools::Rectangle& rRect = pObject->GetSnapRect();
+if (!rRect.IsEmpty())
+aRanges.emplace_back(rRect.Left(), rRect.Top(), rRect.Right(), 
rRect.Bottom());
 }
 }
 OverlayObject(std::move(aRanges));


core.git: sw/source

2026-03-01 Thread Caolán McNamara (via logerrit)
 sw/source/filter/html/swhtml.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 8bc8a88bc0d8409e9c70dd9d230a73d043d1695e
Author: Caolán McNamara 
AuthorDate: Sun Mar 1 16:08:35 2026 +
Commit: Caolán McNamara 
CommitDate: Mon Mar 2 00:01:09 2026 +0100

ofz#390465661 make an effort to reduce Timeout

==259== ERROR: libFuzzer: timeout after 61 seconds
#0 0x5acc95a80b31 in __sanitizer_print_stack_trace 
/src/llvm-project/compiler-rt/lib/asan/asan_stack.cpp:87:3
#1 0x5acc959aa048 in fuzzer::PrintStackTrace() 
/src/llvm-project/compiler-rt/lib/fuzzer/FuzzerUtil.cpp:210:5
#2 0x5acc9598d90b in fuzzer::Fuzzer::AlarmCallback() 
/src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:304:5
#3 0x7ada6679441f in libpthread.so.0
#4 0x5acc959a7e32 in AddValue 
/src/llvm-project/compiler-rt/lib/fuzzer/FuzzerValueBitMap.h:38:33
#5 0x5acc959a7e32 in HandleCmp 
/src/llvm-project/compiler-rt/lib/fuzzer/FuzzerTracePC.cpp:391:19
#6 0x5acc959a7e32 in __sanitizer_cov_trace_cmp4 
/src/llvm-project/compiler-rt/lib/fuzzer/FuzzerTracePC.cpp:505:15
#7 0x5acc97271beb in operator() 
/src/libreoffice/sw/source/core/txtnode/thints.cxx:2817:42
#8 0x5acc97271beb in SwpHints::MergePortions(SwTextNode&) 
/src/libreoffice/sw/source/core/txtnode/thints.cxx:2831:19
#9 0x5acc97267ac5 in SwpHints::TryInsertHint(SwTextAttr*, SwTextNode&, 
SetAttrMode) /src/libreoffice/sw/source/core/txtnode/thints.cxx:3355:13
#10 0x5acc972626de in SwTextNode::InsertHint(SwTextAttr*, SetAttrMode) 
/src/libreoffice/sw/source/core/txtnode/thints.cxx:1732:39

This MergePortions thing is skipped when SetInXMLImport is true, maybe
we should skip it always when SetInReading is true? Experiment
with the html fuzzer if it would work anyway.

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

diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 8736846d04c1..df2bfcb1dcd7 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -5666,6 +5666,7 @@ bool TestImportHTML(SvStream &rStream)
 
 SwPaM aPaM(pD->GetNodes().GetEndOfContent(), SwNodeOffset(-1));
 pD->SetInReading(true);
+pD->SetInXMLImport(true);
 bool bRet = false;
 try
 {
@@ -5677,6 +5678,7 @@ bool TestImportHTML(SvStream &rStream)
 catch (const std::out_of_range&)
 {
 }
+pD->SetInXMLImport(false);
 pD->SetInReading(false);
 
 return bRet;


core.git: sw/source

2026-02-28 Thread Heiko Tietze (via logerrit)
 sw/source/core/text/inftxt.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 78a8e3a0b3910d291a0144c7c57c09b31ba3255f
Author: Heiko Tietze 
AuthorDate: Fri Feb 27 09:53:31 2026 +0100
Commit: Heiko Tietze 
CommitDate: Sat Feb 28 09:47:08 2026 +0100

Resolves tdf#165810 - Show Soft Hyphen and Spaces independently from NPC

Previously the patch it was required to check the option under
Formatting Aids AND to enable non-printable characters. Now the latter
is not needed anymore. If the option under Formatting Aids is unchecked,
the ° symbol wont be shown if NPC is on.

Change-Id: Ib310691f39ec974d57516506f5992f8e826bb033
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200568
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 91d943bfc17a..fd4670e909f7 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1550,12 +1550,10 @@ void SwTextPaintInfo::DrawViewOpt( const SwLinePortion 
&rPor,
 bDraw = GetOpt().IsTab();
 break;
 case PortionType::SoftHyphen:
-if ( GetOpt().IsViewMetaChars() )
-bDraw = GetOpt().IsSoftHyph();
+bDraw = GetOpt().IsSoftHyph();
 break;
 case PortionType::Blank:
-if ( GetOpt().IsViewMetaChars() )
-bDraw = GetOpt().IsHardBlank();
+bDraw = GetOpt().IsHardBlank();
 break;
 case PortionType::ControlChar:
 if ( GetOpt().IsViewMetaChars() )


core.git: sw/source

2026-02-27 Thread Justin Luth (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b6359a0913f52288f99c8f6bce3f232c05e2
Author: Justin Luth 
AuthorDate: Fri Feb 27 09:06:40 2026 -0500
Commit: Justin Luth 
CommitDate: Fri Feb 27 23:34:50 2026 +0100

NFC cleanup: remove newly added assert that doesn't make sense

As vmiklos pointed out,
a few lines earlier just proved that it exists
(m_pRedlineData.back() would have crashed if size 0)
so this assert is not doing what I imagined.

StartRun pushes a redlineData.
EndRun pops the redlineData.

The idea behind the assert was to ensure that we can't get
EndRuns without StartRuns.
So nice as a confirmation during development
(although as we've seen also pointless in this particular case)
but definitely not something to leave in as
a permanent reminder that I am not a real programmer.

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index febe11d813ac..8b6554c83128 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2235,7 +2235,7 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, 
sal_Int32 nPos, sal_In
 {
 EndRedline(m_pRedlineData.back());
 }
-assert(m_pRedlineData.size());
+
 m_pRedlineData.pop_back();
 
 DoWriteBookmarksStart(m_rFinalBookmarksStart);


core.git: sw/source

2026-02-27 Thread Noel Grandin (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 6ee28b12844b4f9f9b2de0de236b90e3a9919003
Author: Noel Grandin 
AuthorDate: Mon Oct 27 13:44:59 2025 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 27 13:31:44 2026 +0100

mso-test: fix duplicate w:i element

when loading and then saving the document from tdf#99822, we end up with a 
duplicate w:i element,
which causes ms-office to think the document is corrupt

Change-Id: I6b7867fd4ee52d37502fde86a13294ef457416d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193035
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Stahl 
(cherry picked from commit 110d88a1e8f77a3b3c2d8ddb3f203e4858be77e6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200569
Tested-by: Jenkins

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 1b2d6281e6d2..4589ee750553 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1593,6 +1593,7 @@ void 
lcl_writeParagraphMarkerProperties(DocxAttributeOutput& rAttributeOutput, c
 // Did we already produce a  element?
 bool bFontSizeWritten = false;
 bool bBoldWritten = false;
+bool bPostureWritten = false;
 while (nWhichId)
 {
 if (aIter.GetItemState(true, &pItem) == SfxItemState::SET)
@@ -1602,12 +1603,15 @@ void 
lcl_writeParagraphMarkerProperties(DocxAttributeOutput& rAttributeOutput, c
 // Will this item produce a  element?
 bool bFontSizeItem = nWhichId == RES_CHRATR_FONTSIZE || 
nWhichId == RES_CHRATR_CJK_FONTSIZE;
 bool bBoldItem = nWhichId == RES_CHRATR_WEIGHT || nWhichId == 
RES_CHRATR_CJK_WEIGHT;
-if (!(bFontSizeWritten && bFontSizeItem) && !(bBoldWritten && 
bBoldItem))
+bool bPostureItem = nWhichId == RES_CHRATR_POSTURE || nWhichId 
== RES_CHRATR_CJK_POSTURE;
+if (!(bFontSizeWritten && bFontSizeItem) && !(bBoldWritten && 
bBoldItem) && !(bPostureWritten && bPostureItem))
 rAttributeOutput.OutputItem(*pItem);
 if (bFontSizeItem)
 bFontSizeWritten = true;
 if (bBoldItem)
 bBoldWritten = true;
+if (bPostureItem)
+bPostureWritten = true;
 }
 else if (nWhichId == RES_TXTATR_AUTOFMT)
 {


core.git: sw/source

2026-02-26 Thread Andrea Gelmini (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6e516436bdc67506ec635ca2ba11297bdecc3fef
Author: Andrea Gelmini 
AuthorDate: Mon Feb 23 18:00:53 2026 +0100
Commit: Julien Nabet 
CommitDate: Thu Feb 26 18:25:14 2026 +0100

Fix typo

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 8d4b05c44265..1b2d6281e6d2 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1889,7 +1889,7 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, 
sal_Int32 nPos, sal_In
 {
 // This is the common case: "close sdt before the current run" was 
requested by the next run.
 // This is NOT common anymore. Hardly any runSdt's are grabbagged 
nowadays,
-// but yes, if is is grabbagged, then this is the common way that it 
is closed.
+// but yes, if it is grabbagged, then this is the common way that it 
is closed.
 
 m_aRunSdt.EndSdtBlock(m_pSerializer);
 m_bEndCharSdt = false;


core.git: sw/source

2026-02-26 Thread Andrea Gelmini (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e02be75e46c23be3774e7161a2ddf4adf70c5793
Author: Andrea Gelmini 
AuthorDate: Mon Feb 23 18:00:54 2026 +0100
Commit: Julien Nabet 
CommitDate: Thu Feb 26 18:25:38 2026 +0100

Fix typo

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx 
b/sw/source/filter/ww8/docxattributeoutput.hxx
index ca9db3e30ece..d23d191b92b0 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -173,7 +173,7 @@ public:
 // In order to cache the SdtBlockHelper value, some mechanism is needed to 
check its validity.
 // Currently this is needed only for m_aParagraphSdt, so tracking the 
SwPosition is sufficient.
 
-// If the SDT has not beeen started (!m_bStartedSdt) and the text 
positions do not match,
+// If the SDT has not been started (!m_bStartedSdt) and the text positions 
do not match,
 // then this SdtBlockHelper cache may be cleared and re-populated.
 const SwPosition* m_pStartPosition; // only used by m_aParagraphSdt
 std::vector m_vBookmarkEnd; // only used by m_aParagraphSdt
@@ -1103,7 +1103,7 @@ private:
 // It starts at the paragraph containing the 'SdtPr' grabbag property,
 // and ends at the paragraph before the one containing the 
'ParaSdtEndBefore' property.
 SdtBlockHelper m_aParagraphSdt;
-// Same as m_aParagraphSdt except it ends on the run before the one 
containng 'SdtEndBefore'
+// Same as m_aParagraphSdt except it ends on the run before the one 
containing 'SdtEndBefore'
 SdtBlockHelper m_aRunSdt;
 
 std::vector> 
m_aTableStyleConfs;


core.git: sw/source

2026-02-26 Thread Andrea Gelmini (via logerrit)
 sw/source/writerfilter/inc/ooxml/OOXMLDocument.hxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 7803822d5463008e0a1a85488a18858963c517f2
Author: Andrea Gelmini 
AuthorDate: Tue Feb 24 15:35:52 2026 +0100
Commit: Julien Nabet 
CommitDate: Thu Feb 26 18:24:51 2026 +0100

Remove duplicated include

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

diff --git a/sw/source/writerfilter/inc/ooxml/OOXMLDocument.hxx 
b/sw/source/writerfilter/inc/ooxml/OOXMLDocument.hxx
index 71bc7b678a4f..83d8a064db3c 100644
--- a/sw/source/writerfilter/inc/ooxml/OOXMLDocument.hxx
+++ b/sw/source/writerfilter/inc/ooxml/OOXMLDocument.hxx
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 


core.git: sw/source

2026-02-25 Thread Noel Grandin (via logerrit)
 sw/source/writerfilter/dmapper/PropertyMap.hxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 50a4e42e7ae9bc358b59b16318d18b2b27d63c5d
Author: Noel Grandin 
AuthorDate: Wed Feb 25 09:33:01 2026 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 25 11:12:54 2026 +0100

mark some PropertyMap subclasses final

mostly for my own benefit, to make it easier to reason
about the inheritance hierarchy

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

diff --git a/sw/source/writerfilter/dmapper/PropertyMap.hxx 
b/sw/source/writerfilter/dmapper/PropertyMap.hxx
index 96ed4e720773..23d1475e334d 100644
--- a/sw/source/writerfilter/dmapper/PropertyMap.hxx
+++ b/sw/source/writerfilter/dmapper/PropertyMap.hxx
@@ -235,7 +235,7 @@ enum class PageBreakType
 Both
 };
 
-class SectionPropertyMap : public PropertyMap
+class SectionPropertyMap final : public PropertyMap
 {
 public:
 enum class BorderApply
@@ -457,7 +457,7 @@ void BeforeConvertToTextFrame(const 
std::deque& rFramedRedlines,
 
 void AfterConvertToTextFrame(const DomainMapper_Impl& rDM_Impl, const 
std::deque& aFramedRedlines, std::vector& redPos, 
std::vector& redLen, std::vector& redCell, 
std::vector& redTable);
 
-class ParagraphProperties : public SvRefBase
+class ParagraphProperties final : public SvRefBase
 {
 private:
 bool m_bFrameMode;
@@ -580,7 +580,7 @@ private:
 #define WW_OUTLINE_MAX  sal_Int16( 9 )
 #define WW_OUTLINE_MIN  sal_Int16( 0 )
 
-class StyleSheetPropertyMap
+class StyleSheetPropertyMap final
 : public ParagraphPropertiesPropertyMap
 {
 private:
@@ -597,7 +597,7 @@ public:
 void SetOutlineLevel(sal_Int16 nLevel) { if (nLevel <= WW_OUTLINE_MAX) 
mnOutlineLevel = nLevel; }
 };
 
-class ParagraphPropertyMap
+class ParagraphPropertyMap final
 : public ParagraphPropertiesPropertyMap
 {
 public:
@@ -606,7 +606,7 @@ public:
 
 typedef tools::SvRef< ParagraphPropertyMap > ParagraphPropertyMapPtr;
 
-class TablePropertyMap
+class TablePropertyMap final
 : public PropertyMap
 {
 public:


core.git: sw/source

2026-02-25 Thread Noel Grandin (via logerrit)
 sw/source/writerfilter/dmapper/DomainMapper.cxx |6 +-
 sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx |6 +-
 sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx|   30 ++--
 sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx|2 
 sw/source/writerfilter/dmapper/NumberingManager.cxx |8 +--
 sw/source/writerfilter/dmapper/PropertyMap.cxx  |   14 ++---
 sw/source/writerfilter/dmapper/PropertyMap.hxx  |2 
 sw/source/writerfilter/dmapper/StyleSheetTable.cxx  |   10 ++--
 8 files changed, 39 insertions(+), 39 deletions(-)

New commits:
commit bff6b30a58e4935d341567bd143673f266e8254d
Author: Noel Grandin 
AuthorDate: Tue Feb 24 22:03:10 2026 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 25 09:34:37 2026 +0100

remove some Sequence<->vector conversion

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

diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper.cxx
index 2cf85379ac9c..c302f76b8546 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx
@@ -3226,7 +3226,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 resolveSprmProps(*this, rSprm );
 
 // Get all the properties that were processed in the 
'rPrChange'->'rPr' XML node
-uno::Sequence< beans::PropertyValue > currentRedlineRevertProperties = 
m_pImpl->GetTopContext()->GetPropertyValues();
+std::vector< beans::PropertyValue > currentRedlineRevertProperties = 
m_pImpl->GetTopContext()->GetPropertyValues();
 
 // Pop back out the character properties that were on the run
 m_pImpl->PopProperties(CONTEXT_CHARACTER);
@@ -3246,7 +3246,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 resolveSprmProps(*this, rSprm );
 
 // Get all the properties that were processed in the 
'pPrChange'->'pPr' XML node
-uno::Sequence< beans::PropertyValue > currentRedlineRevertProperties = 
m_pImpl->GetTopContext()->GetPropertyValues();
+std::vector< beans::PropertyValue > currentRedlineRevertProperties = 
m_pImpl->GetTopContext()->GetPropertyValues();
 
 // Pop back out the character properties that were on the run
 m_pImpl->PopProperties(CONTEXT_PARAGRAPH);
@@ -4534,7 +4534,7 @@ void DomainMapper::lcl_utext(const sal_Unicode *const 
data_, size_t len)
 if (aInfo.nSprmId == NS_ooxml::LN_CT_Ruby_rt)
 {
 PropertyMapPtr pContext = m_pImpl->GetTopContext();
-PropertyValueVector_t aProps = comphelper::sequenceToContainer< 
PropertyValueVector_t >(pContext->GetPropertyValues());
+std::vector aProps = 
pContext->GetPropertyValues();
 OUString sStyle = getOrCreateCharStyle(aProps, 
/*bAlwaysCreate=*/false);
 m_pImpl->SetRubyText(sText,sStyle);
 return;
diff --git a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx 
b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx
index ab0fd12a0efa..dfbcf929c88d 100644
--- a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx
@@ -684,7 +684,7 @@ TableStyleSheetEntry * 
DomainMapperTableHandler::endTableGetTableStyle(TableInfo
 }
 }
 
-rInfo.aTableProperties = m_aTableProperties->GetPropertyValues();
+rInfo.aTableProperties = 
comphelper::containerToSequence(m_aTableProperties->GetPropertyValues());
 rInfo.aTablePropertyIds = m_aTableProperties->GetPropertyIds();
 
 #ifdef DBG_UTIL
@@ -967,7 +967,7 @@ CellPropertyValuesSeq_t 
DomainMapperTableHandler::endTableGetCellProperties(Tabl
 }
 (*aCellIterator)->Erase(PROP_HORIZONTAL_MERGE);
 }
-pSingleCellProperties[nCell] = 
(*aCellIterator)->GetPropertyValues();
+pSingleCellProperties[nCell] = 
comphelper::containerToSequence((*aCellIterator)->GetPropertyValues());
 #ifdef DBG_UTIL
 TagLogger::getInstance().endElement();
 #endif
@@ -1125,7 +1125,7 @@ css::uno::Sequence 
DomainMapperTableHandler::endTabl
 rRow->Insert(PROP_SIZE_TYPE, uno::Any(text::SizeType::FIX));
 }
 
-aRowPropertiesRange[nRow] = rRow->GetPropertyValues();
+aRowPropertiesRange[nRow] = 
comphelper::containerToSequence(rRow->GetPropertyValues());
 #ifdef DBG_UTIL
 rRow->dumpXml();
 lcl_DumpPropertyValues(aRowProperties[nRow]);
diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
index cc33d3c82b15..f1d1fe765b98 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
+++ b/sw/

core.git: sw/source

2026-02-25 Thread Noel Grandin (via logerrit)
 sw/source/writerfilter/dmapper/DomainMapper.cxx  |3 +-
 sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx |   28 +--
 sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx |6 ++--
 sw/source/writerfilter/dmapper/PropertyMap.hxx   |4 ++
 4 files changed, 22 insertions(+), 19 deletions(-)

New commits:
commit 13c16ba3fd69db24cd8ac4a656bbaeaa706431e8
Author: Noel Grandin 
AuthorDate: Tue Feb 24 20:26:12 2026 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 25 09:11:52 2026 +0100

use more concrete type in TableParagraph

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

diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper.cxx
index 261a5c0f10bb..2cf85379ac9c 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx
@@ -5421,7 +5421,8 @@ void DomainMapper::finishParagraph(const bool bRemove, 
const bool bNoNumbering)
 {
 if (m_pImpl->m_pSdtHelper->getControlType() == SdtControlType::datePicker)
 m_pImpl->m_pSdtHelper->createDateContentControl();
-m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH), 
bRemove, bNoNumbering);
+auto pParaContext = 
static_cast(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH).get());
+m_pImpl->finishParagraph(pParaContext, bRemove, bNoNumbering);
 if (bRemove || mbIsLastPara)
 m_pImpl->RemoveLastParagraph();
 mbIsLastPara = false; // handle other subdocuments
diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
index de5f47d5926e..cc33d3c82b15 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
@@ -2152,7 +2152,7 @@ static sal_Int32 lcl_getListId(const StyleSheetEntryPtr& 
rEntry, const StyleShee
 ///  9 indicates that numbering should be at body level (aka disabled) - 
rarely used by MSWord.
 ///  0-8 are the nine valid numbering levels.
 sal_Int16 DomainMapper_Impl::GetListLevel(const StyleSheetEntryPtr& pEntry,
-  const PropertyMapPtr& pParaContext)
+  const ParagraphPropertyMapPtr& pParaContext)
 {
 sal_Int16 nListLevel = -1;
 if (pParaContext)
@@ -2225,7 +2225,7 @@ void DomainMapper_Impl::ValidateListLevel(const OUString& 
sStyleIdentifierD)
 }
 }
 
-void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, 
const bool bRemove, const bool bNoNumbering )
+void DomainMapper_Impl::finishParagraph( const ParagraphPropertyMapPtr& 
pParaContext, const bool bRemove, const bool bNoNumbering )
 {
 if (m_bDiscardHeaderFooter)
 return;
@@ -2248,7 +2248,7 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap, con
 if (pFieldContext->GetFieldId() == FIELD_IF || 
pFieldContext->GetFieldId() == FIELD_REF)
 {
 // Conditional text fields can't contain newlines, finish the 
paragraph later.
-FieldParagraph aFinish{pPropertyMap, bRemove};
+FieldParagraph aFinish{pParaContext, bRemove};
 pFieldContext->GetParagraphsToFinish().push_back(aFinish);
 return;
 }
@@ -2259,7 +2259,6 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap, con
 TagLogger::getInstance().startElement("finishParagraph");
 #endif
 
-ParagraphPropertyMap* pParaContext = dynamic_cast< ParagraphPropertyMap* 
>( pPropertyMap.get() );
 if (m_aTextAppendStack.empty())
 return;
 TextAppendContext& rAppendContext = m_aTextAppendStack.top();
@@ -2406,7 +2405,7 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap, con
 // apply INHERITED autospacing only if top margin is not set
 if ( bIsAutoSet || bNoTopmargin )
 {
-GetAnyProperty(PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING, pPropertyMap) 
>>= nBeforeAutospacing;
+GetAnyProperty(PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING, 
pParaContext.get()) >>= nBeforeAutospacing;
 // tdf#137655 only w:beforeAutospacing=0 was specified, but not 
PARA_TOP_MARGIN
 // (see default_spacing = -1 in processing of 
LN_CT_Spacing_beforeAutospacing)
 if (bNoTopmargin && nBeforeAutospacing == convertTwipToMm100(-1))
@@ -2442,7 +2441,7 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap, con
 bool bAppliedBottomAutospacing = false;
 if (bIsAutoSet || bNoBottomMargin)
 {
-GetAnyProperty(PROP_PARA_BOTTOM_MARGIN_AFTER_AUTO_SPACING, 
pPropertyMap) >>= nAfterAutospacing;
+GetAnyProperty(PROP_PARA_BOTTOM_MARGIN_AFTER_AUTO_SPACING, 
pParaContext.get()) >>= nAfterAutospacing;
 if (bNoBottomMargin && nAfter

core.git: sw/source

2026-02-24 Thread shark (via logerrit)
 sw/source/ui/config/optpage.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit bfd6ee8b0b87db47ca8dd433fb9bb2221a3f20a2
Author: shark 
AuthorDate: Thu Jan 29 15:15:50 2026 +
Commit: Heiko Tietze 
CommitDate: Tue Feb 24 14:17:19 2026 +0100

tdf#150800 Improve change of vertical scrollbar from left to right

Change-Id: I6371e75b89ece41ba43f543a717fc0dd809c46bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198454
Reviewed-by: Heiko Tietze 
Tested-by: Jenkins

diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 77a29f52e227..6dfa07f7248e 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -173,8 +173,6 @@ SwContentOptPage::SwContentOptPage(weld::Container* pPage, 
weld::DialogControlle
 m_xZoomValue->hide();
 }
 
-if(!SvtCJKOptions::IsVerticalTextEnabled() )
-m_xVRulerRightCBox->hide();
 m_xVRulerCBox->connect_toggled(LINK(this, SwContentOptPage, VertRulerHdl 
));
 
 for (const auto& [pId, eFUnit] : STR_ARR_METRIC)


core.git: sw/source

2026-02-24 Thread Justin Luth (via logerrit)
 sw/source/writerfilter/dmapper/DomainMapper.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 47c06be9a4bf1a784bf6c98f56557cf98ed22df2
Author: Justin Luth 
AuthorDate: Fri Feb 20 09:32:23 2026 -0500
Commit: Justin Luth 
CommitDate: Tue Feb 24 13:18:59 2026 +0100

RunSDT: SetSdtType AFTER it might be cleared

During the cleanup of some outstanding text,
a content control might be created.
At the end of that process, it clear()s m_pSdtHelper
so clearly setting m_pSdtHelper variables
should come at the end of that cleanup.

Right?

This change was triggered by
sdt-run-in-para.docx
and the assert I added to PopSdt's
assert(m_pSdtHelper->GetSdtType() == NS_ooxml::LN_CT_SdtRun_sdtContent)

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

diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper.cxx
index 6763e91adbd6..261a5c0f10bb 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx
@@ -1267,8 +1267,6 @@ void DomainMapper::lcl_attribute(Id nName, const Value & 
val)
 case NS_ooxml::LN_CT_SdtBlock_sdtContent:
 case NS_ooxml::LN_CT_SdtRun_sdtContent:
 {
-m_pImpl->m_pSdtHelper->SetSdtType(nName);
-
 if (m_pImpl->m_pSdtHelper->getControlType() == 
SdtControlType::unknown)
 {
 // If the SdtControlType is not defined, it really OUGHT to be 
richText
@@ -1335,10 +1333,12 @@ void DomainMapper::lcl_attribute(Id nName, const Value 
& val)
 m_pImpl->clearDeferredBreaks();
 }
 
+m_pImpl->m_pSdtHelper->SetSdtType(nName);
 
m_pImpl->m_pSdtHelper->setControlType(SdtControlType::richText);
 m_pImpl->PushSdt();
 break;
 }
+m_pImpl->m_pSdtHelper->SetSdtType(nName);
 m_pImpl->SetSdt(true);
 }
 break;


core.git: sw/source

2026-02-23 Thread Mike Kaganski (via logerrit)
 sw/source/filter/md/swmd.cxx |  119 ---
 sw/source/filter/md/swmd.hxx |2 
 2 files changed, 35 insertions(+), 86 deletions(-)

New commits:
commit a488a7ca877541e3f999df9a5d00db077e26ad36
Author: Mike Kaganski 
AuthorDate: Sun Feb 22 17:03:39 2026 +0100
Commit: Mike Kaganski 
CommitDate: Mon Feb 23 19:10:01 2026 +0100

Optimize SwMarkdownParser::CallParser a bit

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

diff --git a/sw/source/filter/md/swmd.cxx b/sw/source/filter/md/swmd.cxx
index 1b410ab17448..8581c9aafe17 100644
--- a/sw/source/filter/md/swmd.cxx
+++ b/sw/source/filter/md/swmd.cxx
@@ -748,7 +748,6 @@ SwMarkdownParser::SwMarkdownParser(SwDoc& rD, SwPaM& 
rCursor, SvStream& rIn, OUS
 rCursor.DeleteMark();
 m_pPam = &rCursor;
 m_rInput.ResetError();
-m_nFilesize = m_rInput.TellEnd();
 m_rInput.Seek(STREAM_SEEK_TO_BEGIN);
 m_rInput.ResetError();
 }
@@ -843,102 +842,55 @@ ErrCodeMsg MarkdownReader::Read(SwDoc& rDoc, const 
OUString& rBaseURL, SwPaM& rP
 ErrCode SwMarkdownParser::CallParser()
 {
 // use utf8
-rtl_TextEncoding eSrcEnc = RTL_TEXTENCODING_DONTKNOW;
-m_rInput.StartReadingUnicodeText(eSrcEnc);
-if (m_rInput.good())
+m_rInput.StartReadingUnicodeText(RTL_TEXTENCODING_DONTKNOW);
+if (!m_rInput.good())
 {
-sal_uInt64 nPos = m_rInput.Tell(); //bom size
-{
-std::vector buf(65535); // Arbitrarily chosen 64KiB buffer
-const size_t nSize = m_rInput.ReadBytes(buf.data(), buf.size());
-if (nSize > 0)
-{
-UErrorCode uerr = U_ZERO_ERROR;
-UCharsetDetector* ucd = ucsdet_open(&uerr);
-ucsdet_setText(ucd, buf.data(), nSize, &uerr);
-if (const UCharsetMatch* match = ucsdet_detect(ucd, &uerr))
-{
-const char* pEncodingName = ucsdet_getName(match, &uerr);
-
-if (strcmp("UTF-16LE", pEncodingName) == 0)
-{
-eSrcEnc = RTL_TEXTENCODING_UCS2;
-m_rInput.SetEndian(SvStreamEndian::LITTLE);
-}
-else if (strcmp("UTF-16BE", pEncodingName) == 0)
-{
-eSrcEnc = RTL_TEXTENCODING_UCS2;
-m_rInput.SetEndian(SvStreamEndian::BIG);
-}
-else
-{
-eSrcEnc = 
rtl_getTextEncodingFromMimeCharset(pEncodingName);
-}
-}
-ucsdet_close(ucd);
-}
-else
-{
-return ERRCODE_IO_INVALIDLENGTH;
-}
-}
+return ERRCODE_IO_INVALIDCHAR;
+}
 
+rtl_TextEncoding eSrcEnc;
+const sal_uInt64 nPos = m_rInput.Tell(); //bom size
+if (nPos == 2)
+eSrcEnc = RTL_TEXTENCODING_UCS2;
+else if (nPos == 3)
+eSrcEnc = RTL_TEXTENCODING_UTF8;
+else
+{
+SvStreamEndian eEndian;
+SfxObjectShell::DetectCharSet(m_rInput, eSrcEnc, eEndian);
 if (eSrcEnc == RTL_TEXTENCODING_DONTKNOW)
 return ERRCODE_IO_INVALIDCHAR;
+m_rInput.SetEndian(eEndian);
+}
 
-m_rInput.Seek(nPos);
-m_rInput.ResetError();
-m_nFilesize -= nPos;
-
-OUString sData;
-OString sUtf8Data;
-
-if (eSrcEnc == RTL_TEXTENCODING_UCS2)
-{
-if (m_nFilesize & 1)
-return ERRCODE_IO_INVALIDCHAR;
-
-tools::Long nChars = m_nFilesize / 2;
-std::vector aCharData(nChars);
+m_rInput.ResetError();
+const sal_uInt64 nFilesize = m_rInput.remainingSize();
+OString sUtf8Data;
 
-for (tools::Long n = 0; n < nChars; n++)
-{
-m_rInput.ReadUtf16(aCharData[n]);
-}
+if (eSrcEnc == RTL_TEXTENCODING_UCS2)
+{
+if (nFilesize & 1)
+return ERRCODE_IO_INVALIDCHAR;
 
-sData = OUString(aCharData.data(), nChars);
-sUtf8Data = OUStringToOString(sData, RTL_TEXTENCODING_UTF8);
-}
-else
+const sal_uInt64 nChars = nFilesize / 2;
+OUString sData = read_uInt16s_ToOUString(m_rInput, nChars);
+sUtf8Data = OUStringToOString(sData, RTL_TEXTENCODING_UTF8);
+}
+else
+{
+sUtf8Data = read_uInt8s_ToOString(m_rInput, nFilesize);
+if (eSrcEnc != RTL_TEXTENCODING_UTF8)
 {
-tools::Long nChars = m_nFilesize;
-std::vector aCharData(nChars);
-m_rInput.ReadBytes(aCharData.data(), nChars);
-sData = OUString(aCharData.data(), nChars, eSrcEnc);
+OUString sData = OStringToOUString(sUtf8Data, eSrcEnc);
 sUtf8Data = OUString

core.git: sw/source

2026-02-23 Thread Mike Kaganski (via logerrit)
 sw/source/core/view/viewsh.cxx |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit c6b9b0045e9fa8eb0afc59b6620c17bed866f3d4
Author: Mike Kaganski 
AuthorDate: Mon Feb 23 09:55:49 2026 +0100
Commit: Mike Kaganski 
CommitDate: Mon Feb 23 11:30:09 2026 +0100

Use ScopedVclPrtInstance to simplify lifetime management

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

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index d7492c040809..f80106b069f2 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -480,7 +480,7 @@ void 
SwViewShell::ImplUnlockPaint(std::vector& rReasons, bool b
 if ( (bInSizeNotify || bVirDev ) && VisArea().HasArea() && 
!comphelper::LibreOfficeKit::isActive())
 {
 //Refresh with virtual device to avoid flickering.
-VclPtrInstance pVout( *mpOut );
+ScopedVclPtrInstance pVout(*mpOut);
 pVout->SetMapMode( mpOut->GetMapMode() );
 Size aSize( VisArea().SSize() );
 aSize.AdjustWidth(20 );
@@ -522,7 +522,6 @@ void 
SwViewShell::ImplUnlockPaint(std::vector& rReasons, bool b
 GetWin()->EnablePaint( true );
 InvalidateAll(rReasons);
 }
-pVout.disposeAndClear();
 }
 else
 {
@@ -1531,7 +1530,7 @@ bool SwViewShell::SmoothScroll( tools::Long lXDiff, 
tools::Long lYDiff, const to
 
 //create virtual device and set.
 const Size aPixSz = GetWin()->PixelToLogic(Size(1,1));
-VclPtrInstance pVout( *GetWin()->GetOutDev() );
+ScopedVclPtrInstance pVout(*GetWin()->GetOutDev());
 pVout->SetLineColor( GetWin()->GetOutDev()->GetLineColor() );
 pVout->SetFillColor( GetWin()->GetOutDev()->GetFillColor() );
 MapMode aMapMode( GetWin()->GetMapMode() );
@@ -1708,14 +1707,12 @@ bool SwViewShell::SmoothScroll( tools::Long lXDiff, 
tools::Long lYDiff, const to
 --mnLockPaint;
 }
 }
-pVout.disposeAndClear();
 GetWin()->PaintImmediately();
 if ( !Imp()->m_bStopSmooth )
 --mnLockPaint;
 SetFirstVisPageInvalid();
 return true;
 }
-pVout.disposeAndClear();
 }
 #endif
 


core.git: sw/source

2026-02-23 Thread Mike Kaganski (via logerrit)
 sw/source/filter/ww8/ww8par.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 35a053b28b76432b749c8c9667fb03f27c2cb635
Author: Mike Kaganski 
AuthorDate: Mon Feb 23 09:39:02 2026 +0100
Commit: Mike Kaganski 
CommitDate: Mon Feb 23 11:04:53 2026 +0100

Simplify the condition a bit

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

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 4cbb1eb5614d..1ea68b6cddf8 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3026,10 +3026,7 @@ static std::size_t 
Custom8BitToUnicode(rtl_TextToUnicodeConverter hConverter,
 
 nConverted += nThisConverted;
 
-if (
-nInfo & RTL_TEXTTOUNICODE_INFO_UNDEFINED ||
-nInfo & RTL_TEXTTOUNICODE_INFO_MBUNDEFINED
-   )
+if (nInfo & (RTL_TEXTTOUNICODE_INFO_UNDEFINED | 
RTL_TEXTTOUNICODE_INFO_MBUNDEFINED))
 {
 sal_Size nOtherConverted;
 rtl_TextToUnicodeConverter hCP1252Converter =


core.git: sw/source

2026-02-22 Thread Mike Kaganski (via logerrit)
 sw/source/filter/basflt/iodetect.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit dde027cbe68dccf123187f7abb27d439a99bbed5
Author: Mike Kaganski 
AuthorDate: Sun Feb 22 19:04:29 2026 +0100
Commit: Mike Kaganski 
CommitDate: Sun Feb 22 20:39:27 2026 +0100

Improve SwIoSystem::GetTextEncoding

Use correct type (IsDetectableText takes reference to sal_uLong).
Initialize eCharSet (IsDetectableText may return without setting
out charset variable).

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

diff --git a/sw/source/filter/basflt/iodetect.cxx 
b/sw/source/filter/basflt/iodetect.cxx
index 3977d6740599..5e2acab50033 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -242,11 +242,11 @@ std::shared_ptr 
SwIoSystem::GetFileFilter(const OUString& rFile
 
 rtl_TextEncoding SwIoSystem::GetTextEncoding(SvStream& rStrm)
 {
-sal_Size nLen, nOrig;
+sal_uLong nLen, nOrig;
 char aBuf[4096];
 nOrig = nLen = rStrm.ReadBytes(aBuf, sizeof(aBuf));
 
-rtl_TextEncoding eCharSet;
+rtl_TextEncoding eCharSet = RTL_TEXTENCODING_DONTKNOW;
 const bool bRet = SwIoSystem::IsDetectableText(aBuf, nLen, &eCharSet, 
nullptr, nullptr, nullptr);
 if (bRet && eCharSet != RTL_TEXTENCODING_DONTKNOW)
 rStrm.SeekRel(-(tools::Long(nLen)));


core.git: sw/source

2026-02-22 Thread Caolán McNamara (via logerrit)
 sw/source/ui/table/convert.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7448079186349ab5974b06d1e678a432250d75c8
Author: Caolán McNamara 
AuthorDate: Sat Feb 21 19:35:13 2026 +
Commit: Caolán McNamara 
CommitDate: Sun Feb 22 18:17:54 2026 +0100

cid#1681468 Improper use of negative value

my facepalm there

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

diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx
index defb1597ca42..412493ce3916 100644
--- a/sw/source/ui/table/convert.cxx
+++ b/sw/source/ui/table/convert.cxx
@@ -242,7 +242,7 @@ std::unique_ptr 
SwConvertTableDlg::FillAutoFormatOfIndex() co
 
 IMPL_LINK(SwConvertTableDlg, CheckHdl, weld::Toggleable&, rBtn, void)
 {
-if (m_nIndex != -1)
+if (m_nIndex == -1)
 return;
 
 SwTableAutoFormat& rData = (*m_xTableTable)[m_nIndex];


core.git: sw/source

2026-02-22 Thread Vaasu K (via logerrit)
 sw/source/uibase/inc/dselect.hxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit a6d43ed34c4ce1281f7721643660a954ce6303fa
Author: Vaasu K 
AuthorDate: Sat Feb 21 18:55:11 2026 +
Commit: Ilmari Lauhakangas 
CommitDate: Sun Feb 22 11:08:19 2026 +0100

tdf#124176: Replace include guard with pragma once in dselect.hxx

Replace with #pragma once in file

Signed-off-by: [email protected]>
Change-Id: If32c7ecb3d37f56897a49ff3ab26c649103f3533
Signed-off-by: Vaasu K 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199958
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas 

diff --git a/sw/source/uibase/inc/dselect.hxx b/sw/source/uibase/inc/dselect.hxx
index bb9f6e9c3d4a..cb275552c3d4 100644
--- a/sw/source/uibase/inc/dselect.hxx
+++ b/sw/source/uibase/inc/dselect.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_SOURCE_UIBASE_INC_DSELECT_HXX
-#define INCLUDED_SW_SOURCE_UIBASE_INC_DSELECT_HXX
+#pragma once
 
 #include "drawbase.hxx"
 
@@ -30,6 +29,4 @@ public:
 virtual void Activate(const sal_uInt16 nSlotId) override; // activate 
function
 };
 
-#endif // INCLUDED_SW_SOURCE_UIBASE_INC_DSELECT_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: sw/source

2026-02-21 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/utlui/glbltree.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit dae57af4a7f24ea4672f2d99b18413b878e6a69a
Author: Caolán McNamara 
AuthorDate: Sat Feb 21 16:32:41 2026 +
Commit: Caolán McNamara 
CommitDate: Sat Feb 21 20:12:17 2026 +0100

Resolves: tdf#166902 ensure right clicked entry is selected

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

diff --git a/sw/source/uibase/utlui/glbltree.cxx 
b/sw/source/uibase/utlui/glbltree.cxx
index 98ee87f12550..8a7dd8ab1fc7 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -272,6 +272,17 @@ IMPL_LINK(SwGlobalTree, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 bool bPop = false;
 if (m_pActiveShell && 
!m_pActiveShell->GetView().GetDocShell()->IsReadOnly())
 {
+// tdf#166902 ensure right clicked entry is selected
+if (rCEvt.IsMouseEvent())
+{
+if (std::unique_ptr xEntry = 
m_xTreeView->get_dest_row_at_pos(rCEvt.GetMousePosPixel(), false))
+{
+// if clicked entry is not currently selected then clear 
selections and select it
+if (!m_xTreeView->is_selected(*xEntry))
+m_xTreeView->set_cursor(*xEntry);
+}
+}
+
 std::unique_ptr 
xBuilder(Application::CreateBuilder(m_xTreeView.get(), 
u"modules/swriter/ui/mastercontextmenu.ui"_ustr));
 std::unique_ptr xPopup = 
xBuilder->weld_menu(u"navmenu"_ustr);
 std::unique_ptr xSubPopup = 
xBuilder->weld_menu(u"insertmenu"_ustr);


core.git: sw/source

2026-02-20 Thread Justin Luth (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d2767db09c5608d2f4edc6c2c7a3c4d0e92192cf
Author: Justin Luth 
AuthorDate: Fri Feb 13 20:36:15 2026 -0500
Commit: Justin Luth 
CommitDate: Fri Feb 20 20:43:57 2026 +0100

NFC tdf#170602 docx export: always use EndParaSdtBlock()

No Functional Change intended

This lays some groundwork for the subsequent patches
in this bug report.
It is a super minor change,
but I want to de-clutter this patchset as much as possible.

Use the function so that all closings of a grabbagged m_aParagraph
follow the same code path.

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 34d518a69e18..841edf06aa31 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -614,7 +614,7 @@ sal_Int32 DocxAttributeOutput::StartParagraph(const 
ww8::WW8TableNodeInfo::Point
 if (bEndParaSdt || (m_aParagraphSdt.m_bStartedSdt && m_bHadSectPr))
 {
 // This is the common case: "close sdt before the current paragraph" 
was requested by the next paragraph.
-m_aParagraphSdt.EndSdtBlock(m_pSerializer);
+EndParaSdtBlock();
 }
 m_bHadSectPr = false;
 
@@ -1303,7 +1303,7 @@ void DocxAttributeOutput::EndParagraph( const 
ww8::WW8TableNodeInfoInner::Pointe
 const bool bOldStartedSdt = m_aParagraphSdt.m_bStartedSdt;
 m_rExport.SdrExporter().writeOnlyTextOfFrame(pFrame.get());
 if (!bOldStartedSdt && m_aParagraphSdt.m_bStartedSdt)
-m_aParagraphSdt.EndSdtBlock(m_pSerializer);
+EndParaSdtBlock();
 m_aFramePr.SetFrame(nullptr);
 }
 


core.git: sw/source

2026-02-20 Thread Justin Luth (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |   15 +--
 sw/source/filter/ww8/docxattributeoutput.hxx |   15 +++
 2 files changed, 8 insertions(+), 22 deletions(-)

New commits:
commit 67b49e7a5c35617b68b41f9cc2b1fefcb4820c39
Author: Justin Luth 
AuthorDate: Fri Feb 13 20:17:31 2026 -0500
Commit: Justin Luth 
CommitDate: Fri Feb 20 20:43:40 2026 +0100

tdf#170602 docx export: remove obsolete bCloseEarlierSdt

I need to remove this in order to change
when the SdtBlockHelper should be cleared/cached.

This just doesn't look right anyway.
It says "if not-richText-but-something, then close it later"
Everywhere else that checks for a to-be-written-grabbagged-SDT
also checks Id and DataBinding.
Any why should this situation be different,
and why would richText not be included when everything else is?

Plus, even the markings (which I admittedly don't understand)
don't seem very convincing.

In any case, grabbagged runSdt's are not very common now
(perhaps only citations are left?)
so if there is a problem with grabbagged runSdt's
it would probably be better just to fully implement them.
(Google says w:citation has no special fields,
so it should be super simple to round-trip as a real control.)

The unit test accompanying the original patch still passes
because it tests against real content controls now.
The only m_aRunSdt's I saw in existing unit tests were citations.

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index e8b89fd35296..34d518a69e18 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1869,7 +1869,6 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, 
sal_Int32 nPos, sal_In
 // level down, to be able to prepend the actual run start attribute (just
 // before "postponed run start")
 m_pSerializer->mark(Tag_EndRun_1); // let's call it "actual run start"
-bool bCloseEarlierSDT = false;
 
 if (m_bEndCharSdt)
 {
@@ -1877,12 +1876,7 @@ void DocxAttributeOutput::EndRun(const SwTextNode* 
pNode, sal_Int32 nPos, sal_In
 // This is NOT common anymore. Hardly any runSdt's are grabbagged 
nowadays,
 // but yes, if is is grabbagged, then this is the common way that it 
is closed.
 
-// if another sdt starts in this run, then wait
-// as closing the sdt now, might cause nesting of sdts
-if (m_aRunSdt.m_oSdtPrToken.has_value())
-bCloseEarlierSDT = true;
-else
-m_aRunSdt.EndSdtBlock(m_pSerializer);
+m_aRunSdt.EndSdtBlock(m_pSerializer);
 m_bEndCharSdt = false;
 }
 
@@ -2129,13 +2123,6 @@ void DocxAttributeOutput::EndRun(const SwTextNode* 
pNode, sal_Int32 nPos, sal_In
 m_aRunSdt.clearGrabbagValues();
 }
 
-if (bCloseEarlierSDT)
-{
-m_pSerializer->mark(Tag_EndRun_2);
-m_aRunSdt.EndSdtBlock(m_pSerializer);
-m_pSerializer->mergeTopMarks(Tag_EndRun_2, 
sax_fastparser::MergeMarks::PREPEND);
-}
-
 m_pSerializer->mergeTopMarks(Tag_StartRun_1);
 
 // XML_r node should be surrounded with permission-begin and 
permission-end nodes if it has permission.
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx 
b/sw/source/filter/ww8/docxattributeoutput.hxx
index b69ad436fe61..b37547aac8f2 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -1170,14 +1170,13 @@ public:
 static const sal_Int32 Tag_StartRun_2 = 7;
 static const sal_Int32 Tag_StartRun_3 = 8;
 static const sal_Int32 Tag_EndRun_1 = 9;
-static const sal_Int32 Tag_EndRun_2 = 10;
-static const sal_Int32 Tag_StartRunProperties = 11;
-static const sal_Int32 Tag_InitCollectedRunProperties = 12;
-static const sal_Int32 Tag_Redline_1 = 13;
-static const sal_Int32 Tag_Redline_2 = 14;
-static const sal_Int32 Tag_TableDefinition = 15;
-static const sal_Int32 Tag_OutputFlyFrame = 16;
-static const sal_Int32 Tag_StartSection = 17;
+static const sal_Int32 Tag_StartRunProperties = 10;
+static const sal_Int32 Tag_InitCollectedRunProperties = 11;
+static const sal_Int32 Tag_Redline_1 = 12;
+static const sal_Int32 Tag_Redline_2 = 13;
+static const sal_Int32 Tag_TableDefinition = 14;
+static const sal_Int32 Tag_OutputFlyFrame = 15;
+static const sal_Int32 Tag_StartSection = 16;
 };
 
 /**


core.git: sw/source

2026-02-20 Thread Justin Luth (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |   70 ---
 sw/source/filter/ww8/docxattributeoutput.hxx |   13 +++--
 2 files changed, 51 insertions(+), 32 deletions(-)

New commits:
commit 8fc23c6d7d34d344b2014491d8696c618ff6d04b
Author: Justin Luth 
AuthorDate: Fri Feb 13 19:19:55 2026 -0500
Commit: Justin Luth 
CommitDate: Fri Feb 20 20:43:23 2026 +0100

tdf#170602 docxexport BlockSdtHelper: make optional nId/nSdtPrToken

This is almost a 'Non Functional Change intended'.
It lays some groundwork for the subsequent patches in this bug report.

One minor benefit: an Id of 0 no longer prevents
round-tripping a grabbagged richText content control
(although I don't know what would create such a file. We don't).

Both Id and the Token can technically be non-existant,
so (especially for SdtPrToken) it should be useful to know
whether they are at their set value,
or whether they don't exist.

The SdtPrToken will not exist
if it is the most common type: richText.
It seems useful to indicate this by setting to zero,
so that we can easily know the content control type
without always checking whether a full grabbagged SDT exists.

(Things are a bit more complicated here,
because MS Word implicitly treats richText as plainText
if there are DataBindings.
It seemed best to explicitly 'force' w:text in that case.)

Knowing whether these were specified is especially important because
these variables determine whether this is a full grabbagged Sdt.
We tested whether m_nId || m_nSdtPrToken are non-zero.
Better if we do that by checking if they are non-existant.

Note that MS Word never writes out an w:id of zero.
It accepts zero as non-corrupt input, but then gives it a random value.

LO simply does not export any Id if it is zero.
Providing a w:id is NOT required (at least it is not corrupt).

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 47d96476146f..e8b89fd35296 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -774,15 +774,15 @@ void SdtBlockHelper::clearGrabbagValues()
 if (!m_aAppearance.isEmpty())
 m_aAppearance.clear();
 m_bShowingPlaceHolder = false;
-m_nId = 0;
-m_nSdtPrToken = 0;
+m_oId = std::nullopt;
+m_oSdtPrToken = std::nullopt;
 m_nTabIndex = 0;
 }
 
 void SdtBlockHelper::WriteSdtBlock(const ::sax_fastparser::FSHelperPtr& 
pSerializer, bool bRunTextIsOn, bool bParagraphHasDrawing)
 {
-if (!m_nSdtPrToken && !m_pDataBindingAttrs.is() && !m_nId)
-return;
+if (!m_oSdtPrToken.has_value())
+return; // not a full Sdt definition
 
 // sdt start mark
 pSerializer->mark(DocxAttributeOutput::Tag_WriteSdtBlock);
@@ -794,32 +794,32 @@ void SdtBlockHelper::WriteSdtBlock(const 
::sax_fastparser::FSHelperPtr& pSeriali
 
 WriteExtraParams(pSerializer);
 
-if (m_nSdtPrToken && m_pTokenChildren.is())
+if (m_oSdtPrToken.has_value() && *m_oSdtPrToken && m_pTokenChildren.is())
 {
 if (!m_pTokenAttributes.is())
-pSerializer->startElement(m_nSdtPrToken);
+pSerializer->startElement(*m_oSdtPrToken);
 else
 {
-pSerializer->startElement(m_nSdtPrToken, 
detachFrom(m_pTokenAttributes));
+pSerializer->startElement(*m_oSdtPrToken, 
detachFrom(m_pTokenAttributes));
 }
 
-assert(m_nSdtPrToken != FSNS(XML_w, XML_date) && "date is never 
grabbagged, so SdtPrToken is never set to date");
-if (/*m_nSdtPrToken == FSNS(XML_w, XML_date) ||*/ m_nSdtPrToken == 
FSNS(XML_w, XML_docPartObj) || m_nSdtPrToken == FSNS(XML_w, XML_docPartList) || 
m_nSdtPrToken == FSNS(XML_w14, XML_checkbox)) {
+assert(m_oSdtPrToken != FSNS(XML_w, XML_date) && "date is never 
grabbagged, so SdtPrToken is never set to date");
+if (/* m_oSdtPrToken == FSNS(XML_w, XML_date) ||*/ m_oSdtPrToken == 
FSNS(XML_w, XML_docPartObj) || m_oSdtPrToken == FSNS(XML_w, XML_docPartList) || 
m_oSdtPrToken == FSNS(XML_w14, XML_checkbox)) {
 for (auto& it : *m_pTokenChildren)
 {
 pSerializer->singleElement(it.getToken(), FSNS(XML_w, 
XML_val), it.toCString());
 }
 }
 
-pSerializer->endElement(m_nSdtPrToken);
+pSerializer->endElement(*m_oSdtPrToken);
 }
-else if (m_nSdtPrToken && !(bRunTextIsOn && bParagraphHasDrawing))
+else if (m_oSdtPrToken.has_value() && *m_oSdtPrToken && !(bRunTextIsOn && 
bParagraphHasDrawing))
 {
 if (!m_pTokenAttributes.is())
-pSerializer->singleElement(m_nSdtPrToken);
+pSerializer->si

core.git: sw/source

2026-02-20 Thread ayagamal-tech (via logerrit)
 sw/source/core/unocore/unotbl.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 6472a50585e31d99774e0dba9259be116d8ac88f
Author: ayagamal-tech 
AuthorDate: Wed Feb 4 17:13:28 2026 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Fri Feb 20 16:35:21 2026 +0100

tdf#42982 Improve UNO API error reporting in sw/unotbl.cxx

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

diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index a48f53fbbc44..26e9e0682cb7 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -910,7 +910,7 @@ sal_Int32 SwXCell::getError()
 rtl::Reference< SwXTextCursor > SwXCell::createXTextCursor()
 {
 if(!m_pStartNode && !IsValid())
-throw uno::RuntimeException();
+throw uno::RuntimeException("Cannot create TextCursor: The table cell 
is invalid and disposed.", getXWeak());
 const SwStartNode* pSttNd = m_pStartNode ? m_pStartNode : 
m_pBox->GetSttNd();
 SwPosition aPos(*pSttNd);
 rtl::Reference const pXCursor =
@@ -924,7 +924,7 @@ rtl::Reference 
SwXCell::createXTextCursorByRange(const uno::Refer
 {
 SwUnoInternalPaM aPam(*GetDoc());
 if(!::sw::XTextRangeToSwPaM(aPam, xTextPosition))
-throw uno::RuntimeException();
+throw uno::RuntimeException("Cannot create TextCursor by range: The 
text range is invalid.", getXWeak());
 return createXTextCursorByRangeImpl(aPam);
 }
 
@@ -932,7 +932,7 @@ rtl::Reference< SwXTextCursor > 
SwXCell::createXTextCursorByRangeImpl(
 SwUnoInternalPaM& rPam)
 {
 if(!m_pStartNode && !IsValid())
-throw uno::RuntimeException();
+throw uno::RuntimeException("Cannot create TextCursor by range: The 
cell is invalid and disposed.", getXWeak());
 const SwStartNode* pSttNd = m_pStartNode ? m_pStartNode : 
m_pBox->GetSttNd();
 // skip sections
 SwStartNode* p1 = rPam.GetPointNode().StartOfSectionNode();


core.git: sw/source

2026-02-20 Thread shark (via logerrit)
 sw/source/filter/ww8/writerhelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a5fa7137291a9f223ac6cfd325403f6dee09303e
Author: shark 
AuthorDate: Sat Jan 17 17:48:41 2026 +
Commit: Ilmari Lauhakangas 
CommitDate: Fri Feb 20 12:55:47 2026 +0100

tdf#170270 Use std::ranges::copy_if instead of std::copy_if in sw

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

diff --git a/sw/source/filter/ww8/writerhelper.cxx 
b/sw/source/filter/ww8/writerhelper.cxx
index e8500f6dfc9b..9f6e4b15f15c 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -508,7 +508,7 @@ namespace sw
 ww8::Frames GetFramesInNode(const ww8::Frames &rFrames, const SwNode 
&rNode)
 {
 ww8::Frames aRet;
-std::copy_if(rFrames.begin(), rFrames.end(),
+std::ranges::copy_if(rFrames,
 std::back_inserter(aRet), anchoredto(rNode));
 return aRet;
 }


core.git: sw/source

2026-02-20 Thread Caolán McNamara (via logerrit)
 sw/source/ui/table/convert.cxx   |   17 -
 sw/source/uibase/inc/convert.hxx |2 +-
 2 files changed, 13 insertions(+), 6 deletions(-)

New commits:
commit 7878dd3d59227626cdb8cbea232ca42c7364cdec
Author: Caolán McNamara 
AuthorDate: Thu Feb 19 17:43:29 2026 +
Commit: Caolán McNamara 
CommitDate: Fri Feb 20 11:30:19 2026 +0100

cid#1681346 Improper use of negative value

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

diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx
index 108b821c55d1..defb1597ca42 100644
--- a/sw/source/ui/table/convert.cxx
+++ b/sw/source/ui/table/convert.cxx
@@ -94,7 +94,7 @@ void SwConvertTableDlg::GetValues(sal_Unicode& rDelim, 
SwInsertTableOptions& rIn
 SwConvertTableDlg::SwConvertTableDlg(SwView& rView, bool bToTable)
 : SfxDialogController(rView.GetFrameWeld(), 
u"modules/swriter/ui/converttexttable.ui"_ustr,
   u"ConvertTextTableDialog"_ustr)
-, m_nIndex(0)
+, m_nIndex(-1)
 , m_bCoreDataChanged(false)
 , m_xTableTable(new SwTableAutoFormatTable)
 , m_xTabBtn(m_xBuilder->weld_radio_button(u"tabs"_ustr))
@@ -196,9 +196,11 @@ void SwConvertTableDlg::Init()
 m_xBtnNumFormat->connect_toggled(aLk);
 
 m_xLbFormat->connect_selection_changed(LINK(this, SwConvertTableDlg, 
SelFormatHdl));
-m_nIndex = 0;
 
-for (sal_uInt8 i = 0, nCount = 
static_cast(m_xTableTable->size()); i < nCount; i++)
+size_t nCount = m_xTableTable->size();
+m_nIndex = nCount ? 0 : -1;
+
+for (size_t i = 0; i < nCount; ++i)
 {
 SwTableAutoFormat const& rFormat = (*m_xTableTable)[i];
 m_xLbFormat->append_text(rFormat.GetName().toString());
@@ -230,7 +232,7 @@ void SwConvertTableDlg::UpdateChecks(const 
SwTableAutoFormat& rFormat, bool bEna
 
 std::unique_ptr SwConvertTableDlg::FillAutoFormatOfIndex() 
const
 {
-if (255 != m_nIndex)
+if (m_nIndex != -1)
 {
 return std::make_unique((*m_xTableTable)[m_nIndex]);
 }
@@ -240,7 +242,7 @@ std::unique_ptr 
SwConvertTableDlg::FillAutoFormatOfIndex() co
 
 IMPL_LINK(SwConvertTableDlg, CheckHdl, weld::Toggleable&, rBtn, void)
 {
-if (m_nIndex == 255)
+if (m_nIndex != -1)
 return;
 
 SwTableAutoFormat& rData = (*m_xTableTable)[m_nIndex];
@@ -274,6 +276,11 @@ IMPL_LINK(SwConvertTableDlg, CheckHdl, weld::Toggleable&, 
rBtn, void)
 IMPL_LINK_NOARG(SwConvertTableDlg, SelFormatHdl, weld::TreeView&, void)
 {
 m_nIndex = m_xLbFormat->get_selected_index();
+if (m_nIndex == -1)
+{
+SAL_WARN("sw.ui", "No entry selected");
+return;
+}
 
m_aWndPreview.NotifyChange(m_xTableTable->GetResolvedStyle(m_xTableTable->GetData(m_nIndex)));
 UpdateChecks((*m_xTableTable)[m_nIndex], true);
 mxTAutoFormat = FillAutoFormatOfIndex();
diff --git a/sw/source/uibase/inc/convert.hxx b/sw/source/uibase/inc/convert.hxx
index b458bf0d1073..80ca19e0bce3 100644
--- a/sw/source/uibase/inc/convert.hxx
+++ b/sw/source/uibase/inc/convert.hxx
@@ -38,7 +38,7 @@ struct SwInsertTableOptions;
 
 class SwConvertTableDlg final : public SfxDialogController
 {
-sal_uInt8 m_nIndex;
+int m_nIndex;
 bool m_bCoreDataChanged : 1;
 
 std::unique_ptr m_xTableTable;


core.git: sw/source

2026-02-19 Thread Caolán McNamara (via logerrit)
 sw/source/core/docnode/ndtbl.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit af326f015f4cd71a0eceb1d026d4cfd1ccb17094
Author: Caolán McNamara 
AuthorDate: Thu Feb 19 17:24:42 2026 +
Commit: Caolán McNamara 
CommitDate: Thu Feb 19 21:02:04 2026 +0100

cid#1681350 Uninitialized scalar field

since:

commit 513bfbd476113f648090a8275cece4dc04ba0463
Date:   Wed Aug 20 15:58:21 2025 +0530

Writer: Adapt 'SvxAutoFormat'

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

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 53b3af1d3140..7e95a24fa8f5 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -3921,6 +3921,7 @@ struct SetAFormatTabPara
 , pUndo(nullptr)
 , nEndBox(0)
 , nCurBox(0)
+, nEndLine(0)
 , nAFormatLine(0)
 , nAFormatBox(0)
 , bSingleRowTable(false)


core.git: sw/source

2026-02-19 Thread Xisco Fauli (via logerrit)
 sw/source/core/text/txtfly.cxx |   19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit 81f9c593a4c49c87ba56792ae1f21692d96f87e6
Author: Xisco Fauli 
AuthorDate: Thu Feb 19 10:43:52 2026 +0100
Commit: Xisco Fauli 
CommitDate: Thu Feb 19 16:30:50 2026 +0100

sw: silence warning C6011: Dereferencing NULL pointer 'pFlyFrame->Lower()'


E:/jenkins/workspace/lo_tb_master_win_analyze/sw/source/core/text/txtfly.cxx(1430):
 error C2220: the following warning is treated as an error
E:\jenkins\workspace\lo_tb_master_win_analyze\sw\source
Change-Id: I48aee6e10f169997a23f0b1498ce009c07c2013e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199706
Reviewed-by: Xisco Fauli 
Tested-by: Jenkins

diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 2530e8a62080..2046b557d36b 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -1378,16 +1378,19 @@ SwRect SwTextFly::AnchoredObjToRect( const 
SwAnchoredObject* pAnchoredObj,
 
 if (auto pFlyFrame = pAnchoredObj->DynCastFlyFrame())
 {
-if (pFlyFrame->IsFlySplitAllowed() && pFlyFrame->Lower())
+if (pFlyFrame->IsFlySplitAllowed())
 {
-// The floating table could be too tall for its fly frame at this 
point, because the
-// fly's Grow_ would limit to only available space. Take the 
excessive height into
-// account here, so that the line can be forced to move to next 
page (via SwFlyPortion).
-
-auto aLowerHeight = 
aRectFnSet.GetHeight(pFlyFrame->Lower()->getFrameArea());
-if (aLowerHeight > aRectFnSet.GetHeight(aFly))
+if (const SwFrame* pLower =  pFlyFrame->Lower())
 {
-aRectFnSet.SetHeight(aFly, aLowerHeight);
+// The floating table could be too tall for its fly frame at 
this point, because the
+// fly's Grow_ would limit to only available space. Take the 
excessive height into
+// account here, so that the line can be forced to move to 
next page (via SwFlyPortion).
+
+auto aLowerHeight = 
aRectFnSet.GetHeight(pLower->getFrameArea());
+if (aLowerHeight > aRectFnSet.GetHeight(aFly))
+{
+aRectFnSet.SetHeight(aFly, aLowerHeight);
+}
 }
 }
 }


core.git: sw/source

2026-02-18 Thread Mike Kaganski (via logerrit)
 sw/source/core/layout/tabfrm.cxx |   21 -
 sw/source/core/text/txtfly.cxx   |   16 
 2 files changed, 16 insertions(+), 21 deletions(-)

New commits:
commit 4d5a536685a8c83be6c602d18c074074b71bfe42
Author: Mike Kaganski 
AuthorDate: Thu Feb 19 09:07:17 2026 +0500
Commit: Mike Kaganski 
CommitDate: Thu Feb 19 08:29:43 2026 +0100

tdf#170846: Use tall SwTextFly/SwFlyPortion to move floating table forward

Again try to avoid InsertMovedFwdFrame for floating tables (after commit
52172dbd3e290fb92fd8169803c6df5498990466). This time, take into account
that a fly frame may be shorter than its table, because SwFlyFrame::Grow_
will limit to the available space. In this case, when the table cannot
split, it must move forward as a whole; but the fly's height is small
enough to fit in the available space. Previously, table's MoveFwd was
used to force the move - which started a complex sequence of finding the
next fly; creating it on the next page by splitting the anchor; moving
the table; removing the now-empty master fly; merging the split anchor
(and possibly starting oscillations in the process). Then, in the commit
52172dbd3e290fb92fd8169803c6df5498990466, InsertMovedFwdFrame was used
to force move of anchor forward - but that's a hack, which could prevent
normal reflow.

With this change, the move forward is expected to happen because last
line height will calculate too high (taking into account not only the
fly height itself, but also its table). For flys correctly matching
their tables, nothing would change; but for too short flys, the correct
height will force the normal mechanism of "line is too high -> move it
forward".

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

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index c61b39a6c02f..23c8337b4e55 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -3287,27 +3287,6 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 {
 // Don't try to move floating table forward. It's done 
elsewhere moving its fly.
 bSkipMoveFwd = true;
-// Only limit the InsertMovedFwdFrame hack to non-split 
floating tables for now:
-// it seems that split tables don't need it.
-if (!IsFollow() && !HasFollow())
-{
-// This floating table doesn't fit on this page. 
Instead of the complex
-// MoveFwd sequence (split anchor, create follow fly, 
move table, destroy
-// old fly, merge anchor - which may oscillate), 
signal the anchor to move
-// forward. The fly will follow.
-SwTextFrame* pAnchor = 
pFlyFrame->FindAnchorCharFrame();
-if (pAnchor)
-{
-SwPageFrame* pPage = pAnchor->FindPageFrame();
-if (pPage)
-{
-
SwLayouter::InsertMovedFwdFrame(pPage->GetFormat()->GetDoc(),
-*pAnchor,
-
pPage->GetPhyPageNum() + 1);
-pAnchor->InvalidatePos();
-}
-}
-}
 }
 }
 // don't make the effort to move fwd if its known
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index fba5e1b06120..2530e8a62080 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -1376,6 +1376,22 @@ SwRect SwTextFly::AnchoredObjToRect( const 
SwAnchoredObject* pAnchoredObj,
 if( !aFly.Width() )
 return aFly;
 
+if (auto pFlyFrame = pAnchoredObj->DynCastFlyFrame())
+{
+if (pFlyFrame->IsFlySplitAllowed() && pFlyFrame->Lower())
+{
+// The floating table could be too tall for its fly frame at this 
point, because the
+// fly's Grow_ would limit to only available space. Take the 
excessive height into
+// account here, so that the line can be forced to move to next 
page (via SwFlyPortion).
+
+auto aLowerHeight = 
aRectFnSet.GetHeight(pFlyFrame->Lower()->getFrameArea());
+if (aLowerHeight > aRectFnSet.GetHeight(aFly))
+{
+aRectFnSet.SetHeight(aFly, aLowerHeight);
+}
+}
+}
+
 // so the line may grow up to the lower edge of the frame
 SetNextTop( aRectFnSet.GetBottom(aFly) );
 SwAnchoredObjList::size_type 

core.git: sw/source

2026-02-18 Thread Michael Weghorn (via logerrit)
 sw/source/core/access/AccessibilityIssue.cxx |   25 -
 1 file changed, 12 insertions(+), 13 deletions(-)

New commits:
commit ed50960724fa6fa5ed1106783ffcd175c5298d76
Author: Michael Weghorn 
AuthorDate: Tue Feb 17 16:48:47 2026 +0100
Commit: Michael Weghorn 
CommitDate: Wed Feb 18 16:43:17 2026 +0100

tdf#158280 Use SvxNameDialog directly in AccessibilityIssue

As mentioned in previous commit

Change-Id: I26023712b09bcd7c303053e88cce40a3e1cae964
Author: Michael Weghorn 
Date:   Tue Feb 17 15:43:22 2026 +0100

tdf#158280 Move SvxNameDialog etc. from cui to svtools

, SvxNameDialog can now be used directly instead
of via the AbstractSvxNameDialog abstraction.

Do so in AccessibilityIssue::quickFixIssue.

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

diff --git a/sw/source/core/access/AccessibilityIssue.cxx 
b/sw/source/core/access/AccessibilityIssue.cxx
index 9633d7db4350..0940484298a5 100644
--- a/sw/source/core/access/AccessibilityIssue.cxx
+++ b/sw/source/core/access/AccessibilityIssue.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -339,12 +340,11 @@ void AccessibilityIssue::quickFixIssue() const
 case IssueObject::HYPERLINKTEXT:
 case IssueObject::HYPERLINKFLY:
 {
-SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
 SwWrtShell* pWrtShell = pShell->GetWrtShell();
-ScopedVclPtr 
aNameDialog(pFact->CreateSvxNameDialog(
-pWrtShell->GetView().GetFrameWeld(), OUString(), 
SwResId(STR_HYPERLINK_NO_NAME_DLG),
-SwResId(STR_HYPERLINK_NO_NAME_DLG)));
-if (aNameDialog->Execute() == RET_OK)
+SvxNameDialog aNameDialog(pWrtShell->GetView().GetFrameWeld(), 
OUString(),
+  SwResId(STR_HYPERLINK_NO_NAME_DLG),
+  SwResId(STR_HYPERLINK_NO_NAME_DLG));
+if (aNameDialog.run() == RET_OK)
 {
 if (m_eIssueObject == IssueObject::HYPERLINKTEXT)
 {
@@ -357,7 +357,7 @@ void AccessibilityIssue::quickFixIssue() const
 && 
xRun->getPropertySetInfo()->hasPropertyByName(u"HyperLinkName"_ustr))
 {
 xRun->setPropertyValue(u"HyperLinkName"_ustr,
-   
uno::Any(aNameDialog->GetName()));
+   
uno::Any(aNameDialog.GetName()));
 }
 }
 else
@@ -367,7 +367,7 @@ void AccessibilityIssue::quickFixIssue() const
 if (pFlyFormat)
 {
 SwFormatURL item{ pFlyFormat->GetURL() };
-item.SetName(aNameDialog->GetName());
+item.SetName(aNameDialog.GetName());
 SwAttrSet set{ m_pDoc->GetAttrPool(), 
svl::Items };
 set.Put(item);
 m_pDoc->SetFlyFrameAttr(*pFlyFormat, set);
@@ -379,18 +379,17 @@ void AccessibilityIssue::quickFixIssue() const
 break;
 case IssueObject::DOCUMENT_TITLE:
 {
-SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
 SwWrtShell* pWrtShell = pShell->GetWrtShell();
-ScopedVclPtr 
aNameDialog(pFact->CreateSvxNameDialog(
-pWrtShell->GetView().GetFrameWeld(), OUString(),
-SwResId(STR_DOCUMENT_TITLE_DLG_DESC), 
SwResId(STR_DOCUMENT_TITLE_DLG_TITLE)));
-if (aNameDialog->Execute() == RET_OK)
+SvxNameDialog aNameDialog(pWrtShell->GetView().GetFrameWeld(), 
OUString(),
+  SwResId(STR_DOCUMENT_TITLE_DLG_DESC),
+  SwResId(STR_DOCUMENT_TITLE_DLG_TITLE));
+if (aNameDialog.run() == RET_OK)
 {
 const uno::Reference 
xDPS(
 pShell->GetModel(), uno::UNO_QUERY_THROW);
 const uno::Reference 
xDocumentProperties(
 xDPS->getDocumentProperties());
-xDocumentProperties->setTitle(aNameDialog->GetName());
+xDocumentProperties->setTitle(aNameDialog.GetName());
 
 
m_pDoc->getOnlineAccessibilityCheck()->resetAndQueueDocumentLevel();
 }


core.git: sw/source

2026-02-17 Thread karthik (via logerrit)
 sw/source/core/docnode/ndtbl.cxx |   38 +-
 1 file changed, 13 insertions(+), 25 deletions(-)

New commits:
commit 4e3dfc1460aa7600643056f10b93f403c1454ffd
Author: karthik 
AuthorDate: Mon Feb 16 15:20:52 2026 +0530
Commit: Caolán McNamara 
CommitDate: Tue Feb 17 09:51:09 2026 +0100

sw: Fix memory leak in lcl_SetDfltBoxAttr

`DfltBoxAttrMap_t` is no longer needed as cache. This is related to
513bfbd476113f648090a8275cece4dc04ba0463

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

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index ed164d208cb5..53b3af1d3140 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -149,36 +149,24 @@ static void lcl_SetDfltBoxAttr( SwFrameFormat& rFormat, 
sal_uInt8 nId )
 typedef std::map DfltBoxAttrMap_t;
 typedef std::vector DfltBoxAttrList_t;
 
-static void lcl_SetDfltBoxAttr(SwTableBox& rBox, size_t row,
-   size_t col, size_t nRows, size_t nCols, 
sal_uInt8 const nId,
+static void lcl_SetDfltBoxAttr(SwTableBox& rBox, size_t row, size_t col, 
size_t nRows, size_t nCols,
+   sal_uInt8 const nId,
SwTableAutoFormat const* const pAutoFormat = 
nullptr)
 {
-DfltBoxAttrMap_t* pMap = new DfltBoxAttrMap_t;
-
-SwTableBoxFormat* pNewTableBoxFormat = nullptr;
 SwFrameFormat* pBoxFrameFormat = rBox.GetFrameFormat();
-DfltBoxAttrMap_t::iterator const iter(pMap->find(pBoxFrameFormat));
-if (pMap->end() != iter)
-{
-pNewTableBoxFormat = iter->second;
-}
-else
-{
-SwDoc& rDoc = pBoxFrameFormat->GetDoc();
-// format does not exist, so create it
-pNewTableBoxFormat = rDoc.MakeTableBoxFormat();
-pNewTableBoxFormat->SetFormatAttr( pBoxFrameFormat->GetAttrSet().Get( 
RES_FRM_SIZE ) );
 
-if( pAutoFormat )
-
pAutoFormat->UpdateToSet(const_cast(static_cast(
- pNewTableBoxFormat->GetAttrSet())),
- row, col, nRows, nCols, 
rDoc.GetNumberFormatter());
-else
-::lcl_SetDfltBoxAttr( *pNewTableBoxFormat, nId );
+SwDoc& rDoc = pBoxFrameFormat->GetDoc();
+SwTableBoxFormat* pNewTableBoxFormat = rDoc.MakeTableBoxFormat();
+
pNewTableBoxFormat->SetFormatAttr(pBoxFrameFormat->GetAttrSet().Get(RES_FRM_SIZE));
 
-(*pMap)[pBoxFrameFormat] = pNewTableBoxFormat;
-}
-rBox.ChgFrameFormat( pNewTableBoxFormat );
+if (pAutoFormat)
+
pAutoFormat->UpdateToSet(const_cast(static_cast(
+ pNewTableBoxFormat->GetAttrSet())),
+ row, col, nRows, nCols, 
rDoc.GetNumberFormatter());
+else
+::lcl_SetDfltBoxAttr(*pNewTableBoxFormat, nId);
+
+rBox.ChgFrameFormat(pNewTableBoxFormat);
 }
 
 static SwTableBoxFormat *lcl_CreateDfltBoxFormat( SwDoc &rDoc, 
std::vector &rBoxFormatArr,


core.git: sw/source

2026-02-17 Thread Stephan Bergmann (via logerrit)
 sw/source/filter/md/swmd.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 76836e39caf91e56bf63ec9cb2b1c1acf732e6b9
Author: Stephan Bergmann 
AuthorDate: Tue Feb 17 08:15:41 2026 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Feb 17 09:37:20 2026 +0100

Avoid heap-buffer-overflow internally in md4c

...as seen during CppunitTest_sw_filter_md,

> ==1418747==ERROR: AddressSanitizer: heap-buffer-overflow on address 
0x7b9a07967527 at pc 0x560f1d4a7b22 bp 0x7ffdd9a75f10 sp 0x7ffdd9a756d0
> READ of size 24 at 0x7b9a07967527 thread T0
>  #0 in strcspn at 
~/github.com/llvm/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:806:5
>  #1 in md_analyze_line at workdir/UnpackedTarball/md4c/src/md4c.c:6230:26
>  #2 in md_process_doc at workdir/UnpackedTarball/md4c/src/md4c.c:6404:18
>  #3 in md_parse at workdir/UnpackedTarball/md4c/src/md4c.c:6483:11
>  #4 in SwMarkdownParser::CallParser() at 
sw/source/filter/md/swmd.cxx:955:18
>  #5 in MarkdownReader::Read(SwDoc&, rtl::OUString const&, SwPaM&, 
rtl::OUString const&) at sw/source/filter/md/swmd.cxx:838:19
>  #6 in SwReader::Read(Reader const&) at 
sw/source/filter/basflt/shellio.cxx:209:26
>  #7 in SwDocShell::ConvertFrom(SfxMedium&) at 
sw/source/uibase/app/docsh.cxx:230:29
>  #8 in SfxObjectShell::DoLoad(SfxMedium*) at 
sfx2/source/doc/objstor.cxx:786:27
>  #9 in 
SfxBaseModel::load(com::sun::star::uno::Sequence
 const&) at sfx2/source/doc/sfxbasemodel.cxx:1982:36
>  #10 in (anonymous 
namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence
 const&, com::sun::star::uno::Reference const&) 
at sfx2/source/view/frmload.cxx:774:28
>  #11 in framework::LoadEnv::impl_loadContent() at 
framework/source/loadenv/loadenv.cxx:1180:37
>  #12 in framework::LoadEnv::start() at 
framework/source/loadenv/loadenv.cxx:416:20
>  #13 in framework::LoadEnv::startLoading(rtl::OUString const&, 
com::sun::star::uno::Sequence const&, 
com::sun::star::uno::Reference const&, 
rtl::OUString const&, int, LoadEnvFeatures) at 
framework/source/loadenv/loadenv.cxx:312:5
>  #14 in 
framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference
 const&, com::sun::star::uno::Reference 
const&, rtl::OUString const&, rtl::OUString const&, int, 
com::sun::star::uno::Sequence const&) at 
framework/source/loadenv/loadenv.cxx:168:14
>  #15 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, 
rtl::OUString const&, int, 
com::sun::star::uno::Sequence const&) at 
framework/source/services/desktop.cxx:594:16
>  #16 in non-virtual thunk to 
framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString 
const&, int, 
com::sun::star::uno::Sequence const&) at 
framework/source/services/desktop.cxx
>  #17 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, 
rtl::OUString const&, 
com::sun::star::uno::Sequence const&) at 
unotest/source/cpp/macros_test.cxx:75:62
>  #18 in UnoApiTest::loadFromURL(rtl::OUString const&, 
com::sun::star::uno::Sequence const&, 
char const*) at test/source/unoapi_test.cxx:271:19
>  #19 in SwModelTestBase::loadURL(rtl::OUString const&, 
com::sun::star::uno::Sequence const&, 
char const*) at sw/qa/unit/swmodeltestbase.cxx:382:5
>  #20 in SwModelTestBase::createSwDoc(char const*, 
com::sun::star::uno::Sequence const&, 
char const*) at sw/qa/unit/swmodeltestbase.cxx:423:9
>  #21 in testBlockQuoteMdImport::TestBody() at sw/qa/filter/md/md.cxx:418:5
>
> 0x7b9a07967527 is located 0 bytes after 23-byte region 
[0x7b9a07967510,0x7b9a07967527)
> allocated by thread T0 here:
>  #0 in operator new[](unsigned long) at 
~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:111:37
>  #1 in SwMarkdownParser::CallParser() at 
sw/source/filter/md/swmd.cxx:924:26
>  #2 in MarkdownReader::Read(SwDoc&, rtl::OUString const&, SwPaM&, 
rtl::OUString const&) at sw/source/filter/md/swmd.cxx:838:19
>  #3 in SwReader::Read(Reader const&) at 
sw/source/filter/basflt/shellio.cxx:209:26
>  #4 in SwDocShell::ConvertFrom(SfxMedium&) at 
sw/source/uibase/app/docsh.cxx:230:29
>  #5 in SfxObjectShell::DoLoad(SfxMedium*) at 
sfx2/source/doc/objstor.cxx:786:27
>  #6 in 
SfxBaseModel::load(com::sun::star::uno::Sequence
 const&) at sfx2/source/doc/sfxbasemodel.cxx:1982:36
>  #7 in (anonymous 
namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence
 const&, com::sun::star::uno::Reference const&) 
at sfx2/source/view/frmload.cxx:774:28
>  #8 in framework::LoadEnv::impl_loadContent() at 
framework/source/loadenv/loadenv.cxx:1180:37
>  #9 in framework::LoadEnv::start() at 
framework/source/loadenv/loadenv.cxx:416:20
>  #10 in framework::LoadEnv::startLoading(rtl::OUString const&, 
com::sun::star::uno::Sequence const&, 
com::sun::star::uno::Reference const&, 
rtl::OUString const&, int, LoadEnvFea

core.git: sw/source

2026-02-15 Thread Ujjawal Kumar (via logerrit)
 sw/source/filter/md/swmd.cxx |   98 +--
 1 file changed, 95 insertions(+), 3 deletions(-)

New commits:
commit d28d6d7ec71a119a71a975e35393f1857450b7b6
Author: Ujjawal Kumar 
AuthorDate: Wed Feb 11 17:05:25 2026 +0530
Commit: Thorsten Behrens 
CommitDate: Mon Feb 16 05:09:07 2026 +0100

Markdown: Handle different file encodings correctly

Change-Id: I0b7d3927b105b4b77b8e750d3c368c8708d11180
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199155
Reviewed-by: Thorsten Behrens 
Tested-by: Jenkins

diff --git a/sw/source/filter/md/swmd.cxx b/sw/source/filter/md/swmd.cxx
index 58346f778538..71ca58dbc443 100644
--- a/sw/source/filter/md/swmd.cxx
+++ b/sw/source/filter/md/swmd.cxx
@@ -58,6 +58,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include "swmd.hxx"
 
@@ -748,7 +751,6 @@ SwMarkdownParser::SwMarkdownParser(SwDoc& rD, SwPaM& 
rCursor, SvStream& rIn, OUS
 m_nFilesize = m_rInput.TellEnd();
 m_rInput.Seek(STREAM_SEEK_TO_BEGIN);
 m_rInput.ResetError();
-m_pArr.reset(new char[m_nFilesize + 1]);
 }
 
 void MarkdownReader::SetupFilterOptions(SwDoc& rDoc)
@@ -840,13 +842,103 @@ ErrCodeMsg MarkdownReader::Read(SwDoc& rDoc, const 
OUString& rBaseURL, SwPaM& rP
 
 ErrCode SwMarkdownParser::CallParser()
 {
+// use utf8
+rtl_TextEncoding eSrcEnc = RTL_TEXTENCODING_DONTKNOW;
+m_rInput.StartReadingUnicodeText(eSrcEnc);
+if (m_rInput.good())
+{
+sal_uInt64 nPos = m_rInput.Tell(); //bom size
+{
+std::vector buf(65535); // Arbitrarily chosen 64KiB buffer
+const size_t nSize = m_rInput.ReadBytes(buf.data(), buf.size());
+if (nSize > 0)
+{
+UErrorCode uerr = U_ZERO_ERROR;
+UCharsetDetector* ucd = ucsdet_open(&uerr);
+ucsdet_setText(ucd, buf.data(), nSize, &uerr);
+if (const UCharsetMatch* match = ucsdet_detect(ucd, &uerr))
+{
+const char* pEncodingName = ucsdet_getName(match, &uerr);
+
+if (strcmp("UTF-16LE", pEncodingName) == 0)
+{
+eSrcEnc = RTL_TEXTENCODING_UCS2;
+m_rInput.SetEndian(SvStreamEndian::LITTLE);
+}
+else if (strcmp("UTF-16BE", pEncodingName) == 0)
+{
+eSrcEnc = RTL_TEXTENCODING_UCS2;
+m_rInput.SetEndian(SvStreamEndian::BIG);
+}
+else
+{
+eSrcEnc = 
rtl_getTextEncodingFromMimeCharset(pEncodingName);
+}
+}
+ucsdet_close(ucd);
+}
+else
+{
+return ERRCODE_IO_INVALIDLENGTH;
+}
+}
+
+if (eSrcEnc == RTL_TEXTENCODING_DONTKNOW)
+return ERRCODE_IO_INVALIDCHAR;
+
+m_rInput.Seek(nPos);
+m_rInput.ResetError();
+m_nFilesize -= nPos;
+
+OUString sData;
+OString sUtf8Data;
+
+if (eSrcEnc == RTL_TEXTENCODING_UCS2)
+{
+if (m_nFilesize & 1)
+return ERRCODE_IO_INVALIDCHAR;
+
+tools::Long nChars = m_nFilesize / 2;
+std::vector aCharData(nChars);
+
+for (tools::Long n = 0; n < nChars; n++)
+{
+m_rInput.ReadUtf16(aCharData[n]);
+}
+
+sData = OUString(aCharData.data(), nChars);
+sUtf8Data = OUStringToOString(sData, RTL_TEXTENCODING_UTF8);
+}
+else
+{
+tools::Long nChars = m_nFilesize;
+std::vector aCharData(nChars);
+m_rInput.ReadBytes(aCharData.data(), nChars);
+sData = OUString(aCharData.data(), nChars, eSrcEnc);
+sUtf8Data = OUStringToOString(sData, RTL_TEXTENCODING_UTF8);
+}
+
+if (sUtf8Data.getLength())
+{
+m_nFilesize = sUtf8Data.getLength();
+m_pArr.reset(new char[m_nFilesize]);
+memcpy(m_pArr.get(), sUtf8Data.getStr(), m_nFilesize);
+}
+else
+{
+return ERRCODE_IO_INVALIDCHAR;
+}
+}
+else
+{
+return ERRCODE_IO_INVALIDCHAR;
+}
+
 ::StartProgress(STR_STATSTR_W4WREAD, 0, m_nFilesize, 
m_xDoc->GetDocShell());
 
 SwTextFormatColl* pColl
 = 
m_xDoc->getIDocumentStylePoolAccess().GetTextCollFromPool(SwPoolFormatId::COLL_TEXT);
 m_xDoc->SetTextFormatColl(*m_pPam, pColl);
-m_rInput.ReadBytes(m_pArr.get(), m_nFilesize);
-m_pArr[m_nFilesize] = '
 
 ErrCode nRet;
 


core.git: sw/source

2026-02-15 Thread Mo Amr (via logerrit)
 sw/source/core/bastyp/swregion.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit c103294b733961e9ddc551b9b97b9b605ef0e09a
Author: Mo Amr 
AuthorDate: Thu Feb 12 13:16:21 2026 +
Commit: Hossein 
CommitDate: Sun Feb 15 11:09:53 2026 +0100

tdf#158337 use C++20 std::erase_if in sw

Use C++20 std::erase_if instead of std::remove_if and resize to simplify

Change-Id: I30341b66927ad4ddbb63a8b1ca66191a2d499070
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199273
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sw/source/core/bastyp/swregion.cxx 
b/sw/source/core/bastyp/swregion.cxx
index b790bf14764f..97e271811ab8 100644
--- a/sw/source/core/bastyp/swregion.cxx
+++ b/sw/source/core/bastyp/swregion.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+
 #include 
 #include 
 #include 
@@ -218,7 +220,7 @@ void SwRegionRects::Compress( CompressType type )
 // Instead of repeated erase() we Width(0) the elements, and now erase
 // all empty elements just once.
 if( bRemoved )
-resize( std::remove_if(begin(), end(), [](const SwRect& rect) { 
return rect.IsEmpty(); }) - begin());
+std::erase_if(*this , [](const SwRect& rect) { return 
rect.IsEmpty(); }) ;
 // Code paths setting bAgain alter elements of the vector, possibly 
breaking
 // the Y-axis optimization, so run another pass just to make sure. The 
adjacent-rects
 // merging code may possibly benefit from a repeated pass also if two 
pairs of merged


core.git: sw/source

2026-02-13 Thread Mike Kaganski (via logerrit)
 sw/source/writerfilter/rtftok/rtftokenizer.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 4fec22a9937d2a826e17fb053b4a99222c146756
Author: Mike Kaganski 
AuthorDate: Fri Feb 13 11:15:49 2026 +0100
Commit: Mike Kaganski 
CommitDate: Fri Feb 13 19:06:03 2026 +0100

Use rtl::isAsciiHexDigit instead of manual check

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

diff --git a/sw/source/writerfilter/rtftok/rtftokenizer.cxx 
b/sw/source/writerfilter/rtftok/rtftokenizer.cxx
index 0f3829e7dd95..13ca17381147 100644
--- a/sw/source/writerfilter/rtftok/rtftokenizer.cxx
+++ b/sw/source/writerfilter/rtftok/rtftokenizer.cxx
@@ -2043,8 +2043,7 @@ RTFError RTFTokenizer::resolveParse()
 {
 SAL_INFO("writerfilter.rtf", __func__ << ": hex 
internal state");
 // Assume that \' means \'0.
-if (rtl::isAsciiDigit(static_cast(ch))
-|| (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 
'F'))
+if (rtl::isAsciiHexDigit(static_cast(ch)))
 {
 b = b << 4;
 sal_Int8 parsed = o3tl::convertToHex(ch);


core.git: sw/source

2026-02-13 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/shells/grfsh.cxx |   39 +-
 1 file changed, 22 insertions(+), 17 deletions(-)

New commits:
commit 6c28e1f133c8f41728b810dee044ab38d26d21ce
Author: Caolán McNamara 
AuthorDate: Mon Jan 26 16:40:15 2026 +
Commit: Caolán McNamara 
CommitDate: Fri Feb 13 15:31:39 2026 +0100

make the writer CompressGraphicsDialog async

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

diff --git a/sw/source/uibase/shells/grfsh.cxx 
b/sw/source/uibase/shells/grfsh.cxx
index 75a1c9b0ffca..2a6b8fcad429 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -204,27 +204,32 @@ void SwGrfShell::Execute(SfxRequest &rReq)
 
 Graphic aGraphic = *pGraphic;
 
-CompressGraphicsDialog aDialog(GetView().GetFrameWeld(), 
std::move(aGraphic), aSize, aCropRectangle, 
GetView().GetViewFrame().GetBindings());
-if (aDialog.run() == RET_OK)
-{
-rSh.StartAllAction();
-rSh.StartUndo(SwUndoId::START);
-tools::Rectangle aScaledCropedRectangle = 
aDialog.GetScaledCropRectangle();
+auto xDialog = 
std::make_shared(GetView().GetFrameWeld(), 
std::move(aGraphic), aSize, aCropRectangle, 
GetView().GetViewFrame().GetBindings());
+weld::DialogController::runAsync(xDialog, [this, xDialog, 
aCrop, aMirror](sal_uInt32 nResult) {
+if (nResult == RET_OK)
+{
+SwWrtShell& rShell = GetShell();
 
-aCrop.SetLeft(   o3tl::toTwips( 
aScaledCropedRectangle.Left(), o3tl::Length::mm100 ));
-aCrop.SetTop(o3tl::toTwips( 
aScaledCropedRectangle.Top(), o3tl::Length::mm100 ));
-aCrop.SetRight(  o3tl::toTwips( 
aScaledCropedRectangle.Right(), o3tl::Length::mm100 ));
-aCrop.SetBottom( o3tl::toTwips( 
aScaledCropedRectangle.Bottom(), o3tl::Length::mm100 ));
+rShell.StartAllAction();
+rShell.StartUndo(SwUndoId::START);
+tools::Rectangle aScaledCropedRectangle = 
xDialog->GetScaledCropRectangle();
 
-Graphic aCompressedGraphic( aDialog.GetCompressedGraphic() 
);
-rSh.ReRead(OUString(), OUString(), &aCompressedGraphic);
+SwCropGrf aNewCrop(aCrop);
+aNewCrop.SetLeft(o3tl::toTwips( 
aScaledCropedRectangle.Left(), o3tl::Length::mm100));
+aNewCrop.SetTop(o3tl::toTwips( 
aScaledCropedRectangle.Top(), o3tl::Length::mm100));
+aNewCrop.SetRight(o3tl::toTwips( 
aScaledCropedRectangle.Right(), o3tl::Length::mm100));
+aNewCrop.SetBottom(o3tl::toTwips( 
aScaledCropedRectangle.Bottom(), o3tl::Length::mm100));
 
-rSh.SetAttrItem(aCrop);
-rSh.SetAttrItem(aMirror);
+Graphic aCompressedGraphic( 
xDialog->GetCompressedGraphic() );
+rShell.ReRead(OUString(), OUString(), 
&aCompressedGraphic);
 
-rSh.EndUndo(SwUndoId::END);
-rSh.EndAllAction();
-}
+rShell.SetAttrItem(aNewCrop);
+rShell.SetAttrItem(aMirror);
+
+rShell.EndUndo(SwUndoId::END);
+rShell.EndAllAction();
+}
+});
 }
 }
 break;


core.git: sw/source

2026-02-13 Thread Noel Grandin (via logerrit)
 sw/source/core/doc/DocumentContentOperationsManager.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d41d07b3eb875345451c789f3b6ab8f3f028d367
Author: Noel Grandin 
AuthorDate: Tue Feb 10 15:26:29 2026 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 13 09:46:59 2026 +0100

tdf#170595 we can reduce re-alloc a little here

by sizing the vector up front

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

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index b6664477f370..e05e9390fc71 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -4151,6 +4151,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl(
 // They are stored as matching the originals, so that we will be later
 // able to build the chains accordingly.
 std::vector< SwFrameFormat* > aVecSwFrameFormat;
+aVecSwFrameFormat.reserve(aSet.size());
 std::set< ZSortFly >::const_iterator it=aSet.begin();
 
 while (it != aSet.end())


core.git: sw/source

2026-02-12 Thread Dennis Francis (via logerrit)
 sw/source/uibase/table/tablemgr.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 711aed772115cdcddfd0f411e9ca17e8a55dcdd3
Author: Dennis Francis 
AuthorDate: Mon Feb 9 22:54:55 2026 +0530
Commit: Dennis Francis 
CommitDate: Thu Feb 12 18:28:22 2026 +0100

lok: sw: chart wizard updates the chart only...

... if the chart is activated like it is done in the desktop version.

To reproduce:
1. Create a .odt file
2. Create a 2x2 table and insert data (first col can be a, b; second 
col can be 1, 2)
3. Select the data, click insert Chart.
4. Change chart type to a pie chart.

What actually happens:
The chart shown in the document is still showing a column chart,
that is the chart is not updated.

What should happen:
The chart shown must change to a pie chart type.

Note: Chart wizard never worked properly after jsdialog migration.

Signed-off-by: Dennis Francis 
Change-Id: Ic569424b12323283105320fa62037f337b848847
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199066
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit eeb5f37e264c9f9a93fd3b99d58a09f67d217577)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199137
Tested-by: Jenkins

diff --git a/sw/source/uibase/table/tablemgr.cxx 
b/sw/source/uibase/table/tablemgr.cxx
index cebeb659987d..f7a7ab13f97a 100644
--- a/sw/source/uibase/table/tablemgr.cxx
+++ b/sw/source/uibase/table/tablemgr.cxx
@@ -230,10 +230,9 @@ uno::Reference< frame::XModel > SwTableFUNC::InsertChart(
 }
 m_pSh->EndAllAction();
 
-if (xObj.is() && !comphelper::LibreOfficeKit::isActive())
+if (xObj.is())
 {
-// Let the chart be activated after the inserting (unless
-// via LibreOfficeKit)
+// Let the chart be activated after the inserting
 SfxInPlaceClient* pClient = m_pSh->GetView().FindIPClient( xObj, 
&m_pSh->GetView().GetEditWin() );
 if ( !pClient )
 {


core.git: sw/source

2026-02-12 Thread Dennis Francis (via logerrit)
 sw/source/uibase/table/chartins.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 6ed87188ac24816b735adcc6448190ac02811a11
Author: Dennis Francis 
AuthorDate: Mon Feb 9 22:52:36 2026 +0530
Commit: Dennis Francis 
CommitDate: Thu Feb 12 14:28:20 2026 +0100

lok: sw: empty parent causes irresponsive chart jsdialog

Clicking any of the chart wizard buttons 'Next', 'Cancel', 'Finish' etc
does not perform any action.

With this patch the wizard buttons when clicked performs corresponding
actions.

To reproduce:
1. Create a .odt file
2. Create a 2x2 table and insert data (first col can be a, b; second col 
can be 1, 2)
3. Select the data, click insert Chart.
4. press Finish, The dialog is not closed.

Signed-off-by: Dennis Francis 
Change-Id: I5af8ba00a0b55b3d2ed10fa0f020ac21c4922afb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199065
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
(cherry picked from commit 5e0b9f2ac68100eac288d08a30154f41f8925656)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199136
Tested-by: Jenkins

diff --git a/sw/source/uibase/table/chartins.cxx 
b/sw/source/uibase/table/chartins.cxx
index 453e8ef03f44..473b48d24f19 100644
--- a/sw/source/uibase/table/chartins.cxx
+++ b/sw/source/uibase/table/chartins.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -174,10 +175,16 @@ SwInsertChart::SwInsertChart( const 
Link xInit( xDialog, uno::UNO_QUERY );
 if( xInit.is() )
 {
+css::uno::Reference< css::awt::XWindow > xParent;
+vcl::Window* pWin = rWrtShell.GetWin();
+if (pWin)
+{
+xParent = new weld::TransportAsXWindow(pWin->GetFrameWeld());
+}
 //  initialize dialog
 uno::Sequence aSeq(comphelper::InitAnyPropertySequence(
 {
-{"ParentWindow", uno::Any(uno::Reference< awt::XWindow >())},
+{"ParentWindow", uno::Any(xParent)},
 {"ChartModel", uno::Any(xChartModel)}
 }));
 xInit->initialize( aSeq );


core.git: sw/source

2026-02-12 Thread Caolán McNamara (via logerrit)
 sw/source/ui/dialog/uiregionsw.cxx |   38 +++--
 1 file changed, 20 insertions(+), 18 deletions(-)

New commits:
commit f30c893c9e2b56cd90a106a214a477179ce4c4d2
Author: Caolán McNamara 
AuthorDate: Mon Jan 19 11:34:56 2026 +
Commit: Caolán McNamara 
CommitDate: Thu Feb 12 12:27:51 2026 +0100

make writer section password dialog async

Change-Id: Icc65d0e68a2de01b7d34f0ee2768c8c510ebf1d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197578
Reviewed-by: Caolán McNamara 
Reviewed-by: Miklos Vajna 
Tested-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199262
Tested-by: Jenkins

diff --git a/sw/source/ui/dialog/uiregionsw.cxx 
b/sw/source/ui/dialog/uiregionsw.cxx
index ce3ec6df9519..5c3770d4ee09 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1661,25 +1661,27 @@ void SwInsertSectionTabPage::ChangePasswd(bool bChange)
 {
 if(!m_aNewPasswd.hasElements() || bChange)
 {
-SfxPasswordDialog aPasswdDlg(GetFrameWeld());
-aPasswdDlg.ShowExtras(SfxShowExtras::CONFIRM);
-if (RET_OK == aPasswdDlg.run())
-{
-const OUString sNewPasswd(aPasswdDlg.GetPassword());
-if (aPasswdDlg.GetConfirm() == sNewPasswd)
-{
-SvPasswordHelper::GetHashPassword( m_aNewPasswd, 
sNewPasswd );
-}
-else
-{
-std::shared_ptr 
xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
-  
VclMessageType::Info, VclButtonsType::Ok,
-  
SwResId(STR_WRONG_PASSWD_REPEAT)));
-xInfoBox->runAsync(xInfoBox, [](sal_uInt32) {});
+auto xPasswdDlg = 
std::make_shared(GetFrameWeld());
+xPasswdDlg->ShowExtras(SfxShowExtras::CONFIRM);
+xPasswdDlg->PreRun();
+weld::GenericDialogController::runAsync(xPasswdDlg, [xPasswdDlg, 
this, bChange](sal_Int32 nResult){
+if (nResult == RET_OK) {
+const OUString sNewPasswd(xPasswdDlg->GetPassword());
+if (xPasswdDlg->GetConfirm() == sNewPasswd)
+{
+SvPasswordHelper::GetHashPassword( m_aNewPasswd, 
sNewPasswd );
+}
+else
+{
+std::shared_ptr 
xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
+  
VclMessageType::Info, VclButtonsType::Ok,
+  
SwResId(STR_WRONG_PASSWD_REPEAT)));
+xInfoBox->runAsync(xInfoBox, [](sal_uInt32) {});
+}
 }
-}
-else if(!bChange)
-m_xPasswdCB->set_active(false);
+else if(!bChange)
+m_xPasswdCB->set_active(false);
+});
 }
 }
 else


core.git: sw/source

2026-02-11 Thread Miklos Vajna (via logerrit)
 sw/source/core/undo/undobj1.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 85415041a469cee0389244276dbd0035f81861a0
Author: Miklos Vajna 
AuthorDate: Tue Feb 10 10:45:31 2026 +0100
Commit: Miklos Vajna 
CommitDate: Wed Feb 11 10:22:50 2026 +0100

sw: fix crash in lcl_GetSwUndoId()

gdb on the crashreport core dump:

#0  SwNodeIndex::GetNodes (this=0x0) at sw/inc/ndindex.hxx:117
#1  SwNodeIndex::SwNodeIndex (nDiff=..., rIdx=..., 
this=0x7ffc29a667f0) at sw/inc/ndindex.hxx:67
#2  SwNodeIndex::SwNodeIndex (nDiff=1, rIdx=..., 
this=0x7ffc29a667f0) at sw/inc/ndindex.hxx:65
#3  lcl_GetSwUndoId (pFrameFormat=0x53c5c4e0) at 
sw/source/core/undo/undobj1.cxx:409
#4  SwUndoDelLayFormat::SwUndoDelLayFormat 
(this=this@entry=0x5477eb40, pFormat=pFormat@entry=0x53c5c4e0)
at sw/source/core/undo/undobj1.cxx:426

I.e. it's possible that in lcl_GetSwUndoId(), rContent.GetContentIdx()
returns a nullptr, so we can't unconditinally dereference that. Return
early with a SwUndoId::DELLAYFMT in that case, matching what would
happen if we would get a content index, which is not a graphic or OLE
node.

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

diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index e44a4519fc17..6c09ede713f4 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -405,6 +405,10 @@ lcl_GetSwUndoId(SwFrameFormat const *const pFrameFormat)
 {
 const SwFormatContent& rContent = pFrameFormat->GetContent();
 OSL_ENSURE( rContent.GetContentIdx(), "Fly without content" );
+if (!rContent.GetContentIdx())
+{
+return SwUndoId::DELLAYFMT;
+}
 
 SwNodeIndex firstNode(*rContent.GetContentIdx(), 1);
 SwNoTextNode *const pNoTextNode(firstNode.GetNode().GetNoTextNode());


core.git: sw/source

2026-02-11 Thread Noel Grandin (via logerrit)
 sw/source/filter/ww8/wrtw8nds.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit d254e813f49071c336dcd741b4da85d6066d8730
Author: Noel Grandin 
AuthorDate: Wed Feb 11 09:37:40 2026 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 11 09:38:30 2026 +0100

move var closer to use

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

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index fdbec62edf7e..e1c036339a92 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2548,7 +2548,6 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
 bool bTextAtr = aAttrIter.IsTextAttr( nCurrentPos );
 nOpenAttrWithRange += aAttrIter.OutAttrWithRange( rNode, 
nCurrentPos );
 
-OUString aSymbolFont;
 sal_Int32 nLen = nNextAttr - nCurrentPos;
 
 // DOCX: Put the flies in their own run.
@@ -2736,7 +2735,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
 m_bAddFootnoteTab = false;
 }
 
-aSymbolFont = lcl_GetSymbolFont(m_rDoc.GetAttrPool(), rNode, 
nCurrentPos + ofs,
+OUString aSymbolFont = lcl_GetSymbolFont(m_rDoc.GetAttrPool(), 
rNode, nCurrentPos + ofs,
 nCurrentPos + ofs + nLen);
 
 AttrOutput().RunText( aSnippet, eChrSet, aSymbolFont );


core.git: sw/source

2026-02-10 Thread Justin Luth (via logerrit)
 sw/source/filter/ww8/wrtw8nds.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit b2e0e6c0b8e9b85c7657f784f13810af16a2298c
Author: Justin Luth 
AuthorDate: Tue Feb 10 12:09:52 2026 -0500
Commit: Justin Luth 
CommitDate: Tue Feb 10 21:49:16 2026 +0100

NFC tdf#170516 cleanup: remove unused update to aSymbolFont

No Functional Change intended

This aSymbolFont was only used for bPostponeWritingText
which was removed earlier for this bug report.

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

diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 42527ad762a9..fdbec62edf7e 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2858,8 +2858,6 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
 
 AttrOutput().WritePostitFieldReference();
 
-aSymbolFont = lcl_GetSymbolFont(m_rDoc.GetAttrPool(), rNode, 
nCurrentPos, nCurrentPos + nLen);
-
 AttrOutput().EndRun(&rNode, nCurrentPos, nLen, nNextAttr == nEnd);
 
 nCurrentPos = nNextAttr;


core.git: sw/source

2026-02-10 Thread Noel Grandin (via logerrit)
 sw/source/core/unocore/unotext.cxx |   15 ++---
 sw/source/filter/xml/xmltbli.cxx   |5 +---
 sw/source/ui/vba/vbarows.cxx   |   41 +++--
 sw/source/ui/vba/vbarows.hxx   |9 +---
 sw/source/ui/vba/vbaselection.cxx  |   14 +---
 sw/source/ui/vba/vbaselection.hxx  |4 ++-
 sw/source/ui/vba/vbatable.cxx  |   36 
 sw/source/ui/vba/vbatable.hxx  |5 ++--
 sw/source/ui/vba/vbatables.cxx |6 +++--
 sw/source/ui/vba/wordvbahelper.cxx |5 ++--
 10 files changed, 74 insertions(+), 66 deletions(-)

New commits:
commit 634cf166e04760f198b0019698d1f23ab8a67e9a
Author: Noel Grandin 
AuthorDate: Mon Feb 9 17:03:43 2026 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 10 15:20:10 2026 +0100

use more concrete UNO

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

diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index e53e322aac70..94c4531c0128 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1795,11 +1795,11 @@ namespace {
 // Move previously imported paragraphs into a new text table.
 struct VerticallyMergedCell
 {
-std::vector > aCells;
+std::vector > aCells;
 sal_Int32   nLeftPosition;
 boolbOpen;
 
-VerticallyMergedCell(uno::Reference< beans::XPropertySet > const& rxCell,
+VerticallyMergedCell(rtl::Reference< SwXCell > const& rxCell,
 const sal_Int32 nLeft)
 : nLeftPosition( nLeft )
 , bOpen( true )
@@ -2074,10 +2074,9 @@ static void
 lcl_ApplyCellProperties(
 const sal_Int32 nLeftPos,
 const uno::Sequence< beans::PropertyValue >& rCellProperties,
-const uno::Reference< uno::XInterface >& xCell,
+const rtl::Reference< SwXCell >& xCell,
 std::vector & rMergedCells)
 {
-const uno::Reference< beans::XPropertySet > xCellPS(xCell, uno::UNO_QUERY);
 for (const auto& rCellProperty : rCellProperties)
 {
 const OUString & rName  = rCellProperty.Name;
@@ -2100,7 +2099,7 @@ lcl_ApplyCellProperties(
 }
 }
 // add the new group of merged cells
-rMergedCells.emplace_back(xCellPS, nLeftPos);
+rMergedCells.emplace_back(xCell, nLeftPos);
 }
 else
 {
@@ -2110,7 +2109,7 @@ lcl_ApplyCellProperties(
 {
 if (aMergedCell.bOpen && 
lcl_SimilarPosition(aMergedCell.nLeftPosition, nLeftPos))
 {
-aMergedCell.aCells.push_back( xCellPS );
+aMergedCell.aCells.push_back( xCell );
 bFound = true;
 }
 }
@@ -2138,7 +2137,7 @@ lcl_ApplyCellProperties(
 };
 if (std::find(vDenylist.begin(), vDenylist.end(), rName) == 
vDenylist.end())
 {
-xCellPS->setPropertyValue(rName, rValue);
+xCell->setPropertyValue(rName, rValue);
 }
 }
 catch (const uno::Exception&)
@@ -2325,7 +2324,7 @@ SwXText::convertToSwTable(
 {
 lcl_ApplyCellProperties(lcl_GetLeftPos(nCell, 
aRowSeparators[nRow]),
 rCellProps,
-xRet->getCellByPosition(nCell, nRow),
+xRet->getSwCellByPosition(nCell, nRow),
 aMergedCells);
 ++nCell;
 }
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index ef873fcf3838..f592ed21c2b2 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -1223,10 +1223,9 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& 
rImport,
 // xml:id for RDF metadata
 GetImport().SetXmlId(uno::Reference(xTable), sXmlId);
 
-Reference < XCell > xCell = xTable->getCellByPosition( 0, 0 );
-Reference < XText> xText( xCell, UNO_QUERY );
+rtl::Reference< SwXCell > xCell = xTable->getSwCellByPosition( 0, 0 );
 m_xOldCursor = GetImport().GetTextImport()->GetCursor();
-GetImport().GetTextImport()->SetCursor( xText->createTextCursor() );
+GetImport().GetTextImport()->SetCursor( xCell->createTextCursor() );
 
 // take care of open redlines for tables
 GetImport().GetTextImport()->RedlineAdjustStartNodeCursor();
diff --git a/sw/source/ui/vba/vbarows.cxx b/sw/source/ui/vba/vbarows.cxx
index e33f732e7638..1ad673b6c431 100644
--- a/sw/source/ui/vba/vbarows.cxx
+++ b/sw/source/ui/vba/vbarows.cxx
@@ -30,6 +30,7 @@
 #include "vbatablehelper.hxx"
 #include "wordvbahelper.hxx"
 #include 
+#include 
 
 using namespace ::ooo::vba;
 using namespace ::o

core.git: sw/source

2026-02-10 Thread Andrea Gelmini (via logerrit)
 sw/source/core/crsr/swcrsr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3c93380e00378b36c20478dba2bae28d446abc1b
Author: Andrea Gelmini 
AuthorDate: Mon Feb 9 13:40:07 2026 +0100
Commit: Andrea Gelmini 
CommitDate: Tue Feb 10 12:30:29 2026 +0100

Fix typo

Change-Id: Ib4b387b5c699dac21bde8a9069eb320e36583e86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198981
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini 
Reviewed-by: Simon Chenery 

diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index feaf62bf0e12..9059346984a9 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -856,7 +856,7 @@ static sal_Int32 lcl_FindSelection( SwFindParas& rParas, 
SwCursor* pCurrentCurso
 }
 }
 
-// tdf#131431 move pCurrentCursor if it hasn't moved to avoid an 
infinte loop
+// tdf#131431 move pCurrentCursor if it hasn't moved to avoid an 
infinite loop
 if( bSrchBkwrd && *pEndPos == *pCurrentCursor->Start() )
 {
 (*fnMove.fnPos)( pCurrentCursor->GetMark(), false );


core.git: sw/source

2026-02-10 Thread Mike Kaganski (via logerrit)
 sw/source/core/frmedt/fecopy.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 58525e8692b6fc8c3fd1c601fa27853fb061d06b
Author: Mike Kaganski 
AuthorDate: Tue Feb 10 11:54:49 2026 +0500
Commit: Mike Kaganski 
CommitDate: Tue Feb 10 11:59:19 2026 +0100

enable-msvc-analyze: C6011: Dereferencing NULL pointer

C:\loDereferencing NULL pointer 'pFormat'. .: Lines: 1394, 1395, 1396, 
1398,
1403, 1405, 1406, 1408, 1411, 1412, 1416, 1421, 1423, 1424, 1425, 1427,
1430, 1432, 1434, 1435, 1436, 1453, 1454, 1455, 1456, 1457, 1459, 1460,
1461, 1463, 1464, 1466, 1468, 1469, 1473, 1476, 1477
C:\loDereferencing NULL pointer 'pAnchor'. .: Lines: 1394, 1395, 1396, 
1398,
1403, 1405, 1406, 1408, 1411, 1412, 1416, 1421, 1423, 1424, 1425, 1427,
1430, 1432, 1434, 1435, 1436, 1453, 1454, 1455, 1456, 1457, 1459, 1460,
1461, 1463, 1464, 1466, 1468, 1469, 1473, 1476, 1477, 1479, 1480
C:\loDereferencing NULL pointer 'pTmp'. See line 1480 for an earlier 
location
where this can occur.: Lines: 1394, 1395, 1396, 1398, 1403, 1405, 1406,
1408, 1411, 1412, 1416, 1421, 1423, 1424, 1425, 1427, 1430, 1432, 1434,
1435, 1436, 1453, 1454, 1455, 1456, 1457, 1459, 1460, 1461, 1463, 1464,
1466, 1468, 1469, 1473, 1476, 1477, 1479, 1480, 1482, 1484

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

diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 44853eb1bb3f..ae388e567ea2 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1436,6 +1436,7 @@ SwPasteSdr SwFEShell::PasteStream(SvStream & rStrm, 
SwPasteSdr nAction, const Po
 if( DynCastSwVirtFlyDrawObj( pOldObj) !=  nullptr )
 {
 pFormat = FindFrameFormat( pOldObj );
+assert(pFormat);
 
 Point aNullPt;
 SwFlyFrame* pFlyFrame = static_cast(pFormat)->GetFrame( &aNullPt );
@@ -1472,6 +1473,9 @@ SwPasteSdr SwFEShell::PasteStream(SvStream & rStrm, 
SwPasteSdr nAction, const Po
 
 if( DynCastSwVirtFlyDrawObj( pOldObj) !=  nullptr )
 {
+assert(pFormat);
+assert(pAnchor);
+
 // store attributes, then set SdrObject
 SfxItemSetFixed aFrameSet( 
mxDoc->GetAttrPool() );
 aFrameSet.Set( pFormat->GetAttrSet() );


core.git: sw/source

2026-02-10 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/misc/redlndlg.cxx |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 6f672373ecb30565261395bb6ebed334c0649b7f
Author: Mike Kaganski 
AuthorDate: Tue Feb 10 12:18:06 2026 +0500
Commit: Mike Kaganski 
CommitDate: Tue Feb 10 10:13:52 2026 +0100

tdf#170701: only enable [Accept]/[Reject] for top-level changes

Regression after commit 6fe35fdbd39cee17cb1f4fc9494520e2bdcabcba
(tdf#167128: SwRedlineAcceptDlg: move enabling controls after
selection, 2025-06-20). The previous code, that enabled these
controls in GotoHdl, only set bSel to true for top-level items.

This change implements the same logic in EnableControls.

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

diff --git a/sw/source/uibase/misc/redlndlg.cxx 
b/sw/source/uibase/misc/redlndlg.cxx
index e9d3acb689c5..4bd546c1f973 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -379,10 +379,14 @@ void SwRedlineAcceptDlg::EnableControls(const SwView* 
pView)
 bool const bEnable = isAcceptRejectCommandsEnabled(*pView)
 && rTreeView.n_children() != 0
 && 
!pSh->getIDocumentRedlineAccess().GetRedlinePassword().hasElements();
-std::unique_ptr pSelectedEntry = rTreeView.get_selected();
 
+bool bAcceptReject = false;
 bool bIsNotFormated = false;
-rTreeView.selected_foreach([this, pSh, &bIsNotFormated](weld::TreeIter& 
rEntry){
+rTreeView.selected_foreach([this, pSh, &bIsNotFormated, 
&bAcceptReject](weld::TreeIter& rEntry){
+// Only enable these controls for top-level redlines
+if (m_pTable->GetWidget().get_iter_depth(rEntry) == 0)
+bAcceptReject = true;
+
 // find the selected redline
 // (fdo#57874: ignore, if the redline is already gone)
 SwRedlineTable::size_type nPos = GetRedlinePos(rEntry);
@@ -395,9 +399,9 @@ void SwRedlineAcceptDlg::EnableControls(const SwView* pView)
 return false;
 });
 
-m_rTPView.EnableAccept(bEnable && pSelectedEntry);
-m_rTPView.EnableReject(bEnable && pSelectedEntry);
-m_rTPView.EnableClearFormat(bEnable && !bIsNotFormated && pSelectedEntry);
+m_rTPView.EnableAccept(bEnable && bAcceptReject);
+m_rTPView.EnableReject(bEnable && bAcceptReject);
+m_rTPView.EnableClearFormat(bEnable && !bIsNotFormated && bAcceptReject);
 m_rTPView.EnableAcceptAll(bEnable);
 m_rTPView.EnableRejectAll(bEnable);
 m_rTPView.EnableClearFormatAll(bEnable && m_bOnlyFormatedRedlines);


core.git: sw/source

2026-02-09 Thread Mike Kaganski (via logerrit)
 sw/source/core/layout/sortedobjs.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 297063248661d92211cb9ad7d0ba4f930fa35d24
Author: Mike Kaganski 
AuthorDate: Mon Feb 9 19:21:39 2026 +0500
Commit: Mike Kaganski 
CommitDate: Mon Feb 9 18:19:06 2026 +0100

Use "chain" instead of "group"

Thanks Miklos for noticing that.
Also, expand the comment to clarify the reason for this part of code.

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

diff --git a/sw/source/core/layout/sortedobjs.cxx 
b/sw/source/core/layout/sortedobjs.cxx
index f74ba71b675b..e53fcf507ddc 100644
--- a/sw/source/core/layout/sortedobjs.cxx
+++ b/sw/source/core/layout/sortedobjs.cxx
@@ -222,12 +222,16 @@ struct ObjAnchorOrder
 
 if (pLHSplitFly && pRHSplitFly)
 {
-// standalone split fly after grouped
-auto isInGroup
+// standalone split fly after chained. This case happens when 
a follow fly gets
+// emptied, dropped from chain, and eventually will be 
removed; but at this point,
+// it's still there in the sorted vector. Without this code, 
the vector would not
+// be properly partitioned relative to newly added follow, 
causing assertion in
+// clang/dbgutil:
+auto isInChain
 = [](const SwFlyAtContentFrame* p) { return p->HasFollow() 
|| p->IsFollow(); };
-if (isInGroup(pLHSplitFly) && !isInGroup(pRHSplitFly))
+if (isInChain(pLHSplitFly) && !isInChain(pRHSplitFly))
 return true;
-if (!isInGroup(pLHSplitFly) && isInGroup(pRHSplitFly))
+if (!isInChain(pLHSplitFly) && isInChain(pRHSplitFly))
 return false;
 
 if (pLHSplitFly->HasFollow() && pRHSplitFly->IsFollow())


core.git: sw/source

2026-02-08 Thread Mike Kaganski (via logerrit)
 sw/source/core/docnode/ndtbl.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit c6661190de4f85c2ea6a96ea76efe85119271dd2
Author: Mike Kaganski 
AuthorDate: Sun Feb 8 15:05:51 2026 +0500
Commit: Mike Kaganski 
CommitDate: Sun Feb 8 14:20:59 2026 +0100

enable-msvc-analyze: C6011: Dereferencing NULL pointer

C:\loDereferencing NULL pointer 'pAutoFormat'. .: Lines: 4196, 4197, 
4200,
4201, 4202, 4201, 4202, 4201, 4205, 4207, 4208, 4209, 4208, 4219, 4205,
4207, 4208

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

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 9d45868969ce..ed164d208cb5 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -4205,6 +4205,7 @@ void SwDoc::ResetTableStyles(const OUString& sTableStyle, 
std::u16string_view sO
 for (size_t i = 0; i < pAutoFormats.size(); i++)
 {
 SwTableAutoFormat* pAutoFormat = pAutoFormats.GetData(i);
+assert(pAutoFormat);
 OUString sCurrentStyle = pAutoFormat->GetName().toString();
 while (pAutoFormat)
 {


core.git: sw/source

2026-02-08 Thread Mike Kaganski (via logerrit)
 sw/source/core/frmedt/fefly1.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit a787a3895f111615440f1f065a120d77e6560fcc
Author: Mike Kaganski 
AuthorDate: Sun Feb 8 15:03:51 2026 +0500
Commit: Mike Kaganski 
CommitDate: Sun Feb 8 12:05:42 2026 +0100

enable-msvc-analyze: C6011: Dereferencing NULL pointer

C:\loDereferencing NULL pointer 'this->GetSfxViewShell()'. .: Lines: 
282,
283, 288, 289, 290, 291, 296, 297, 302, 308, 303, 310, 316, 318, 320,
321, 324, 325, 328, 334, 336

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

diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 241a5272b2b2..74799c796731 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -333,7 +333,9 @@ void SwFEShell::UnfloatFlyFrame()
 // else
 SelectObj(Point(), 0, pAnchoredObj->DrawObj());
 
-
GetSfxViewShell()->GetDispatcher()->Execute(FN_TOOL_ANCHOR_PARAGRAPH,
+auto pSfxViewShell = GetSfxViewShell();
+assert(pSfxViewShell);
+pSfxViewShell->GetDispatcher()->Execute(FN_TOOL_ANCHOR_PARAGRAPH,
 SfxCallMode::SYNCHRON);
 
 // Check if anchor id changed.


core.git: sw/source

2026-02-07 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/wrtsh/wrtsh1.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit e9c187db207f971c9eab9268eefdbceb769f0fdb
Author: Jim Raykowski 
AuthorDate: Fri Feb 6 01:17:00 2026 -0900
Commit: Jim Raykowski 
CommitDate: Sun Feb 8 07:22:31 2026 +0100

tdf#170599 fix outline folding crash

When reopening Print Preview with outline folding enabled and a heading
in the first paragraph and display formatting hidden characters option
is enabled.

Effort to understand why this crash happens revealed a similar
occurrence in SwDocShell::LoadStyles_. While moving the call to
InvalidateOutlineContentVisibility in SwView ctor to before the line
having 'g_NoInterrupt = bOld' seems to avoid the crash, or my first
approach of conditionally including StartAction/EndAction through use of
a function argument, this patch uses the
comphelper::FlagRestorationGuard used in rhbz#818557, fdo#58893 fix in
SwDocShell::LoadStyles_:

  "rhbz#818557, fdo#58893: EndAllAction will call SelectShell(),
   which pushes a bunch of SfxShells that are not cleared
   (for unknown reasons) when closing the document, causing crash;
   setting g_bNoInterrupt appears to avoid the problem."

Attempts to make this crash occur in a unit test have not been
successful; therefore one is not included with this patch.

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

diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 671d5e1e2e6c..6fc130b6c3dc 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -129,6 +129,8 @@
 
 #include 
 
+#include 
+
 using namespace sw::mark;
 using namespace com::sun::star;
 namespace {
@@ -2711,6 +2713,15 @@ void SwWrtShell::MakeOutlineContentVisible(const size_t 
nPos, bool bMakeVisible,
 // make content visible or not visible only if needed
 void SwWrtShell::InvalidateOutlineContentVisibility()
 {
+// tdf#170599 fix taken from fix for:
+//   "rhbz#818557, fdo#58893: EndAllAction will call SelectShell(),
+//which pushes a bunch of SfxShells that are not cleared
+//(for unknown reasons) when closing the document, causing crash;
+//setting g_bNoInterrupt appears to avoid the problem."
+// In this case the crash occurs when reopening Print Preview with outline 
folding enabled and
+// a heading in the first paragraph and display formatting hidden 
characters option is enabled.
+comphelper::FlagRestorationGuard g(g_bNoInterrupt, true);
+
 StartAction();
 
 
GetView().GetEditWin().GetFrameControlsManager().HideControls(FrameControlType::Outline);


  1   2   3   4   5   6   7   8   9   10   >