core.git: 2 commits - sc/source

2024-05-24 Thread Caolán McNamara (via logerrit)
 sc/source/ui/undo/undotab.cxx |   51 --
 1 file changed, 25 insertions(+), 26 deletions(-)

New commits:
commit b227481b63000b556e648ad607ffeb86681482a0
Author: Caolán McNamara 
AuthorDate: Fri May 24 19:30:51 2024 +0100
Commit: Caolán McNamara 
CommitDate: Fri May 24 22:34:25 2024 +0200

pViewShell arg is never null, just use a reference here

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

diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 3cdeaeed1f76..43f647debbd9 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -63,16 +63,16 @@ using ::std::vector;
 
 namespace
 {
-void lcl_OnTabsChanged(const ScTabViewShell* pViewShell, const ScDocument& 
rDoc, SCTAB nTab, bool bInvalidateTiles = false)
+void lcl_OnTabsChanged(const ScTabViewShell& rViewShell, const ScDocument& 
rDoc, SCTAB nTab, bool bInvalidateTiles = false)
 {
 for (SCTAB nTabIndex = nTab; nTabIndex < rDoc.GetTableCount(); ++nTabIndex)
 {
 if (!rDoc.IsVisible(nTabIndex))
 continue;
 if (bInvalidateTiles)
-pViewShell->libreOfficeKitViewInvalidateTilesCallback(nullptr, 
nTabIndex, 0);
+rViewShell.libreOfficeKitViewInvalidateTilesCallback(nullptr, 
nTabIndex, 0);
 ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
-pViewShell,
+&rViewShell,
 true /* bColsAffected */, true /* bRowsAffected */,
 true /* bSizes*/, true /* bHidden */, true /* bFiltered */,
 true /* bGroups */, nTabIndex);
@@ -99,7 +99,7 @@ void lcl_MakeJsonArray(tools::JsonWriter& rJson, const 
std::vector& v, const
 }
 }
 
-void lcl_UndoCommandResult(const ScTabViewShell* pViewShell,
+void lcl_UndoCommandResult(const ScTabViewShell& rViewShell,
const char *pCmdName, const char *pCmdType,
const std::vector* pNewTabs,
const std::vector* pOldTabs = nullptr)
@@ -116,7 +116,7 @@ void lcl_UndoCommandResult(const ScTabViewShell* pViewShell,
 lcl_MakeJsonArray(aJson, *pOldTabs, "oldTabs");
 }
 
-pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_UNO_COMMAND_RESULT, 
aJson.finishAndGetAsOString());
+rViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_UNO_COMMAND_RESULT, 
aJson.finishAndGetAsOString());
 }
 }
 
@@ -183,9 +183,9 @@ void ScUndoInsertTab::Undo()
 if (comphelper::LibreOfficeKit::isActive())
 {
 ScDocument& rDoc = pDocShell->GetDocument();
-lcl_OnTabsChanged(pViewShell, rDoc, nTab);
+lcl_OnTabsChanged(*pViewShell, rDoc, nTab);
 std::vector aTabs{nTab};
-lcl_UndoCommandResult(pViewShell, ".uno:Undo", "ScUndoInsertTab", 
&aTabs);
+lcl_UndoCommandResult(*pViewShell, ".uno:Undo", "ScUndoInsertTab", 
&aTabs);
 
 }
 
@@ -218,9 +218,9 @@ void ScUndoInsertTab::Redo()
 if (comphelper::LibreOfficeKit::isActive())
 {
 ScDocument& rDoc = pDocShell->GetDocument();
-lcl_OnTabsChanged(pViewShell, rDoc, nTab);
+lcl_OnTabsChanged(*pViewShell, rDoc, nTab);
 std::vector aTabs{nTab};
-lcl_UndoCommandResult(pViewShell, ".uno:Redo", "ScUndoInsertTab", 
&aTabs);
+lcl_UndoCommandResult(*pViewShell, ".uno:Redo", "ScUndoInsertTab", 
&aTabs);
 }
 }
 
@@ -450,8 +450,8 @@ void ScUndoDeleteTab::Undo()
 {
 if (pViewShell)
 {
-lcl_OnTabsChanged(pViewShell, rDoc, theTabs[0]);
-lcl_UndoCommandResult(pViewShell, ".uno:Undo", "ScUndoDeleteTab", 
&theTabs);
+lcl_OnTabsChanged(*pViewShell, rDoc, theTabs[0]);
+lcl_UndoCommandResult(*pViewShell, ".uno:Undo", "ScUndoDeleteTab", 
&theTabs);
 }
 }
 
@@ -493,8 +493,8 @@ void ScUndoDeleteTab::Redo()
 if (comphelper::LibreOfficeKit::isActive() && !theTabs.empty())
 {
 ScDocument& rDoc = pDocShell->GetDocument();
-lcl_OnTabsChanged(pViewShell, rDoc, theTabs[0]);
-lcl_UndoCommandResult(pViewShell, ".uno:Redo", "ScUndoDeleteTab", 
&theTabs);
+lcl_OnTabsChanged(*pViewShell, rDoc, theTabs[0]);
+lcl_UndoCommandResult(*pViewShell, ".uno:Redo", "ScUndoDeleteTab", 
&theTabs);
 }
 
 //  SetTabNo(...,sal_True) for all views to sync with drawing layer pages
@@ -653,8 +653,8 @@ void ScUndoMoveTab::DoChange( bool bUndo ) const
 const auto newTabsMinIt = std::min_element(mpNewTabs->begin(), 
mpNewTabs->end());
 const auto oldTabsMinIt = std::min_element(mpOldTabs->begin(), 
mpOldTabs->end());
 SCTAB nTab = std::min(*newTabsMinIt, *oldTabsMinIt);
-lcl_OnTabsChanged(pViewShell, rDoc, nTab, true /* bInvalidateTiles */);
-lcl_UndoCommandResult(pViewShell, bUndo ? ".uno:Undo" : ".uno:Redo", 
"ScUndoMoveTab", mpOldTabs.get(), 

core.git: vcl/win

2024-05-24 Thread Caolán McNamara (via logerrit)
 vcl/win/gdi/salprn.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit da15cb3d111f65356726ee5ed15bd82c73d5ccce
Author: Caolán McNamara 
AuthorDate: Sat May 18 19:55:06 2024 +0100
Commit: Caolán McNamara 
CommitDate: Fri May 24 22:11:13 2024 +0200

use same pattern as elsewhere for consistency

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

diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx
index 6edcc9ac2938..b43c59e27473 100644
--- a/vcl/win/gdi/salprn.cxx
+++ b/vcl/win/gdi/salprn.cxx
@@ -164,9 +164,9 @@ void WinSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* 
pList )
 if ( nBytes )
 {
 PRINTER_INFO_4W* pWinInfo4 = 
static_cast(std::malloc( nBytes ));
+assert(pWinInfo4 && "Don't handle OOM conditions");
 if ( EnumPrintersW( PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, 
nullptr, 4, reinterpret_cast(pWinInfo4), nBytes, &nBytes, &nInfoPrn4 ) )
 {
-assert(pWinInfo4);
 for ( i = 0; i < nInfoPrn4; i++ )
 {
 std::unique_ptr pInfo(new 
SalPrinterQueueInfo);


core.git: sc/source

2024-05-24 Thread Noel Grandin (via logerrit)
 sc/source/filter/excel/xlroot.cxx |5 -
 sc/source/filter/inc/xlroot.hxx   |2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

New commits:
commit 137f423cc18e23f64b3b2bc6075c5f1581ac6537
Author: Noel Grandin 
AuthorDate: Wed May 22 16:40:31 2024 +0200
Commit: Noel Grandin 
CommitDate: Fri May 24 20:11:12 2024 +0200

tdf#161210 speedup loading large XLS (2)

shave 2% off time by inlining GetDoc which is quite hot

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

diff --git a/sc/source/filter/excel/xlroot.cxx 
b/sc/source/filter/excel/xlroot.cxx
index 836c08b3f5e4..593a4d1583da 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -286,11 +286,6 @@ rtl::Reference XclRoot::OpenStream(const 
OUString& rStrmName)
 return OpenStream( GetRootStorage(), rStrmName );
 }
 
-ScDocument& XclRoot::GetDoc() const
-{
-return mrData.mrDoc;
-}
-
 ScDocShell* XclRoot::GetDocShell() const
 {
 return GetDoc().GetDocumentShell();
diff --git a/sc/source/filter/inc/xlroot.hxx b/sc/source/filter/inc/xlroot.hxx
index aa86378416b4..603307fb3476 100644
--- a/sc/source/filter/inc/xlroot.hxx
+++ b/sc/source/filter/inc/xlroot.hxx
@@ -198,7 +198,7 @@ public:
 rtl::Reference OpenStream(const OUString& rStrmName) 
const;
 
 /** Returns reference to the destination document (import) or source 
document (export). */
-ScDocument& GetDoc() const;
+ScDocument& GetDoc() const { return mrData.mrDoc; }
 
 /** Returns the object shell of the Calc document. May be 0 (i.e. import 
from clipboard). */
 ScDocShell* GetDocShell() const;


core.git: sw/qa sw/source

2024-05-24 Thread László Németh (via logerrit)
 sw/qa/extras/uiwriter/uiwriter6.cxx |   63 
 sw/source/core/layout/flylay.cxx|   38 ++---
 2 files changed, 96 insertions(+), 5 deletions(-)

New commits:
commit 4da6f52f5fd164082fd42fc58fc7d31da567c924
Author: László Németh 
AuthorDate: Tue May 21 13:20:24 2024 +0200
Commit: László Németh 
CommitDate: Fri May 24 19:46:46 2024 +0200

tdf#161261 sw: fix lost size of image resized in fixed-height cell

A fixed-height cell can contain a bigger image, which is cropped by
cell boundaries. It was not possible to resize this image with a simple 
drag & drop, because its size changed to the cell size immediately.
Now it's possible, like MSO does.

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

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

diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx 
b/sw/qa/extras/uiwriter/uiwriter6.cxx
index fb3ecb357bcd..6322120748da 100644
--- a/sw/qa/extras/uiwriter/uiwriter6.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter6.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -1559,6 +1560,68 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf160836)
 CPPUNIT_ASSERT_EQUAL(tools::Long(1980), pCellA1->getFrameArea().Height());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf161261)
+{
+createSwDoc("tdf160842.fodt");
+SwDoc* pDoc = getSwDoc();
+CPPUNIT_ASSERT(pDoc);
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+CPPUNIT_ASSERT(pWrtShell);
+// the cursor is not in the table
+CPPUNIT_ASSERT(!pWrtShell->IsCursorInTable());
+
+SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+auto pPage = dynamic_cast(pLayout->Lower());
+CPPUNIT_ASSERT(pPage);
+const SwSortedObjs& rPageObjs = *pPage->GetSortedObjs();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rPageObjs.size());
+auto pPageFly = dynamic_cast(rPageObjs[0]);
+CPPUNIT_ASSERT(pPageFly);
+auto pTable = dynamic_cast(pPageFly->GetLower());
+CPPUNIT_ASSERT(pTable);
+auto pRow1 = pTable->GetLower();
+CPPUNIT_ASSERT(pRow1->IsRowFrame());
+auto pCellA1 = pRow1->GetLower();
+CPPUNIT_ASSERT(pCellA1);
+const SwRect& rCellA1Rect = pCellA1->getFrameArea();
+auto nRowHeight = rCellA1Rect.Height();
+
+// select image by clicking on it at the center of the upper cell
+Point ptFrom(rCellA1Rect.Left() + rCellA1Rect.Width() / 2, 
rCellA1Rect.Top() + nRowHeight / 2);
+vcl::Window& rEditWin = pDoc->GetDocShell()->GetView()->GetEditWin();
+Point aFrom = rEditWin.LogicToPixel(ptFrom);
+MouseEvent aClickEvent(aFrom, 1, MouseEventModifiers::SIMPLECLICK, 
MOUSE_LEFT);
+rEditWin.MouseButtonDown(aClickEvent);
+rEditWin.MouseButtonUp(aClickEvent);
+
+// Then make sure that the image is selected:
+SelectionType eType = pWrtShell->GetSelectionType();
+CPPUNIT_ASSERT_EQUAL(SelectionType::Graphic, eType);
+
+uno::Reference xShape = getShape(2);
+CPPUNIT_ASSERT(xShape.is());
+
+// zoom image by drag & drop using right bottom handle of the image
+const SwRect& rSelRect = pWrtShell->GetAnyCurRect(CurRectType::Frame);
+Point ptFromHandle(rSelRect.Right(), rSelRect.Bottom());
+Point aFromHandle = rEditWin.LogicToPixel(ptFromHandle);
+Point ptTo(rSelRect.Left() + rSelRect.Width() * 1.5, rSelRect.Top() + 
rSelRect.Height() * 1.5);
+Point aTo = rEditWin.LogicToPixel(ptTo);
+MouseEvent aClickEvent2(aFromHandle, 1, MouseEventModifiers::SIMPLECLICK, 
MOUSE_LEFT);
+rEditWin.MouseButtonDown(aClickEvent2);
+MouseEvent aClickEvent3(aTo, 0, MouseEventModifiers::SIMPLEMOVE, 
MOUSE_LEFT);
+rEditWin.MouseMove(aClickEvent3);
+rEditWin.MouseMove(aClickEvent3);
+MouseEvent aClickEvent4(aTo, 1, MouseEventModifiers::SIMPLECLICK, 
MOUSE_LEFT);
+rEditWin.MouseButtonUp(aClickEvent4);
+Scheduler::ProcessEventsToIdle();
+
+// Make sure image is greater than before, instead of minimizing it to the 
cell size
+// This was 8707 and 6509
+CPPUNIT_ASSERT_GREATER(sal_Int32(1), xShape->getSize().Width);
+CPPUNIT_ASSERT_GREATER(sal_Int32(8000), xShape->getSize().Height);
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf115132)
 {
 createSwDoc();
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 1a39b735d2d8..92ad07ba4481 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -1409,17 +1409,45 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect 
&rRect, bool bMove )
 {
 const SwFrame *pUp = pFly->GetAnchorFrame()->GetUpper();
 SwRectFnSet aRectFnSet(pFly->GetAnchorFrame());
+bool bOnlyCellFrame = pUp->IsCellFrame()

New Defects reported by Coverity Scan for LibreOffice

2024-05-24 Thread scan-admin
Hi,

Please find the latest report on new defect(s) introduced to LibreOffice found 
with Coverity Scan.

1 new defect(s) introduced to LibreOffice found with Coverity Scan.
2 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent 
build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)


