core.git: sw/source

2024-06-06 Thread Gabor Kelemen (via logerrit)
 sw/source/core/doc/notxtfrm.cxx|2 +-
 sw/source/core/inc/cellfrm.hxx |3 ++-
 sw/source/core/inc/flyfrm.hxx  |3 ++-
 sw/source/core/inc/frame.hxx   |3 ++-
 sw/source/core/inc/layfrm.hxx  |3 ++-
 sw/source/core/inc/notxtfrm.hxx|3 ++-
 sw/source/core/inc/rootfrm.hxx |3 ++-
 sw/source/core/inc/tabfrm.hxx  |3 ++-
 sw/source/core/inc/txtfrm.hxx  |3 ++-
 sw/source/core/inc/viewimp.hxx |1 +
 sw/source/core/layout/paintfrm.cxx |   21 -
 sw/source/core/layout/unusedf.cxx  |2 +-
 sw/source/core/text/frmpaint.cxx   |2 +-
 sw/source/core/view/vdraw.cxx  |7 +++
 14 files changed, 39 insertions(+), 20 deletions(-)

New commits:
commit 3735d43955a000db8b6fff04a2214793be649c4b
Author: Gabor Kelemen 
AuthorDate: Wed Jun 5 09:14:23 2024 +0200
Commit: Gabor Kelemen 
CommitDate: Thu Jun 6 11:12:11 2024 +0200

tdf#161340 Revert partially 6cdf523f179f3e7ed94267502a5fe3d1247398cc

so that hiding drawing shapes from Print Dialog still works
with the 'Images and other graphic objects' option

Change-Id: I3c6612f1074e31d1007523709858e2c8ab6de809
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168467
Reviewed-by: Samuel Mehrbrodt 
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen 

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 5083ad7aded8..8afc1c60b280 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -214,7 +214,7 @@ static void lcl_ClearArea( const SwFrame ,
 }
 }
 
-void SwNoTextFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect 
const& rRect, PaintFrameMode) const
+void SwNoTextFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect 
const& rRect, PaintFrameMode, SwPrintData const*const) const
 {
 if ( getFrameArea().IsEmpty() )
 return;
diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx
index 3fad18e7fcec..0d1575a83695 100644
--- a/sw/source/core/inc/cellfrm.hxx
+++ b/sw/source/core/inc/cellfrm.hxx
@@ -42,7 +42,8 @@ public:
 SwCellFrame( const SwTableBox &, SwFrame*, bool bInsertContent );
 
 virtual bool GetModelPositionForViewPoint( SwPosition *, Point&, 
SwCursorMoveState* = nullptr, bool bTestBackground = false ) const override;
-virtual void PaintSwFrame( vcl::RenderContext& rRenderContext, SwRect 
const&, PaintFrameMode mode = PAINT_ALL ) const override;
+virtual void PaintSwFrame( vcl::RenderContext& rRenderContext, SwRect 
const&, PaintFrameMode mode = PAINT_ALL,
+SwPrintData const*const pPrintData = nullptr ) const 
override;
 virtual void CheckDirection( bool bVert ) override;
 
 // #i103961#
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index a9db68182fd8..2a4091b7859a 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -170,7 +170,8 @@ protected:
 
 public:
 // #i26791#
-virtual void PaintSwFrame( vcl::RenderContext& rRenderContext, SwRect 
const&, PaintFrameMode mode = PAINT_ALL ) const override;
+virtual void PaintSwFrame( vcl::RenderContext& rRenderContext, SwRect 
const&, PaintFrameMode mode = PAINT_ALL,
+SwPrintData const*const pPrintData = nullptr ) const 
override;
 virtual Size ChgSize( const Size& aNewSize ) override;
 virtual bool GetModelPositionForViewPoint( SwPosition *, Point&,
   SwCursorMoveState* = nullptr, bool 
bTestBackground = false ) const override;
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 13c196ad70cb..eea75e34a3c7 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -853,7 +853,8 @@ public:
  SwCursorMoveState* = nullptr, bool 
bTestBackground = false ) const;
 virtual boolGetCharRect( SwRect &, const SwPosition&,
  SwCursorMoveState* = nullptr, bool 
bAllowFarAway = true ) const;
-virtual void PaintSwFrame( vcl::RenderContext& rRenderContext, SwRect 
const&, PaintFrameMode eMode = PAINT_ALL ) const;
+virtual void PaintSwFrame( vcl::RenderContext& rRenderContext, SwRect 
const&, PaintFrameMode eMode = PAINT_ALL,
+SwPrintData const*const pPrintData = nullptr ) const;
 
 // HACK: shortcut between frame and formatting
 // It's your own fault if you cast void* incorrectly! In any case check
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index a73bf34477d2..d40fa7b5a341 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -96,7 +96,8 @@ public:
 
 SwLayoutFrame( SwFrameFormat*, SwFrame* );
 