** CID 1598442:(NULL_RETURNS)



*** CID 1598442:(NULL_RETURNS)
/sc/source/ui/undo/undotab.cxx: 478 in ScUndoDeleteTab::Redo()()
472 pViewShell->SetTabNo( lcl_GetVisibleTabBefore( rDoc, theTabs[0] 
), true );
473 }
474 
475 void ScUndoDeleteTab::Redo()
476 {
477 ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
>>> CID 1598442:(NULL_RETURNS)
>>> Dereferencing a pointer that might be "nullptr" "pViewShell" when 
>>> calling "SetTabNo".
478 pViewShell->SetTabNo( lcl_GetVisibleTabBefore( 
pDocShell->GetDocument(), theTabs.front() ) );
479 
480 RedoSdrUndoAction( pDrawUndo.get() );   // Draw Redo first
481 
482 pDocShell->SetInUndo( true );   //! BeginRedo
483 bDrawIsInUndo = true;
/sc/source/ui/undo/undotab.cxx: 494 in ScUndoDeleteTab::Redo()()
488 SetChangeTrack();
489 
490 if (comphelper::LibreOfficeKit::isActive() && !theTabs.empty())
491 {
492 ScDocument& rDoc = pDocShell->GetDocument();
493 lcl_OnTabsChanged(pViewShell, rDoc, theTabs[0]);
>>> CID 1598442:(NULL_RETURNS)
>>> Dereferencing a pointer that might be "nullptr" "pViewShell" when 
>>> calling "lcl_UndoCommandResult".
494 lcl_UndoCommandResult(pViewShell, ".uno:Redo", 
"ScUndoDeleteTab", &theTabs);
495 }
496 
497 //  SetTabNo(...,sal_True) for all views to sync with drawing layer 
pages
498 pDocShell->Broadcast( SfxHint( SfxHintId::ScForceSetTab ) );
499 }



To view the defects in Coverity Scan visit, 
https://u15810271.ct.sendgrid.net/ls/click?upn=u001.AxU2LYlgjL6eX23u9ErQy-2BKADyCpvUKOL6EWmZljiu6VvXBlQRUbS683tC8265rGNPXqJ1ffcoLZCnTuJFQbNcTEkb4XaEQkzovKhJ5DB3c-3D8GvR_A9M4dSy7guk8NP6DcfgslOyvJRzavztVIKj6nRqYjYpWom7SJFyX0y710bz0kUGtRs21SpJYxmEuHcCNhcR6c2tEPVHJ65guYKM4Ndwr1MNRYtDZQIeZ4FHqrwgR8A6a-2FMtHkLxB9P7Tg9BlmL8Gb9lHdjjuhjwxanr82a-2BkpDGYn65fZ6MLs77Qcl3YijxYNKlME2ihprY0BQiI4eijTqQqpdrlmTegCjwXIpHHorM-3D



core.git: helpcontent2

2024-05-24 Thread Adolfo Jayme Barrientos (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 293e3e683f98de949484c880147fee9a562c7df4
Author: Adolfo Jayme Barrientos 
AuthorDate: Fri May 24 10:31:58 2024 -0600
Commit: Gerrit Code Review 
CommitDate: Fri May 24 18:31:58 2024 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to f26ce1d963abdd6d0503d2f225abc9423a77ccdd
  - Fixups

Change-Id: I9b66bb7e7bf2e5cee67ad3e6f952a0b98afda66f
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/168025
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Jenkins

diff --git a/helpcontent2 b/helpcontent2
index 7fe9ae80c7df..f26ce1d963ab 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 7fe9ae80c7df68c70dae06b9d6002fbc42d1ab7e
+Subproject commit f26ce1d963abdd6d0503d2f225abc9423a77ccdd


help.git: source/text

2024-05-24 Thread Adolfo Jayme Barrientos (via logerrit)
 source/text/shared/01/01100100.xhp|2 +-
 source/text/shared/guide/start_parameters.xhp |5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit f26ce1d963abdd6d0503d2f225abc9423a77ccdd
Author: Adolfo Jayme Barrientos 
AuthorDate: Fri May 24 10:30:09 2024 -0600
Commit: Adolfo Jayme Barrientos 
CommitDate: Fri May 24 18:31:58 2024 +0200

Fixups

Change-Id: I9b66bb7e7bf2e5cee67ad3e6f952a0b98afda66f
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/168025
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Jenkins

diff --git a/source/text/shared/01/01100100.xhp 
b/source/text/shared/01/01100100.xhp
index b49ab07f9c..63d9828651 100644
--- a/source/text/shared/01/01100100.xhp
+++ b/source/text/shared/01/01100100.xhp
@@ -67,7 +67,7 @@
 
 
   Contributor
-  Enter the names of 
the people, organizations, or other entities that have made contributions to 
the document. For example he names of the authors of the document, or members 
of the team who contributed data.
+  Enter the names of 
the people, organizations, or other entities that have made contributions to 
the document. For example, the names of the document’s authors, or team members 
who contributed data to it.
   DCMI 
Definition: An entity responsible for making contributions to the 
resource.
 
 
diff --git a/source/text/shared/guide/start_parameters.xhp 
b/source/text/shared/guide/start_parameters.xhp
index 1740980581..9b0df08afa 100644
--- a/source/text/shared/guide/start_parameters.xhp
+++ b/source/text/shared/guide/start_parameters.xhp
@@ -533,11 +533,10 @@
 
 
 
---show[=slide_number]
+--show[=slide_number]
 
 
-
-Opens and starts the slideshow of the following presentation 
documents immediately. Files are closed after the showing. If a 
slide_number is provided, they start at that slide.
+Opens and starts the slideshow of the following presentation 
documents immediately. Files are closed after the showing. If a 
slide_number is provided, they start at that 
slide.
 
 
 


core.git: Branch 'distro/collabora/co-23.05' - sc/source

2024-05-24 Thread Henry Castro (via logerrit)
 sc/source/core/data/patattr.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit eb1064e121436df61a6fba827a8aa081022b16ca
Author: Henry Castro 
AuthorDate: Tue May 21 17:32:54 2024 -0400
Commit: Henry Castro 
CommitDate: Fri May 24 18:30:04 2024 +0200

lok: sc: fix print mode document back color

Signed-off-by: Henry Castro 
Change-Id: I334ff51230ef01d7a87790409a6d76541c57ba54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167911
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168021

diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 34cfa1c52175..2de19a4d952b 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -509,7 +509,8 @@ void ScPatternAttr::fillColor(model::ComplexColor& 
rComplexColor, const SfxItemS
 if (pViewShell)
 {
 const ScViewRenderingOptions& rViewRenderingOptions = 
pViewShell->GetViewRenderingData();
-aBackColor = rViewRenderingOptions.GetDocColor();
+aBackColor = eAutoMode == SC_AUTOCOL_PRINT ? COL_WHITE 
:
+rViewRenderingOptions.GetDocColor();
 }
 }
 }


core.git: sc/source

2024-05-24 Thread Noel Grandin (via logerrit)
 sc/source/filter/excel/xistyle.cxx |   33 -
 sc/source/filter/inc/xistyle.hxx   |4 ++--
 2 files changed, 18 insertions(+), 19 deletions(-)

New commits:
commit 397d7af2cbb1f2786ba857d350fb4641525e3bb2
Author: Noel Grandin 
AuthorDate: Wed May 22 15:03:40 2024 +0200
Commit: Noel Grandin 
CommitDate: Fri May 24 18:29:02 2024 +0200

tdf#161210 speedup loading large XLS

takes the time from 22s to 20s for me

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

diff --git a/sc/source/filter/excel/xistyle.cxx 
b/sc/source/filter/excel/xistyle.cxx
index 23db22d23ed8..00bc34c744bd 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -1724,7 +1724,7 @@ void XclImpXFRangeColumn::SetDefaultXF( const 
XclImpXFIndex& rXFIndex, const Xcl
 OSL_ENSURE( maIndexList.empty(), "XclImpXFRangeColumn::SetDefaultXF - 
Setting Default Column XF is not empty" );
 
 // insert a complete row range with one insert.
-maIndexList.push_back( std::make_unique( 0, 
rRoot.GetDoc().MaxRow(), rXFIndex ) );
+maIndexList.push_back( XclImpXFRange( 0, rRoot.GetDoc().MaxRow(), rXFIndex 
) );
 }
 
 void XclImpXFRangeColumn::SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex )
@@ -1748,7 +1748,7 @@ void XclImpXFRangeColumn::SetXF( SCROW nScRow, const 
XclImpXFIndex& rXFIndex )
 SCROW nLastScRow = pPrevRange->mnScRow2;
 sal_uLong nIndex = nNextIndex - 1;
 XclImpXFRange* pThisRange = pPrevRange;
-pPrevRange = (nIndex > 0 && nIndex <= maIndexList.size()) ? 
maIndexList[ nIndex - 1 ].get() : nullptr;
+pPrevRange = (nIndex > 0 && nIndex <= maIndexList.size()) ? 
&maIndexList[ nIndex - 1 ] : nullptr;
 
 if( nFirstScRow == nLastScRow ) // replace solely XF
 {
@@ -1761,20 +1761,20 @@ void XclImpXFRangeColumn::SetXF( SCROW nScRow, const 
XclImpXFIndex& rXFIndex )
 ++(pThisRange->mnScRow1);
 // try to concatenate with previous of this
 if( !pPrevRange || !pPrevRange->Expand( nScRow, rXFIndex ) )
-Insert( new XclImpXFRange( nScRow, rXFIndex ), nIndex );
+Insert( XclImpXFRange( nScRow, rXFIndex ), nIndex );
 }
 else if( nLastScRow == nScRow ) // replace last XF
 {
 --(pThisRange->mnScRow2);
 if( !pNextRange || !pNextRange->Expand( nScRow, rXFIndex ) )
-Insert( new XclImpXFRange( nScRow, rXFIndex ), nNextIndex 
);
+Insert( XclImpXFRange( nScRow, rXFIndex ), nNextIndex );
 }
 else// insert in the middle of 
the range
 {
 pThisRange->mnScRow1 = nScRow + 1;
 // List::Insert() moves entries towards end of list, so insert 
twice at nIndex
-Insert( new XclImpXFRange( nScRow, rXFIndex ), nIndex );
-Insert( new XclImpXFRange( nFirstScRow, nScRow - 1, 
pThisRange->maXFIndex ), nIndex );
+Insert( XclImpXFRange( nScRow, rXFIndex ), nIndex );
+Insert( XclImpXFRange( nFirstScRow, nScRow - 1, 
pThisRange->maXFIndex ), nIndex );
 }
 return;
 }
@@ -1790,12 +1790,12 @@ void XclImpXFRangeColumn::SetXF( SCROW nScRow, const 
XclImpXFIndex& rXFIndex )
 return;
 
 // create new range
-Insert( new XclImpXFRange( nScRow, rXFIndex ), nNextIndex );
+Insert( XclImpXFRange( nScRow, rXFIndex ), nNextIndex );
 }
 