-virtual void PaintSwFrame( vcl::RenderContext& rRenderContext, SwRect 
const&, PaintFrameMode mode = PAINT_ALL ) const override;
+virtual void PaintSwFrame( vcl::RenderContext& 

core.git: sw/source

2024-06-06 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/sidebar/QuickFindPanel.cxx |   52 ++--
 1 file changed, 49 insertions(+), 3 deletions(-)

New commits:
commit 200f74b8004564d226dce5cde7d4aa2d109f258f
Author: Jim Raykowski 
AuthorDate: Sun Jun 2 18:23:10 2024 -0800
Commit: Jim Raykowski 
CommitDate: Thu Jun 6 09:06:16 2024 +0200

tdf#160539 Quickfind sidebar: Words are cut-off at beginning and end

Adjust the search finds list entry text subview of paragraph text
around the search find to start and end at a pseudo word boundary.

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

diff --git a/sw/source/uibase/sidebar/QuickFindPanel.cxx 
b/sw/source/uibase/sidebar/QuickFindPanel.cxx
index 37edbc90019a..176ae3ad2eab 100644
--- a/sw/source/uibase/sidebar/QuickFindPanel.cxx
+++ b/sw/source/uibase/sidebar/QuickFindPanel.cxx
@@ -161,19 +161,65 @@ void QuickFindPanel::FillSearchFindsList()
 auto nMarkIndex = rPaM.GetMark()->nContent.GetIndex();
 auto nPointIndex = rPaM.GetPoint()->nContent.GetIndex();
 
+// determine the text node text subview start index for the list 
entry text
 auto nStartIndex = nMarkIndex - 50;
 if (nStartIndex < 0)
+{
 nStartIndex = 0;
+}
+else
+{
+// tdf#160539 format search finds results also to word 
boundaries
+sal_Unicode ch;
+do
+{
+ch = sNodeText[nStartIndex];
+} while (++nStartIndex < nMarkIndex && ch != ' ' && ch != '
');
+if (nStartIndex < nMarkIndex)
+{
+// move past neighboring space and tab characters
+ch = sNodeText[nStartIndex];
+while (nStartIndex < nMarkIndex && (ch == ' ' || ch == '   
'))
+ch = sNodeText[++nStartIndex];
+}
+if (nStartIndex == nMarkIndex) // no white space found
+nStartIndex = nMarkIndex - 50;
+}
+
+// determine the text node text subview end index for the list 
entry text
 auto nEndIndex = nPointIndex + 50;
-if (nEndIndex > sNodeText.getLength())
+if (nEndIndex >= sNodeText.getLength())
+{
+nEndIndex = sNodeText.getLength() - 1;
+}
+else
 {
-nEndIndex = sNodeText.getLength();
+// tdf#160539 format search finds results also to word 
boundaries
+sal_Unicode ch;
+do
+{
+ch = sNodeText[nEndIndex];
+} while (--nEndIndex > nPointIndex && ch != ' ' && ch != ' 
');
+if (nEndIndex > nPointIndex)
+{
+// move past neighboring space and tab characters
+ch = sNodeText[nEndIndex];
+while (nEndIndex > nPointIndex && (ch == ' ' || ch == '
'))
+ch = sNodeText[--nEndIndex];
+}
+if (nEndIndex == nPointIndex) // no white space found
+{
+nEndIndex = nPointIndex + 50;
+if (nEndIndex >= sNodeText.getLength())
+nEndIndex = sNodeText.getLength() - 1;
+}
 }
+
 auto nCount = nMarkIndex - nStartIndex;
 OUString sTextBeforeFind = 
OUString::Concat(sNodeText.subView(nStartIndex, nCount));
 auto nCount1 = nPointIndex - nMarkIndex;
 OUString sFind = OUString::Concat(sNodeText.subView(nMarkIndex, 
nCount1));
-auto nCount2 = nEndIndex - nPointIndex;
+auto nCount2 = nEndIndex - nPointIndex + 1;
 OUString sTextAfterFind = 
OUString::Concat(sNodeText.subView(nPointIndex, nCount2));
 OUString sStr = sTextBeforeFind + "[" + sFind + "]" + 
sTextAfterFind;
 


core.git: sw/source

2024-06-05 Thread Noel Grandin (via logerrit)
 sw/source/uibase/uno/SwXDocumentSettings.cxx |   82 +++
 sw/source/uibase/uno/SwXFilterOptions.cxx|8 -
 sw/source/uibase/uno/loktxdoc.cxx|   24 ++--
 sw/source/uibase/uno/unoatxt.cxx |   20 +--
 sw/source/uibase/uno/unodispatch.cxx |2 
 sw/source/uibase/uno/unomailmerge.cxx|   42 +++
 sw/source/uibase/uno/unomod.cxx  |  146 +--
 sw/source/uibase/uno/unomodule.cxx   |4 
 sw/source/uibase/uno/unotxdoc.cxx|  102 +-
 sw/source/uibase/uno/unotxvw.cxx |   58 +-
 10 files changed, 244 insertions(+), 244 deletions(-)

New commits:
commit 309768c2f54ce0ff5fa4b3409996733afa96bc02
Author: Noel Grandin 
AuthorDate: Wed Jun 5 10:19:27 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed Jun 5 13:19:40 2024 +0200

loplugin:ostr in sw/.../uno

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

diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx 
b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index b46c9c4316ed..e932610066c7 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -170,45 +170,45 @@ static rtl::Reference 
lcl_createSettingsInfo()
 {
 static PropertyInfo const aWriterSettingsInfoMap[] =
 {
-{ OUString("ForbiddenCharacters"),HANDLE_FORBIDDEN_CHARS,  
   cppu::UnoType::get(),  0},
-{ OUString("LinkUpdateMode"), HANDLE_LINK_UPDATE_MODE, 
   cppu::UnoType::get(), 0},
-{ OUString("FieldAutoUpdate"),HANDLE_FIELD_AUTO_UPDATE,
   cppu::UnoType::get(),   0},
-{ OUString("ChartAutoUpdate"),HANDLE_CHART_AUTO_UPDATE,
   cppu::UnoType::get(),   0},
-{ OUString("AddParaTableSpacing"),
HANDLE_ADD_PARA_TABLE_SPACING,  cppu::UnoType::get(),   
0},
-{ OUString("AddParaTableSpacingAtStart"), 
HANDLE_ADD_PARA_TABLE_SPACING_AT_START, cppu::UnoType::get(),   
0},
-{ OUString("AlignTabStopPosition"),   
HANDLE_ALIGN_TAB_STOP_POSITION, cppu::UnoType::get(),   
0},
-{ OUString("PrinterName"),HANDLE_PRINTER_NAME, 
   cppu::UnoType::get(),  0},
-{ OUString("PrinterSetup"),   HANDLE_PRINTER_SETUP,
   cppu::UnoType< cppu::UnoSequenceType >::get(),   
0},
-{ OUString("PrinterPaperFromSetup"),  HANDLE_PRINTER_PAPER,
   cppu::UnoType::get(),   0},
-{ OUString("IsKernAsianPunctuation"), 
HANDLE_IS_KERN_ASIAN_PUNCTUATION,   cppu::UnoType::get(),   
0},
-{ OUString("CharacterCompressionType"),   
HANDLE_CHARACTER_COMPRESSION_TYPE,  cppu::UnoType::get(),
 0},
-{ OUString("ApplyUserData"),  HANDLE_APPLY_USER_DATA,  
   cppu::UnoType::get(),   0 },
-{ OUString("SaveThumbnail"),  HANDLE_SAVE_THUMBNAIL,   
   cppu::UnoType::get(),   0 },
-{ OUString("SaveGlobalDocumentLinks"),
HANDLE_SAVE_GLOBAL_DOCUMENT_LINKS,  cppu::UnoType::get(),   
0},
-{ OUString("CurrentDatabaseDataSource"),  
HANDLE_CURRENT_DATABASE_DATA_SOURCE,cppu::UnoType::get(), 
 0},
-{ OUString("CurrentDatabaseCommand"), 
HANDLE_CURRENT_DATABASE_COMMAND,cppu::UnoType::get(), 
 0},
-{ OUString("CurrentDatabaseCommandType"), 
HANDLE_CURRENT_DATABASE_COMMAND_TYPE,   cppu::UnoType::get(),
 0},
-{ OUString("EmbeddedDatabaseName"),   
HANDLE_EMBEDDED_DATABASE_NAME,  cppu::UnoType::get(), 
 0},
-{ OUString("SaveVersionOnClose"), 
HANDLE_SAVE_VERSION_ON_CLOSE,   cppu::UnoType::get(),   
0},
-{ OUString("UpdateFromTemplate"), HANDLE_UPDATE_FROM_TEMPLATE, 
   cppu::UnoType::get(),   0},
+{ u"ForbiddenCharacters"_ustr,HANDLE_FORBIDDEN_CHARS,  
   cppu::UnoType::get(),  0},
+{ u"LinkUpdateMode"_ustr, HANDLE_LINK_UPDATE_MODE, 
   cppu::UnoType::get(), 0},
+{ u"FieldAutoUpdate"_ustr,HANDLE_FIELD_AUTO_UPDATE,
   cppu::UnoType::get(),   0},
+{ u"ChartAutoUpdate"_ustr,HANDLE_CHART_AUTO_UPDATE,
   cppu::UnoType::get(),   0},
+{ u"AddParaTableSpacing"_ustr,HANDLE_ADD_PARA_TABLE_SPACING,   
   cppu::UnoType::get(),   0},
+{ u"AddParaTableSpacingAtStart"_ustr, 
HANDLE_ADD_PARA_TABLE_SPACING_AT_START, cppu::UnoType::get(),   
0},
+{ u"AlignTabStopPosition"_ustr,   

core.git: sw/source

2024-06-05 Thread Noel Grandin (via logerrit)
 sw/source/ui/misc/bookmark.cxx  |   31 ++-
 sw/source/ui/misc/contentcontroldlg.cxx |   47 +
 sw/source/ui/misc/contentcontrollistitemdlg.cxx |   10 +--
 sw/source/ui/misc/docfnote.cxx  |   42 +++
 sw/source/ui/misc/glosbib.cxx   |   16 +++---
 sw/source/ui/misc/glossary.cxx  |   62 +++
 sw/source/ui/misc/insfnote.cxx  |   22 
 sw/source/ui/misc/linenum.cxx   |   38 +++---
 sw/source/ui/misc/num.cxx   |   64 
 sw/source/ui/misc/outline.cxx   |   40 +++
 sw/source/ui/misc/pagenumberdlg.cxx |   21 ---
 sw/source/ui/misc/pgfnote.cxx   |2 
 sw/source/ui/misc/pggrid.cxx|   44 
 sw/source/ui/misc/srtdlg.cxx|   50 +-
 sw/source/ui/misc/swmodalredlineacceptdlg.cxx   |8 +--
 sw/source/ui/misc/titlepage.cxx |   30 +--
 sw/source/ui/misc/translatelangselect.cxx   |   10 +--
 17 files changed, 270 insertions(+), 267 deletions(-)

New commits:
commit a2b7dca2eb1da105fe139b3f14bb9dfaae11d549
Author: Noel Grandin 
AuthorDate: Wed Jun 5 10:18:31 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed Jun 5 13:19:05 2024 +0200

loplugin:ostr in sw/.../misc

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

diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 40cebea7ead7..6f882bad5d15 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -312,7 +312,7 @@ bool SwInsertBookmarkDlg::ValidateBookmarks()
 if (HaveBookmarksChanged())
 {
 PopulateTable();
-m_xEditBox->set_text("");
+m_xEditBox->set_text(u""_ustr);
 return false;
 }
 return true;
@@ -363,21 +363,22 @@ void SwInsertBookmarkDlg::PopulateTable()
 
 SwInsertBookmarkDlg::SwInsertBookmarkDlg(weld::Window* pParent, SwWrtShell& rS,
  OUString const* const pSelected)
-: SfxDialogController(pParent, "modules/swriter/ui/insertbookmark.ui", 
"InsertBookmarkDialog")
+: SfxDialogController(pParent, 
u"modules/swriter/ui/insertbookmark.ui"_ustr,
+  u"InsertBookmarkDialog"_ustr)
 , m_rSh(rS)
 , m_nLastBookmarksCount(0)
 , m_bSorted(false)
-, m_xEditBox(m_xBuilder->weld_entry("name"))
-, m_xInsertBtn(m_xBuilder->weld_button("insert"))
-, m_xDeleteBtn(m_xBuilder->weld_button("delete"))
-, m_xGotoBtn(m_xBuilder->weld_button("goto"))
-, m_xEditTextBtn(m_xBuilder->weld_button("edittext"))
-, m_xRenameBtn(m_xBuilder->weld_button("rename"))
-, m_xHideCB(m_xBuilder->weld_check_button("hide"))
-, m_xConditionFT(m_xBuilder->weld_label("condlabel"))
-, m_xConditionED(new ConditionEdit(m_xBuilder->weld_entry("withcond")))
-, m_xBookmarksBox(new 
BookmarkTable(m_xBuilder->weld_tree_view("bookmarks")))
-, m_xForbiddenChars(m_xBuilder->weld_label("lbForbiddenChars"))
+, m_xEditBox(m_xBuilder->weld_entry(u"name"_ustr))
+, m_xInsertBtn(m_xBuilder->weld_button(u"insert"_ustr))
+, m_xDeleteBtn(m_xBuilder->weld_button(u"delete"_ustr))
+, m_xGotoBtn(m_xBuilder->weld_button(u"goto"_ustr))
+, m_xEditTextBtn(m_xBuilder->weld_button(u"edittext"_ustr))
+, m_xRenameBtn(m_xBuilder->weld_button(u"rename"_ustr))
+, m_xHideCB(m_xBuilder->weld_check_button(u"hide"_ustr))
+, m_xConditionFT(m_xBuilder->weld_label(u"condlabel"_ustr))
+, m_xConditionED(new 
ConditionEdit(m_xBuilder->weld_entry(u"withcond"_ustr)))
+, m_xBookmarksBox(new 
BookmarkTable(m_xBuilder->weld_tree_view(u"bookmarks"_ustr)))
+, m_xForbiddenChars(m_xBuilder->weld_label(u"lbForbiddenChars"_ustr))
 {
 m_xBookmarksBox->connect_changed(LINK(this, SwInsertBookmarkDlg, 
SelectionChangedHdl));
 m_xBookmarksBox->connect_row_activated(LINK(this, SwInsertBookmarkDlg, 
DoubleClickHdl));
@@ -423,7 +424,7 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg(weld::Window* 
pParent, SwWrtShell& rS,
 m_xConditionFT->set_sensitive(false);
 
 // restore dialog size
-SvtViewOptions aDlgOpt(EViewType::Dialog, "BookmarkDialog");
+SvtViewOptions aDlgOpt(EViewType::Dialog, u"BookmarkDialog"_ustr);
 if (aDlgOpt.Exists())
 m_xDialog->set_window_state(aDlgOpt.GetWindowState());
 
@@ -443,7 +444,7 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg(weld::Window* 
pParent, SwWrtShell& rS,
 SwInsertBookmarkDlg::~SwInsertBookmarkDlg()
 {
 // tdf#146261 - Remember size of bookmark dialog
-SvtViewOptions aDlgOpt(EViewType::Dialog, "BookmarkDialog");
+SvtViewOptions aDlgOpt(EViewType::Dialog, u"BookmarkDialog"_ustr);
 OUString sWindowState = 

core.git: sw/source

2024-06-05 Thread László Németh (via logerrit)
 sw/source/core/layout/paintfrm.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 78a9afc5ea493a703467b72475a9d80a9fa8a6db
Author: László Németh 
AuthorDate: Wed Jun 5 02:01:17 2024 +0200
Commit: László Németh 
CommitDate: Wed Jun 5 10:06:28 2024 +0200

tdf#77388 sw: add missing comment

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

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index fd426234a652..7bcd14b396f3 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4667,6 +4667,7 @@ void SwTabFrame::PaintSwFrame(vcl::RenderContext& 
rRenderContext, SwRect const&
 const SwViewOption* pViewOption = gProp.pSGlobalShell->GetViewOptions();
 if (pViewOption->IsTable())
 {
+// tdf#77388 first paint the cell content to avoid of removing own 
border
 SwLayoutFrame::PaintSwFrame( rRenderContext, rRect );
 
 // #i29550#


core.git: sw/source

2024-06-04 Thread Noel Grandin (via logerrit)
 sw/source/uibase/shells/annotsh.cxx|   14 +--
 sw/source/uibase/shells/basesh.cxx |   10 +++
 sw/source/uibase/shells/beziersh.cxx   |4 +--
 sw/source/uibase/shells/drawsh.cxx |6 ++--
 sw/source/uibase/shells/drformsh.cxx   |   28 +++---
 sw/source/uibase/shells/drwbassh.cxx   |2 -
 sw/source/uibase/shells/drwtxtex.cxx   |6 ++--
 sw/source/uibase/shells/drwtxtsh.cxx   |   12 -
 sw/source/uibase/shells/frmsh.cxx  |   20 +++
 sw/source/uibase/shells/grfsh.cxx  |8 +++---
 sw/source/uibase/shells/grfshex.cxx|4 +--
 sw/source/uibase/shells/langhelper.cxx |2 -
 sw/source/uibase/shells/listsh.cxx |2 -
 sw/source/uibase/shells/mediash.cxx|4 +--
 sw/source/uibase/shells/navsh.cxx  |2 -
 sw/source/uibase/shells/olesh.cxx  |4 +--
 sw/source/uibase/shells/tabsh.cxx  |4 +--
 sw/source/uibase/shells/textdrw.cxx|   12 -
 sw/source/uibase/shells/textfld.cxx|   12 -
 sw/source/uibase/shells/textsh.cxx |   20 +++
 sw/source/uibase/shells/textsh1.cxx|   42 -
 sw/source/uibase/shells/txtnum.cxx |2 -
 22 files changed, 110 insertions(+), 110 deletions(-)

New commits:
commit 87e8e79da0769fbc37a274049d31da07359713f4
Author: Noel Grandin 
AuthorDate: Tue Jun 4 09:52:34 2024 +0200
Commit: Noel Grandin 
CommitDate: Tue Jun 4 14:34:45 2024 +0200

loplugin:ostr in sw/.../shells

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

diff --git a/sw/source/uibase/shells/annotsh.cxx 
b/sw/source/uibase/shells/annotsh.cxx
index d6f018e98ac6..a7e3afe845a0 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -117,7 +117,7 @@ void SwAnnotationShell::InitInterface_Impl()
 {
 GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, 
SfxVisibilityFlags::Invisible, ToolbarId::Text_Toolbox_Sw);
 
-GetStaticInterface()->RegisterPopupMenu("annotation");
+GetStaticInterface()->RegisterPopupMenu(u"annotation"_ustr);
 }
 
 
@@ -476,11 +476,11 @@ void SwAnnotationShell::Exec( SfxRequest  )
 VclPtr 
pDlg(pFact->CreateSwCharDlg(m_rView.GetFrameWeld(), m_rView, aDlgAttr, 
SwCharDlgMode::Ann));
 if (nSlot == SID_CHAR_DLG_EFFECT)
 {
-pDlg->SetCurPageId("fonteffects");
+pDlg->SetCurPageId(u"fonteffects"_ustr);
 }
 if (nSlot == SID_CHAR_DLG_POSITION)
 {
-pDlg->SetCurPageId("position");
+pDlg->SetCurPageId(u"position"_ustr);
 }
 else if (pItem)
 {
@@ -1327,7 +1327,7 @@ void SwAnnotationShell::ExecLingu(SfxRequest )
 {
 Reference< ui::dialogs::XExecutableDialog > xDialog(
 xMCF->createInstanceWithContext(
-
"com.sun.star.linguistic2.ChineseTranslationDialog", xContext),
+
u"com.sun.star.linguistic2.ChineseTranslationDialog"_ustr, xContext),
 UNO_QUERY);
 Reference< lang::XInitialization > xInit( xDialog, 
UNO_QUERY );
 if( xInit.is() )
@@ -1352,9 +1352,9 @@ void SwAnnotationShell::ExecLingu(SfxRequest )
 {
 try
 {
-xProp->getPropertyValue( 
"IsDirectionToSimplified" ) >>= bToSimplified;
-xProp->getPropertyValue( 
"IsUseCharacterVariants" ) >>= bUseVariants;
-xProp->getPropertyValue( 
"IsTranslateCommonTerms" ) >>= bCommonTerms;
+xProp->getPropertyValue( 
u"IsDirectionToSimplified"_ustr ) >>= bToSimplified;
+xProp->getPropertyValue( 
u"IsUseCharacterVariants"_ustr ) >>= bUseVariants;
+xProp->getPropertyValue( 
u"IsTranslateCommonTerms"_ustr ) >>= bCommonTerms;
 }
 catch (const Exception&)
 {
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index cf36bcd7e076..3b7e66f6c465 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -834,10 +834,10 @@ bool UpdateFieldContents(SfxRequest& rReq, SwWrtShell& 
rWrtSh)
 break;
 }
 comphelper::SequenceAsHashMap aMap(aFields[nFieldIndex++]);
-pRefMark->GetRefName() = aMap["Name"].get();
+

core.git: sw/source

2024-06-04 Thread Mike Kaganski (via logerrit)
 sw/source/core/layout/flowfrm.cxx |2 +-
 sw/source/core/layout/sectfrm.cxx |3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit ecd42fe1885e8fca0ec302a6d0a666f925fa62d9
Author: Mike Kaganski 
AuthorDate: Tue Jun 4 10:12:26 2024 +0500
Commit: Mike Kaganski 
CommitDate: Tue Jun 4 09:05:47 2024 +0200

Make sure that the big value doesn't readily overflow

As shown in 
https://gerrit.libreoffice.org/c/core/+/168235/6#message-5e7ed6fecf7fd36dc167193e25c3ec94daa11cb3

> looks like this started to break e.g. CppunitTest_sw_mailmerge2 with
>
> /sw/inc/swrect.hxx:251:48: runtime error: signed integer overflow: 13569 
+ 9223372036854775807 cannot be represented in type 'long'
> #0 0x7f30b337cb90 in SwRect::Bottom() const /sw/inc/swrect.hxx:251:48
> #1 0x7f30b337234f in SwRect::Overlaps(SwRect const&) const 
/sw/inc/swrect.hxx:376:30
> #2 0x7f30b699354b in lcl_CheckFlowBack(SwFrame*, SwRect const&) 
/sw/source/core/layout/frmtool.cxx:3316:23
> #3 0x7f30b699376f in lcl_CheckFlowBack(SwFrame*, SwRect const&) 
/sw/source/core/layout/frmtool.cxx:3317:17
> #4 0x7f30b699376f in lcl_CheckFlowBack(SwFrame*, SwRect const&) 
/sw/source/core/layout/frmtool.cxx:3317:17
> #5 0x7f30b698d21e in Notify_Background(SdrObject const*, 
SwPageFrame*, SwRect const&, PrepareHint, bool) 
/sw/source/core/layout/frmtool.cxx:3415:13
> #6 0x7f30b5b941b4 in lcl_NotifyBackgroundOfObj(SwDrawContact const&, 
SdrObject const&, tools::Rectangle const*) 
/sw/source/core/draw/dcontact.cxx:955:13
> #7 0x7f30b5b7c9b9 in SwDrawContact::DisconnectFromLayout(bool) 
/sw/source/core/draw/dcontact.cxx:1689:9
> #8 0x7f30b5ba0cae in SwDrawContact::SwClientNotify(SwModify const&, 
SfxHint const&) /sw/source/core/draw/dcontact.cxx:1544:17
> #9 0x7f30b399e3c2 in SwModify::CallSwClientNotify(SfxHint const&) 
const /sw/source/core/attr/calbck.cxx:311:18
> #10 0x7f30b399e6c5 in 
sw::BroadcastingModify::CallSwClientNotify(SfxHint const&) const 
/sw/source/core/attr/calbck.cxx:316:15
> #11 0x7f30b6656d23 in SwDrawFrameFormat::DelFrames() 
/sw/source/core/layout/atrfrm.cxx:3525:5
> #12 0x7f30b51785f8 in 
sw::DocumentLayoutManager::DelLayoutFormat(SwFrameFormat*) 
/sw/source/core/doc/DocumentLayoutManager.cxx:235:14
> #13 0x7f30b4df70ac in 
sw::DocumentContentOperationsManager::DelFullPara(SwPaM&) 
/sw/source/core/doc/DocumentContentOperationsManager.cxx:2343:55
> #14 0x7f30b42b5701 in SwDoc::RemoveInvisibleContent() 
/sw/source/core/doc/doc.cxx:1576:57
> #15 0x7f30ba70c920 in SwDBManager::MergeMailFiles(SwWrtShell*, 
SwMergeDescriptor const&) /sw/source/uibase/dbui/dbmgr.cxx:1468:35
> #16 0x7f30ba6f7eff in SwDBManager::Merge(SwMergeDescriptor const&) 
/sw/source/uibase/dbui/dbmgr.cxx:556:20
> #17 0x7f30bbe0d561 in 
SwXMailMerge::execute(com::sun::star::uno::Sequence
 const&) /sw/source/uibase/uno/unomailmerge.cxx:786:24
> #18 0x7f30bbe103ce in non-virtual thunk to 
SwXMailMerge::execute(com::sun::star::uno::Sequence
 const&) /sw/source/uibase/uno/unomailmerge.cxx
> #19 0x7f30d009b8ed in (anonymous 
namespace)::MMTest2::executeMailMerge(bool) 
/sw/qa/extras/mailmerge/mailmerge2.cxx:195:31
> #20 0x7f30d00eb3e5 in (anonymous 
namespace)::testTdf123057_file::verify() 
/sw/qa/extras/mailmerge/mailmerge2.cxx:597:5
> #21 0x7f30d00a11eb in (anonymous 
namespace)::MMTest2::executeMailMergeTest(char const*, char const*, char 
const*, char const*, int, char const*) 
/sw/qa/extras/mailmerge/mailmerge2.cxx:99:9
> #22 0x7f30d00efc32 in (anonymous 
namespace)::testTdf123057_file::MailMerge() 
/sw/qa/extras/mailmerge/mailmerge2.cxx:594:1
> (;)

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

diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index 66ec8ea9e7c2..b45c8d100fcb 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -609,7 +609,7 @@ bool SwFlowFrame::PasteTree( SwFrame *pStart, SwLayoutFrame 
*pParent, SwFrame *p
 else
 bRet = true;
 
-nGrowVal += aRectFnSet.GetHeight(pFloat->getFrameArea());
+nGrowVal = o3tl::saturating_add(nGrowVal, 
aRectFnSet.GetHeight(pFloat->getFrameArea()));
 if ( pFloat->GetNext() )
 pFloat = pFloat->GetNext();
 else
diff --git a/sw/source/core/layout/sectfrm.cxx 
b/sw/source/core/layout/sectfrm.cxx
index c92af1303fae..4dc31c4256fd 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -2726,8 +2726,9 @@ void SwSectionFrame::SwClientNotify(const SwModify& rMod, 
const SfxHint& rHint)
 InvalidateObjs(false);
 {
 // Set it to a 

core.git: sw/source

2024-06-04 Thread Andrea Gelmini (via logerrit)
 sw/source/core/inc/flowfrm.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit eb6c458bc97d18da342c7cd1aca5306b2ffe04e9
Author: Andrea Gelmini 
AuthorDate: Mon Jun 3 15:49:38 2024 +0200
Commit: Julien Nabet 
CommitDate: Tue Jun 4 08:58:23 2024 +0200

Fix typo

Change-Id: I29b5c1f75c9126ec274c4e4324c6f4577b9dae7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168378
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index 3d271613bf6a..154fd37febf2 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -48,7 +48,7 @@ class SwNodeIndex;
 multiple base classes since the class tree splits exactly at the branch
 from SwFrame to SwContentFrame and SwLayoutFrame) also virtually from 
SwFrame as
 well. Unfortunately, this leads - besides problems with compilers and
-debugging programs - to high additional costs, that we IMHO are not able to
+debugging programs - too high additional costs, that we IMHO are not able 
to
 afford nowadays.
 
 Hence, we use another technique: A FlowFrame keeps a reference to a SwFrame


core.git: sw/source

2024-06-03 Thread László Németh (via logerrit)
 sw/source/core/layout/paintfrm.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 03aa8a1d9bfe4af2f37df0bde42193c2cf90ffb4
Author: László Németh 
AuthorDate: Mon Jun 3 16:27:55 2024 +0200
Commit: László Németh 
CommitDate: Mon Jun 3 21:50:26 2024 +0200

tdf#77388 sw: fix missing table border at cropped images

At images cropped by the bottom or right cell boundaries,
or at images with zero padding in table cells (e.g, in
test document of tdf#160836), table borders were hovered
by the image, resulting missing table borders.

First paint the cell content, and after that the DOCX-like
"collapsing" cell borders in SwTabFrame::PaintSwFrame.

Note: this doesn't modify painting of the objects
anchored to characters (which still hovers the cell borders),
and painting of the text content of the cells (which are
still hovered by the cell borders at zero padding, despite
their non-transparent background color).

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

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index c572585e597a..fd426234a652 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4667,6 +4667,8 @@ void SwTabFrame::PaintSwFrame(vcl::RenderContext& 
rRenderContext, SwRect const&
 const SwViewOption* pViewOption = gProp.pSGlobalShell->GetViewOptions();
 if (pViewOption->IsTable())
 {
+SwLayoutFrame::PaintSwFrame( rRenderContext, rRect );
+
 // #i29550#
 if ( IsCollapsingBorders() )
 {
@@ -4684,8 +4686,6 @@ void SwTabFrame::PaintSwFrame(vcl::RenderContext& 
rRenderContext, SwRect const&
 SwTabFramePainter aHelper(*this);
 aHelper.PaintLines(rRenderContext, rRect);
 }
-
-SwLayoutFrame::PaintSwFrame( rRenderContext, rRect );
 }
 // #i6467# - no light grey rectangle for page preview
 else if ( gProp.pSGlobalShell->GetWin() && 
!gProp.pSGlobalShell->IsPreview() )


core.git: sw/source

2024-06-03 Thread Noel Grandin (via logerrit)
 sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx |   57 +-
 sw/source/uibase/sidebar/PageColumnControl.cxx|   24 +++
 sw/source/uibase/sidebar/PageColumnPopup.cxx  |4 -
 sw/source/uibase/sidebar/PageFooterPanel.cxx  |   14 ++--
 sw/source/uibase/sidebar/PageFormatPanel.cxx  |   16 ++---
 sw/source/uibase/sidebar/PageHeaderPanel.cxx  |   16 ++---
 sw/source/uibase/sidebar/PageMarginControl.cxx|   44 ++---
 sw/source/uibase/sidebar/PageMarginPopup.cxx  |4 -
 sw/source/uibase/sidebar/PageOrientationControl.cxx   |8 +-
 sw/source/uibase/sidebar/PageOrientationPopup.cxx |4 -
 sw/source/uibase/sidebar/PageSizeControl.cxx  |8 +-
 sw/source/uibase/sidebar/PageSizePopup.cxx|4 -
 sw/source/uibase/sidebar/PageStylesPanel.cxx  |   24 +++
 sw/source/uibase/sidebar/QuickFindPanel.cxx   |   10 +--
 sw/source/uibase/sidebar/StylePresetsPanel.cxx|6 -
 sw/source/uibase/sidebar/SwPanelFactory.cxx   |   16 ++---
 sw/source/uibase/sidebar/TableEditPanel.cxx   |   36 +--
 sw/source/uibase/sidebar/ThemePanel.cxx   |8 +-
 sw/source/uibase/sidebar/WrapPropertyPanel.cxx|   12 +--
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |   33 +-
 20 files changed, 175 insertions(+), 173 deletions(-)

New commits:
commit 782f7c23af25187b9205e7ca036cb819834be2df
Author: Noel Grandin 
AuthorDate: Mon Jun 3 14:37:41 2024 +0200
Commit: Noel Grandin 
CommitDate: Mon Jun 3 19:35:46 2024 +0200

loplugin:ostr in sw/.../sidebar

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

diff --git a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx 
b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
index 8a41db78f0ac..bf5333ac6456 100644
--- a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
+++ b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
@@ -32,11 +32,11 @@ namespace sw::sidebar
 {
 AccessibilityCheckEntry::AccessibilityCheckEntry(
 weld::Container* pParent, std::shared_ptr const& 
rAccessibilityIssue)
-: m_xBuilder(Application::CreateBuilder(pParent, 
"svx/ui/accessibilitycheckentry.ui"))
-, m_xContainer(m_xBuilder->weld_container("accessibilityCheckEntryBox"))
-, m_xLabel(m_xBuilder->weld_label("accessibilityCheckEntryLabel"))
-, 
m_xGotoButton(m_xBuilder->weld_link_button("accessibilityCheckEntryLinkButton"))
-, m_xFixButton(m_xBuilder->weld_button("accessibilityCheckEntryFixButton"))
+: m_xBuilder(Application::CreateBuilder(pParent, 
u"svx/ui/accessibilitycheckentry.ui"_ustr))
+, 
m_xContainer(m_xBuilder->weld_container(u"accessibilityCheckEntryBox"_ustr))
+, m_xLabel(m_xBuilder->weld_label(u"accessibilityCheckEntryLabel"_ustr))
+, 
m_xGotoButton(m_xBuilder->weld_link_button(u"accessibilityCheckEntryLinkButton"_ustr))
+, 
m_xFixButton(m_xBuilder->weld_button(u"accessibilityCheckEntryFixButton"_ustr))
 , m_pAccessibilityIssue(rAccessibilityIssue)
 {
 // lock in the height as including the button so all rows are the same 
height
@@ -97,39 +97,40 @@ std::unique_ptr 
A11yCheckIssuesPanel::Create(weld::Widget* pParent,
 {
 if (pParent == nullptr)
 throw ::com::sun::star::lang::IllegalArgumentException(
-"no parent window given to A11yCheckIssuesPanel::Create", nullptr, 
0);
+u"no parent window given to A11yCheckIssuesPanel::Create"_ustr, 
nullptr, 0);
 return std::make_unique(pParent, pBindings);
 }
 
 A11yCheckIssuesPanel::A11yCheckIssuesPanel(weld::Widget* pParent, SfxBindings* 
pBindings)
-: PanelLayout(pParent, "A11yCheckIssuesPanel", 
"modules/swriter/ui/a11ycheckissuespanel.ui")
+: PanelLayout(pParent, u"A11yCheckIssuesPanel"_ustr,
+  u"modules/swriter/ui/a11ycheckissuespanel.ui"_ustr)
 , mpBindings(pBindings)
 , mpDoc(nullptr)
 , maA11yCheckController(FN_STAT_ACCESSIBILITY_CHECK, *pBindings, *this)
 , mnIssueCount(0)
 , mbAutomaticCheckEnabled(false)
 {
-m_xExpanders[0] = m_xBuilder->weld_expander("expand_document");
-m_xExpanders[1] = m_xBuilder->weld_expander("expand_styles");
-m_xExpanders[2] = m_xBuilder->weld_expander("expand_linked");
-m_xExpanders[3] = m_xBuilder->weld_expander("expand_no_alt");
-m_xExpanders[4] = m_xBuilder->weld_expander("expand_table");
-m_xExpanders[5] = m_xBuilder->weld_expander("expand_formatting");
-m_xExpanders[6] = m_xBuilder->weld_expander("expand_hyperlink");
-m_xExpanders[7] = m_xBuilder->weld_expander("expand_fakes");
-m_xExpanders[8] = m_xBuilder->weld_expander("expand_numbering");
-m_xExpanders[9] = m_xBuilder->weld_expander("expand_other");
-
-m_xBoxes[0] = m_xBuilder->weld_box("box_document");
-m_xBoxes[1] = m_xBuilder->weld_box("box_styles");
-

core.git: sw/source

2024-06-03 Thread Noel Grandin (via logerrit)
 sw/source/ui/fldui/DateFormFieldDialog.cxx |7 ++-
 sw/source/ui/fldui/DropDownFieldDialog.cxx |   12 +++---
 sw/source/ui/fldui/DropDownFormFieldDialog.cxx |   16 
 sw/source/ui/fldui/changedb.cxx|   14 +++
 sw/source/ui/fldui/flddb.cxx   |   28 +++
 sw/source/ui/fldui/flddinf.cxx |   24 ++---
 sw/source/ui/fldui/flddok.cxx  |   32 -
 sw/source/ui/fldui/fldedt.cxx  |8 ++--
 sw/source/ui/fldui/fldfunc.cxx |   46 -
 sw/source/ui/fldui/fldpage.cxx |4 +-
 sw/source/ui/fldui/fldref.cxx  |   28 +++
 sw/source/ui/fldui/fldtdlg.cxx |   40 ++---
 sw/source/ui/fldui/fldvar.cxx  |   38 ++--
 sw/source/ui/fldui/inpdlg.cxx  |   12 +++---
 sw/source/ui/fldui/javaedit.cxx|   22 +--
 15 files changed, 166 insertions(+), 165 deletions(-)

New commits:
commit d620821608a4b89d10ce4b93aa03e6e6d5d04fa8
Author: Noel Grandin 
AuthorDate: Mon Jun 3 12:08:21 2024 +0200
Commit: Noel Grandin 
CommitDate: Mon Jun 3 14:36:20 2024 +0200

loplugin:ostr in sw/.../fldui

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

diff --git a/sw/source/ui/fldui/DateFormFieldDialog.cxx 
b/sw/source/ui/fldui/DateFormFieldDialog.cxx
index 24461c47d6b2..85baf0ed62f5 100644
--- a/sw/source/ui/fldui/DateFormFieldDialog.cxx
+++ b/sw/source/ui/fldui/DateFormFieldDialog.cxx
@@ -19,11 +19,12 @@ namespace sw
 {
 DateFormFieldDialog::DateFormFieldDialog(weld::Widget* pParent,
  sw::mark::IDateFieldmark* pDateField, 
SwDoc& rDoc)
-: GenericDialogController(pParent, 
"modules/swriter/ui/dateformfielddialog.ui",
-  "DateFormFieldDialog")
+: GenericDialogController(pParent, 
u"modules/swriter/ui/dateformfielddialog.ui"_ustr,
+  u"DateFormFieldDialog"_ustr)
 , m_pDateField(pDateField)
 , m_pNumberFormatter(rDoc.GetNumberFormatter())
-, m_xFormatLB(new 
SwNumFormatTreeView(m_xBuilder->weld_tree_view("date_formats_treeview")))
+, m_xFormatLB(
+  new 
SwNumFormatTreeView(m_xBuilder->weld_tree_view(u"date_formats_treeview"_ustr)))
 {
 m_xFormatLB->SetFormatType(SvNumFormatType::DATE);
 m_xFormatLB->SetAutomaticLanguage(true);
diff --git a/sw/source/ui/fldui/DropDownFieldDialog.cxx 
b/sw/source/ui/fldui/DropDownFieldDialog.cxx
index d85bc5365bee..b5dc3e36ebea 100644
--- a/sw/source/ui/fldui/DropDownFieldDialog.cxx
+++ b/sw/source/ui/fldui/DropDownFieldDialog.cxx
@@ -29,15 +29,15 @@ using namespace ::com::sun::star;
 // edit insert-field
 sw::DropDownFieldDialog::DropDownFieldDialog(weld::Widget *pParent, SwWrtShell 
,
   SwField* pField, bool bPrevButton, bool 
bNextButton)
-: GenericDialogController(pParent, 
"modules/swriter/ui/dropdownfielddialog.ui", "DropdownFieldDialog")
+: GenericDialogController(pParent, 
u"modules/swriter/ui/dropdownfielddialog.ui"_ustr, u"DropdownFieldDialog"_ustr)
 , m_rSh( rS )
 , m_pDropField(nullptr)
 , m_pPressedButton(nullptr)
-, m_xListItemsLB(m_xBuilder->weld_tree_view("list"))
-, m_xOKPB(m_xBuilder->weld_button("ok"))
-, m_xPrevPB(m_xBuilder->weld_button("prev"))
-, m_xNextPB(m_xBuilder->weld_button("next"))
-, m_xEditPB(m_xBuilder->weld_button("edit"))
+, m_xListItemsLB(m_xBuilder->weld_tree_view(u"list"_ustr))
+, m_xOKPB(m_xBuilder->weld_button(u"ok"_ustr))
+, m_xPrevPB(m_xBuilder->weld_button(u"prev"_ustr))
+, m_xNextPB(m_xBuilder->weld_button(u"next"_ustr))
+, m_xEditPB(m_xBuilder->weld_button(u"edit"_ustr))
 {
 
m_xListItemsLB->set_size_request(m_xListItemsLB->get_approximate_digit_width() 
* 24,
  m_xListItemsLB->get_height_rows(12));
diff --git a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx 
b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
index a28d9f1f5fab..dab673c45da5 100644
--- a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
+++ b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
@@ -19,16 +19,16 @@ namespace sw
 {
 DropDownFormFieldDialog::DropDownFormFieldDialog(weld::Widget* pParent,
  mark::IFieldmark* 
pDropDownField)
-: GenericDialogController(pParent, 
"modules/swriter/ui/dropdownformfielddialog.ui",
-  "DropDownFormFieldDialog")
+: GenericDialogController(pParent, 
u"modules/swriter/ui/dropdownformfielddialog.ui"_ustr,
+  u"DropDownFormFieldDialog"_ustr)
 , m_pDropDownField(pDropDownField)
 , m_bListHasChanged(false)
-, 

core.git: sw/source

2024-06-03 Thread Caolán McNamara (via logerrit)
 sw/source/filter/html/htmlgrin.cxx |4 ++--
 sw/source/filter/html/htmlplug.cxx |8 
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 24b06580577425681e22472ee68ab00e9c509a83
Author: Caolán McNamara 
AuthorDate: Sun Jun 2 12:19:41 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Jun 3 11:21:01 2024 +0200

cid#1602448 Unchecked return value

and

cid#1602447 Unchecked return value
cid#1602444 Unchecked return value

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

diff --git a/sw/source/filter/html/htmlgrin.cxx 
b/sw/source/filter/html/htmlgrin.cxx
index 4b5a0d5e4bd5..c8c15997ab78 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -563,7 +563,7 @@ IMAGE_SETEVENT:
 SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
 SvxCSS1PropertyInfo aPropInfo;
 if( HasStyleOptions( aStyle, aId, aClass ) )
-ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo );
+(void)ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo );
 
 SfxItemSetFixed aFrameSet( 
m_xDoc->GetAttrPool() );
 if( !IsNewDoc() )
@@ -1093,7 +1093,7 @@ void SwHTMLParser::InsertBodyOptions()
 SfxItemSet aItemSet( m_xDoc->GetAttrPool(), 
m_pCSS1Parser->GetWhichMap() );
 SvxCSS1PropertyInfo aPropInfo;
 OUString aDummy;
-ParseStyleOptions( aStyle, aDummy, aDummy, aItemSet, aPropInfo, 
nullptr,  );
+(void)ParseStyleOptions( aStyle, aDummy, aDummy, aItemSet, aPropInfo, 
nullptr,  );
 
 // Some attributes have to set on the page style, in fact the ones
 // which aren't inherited
diff --git a/sw/source/filter/html/htmlplug.cxx 
b/sw/source/filter/html/htmlplug.cxx
index 80453237045d..720a9a929647 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -453,7 +453,7 @@ bool SwHTMLParser::InsertEmbed()
 SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
 SvxCSS1PropertyInfo aPropInfo;
 if( HasStyleOptions( aStyle, aId, aClass ) )
-ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo );
+(void)ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo );
 
 // Convert the default values (except height/width, which is done by 
SetFrameSize())
 if( eVertOri==text::VertOrientation::NONE && 
eHoriOri==text::HoriOrientation::NONE )
@@ -834,7 +834,7 @@ void SwHTMLParser::NewObject()
 SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
 SvxCSS1PropertyInfo aPropInfo;
 if( HasStyleOptions( aStyle, aId, aClass ) )
-ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo );
+(void)ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo );
 
 SfxItemSet& rFrameSet = m_pAppletImpl->GetItemSet();
 if( !IsNewDoc() )
@@ -964,7 +964,7 @@ void SwHTMLParser::InsertApplet()
 SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
 SvxCSS1PropertyInfo aPropInfo;
 if( HasStyleOptions( aStyle, aId, aClass ) )
-ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo );
+(void)ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo );
 
 SfxItemSet& rFrameSet = m_pAppletImpl->GetItemSet();
 if( !IsNewDoc() )
@@ -1148,7 +1148,7 @@ void SwHTMLParser::InsertFloatingFrame()
 SfxItemSet aItemSet( m_xDoc->GetAttrPool(), m_pCSS1Parser->GetWhichMap() );
 SvxCSS1PropertyInfo aPropInfo;
 if( HasStyleOptions( aStyle, aId, aClass ) )
-ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo );
+(void)ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo );
 
 // fetch the ItemSet
 SfxItemSetFixed aFrameSet( 
m_xDoc->GetAttrPool() );


core.git: sw/source

2024-06-03 Thread Ilmari Lauhakangas (via logerrit)
 sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e5e3188165e2e3dd81f5e7ec554fe66f20f7b8fc
Author: Ilmari Lauhakangas 
AuthorDate: Sun Jun 2 18:49:58 2024 +0300
Commit: Ilmari Lauhakangas 
CommitDate: Mon Jun 3 08:32:38 2024 +0200

Fix typo

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

diff --git a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx 
b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
index 7bbbf130678c..8a41db78f0ac 100644
--- a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
+++ b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
@@ -164,8 +164,8 @@ void A11yCheckIssuesPanel::ImplDestroy()
 mpBindings->Invalidate(SID_ACCESSIBILITY_CHECK_ONLINE);
 }
 
-for (auto& xExapnder : m_xExpanders)
-xExapnder.reset();
+for (auto& xExpander : m_xExpanders)
+xExpander.reset();
 
 for (auto& xBox : m_xBoxes)
 xBox.reset();


core.git: sw/source

2024-06-02 Thread Julien Nabet (via logerrit)
 sw/source/core/doc/docredln.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit fc37066963a866eeb342b3a41b916f2574f5de28
Author: Julien Nabet 
AuthorDate: Sun Jun 2 09:20:32 2024 +0200
Commit: Julien Nabet 
CommitDate: Sun Jun 2 12:27:48 2024 +0200

cid#1602443: use_after_free

Change-Id: Ic7525bbd2d4d26f6bf07ecfb6ba6cf056a98580a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168339
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Julien Nabet 

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index fe1c917ba9c3..91c4c5a29bff 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -719,11 +719,11 @@ void SwRedlineTable::DeleteAndDestroyAll()
 void SwRedlineTable::DeleteAndDestroy(size_type const nP)
 {
 auto const pRedline = maVector[nP];
+if (pRedline == mpMaxEndPos)
+mpMaxEndPos = nullptr;
 maVector.erase(maVector.begin() + nP);
 LOKRedlineNotification(RedlineNotification::Remove, pRedline);
 delete pRedline;
-if (pRedline == mpMaxEndPos)
-mpMaxEndPos = nullptr;
 }
 
 SwRedlineTable::size_type SwRedlineTable::FindNextOfSeqNo( size_type nSttPos ) 
const


core.git: sw/source

2024-06-01 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/uiview/view.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 1071db05c2b5a5a9974ec9ece12f60217ab86db6
Author: Caolán McNamara 
AuthorDate: Sat Jun 1 20:16:17 2024 +0100
Commit: Caolán McNamara 
CommitDate: Sun Jun 2 00:42:16 2024 +0200

ofz#69356 Integer-overflow

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

diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 6578944aa4a8..29fa3f3281ef 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1430,23 +1430,23 @@ void SwView::ReadUserDataSequence ( const uno::Sequence 
< beans::PropertyValue >
 if ( rValue.Name == "ViewLeft" )
 {
rValue.Value >>= nX;
-   nX = o3tl::toTwips(nX, o3tl::Length::mm100);
+   nX = o3tl::convertSaturate(nX, o3tl::Length::mm100, 
o3tl::Length::twip);
 }
 else if ( rValue.Name == "ViewTop" )
 {
rValue.Value >>= nY;
-   nY = o3tl::toTwips(nY, o3tl::Length::mm100);
+   nY = o3tl::convertSaturate(nY, o3tl::Length::mm100, 
o3tl::Length::twip);
 }
 else if ( rValue.Name == "VisibleLeft" )
 {
rValue.Value >>= nLeft;
-   nLeft = o3tl::toTwips(nLeft, o3tl::Length::mm100);
+   nLeft = o3tl::convertSaturate(nLeft, o3tl::Length::mm100, 
o3tl::Length::twip);
bGotVisibleLeft = true;
 }
 else if ( rValue.Name == "VisibleTop" )
 {
rValue.Value >>= nTop;
-   nTop = o3tl::toTwips(nTop, o3tl::Length::mm100);
+   nTop = o3tl::convertSaturate(nTop, o3tl::Length::mm100, 
o3tl::Length::twip);
bGotVisibleTop = true;
 }
 else if ( rValue.Name == "ZoomType" )


core.git: sw/source

2024-06-01 Thread Noel Grandin (via logerrit)
 sw/source/core/doc/DocumentRedlineManager.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 1291edd7ed369ee97177cab2910f2396302ebacf
Author: Noel Grandin 
AuthorDate: Fri May 31 15:04:27 2024 +0200
Commit: Noel Grandin 
CommitDate: Sat Jun 1 12:55:53 2024 +0200

tdf#144208 speedup doc with lots of redline(2)

use iterators to avoid indexing and cost of repeatedly calling size(),
shaves 1-2% off load time

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

diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 6e287c6fb91f..9ae003980701 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -2823,9 +2823,9 @@ SwRedlineTable::size_type 
DocumentRedlineManager::GetRedlinePos( const SwNode& r
 }
 else
 {
-for( SwRedlineTable::size_type n = 0; n < maRedlineTable.size() ; ++n )
+for( auto it = maRedlineTable.begin(), itEnd = maRedlineTable.end(); 
it != itEnd; ++it )
 {
-const SwRangeRedline* pTmp = maRedlineTable[ n ];
+const SwRangeRedline* pTmp = *it;
 SwNodeOffset nPt = pTmp->GetPoint()->GetNodeIndex(),
   nMk = pTmp->GetMark()->GetNodeIndex();
 if( nPt < nMk )
@@ -2833,7 +2833,7 @@ SwRedlineTable::size_type 
DocumentRedlineManager::GetRedlinePos( const SwNode& r
 
 if( ( RedlineType::Any == nType || nType == pTmp->GetType()) &&
 nMk <= nNdIdx && nNdIdx <= nPt )
-return n;
+return std::distance(maRedlineTable.begin(), it);
 
 if( nMk > nNdIdx )
 break;


core.git: sw/source sw/uiconfig

2024-05-31 Thread Miklos Vajna (via logerrit)
 sw/source/ui/misc/pgfnote.cxx  |   29 +
 sw/source/uibase/inc/pgfnote.hxx   |4 
 sw/source/uibase/utlui/uitool.cxx  |7 +++
 sw/uiconfig/swriter/ui/footnoteareapage.ui |8 
 4 files changed, 44 insertions(+), 4 deletions(-)

New commits:
commit 8f3e11dc9a4b3fd9ad1985d88b241df7bcb66fec
Author: Miklos Vajna 
AuthorDate: Fri May 31 16:11:42 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 31 21:59:57 2024 +0200

tdf#160984 sw continuous endnotes: hide not functional UI in this mode

Previous commits bug have fixed cases where opening a Word document
rendered a different foot/endnote separator than expected for Word. The
followings were modified:

- distance between body text and separator, between separator and first
  note

- the vertical position of the line

- the length of the line

Now ODT files keep the original feature set and Word files look as
expected, but a couple of UI controls are ignored by the layout, hide
these as they intentionally don't do anything while we're in Word compat
mode.

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

diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index 0316f6251eaa..9ed64e3e3de6 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -99,13 +100,17 @@ SwFootNotePage::SwFootNotePage(weld::Container* pPage, 
weld::DialogController* p
 , m_xMaxHeightPageBtn(m_xBuilder->weld_radio_button("maxheightpage"))
 , m_xMaxHeightBtn(m_xBuilder->weld_radio_button("maxheight"))
 , m_xMaxHeightEdit(m_xBuilder->weld_metric_spin_button("maxheightsb", 
FieldUnit::CM))
+, m_xDistLabel(m_xBuilder->weld_label("spacetotextlabel"))
 , m_xDistEdit(m_xBuilder->weld_metric_spin_button("spacetotext", 
FieldUnit::CM))
+, m_xLinePosLabel(m_xBuilder->weld_label("positionlabel"))
 , m_xLinePosBox(m_xBuilder->weld_combo_box("position"))
 , m_xLineTypeBox(new SvtLineListBox(m_xBuilder->weld_menu_button("style")))
 , m_xLineWidthEdit(m_xBuilder->weld_metric_spin_button("thickness", 
FieldUnit::POINT))
 , m_xLineColorBox(new ColorListBox(m_xBuilder->weld_menu_button("color"),
 [this]{ return GetDialogController()->getDialog(); }))
+, m_xLineLengthLabel(m_xBuilder->weld_label("lengthlabel"))
 , m_xLineLengthEdit(m_xBuilder->weld_metric_spin_button("length", 
FieldUnit::PERCENT))
+, m_xLineDistLabel(m_xBuilder->weld_label("spacingtocontentslabel"))
 , m_xLineDistEdit(m_xBuilder->weld_metric_spin_button("spacingtocontents", 
FieldUnit::CM))
 {
 SetExchangeSupport();
@@ -116,6 +121,30 @@ SwFootNotePage::SwFootNotePage(weld::Container* pPage, 
weld::DialogController* p
 MeasurementSystem eSys = 
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
 tools::Long nHeightValue = MeasurementSystem::Metric != eSys ? 1440 : 1134;
 
m_xMaxHeightEdit->set_value(m_xMaxHeightEdit->normalize(nHeightValue),FieldUnit::TWIP);
+
+bool bContinuousEndnotes = false;
+if (const SfxGrabBagItem* pGragbagItem = 
rSet.GetItemIfSet(SID_ATTR_CHAR_GRABBAG))
+{
+auto it = pGragbagItem->GetGrabBag().find("ContinuousEndnotes");
+if (it != pGragbagItem->GetGrabBag().end())
+{
+it->second >>= bContinuousEndnotes;
+}
+}
+
+if (bContinuousEndnotes)
+{
+// These are ignored in SwFootnoteContFrame::Format() and 
SwFootnoteContFrame::PaintLine(),
+// hide them.
+m_xDistLabel->set_visible(false);
+m_xDistEdit->set_visible(false);
+m_xLinePosLabel->set_visible(false);
+m_xLinePosBox->set_visible(false);
+m_xLineLengthLabel->set_visible(false);
+m_xLineLengthEdit->set_visible(false);
+m_xLineDistLabel->set_visible(false);
+m_xLineDistEdit->set_visible(false);
+}
 }
 
 SwFootNotePage::~SwFootNotePage()
diff --git a/sw/source/uibase/inc/pgfnote.hxx b/sw/source/uibase/inc/pgfnote.hxx
index c239f1ed292f..0abb09a80a9d 100644
--- a/sw/source/uibase/inc/pgfnote.hxx
+++ b/sw/source/uibase/inc/pgfnote.hxx
@@ -44,12 +44,16 @@ private:
 std::unique_ptr m_xMaxHeightPageBtn;
 std::unique_ptr m_xMaxHeightBtn;
 std::unique_ptr m_xMaxHeightEdit;
+std::unique_ptr m_xDistLabel;
 std::unique_ptr m_xDistEdit;
+std::unique_ptr m_xLinePosLabel;
 std::unique_ptr m_xLinePosBox;
 std::unique_ptr m_xLineTypeBox;
 std::unique_ptr m_xLineWidthEdit;
 std::unique_ptr m_xLineColorBox;
+std::unique_ptr m_xLineLengthLabel;
 std::unique_ptr m_xLineLengthEdit;
+std::unique_ptr m_xLineDistLabel;
 std::unique_ptr m_xLineDistEdit;
 
 

core.git: sw/source

2024-05-31 Thread Noel Grandin (via logerrit)
 sw/source/core/edit/edlingu.cxx |  183 
 1 file changed, 74 insertions(+), 109 deletions(-)

New commits:
commit c22ad4f8cbefa68a675cc4eec3045bd9519b5342
Author: Noel Grandin 
AuthorDate: Thu May 30 13:58:24 2024 +0200
Commit: Noel Grandin 
CommitDate: Fri May 31 09:54:02 2024 +0200

unique_ptr->optional in SwLinguIter

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

diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index e1bcd3f23520..41123a009e63 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -67,29 +67,17 @@ namespace {
 class SwLinguIter
 {
 SwEditShell* m_pSh;
-std::unique_ptr m_pStart;
-std::unique_ptr m_pEnd;
-std::unique_ptr m_pCurr;
-std::unique_ptr m_pCurrX;
+public:
+std::optional m_oStart;
+std::optional m_oEnd;
+std::optional m_oCurr;
+std::optional m_oCurrX;
 sal_uInt16 m_nCursorCount;
 
-public:
 SwLinguIter();
 
 SwEditShell* GetSh() { return m_pSh; }
 
-const SwPosition *GetEnd() const { return m_pEnd.get(); }
-void SetEnd(SwPosition* pNew) { m_pEnd.reset(pNew); }
-
-const SwPosition *GetStart() const { return m_pStart.get(); }
-void SetStart(SwPosition* pNew) { m_pStart.reset(pNew); }
-
-const SwPosition *GetCurr() const { return m_pCurr.get(); }
-void SetCurr(SwPosition* pNew) { m_pCurr.reset(pNew); }
-
-const SwPosition *GetCurrX() const { return m_pCurrX.get(); }
-void SetCurrX(SwPosition* pNew) { m_pCurrX.reset(pNew); }
-
 sal_uInt16& GetCursorCnt() { return m_nCursorCount; }
 
 // for the UI:
@@ -215,13 +203,13 @@ void SwLinguIter::Start_( SwEditShell *pShell, 
SwDocPositions eStart,
 
 CurrShell aCurr(m_pSh);
 
-OSL_ENSURE(!m_pEnd, "SwLinguIter::Start_ without End?");
+OSL_ENSURE(!m_oEnd, "SwLinguIter::Start_ without End?");
 
 SwPaM* pCursor = m_pSh->GetCursor();
 
 if( pShell->HasSelection() || pCursor != pCursor->GetNext() )
 {
-bSetCurr = nullptr != GetCurr();
+bSetCurr = m_oCurr.has_value();
 m_nCursorCount = m_pSh->GetCursorCnt();
 if (m_pSh->IsTableMode())
 m_pSh->TableCursorToCursor();
@@ -247,14 +235,12 @@ void SwLinguIter::Start_( SwEditShell *pShell, 
SwDocPositions eStart,
 if ( *pCursor->GetPoint() > *pCursor->GetMark() )
 pCursor->Exchange();
 
-m_pStart.reset(new SwPosition(*pCursor->GetPoint()));
-m_pEnd.reset(new SwPosition(*pCursor->GetMark()));
+m_oStart.emplace(*pCursor->GetPoint());
+m_oEnd.emplace(*pCursor->GetMark());
 if( bSetCurr )
 {
-SwPosition* pNew = new SwPosition( *GetStart() );
-SetCurr( pNew );
-pNew = new SwPosition( *pNew );
-SetCurrX( pNew );
+m_oCurr.emplace( *m_oStart );
+m_oCurrX.emplace( *m_oCurr );
 }
 
 pCursor->SetMark();
@@ -265,7 +251,7 @@ void SwLinguIter::End_(bool bRestoreSelection)
 if (!m_pSh)
 return;
 
-OSL_ENSURE(m_pEnd, "SwLinguIter::End_ without end?");
+OSL_ENSURE(m_oEnd, "SwLinguIter::End_ without end?");
 if(bRestoreSelection)
 {
 while (m_nCursorCount--)
@@ -274,10 +260,10 @@ void SwLinguIter::End_(bool bRestoreSelection)
 m_pSh->KillPams();
 m_pSh->ClearMark();
 }
-m_pStart.reset();
-m_pEnd.reset();
-m_pCurr.reset();
-m_pCurrX.reset();
+m_oStart.reset();
+m_oEnd.reset();
+m_oCurr.reset();
+m_oCurrX.reset();
 
 m_pSh = nullptr;
 }
@@ -307,7 +293,7 @@ uno::Any SwSpellIter::Continue( sal_uInt16* pPageCnt, 
sal_uInt16* pPageSt )
 if( !pMySh )
 return aSpellRet;
 
-OSL_ENSURE( GetEnd(), "SwSpellIter::Continue without start?");
+OSL_ENSURE( m_oEnd, "SwSpellIter::Continue without start?");
 
 uno::Reference< uno::XInterface >  xSpellRet;
 bool bGoOn = true;
@@ -316,8 +302,8 @@ uno::Any SwSpellIter::Continue( sal_uInt16* pPageCnt, 
sal_uInt16* pPageSt )
 if ( !pCursor->HasMark() )
 pCursor->SetMark();
 
-*pMySh->GetCursor()->GetPoint() = *GetCurr();
-*pMySh->GetCursor()->GetMark() = *GetEnd();
+*pMySh->GetCursor()->GetPoint() = *m_oCurr;
+*pMySh->GetCursor()->GetMark() = *m_oEnd;
 pMySh->GetDoc()->Spell(*pMySh->GetCursor(), m_xSpeller, pPageCnt, 
pPageSt, false,
pMySh->GetLayout())
 >>= xSpellRet;
@@ -325,10 +311,8 @@ uno::Any SwSpellIter::Continue( sal_uInt16* pPageCnt, 
sal_uInt16* pPageSt )
 if( xSpellRet.is() )
 {
 bGoOn = false;
-SwPosition* pNewPoint = new SwPosition( *pCursor->GetPoint() );
-SwPosition* pNewMark = new SwPosition( *pCursor->GetMark() );
-SetCurr( pNewPoint );
-SetCurrX( pNewMark );
+m_oCurr.emplace( 

core.git: sw/source

2024-05-30 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/docvw/AnnotationWin.cxx  |9 ++---
 sw/source/uibase/docvw/AnnotationWin2.cxx |   10 --
 2 files changed, 10 insertions(+), 9 deletions(-)

New commits:
commit c497cd602d543b4212f79ba1ecf378e415fc
Author: Caolán McNamara 
AuthorDate: Thu May 30 08:47:09 2024 +0100
Commit: Caolán McNamara 
CommitDate: Thu May 30 17:47:37 2024 +0200

ubsan: runtime error: reference binding to null pointer of type 'const 
SwFrame'

since:

commit 124a988ea99096ea5080060c0d1a801528bd7a5c
Date:   Wed May 22 11:57:57 2024 +0100

create comment reply synchronously

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

diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx 
b/sw/source/uibase/docvw/AnnotationWin.cxx
index 409b8be9a7a7..db54099486af 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -120,9 +120,12 @@ SwAnnotationWin::SwAnnotationWin( SwEditWin& rEditWin,
 }
 
 #if !ENABLE_WASM_STRIP_ACCESSIBILITY
-mrMgr.ConnectSidebarWinToFrame( 
*(mrSidebarItem.maLayoutInfo.mpAnchorFrame),
-  mrSidebarItem.GetFormatField(),
-  *this );
+if (rSidebarItem.maLayoutInfo.mpAnchorFrame)
+{
+mrMgr.ConnectSidebarWinToFrame( 
*(rSidebarItem.maLayoutInfo.mpAnchorFrame),
+  mrSidebarItem.GetFormatField(),
+  *this );
+}
 #endif
 
 if (SupportsDoubleBuffering())
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index a20255f1c37b..378d35b174d4 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -1067,16 +1067,13 @@ void SwAnnotationWin::ExecuteCommand(sal_uInt16 nSlot)
 
 SwDocShell* pShell = mrView.GetDocShell();
 if (bReply)
-
pShell->GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::START, nullptr);
+
pShell->GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT, nullptr);
 
 // synchronous dispatch
 mrView.GetViewFrame().GetDispatcher()->Execute(FN_POSTIT);
 
 if (bReply)
 {
-SwUndoId nUndoId(SwUndoId::END);
-mrView.GetWrtShell().GetLastUndoInfo(nullptr, );
-
 // Get newly created SwPostItField and set its paraIdParent
 auto pPostItField = mrMgr.GetLatestPostItField();
 pPostItField->SetParentId(GetTopReplyNote()->GetParaId());
@@ -1092,7 +1089,7 @@ void SwAnnotationWin::ExecuteCommand(sal_uInt16 nSlot)
 
 SwRewriter aRewriter;
 aRewriter.AddRule(UndoArg1, pPostItField->GetDescription());
-pShell->GetDoc()->GetIDocumentUndoRedo().EndUndo(nUndoId, 
);
+
pShell->GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT, );
 }
 break;
 }
@@ -1420,7 +1417,7 @@ void SwAnnotationWin::ChangeSidebarItem( SwSidebarItem 
const & rSidebarItem )
 {
 #if !ENABLE_WASM_STRIP_ACCESSIBILITY
 const bool bAnchorChanged = mpAnchorFrame != 
rSidebarItem.maLayoutInfo.mpAnchorFrame;
-if ( bAnchorChanged )
+if (bAnchorChanged && mpAnchorFrame)
 {
 mrMgr.DisconnectSidebarWinFromFrame( *mpAnchorFrame, *this );
 }
@@ -1428,6 +1425,7 @@ void SwAnnotationWin::ChangeSidebarItem( SwSidebarItem 
const & rSidebarItem )
 
 mrSidebarItem = rSidebarItem;
 mpAnchorFrame = mrSidebarItem.maLayoutInfo.mpAnchorFrame;
+assert(mpAnchorFrame);
 
 #if !ENABLE_WASM_STRIP_ACCESSIBILITY
 if (mxSidebarWinAccessible)


core.git: sw/source

2024-05-29 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/utlui/content.cxx |   17 ++---
 1 file changed, 2 insertions(+), 15 deletions(-)

New commits:
commit 24c28600430668c0bef6c24679a2fd0279d6253f
Author: Jim Raykowski 
AuthorDate: Tue May 28 06:39:19 2024 -0800
Commit: Jim Raykowski 
CommitDate: Thu May 30 00:22:24 2024 +0200

SwNavigator: simplify table delete

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

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 78177a9e226c..edfcac1b63b0 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -5597,21 +5597,8 @@ void SwContentTree::EditEntry(const weld::TreeIter& 
rEntry, EditEntryMode nMode)
 }
 else if(nMode == EditEntryMode::DELETE)
 {
-m_pActiveShell->StartAction();
-OUString sTable = SwResId(STR_TABLE_NAME);
-SwRewriter aRewriterTableName;
-aRewriterTableName.AddRule(UndoArg1, SwResId(STR_START_QUOTE));
-aRewriterTableName.AddRule(UndoArg2, pCnt->GetName());
-aRewriterTableName.AddRule(UndoArg3, SwResId(STR_END_QUOTE));
-sTable = aRewriterTableName.Apply(sTable);
-
-SwRewriter aRewriter;
-aRewriter.AddRule(UndoArg1, sTable);
-m_pActiveShell->StartUndo(SwUndoId::DELETE, );
-
m_pActiveShell->GetView().GetViewFrame().GetDispatcher()->Execute(FN_TABLE_SELECT_ALL);
-m_pActiveShell->DeleteRow();
-m_pActiveShell->EndUndo();
-m_pActiveShell->EndAction();
+m_pActiveShell->SelTable();
+m_pActiveShell->DeleteTable();
 }
 else if(nMode == EditEntryMode::RENAME)
 {


core.git: sw/source

2024-05-29 Thread Noel Grandin (via logerrit)
 sw/source/core/doc/docredln.cxx |   18 +++---
 1 file changed, 7 insertions(+), 11 deletions(-)

New commits:
commit 941d03968cc12a6f7badc2641decd91dbd8f0244
Author: Noel Grandin 
AuthorDate: Tue May 28 15:26:19 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed May 29 18:19:23 2024 +0200

simplify and reduce allocation in SwRedlineTable::getTextOfArea

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

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index b5a9059a579d..9860964a89d6 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -872,33 +872,29 @@ OUString SwRedlineTable::getTextOfArea(size_type 
rPosStart, size_type rPosEnd) c
 SwRangeRedline* pRedline = (*this)[nIdx];
 bool bStartWithNonTextNode = false;
 
-SwPaM *pPaM;
-bool bDeletePaM = false;
+OUString sNew;
 if (nullptr == pRedline->GetContentIdx())
 {
-pPaM = pRedline;
+sNew = pRedline->GetText();
 }
 else // otherwise it is saved in pContentSect, e.g. during ODT import
 {
-pPaM = new SwPaM(pRedline->GetContentIdx()->GetNode(),
+SwPaM aTmpPaM(pRedline->GetContentIdx()->GetNode(),
   
*pRedline->GetContentIdx()->GetNode().EndOfSectionNode());
-if (!pPaM->Start()->nNode.GetNode().GetTextNode())
+if (!aTmpPaM.Start()->nNode.GetNode().GetTextNode())
 {
 bStartWithNonTextNode = true;
 }
-bDeletePaM = true;
+sNew = aTmpPaM.GetText();
 }
-const OUString sNew = pPaM->GetText();
 
 if (bStartWithNonTextNode &&
 sNew[0] == CH_TXTATR_NEWLINE)
 {
-sRet += pPaM->GetText().subView(1);
+sRet += sNew.subView(1);
 }
 else
-sRet += pPaM->GetText();
-if (bDeletePaM)
-delete pPaM;
+sRet += sNew;
 }
 
 return sRet;


core.git: sw/source

2024-05-29 Thread Noel Grandin (via logerrit)
 sw/source/core/doc/docredln.cxx |   29 ++---
 1 file changed, 6 insertions(+), 23 deletions(-)

New commits:
commit e4ca7aa44ad9856c2e5753e749dc031f8fec6a3f
Author: Noel Grandin 
AuthorDate: Tue May 28 15:33:12 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed May 29 12:55:52 2024 +0200

simplify and reduce allocation in SwRedlineTable

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

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index b5a022d8effc..b5a9059a579d 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -932,8 +932,6 @@ bool SwRedlineTable::isMovedImpl(size_type rPos, bool 
bTryCombined) const
 // only deleted or inserted text can be moved
 return false;
 
-bool bDeletePaM = false;
-SwPaM* pPaM = nullptr;
 OUString sTrimmed;
 SwRedlineTable::size_type nPosStart = rPos;
 SwRedlineTable::size_type nPosEnd = rPos;
@@ -950,16 +948,14 @@ bool SwRedlineTable::isMovedImpl(size_type rPos, bool 
bTryCombined) const
 // if this redline is visible the content is in this PaM
 if (nullptr == pRedline->GetContentIdx())
 {
-pPaM = pRedline;
+sTrimmed = pRedline->GetText().trim();
 }
 else // otherwise it is saved in pContentSect, e.g. during ODT import
 {
-pPaM = new SwPaM(pRedline->GetContentIdx()->GetNode(),
+SwPaM aTmpPaM(pRedline->GetContentIdx()->GetNode(),
  
*pRedline->GetContentIdx()->GetNode().EndOfSectionNode());
-bDeletePaM = true;
+sTrimmed = aTmpPaM.GetText().trim();
 }
-
-sTrimmed = pPaM->GetText().trim();
 }
 
 // detection of move needs at least 6 characters with an inner
@@ -968,8 +964,6 @@ bool SwRedlineTable::isMovedImpl(size_type rPos, bool 
bTryCombined) const
 // word parts, e.g. 'the' and 'of a' to detect as text moving
 if (sTrimmed.getLength() < 6 || sTrimmed.indexOf(' ') == -1)
 {
-if (bDeletePaM)
-delete pPaM;
 return false;
 }
 
@@ -995,9 +989,6 @@ bool SwRedlineTable::isMovedImpl(size_type rPos, bool 
bTryCombined) const
 continue;
 }
 
-bool bDeletePairPaM = false;
-SwPaM* pPairPaM = nullptr;
-
 OUString sPairTrimmed = "";
 SwRedlineTable::size_type nPairStart = nPosAct;
 SwRedlineTable::size_type nPairEnd = nPosAct;
@@ -1007,17 +998,15 @@ bool SwRedlineTable::isMovedImpl(size_type rPos, bool 
bTryCombined) const
 // if this redline is visible the content is in this PaM
 if (nullptr == pPair->GetContentIdx())
 {
-pPairPaM = pPair;
+sPairTrimmed = o3tl::trim(pPair->GetText());
 }
 else // otherwise it is saved in pContentSect, e.g. during ODT 
import
 {
 // saved in pContentSect, e.g. during ODT import
-pPairPaM = new SwPaM(pPair->GetContentIdx()->GetNode(),
+SwPaM aPairPaM(pPair->GetContentIdx()->GetNode(),
  
*pPair->GetContentIdx()->GetNode().EndOfSectionNode());
-bDeletePairPaM = true;
+sPairTrimmed = o3tl::trim(aPairPaM.GetText());
 }
-
-sPairTrimmed = o3tl::trim(pPairPaM->GetText());
 }
 else
 {
@@ -1053,18 +1042,12 @@ bool SwRedlineTable::isMovedImpl(size_type rPos, bool 
bTryCombined) const
 bRet = true;
 }
 
-if (bDeletePairPaM)
-delete pPairPaM;
-
 //we can skip the combined redlines
 if (nPass == 1)
 nPosAct = nPairEnd;
 }
 }
 
-if ( bDeletePaM )
-delete pPaM;
-
 return bRet;
 }
 


core.git: sw/source

2024-05-29 Thread Noel Grandin (via logerrit)
 sw/source/writerfilter/dmapper/BorderHandler.cxx|   16 
 sw/source/writerfilter/dmapper/CellColorHandler.cxx |   20 
 sw/source/writerfilter/dmapper/CellMarginHandler.cxx|   12 
 sw/source/writerfilter/dmapper/DocumentProtection.cxx   |   22 
 sw/source/writerfilter/dmapper/DomainMapper.cxx |  220 ++--
 sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx |   76 -
 sw/source/writerfilter/dmapper/DomainMapperTableManager.cxx |   14 
 sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx|  598 ++--
 sw/source/writerfilter/dmapper/FormControlHelper.cxx|   42 
 sw/source/writerfilter/dmapper/GraphicHelpers.cxx   |4 
 sw/source/writerfilter/dmapper/GraphicImport.cxx|  160 +--
 sw/source/writerfilter/dmapper/MeasureHandler.cxx   |8 
 sw/source/writerfilter/dmapper/NumberingManager.cxx |4 
 sw/source/writerfilter/dmapper/OLEHandler.cxx   |   10 
 sw/source/writerfilter/dmapper/PropertyMap.cxx  |   72 -
 sw/source/writerfilter/dmapper/SdtHelper.cxx|   36 
 sw/source/writerfilter/dmapper/SettingsTable.cxx|   66 -
 sw/source/writerfilter/dmapper/StyleSheetTable.cxx  |   64 -
 sw/source/writerfilter/dmapper/TDefTableHandler.cxx |  446 
 sw/source/writerfilter/dmapper/TablePositionHandler.cxx |   44 
 sw/source/writerfilter/dmapper/TablePositionHandler.hxx |4 
 sw/source/writerfilter/dmapper/TablePropertiesHandler.cxx   |   14 
 sw/source/writerfilter/dmapper/TblStylePrHandler.cxx|   40 
 sw/source/writerfilter/dmapper/TextEffectsHandler.cxx   |  512 +-
 sw/source/writerfilter/dmapper/ThemeHandler.cxx |   86 -
 sw/source/writerfilter/dmapper/WriteProtection.cxx  |8 
 sw/source/writerfilter/filter/RtfFilter.cxx |   18 
 sw/source/writerfilter/filter/WriterFilter.cxx  |   67 -
 sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx  |   10 
 sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx|6 
 sw/source/writerfilter/rtftok/rtfdispatchdestination.cxx|5 
 sw/source/writerfilter/rtftok/rtfdispatchflag.cxx   |   21 
 sw/source/writerfilter/rtftok/rtfdispatchsymbol.cxx |6 
 sw/source/writerfilter/rtftok/rtfdispatchvalue.cxx  |4 
 sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx   |   44 
 sw/source/writerfilter/rtftok/rtfdocumentimpl.hxx   |6 
 sw/source/writerfilter/rtftok/rtfsdrimport.cxx  |  137 +-
 sw/source/writerfilter/rtftok/rtfsprm.cxx   |2 
 38 files changed, 1472 insertions(+), 1452 deletions(-)

New commits:
commit 5edbc4fd99db9fa568143aa4fa15b29de4bcc48b
Author: Noel Grandin 
AuthorDate: Thu May 16 13:32:29 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed May 29 12:55:31 2024 +0200

loplugin:ostr in sw/../writerfilter

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

diff --git a/sw/source/writerfilter/dmapper/BorderHandler.cxx 
b/sw/source/writerfilter/dmapper/BorderHandler.cxx
index ed14194c2a01..ad37a1d46c35 100644
--- a/sw/source/writerfilter/dmapper/BorderHandler.cxx
+++ b/sw/source/writerfilter/dmapper/BorderHandler.cxx
@@ -58,37 +58,37 @@ void BorderHandler::lcl_attribute(Id rName, Value & rVal)
 case NS_ooxml::LN_CT_Border_sz:
 //  width of a single line in 1/8 pt, max of 32 pt -> twip * 5 / 2.
 m_nLineWidth = nIntValue * 5 / 2;
-appendGrabBag("sz", OUString::number(nIntValue));
+appendGrabBag(u"sz"_ustr, OUString::number(nIntValue));
 break;
 case NS_ooxml::LN_CT_Border_val:
 m_nLineType = nIntValue;
-appendGrabBag("val", 
TDefTableHandler::getBorderTypeString(nIntValue));
+appendGrabBag(u"val"_ustr, 
TDefTableHandler::getBorderTypeString(nIntValue));
 break;
 case NS_ooxml::LN_CT_Border_color:
 m_nLineColor = nIntValue;
-appendGrabBag("color", 
msfilter::util::ConvertColorOU(Color(ColorTransparency, nIntValue)));
+appendGrabBag(u"color"_ustr, 
msfilter::util::ConvertColorOU(Color(ColorTransparency, nIntValue)));
 break;
 case NS_ooxml::LN_CT_Border_space: // border distance in points
 m_nLineDistance = ConversionHelper::convertTwipToMM100( nIntValue 
* 20 );
-appendGrabBag("space", OUString::number(nIntValue));
+appendGrabBag(u"space"_ustr, OUString::number(nIntValue));
 break;
 case NS_ooxml::LN_CT_Border_shadow:
 m_bShadow = nIntValue;
 break;
 case NS_ooxml::LN_CT_Border_frame:
-appendGrabBag("frame", OUString::number(nIntValue, 16));
+appendGrabBag(u"frame"_ustr, OUString::number(nIntValue, 

core.git: sw/source

2024-05-28 Thread Noel Grandin (via logerrit)
 sw/source/uibase/docvw/PostItMgr.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit e70b7edfb1bb8bcbde272f0152c51ae193e115d7
Author: Noel Grandin 
AuthorDate: Mon May 27 21:17:39 2024 +0200
Commit: Noel Grandin 
CommitDate: Tue May 28 16:13:12 2024 +0200

no need to dynamic_cast here

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

diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index 8a2ab40317ed..ebd1223c586d 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -447,8 +447,9 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const 
SfxHint& rHint )
 }
 }
 }
-else if ( const SfxStyleSheetModifiedHint * pStyleHint = 
dynamic_cast() )
+else if ( rHint.GetId() == SfxHintId::StyleSheetModifiedExtended )
 {
+const SfxStyleSheetModifiedHint * pStyleHint = static_cast();
 for (const auto& postItField : mvPostItFields)
 {
 auto pField = 
static_cast(postItField->GetFormatField().GetField());


core.git: sw/source

2024-05-28 Thread Andrea Gelmini (via logerrit)
 sw/source/writerfilter/dmapper/DomainMapper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6426583d0e73ea3d38c4b3baa80b7b10c020996d
Author: Andrea Gelmini 
AuthorDate: Tue May 28 10:59:47 2024 +0200
Commit: Julien Nabet 
CommitDate: Tue May 28 14:39:49 2024 +0200

Fix typo

Change-Id: Ib67e06df1e730d6e23b30d590f6132e7ad7315b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168142
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper.cxx
index 25c262b10ad9..3af9d5d85ff6 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx
@@ -147,7 +147,7 @@ DomainMapper::DomainMapper( const uno::Reference< 
uno::XComponentContext >& xCon
 
 // Enable only for new documents, since pasting from clipboard can 
influence existing doc
 m_pImpl->SetDocumentSettingsProperty("NoNumberingShowFollowBy", 
uno::Any(true));
-//paint backgound frames after header/footer when anchored in body
+//paint background frames after header/footer when anchored in body
 
m_pImpl->SetDocumentSettingsProperty("PaintHellOverHeaderFooter",uno::Any(true));
 }
 


core.git: sw/source

2024-05-28 Thread Noel Grandin (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx  |  276 +-
 sw/source/filter/ww8/docxexport.cxx   |   82 +++
 sw/source/filter/ww8/docxexportfilter.cxx |2 
 sw/source/filter/ww8/docxsdrexport.cxx|   63 +++--
 sw/source/filter/ww8/docxtableexport.cxx  |6 
 sw/source/filter/ww8/docxtablestyleexport.cxx |7 
 sw/source/filter/ww8/rtfattributeoutput.cxx   |   28 +-
 sw/source/filter/ww8/rtfexport.cxx|8 
 sw/source/filter/ww8/rtfexportfilter.cxx  |7 
 sw/source/filter/ww8/rtfsdrexport.cxx |2 
 sw/source/filter/ww8/writerwordglue.cxx   |2 
 sw/source/filter/ww8/wrtw8esh.cxx |   12 -
 sw/source/filter/ww8/wrtw8nds.cxx |   38 +--
 sw/source/filter/ww8/wrtw8sty.cxx |4 
 sw/source/filter/ww8/wrtww8.cxx   |   36 +--
 sw/source/filter/ww8/wrtww8gr.cxx |4 
 sw/source/filter/ww8/ww8atr.cxx   |   10 
 sw/source/filter/ww8/ww8par.cxx   |   64 +++---
 sw/source/filter/ww8/ww8par2.cxx  |6 
 sw/source/filter/ww8/ww8par3.cxx  |   46 ++--
 sw/source/filter/ww8/ww8par4.cxx  |8 
 sw/source/filter/ww8/ww8par5.cxx  |   28 +-
 sw/source/filter/ww8/ww8scan.cxx  |2 
 sw/source/filter/ww8/ww8toolbar.cxx   |   14 -
 24 files changed, 381 insertions(+), 374 deletions(-)

New commits:
commit 71ce1181942741d0899d9dbbf035632dffe2b323
Author: Noel Grandin 
AuthorDate: Wed May 22 12:45:39 2024 +0200
Commit: Noel Grandin 
CommitDate: Tue May 28 13:26:37 2024 +0200

loplugin:ostr in sw/../ww8

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 682959b33f33..1532ecf72c81 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -482,7 +482,7 @@ static void 
checkAndWriteFloatingTables(DocxAttributeOutput& rDocxAttributeOutpu
 const SfxGrabBagItem* pTableGrabBag = 
pTableFormat->GetAttrSet().GetItem(RES_FRMATR_GRABBAG);
 const std::map & rTableGrabBag = 
pTableGrabBag->GetGrabBag();
 // no grabbag?
-if (rTableGrabBag.find("TablePosition") == rTableGrabBag.end())
+if (rTableGrabBag.find(u"TablePosition"_ustr) == rTableGrabBag.end())
 {
 if (pFrameFormat->GetFlySplit().GetValue())
 {
@@ -577,7 +577,7 @@ sal_Int32 
DocxAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t p
 {
 const SfxGrabBagItem& rParaGrabBag = static_cast(*pItem);
 const std::map& rMap = 
rParaGrabBag.GetGrabBag();
-bEndParaSdt = m_aParagraphSdt.m_bStartedSdt && 
rMap.contains("ParaSdtEndBefore");
+bEndParaSdt = m_aParagraphSdt.m_bStartedSdt && 
rMap.contains(u"ParaSdtEndBefore"_ustr);
 }
 }
 }
@@ -1110,12 +1110,12 @@ bool DocxAttributeOutput::TextBoxIsFramePr(const 
SwFrameFormat& rFrameFormat)
 return false;
 
 uno::Reference 
xPropSetInfo(xPropertySet->getPropertySetInfo());
-if (!xPropSetInfo.is() || 
!xPropSetInfo->hasPropertyByName("FrameInteropGrabBag"))
+if (!xPropSetInfo.is() || 
!xPropSetInfo->hasPropertyByName(u"FrameInteropGrabBag"_ustr))
 return false;
 
 bool bRet = false;
 uno::Sequence propList;
-xPropertySet->getPropertyValue("FrameInteropGrabBag") >>= propList;
+xPropertySet->getPropertyValue(u"FrameInteropGrabBag"_ustr) >>= propList;
 auto pProp = std::find_if(std::cbegin(propList), std::cend(propList),
 [](const beans::PropertyValue& rProp) { return rProp.Name == 
"ParaFrameProperties"; });
 if (pProp != std::cend(propList))
@@ -1718,7 +1718,7 @@ void DocxAttributeOutput::EndParagraphProperties(const 
SfxItemSet& rParagraphMar
 SwTextNode* pTextNode = m_rExport.m_pCurPam->GetPointNode().GetTextNode();
 std::map aStatements;
 if (pTextNode)
-aStatements = SwRDFHelper::getTextNodeStatements("urn:bails", 
*pTextNode);
+aStatements = SwRDFHelper::getTextNodeStatements(u"urn:bails"_ustr, 
*pTextNode);
 if (!aStatements.empty())
 {
 m_pSerializer->startElementNS(XML_w, XML_smartTag,
@@ -2042,7 +2042,7 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, 
sal_Int32 nPos, sal_In
 m_pSerializer->startElementNS(XML_w, XML_r);
 if(GetExport().m_bTabInTOC && m_pHyperlinkAttrList.is())
 {
-RunText("  ") ;
+RunText(u" "_ustr) ;
 }
 m_pSerializer->mergeTopMarks(Tag_EndRun_1, 
sax_fastparser::MergeMarks::PREPEND); // merges with "postponed run start", see 
above
 
@@ -2464,15 +2464,15 @@ void DocxAttributeOutput::WriteFFData(  const 
FieldInfos& rInfos )
 

core.git: sw/source

2024-05-28 Thread Noel Grandin (via logerrit)
 sw/source/uibase/app/docstyle.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 072bd5d40a149bd50e95d24fc54417094193077e
Author: Noel Grandin 
AuthorDate: Mon May 27 21:23:21 2024 +0200
Commit: Noel Grandin 
CommitDate: Tue May 28 11:16:27 2024 +0200

no need to dynamic_cast here

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

diff --git a/sw/source/uibase/app/docstyle.cxx 
b/sw/source/uibase/app/docstyle.cxx
index 7cfd6f24fef1..f71002c09d13 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -136,11 +136,12 @@ public:
 
 void Notify(SfxBroadcaster&, const SfxHint& rHint) override
 {
-auto pHint = dynamic_cast();
-if (!pHint)
+auto nId = rHint.GetId();
+if (nId != SfxHintId::StyleSheetModified && nId != 
SfxHintId::StyleSheetModifiedExtended
+&& nId != SfxHintId::StyleSheetErased)
 return;
+auto pHint = static_cast();
 
-auto nId = pHint->GetId();
 auto pDocStyleSheet = pHint->GetStyleSheet();
 const SfxStyleSheetModifiedHint* pExtendedHint = nullptr;
 if (nId == SfxHintId::StyleSheetModifiedExtended)
@@ -3367,10 +3368,9 @@ void SwStyleSheetIterator::InvalidateIterator()
 void SwStyleSheetIterator::Notify( SfxBroadcaster&, const SfxHint& rHint )
 {
 // search and remove from View-List!!
-const SfxStyleSheetHint* pStyleSheetHint = dynamic_cast();
-if( pStyleSheetHint &&
-SfxHintId::StyleSheetErased == pStyleSheetHint->GetId() )
+if( SfxHintId::StyleSheetErased == rHint.GetId() )
 {
+const SfxStyleSheetHint* pStyleSheetHint = static_cast();
 SfxStyleSheetBase* pStyle = pStyleSheetHint->GetStyleSheet();
 
 if (pStyle)


core.git: sw/source

2024-05-28 Thread Noel Grandin (via logerrit)
 sw/source/uibase/utlui/content.cxx  |   26 --
 sw/source/uibase/utlui/glbltree.cxx |   32 +++-
 2 files changed, 35 insertions(+), 23 deletions(-)

New commits:
commit 9376df3c03d361a4c01493066db2a11a770d6cc9
Author: Noel Grandin 
AuthorDate: Mon May 27 21:34:14 2024 +0200
Commit: Noel Grandin 
CommitDate: Tue May 28 09:03:24 2024 +0200

no need to dynamic_cast here

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

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index f462148fa7d8..d044b611eb59 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3664,18 +3664,24 @@ void SwContentTree::SetConstantShell(SwWrtShell* pSh)
 
 void SwContentTree::Notify(SfxBroadcaster & rBC, SfxHint const& rHint)
 {
-SfxViewEventHint const*const pVEHint(dynamic_cast());
-SwXTextView* pDyingShell = nullptr;
-if (m_pActiveShell && pVEHint && pVEHint->GetEventName() == "OnViewClosed")
-pDyingShell = 
dynamic_cast(pVEHint->GetController().get());
-if (pDyingShell && pDyingShell->GetView() == _pActiveShell->GetView())
+if (rHint.GetId() == SfxHintId::ThisIsAnSfxEventHint)
 {
-SetActiveShell(nullptr); // our view is dying, clear our pointers to it
-}
-else
-{
-SfxListener::Notify(rBC, rHint);
+const SfxEventHint* pEventHint = static_cast();
+if (pEventHint->GetEventId() == SfxEventHintId::CloseView)
+{
+SfxViewEventHint const*const pVEHint(static_cast());
+if (m_pActiveShell)
+{
+SwXTextView* pDyingShell = 
dynamic_cast(pVEHint->GetController().get());
+if (pDyingShell && pDyingShell->GetView() == 
_pActiveShell->GetView())
+{
+SetActiveShell(nullptr); // our view is dying, clear our 
pointers to it
+}
+}
+return;
+}
 }
+SfxListener::Notify(rBC, rHint);
 switch (rHint.GetId())
 {
 case SfxHintId::SwNavigatorUpdateTracking:
diff --git a/sw/source/uibase/utlui/glbltree.cxx 
b/sw/source/uibase/utlui/glbltree.cxx
index 448f2655727a..7d7d0104fc7b 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -1164,21 +1164,27 @@ IMPL_LINK( SwGlobalTree, DialogClosedHdl, 
sfx2::FileDialogHelper*, _pFileDlg, vo
 
 void SwGlobalTree::Notify(SfxBroadcaster& rBC, SfxHint const& rHint)
 {
-SfxViewEventHint const*const pVEHint(dynamic_cast());
-SwXTextView* pDyingShell = nullptr;
-if (m_pActiveShell && pVEHint && pVEHint->GetEventName() == "OnViewClosed")
-pDyingShell = 
dynamic_cast(pVEHint->GetController().get());
-if (pDyingShell && pDyingShell->GetView() == _pActiveShell->GetView())
+if (rHint.GetId() == SfxHintId::ThisIsAnSfxEventHint)
 {
-EndListening(*m_pActiveShell->GetView().GetDocShell());
-m_pActiveShell = nullptr;
-}
-else
-{
-SfxListener::Notify(rBC, rHint);
-if (rHint.GetId() == SfxHintId::SwNavigatorUpdateTracking)
-UpdateTracking();
+const SfxEventHint* pEventHint = static_cast();
+if (pEventHint->GetEventId() == SfxEventHintId::CloseView)
+{
+SfxViewEventHint const*const pVEHint(static_cast());
+if (m_pActiveShell)
+{
+SwXTextView* pDyingShell = 
dynamic_cast(pVEHint->GetController().get());
+if (pDyingShell && pDyingShell->GetView() == 
_pActiveShell->GetView())
+{
+EndListening(*m_pActiveShell->GetView().GetDocShell());
+m_pActiveShell = nullptr;
+}
+}
+return;
+}
 }
+SfxListener::Notify(rBC, rHint);
+if (rHint.GetId() == SfxHintId::SwNavigatorUpdateTracking)
+UpdateTracking();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: sw/source sw/uiconfig

2024-05-27 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/inc/conttree.hxx  |7 +---
 sw/source/uibase/utlui/content.cxx |   38 +++--
 sw/uiconfig/swriter/ui/navigatorcontextmenu.ui |8 -
 3 files changed, 21 insertions(+), 32 deletions(-)

New commits:
commit ae94c420e6269f99cdaa611d19e73fc92ebd234b
Author: Jim Raykowski 
AuthorDate: Tue May 21 15:05:33 2024 -0800
Commit: Jim Raykowski 
CommitDate: Tue May 28 06:25:46 2024 +0200

SwNavigator: Improve Indexes context menu

* Removes "Remove Index" menu item in favor of the repeated function
"Delete index" menu item.

* Hides the "Update", "Delete Index", and "Rename..." menu items when
the document or index is set read-only.

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

diff --git a/sw/source/uibase/inc/conttree.hxx 
b/sw/source/uibase/inc/conttree.hxx
index 9a67d986f55f..d58123287e07 100644
--- a/sw/source/uibase/inc/conttree.hxx
+++ b/sw/source/uibase/inc/conttree.hxx
@@ -50,10 +50,9 @@ enum class EditEntryMode
 {
 EDIT  = 0,
 UPD_IDX   = 1,
-RMV_IDX   = 2,
-UNPROTECT_TABLE= 3,
-DELETE= 4,
-RENAME= 5,
+UNPROTECT_TABLE= 2,
+DELETE= 3,
+RENAME= 4,
 };
 
 // Flags for PopupMenu-enable/disable
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 1346d3bb5094..f462148fa7d8 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1692,8 +1692,8 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 bRemoveGotoEntry = true;
 
 bool bRemovePostItEntries = true;
-bool bRemoveIndexEntries = true;
-bool bRemoveCopyEntry = true;
+bool bRemoveUpdateIndexEntry = true;
+bool bRemoveReadonlyIndexEntry = true;bool bRemoveCopyEntry = true;
 bool bRemoveEditEntry = true;
 bool bRemoveUnprotectEntry = true;
 bool bRemoveDeleteChapterEntry = true,
@@ -1825,7 +1825,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 (State::ACTIVE == m_eState || (GetActiveView() && 
m_pActiveShell == GetActiveView()->GetWrtShellPtr()))
 && lcl_IsContent(*xEntry, *m_xTreeView))
 {
-const bool bReadonly = 
m_pActiveShell->GetView().GetDocShell()->IsReadOnly();
+bool bReadonly = 
m_pActiveShell->GetView().GetDocShell()->IsReadOnly();
 const bool bVisible = 
!weld::fromId(m_xTreeView->get_id(*xEntry))->IsInvisible();
 const bool bProtected = 
weld::fromId(m_xTreeView->get_id(*xEntry))->IsProtect();
 const bool bProtectBM = (ContentTypeId::BOOKMARK == nContentType)
@@ -1873,9 +1873,6 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 case ContentTypeId::REFERENCE:
 bRemoveDeleteReferenceEntry = false;
 break;
-case ContentTypeId::INDEX:
-bRemoveDeleteIndexEntry = false;
-break;
 case ContentTypeId::POSTIT:
 bRemoveDeleteCommentEntry = false;
 break;
@@ -1919,12 +1916,16 @@ IMPL_LINK(SwContentTree, CommandHdl, const 
CommandEvent&, rCEvt, bool)
 {
 if(ContentTypeId::INDEX == nContentType)
 {
-bRemoveIndexEntries = false;
-
+bRemoveReadonlyIndexEntry = false;
+bRemoveEditEntry = false;
 const SwTOXBase* pBase = 
weld::fromId(m_xTreeView->get_id(*xEntry))->GetTOXBase();
-if (!pBase->IsTOXBaseInReadonly())
-bRemoveEditEntry = false;
-
+if (!pBase->IsTOXBaseInReadonly() && 
!SwEditShell::IsTOXBaseReadonly(*pBase))
+{
+bRemoveUpdateIndexEntry = false;
+bRemoveDeleteIndexEntry = false;
+}
+else
+bReadonly = true;
 xPop->set_active(OUString::number(405), 
SwEditShell::IsTOXBaseReadonly(*pBase));
 }
 else if(ContentTypeId::TABLE == nContentType)
@@ -1955,7 +1956,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 else
 bRemoveEditEntry = false;
 }
-if (bRenamable)
+if (bRenamable && !bReadonly)
 bRemoveRenameEntry = false;
 }
 else
@@ -2071,12 +2072,11 @@ IMPL_LINK(SwContentTree, CommandHdl, const 
CommandEvent&, rCEvt, bool)
 if (bRemoveRenameEntry)
 xPop->remove(OUString::number(502));
 
-if (bRemoveIndexEntries)
-{
-

core.git: sw/source

2024-05-27 Thread Miklos Vajna (via logerrit)
 sw/source/core/txtnode/thints.cxx  |4 ++--
 sw/source/core/unocore/unoportenum.cxx |2 +-
 sw/source/core/unocore/unotext.cxx |4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 350a2dfa74bbc9d82f6555c0f3d679b6c53fe353
Author: Miklos Vajna 
AuthorDate: Mon May 27 11:05:37 2024 +0200
Commit: Miklos Vajna 
CommitDate: Tue May 28 00:21:50 2024 +0200

sw: rename SwIndexes to SwContentIndexes in comments

Leftover from commit 9fdb06d65a8f2c3401392bffee9c4639e178aada (rename
SwIndex->SwContentIndex, 2022-07-25).

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

diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 5da054405ef5..729a5443b03b 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1421,7 +1421,7 @@ bool SwTextNode::InsertHint( SwTextAttr * const pAttr, 
const SetAttrMode nMode )
 assert(CH_TXTATR_BREAKWORD == 
m_Text[pAttr->GetStart()]
 || CH_TXTATR_INWORD == 
m_Text[pAttr->GetStart()]);
 m_Text = m_Text.replaceAt(pAttr->GetStart(), 1, 
u"");
-// Update SwIndexes
+// Update SwContentIndexes
 SwContentIndex aTmpIdx( this, pAttr->GetStart() );
 Update(aTmpIdx, 1, UpdateMode::Negative);
 }
@@ -1461,7 +1461,7 @@ bool SwTextNode::InsertHint( SwTextAttr * const pAttr, 
const SetAttrMode nMode )
 assert(CH_TXTATR_BREAKWORD == m_Text[pAttr->GetStart()]
 || CH_TXTATR_INWORD == m_Text[pAttr->GetStart()]);
 m_Text = m_Text.replaceAt(pAttr->GetStart(), 1, u"");
-// Update SwIndexes
+// Update SwContentIndexes
 SwContentIndex aTmpIdx( this, pAttr->GetStart() );
 Update(aTmpIdx, 1, UpdateMode::Negative);
 }
diff --git a/sw/source/core/unocore/unoportenum.cxx 
b/sw/source/core/unocore/unoportenum.cxx
index 58657677429c..d975f3c20960 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -200,7 +200,7 @@ namespace
 
 SwTextNode* pTextNode = rUnoCursor.GetPoint()->GetNode().GetTextNode();
 assert(pTextNode);
-// A text node already knows its marks via its SwIndexes.
+// A text node already knows its marks via its SwContentIndexes.
 o3tl::sorted_vector aSeenMarks;
 for (const SwContentIndex* pIndex = pTextNode->GetFirstIndex(); 
pIndex; pIndex = pIndex->GetNext())
 {
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index 39b2016335ba..fd2811f05743 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1664,7 +1664,7 @@ SwXText::convertToTextFrame(
 xNewFrame->SwXFrame::setPropertyValue(rValue.Name, rValue.Value);
 }
 
-{   // has to be in a block to remove the SwIndexes before
+{   // has to be in a block to remove the SwContentIndexes before
 // DelFullPara is called
 const uno::Reference< text::XTextRange> xInsertTextRange =
 new SwXTextRange(*pStartPam, this);
@@ -1677,7 +1677,7 @@ SwXText::convertToTextFrame(
 assert(pTextNode);
 if (!pTextNode || !pTextNode->Len()) // don't remove if it contains 
text!
 {
-{   // has to be in a block to remove the SwIndexes before
+{   // has to be in a block to remove the SwContentIndexes before
 // DelFullPara is called
 SwPaM aMovePam( pStartPam->GetPointNode() );
 if (aMovePam.Move( fnMoveForward, GoInContent ))


core.git: sw/source

2024-05-26 Thread Andrea Gelmini (via logerrit)
 sw/source/core/layout/flylay.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 24f65bf5940adb0aa3590443752110119e2bea5e
Author: Andrea Gelmini 
AuthorDate: Sun May 26 14:56:05 2024 +0200
Commit: Taichi Haradaguchi <20001...@ymail.ne.jp>
CommitDate: Mon May 27 06:17:42 2024 +0200

Fix typo

Change-Id: I9e45b3667e2fadbeba46ddab5fdc135743a5d5bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168046
Tested-by: Jenkins
Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp>

diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 92ad07ba4481..35eb225782f9 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -1446,7 +1446,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect 
, bool bMove )
 if ( pUp->IsCellFrame() )
 {
 const SwFrame *pTab = pUp->FindTabFrame();
-aRectFnSet.SetBottom( rRect, 
aRectFnSet.GetPrtBottom(*pTab->GetUpper()) ); // set botto?m
+aRectFnSet.SetBottom( rRect, 
aRectFnSet.GetPrtBottom(*pTab->GetUpper()) ); // set bottom
 }
 }
 }


core.git: sw/source

2024-05-24 Thread Heiko Tietze (via logerrit)
 sw/source/core/text/porexp.cxx  |   53 +++-
 sw/source/core/text/porrst.cxx  |3 +-
 sw/source/core/text/txthyph.cxx |   15 ++-
 3 files changed, 42 insertions(+), 29 deletions(-)

New commits:
commit 1e9a5ee8671f9a48894849d3cba4d65afa181554
Author: Heiko Tietze 
AuthorDate: Thu May 23 14:58:46 2024 +0200
Commit: Heiko Tietze 
CommitDate: Fri May 24 16:30:31 2024 +0200

Resolves tdf161196 - Visibility of formatting marks

* Special indicators such as "°" for no-break space but also
  "," for zero width space are hidden if non-printable chars
  are disabled
* Special indicators use the same color (NON_PRINTING_CHARACTER_COLOR)
* Hard hyphen becomes blueish with non-printable chars on
* Hard blank as well as hard hyphen are controlled by Formatting Aids >
  Non-breaking spaces; and both highlighting and indicator are hidden
  with non-printable chars off

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

diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx
index 0884db6fce76..377af4671f2b 100644
--- a/sw/source/core/text/porexp.cxx
+++ b/sw/source/core/text/porexp.cxx
@@ -213,35 +213,34 @@ void SwBlankPortion::Paint( const SwTextPaintInfo  ) 
const
 rInf.DrawViewOpt(*this, PortionType::Blank);
 SwExpandPortion::Paint(rInf);
 
-if (m_cChar == CHAR_HARDBLANK)
+if (rInf.GetOpt().IsViewMetaChars() && rInf.GetOpt().IsHardBlank())
 {
-if (rInf.GetOpt().IsBlank())
-{
-// Draw tilde or degree sign
-OUString aMarker = 
(rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess()
+// Draw tilde or degree sign
+OUString aMarker = (m_cChar == CHAR_HARDBLANK ?
+
rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess()
 
.get(DocumentSettingId::USE_VARIABLE_WIDTH_NBSP)
-  ? u"~"_ustr
-  : u"°"_ustr);
-
-SwPosSize aMarkerSize(rInf.GetTextSize(aMarker));
-Point aPos(rInf.GetPos());
-
-std::shared_ptr pPortionRect = std::make_shared();
-rInf.CalcRect(*this, pPortionRect.get());
-aPos.AdjustX((pPortionRect->Width() / 2) - (aMarkerSize.Width() / 
2));
-
-SwTextPaintInfo aInf(rInf, );
-aInf.SetPos(aPos);
-SwTextPortion aMarkerPor;
-aMarkerPor.Width(aMarkerSize.Width());
-aMarkerPor.Height(aMarkerSize.Height());
-aMarkerPor.SetAscent(GetAscent());
-
-Color colorBackup = aInf.GetFont()->GetColor();
-aInf.GetFont()->SetColor(NON_PRINTING_CHARACTER_COLOR);
-aInf.DrawText(aMarkerPor, TextFrameIndex(aMarker.getLength()), 
true);
-aInf.GetFont()->SetColor(colorBackup);
-}
+? u"~"_ustr
+: u"°"_ustr
+: u"-"_ustr); //CHAR_HARDHYPHEN
+
+SwPosSize aMarkerSize(rInf.GetTextSize(aMarker));
+Point aPos(rInf.GetPos());
+
+std::shared_ptr pPortionRect = std::make_shared();
+rInf.CalcRect(*this, pPortionRect.get());
+aPos.AdjustX((pPortionRect->Width() / 2) - (aMarkerSize.Width() / 2));
+
+SwTextPaintInfo aInf(rInf, );
+aInf.SetPos(aPos);
+SwTextPortion aMarkerPor;
+aMarkerPor.Width(aMarkerSize.Width());
+aMarkerPor.Height(aMarkerSize.Height());
+aMarkerPor.SetAscent(GetAscent());
+
+Color colorBackup = aInf.GetFont()->GetColor();
+aInf.GetFont()->SetColor(NON_PRINTING_CHARACTER_COLOR);
+aInf.DrawText(aMarkerPor, TextFrameIndex(aMarker.getLength()), true);
+aInf.GetFont()->SetColor(colorBackup);
 }
 }
 
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index ff1e029ae141..8f0b89852450 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -677,7 +677,7 @@ bool SwHiddenTextPortion::Format( SwTextFormatInfo  )
 bool SwControlCharPortion::DoPaint(SwTextPaintInfo const& rTextPaintInfo,
 OUString & rOutString, SwFont & rTmpFont, int &) const
 {
-if (mcChar == CHAR_WJ || !rTextPaintInfo.GetOpt().IsFieldShadings())
+if (mcChar == CHAR_WJ || !rTextPaintInfo.GetOpt().IsViewMetaChars())
 {
 return false;
 }
@@ -696,6 +696,7 @@ bool SwControlCharPortion::DoPaint(SwTextPaintInfo const& 
rTextPaintInfo,
 }
 
 rTmpFont.SetEscapement( CHAR_ZWSP == mcChar ? DFLT_ESC_AUTO_SUB : -25 );
+rTmpFont.SetColor( NON_PRINTING_CHARACTER_COLOR );
 const sal_uInt16 nProp = 40;
 rTmpFont.SetProportion( nProp );  // a smaller font
 
diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx

core.git: sw/source

2024-05-23 Thread Xisco Fauli (via logerrit)
 sw/source/ui/dbui/mmgreetingspage.cxx |4 ++--
 sw/source/ui/dbui/mmgreetingspage.hxx |3 ++-
 sw/source/ui/dbui/mmresultdialogs.cxx |   17 +++--
 sw/source/uibase/utlui/content.cxx|5 ++---
 4 files changed, 13 insertions(+), 16 deletions(-)

New commits:
commit b9f9493b43f89ad1560e9779796ade7854aa2b74
Author: Xisco Fauli 
AuthorDate: Thu May 23 11:07:20 2024 +0200
Commit: Xisco Fauli 
CommitDate: Thu May 23 15:52:52 2024 +0200

sw: warning C6011: Dereferencing NULL pointer

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

diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx 
b/sw/source/ui/dbui/mmgreetingspage.cxx
index 5fb6ed5a0648..3e5f8d43c243 100644
--- a/sw/source/ui/dbui/mmgreetingspage.cxx
+++ b/sw/source/ui/dbui/mmgreetingspage.cxx
@@ -337,9 +337,9 @@ IMPL_LINK(SwMailMergeGreetingsPage, InsertDataHdl_Impl, 
weld::Button&, rButton,
 m_xDocumentIndexFI->set_label(m_sDocument.replaceFirst("%1", 
OUString::number(nPos)));
 }
 
-SwMailBodyDialog::SwMailBodyDialog(weld::Window* pParent)
+SwMailBodyDialog::SwMailBodyDialog(weld::Window* pParent, 
std::shared_ptr const & rConfigItem)
 : SfxDialogController(pParent, u"modules/swriter/ui/mmmailbody.ui"_ustr, 
u"MailBodyDialog"_ustr)
-, SwGreetingsHandler(*GetActiveView()->GetMailMergeConfigItem(), 
*m_xBuilder)
+, SwGreetingsHandler(*rConfigItem, *m_xBuilder)
 , m_xBodyMLE(m_xBuilder->weld_text_view(u"bodymle"_ustr))
 , m_xOK(m_xBuilder->weld_button(u"ok"_ustr))
 {
diff --git a/sw/source/ui/dbui/mmgreetingspage.hxx 
b/sw/source/ui/dbui/mmgreetingspage.hxx
index 7d266870b13b..39761659bdcc 100644
--- a/sw/source/ui/dbui/mmgreetingspage.hxx
+++ b/sw/source/ui/dbui/mmgreetingspage.hxx
@@ -119,7 +119,8 @@ class SwMailBodyDialog : public SfxDialogController, public 
SwGreetingsHandler
 DECL_LINK(OKHdl, weld::Button&, void);
 
 public:
-SwMailBodyDialog(weld::Window* pParent);
+SwMailBodyDialog(weld::Window* pParent,
+ std::shared_ptr const& 
rConfigItem);
 virtual ~SwMailBodyDialog() override;
 
 void SetBody(const OUString& rBody) { m_xBodyMLE->set_text(rBody); }
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx 
b/sw/source/ui/dbui/mmresultdialogs.cxx
index e36306678c8f..35ea44e6e5b4 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -892,17 +892,14 @@ IMPL_LINK(SwMMResultEmailDialog, SendTypeHdl_Impl, 
weld::ComboBox&, rBox, void)
 
 IMPL_LINK_NOARG(SwMMResultEmailDialog, SendAsHdl_Impl, weld::Button&, void)
 {
-// work around crash when calling constructor with no active view
-if (!GetActiveView())
-{
-SAL_WARN("sw", "ignoring SendAs button click, because no active view");
-return;
-}
-SwMailBodyDialog aDlg(m_xDialog.get());
-aDlg.SetBody(m_sBody);
-if (RET_OK == aDlg.run())
+if (SwView* pView = GetActiveView())
 {
-m_sBody = aDlg.GetBody();
+SwMailBodyDialog aDlg(m_xDialog.get(), 
pView->GetMailMergeConfigItem());
+aDlg.SetBody(m_sBody);
+if (RET_OK == aDlg.run())
+{
+m_sBody = aDlg.GetBody();
+}
 }
 }
 
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index fb7833e244a4..1346d3bb5094 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3156,9 +3156,8 @@ bool 
SwContentTree::FillTransferData(TransferDataContainer& rTransfer)
 SfxMedium* pMedium = pDocShell->GetMedium();
 sUrl = pMedium->GetURLObject().GetURLNoMark();
 }
-else if (State::CONSTANT == m_eState
- && (!::GetActiveView()
- || m_pActiveShell != 
::GetActiveView()->GetWrtShellPtr()))
+else if (SwView* pView = GetActiveView(); State::CONSTANT == 
m_eState
+ && (!pView || m_pActiveShell != pView->GetWrtShellPtr()))
 {
 // Urls of inactive views cannot dragged without
 // file names, also.


core.git: sw/source vcl/source

2024-05-23 Thread Tibor Nagy (via logerrit)
 sw/source/uibase/docvw/edtwin2.cxx |   44 -
 vcl/source/app/help.cxx|6 -
 2 files changed, 39 insertions(+), 11 deletions(-)

New commits:
commit 1396347c8e9b036f15bc646b9475073344e69e74
Author: Tibor Nagy 
AuthorDate: Thu May 23 01:14:21 2024 +0200
Commit: Nagy Tibor 
CommitDate: Thu May 23 13:04:06 2024 +0200

tdf#159899 sw: show hyperlink name as tooltip

Change-Id: I48f841d1c42f9541e03632a88e1a4f65975a5335
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167971
Tested-by: Jenkins
Reviewed-by: Nagy Tibor 

diff --git a/sw/source/uibase/docvw/edtwin2.cxx 
b/sw/source/uibase/docvw/edtwin2.cxx
index a0a1016b114d..4107d2a05c0b 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -333,9 +333,10 @@ void SwEditWin::RequestHelp(const HelpEvent )
 if(bQuickBalloon && !rSh.GetViewOptions()->IsShowContentTips())
 return;
 bool bContinue = true;
+bool bScreenTip = false;
 CurrShell aCurr();
 OUString sText;
-Point aPos( PixelToLogic( ScreenToOutputPixel( rEvt.GetMousePosPixel() ) 
));
+Point aPt( PixelToLogic( ScreenToOutputPixel( rEvt.GetMousePosPixel() ) ));
 bool bBalloon = bool(rEvt.GetMode() & HelpEventMode::BALLOON);
 
 SdrView *pSdrView = rSh.GetDrawView();
@@ -365,7 +366,7 @@ void SwEditWin::RequestHelp(const HelpEvent )
 IsAttrAtPos::TableRedline |
 IsAttrAtPos::TableColRedline );
 
-if( rSh.GetContentAtPos( aPos, aContentAtPos, false,  ) )
+if( rSh.GetContentAtPos( aPt, aContentAtPos, false,  ) )
 {
 QuickHelpFlags nStyle = QuickHelpFlags::NONE; // style of quick 
help
 switch( aContentAtPos.eContentAtPos )
@@ -445,6 +446,27 @@ void SwEditWin::RequestHelp(const HelpEvent )
 if ( !bExecHyperlinks )
 {
 sText = SfxHelp::GetURLHelpText(sText);
+
+SwPosition aPos(rSh.GetDoc()->GetNodes());
+rSh.GetLayout()->GetModelPositionForViewPoint(, aPt);
+rtl::Reference 
xRange(SwXTextRange::CreateXTextRange(
+*(m_rView.GetDocShell()->GetDoc()), aPos, ));
+
+OUString sName;
+xRange->getPropertyValue("HyperLinkName") >>= sName;
+if (!sName.isEmpty())
+{
+bScreenTip = true;
+OUStringBuffer sStrBuffer(sName);
+sal_Int32 nTextLen = sText.getLength();
+sal_Int32 nNameLen = sName.getLength();
+if (nNameLen > nTextLen)
+{
+for (sal_Int32 i = nTextLen - 1; i < nNameLen; i 
+= nTextLen)
+sStrBuffer.insert(i + 1, std::u16string_view(u"
"));
+}
+sText = sStrBuffer.makeStringAndClear() + "
" + sText;
+}
 }
 break;
 }
@@ -620,7 +642,7 @@ void SwEditWin::RequestHelp(const HelpEvent )
 if ( bShowTrackChanges && bShowInlineTooltips )
 {
 aContentAtPos.eContentAtPos = IsAttrAtPos::Redline;
-if( rSh.GetContentAtPos( aPos, aContentAtPos, 
false,  ) )
+if( rSh.GetContentAtPos( aPt, aContentAtPos, 
false,  ) )
 sText = 
lcl_GetRedlineHelp(*aContentAtPos.aFnd.pRedl, bBalloon, /*bTableChange=*/false, 
/*bTableColChange=*/false);
 }
 }
@@ -636,12 +658,12 @@ void SwEditWin::RequestHelp(const HelpEvent )
 else
 {
 tools::Rectangle aRect(aFieldRect.SVRect());
-Point 
aPt(OutputToScreenPixel(LogicToPixel(aRect.TopLeft(;
-aRect.SetLeft(aPt.X());
-aRect.SetTop(aPt.Y());
-aPt = 
OutputToScreenPixel(LogicToPixel(aRect.BottomRight()));
-aRect.SetRight(aPt.X());
-aRect.SetBottom(aPt.Y());
+Point 
aRectPt(OutputToScreenPixel(LogicToPixel(aRect.TopLeft(;
+aRect.SetLeft(aRectPt.X());
+aRect.SetTop(aRectPt.Y());
+aRectPt = 
OutputToScreenPixel(LogicToPixel(aRect.BottomRight()));
+aRect.SetRight(aRectPt.X());
+aRect.SetBottom(aRectPt.Y());
 
 // tdf#136336 ensure tooltip area surrounds the current 
mouse position with at least a pixel margin
 aRect.Union(tools::Rectangle(rEvt.GetMousePosPixel(), 
Size(1, 1)));
@@ -655,7 +677,9 @@ void SwEditWin::RequestHelp(const HelpEvent )
 else

core.git: sw/source

2024-05-23 Thread Noel Grandin (via logerrit)
 sw/source/ui/vba/vbaaddin.cxx|6 
 sw/source/ui/vba/vbaaddins.cxx   |4 
 sw/source/ui/vba/vbaapplication.cxx  |   14 +-
 sw/source/ui/vba/vbaautotextentry.cxx|   20 +--
 sw/source/ui/vba/vbabookmark.cxx |6 
 sw/source/ui/vba/vbabookmarks.cxx|6 
 sw/source/ui/vba/vbaborders.cxx  |   18 +-
 sw/source/ui/vba/vbacell.cxx |4 
 sw/source/ui/vba/vbacells.cxx|4 
 sw/source/ui/vba/vbacolumn.cxx   |4 
 sw/source/ui/vba/vbacolumns.cxx  |8 -
 sw/source/ui/vba/vbacontentcontrol.cxx   |  124 +--
 sw/source/ui/vba/vbacontentcontrollistentries.cxx|4 
 sw/source/ui/vba/vbacontentcontrollistentry.cxx  |6 
 sw/source/ui/vba/vbacontentcontrols.cxx  |4 
 sw/source/ui/vba/vbadialog.cxx   |4 
 sw/source/ui/vba/vbadialogs.cxx  |4 
 sw/source/ui/vba/vbadocument.cxx |   38 ++---
 sw/source/ui/vba/vbadocumentproperties.cxx   |   14 +-
 sw/source/ui/vba/vbadocuments.cxx|4 
 sw/source/ui/vba/vbaeventshelper.cxx |6 
 sw/source/ui/vba/vbafield.cxx|   18 +-
 sw/source/ui/vba/vbafilterpropsfromformat.hxx|   12 -
 sw/source/ui/vba/vbafind.cxx |   38 ++---
 sw/source/ui/vba/vbafont.cxx |6 
 sw/source/ui/vba/vbaformfield.cxx|   16 +-
 sw/source/ui/vba/vbaformfieldcheckbox.cxx|6 
 sw/source/ui/vba/vbaformfielddropdown.cxx|6 
 sw/source/ui/vba/vbaformfielddropdownlistentries.cxx |4 
 sw/source/ui/vba/vbaformfielddropdownlistentry.cxx   |4 
 sw/source/ui/vba/vbaformfields.cxx   |4 
 sw/source/ui/vba/vbaformfieldtextinput.cxx   |8 -
 sw/source/ui/vba/vbaframe.cxx|4 
 sw/source/ui/vba/vbaframes.cxx   |4 
 sw/source/ui/vba/vbaglobals.cxx  |8 -
 sw/source/ui/vba/vbaheaderfooter.cxx |4 
 sw/source/ui/vba/vbaheaderfooterhelper.cxx   |   12 -
 sw/source/ui/vba/vbaheadersfooters.cxx   |4 
 sw/source/ui/vba/vbainformationhelper.cxx|2 
 sw/source/ui/vba/vbalistformat.cxx   |   68 +-
 sw/source/ui/vba/vbalistgalleries.cxx|6 
 sw/source/ui/vba/vbalistgallery.cxx  |4 
 sw/source/ui/vba/vbalisthelper.cxx   |   18 +-
 sw/source/ui/vba/vbalistlevel.cxx|   50 +++
 sw/source/ui/vba/vbalistlevels.cxx   |6 
 sw/source/ui/vba/vbalisttemplate.cxx |6 
 sw/source/ui/vba/vbalisttemplates.cxx|6 
 sw/source/ui/vba/vbamailmerge.cxx|4 
 sw/source/ui/vba/vbaoptions.cxx  |4 
 sw/source/ui/vba/vbapagesetup.cxx|   82 ++--
 sw/source/ui/vba/vbapane.cxx |6 
 sw/source/ui/vba/vbapanes.cxx|4 
 sw/source/ui/vba/vbaparagraph.cxx|   12 -
 sw/source/ui/vba/vbaparagraphformat.cxx  |   74 +--
 sw/source/ui/vba/vbarange.cxx|   20 +--
 sw/source/ui/vba/vbarange.hxx|2 
 sw/source/ui/vba/vbareplacement.cxx  |4 
 sw/source/ui/vba/vbarevision.cxx |4 
 sw/source/ui/vba/vbarevisions.cxx|4 
 sw/source/ui/vba/vbarow.cxx  |   12 -
 sw/source/ui/vba/vbarows.cxx |   40 +++---
 sw/source/ui/vba/vbasection.cxx  |4 
 sw/source/ui/vba/vbasections.cxx |8 -
 sw/source/ui/vba/vbaselection.cxx|   62 -
 sw/source/ui/vba/vbastyle.cxx|   32 ++--
 sw/source/ui/vba/vbastyle.hxx|2 
 sw/source/ui/vba/vbastyles.cxx   |   12 -
 sw/source/ui/vba/vbasystem.cxx   |   10 -
 sw/source/ui/vba/vbatable.cxx|   20 +--
 sw/source/ui/vba/vbatablehelper.cxx  |6 
 sw/source/ui/vba/vbatableofcontents.cxx  |   16 +-
 sw/source/ui/vba/vbatables.cxx   |6 
 sw/source/ui/vba/vbatablesofcontents.cxx |8 -
 sw/source/ui/vba/vbatabstop.cxx  |4 
 sw/source/ui/vba/vbatabstops.cxx |8 -
 sw/source/ui/vba/vbatemplate.cxx |8 -
 sw/source/ui/vba/vbavariable.cxx |6 
 sw/source/ui/vba/vbavariables.cxx|4 
 sw/source/ui/vba/vbaview.cxx  

core.git: sw/source

2024-05-22 Thread Justin Luth (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit fe5b4257d852b937652d55f2272ed535835d85c5
Author: Justin Luth 
AuthorDate: Wed May 22 12:22:07 2024 -0400
Commit: Justin Luth 
CommitDate: Wed May 22 23:22:17 2024 +0200

NFC IsInline includes GetAnchorId() == RndStdIds::FLY_AS_CHAR

m_bIsInline is either forced true,
or is set by GetAnchorId() == RndStdIds::FLY_AS_CHAR.
Nothing sets it to false, but it can become true with
ForceTreatAsInline.

So, no need to check for FLY_AS_CHAR if we also allow IsInline.

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 20ce68a5b08c..682959b33f33 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6409,8 +6409,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl(const 
ww8::Frame& rFrame, const Po
 /// support that feature, instead it postponed and exported
 /// later when the original shape closed.
 
-if (rFrame.GetFrameFormat().GetAnchor().GetAnchorId() == 
RndStdIds::FLY_AS_CHAR
-|| rFrame.IsInline())
+if (rFrame.IsInline())
 {
 m_nEmbedFlyLevel++;
 WriteFlyFrame(rFrame);


core.git: sw/source

2024-05-22 Thread Noel Grandin (via logerrit)
 sw/source/ui/dbui/addresslistdialog.cxx  |   56 -
 sw/source/ui/dbui/createaddresslistdialog.cxx|   48 
 sw/source/ui/dbui/customizeaddresslistdialog.cxx |   20 +--
 sw/source/ui/dbui/customizeaddresslistdialog.hxx |8 -
 sw/source/ui/dbui/dbinsdlg.cxx   |   76 ++--
 sw/source/ui/dbui/dbtablepreviewdialog.cxx   |8 -
 sw/source/ui/dbui/mailmergewizard.cxx|   10 -
 sw/source/ui/dbui/mmaddressblockpage.cxx |  136 +++
 sw/source/ui/dbui/mmdocselectpage.cxx|   22 +--
 sw/source/ui/dbui/mmgreetingspage.cxx|   22 +--
 sw/source/ui/dbui/mmgreetingspage.hxx|   30 ++---
 sw/source/ui/dbui/mmlayoutpage.cxx   |   30 ++---
 sw/source/ui/dbui/mmoutputtypepage.cxx   |   32 ++---
 sw/source/ui/dbui/mmresultdialogs.cxx|  106 -
 sw/source/ui/dbui/selectdbtabledialog.cxx|   19 +--
 15 files changed, 312 insertions(+), 311 deletions(-)

New commits:
commit ebb1444a17d56acc93ffbb06b43506531dd6
Author: Noel Grandin 
AuthorDate: Wed May 22 09:36:10 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed May 22 16:07:27 2024 +0200

loplugin:ostr in sw/../dbui

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

diff --git a/sw/source/ui/dbui/addresslistdialog.cxx 
b/sw/source/ui/dbui/addresslistdialog.cxx
index 30df8ce37ce2..d4e6f40be4bc 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -87,13 +87,13 @@ static OUString lcl_getFlatURL( 
uno::Reference const & xSou
 if(xSourceProperties.is())
 {
 OUString sDBURL;
-xSourceProperties->getPropertyValue("URL") >>= sDBURL;
+xSourceProperties->getPropertyValue(u"URL"_ustr) >>= sDBURL;
 if (sDBURL.startsWith("sdbc:flat:"))
 {
 uno::Sequence aFilters;
-xSourceProperties->getPropertyValue("TableFilter") >>= aFilters;
+xSourceProperties->getPropertyValue(u"TableFilter"_ustr) >>= 
aFilters;
 uno::Sequence aInfo;
-xSourceProperties->getPropertyValue("Info") >>= aInfo;
+xSourceProperties->getPropertyValue(u"Info"_ustr) >>= aInfo;
 if(aFilters.getLength() == 1 && aInfo.hasElements() )
 {
 OUString sExtension;
@@ -118,19 +118,19 @@ static OUString lcl_getFlatURL( 
uno::Reference const & xSou
 }
 
 SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent)
-: SfxDialogController(pParent->GetWizard()->getDialog(), 
"modules/swriter/ui/selectaddressdialog.ui", "SelectAddressDialog")
+: SfxDialogController(pParent->GetWizard()->getDialog(), 
u"modules/swriter/ui/selectaddressdialog.ui"_ustr, u"SelectAddressDialog"_ustr)
 , m_bInSelectHdl(false)
 , m_pAddressPage(pParent)
-, m_xDescriptionFI(m_xBuilder->weld_label("desc"))
-, m_xConnecting(m_xBuilder->weld_label("connecting"))
-, m_xListLB(m_xBuilder->weld_tree_view("sources"))
-, m_xLoadListPB(m_xBuilder->weld_button("add"))
-, m_xRemovePB(m_xBuilder->weld_button("remove"))
-, m_xCreateListPB(m_xBuilder->weld_button("create"))
-, m_xFilterPB(m_xBuilder->weld_button("filter"))
-, m_xEditPB(m_xBuilder->weld_button("edit"))
-, m_xTablePB(m_xBuilder->weld_button("changetable"))
-, m_xOK(m_xBuilder->weld_button("ok"))
+, m_xDescriptionFI(m_xBuilder->weld_label(u"desc"_ustr))
+, m_xConnecting(m_xBuilder->weld_label(u"connecting"_ustr))
+, m_xListLB(m_xBuilder->weld_tree_view(u"sources"_ustr))
+, m_xLoadListPB(m_xBuilder->weld_button(u"add"_ustr))
+, m_xRemovePB(m_xBuilder->weld_button(u"remove"_ustr))
+, m_xCreateListPB(m_xBuilder->weld_button(u"create"_ustr))
+, m_xFilterPB(m_xBuilder->weld_button(u"filter"_ustr))
+, m_xEditPB(m_xBuilder->weld_button(u"edit"_ustr))
+, m_xTablePB(m_xBuilder->weld_button(u"changetable"_ustr))
+, m_xOK(m_xBuilder->weld_button(u"ok"_ustr))
 , m_xIter(m_xListLB->make_iterator())
 {
 m_sConnecting = m_xConnecting->get_label();
@@ -245,20 +245,20 @@ IMPL_LINK_NOARG(SwAddressListDialog, FilterHdl_Impl, 
weld::Button&, void)
 {
 uno::Reference 
xConnectFactory(pUserData->xConnection, UNO_QUERY_THROW);
 uno::Reference xComposer(
-
xConnectFactory->createInstance("com.sun.star.sdb.SingleSelectQueryComposer"), 
UNO_QUERY_THROW);
+
xConnectFactory->createInstance(u"com.sun.star.sdb.SingleSelectQueryComposer"_ustr),
 UNO_QUERY_THROW);
 
 uno::Reference xRowSet(
-xMgr->createInstance("com.sun.star.sdb.RowSet"), UNO_QUERY);
+xMgr->createInstance(u"com.sun.star.sdb.RowSet"_ustr), 
UNO_QUERY);
 uno::Reference xRowProperties(xRowSet, UNO_QUERY);
-

core.git: sw/source

2024-05-22 Thread Michael Weghorn (via logerrit)
 sw/source/core/doc/tblrwcl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 554c06b2f66ff7c26df0ac29f89894fff89eecd6
Author: Michael Weghorn 
AuthorDate: Wed May 22 08:16:00 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed May 22 11:05:03 2024 +0200

sw: Change OSL_ENSURE -> assert

This fixes my local Windows/MSVC build that previously
failed like this:


C:/tools/cygwin/home/user/development/git/libreoffice/sw/source/core/doc/tblrwcl.cxx(3187):
 error C2220: the following warning is treated as an error
C:  oolsmake[1]: *** 
[C:/tools/cygwin/home/user/development/git/libreoffice/solenv/gbuild/LinkTarget.mk:338:
 
C:/tools/cygwin/home/user/development/git/libreoffice/workdir/CxxObject/sw/source/core/doc/tblrwcl.o]
 Error 2
make: *** [Makefile:294: build] Error 2

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

diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index b13dc38ebcef..38c5074f0e89 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -3100,7 +3100,7 @@ bool SwTable::SetRowHeight( SwTableBox& rCurrentBox, 
TableChgWidthHeightType eTy
 for( auto n = nStt; n < nEnd; ++n )
 {
 SwLayoutFrame* pLineFrame = GetRowFrame( *(*pLines)[ n 
] );
-OSL_ENSURE( pLineFrame, "Where is the Frame from the 
SwTableLine??" );
+assert(pLineFrame && "Where is the Frame from the 
SwTableLine??");
 aParam.nMaxSpace += CalcRowRstHeight( pLineFrame );
 aParam.nMaxHeight += 
pLineFrame->getFrameArea().Height();
 }


core.git: sw/source sw/uiconfig

2024-05-21 Thread Heiko Tietze (via logerrit)
 sw/source/ui/config/optpage.cxx |   57 -
 sw/source/uibase/inc/optpage.hxx|5 -
 sw/uiconfig/swriter/ui/optcomparison.ui |   85 +++-
 3 files changed, 10 insertions(+), 137 deletions(-)

New commits:
commit 6ddb49bc32c534d196ff3913835aceb88cbc8dfc
Author: Heiko Tietze 
AuthorDate: Tue May 21 10:00:44 2024 +0200
Commit: Heiko Tietze 
CommitDate: Tue May 21 15:33:34 2024 +0200

Resolves tdf#160834 - Unclear meaning of "Ignore pieces of length"

Access in the UI removed
Find the options under ooO.Writer.Comparison.IgnoreLength and IgnorePieces

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

diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 6ca432acc34e..089942b5eeb0 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -2577,10 +2577,6 @@ 
SwCompareOptionsTabPage::SwCompareOptionsTabPage(weld::Container* pPage, weld::D
 , m_xCompareModeImg(m_xBuilder->weld_widget("lockcomparemode"))
 , m_xRsidCB(m_xBuilder->weld_check_button("useRSID"))
 , m_xRsidImg(m_xBuilder->weld_widget("lockuseRSID"))
-, m_xIgnoreCB(m_xBuilder->weld_check_button("ignore"))
-, m_xIgnoreImg(m_xBuilder->weld_widget("lockignore"))
-, m_xLenNF(m_xBuilder->weld_spin_button("ignorelen"))
-, m_xLenImg(m_xBuilder->weld_widget("lockignorelen"))
 , m_xStoreRsidCB(m_xBuilder->weld_check_button("storeRSID"))
 , m_xStoreRsidImg(m_xBuilder->weld_widget("lockstoreRSID"))
 {
@@ -2588,8 +2584,6 @@ 
SwCompareOptionsTabPage::SwCompareOptionsTabPage(weld::Container* pPage, weld::D
 m_xAutoRB->connect_toggled( aLnk );
 m_xWordRB->connect_toggled( aLnk );
 m_xCharRB->connect_toggled( aLnk );
-
-m_xIgnoreCB->connect_toggled( LINK( this, SwCompareOptionsTabPage, 
IgnoreHdl) );
 }
 
 SwCompareOptionsTabPage::~SwCompareOptionsTabPage()
@@ -2612,14 +2606,6 @@ OUString SwCompareOptionsTabPage::GetAllStrings()
 sAllStrings += pString->get_label() + " ";
 }
 
-OUString checkButton[] = { "useRSID", "ignore", "storeRSID" };
-
-for (const auto& check : checkButton)
-{
-if (const auto& pString = m_xBuilder->weld_check_button(check))
-sAllStrings += pString->get_label() + " ";
-}
-
 OUString radioButton[] = { "auto", "byword", "bycharacter" };
 
 for (const auto& radio : radioButton)
@@ -2656,18 +2642,6 @@ bool SwCompareOptionsTabPage::FillItemSet( SfxItemSet* )
 bRet = true;
 }
 
-if( m_xIgnoreCB->get_state_changed_from_saved() )
-{
-pOpt->SetIgnorePieces( m_xIgnoreCB->get_active() );
-bRet = true;
-}
-
-if( m_xLenNF->get_value_changed_from_saved() )
-{
-pOpt->SetPieceLen( m_xLenNF->get_value() );
-bRet = true;
-}
-
 if (m_xStoreRsidCB->get_state_changed_from_saved())
 {
 pOpt->SetStoreRsid(m_xStoreRsidCB->get_active());
@@ -2686,22 +2660,16 @@ void SwCompareOptionsTabPage::Reset( const SfxItemSet* )
 {
 m_xAutoRB->set_active(true);
 m_xRsidCB->set_sensitive(false);
-m_xIgnoreCB->set_sensitive(false);
-m_xLenNF->set_sensitive(false);
 }
 else if( eCmpMode == SwCompareMode::ByWord )
 {
 m_xWordRB->set_active(true);
 m_xRsidCB->set_sensitive(true);
-m_xIgnoreCB->set_sensitive(true);
-m_xLenNF->set_sensitive(true);
 }
 else if( eCmpMode == SwCompareMode::ByChar)
 {
 m_xCharRB->set_active(true);
 m_xRsidCB->set_sensitive(true);
-m_xIgnoreCB->set_sensitive(true);
-m_xLenNF->set_sensitive(true);
 }
 
 if (officecfg::Office::Writer::Comparison::Mode::isReadOnly())
@@ -2724,24 +2692,6 @@ void SwCompareOptionsTabPage::Reset( const SfxItemSet* )
 }
 m_xRsidCB->save_state();
 
-m_xIgnoreCB->set_active( pOpt->IsIgnorePieces() );
-if (officecfg::Office::Writer::Comparison::IgnorePieces::isReadOnly())
-{
-m_xIgnoreCB->set_sensitive(false);
-m_xIgnoreImg->set_visible(true);
-}
-m_xIgnoreCB->save_state();
-
-m_xLenNF->set_sensitive( m_xIgnoreCB->get_active() && eCmpMode != 
SwCompareMode::Auto );
-
-m_xLenNF->set_value( pOpt->GetPieceLen() );
-if (officecfg::Office::Writer::Comparison::IgnoreLength::isReadOnly())
-{
-m_xLenNF->set_sensitive(false);
-m_xLenImg->set_visible(true);
-}
-m_xLenNF->save_value();
-
 m_xStoreRsidCB->set_active(pOpt->IsStoreRsid());
 
m_xStoreRsidCB->set_sensitive(!officecfg::Office::Writer::Comparison::StoreRSID::isReadOnly());
 
m_xStoreRsidImg->set_visible(officecfg::Office::Writer::Comparison::StoreRSID::isReadOnly());
@@ -2755,13 +2705,6 @@ IMPL_LINK(SwCompareOptionsTabPage, ComparisonHdl, 
weld::Toggleable&, rButton, vo
 
 bool bChecked = 

core.git: sw/source

2024-05-20 Thread Noel Grandin (via logerrit)
 sw/source/core/access/AccessibilityCheck.cxx |   29 +--
 sw/source/core/access/AccessibilityIssue.cxx |   12 +--
 sw/source/core/access/acccell.cxx|2 -
 sw/source/core/access/acccontext.cxx |   12 +--
 sw/source/core/access/accdoc.cxx |   12 +--
 sw/source/core/access/accembedded.cxx|2 -
 sw/source/core/access/accfootnote.cxx|2 -
 sw/source/core/access/accgraphic.cxx |4 +--
 sw/source/core/access/accheaderfooter.cxx|2 -
 sw/source/core/access/acchyperlink.cxx   |2 -
 sw/source/core/access/accpage.cxx|2 -
 sw/source/core/access/accpara.cxx|   16 +++---
 sw/source/core/access/accpreview.cxx |2 -
 sw/source/core/access/accselectionhelper.cxx |2 -
 sw/source/core/access/acctable.cxx   |6 ++---
 sw/source/core/access/acctextframe.cxx   |4 +--
 16 files changed, 56 insertions(+), 55 deletions(-)

New commits:
commit 9312f954b6d636f232a72e35aa2767e450690793
Author: Noel Grandin 
AuthorDate: Mon May 20 09:14:32 2024 +0200
Commit: Noel Grandin 
CommitDate: Mon May 20 12:29:03 2024 +0200

loplugin:ostr in sw/.../access

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

diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index a1fed7c1ffd1..ae767b597698 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -373,11 +373,11 @@ private:
 sal_Int32 nStart)
 {
 uno::Reference xProperties(xTextRange, 
uno::UNO_QUERY);
-if 
(!xProperties->getPropertySetInfo()->hasPropertyByName("HyperLinkURL"))
+if 
(!xProperties->getPropertySetInfo()->hasPropertyByName(u"HyperLinkURL"_ustr))
 return;
 
 OUString sHyperlink;
-xProperties->getPropertyValue("HyperLinkURL") >>= sHyperlink;
+xProperties->getPropertyValue(u"HyperLinkURL"_ustr) >>= sHyperlink;
 if (!sHyperlink.isEmpty())
 {
 OUString sText = xTextRange->getString();
@@ -485,7 +485,7 @@ private:
 
 Color nParaBackColor(COL_AUTO);
 uno::Reference xParagraphProperties(xParagraph, 
uno::UNO_QUERY);
-if (!(xParagraphProperties->getPropertyValue("ParaBackColor") >>= 
nParaBackColor))
+if (!(xParagraphProperties->getPropertyValue(u"ParaBackColor"_ustr) 
>>= nParaBackColor))
 {
 SAL_WARN("sw.a11y", "ParaBackColor void");
 return;
@@ -497,7 +497,7 @@ private:
 
 // Foreground color
 sal_Int32 nCharColor = {}; // spurious -Werror=maybe-uninitialized
-if (!(xProperties->getPropertyValue("CharColor") >>= nCharColor))
+if (!(xProperties->getPropertyValue(u"CharColor"_ustr) >>= nCharColor))
 { // not sure this is impossible, can the default be void?
 SAL_WARN("sw.a11y", "CharColor void");
 return;
@@ -522,7 +522,7 @@ private:
 
 Color nCharBackColor(COL_AUTO);
 
-if (!(xProperties->getPropertyValue("CharBackColor") >>= 
nCharBackColor))
+if (!(xProperties->getPropertyValue(u"CharBackColor"_ustr) >>= 
nCharBackColor))
 {
 SAL_WARN("sw.a11y", "CharBackColor void");
 return;
@@ -538,7 +538,7 @@ private:
 {
 OUString sCharStyleName;
 Color nCharStyleBackColor(COL_AUTO);
-if (xProperties->getPropertyValue("CharStyleName") >>= 
sCharStyleName)
+if (xProperties->getPropertyValue(u"CharStyleName"_ustr) >>= 
sCharStyleName)
 {
 try
 {
@@ -547,10 +547,10 @@ private:
 uno::Reference xCont
 = xStyleFamiliesSupplier->getStyleFamilies();
 uno::Reference xStyleFamily(
-xCont->getByName("CharacterStyles"), uno::UNO_QUERY);
+xCont->getByName(u"CharacterStyles"_ustr), 
uno::UNO_QUERY);
 uno::Reference xInfo(
 xStyleFamily->getByName(sCharStyleName), 
uno::UNO_QUERY);
-xInfo->getPropertyValue("CharBackColor") >>= 
nCharStyleBackColor;
+xInfo->getPropertyValue(u"CharBackColor"_ustr) >>= 
nCharStyleBackColor;
 }
 catch (const uno::Exception&)
 {
@@ -1095,10 +1095,11 @@ private:
 sal_Int32 nStart)
 {
 uno::Reference xProperties(xTextRange, 
uno::UNO_QUERY);
-if (xProperties.is() && 
xProperties->getPropertySetInfo()->hasPropertyByName("CharFlash"))
+if (xProperties.is()
+&& 
xProperties->getPropertySetInfo()->hasPropertyByName(u"CharFlash"_ustr))
 {
 

core.git: sw/source

2024-05-19 Thread Caolán McNamara (via logerrit)
 sw/source/ui/frmdlg/frmpage.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit d0702a3f17c1fbd1b8ffb9ca0b275943e1a1f442
Author: Caolán McNamara 
AuthorDate: Sun May 19 15:08:14 2024 +0100
Commit: Caolán McNamara 
CommitDate: Sun May 19 20:08:15 2024 +0200

Resolves: tdf#151382 we want to save the FN_KEEP_ASPECT_RATIO state

and not if it is implied to be toggled on by SwFormatFrameSize::SYNCED
in which case on "ok" FN_KEEP_ASPECT_RATIO is set from the ui state

so both tdf#151382 and tdf132591 work

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

diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 6d6a1fefd49a..589af7dbb0a0 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2321,6 +2321,8 @@ void SwFramePage::Init(const SfxItemSet& rSet)
 
 if (SfxItemState::SET == rSet.GetItemState(FN_KEEP_ASPECT_RATIO))
 m_xFixedRatioCB->set_active(rSet.Get(FN_KEEP_ASPECT_RATIO).GetValue());
+// see tdf#132591 and tdf#151382 for some examples of FN_KEEP_ASPECT_RATIO 
cases
+m_xFixedRatioCB->save_state();
 
 // columns
 SwFormatCol aCol( rSet.Get(RES_COL) );
@@ -2379,7 +2381,6 @@ void SwFramePage::Init(const SfxItemSet& rSet)
 
 if (rSize.GetWidthPercent() == SwFormatFrameSize::SYNCED || 
rSize.GetHeightPercent() == SwFormatFrameSize::SYNCED)
 m_xFixedRatioCB->set_active(true);
-m_xFixedRatioCB->save_state();
 if (rSize.GetWidthPercent() && rSize.GetWidthPercent() != 
SwFormatFrameSize::SYNCED &&
 !m_xRelWidthCB->get_active())
 {


core.git: sw/source

2024-05-19 Thread Caolán McNamara (via logerrit)
 sw/source/core/unocore/unosect.cxx |2 +-
 sw/source/core/unocore/unotbl.cxx  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 445ee505b63686161962abfe7a2aaafe8a03b4be
Author: Caolán McNamara 
AuthorDate: Sun May 19 12:15:24 2024 +0100
Commit: Caolán McNamara 
CommitDate: Sun May 19 16:34:30 2024 +0200

cid#1598293 silence Unchecked return value

and

cid#1598292 Unchecked return value

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

diff --git a/sw/source/core/unocore/unosect.cxx 
b/sw/source/core/unocore/unosect.cxx
index 5f48f9580bc4..d85a90736866 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -1607,7 +1607,7 @@ SwXTextSection::getPropertyDefault(const OUString& 
rPropertyName)
 case  FN_UNO_ANCHOR_TYPES:
 case  FN_UNO_TEXT_WRAP:
 case  FN_UNO_ANCHOR_TYPE:
-::sw::GetDefaultTextContentValue(aRet, u"", pEntry->nWID);
+(void)::sw::GetDefaultTextContentValue(aRet, u"", pEntry->nWID);
 break;
 default:
 if(pFormat && SfxItemPool::IsWhich(pEntry->nWID))
diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index 1ecefa2eb2a9..f9ce9aa23b6e 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -2713,7 +2713,7 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& 
rPropertyName)
 case  FN_UNO_ANCHOR_TYPES:
 case  FN_UNO_TEXT_WRAP:
 case  FN_UNO_ANCHOR_TYPE:
-::sw::GetDefaultTextContentValue(
+(void)::sw::GetDefaultTextContentValue(
 aRet, u"", pEntry->nWID);
 break;
 


core.git: sw/source

2024-05-19 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/app/apphdl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7e36bbd142ea80969c15f384759102d8175dedc3
Author: Caolán McNamara 
AuthorDate: Sun May 19 12:13:15 2024 +0100
Commit: Caolán McNamara 
CommitDate: Sun May 19 15:25:18 2024 +0200

cid#1598236 silence Unchecked return value

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

diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 03657db5447f..28c766b3d3b1 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -414,7 +414,7 @@ void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( 
const SfxItemSet * pArgs
 const css::uno::Sequence< OUString > vPackages{ 
"libreoffice-base" };
 xSyncDbusSessionHelper->InstallPackageNames(vPackages, 
OUString());
 SolarMutexGuard aGuard;
-executeRestartDialog(comphelper::getProcessComponentContext(), 
nullptr, RESTART_REASON_MAILMERGE_INSTALL);
+
(void)executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, 
RESTART_REASON_MAILMERGE_INSTALL);
 }
 catch (const css::uno::Exception &)
 {


core.git: sw/source

2024-05-18 Thread Noel Grandin (via logerrit)
 sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx |4 +-
 sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx |2 -
 sw/source/writerfilter/dmapper/PropertyMap.cxx   |   27 +--
 3 files changed, 16 insertions(+), 17 deletions(-)

New commits:
commit 551c8230b495e8c0e0502b73445f6edd1510633e
Author: Noel Grandin 
AuthorDate: Fri May 17 14:57:56 2024 +0200
Commit: Noel Grandin 
CommitDate: Sat May 18 16:59:15 2024 +0200

use more concrete UNO type in sw/../writerfilter

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

diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
index 0d6570997e82..2f46d3e977fb 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
@@ -3883,7 +3883,7 @@ void DomainMapper_Impl::PushPageHeaderFooter(PagePartType 
ePagePartType, PageTyp
 
 /** Prepares the header/footer text content by first removing the existing
  *  content and adding it to the text append stack. */
-void 
DomainMapper_Impl::prepareHeaderFooterContent(uno::Reference
 const& xPageStyle,
+void 
DomainMapper_Impl::prepareHeaderFooterContent(rtl::Reference 
const& xPageStyle,
PagePartType ePagePartType, 
PropertyIds ePropertyID,
bool 
bAppendToHeaderAndFooterTextStack)
 {
@@ -3921,7 +3921,7 @@ void 
DomainMapper_Impl::checkIfHeaderFooterIsEmpty(PagePartType ePagePartType, P
 
 bool bHeader = ePagePartType == PagePartType::Header;
 
-uno::Reference 
xPageStyle(pSectionContext->GetPageStyle(*this));
+rtl::Reference 
xPageStyle(pSectionContext->GetPageStyle(*this));
 
 if (!xPageStyle.is())
 return;
diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx 
b/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
index 052a0a62c156..d54b42e719dd 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx
@@ -744,7 +744,7 @@ public:
 void RemoveLastParagraph();
 
 void checkIfHeaderFooterIsEmpty(PagePartType ePagePartType, PageType 
eType);
-void 
prepareHeaderFooterContent(css::uno::Reference const& 
xPageStyle,
+void prepareHeaderFooterContent(rtl::Reference const& 
xPageStyle,
 PagePartType ePagePartType, PropertyIds 
eID,
 bool bAppendToHeaderAndFooterTextStack);
 
diff --git a/sw/source/writerfilter/dmapper/PropertyMap.cxx 
b/sw/source/writerfilter/dmapper/PropertyMap.cxx
index 913dde2bc84e..f52d37764402 100644
--- a/sw/source/writerfilter/dmapper/PropertyMap.cxx
+++ b/sw/source/writerfilter/dmapper/PropertyMap.cxx
@@ -594,11 +594,10 @@ void SectionPropertyMap::SetBorder( BorderPosition ePos, 
sal_Int32 nLineDistance
 
 void SectionPropertyMap::ApplyPaperSource(DomainMapper_Impl& rDM_Impl)
 {
-uno::Reference xFirst;
 // todo: negative spacing (from ww8par6.cxx)
 if (!m_sPageStyleName.isEmpty())
 {
-xFirst = GetPageStyle(rDM_Impl);
+rtl::Reference xFirst = GetPageStyle(rDM_Impl);
 if ( xFirst.is() )
 try
 {
@@ -630,7 +629,7 @@ void SectionPropertyMap::ApplyBorderToPageStyles( 
DomainMapper_Impl& rDM_Impl,
 1 offset from edge of page
 */
 
-uno::Reference xFirst;
+rtl::Reference xFirst;
 // todo: negative spacing (from ww8par6.cxx)
 if (!m_sPageStyleName.isEmpty())
 xFirst = GetPageStyle(rDM_Impl);
@@ -895,8 +894,8 @@ namespace
 {
 
 // Copy the content of the header/footer property to the target style
-void copyHeaderFooterTextProperty(const uno::Reference& 
xSource,
-  const uno::Reference& 
xTarget,
+void copyHeaderFooterTextProperty(const rtl::Reference& xSource,
+  const rtl::Reference& xTarget,
   PropertyIds ePropId)
 {
 if (!xSource.is() || !xTarget.is())
@@ -923,8 +922,8 @@ void copyHeaderFooterTextProperty(const 
uno::Reference& xSo
 }
 
 // Copies all the header and footer content and relevant flags from the source 
style to the target.
-void completeCopyHeaderFooter(const uno::Reference& 
xSourceStyle,
-const uno::Reference& xTargetStyle,
+void completeCopyHeaderFooter(const rtl::Reference& xSourceStyle,
+const rtl::Reference& xTargetStyle,
 bool const bMissingHeader, bool const bMissingFooter)
 {
 if (!xSourceStyle.is() || !xTargetStyle.is())
@@ -994,8 +993,8 @@ void completeCopyHeaderFooter(const 
uno::Reference& xSource
 
 // Copy headers and footers from the previous page style.
 void copyHeaderFooter(const DomainMapper_Impl& rDM_Impl,
-  const uno::Reference< 

core.git: sw/source

2024-05-17 Thread Noel Grandin (via logerrit)
 sw/source/core/unocore/SwXTextDefaults.cxx   |   16 +-
 sw/source/core/unocore/swunohelper.cxx   |6 -
 sw/source/core/unocore/unobkm.cxx|   30 ++---
 sw/source/core/unocore/unochart.cxx  |   30 ++---
 sw/source/core/unocore/unocoll.cxx   |   50 -
 sw/source/core/unocore/unocontentcontrol.cxx |   22 ++--
 sw/source/core/unocore/unocrsrhelper.cxx |   20 +--
 sw/source/core/unocore/unodraw.cxx   |   40 +++
 sw/source/core/unocore/unoevent.cxx  |8 -
 sw/source/core/unocore/unofield.cxx  |   26 ++--
 sw/source/core/unocore/unoflatpara.cxx   |   10 -
 sw/source/core/unocore/unoframe.cxx  |   46 
 sw/source/core/unocore/unoftn.cxx|4 
 sw/source/core/unocore/unoidx.cxx|   46 
 sw/source/core/unocore/unolinebreak.cxx  |6 -
 sw/source/core/unocore/unoobj.cxx|   40 +++
 sw/source/core/unocore/unoobj2.cxx   |   62 +--
 sw/source/core/unocore/unoparagraph.cxx  |   28 ++---
 sw/source/core/unocore/unoport.cxx   |   24 ++--
 sw/source/core/unocore/unoportenum.cxx   |4 
 sw/source/core/unocore/unoredline.cxx|4 
 sw/source/core/unocore/unoredlines.cxx   |4 
 sw/source/core/unocore/unorefmk.cxx  |   58 +-
 sw/source/core/unocore/unosect.cxx   |   18 +--
 sw/source/core/unocore/unosett.cxx   |   48 
 sw/source/core/unocore/unosrch.cxx   |4 
 sw/source/core/unocore/unostyle.cxx  |   66 ++--
 sw/source/core/unocore/unotbl.cxx|  148 +--
 sw/source/core/unocore/unotext.cxx   |   36 +++---
 29 files changed, 453 insertions(+), 451 deletions(-)

New commits:
commit 359ae74cc138c59d18285cea301a7382da14668d
Author: Noel Grandin 
AuthorDate: Fri May 17 12:42:04 2024 +0200
Commit: Noel Grandin 
CommitDate: Fri May 17 21:38:42 2024 +0200

loplugin:ostr in sw/../unocore

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

diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx 
b/sw/source/core/unocore/SwXTextDefaults.cxx
index f129eff219eb..66ea89e3d3f0 100644
--- a/sw/source/core/unocore/SwXTextDefaults.cxx
+++ b/sw/source/core/unocore/SwXTextDefaults.cxx
@@ -213,7 +213,7 @@ Any SAL_CALL SwXTextDefaults::getPropertyDefault( const 
OUString& rPropertyName
 
 OUString SAL_CALL SwXTextDefaults::getImplementationName(  )
 {
-return "SwXTextDefaults";
+return u"SwXTextDefaults"_ustr;
 }
 
 sal_Bool SAL_CALL SwXTextDefaults::supportsService( const OUString& 
rServiceName )
@@ -223,13 +223,13 @@ sal_Bool SAL_CALL SwXTextDefaults::supportsService( const 
OUString& rServiceName
 
 uno::Sequence< OUString > SAL_CALL SwXTextDefaults::getSupportedServiceNames(  
)
 {
-return { "com.sun.star.text.Defaults",
- "com.sun.star.style.CharacterProperties",
- "com.sun.star.style.CharacterPropertiesAsian",
- "com.sun.star.style.CharacterPropertiesComplex",
- "com.sun.star.style.ParagraphProperties",
- "com.sun.star.style.ParagraphPropertiesAsian",
- "com.sun.star.style.ParagraphPropertiesComplex" };
+return { u"com.sun.star.text.Defaults"_ustr,
+ u"com.sun.star.style.CharacterProperties"_ustr,
+ u"com.sun.star.style.CharacterPropertiesAsian"_ustr,
+ u"com.sun.star.style.CharacterPropertiesComplex"_ustr,
+ u"com.sun.star.style.ParagraphProperties"_ustr,
+ u"com.sun.star.style.ParagraphPropertiesAsian"_ustr,
+ u"com.sun.star.style.ParagraphPropertiesComplex"_ustr };
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/swunohelper.cxx 
b/sw/source/core/unocore/swunohelper.cxx
index 0aab2a681acf..b5b1d2adb36a 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -64,7 +64,7 @@ bool UCB_DeleteFile( const OUString& rURL )
 ucbhelper::Content aTempContent( rURL,
 css::uno::Reference< 
css::ucb::XCommandEnvironment >(),
 comphelper::getProcessComponentContext() );
-aTempContent.executeCommand("delete", css::uno::Any( true ) );
+aTempContent.executeCommand(u"delete"_ustr, css::uno::Any( true ) );
 bRemoved = true;
 }
 catch( css::uno::Exception& )
@@ -94,7 +94,7 @@ bool UCB_MoveFile( const OUString& rURL, std::u16string_view 
rNewURL )
 aInfo.NewTitle = sName;
 aInfo.SourceURL = rURL;
 aInfo.MoveData = true;
-aTempContent.executeCommand( "transfer", uno::Any(aInfo) );
+aTempContent.executeCommand( u"transfer"_ustr, uno::Any(aInfo) );
 }
 catch( css::uno::Exception& )
 {
@@ -138,7 +138,7 @@ bool 

core.git: sw/source

2024-05-17 Thread Caolán McNamara (via logerrit)
 sw/source/filter/ww8/ww8atr.cxx |   24 ++--
 1 file changed, 14 insertions(+), 10 deletions(-)

New commits:
commit 3ddd11d18a24ebd8cbc3e5ac8d460b4888cade07
Author: Caolán McNamara 
AuthorDate: Fri May 17 14:15:23 2024 +0100
Commit: Caolán McNamara 
CommitDate: Fri May 17 17:43:03 2024 +0200

WaE: C6011 Dereferencing NULL pointer warnings

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

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 30fbebc4fbc3..e1787614f732 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -5521,17 +5521,21 @@ static void ParaTabStopDelAdd( WW8Export& rWrt,
 aTab.Add(*pTN, nLParaMgn);  // must be inserted
 nN++;
 }
-else if (lcl_IsEqual(nOP, *pTO, nNP, *pTN)) // tabs are equal
-{
-nO++;   // nothing to do
-nN++;
-}
-else// tabs same position, 
different type
+else
 {
-aTab.Del(*pTO, nLStypeMgn); // delete old one
-aTab.Add(*pTN, nLParaMgn);  // insert new one
-nO++;
-nN++;
+assert(pTO && pTN);
+if (lcl_IsEqual(nOP, *pTO, nNP, *pTN)) // tabs are equal
+{
+nO++;   // nothing to do
+nN++;
+}
+else// tabs same position, 
different type
+{
+aTab.Del(*pTO, nLStypeMgn); // delete old one
+aTab.Add(*pTN, nLParaMgn);  // insert new one
+nO++;
+nN++;
+}
 }
 } while( true );
 


core.git: sw/source

2024-05-17 Thread Pranam Lashkari (via logerrit)
 sw/source/uibase/docvw/AnnotationWin2.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 45e0c28a6911ef19c8c11e0195c6f01362d53611
Author: Pranam Lashkari 
AuthorDate: Wed May 15 23:08:23 2024 +0300
Commit: Caolán McNamara 
CommitDate: Fri May 17 12:05:40 2024 +0200

Added parent / child relationship to comments.

Adding parent name of a comment into odf file when there is a parent.

problem:
adding reply to any comment, saving and reopening doc will not show
reply in same thread.
regression from: c0187d9f5e6ab5129b6fc4682555f2f8775d6f67

this part affects core only, similar thing online was done in 
62cc2217217650d23c72e4646ccd793f76722d94

Change-Id: I563e3a2785543da69d717f8770f91a514699e604
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167711
Reviewed-by: Gökay ŞATIR 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 2a040bfe3e9f58db5c9f6503796778f07e2beba9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167680
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins

diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index e831ed55f182..75edfe80edb2 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -1071,6 +1071,7 @@ void SwAnnotationWin::ExecuteCommand(sal_uInt16 nSlot)
 auto pPostItField = mrMgr.GetLatestPostItField();
 pPostItField->SetParentId(GetTopReplyNote()->GetParaId());
 
pPostItField->SetParentPostItId(GetTopReplyNote()->GetPostItField()->GetPostItId());
+this->GeneratePostItName();
 
pPostItField->SetParentName(GetTopReplyNote()->GetPostItField()->GetName());
 }
 break;


core.git: sw/source

2024-05-16 Thread Justin Luth (via logerrit)
 sw/source/filter/ww8/ww8graf.cxx |   17 ++---
 1 file changed, 6 insertions(+), 11 deletions(-)

New commits:
commit 1a38ff09bef969ad13877e3e752b04e1d590323e
Author: Justin Luth 
AuthorDate: Tue May 14 21:29:29 2024 -0400
Commit: Justin Luth 
CommitDate: Thu May 16 13:07:16 2024 +0200

NFC use more GetTrueWhichIDFromSlotID

We already check if nWhich is not equal to 0,
so instead of returning nWhich == nSlotId
(which we immediately check for an reject),
use this version of the function which returns a 0
instead of the slotid when there is no nWhich.

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

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index a0209e002d8e..97420da84945 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -536,12 +536,10 @@ void SwWW8ImplReader::InsertTxbxStyAttrs(SfxItemSet& rS, 
sal_uInt16 nColl, ManTy
 aLR.SetRight(pStyInf->m_pFormat->GetRightMargin().GetRight());
 rS.Put(aLR);
 }
-else if (
-nSlotId && nWhich != nSlotId &&
-0 != (nWhich = pEditPool->GetWhichIDFromSlotID(nSlotId)) &&
-nWhich != nSlotId &&
-( SfxItemState::SET != rS.GetItemState(nWhich, false) )
-   )
+else if (nSlotId && nWhich != nSlotId
+ && 0 != (nWhich = 
pEditPool->GetTrueWhichIDFromSlotID(nSlotId))
+ && SfxItemState::SET != rS.GetItemState(nWhich, false))
+
 {
 rS.Put( pItem->CloneSetWhich(nWhich) );
 }
@@ -794,11 +792,8 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP 
nStartCp, WW8_CP nEndCp,
 }
 pS->Put(aLR);
 }
-else if (
-nSlotId && nWhich != nSlotId &&
-0 != (nWhich = 
pEditPool->GetWhichIDFromSlotID(nSlotId)) &&
-nWhich != nSlotId
-)
+else if (nSlotId && nWhich != nSlotId
+ && 0 != (nWhich = 
pEditPool->GetTrueWhichIDFromSlotID(nSlotId)))
 {
 pS->Put( pItem->CloneSetWhich(nWhich) );
 }


core.git: sw/source

2024-05-15 Thread Justin Luth (via logerrit)
 sw/source/filter/ww8/ww8par6.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit ebf7d87fa4cb7ceac80190f48b7d035aa9469acf
Author: Justin Luth 
AuthorDate: Fri May 10 11:24:26 2024 -0400
Commit: Justin Luth 
CommitDate: Thu May 16 01:48:38 2024 +0200

NFC typo: rename to consistent bFirstLineOfstSet

One version spelled "Line" wrong (Lin),
and the other version had poor "Ofst" capitalization(OfSt).

I decided not to make it "Ofset" because then you get
"OfsetSet" which looks a bit more redundant,
and then m_aTextNodesHavingFirstLineOfstSet should also be renamed...

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

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index bc89199c4904..021445724647 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2844,7 +2844,7 @@ bool SwWW8ImplReader::TestSameApo(const ApoTestResults 
,
 }
 
 void SwWW8ImplReader::NewAttr( const SfxPoolItem& rAttr,
-   const bool bFirstLineOfStSet,
+   const bool bFirstLineOfstSet,
const bool bLeftIndentSet )
 {
 if( m_bNoAttrImport ) // for ignoring styles during doc inserts
@@ -2867,7 +2867,7 @@ void SwWW8ImplReader::NewAttr( const SfxPoolItem& rAttr,
 {
 m_xCtrlStck->NewAttr(*m_pPaM->GetPoint(), rAttr);
 // #i103711#
-if ( bFirstLineOfStSet )
+if (bFirstLineOfstSet)
 {
 const SwNode* pNd = &(m_pPaM->GetPoint()->GetNode());
 m_aTextNodesHavingFirstLineOfstSet.insert( pNd );
@@ -4346,7 +4346,7 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const 
sal_uInt8* pData, short nLe
 }
 }
 
-bool bFirstLinOfstSet( false ); // #i103711#
+bool bFirstLineOfstSet(false); // #i103711#
 bool bLeftIndentSet( false ); // #i105414#
 
 switch (nId)
@@ -4412,7 +4412,7 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const 
sal_uInt8* pData, short nLe
 {
 m_vColl[m_nCurrentColl].m_bListRelevantIndentSet = true;
 }
-bFirstLinOfstSet = true; // #i103711#
+bFirstLineOfstSet = true; // #i103711#
 break;
 //sprmPDxaRight
 case NS_sprm::v6::sprmPDxaRight:
@@ -4424,7 +4424,7 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const 
sal_uInt8* pData, short nLe
 return;
 }
 
-NewAttr(*pFirstLine, bFirstLinOfstSet, false); // #i103711#, #i105414#
+NewAttr(*pFirstLine, bFirstLineOfstSet, false); // #i103711#, #i105414#
 NewAttr(*pLeftMargin, false, bLeftIndentSet);
 NewAttr(*pRightMargin, false, false);
 }


core.git: sw/source

2024-05-15 Thread Michael Stahl (via logerrit)
 sw/source/core/layout/tabfrm.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 534d3818aedfa95ad73935235462f5ec2817f5da
Author: Michael Stahl 
AuthorDate: Wed May 15 14:43:10 2024 +0200
Commit: Michael Stahl 
CommitDate: Wed May 15 17:58:21 2024 +0200

tdf#160897 sw: layout: fail SwTabFrame::Split on footnote overlap

The bugdoc has a table in a section, and the cells contain many
footnotes.

Somehow commit c303981cfd95ce1c3881366023d5495ae2edce97 introduced some
layout looping, and it also looks worse than in 7.5.

During lcl_RecalcRow(rLastLine) it may happen that first some footnotes
are moved off the page, then the table/section grow during text
formatting, then the footnotes are moved back onto the page, so the
footnote container is the same size as before, the body is the same size
as before (because it shrinks whenever the footnote container grows),
but the section and table don't fit into the body any more.

This fixes the layout loops, and also there are no visible overlaps of
body(table) and footnotes any more; however, the layout is obviously not
perfect, many footnotes are on the wrong page and there are some gaps of
empty space on some pages, but at least none of the footnotes are
numbered "0" any more.

In 7.5, there was overlap of the body and the footnotes on page 1 and 3,
and also the irritating effect that moving the mouse over
the bottom of page 3 would relayout the document multiple times...

Some other ideas that don't work:

* it doesn't help to call Shrink() on the section frame, because it has
  ToMaximize() and does not actually shrink.
* one aspect of the loop is that the section is always size-invalidated
  even when it doesn't change its size during SwTabFormat::MakeAll()
  and the idea was to detect this (invalidation flag set on upper but
  same area as before) and reset the flag, but this prevents shrinking
  the section to fit on the page

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

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 41ea720609b1..8cd16b8d80ce 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -760,6 +760,9 @@ static bool lcl_RecalcSplitLine( SwRowFrame& rLastLine, 
SwRowFrame& rFollowLine,
 // #i26945# - include check, if objects fit
 const SwTwips nDistanceToUpperPrtBottom =
 aRectFnSet.BottomDist(rTab.getFrameArea(), 
aRectFnSet.GetPrtBottom(*rTab.GetUpper()));
+// also check the footnote boss - it *may* be smaller than the upper now!
+const SwTwips nDistanceToFootnoteBodyPrtBottom =
+aRectFnSet.BottomDist(rTab.getFrameArea(), 
aRectFnSet.GetPrtBottom(*rTab.FindFootnoteBossFrame()->FindBodyCont()));
 // tdf#125685 ignore footnotes that are anchored in follow-table of this
 // table - if split is successful they move to the next page/column anyway
 assert(rTab.GetFollow() == rFollowLine.GetUpper());
@@ -803,6 +806,14 @@ static bool lcl_RecalcSplitLine( SwRowFrame& rLastLine, 
SwRowFrame& rFollowLine,
 if (nDistanceToUpperPrtBottom + nFollowFootnotes < 0 || 
!rTab.DoesObjsFit())
 bRet = false;
 
+// apparently checking nFootnoteHeight here does *not* guarantee that it 
fits into the body
+if (bRet && nDistanceToFootnoteBodyPrtBottom + nFollowFootnotes < 0)
+{
+assert(rTab.GetUpper() != 
rTab.FindFootnoteBossFrame()->FindBodyCont());
+SAL_INFO("sw.layout", "SwTabFrame Split failed because of footnote 
growth");
+bRet = false; // tdf#160897
+}
+
 // 2. Check if each cell in the last line has at least one content frame.
 
 // Note: a FollowFlowRow may contains empty cells!


core.git: sw/source

2024-05-14 Thread Jaume Pujantell (via logerrit)
 sw/source/uibase/uiview/viewtab.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 1d83ac544dcd2fbfb0aa19065e16ed82c40d0c86
Author: Jaume Pujantell 
AuthorDate: Fri May 10 10:04:47 2024 +0200
Commit: Caolán McNamara 
CommitDate: Tue May 14 09:37:43 2024 +0200

sw: avoid unwanted row height changes

When changing a row's height with SID_TABLE_CHANGE_CURRENT_BORDER_POSITION
avoid knock-on effects to lower rows.

Change-Id: I0af5a6ec2ceb685ec5dd97e4a00237a4c7857589
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167438
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit c6c1c7afc18f32453c06a3af25f389ccb9074a1b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167459
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins

diff --git a/sw/source/uibase/uiview/viewtab.cxx 
b/sw/source/uibase/uiview/viewtab.cxx
index 2e5bb65435ec..24d5585137fa 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -1169,7 +1169,15 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
 auto & rEntry = aTabRows.GetEntry(nIndex);
 tools::Long nNewPosition = rEntry.nPos + nOffset;
 nNewPosition = std::clamp(nNewPosition, rEntry.nMin, 
rEntry.nMax - constDistanceOffset);
+tools::Long nActualOffset = nNewPosition - rEntry.nPos;
 rEntry.nPos = nNewPosition;
+// Maintain the size of the other rows
+for (size_t i = nIndex + 1; i < aTabRows.Count(); ++i)
+{
+auto& rNextEntry = aTabRows.GetEntry(i);
+rNextEntry.nPos += nActualOffset;
+}
+aTabRows.SetRight(aTabRows.GetRight() + nActualOffset);
 }
 
 rSh.SetTabRows(aTabRows, false);


core.git: sw/source

2024-05-10 Thread Andrea Gelmini (via logerrit)
 sw/source/core/frmedt/tblsel.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8088bd350da2a38f7e582c6452d506a572a19cae
Author: Andrea Gelmini 
AuthorDate: Fri May 10 16:59:36 2024 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat May 11 05:22:55 2024 +0200

Fix typo

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

diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 74ec7fe7a106..ccaa3d2ae9b1 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -1883,7 +1883,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const 
SwLayoutFrame *pStart,
 {
 SwRowFrame* pRowFrame = pTable->GetFirstNonHeadlineRow();
 //tdf#159027: follow returns a frame without height if
-// merged cells are invoved
+// merged cells are involved
 if (pRowFrame->getFrameArea().IsEmpty())
 pRowFrame = static_cast(pRowFrame->GetNext());
 pRow = pRowFrame;


core.git: sw/source

2024-05-10 Thread Oliver Specht (via logerrit)
 sw/source/core/frmedt/tblsel.cxx |   15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit f60126a6bfae5dad4a11afcc94ddf4a58c5ce8ab
Author: Oliver Specht 
AuthorDate: Thu Apr 18 16:04:49 2024 +0200
Commit: Michael Stahl 
CommitDate: Fri May 10 11:05:36 2024 +0200

tdf#159027: Fix calculation in tables with merged cells

Calculation in tables with merged cells over multiple pages is fixed.
It's more a workaround than a fix as it skips an empty SwRowFrame
returned from SwTabFrame::GetFirstNonHeadlineRow()

Change-Id: If11838da9769e0f6b0e54da8f422b4884684e30f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166254
Tested-by: Gabor Kelemen 
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 669762ffacc3..74ec7fe7a106 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -1878,9 +1878,18 @@ void MakeSelUnions( SwSelUnions& rUnions, const 
SwLayoutFrame *pStart,
 // erroneous results could occur during split/merge.
 // To prevent these we will determine the first and last row
 // within the union and use their values for a new union
-const SwLayoutFrame* pRow = pTable->IsFollow() ?
-  pTable->GetFirstNonHeadlineRow() :
-  static_cast(pTable->Lower());
+const SwLayoutFrame* pRow = nullptr;
+if (pTable->IsFollow())
+{
+SwRowFrame* pRowFrame = pTable->GetFirstNonHeadlineRow();
+//tdf#159027: follow returns a frame without height if
+// merged cells are invoved
+if (pRowFrame->getFrameArea().IsEmpty())
+pRowFrame = static_cast(pRowFrame->GetNext());
+pRow = pRowFrame;
+}
+else
+pRow = static_cast(pTable->Lower());
 
 while ( pRow && !pRow->getFrameArea().Overlaps( aUnion ) )
 pRow = static_cast(pRow->GetNext());


core.git: sw/source

2024-05-10 Thread Michael Stahl (via logerrit)
 sw/source/uibase/utlui/content.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 609d1e353cfd7a9b138fcbe656a2faae9f84c36a
Author: Michael Stahl 
AuthorDate: Wed May 8 13:28:52 2024 +0200
Commit: Michael Stahl 
CommitDate: Fri May 10 10:08:01 2024 +0200

sw: Navigator: don't show virtual drawing objects

These can return a non-empty name now, so exclude them explicitly.

(regression from commit ae132145ff42a95dc24fb124847c04af4b8c8dab)

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

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 5642ff20a790..fb7833e244a4 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1023,7 +1023,7 @@ void SwContentType::FillMemberList(bool* pbContentChanged)
 for (const rtl::Reference& pTemp : *pPage)
 {
 // #i51726# - all drawing objects can be named now
-if (!pTemp->GetName().isEmpty())
+if (!pTemp->IsVirtualObj() && !pTemp->GetName().isEmpty())
 {
 tools::Long nYPos = LONG_MIN;
 const bool bIsVisible = 
rIDDMA.IsVisibleLayerId(pTemp->GetLayer());


core.git: sw/source

2024-05-09 Thread Miklos Vajna (via logerrit)
 sw/source/core/inc/pagefrm.hxx|1 +
 sw/source/core/inc/sectfrm.hxx|4 
 sw/source/core/layout/findfrm.cxx |   23 +++
 sw/source/core/layout/sectfrm.cxx |1 +
 4 files changed, 29 insertions(+)

New commits:
commit 8bae684c93bd23bbe98707ba9cf75d1a39427131
Author: Miklos Vajna 
AuthorDate: Thu May 9 08:20:21 2024 +0200
Commit: Miklos Vajna 
CommitDate: Thu May 9 09:35:03 2024 +0200

tdf#160984 sw continuous endnotes: add a way to find the endnote section 
start

Existing code with endnotes on separate page at the end of the document
works by searching for a current or next page that is an endnote page in
SwFootnoteBossFrame::AppendFootnote(), and in case none is found, then
an endnote page is created.

Add similar infrastructure for the inline endnotes case: here we want to
find the first page that has an endnotes section, which also requires
being able to tell if a section is an endnotes one.

The newly introduced SwPageFrame::GetEndNoteSection() is not yet used in
SwFootnoteBossFrame::AppendFootnote(), though.

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

diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 23d77b1c8f74..be55221b2bef 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -204,6 +204,7 @@ public:
 bool IsEndNotePage() const  { return m_bEndNotePage; }
 void SetFootnotePage( bool b )   { m_bFootnotePage = 
b; }
 void SetEndNotePage( bool b )   { m_bEndNotePage = b; }
+SwSectionFrame* GetEndNoteSection();
 
 sal_uInt16 GetPhyPageNum() const{ return m_nPhyPageNum;}
 void SetPhyPageNum( sal_uInt16 nNum )   { m_nPhyPageNum = nNum;}
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index 9dbf9f4df9cc..12646d08ebad 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -52,6 +52,8 @@ class SAL_DLLPUBLIC_RTTI SwSectionFrame final: public 
SwLayoutFrame, public SwFl
 SwSection* m_pSection;
 bool m_bFootnoteAtEnd; // footnotes at the end of section
 bool m_bEndnAtEnd; // endnotes at the end of section
+/// If this is a section for endnotes, then the SwSection is not backed by 
an SwSectionNode.
+bool m_bEndNoteSection = false;
 bool m_bContentLock; // content locked
 bool m_bOwnFootnoteNum; // special numbering of footnotes
 bool m_bFootnoteLock; // ftn, don't leave this section bwd
@@ -171,6 +173,8 @@ public:
 
 void SetFootnoteLock( bool bNew ) { m_bFootnoteLock = bNew; }
 bool IsFootnoteLock() const { return m_bFootnoteLock; }
+void SetEndNoteSection(bool bEndNoteSection) { m_bEndNoteSection = 
bEndNoteSection; }
+bool IsEndNoteSection() const { return m_bEndNoteSection; }
 };
 
 inline const SwSectionFrame *SwSectionFrame::GetFollow() const
diff --git a/sw/source/core/layout/findfrm.cxx 
b/sw/source/core/layout/findfrm.cxx
index a86a7afefc87..60ca1fe7d326 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -65,6 +65,29 @@ SwContentFrame *SwPageFrame::FindLastBodyContent()
 return pRet;
 }
 
+SwSectionFrame* SwPageFrame::GetEndNoteSection()
+{
+SwLayoutFrame* pBody = FindBodyCont();
+if (!pBody)
+{
+return nullptr;
+}
+
+SwFrame* pLast = pBody->GetLastLower();
+if (!pLast || !pLast->IsSctFrame())
+{
+return nullptr;
+}
+
+auto pLastSection = static_cast(pLast);
+if (!pLastSection->IsEndNoteSection())
+{
+return nullptr;
+}
+
+return pLastSection;
+}
+
 /**
  * Checks if the frame contains one or more ContentFrame's anywhere in his
  * subsidiary structure; if so the first found ContentFrame is returned.
diff --git a/sw/source/core/layout/sectfrm.cxx 
b/sw/source/core/layout/sectfrm.cxx
index 3967a1f56442..78278da9cb38 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -94,6 +94,7 @@ SwSectionFrame::SwSectionFrame( SwSectionFrame , bool 
bMaster ) :
 m_bOwnFootnoteNum( false ),
 m_bFootnoteLock( false )
 {
+m_bEndNoteSection = rSect.m_bEndNoteSection;
 StartListening(rSect.GetFormat()->GetNotifier());
 
 mnFrameType = SwFrameType::Section;


core.git: sw/source xmlsecurity/source

2024-05-09 Thread Caolán McNamara (via logerrit)
 sw/source/core/edit/edsect.cxx  |2 +-
 sw/source/core/text/txtftn.cxx  |2 +-
 xmlsecurity/source/framework/saxeventkeeperimpl.cxx |1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 880e093555386e866ef85949ab42cc8f9422994f
Author: Caolán McNamara 
AuthorDate: Wed May 8 21:25:42 2024 +0100
Commit: Caolán McNamara 
CommitDate: Thu May 9 09:30:32 2024 +0200

WaE: C6011 Dereferencing NULL pointer warnings

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

diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx
index 816008776e51..77fd2e7b3dc9 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -301,7 +301,7 @@ static const SwNode* lcl_SpecialInsertNode(const 
SwPosition* pCurrentPos)
 const SwNode* pReturn = nullptr;
 
 // the current position
-OSL_ENSURE( pCurrentPos != nullptr, "Strange, we have no position!" );
+assert(pCurrentPos && "Strange, we have no position!");
 const SwNode& rCurrentNode = pCurrentPos->GetNode();
 
 // find innermost section or table.  At the end of this scope,
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 145a3a30d00f..35bb31f76a4c 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -1034,7 +1034,7 @@ SwNumberPortion *SwTextFormatter::NewFootnoteNumPortion( 
SwTextFormatInfo const
 
 static OUString lcl_GetPageNumber( const SwPageFrame* pPage )
 {
-OSL_ENSURE( pPage, "GetPageNumber: Homeless TextFrame" );
+assert(pPage && "GetPageNumber: Homeless TextFrame");
 const sal_uInt16 nVirtNum = pPage->GetVirtPageNum();
 const SvxNumberType& rNum = pPage->GetPageDesc()->GetNumType();
 return rNum.GetNumStr( nVirtNum );
diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx 
b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
index b5a7f027287f..fe6c0ed915d9 100644
--- a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
+++ b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
@@ -648,6 +648,7 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer()
 BufferNode* pTempCurrentBlockingBufferNode = 
m_pCurrentBlockingBufferNode;
 
 m_pCurrentBufferNode = pBufferNode;
+assert(pBufferNode);
 m_pCurrentBlockingBufferNode = nullptr;
 
 m_bIsForwarding = true;


core.git: sw/source

2024-05-09 Thread Caolán McNamara (via logerrit)
 sw/source/core/text/wrong.cxx   |2 +
 sw/source/core/tox/txmsrt.cxx   |4 +-
 sw/source/core/txtnode/attrcontentcontrol.cxx   |7 +---
 sw/source/core/txtnode/fntcache.cxx |3 +
 sw/source/core/txtnode/ndtxt.cxx|2 -
 sw/source/core/txtnode/txtatr2.cxx  |2 -
 sw/source/core/undo/undel.cxx   |   16 --
 sw/source/core/undo/undobj1.cxx |2 -
 sw/source/core/undo/undraw.cxx  |2 -
 sw/source/core/undo/unins.cxx   |4 +-
 sw/source/core/undo/unnum.cxx   |2 -
 sw/source/core/undo/unsect.cxx  |2 -
 sw/source/core/undo/unspnd.cxx  |2 -
 sw/source/core/undo/untbl.cxx   |   10 +++---
 sw/source/core/unocore/unodraw.cxx  |1 
 sw/source/core/unocore/unoframe.cxx |7 ++--
 sw/source/core/unocore/unoftn.cxx   |   13 
 sw/source/core/unocore/unoidx.cxx   |   16 +-
 sw/source/core/unocore/unolinebreak.cxx |4 +-
 sw/source/core/unocore/unoobj2.cxx  |2 -
 sw/source/core/unocore/unosect.cxx  |5 +--
 sw/source/core/unocore/unotbl.cxx   |   13 +---
 sw/source/core/unocore/unotextmarkup.cxx|4 +-
 sw/source/core/view/pagepreviewlayout.cxx   |2 +
 sw/source/core/view/viewsh.cxx  |2 -
 sw/source/filter/html/css1atr.cxx   |2 -
 sw/source/filter/html/htmlatr.cxx   |2 -
 sw/source/filter/html/htmlcss1.cxx  |4 +-
 sw/source/filter/html/htmlflywriter.cxx |6 +--
 sw/source/filter/html/htmlform.cxx  |8 ++---
 sw/source/filter/html/htmlftn.cxx   |2 -
 sw/source/filter/html/htmlsect.cxx  |2 -
 sw/source/filter/html/htmltab.cxx   |2 -
 sw/source/filter/html/svxcss1.cxx   |   38 
 sw/source/filter/html/swhtml.cxx|2 -
 sw/source/filter/html/wrthtml.cxx   |9 +++--
 sw/source/filter/ww8/wrtw8sty.cxx   |6 +--
 sw/source/filter/ww8/ww8par.cxx |2 -
 sw/source/filter/xml/XMLRedlineImportHelper.cxx |2 -
 sw/source/filter/xml/xmltble.cxx|6 +--
 sw/source/filter/xml/xmltbli.cxx|4 +-
 sw/source/ui/chrdlg/break.cxx   |2 -
 sw/source/ui/chrdlg/drpcps.cxx  |2 -
 sw/source/ui/dialog/wordcountdialog.cxx |   14 ++--
 sw/source/ui/envelp/envfmt.cxx  |4 +-
 sw/source/ui/index/swuiidxmrk.cxx   |5 +--
 sw/source/ui/misc/docfnote.cxx  |2 -
 sw/source/ui/table/tabledlg.cxx |3 +
 sw/source/uibase/app/docsh.cxx  |9 +++--
 sw/source/uibase/app/docsh2.cxx |   12 ---
 sw/source/uibase/app/docshini.cxx   |1 
 sw/source/uibase/app/docstyle.cxx   |   12 +++
 sw/source/uibase/dbui/dbmgr.cxx |1 
 sw/source/uibase/dialog/watermarkdialog.cxx |   10 +-
 sw/source/uibase/lingu/sdrhhcwrap.cxx   |2 -
 sw/source/uibase/shells/drwbassh.cxx|4 +-
 sw/source/uibase/shells/drwtxtex.cxx|   10 +++---
 sw/source/uibase/uitest/uiobject.cxx|2 -
 sw/source/uibase/uiview/viewdraw.cxx|4 +-
 sw/source/uibase/uiview/viewsrch.cxx|8 +++--
 sw/source/uibase/utlui/uitool.cxx   |4 +-
 sw/source/uibase/wrtsh/select.cxx   |2 -
 62 files changed, 197 insertions(+), 142 deletions(-)

New commits:
commit d884c4be18a82f61fe6db6f22cb1bf1092afd48a
Author: Caolán McNamara 
AuthorDate: Wed May 8 14:10:57 2024 +0100
Commit: Caolán McNamara 
CommitDate: Thu May 9 09:29:34 2024 +0200

WaE: C6011 Dereferencing NULL pointer warnings

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

diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index 00be8d5fac4f..5a0ac3da9d93 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -849,6 +849,7 @@ sal_uInt16 WrongListIteratorCounter::GetElementCount()
 InCurrentNode = 0;
 pNode = rExtent.pNode;
 }
+assert(rExtent.pNode);
 SwWrongList const*const 
pWrongList((rExtent.pNode->*m_pGetWrongList)());
 for (; pWrongList && InCurrentNode < pWrongList->Count(); 
++InCurrentNode)
 {
@@ -893,6 +894,7 @@ WrongListIteratorCounter::GetElementAt(sal_uInt16 nIndex)
 InCurrentNode = 0;
 pNode = rExtent.pNode;
 }
+

core.git: sw/source

2024-05-07 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/utlui/content.cxx |   24 +++-
 1 file changed, 19 insertions(+), 5 deletions(-)

New commits:
commit 9ccdb4c63445ad9ca7bdba869e1bb967b7f622c8
Author: Jim Raykowski 
AuthorDate: Sun May 5 22:13:54 2024 -0800
Commit: Jim Raykowski 
CommitDate: Tue May 7 18:07:26 2024 +0200

tdf#160598 follow up to make delete key work

Adds delete key handling for delete all footnotes/endnotes from the
Navigator.

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

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 3e5a2faa8043..5642ff20a790 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -4769,13 +4769,27 @@ IMPL_LINK(SwContentTree, KeyInputHdl, const KeyEvent&, 
rEvent, bool)
 else if(aCode.GetCode() == KEY_DELETE && 0 == aCode.GetModifier())
 {
 std::unique_ptr xEntry(m_xTreeView->make_iterator());
-if (m_xTreeView->get_selected(xEntry.get()) && lcl_IsContent(*xEntry, 
*m_xTreeView))
+if (!m_pActiveShell->GetView().GetDocShell()->IsReadOnly()
+&& m_xTreeView->get_selected(xEntry.get()))
 {
-
assert(dynamic_cast(weld::fromId(m_xTreeView->get_id(*xEntry;
-if 
(weld::fromId(m_xTreeView->get_id(*xEntry))->GetParent()->IsDeletable()
 &&
-!m_pActiveShell->GetView().GetDocShell()->IsReadOnly())
+if (lcl_IsContent(*xEntry, *m_xTreeView))
+{
+
assert(dynamic_cast(weld::fromId(m_xTreeView->get_id(*xEntry;
+if 
(weld::fromId(m_xTreeView->get_id(*xEntry))->GetParent()->IsDeletable())
+{
+EditEntry(*xEntry, EditEntryMode::DELETE);
+}
+}
+else
 {
-EditEntry(*xEntry, EditEntryMode::DELETE);
+SwContentType* pContentType
+= 
weld::fromId(m_xTreeView->get_id(*xEntry));
+if (pContentType->GetMemberCount()
+&& (pContentType->GetType() == ContentTypeId::FOOTNOTE
+|| pContentType->GetType() == 
ContentTypeId::ENDNOTE))
+{
+ExecuteContextMenuAction("deleteallfootnotes");
+}
 }
 }
 }


core.git: sw/source

2024-05-06 Thread Michael Stahl (via logerrit)
 sw/source/core/doc/doctxm.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 7178d6197b892e456a8db8a3d085a24bfd52cf32
Author: Michael Stahl 
AuthorDate: Fri May 3 17:33:56 2024 +0200
Commit: Michael Stahl 
CommitDate: Mon May 6 13:43:45 2024 +0200

tdf#40142 sw: only check level for table of contents

Only Table of Contents has level settings, the level is always 0 for the
other ToX types, which erroneously excludes nodes (as can be seen with
testFDO77715 failing with upcoming tdf#160402 bugfix).

(regression from commit 5c04c4474236cc50009aea6d89f7c443c861af19)

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

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 613f68773493..9e2c409d9511 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1377,7 +1377,8 @@ void SwTOXBaseSection::UpdateTemplate(const SwTextNode* 
pOwnChapterNode,
 pTextNd->getLayoutFrame(pLayout) &&
 pTextNd->GetNodes().IsDocNodes() &&
 // tdf#40142 - consider level settings of the various text 
nodes
-o3tl::make_unsigned(pTextNd->GetAttrOutlineLevel()) <= 
GetLevel() &&
+(TOX_CONTENT != SwTOXBase::GetType() ||
+ o3tl::make_unsigned(pTextNd->GetAttrOutlineLevel()) <= 
GetLevel()) &&
 (!pLayout || !pLayout->HasMergedParas()
 || 
static_cast(pTextNd->getLayoutFrame(pLayout))->GetTextNodeForParaProps()
 == pTextNd) &&
 (!IsFromChapter() || IsHeadingContained(pOwnChapterNode, 
*pTextNd)))


core.git: sw/source

2024-05-06 Thread Caolán McNamara (via logerrit)
 sw/source/core/bastyp/calc.cxx |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 76d762fea934df31cd81768d467d5d40d439cb67
Author: Caolán McNamara 
AuthorDate: Sun May 5 16:50:03 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 6 12:22:59 2024 +0200

do the casts just once so this is readable

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

diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 1633090972d0..fbfc4b701457 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -119,22 +119,22 @@ const sal_Int32 coContFlags =
 & ~i18n::KParseTokens::IGNORE_LEADING_WS;
 
 extern "C" {
-static int OperatorCompare( const void *pFirst, const void *pSecond)
+static int OperatorCompare(const void *pA, const void *pB)
 {
+const CalcOp *pFirst = static_cast(pA);
+const CalcOp *pSecond = static_cast(pB);
+
 int nRet = 0;
-if( CALC_NAME == static_cast(pFirst)->eOp )
+if( CALC_NAME == pFirst->eOp )
 {
-nRet = static_cast(pFirst)->aName.compareTo(
-static_cast(pSecond)->aName );
+nRet = pFirst->aName.compareTo(pSecond->aName );
 }
 else
 {
-if( CALC_NAME == static_cast(pSecond)->eOp )
-nRet = -1 * static_cast(pSecond)->aName.compareTo(
-static_cast(pFirst)->aName );
+if( CALC_NAME == pSecond->eOp )
+nRet = -1 * pSecond->aName.compareTo(pFirst->aName);
 else
-nRet = static_cast(pFirst)->aName.compareTo(
- static_cast(pSecond)->aName );
+nRet = pFirst->aName.compareTo(pSecond->aName);
 }
 return nRet;
 }


core.git: sw/source

2024-05-05 Thread Caolán McNamara (via logerrit)
 sw/source/core/bastyp/calc.cxx |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 42794558768d4beb0321271457f675976970241f
Author: Caolán McNamara 
AuthorDate: Sun May 5 16:43:45 2024 +0100
Commit: Caolán McNamara 
CommitDate: Sun May 5 21:36:39 2024 +0200

cid#1596834 Identical code for different branches

which has become detectable since:

commit 7d070fa5e4b055501cc59d3ea1b4e049db4bd4ae
Date:   Thu May 2 14:51:24 2024 +0200

replace createFromAscii with OUString literals in SwCalc

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

diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 72b8661e5207..1633090972d0 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -124,12 +124,8 @@ static int OperatorCompare( const void *pFirst, const void 
*pSecond)
 int nRet = 0;
 if( CALC_NAME == static_cast(pFirst)->eOp )
 {
-if( CALC_NAME == static_cast(pSecond)->eOp )
-nRet = static_cast(pFirst)->aName.compareTo(
-static_cast(pSecond)->aName );
-else
-nRet = static_cast(pFirst)->aName.compareTo(
- static_cast(pSecond)->aName );
+nRet = static_cast(pFirst)->aName.compareTo(
+static_cast(pSecond)->aName );
 }
 else
 {


core.git: sw/source

2024-05-04 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/utlui/content.cxx |   91 ++---
 1 file changed, 64 insertions(+), 27 deletions(-)

New commits:
commit 3a394f3f8a15623e2ffb9fbcad81bbb3b9856abe
Author: Jim Raykowski 
AuthorDate: Sat Apr 13 17:36:49 2024 -0800
Commit: Jim Raykowski 
CommitDate: Sat May 4 19:28:53 2024 +0200

tdf#160657 Improve Writer Navigator Headings display

when alphabetically sorted

Make the Headings content display flat (no parent-child hierarchy, no
outline-level indentation) when set to alphabetical sort order.

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

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 06c4d93f78dd..3e5a2faa8043 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2252,38 +2252,61 @@ bool SwContentTree::RequestingChildren(const 
weld::TreeIter& rParent)
 // Add for outline plus/minus
 if (pCntType->GetType() == ContentTypeId::OUTLINE)
 {
-std::vector> aParentCandidates;
-for(size_t i = 0; i < nCount; ++i)
+if (pCntType->IsAlphabeticSort())
 {
-const SwContent* pCnt = pCntType->GetMember(i);
-if(pCnt)
+for (size_t i = 0; i < nCount; ++i)
 {
-const auto nLevel = static_cast(pCnt)->GetOutlineLevel();
-OUString sEntry = pCnt->GetName();
-if(sEntry.isEmpty())
-sEntry = m_sSpace;
-OUString sId(weld::toId(pCnt));
-
-auto lambda = [nLevel, this](const 
std::unique_ptr& entry)
+const SwContent* pCnt = pCntType->GetMember(i);
+if (pCnt)
 {
-return lcl_IsLowerOutlineContent(*entry, *m_xTreeView, 
nLevel);
-};
+OUString sEntry = pCnt->GetName();
+if (sEntry.isEmpty())
+sEntry = m_sSpace;
+OUString sId(weld::toId(pCnt));
 
-// if there is a preceding outline node candidate with a 
lower outline level use
-// that as a parent, otherwise use the root node
-auto aFind = std::find_if(aParentCandidates.rbegin(), 
aParentCandidates.rend(), lambda);
-if (aFind != aParentCandidates.rend())
-insert(aFind->get(), sEntry, sId, false, xChild.get());
-else
 insert(, sEntry, sId, false, xChild.get());
-m_xTreeView->set_sensitive(*xChild, !pCnt->IsInvisible());
-m_xTreeView->set_extra_row_indent(*xChild, nLevel + 1 - 
m_xTreeView->get_iter_depth(*xChild));
+m_xTreeView->set_sensitive(*xChild, 
!pCnt->IsInvisible());
+}
+}
+}
+else
+{
+std::vector> aParentCandidates;
+for (size_t i = 0; i < nCount; ++i)
+{
+const SwContent* pCnt = pCntType->GetMember(i);
+if (pCnt)
+{
+const auto nLevel
+= static_cast(pCnt)->GetOutlineLevel();
+OUString sEntry = pCnt->GetName();
+if (sEntry.isEmpty())
+sEntry = m_sSpace;
+OUString sId(weld::toId(pCnt));
+
+auto lambda = [nLevel, this](const 
std::unique_ptr& entry) {
+return lcl_IsLowerOutlineContent(*entry, 
*m_xTreeView, nLevel);
+};
+
+// if there is a preceding outline node candidate with 
a lower outline level
+// use that as a parent, otherwise use the root node
+auto aFind = std::find_if(aParentCandidates.rbegin(),
+  aParentCandidates.rend(), 
lambda);
+if (aFind != aParentCandidates.rend())
+insert(aFind->get(), sEntry, sId, false, 
xChild.get());
+else
+insert(, sEntry, sId, false, xChild.get());
+m_xTreeView->set_sensitive(*xChild, 
!pCnt->IsInvisible());
+m_xTreeView->set_extra_row_indent(
+*xChild, nLevel + 1 - 
m_xTreeView->get_iter_depth(*xChild));
 
-// remove any parent candidates equal to or higher than 
this node
-std::erase_if(aParentCandidates, std::not_fn(lambda));
+// 

core.git: sw/source sw/uiconfig

2024-05-04 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/utlui/content.cxx   |   52 ++-
 sw/uiconfig/swriter/ui/navigatorpanel.ui |4 ++
 2 files changed, 21 insertions(+), 35 deletions(-)

New commits:
commit 7938500ad3b384f1f30858cea64e12c84610996d
Author: Jim Raykowski 
AuthorDate: Sat Apr 13 12:56:39 2024 -0800
Commit: Jim Raykowski 
CommitDate: Sat May 4 19:28:27 2024 +0200

SwNavigator: improve when outline move controls/menu-items are

active/visible

Makes the outline content context menu not show the up/down/promote/
demote menu items when outline content is set to display by
alphabetical sort.

With intent to improve code readablility, reworks the
SwContentTree::Select function used to set the sensitive state of the
up/down/promote/demote buttons. The buttons are disabled for any of the
following conditions; the Navigator is in "Zoom" mode, the document is
in read-only mode, the selected entry is not an outline content entry,
or the outline content is displayed by alphabetical sort.

The patch also makes the alphabetical sort setting
independent among the floating and sidebar versions.

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

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 994f18cdbee9..06c4d93f78dd 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1753,9 +1753,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 && nContentType != ContentTypeId::POSTIT && nContentType != 
ContentTypeId::UNKNOWN)
 {
 bRemoveSortEntry = false;
-const sal_Int32 nMask = 1 << static_cast(nContentType);
-sal_uInt64 nSortAlphabeticallyBlock = 
m_pConfig->GetSortAlphabeticallyBlock();
-xPop->set_active("sort", nSortAlphabeticallyBlock & nMask);
+xPop->set_active("sort", pType->IsAlphabeticSort());
 }
 
 OUString aIdent;
@@ -1912,7 +1910,8 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 if (!bReadonly)
 {
 bRemoveSelectEntry = false;
-bRemoveChapterEntries = false;
+if (!pType->IsAlphabeticSort())
+bRemoveChapterEntries = false;
 }
 bRemoveCopyEntry = false;
 }
@@ -2893,20 +2892,8 @@ void SwContentTree::Display( bool bActive )
 }
 else if (State::HIDDEN == m_eState)
 m_eState = State::ACTIVE;
-SwWrtShell* pShell = GetWrtShell();
-const bool bReadOnly = !pShell || 
pShell->GetView().GetDocShell()->IsReadOnly();
-if(bReadOnly != m_bIsLastReadOnly)
-{
-m_bIsLastReadOnly = bReadOnly;
-bool bDisable =  pShell == nullptr || bReadOnly;
-SwNavigationPI* pNavi = GetParentWindow();
-pNavi->m_xContent6ToolBox->set_item_sensitive("chapterup", !bDisable);
-pNavi->m_xContent6ToolBox->set_item_sensitive("chapterdown", 
!bDisable);
-pNavi->m_xContent6ToolBox->set_item_sensitive("promote", !bDisable);
-pNavi->m_xContent6ToolBox->set_item_sensitive("demote", !bDisable);
-pNavi->m_xContent5ToolBox->set_item_sensitive("reminder", !bDisable);
-}
 
+SwWrtShell* pShell = GetWrtShell();
 if (pShell)
 {
 std::unique_ptr xEntry = m_xTreeView->make_iterator();
@@ -3030,10 +3017,11 @@ void SwContentTree::Display( bool bActive )
 }
 // set_cursor unselects all entries, makes passed entry visible, 
and selects it
 m_xTreeView->set_cursor(*xSelEntry);
-Select();
 }
 }
 
+Select();
+
 if (!m_bIgnoreDocChange && GetEntryCount() == nOldEntryCount)
 {
 m_xTreeView->vadjustment_set_value(nOldScrollPos);
@@ -5479,33 +5467,27 @@ IMPL_LINK_NOARG(SwContentTree, SelectHdl, 
weld::TreeView&, void)
 }
 
 // Here the buttons for moving outlines are en-/disabled.
+// The buttons for moving outlines are disabled when the Navigator is in 
"Zoom" mode or when
+// the document is in read-only mode or when the outline content is displayed 
alphabetically
+// sorted or when the selected entry is not outline content.
 void SwContentTree::Select()
 {
-std::unique_ptr xEntry(m_xTreeView->make_iterator());
-if (!m_xTreeView->get_selected(xEntry.get()))
-return;
+SwNavigationPI* pNavi = GetParentWindow();
 
 bool bEnable = false;
-std::unique_ptr 
xParentEntry(m_xTreeView->make_iterator(xEntry.get()));
-bool bParentEntry = m_xTreeView->iter_parent(*xParentEntry);
-while (bParentEntry && (!lcl_IsContentType(*xParentEntry, *m_xTreeView)))
-bParentEntry = m_xTreeView->iter_parent(*xParentEntry);
-if (!m_bIsLastReadOnly)
+
+if 

core.git: sw/source

2024-05-01 Thread Tomaž Vajngerl (via logerrit)
 sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx |  210 +++---
 sw/source/uibase/sidebar/A11yCheckIssuesPanel.hxx |   56 ++---
 2 files changed, 97 insertions(+), 169 deletions(-)

New commits:
commit 9b41d33a00763bebd5fc7078705d35a98a52
Author: Tomaž Vajngerl 
AuthorDate: Tue Apr 30 23:28:10 2024 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu May 2 04:12:40 2024 +0200

sw: simplify widgets in A11yCheckIssuesPanel

Change-Id: Iee8db2953c5836f7dee667dadab9441f73706d52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166961
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx 
b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
index a1907c9b6306..7bbbf130678c 100644
--- a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
+++ b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "A11yCheckIssuesPanel.hxx"
 
@@ -80,13 +81,15 @@ AccessibilityCheckEntry::AccessibilityCheckEntry(
 
 IMPL_LINK_NOARG(AccessibilityCheckEntry, GotoButtonClicked, weld::LinkButton&, 
bool)
 {
-m_pAccessibilityIssue->gotoIssue();
+if (m_pAccessibilityIssue)
+m_pAccessibilityIssue->gotoIssue();
 return true;
 }
 
 IMPL_LINK_NOARG(AccessibilityCheckEntry, FixButtonClicked, weld::Button&, void)
 {
-m_pAccessibilityIssue->quickFixIssue();
+if (m_pAccessibilityIssue)
+m_pAccessibilityIssue->quickFixIssue();
 }
 
 std::unique_ptr A11yCheckIssuesPanel::Create(weld::Widget* 
pParent,
@@ -100,32 +103,34 @@ std::unique_ptr 
A11yCheckIssuesPanel::Create(weld::Widget* pParent,
 
 A11yCheckIssuesPanel::A11yCheckIssuesPanel(weld::Widget* pParent, SfxBindings* 
pBindings)
 : PanelLayout(pParent, "A11yCheckIssuesPanel", 
"modules/swriter/ui/a11ycheckissuespanel.ui")
-, m_xExpanderDocument(m_xBuilder->weld_expander("expand_document"))
-, m_xExpanderStyles(m_xBuilder->weld_expander("expand_styles"))
-, m_xExpanderLinked(m_xBuilder->weld_expander("expand_linked"))
-, m_xExpanderNoAlt(m_xBuilder->weld_expander("expand_no_alt"))
-, m_xExpanderTable(m_xBuilder->weld_expander("expand_table"))
-, m_xExpanderFormatting(m_xBuilder->weld_expander("expand_formatting"))
-, m_xExpanderHyperlink(m_xBuilder->weld_expander("expand_hyperlink"))
-, m_xExpanderFakes(m_xBuilder->weld_expander("expand_fakes"))
-, m_xExpanderNumbering(m_xBuilder->weld_expander("expand_numbering"))
-, m_xExpanderOther(m_xBuilder->weld_expander("expand_other"))
-, m_xBoxDocument(m_xBuilder->weld_box("box_document"))
-, m_xBoxStyles(m_xBuilder->weld_box("box_styles"))
-, m_xBoxLinked(m_xBuilder->weld_box("box_linked"))
-, m_xBoxNoAlt(m_xBuilder->weld_box("box_no_alt"))
-, m_xBoxTable(m_xBuilder->weld_box("box_table"))
-, m_xBoxFormatting(m_xBuilder->weld_box("box_formatting"))
-, m_xBoxHyperlink(m_xBuilder->weld_box("box_hyperlink"))
-, m_xBoxFakes(m_xBuilder->weld_box("box_fakes"))
-, m_xBoxNumbering(m_xBuilder->weld_box("box_numbering"))
-, m_xBoxOther(m_xBuilder->weld_box("box_other"))
 , mpBindings(pBindings)
 , mpDoc(nullptr)
 , maA11yCheckController(FN_STAT_ACCESSIBILITY_CHECK, *pBindings, *this)
 , mnIssueCount(0)
 , mbAutomaticCheckEnabled(false)
 {
+m_xExpanders[0] = m_xBuilder->weld_expander("expand_document");
+m_xExpanders[1] = m_xBuilder->weld_expander("expand_styles");
+m_xExpanders[2] = m_xBuilder->weld_expander("expand_linked");
+m_xExpanders[3] = m_xBuilder->weld_expander("expand_no_alt");
+m_xExpanders[4] = m_xBuilder->weld_expander("expand_table");
+m_xExpanders[5] = m_xBuilder->weld_expander("expand_formatting");
+m_xExpanders[6] = m_xBuilder->weld_expander("expand_hyperlink");
+m_xExpanders[7] = m_xBuilder->weld_expander("expand_fakes");
+m_xExpanders[8] = m_xBuilder->weld_expander("expand_numbering");
+m_xExpanders[9] = m_xBuilder->weld_expander("expand_other");
+
+m_xBoxes[0] = m_xBuilder->weld_box("box_document");
+m_xBoxes[1] = m_xBuilder->weld_box("box_styles");
+m_xBoxes[2] = m_xBuilder->weld_box("box_linked");
+m_xBoxes[3] = m_xBuilder->weld_box("box_no_alt");
+m_xBoxes[4] = m_xBuilder->weld_box("box_table");
+m_xBoxes[5] = m_xBuilder->weld_box("box_formatting");
+m_xBoxes[6] = m_xBuilder->weld_box("box_hyperlink");
+m_xBoxes[7] = m_xBuilder->weld_box("box_fakes");
+m_xBoxes[8] = m_xBuilder->weld_box("box_numbering");
+m_xBoxes[9] = m_xBuilder->weld_box("box_other");
+
 SwDocShell* pDocSh = dynamic_cast(SfxObjectShell::Current());
 if (!pDocSh)
 return;
@@ -158,93 +163,49 @@ void A11yCheckIssuesPanel::ImplDestroy()
 batch->commit();
 mpBindings->Invalidate(SID_ACCESSIBILITY_CHECK_ONLINE);
 }
-m_xExpanderDocument.reset();
-m_xExpanderStyles.reset();
-m_xExpanderLinked.reset();
-m_xExpanderNoAlt.reset();
-

core.git: sw/source

2024-05-01 Thread Julien Nabet (via logerrit)
 sw/source/core/doc/doc.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a835b40e05462e9be58cb501aa6b938f3dc998b8
Author: Julien Nabet 
AuthorDate: Wed May 1 15:50:50 2024 +0200
Commit: Julien Nabet 
CommitDate: Wed May 1 18:41:10 2024 +0200

Silence some bogus -Werror=array-bounds etc. also with GCC 13 and -std=c++20

See 1c3c27bc2e42f70e588ef5dbc769a8a346042e04
Silence some bogus -Werror=array-bounds etc. with GCC 12 and -std=c++20

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

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 62add1d5bae5..c6641fd4580a 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -992,13 +992,13 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
 // just one page is special ...
 if ( 1 == aVec.size() )
 {
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 12 && __cplusplus == 
202002L
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ <= 13 && __cplusplus == 
202002L
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Warray-bounds"
 #pragma GCC diagnostic ignored "-Wstringop-overflow"
 #endif
 aVec.insert( aVec.begin() + 1, nullptr ); // insert a second empty page
-#if defined __GNUC__ && !defined __clang__ && __GNUC__ == 12 && __cplusplus == 
202002L
+#if defined __GNUC__ && !defined __clang__ && __GNUC__ <= 13 && __cplusplus == 
202002L
 #pragma GCC diagnostic pop
 #endif
 }


core.git: sw/source

2024-05-01 Thread Mike Kaganski (via logerrit)
 sw/source/core/inc/noteurl.hxx |2 +-
 sw/source/core/layout/paintfrm.cxx |4 ++--
 sw/source/core/text/noteurl.cxx|2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit c85c534befc1a68f405fc2ad508ae9363d7ebb91
Author: Mike Kaganski 
AuthorDate: Wed May 1 10:00:25 2024 +0500
Commit: Mike Kaganski 
CommitDate: Wed May 1 08:35:25 2024 +0200

Make pNoteURL thread-local, just in case

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

diff --git a/sw/source/core/inc/noteurl.hxx b/sw/source/core/inc/noteurl.hxx
index eeae15642a43..b575b60d20a0 100644
--- a/sw/source/core/inc/noteurl.hxx
+++ b/sw/source/core/inc/noteurl.hxx
@@ -59,7 +59,7 @@ public:
 };
 
 // globale Variable, in NoteURL.Cxx angelegt
-extern SwNoteURL* pNoteURL;
+extern thread_local SwNoteURL* pNoteURL;
 
 #endif
 
diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 1e8600d83094..1d27f9406c0c 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -8054,7 +8054,7 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap, 
const sal_uInt32 /*nMaxim
 SfxItemState::SET != GetAttrSet().GetItemState( RES_URL );
 if( bNoteURL )
 {
-OSL_ENSURE( !pNoteURL, "MakeGraphic: pNoteURL already used? " );
+assert(!pNoteURL);
 pNoteURL = new SwNoteURL;
 }
 SwFlyFrame *pFly = static_cast(pFirst);
@@ -8135,7 +8135,7 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap, 
const sal_uInt32 /*nMaxim
 
 if( bNoteURL )
 {
-OSL_ENSURE( pNoteURL, "MakeGraphic: Good Bye, NoteURL." );
+assert(pNoteURL);
 pNoteURL->FillImageMap(pMap, pFly->getFrameArea().Pos(), aMap);
 delete pNoteURL;
 pNoteURL = nullptr;
diff --git a/sw/source/core/text/noteurl.cxx b/sw/source/core/text/noteurl.cxx
index ae52e1c29a91..d66736280bb5 100644
--- a/sw/source/core/text/noteurl.cxx
+++ b/sw/source/core/text/noteurl.cxx
@@ -25,7 +25,7 @@
 #include 
 
 // Global variable
-SwNoteURL* pNoteURL = nullptr;
+thread_local SwNoteURL* pNoteURL = nullptr;
 
 void SwNoteURL::InsertURLNote(const OUString& rURL, const OUString& rTarget, 
const SwRect& rRect)
 {


core.git: sw/source

2024-04-30 Thread Justin Luth (via logerrit)
 sw/source/writerfilter/dmapper/GraphicImport.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit bc7501d30ab9a3a5edec66d2f0022177f85d6127
Author: Justin Luth 
AuthorDate: Sat Apr 20 19:45:39 2024 -0400
Commit: Justin Luth 
CommitDate: Wed May 1 00:44:37 2024 +0200

NFC GraphicImport.cxx: address nit x2

less emphasis on minimizing "if logic"
and more emphasis on readability
(especially since the comment comes after the logic).

In the most common cases, this version
should actually finish sooner too.

I didn't remember doing a copy/paste,
so the first time I only fixed the one instance...

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

diff --git a/sw/source/writerfilter/dmapper/GraphicImport.cxx 
b/sw/source/writerfilter/dmapper/GraphicImport.cxx
index 0320c671c47f..3a60e63dbefb 100644
--- a/sw/source/writerfilter/dmapper/GraphicImport.cxx
+++ b/sw/source/writerfilter/dmapper/GraphicImport.cxx
@@ -1304,9 +1304,10 @@ void GraphicImport::lcl_attribute(Id nName, Value& 
rValue)
 }
 
 if (m_pImpl->m_nHoriRelation == 
text::RelOrientation::FRAME
-&& m_pImpl->m_nHoriOrient > 
text::HoriOrientation::NONE
-&& m_pImpl->m_nHoriOrient != 
text::HoriOrientation::CENTER
-&& m_pImpl->m_nHoriOrient < 
text::HoriOrientation::FULL)
+&& (m_pImpl->m_nHoriOrient == 
text::HoriOrientation::LEFT
+|| m_pImpl->m_nHoriOrient == 
text::HoriOrientation::RIGHT
+|| m_pImpl->m_nHoriOrient == 
text::HoriOrientation::INSIDE
+|| m_pImpl->m_nHoriOrient == 
text::HoriOrientation::OUTSIDE))
 {
 // before compat15, relative 
left/right/inside/outside honored margins.
 if 
(m_pImpl->m_rDomainMapper.GetSettingsTable()->GetWordCompatibilityMode() < 15)


core.git: sw/source

2024-04-30 Thread László Németh (via logerrit)
 sw/source/uibase/docvw/edtwin.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 38b6e89c9483fdfe3d26bef3b25f890528aef84e
Author: László Németh 
AuthorDate: Mon Apr 29 21:39:41 2024 +0200
Commit: László Németh 
CommitDate: Tue Apr 30 23:02:01 2024 +0200

tdf#160836 sw: fix narrow selection area of cell border

Remove ShouldObjectBeSelected() condition to fix the
selection area around the horizontal border. (Its purpose
was to avoid of selection of the border, when covered by
an image: but that would be !ShouldObjectBeSelected(), with
the same problem: halved selection area.)

Clean-up commit commit 30de13743f144aced83bc43d310592f82788c910
"tdf#160836 sw: resize rows at images cropped by row height".

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

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index c0d4a0837f17..b50c67811774 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -3159,8 +3159,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
  SwTab::COL_NONE != (nMouseTabCol = rSh.WhichMouseTabCol( aDocPos ) ) 
&&
  ( !rSh.IsObjSelectable( aDocPos ) ||
  // allow resizing row height, if the image is anchored as 
character in the cell
- ( rSh.ShouldObjectBeSelected(aDocPos) &&
- !( SwTab::COL_VERT == nMouseTabCol || SwTab::COL_HORI == 
nMouseTabCol ) ) ) )
+ !( SwTab::COL_VERT == nMouseTabCol || SwTab::COL_HORI == 
nMouseTabCol ) ) )
 {
 // Enhanced table selection
 if ( SwTab::SEL_HORI <= nMouseTabCol && SwTab::COLSEL_VERT >= 
nMouseTabCol )
@@ -4033,8 +4032,7 @@ bool SwEditWin::changeMousePointer(Point const & 
rDocPoint)
 if ( SwTab::COL_NONE != (nMouseTabCol = rShell.WhichMouseTabCol( rDocPoint 
) ) &&
  ( !rShell.IsObjSelectable( rDocPoint ) ||
  // allow resizing row height, if the image is anchored as 
character in the cell
- ( rShell.ShouldObjectBeSelected(rDocPoint) &&
- !( SwTab::COL_VERT == nMouseTabCol || SwTab::COL_HORI == 
nMouseTabCol ) ) ) )
+ !( SwTab::COL_VERT == nMouseTabCol || SwTab::COL_HORI == 
nMouseTabCol ) ) )
 {
 PointerStyle nPointer = PointerStyle::Null;
 bool bChkTableSel = false;


core.git: sw/source

2024-04-30 Thread Noel Grandin (via logerrit)
 sw/source/writerfilter/rtftok/rtfdispatchdestination.cxx |2 -
 sw/source/writerfilter/rtftok/rtfdispatchflag.cxx|   15 --
 sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx|   22 +--
 sw/source/writerfilter/rtftok/rtfdocumentimpl.hxx|6 
 sw/source/writerfilter/rtftok/rtfsdrimport.cxx   |6 ++--
 5 files changed, 20 insertions(+), 31 deletions(-)

New commits:
commit bd343716f505bb955ddfb9fa20002468df3fb19c
Author: Noel Grandin 
AuthorDate: Thu Apr 25 10:55:07 2024 +0200
Commit: Noel Grandin 
CommitDate: Tue Apr 30 19:34:23 2024 +0200

use more concrete UNO classes in writerfilter rtf

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

diff --git a/sw/source/writerfilter/rtftok/rtfdispatchdestination.cxx 
b/sw/source/writerfilter/rtftok/rtfdispatchdestination.cxx
index 4ff4fade6867..30b2acb58f80 100644
--- a/sw/source/writerfilter/rtftok/rtfdispatchdestination.cxx
+++ b/sw/source/writerfilter/rtftok/rtfdispatchdestination.cxx
@@ -613,7 +613,7 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 if (!aLookahead.hasTable())
 {
 uno::Reference xGroupShape(
-
m_xModelFactory->createInstance("com.sun.star.drawing.GroupShape"),
+
getTextDocument()->createInstance("com.sun.star.drawing.GroupShape"),
 uno::UNO_QUERY);
 if (m_xDstDoc)
 {
diff --git a/sw/source/writerfilter/rtftok/rtfdispatchflag.cxx 
b/sw/source/writerfilter/rtftok/rtfdispatchflag.cxx
index 434936da2e53..af97b36812f9 100644
--- a/sw/source/writerfilter/rtftok/rtfdispatchflag.cxx
+++ b/sw/source/writerfilter/rtftok/rtfdispatchflag.cxx
@@ -28,6 +28,7 @@
 #include "rtfsdrimport.hxx"
 #include "rtfskipdestination.hxx"
 #include 
+#include 
 
 using namespace com::sun::star;
 
@@ -1039,7 +1040,7 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword 
nKeyword)
 case RTFKeyword::DPLINE:
 {
 uno::Reference xShape(
-
getModelFactory()->createInstance("com.sun.star.drawing.LineShape"),
+
getTextDocument()->createInstance("com.sun.star.drawing.LineShape"),
 uno::UNO_QUERY);
 m_aStates.top().getDrawingObject().setShape(xShape);
 break;
@@ -1048,7 +1049,7 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword 
nKeyword)
 {
 // The reason this is not a simple CustomShape is that in 
the old syntax we have no ViewBox info.
 uno::Reference xShape(
-
getModelFactory()->createInstance("com.sun.star.drawing.PolyLineShape"),
+
getTextDocument()->createInstance("com.sun.star.drawing.PolyLineShape"),
 uno::UNO_QUERY);
 m_aStates.top().getDrawingObject().setShape(xShape);
 break;
@@ -1056,7 +1057,7 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword 
nKeyword)
 case RTFKeyword::DPPOLYGON:
 {
 uno::Reference xShape(
-
getModelFactory()->createInstance("com.sun.star.drawing.PolyPolygonShape"),
+
getTextDocument()->createInstance("com.sun.star.drawing.PolyPolygonShape"),
 uno::UNO_QUERY);
 m_aStates.top().getDrawingObject().setShape(xShape);
 break;
@@ -1064,7 +1065,7 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword 
nKeyword)
 case RTFKeyword::DPRECT:
 {
 uno::Reference xShape(
-
getModelFactory()->createInstance("com.sun.star.drawing.RectangleShape"),
+
getTextDocument()->createInstance("com.sun.star.drawing.RectangleShape"),
 uno::UNO_QUERY);
 m_aStates.top().getDrawingObject().setShape(xShape);
 break;
@@ -1074,9 +1075,7 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword 
nKeyword)
 break;
 case RTFKeyword::DPTXBX:
 {
-uno::Reference xShape(
-
getModelFactory()->createInstance("com.sun.star.text.TextFrame"),
-uno::UNO_QUERY);
+rtl::Reference 
xShape(getTextDocument()->createTextFrame());
 m_aStates.top().getDrawingObject().setShape(xShape);
 std::vector aDefaults
 = RTFSdrImport::getTextFrameDefaults(false);
@@ -1099,7 +1098,7 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword 
nKeyword)
 if (nType)
 {
   

core.git: sw/source

2024-04-29 Thread Caolán McNamara (via logerrit)
 sw/source/core/access/acctable.cxx |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 2bad2224090eb2802111760ec83db230aeca0616
Author: Caolán McNamara 
AuthorDate: Mon Apr 29 11:59:09 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 29 21:23:07 2024 +0200

futile to null check here if we deref afterwards anyway

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

diff --git a/sw/source/core/access/acctable.cxx 
b/sw/source/core/access/acctable.cxx
index 3c8beaf9a0a4..d58a8b74b1ae 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -611,9 +611,7 @@ SwAccessibleTable::SwAccessibleTable(
 SwAccessibleContext( pInitMap, AccessibleRole::TABLE, pTabFrame )
 {
 const SwFrameFormat* pFrameFormat = pTabFrame->GetFormat();
-if(pFrameFormat)
-
StartListening(const_cast(pFrameFormat)->GetNotifier());
-
+StartListening(const_cast(pFrameFormat)->GetNotifier());
 SetName( pFrameFormat->GetName() + "-" + OUString::number( 
pTabFrame->GetPhyPageNum() ) );
 
 const OUString sArg1( static_cast< const SwTabFrame * >( GetFrame() 
)->GetFormat()->GetName() );
@@ -1620,8 +1618,7 @@ SwAccessibleTableColHeaders::SwAccessibleTableColHeaders(
 SolarMutexGuard aGuard;
 
 const SwFrameFormat* pFrameFormat = pTabFrame->GetFormat();
-if(pFrameFormat)
-
StartListening(const_cast(pFrameFormat)->GetNotifier());
+StartListening(const_cast(pFrameFormat)->GetNotifier());
 const OUString aName = pFrameFormat->GetName() + "-ColumnHeaders";
 
 SetName( aName + "-" + OUString::number( pTabFrame->GetPhyPageNum() ) );


core.git: sw/source

2024-04-29 Thread Xisco Fauli (via logerrit)
 sw/source/core/draw/dview.cxx |   31 +--
 1 file changed, 17 insertions(+), 14 deletions(-)

New commits:
commit 0627386e924279e1de75210cf6b144303fccbe7f
Author: Xisco Fauli 
AuthorDate: Mon Apr 29 09:54:12 2024 +0200
Commit: Xisco Fauli 
CommitDate: Mon Apr 29 15:42:25 2024 +0200

Fix UBSan failure

Introduced by 495b5db74f0db59395ff68bacc8d8ca67595b66e
"sw: check GetUserCall"


https://ci.libreoffice.org/job/lo_ubsan/3154/consoleFull#-1571115798d893063f-7f3d-4b7e-b56f-4e0f225817cd
Change-Id: Ifc80312890f2e6b82dcc9419b5b7e8bfcd5340a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166824
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index d95dc0d17af9..de84660ca94a 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -708,13 +708,10 @@ const SwFrame* SwDrawView::CalcAnchor()
 return nullptr;
 
 SdrObject* pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
-SwDrawContact* pContact = static_cast(GetUserCall(pObj));
-if (!pContact)
-return nullptr;
 
 //Search for paragraph bound objects, otherwise only the
 //current anchor. Search only if we currently drag.
-const SwFrame* pAnch;
+const SwFrame* pAnch = nullptr;
 tools::Rectangle aMyRect;
 auto pFlyDrawObj = dynamic_cast( pObj );
 if ( pFlyDrawObj )
@@ -726,13 +723,16 @@ const SwFrame* SwDrawView::CalcAnchor()
 {
 // determine correct anchor position for 'virtual' drawing objects.
 // #i26791#
-pAnch = pContact->GetAnchorFrame( pObj );
-if( !pAnch )
+if (SwDrawContact* pContact = 
static_cast(GetUserCall(pObj)))
 {
-pContact->ConnectToLayout();
-// determine correct anchor position for 'virtual' drawing objects.
-// #i26791#
 pAnch = pContact->GetAnchorFrame( pObj );
+if( !pAnch )
+{
+pContact->ConnectToLayout();
+// determine correct anchor position for 'virtual' drawing 
objects.
+// #i26791#
+pAnch = pContact->GetAnchorFrame( pObj );
+}
 }
 aMyRect = pObj->GetSnapRect();
 }
@@ -767,11 +767,14 @@ const SwFrame* SwDrawView::CalcAnchor()
 {
 const SwRect aRect( aPt.getX(), aPt.getY(), 1, 1 );
 
-if ( pContact->GetAnchorFrame( pObj ) &&
- pContact->GetAnchorFrame( pObj )->IsPageFrame() )
-pAnch = pContact->GetPageFrame();
-else
-pAnch = pContact->FindPage( aRect );
+if (SwDrawContact* pContact = 
static_cast(GetUserCall(pObj)))
+{
+if ( pContact->GetAnchorFrame( pObj ) &&
+ pContact->GetAnchorFrame( pObj )->IsPageFrame() )
+pAnch = pContact->GetPageFrame();
+else
+pAnch = pContact->FindPage( aRect );
+}
 }
 }
 if( pAnch && !pAnch->IsProtected() )


core.git: sw/source

2024-04-29 Thread Stephan Bergmann (via logerrit)
 sw/source/core/inc/unobookmark.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a6d41c61daaf6f0822fc86d790eca19972e4a7c8
Author: Stephan Bergmann 
AuthorDate: Mon Apr 29 08:19:50 2024 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Apr 29 13:15:18 2024 +0200

UBSan needs SwXBookmark RTTI now

...presumably since 6a11bf9f7bd209a082254c861d5a04c7f5729d68 "use more 
concrete
UNO classes in writerfilter (SwXBookmark)", failing sw_writerfilter_misc 
with

> DynamicLibraryManagerException: "Failed to load dynamic library: 
workdir/LinkTarget/CppunitTest/libtest_sw_writerfilter_misc.so
> instdir/program/libsw_writerfilterlo.so: undefined symbol: 
_ZTI11SwXBookmark"

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

diff --git a/sw/source/core/inc/unobookmark.hxx 
b/sw/source/core/inc/unobookmark.hxx
index d1d800d9a28e..7082e3c09587 100644
--- a/sw/source/core/inc/unobookmark.hxx
+++ b/sw/source/core/inc/unobookmark.hxx
@@ -46,7 +46,7 @@ typedef ::cppu::ImplInheritanceHelper
 > SwXBookmark_Base;
 
 /// UNO API wrapper around an internal sw::mark::IMark.
-class SwXBookmark
+class SAL_DLLPUBLIC_RTTI SwXBookmark
 : public SwXBookmark_Base
 {
 


core.git: sw/source

2024-04-29 Thread Vasily Melenchuk (via logerrit)
 sw/source/uibase/utlui/navipi.cxx |   21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

New commits:
commit 084882a66c4e612f207024be301631102be31ca6
Author: Vasily Melenchuk 
AuthorDate: Thu Apr 25 10:12:41 2024 +0200
Commit: Vasily Melenchuk 
CommitDate: Mon Apr 29 12:06:00 2024 +0200

sw: fixed crash on GetCreateView() returning nullptr

Change-Id: Id0cb44ac7d805a1736fa8170aaffb97b54211707
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166617
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk 

diff --git a/sw/source/uibase/utlui/navipi.cxx 
b/sw/source/uibase/utlui/navipi.cxx
index bb8338e3fe9e..e86e51c30d11 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -73,6 +73,8 @@ OUString SwNavigationPI::CleanEntry(const OUString& rEntry)
 void SwNavigationPI::MoveOutline(SwOutlineNodes::size_type nSource, 
SwOutlineNodes::size_type nTarget)
 {
 SwView *pView = GetCreateView();
+if (!pView)
+return;
 SwWrtShell  = pView->GetWrtShell();
 if(nTarget < nSource || nTarget == SwOutlineNodes::npos)
 nTarget ++;
@@ -575,7 +577,7 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent,
 
 //Open Headings by default
 SwView *pView = GetCreateView();
-if (pView->m_nNaviExpandedStatus < 0)
+if (pView && pView->m_nNaviExpandedStatus < 0)
 {
 pView->m_nNaviExpandedStatus = 1;
 m_xContentTree->ExpandAllHeadings();
@@ -684,13 +686,16 @@ void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, 
SfxItemState /*eState*/,
 if (SwView::GetMoveType() == NID_PGE)
 {
 SwView *pView = GetCreateView();
-SwWrtShell  = pView->GetWrtShell();
-// GetPageNum - return current page number:
-// true: in which cursor is located.
-// false: which is visible at the upper margin.
-sal_uInt16 nPhyNum, nVirtNum;
-rSh.GetPageNum(nPhyNum, nVirtNum, false);
-m_xGotoPageSpinButton->set_text(OUString::number(nPhyNum));
+if (pView)
+{
+SwWrtShell& rSh = pView->GetWrtShell();
+// GetPageNum - return current page number:
+// true: in which cursor is located.
+// false: which is visible at the upper margin.
+sal_uInt16 nPhyNum, nVirtNum;
+rSh.GetPageNum(nPhyNum, nVirtNum, false);
+m_xGotoPageSpinButton->set_text(OUString::number(nPhyNum));
+}
 }
 }
 }


core.git: sw/source

2024-04-28 Thread Stephan Bergmann (via logerrit)
 sw/source/writerfilter/filter/WriterFilter.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 817d35eb829db00329ea5437d50e5c682139f505
Author: Stephan Bergmann 
AuthorDate: Sun Apr 28 09:44:14 2024 +0200
Commit: Stephan Bergmann 
CommitDate: Sun Apr 28 11:29:29 2024 +0200

-Werror,-Wunused-variable

...after 87e0feafd3690a9b58890cc28f8ba0c521bfb557 "use more concrete UNO 
classes
in writerfilter (SwXDocumentSettings)"

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

diff --git a/sw/source/writerfilter/filter/WriterFilter.cxx 
b/sw/source/writerfilter/filter/WriterFilter.cxx
index 7aee1060ac39..413eb00c139c 100644
--- a/sw/source/writerfilter/filter/WriterFilter.cxx
+++ b/sw/source/writerfilter/filter/WriterFilter.cxx
@@ -301,7 +301,6 @@ void WriterFilter::setTargetDocument(const 
uno::Reference& xDo
 assert(m_xDstDoc);
 
 // Set some compatibility options that are valid for the DOCX format
-uno::Reference xFactory(xDoc, uno::UNO_QUERY);
 rtl::Reference xSettings = 
m_xDstDoc->createDocumentSettings();
 
 xSettings->setPropertyValue("UseOldNumbering", uno::Any(false));


core.git: sw/source

2024-04-26 Thread Noel Grandin (via logerrit)
 sw/source/writerfilter/dmapper/DomainMapper.cxx  |6 -
 sw/source/writerfilter/dmapper/DomainMapper.hxx  |2 
 sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx |   89 +--
 sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx |5 -
 sw/source/writerfilter/dmapper/PropertyMap.cxx   |5 -
 sw/source/writerfilter/dmapper/SdtHelper.cxx |   10 +-
 sw/source/writerfilter/dmapper/StyleSheetTable.cxx   |2 
 7 files changed, 56 insertions(+), 63 deletions(-)

New commits:
commit 556af85ae78d1d11f8b3c59953342b770e25620c
Author: Noel Grandin 
AuthorDate: Wed Apr 24 11:43:44 2024 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 26 13:19:35 2024 +0200

use more concrete UNO in writerfilter

elimate the TextFactory stuff, since it is the same object as the
TextDocument

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

diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper.cxx
index 16106cf0e5d5..5a9f84aa3b0d 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx
@@ -172,7 +172,7 @@ DomainMapper::DomainMapper( const uno::Reference< 
uno::XComponentContext >& xCon
 // the intended font to provide best layout match.
 try
 {
-uno::Reference< beans::XPropertySet > 
xDefProps(GetTextFactory()->createInstance("com.sun.star.text.Defaults"),
+uno::Reference< beans::XPropertySet > 
xDefProps(GetTextDocument()->createInstance("com.sun.star.text.Defaults"),
 uno::UNO_QUERY_THROW);
 xDefProps->setPropertyValue(getPropertyName(PROP_CHAR_FONT_NAME), 
css::uno::Any(OUString("Calibri")));
 xDefProps->setPropertyValue(getPropertyName(PROP_CHAR_HEIGHT), 
css::uno::Any(double(11)));
@@ -4859,9 +4859,9 @@ bool DomainMapper::IsRTFImport() const
 return m_pImpl->IsRTFImport();
 }
 
-uno::Reference < lang::XMultiServiceFactory > const & 
DomainMapper::GetTextFactory() const
+rtl::Reference const & DomainMapper::GetTextDocument() const
 {
-return m_pImpl->GetTextFactory();
+return m_pImpl->GetTextDocument();
 }
 
 uno::Reference< text::XTextRange > DomainMapper::GetCurrentTextRange()
diff --git a/sw/source/writerfilter/dmapper/DomainMapper.hxx 
b/sw/source/writerfilter/dmapper/DomainMapper.hxx
index de43478bae7f..ecd5c4459273 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper.hxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper.hxx
@@ -103,7 +103,7 @@ public:
 
 bool IsOOXMLImport() const;
 bool IsRTFImport() const;
-css::uno::Reference const & 
GetTextFactory() const;
+rtl::Reference const & GetTextDocument() const;
 css::uno::Reference GetCurrentTextRange();
 
 OUString getOrCreateCharStyle( PropertyValueVector_t& rCharProperties, 
bool bAlwaysCreate );
diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
index 2a4f3052df81..aab27ef1a4bc 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx
@@ -333,7 +333,6 @@ DomainMapper_Impl::DomainMapper_Impl(
 m_rDMapper( rDMapper ),
 m_pOOXMLDocument(nullptr),
 m_xTextDocument( xModel ),
-m_xTextFactory( xModel ),
 m_xComponentContext(std::move( xContext )),
 
m_bForceGenericFields(officecfg::Office::Common::Filter::Microsoft::Import::ForceImportWWFieldsAsGenericFields::get()),
 m_bIsDecimalComma( false ),
@@ -526,9 +525,9 @@ uno::Reference< text::XText > const & 
DomainMapper_Impl::GetBodyText()
 
 uno::Reference< beans::XPropertySet > const & 
DomainMapper_Impl::GetDocumentSettings()
 {
-if( !m_xDocumentSettings.is() && m_xTextFactory.is())
+if( !m_xDocumentSettings.is() && m_xTextDocument.is())
 {
-m_xDocumentSettings.set( 
m_xTextFactory->createInstance("com.sun.star.document.Settings"), 
uno::UNO_QUERY );
+m_xDocumentSettings.set( 
m_xTextDocument->createInstance("com.sun.star.document.Settings"), 
uno::UNO_QUERY );
 }
 return m_xDocumentSettings;
 }
@@ -875,7 +874,7 @@ void DomainMapper_Impl::RemoveLastParagraph( )
 {
 // Yes, it was removed. Restore
 uno::Reference xBookmark(
-
m_xTextFactory->createInstance("com.sun.star.text.Bookmark"),
+
m_xTextDocument->createInstance("com.sun.star.text.Bookmark"),
 uno::UNO_QUERY_THROW);
 
 uno::Reference xBkmNamed(xBookmark,
@@ -1083,7 +1082,7 @@ void DomainMapper_Impl::PopSdt()
 }
 
 uno::Reference xContentControl(
-m_xTextFactory->createInstance("com.sun.star.text.ContentControl"), 
uno::UNO_QUERY);
+

core.git: sw/source

2024-04-26 Thread Michael Stahl (via logerrit)
 sw/source/filter/html/htmlctxt.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ac05822b8957d80018d3ce1cbf97cd9faa0dfe99
Author: Michael Stahl 
AuthorDate: Thu Apr 25 18:20:20 2024 +0200
Commit: Michael Stahl 
CommitDate: Fri Apr 26 12:59:19 2024 +0200

tdf#154581 tdf#157411 tdf#158549 sw: HTML import: fix SfxItemIter reuse

This is obviously wrong, as ALG just pointed out: the aIter is at the
end after the 1st loop, so the 2nd loop does nothing.
Thx Gabor for checking all the reported bugs.

(regression from commit db115bec9254417ef7a3faf687478fe5424ab378)

Change-Id: Iae37b9ab5c630d0ee774f42c84d5e76349b92a90
Tested-by: Gabor Kelemen 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166643
Reviewed-by: Michael Stahl 
Tested-by: Jenkins

diff --git a/sw/source/filter/html/htmlctxt.cxx 
b/sw/source/filter/html/htmlctxt.cxx
index 80245ba2ea6a..0e87b83644f8 100644
--- a/sw/source/filter/html/htmlctxt.cxx
+++ b/sw/source/filter/html/htmlctxt.cxx
@@ -656,7 +656,8 @@ void SwHTMLParser::InsertAttrs( SfxItemSet ,
 }
 #endif
 
-for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = 
aIter.NextItem())
+SfxItemIter aIter2(rItemSet);
+for (const SfxPoolItem* pItem = aIter2.GetCurItem(); pItem; pItem = 
aIter2.NextItem())
 {
 HTMLAttr **ppAttr = nullptr;
 


core.git: sw/source

2024-04-26 Thread Xisco Fauli (via logerrit)
 sw/source/core/access/accfrmobj.cxx  |   15 ++-
 sw/source/core/doc/docdraw.cxx   |   12 +++
 sw/source/core/draw/dview.cxx|  108 ---
 sw/source/core/frmedt/fecopy.cxx |   25 +++---
 sw/source/core/frmedt/fefly1.cxx |   13 ++-
 sw/source/core/frmedt/feshview.cxx   |   37 ++---
 sw/source/core/layout/anchoreddrawobject.cxx |4 +
 sw/source/core/layout/anchoredobject.cxx |   11 +-
 sw/source/core/layout/fly.cxx|4 -
 sw/source/core/layout/flylay.cxx |   41 +-
 sw/source/core/layout/frmtool.cxx|   40 ++
 sw/source/core/layout/pagechg.cxx|   19 ++--
 sw/source/core/layout/trvlfrm.cxx|   39 +
 sw/source/core/txtnode/atrflyin.cxx  |3 
 sw/source/core/undo/undraw.cxx   |   31 ---
 15 files changed, 242 insertions(+), 160 deletions(-)

New commits:
commit 495b5db74f0db59395ff68bacc8d8ca67595b66e
Author: Xisco Fauli 
AuthorDate: Thu Apr 25 18:15:12 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Apr 26 09:25:23 2024 +0200

sw: check GetUserCall

It might return nullptr
See 
https://crashreport.libreoffice.org/stats/signature/SwFEShell::ShouldObjectBeSelected(Point%20const%20&)

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

diff --git a/sw/source/core/access/accfrmobj.cxx 
b/sw/source/core/access/accfrmobj.cxx
index f78dc2d155db..004ca4ab94e0 100644
--- a/sw/source/core/access/accfrmobj.cxx
+++ b/sw/source/core/access/accfrmobj.cxx
@@ -240,13 +240,16 @@ SwRect SwAccessibleChild::GetBox( const SwAccessibleMap& 
rAccMap ) const
 // by the mpFrame case above b) for genuine SdrObject this must be set
 // if it's connected to layout
 assert(dynamic_cast(pContact));
-SwPageFrame const*const pPage(const_cast(
-pContact->GetAnchoredObj(mpDrawObj))->FindPageFrameOfAnchor());
-if (pPage) // may end up here with partial layout -> not visible
+if (pContact)
 {
-aBox = SwRect( mpDrawObj->GetCurrentBoundRect() );
-// tdf#91260 drawing object may be partially off-page
-aBox.Intersection(pPage->getFrameArea());
+SwPageFrame const*const pPage(const_cast(
+pContact->GetAnchoredObj(mpDrawObj))->FindPageFrameOfAnchor());
+if (pPage) // may end up here with partial layout -> not visible
+{
+aBox = SwRect( mpDrawObj->GetCurrentBoundRect() );
+// tdf#91260 drawing object may be partially off-page
+aBox.Intersection(pPage->getFrameArea());
+}
 }
 }
 else if ( mpWindow )
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index f5a37d00ab21..1a3bed4e4c0c 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -67,6 +67,9 @@ static void lcl_AdjustPositioningAttr( SwDrawFrameFormat* 
_pFrameFormat,
 const SwContact* pContact = GetUserCall( &_rSdrObj );
 OSL_ENSURE( pContact, " - missing contact 
object." );
 
+if (!pContact)
+return;
+
 // determine position of new group object relative to its anchor frame 
position
 SwTwips nHoriRelPos = 0;
 SwTwips nVertRelPos = 0;
@@ -194,6 +197,9 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
 
 // Revoke anchor attribute.
 SwDrawContact *pMyContact = 
static_cast(GetUserCall(pObj));
+if (!pMyContact)
+return pNewContact;
+
 const SwFormatAnchor aAnch( pMyContact->GetFormat()->GetAnchor() );
 
 std::unique_ptr pUndo;
@@ -215,6 +221,9 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
 pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
 SwDrawContact *pContact = 
static_cast(GetUserCall(pObj));
 
+if (!pContact)
+continue;
+
 // #i53320#
 #if OSL_DEBUG_LEVEL > 0
 SwAnchoredDrawObject* pAnchoredDrawObj =
@@ -351,6 +360,9 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
 {
 SwDrawContact *pContact = 
static_cast(GetUserCall(pObj));
 
+if (!pContact)
+continue;
+
 std::shared_ptr pTextBoxNode;
 if (auto pGroupFormat = pContact->GetFormat())
 pTextBoxNode = pGroupFormat->GetOtherTextBoxFormats();
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index 21e557b886e4..d95dc0d17af9 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -212,10 +212,14 @@ void SwDrawView::AddCustomHdl()
 {
 const SdrMarkList  = GetMarkedObjectList();
 
-if(rMrkList.GetMarkCount() != 1 || 

core.git: sw/source

2024-04-25 Thread Andrea Gelmini (via logerrit)
 sw/source/uibase/utlui/content.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a9ad50c2de829a21ba79baa061597487e30877dc
Author: Andrea Gelmini 
AuthorDate: Thu Apr 25 19:48:33 2024 +0200
Commit: Julien Nabet 
CommitDate: Thu Apr 25 21:48:00 2024 +0200

Fix typo

Change-Id: I8ab3728b0b5cf414582849e9efe36a3c9df43f45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166646
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index f9776b3b2135..994f18cdbee9 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2049,7 +2049,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 if (bRemoveDeleteEndnoteEntry)
 xPop->remove("deleteendnote");
 
-// bRemoveDeleteEntry is used in determining seperator 2
+// bRemoveDeleteEntry is used in determining separator 2
 bool bRemoveDeleteEntry =
 bRemoveDeleteChapterEntry &&
 bRemoveDeleteTableEntry &&


core.git: sw/source sw/uiconfig

2024-04-24 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/utlui/content.cxx |  109 +++--
 sw/uiconfig/swriter/ui/navigatorcontextmenu.ui |   35 
 2 files changed, 136 insertions(+), 8 deletions(-)

New commits:
commit b2b84dfa1d4f5da32f3335c59d618d385173a170
Author: Jim Raykowski 
AuthorDate: Sun Apr 21 19:23:34 2024 -0800
Commit: Jim Raykowski 
CommitDate: Thu Apr 25 05:38:42 2024 +0200

tdf#160598 SwNavigator enhancement to delete footnotes/endnotes

m_bDocHasChanged is checked first in the tooltip and mouse move handlers
to prevent crashes/asserts that happen when SfxPoolItemHolder m_aAttr
references a delete poolitem or poolitem data. Without this check the
following types of crashes/asserts can happen:



Unspecified Application Error

Fatal exception: Signal 6
Stack:
0 sal::backtrace_get(unsigned int) at /home/lo/Dev/LO1/core/sal/osl/
unx/backtraceapi.cxx:42 (discriminator 3)
1 (anonymous namespace)::printStack(int) at /home/lo/Dev/LO1/core/sal/
osl/unx/signal.cxx:289
2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at /
home/lo/Dev/LO1/core/sal/osl/unx/signal.cxx:330
3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*)
at /home/lo/Dev/LO1/core/sal/osl/unx/signal.cxx:427
4 __restore_rt at libc_sigaction.c:?
5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44
6 __GI_raise at ./signal/../sysdeps/posix/raise.c:27
7 __GI_abort at ./stdlib/abort.c:81 (discriminator 21)
8 SalAbort(rtl::OUString const&, bool) at /home/lo/Dev/LO1/core/vcl/
source/app/salplug.cxx:412
9 Application::Abort(rtl::OUString const&) at /home/lo/Dev/LO1/core/
vcl/source/app/svapp.cxx:316
10 desktop::Desktop::Exception(ExceptionCategory) at /home/lo/Dev/LO1/
core/desktop/source/app/app.cxx:1203 (discriminator 2)
11 VCLExceptionSignal_impl(void*, oslSignalInfo*) at /home/lo/Dev/LO1/
core/vcl/source/app/svmain.cxx:176
12 callSignalHandler(oslSignalInfo*) at /home/lo/Dev/LO1/core/sal/osl/
all/signalshared.cxx:47
13 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*)
at /home/lo/Dev/LO1/core/sal/osl/unx/signal.cxx:423
14 __restore_rt at libc_sigaction.c:?
15 SfxPoolItem::Which() const at /home/lo/Dev/LO1/core/include/svl/
poolitem.hxx:225
16 SfxPoolItemHolder::Which() const at /home/lo/Dev/LO1/core/include/
svl/itemset.hxx:74 (discriminator 1)
17 SwTextAttr::GetFootnote() const at /home/lo/Dev/LO1/core/sw/inc/
txatbase.hxx:223 (discriminator 1)
18 SwContentTree::QueryTooltipHdl(weld::TreeIter const&) at /home/lo/
Dev/LO1/core/sw/source/uibase/utlui/content.cxx:4974
19 SwContentTree::LinkStubQueryTooltipHdl(void*, weld::TreeIter const&)
at /home/lo/Dev/LO1/core/sw/source/uibase/utlui/content.cxx:4895
20 Link::Call(weld::TreeIter
const&) const at /home/lo/Dev/LO1/core/include/tools/link.hxx:111
21 weld::TreeView::signal_query_tooltip(weld::TreeIter const&) at /
home/lo/Dev/LO1/core/include/vcl/weld.hxx:977
22 SalInstanceTreeView::TooltipHdl(SvTreeListEntry*) at /home/lo/Dev/
LO1/core/vcl/source/app/salvtables.cxx:5154
23 SalInstanceTreeView::LinkStubTooltipHdl(void*, SvTreeListEntry*) at
/home/lo/Dev/LO1/core/vcl/source/app/salvtables.cxx:5151
24 Link::Call(SvTreeListEntry*) const
at /home/lo/Dev/LO1/core/include/tools/link.hxx:111
25 SvTreeListBox::RequestHelp(HelpEvent const&) at /home/lo/Dev/LO1/
core/vcl/source/treelist/treelistbox.cxx:3284
26 ImplHandleMouseHelpRequest(vcl::Window*, Point const&) at /home/lo/
Dev/LO1/core/vcl/source/window/winproc.cxx:186
27 ImplHandleMouseEvent(VclPtr const&, NotifyEventType,
bool, long, long, unsigned long, unsigned short, MouseEventModifiers) at
/home/lo/Dev/LO1/core/vcl/source/window/winproc.cxx:740
28 ImplHandleSalMouseMove(vcl::Window*, SalMouseEvent const*) at /home/
lo/Dev/LO1/core/vcl/source/window/winproc.cxx:2332
29 ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at /home/
lo/Dev/LO1/core/vcl/source/window/winproc.cxx:2665 (discriminator 1)
30 SalFrame::CallCallback(SalEvent, void const*) const at /home/lo/Dev/
LO1/core/vcl/inc/salframe.hxx:312 (discriminator 1)
31 QtFrame::CallCallback(SalEvent, void const*) const at /home/lo/Dev/
LO1/core/vcl/inc/qt5/QtFrame.hxx:228
32 QtWidget::mouseMoveEvent(QMouseEvent*) at /home/lo/Dev/LO1/core/vcl/
qt5/QtWidget.cxx:202
33 QWidget::event(QEvent*) in /lib/x86_64-linux-gnu/libQt5Widgets.so.5
34 QtWidget::event(QEvent*) at /home/lo/Dev/LO1/core/vcl/qt5/
QtWidget.cxx:738 (discriminator 2)
35 QApplicationPrivate::notify_helper(QObject*, QEvent*) in /lib/
x86_64-linux-gnu/libQt5Widgets.so.5
36 QApplication::notify(QObject*, QEvent*) in /lib/x86_64-linux-gnu/
libQt5Widgets.so.5
37 QCoreApplication::notifyInternal2(QObject*, QEvent*) in /lib/x86_64-

core.git: sw/source

2024-04-24 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/utlui/content.cxx |   12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 802bc63be79f5622d794345dbbc577b6c603b61b
Author: Jim Raykowski 
AuthorDate: Sat Apr 20 09:52:16 2024 -0800
Commit: Jim Raykowski 
CommitDate: Wed Apr 24 21:37:44 2024 +0200

SwContentTree: Don't show 'Delete' menu item when read-only

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

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 25186110de86..a7e3ff3c9289 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1823,10 +1823,12 @@ IMPL_LINK(SwContentTree, CommandHdl, const 
CommandEvent&, rCEvt, bool)
 const bool bProtected = 
weld::fromId(m_xTreeView->get_id(*xEntry))->IsProtect();
 const bool bProtectBM = (ContentTypeId::BOOKMARK == nContentType)
 && 
m_pActiveShell->getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS);
-const bool bEditable = pType->IsEditable() &&
-((bVisible && !bProtected) || ContentTypeId::REGION == 
nContentType);
-const bool bDeletable = pType->IsDeletable()
-&& ((bVisible && !bProtected && !bProtectBM) || 
ContentTypeId::REGION == nContentType);
+const bool bEditable
+= !bReadonly && pType->IsEditable()
+  && ((bVisible && !bProtected) || ContentTypeId::REGION == 
nContentType);
+const bool bDeletable = !bReadonly && pType->IsDeletable()
+&& ((bVisible && !bProtected && 
!bProtectBM)
+|| ContentTypeId::REGION == 
nContentType);
 const bool bRenamable
 = !bReadonly
   && (pType->IsRenamable()
@@ -1899,7 +1901,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 }
 bRemoveCopyEntry = false;
 }
-else if (!bReadonly && bEditable)
+else if (bEditable)
 {
 if(ContentTypeId::INDEX == nContentType)
 {


core.git: sw/source

2024-04-24 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/inc/content.hxx   |2 ++
 sw/source/uibase/utlui/content.cxx |   29 -
 2 files changed, 18 insertions(+), 13 deletions(-)

New commits:
commit 74bd60c433cdc135d8a465eb5cea8ee6ce84b436
Author: Jim Raykowski 
AuthorDate: Sat Apr 20 09:14:00 2024 -0800
Commit: Jim Raykowski 
CommitDate: Wed Apr 24 21:36:57 2024 +0200

Rework SwContentTree context menu item 'Rename' inclusion

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

diff --git a/sw/source/uibase/inc/content.hxx b/sw/source/uibase/inc/content.hxx
index c6698f4b0322..f0aad555619c 100644
--- a/sw/source/uibase/inc/content.hxx
+++ b/sw/source/uibase/inc/content.hxx
@@ -188,6 +188,7 @@ class SwContentType final : public SwTypeNumber
 boolm_bDataValid :1;
 boolm_bEdit:  1;  // can this type be edited?
 boolm_bDelete:1;  // can this type be deleted?
+bool m_bRenamable = false;
 
 bool m_bAlphabeticSort = false;
 
@@ -221,6 +222,7 @@ public:
 
 boolIsEditable() const {return m_bEdit;}
 boolIsDeletable() const {return m_bDelete;}
+bool IsRenamable() const {return m_bRenamable;}
 };
 
 #endif
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index eff50a0ea76c..25186110de86 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -379,18 +379,22 @@ SwContentType::SwContentType(SwWrtShell* pShell, 
ContentTypeId nType, sal_uInt8
 case ContentTypeId::TABLE:
 m_sTypeToken = "table";
 m_bEdit = true;
+m_bRenamable = true;
 break;
 case ContentTypeId::FRAME:
 m_sTypeToken = "frame";
 m_bEdit = true;
+m_bRenamable = true;
 break;
 case ContentTypeId::GRAPHIC:
 m_sTypeToken = "graphic";
 m_bEdit = true;
+m_bRenamable = true;
 break;
 case ContentTypeId::OLE:
 m_sTypeToken = "ole";
 m_bEdit = true;
+m_bRenamable = true;
 break;
 case ContentTypeId::TEXTFIELD:
 m_bEdit = true;
@@ -407,16 +411,19 @@ SwContentType::SwContentType(SwWrtShell* pShell, 
ContentTypeId nType, sal_uInt8
 DocumentSettingId::PROTECT_BOOKMARKS);
 m_bEdit = true;
 m_bDelete = !bProtectedBM;
+m_bRenamable = !bProtectedBM;
 }
 break;
 case ContentTypeId::REGION:
 m_sTypeToken = "region";
 m_bEdit = true;
 m_bDelete = true;
+m_bRenamable = true;
 break;
 case ContentTypeId::INDEX:
 m_bEdit = true;
 m_bDelete = true;
+m_bRenamable = true;
 break;
 case ContentTypeId::REFERENCE:
 m_bEdit = false;
@@ -432,6 +439,7 @@ SwContentType::SwContentType(SwWrtShell* pShell, 
ContentTypeId nType, sal_uInt8
 case ContentTypeId::DRAWOBJECT:
 m_sTypeToken = "drawingobject";
 m_bEdit = true;
+m_bRenamable = true;
 break;
 default: break;
 }
@@ -1819,15 +1827,11 @@ IMPL_LINK(SwContentTree, CommandHdl, const 
CommandEvent&, rCEvt, bool)
 ((bVisible && !bProtected) || ContentTypeId::REGION == 
nContentType);
 const bool bDeletable = pType->IsDeletable()
 && ((bVisible && !bProtected && !bProtectBM) || 
ContentTypeId::REGION == nContentType);
-const bool bRenamable = bEditable && !bReadonly &&
-(ContentTypeId::TABLE == nContentType ||
- ContentTypeId::FRAME == nContentType ||
- ContentTypeId::GRAPHIC == nContentType ||
- ContentTypeId::OLE == nContentType ||
- (ContentTypeId::BOOKMARK == nContentType && !bProtectBM) 
||
- ContentTypeId::REGION == nContentType ||
- ContentTypeId::INDEX == nContentType ||
- ContentTypeId::DRAWOBJECT == nContentType);
+const bool bRenamable
+= !bReadonly
+  && (pType->IsRenamable()
+  || (ContentTypeId::BOOKMARK == nContentType && 
!bProtectBM));
+
 // Choose which Delete entry to show.
 if (bDeletable)
 {
@@ -1932,12 +1936,11 @@ IMPL_LINK(SwContentTree, CommandHdl, const 
CommandEvent&, rCEvt, bool)
 xPop->set_active("protectsection", bProtected);
 xPop->set_active("hidesection", bHidden);
 }
-else if (bEditable)
+else
 bRemoveEditEntry = false;
-//Rename 

core.git: sw/source

2024-04-22 Thread Jim Raykowski (via logerrit)
 sw/source/core/crsr/trvlfnfl.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 5740d3fa83e9725a2771e5f00ba4aaf9965f0be2
Author: Jim Raykowski 
AuthorDate: Fri Apr 19 21:05:24 2024 -0800
Commit: Jim Raykowski 
CommitDate: Mon Apr 22 20:51:58 2024 +0200

Resolves tdf#160731 Navigate by recency does not work under gtk3 +

wayland

I think the lines of code removed by this patch were meant to allow
recency to remember the cursor position before being moved to a start/
end/previous/next word or sentence position by an UNO dispatch command. 
These are already taken care of in the slot execute function void
SwTextShell::ExecMoveLingu.

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

diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx
index 8cdf807acc55..098bad4b3435 100644
--- a/sw/source/core/crsr/trvlfnfl.cxx
+++ b/sw/source/core/crsr/trvlfnfl.cxx
@@ -34,9 +34,6 @@
 
 bool SwCursorShell::CallCursorShellFN( FNCursorShell fnCursor )
 {
-if (SwWrtShell* pWrtSh = dynamic_cast(this))
-pWrtSh->addCurrentPosition();
-
 SwCallLink aLk( *this ); // watch Cursor-Moves
 bool bRet = (this->*fnCursor)();
 if( bRet )
@@ -47,6 +44,7 @@ bool SwCursorShell::CallCursorShellFN( FNCursorShell fnCursor 
)
 
 bool SwCursorShell::CallCursorFN( FNCursor fnCursor )
 {
+// for footnote anchor<->text recency
 if (SwWrtShell* pWrtSh = dynamic_cast(this))
 pWrtSh->addCurrentPosition();
 


core.git: sw/source

2024-04-21 Thread Heiko Tietze (via logerrit)
 sw/source/core/text/inftxt.cxx|   90 +++---
 sw/source/uibase/uiview/view0.cxx |6 --
 2 files changed, 47 insertions(+), 49 deletions(-)

New commits:
commit b79e0dd7fc8bc620420ed65edbc105eec3648b34
Author: Heiko Tietze 
AuthorDate: Fri Apr 12 15:26:41 2024 +0200
Commit: Heiko Tietze 
CommitDate: Sun Apr 21 12:40:23 2024 +0200

Resolves tdf#58434 - Show formatting marks independently from fields

Field Shading / .uno:Marks toggles now only fields, footnotes, tox etc.
and Tab, SoftHyphen, Blank, as well as ControlChar depends now on
Formatting Marks / .uno:ControlCodes. Field Shading also does not
toggle HardBlank and SoftHyphen, and what control character is shown
respect the options under Formatting Aids

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

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 18ad3d1144e0..b293f18f824a 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1407,54 +1407,56 @@ void SwTextPaintInfo::DrawViewOpt( const SwLinePortion 
,
 return;
 
 bool bDraw = false;
-switch( nWhich )
-{
-case PortionType::Footnote:
-case PortionType::QuoVadis:
-case PortionType::Number:
-case PortionType::Field:
-case PortionType::Hidden:
-case PortionType::Tox:
-case PortionType::Ref:
-case PortionType::Meta:
-case PortionType::ContentControl:
-case PortionType::ControlChar:
-if ( !GetOpt().IsPagePreview()
- && !GetOpt().IsReadonly()
- && GetOpt().IsFieldShadings()
- && ( PortionType::Number != nWhich
-  || m_pFrame->GetTextNodeForParaProps()->HasMarkedLabel())) 
// #i27615#
-{
-bDraw = PortionType::Footnote != nWhich || 
m_pFrame->IsFootnoteAllowed();
-bDraw &= GetOpt().IsHardBlank();
-}
-break;
-case PortionType::Bookmark:
-// no shading
-break;
-case PortionType::InputField:
-// input field shading also in read-only mode
-if ( !GetOpt().IsPagePreview()
- && GetOpt().IsFieldShadings() )
-{
-bDraw = true;
-}
-break;
-case PortionType::Tab:
-if ( GetOpt().IsTab() ) bDraw = true;
-break;
-case PortionType::SoftHyphen:
-if ( GetOpt().IsSoftHyph() )bDraw = true;
-break;
-case PortionType::Blank:
-if ( GetOpt().IsHardBlank())bDraw = true;
-break;
-default:
+if ( !GetOpt().IsPagePreview()
+ && !GetOpt().IsReadonly() )
+{
+switch( nWhich )
 {
-OSL_ENSURE( false, "SwTextPaintInfo::DrawViewOpt: don't know how 
to draw this" );
+case PortionType::Tab:
+if ( GetOpt().IsViewMetaChars() )
+bDraw = GetOpt().IsTab();
+break;
+case PortionType::SoftHyphen:
+if ( GetOpt().IsViewMetaChars() )
+bDraw = GetOpt().IsSoftHyph();
 break;
+case PortionType::Blank:
+if ( GetOpt().IsViewMetaChars() )
+bDraw = GetOpt().IsHardBlank();
+break;
+case PortionType::ControlChar:
+if ( GetOpt().IsViewMetaChars() )
+bDraw = true;
+break;
+case PortionType::Bookmark:
+// no shading
+break;
+case PortionType::Footnote:
+case PortionType::QuoVadis:
+case PortionType::Number:
+case PortionType::Hidden:
+case PortionType::Tox:
+case PortionType::Ref:
+case PortionType::Meta:
+case PortionType::ContentControl:
+case PortionType::Field:
+case PortionType::InputField:
+// input field shading also in read-only mode
+if (GetOpt().IsFieldShadings()
+&& ( PortionType::Number != nWhich
+|| m_pFrame->GetTextNodeForParaProps()->HasMarkedLabel())) 
// #i27615#
+{
+bDraw = PortionType::Footnote != nWhich || 
m_pFrame->IsFootnoteAllowed();
+}
+break;
+default:
+{
+OSL_ENSURE( false, "SwTextPaintInfo::DrawViewOpt: don't know 
how to draw this" );
+break;
+}
 }
 }
+
 if ( bDraw )
 DrawBackground( rPor, pColor );
 }
diff --git a/sw/source/uibase/uiview/view0.cxx 
b/sw/source/uibase/uiview/view0.cxx
index 70c9882e0d2e..488b32cc5fee 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -128,14 +128,10 @@ std::shared_ptr const & 
SwView::GetMailMergeConfigItem()
 
 static bool lcl_IsViewMarks( const SwViewOption& rVOpt )
 {
-return  rVOpt.IsHardBlank() &&
-rVOpt.IsSoftHyph() &&
-   

core.git: sw/source

2024-04-15 Thread Caolán McNamara (via logerrit)
 sw/source/core/text/frmform.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c2243d4ced63c5a9764e5d83812285e08e0ea918
Author: Caolán McNamara 
AuthorDate: Mon Apr 15 10:07:39 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 15 20:25:20 2024 +0200

cid#1596278 Dereference after null check

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

diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 97eff3e607ec..4e2caf27b276 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1202,7 +1202,7 @@ void SwTextFrame::FormatAdjust( SwTextFormatter ,
 {
 // Do not split immediately in the beginning of page (unless there 
is an at-para or
 // at-char or at-page fly, which pushes the rest down)
-if (isFirstVisibleFrameInBody(this) && !hasFly(this) && 
!hasAtPageFly(pBodyFrame))
+if (isFirstVisibleFrameInBody(this) && !hasFly(this) && pBodyFrame 
&& !hasAtPageFly(pBodyFrame))
 nNew = 0;
 }
 }


core.git: sw/source

2024-04-15 Thread Caolán McNamara (via logerrit)
 sw/source/core/text/widorp.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit fff6e491f830daf18088f025fad6ce8118ec6108
Author: Caolán McNamara 
AuthorDate: Mon Apr 15 10:05:55 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 15 14:10:40 2024 +0200

cid#1596323 Dereference null return value

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

diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx
index acb3fe32cd31..5446ac8cec15 100644
--- a/sw/source/core/text/widorp.cxx
+++ b/sw/source/core/text/widorp.cxx
@@ -479,11 +479,14 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, 
SwTextMargin  )
 {
 const SwSectionFrame* const pSct = pFrame->FindSctFrame();
 // multi-column section
-if ( pSct->Lower()->IsColumnFrame() && pSct->Lower()->GetNext()
- // and not in the last column
- && !pFrame->FindColFrame()->GetNext() )
+if ( pSct->Lower()->IsColumnFrame() && pSct->Lower()->GetNext() )
 {
-bKeep = false;
+const SwFrame *pCol = pFrame->FindColFrame();
+// and not in the last column
+if (pCol && !pCol->GetNext())
+{
+bKeep = false;
+}
 }
 }
 


core.git: sw/source

2024-04-14 Thread Mike Kaganski (via logerrit)
 sw/source/filter/html/css1atr.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 84580785ba7081939296a0ae2da076e067612d4f
Author: Mike Kaganski 
AuthorDate: Sat Apr 13 23:37:38 2024 +0500
Commit: Mike Kaganski 
CommitDate: Sun Apr 14 08:58:39 2024 +0200

Use more o3tl::convert

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

diff --git a/sw/source/filter/html/css1atr.cxx 
b/sw/source/filter/html/css1atr.cxx
index 48badab293dd..0cbf5b36da86 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -118,7 +118,7 @@ namespace o3tl {
 template<> struct typed_flags : 
is_typed_flags {};
 }
 
-#define DOT_LEADERS_MAX_WIDTH   18
+constexpr int DOT_LEADERS_MAX_WIDTH = 18; // cm
 
 static SwHTMLWriter& OutCSS1_SwFormat( SwHTMLWriter& rWrt, const SwFormat& 
rFormat,
   IDocumentStylePoolAccess /*SwDoc*/ *pDoc, SwDoc 
*pTemplate );
@@ -2822,7 +2822,7 @@ static SwHTMLWriter& 
OutCSS1_SvxTextLeftMargin(SwHTMLWriter & rWrt, SfxPoolItem
 
 // max-width = max-width - margin-left for TOC paragraphs with dot 
leaders
 if (rWrt.m_bParaDotLeaders)
-rWrt.OutCSS1_UnitProperty(sCSS1_P_max_width, 
tools::Long(DOT_LEADERS_MAX_WIDTH/2.54*72*20) - nLeftMargin);
+rWrt.OutCSS1_UnitProperty(sCSS1_P_max_width, 
o3tl::convert(DOT_LEADERS_MAX_WIDTH, o3tl::Length::cm, o3tl::Length::twip) - 
nLeftMargin);
 
 }
 
@@ -2859,7 +2859,7 @@ static SwHTMLWriter& OutCSS1_SvxLRSpace( SwHTMLWriter& 
rWrt, const SfxPoolItem&
 
 // max-width = max-width - margin-left for TOC paragraphs with dot 
leaders
 if( rWrt.m_bParaDotLeaders )
-rWrt.OutCSS1_UnitProperty( sCSS1_P_max_width, 
tools::Long(DOT_LEADERS_MAX_WIDTH/2.54*72*20) - nLeftMargin );
+rWrt.OutCSS1_UnitProperty( sCSS1_P_max_width, 
o3tl::convert(DOT_LEADERS_MAX_WIDTH, o3tl::Length::cm, o3tl::Length::twip) - 
nLeftMargin );
 
 }
 


core.git: sw/source

2024-04-13 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/utlui/content.cxx |   33 -
 1 file changed, 12 insertions(+), 21 deletions(-)

New commits:
commit 857fe51bc8f2d3f3535807a69399c7e2fee971ae
Author: Jim Raykowski 
AuthorDate: Thu Apr 11 17:50:16 2024 -0800
Commit: Jim Raykowski 
CommitDate: Sun Apr 14 05:08:07 2024 +0200

SwContentTree: remove repeated pointer assignment

The selected entry does not change within the CommandHdl function
therefore assignment of the pointer to the selected entry SwContentType
does not need to be repeated elsewhere in the function.

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

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 8e301753b236..9e80e06c3292 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1941,31 +1941,22 @@ IMPL_LINK(SwContentTree, CommandHdl, const 
CommandEvent&, rCEvt, bool)
 }
 else
 {
-if (lcl_IsContentType(*xEntry, *m_xTreeView))
-pType = 
weld::fromId(m_xTreeView->get_id(*xEntry));
-else
-pType = weld::fromId(
-m_xTreeView->get_id(*xEntry))->GetParent();
-if (pType)
+if (ContentTypeId::OUTLINE == nContentType)
 {
-if (ContentTypeId::OUTLINE == nContentType)
+bOutline = true;
+if (State::HIDDEN != m_eState)
 {
-bOutline = true;
-if (State::HIDDEN != m_eState)
-{
-lcl_SetOutlineContentEntriesSensitivities(this, 
*m_xTreeView, *xEntry,
-  
*xSubPopOutlineContent);
-bRemoveSendOutlineEntry = false;
-}
-bRemoveToggleExpandEntry = 
lcl_InsertExpandCollapseAllItem(*m_xTreeView, *xEntry,
-   
*xPop);
+lcl_SetOutlineContentEntriesSensitivities(this, 
*m_xTreeView, *xEntry,
+  
*xSubPopOutlineContent);
+bRemoveSendOutlineEntry = false;
 }
-else if (State::HIDDEN != m_eState &&
- nContentType == ContentTypeId::POSTIT &&
- 
!m_pActiveShell->GetView().GetDocShell()->IsReadOnly() &&
- pType->GetMemberCount() > 0)
-bRemovePostItEntries = false;
+bRemoveToggleExpandEntry
+= lcl_InsertExpandCollapseAllItem(*m_xTreeView, *xEntry, 
*xPop);
 }
+else if (State::HIDDEN != m_eState && nContentType == 
ContentTypeId::POSTIT
+ && !m_pActiveShell->GetView().GetDocShell()->IsReadOnly()
+ && pType->GetMemberCount() > 0)
+bRemovePostItEntries = false;
 }
 }
 


core.git: sw/source

2024-04-13 Thread Aaron Bourdeaux (via logerrit)
 sw/source/core/access/acccell.cxx |4 +---
 sw/source/core/access/accembedded.cxx |4 +---
 sw/source/core/access/accfootnote.cxx |9 ++---
 3 files changed, 4 insertions(+), 13 deletions(-)

New commits:
commit 734a84f33d3f08e31086c2dbd629715608a178d5
Author: Aaron Bourdeaux 
AuthorDate: Fri Apr 5 19:38:00 2024 -0400
Commit: Ilmari Lauhakangas 
CommitDate: Sat Apr 13 20:31:00 2024 +0200

tdf#158067 Replace OUStringLiteral with _ustr

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

diff --git a/sw/source/core/access/acccell.cxx 
b/sw/source/core/access/acccell.cxx
index 8b15fa095545..0cffe02d1e04 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -48,8 +48,6 @@ using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
 using namespace sw::access;
 
-constexpr OUStringLiteral sImplementationName = 
u"com.sun.star.comp.Writer.SwAccessibleCellView";
-
 bool SwAccessibleCell::IsSelected()
 {
 bool bRet = false;
@@ -240,7 +238,7 @@ OUString SAL_CALL 
SwAccessibleCell::getAccessibleDescription()
 
 OUString SAL_CALL SwAccessibleCell::getImplementationName()
 {
-return sImplementationName;
+return u"com.sun.star.comp.Writer.SwAccessibleCellView"_ustr;
 }
 
 sal_Bool SAL_CALL SwAccessibleCell::supportsService(const OUString& 
sTestServiceName)
diff --git a/sw/source/core/access/accembedded.cxx 
b/sw/source/core/access/accembedded.cxx
index 1eb54cf25878..7d4a5415bdcf 100644
--- a/sw/source/core/access/accembedded.cxx
+++ b/sw/source/core/access/accembedded.cxx
@@ -31,8 +31,6 @@ using namespace ::com::sun::star;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::accessibility;
 
-constexpr OUStringLiteral sImplementationName = 
u"com.sun.star.comp.Writer.SwAccessibleEmbeddedObject";
-
 SwAccessibleEmbeddedObject::SwAccessibleEmbeddedObject(
 std::shared_ptr const& pInitMap,
 const SwFlyFrame* pFlyFrame  ) :
@@ -71,7 +69,7 @@ void SAL_CALL
 
 OUString SAL_CALL SwAccessibleEmbeddedObject::getImplementationName()
 {
-return sImplementationName;
+return u"com.sun.star.comp.Writer.SwAccessibleEmbeddedObject"_ustr;
 }
 
 sal_Bool SAL_CALL SwAccessibleEmbeddedObject::supportsService(const OUString& 
sTestServiceName)
diff --git a/sw/source/core/access/accfootnote.cxx 
b/sw/source/core/access/accfootnote.cxx
index 6fb7ebca864c..9fc265c53bc1 100644
--- a/sw/source/core/access/accfootnote.cxx
+++ b/sw/source/core/access/accfootnote.cxx
@@ -33,11 +33,6 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::accessibility;
 
-constexpr OUStringLiteral sImplementationNameFootnote
-= u"com.sun.star.comp.Writer.SwAccessibleFootnoteView";
-constexpr OUStringLiteral sImplementationNameEndnote
-= u"com.sun.star.comp.Writer.SwAccessibleEndnoteView";
-
 SwAccessibleFootnote::SwAccessibleFootnote(
 std::shared_ptr const& pInitMap,
 bool bIsEndnote,
@@ -90,9 +85,9 @@ OUString SAL_CALL 
SwAccessibleFootnote::getAccessibleDescription()
 OUString SAL_CALL SwAccessibleFootnote::getImplementationName()
 {
 if( AccessibleRole::END_NOTE == GetRole() )
-return sImplementationNameEndnote;
+return u"com.sun.star.comp.Writer.SwAccessibleEndnoteView"_ustr;
 else
-return sImplementationNameFootnote;
+return u"com.sun.star.comp.Writer.SwAccessibleFootnoteView"_ustr;
 }
 
 sal_Bool SAL_CALL SwAccessibleFootnote::supportsService(const OUString& 
sTestServiceName)


core.git: sw/source

2024-04-12 Thread Michael Stahl (via logerrit)
 sw/source/core/layout/tabfrm.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 44ff9907eb1f2851b3b9087e7ec5e5dfae5a00c6
Author: Michael Stahl 
AuthorDate: Thu Apr 11 16:37:12 2024 +0200
Commit: Michael Stahl 
CommitDate: Fri Apr 12 11:10:54 2024 +0200

sw: workaround crash in IsAllHiddenRow()

Not sure why but somehow still crashes in the code added in commit
ab7893544dc6be6dc192dffefd57cd5ddd421c35


https://crashreport.libreoffice.org/stats/crash_details/912e7417-5e04-4279-bbaf-380234f4cd33

Change-Id: I23b7ecdd83009cfe6584866ed72102d8f2179f86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166010
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index cd44758e574b..e8ec84faad83 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1523,7 +1523,8 @@ namespace
 }
 }
 }
-if (rTab.IsCollapsingBorders() && !rCell.Lower()->IsRowFrame())
+assert(rCell.Lower());
+if (rTab.IsCollapsingBorders() && rCell.Lower() && 
!rCell.Lower()->IsRowFrame())
 {
 if (rRow.GetTopMarginForLowers() != 0
 || rRow.GetBottomMarginForLowers() != 0)


core.git: sw/source

2024-04-08 Thread Caolán McNamara (via logerrit)
 sw/source/ui/fldui/fldref.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit db609a58df7be082de7d5a20a2a924789d6a64a1
Author: Caolán McNamara 
AuthorDate: Sun Apr 7 20:40:39 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 8 14:39:56 2024 +0200

Resolves: tdf#154715 don't use last-used field setting when editing field

If we are inserting a field it makes sense to use the last-used
settings, but if we are editing an existing field we naturally want to
populate with the current field.

Here we have IsRefresh used twice as a condition, one inside the other.
But if was true in the outer use, it will also be true in the inner
(this duplication exists all the way back to the initial commit) because
GetUserData() has no side effect.

IsRefresh is only true during EditNewField (which is the case of using
the "next/back" button to go to edit another field). So even before this
change if you click next and then back (assuming there is another field
to move to) then you then get the right results

Skip restoring the last-used settings in the EditField case, replace
the outer !IsRefresh() with !IsFieldEdit()

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

diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index a08715c8ca3c..434e10a6a2f2 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -268,7 +268,7 @@ void SwFieldRefPage::Reset(const SfxItemSet* )
 nFieldDlgFormatSel = 0;
 
 sal_uInt16 nFormatBoxPosition = USHRT_MAX;
-if( !IsRefresh() )
+if( !IsFieldEdit() )
 {
 sal_Int32 nIdx{ 0 };
 const OUString sUserData = GetUserData();


core.git: sw/source

2024-04-08 Thread Stephan Bergmann (via logerrit)
 sw/source/core/docnode/node2lay.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a57ade9be3aa03634933e767eab5e8fb640760ca
Author: Stephan Bergmann 
AuthorDate: Mon Apr 8 07:52:38 2024 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Apr 8 09:50:20 2024 +0200

-Werror,-Wunused-but-set-variable

...ever since the code got introduced in
9dc6e2c9062725ef1f9d7e321cae5f4dbe8ca749 "sw: fix expansion of 
SetGetExpField in
headers with split table rows"

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

diff --git a/sw/source/core/docnode/node2lay.cxx 
b/sw/source/core/docnode/node2lay.cxx
index 607ebada8ef4..312ce2dff440 100644
--- a/sw/source/core/docnode/node2lay.cxx
+++ b/sw/source/core/docnode/node2lay.cxx
@@ -146,7 +146,7 @@ SwFrame const* FindNeighbourFrameForNode(SwNode const& 
rNode)
 {
 SwNodeIndex idx(rNode);
 SwFlowFrame const* pFlow(nullptr);
-if (SwNode *const pNode = GoPreviousWithFrame(, ))
+if (GoPreviousWithFrame(, ))
 {
 if (::CheckNodesRange(rNode, idx.GetNode(), true))
 {
@@ -158,7 +158,7 @@ SwFrame const* FindNeighbourFrameForNode(SwNode const& 
rNode)
 }
 }
 idx = rNode;
-if (SwNode *const pNode = GoNextWithFrame(idx.GetNodes(), , ))
+if (GoNextWithFrame(idx.GetNodes(), , ))
 {
 if (::CheckNodesRange(rNode, idx.GetNode(), true))
 {


core.git: sw/source

2024-04-07 Thread Mike Kaganski (via logerrit)
 sw/source/core/layout/findfrm.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit fead9c3ea98eb5e6bc01b1dde2a8ab2fa755209d
Author: Mike Kaganski 
AuthorDate: Sun Apr 7 12:38:23 2024 +0100
Commit: Mike Kaganski 
CommitDate: Sun Apr 7 14:46:34 2024 +0200

Drop a redundant check

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

diff --git a/sw/source/core/layout/findfrm.cxx 
b/sw/source/core/layout/findfrm.cxx
index c910ebf48992..7b85f267d26a 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -475,8 +475,6 @@ const SwContentFrame* 
SwContentFrame::ImplGetNextContentFrame( bool bFwd ) const
 SwPageFrame* SwFrame::ImplFindPageFrame()
 {
 SwFrame *pRet = this;
-if (pRet->IsInDtor())
-return nullptr;
 while ( pRet )
 {
 if (pRet->IsInDtor())


core.git: sw/source

2024-04-06 Thread Mike Kaganski (via logerrit)
 sw/source/core/layout/calcmove.cxx |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 07f287c58ca4bae4bdc641cc9139f9aaaff24374
Author: Mike Kaganski 
AuthorDate: Sat Apr 6 13:00:06 2024 +0500
Commit: Mike Kaganski 
CommitDate: Sat Apr 6 16:09:54 2024 +0200

Simplify a bit

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

diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index e13fdf012143..428c1defe8c2 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1312,7 +1312,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
 
 // #i28701# - move master forward, if it has to move,
 // because of its object positioning.
-if ( !static_cast(this)->IsFollow() )
+if (!IsFollow())
 {
 sal_uInt32 nToPageNum = 0;
 const bool bMoveFwdByObjPos = SwLayouter::FrameMovedFwdByObjPos(
@@ -1333,17 +1333,15 @@ void SwContentFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
 MoveFwd( bMakePage, false );
 }
 }
-
-// If a Follow sits next to its Master and doesn't fit, we know it can
-// be moved right now.
-if ( lcl_Prev( this ) && static_cast(this)->IsFollow() && 
IsMoveable() )
+else if (auto* prev = lcl_Prev(this); prev && IsMoveable())
 {
+// If a Follow sits next to its Master and doesn't fit, we know it can 
be moved right now.
 bMovedFwd = true;
 // If follow frame is in table, its master will be the last in the
 // current table cell. Thus, invalidate the printing area of the 
master.
 if ( IsInTab() )
 {
-lcl_Prev( this )->InvalidatePrt();
+prev->InvalidatePrt();
 }
 MoveFwd( bMakePage, false );
 }


core.git: sw/source

2024-04-05 Thread Michael Stahl (via logerrit)
 sw/source/core/layout/layact.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 759d822dac5edc6104ce61b70c578425d9f2470d
Author: Michael Stahl 
AuthorDate: Thu Apr 4 19:26:31 2024 +0200
Commit: Michael Stahl 
CommitDate: Fri Apr 5 10:03:13 2024 +0200

sw: layout: remove superfluous pages again in InternalAction()

The bugdoc has a very large header containing hidden text changes height
when toggling Formatting Marks.  When toggling on, it crashes, because
UnHide() iterates the text frames in all headers, but after the first
one empty pages at the end of the document are removed, so UAF.

Remove the pages without content earlier; SwLayAction::InternalAction()
already does it after the "normal" page loop, but the 2nd page loop
following that may also move content off pages, so do it again.

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

diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index abbca7d67eab..5add4e40a8a7 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -809,6 +809,12 @@ void SwLayAction::InternalAction(OutputDevice* 
pRenderContext)
 unlockPositionOfObjects( pPg );
 pPg = static_cast(pPg->GetNext());
 }
+if (m_pRoot->IsSuperfluous()) // could be newly set now!
+{
+bool bOld = IsAgain();
+m_pRoot->RemoveSuperfluous();
+SetAgain(bOld);
+}
 // reset flag for special interrupt content formatting.
 mbFormatContentOnInterrupt = false;
 }


core.git: sw/source

2024-04-04 Thread Heiko Tietze (via logerrit)
 sw/source/ui/index/swuiidxmrk.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ebfa0d061fdbca6a25d3efcff72ab5ed184a51dc
Author: Heiko Tietze 
AuthorDate: Thu Apr 4 12:09:33 2024 +0200
Commit: Heiko Tietze 
CommitDate: Thu Apr 4 15:30:30 2024 +0200

Resolves tdf#154209 - Fixes resize issue in Index Entry dialog

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

diff --git a/sw/source/ui/index/swuiidxmrk.cxx 
b/sw/source/ui/index/swuiidxmrk.cxx
index 6b6e9f10536f..2ca5d673712b 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -441,6 +441,7 @@ IMPL_LINK_NOARG(SwIndexMarkPane, SyncSelectionHdl, 
weld::Button&, void)
 m_xApplyToAllCB->show();
 m_xSearchCaseSensitiveCB->show();
 m_xSearchCaseWordOnlyCB->show();
+m_xDialog->resize_to_request();
 m_xApplyToAllCB->set_sensitive(!m_aOrgStr.isEmpty() &&
 !(nFrameType & ( FrameTypeFlags::HEADER | FrameTypeFlags::FOOTER | 
FrameTypeFlags::FLY_ANY )));
 SearchTypeHdl(*m_xApplyToAllCB);


core.git: sw/source

2024-04-04 Thread Mike Kaganski (via logerrit)
 sw/source/core/fields/expfld.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 746b21760b911860c7ac497f10ab07d60111e867
Author: Mike Kaganski 
AuthorDate: Thu Apr 4 15:11:24 2024 +0500
Commit: Mike Kaganski 
CommitDate: Thu Apr 4 15:12:14 2024 +0200

tdf#81012: avoid content frames in footnotes / endnotes

This makes the behavior of the endnotes in the end of sections consistent
with the behavior of dedicated endnote pages, where heading fields ignore
headings in endnote content.

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

diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index c764f898d93f..adf6097582b8 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -233,7 +233,7 @@ const SwTextNode* GetBodyTextNode( const SwDoc& rDoc, 
SwPosition& rPos,
 else
 pContentFrame = pPgFrame->FindLastBodyContent();
 
-if( pContentFrame )
+if( pContentFrame && !pContentFrame->IsInFootnote() )
 {
 assert(pContentFrame->IsTextFrame());
 SwTextFrame const*const pFrame(static_cast(pContentFrame));


core.git: sw/source

2024-04-04 Thread Mike Kaganski (via logerrit)
 sw/source/core/layout/trvlfrm.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d33a43a76c3ad6d38f7c2dca0ff5386ee5264bce
Author: Mike Kaganski 
AuthorDate: Thu Apr 4 10:51:10 2024 +0100
Commit: Mike Kaganski 
CommitDate: Thu Apr 4 13:11:08 2024 +0200

Drop one redundant check

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

diff --git a/sw/source/core/layout/trvlfrm.cxx 
b/sw/source/core/layout/trvlfrm.cxx
index aa1a255fc421..07801bf93164 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -1205,7 +1205,7 @@ const SwContentFrame *SwLayoutFrame::GetContentPos( 
Point& rPoint,
 if ( !pContent && (GetPrev() && !bDontLeave) )
 pContent = ContainsContent();
 
-if ( bBodyOnly && pContent && !pContent->IsInDocBody() )
+if ( bBodyOnly )
 while ( pContent && !pContent->IsInDocBody() )
 pContent = pContent->GetNextContentFrame();
 


core.git: sw/source

2024-03-29 Thread wilmhit (via logerrit)
 sw/source/ui/dbui/addresslistdialog.hxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit b4134d3554711bfb1c05e8f36f9f4b5bc52aec3f
Author: wilmhit 
AuthorDate: Sun Mar 17 16:38:43 2024 +0100
Commit: Ilmari Lauhakangas 
CommitDate: Fri Mar 29 14:08:29 2024 +0100

tdf#143148: Use pragma once in dbui addresslistdialog

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

diff --git a/sw/source/ui/dbui/addresslistdialog.hxx 
b/sw/source/ui/dbui/addresslistdialog.hxx
index dc0873af000e..6669ad06509e 100644
--- a/sw/source/ui/dbui/addresslistdialog.hxx
+++ b/sw/source/ui/dbui/addresslistdialog.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_UI_DBUI_ADDRESSLISTDIALOG_HXX
-#define INCLUDED_SW_SOURCE_UI_DBUI_ADDRESSLISTDIALOG_HXX
+#pragma once
 
 #include 
 #include 
@@ -96,6 +95,5 @@ public:
 const SwDBData& GetDBData() const   {return m_aDBData;}
 OUString GetFilter() const;
 };
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: sw/source

2024-03-28 Thread Noel Grandin (via logerrit)
 sw/source/uibase/inc/redlndlg.hxx  |1 +
 sw/source/uibase/misc/redlndlg.cxx |4 
 2 files changed, 5 insertions(+)

New commits:
commit 3b71e5ef440d3fa8ceac9dd3591171ad1a076bd4
Author: Noel Grandin 
AuthorDate: Wed Mar 27 21:54:23 2024 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 28 10:46:13 2024 +0100

prevent crash in SwModelessRedlineAcceptDlg destruction

Seems to be timing dependent, does not always happen.

Stack:
 #0 sal::backtrace_get(unsigned int) at sal/osl/unx/backtraceapi.cxx:42 
(discriminator 1)
 #1 (anonymous namespace)::printStack(int) at sal/osl/unx/signal.cxx:289
 #2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at 
sal/osl/unx/signal.cxx:330
 #3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at 
sal/osl/unx/signal.cxx:427
 #4 __restore_rt at libc_sigaction.c:?
 #5 std::__uniq_ptr_impl >::_M_ptr() const at 
/usr/include/c++/13/bits/unique_ptr.h:199 (discriminator 1)
 #6 std::unique_ptr 
>::get() const at /usr/include/c++/13/bits/unique_ptr.h:470
 #7 std::unique_ptr 
>::operator->() const at /usr/include/c++/13/bits/unique_ptr.h:464
 #8 SvxTPFilter::GetSelectedAuthor() const at 
svx/source/dialog/ctredlin.cxx:636 (discriminator 1)
 #9 SwRedlineAcceptDlg::InitAuthors() at 
sw/source/uibase/misc/redlndlg.cxx:256
 #10 SwRedlineAcceptDlg::Activate() at 
sw/source/uibase/misc/redlndlg.cxx:492
 #11 SwModelessRedlineAcceptDlg::Activate() at 
sw/source/uibase/misc/redlndlg.cxx:123
 #12 SfxDialogController::FocusChangeHdl(weld::Container&) at 
sfx2/source/dialog/basedlgs.cxx:117
 #13 SfxDialogController::LinkStubFocusChangeHdl(void*, weld::Container&) 
at sfx2/source/dialog/basedlgs.cxx:111
 #14 Link::Call(weld::Container&) const at 
include/tools/link.hxx:111
 #15 weld::Container::signal_container_focus_changed() at 
include/vcl/weld.hxx:368
 #16 SalInstanceContainer::HandleEventListener(VclWindowEvent&) at 
vcl/source/app/salvtables.cxx:1328
 #17 SalInstanceWidget::EventListener(VclWindowEvent&) at 
vcl/source/app/salvtables.cxx:824
 #18 SalInstanceWidget::LinkStubEventListener(void*, VclWindowEvent&) at 
vcl/source/app/salvtables.cxx:821
 #19 Link::Call(VclWindowEvent&) const at 
include/tools/link.hxx:111
 #20 vcl::Window::CallEventListeners(VclEventId, void*) at 
vcl/source/window/event.cxx:257 (discriminator 2)
 #21 vcl::Window::ImplCallActivateListeners(vcl::Window*) at 
vcl/source/window/window.cxx:3438
 #22 vcl::Window::ImplCallActivateListeners(vcl::Window*) at 
vcl/source/window/window.cxx:3442 (discriminator 1)
 #23 vcl::Window::ImplCallActivateListeners(vcl::Window*) at 
vcl/source/window/window.cxx:3442 (discriminator 1)
 #24 vcl::Window::ImplCallActivateListeners(vcl::Window*) at 
vcl/source/window/window.cxx:3442 (discriminator 1)
 #25 vcl::Window::ImplCallActivateListeners(vcl::Window*) at 
vcl/source/window/window.cxx:3442 (discriminator 1)
 #26 vcl::Window::ImplCallActivateListeners(vcl::Window*) at 
vcl/source/window/window.cxx:3442 (discriminator 1)
 #27 vcl::Window::ImplCallActivateListeners(vcl::Window*) at 
vcl/source/window/window.cxx:3442 (discriminator 1)
 #28 vcl::Window::ImplCallActivateListeners(vcl::Window*) at 
vcl/source/window/window.cxx:3442 (discriminator 1)
 #29 vcl::Window::ImplGrabFocus(GetFocusFlags) at 
vcl/source/window/mouse.cxx:386 (discriminator 15)
 #30 vcl::Window::GrabFocus() at vcl/source/window/window.cxx:2989
 #31 vcl::Window::dispose() at vcl/source/window/window.cxx:433
 #32 Control::dispose() at vcl/source/control/ctrl.cxx:66
 #33 SvTreeListBox::dispose() at vcl/source/treelist/treelistbox.cxx:1341
 #34 SvTabListBox::dispose() at vcl/source/treelist/svtabbx.cxx:244
 #35 SvHeaderTabListBox::dispose() at vcl/source/treelist/svtabbx.cxx:529
 #36 VclReferenceBase::disposeOnce() at 
vcl/source/outdev/vclreferencebase.cxx:38
 #37 VclPtr::disposeAndClear() at include/vcl/vclptr.hxx:209
 #38 VclBuilder::disposeBuilder() at vcl/source/window/builder.cxx:810 
(discriminator 2)
 #39 VclBuilder::~VclBuilder() at vcl/source/window/builder.cxx:805
 #40 std::default_delete::operator()(VclBuilder*) const at 
/usr/include/c++/13/bits/unique_ptr.h:99 (discriminator 1)
 #41 std::__uniq_ptr_impl 
>::reset(VclBuilder*) at /usr/include/c++/13/bits/unique_ptr.h:212
 #42 std::unique_ptr 
>::reset(VclBuilder*) at /usr/include/c++/13/bits/unique_ptr.h:510
 #43 SalInstanceBuilder::~SalInstanceBuilder() at 
vcl/source/app/salvtables.cxx:7456
 #44 SalInstanceBuilder::~SalInstanceBuilder() at 
vcl/source/app/salvtables.cxx:7457 (discriminator 1)
 #45 std::default_delete::operator()(weld::Builder*) const 
at /usr/include/c++/13/bits/unique_ptr.h:100
 #46 std::unique_ptr 
>::~unique_ptr() at /usr/include/c++/13/bits/unique_ptr.h:405
 #47 SvxTPage::~SvxTPage() at svx/source/dialog/ctredlin.cxx:289
 #48 

core.git: sw/source

2024-03-27 Thread Justin Luth (via logerrit)
 sw/source/core/layout/paintfrm.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit c51f9f15b8c308e62b4839cc13d623fdab0486c2
Author: Justin Luth 
AuthorDate: Wed Mar 27 09:50:36 2024 -0400
Commit: Justin Luth 
CommitDate: Wed Mar 27 18:49:09 2024 +0100

tdf#131253 sw: draw frame text boundary if fly has textframe

While the text boundary on a wrap-through frame
will not need text boundary markers for the external text,
it does have relevance for the internal text.

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

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 6903e80b1f46..8479436a88c8 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -7491,8 +7491,10 @@ void SwLayoutFrame::PaintSubsidiaryLines( const 
SwPageFrame *pPage,
 return;
 
 // if the frame is wrap none or wrap through, then text boundary lines 
have no meaning
+// (unless the frame itself contains text)
 const text::WrapTextMode aSurround = 
GetFormat()->GetSurround().GetSurround();
 if (GetFormat()->GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR
+&& (!Lower() || !Lower()->IsTextFrame())
 && (aSurround == text::WrapTextMode::WrapTextMode_THROUGH
 || aSurround == text::WrapTextMode::WrapTextMode_NONE))
 {


  1   2   3   4   5   6   7   8   9   10   >