-void XclImpXFRangeColumn::Insert(XclImpXFRange* pXFRange, sal_uLong nIndex)
+void XclImpXFRangeColumn::Insert(XclImpXFRange aXFRange, sal_uLong nIndex)
 {
-maIndexList.insert( maIndexList.begin() + nIndex, 
std::unique_ptr(pXFRange) );
+maIndexList.insert( maIndexList.begin() + nIndex, std::move(aXFRange) );
 }
 
 void XclImpXFRangeColumn::Find(
@@ -1811,8 +1811,8 @@ void XclImpXFRangeColumn::Find(
 return;
 }
 
-rpPrevRange = maIndexList.front().get();
-rpNextRange = maIndexList.back().get();
+rpPrevRange = &maIndexList.front();
+rpNextRange = &maIndexList.back();
 
 // test whether row is at end of list (contained in or behind last range)
 // rpPrevRange will contain a possible existing row
@@ -1843,7 +1843,7 @@ void XclImpXFRangeColumn::Find(
 while( ((rnNextIndex - nPrevIndex) > 1) && (rpPrevRange->mnScRow2 < 
nScRow) )
 {
 nMidIndex = (nPrevIndex + rnNextIndex) / 2;
-pMidRange = maIndexList[nMidIndex].get();
+pMidRange = &maIndexList[nMidIndex];
 assert(pMidRange && "XclImpXFRangeColumn::Find - missing XF index 
range");
 if( nScRow < pMidRange->mnScRow1 )  // row is really before 
pMidRange
 {
@@ -1861,7 +1861,7 @@ void XclImpXFRa

core.git: avmedia/source

2024-05-24 Thread Michael Weghorn (via logerrit)
 avmedia/source/qt6/QtPlayer.cxx |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 7960bd204bdecb73522c1eda6c101c40edda
Author: Michael Weghorn 
AuthorDate: Fri May 24 11:31:09 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 24 18:18:17 2024 +0200

tdf#145735 qt avmedia: Return video resolution for preferred win size

In `QtPlayer::getPreferredPlayerWindowSize`, retrieve the
video resolution from the meta data and return that for the
preferred window size if available, instead of always returning
an empty rect.

For the sample presentation referenced in tdf#145735,
the size retrieved this way also matches what
`GtkPlayer::getPreferredPlayerWindowSize` returns
(720x400).

As mentioned in

commit 441d8ed9be0e7f831b455a69b8688dcb79a8bc00
Author: Michael Weghorn 
Date:   Mon May 20 16:25:09 2024 +0200

tdf#145735 avmedia qt: Use QtMultimedia for Qt 6 media playback

, the behaviour without this was:

> * In non-presentation mode, the placeholder
>   shown until the video gets started using the controls
>   in the sidebar is just an "audio icon", not a frame
>   from the actual video. (This might be related to the
>   fact that `QtPlayer::createFrameGrabber` currently
>   returns an empty reference.)

With this in place, the placeholder is now a different
icon, a "video icon" (but still not a frame from the actual
video).

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

diff --git a/avmedia/source/qt6/QtPlayer.cxx b/avmedia/source/qt6/QtPlayer.cxx
index 1ad675f37d5c..5f75394ff1a3 100644
--- a/avmedia/source/qt6/QtPlayer.cxx
+++ b/avmedia/source/qt6/QtPlayer.cxx
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -178,8 +179,16 @@ awt::Size SAL_CALL QtPlayer::getPreferredPlayerWindowSize()
 {
 osl::MutexGuard aGuard(m_aMutex);
 
-awt::Size aSize(0, 0);
-return aSize;
+assert(m_xMediaPlayer);
+const QMediaMetaData aMetaData = m_xMediaPlayer->metaData();
+const QVariant aResolutionVariant = 
aMetaData.value(QMediaMetaData::Resolution);
+if (aResolutionVariant.canConvert())
+{
+const QSize aResolution = aResolutionVariant.value();
+return awt::Size(aResolution.width(), aResolution.height());
+}
+
+return awt::Size(0, 0);
 }
 
 uno::Reference<::media::XPlayerWindow>


core.git: vcl/qt5

2024-05-24 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtObject.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 81c94af71206013cb200f5612bc3bd61c799cf83
Author: Michael Weghorn 
AuthorDate: Fri May 24 11:16:17 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 24 18:17:58 2024 +0200

tdf#145735 qt: Set margins for video widget/layout to 0

Set all of the content margins of the layout that
holds the widget for video playback to 0.

Quoting [1]:

> Sets the left, top, right, and bottom margins to use around the layout.
>
> By default, QLayout uses the values provided by the style. On most 
platforms,
> the margin is 11 pixels in all directions.

This makes the odd margin/frame shown around the video
on video playback mentioned in

commit 441d8ed9be0e7f831b455a69b8688dcb79a8bc00
Author: Michael Weghorn 
Date:   Mon May 20 16:25:09 2024 +0200

tdf#145735 avmedia qt: Use QtMultimedia for Qt 6 media playback

disappear.

[1] https://doc.qt.io/qt-6/qlayout.html#setContentsMargins

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

diff --git a/vcl/qt5/QtObject.cxx b/vcl/qt5/QtObject.cxx
index cd133e095ff5..bde8b570ac2e 100644
--- a/vcl/qt5/QtObject.cxx
+++ b/vcl/qt5/QtObject.cxx
@@ -115,6 +115,7 @@ QtObjectWidget::QtObjectWidget(QtObject& rParent)
 
 // set layout, used for video playback, see QtPlayer::createPlayerWindow
 QVBoxLayout* layout = new QVBoxLayout;
+layout->setContentsMargins(0, 0, 0, 0);
 setLayout(layout);
 }
 


core.git: sd/source

2024-05-24 Thread Sarper Akdemir (via logerrit)
 sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx |   30 
--
 1 file changed, 26 insertions(+), 4 deletions(-)

New commits:
commit a50b13f357ffa403542a09de0552c048d6374011
Author: Sarper Akdemir 
AuthorDate: Fri May 24 15:11:24 2024 +0200
Commit: Sarper Akdemir 
CommitDate: Fri May 24 18:03:28 2024 +0200

related tdf#33603: update current page on SlideSorter view

Make SlideSorterView update the current page properly when it is the
MainViewShell.

Also fixes Notes Pane not properly updating on SlideSorter
view mode.

Change-Id: If4fed4e84951cb4a1707874b288ac46e6d5c26da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168022
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx 
b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
index e8fc847a4a7b..684cb2da5f7e 100644
--- a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
@@ -28,6 +28,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -166,7 +168,29 @@ void CurrentSlideManager::SetCurrentSlideAtViewShellBase 
(const SharedPageDescri
 OSL_ASSERT(rpDescriptor);
 
 ViewShellBase* pBase = mrSlideSorter.GetViewShellBase();
-if (pBase != nullptr)
+if(!pBase)
+return;
+
+if (mrSlideSorter.GetViewShell() && 
mrSlideSorter.GetViewShell()->IsMainViewShell())
+{
+SdDrawDocument* pDoc = pBase->GetDocument();
+if (!pDoc)
+return;
+
+// deselect all pages
+for (sal_uInt16 i = 0; i < pDoc->GetSdPageCount(PageKind::Standard); 
i++)
+pDoc->SetSelected(pDoc->GetSdPage(i, PageKind::Standard), false);
+
+// select the given page
+pDoc->SetSelected(rpDescriptor->GetPage(), true);
+DrawController* pDrawController = pBase->GetDrawController();
+if (!pDrawController)
+return;
+
+pDrawController->FireSelectionChangeListener();
+pDrawController->FireSwitchCurrentPage(rpDescriptor->GetPage());
+}
+else
 {
 DrawViewShell* pDrawViewShell = dynamic_cast(
 pBase->GetMainViewShell().get());
@@ -245,9 +269,7 @@ IMPL_LINK_NOARG(CurrentSlideManager, SwitchPageCallback, 
Timer *, void)
 // it does not work always correctly (after some kinds of model
 // changes).  Therefore, we call DrawViewShell::SwitchPage(),
 // too.
-ViewShell* pViewShell = mrSlideSorter.GetViewShell();
-if (pViewShell==nullptr || ! pViewShell->IsMainViewShell())
-SetCurrentSlideAtViewShellBase(mpCurrentSlide);
+SetCurrentSlideAtViewShellBase(mpCurrentSlide);
 SetCurrentSlideAtXController(mpCurrentSlide);
 }
 }


core.git: sw/CppunitTest_sw_writerfilter_dmapper.mk sw/CppunitTest_sw_writerfilter_filter.mk sw/CppunitTest_sw_writerfilter_filters_test.mk sw/CppunitTest_sw_writerfilter_misc.mk sw/CppunitTest_sw_wri

2024-05-24 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_writerfilter_dmapper.mk   |   22 
 sw/CppunitTest_sw_writerfilter_filter.mk|2 -
 sw/CppunitTest_sw_writerfilter_filters_test.mk  |2 -
 sw/CppunitTest_sw_writerfilter_misc.mk  |2 -
 sw/CppunitTest_sw_writerfilter_ooxml.mk |2 -
 sw/CppunitTest_sw_writerfilter_rtftok.mk|   14 +-
 sw/qa/writerfilter/dmapper/CellColorHandler.cxx |2 -
 sw/qa/writerfilter/dmapper/DomainMapper.cxx |2 -
 sw/qa/writerfilter/dmapper/DomainMapperTableHandler.cxx |2 -
 sw/qa/writerfilter/dmapper/DomainMapperTableManager.cxx |2 -
 sw/qa/writerfilter/dmapper/DomainMapper_Impl.cxx|2 -
 sw/qa/writerfilter/dmapper/GraphicImport.cxx|2 -
 sw/qa/writerfilter/dmapper/PropertyMap.cxx  |2 -
 sw/qa/writerfilter/dmapper/SdtHelper.cxx|2 -
 sw/qa/writerfilter/dmapper/SettingsTable.cxx|2 -
 sw/qa/writerfilter/dmapper/TableManager.cxx |2 -
 sw/qa/writerfilter/dmapper/TextEffectsHandler.cxx   |2 -
 sw/qa/writerfilter/filter/WriterFilter.cxx  |2 -
 sw/qa/writerfilter/filters-test/filters-test.cxx|3 --
 sw/qa/writerfilter/ooxml/ooxml.cxx  |2 -
 sw/qa/writerfilter/rtftok/rtfdispatchflag.cxx   |2 -
 sw/qa/writerfilter/rtftok/rtfdispatchsymbol.cxx |2 -
 sw/qa/writerfilter/rtftok/rtfdispatchvalue.cxx  |2 -
 sw/qa/writerfilter/rtftok/rtfdocumentimpl.cxx   |2 -
 sw/qa/writerfilter/rtftok/rtfsdrimport.cxx  |2 -
 sw/qa/writerfilter/rtftok/rtfsprm.cxx   |2 -
 sw/qa/writerfilter/rtftok/rtftokenizer.cxx  |2 -
 27 files changed, 43 insertions(+), 44 deletions(-)

New commits:
commit 8112883acf0015066f21dece7e1109dbda3e4cae
Author: Miklos Vajna 
AuthorDate: Fri May 24 16:07:55 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 24 17:34:09 2024 +0200

sw qa: rename writerfilter/cppunittests to just writerfilter

15:47  noelgrandin: any objections to go further with your 
writerfilter rename and turn sw/qa/writerfilter/cppunittests/* into 
sw/qa/writerfilter/* ? (suggest to either do it now or not at all if we're past 
the libreoffice-24-8 branch-off)
15:59  vmiklos, not at all, go for it

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

diff --git a/sw/CppunitTest_sw_writerfilter_dmapper.mk 
b/sw/CppunitTest_sw_writerfilter_dmapper.mk
index ecae5cf7db7e..d865706c2b50 100644
--- a/sw/CppunitTest_sw_writerfilter_dmapper.mk
+++ b/sw/CppunitTest_sw_writerfilter_dmapper.mk
@@ -17,17 +17,17 @@ $(eval $(call 
gb_CppunitTest_use_externals,sw_writerfilter_dmapper,\
 ))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,sw_writerfilter_dmapper, \
-sw/qa/writerfilter/cppunittests/dmapper/CellColorHandler \
-sw/qa/writerfilter/cppunittests/dmapper/DomainMapperTableHandler \
-sw/qa/writerfilter/cppunittests/dmapper/DomainMapperTableManager \
-sw/qa/writerfilter/cppunittests/dmapper/DomainMapper \
-sw/qa/writerfilter/cppunittests/dmapper/DomainMapper_Impl \
-sw/qa/writerfilter/cppunittests/dmapper/GraphicImport \
-sw/qa/writerfilter/cppunittests/dmapper/TableManager \
-sw/qa/writerfilter/cppunittests/dmapper/TextEffectsHandler \
-sw/qa/writerfilter/cppunittests/dmapper/PropertyMap \
-sw/qa/writerfilter/cppunittests/dmapper/SdtHelper \
-sw/qa/writerfilter/cppunittests/dmapper/SettingsTable \
+sw/qa/writerfilter/dmapper/CellColorHandler \
+sw/qa/writerfilter/dmapper/DomainMapperTableHandler \
+sw/qa/writerfilter/dmapper/DomainMapperTableManager \
+sw/qa/writerfilter/dmapper/DomainMapper \
+sw/qa/writerfilter/dmapper/DomainMapper_Impl \
+sw/qa/writerfilter/dmapper/GraphicImport \
+sw/qa/writerfilter/dmapper/TableManager \
+sw/qa/writerfilter/dmapper/TextEffectsHandler \
+sw/qa/writerfilter/dmapper/PropertyMap \
+sw/qa/writerfilter/dmapper/SdtHelper \
+sw/qa/writerfilter/dmapper/SettingsTable \
 ))
 
 $(eval $(call gb_CppunitTest_use_libraries,sw_writerfilter_dmapper, \
diff --git a/sw/CppunitTest_sw_writerfilter_filter.mk 
b/sw/CppunitTest_sw_writerfilter_filter.mk
index ad61c66f1ed4..e627d43d2180 100644
--- a/sw/CppunitTest_sw_writerfilter_filter.mk
+++ b/sw/CppunitTest_sw_writerfilter_filter.mk
@@ -17,7 +17,7 @@ $(eval $(call 
gb_CppunitTest_use_externals,sw_writerfilter_filter,\
 ))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,sw_writerfilter_filter, \
-sw/qa/writerfilter/cppunittests/filter/WriterFilter \
+sw/qa/writerfilter/filter/WriterFilter \
 ))
 
 $(eval $(call gb_CppunitTest_use_libraries,sw_writerfilter_filter, \
diff --git a/sw/CppunitTest_sw_writerfilter_filters_test.mk 
b/sw/CppunitTe

core.git: vcl/win

2024-05-24 Thread Caolán McNamara (via logerrit)
 vcl/win/dtrans/APNDataObject.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c88ce0eb999f86ecde956c9444d9970b73e70551
Author: Caolán McNamara 
AuthorDate: Fri May 24 13:57:13 2024 +0100
Commit: Caolán McNamara 
CommitDate: Fri May 24 17:14:13 2024 +0200

fix up assert

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

diff --git a/vcl/win/dtrans/APNDataObject.cxx b/vcl/win/dtrans/APNDataObject.cxx
index e13561a87bc3..47dd481080b9 100644
--- a/vcl/win/dtrans/APNDataObject.cxx
+++ b/vcl/win/dtrans/APNDataObject.cxx
@@ -296,7 +296,7 @@ STDMETHODIMP CAPNDataObject::EnumDAdvise( IEnumSTATDATA ** 
ppenumAdvise )
 
 HRESULT CAPNDataObject::MarshalIDataObjectIntoCurrentApartment( IDataObject** 
ppIDataObj )
 {
-assert(nullptr && ppIDataObj);
+assert(ppIDataObj);
 
 *ppIDataObj = nullptr;
 HRESULT hr = E_FAIL;


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 &rInf ) 
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, &aMarker);
-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, &aMarker);
+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 &rInf )
 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/sou

core.git: sc/source

2024-05-24 Thread Mike Kaganski (via logerrit)
 sc/source/core/data/column2.cxx |   51 
 1 file changed, 31 insertions(+), 20 deletions(-)

New commits:
commit 98dd23286a09e10830c1103039dca5609e8c73a9
Author: Mike Kaganski 
AuthorDate: Fri May 24 14:46:05 2024 +0500
Commit: Mike Kaganski 
CommitDate: Fri May 24 15:58:37 2024 +0200

Avoid more cases of unneeded GetTextWidth

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

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index e62ac56a1e14..2b0a88aef220 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -307,26 +307,33 @@ tools::Long ScColumn::GetNeededSize(
 {
 //  SetFont is moved up
 
-Size aSize;
+tools::Long nWidth = 0;
 if ( eOrient != SvxCellOrientation::Standard )
 {
-aSize = Size( pDev->GetTextWidth( aValStr ), 
pDev->GetTextHeight() );
-tools::Long nTemp = aSize.Width();
-aSize.setWidth( aSize.Height() );
-aSize.setHeight( nTemp );
+nWidth = pDev->GetTextHeight();
 }
 else if ( nRotate )
 {
 //TODO: take different X/Y scaling into consideration
 
-aSize = Size( pDev->GetTextWidth( aValStr ), 
pDev->GetTextHeight() );
+// avoid calling the expensive GetTextWidth when not needed
+auto TextWidth = [&, w = std::optional()]() 
mutable
+{
+if (!w)
+w = pDev->GetTextWidth(aValStr);
+return *w;
+};
+auto TextHeight = [&, h = std::optional()]() 
mutable
+{
+if (!h)
+h = pDev->GetTextHeight();
+return *h;
+};
 double nRealOrient = toRadians(nRotate);
 double nCosAbs = fabs( cos( nRealOrient ) );
 double nSinAbs = fabs( sin( nRealOrient ) );
-tools::Long nHeight = static_cast( aSize.Height() 
* nCosAbs + aSize.Width() * nSinAbs );
-tools::Long nWidth;
 if ( eRotMode == SVX_ROTATE_MODE_STANDARD )
-nWidth  = static_cast( aSize.Width() * 
nCosAbs + aSize.Height() * nSinAbs );
+nWidth  = static_cast( TextWidth() * nCosAbs 
+ TextHeight() * nSinAbs );
 else if ( rOptions.bTotalSize )
 {
 nWidth = conditionalScaleFunc(rDocument.GetColWidth( 
nCol,nTab ), nPPT);
@@ -338,21 +345,25 @@ tools::Long ScColumn::GetNeededSize(
 (bInPrintTwips ? 1.0 : nPPT) * 
nCosAbs / nSinAbs );
 }
 else
-nWidth  = static_cast( aSize.Height() / 
nSinAbs );   //TODO: limit?
+nWidth  = static_cast( TextHeight() / nSinAbs 
);   //TODO: limit?
 
-if ( bBreak && !rOptions.bTotalSize )
+if (bWidth)
+nValue = nWidth;
+else
 {
-//  limit size for line break
-tools::Long nCmp = pDev->GetFont().GetFontSize().Height() 
* SC_ROT_BREAK_FACTOR;
-if ( nHeight > nCmp )
-nHeight = nCmp;
+tools::Long nHeight = static_cast( 
TextHeight() * nCosAbs + TextWidth() * nSinAbs );
+if ( bBreak && !rOptions.bTotalSize )
+{
+//  limit size for line break
+tools::Long nCmp = 
pDev->GetFont().GetFontSize().Height() * SC_ROT_BREAK_FACTOR;
+if ( nHeight > nCmp )
+nHeight = nCmp;
+}
+nValue = nHeight;
 }
-
-aSize = Size( nWidth, nHeight );
-nValue = bWidth ? aSize.Width() : aSize.Height();
 }
 else if (bBreak && !bWidth)
-aSize = Size( pDev->GetTextWidth( aValStr ), 
pDev->GetTextHeight() );
+nWidth = pDev->GetTextWidth(aValStr);
 else
 // in the common case (height), avoid calling the expensive 
GetTextWidth
 nValue = bWidth ? pDev->GetTextWidth( aValStr ) : 
pDev->GetTextHeight();
@@ -382,7 +393,7 @@ tools::Long ScColumn::GetNeededSize(
 pMargin->GetLeftMargin() - 
pMargin->GetRightMargin() -
 nIndent), nPPTX);
 nDocSize = (nDocSize * 9) / 10;   // for safety
-if ( aSize.Width() > nDocSize )
+if (nWidth > nDocSize)
 bEditEn

core.git: sd/source

2024-05-24 Thread Sarper Akdemir (via logerrit)
 sd/source/ui/func/fuoltext.cxx |   25 +
 1 file changed, 1 insertion(+), 24 deletions(-)

New commits:
commit 8fc4eb1149e58ed5bcc4bb2b57807cdc92d93785
Author: Sarper Akdemir 
AuthorDate: Fri May 24 12:06:08 2024 +0200
Commit: Sarper Akdemir 
CommitDate: Fri May 24 15:18:29 2024 +0200

related tdf#33603: sd: outlineview: update current page on moving cursor

The "early rejection test" removed here is a historical
artifact when UpdateForKeyPress was created.

in the current state it checked if
pOutlineViewShell->GetActualPage() was different from
itself.

In the OutlineViewShell::UpdatePreview, there's an
additional check if we have actually moved to a new page, so
we can just safely remove this.

Also fixes Notes Pane not properly updating on Outline View Mode

Change-Id: Ic9de2e7302e76260809f90360533f0bfe6e05d2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168017
Reviewed-by: Sarper Akdemir 
Tested-by: Jenkins

diff --git a/sd/source/ui/func/fuoltext.cxx b/sd/source/ui/func/fuoltext.cxx
index 0068f77d4053..6cebc1c55cb4 100644
--- a/sd/source/ui/func/fuoltext.cxx
+++ b/sd/source/ui/func/fuoltext.cxx
@@ -85,30 +85,7 @@ const sal_uInt16 SidArray[] = {
 void FuOutlineText::UpdateForKeyPress (const KeyEvent& rEvent)
 {
 FuSimpleOutlinerText::UpdateForKeyPress(rEvent);
-
-bool bUpdatePreview = true;
-switch (rEvent.GetKeyCode().GetCode())
-{
-// When just the cursor has been moved the preview only changes when
-// it moved to entries of another page.  To prevent unnecessary
-// updates we check this here.  This is an early rejection test, so
-// missing a key is not a problem.
-case KEY_UP:
-case KEY_DOWN:
-case KEY_LEFT:
-case KEY_RIGHT:
-case KEY_HOME:
-case KEY_END:
-case KEY_PAGEUP:
-case KEY_PAGEDOWN:
-{
-SdPage* pCurrentPage = pOutlineViewShell->GetActualPage();
-bUpdatePreview = (pCurrentPage != 
pOutlineViewShell->GetActualPage());
-}
-break;
-}
-if (bUpdatePreview)
-pOutlineViewShell->UpdatePreview (pOutlineViewShell->GetActualPage());
+pOutlineViewShell->UpdatePreview(pOutlineViewShell->GetActualPage());
 }
 
 /**


core.git: sd/source

2024-05-24 Thread Sarper Akdemir (via logerrit)
 sd/source/ui/view/NotesPanelViewShell.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit dc208a0de04b29a53fe8384043f1fc925761a912
Author: Sarper Akdemir 
AuthorDate: Fri May 24 10:41:08 2024 +0200
Commit: Sarper Akdemir 
CommitDate: Fri May 24 15:18:11 2024 +0200

tdf#33603: sd: notes pane: properly handle movement keys

Makes it so that notes pane handles some previously
incorrectly handled keys itself. e.g. PageUp & PageDown

Change-Id: I19f73fa2782900a752889544dcc79fc180ee52d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168008
Reviewed-by: Sarper Akdemir 
Tested-by: Jenkins

diff --git a/sd/source/ui/view/NotesPanelViewShell.cxx 
b/sd/source/ui/view/NotesPanelViewShell.cxx
index 6bccc766b7cb..a34660280459 100644
--- a/sd/source/ui/view/NotesPanelViewShell.cxx
+++ b/sd/source/ui/view/NotesPanelViewShell.cxx
@@ -1417,7 +1417,7 @@ bool NotesPanelViewShell::KeyInput(const KeyEvent& rKEvt, 
::sd::Window* pWin)
 {
 bool bReturn = false;
 
-if (pWin == nullptr && HasCurrentFunction())
+if (HasCurrentFunction())
 {
 bReturn = GetCurrentFunction()->KeyInput(rKEvt);
 }
@@ -1436,7 +1436,6 @@ bool NotesPanelViewShell::KeyInput(const KeyEvent& rKEvt, 
::sd::Window* pWin)
 Invalidate(SID_STYLE_WATERCAN);
 Invalidate(SID_STYLE_FAMILY5);
 
-vcl::KeyCode aKeyGroup(rKEvt.GetKeyCode().GetGroup());
 return bReturn;
 }
 


core.git: Branch 'distro/collabora/co-24.04' - sc/qa sc/source

2024-05-24 Thread Jaume Pujantell (via logerrit)
 sc/qa/unit/tiledrendering/data/right-aligned-with-overflow.ods |binary
 sc/qa/unit/tiledrendering/tiledrendering.cxx   |   28 
++
 sc/source/ui/view/tabview3.cxx |5 +
 3 files changed, 31 insertions(+), 2 deletions(-)

New commits:
commit 3009eebbad4b1d9883a68066d758a67eeaf3c379
Author: Jaume Pujantell 
AuthorDate: Thu May 23 15:30:42 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 24 14:24:33 2024 +0200

sc: don't overwrite Special Positioning on MakeEditView

On LOK, calling UpdateEditPos after SetEditEngine overwrote the outer area
of mpLOKSpecialPositioning, making the text show on the wrong position on
right alined cells with overflowing content.

Changing the order of the calls fixes that.

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

diff --git a/sc/qa/unit/tiledrendering/data/right-aligned-with-overflow.ods 
b/sc/qa/unit/tiledrendering/data/right-aligned-with-overflow.ods
new file mode 100644
index ..6a32fdc579c2
Binary files /dev/null and 
b/sc/qa/unit/tiledrendering/data/right-aligned-with-overflow.ods differ
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 17048a4ca8df..a29abeb1ac00 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -4007,6 +4007,34 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testNumberFormatLocaleMultiUser)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testLeftOverflowEdit)
+{
+
comphelper::LibreOfficeKit::setCompatFlag(comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs);
+ScModelObj* pModelObj = createDoc("right-aligned-with-overflow.ods");
+ViewCallback aView;
+
+// Go to Cell B5000
+uno::Sequence aPropertyValues = {
+comphelper::makePropertyValue("ToPoint", OUString("$B$5000")),
+};
+dispatchCommand(mxComponent, ".uno:GoToCell", aPropertyValues);
+
+// Enter edit mode and select all text.
+aView.m_aTextSelectionResult.clear();
+pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::F2);
+pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::F2);
+Scheduler::ProcessEventsToIdle();
+// CTRL + A
+pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_MOD1 | awt::Key::A);
+pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_MOD1 | awt::Key::A);
+Scheduler::ProcessEventsToIdle();
+
+// Without the accompanying fix this would fail with
+// - Expected: 20
+// - Actual  : 1300
+CPPUNIT_ASSERT_EQUAL(tools::Long(20), 
aView.m_aTextSelectionResult.m_aRefPoint.getX());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 8345ba9f42d0..602256a34900 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -2211,14 +2211,15 @@ void ScTabView::MakeEditView( ScEditEngineDefaulter* 
pEngine, SCCOL nCol, SCROW
 // MapMode must be set after HideCursor
 pGridWin[i]->SetMapMode(aViewData.GetLogicMode());
 
-aViewData.SetEditEngine( static_cast(i), pEngine, 
pGridWin[i], nCol, nRow );
-
 if ( !bPosVisible )
 {
 //  move the edit view area to the real (possibly 
negative) position,
 //  or hide if completely above or left of the window
 pGridWin[i]->UpdateEditViewPos();
 }
+
+aViewData.SetEditEngine(static_cast(i), pEngine, 
pGridWin[i], nCol,
+nRow);
 }
 }
 }


core.git: sw/inc sw/source

2024-05-24 Thread Miklos Vajna (via logerrit)
 sw/inc/contentindex.hxx|2 +-
 sw/source/core/txtnode/ndtxt.cxx   |2 +-
 sw/source/core/unocore/unotext.cxx |4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 6de49dee825c6bd093007b4c954f97812c3fdb47
Author: Miklos Vajna 
AuthorDate: Fri May 24 13:09:36 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 24 14:22:07 2024 +0200

sw: rename SwIndex to SwContentIndex in comments

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

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

diff --git a/sw/inc/contentindex.hxx b/sw/inc/contentindex.hxx
index 873e1512ca4f..ea54b1c052a2 100644
--- a/sw/inc/contentindex.hxx
+++ b/sw/inc/contentindex.hxx
@@ -44,7 +44,7 @@ private:
 SwContentIndex * m_pNext;
 SwContentIndex * m_pPrev;
 
-/// points to the SwRangeRedline (if any) that contains this SwIndex, via 
SwPosition and SwPaM
+/// points to the SwRangeRedline (if any) that contains this 
SwContentIndex, via SwPosition and SwPaM
 SwRangeRedline * m_pRangeRedline = nullptr;
 
 /// Pointer to a mark that owns this position to allow fast lookup of 
marks of an SwContentIndexReg.
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 34619f0c7dfb..1d71a1cd8169 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1455,7 +1455,7 @@ void SwTextNode::Update(
 if (!(eMode & UpdateMode::Negative) && !(eMode & UpdateMode::Delete))
 {
 std::vector vMyRedlines;
-// walk the list of SwIndex attached to me and see if any of them are 
redlines
+// walk the list of SwContentIndex attached to me and see if any of 
them are redlines
 const SwContentIndex* pContentNodeIndex = GetFirstIndex();
 while (pContentNodeIndex)
 {
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index 50d9f75db63f..39b2016335ba 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1579,7 +1579,7 @@ SwXText::convertToTextFrame(
 (pStartStartNode != GetStartNode()))
 {
 // if not - remove the additional paragraphs and throw
-oAnchorCheckPam.reset(); // clear SwIndex before deleting nodes
+oAnchorCheckPam.reset(); // clear SwContentIndex before deleting 
nodes
 if (bParaBeforeInserted)
 {
 SwCursor aDelete(*pStartPam->GetPoint(), nullptr);
@@ -1653,7 +1653,7 @@ SwXText::convertToTextFrame(
 }
 }
 }
-oAnchorCheckPam.reset(); // clear SwIndex before deleting nodes
+oAnchorCheckPam.reset(); // clear SwContentIndex before deleting nodes
 
 const rtl::Reference xNewFrame =
 SwXTextFrame::CreateXTextFrame(*m_pImpl->m_pDoc, nullptr);


core.git: sw/qa sw/source

2024-05-24 Thread Miklos Vajna (via logerrit)
 sw/qa/uitest/data/keep-aspect-ratio.odt |binary
 sw/qa/uitest/ui/frmdlg/frmdlg.py|   20 
 sw/source/ui/frmdlg/frmpage.cxx |6 +-
 sw/source/uibase/inc/frmpage.hxx|1 +
 4 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit a3150fc8a59662ce8630cfc64fec9cd083ac7d36
Author: Miklos Vajna 
AuthorDate: Fri May 24 12:06:55 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 24 13:58:07 2024 +0200

tdf#145972 sw image dialog: fix bad rel width w/ pt units and kept aspect 
ratio

Regression from commit 02c435082058ecf7f9d4d73cb47d31d0218dc10d (sw keep
aspect ratio: add filter for this setting, 2021-06-07), once UI units
are set to poins (instead of cms), the image dialog for the bugdoc was
showing 5% width instead of 48%.

48% is roughtly correct, visually the image is taking half of the body
frame width. Previously the bad rel size didn't happen because we didn't
save the "keep aspect ratio" to documents, so it was off by the time the
dialog was initialized.

Fix the problem by introducing a new flag, so we can differentiate
between the user changine the width or height vs the dialog being
initialized. RelSizeClickHdl() is meant to adjust the other axis in the
user case, and this is not wanted in the init case.

A higher level fix would be to make sure once aspect ratio is kept,
that ratio is stored in documents explicitly, so we can say 50% wide
with e.g. 4:3 ratio, that would avoid all this trouble by even looking
at the calculated sizes when we want to work with percents. This storing
of the aspect ratio is not done here.

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

diff --git a/sw/qa/uitest/data/keep-aspect-ratio.odt 
b/sw/qa/uitest/data/keep-aspect-ratio.odt
new file mode 100644
index ..2545b34e91f7
Binary files /dev/null and b/sw/qa/uitest/data/keep-aspect-ratio.odt differ
diff --git a/sw/qa/uitest/ui/frmdlg/frmdlg.py b/sw/qa/uitest/ui/frmdlg/frmdlg.py
index aa2d4fba7aff..a37062c1d392 100644
--- a/sw/qa/uitest/ui/frmdlg/frmdlg.py
+++ b/sw/qa/uitest/ui/frmdlg/frmdlg.py
@@ -150,4 +150,24 @@ class Test(UITestCase):
 # complexity.
 self.assertEqual(visible, "false")
 
+def test_keep_aspect_ratio_init(self):
+# Change from inch to pt to hit the rounding error. 6 means Point, see
+# officecfg/registry/schema/org/openoffice/Office/Writer.xcs.
+with 
self.ui_test.set_config('/org.openoffice.Office.Writer/Layout/Other/MeasureUnit',
 6):
+# Given a document with an image, width is relative:
+with 
self.ui_test.load_file(get_url_for_data_file("keep-aspect-ratio.odt")) as 
xComponent:
+xComponent.CurrentController.select(xComponent.DrawPage[0])
+# Wait until SwTextShell is replaced with SwDrawShell after 
120 ms, as set in the SwView
+# ctor.
+time.sleep(0.2)
+# When opening the image properties dialog:
+with 
self.ui_test.execute_dialog_through_command(".uno:FrameDialog") as xDialog:
+xWidth = xDialog.getChild("width")
+frame_width = get_state_as_dict(xWidth)["Value"]
+# Then make sure the width is 48%:
+# Without the accompanying fix in place, this test would have 
failed with:
+# AssertionError: '5' != '48'
+# i.e. the reported size was close to zero instead of ~half of 
the page width.
+self.assertEqual(frame_width, "48")
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 589af7dbb0a0..bd58f2ab7246 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2182,7 +2182,7 @@ IMPL_LINK( SwFramePage, ModifyHdl, 
weld::MetricSpinButton&, rEdit, void )
 {
 SwTwips nWidth  = static_cast< SwTwips 
>(m_xWidthED->DenormalizePercent(m_xWidthED->get_value(FieldUnit::TWIP)));
 SwTwips nHeight = static_cast< SwTwips 
>(m_xHeightED->DenormalizePercent(m_xHeightED->get_value(FieldUnit::TWIP)));
-if (m_xFixedRatioCB->get_active())
+if (m_xFixedRatioCB->get_active() && !m_bIgnoreFixedRatio)
 {
 if (&rEdit == m_xWidthED->get())
 {
@@ -2385,14 +2385,18 @@ void SwFramePage::Init(const SfxItemSet& rSet)
 !m_xRelWidthCB->get_active())
 {
 m_xRelWidthCB->set_active(true);
+m_bIgnoreFixedRatio = true;
 RelSizeClickHdl(*m_xRelWidthCB);
+m_bIgnoreFixedRatio = false;
 m_xWidthED->set_value(rSize.GetWidthPercent(), FieldUnit::PERCENT);
 }
 if (rSize.GetHeightPercent() && rSize.GetHeightPercent() != 
SwFormatFrameSize::SYNCED &&
 !m_x

Re: GSoC: Libreoffice Theme (week - 1 update)

2024-05-24 Thread Sahil Gautam

Hi,the WIP prototype patch is linked in the sources below.
I created an extension and found that we can overwrite the expert configuration 
from
the extension. Then I searched on the web for what options do these toolkits 
provide in
terms of styling. For gtk, the only option that I found was to go via the CSS 
route, meaning
that one has to create either a CSS file, or a CSS string, load it into a 
GtkCssProvider(StyleProvider),
and add the provider to the GdkScreen. For QT/kf5 I am supposed to create a 
derived class of QStyle
and change the drawing behaviour for the widgets there. The youtube tutorial 
explains it well, but I
am yet to test it properly (my lsp was having some issues).

I added an entry under tools > options > application colors for changing the 
menubar color, and it works
in gtk. But it works only when one goes to tools > options > applic... and 
changes it on the spot.
On startup, the colors are washed away for some reason.

The various vclplugins communicate with the configuration via `AllSettings` 
which are passed to
the various `updateSettings(...)` functions. I tried using  `Color aColor = 
svtools::ColorConfig::GetDefaultColor(svtools::MENUBARBACKGROUND);`
but got linking errors. Meaning that the only way  of exchaning information 
with the toolkits is `AllSettings.StyleSettings().getcolor()`,
Please share if you know of any other ways to access the expert config colors 
in VCLs. I have been searching for the central AllSettings/
StyleSettings object, but didn't find it yet.

The `ColorConfig` class seems to be the central structure for accessing/modifying the 
tools > options > App Colors, but I found
not a single instance of it in the VCL. Also there are some questions that I am 
 trying to find the answer to first, like

- how is the central StyleSettings object (part of AllSettings) is 
communicating with expert configuration.
- why is my  lsp suddenly broken in qt source files :)


- A little frustrated --

Woring in VCL and colorcfg with a 4 core i5 laptop is a bad idea. And this was 
the major setback that I faced.
I couldn't just change something like add a new function and test it quickly. 
Compiling it took an hour or more,
and by then my brain's cache was cleared. So within this week, I am building a 
computer with 7950x.
I have ccache --max-size= 200G, still 4 cores!!

I had some college exams this month + the slow PC. I tried working on something 
else while the program compiles,
but that doesn't help as it takes 30 minutes to sink into the codebase and the 
constant context switching makes
it worst. Summer holidays for this year are starting day after tomorrow, and I 
hope the next week I can get more work done.

Sahil Gautam
still debugging with printf

Sources:
https://gerrit.libreoffice.org/c/core/+/168016  [PROTOTYPE PATCH]
https://wiki.documentfoundation.org/images/b/b0/LibreOffice_config_extension_writing.pdf
https://www.youtube.com/watch?v=Qn4HHbDxG0M  [A nice tutorial on Styling in 
QT/kf5]
https://discourse.gnome.org/t/setting-css-attributes-on-individual-widget-instances/13836
  [Styling in GTK]

On 5/14/24 2:03 PM, Printf Debugging wrote:
Hi, I am Printf from India, and I will be working on the "Libreoffice 
Theme" project this summer. First of all, many many thanks to Heiko 
and Rafael for mentoring the project, and to the community for being 
so welcoming! This week, I have been wrapping up some patches that I 
had assigned myself, along with some hunting and exploration in the 
VCL. I found that there are functions like `bool 
GtkSalGraphics::updateSettings(AllSettings& rSettings)` which extract 
the colors from the widget systems and save those in a local copy via 
the `Set.Color()` functions. The transaction seemed to be one way 
though, meaning that I didn't see any calls putting the updated colors 
back into the widget system, to modify the UI. For the colors like 
accent-color etc, I think all the getting/setting happens on the local 
copy after extraction. So I have been trying to understand how GTK 
does colors. Found that styling in GTK is built around 
`GtkStyleContext` to which we add StyleProviders, which have the 
styling information. There are a lot of GtkStyleContext pointers in 
`gtkgdi.hxx` for each major component. These are created at startup... 
(survey in progress) I will come up with a prototype patch to change 
the menubar colors probably in this week (counting the start of week 1 
from today) or at max next week. The idea is to get a thumbs up from 
the mentors, community and the devs on the approach/roadmap for the 
project, like shall we create a separate dialog for themes, or shall 
we repurpose the `Tools > Options > Application Colors/Personas` area. 
If we go the dialog route, then what should be the layout, considering 
that this project might extend beyond just plain colors during or even 
after the GSoC project. Is my styling approach scalable, meaning 
should I create a separate class etc etc. This is 

core.git: sw/qa sw/source

2024-05-24 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/paintfrm.cxx |   10 ++
 sw/source/core/layout/paintfrm.cxx |9 -
 2 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 755f3bebd96ec7ae43b1dcf247f907b9c15c1995
Author: Miklos Vajna 
AuthorDate: Fri May 24 10:51:31 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 24 12:36:21 2024 +0200

tdf#160984 sw continuous endnotes: fix the endnote separator length

See
,
Word has a longer separator line for the foot/endnote than Writer for
this bugdoc.

Writer defaults to 25% of the body frame width in the SwPageFootnoteInfo
ctor, and we don't seem to change that in the DOCX import. Word has a
static 2 inches setting, which is only reduced if it would go outside
the body frame.

Fix the problem by extending SwFootnoteContFrame::PaintLine() in the
DocumentSettingId::CONTINUOUS_ENDNOTES case to do the same.

I searched the OOXML spec and the MS implementer notes, they don't
specify this 2 inches length, but it seems static: the value doesn't
change with the page size. With this, the single-section bugdoc is now
rendered fine.

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

diff --git a/sw/qa/core/layout/paintfrm.cxx b/sw/qa/core/layout/paintfrm.cxx
index 8e7154db2501..a5213c57d639 100644
--- a/sw/qa/core/layout/paintfrm.cxx
+++ b/sw/qa/core/layout/paintfrm.cxx
@@ -177,6 +177,16 @@ CPPUNIT_TEST_FIXTURE(Test, 
testInlineEndnoteSeparatorPosition)
 // - Actual  : 2060
 // i.e. the upper spacing was too low.
 CPPUNIT_ASSERT_EQUAL(static_cast(2164), nEndnoteSeparatorY);
+
+// Also make sure the separator length is correct:
+auto nEndnoteSeparatorStart = getXPath(pXmlDoc, "//polygon/point[1]"_ostr, 
"x"_ostr).toInt32();
+auto nEndnoteSeparatorEnd = getXPath(pXmlDoc, "//polygon/point[2]"_ostr, 
"x"_ostr).toInt32();
+sal_Int32 nEndnoteSeparatorLength = nEndnoteSeparatorEnd - 
nEndnoteSeparatorStart;
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 2880
+// - Actual  : 2340
+// i.e. the separator wasn't 2 inches long, but was shorter vs Word.
+CPPUNIT_ASSERT_EQUAL(static_cast(2880), 
nEndnoteSeparatorLength);
 }
 }
 
diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index b139a75094da..a0d5f0d8a629 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -5772,7 +5772,7 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect,
 SwTwips nPrtWidth = aRectFnSet.GetWidth(getFramePrintArea());
 Fraction aFract( nPrtWidth, 1 );
 aFract *= rInf.GetWidth();
-const SwTwips nWidth = static_cast(aFract);
+SwTwips nWidth = static_cast(aFract);
 
 SwTwips nX = aRectFnSet.GetPrtLeft(*this);
 switch ( rInf.GetAdj() )
@@ -5803,6 +5803,13 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect,
 // Word style: instead of fixed value, upper spacing is 60% of all 
space.
 auto nPrintAreaTop = 
static_cast(getFramePrintArea().Top());
 aPoint.setY(getFrameArea().Pos().Y() + nPrintAreaTop * 0.6);
+
+// Length is 2 inches, but don't paint outside the container frame.
+nWidth = o3tl::convert(2, o3tl::Length::in, o3tl::Length::twip);
+if (nWidth > nPrtWidth)
+{
+nWidth = nPrtWidth;
+}
 }
 oLineRect.emplace(aPoint, Size(nWidth, rInf.GetLineWidth()));
 }


core.git: sc/source

2024-05-24 Thread Henry Castro (via logerrit)
 sc/source/core/data/patattr.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 7cd07676dfb6a27957d60fb968fd2d3b8abc873c
Author: Henry Castro 
AuthorDate: Tue May 21 17:32:54 2024 -0400
Commit: Caolán McNamara 
CommitDate: Fri May 24 12:31:29 2024 +0200

lok: sc: fix print mode document back color

Signed-off-by: Henry Castro 
Change-Id: I334ff51230ef01d7a87790409a6d76541c57ba54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167911
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 11eaf501798cec2c5758cd7fd447998e202ae1f9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167944
Tested-by: Jenkins

diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 4e0ab28a07c3..162e46d5de4a 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -829,7 +829,8 @@ void ScPatternAttr::fillColor(model::ComplexColor& 
rComplexColor, const SfxItemS
 if (pViewShell)
 {
 const ScViewRenderingOptions& rViewRenderingOptions = 
pViewShell->GetViewRenderingData();
-aBackColor = rViewRenderingOptions.GetDocColor();
+aBackColor = eAutoMode == ScAutoFontColorMode::Print ? 
COL_WHITE :
+rViewRenderingOptions.GetDocColor();
 }
 }
 }


core.git: 2 commits - accessibility/inc accessibility/source

2024-05-24 Thread Michael Weghorn (via logerrit)
 accessibility/inc/standard/accessiblemenubasecomponent.hxx|4 
 accessibility/source/standard/accessiblemenubasecomponent.cxx |   68 +-
 2 files changed, 35 insertions(+), 37 deletions(-)

New commits:
commit 248a19ad2b21669be6f76dbacb0f89ea41fe6d96
Author: Michael Weghorn 
AuthorDate: Fri May 24 08:01:41 2024 +0200
Commit: Michael Weghorn 
CommitDate: Fri May 24 11:07:42 2024 +0200

a11y: Rename m_aAccessibleChildren1 -> m_aAccessibleChildren

Was previously changed the other way around in

commit 28c89e58d90ea73513e273db274eb46ff9081c35
Date:   Wed Aug 30 15:16:01 2023 +0200

use concrete type for 
OAccessibleMenuBaseComponent::m_aAccessibleChildren

for no apparent reason.

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

diff --git a/accessibility/inc/standard/accessiblemenubasecomponent.hxx 
b/accessibility/inc/standard/accessiblemenubasecomponent.hxx
index 7d62a63eff63..4ddcdd791e1b 100644
--- a/accessibility/inc/standard/accessiblemenubasecomponent.hxx
+++ b/accessibility/inc/standard/accessiblemenubasecomponent.hxx
@@ -45,7 +45,7 @@ class OAccessibleMenuBaseComponent : public 
cppu::ImplInheritanceHelper<
 friend class VCLXAccessibleMenu;
 
 protected:
-std::vector> 
m_aAccessibleChildren1;
+std::vector> 
m_aAccessibleChildren;
 VclPtrm_pMenu;
 
 boolm_bEnabled;
diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx 
b/accessibility/source/standard/accessiblemenubasecomponent.cxx
index e5e390d59512..4ef911dccc12 100644
--- a/accessibility/source/standard/accessiblemenubasecomponent.cxx
+++ b/accessibility/source/standard/accessiblemenubasecomponent.cxx
@@ -54,7 +54,7 @@ OAccessibleMenuBaseComponent::OAccessibleMenuBaseComponent( 
Menu* pMenu )
 {
 if ( m_pMenu )
 {
-m_aAccessibleChildren1.assign( m_pMenu->GetItemCount(), 
rtl::Reference< OAccessibleMenuItemComponent >() );
+m_aAccessibleChildren.assign( m_pMenu->GetItemCount(), rtl::Reference< 
OAccessibleMenuItemComponent >() );
 m_pMenu->AddEventListener( LINK( this, OAccessibleMenuBaseComponent, 
MenuEventListener ) );
 }
 }
@@ -196,9 +196,9 @@ void OAccessibleMenuBaseComponent::SetChecked( bool 
bChecked )
 
 void OAccessibleMenuBaseComponent::UpdateEnabled( sal_Int32 i, bool bEnabled )
 {
-if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren1.size() )
+if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
 {
-rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren1[i] );
+rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren[i] );
 if ( xChild.is() )
 xChild->SetEnabled( bEnabled );
 }
@@ -207,9 +207,9 @@ void OAccessibleMenuBaseComponent::UpdateEnabled( sal_Int32 
i, bool bEnabled )
 
 void OAccessibleMenuBaseComponent::UpdateFocused( sal_Int32 i, bool bFocused )
 {
-if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren1.size() )
+if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
 {
-rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren1[i] );
+rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren[i] );
 if ( xChild.is() )
 xChild->SetFocused( bFocused );
 }
@@ -219,7 +219,7 @@ void OAccessibleMenuBaseComponent::UpdateFocused( sal_Int32 
i, bool bFocused )
 void OAccessibleMenuBaseComponent::UpdateVisible()
 {
 SetVisible( IsVisible() );
-for (const rtl::Reference& xChild : 
m_aAccessibleChildren1)
+for (const rtl::Reference& xChild : 
m_aAccessibleChildren)
 {
 if ( xChild.is() )
 xChild->SetVisible( xChild->IsVisible() );
@@ -231,9 +231,9 @@ void OAccessibleMenuBaseComponent::UpdateSelected( 
sal_Int32 i, bool bSelected )
 {
 NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() 
);
 
-if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren1.size() )
+if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
 {
-rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren1[i] );
+rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAccessibleChildren[i] );
 if ( xChild.is() )
 xChild->SetSelected( bSelected );
 }
@@ -242,9 +242,9 @@ void OAccessibleMenuBaseComponent::UpdateSelected( 
sal_Int32 i, bool bSelected )
 
 void OAccessibleMenuBaseComponent::UpdateChecked( sal_Int32 i, bool bChecked )
 {
-if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren1.size() )
+if ( i >= 0 && o3tl::make_unsigned(i) < m_aAccessibleChildren.size() )
 {
-rtl::Reference< OAccessibleMenuBaseComponent > xChild( 
m_aAcces

core.git: helpcontent2

2024-05-24 Thread Andrea Gelmini (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2d568fe29bd95755746248fc54624d5dec03d9b7
Author: Andrea Gelmini 
AuthorDate: Fri May 24 10:14:51 2024 +0200
Commit: Gerrit Code Review 
CommitDate: Fri May 24 10:14:51 2024 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 7fe9ae80c7df68c70dae06b9d6002fbc42d1ab7e
  - Fix typo

Change-Id: Ia0a17632d7e505bff252bb788384a83869aef00b
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/168003
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/helpcontent2 b/helpcontent2
index 25f4e3d465be..7fe9ae80c7df 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 25f4e3d465bed888952ef7cafa2e47736bb0214d
+Subproject commit 7fe9ae80c7df68c70dae06b9d6002fbc42d1ab7e


help.git: source/text

2024-05-24 Thread Andrea Gelmini (via logerrit)
 source/text/shared/main0227.xhp |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7fe9ae80c7df68c70dae06b9d6002fbc42d1ab7e
Author: Andrea Gelmini 
AuthorDate: Fri May 24 08:34:58 2024 +0200
Commit: Julien Nabet 
CommitDate: Fri May 24 10:14:50 2024 +0200

Fix typo

Change-Id: Ia0a17632d7e505bff252bb788384a83869aef00b
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/168003
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/source/text/shared/main0227.xhp b/source/text/shared/main0227.xhp
index e410bb18bb..b7ec02b961 100644
--- a/source/text/shared/main0227.xhp
+++ b/source/text/shared/main0227.xhp
@@ -203,12 +203,12 @@
 
 
 
-
+
 Symmetric Transition
 This icon converts a corner point or a smooth point 
into a symmetrical point. Both control points of the corner point are 
aligned in parallel and have the same length. They can only be moved 
simultaneously and the degree of curvature is the same in both 
directions.
 
 
-
+
 
 
 


core.git: Branch 'distro/collabora/co-24.04' - sw/inc sw/qa sw/source

2024-05-24 Thread Michael Stahl (via logerrit)
 sw/inc/doc.hxx  |8 +-
 sw/qa/extras/uiwriter/uiwriter8.cxx |   46 -
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   11 ++-
 sw/source/core/doc/docnum.cxx   |   55 +++-
 4 files changed, 109 insertions(+), 11 deletions(-)

New commits:
commit df2c39e978fefcd0858c8aabf9c6ad35b4f3c178
Author: Michael Stahl 
AuthorDate: Fri May 17 13:58:41 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 24 10:02:48 2024 +0200

tdf#161137 sw: AutoText or Paste should copy paragraph indents for lists

The first commit made the start and end node of the paste look like the
list it was inserted into, but the middle nodes may have different
paragraph styles and may have different left margin / first line indent.

In addition to the SwNumRule, also copy any left margin or first line
indent if it is effective on the node that the SwNumRule was taken from.

Now all the list labels should be in the same place.

Change-Id: Ia5794687ea0ff542f23289b1ca63ea99dae85bc3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/16
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 2bcaa374ea418cd81f9dbf62cd7e896f5977992a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167810
Reviewed-by: Caolán McNamara 
(cherry picked from commit b01d89eaf473870281f6ecbdeb12aa3fcd79f9bb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168006
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 84378f8521ea..946c96fd29db 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1073,7 +1073,9 @@ public:
  const SwNumRule&,
  SetNumRuleMode mode,
  SwRootFrame const* pLayout = nullptr,
- const OUString& sContinuedListId = OUString());
+ const OUString& sContinuedListId = OUString(),
+ SvxTextLeftMarginItem const* pTextLeftMarginToPropagate = 
nullptr,
+ SvxFirstLineIndentItem const* pFirstLineIndentToPropagate 
= nullptr);
 void SetCounted(const SwPaM&, bool bCounted, SwRootFrame const* pLayout);
 
 void MakeUniqueNumRules(const SwPaM & rPaM);
@@ -1150,7 +1152,9 @@ public:
 int nNonEmptyAllowed,
 OUString& sListId,
 SwRootFrame const* pLayout,
-const bool bInvestigateStartNode = false );
+const bool bInvestigateStartNode = false,
+SvxTextLeftMarginItem const** 
o_ppTextLeftMargin = nullptr,
+SvxFirstLineIndentItem const** 
o_ppFirstLineIndent = nullptr);
 
 // Paragraphs without numbering but with indents.
 bool NoNum( const SwPaM& );
diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx 
b/sw/qa/extras/uiwriter/uiwriter8.cxx
index 13e437e68d96..60b1bd8e9ce6 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -880,7 +881,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, 
testInsertAutoTextIntoListFromParaStyle)
 pWrtShell->FwdPara();
 pWrtShell->EndPara(/*bSelect=*/false);
 // expands autotext (via F3)
-pWrtShell->Insert(" dt");
+pWrtShell->Insert(" jacr");
 
 SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
 pTextDoc->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_F3);
@@ -889,6 +890,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, 
testInsertAutoTextIntoListFromParaStyle)
 pWrtShell->SttEndDoc(/*bStt=*/true);
 pWrtShell->FwdPara();
 
+SwNumRule* pNumRule;
+SvxTextLeftMarginItem const* pTextLeftMargin;
+SvxFirstLineIndentItem const* pFirstLineIndent;
+
 {
 SwTextNode& rNode{ 
*pWrtShell->GetCursor()->GetPoint()->GetNode().GetTextNode() };
 // numrule from paragraph style, but not from direct formatting
@@ -905,7 +910,32 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, 
testInsertAutoTextIntoListFromParaStyle)
 CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, 
pSet->GetItemState(RES_MARGIN_TEXTLEFT, false));
 CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, 
pSet->GetItemState(RES_MARGIN_TEXTLEFT, true));
 CPPUNIT_ASSERT_EQUAL(u"ListAndIndents"_ustr, 
rNode.GetTextColl()->GetName());
-CPPUNIT_ASSERT(rNode.GetText().startsWith("Item He heard quiet 
steps"));
+CPPUNIT_ASSERT_EQUAL(u"Item We confirm receipt of your application 
material."_ustr,
+ rNode.GetText());
+pNumRule = rNode.GetNumRule();
+pTextLeftMargin = &rNode.GetAttr(RES_MARGIN_TEXTLEFT);
+pFirstLineIndent = &rNode.GetAttr(RES_MARGIN_FIRS