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

2024-05-17 Thread Miklos Vajna (via logerrit)
 desktop/source/lib/init.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 63ba90e6aea1554d6ee2d50b9439312a4b7ee483
Author: Miklos Vajna 
AuthorDate: Fri May 17 13:54:26 2024 +0200
Commit: Caolán McNamara 
CommitDate: Fri May 17 15:24:31 2024 +0200

desktop: fix warning C4100: 'pThis': unreferenced formal parameter

SAL_UNUSED_PARAMETER expands to nothing in the Windows case, though not
sure why this started to matter only now.

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8edd138cc907..a61eb3ff0879 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7289,7 +7289,7 @@ static void doc_setViewTimezone(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* /*p
 }
 }
 
-static void doc_setViewReadOnly(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* 
pThis, int nId, const bool readOnly)
+static void doc_setViewReadOnly(LibreOfficeKitDocument* /*pThis*/, int nId, 
const bool readOnly)
 {
 comphelper::ProfileZone aZone("doc_setViewReadOnly");
 
@@ -7299,7 +7299,7 @@ static void doc_setViewReadOnly(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* pTh
 SfxLokHelper::setViewReadOnly(nId, readOnly);
 }
 
-static void doc_setAllowChangeComments(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* pThis, int nId, const bool allow)
+static void doc_setAllowChangeComments(LibreOfficeKitDocument* /*pThis*/, int 
nId, const bool allow)
 {
 comphelper::ProfileZone aZone("doc_setAllowChangeComments");
 


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

2024-05-17 Thread Miklos Vajna (via logerrit)
 sw/qa/filter/ww8/ww8.cxx  |7 ++-
 sw/source/core/inc/frame.hxx  |3 +++
 sw/source/core/layout/findfrm.cxx |   11 +++
 sw/source/filter/ww8/ww8par.cxx   |7 ---
 4 files changed, 20 insertions(+), 8 deletions(-)

New commits:
commit 135e86e7e3bafdb0ab39a372a989854eefefe30c
Author: Miklos Vajna 
AuthorDate: Thu May 16 08:46:36 2024 +0200
Commit: Caolán McNamara 
CommitDate: Fri May 17 12:03:49 2024 +0200

tdf#160984 sw continuous endnotes, DOC import: enable this unconditionally

DOC files with <= 2 endnotes were imported fine, but not if they had
more endnotes.

This was added in commit dc11f5b151e1a2ea2623fc8cf806a400763955d9
(tdf#143445 DOC import: limit the usage of the CONTINUOUS_ENDNOTES
compat flag, 2023-05-23), because mapping endnotes to footnotes was a
dead-end.

The limitation can be dropped: I checked that the tdf#143445 bugdoc with
all its 72 endnotes is laid out reasonably.

Also add a new SwFrame::DynCastColumnFrame() to easily get a column
frame from a frame using our own RTTI, if we have it anyway.

(cherry picked from commit d74fb6b571304b41c13b7a6dcdd2b853bfca7210)

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

diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx
index af19051a03e5..4cbbfe5fbf31 100644
--- a/sw/qa/filter/ww8/ww8.cxx
+++ b/sw/qa/filter/ww8/ww8.cxx
@@ -30,6 +30,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 namespace
 {
@@ -298,7 +300,10 @@ CPPUNIT_TEST_FIXTURE(Test, test3Endnotes)
 SwDoc* pDoc = getSwDoc();
 SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
 SwPageFrame* pPage = pLayout->GetLastPage();
-SwFootnoteContFrame* pFootnoteCont = pPage->FindFootnoteCont();
+SwContentFrame* pLastContent = pPage->FindLastBodyContent();
+SwFrame* pSectionFrame = pLastContent->GetNext();
+auto pColumnFrame = pSectionFrame->GetLower()->DynCastColumnFrame();
+SwFootnoteContFrame* pFootnoteCont = pColumnFrame->FindFootnoteCont();
 int nEndnotes = 0;
 for (SwFrame* pLower = pFootnoteCont->GetLower(); pLower; pLower = 
pLower->GetNext())
 {
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index a86358508182..b662adc89086 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -40,6 +40,7 @@ namespace drawinglayer::processor2d { class BaseProcessor2D; }
 class SwLayoutFrame;
 class SwRootFrame;
 class SwPageFrame;
+class SwColumnFrame;
 class SwBodyFrame;
 class SwFlyFrame;
 class SwSectionFrame;
@@ -876,6 +877,8 @@ public:
 const SwTextFrame* DynCastTextFrame() const;
 SwPageFrame* DynCastPageFrame();
 const SwPageFrame* DynCastPageFrame() const;
+SwColumnFrame* DynCastColumnFrame();
+const SwColumnFrame* DynCastColumnFrame() const;
 inline bool IsNoTextFrame() const;
 // Frames where its PrtArea depends on their neighbors and that are
 // positioned in the content flow
diff --git a/sw/source/core/layout/findfrm.cxx 
b/sw/source/core/layout/findfrm.cxx
index 378e451b9f89..4efa25e553e6 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1973,4 +1974,14 @@ const SwPageFrame* SwFrame::DynCastPageFrame() const
 return IsPageFrame() ? static_cast(this) : nullptr;
 }
 
+SwColumnFrame* SwFrame::DynCastColumnFrame()
+{
+return IsColumnFrame() ? static_cast(this) : nullptr;
+}
+
+const SwColumnFrame* SwFrame::DynCastColumnFrame() const
+{
+return IsColumnFrame() ? static_cast(this) : nullptr;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index c88990a5f663..3f18c2058122 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5195,13 +5195,6 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const 
*pGloss)
 if( m_xWDop->nEdn )
 aInfo.m_nFootnoteOffset = m_xWDop->nEdn - 1;
 m_rDoc.SetEndNoteInfo( aInfo );
-
-if (m_xSBase->GetEndnoteCount() > 2)
-{
-// This compatibility flag only works in easy cases, disable it 
for anything non-trivial
-// for now.
-
m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::CONTINUOUS_ENDNOTES, 
false);
-}
 }
 
 if (m_xWwFib->m_lcbPlcfhdd)


core.git: Branch 'libreoffice-24-2' - sw/qa sw/source

2024-05-17 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/calcmove.cxx   |   24 +++
 sw/qa/core/layout/data/ignore-top-margin-fly.odt |binary
 sw/source/core/layout/calcmove.cxx   |6 +
 3 files changed, 30 insertions(+)

New commits:
commit 9b508c45a7c30a5c1847b7d93f2a26a653102588
Author: Miklos Vajna 
AuthorDate: Fri May 17 08:07:23 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 17 11:00:10 2024 +0200

tdf#160952 sw: ignore top margin only at page top, not in fly

See

<https://gerrit.libreoffice.org/c/core/+/167671/2#message-8603b129dd8bd72608259571056ded950182ca96>,
multi-column shape text can't appear in DOCX files, so collapsing upper
spacing in that case is not correct, avoid it.

Change-Id: Icf69c8d84fdd15d6e3289ff614b2f6ba7cee1e0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167758
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit b969e692000f50aafacc2eb577f545b8836dcc26)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167683
Reviewed-by: Michael Stahl 

diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx
index a44dc1256b83..ad53df9bd0f4 100644
--- a/sw/qa/core/layout/calcmove.cxx
+++ b/sw/qa/core/layout/calcmove.cxx
@@ -58,6 +58,30 @@ CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginTable)
 // i.e. the top margin in B1's first paragraph was ignored, but not in 
Word.
 CPPUNIT_ASSERT_EQUAL(static_cast(2000), nParaTopMargin);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginFly)
+{
+// Given a document with compat flags like DOCX (>= Word 2013), 2 pages, 
multi-col fly frame on
+// page 2:
+createSwDoc("ignore-top-margin-fly.odt");
+
+// When laying out that document:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+// Then make sure that the top margin is not ignored inside shape text:
+sal_Int32 nParaTopMargin
+= getXPath(
+  pXmlDoc,
+  
"/root/page[2]/body/section/column[2]/body/txt/anchored/fly/column/body/txt/infos/prtBounds"_ostr,
+  "top"_ostr)
+  .toInt32();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 4000
+// - Actual  : 0
+// i.e. the top margin was ignored inside shape text for Word compat, 
while multi-col shape text
+// is a Writer feature.
+CPPUNIT_ASSERT_EQUAL(static_cast(4000), nParaTopMargin);
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/layout/data/ignore-top-margin-fly.odt 
b/sw/qa/core/layout/data/ignore-top-margin-fly.odt
new file mode 100644
index ..51bda8fe40a9
Binary files /dev/null and b/sw/qa/core/layout/data/ignore-top-margin-fly.odt 
differ
diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index 63c774c25cd6..f358d74af0bd 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1092,6 +1092,12 @@ bool SwFrame::IsCollapseUpper() const
 return false;
 }
 
+if (IsInFly())
+{
+// Not in a page's body.
+return false;
+}
+
 // Word >= 2013 style: when we're at the top of the page's body, but not 
on the first page, then
 // ignore the upper margin for paragraphs.
 if (GetPrev() || !GetUpper() || !GetUpper()->IsBodyFrame())


core.git: sw/qa sw/source

2024-05-17 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/calcmove.cxx   |   24 +++
 sw/qa/core/layout/data/ignore-top-margin-fly.odt |binary
 sw/source/core/layout/calcmove.cxx   |6 +
 3 files changed, 30 insertions(+)

New commits:
commit b969e692000f50aafacc2eb577f545b8836dcc26
Author: Miklos Vajna 
AuthorDate: Fri May 17 08:07:23 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 17 09:21:37 2024 +0200

tdf#160952 sw: ignore top margin only at page top, not in fly

See

<https://gerrit.libreoffice.org/c/core/+/167671/2#message-8603b129dd8bd72608259571056ded950182ca96>,
multi-column shape text can't appear in DOCX files, so collapsing upper
spacing in that case is not correct, avoid it.

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

diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx
index a44dc1256b83..ad53df9bd0f4 100644
--- a/sw/qa/core/layout/calcmove.cxx
+++ b/sw/qa/core/layout/calcmove.cxx
@@ -58,6 +58,30 @@ CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginTable)
 // i.e. the top margin in B1's first paragraph was ignored, but not in 
Word.
 CPPUNIT_ASSERT_EQUAL(static_cast(2000), nParaTopMargin);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginFly)
+{
+// Given a document with compat flags like DOCX (>= Word 2013), 2 pages, 
multi-col fly frame on
+// page 2:
+createSwDoc("ignore-top-margin-fly.odt");
+
+// When laying out that document:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+// Then make sure that the top margin is not ignored inside shape text:
+sal_Int32 nParaTopMargin
+= getXPath(
+  pXmlDoc,
+  
"/root/page[2]/body/section/column[2]/body/txt/anchored/fly/column/body/txt/infos/prtBounds"_ostr,
+  "top"_ostr)
+  .toInt32();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 4000
+// - Actual  : 0
+// i.e. the top margin was ignored inside shape text for Word compat, 
while multi-col shape text
+// is a Writer feature.
+CPPUNIT_ASSERT_EQUAL(static_cast(4000), nParaTopMargin);
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/layout/data/ignore-top-margin-fly.odt 
b/sw/qa/core/layout/data/ignore-top-margin-fly.odt
new file mode 100644
index ..51bda8fe40a9
Binary files /dev/null and b/sw/qa/core/layout/data/ignore-top-margin-fly.odt 
differ
diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index ea27716aaeed..6e8112308002 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1092,6 +1092,12 @@ bool SwFrame::IsCollapseUpper() const
 return false;
 }
 
+if (IsInFly())
+{
+// Not in a page's body.
+return false;
+}
+
 // Word >= 2013 style: when we're at the top of the page's body, but not 
on the first page, then
 // ignore the upper margin for paragraphs.
 if (GetPrev() || !GetUpper() || !GetUpper()->IsBodyFrame())


ESC meeting minutes: 2024-05-16

2024-05-16 Thread Miklos Vajna

* Present:
+ Heiko, Olivier, Thorsten, Cloph, Hossein, Ilmari, Jonathan, Michael W, 
Xisco, Michael S, Caolan, Stephane, Miklos

* Completed Action Items:
+ tdf#99528 Vertical tabs: invite Samuel next week if there are still 
burning fires (Heiko)
  + Samuel says not needed
  + revert for 24.8 if needed
  + unfortunately couldn't make it to the call (Thorsten)
  + the intention is to fix this, so it doesn't look broken
  + suggest to have a week before UI freeze to see where we are
  + original idea came from UX
  + afraid to wait for too long (Heiko)
  + if the change is controversial, agree (Thorsten)
+ if desirable: try to fix it
+ committed to put some effort into this
+ no very strong opinion on this
  + 4 high severity bugs for this topic so far (Xisco)
+ feels broken in its current state (Heiko)
  + except on gtk3
  + suggest to review the state in 2 weeks and see the direction (Miklos)
  + like the idea + a recurring item (Xisco)
+ send welcome mail for Jonathan (Xisco)
+ enable the commit bit for Jonathan (Cloph)
* Pending Action Items:

* Release Engineering update (Cloph)
+ 24.2: 24.2.4 RC1 this week, today evening
+ 24.8: alpha was tagged earlier this week
+ feature freeze in 3 weeks
+ string / UI freeze 4 weeks after that
+ bug with Linux packaging: missing mapping, locally patched for now
  + if you have a late feature proposal, announce that here
  + MAR updater:
+ 2 channels?
+ keep on the old channel as long as possible?
+ update to the new channel as soon as possible?
+ stick to how the old update notification did it?
+ could also provide a dummy update to stop updates
+ context (Thorsten)
  + plan: 24.8 is enabled by default, without any user interaction
  + channel name is baked into the version
  + can tell people to edit some files
  + easiest is to decide on one policy and go with that
  + if we stop supporting a Windows version, there is no good option to 
do that
+ least bad: product is discontinued, then no obligation to have 
working LO there
+ perhaps update Windows requirement for 24.8, then we're good for 
the next few years
+ last time an ICU update triggered the Windows bump (Cloph)
  + concern: we ship an update then the new version can't be launched 
anymore
  + or only partially
  + if we stick to just 1 policy, then dummy update is a trick
+ if the update check sends OS info, it's easier
+ if single channel, which variant to use? (Cloph)
  + switch later, sooner, something in-between?
  + play it safe and start with the in-branch update first and only do 
major updates in the next cycle?
+ what browsers do (Hossein)
  + Chrome has 3 channels: stable, dev, canary
  + Firefox: minor versions (automatic) and then a major version 
(manually)
+ and now just similar to Chrome (automatic for all)
  + look at if this is relevant for us
  + browers always try to get to the latest (Thorsten)
  + for us: when a major update the least distruptive
  + can decide later when to cross-update (Cloph)
+ mid-cycle or when EOL is reached?
  + care about: the expecation is that EOL version is automatically 
updated (Thorsten)
+ stop running unmaintained, insecure software
  + run update in the background, then user decides if update now or 
later? (Hossein)
+ strongly feel against the idea of keep running insecure version 
(Thorsten)
+ default should be to update (unless you go via tools -> options)
+ agree, default to update is good (Hossein)
  + include OS info in the user agent? (Cloph)
+ like the idea (Thorsten)
AI: do this or file a bug to do it (Cloph)

* Documentation (Olivier)
+ Helpcontent2
   + Help for RANDARRAY (ohallot, fito, Balasz)
   + Updates and fixes (ohallot)
+ Extended tips
   + Calc option view page (D. Maddern)
+ Guides
   + Work in progress.
   + IMpress 24.2 soon to be announced
+ Bugzilla Documentation statistics
257(257) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 12(-2)   46(7) 107(0) 220(-5)
 commented 12(-8)   70(9) 245(-10)   837(-17)
  resolved  6(-1)   28(5)  57(3) 123(2)
+ top 10 contributors:
  Olivier Hallot made 58 changes in 1 month, and 242 changes in 1 year
  Stéphane Guillou made 31 changes in 1 month, and 237 changes in 1 year
  Vernon, Stuart Foote made 22 changes in 1 month, and 106 changes in 1 
year
  Ilmari Lauhakangas made 10 changes in 1 month, and 73 changes in 1 
year
  

ESC meeting minutes: 2024-05-16

2024-05-16 Thread Miklos Vajna

* Present:
+ Heiko, Olivier, Thorsten, Cloph, Hossein, Ilmari, Jonathan, Michael W, 
Xisco, Michael S, Caolan, Stephane, Miklos

* Completed Action Items:
+ tdf#99528 Vertical tabs: invite Samuel next week if there are still 
burning fires (Heiko)
  + Samuel says not needed
  + revert for 24.8 if needed
  + unfortunately couldn't make it to the call (Thorsten)
  + the intention is to fix this, so it doesn't look broken
  + suggest to have a week before UI freeze to see where we are
  + original idea came from UX
  + afraid to wait for too long (Heiko)
  + if the change is controversial, agree (Thorsten)
+ if desirable: try to fix it
+ committed to put some effort into this
+ no very strong opinion on this
  + 4 high severity bugs for this topic so far (Xisco)
+ feels broken in its current state (Heiko)
  + except on gtk3
  + suggest to review the state in 2 weeks and see the direction (Miklos)
  + like the idea + a recurring item (Xisco)
+ send welcome mail for Jonathan (Xisco)
+ enable the commit bit for Jonathan (Cloph)
* Pending Action Items:

* Release Engineering update (Cloph)
+ 24.2: 24.2.4 RC1 this week, today evening
+ 24.8: alpha was tagged earlier this week
+ feature freeze in 3 weeks
+ string / UI freeze 4 weeks after that
+ bug with Linux packaging: missing mapping, locally patched for now
  + if you have a late feature proposal, announce that here
  + MAR updater:
+ 2 channels?
+ keep on the old channel as long as possible?
+ update to the new channel as soon as possible?
+ stick to how the old update notification did it?
+ could also provide a dummy update to stop updates
+ context (Thorsten)
  + plan: 24.8 is enabled by default, without any user interaction
  + channel name is baked into the version
  + can tell people to edit some files
  + easiest is to decide on one policy and go with that
  + if we stop supporting a Windows version, there is no good option to 
do that
+ least bad: product is discontinued, then no obligation to have 
working LO there
+ perhaps update Windows requirement for 24.8, then we're good for 
the next few years
+ last time an ICU update triggered the Windows bump (Cloph)
  + concern: we ship an update then the new version can't be launched 
anymore
  + or only partially
  + if we stick to just 1 policy, then dummy update is a trick
+ if the update check sends OS info, it's easier
+ if single channel, which variant to use? (Cloph)
  + switch later, sooner, something in-between?
  + play it safe and start with the in-branch update first and only do 
major updates in the next cycle?
+ what browsers do (Hossein)
  + Chrome has 3 channels: stable, dev, canary
  + Firefox: minor versions (automatic) and then a major version 
(manually)
+ and now just similar to Chrome (automatic for all)
  + look at if this is relevant for us
  + browers always try to get to the latest (Thorsten)
  + for us: when a major update the least distruptive
  + can decide later when to cross-update (Cloph)
+ mid-cycle or when EOL is reached?
  + care about: the expecation is that EOL version is automatically 
updated (Thorsten)
+ stop running unmaintained, insecure software
  + run update in the background, then user decides if update now or 
later? (Hossein)
+ strongly feel against the idea of keep running insecure version 
(Thorsten)
+ default should be to update (unless you go via tools -> options)
+ agree, default to update is good (Hossein)
  + include OS info in the user agent? (Cloph)
+ like the idea (Thorsten)
AI: do this or file a bug to do it (Cloph)

* Documentation (Olivier)
+ Helpcontent2
   + Help for RANDARRAY (ohallot, fito, Balasz)
   + Updates and fixes (ohallot)
+ Extended tips
   + Calc option view page (D. Maddern)
+ Guides
   + Work in progress.
   + IMpress 24.2 soon to be announced
+ Bugzilla Documentation statistics
257(257) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 12(-2)   46(7) 107(0) 220(-5)
 commented 12(-8)   70(9) 245(-10)   837(-17)
  resolved  6(-1)   28(5)  57(3) 123(2)
+ top 10 contributors:
  Olivier Hallot made 58 changes in 1 month, and 242 changes in 1 year
  Stéphane Guillou made 31 changes in 1 month, and 237 changes in 1 year
  Vernon, Stuart Foote made 22 changes in 1 month, and 106 changes in 1 
year
  Ilmari Lauhakangas made 10 changes in 1 month, and 73 changes in 1 
year
  

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

2024-05-16 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/data/inline-endnote-and-section.odt |binary
 sw/qa/core/layout/ftnfrm.cxx  |   18 ++
 sw/source/core/layout/ftnfrm.cxx  |   16 +++-
 3 files changed, 33 insertions(+), 1 deletion(-)

New commits:
commit a8216967ebe242c379b7df1267836c4ec5a566a4
Author: Miklos Vajna 
AuthorDate: Wed May 15 13:25:13 2024 +0200
Commit: Caolán McNamara 
CommitDate: Thu May 16 16:02:17 2024 +0200

tdf#161083 sw continuous endnotes: fix layout with a section at doc end

Open the bugdoc, notice warnings like:

warn:legacy.osl:15059:15059:sw/source/core/layout/wsfrm.cxx:910: Frame tree 
is inconsistent.

Which means we try to insert the new section frame under body frame, but
the insert point is behind a frame which is not a direct child of the
body frame.

This went wrong in commit 6885dcd7ec7b82a946d8344bfc27a3e88eecc44a
(tdf#160984 sw continuous endnotes: switch to a section-based layout,
2024-05-14), where I didn't consider the case of having a continuous
section break at the Word doc end, which maps to a section frame before
the section frame of the endnotes in Writer.

Fix the problem by walking up the parent chain till we find the last
direct child of the body frame, which is typically not required, except
when having one or more (nested) section frames at the end of the
document.

Interestingly tdf#143456 had the same problem, which was the bugdoc to
trigger the revert of the old continuous endnotes code for DOCX in
eeda1b35a6e87d5349545464da33d997c52f15e3 (Revert "tdf#58521 DOCX import:
enable ContinuousEndnotes compat flag", 2021-08-10).

(cherry picked from commit 82dd81a9d2049ac95535880fc67c1867f90e1427)

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

diff --git a/sw/qa/core/layout/data/inline-endnote-and-section.odt 
b/sw/qa/core/layout/data/inline-endnote-and-section.odt
new file mode 100644
index ..4518904f6009
Binary files /dev/null and 
b/sw/qa/core/layout/data/inline-endnote-and-section.odt differ
diff --git a/sw/qa/core/layout/ftnfrm.cxx b/sw/qa/core/layout/ftnfrm.cxx
index 71fd3fd67150..1cf31809e5a7 100644
--- a/sw/qa/core/layout/ftnfrm.cxx
+++ b/sw/qa/core/layout/ftnfrm.cxx
@@ -84,4 +84,22 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndFootnote)
 CPPUNIT_ASSERT_LESS(nFootnoteTop, nEndnoteTop);
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndSection)
+{
+// Given a document ending with a section, ContinuousEndnotes is true:
+createSwDoc("inline-endnote-and-section.odt");
+
+// When laying out that document:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+// Then make sure the endnote section is after the section at the end of 
the document, not
+// inside it:
+int nToplevelSections = countXPathNodes(pXmlDoc, 
"/root/page/body/section"_ostr);
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 2
+// - Actual  : 1
+// and we even crashed on shutdown.
+CPPUNIT_ASSERT_EQUAL(2, nToplevelSections);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 4be87ee57ccd..61a8385d51fc 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -1560,7 +1560,21 @@ void SwFootnoteBossFrame::AppendFootnote( SwContentFrame 
*pRef, SwTextFootnote *
 {
 SwSection* pSwSection = 
pDoc->GetEndNoteInfo().GetSwSection(*pDoc);
 pEndnoteSection = new SwSectionFrame(*pSwSection, pPage);
-pEndnoteSection->InsertBehind(pPage->FindBodyCont(), 
pPage->FindLastBodyContent());
+SwLayoutFrame* pParent = pPage->FindBodyCont();
+SwFrame* pBefore = pPage->FindLastBodyContent();
+while (pBefore)
+{
+// Check if the last content frame is directly under the 
body frame or there is
+// something in-between, e.g. a section frame.
+if (pBefore->GetUpper() == pParent)
+{
+break;
+}
+
+// If so, insert behind the parent of the content frame, 
not inside the parent.
+pBefore = pBefore->GetUpper();
+}
+pEndnoteSection->InsertBehind(pParent, pBefore);
 pEndnoteSection->Init();
 pEndnoteSection->SetEndNoteSection(true);
 }


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

2024-05-16 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/data/inline-endnote-and-footnote.doc |binary
 sw/qa/core/layout/ftnfrm.cxx   |   21 +++
 sw/source/core/layout/flowfrm.cxx  |   37 -
 sw/source/core/layout/ftnfrm.cxx   |   45 ++---
 sw/source/core/text/txtftn.cxx |   10 ---
 5 files changed, 83 insertions(+), 30 deletions(-)

New commits:
commit ad3586d6c6b03d588a45610e1f091f83b16b83a2
Author: Miklos Vajna 
AuthorDate: Tue May 14 08:28:33 2024 +0200
Commit: Caolán McNamara 
CommitDate: Thu May 16 15:57:41 2024 +0200

tdf#160984 sw continuous endnotes: switch to a section-based layout

The original layout added in commit
4814e8caa5f06c4fe438dfd7d7315e4a2410ea18 (tdf#124601 sw: add
ContinuousEndnotes layout compat option, 2019-09-30) puts endnotes to
the footnote container on the last page, which fixes the page count but
the endnote position is wrong: should be after the body text, not at the
bottom of the page.

Now that we can have an endnote section (with one or more section frames
at a layout level), we have a container that can span over multiple
pages, is at the end of the document and is inline.

Fix the bad position by:

1) Reverting the layout changes from the old approach, which gives us a
   bad position for the endnote.

2) Creating an endnote section frame on demand in
   SwFootnoteBossFrame::AppendFootnote().

3) Moving part of the endnote to a next page works out of the box, but
   moving part of the endnote to a previous page needs explicit handling
   in SwFlowFrame::MoveBwd(), similar to how SwFrame::GetPrevSctLeaf()
   does this in the simple section case. This needs explicit handling,
   because the body frame of the endnote section is empty, all content goes
   to its endnote container.

Note that this just reimplements the compat flag, but its enablement
(only for DOC import, only for <= 2 endnotes) stays unchanged for now.

(cherry picked from commit 6885dcd7ec7b82a946d8344bfc27a3e88eecc44a)

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

diff --git a/sw/qa/core/layout/data/inline-endnote-and-footnote.doc 
b/sw/qa/core/layout/data/inline-endnote-and-footnote.doc
new file mode 100644
index ..39c5636e1e12
Binary files /dev/null and 
b/sw/qa/core/layout/data/inline-endnote-and-footnote.doc differ
diff --git a/sw/qa/core/layout/ftnfrm.cxx b/sw/qa/core/layout/ftnfrm.cxx
index 4c874202da3f..71fd3fd67150 100644
--- a/sw/qa/core/layout/ftnfrm.cxx
+++ b/sw/qa/core/layout/ftnfrm.cxx
@@ -63,4 +63,25 @@ CPPUNIT_TEST_FIXTURE(Test, testFlySplitFootnoteLayout)
 CPPUNIT_ASSERT(pPage->FindFootnoteCont());
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndFootnote)
+{
+// Given a DOC file with an endnote and then a footnote:
+createSwDoc("inline-endnote-and-footnote.doc");
+
+// When laying out that document:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+// Then make sure the footnote is below the endnote:
+// Without the accompanying fix in place, this test would have failed with:
+// - xpath should match exactly 1 node
+// i.e. the endnote was also in the footnote container, not at the end of 
the body text.
+sal_Int32 nEndnoteTop
+= 
parseDump("/root/page/body/section/column/ftncont/ftn/infos/bounds"_ostr, 
"top"_ostr)
+  .toInt32();
+sal_Int32 nFootnoteTop
+= parseDump("/root/page/ftncont/ftn/infos/bounds"_ostr, 
"top"_ostr).toInt32();
+// Endnote at the end of body text, footnote at page bottom.
+CPPUNIT_ASSERT_LESS(nFootnoteTop, nEndnoteTop);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index 37fd20b323d7..1cb5cf7bf47a 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -2257,18 +2257,47 @@ bool SwFlowFrame::MoveBwd( bool  )
 const bool bEndnote = pFootnote->GetAttr()->GetFootnote().IsEndNote();
 const IDocumentSettingAccess& rSettings
 = pFootnote->GetAttrSet()->GetDoc()->getIDocumentSettingAccess();
-if( bEndnote && pFootnote->IsInSct() )
+bool bContEndnotes = 
rSettings.get(DocumentSettingId::CONTINUOUS_ENDNOTES);
+if( bEndnote && pFootnote->IsInSct() && !bContEndnotes)
 {
 SwSectionFrame* pSect = pFootnote->FindSctFrame();
 if( pSect->IsEndnAtEnd() )
 // Endnotes at the end of the section.
 pRef = pSect->FindLastContent( SwFindMode::LastCnt

core.git: Branch 'libreoffice-24-2' - sw/qa sw/source

2024-05-16 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/calcmove.cxx  |   19 +++
 sw/qa/core/layout/data/ignore-top-margin-table.docx |binary
 sw/source/core/layout/calcmove.cxx  |6 +++---
 3 files changed, 22 insertions(+), 3 deletions(-)

New commits:
commit ed4316d109841c31de49493092d82b40259e818a
Author: Miklos Vajna 
AuthorDate: Tue May 14 13:49:51 2024 +0200
Commit: Michael Stahl 
CommitDate: Thu May 16 09:40:52 2024 +0200

tdf#160952 sw: ignore top margin only at page top, not e.g. table top

The bugdoc has a table at the top of the 2nd page and we ignored the top
margin inside the table cell (for the first paragraph), while this
doesn't happen in Word.

As mentioned at

<https://gerrit.libreoffice.org/c/core/+/167221/3#message-c03abf8e8e3cd20d49006058e6b3eb130585ff8f>,
the old code assumed "top of the page" for all frames not having a
previous frame, while that code was only tested with text frames
directly in the body frame of a page frame.

Fix the problem by limiting this "collapse upper spacing" behavior to
frames directly in body frames. This keeps the old bugdoc working, but
is meant to restore the old, wanted behavior in other cases like e.g. in
table cells.

If later it's discovered that upper spacing collapsing is wanted in
other contexts, those are best added on a case by case basis.

Change-Id: Ieb93facd8b2e7f6412fd20873c10ce6c8b775619
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167631
    Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 6025ac371bd5cd07c0af550d78db323ad394173b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167671
Reviewed-by: Michael Stahl 

diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx
index 3e4deec52ae8..a44dc1256b83 100644
--- a/sw/qa/core/layout/calcmove.cxx
+++ b/sw/qa/core/layout/calcmove.cxx
@@ -39,6 +39,25 @@ CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMargin)
 // i.e. the top margin in the first para of a non-first page wasn't 
ignored, like in Word.
 CPPUNIT_ASSERT_EQUAL(static_cast(0), nParaTopMargin);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginTable)
+{
+// Given a DOCX (>= Word 2013) file, with 2 pages:
+// When loading that document:
+createSwDoc("ignore-top-margin-table.docx");
+
+// Then make sure that the paragraph on the 2nd page in B1 has a top 
margin:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+sal_Int32 nParaTopMargin
+= getXPath(pXmlDoc, 
"/root/page[2]/body/tab/row/cell[2]/txt/infos/prtBounds"_ostr,
+   "top"_ostr)
+  .toInt32();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 2000
+// - Actual  : 0
+// i.e. the top margin in B1's first paragraph was ignored, but not in 
Word.
+CPPUNIT_ASSERT_EQUAL(static_cast(2000), nParaTopMargin);
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/layout/data/ignore-top-margin-table.docx 
b/sw/qa/core/layout/data/ignore-top-margin-table.docx
new file mode 100644
index ..c82f6d63c13f
Binary files /dev/null and 
b/sw/qa/core/layout/data/ignore-top-margin-table.docx differ
diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index 081472b98ee3..63c774c25cd6 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1092,9 +1092,9 @@ bool SwFrame::IsCollapseUpper() const
 return false;
 }
 
-// Word >= 2013 style: when we're at the top of the page, but not on the 
first page, then ignore
-// the upper margin for paragraphs.
-if (GetPrev())
+// Word >= 2013 style: when we're at the top of the page's body, but not 
on the first page, then
+// ignore the upper margin for paragraphs.
+if (GetPrev() || !GetUpper() || !GetUpper()->IsBodyFrame())
 {
 return false;
 }


core.git: sw/qa

2024-05-16 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/rtfexport/rtfexport7.cxx | 1348 --
 1 file changed, 822 insertions(+), 526 deletions(-)

New commits:
commit 55eb6fc8b83fe2f846a4f7448271a5b0fe03fbfc
Author: Miklos Vajna 
AuthorDate: Thu May 16 08:00:20 2024 +0200
Commit: Miklos Vajna 
CommitDate: Thu May 16 08:48:06 2024 +0200

CppunitTest_sw_rtfexport7: avoid DECLARE_RTFEXPORT_TEST

No need to go via Writer-specific macros here.

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

diff --git a/sw/qa/extras/rtfexport/rtfexport7.cxx 
b/sw/qa/extras/rtfexport/rtfexport7.cxx
index d0803d6bcb74..57162cf30df1 100644
--- a/sw/qa/extras/rtfexport/rtfexport7.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport7.cxx
@@ -43,29 +43,41 @@ public:
 }
 };
 
-DECLARE_RTFEXPORT_TEST(testPictureWrapPolygon, "picture-wrap-polygon.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testPictureWrapPolygon)
 {
-// The problem was that the wrap polygon was ignored during import.
-drawing::PointSequenceSequence aSeqSeq
-= getProperty(getShape(1), 
"ContourPolyPolygon");
-// This was 0: the polygon list was empty.
-CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aSeqSeq.getLength());
-
-drawing::PointSequence aSeq = aSeqSeq[0];
-CPPUNIT_ASSERT_EQUAL(sal_Int32(11), aSeq.getLength());
-
-// The shape also didn't have negative top / left coordinates.
-CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-1177)),
- getProperty(getShape(1), 
"HoriOrientPosition"));
-CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-67)),
- getProperty(getShape(1), 
"VertOrientPosition"));
+auto verify = [this]() {
+// The problem was that the wrap polygon was ignored during import.
+drawing::PointSequenceSequence aSeqSeq
+= getProperty(getShape(1), 
"ContourPolyPolygon");
+// This was 0: the polygon list was empty.
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aSeqSeq.getLength());
+
+drawing::PointSequence aSeq = aSeqSeq[0];
+CPPUNIT_ASSERT_EQUAL(sal_Int32(11), aSeq.getLength());
+
+// The shape also didn't have negative top / left coordinates.
+CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-1177)),
+ getProperty(getShape(1), 
"HoriOrientPosition"));
+CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-67)),
+ getProperty(getShape(1), 
"VertOrientPosition"));
+};
+createSwDoc("picture-wrap-polygon.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testTdf113408, "tdf113408.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testTdf113408)
 {
-// This was 0, left margin was not inherited from style properly.
-CPPUNIT_ASSERT_EQUAL(static_cast(1270),
- getProperty(getParagraph(1), 
"ParaLeftMargin"));
+auto verify = [this]() {
+// This was 0, left margin was not inherited from style properly.
+CPPUNIT_ASSERT_EQUAL(static_cast(1270),
+ getProperty(getParagraph(1), 
"ParaLeftMargin"));
+};
+createSwDoc("tdf113408.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
 CPPUNIT_TEST_FIXTURE(Test, testAbi10039)
@@ -85,30 +97,42 @@ CPPUNIT_TEST_FIXTURE(Test, testAbi10076)
 // Just make sure that we don't crash after exporting a fully calculated 
layout.
 }
 
-DECLARE_RTFEXPORT_TEST(testEm, "em.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testEm)
 {
-// Test all possible cc* control words.
-CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::NONE,
- getProperty(getRun(getParagraph(1), 1), 
"CharEmphasis"));
-CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::DOT_ABOVE,
- getProperty(getRun(getParagraph(1), 2), 
"CharEmphasis"));
-CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::ACCENT_ABOVE,
- getProperty(getRun(getParagraph(1), 3), 
"CharEmphasis"));
-// This was missing.
-CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::CIRCLE_ABOVE,
- getProperty(getRun(getParagraph(1), 4), 
"CharEmphasis"));
-// This one, too.
-CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::DOT_BELOW,
- getProperty(getRun(getParagraph(1), 5), 
"CharEmphasis"));
+auto verify = [this]() {
+// Test all possible cc* control words.
+CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::NONE,
+ getProperty(getRun(getParagraph(1), 
1), "CharEmphasis"));
+CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::DOT_ABOVE,
+ getProperty(getRun(getParagraph(1), 
2), "Cha

core.git: sw/qa sw/source

2024-05-15 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/data/inline-endnote-and-section.odt |binary
 sw/qa/core/layout/ftnfrm.cxx  |   18 ++
 sw/source/core/layout/ftnfrm.cxx  |   16 +++-
 3 files changed, 33 insertions(+), 1 deletion(-)

New commits:
commit 82dd81a9d2049ac95535880fc67c1867f90e1427
Author: Miklos Vajna 
AuthorDate: Wed May 15 13:25:13 2024 +0200
Commit: Miklos Vajna 
CommitDate: Wed May 15 16:54:05 2024 +0200

tdf#161083 sw continuous endnotes: fix layout with a section at doc end

Open the bugdoc, notice warnings like:

warn:legacy.osl:15059:15059:sw/source/core/layout/wsfrm.cxx:910: Frame tree 
is inconsistent.

Which means we try to insert the new section frame under body frame, but
the insert point is behind a frame which is not a direct child of the
body frame.

This went wrong in commit 6885dcd7ec7b82a946d8344bfc27a3e88eecc44a
(tdf#160984 sw continuous endnotes: switch to a section-based layout,
2024-05-14), where I didn't consider the case of having a continuous
section break at the Word doc end, which maps to a section frame before
the section frame of the endnotes in Writer.

Fix the problem by walking up the parent chain till we find the last
direct child of the body frame, which is typically not required, except
when having one or more (nested) section frames at the end of the
document.

Interestingly tdf#143456 had the same problem, which was the bugdoc to
trigger the revert of the old continuous endnotes code for DOCX in
eeda1b35a6e87d5349545464da33d997c52f15e3 (Revert "tdf#58521 DOCX import:
enable ContinuousEndnotes compat flag", 2021-08-10).

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

diff --git a/sw/qa/core/layout/data/inline-endnote-and-section.odt 
b/sw/qa/core/layout/data/inline-endnote-and-section.odt
new file mode 100644
index ..4518904f6009
Binary files /dev/null and 
b/sw/qa/core/layout/data/inline-endnote-and-section.odt differ
diff --git a/sw/qa/core/layout/ftnfrm.cxx b/sw/qa/core/layout/ftnfrm.cxx
index 71fd3fd67150..1cf31809e5a7 100644
--- a/sw/qa/core/layout/ftnfrm.cxx
+++ b/sw/qa/core/layout/ftnfrm.cxx
@@ -84,4 +84,22 @@ CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndFootnote)
 CPPUNIT_ASSERT_LESS(nFootnoteTop, nEndnoteTop);
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndSection)
+{
+// Given a document ending with a section, ContinuousEndnotes is true:
+createSwDoc("inline-endnote-and-section.odt");
+
+// When laying out that document:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+// Then make sure the endnote section is after the section at the end of 
the document, not
+// inside it:
+int nToplevelSections = countXPathNodes(pXmlDoc, 
"/root/page/body/section"_ostr);
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 2
+// - Actual  : 1
+// and we even crashed on shutdown.
+CPPUNIT_ASSERT_EQUAL(2, nToplevelSections);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index e03519ed3040..b7851a131e44 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -1585,7 +1585,21 @@ void SwFootnoteBossFrame::AppendFootnote( SwContentFrame 
*pRef, SwTextFootnote *
 {
 SwSection* pSwSection = 
pDoc->GetEndNoteInfo().GetSwSection(*pDoc);
 pEndnoteSection = new SwSectionFrame(*pSwSection, pPage);
-pEndnoteSection->InsertBehind(pPage->FindBodyCont(), 
pPage->FindLastBodyContent());
+SwLayoutFrame* pParent = pPage->FindBodyCont();
+SwFrame* pBefore = pPage->FindLastBodyContent();
+while (pBefore)
+{
+// Check if the last content frame is directly under the 
body frame or there is
+// something in-between, e.g. a section frame.
+if (pBefore->GetUpper() == pParent)
+{
+break;
+}
+
+// If so, insert behind the parent of the content frame, 
not inside the parent.
+pBefore = pBefore->GetUpper();
+}
+pEndnoteSection->InsertBehind(pParent, pBefore);
 pEndnoteSection->Init();
 pEndnoteSection->SetEndNoteSection(true);
 }


ESC meeting agenda: 2024-05-16 16:00 CEST

2024-05-15 Thread Miklos Vajna

Hi,

The prototype agenda is below. Extra items are appreciated either in
this document or as a reply to this mail:

https://pad.documentfoundation.org/p/esc

You can join using Jitsi here:

https://jitsi.documentfoundation.org/esc

Regards,

Miklos

---

* Present:
+

* Completed Action Items:

* Pending Action Items:
+ tdf#99528 Vertical tabs: invite Samuel next week if there are still 
burning fires (Heiko)
+ send welcome mail for Jonathan (Xisco)
+ enable the commit bit for Jonathan (Cloph)

* Release Engineering update (Cloph)
+ 24.2: 24.2.4 RC1 this week?
+ 24.8: feature freeze in 3 weeks
+ string / UI freeze 4 weeks after that
  + if you have a late feature proposal, announce that here

* Documentation (Olivier)
+ Bugzilla Documentation statistics
257(257) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 12(-2)   46(7) 107(0) 220(-5)
 commented 12(-8)   70(9) 245(-10)   837(-17)
  resolved  6(-1)   28(5)  57(3) 123(2)
+ top 10 contributors:
  Olivier Hallot made 58 changes in 1 month, and 242 changes in 1 year
  Stéphane Guillou made 31 changes in 1 month, and 237 changes in 1 year
  Vernon, Stuart Foote made 22 changes in 1 month, and 106 changes in 1 
year
  Ilmari Lauhakangas made 10 changes in 1 month, and 73 changes in 1 
year
  Heiko Tietze made 7 changes in 1 month, and 77 changes in 1 year
  Kaganski, Mike made 7 changes in 1 month, and 74 changes in 1 year
  Nabet, Julien made 6 changes in 1 month, and 59 changes in 1 year
  Cor Nouws made 5 changes in 1 month, and 8 changes in 1 year
  nobu made 4 changes in 1 month, and 16 changes in 1 year
  Dieter made 3 changes in 1 month, and 8 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
240(240) (topicUI) bugs open, 39(39) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
 added  7(3) 13(3) 18(3)   25(4)
 commented 60(-4)   206(20)   560(35)1757(-4)
   removed  0(0)  4(0)  5(0)   11(-1)
  resolved  8(0) 32(1) 80(1)  297(-11)
+ top 10 contributors:
  Heiko Tietze made 111 changes in 1 month, and 986 changes in 1 year
  Vernon, Stuart Foote made 105 changes in 1 month, and 329 changes in 
1 year
  Eyal Rozenberg made 45 changes in 1 month, and 160 changes in 1 year
  Stéphane Guillou made 40 changes in 1 month, and 612 changes in 1 year
  Dieter made 32 changes in 1 month, and 147 changes in 1 year
  Cor Nouws made 21 changes in 1 month, and 32 changes in 1 year
  Ilmari Lauhakangas made 12 changes in 1 month, and 129 changes in 1 
year
  Roman Kuznetsov made 9 changes in 1 month, and 45 changes in 1 year
  Olivier Hallot made 8 changes in 1 month, and 22 changes in 1 year
  Aron Budea made 6 changes in 1 month, and 22 changes in 1 year

* Crash Testing (Caolan)
+ 25(+1) import failure, 19(-1) export failures
+ ??? coverity issues
+ Google / ossfuzz: ?? fuzzers active now

* Crash Reporting (Xisco)
+ 24.2.1.173(+0)
+ 24.2.1.214477(+739)
+ 24.2.2.210399(+1469)
+ 24.2.3.21437(+950)

* Mentoring (Hossein)
  committer...   1 week  1 month 3 months 12 months
  open  89(8)   160(18) 160(-18)  160(-18)
   reviews 318(-132)   1250(44)3594(-124)   12458(-4)
merged 310(-40)1244(104)   3423(54) 12714(121)
 abandoned  15(2)61(6)  174(2)661(5)
   own commits 227(-23) 913(86)2380(77)  9274(45)
review commits  38(-13) 218(-6) 839(-32) 2994(-18)
contributor...   1 week 1 month 3 months12 months
  open  55(18) 103(26) 103(0)   103(0)
   reviews 894(-68)   3050(276)   7930(24)29574(52)
merged  15(-8)  86(-12)377(-8) 1583(-52)
 abandoned   0(-9)  33(-16)279(-9)  699(-5)
   own commits  14(-11) 97(-8) 429(-20)1114(-12)
review commits   0(0)0(0)0(0) 0(0)
+ easyHack statistics:
   needsDevEval 8(8)   needsUXEval 1(1)   cleanup_comments 326(326)
   total 409(409)   assigned 26(26)   open 349(349)
+ top 10 contributors:
  Jakub Kościelak made 5 patches in 1 month, and 5 patches in 1 year
made 4 patches in 1 month, and 7 patches in 1 year
  Kira Tubo made 4 patches in 1 month, and 14 patches in 1 year
  Armin Le Grand (allotropia) made 4 patches in 1 month, and 86 patches 
in 1 year
  

ESC meeting agenda: 2024-05-16 16:00 CEST

2024-05-15 Thread Miklos Vajna

Hi,

The prototype agenda is below. Extra items are appreciated either in
this document or as a reply to this mail:

https://pad.documentfoundation.org/p/esc

You can join using Jitsi here:

https://jitsi.documentfoundation.org/esc

Regards,

Miklos

---

* Present:
+

* Completed Action Items:

* Pending Action Items:
+ tdf#99528 Vertical tabs: invite Samuel next week if there are still 
burning fires (Heiko)
+ send welcome mail for Jonathan (Xisco)
+ enable the commit bit for Jonathan (Cloph)

* Release Engineering update (Cloph)
+ 24.2: 24.2.4 RC1 this week?
+ 24.8: feature freeze in 3 weeks
+ string / UI freeze 4 weeks after that
  + if you have a late feature proposal, announce that here

* Documentation (Olivier)
+ Bugzilla Documentation statistics
257(257) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 12(-2)   46(7) 107(0) 220(-5)
 commented 12(-8)   70(9) 245(-10)   837(-17)
  resolved  6(-1)   28(5)  57(3) 123(2)
+ top 10 contributors:
  Olivier Hallot made 58 changes in 1 month, and 242 changes in 1 year
  Stéphane Guillou made 31 changes in 1 month, and 237 changes in 1 year
  Vernon, Stuart Foote made 22 changes in 1 month, and 106 changes in 1 
year
  Ilmari Lauhakangas made 10 changes in 1 month, and 73 changes in 1 
year
  Heiko Tietze made 7 changes in 1 month, and 77 changes in 1 year
  Kaganski, Mike made 7 changes in 1 month, and 74 changes in 1 year
  Nabet, Julien made 6 changes in 1 month, and 59 changes in 1 year
  Cor Nouws made 5 changes in 1 month, and 8 changes in 1 year
  nobu made 4 changes in 1 month, and 16 changes in 1 year
  Dieter made 3 changes in 1 month, and 8 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
240(240) (topicUI) bugs open, 39(39) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
 added  7(3) 13(3) 18(3)   25(4)
 commented 60(-4)   206(20)   560(35)1757(-4)
   removed  0(0)  4(0)  5(0)   11(-1)
  resolved  8(0) 32(1) 80(1)  297(-11)
+ top 10 contributors:
  Heiko Tietze made 111 changes in 1 month, and 986 changes in 1 year
  Vernon, Stuart Foote made 105 changes in 1 month, and 329 changes in 
1 year
  Eyal Rozenberg made 45 changes in 1 month, and 160 changes in 1 year
  Stéphane Guillou made 40 changes in 1 month, and 612 changes in 1 year
  Dieter made 32 changes in 1 month, and 147 changes in 1 year
  Cor Nouws made 21 changes in 1 month, and 32 changes in 1 year
  Ilmari Lauhakangas made 12 changes in 1 month, and 129 changes in 1 
year
  Roman Kuznetsov made 9 changes in 1 month, and 45 changes in 1 year
  Olivier Hallot made 8 changes in 1 month, and 22 changes in 1 year
  Aron Budea made 6 changes in 1 month, and 22 changes in 1 year

* Crash Testing (Caolan)
+ 25(+1) import failure, 19(-1) export failures
+ ??? coverity issues
+ Google / ossfuzz: ?? fuzzers active now

* Crash Reporting (Xisco)
+ 24.2.1.173(+0)
+ 24.2.1.214477(+739)
+ 24.2.2.210399(+1469)
+ 24.2.3.21437(+950)

* Mentoring (Hossein)
  committer...   1 week  1 month 3 months 12 months
  open  89(8)   160(18) 160(-18)  160(-18)
   reviews 318(-132)   1250(44)3594(-124)   12458(-4)
merged 310(-40)1244(104)   3423(54) 12714(121)
 abandoned  15(2)61(6)  174(2)661(5)
   own commits 227(-23) 913(86)2380(77)  9274(45)
review commits  38(-13) 218(-6) 839(-32) 2994(-18)
contributor...   1 week 1 month 3 months12 months
  open  55(18) 103(26) 103(0)   103(0)
   reviews 894(-68)   3050(276)   7930(24)29574(52)
merged  15(-8)  86(-12)377(-8) 1583(-52)
 abandoned   0(-9)  33(-16)279(-9)  699(-5)
   own commits  14(-11) 97(-8) 429(-20)1114(-12)
review commits   0(0)0(0)0(0) 0(0)
+ easyHack statistics:
   needsDevEval 8(8)   needsUXEval 1(1)   cleanup_comments 326(326)
   total 409(409)   assigned 26(26)   open 349(349)
+ top 10 contributors:
  Jakub Kościelak made 5 patches in 1 month, and 5 patches in 1 year
made 4 patches in 1 month, and 7 patches in 1 year
  Kira Tubo made 4 patches in 1 month, and 14 patches in 1 year
  Armin Le Grand (allotropia) made 4 patches in 1 month, and 86 patches 
in 1 year
  

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

2024-05-15 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/calcmove.cxx  |   19 +++
 sw/qa/core/layout/data/ignore-top-margin-table.docx |binary
 sw/source/core/layout/calcmove.cxx  |6 +++---
 3 files changed, 22 insertions(+), 3 deletions(-)

New commits:
commit 07c93a65d2c8579adb100b7ae0c312e1872a1f37
Author: Miklos Vajna 
AuthorDate: Tue May 14 13:49:51 2024 +0200
Commit: Caolán McNamara 
CommitDate: Wed May 15 13:45:49 2024 +0200

tdf#160952 sw: ignore top margin only at page top, not e.g. table top

The bugdoc has a table at the top of the 2nd page and we ignored the top
margin inside the table cell (for the first paragraph), while this
doesn't happen in Word.

As mentioned at

<https://gerrit.libreoffice.org/c/core/+/167221/3#message-c03abf8e8e3cd20d49006058e6b3eb130585ff8f>,
the old code assumed "top of the page" for all frames not having a
previous frame, while that code was only tested with text frames
directly in the body frame of a page frame.

Fix the problem by limiting this "collapse upper spacing" behavior to
frames directly in body frames. This keeps the old bugdoc working, but
is meant to restore the old, wanted behavior in other cases like e.g. in
table cells.

If later it's discovered that upper spacing collapsing is wanted in
other contexts, those are best added on a case by case basis.

(cherry picked from commit 6025ac371bd5cd07c0af550d78db323ad394173b)

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

diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx
index 3e4deec52ae8..a44dc1256b83 100644
--- a/sw/qa/core/layout/calcmove.cxx
+++ b/sw/qa/core/layout/calcmove.cxx
@@ -39,6 +39,25 @@ CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMargin)
 // i.e. the top margin in the first para of a non-first page wasn't 
ignored, like in Word.
 CPPUNIT_ASSERT_EQUAL(static_cast(0), nParaTopMargin);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginTable)
+{
+// Given a DOCX (>= Word 2013) file, with 2 pages:
+// When loading that document:
+createSwDoc("ignore-top-margin-table.docx");
+
+// Then make sure that the paragraph on the 2nd page in B1 has a top 
margin:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+sal_Int32 nParaTopMargin
+= getXPath(pXmlDoc, 
"/root/page[2]/body/tab/row/cell[2]/txt/infos/prtBounds"_ostr,
+   "top"_ostr)
+  .toInt32();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 2000
+// - Actual  : 0
+// i.e. the top margin in B1's first paragraph was ignored, but not in 
Word.
+CPPUNIT_ASSERT_EQUAL(static_cast(2000), nParaTopMargin);
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/layout/data/ignore-top-margin-table.docx 
b/sw/qa/core/layout/data/ignore-top-margin-table.docx
new file mode 100644
index ..c82f6d63c13f
Binary files /dev/null and 
b/sw/qa/core/layout/data/ignore-top-margin-table.docx differ
diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index 081472b98ee3..63c774c25cd6 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1092,9 +1092,9 @@ bool SwFrame::IsCollapseUpper() const
 return false;
 }
 
-// Word >= 2013 style: when we're at the top of the page, but not on the 
first page, then ignore
-// the upper margin for paragraphs.
-if (GetPrev())
+// Word >= 2013 style: when we're at the top of the page's body, but not 
on the first page, then
+// ignore the upper margin for paragraphs.
+if (GetPrev() || !GetUpper() || !GetUpper()->IsBodyFrame())
 {
 return false;
 }


core.git: sw/qa sw/source

2024-05-15 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/calcmove.cxx  |   19 +++
 sw/qa/core/layout/data/ignore-top-margin-table.docx |binary
 sw/source/core/layout/calcmove.cxx  |6 +++---
 3 files changed, 22 insertions(+), 3 deletions(-)

New commits:
commit 6025ac371bd5cd07c0af550d78db323ad394173b
Author: Miklos Vajna 
AuthorDate: Tue May 14 13:49:51 2024 +0200
Commit: Miklos Vajna 
CommitDate: Wed May 15 13:08:02 2024 +0200

tdf#160952 sw: ignore top margin only at page top, not e.g. table top

The bugdoc has a table at the top of the 2nd page and we ignored the top
margin inside the table cell (for the first paragraph), while this
doesn't happen in Word.

As mentioned at

<https://gerrit.libreoffice.org/c/core/+/167221/3#message-c03abf8e8e3cd20d49006058e6b3eb130585ff8f>,
the old code assumed "top of the page" for all frames not having a
previous frame, while that code was only tested with text frames
directly in the body frame of a page frame.

Fix the problem by limiting this "collapse upper spacing" behavior to
frames directly in body frames. This keeps the old bugdoc working, but
is meant to restore the old, wanted behavior in other cases like e.g. in
table cells.

If later it's discovered that upper spacing collapsing is wanted in
other contexts, those are best added on a case by case basis.

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

diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx
index 3e4deec52ae8..a44dc1256b83 100644
--- a/sw/qa/core/layout/calcmove.cxx
+++ b/sw/qa/core/layout/calcmove.cxx
@@ -39,6 +39,25 @@ CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMargin)
 // i.e. the top margin in the first para of a non-first page wasn't 
ignored, like in Word.
 CPPUNIT_ASSERT_EQUAL(static_cast(0), nParaTopMargin);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMarginTable)
+{
+// Given a DOCX (>= Word 2013) file, with 2 pages:
+// When loading that document:
+createSwDoc("ignore-top-margin-table.docx");
+
+// Then make sure that the paragraph on the 2nd page in B1 has a top 
margin:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+sal_Int32 nParaTopMargin
+= getXPath(pXmlDoc, 
"/root/page[2]/body/tab/row/cell[2]/txt/infos/prtBounds"_ostr,
+   "top"_ostr)
+  .toInt32();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 2000
+// - Actual  : 0
+// i.e. the top margin in B1's first paragraph was ignored, but not in 
Word.
+CPPUNIT_ASSERT_EQUAL(static_cast(2000), nParaTopMargin);
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/layout/data/ignore-top-margin-table.docx 
b/sw/qa/core/layout/data/ignore-top-margin-table.docx
new file mode 100644
index ..c82f6d63c13f
Binary files /dev/null and 
b/sw/qa/core/layout/data/ignore-top-margin-table.docx differ
diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index 50dd45579e4b..ea27716aaeed 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1092,9 +1092,9 @@ bool SwFrame::IsCollapseUpper() const
 return false;
 }
 
-// Word >= 2013 style: when we're at the top of the page, but not on the 
first page, then ignore
-// the upper margin for paragraphs.
-if (GetPrev())
+// Word >= 2013 style: when we're at the top of the page's body, but not 
on the first page, then
+// ignore the upper margin for paragraphs.
+if (GetPrev() || !GetUpper() || !GetUpper()->IsBodyFrame())
 {
 return false;
 }


core.git: sw/qa sw/source

2024-05-14 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/data/inline-endnote-and-footnote.doc |binary
 sw/qa/core/layout/ftnfrm.cxx   |   21 +++
 sw/source/core/layout/flowfrm.cxx  |   37 -
 sw/source/core/layout/ftnfrm.cxx   |   45 ++---
 sw/source/core/text/txtftn.cxx |   10 ---
 5 files changed, 83 insertions(+), 30 deletions(-)

New commits:
commit 6885dcd7ec7b82a946d8344bfc27a3e88eecc44a
Author: Miklos Vajna 
AuthorDate: Tue May 14 08:28:33 2024 +0200
Commit: Miklos Vajna 
CommitDate: Tue May 14 12:08:31 2024 +0200

tdf#160984 sw continuous endnotes: switch to a section-based layout

The original layout added in commit
4814e8caa5f06c4fe438dfd7d7315e4a2410ea18 (tdf#124601 sw: add
ContinuousEndnotes layout compat option, 2019-09-30) puts endnotes to
the footnote container on the last page, which fixes the page count but
the endnote position is wrong: should be after the body text, not at the
bottom of the page.

Now that we can have an endnote section (with one or more section frames
at a layout level), we have a container that can span over multiple
pages, is at the end of the document and is inline.

Fix the bad position by:

1) Reverting the layout changes from the old approach, which gives us a
   bad position for the endnote.

2) Creating an endnote section frame on demand in
   SwFootnoteBossFrame::AppendFootnote().

3) Moving part of the endnote to a next page works out of the box, but
   moving part of the endnote to a previous page needs explicit handling
   in SwFlowFrame::MoveBwd(), similar to how SwFrame::GetPrevSctLeaf()
   does this in the simple section case. This needs explicit handling,
   because the body frame of the endnote section is empty, all content goes
   to its endnote container.

Note that this just reimplements the compat flag, but its enablement
(only for DOC import, only for <= 2 endnotes) stays unchanged for now.

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

diff --git a/sw/qa/core/layout/data/inline-endnote-and-footnote.doc 
b/sw/qa/core/layout/data/inline-endnote-and-footnote.doc
new file mode 100644
index ..39c5636e1e12
Binary files /dev/null and 
b/sw/qa/core/layout/data/inline-endnote-and-footnote.doc differ
diff --git a/sw/qa/core/layout/ftnfrm.cxx b/sw/qa/core/layout/ftnfrm.cxx
index 4c874202da3f..71fd3fd67150 100644
--- a/sw/qa/core/layout/ftnfrm.cxx
+++ b/sw/qa/core/layout/ftnfrm.cxx
@@ -63,4 +63,25 @@ CPPUNIT_TEST_FIXTURE(Test, testFlySplitFootnoteLayout)
 CPPUNIT_ASSERT(pPage->FindFootnoteCont());
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testInlineEndnoteAndFootnote)
+{
+// Given a DOC file with an endnote and then a footnote:
+createSwDoc("inline-endnote-and-footnote.doc");
+
+// When laying out that document:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+// Then make sure the footnote is below the endnote:
+// Without the accompanying fix in place, this test would have failed with:
+// - xpath should match exactly 1 node
+// i.e. the endnote was also in the footnote container, not at the end of 
the body text.
+sal_Int32 nEndnoteTop
+= 
parseDump("/root/page/body/section/column/ftncont/ftn/infos/bounds"_ostr, 
"top"_ostr)
+  .toInt32();
+sal_Int32 nFootnoteTop
+= parseDump("/root/page/ftncont/ftn/infos/bounds"_ostr, 
"top"_ostr).toInt32();
+// Endnote at the end of body text, footnote at page bottom.
+CPPUNIT_ASSERT_LESS(nFootnoteTop, nEndnoteTop);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index 37fd20b323d7..1cb5cf7bf47a 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -2257,18 +2257,47 @@ bool SwFlowFrame::MoveBwd( bool  )
 const bool bEndnote = pFootnote->GetAttr()->GetFootnote().IsEndNote();
 const IDocumentSettingAccess& rSettings
 = pFootnote->GetAttrSet()->GetDoc()->getIDocumentSettingAccess();
-if( bEndnote && pFootnote->IsInSct() )
+bool bContEndnotes = 
rSettings.get(DocumentSettingId::CONTINUOUS_ENDNOTES);
+if( bEndnote && pFootnote->IsInSct() && !bContEndnotes)
 {
 SwSectionFrame* pSect = pFootnote->FindSctFrame();
 if( pSect->IsEndnAtEnd() )
 // Endnotes at the end of the section.
 pRef = pSect->FindLastContent( SwFindMode::LastCnt );
 }
-else if (bEndnote && 
rSettings.get(DocumentSettingId::CONTINUOUS_ENDNOTES))
+else if (

core.git: Branch 'libreoffice-24-2' - sw/CppunitTest_sw_core_layout.mk sw/qa sw/source

2024-05-14 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_core_layout.mk  |1 
 sw/qa/core/layout/calcmove.cxx|   44 ++
 sw/qa/core/layout/data/ignore-top-margin.docx |binary
 sw/source/core/inc/frame.hxx  |3 +
 sw/source/core/layout/calcmove.cxx|   32 ++
 sw/source/core/layout/flowfrm.cxx |5 ++
 6 files changed, 85 insertions(+)

New commits:
commit abd90828cf101581a07b9d1c371a8c3156521e9f
Author: Miklos Vajna 
AuthorDate: Tue May 7 08:13:37 2024 +0200
Commit: Michael Stahl 
CommitDate: Tue May 14 11:15:21 2024 +0200

tdf#160952 sw: ignore top margin of para on non-first pages with newer DOCX

The 2nd page of the bugdoc has a single paragraph, with a non-zero top
margin. This is ignored in Word, but wasn't ignored in Writer.

Experimenting with the document, it looks like old Word files also don't
ignore this top margin: it started when the compat mode is upgraded
(from binary DOC or Word 2010) to Word 2023 or newer. Also the top
margin is only ignored for the first paragraph on the page, and only in
case it's not on the first page.

Fix the problem by introducing a new SwFrame::IsCollapseUpper() function
to decide if the upper margin should be collapsed or not, and then by
using it in SwFlowFrame::CalcUpperSpace() at one place where we read the
top margin from the doc model. Take advantage of the fact that we have
related, existing compat flags that tell us if we're in "Word >= 2013"
compat mode: see e.g. GetFlyAnchorBottom(), which explains
DocumentSettingId::TAB_OVER_MARGIN is a good indicator that this is a
"Word <= 2010" document. Also, DocumentSettingId::TAB_OVER_SPACING is an
indicator that this is a Word document, so we want the "TabOverSpacing
&& !TabOverMargin" case.

This doesn't change all reads of the upper spacing of a text node, but
is enough to avoid the unwanted top spacing, as demonstrated by the
bugdoc.

Change-Id: Ibdebdf5f0555256a0b6ed85d07079f14ef69a576
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167252
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 6200d89b905d51776ff4f3c8a84f338655ffaa7f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167221
Reviewed-by: Michael Stahl 

diff --git a/sw/CppunitTest_sw_core_layout.mk b/sw/CppunitTest_sw_core_layout.mk
index 5eb874400d53..d64a43f7d3fb 100644
--- a/sw/CppunitTest_sw_core_layout.mk
+++ b/sw/CppunitTest_sw_core_layout.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_CppunitTest_CppunitTest,sw_core_layout))
 $(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_core_layout))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,sw_core_layout, \
+sw/qa/core/layout/calcmove \
 sw/qa/core/layout/fly \
 sw/qa/core/layout/flycnt \
 sw/qa/core/layout/frmtool \
diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx
new file mode 100644
index ..3e4deec52ae8
--- /dev/null
+++ b/sw/qa/core/layout/calcmove.cxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#include 
+
+namespace
+{
+/// Covers sw/source/core/layout/calcmove.cxx fixes.
+class Test : public SwModelTestBase
+{
+public:
+Test()
+: SwModelTestBase("/sw/qa/core/layout/data/")
+{
+}
+};
+
+CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMargin)
+{
+// Given a DOCX (>= Word 2013) file, with 2 pages:
+// When loading that document:
+createSwDoc("ignore-top-margin.docx");
+
+// Then make sure that the paragraph on the 2nd page has no top margin:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+sal_Int32 nParaTopMargin
+= getXPath(pXmlDoc, "/root/page[2]/body/txt/infos/prtBounds"_ostr, 
"top"_ostr).toInt32();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 0
+// - Actual  : 2400
+// i.e. the top margin in the first para of a non-first page wasn't 
ignored, like in Word.
+CPPUNIT_ASSERT_EQUAL(static_cast(0), nParaTopMargin);
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/layout/data/ignore-top-margin.docx 
b/sw/qa/core/layout/data/ignore-top-margin.docx
new file mode 100644
index ..d05a1358db1e
Binary files /dev/null and b/sw/qa/core/layout/data/ignore-top-margin.docx 
differ
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 604488a18c9f..a86358508182 100644
--- a/sw/source/core/inc/fra

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

2024-05-14 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/layout/layout3.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 48ee8fb96540e68a17599b5db505f9b056dc09f3
Author: Miklos Vajna 
AuthorDate: Mon May 13 08:37:22 2024 +0200
Commit: Caolán McNamara 
CommitDate: Tue May 14 10:25:05 2024 +0200

tdf#160984 sw continuous endnotes: fix CppunitTest_sw_layoutwriter3

These are similar to commit ab3416cad1dd4e706432f9b1a3592cec823c76b0
(tdf#160984 sw continuous endnotes: fix
testContinuousEndnotesMoveBackwards, 2024-05-10).

I've manually verified that the use-case still works as intended, so fix
the failing tests by relaxing the assert a bit: now we accept endnotes
directly under the page frame or under the column frame as well.

This way these tests won't break when we switch to section-based
continuous endnotes.

(cherry picked from commit 9c7acbc937b3b341c10187b837e09cc20399f04e)

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

diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx
index 98c77b18ecdf..d553162f1636 100644
--- a/sw/qa/extras/layout/layout3.cxx
+++ b/sw/qa/extras/layout/layout3.cxx
@@ -1315,7 +1315,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601)
 // i.e. there was a separate endnote page, even when the 
ContinuousEndnotes compat option was
 // on.
 assertXPath(pXmlDoc, "/root/page"_ostr, 2);
-assertXPath(pXmlDoc, "/root/page[2]/ftncont"_ostr, 1);
+assertXPath(pXmlDoc, "/root/page[2]//ftncont"_ostr, 1);
 }
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601b)
@@ -1425,7 +1425,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, 
testContinuousEndnotesInsertPageAtStart)
 // - Expected: 1
 // - Actual  : 0
 // i.e. the footnote container remained on page 2.
-assertXPath(pXmlDoc, "/root/page[3]/ftncont"_ostr, 1);
+assertXPath(pXmlDoc, "/root/page[3]//ftncont"_ostr, 1);
 }
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testContinuousEndnotesDeletePageAtStart)
@@ -1452,7 +1452,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, 
testContinuousEndnotesDeletePageAtStart)
 // - Actual  : 2
 // i.e. the endnote remained on an (otherwise) empty 2nd page.
 assertXPath(pXmlDoc, "/root/page"_ostr, 1);
-assertXPath(pXmlDoc, "/root/page[1]/ftncont"_ostr, 1);
+assertXPath(pXmlDoc, "/root/page[1]//ftncont"_ostr, 1);
 }
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf128399)


core.git: sw/qa

2024-05-13 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/layout/layout3.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9c7acbc937b3b341c10187b837e09cc20399f04e
Author: Miklos Vajna 
AuthorDate: Mon May 13 08:37:22 2024 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 13 12:15:08 2024 +0200

tdf#160984 sw continuous endnotes: fix CppunitTest_sw_layoutwriter3

These are similar to commit ab3416cad1dd4e706432f9b1a3592cec823c76b0
(tdf#160984 sw continuous endnotes: fix
testContinuousEndnotesMoveBackwards, 2024-05-10).

I've manually verified that the use-case still works as intended, so fix
the failing tests by relaxing the assert a bit: now we accept endnotes
directly under the page frame or under the column frame as well.

This way these tests won't break when we switch to section-based
continuous endnotes.

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

diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx
index e907f6bc8ebf..329c81847313 100644
--- a/sw/qa/extras/layout/layout3.cxx
+++ b/sw/qa/extras/layout/layout3.cxx
@@ -1444,7 +1444,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601)
 // i.e. there was a separate endnote page, even when the 
ContinuousEndnotes compat option was
 // on.
 assertXPath(pXmlDoc, "/root/page"_ostr, 2);
-assertXPath(pXmlDoc, "/root/page[2]/ftncont"_ostr, 1);
+assertXPath(pXmlDoc, "/root/page[2]//ftncont"_ostr, 1);
 }
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf124601b)
@@ -1554,7 +1554,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, 
testContinuousEndnotesInsertPageAtStart)
 // - Expected: 1
 // - Actual  : 0
 // i.e. the footnote container remained on page 2.
-assertXPath(pXmlDoc, "/root/page[3]/ftncont"_ostr, 1);
+assertXPath(pXmlDoc, "/root/page[3]//ftncont"_ostr, 1);
 }
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testContinuousEndnotesDeletePageAtStart)
@@ -1581,7 +1581,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, 
testContinuousEndnotesDeletePageAtStart)
 // - Actual  : 2
 // i.e. the endnote remained on an (otherwise) empty 2nd page.
 assertXPath(pXmlDoc, "/root/page"_ostr, 1);
-assertXPath(pXmlDoc, "/root/page[1]/ftncont"_ostr, 1);
+assertXPath(pXmlDoc, "/root/page[1]//ftncont"_ostr, 1);
 }
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf128399)


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

2024-05-13 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/layout.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b6f42a6006dd0b0e4234ed5e0f536b7f4d8a
Author: Miklos Vajna 
AuthorDate: Fri May 10 08:07:41 2024 +0200
Commit: Caolán McNamara 
CommitDate: Mon May 13 12:06:55 2024 +0200

tdf#160984 sw continuous endnotes: fix testContinuousEndnotesMoveBackwards

Once continuous endnotes are in a section, this failed, even if the
generated layout is an improvement.

The layout will put the endnotes to a section, which will be directly
after the end of the body text, which is closer to what Word does, but
makes the test fail, since the foot/endnote container is no longer
directly under the page frame (the new tree is page -> body -> section
-> column -> ftncont).

Fix the problem by relaxing the assert to only check which pages have
footnote containers, which passes with and without the move to
section-based continuous endnotes, but still fails if endnotes go to
their own page, which was the original problem to be tested (endnotes
remained on page 3 and didn't move backwards).

The assert for the number of pages can remain unchanged.

(cherry picked from commit ab3416cad1dd4e706432f9b1a3592cec823c76b0)

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

diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index 5971e870304d..9cae825b38b4 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -179,9 +179,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, 
testContinuousEndnotesMoveBackwards)
 // - Expected: 0
 // - Actual  : 1
 // i.e. there were unexpected endnotes on page 1.
-assertXPath(pLayout, "/root/page[1]/ftncont"_ostr, 0);
+assertXPath(pLayout, "/root/page[1]//ftncont"_ostr, 0);
 // All endnotes are in a container on page 2.
-assertXPath(pLayout, "/root/page[2]/ftncont"_ostr, 1);
+assertXPath(pLayout, "/root/page[2]//ftncont"_ostr, 1);
 }
 
 CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testAnchorPositionBasedOnParagraph)


core.git: include/svx svx/source

2024-05-13 Thread Miklos Vajna (via logerrit)
 include/svx/svdundo.hxx   |   10 +++
 svx/source/svdraw/svdundo.cxx |   56 +-
 2 files changed, 33 insertions(+), 33 deletions(-)

New commits:
commit 74bd51629eed7eb34aef9acbb93c110525f8ef7d
Author: Miklos Vajna 
AuthorDate: Mon May 13 08:33:27 2024 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 13 10:32:50 2024 +0200

svx: prefix members of SdrUndoAttrObj

See tdf#94879 for motivation.

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

diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx
index 824f36f06efc..5af5c584eda1 100644
--- a/include/svx/svdundo.hxx
+++ b/include/svx/svdundo.hxx
@@ -155,17 +155,17 @@ class SVXCORE_DLLPUBLIC SdrUndoAttrObj : public SdrUndoObj
 // FIXME: Or should we better remember the StyleSheetNames?
 rtl::Reference< SfxStyleSheet > mxUndoStyleSheet;
 rtl::Reference< SfxStyleSheet > mxRedoStyleSheet;
-bool bStyleSheet;
-bool bHaveToTakeRedoSet;
+bool m_bStyleSheet;
+bool m_bHaveToTakeRedoSet;
 
 // When assigning TextItems to a drawing object with text:
-std::optional pTextUndo;
+std::optional m_pTextUndo;
 // #i8508#
 // The text rescue mechanism needs also to be implemented for redo actions.
-std::optional pTextRedo;
+std::optional m_pTextRedo;
 
 // If we have a group object:
-std::unique_ptr pUndoGroup;
+std::unique_ptr m_pUndoGroup;
 
 protected:
 // Helper to ensure StyleSheet is in pool (provided by SdrModel from 
SdrObject)
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 18b248ba5960..1b52ee945957 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -250,9 +250,9 @@ void 
SdrUndoAttrObj::ensureStyleSheetInStyleSheetPool(SfxStyleSheetBasePool& rSt
 
 SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool 
bSaveText)
 : SdrUndoObj(rNewObj)
-, bHaveToTakeRedoSet(true)
+, m_bHaveToTakeRedoSet(true)
 {
-bStyleSheet = bStyleSheet1;
+m_bStyleSheet = bStyleSheet1;
 
 SdrObjList* pOL = rNewObj.GetSubList();
 bool bIsGroup(pOL!=nullptr && pOL->GetObjCount());
@@ -261,11 +261,11 @@ SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool 
bStyleSheet1, bool bSave
 if(bIsGroup)
 {
 // it's a group object!
-pUndoGroup.reset(new SdrUndoGroup(mxObj->getSdrModelFromSdrObject()));
+m_pUndoGroup.reset(new 
SdrUndoGroup(mxObj->getSdrModelFromSdrObject()));
 
 for (const rtl::Reference& pObj : *pOL)
 {
-pUndoGroup->AddAction(
+m_pUndoGroup->AddAction(
 std::make_unique(*pObj, bStyleSheet1));
 }
 }
@@ -275,14 +275,14 @@ SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool 
bStyleSheet1, bool bSave
 
 moUndoSet.emplace( mxObj->GetMergedItemSet() );
 
-if(bStyleSheet)
+if(m_bStyleSheet)
 mxUndoStyleSheet = mxObj->GetStyleSheet();
 
 if(bSaveText)
 {
 auto p = mxObj->GetOutlinerParaObject();
 if(p)
-pTextUndo = *p;
+m_pTextUndo = *p;
 }
 }
 
@@ -290,9 +290,9 @@ SdrUndoAttrObj::~SdrUndoAttrObj()
 {
 moUndoSet.reset();
 moRedoSet.reset();
-pUndoGroup.reset();
-pTextUndo.reset();
-pTextRedo.reset();
+m_pUndoGroup.reset();
+m_pTextUndo.reset();
+m_pTextRedo.reset();
 }
 
 void SdrUndoAttrObj::Undo()
@@ -303,27 +303,27 @@ void SdrUndoAttrObj::Undo()
 // Trigger PageChangeCall
 ImpShowPageOfThisObject();
 
-if(!pUndoGroup || bIs3DScene)
+if(!m_pUndoGroup || bIs3DScene)
 {
-if(bHaveToTakeRedoSet)
+if(m_bHaveToTakeRedoSet)
 {
-bHaveToTakeRedoSet = false;
+m_bHaveToTakeRedoSet = false;
 
 moRedoSet.emplace( mxObj->GetMergedItemSet() );
 
-if(bStyleSheet)
+if(m_bStyleSheet)
 mxRedoStyleSheet = mxObj->GetStyleSheet();
 
-if(pTextUndo)
+if(m_pTextUndo)
 {
 // #i8508#
 auto p = mxObj->GetOutlinerParaObject();
 if(p)
-pTextRedo = *p;
+m_pTextRedo = *p;
 }
 }
 
-if(bStyleSheet)
+if(m_bStyleSheet)
 {
 mxRedoStyleSheet = mxObj->GetStyleSheet();
 SfxStyleSheet* pSheet = mxUndoStyleSheet.get();
@@ -392,15 +392,15 @@ void SdrUndoAttrObj::Undo()
 
 mxObj->GetProperties().BroadcastItemChange(aItemChange);
 
-if(pTextUndo)
+if(m_pTextUndo)
 {
-mxObj->SetOutlinerParaObject(*pTextUndo);
+mxObj->SetOutlinerParaObject(*m_pTextUndo);
 }
 }
 
-if(pUndoGroup)

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

2024-05-10 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 e747e6df648a7ff076663ab376a4dbbc041b5180
Author: Miklos Vajna 
AuthorDate: Thu May 9 08:20:21 2024 +0200
Commit: Caolán McNamara 
CommitDate: Fri May 10 16:03:56 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.

(cherry picked from commit 8bae684c93bd23bbe98707ba9cf75d1a39427131)

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

diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 54458032f188..054495eeea80 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 3debf367f05a..ac57bd815d5f 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -52,6 +52,8 @@ class SW_DLLPUBLIC SwSectionFrame final: public 
SwLayoutFrame, public SwFlowFram
 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 0dd64c6aecff..378e451b9f89 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/qa

2024-05-10 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/layout.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ab3416cad1dd4e706432f9b1a3592cec823c76b0
Author: Miklos Vajna 
AuthorDate: Fri May 10 08:07:41 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 10 09:05:24 2024 +0200

tdf#160984 sw continuous endnotes: fix testContinuousEndnotesMoveBackwards

Once continuous endnotes are in a section, this failed, even if the
generated layout is an improvement.

The layout will put the endnotes to a section, which will be directly
after the end of the body text, which is closer to what Word does, but
makes the test fail, since the foot/endnote container is no longer
directly under the page frame (the new tree is page -> body -> section
-> column -> ftncont).

Fix the problem by relaxing the assert to only check which pages have
footnote containers, which passes with and without the move to
section-based continuous endnotes, but still fails if endnotes go to
their own page, which was the original problem to be tested (endnotes
remained on page 3 and didn't move backwards).

The assert for the number of pages can remain unchanged.

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

diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index 5971e870304d..9cae825b38b4 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -179,9 +179,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, 
testContinuousEndnotesMoveBackwards)
 // - Expected: 0
 // - Actual  : 1
 // i.e. there were unexpected endnotes on page 1.
-assertXPath(pLayout, "/root/page[1]/ftncont"_ostr, 0);
+assertXPath(pLayout, "/root/page[1]//ftncont"_ostr, 0);
 // All endnotes are in a container on page 2.
-assertXPath(pLayout, "/root/page[2]/ftncont"_ostr, 1);
+assertXPath(pLayout, "/root/page[2]//ftncont"_ostr, 1);
 }
 
 CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testAnchorPositionBasedOnParagraph)


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

2024-05-09 Thread Miklos Vajna (via logerrit)
 sw/inc/ftninfo.hxx|5 +
 sw/source/core/doc/docftn.cxx |   19 +++
 sw/source/core/doc/docnew.cxx |1 +
 3 files changed, 25 insertions(+)

New commits:
commit 3ac458599fd3dd532c9b4cc02ffa446d1a0e3dc2
Author: Miklos Vajna 
AuthorDate: Wed May 8 08:59:47 2024 +0200
Commit: Caolán McNamara 
CommitDate: Thu May 9 17:12:24 2024 +0200

tdf#160984 sw continuous endnotes: introduce an endnote section

Word lays out endnotes at the end of the document inline after body
text, Writer puts them on one or more separate endnote pages.

There was already an attempt in the past to resolve this difference, see
commit 4814e8caa5f06c4fe438dfd7d7315e4a2410ea18 (tdf#124601 sw: add
ContinuousEndnotes layout compat option, 2019-09-30). The approach back
then was to map such endnotes to footnotes, so the extra, unwanted page
doesn't appear. This turned out to be not working too well, the compat
option is only enabled for DOC, and even there commit
dc11f5b151e1a2ea2623fc8cf806a400763955d9 (tdf#143445 DOC import: limit
the usage of the CONTINUOUS_ENDNOTES compat flag, 2023-05-23) limited
the usage of the compat flag to 1 or 2 endnotes only.

Coming back to this, try a new approach: create a section that more or
less exists only at a layout level and put endnotes into that section.
This allows reusing all the complex logic on how to lay out endnotes
inline, on one or more pages. The plan is that this new approach is more
robust, can replace the old continuous endnotes layout code and then can
be enabled for DOCX as well.

This commit just introduces the backing section format and SwSection for
that special "endnotes section" (it's special because SwSection is
usually owned by an SwSectionNode, but here there is no doc model node
for the SwSection), SwFootnoteBossFrame::AppendFootnote() doesn't try to
use the new SwEndNoteInfo::GetSwSection() yet.

(cherry picked from commit 90f19126fa405a0632eae4ee8525b66bbce12625)

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

diff --git a/sw/inc/ftninfo.hxx b/sw/inc/ftninfo.hxx
index 17742687c944..c5490ed885d0 100644
--- a/sw/inc/ftninfo.hxx
+++ b/sw/inc/ftninfo.hxx
@@ -28,12 +28,14 @@ class SwTextFormatColl;
 class SwPageDesc;
 class SwCharFormat;
 class SwDoc;
+class SwSection;
 
 class SW_DLLPUBLIC SwEndNoteInfo : public SwClient
 {
 mutable sw::WriterMultiListener m_aDepends;
 mutable SwTextFormatColl* m_pTextFormatColl;
 mutable SwPageDesc* m_pPageDesc;
+mutable std::unique_ptr m_pSwSection;
 mutable SwCharFormat* m_pCharFormat;
 mutable SwCharFormat* m_pAnchorFormat;
 OUString m_sPrefix;
@@ -51,6 +53,9 @@ public:
 bool KnowsPageDesc() const;
 bool DependsOn(const SwPageDesc*) const;
 
+SwSection* GetSwSection(SwDoc& rDoc) const;
+void ResetSwSection();
+
 void SetFootnoteTextColl(SwTextFormatColl& rColl);
 SwTextFormatColl* GetFootnoteTextColl() const { return m_pTextFormatColl; 
} // can be 0.
 
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index 16f6694c94c5..f211dcdcc9f4 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -35,6 +35,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 SwEndNoteInfo& SwEndNoteInfo::operator=(const SwEndNoteInfo& rInfo)
 {
@@ -130,6 +132,23 @@ void SwEndNoteInfo::ChgPageDesc(SwPageDesc* pDesc)
 m_aDepends.StartListening(m_pPageDesc);
 }
 
+SwSection* SwEndNoteInfo::GetSwSection(SwDoc& rDoc) const
+{
+if (!m_pSwSection)
+{
+SwSectionFormat* pFormat = rDoc.MakeSectionFormat();
+pFormat->SetFormatName(UNO_NAME_ENDNOTE);
+pFormat->SetFormatAttr(SwFormatEndAtTextEnd(FTNEND_ATTXTEND));
+m_pSwSection.reset(new SwSection(SectionType::Content, 
pFormat->GetName(), *pFormat));
+}
+return m_pSwSection.get();
+}
+
+void SwEndNoteInfo::ResetSwSection()
+{
+m_pSwSection.reset();
+}
+
 void SwEndNoteInfo::SetFootnoteTextColl(SwTextFormatColl& rFormat)
 {
 m_aDepends.EndListening(m_pTextFormatColl);
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index d6e885e8219a..bb0cd32d2c19 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -503,6 +503,7 @@ SwDoc::~SwDoc()
 // do not have any dependencies anymore.
 m_pNodes->DelNodes( SwNodeIndex(*m_pNodes), m_pNodes->Count() );
 rUndoNodes.DelNodes( SwNodeIndex( rUndoNodes ), rUndoNodes.Count() );
+mpEndNoteInfo->ResetSwSection();
 
 // clear TOX after nodes - TOXMarks are gone now so SwTOXType has no 
clients
 for (const auto& pType : *mpTOXTypes)


ESC meeting minutes: 2024-05-09

2024-05-09 Thread Miklos Vajna

* Present:
+ Cloph, Gabriel, Heiko, Hossein, Ilmari, Jonathan, Olivier, Xisco, 
sockseight, Caolan, Stephane, Miklos

* Completed Action Items:

* Pending Action Items:

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 release: this week, tomorrow
+ 24.2: 24.2.4 RC1 in 1 week
+ 24.8: first alpha this week, from master, tomorrow
  + week 23 is the feature freeze, 4 weeks
+ string / UI freeze 4 weeks after that
  + if you have a late feature proposal, announce that here
+ MAR-based updater will be enabled by default on Windows, but not Linux 
(Hossein)
  + rpm/deb update is handled by distro packages
  + for the ones taking binaries from TDF
  + TDF to provide rpm/deb repos?
  + the files are hosted already
  + just the repo defs are missing
  + suggesting to provide these repos
  + proposal is to povide repos and ignore MAR on Linux for now
  + interested in doing the scripting work? (Miklos)
+ the important part is the description / dependencies (Hossein)
+ willing to help
  + linux downloads are 2% of TDF downloads (Cloph)
+ so not a huge amount, but not objecting
+ only the the ones which are covered by rpm/deb binaries
  + what is the lag between Ubuntu-provided packages / TDF releases? 
(Olivier)
+ the package from Ubuntu follows TDF quickly
+ similar with Debian, thanks to Rene (Cloph)
  + with actively supported versions
+ see LibreOffice 7.3.7 for Ubuntu 22.04 
https://packages.ubuntu.com/jammy/libreoffice (Hossein)

* Documentation (Olivier)
+ Helpcontents2
   + Updates and fixes (A Gelmini. S. Horacek, fitoshido)
   + Changes in makefiles (cloph)
   + Updates in doc properties (Dublin Core) by Dione Maddern
+ Core
   + Extended tips for sparklines
+ Guides
   + important fix by M. Stahl will trigger format review
  + in all guides,
  + starting after LO 24.2.4
  + tdf#159366
+ bugs with >20 comments
  + hard to follow, to understand what is the actual request
  + sometimes asking: if this feature is still used
  + thanks to the precise bugreports
+ Bugzilla Documentation statistics
263(263) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 14(5)39(2) 107(7) 225(4)
 commented 20(10)   61(0) 255(5) 854(6)
  resolved  7(2)23(5)  54(6) 121(4)
+ top 10 contributors:
  Olivier Hallot made 42 changes in 1 month, and 239 changes in 1 year
  Stéphane Guillou made 28 changes in 1 month, and 253 changes in 1 year
  Vernon, Stuart Foote made 22 changes in 1 month, and 107 changes in 1 
year
  Ilmari Lauhakangas made 10 changes in 1 month, and 73 changes in 1 
year
  Kaganski, Mike made 8 changes in 1 month, and 74 changes in 1 year
  Nabet, Julien made 6 changes in 1 month, and 59 changes in 1 year
  Cor Nouws made 5 changes in 1 month, and 8 changes in 1 year
  Heiko Tietze made 4 changes in 1 month, and 76 changes in 1 year
  nobu made 4 changes in 1 month, and 16 changes in 1 year
  Kira Tubo made 2 changes in 1 month, and 2 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
240(240) (topicUI) bugs open, 35(35) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
 added  4(-1)10(1) 15(-1)  21(-3)
 commented 64(48)   186(30)   525(-6)1761(-60)
   removed  0(-2) 4(-1) 5(0)   12(-1)
  resolved  8(2) 31(1) 79(-2) 308(-7)
+ top 10 contributors:
  Heiko Tietze made 110 changes in 1 month, and 1031 changes in 1 year
  Vernon, Stuart Foote made 108 changes in 1 month, and 317 changes in 
1 year
  Stéphane Guillou made 51 changes in 1 month, and 621 changes in 1 year
  Cor Nouws made 21 changes in 1 month, and 33 changes in 1 year
  Dieter made 18 changes in 1 month, and 139 changes in 1 year
  Ilmari Lauhakangas made 16 changes in 1 month, and 131 changes in 1 
year
  Eyal Rozenberg made 10 changes in 1 month, and 125 changes in 1 year
  Ady made 6 changes in 1 month, and 122 changes in 1 year
  jan d made 5 changes in 1 month, and 5 changes in 1 year
  *UNKNOWN* made 5 changes in 1 month, and 5 changes in 1 year
+ [Bug 161002] Missing item "Insert/Filed/More Fields.." in LibreOffice Draw
+ [Bug 160986] show 'X %' instead of 'X%'
+ [Bug 153309] Prevent direct formatting on writer by a password.
 -> + [Bug 98902] Right clicking on selected text unselects it if the cursor is 
on
   a misspelled word
+ [Bug 160955] When selecting an alternative link target for an OLE object, 
button
  says 

ESC meeting minutes: 2024-05-09

2024-05-09 Thread Miklos Vajna

* Present:
+ Cloph, Gabriel, Heiko, Hossein, Ilmari, Jonathan, Olivier, Xisco, 
sockseight, Caolan, Stephane, Miklos

* Completed Action Items:

* Pending Action Items:

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 release: this week, tomorrow
+ 24.2: 24.2.4 RC1 in 1 week
+ 24.8: first alpha this week, from master, tomorrow
  + week 23 is the feature freeze, 4 weeks
+ string / UI freeze 4 weeks after that
  + if you have a late feature proposal, announce that here
+ MAR-based updater will be enabled by default on Windows, but not Linux 
(Hossein)
  + rpm/deb update is handled by distro packages
  + for the ones taking binaries from TDF
  + TDF to provide rpm/deb repos?
  + the files are hosted already
  + just the repo defs are missing
  + suggesting to provide these repos
  + proposal is to povide repos and ignore MAR on Linux for now
  + interested in doing the scripting work? (Miklos)
+ the important part is the description / dependencies (Hossein)
+ willing to help
  + linux downloads are 2% of TDF downloads (Cloph)
+ so not a huge amount, but not objecting
+ only the the ones which are covered by rpm/deb binaries
  + what is the lag between Ubuntu-provided packages / TDF releases? 
(Olivier)
+ the package from Ubuntu follows TDF quickly
+ similar with Debian, thanks to Rene (Cloph)
  + with actively supported versions
+ see LibreOffice 7.3.7 for Ubuntu 22.04 
https://packages.ubuntu.com/jammy/libreoffice (Hossein)

* Documentation (Olivier)
+ Helpcontents2
   + Updates and fixes (A Gelmini. S. Horacek, fitoshido)
   + Changes in makefiles (cloph)
   + Updates in doc properties (Dublin Core) by Dione Maddern
+ Core
   + Extended tips for sparklines
+ Guides
   + important fix by M. Stahl will trigger format review
  + in all guides,
  + starting after LO 24.2.4
  + tdf#159366
+ bugs with >20 comments
  + hard to follow, to understand what is the actual request
  + sometimes asking: if this feature is still used
  + thanks to the precise bugreports
+ Bugzilla Documentation statistics
263(263) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 14(5)39(2) 107(7) 225(4)
 commented 20(10)   61(0) 255(5) 854(6)
  resolved  7(2)23(5)  54(6) 121(4)
+ top 10 contributors:
  Olivier Hallot made 42 changes in 1 month, and 239 changes in 1 year
  Stéphane Guillou made 28 changes in 1 month, and 253 changes in 1 year
  Vernon, Stuart Foote made 22 changes in 1 month, and 107 changes in 1 
year
  Ilmari Lauhakangas made 10 changes in 1 month, and 73 changes in 1 
year
  Kaganski, Mike made 8 changes in 1 month, and 74 changes in 1 year
  Nabet, Julien made 6 changes in 1 month, and 59 changes in 1 year
  Cor Nouws made 5 changes in 1 month, and 8 changes in 1 year
  Heiko Tietze made 4 changes in 1 month, and 76 changes in 1 year
  nobu made 4 changes in 1 month, and 16 changes in 1 year
  Kira Tubo made 2 changes in 1 month, and 2 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
240(240) (topicUI) bugs open, 35(35) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
 added  4(-1)10(1) 15(-1)  21(-3)
 commented 64(48)   186(30)   525(-6)1761(-60)
   removed  0(-2) 4(-1) 5(0)   12(-1)
  resolved  8(2) 31(1) 79(-2) 308(-7)
+ top 10 contributors:
  Heiko Tietze made 110 changes in 1 month, and 1031 changes in 1 year
  Vernon, Stuart Foote made 108 changes in 1 month, and 317 changes in 
1 year
  Stéphane Guillou made 51 changes in 1 month, and 621 changes in 1 year
  Cor Nouws made 21 changes in 1 month, and 33 changes in 1 year
  Dieter made 18 changes in 1 month, and 139 changes in 1 year
  Ilmari Lauhakangas made 16 changes in 1 month, and 131 changes in 1 
year
  Eyal Rozenberg made 10 changes in 1 month, and 125 changes in 1 year
  Ady made 6 changes in 1 month, and 122 changes in 1 year
  jan d made 5 changes in 1 month, and 5 changes in 1 year
  *UNKNOWN* made 5 changes in 1 month, and 5 changes in 1 year
+ [Bug 161002] Missing item "Insert/Filed/More Fields.." in LibreOffice Draw
+ [Bug 160986] show 'X %' instead of 'X%'
+ [Bug 153309] Prevent direct formatting on writer by a password.
 -> + [Bug 98902] Right clicking on selected text unselects it if the cursor is 
on
   a misspelled word
+ [Bug 160955] When selecting an alternative link target for an OLE object, 
button
  says 

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

2024-05-09 Thread Miklos Vajna (via logerrit)
 sw/source/uibase/shells/drwbassh.cxx |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 0f7127aa6019363d15a167ab492ba06e0347174a
Author: Miklos Vajna 
AuthorDate: Thu May 9 13:09:43 2024 +0200
Commit: Caolán McNamara 
CommitDate: Thu May 9 14:59:53 2024 +0200

sw: fix -Wshadow warnings


/home/vmiklos/git/libreoffice/co-24.04/sw/source/uibase/shells/drwbassh.cxx: In 
lambda function:

/home/vmiklos/git/libreoffice/co-24.04/sw/source/uibase/shells/drwbassh.cxx:656:38:
 error: declaration of ‘aTitle’ shadows a previous local [-Werror=shadow]
  656 | OUString aTitle;
  |  ^~

/home/vmiklos/git/libreoffice/co-24.04/sw/source/uibase/shells/drwbassh.cxx:643:26:
 note: shadowed declaration is here
  643 | OUString aTitle(pSelected->GetTitle());
  |  ^~

/home/vmiklos/git/libreoffice/co-24.04/sw/source/uibase/shells/drwbassh.cxx:657:38:
 error: declaration of ‘aDescription’ shadows a previous local [-Werror=shadow]
  657 | OUString aDescription;
  |  ^~~~

/home/vmiklos/git/libreoffice/co-24.04/sw/source/uibase/shells/drwbassh.cxx:644:26:
 note: shadowed declaration is here
  644 | OUString 
aDescription(pSelected->GetDescription());
  |  ^~~~

/home/vmiklos/git/libreoffice/co-24.04/sw/source/uibase/shells/drwbassh.cxx:658:34:
 error: declaration of ‘isDecorative’ shadows a previous local [-Werror=shadow]
  658 | bool isDecorative;
  |  ^~~~

/home/vmiklos/git/libreoffice/co-24.04/sw/source/uibase/shells/drwbassh.cxx:645:22:
 note: shadowed declaration is here
  645 | bool 
isDecorative(pSelected->IsDecorative());
  |  ^~~~
cc1plus: all warnings being treated as errors

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

diff --git a/sw/source/uibase/shells/drwbassh.cxx 
b/sw/source/uibase/shells/drwbassh.cxx
index ebd1eb3ce705..c98e97eb7aba 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -653,17 +653,17 @@ void SwDrawBaseShell::Execute(SfxRequest const )
 {
 if (nResult == RET_OK)
 {
-OUString aTitle;
-OUString aDescription;
-bool isDecorative;
+OUString aNewTitle;
+OUString aNewDescription;
+bool newIsDecorative;
 
-pDlg->GetTitle(aTitle);
-pDlg->GetDescription(aDescription);
-pDlg->IsDecorative(isDecorative);
+pDlg->GetTitle(aNewTitle);
+pDlg->GetDescription(aNewDescription);
+pDlg->IsDecorative(newIsDecorative);
 
-pSelected->SetTitle(aTitle);
-pSelected->SetDescription(aDescription);
-pSelected->SetDecorative(isDecorative);
+pSelected->SetTitle(aNewTitle);
+pSelected->SetDescription(aNewDescription);
+pSelected->SetDecorative(newIsDecorative);
 
 pSh->SetModified();
 }


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

2024-05-09 Thread Miklos Vajna (via logerrit)
 sd/source/ui/view/drviews2.cxx |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 943913f74c26210ebf3ed04f36412e3c45b76f0e
Author: Miklos Vajna 
AuthorDate: Thu May 9 11:52:13 2024 +0200
Commit: Szymon Kłos 
CommitDate: Thu May 9 12:06:48 2024 +0200

sd: fix -Wshadow warnings


/home/vmiklos/git/libreoffice/co-24.04/sd/source/ui/view/drviews2.cxx: In 
lambda function:

/home/vmiklos/git/libreoffice/co-24.04/sd/source/ui/view/drviews2.cxx:2713:38: 
error: declaration of ‘aTitle’ shadows a previous local [-Werror=shadow]
 2713 | OUString aTitle;
  |  ^~

/home/vmiklos/git/libreoffice/co-24.04/sd/source/ui/view/drviews2.cxx:2700:26: 
note: shadowed declaration is here
 2700 | OUString aTitle(pSelected->GetTitle());
  |  ^~

/home/vmiklos/git/libreoffice/co-24.04/sd/source/ui/view/drviews2.cxx:2714:38: 
error: declaration of ‘aDescription’ shadows a previous local [-Werror=shadow]
 2714 | OUString aDescription;
  |  ^~~~

/home/vmiklos/git/libreoffice/co-24.04/sd/source/ui/view/drviews2.cxx:2701:26: 
note: shadowed declaration is here
 2701 | OUString 
aDescription(pSelected->GetDescription());
  |  ^~~~

/home/vmiklos/git/libreoffice/co-24.04/sd/source/ui/view/drviews2.cxx:2715:34: 
error: declaration of ‘isDecorative’ shadows a previous local [-Werror=shadow]
 2715 | bool isDecorative;
  |  ^~~~

/home/vmiklos/git/libreoffice/co-24.04/sd/source/ui/view/drviews2.cxx:2702:22: 
note: shadowed declaration is here
 2702 | bool 
isDecorative(pSelected->IsDecorative());
  |  ^~~~
cc1plus: all warnings being treated as errors

Change-Id: I036105d084010c66b8aab75befdef590408b25ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167381
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index a7ed100977bf..d149c9633d7f 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -2710,17 +2710,17 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 {
 if (nResult == RET_OK)
 {
-OUString aTitle;
-OUString aDescription;
-bool isDecorative;
+OUString aNewTitle;
+OUString aNewDescription;
+bool newIsDecorative;
 
-pDlg->GetTitle(aTitle);
-pDlg->GetDescription(aDescription);
-pDlg->IsDecorative(isDecorative);
+pDlg->GetTitle(aNewTitle);
+pDlg->GetDescription(aNewDescription);
+pDlg->IsDecorative(newIsDecorative);
 
-pSelected->SetTitle(aTitle);
-pSelected->SetDescription(aDescription);
-pSelected->SetDecorative(isDecorative);
+pSelected->SetTitle(aNewTitle);
+pSelected->SetDescription(aNewDescription);
+pSelected->SetDecorative(newIsDecorative);
 }
 pDlg->disposeOnce();
 }


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: Branch 'distro/collabora/co-24.04' - sw/qa sw/source

2024-05-09 Thread Miklos Vajna (via logerrit)
 sw/qa/core/txtnode/data/plain-content-control-copy.docx |binary
 sw/qa/core/txtnode/txtnode.cxx  |   23 
 sw/source/core/txtnode/thints.cxx   |4 ++
 3 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 47c917bcdbffd6423f50a3d970ed45ce06b9061e
Author: Miklos Vajna 
AuthorDate: Tue Apr 30 08:44:59 2024 +0200
Commit: Miklos Vajna 
CommitDate: Thu May 9 09:33:22 2024 +0200

tdf#159683 sw content controls, plain text: fix crash with the clipboard doc

Regression from commit c804c5354855188b5a37219cfe11dc079dc235f4 (sw
content control: fix lost properties on copy, 2023-03-10), select
a plain text content control, copy it to the clipboard, quit: assertion
fails during shutdown because the doc's "placeholder text" char style is
still referenced by a client.

What happens here is that the SwContentControl copy ctor copies the
plain text flag, and that flag is only read in SwTextNode::InsertHint(),
so that causes the problem. Note how that code is inconsistent: we avoid
the creation of dummy characters in the copy case, but we still try to
adjust the start/end of the content control attribute in the copy case,
which makes not much sense.

Fix the problem by not adjusting the content control attribute
boundaries in the copy case, since the original intention was to do
thees corrections only at a UI level, during interactive edit.

It's not clear why this inconsistency had an influence on the clients of
the char style, though.

Change-Id: I86b0516464f24fc453dcd97588dafb8afd010a9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166882
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 06aeb9c61d50bba7edafe17f9d3513af26b0782f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167311
Reviewed-by: Xisco Fauli 
(cherry picked from commit 32616609c788aa1cf0837af0f387390a23de1766)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167375
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/qa/core/txtnode/data/plain-content-control-copy.docx 
b/sw/qa/core/txtnode/data/plain-content-control-copy.docx
new file mode 100644
index ..80fecae26d5b
Binary files /dev/null and 
b/sw/qa/core/txtnode/data/plain-content-control-copy.docx differ
diff --git a/sw/qa/core/txtnode/txtnode.cxx b/sw/qa/core/txtnode/txtnode.cxx
index c2df8a407e69..be4d97190251 100644
--- a/sw/qa/core/txtnode/txtnode.cxx
+++ b/sw/qa/core/txtnode/txtnode.cxx
@@ -539,6 +539,29 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, 
testSplitFlyAnchorSplit)
 CPPUNIT_ASSERT_EQUAL(OUString("PortionType::Fly"), aPortionType);
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testPlainContentControlCopy)
+{
+// Given a document with a plain text content control, all text selected 
and copied to the
+// clipboard:
+createSwDoc("plain-content-control-copy.docx");
+SwDocShell* pDocShell = getSwDocShell();
+SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+pWrtShell->SelAll();
+{
+rtl::Reference xTransfer = new 
SwTransferable(*pWrtShell);
+xTransfer->Copy();
+}
+
+// When closing that document, then make sure we don't crash on shutdown:
+uno::Reference xModel(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xFrame(xModel->getCurrentController()->getFrame(),
+uno::UNO_QUERY);
+// Without the accompanying fix in place, this resulted in an assertion 
failure, a char style
+// still had clients by the time it was deleted.
+xFrame->close(false);
+mxComponent.clear();
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index cf5e1ff1cccf..c499294f4f26 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1700,7 +1700,9 @@ bool SwTextNode::InsertHint( SwTextAttr * const pAttr, 
const SetAttrMode nMode )
 // for all of its content.
 auto* pTextContentControl = static_txtattr_cast(
 GetTextAttrAt(pAttr->GetStart(), RES_TXTATR_CONTENTCONTROL, 
::sw::GetTextAttrMode::Parent));
-if (pTextContentControl)
+// If the caller is SwTextNode::CopyText, we just copy an existing 
attribute, no need to
+// correct it.
+if (pTextContentControl && !(nMode & SetAttrMode::NOTXTATRCHR))
 {
 auto& rFormatContentControl
 = 
static_cast(pTextContentControl->GetAttr());


core.git: Changes to 'refs/tags/cp-24.04.2-1'

2024-05-08 Thread Miklos Vajna (via logerrit)
Tag 'cp-24.04.2-1' created by Aron Budea  at 
2024-05-08 15:21 +

cp-24.04.2-1

Changes since cp-24.04.1-4-81:
---
 0 files changed
---


ESC meeting agenda: 2024-05-09 16:00 CEST

2024-05-08 Thread Miklos Vajna

Hi,

The prototype agenda is below. Extra items are appreciated either in
this document or as a reply to this mail:

https://pad.documentfoundation.org/p/esc

You can join using Jitsi here:

https://jitsi.documentfoundation.org/esc

Regards,

Miklos

---

* Present:
+

* Completed Action Items:

* Pending Action Items:

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 release: this week?
+ 24.2: 24.2.4 RC1 in 1 week?
+ 24.8: first alpha this week?

* Documentation (Olivier)
+ Bugzilla Documentation statistics
263(263) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 14(5)39(2) 107(7) 225(4)
 commented 20(10)   61(0) 255(5) 854(6)
  resolved  7(2)23(5)  54(6) 121(4)
+ top 10 contributors:
  Olivier Hallot made 42 changes in 1 month, and 239 changes in 1 year
  Stéphane Guillou made 28 changes in 1 month, and 253 changes in 1 year
  Vernon, Stuart Foote made 22 changes in 1 month, and 107 changes in 1 
year
  Ilmari Lauhakangas made 10 changes in 1 month, and 73 changes in 1 
year
  Kaganski, Mike made 8 changes in 1 month, and 74 changes in 1 year
  Nabet, Julien made 6 changes in 1 month, and 59 changes in 1 year
  Cor Nouws made 5 changes in 1 month, and 8 changes in 1 year
  Heiko Tietze made 4 changes in 1 month, and 76 changes in 1 year
  nobu made 4 changes in 1 month, and 16 changes in 1 year
  Kira Tubo made 2 changes in 1 month, and 2 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
240(240) (topicUI) bugs open, 35(35) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
 added  4(-1)10(1) 15(-1)  21(-3)
 commented 64(48)   186(30)   525(-6)1761(-60)
   removed  0(-2) 4(-1) 5(0)   12(-1)
  resolved  8(2) 31(1) 79(-2) 308(-7)
+ top 10 contributors:
  Heiko Tietze made 110 changes in 1 month, and 1031 changes in 1 year
  Vernon, Stuart Foote made 108 changes in 1 month, and 317 changes in 
1 year
  Stéphane Guillou made 51 changes in 1 month, and 621 changes in 1 year
  Cor Nouws made 21 changes in 1 month, and 33 changes in 1 year
  Dieter made 18 changes in 1 month, and 139 changes in 1 year
  Ilmari Lauhakangas made 16 changes in 1 month, and 131 changes in 1 
year
  Eyal Rozenberg made 10 changes in 1 month, and 125 changes in 1 year
  Ady made 6 changes in 1 month, and 122 changes in 1 year
  jan d made 5 changes in 1 month, and 5 changes in 1 year
  *UNKNOWN* made 5 changes in 1 month, and 5 changes in 1 year

* Crash Testing (Caolan)
+ 24(-39) import failure, 20(-39) export failures
+ ??? coverity issues
+ Google / ossfuzz: ?? fuzzers active now

* Crash Reporting (Xisco)
+ 24.2.1.173(+3)
+ 24.2.1.213738(+798)
+ 24.2.2.28930(+1873)
+ 24.2.3.2487(+0)

* Mentoring (Hossein)
  committer...   1 week 1 month 3 months12 months
  open  81(-11)142(-21)178(-17) 178(-17)
   reviews 450(100)   1206(56)3718(76)12462(22)
merged 350(51)1140(127)   3369(127)   12593(81)
 abandoned  13(4)   55(-2) 172(-2)  656(-1)
   own commits 250(27) 827(103)   2303(119)9229(1)
review commits  51(3)  224(-8) 871(14) 3012(-51)
contributor...   1 week 1 month 3 months12 months
  open  37(4)   77(7)  103(8)   103(8)
   reviews 962(132)   2774(178)   7906(220)   29522(6)
merged  23(3)   98(-20)385(5)  1635(-61)
 abandoned   9(-4)  49(-5) 288(-10) 704(-3)
   own commits  25(0)  105(-8) 449(10) 1126(-7)
review commits   0(0)0(0)0(0) 0(0)
+ easyHack statistics:
   needsDevEval 8(8)   needsUXEval 1(1)   cleanup_comments 326(326)
   total 408(408)   assigned 26(26)   open 348(348)
+ top 10 contributors:
  Armin Le Grand (allotropia) made 7 patches in 1 month, and 87 patches 
in 1 year
  Ritobroto Mukherjee made 5 patches in 1 month, and 15 patches in 1 
year
made 4 patches in 1 month, and 7 patches in 1 year
  Kira Tubo made 4 patches in 1 month, and 14 patches in 1 year
  Jakub Kościelak made 4 patches in 1 month, and 4 patches in 1 year
  colton Garrett made 4 patches in 1 month, and 4 patches in 1 year
  Stéphane Guillou made 3 patches in 1 month, and 7 patches in 1 year
  Stéphane Guillou made 3 patches in 1 month, and 58 patches in 1 year
 

ESC meeting agenda: 2024-05-09 16:00 CEST

2024-05-08 Thread Miklos Vajna

Hi,

The prototype agenda is below. Extra items are appreciated either in
this document or as a reply to this mail:

https://pad.documentfoundation.org/p/esc

You can join using Jitsi here:

https://jitsi.documentfoundation.org/esc

Regards,

Miklos

---

* Present:
+

* Completed Action Items:

* Pending Action Items:

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 release: this week?
+ 24.2: 24.2.4 RC1 in 1 week?
+ 24.8: first alpha this week?

* Documentation (Olivier)
+ Bugzilla Documentation statistics
263(263) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 14(5)39(2) 107(7) 225(4)
 commented 20(10)   61(0) 255(5) 854(6)
  resolved  7(2)23(5)  54(6) 121(4)
+ top 10 contributors:
  Olivier Hallot made 42 changes in 1 month, and 239 changes in 1 year
  Stéphane Guillou made 28 changes in 1 month, and 253 changes in 1 year
  Vernon, Stuart Foote made 22 changes in 1 month, and 107 changes in 1 
year
  Ilmari Lauhakangas made 10 changes in 1 month, and 73 changes in 1 
year
  Kaganski, Mike made 8 changes in 1 month, and 74 changes in 1 year
  Nabet, Julien made 6 changes in 1 month, and 59 changes in 1 year
  Cor Nouws made 5 changes in 1 month, and 8 changes in 1 year
  Heiko Tietze made 4 changes in 1 month, and 76 changes in 1 year
  nobu made 4 changes in 1 month, and 16 changes in 1 year
  Kira Tubo made 2 changes in 1 month, and 2 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
240(240) (topicUI) bugs open, 35(35) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
 added  4(-1)10(1) 15(-1)  21(-3)
 commented 64(48)   186(30)   525(-6)1761(-60)
   removed  0(-2) 4(-1) 5(0)   12(-1)
  resolved  8(2) 31(1) 79(-2) 308(-7)
+ top 10 contributors:
  Heiko Tietze made 110 changes in 1 month, and 1031 changes in 1 year
  Vernon, Stuart Foote made 108 changes in 1 month, and 317 changes in 
1 year
  Stéphane Guillou made 51 changes in 1 month, and 621 changes in 1 year
  Cor Nouws made 21 changes in 1 month, and 33 changes in 1 year
  Dieter made 18 changes in 1 month, and 139 changes in 1 year
  Ilmari Lauhakangas made 16 changes in 1 month, and 131 changes in 1 
year
  Eyal Rozenberg made 10 changes in 1 month, and 125 changes in 1 year
  Ady made 6 changes in 1 month, and 122 changes in 1 year
  jan d made 5 changes in 1 month, and 5 changes in 1 year
  *UNKNOWN* made 5 changes in 1 month, and 5 changes in 1 year

* Crash Testing (Caolan)
+ 24(-39) import failure, 20(-39) export failures
+ ??? coverity issues
+ Google / ossfuzz: ?? fuzzers active now

* Crash Reporting (Xisco)
+ 24.2.1.173(+3)
+ 24.2.1.213738(+798)
+ 24.2.2.28930(+1873)
+ 24.2.3.2487(+0)

* Mentoring (Hossein)
  committer...   1 week 1 month 3 months12 months
  open  81(-11)142(-21)178(-17) 178(-17)
   reviews 450(100)   1206(56)3718(76)12462(22)
merged 350(51)1140(127)   3369(127)   12593(81)
 abandoned  13(4)   55(-2) 172(-2)  656(-1)
   own commits 250(27) 827(103)   2303(119)9229(1)
review commits  51(3)  224(-8) 871(14) 3012(-51)
contributor...   1 week 1 month 3 months12 months
  open  37(4)   77(7)  103(8)   103(8)
   reviews 962(132)   2774(178)   7906(220)   29522(6)
merged  23(3)   98(-20)385(5)  1635(-61)
 abandoned   9(-4)  49(-5) 288(-10) 704(-3)
   own commits  25(0)  105(-8) 449(10) 1126(-7)
review commits   0(0)0(0)0(0) 0(0)
+ easyHack statistics:
   needsDevEval 8(8)   needsUXEval 1(1)   cleanup_comments 326(326)
   total 408(408)   assigned 26(26)   open 348(348)
+ top 10 contributors:
  Armin Le Grand (allotropia) made 7 patches in 1 month, and 87 patches 
in 1 year
  Ritobroto Mukherjee made 5 patches in 1 month, and 15 patches in 1 
year
made 4 patches in 1 month, and 7 patches in 1 year
  Kira Tubo made 4 patches in 1 month, and 14 patches in 1 year
  Jakub Kościelak made 4 patches in 1 month, and 4 patches in 1 year
  colton Garrett made 4 patches in 1 month, and 4 patches in 1 year
  Stéphane Guillou made 3 patches in 1 month, and 7 patches in 1 year
  Stéphane Guillou made 3 patches in 1 month, and 58 patches in 1 year
 

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

2024-05-08 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_core_layout.mk  |1 
 sw/qa/core/layout/calcmove.cxx|   44 ++
 sw/qa/core/layout/data/ignore-top-margin.docx |binary
 sw/source/core/inc/frame.hxx  |3 +
 sw/source/core/layout/calcmove.cxx|   32 ++
 sw/source/core/layout/flowfrm.cxx |5 ++
 6 files changed, 85 insertions(+)

New commits:
commit 4fe480d314ceb100f4679626fee3d60dd82a6bc6
Author: Miklos Vajna 
AuthorDate: Tue May 7 08:13:37 2024 +0200
Commit: Caolán McNamara 
CommitDate: Wed May 8 15:12:18 2024 +0200

tdf#160952 sw: ignore top margin of para on non-first pages with newer DOCX

The 2nd page of the bugdoc has a single paragraph, with a non-zero top
margin. This is ignored in Word, but wasn't ignored in Writer.

Experimenting with the document, it looks like old Word files also don't
ignore this top margin: it started when the compat mode is upgraded
(from binary DOC or Word 2010) to Word 2013 or newer. Also the top
margin is only ignored for the first paragraph on the page, and only in
case it's not on the first page.

Fix the problem by introducing a new SwFrame::IsCollapseUpper() function
to decide if the upper margin should be collapsed or not, and then by
using it in SwFlowFrame::CalcUpperSpace() at one place where we read the
top margin from the doc model. Take advantage of the fact that we have
related, existing compat flags that tell us if we're in "Word >= 2013"
compat mode: see e.g. GetFlyAnchorBottom(), which explains
DocumentSettingId::TAB_OVER_MARGIN is a good indicator that this is a
"Word <= 2010" document. Also, DocumentSettingId::TAB_OVER_SPACING is an
indicator that this is a Word document, so we want the "TabOverSpacing
&& !TabOverMargin" case.

This doesn't change all reads of the upper spacing of a text node, but
is enough to avoid the unwanted top spacing, as demonstrated by the
bugdoc.

(cherry picked from commit 6200d89b905d51776ff4f3c8a84f338655ffaa7f)

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

diff --git a/sw/CppunitTest_sw_core_layout.mk b/sw/CppunitTest_sw_core_layout.mk
index 5eb874400d53..d64a43f7d3fb 100644
--- a/sw/CppunitTest_sw_core_layout.mk
+++ b/sw/CppunitTest_sw_core_layout.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_CppunitTest_CppunitTest,sw_core_layout))
 $(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_core_layout))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,sw_core_layout, \
+sw/qa/core/layout/calcmove \
 sw/qa/core/layout/fly \
 sw/qa/core/layout/flycnt \
 sw/qa/core/layout/frmtool \
diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx
new file mode 100644
index ..3e4deec52ae8
--- /dev/null
+++ b/sw/qa/core/layout/calcmove.cxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#include 
+
+namespace
+{
+/// Covers sw/source/core/layout/calcmove.cxx fixes.
+class Test : public SwModelTestBase
+{
+public:
+Test()
+: SwModelTestBase("/sw/qa/core/layout/data/")
+{
+}
+};
+
+CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMargin)
+{
+// Given a DOCX (>= Word 2013) file, with 2 pages:
+// When loading that document:
+createSwDoc("ignore-top-margin.docx");
+
+// Then make sure that the paragraph on the 2nd page has no top margin:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+sal_Int32 nParaTopMargin
+= getXPath(pXmlDoc, "/root/page[2]/body/txt/infos/prtBounds"_ostr, 
"top"_ostr).toInt32();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 0
+// - Actual  : 2400
+// i.e. the top margin in the first para of a non-first page wasn't 
ignored, like in Word.
+CPPUNIT_ASSERT_EQUAL(static_cast(0), nParaTopMargin);
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/layout/data/ignore-top-margin.docx 
b/sw/qa/core/layout/data/ignore-top-margin.docx
new file mode 100644
index ..d05a1358db1e
Binary files /dev/null and b/sw/qa/core/layout/data/ignore-top-margin.docx 
differ
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 604488a18c9f..a86358508182 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -948,6 +948,9 @@ 

core.git: sw/inc sw/source

2024-05-08 Thread Miklos Vajna (via logerrit)
 sw/inc/ftninfo.hxx|5 +
 sw/source/core/doc/docftn.cxx |   19 +++
 sw/source/core/doc/docnew.cxx |1 +
 3 files changed, 25 insertions(+)

New commits:
commit 90f19126fa405a0632eae4ee8525b66bbce12625
Author: Miklos Vajna 
AuthorDate: Wed May 8 08:59:47 2024 +0200
Commit: Miklos Vajna 
CommitDate: Wed May 8 12:49:04 2024 +0200

tdf#160984 sw continuous endnotes: introduce an endnote section

Word lays out endnotes at the end of the document inline after body
text, Writer puts them on one or more separate endnote pages.

There was already an attempt in the past to resolve this difference, see
commit 4814e8caa5f06c4fe438dfd7d7315e4a2410ea18 (tdf#124601 sw: add
ContinuousEndnotes layout compat option, 2019-09-30). The approach back
then was to map such endnotes to footnotes, so the extra, unwanted page
doesn't appear. This turned out to be not working too well, the compat
option is only enabled for DOC, and even there commit
dc11f5b151e1a2ea2623fc8cf806a400763955d9 (tdf#143445 DOC import: limit
the usage of the CONTINUOUS_ENDNOTES compat flag, 2023-05-23) limited
the usage of the compat flag to 1 or 2 endnotes only.

Coming back to this, try a new approach: create a section that more or
less exists only at a layout level and put endnotes into that section.
This allows reusing all the complex logic on how to lay out endnotes
inline, on one or more pages. The plan is that this new approach is more
robust, can replace the old continuous endnotes layout code and then can
be enabled for DOCX as well.

This commit just introduces the backing section format and SwSection for
that special "endnotes section" (it's special because SwSection is
usually owned by an SwSectionNode, but here there is no doc model node
for the SwSection), SwFootnoteBossFrame::AppendFootnote() doesn't try to
use the new SwEndNoteInfo::GetSwSection() yet.

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

diff --git a/sw/inc/ftninfo.hxx b/sw/inc/ftninfo.hxx
index 17742687c944..c5490ed885d0 100644
--- a/sw/inc/ftninfo.hxx
+++ b/sw/inc/ftninfo.hxx
@@ -28,12 +28,14 @@ class SwTextFormatColl;
 class SwPageDesc;
 class SwCharFormat;
 class SwDoc;
+class SwSection;
 
 class SW_DLLPUBLIC SwEndNoteInfo : public SwClient
 {
 mutable sw::WriterMultiListener m_aDepends;
 mutable SwTextFormatColl* m_pTextFormatColl;
 mutable SwPageDesc* m_pPageDesc;
+mutable std::unique_ptr m_pSwSection;
 mutable SwCharFormat* m_pCharFormat;
 mutable SwCharFormat* m_pAnchorFormat;
 OUString m_sPrefix;
@@ -51,6 +53,9 @@ public:
 bool KnowsPageDesc() const;
 bool DependsOn(const SwPageDesc*) const;
 
+SwSection* GetSwSection(SwDoc& rDoc) const;
+void ResetSwSection();
+
 void SetFootnoteTextColl(SwTextFormatColl& rColl);
 SwTextFormatColl* GetFootnoteTextColl() const { return m_pTextFormatColl; 
} // can be 0.
 
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index 16f6694c94c5..f211dcdcc9f4 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -35,6 +35,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 SwEndNoteInfo& SwEndNoteInfo::operator=(const SwEndNoteInfo& rInfo)
 {
@@ -130,6 +132,23 @@ void SwEndNoteInfo::ChgPageDesc(SwPageDesc* pDesc)
 m_aDepends.StartListening(m_pPageDesc);
 }
 
+SwSection* SwEndNoteInfo::GetSwSection(SwDoc& rDoc) const
+{
+if (!m_pSwSection)
+{
+SwSectionFormat* pFormat = rDoc.MakeSectionFormat();
+pFormat->SetFormatName(UNO_NAME_ENDNOTE);
+pFormat->SetFormatAttr(SwFormatEndAtTextEnd(FTNEND_ATTXTEND));
+m_pSwSection.reset(new SwSection(SectionType::Content, 
pFormat->GetName(), *pFormat));
+}
+return m_pSwSection.get();
+}
+
+void SwEndNoteInfo::ResetSwSection()
+{
+m_pSwSection.reset();
+}
+
 void SwEndNoteInfo::SetFootnoteTextColl(SwTextFormatColl& rFormat)
 {
 m_aDepends.EndListening(m_pTextFormatColl);
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index a56e7343e8f1..daef5f64be75 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -505,6 +505,7 @@ SwDoc::~SwDoc()
 // do not have any dependencies anymore.
 m_pNodes->DelNodes( SwNodeIndex(*m_pNodes), m_pNodes->Count() );
 rUndoNodes.DelNodes( SwNodeIndex( rUndoNodes ), rUndoNodes.Count() );
+mpEndNoteInfo->ResetSwSection();
 
 // clear TOX after nodes - TOXMarks are gone now so SwTOXType has no 
clients
 for (const auto& pType : *mpTOXTypes)


core.git: Branch 'libreoffice-24-2' - sw/qa sw/source

2024-05-08 Thread Miklos Vajna (via logerrit)
 sw/qa/core/txtnode/data/plain-content-control-copy.docx |binary
 sw/qa/core/txtnode/txtnode.cxx  |   23 
 sw/source/core/txtnode/thints.cxx   |4 ++
 3 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 32616609c788aa1cf0837af0f387390a23de1766
Author: Miklos Vajna 
AuthorDate: Tue Apr 30 08:44:59 2024 +0200
Commit: Xisco Fauli 
CommitDate: Wed May 8 10:57:56 2024 +0200

tdf#159683 sw content controls, plain text: fix crash with the clipboard doc

Regression from commit c804c5354855188b5a37219cfe11dc079dc235f4 (sw
content control: fix lost properties on copy, 2023-03-10), select
a plain text content control, copy it to the clipboard, quit: assertion
fails during shutdown because the doc's "placeholder text" char style is
still referenced by a client.

What happens here is that the SwContentControl copy ctor copies the
plain text flag, and that flag is only read in SwTextNode::InsertHint(),
so that causes the problem. Note how that code is inconsistent: we avoid
the creation of dummy characters in the copy case, but we still try to
adjust the start/end of the content control attribute in the copy case,
which makes not much sense.

Fix the problem by not adjusting the content control attribute
boundaries in the copy case, since the original intention was to do
thees corrections only at a UI level, during interactive edit.

It's not clear why this inconsistency had an influence on the clients of
the char style, though.

Change-Id: I86b0516464f24fc453dcd97588dafb8afd010a9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166882
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 06aeb9c61d50bba7edafe17f9d3513af26b0782f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167311
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/core/txtnode/data/plain-content-control-copy.docx 
b/sw/qa/core/txtnode/data/plain-content-control-copy.docx
new file mode 100644
index ..80fecae26d5b
Binary files /dev/null and 
b/sw/qa/core/txtnode/data/plain-content-control-copy.docx differ
diff --git a/sw/qa/core/txtnode/txtnode.cxx b/sw/qa/core/txtnode/txtnode.cxx
index c2df8a407e69..be4d97190251 100644
--- a/sw/qa/core/txtnode/txtnode.cxx
+++ b/sw/qa/core/txtnode/txtnode.cxx
@@ -539,6 +539,29 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, 
testSplitFlyAnchorSplit)
 CPPUNIT_ASSERT_EQUAL(OUString("PortionType::Fly"), aPortionType);
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testPlainContentControlCopy)
+{
+// Given a document with a plain text content control, all text selected 
and copied to the
+// clipboard:
+createSwDoc("plain-content-control-copy.docx");
+SwDocShell* pDocShell = getSwDocShell();
+SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+pWrtShell->SelAll();
+{
+rtl::Reference xTransfer = new 
SwTransferable(*pWrtShell);
+xTransfer->Copy();
+}
+
+// When closing that document, then make sure we don't crash on shutdown:
+uno::Reference xModel(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xFrame(xModel->getCurrentController()->getFrame(),
+uno::UNO_QUERY);
+// Without the accompanying fix in place, this resulted in an assertion 
failure, a char style
+// still had clients by the time it was deleted.
+xFrame->close(false);
+mxComponent.clear();
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index cf5e1ff1cccf..c499294f4f26 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1700,7 +1700,9 @@ bool SwTextNode::InsertHint( SwTextAttr * const pAttr, 
const SetAttrMode nMode )
 // for all of its content.
 auto* pTextContentControl = static_txtattr_cast(
 GetTextAttrAt(pAttr->GetStart(), RES_TXTATR_CONTENTCONTROL, 
::sw::GetTextAttrMode::Parent));
-if (pTextContentControl)
+// If the caller is SwTextNode::CopyText, we just copy an existing 
attribute, no need to
+// correct it.
+if (pTextContentControl && !(nMode & SetAttrMode::NOTXTATRCHR))
 {
 auto& rFormatContentControl
 = 
static_cast(pTextContentControl->GetAttr());


core.git: Branch 'libreoffice-24-2' - sw/qa sw/source

2024-05-08 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx |binary
 sw/qa/extras/ww8export/ww8export4.cxx   |   24 
 sw/source/filter/ww8/wrtw8esh.cxx   |6 +++
 3 files changed, 30 insertions(+)

New commits:
commit fe9395164bc4130c83ab75e0c471516f9da61bee
Author: Miklos Vajna 
AuthorDate: Fri May 3 13:54:02 2024 +0200
Commit: Xisco Fauli 
CommitDate: Wed May 8 09:34:09 2024 +0200

Related: tdf#160833 teach DOC export about DoNotMirrorRtlDrawObjs

See

<https://gerrit.libreoffice.org/c/core/+/167033/1#message-e1df9bf60b7b8b2acdf0c062484ddc572939a3d9>,
no need to undo the import-time mapping in case we know that the
mirroring is avoided at a layout level.

Change-Id: Idbdc10ad327540dc5045e9b19dd42160b5139470
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167049
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 9d95eb980ef12678f6fb978badcbe1cacbe0c4dc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167084
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx 
b/sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx
new file mode 100644
index ..3b291901f72d
Binary files /dev/null and 
b/sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx differ
diff --git a/sw/qa/extras/ww8export/ww8export4.cxx 
b/sw/qa/extras/ww8export/ww8export4.cxx
index d31bf17a31f6..3fb0ae7b03a4 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -252,6 +252,30 @@ CPPUNIT_TEST_FIXTURE(Test, testLegalNumbering)
 verify();
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testDOCExportDoNotMirrorRtlDrawObjs)
+{
+// Given a document with a shape, anchored in an RTL paragraph, loaded 
from DOCX:
+createSwDoc("draw-obj-rtl-no-mirror-vml.docx");
+
+// When saving that to DOC:
+saveAndReload(mpFilter);
+
+// Then make sure the shape is on the right margin:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+sal_Int32 nPageRight = getXPath(pXmlDoc, "//page/infos/bounds"_ostr, 
"right"_ostr).toInt32();
+sal_Int32 nBodyRight = getXPath(pXmlDoc, "//body/infos/bounds"_ostr, 
"right"_ostr).toInt32();
+sal_Int32 nShapeLeft
+= getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds"_ostr, 
"left"_ostr).toInt32();
+CPPUNIT_ASSERT_GREATER(nBodyRight, nShapeLeft);
+sal_Int32 nShapeRight
+= getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds"_ostr, 
"right"_ostr).toInt32();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected less than: 12523
+// - Actual  : 12536
+// i.e. the shape was outside of the page right margin area, due to an 
unwanted mapping.
+CPPUNIT_ASSERT_LESS(nPageRight, nShapeRight);
+}
+
 DECLARE_WW8EXPORT_TEST(testNonInlinePageBreakFirstLine, 
"nonInlinePageBreakFirstLine.doc")
 {
 SwDoc* pDoc = getSwDoc();
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index 19ac50ccf5c9..272e3bd27735 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -577,6 +577,12 @@ void WW8Export::MiserableRTLFrameFormatHack(SwTwips 
, SwTwips ,
 if (SvxFrameDirection::Horizontal_RL_TB != 
m_rDoc.GetTextDirection(rFrameFormat.GetPosition()))
 return;
 
+if 
(m_rDoc.getIDocumentSettingAccess().get(DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS))
+{
+// Swap is handled at a layout-level, no need to compensate for it at 
export time.
+return;
+}
+
 SwTwips nWidth = rRight - rLeft;
 SwTwips nPageLeft, nPageRight;
 SwTwips nPageSize = CurrentPageWidth(nPageLeft, nPageRight);


core.git: Branch 'libreoffice-24-2' - cui/source sw/source

2024-05-08 Thread Miklos Vajna (via logerrit)
 cui/source/inc/swpossizetabpage.hxx  |1 +
 cui/source/tabpages/swpossizetabpage.cxx |   27 +--
 sw/source/uibase/shells/drwbassh.cxx |   10 ++
 3 files changed, 32 insertions(+), 6 deletions(-)

New commits:
commit e74f2f3f259125434f7fb9f8d7c338123a0137ed
Author: Miklos Vajna 
AuthorDate: Fri May 3 08:08:29 2024 +0200
Commit: Xisco Fauli 
CommitDate: Wed May 8 09:33:44 2024 +0200

tdf#160833 sw DoNotMirrorRtlDrawObjs: add UI in cui/

The UI code at lcl_ChangeResIdToVerticalOrRTL() was aware that
SwAnchoredObjectPosition::CalcRelPosX() mirrors the position when the
anchor paragraph is RTL, so swapped the "from left" label to a "from
right" label.

Don't do this when the compat option is enabled, so not only we render
correctly but the UI now correctly explains why we came up with the
correct position.

Change-Id: I479ed1f085b249d10be47b66d7a656dc1bd4f936
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167031
    Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 0f410680461d7ba5f70dd65b2a8263dec15ac357)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167083
Reviewed-by: Xisco Fauli 

diff --git a/cui/source/inc/swpossizetabpage.hxx 
b/cui/source/inc/swpossizetabpage.hxx
index eb73196986bf..ede7fd4231ae 100644
--- a/cui/source/inc/swpossizetabpage.hxx
+++ b/cui/source/inc/swpossizetabpage.hxx
@@ -52,6 +52,7 @@ class SvxSwPosSizeTabPage : public SfxTabPage
 boolm_bPositioningDisabled;
 boolm_bIsMultiSelection;
 boolm_bIsInRightToLeft;
+bool m_bDoNotMirrorRtlDrawObjs = false;
 TriStatem_nProtectSizeState;
 
 SwFrameExample m_aExampleWN;
diff --git a/cui/source/tabpages/swpossizetabpage.cxx 
b/cui/source/tabpages/swpossizetabpage.cxx
index 060f7b44ce9f..8de586a74df5 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star::text;
 
@@ -431,14 +432,16 @@ static std::size_t lcl_GetFrmMapCount(const FrmMap* pMap)
 }
 
 static SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(
-SvxSwFramePosString::StringId eStringId, bool bVertical, bool bRTL)
+SvxSwFramePosString::StringId eStringId, bool bVertical, bool 
bRTL, bool bDontMirrorRTL)
 {
 //special handling of STR_FROMLEFT
 if(SvxSwFramePosString::FROMLEFT == eStringId)
 {
+bool bMirrorRtlDrawObjs = !bDontMirrorRTL;
+bool bSwapLR = bRTL && bMirrorRtlDrawObjs;
 eStringId = bVertical ?
 bRTL ? SvxSwFramePosString::FROMBOTTOM : 
SvxSwFramePosString::FROMTOP :
-bRTL ? SvxSwFramePosString::FROMRIGHT : 
SvxSwFramePosString::FROMLEFT;
+bSwapLR ? SvxSwFramePosString::FROMRIGHT : 
SvxSwFramePosString::FROMLEFT;
 return eStringId;
 }
 if(bVertical)
@@ -728,7 +731,8 @@ WhichRangesContainer SvxSwPosSizeTabPage::GetRanges()
 SID_ATTR_TRANSFORM_AUTOWIDTH, SID_ATTR_TRANSFORM_VERT_ORIENT,
 SID_HTML_MODE, SID_HTML_MODE,
 SID_SW_FOLLOW_TEXT_FLOW, SID_SW_FOLLOW_TEXT_FLOW,
-SID_ATTR_TRANSFORM_HORI_POSITION, SID_ATTR_TRANSFORM_VERT_POSITION
+SID_ATTR_TRANSFORM_HORI_POSITION, SID_ATTR_TRANSFORM_VERT_POSITION,
+SID_ATTR_CHAR_GRABBAG, SID_ATTR_CHAR_GRABBAG
 >);
 return ranges;
 }
@@ -967,6 +971,17 @@ void SvxSwPosSizeTabPage::Reset( const SfxItemSet* rSet)
 }
 m_xFollowCB->save_state();
 
+const SfxGrabBagItem* pGrabBag = GetItem(*rSet, SID_ATTR_CHAR_GRABBAG);
+if (pGrabBag)
+{
+const std::map& rMap = pGrabBag->GetGrabBag();
+auto it = rMap.find("DoNotMirrorRtlDrawObjs");
+if (it != rMap.end())
+{
+it->second >>= m_bDoNotMirrorRtlDrawObjs;
+}
+}
+
 if(m_bHtmlMode)
 {
 m_xHoriMirrorCB->hide();
@@ -1651,7 +1666,7 @@ void SvxSwPosSizeTabPage::FillRelLB(FrmMap const *pMap, 
sal_uInt16 nMapPos, sal_
 {
 SvxSwFramePosString::StringId sStrId1 = 
aAsCharRelationMap[nRelPos].eStrId;
 
-sStrId1 = lcl_ChangeResIdToVerticalOrRTL(sStrId1, 
m_bIsVerticalFrame, m_bIsInRightToLeft);
+sStrId1 = lcl_ChangeResIdToVerticalOrRTL(sStrId1, 
m_bIsVerticalFrame, m_bIsInRightToLeft, m_bDoNotMirrorRtlDrawObjs);
 OUString sEntry = 
SvxSwFramePosString::GetString(sStrId1);
 
rLB.append(weld::toId([nRelPos]), sEntry);
 if (pMap[_nMapPos].nAlign == nAlign)
@@ -1706,7 +1721,7 @@ void SvxSwPosSizeTabPage::FillRelLB(FrmMap const *pMap, 
sal_uInt16 nMapPos, sal_
 if (aRelationMap[nRelPos].nLBRelation == 
static_cast(nBit))
 {
   

core.git: sw/qa

2024-05-08 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/rtfexport/rtfexport6.cxx | 1115 ++
 1 file changed, 722 insertions(+), 393 deletions(-)

New commits:
commit af3d52e444595a4a3b50528c0f02fa798e7a2b08
Author: Miklos Vajna 
AuthorDate: Wed May 8 08:11:07 2024 +0200
Commit: Miklos Vajna 
CommitDate: Wed May 8 09:07:54 2024 +0200

CppunitTest_sw_rtfexport6: avoid DECLARE_RTFEXPORT_TEST

No need to go via Writer-specific macros here.

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

diff --git a/sw/qa/extras/rtfexport/rtfexport6.cxx 
b/sw/qa/extras/rtfexport/rtfexport6.cxx
index e943de10622b..f206c1ddadfb 100644
--- a/sw/qa/extras/rtfexport/rtfexport6.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport6.cxx
@@ -47,25 +47,43 @@ public:
 }
 };
 
-DECLARE_RTFEXPORT_TEST(testFdo85889pc, "fdo85889-pc.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testFdo85889pc)
 {
-uno::Reference xTextRange = getRun(getParagraph(1), 1);
+auto verify = [this]() {
+uno::Reference xTextRange = getRun(getParagraph(1), 
1);
 
-CPPUNIT_ASSERT_EQUAL(u"\u00B1\u2265\u2264"_ustr, xTextRange->getString());
+CPPUNIT_ASSERT_EQUAL(u"\u00B1\u2265\u2264"_ustr, 
xTextRange->getString());
+};
+createSwDoc("fdo85889-pc.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testFdo85889pca, "fdo85889-pca.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testFdo85889pca)
 {
-uno::Reference xTextRange = getRun(getParagraph(1), 1);
+auto verify = [this]() {
+uno::Reference xTextRange = getRun(getParagraph(1), 
1);
 
-CPPUNIT_ASSERT_EQUAL(u"\u00B1\u2017\u00BE"_ustr, xTextRange->getString());
+CPPUNIT_ASSERT_EQUAL(u"\u00B1\u2017\u00BE"_ustr, 
xTextRange->getString());
+};
+createSwDoc("fdo85889-pca.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testFdo85889mac, "fdo85889-mac.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testFdo85889mac)
 {
-uno::Reference xTextRange = getRun(getParagraph(1), 1);
+auto verify = [this]() {
+uno::Reference xTextRange = getRun(getParagraph(1), 
1);
 
-CPPUNIT_ASSERT_EQUAL(u"\u00D2\u00DA\u00DB"_ustr, xTextRange->getString());
+CPPUNIT_ASSERT_EQUAL(u"\u00D2\u00DA\u00DB"_ustr, 
xTextRange->getString());
+};
+createSwDoc("fdo85889-mac.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
 CPPUNIT_TEST_FIXTURE(Test, testFdo72031)
@@ -86,63 +104,111 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo72031)
 verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testFdo86750, "fdo86750.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testFdo86750)
 {
-// This was 'HYPERLINK#anchor', the URL of the hyperlink had the field 
type as a prefix, leading to broken links.
-CPPUNIT_ASSERT_EQUAL(OUString("#anchor"),
- getProperty(getRun(getParagraph(1), 1), 
"HyperLinkURL"));
+auto verify = [this]() {
+// This was 'HYPERLINK#anchor', the URL of the hyperlink had the field 
type as a prefix, leading to broken links.
+CPPUNIT_ASSERT_EQUAL(OUString("#anchor"),
+ getProperty(getRun(getParagraph(1), 1), 
"HyperLinkURL"));
+};
+createSwDoc("fdo86750.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testTdf88811, "tdf88811.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testTdf88811)
 {
-// The problem was that shapes anchored to the paragraph that is moved 
into a textframe were lost, so this was 2.
-CPPUNIT_ASSERT_EQUAL(4, getShapes());
+auto verify = [this]() {
+// The problem was that shapes anchored to the paragraph that is moved 
into a textframe were lost, so this was 2.
+CPPUNIT_ASSERT_EQUAL(4, getShapes());
+};
+createSwDoc("tdf88811.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testFdo49893_2, "fdo49893-2.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testFdo49893_2)
 {
-// Ensure that header text exists on each page (especially on second page)
-CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), 
parseDump("/root/page[1]/header/txt/text()"_ostr));
-CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), 
parseDump("/root/page[2]/header/txt/text()"_ostr));
-CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), 
parseDump("/root/page[3]/header/txt/text()"_ostr));
-CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), 
parseDump("/root/page[4]/header/txt/text()"_ostr));
-CPPUNIT_ASSERT_EQUAL(OUString("HEADER"), 
parseDump("/root/page[5]/header/txt/text()"_ostr));
-CPPUNIT_ASSERT_

core.git: sw/CppunitTest_sw_core_layout.mk sw/qa sw/source

2024-05-07 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_core_layout.mk  |1 
 sw/qa/core/layout/calcmove.cxx|   44 ++
 sw/qa/core/layout/data/ignore-top-margin.docx |binary
 sw/source/core/inc/frame.hxx  |3 +
 sw/source/core/layout/calcmove.cxx|   32 ++
 sw/source/core/layout/flowfrm.cxx |5 ++
 6 files changed, 85 insertions(+)

New commits:
commit 6200d89b905d51776ff4f3c8a84f338655ffaa7f
Author: Miklos Vajna 
AuthorDate: Tue May 7 08:13:37 2024 +0200
Commit: Miklos Vajna 
CommitDate: Tue May 7 09:18:06 2024 +0200

tdf#160952 sw: ignore top margin of para on non-first pages with newer DOCX

The 2nd page of the bugdoc has a single paragraph, with a non-zero top
margin. This is ignored in Word, but wasn't ignored in Writer.

Experimenting with the document, it looks like old Word files also don't
ignore this top margin: it started when the compat mode is upgraded
(from binary DOC or Word 2010) to Word 2023 or newer. Also the top
margin is only ignored for the first paragraph on the page, and only in
case it's not on the first page.

Fix the problem by introducing a new SwFrame::IsCollapseUpper() function
to decide if the upper margin should be collapsed or not, and then by
using it in SwFlowFrame::CalcUpperSpace() at one place where we read the
top margin from the doc model. Take advantage of the fact that we have
related, existing compat flags that tell us if we're in "Word >= 2013"
compat mode: see e.g. GetFlyAnchorBottom(), which explains
DocumentSettingId::TAB_OVER_MARGIN is a good indicator that this is a
"Word <= 2010" document. Also, DocumentSettingId::TAB_OVER_SPACING is an
indicator that this is a Word document, so we want the "TabOverSpacing
&& !TabOverMargin" case.

This doesn't change all reads of the upper spacing of a text node, but
is enough to avoid the unwanted top spacing, as demonstrated by the
bugdoc.

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

diff --git a/sw/CppunitTest_sw_core_layout.mk b/sw/CppunitTest_sw_core_layout.mk
index 5eb874400d53..d64a43f7d3fb 100644
--- a/sw/CppunitTest_sw_core_layout.mk
+++ b/sw/CppunitTest_sw_core_layout.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_CppunitTest_CppunitTest,sw_core_layout))
 $(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_core_layout))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,sw_core_layout, \
+sw/qa/core/layout/calcmove \
 sw/qa/core/layout/fly \
 sw/qa/core/layout/flycnt \
 sw/qa/core/layout/frmtool \
diff --git a/sw/qa/core/layout/calcmove.cxx b/sw/qa/core/layout/calcmove.cxx
new file mode 100644
index ..3e4deec52ae8
--- /dev/null
+++ b/sw/qa/core/layout/calcmove.cxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#include 
+
+namespace
+{
+/// Covers sw/source/core/layout/calcmove.cxx fixes.
+class Test : public SwModelTestBase
+{
+public:
+Test()
+: SwModelTestBase("/sw/qa/core/layout/data/")
+{
+}
+};
+
+CPPUNIT_TEST_FIXTURE(Test, testIgnoreTopMargin)
+{
+// Given a DOCX (>= Word 2013) file, with 2 pages:
+// When loading that document:
+createSwDoc("ignore-top-margin.docx");
+
+// Then make sure that the paragraph on the 2nd page has no top margin:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+sal_Int32 nParaTopMargin
+= getXPath(pXmlDoc, "/root/page[2]/body/txt/infos/prtBounds"_ostr, 
"top"_ostr).toInt32();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 0
+// - Actual  : 2400
+// i.e. the top margin in the first para of a non-first page wasn't 
ignored, like in Word.
+CPPUNIT_ASSERT_EQUAL(static_cast(0), nParaTopMargin);
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/layout/data/ignore-top-margin.docx 
b/sw/qa/core/layout/data/ignore-top-margin.docx
new file mode 100644
index ..d05a1358db1e
Binary files /dev/null and b/sw/qa/core/layout/data/ignore-top-margin.docx 
differ
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index eac4adff7ce6..f0b7439bd283 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -951,6 +951,9 @@ public:
 virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const;
 void dumpChildrenAsXml(xmlTextWr

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

2024-05-06 Thread Miklos Vajna (via logerrit)
 sc/source/ui/docshell/docsh6.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 6360a8e721555bf9deb6ee38829a22abe39863ab
Author: Miklos Vajna 
AuthorDate: Fri Mar 1 08:34:00 2024 +0100
Commit: Szymon Kłos 
CommitDate: Tue May 7 07:55:05 2024 +0200

sc lok: make the formula separator warning dialog async

I'm not sure what exactly changed here, but recently online.git
unit-wopi-languages started to fail for me. First it was an assertion
failure:

/home/vmiklos/git/libreoffice/core/vcl/source/window/window.cxx:3186: void 
vcl::Window::SetLOKNotifier(const vcl::ILibreOfficeKitNotifier*, bool): 
Assertion `pNotifier' failed.

Once ScDocShell::CheckConfigOptions() is changed to pass in the view
shell explicitly, the next error is:

kit-26201-26149 2024-02-28 10:41:31.659255 +0100 [ kitbroker_002 ] ERR  
non-async dialog triggered

So convert it to async, similar to the chart2/ hunk of commit
4b33e878a446b0bcdb1d5f882a05a256967eea54 (Make format condition, chart
delete and pivot table error async, 2024-01-10).

Change-Id: I159278b24db0acd5fddb6f4d29dae9a35321e614
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164178
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167235
Tested-by: Jenkins CollaboraOffice 
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index caefdfc0fed3..344b52953faf 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -499,10 +499,10 @@ void ScDocShell::CheckConfigOptions()
 ScTabViewShell* pViewShell = GetBestViewShell();
 if (pViewShell)
 {
-std::unique_ptr 
xInfoBox(Application::CreateMessageDialog(pViewShell->GetFrameWeld(),
+std::shared_ptr 
xInfoBox(Application::CreateMessageDialog(pViewShell->GetFrameWeld(),
   
VclMessageType::Info, VclButtonsType::Ok,
-  
ScResId(STR_OPTIONS_WARN_SEPARATORS)));
-xInfoBox->run();
+  
ScResId(STR_OPTIONS_WARN_SEPARATORS), pViewShell));
+xInfoBox->runAsync(xInfoBox, [] (int) {});
 }
 
 // For now, this is the only option setting that could launch info


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

2024-05-06 Thread Miklos Vajna (via logerrit)
 cui/source/inc/swpossizetabpage.hxx  |1 +
 cui/source/tabpages/swpossizetabpage.cxx |   27 +--
 sw/source/uibase/shells/drwbassh.cxx |   10 ++
 3 files changed, 32 insertions(+), 6 deletions(-)

New commits:
commit 2b1a9d721f0664d31dfe06bad30d4a74d44262ce
Author: Miklos Vajna 
AuthorDate: Fri May 3 08:08:29 2024 +0200
Commit: Caolán McNamara 
CommitDate: Mon May 6 20:01:34 2024 +0200

tdf#160833 sw DoNotMirrorRtlDrawObjs: add UI in cui/

The UI code at lcl_ChangeResIdToVerticalOrRTL() was aware that
SwAnchoredObjectPosition::CalcRelPosX() mirrors the position when the
anchor paragraph is RTL, so swapped the "from left" label to a "from
right" label.

Don't do this when the compat option is enabled, so not only we render
correctly but the UI now correctly explains why we came up with the
correct position.

(cherry picked from commit 0f410680461d7ba5f70dd65b2a8263dec15ac357)

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

diff --git a/cui/source/inc/swpossizetabpage.hxx 
b/cui/source/inc/swpossizetabpage.hxx
index eb73196986bf..ede7fd4231ae 100644
--- a/cui/source/inc/swpossizetabpage.hxx
+++ b/cui/source/inc/swpossizetabpage.hxx
@@ -52,6 +52,7 @@ class SvxSwPosSizeTabPage : public SfxTabPage
 boolm_bPositioningDisabled;
 boolm_bIsMultiSelection;
 boolm_bIsInRightToLeft;
+bool m_bDoNotMirrorRtlDrawObjs = false;
 TriStatem_nProtectSizeState;
 
 SwFrameExample m_aExampleWN;
diff --git a/cui/source/tabpages/swpossizetabpage.cxx 
b/cui/source/tabpages/swpossizetabpage.cxx
index 060f7b44ce9f..8de586a74df5 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star::text;
 
@@ -431,14 +432,16 @@ static std::size_t lcl_GetFrmMapCount(const FrmMap* pMap)
 }
 
 static SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(
-SvxSwFramePosString::StringId eStringId, bool bVertical, bool bRTL)
+SvxSwFramePosString::StringId eStringId, bool bVertical, bool 
bRTL, bool bDontMirrorRTL)
 {
 //special handling of STR_FROMLEFT
 if(SvxSwFramePosString::FROMLEFT == eStringId)
 {
+bool bMirrorRtlDrawObjs = !bDontMirrorRTL;
+bool bSwapLR = bRTL && bMirrorRtlDrawObjs;
 eStringId = bVertical ?
 bRTL ? SvxSwFramePosString::FROMBOTTOM : 
SvxSwFramePosString::FROMTOP :
-bRTL ? SvxSwFramePosString::FROMRIGHT : 
SvxSwFramePosString::FROMLEFT;
+bSwapLR ? SvxSwFramePosString::FROMRIGHT : 
SvxSwFramePosString::FROMLEFT;
 return eStringId;
 }
 if(bVertical)
@@ -728,7 +731,8 @@ WhichRangesContainer SvxSwPosSizeTabPage::GetRanges()
 SID_ATTR_TRANSFORM_AUTOWIDTH, SID_ATTR_TRANSFORM_VERT_ORIENT,
 SID_HTML_MODE, SID_HTML_MODE,
 SID_SW_FOLLOW_TEXT_FLOW, SID_SW_FOLLOW_TEXT_FLOW,
-SID_ATTR_TRANSFORM_HORI_POSITION, SID_ATTR_TRANSFORM_VERT_POSITION
+SID_ATTR_TRANSFORM_HORI_POSITION, SID_ATTR_TRANSFORM_VERT_POSITION,
+SID_ATTR_CHAR_GRABBAG, SID_ATTR_CHAR_GRABBAG
 >);
 return ranges;
 }
@@ -967,6 +971,17 @@ void SvxSwPosSizeTabPage::Reset( const SfxItemSet* rSet)
 }
 m_xFollowCB->save_state();
 
+const SfxGrabBagItem* pGrabBag = GetItem(*rSet, SID_ATTR_CHAR_GRABBAG);
+if (pGrabBag)
+{
+const std::map& rMap = pGrabBag->GetGrabBag();
+auto it = rMap.find("DoNotMirrorRtlDrawObjs");
+if (it != rMap.end())
+{
+it->second >>= m_bDoNotMirrorRtlDrawObjs;
+}
+}
+
 if(m_bHtmlMode)
 {
 m_xHoriMirrorCB->hide();
@@ -1651,7 +1666,7 @@ void SvxSwPosSizeTabPage::FillRelLB(FrmMap const *pMap, 
sal_uInt16 nMapPos, sal_
 {
 SvxSwFramePosString::StringId sStrId1 = 
aAsCharRelationMap[nRelPos].eStrId;
 
-sStrId1 = lcl_ChangeResIdToVerticalOrRTL(sStrId1, 
m_bIsVerticalFrame, m_bIsInRightToLeft);
+sStrId1 = lcl_ChangeResIdToVerticalOrRTL(sStrId1, 
m_bIsVerticalFrame, m_bIsInRightToLeft, m_bDoNotMirrorRtlDrawObjs);
 OUString sEntry = 
SvxSwFramePosString::GetString(sStrId1);
 
rLB.append(weld::toId([nRelPos]), sEntry);
 if (pMap[_nMapPos].nAlign == nAlign)
@@ -1706,7 +1721,7 @@ void SvxSwPosSizeTabPage::FillRelLB(FrmMap const *pMap, 
sal_uInt16 nMapPos, sal_
 if (aRelationMap[nRelPos].nLBRelation == 
static_cast(nBit))
 {
 SvxSwFramePosString::StringId 

core.git: officecfg/registry sw/inc sw/source

2024-05-06 Thread Miklos Vajna (via logerrit)
 officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs |6 +
 sw/inc/strings.hrc|1 
 sw/inc/viewsh.hxx |2 +
 sw/source/core/doc/DocumentSettingManager.cxx |1 
 sw/source/core/view/viewsh.cxx|   11 
++
 sw/source/ui/config/optcomp.cxx   |6 +
 6 files changed, 27 insertions(+)

New commits:
commit 2f79dc2bc2ddf4006646f235f228b61e3f9ffde0
Author: Miklos Vajna 
AuthorDate: Mon May 6 08:36:18 2024 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 6 10:36:33 2024 +0200

Related: tdf#160833 sw DoNotMirrorRtlDrawObjs: add enable/disable option UI

Doing this via a macro was possible already, but that didn't invalidate
the object positions on the layout, so required a document reload, which
was ugly.

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

diff --git a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
index 085a380cbd41..9bc722106070 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
@@ -152,6 +152,12 @@
 
 false
   
+  
+
+  Do not mirror drawing objects anchored in paragraphs with an 
RTL writing direction
+
+false
+  
 
   
   
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index a0d04e35ba29..6a36f4740926 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -1492,6 +1492,7 @@
 #define STR_COMPAT_OPT_NOGAPAFTERNOTENUMBER 
NC_("STR_COMPAT_OPT_NOGAPAFTERNOTENUMBER", "Do not add an extra space after 
number in footnotes / endnotes with hanging first line")
 #define STR_COMPAT_OPT_TABSRELATIVETOINDENT 
NC_("STR_COMPAT_OPT_TABSRELATIVETOINDENT", "Set tabstops relative to indent of 
paragraph")
 #define STR_COMPAT_OPT_TABOVERMARGIN
NC_("STR_COMPAT_OPT_TABOVERMARGIN", "Allow tabs to extend beyond the right 
margin")
+#define STR_COMPAT_OPT_DO_NOT_MIRROR_RTL_DRAW_OBJS 
NC_("DO_NOT_MIRROR_RTL_DRAW_OBJS", "Do not mirror drawing objects anchored in 
paragraphs with an RTL writing direction")
 
 #define STR_TABLE_PANEL_ALIGN_AUTO  
NC_("sidebartableedit|alignautolabel", "Automatic")
 #define STR_TABLE_PANEL_ALIGN_LEFT  
NC_("sidebartableedit|alignleftlabel", "Left")
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 9417702f5b86..18d33266b627 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -451,6 +451,8 @@ public:
 
 SW_DLLPUBLIC void SetTabOverMargin(bool bNew);
 
+SW_DLLPUBLIC void SetDoNotMirrorRtlDrawObjs(bool bDoNotMirrorRtlDrawObjs);
+
 // DOCUMENT COMPATIBILITY FLAGS END
 
 // Calls Idle-formatter of Layout.
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index 55b625932efb..501344ca8108 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -139,6 +139,7 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc 
)
 mbNoGapAfterNoteNumber  = 
aOptions.get(u"NoGapAfterNoteNumber"_ustr);
 mbTabRelativeToIndent   = 
aOptions.get(u"TabsRelativeToIndent"_ustr);
 mbTabOverMargin = 
aOptions.get(u"TabOverMargin"_ustr);
+mbDoNotMirrorRtlDrawObjs= 
aOptions.get(u"DoNotMirrorRtlDrawObjs"_ustr);
 }
 else
 {
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 5ec658a9cd14..f20eb694e8f4 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1083,6 +1083,17 @@ void SwViewShell::SetTabOverMargin(bool bNew)
 }
 }
 
+void SwViewShell::SetDoNotMirrorRtlDrawObjs(bool bDoNotMirrorRtlDrawObjs)
+{
+IDocumentSettingAccess& rIDSA = getIDocumentSettingAccess();
+if (rIDSA.get(DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS) != 
bDoNotMirrorRtlDrawObjs)
+{
+SwWait aWait(*GetDoc()->GetDocShell(), true);
+rIDSA.set(DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS, 
bDoNotMirrorRtlDrawObjs);
+lcl_InvalidateAllObjPos(*this);
+}
+}
+
 void SwViewShell::Reformat()
 {
 SwWait aWait( *GetDoc()->GetDocShell(), true );
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 9ed4c850bd4d..9d60a786ce8b 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -62,6 +62,7 @@ constexpr std:

core.git: Branch 'libreoffice-24-2' - 2 commits - sw/CppunitTest_sw_writerfilter_filter.mk sw/Module_sw.mk sw/qa sw/source writerfilter/source

2024-05-06 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_writerfilter_filter.mk|   59 
++
 sw/Module_sw.mk |1 
 sw/qa/core/objectpositioning/objectpositioning.cxx  |   48 

 sw/qa/writerfilter/cppunittests/filter/WriterFilter.cxx |   57 
+
 sw/qa/writerfilter/cppunittests/filter/data/draw-obj-rtl-no-mirror.docx |binary
 sw/source/core/objectpositioning/anchoredobjectposition.cxx |5 
 writerfilter/source/filter/WriterFilter.cxx |1 
 7 files changed, 170 insertions(+), 1 deletion(-)

New commits:
commit 7d75210808f8d8be7ee226031ae27b724cfcfbcc
Author: Miklos Vajna 
AuthorDate: Thu May 2 08:42:25 2024 +0200
Commit: Xisco Fauli 
CommitDate: Mon May 6 10:24:00 2024 +0200

tdf#160833 DOCX import: use the DoNotMirrorRtlDrawObjs compat flag

The bugdoc has a shape which should be on the right page margin, but it
was on the left page margin.

Use the new compat flag to have a layout that matches Word.

This way we don't need to unmap the tweaked position at export time (a
limitation that the DOC filter has).

Change-Id: I38dfae370f275d9f0897198e7b0569f2d91dd352
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166993
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167044

diff --git a/sw/CppunitTest_sw_writerfilter_filter.mk 
b/sw/CppunitTest_sw_writerfilter_filter.mk
new file mode 100644
index ..ad61c66f1ed4
--- /dev/null
+++ b/sw/CppunitTest_sw_writerfilter_filter.mk
@@ -0,0 +1,59 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_writerfilter_filter))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_writerfilter_filter,\
+   boost_headers \
+   libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_writerfilter_filter, \
+sw/qa/writerfilter/cppunittests/filter/WriterFilter \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_writerfilter_filter, \
+basegfx \
+comphelper \
+cppu \
+cppuhelper \
+oox \
+sal \
+subsequenttest \
+test \
+unotest \
+utl \
+tl \
+vcl \
+))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,sw_writerfilter_filter))
+
+$(eval $(call gb_CppunitTest_use_ure,sw_writerfilter_filter))
+$(eval $(call gb_CppunitTest_use_vcl,sw_writerfilter_filter))
+
+$(eval $(call gb_CppunitTest_use_rdb,sw_writerfilter_filter,services))
+
+$(eval $(call gb_CppunitTest_use_custom_headers,sw_writerfilter_filter,\
+   officecfg/registry \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,sw_writerfilter_filter))
+
+# we need to explicitly depend on library sw_writerfilter because it is not 
implied
+# by a link relation
+$(call gb_CppunitTest_get_target,sw_writerfilter_filter) : $(call 
gb_Library_get_target,sw_writerfilter)
+
+ifneq ($(filter MORE_FONTS,$(BUILD_TYPE)),)
+$(eval $(call 
gb_CppunitTest_set_non_application_font_use,sw_writerfilter_filter,abort))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 7d5679e52f3c..7556ecf33778 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -168,6 +168,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
 CppunitTest_sw_a11y \
 CppunitTest_sw_core_theme \
 CppunitTest_sw_pdf_test \
+CppunitTest_sw_writerfilter_filter \
 ))
 
 ifneq ($(DISABLE_GUI),TRUE)
diff --git a/sw/qa/writerfilter/cppunittests/filter/WriterFilter.cxx 
b/sw/qa/writerfilter/cppunittests/filter/WriterFilter.cxx
new file mode 100644
index ..10b8cab57a45
--- /dev/null
+++ b/sw/qa/writerfilter/cppunittests/filter/WriterFilter.cxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+using namespace ::com::sun::star;
+
+namespace
+{
+/// Tests for sw/source/writerfilter/filter/WriterFilter.cxx.
+class Test : public UnoApiXmlTest
+{
+public:
+Test()
+: UnoApiXmlTest("/sw/qa/writerfilter/cppunittests/filter/data/")
+{
+}
+};
+
+CPPUNIT_TEST_FI

core.git: include/svx reportdesign/source svx/source

2024-05-06 Thread Miklos Vajna (via logerrit)
 include/svx/svdundo.hxx  |2 +-
 reportdesign/source/core/sdr/UndoActions.cxx |   12 ++--
 reportdesign/source/ui/misc/RptUndo.cxx  |2 +-
 svx/source/form/fmundo.cxx   |8 
 svx/source/svdraw/svdundo.cxx|   24 
 5 files changed, 24 insertions(+), 24 deletions(-)

New commits:
commit 9683305264568d77a1d912f4b0d2e063455feeae
Author: Miklos Vajna 
AuthorDate: Mon May 6 08:19:53 2024 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 6 10:00:58 2024 +0200

svx: prefix members of SdrUndoAction

See tdf#94879 for motivation.

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

diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx
index 80c7ae4560b3..824f36f06efc 100644
--- a/include/svx/svdundo.hxx
+++ b/include/svx/svdundo.hxx
@@ -60,7 +60,7 @@ namespace svx { namespace diagram {
 class SVXCORE_DLLPUBLIC SdrUndoAction : public SfxUndoAction
 {
 protected:
-SdrModel& rMod;
+SdrModel& m_rMod;
 ViewShellId m_nViewShellId;
 
 protected:
diff --git a/reportdesign/source/core/sdr/UndoActions.cxx 
b/reportdesign/source/core/sdr/UndoActions.cxx
index 5aaa412cf1ff..e078ffa2c931 100644
--- a/reportdesign/source/core/sdr/UndoActions.cxx
+++ b/reportdesign/source/core/sdr/UndoActions.cxx
@@ -113,7 +113,7 @@ OUndoContainerAction::~OUndoContainerAction()
 if ( !xChild.is() || xChild->getParent().is() )
 return;
 
-OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod 
).GetUndoEnv();
+OXUndoEnvironment& rEnv = static_cast< OReportModel& >( m_rMod 
).GetUndoEnv();
 rEnv.RemoveElement( m_xOwnElement );
 
 // -> dispose it
@@ -141,7 +141,7 @@ void OUndoContainerAction::implReInsert( )
 
 void OUndoContainerAction::implReRemove( )
 {
-OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod 
).GetUndoEnv();
+OXUndoEnvironment& rEnv = static_cast< OReportModel& >( m_rMod 
).GetUndoEnv();
 try
 {
 OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
@@ -234,7 +234,7 @@ OUndoGroupSectionAction::OUndoGroupSectionAction(
 
 void OUndoGroupSectionAction::implReInsert( )
 {
-OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod 
).GetUndoEnv();
+OXUndoEnvironment& rEnv = static_cast< OReportModel& >( m_rMod 
).GetUndoEnv();
 try
 {
 OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
@@ -251,7 +251,7 @@ void OUndoGroupSectionAction::implReInsert( )
 
 void OUndoGroupSectionAction::implReRemove( )
 {
-OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod 
).GetUndoEnv();
+OXUndoEnvironment& rEnv = static_cast< OReportModel& >( m_rMod 
).GetUndoEnv();
 try
 {
 OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
@@ -278,7 +278,7 @@ OUndoReportSectionAction::OUndoReportSectionAction(
 
 void OUndoReportSectionAction::implReInsert( )
 {
-OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod 
).GetUndoEnv();
+OXUndoEnvironment& rEnv = static_cast< OReportModel& >( m_rMod 
).GetUndoEnv();
 try
 {
 OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
@@ -301,7 +301,7 @@ void OUndoReportSectionAction::implReInsert( )
 
 void OUndoReportSectionAction::implReRemove( )
 {
-OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod 
).GetUndoEnv();
+OXUndoEnvironment& rEnv = static_cast< OReportModel& >( m_rMod 
).GetUndoEnv();
 try
 {
 OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
diff --git a/reportdesign/source/ui/misc/RptUndo.cxx 
b/reportdesign/source/ui/misc/RptUndo.cxx
index 7a835237722a..bff3c4518b1a 100644
--- a/reportdesign/source/ui/misc/RptUndo.cxx
+++ b/reportdesign/source/ui/misc/RptUndo.cxx
@@ -125,7 +125,7 @@ OSectionUndo::~OSectionUndo()
 if ( m_bInserted )
 return;
 
-OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod 
).GetUndoEnv();
+OXUndoEnvironment& rEnv = static_cast< OReportModel& >( m_rMod 
).GetUndoEnv();
 for (uno::Reference& xShape : m_aControls)
 {
 rEnv.RemoveElement(xShape);
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx
index 9bbe99a81d6e..956d4a06e43e 100644
--- a/svx/source/form/fmundo.cxx
+++ b/svx/source/form/fmundo.cxx
@@ -964,7 +964,7 @@ FmUndoPropertyAction::FmUndoPropertyAction(FmFormModel& 
rNewMod, const PropertyC
 
 void FmUndoPropertyAction::Undo()
 {
-FmXUndoEnvironment& rEnv = static_cast(rMod).GetUndoEnv();
+FmXUndoEnvironment& rEnv = static_cast(m_rMod).GetUndoEnv();
 
 if (!xObj.is() || rEnv.IsLocked())
 return;
@@ -984,7 +984,7 @@ void FmUndoPropertyAction::Undo()
 

Re: Which GUI toolkit should I learn so that I can "Hack the UI"

2024-05-06 Thread Miklos Vajna
Hi,

On Fri, May 03, 2024 at 10:45:01PM +0530, Printf Debugging 
 wrote:
> **Opinions invited**: I want to work on the UI, beyond small issues, like
> creating custom widgets, notebookbar, tabbed UI etc. I feel that I need to
> know a GUI toolkit well, like gtk or qt for that. So some days ago, I
> started playing around with GTK. My question is that which toolkit will be
> more useful? I picked GTK because we use .ui files for the UI, and being
> good at GTK will somehow help when working on LO UI, but again I don't know,
> that's just an idea.

gtk is probably a good idea, given that these days much of the UI is
welded and the LO weld API is designed after gtk.

Regards,

Miklos


core.git: sw/qa sw/source

2024-05-03 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx |binary
 sw/qa/extras/ww8export/ww8export4.cxx   |   24 
 sw/source/filter/ww8/wrtw8esh.cxx   |6 +++
 3 files changed, 30 insertions(+)

New commits:
commit 9d95eb980ef12678f6fb978badcbe1cacbe0c4dc
Author: Miklos Vajna 
AuthorDate: Fri May 3 13:54:02 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 3 16:28:04 2024 +0200

Related: tdf#160833 teach DOC export about DoNotMirrorRtlDrawObjs

See

<https://gerrit.libreoffice.org/c/core/+/167033/1#message-e1df9bf60b7b8b2acdf0c062484ddc572939a3d9>,
no need to undo the import-time mapping in case we know that the
mirroring is avoided at a layout level.

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

diff --git a/sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx 
b/sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx
new file mode 100644
index ..3b291901f72d
Binary files /dev/null and 
b/sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx differ
diff --git a/sw/qa/extras/ww8export/ww8export4.cxx 
b/sw/qa/extras/ww8export/ww8export4.cxx
index d3bc9c4071d9..6caffceffa00 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -267,6 +267,30 @@ CPPUNIT_TEST_FIXTURE(Test, testLegalNumbering)
 verify();
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testDOCExportDoNotMirrorRtlDrawObjs)
+{
+// Given a document with a shape, anchored in an RTL paragraph, loaded 
from DOCX:
+createSwDoc("draw-obj-rtl-no-mirror-vml.docx");
+
+// When saving that to DOC:
+saveAndReload(mpFilter);
+
+// Then make sure the shape is on the right margin:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+sal_Int32 nPageRight = getXPath(pXmlDoc, "//page/infos/bounds"_ostr, 
"right"_ostr).toInt32();
+sal_Int32 nBodyRight = getXPath(pXmlDoc, "//body/infos/bounds"_ostr, 
"right"_ostr).toInt32();
+sal_Int32 nShapeLeft
+= getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds"_ostr, 
"left"_ostr).toInt32();
+CPPUNIT_ASSERT_GREATER(nBodyRight, nShapeLeft);
+sal_Int32 nShapeRight
+= getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds"_ostr, 
"right"_ostr).toInt32();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected less than: 12523
+// - Actual  : 12536
+// i.e. the shape was outside of the page right margin area, due to an 
unwanted mapping.
+CPPUNIT_ASSERT_LESS(nPageRight, nShapeRight);
+}
+
 DECLARE_WW8EXPORT_TEST(testNonInlinePageBreakFirstLine, 
"nonInlinePageBreakFirstLine.doc")
 {
 SwDoc* pDoc = getSwDoc();
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index c13d06106286..21afd78cce1d 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -576,6 +576,12 @@ void WW8Export::MiserableRTLFrameFormatHack(SwTwips 
, SwTwips ,
 if (SvxFrameDirection::Horizontal_RL_TB != 
m_rDoc.GetTextDirection(rFrameFormat.GetPosition()))
 return;
 
+if 
(m_rDoc.getIDocumentSettingAccess().get(DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS))
+{
+// Swap is handled at a layout-level, no need to compensate for it at 
export time.
+return;
+}
+
 SwTwips nWidth = rRight - rLeft;
 SwTwips nPageLeft, nPageRight;
 SwTwips nPageSize = CurrentPageWidth(nPageLeft, nPageRight);


core.git: Branch 'distro/collabora/co-24.04' - writerfilter/CppunitTest_writerfilter_filter.mk writerfilter/Module_writerfilter.mk writerfilter/qa writerfilter/source

2024-05-03 Thread Miklos Vajna (via logerrit)
 writerfilter/CppunitTest_writerfilter_filter.mk  |   55 
+
 writerfilter/Module_writerfilter.mk  |1 
 writerfilter/qa/cppunittests/filter/WriterFilter.cxx |   57 
++
 writerfilter/qa/cppunittests/filter/data/draw-obj-rtl-no-mirror.docx |binary
 writerfilter/source/filter/WriterFilter.cxx  |1 
 5 files changed, 114 insertions(+)

New commits:
commit ffcd1d52574e19ce45b47758d3ed445d2a9da943
Author: Miklos Vajna 
AuthorDate: Thu May 2 08:42:25 2024 +0200
Commit: Caolán McNamara 
CommitDate: Fri May 3 15:17:14 2024 +0200

tdf#160833 DOCX import: use the DoNotMirrorRtlDrawObjs compat flag

The bugdoc has a shape which should be on the right page margin, but it
was on the left page margin.

Use the new compat flag to have a layout that matches Word.

This way we don't need to unmap the tweaked position at export time (a
limitation that the DOC filter has).

(cherry picked from commit 01dcc9a652ecfc65fb674b492afa6f58b0a846db)

Conflicts:
sw/Module_sw.mk

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

diff --git a/writerfilter/CppunitTest_writerfilter_filter.mk 
b/writerfilter/CppunitTest_writerfilter_filter.mk
new file mode 100644
index ..8b719bba5713
--- /dev/null
+++ b/writerfilter/CppunitTest_writerfilter_filter.mk
@@ -0,0 +1,55 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,writerfilter_filter))
+
+$(eval $(call gb_CppunitTest_use_externals,writerfilter_filter,\
+   boost_headers \
+   libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,writerfilter_filter, \
+writerfilter/qa/cppunittests/filter/WriterFilter \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,writerfilter_filter, \
+basegfx \
+comphelper \
+cppu \
+cppuhelper \
+oox \
+sal \
+subsequenttest \
+test \
+unotest \
+utl \
+tl \
+vcl \
+))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,writerfilter_filter))
+
+$(eval $(call gb_CppunitTest_use_ure,writerfilter_filter))
+$(eval $(call gb_CppunitTest_use_vcl,writerfilter_filter))
+
+$(eval $(call gb_CppunitTest_use_rdb,writerfilter_filter,services))
+
+$(eval $(call gb_CppunitTest_use_custom_headers,writerfilter_filter,\
+   officecfg/registry \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,writerfilter_filter))
+
+# we need to explicitly depend on library writerfilter because it is not 
implied
+# by a link relation
+$(call gb_CppunitTest_get_target,writerfilter_filter) : $(call 
gb_Library_get_target,writerfilter)
+
+# vim: set noet sw=4 ts=4:
diff --git a/writerfilter/Module_writerfilter.mk 
b/writerfilter/Module_writerfilter.mk
index 587bf4fa4dfc..08710edb23e6 100644
--- a/writerfilter/Module_writerfilter.mk
+++ b/writerfilter/Module_writerfilter.mk
@@ -20,6 +20,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,writerfilter,\
 CppunitTest_writerfilter_dmapper \
 CppunitTest_writerfilter_ooxml \
 CppunitTest_writerfilter_rtftok \
+CppunitTest_writerfilter_filter \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/writerfilter/qa/cppunittests/filter/WriterFilter.cxx 
b/writerfilter/qa/cppunittests/filter/WriterFilter.cxx
new file mode 100644
index ..ae741085277c
--- /dev/null
+++ b/writerfilter/qa/cppunittests/filter/WriterFilter.cxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+using namespace ::com::sun::star;
+
+namespace
+{
+/// Tests for writerfilter/source/filter/WriterFilter.cxx.
+class Test : public UnoApiXmlTest
+{
+public:
+Test()
+: UnoApiXmlTest("/writerfilter/qa/cppunittests/filter/data/")
+{
+}
+};
+
+CPPUNIT_TEST_FIXTURE(Test, testDoNotMirrorRtlDrawObjs)
+{
+// Given a document with a shape, anchored in an RTL paragraph:
+// When loading that document:
+loadFromFile(u"draw-obj-rtl-no-mirror.docx");
+
+// Then

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

2024-05-03 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx |binary
 sw/qa/extras/ww8export/ww8export4.cxx   |   24 
 sw/source/filter/ww8/wrtw8esh.cxx   |6 +++
 3 files changed, 30 insertions(+)

New commits:
commit 3e9ff13bb78c56b5ddc6316b0b73c8a21ea7c0b0
Author: Miklos Vajna 
AuthorDate: Fri May 3 12:00:59 2024 +0200
Commit: Caolán McNamara 
CommitDate: Fri May 3 15:16:56 2024 +0200

Related: tdf#160833 teach DOC export about DoNotMirrorRtlDrawObjs

See

<https://gerrit.libreoffice.org/c/core/+/167033/1#message-e1df9bf60b7b8b2acdf0c062484ddc572939a3d9>,
no need to undo the import-time mapping in case we know that the
mirroring is avoided at a layout level.

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

diff --git a/sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx 
b/sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx
new file mode 100644
index ..3b291901f72d
Binary files /dev/null and 
b/sw/qa/extras/ww8export/data/draw-obj-rtl-no-mirror-vml.docx differ
diff --git a/sw/qa/extras/ww8export/ww8export4.cxx 
b/sw/qa/extras/ww8export/ww8export4.cxx
index e297ac949afe..b25d3b4a7701 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -262,6 +262,30 @@ CPPUNIT_TEST_FIXTURE(Test, testLegalNumbering)
 verify();
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testDOCExportDoNotMirrorRtlDrawObjs)
+{
+// Given a document with a shape, anchored in an RTL paragraph, loaded 
from DOCX:
+createSwDoc("draw-obj-rtl-no-mirror-vml.docx");
+
+// When saving that to DOC:
+saveAndReload(mpFilter);
+
+// Then make sure the shape is on the right margin:
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+sal_Int32 nPageRight = getXPath(pXmlDoc, "//page/infos/bounds"_ostr, 
"right"_ostr).toInt32();
+sal_Int32 nBodyRight = getXPath(pXmlDoc, "//body/infos/bounds"_ostr, 
"right"_ostr).toInt32();
+sal_Int32 nShapeLeft
+= getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds"_ostr, 
"left"_ostr).toInt32();
+CPPUNIT_ASSERT_GREATER(nBodyRight, nShapeLeft);
+sal_Int32 nShapeRight
+= getXPath(pXmlDoc, "//SwAnchoredDrawObject/bounds"_ostr, 
"right"_ostr).toInt32();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected less than: 12523
+// - Actual  : 12536
+// i.e. the shape was outside of the page right margin area, due to an 
unwanted mapping.
+CPPUNIT_ASSERT_LESS(nPageRight, nShapeRight);
+}
+
 DECLARE_WW8EXPORT_TEST(testNonInlinePageBreakFirstLine, 
"nonInlinePageBreakFirstLine.doc")
 {
 SwDoc* pDoc = getSwDoc();
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index f9e1082f9276..3e7087221db0 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -577,6 +577,12 @@ void WW8Export::MiserableRTLFrameFormatHack(SwTwips 
, SwTwips ,
 if (SvxFrameDirection::Horizontal_RL_TB != 
m_rDoc.GetTextDirection(rFrameFormat.GetPosition()))
 return;
 
+if 
(m_rDoc.getIDocumentSettingAccess().get(DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS))
+{
+// Swap is handled at a layout-level, no need to compensate for it at 
export time.
+return;
+}
+
 SwTwips nWidth = rRight - rLeft;
 SwTwips nPageLeft, nPageRight;
 SwTwips nPageSize = CurrentPageWidth(nPageLeft, nPageRight);


core.git: cui/source sw/source

2024-05-03 Thread Miklos Vajna (via logerrit)
 cui/source/inc/swpossizetabpage.hxx  |1 +
 cui/source/tabpages/swpossizetabpage.cxx |   27 +--
 sw/source/uibase/shells/drwbassh.cxx |   10 ++
 3 files changed, 32 insertions(+), 6 deletions(-)

New commits:
commit 0f410680461d7ba5f70dd65b2a8263dec15ac357
Author: Miklos Vajna 
AuthorDate: Fri May 3 08:08:29 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 3 13:51:08 2024 +0200

tdf#160833 sw DoNotMirrorRtlDrawObjs: add UI in cui/

The UI code at lcl_ChangeResIdToVerticalOrRTL() was aware that
SwAnchoredObjectPosition::CalcRelPosX() mirrors the position when the
anchor paragraph is RTL, so swapped the "from left" label to a "from
right" label.

Don't do this when the compat option is enabled, so not only we render
correctly but the UI now correctly explains why we came up with the
correct position.

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

diff --git a/cui/source/inc/swpossizetabpage.hxx 
b/cui/source/inc/swpossizetabpage.hxx
index 2e5a15fbebbb..037cede29326 100644
--- a/cui/source/inc/swpossizetabpage.hxx
+++ b/cui/source/inc/swpossizetabpage.hxx
@@ -53,6 +53,7 @@ class SvxSwPosSizeTabPage : public SfxTabPage
 boolm_bPositioningDisabled;
 boolm_bIsMultiSelection;
 boolm_bIsInRightToLeft;
+bool m_bDoNotMirrorRtlDrawObjs = false;
 TriStatem_nProtectSizeState;
 
 SwFrameExample m_aExampleWN;
diff --git a/cui/source/tabpages/swpossizetabpage.cxx 
b/cui/source/tabpages/swpossizetabpage.cxx
index 1a0d14759eac..752af91a1a62 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -433,14 +434,16 @@ static std::size_t lcl_GetFrmMapCount(const FrmMap* pMap)
 }
 
 static SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(
-SvxSwFramePosString::StringId eStringId, bool bVertical, bool bRTL)
+SvxSwFramePosString::StringId eStringId, bool bVertical, bool 
bRTL, bool bDontMirrorRTL)
 {
 //special handling of STR_FROMLEFT
 if(SvxSwFramePosString::FROMLEFT == eStringId)
 {
+bool bMirrorRtlDrawObjs = !bDontMirrorRTL;
+bool bSwapLR = bRTL && bMirrorRtlDrawObjs;
 eStringId = bVertical ?
 bRTL ? SvxSwFramePosString::FROMBOTTOM : 
SvxSwFramePosString::FROMTOP :
-bRTL ? SvxSwFramePosString::FROMRIGHT : 
SvxSwFramePosString::FROMLEFT;
+bSwapLR ? SvxSwFramePosString::FROMRIGHT : 
SvxSwFramePosString::FROMLEFT;
 return eStringId;
 }
 if(bVertical)
@@ -749,7 +752,8 @@ WhichRangesContainer SvxSwPosSizeTabPage::GetRanges()
 SID_ATTR_TRANSFORM_AUTOWIDTH, SID_ATTR_TRANSFORM_VERT_ORIENT,
 SID_HTML_MODE, SID_HTML_MODE,
 SID_SW_FOLLOW_TEXT_FLOW, SID_SW_FOLLOW_TEXT_FLOW,
-SID_ATTR_TRANSFORM_HORI_POSITION, SID_ATTR_TRANSFORM_VERT_POSITION
+SID_ATTR_TRANSFORM_HORI_POSITION, SID_ATTR_TRANSFORM_VERT_POSITION,
+SID_ATTR_CHAR_GRABBAG, SID_ATTR_CHAR_GRABBAG
 >);
 return ranges;
 }
@@ -988,6 +992,17 @@ void SvxSwPosSizeTabPage::Reset( const SfxItemSet* rSet)
 }
 m_xFollowCB->save_state();
 
+const SfxGrabBagItem* pGrabBag = GetItem(*rSet, SID_ATTR_CHAR_GRABBAG);
+if (pGrabBag)
+{
+const std::map& rMap = pGrabBag->GetGrabBag();
+auto it = rMap.find("DoNotMirrorRtlDrawObjs");
+if (it != rMap.end())
+{
+it->second >>= m_bDoNotMirrorRtlDrawObjs;
+}
+}
+
 if(m_bHtmlMode)
 {
 m_xHoriMirrorCB->hide();
@@ -1677,7 +1692,7 @@ void SvxSwPosSizeTabPage::FillRelLB(FrmMap const *pMap, 
sal_uInt16 nMapPos, sal_
 {
 SvxSwFramePosString::StringId sStrId1 = 
aAsCharRelationMap[nRelPos].eStrId;
 
-sStrId1 = lcl_ChangeResIdToVerticalOrRTL(sStrId1, 
m_bIsVerticalFrame, m_bIsInRightToLeft);
+sStrId1 = lcl_ChangeResIdToVerticalOrRTL(sStrId1, 
m_bIsVerticalFrame, m_bIsInRightToLeft, m_bDoNotMirrorRtlDrawObjs);
 OUString sEntry = 
SvxSwFramePosString::GetString(sStrId1);
 
rLB.append(weld::toId([nRelPos]), sEntry);
 if (pMap[_nMapPos].nAlign == nAlign)
@@ -1732,7 +1747,7 @@ void SvxSwPosSizeTabPage::FillRelLB(FrmMap const *pMap, 
sal_uInt16 nMapPos, sal_
 if (aRelationMap[nRelPos].nLBRelation == 
static_cast(nBit))
 {
 SvxSwFramePosString::StringId sStrId1 = 
m_xHoriMirrorCB->get_active() ? aRelationMap[nRelPos].eMirrorStrId : 
aRelationMap[nRelPos].eStrId;
-  

core.git: Branch 'libreoffice-24-2' - sw/inc sw/qa sw/source

2024-05-03 Thread Miklos Vajna (via logerrit)
 sw/inc/IDocumentSettingAccess.hxx |1 +
 sw/qa/uibase/uno/uno.cxx  |   24 
 sw/source/core/doc/DocumentSettingManager.cxx |   10 ++
 sw/source/core/inc/DocumentSettingManager.hxx |1 +
 sw/source/filter/xml/xmlexp.cxx   |1 +
 sw/source/filter/xml/xmlimp.cxx   |   10 ++
 sw/source/uibase/uno/SwXDocumentSettings.cxx  |   18 ++
 7 files changed, 65 insertions(+)

New commits:
commit 799767d5670efc7f996892de5dd7d1afdb4a6cce
Author: Miklos Vajna 
AuthorDate: Mon Apr 29 10:39:43 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri May 3 11:55:12 2024 +0200

tdf#160833 sw: add a DoNotMirrorRtlDrawObjs compat flag

The DOCX bugdoc has a circle shape anchored inside an RTL paragraph:
this shows up on the right hand side in Word, but on the left hand side
in Writer.

What happens is that Writer implicitly mirrors draw objects anchored in
RTL paragraphs, while Word doesn't do this.

Start fixing the problem by adding a new layout compatibility flag that
can be used by the DOCX import in the future, to leave the behavior
unchanged for new & existing ODT documents.

An alternative would be to do something similar to the DOC import's
SwWW8ImplReader::MiserableRTLGraphicsHack(), but 1) we don't have the
page margins by the time we import the shape and 2) as its name says, it
doesn't feel like a clean solution, it's better to handle this
difference at a layout level.

Change-Id: I2ec067d86c7fbdbe57e4cd9547015fe25a9a56b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166820
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit c675eaf923cf579670b8ba2f7794b47be7fad39e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166845
Reviewed-by: Xisco Fauli 

diff --git a/sw/inc/IDocumentSettingAccess.hxx 
b/sw/inc/IDocumentSettingAccess.hxx
index 0dd9467bdf13..264860b854c4 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -99,6 +99,7 @@ enum class DocumentSettingId
 // tdf#119908 new paragraph justification
 JUSTIFY_LINES_WITH_SHRINKING,
 APPLY_TEXT_ATTR_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH,
+DO_NOT_MIRROR_RTL_DRAW_OBJS,
 // COMPATIBILITY FLAGS END
 BROWSE_MODE,
 HTML_MODE,
diff --git a/sw/qa/uibase/uno/uno.cxx b/sw/qa/uibase/uno/uno.cxx
index d38d0bbfc967..3e6d9c93d51c 100644
--- a/sw/qa/uibase/uno/uno.cxx
+++ b/sw/qa/uibase/uno/uno.cxx
@@ -560,6 +560,30 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, 
testAllowTextAfterFloatingTableBreak)
 CPPUNIT_ASSERT(bAllowTextAfterFloatingTableBreak);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testDoNotMirrorRtlDrawObjs)
+{
+// Given an empty document:
+createSwDoc();
+
+// When checking the state of the DoNotMirrorRtlDrawObjs compat flag:
+uno::Reference xDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xSettings(
+xDocument->createInstance("com.sun.star.document.Settings"), 
uno::UNO_QUERY);
+bool bDoNotMirrorRtlDrawObjs{};
+// Without the accompanying fix in place, this test would have failed with:
+// An uncaught exception of type 
com.sun.star.beans.UnknownPropertyException
+// i.e. the compat flag was not recognized.
+xSettings->getPropertyValue("DoNotMirrorRtlDrawObjs") >>= 
bDoNotMirrorRtlDrawObjs;
+// Then make sure it's false by default:
+CPPUNIT_ASSERT(!bDoNotMirrorRtlDrawObjs);
+
+// And when setting DoNotMirrorRtlDrawObjs=true:
+xSettings->setPropertyValue("DoNotMirrorRtlDrawObjs", uno::Any(true));
+// Then make sure it gets enabled:
+xSettings->getPropertyValue("DoNotMirrorRtlDrawObjs") >>= 
bDoNotMirrorRtlDrawObjs;
+CPPUNIT_ASSERT(bDoNotMirrorRtlDrawObjs);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index 661c001e98c2..14cfa5fd3c24 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -256,6 +256,8 @@ bool sw::DocumentSettingManager::get(/*[in]*/ 
DocumentSettingId id) const
 return mbDoNotBreakWrappedTables;
 case DocumentSettingId::ALLOW_TEXT_AFTER_FLOATING_TABLE_BREAK:
 return mbAllowTextAfterFloatingTableBreak;
+case DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS:
+return mbDoNotMirrorRtlDrawObjs;
 case DocumentSettingId::JUSTIFY_LINES_WITH_SHRINKING:
 return mbJustifyLinesWithShrinking;
 case DocumentSettingId::NO_NUMBERING_SHOW_FOLLOWBY: return 
mbNoNumberingShowFollowBy;
@@ -450,6 +452,10 @@ void sw::DocumentSettingManager::set(/*[in]*/ 
DocumentSettingId id, /*[in]*/ boo
 mbApplyTextAttrToEm

core.git: Branch 'libreoffice-7-6-7' - sc/source

2024-05-03 Thread Miklos Vajna (via logerrit)
 sc/source/core/data/column3.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 1f49854c0d18000f52d3ad4525bb52b2f35cc064
Author: Miklos Vajna 
AuthorDate: Wed Apr 24 09:37:35 2024 +0200
Commit: Michael Stahl 
CommitDate: Fri May 3 11:42:03 2024 +0200

sc: fix crash in ScColumn::SetEditText()

Crashreport:

> SIG   Fatal signal received: SIGSEGV code: 128 for address: 0x0
> program/libsclo.so
>   ScColumn::SetEditText(int, std::unique_ptr >)
>   sc/source/core/data/column3.cxx:2362
> program/libsclo.so
>   ScTable::SetEditText(short, int, std::unique_ptr >)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   ScDocument::SetEditText(ScAddress const&, 
std::unique_ptr >)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   ScDocFunc::SetEditCell(ScAddress const&, EditTextObject const&, 
bool)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   (anonymous 
namespace)::finalizeFormulaProcessing(std::shared_ptr<(anonymous 
namespace)::FormulaProcessingContext>)
>   sc/source/ui/view/viewfunc.cxx:565

Change-Id: I331ca8784702fdcb0ebad6a0a73390dbe2615ece
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166612
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit e3ce4aad47c052dcd67107f7c91336f4ecc949be)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166526
Reviewed-by: Xisco Fauli 
(cherry picked from commit 58b85fc5e4ebe6c8a77e2b1935c23bf0ebebad0a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166848
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 
Reviewed-by: Eike Rathke 

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index f0f4cc83263b..5a1582e560d7 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2358,6 +2358,11 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const 
OUString& rString,
 
 void ScColumn::SetEditText( SCROW nRow, std::unique_ptr 
pEditText )
 {
+if (!pEditText)
+{
+return;
+}
+
 pEditText->NormalizeString(GetDoc().GetSharedStringPool());
 std::vector aNewSharedRows;
 sc::CellStoreType::iterator it = GetPositionToInsert(nRow, aNewSharedRows, 
false);


ESC meeting minutes: 2024-05-02

2024-05-02 Thread Miklos Vajna

* Present:
+ Cloph, Hossein, Olivier, Caolan, Heiko, Ilmari, Jonathan, Michael W, 
Eike, Regina, Stephan, Xisco, Thorsten, Stephane, Michael S, Miklos

* Completed Action Items:

* Pending Action Items:

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 RC2 this week
  + last release in this line? (Xisco)
  + last planned, yes (Cloph)
+ 24.2: 24.2.4 RC1 in 2 weeks
+ 24.8: first alpha in 1 week

* Documentation (Olivier)
+ Sometimes missing features to be documented
  + good if Olivier is aware
+ Highlight of the cell background during editing e.g.
  + so translators would discover these features as well.
+ Helpcontent2
+ Updates and fixes (ohallot, stragu)
+ Page for SEQUENCE Calc function (ohallot)
+ Guides
+ Stalled.
+ Bugzilla Documentation statistics
264(264) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 10(-9)   38(2) 101(3) 223(1)
 commented 18(0)63(3) 251(13)850(-2)
  resolved  6(-3)   19(3)  49(3) 119(2)
+ top 10 contributors:
  Olivier Hallot made 33 changes in 1 month, and 256 changes in 1 year
  Stéphane Guillou made 29 changes in 1 month, and 255 changes in 1 year
  Vernon, Stuart Foote made 22 changes in 1 month, and 105 changes in 1 
year
  Dione Maddern made 10 changes in 1 month, and 31 changes in 1 year
  MeBugzilla made 7 changes in 1 month, and 7 changes in 1 year
  Nabet, Julien made 7 changes in 1 month, and 53 changes in 1 year
  nobu made 7 changes in 1 month, and 16 changes in 1 year
  Ilmari Lauhakangas made 6 changes in 1 month, and 71 changes in 1 year
  Cor Nouws made 5 changes in 1 month, and 8 changes in 1 year
  Kaganski, Mike made 4 changes in 1 month, and 68 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
242(242) (topicUI) bugs open, 35(35) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week1 month3 months   12 months
 added  5(2)   8(-3) 15(-3)  24(-2)
 commented 38(-11)   173(-18)   559(6) 1842(-60)
   removed  3(3)   5(3)   5(3)   14(3)
  resolved  7(-2) 30(-1) 87(-1) 315(0)
+ top 10 contributors:
  Heiko Tietze made 107 changes in 1 month, and 1078 changes in 1 year
  Vernon, Stuart Foote made 105 changes in 1 month, and 306 changes in 
1 year
  Stéphane Guillou made 57 changes in 1 month, and 643 changes in 1 year
  Ilmari Lauhakangas made 19 changes in 1 month, and 142 changes in 1 
year
  Dieter made 15 changes in 1 month, and 136 changes in 1 year
  Eyal Rozenberg made 9 changes in 1 month, and 133 changes in 1 year
  Kaganski, Mike made 7 changes in 1 month, and 96 changes in 1 year
  Petros Christopoulos made 7 changes in 1 month, and 7 changes in 1 
year
  m.a.riosv made 6 changes in 1 month, and 49 changes in 1 year
  *UNKNOWN* made 5 changes in 1 month, and 5 changes in 1 year
+ [Bug 160657] Improve how Writer Navigator Headings are displayed when
   alphabetically sorted
+ [Bug 160694] Add .uno:VRuler button to NB Tabbed/Tabbed Compact cutomize
   View list
+ [Bug 160873] Usability: "OLE Object" probably not familiar language
   (Menu: Insert/OLE Object)
+ [Bug 160219] Add confirmation dialog to "Delete all comments"
   (.uno:DeleteAllNotes) in Calc
 -> + [Bug 160465] Ctrl+Shift+F6 is marked reserved, but doesn't do anything
  + ReservedKeys in svapp.cxx not working for triple-state
 -> + [Bug 95274] Wrong editing languages offered
  + gaelic or welsh not correctly reported per libexttextcat, unclear
and input is highly welcome

* Crash Testing (Caolan)
+ 63(+39) import failure, 59(+40) export failures
  + down from a higher, unreported numbers
  + it's an improvement, in fact.
+ 21 coverity issues
+ 5 ossfuzz issues

* Crash Reporting (Xisco)
+ 7.6.5.29807(+812)
+ 7.6.6.32944(+1016)
+ 24.2.1.212822(+961)
+ 24.2.2.26745(+2138)
+ let's wait until next week to see the results from the new release

* Mentoring (Hossein)
  + Reviewd submissions from newcomers
  + Added a new draft blog post for fixing crashes:
Crash fixes, part 4: Assertion failure
(Previous parts were around segfaults, aborts, and how to fix and test them)
https://dev.blog.documentfoundation.org/?p=929=1&_ppp=63e6295aab
  committer...   1 week 1 month 3 months 12 months
  open 104(22) 169(38) 201(42)   201(42)
   reviews 356(26)1152(-40)   3648(-116)   12418(-90)
merged 288(75) 981(47)3241(-10)12462(-29)
 abandoned   

ESC meeting minutes: 2024-05-02

2024-05-02 Thread Miklos Vajna

* Present:
+ Cloph, Hossein, Olivier, Caolan, Heiko, Ilmari, Jonathan, Michael W, 
Eike, Regina, Stephan, Xisco, Thorsten, Stephane, Michael S, Miklos

* Completed Action Items:

* Pending Action Items:

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 RC2 this week
  + last release in this line? (Xisco)
  + last planned, yes (Cloph)
+ 24.2: 24.2.4 RC1 in 2 weeks
+ 24.8: first alpha in 1 week

* Documentation (Olivier)
+ Sometimes missing features to be documented
  + good if Olivier is aware
+ Highlight of the cell background during editing e.g.
  + so translators would discover these features as well.
+ Helpcontent2
+ Updates and fixes (ohallot, stragu)
+ Page for SEQUENCE Calc function (ohallot)
+ Guides
+ Stalled.
+ Bugzilla Documentation statistics
264(264) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 10(-9)   38(2) 101(3) 223(1)
 commented 18(0)63(3) 251(13)850(-2)
  resolved  6(-3)   19(3)  49(3) 119(2)
+ top 10 contributors:
  Olivier Hallot made 33 changes in 1 month, and 256 changes in 1 year
  Stéphane Guillou made 29 changes in 1 month, and 255 changes in 1 year
  Vernon, Stuart Foote made 22 changes in 1 month, and 105 changes in 1 
year
  Dione Maddern made 10 changes in 1 month, and 31 changes in 1 year
  MeBugzilla made 7 changes in 1 month, and 7 changes in 1 year
  Nabet, Julien made 7 changes in 1 month, and 53 changes in 1 year
  nobu made 7 changes in 1 month, and 16 changes in 1 year
  Ilmari Lauhakangas made 6 changes in 1 month, and 71 changes in 1 year
  Cor Nouws made 5 changes in 1 month, and 8 changes in 1 year
  Kaganski, Mike made 4 changes in 1 month, and 68 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
242(242) (topicUI) bugs open, 35(35) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week1 month3 months   12 months
 added  5(2)   8(-3) 15(-3)  24(-2)
 commented 38(-11)   173(-18)   559(6) 1842(-60)
   removed  3(3)   5(3)   5(3)   14(3)
  resolved  7(-2) 30(-1) 87(-1) 315(0)
+ top 10 contributors:
  Heiko Tietze made 107 changes in 1 month, and 1078 changes in 1 year
  Vernon, Stuart Foote made 105 changes in 1 month, and 306 changes in 
1 year
  Stéphane Guillou made 57 changes in 1 month, and 643 changes in 1 year
  Ilmari Lauhakangas made 19 changes in 1 month, and 142 changes in 1 
year
  Dieter made 15 changes in 1 month, and 136 changes in 1 year
  Eyal Rozenberg made 9 changes in 1 month, and 133 changes in 1 year
  Kaganski, Mike made 7 changes in 1 month, and 96 changes in 1 year
  Petros Christopoulos made 7 changes in 1 month, and 7 changes in 1 
year
  m.a.riosv made 6 changes in 1 month, and 49 changes in 1 year
  *UNKNOWN* made 5 changes in 1 month, and 5 changes in 1 year
+ [Bug 160657] Improve how Writer Navigator Headings are displayed when
   alphabetically sorted
+ [Bug 160694] Add .uno:VRuler button to NB Tabbed/Tabbed Compact cutomize
   View list
+ [Bug 160873] Usability: "OLE Object" probably not familiar language
   (Menu: Insert/OLE Object)
+ [Bug 160219] Add confirmation dialog to "Delete all comments"
   (.uno:DeleteAllNotes) in Calc
 -> + [Bug 160465] Ctrl+Shift+F6 is marked reserved, but doesn't do anything
  + ReservedKeys in svapp.cxx not working for triple-state
 -> + [Bug 95274] Wrong editing languages offered
  + gaelic or welsh not correctly reported per libexttextcat, unclear
and input is highly welcome

* Crash Testing (Caolan)
+ 63(+39) import failure, 59(+40) export failures
  + down from a higher, unreported numbers
  + it's an improvement, in fact.
+ 21 coverity issues
+ 5 ossfuzz issues

* Crash Reporting (Xisco)
+ 7.6.5.29807(+812)
+ 7.6.6.32944(+1016)
+ 24.2.1.212822(+961)
+ 24.2.2.26745(+2138)
+ let's wait until next week to see the results from the new release

* Mentoring (Hossein)
  + Reviewd submissions from newcomers
  + Added a new draft blog post for fixing crashes:
Crash fixes, part 4: Assertion failure
(Previous parts were around segfaults, aborts, and how to fix and test them)
https://dev.blog.documentfoundation.org/?p=929=1&_ppp=63e6295aab
  committer...   1 week 1 month 3 months 12 months
  open 104(22) 169(38) 201(42)   201(42)
   reviews 356(26)1152(-40)   3648(-116)   12418(-90)
merged 288(75) 981(47)3241(-10)12462(-29)
 abandoned   

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

2024-05-02 Thread Miklos Vajna (via logerrit)
 sw/qa/core/objectpositioning/objectpositioning.cxx  |   48 
 sw/source/core/objectpositioning/anchoredobjectposition.cxx |5 +
 2 files changed, 52 insertions(+), 1 deletion(-)

New commits:
commit 7f790600a530f7ca7c1e7de0abc0a5bf2f6b3023
Author: Miklos Vajna 
AuthorDate: Tue Apr 30 08:22:03 2024 +0200
Commit: Caolán McNamara 
CommitDate: Thu May 2 14:26:20 2024 +0200

tdf#160833 sw DoNotMirrorRtlDrawObjs: add layout

In case this flag is active (intended for DOCX files), then don't
automatically mirror the position of drawing objects, just because they
are anchored in an RTL text node.

(cherry picked from commit 016b2f2f9194a4a1997d0e7bb51bbd1b10bc27ec)

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

diff --git a/sw/qa/core/objectpositioning/objectpositioning.cxx 
b/sw/qa/core/objectpositioning/objectpositioning.cxx
index bf560cbdaf90..a1805bf4508e 100644
--- a/sw/qa/core/objectpositioning/objectpositioning.cxx
+++ b/sw/qa/core/objectpositioning/objectpositioning.cxx
@@ -24,6 +24,10 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 
 namespace
 {
@@ -404,6 +408,50 @@ CPPUNIT_TEST_FIXTURE(Test, testFloatingTableOverlapCell)
 CPPUNIT_ASSERT(pPage1);
 CPPUNIT_ASSERT(!pPage1->GetNext());
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testDoNotMirrorRtlDrawObjsLayout)
+{
+// Given a document with an RTL paragraph, Word-style compat flag is 
enabled:
+createSwDoc();
+SwDoc* pDoc = getSwDoc();
+auto& rIDSA = pDoc->getIDocumentSettingAccess();
+rIDSA.set(DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS, true);
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+SwView& rView = pWrtShell->GetView();
+SfxItemSetFixed aSet(rView.GetPool());
+SvxFrameDirectionItem aDirection(SvxFrameDirection::Horizontal_RL_TB, 
RES_FRAMEDIR);
+aSet.Put(aDirection);
+pWrtShell->SetAttrSet(aSet, SetAttrMode::DEFAULT, nullptr, 
/*bParagraphSetting=*/true);
+SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+auto pPageFrame = pLayout->Lower()->DynCastPageFrame();
+SwFrame* pBodyFrame = pPageFrame->GetLower();
+
+// When inserting a graphic on the middle of the right margin:
+SfxItemSet aFrameSet(pDoc->GetAttrPool(), svl::Items);
+SwFormatAnchor aAnchor(RndStdIds::FLY_AT_CHAR);
+aFrameSet.Put(aAnchor);
+// Default margin is 1440, this is 1440/2.
+SwFormatFrameSize aSize(SwFrameSize::Fixed, 720, 720);
+aFrameSet.Put(aSize);
+// This is 1440/4.
+SwFormatHoriOrient aOrient(pBodyFrame->getFrameArea().Right() + 360);
+aFrameSet.Put(aOrient);
+Graphic aGrf;
+pWrtShell->SwFEShell::Insert(OUString(), OUString(), , );
+
+// Then make sure that the image is on the right margin:
+SwTwips nBodyRight = pBodyFrame->getFrameArea().Right();
+CPPUNIT_ASSERT(pPageFrame->GetSortedObjs());
+const SwSortedObjs& rPageObjs = *pPageFrame->GetSortedObjs();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rPageObjs.size());
+const SwAnchoredObject* pAnchored = rPageObjs[0];
+Point aAnchoredCenter = 
pAnchored->GetDrawObj()->GetLastBoundRect().Center();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected greater than: 11389
+// - Actual  : 643
+// i.e. the graphic was on the left margin, not on the right margin.
+CPPUNIT_ASSERT_GREATER(nBodyRight, aAnchoredCenter.getX());
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx 
b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index ab35ae7af738..4af3af542b27 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -852,7 +852,10 @@ SwTwips SwAnchoredObjectPosition::CalcRelPosX(
 if ( _rHoriOrient.GetHoriOrient() == text::HoriOrientation::NONE )
 {
 // 'manual' horizontal position
-const bool bR2L = rAnchorFrame.IsRightToLeft();
+const IDocumentSettingAccess& rIDSA = 
mpFrameFormat->getIDocumentSettingAccess();
+// If compat flag is active, then disable automatic mirroring for RTL.
+bool bMirrorRtlDrawObjs = 
!rIDSA.get(DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS);
+const bool bR2L = rAnchorFrame.IsRightToLeft() && bMirrorRtlDrawObjs;
 if( IsAnchoredToChar() && text::RelOrientation::CHAR == eRelOrient )
 {
 if( bR2L )


core.git: sw/CppunitTest_sw_writerfilter_filter.mk sw/Module_sw.mk sw/qa sw/source

2024-05-02 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_writerfilter_filter.mk|   59 
++
 sw/Module_sw.mk |1 
 sw/qa/writerfilter/cppunittests/filter/WriterFilter.cxx |   57 
+
 sw/qa/writerfilter/cppunittests/filter/data/draw-obj-rtl-no-mirror.docx |binary
 sw/source/writerfilter/filter/WriterFilter.cxx  |1 
 5 files changed, 118 insertions(+)

New commits:
commit 01dcc9a652ecfc65fb674b492afa6f58b0a846db
Author: Miklos Vajna 
AuthorDate: Thu May 2 08:42:25 2024 +0200
Commit: Miklos Vajna 
CommitDate: Thu May 2 12:08:31 2024 +0200

tdf#160833 DOCX import: use the DoNotMirrorRtlDrawObjs compat flag

The bugdoc has a shape which should be on the right page margin, but it
was on the left page margin.

Use the new compat flag to have a layout that matches Word.

This way we don't need to unmap the tweaked position at export time (a
limitation that the DOC filter has).

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

diff --git a/sw/CppunitTest_sw_writerfilter_filter.mk 
b/sw/CppunitTest_sw_writerfilter_filter.mk
new file mode 100644
index ..ad61c66f1ed4
--- /dev/null
+++ b/sw/CppunitTest_sw_writerfilter_filter.mk
@@ -0,0 +1,59 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_writerfilter_filter))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_writerfilter_filter,\
+   boost_headers \
+   libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_writerfilter_filter, \
+sw/qa/writerfilter/cppunittests/filter/WriterFilter \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_writerfilter_filter, \
+basegfx \
+comphelper \
+cppu \
+cppuhelper \
+oox \
+sal \
+subsequenttest \
+test \
+unotest \
+utl \
+tl \
+vcl \
+))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,sw_writerfilter_filter))
+
+$(eval $(call gb_CppunitTest_use_ure,sw_writerfilter_filter))
+$(eval $(call gb_CppunitTest_use_vcl,sw_writerfilter_filter))
+
+$(eval $(call gb_CppunitTest_use_rdb,sw_writerfilter_filter,services))
+
+$(eval $(call gb_CppunitTest_use_custom_headers,sw_writerfilter_filter,\
+   officecfg/registry \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,sw_writerfilter_filter))
+
+# we need to explicitly depend on library sw_writerfilter because it is not 
implied
+# by a link relation
+$(call gb_CppunitTest_get_target,sw_writerfilter_filter) : $(call 
gb_Library_get_target,sw_writerfilter)
+
+ifneq ($(filter MORE_FONTS,$(BUILD_TYPE)),)
+$(eval $(call 
gb_CppunitTest_set_non_application_font_use,sw_writerfilter_filter,abort))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 3fcd0f85ed56..fc2afe9fb7d9 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -175,6 +175,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
 CppunitTest_sw_writerfilter_dmapper \
 CppunitTest_sw_writerfilter_ooxml \
 CppunitTest_sw_writerfilter_rtftok \
+CppunitTest_sw_writerfilter_filter \
 ))
 
 ifneq ($(DISABLE_GUI),TRUE)
diff --git a/sw/qa/writerfilter/cppunittests/filter/WriterFilter.cxx 
b/sw/qa/writerfilter/cppunittests/filter/WriterFilter.cxx
new file mode 100644
index ..10b8cab57a45
--- /dev/null
+++ b/sw/qa/writerfilter/cppunittests/filter/WriterFilter.cxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+using namespace ::com::sun::star;
+
+namespace
+{
+/// Tests for sw/source/writerfilter/filter/WriterFilter.cxx.
+class Test : public UnoApiXmlTest
+{
+public:
+Test()
+: UnoApiXmlTest("/sw/qa/writerfilter/cppunittests/filter/data/")
+{
+}
+};
+
+CPPUNIT_TEST_FIXTURE(Test, testDoNotMirrorRtlDrawObjs)
+{
+// Given a document with a shape, anchored in an RTL paragraph:
+// When loading that document:
+loadFromFile(u"draw-obj-rtl-no-mirror.docx");
+
+// Then make sure the shape is on the ri

core.git: sw/qa

2024-05-02 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/rtfexport/rtfexport5.cxx | 1509 +-
 1 file changed, 948 insertions(+), 561 deletions(-)

New commits:
commit ceaba8bf5903b454ff717d788d2298edbf92bac2
Author: Miklos Vajna 
AuthorDate: Thu May 2 08:19:38 2024 +0200
Commit: Miklos Vajna 
CommitDate: Thu May 2 11:43:30 2024 +0200

CppunitTest_sw_rtfexport5: avoid DECLARE_RTFEXPORT_TEST

No need to go via Writer-specific macros here.

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

diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx 
b/sw/qa/extras/rtfexport/rtfexport5.cxx
index 18ff21848af8..8b897485e92b 100644
--- a/sw/qa/extras/rtfexport/rtfexport5.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport5.cxx
@@ -40,115 +40,188 @@ public:
 }
 };
 
-DECLARE_RTFEXPORT_TEST(testFdo63023, "fdo63023.rtf")
-{
-uno::Reference xHeaderText = 
getProperty>(
-getStyles("PageStyles")->getByName("Standard"), "HeaderText");
-// Back color was black (0) in the header, due to missing color table in 
the substream.
-CPPUNIT_ASSERT_EQUAL(
-Color(0x99),
-getProperty(getRun(getParagraphOfText(1, xHeaderText), 1), 
"CharBackColor"));
+CPPUNIT_TEST_FIXTURE(Test, testFdo63023)
+{
+auto verify = [this]() {
+uno::Reference xHeaderText = 
getProperty>(
+getStyles("PageStyles")->getByName("Standard"), "HeaderText");
+// Back color was black (0) in the header, due to missing color table 
in the substream.
+CPPUNIT_ASSERT_EQUAL(
+Color(0x99),
+getProperty(getRun(getParagraphOfText(1, xHeaderText), 1), 
"CharBackColor"));
+};
+createSwDoc("fdo63023.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testFdo42109, "fdo42109.rtf")
-{
-uno::Reference xTextTablesSupplier(mxComponent, 
uno::UNO_QUERY);
-uno::Reference 
xTables(xTextTablesSupplier->getTextTables(),
-uno::UNO_QUERY);
-uno::Reference xTable(xTables->getByIndex(0), 
uno::UNO_QUERY);
-uno::Reference xCell(xTable->getCellByName("B1"), 
uno::UNO_QUERY);
-// Make sure the page number is imported as a field in the B1 cell.
-CPPUNIT_ASSERT_EQUAL(OUString("TextField"),
- getProperty(getRun(getParagraphOfText(1, 
xCell->getText()), 1),
-   "TextPortionType"));
+CPPUNIT_TEST_FIXTURE(Test, testFdo42109)
+{
+auto verify = [this]() {
+uno::Reference 
xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xTables(xTextTablesSupplier->getTextTables(),
+uno::UNO_QUERY);
+uno::Reference xTable(xTables->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xCell(xTable->getCellByName("B1"), 
uno::UNO_QUERY);
+// Make sure the page number is imported as a field in the B1 cell.
+CPPUNIT_ASSERT_EQUAL(
+OUString("TextField"),
+getProperty(getRun(getParagraphOfText(1, 
xCell->getText()), 1),
+  "TextPortionType"));
+};
+createSwDoc("fdo42109.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testFdo62977, "fdo62977.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testFdo62977)
 {
-// The middle character was imported as '?' instead of the proper unicode 
value.
-getRun(getParagraph(1), 1, u"\u5E74\uFF14\u6708"_ustr);
+auto verify = [this]() {
+// The middle character was imported as '?' instead of the proper 
unicode value.
+getRun(getParagraph(1), 1, u"\u5E74\uFF14\u6708"_ustr);
+};
+createSwDoc("fdo62977.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testN818997, "n818997.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testN818997)
 {
-// \page was ignored between two \shp tokens.
-CPPUNIT_ASSERT_EQUAL(2, getPages());
+auto verify = [this]() {
+// \page was ignored between two \shp tokens.
+CPPUNIT_ASSERT_EQUAL(2, getPages());
+};
+createSwDoc("n818997.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testN818997B, "n818997B.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testN818997B)
 {
-// \page was ignored between two \shp tokens - this time not 
IsFirstParagraphInSection.
-CPPUNIT_ASSERT_EQUAL(2, getPages());
+auto verify = [this]() {
+// \page was ignored between two \shp tokens - this time not 
IsFirstParagraphInS

ESC meeting agenda: 2024-05-02 16:00 CEST

2024-04-30 Thread Miklos Vajna

Hi,

The prototype agenda is below. Extra items are appreciated either in
this document or as a reply to this mail:

https://pad.documentfoundation.org/p/esc

You can join using Jitsi here:

https://jitsi.documentfoundation.org/esc

Regards,

Miklos

---

* Present:
+

* Completed Action Items:

* Pending Action Items:

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 RC2 this week?
+ 24.2: 24.2.4 RC1 in 2 weeks?

* Documentation (Olivier)
+ Bugzilla Documentation statistics
264(264) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 10(-9)   38(2) 101(3) 223(1)
 commented 18(0)63(3) 251(13)850(-2)
  resolved  6(-3)   19(3)  49(3) 119(2)
+ top 10 contributors:
  Olivier Hallot made 33 changes in 1 month, and 256 changes in 1 year
  Stéphane Guillou made 29 changes in 1 month, and 255 changes in 1 year
  Vernon, Stuart Foote made 22 changes in 1 month, and 105 changes in 1 
year
  Dione Maddern made 10 changes in 1 month, and 31 changes in 1 year
  MeBugzilla made 7 changes in 1 month, and 7 changes in 1 year
  Nabet, Julien made 7 changes in 1 month, and 53 changes in 1 year
  nobu made 7 changes in 1 month, and 16 changes in 1 year
  Ilmari Lauhakangas made 6 changes in 1 month, and 71 changes in 1 year
  Cor Nouws made 5 changes in 1 month, and 8 changes in 1 year
  Kaganski, Mike made 4 changes in 1 month, and 68 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
242(242) (topicUI) bugs open, 35(35) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week1 month3 months   12 months
 added  5(2)   8(-3) 15(-3)  24(-2)
 commented 38(-11)   173(-18)   559(6) 1842(-60)
   removed  3(3)   5(3)   5(3)   14(3)
  resolved  7(-2) 30(-1) 87(-1) 315(0)
+ top 10 contributors:
  Heiko Tietze made 107 changes in 1 month, and 1078 changes in 1 year
  Vernon, Stuart Foote made 105 changes in 1 month, and 306 changes in 
1 year
  Stéphane Guillou made 57 changes in 1 month, and 643 changes in 1 year
  Ilmari Lauhakangas made 19 changes in 1 month, and 142 changes in 1 
year
  Dieter made 15 changes in 1 month, and 136 changes in 1 year
  Eyal Rozenberg made 9 changes in 1 month, and 133 changes in 1 year
  Kaganski, Mike made 7 changes in 1 month, and 96 changes in 1 year
  Petros Christopoulos made 7 changes in 1 month, and 7 changes in 1 
year
  m.a.riosv made 6 changes in 1 month, and 49 changes in 1 year
  *UNKNOWN* made 5 changes in 1 month, and 5 changes in 1 year

* Crash Testing (Caolan)
+ 63(+39) import failure, 59(+40) export failures
+ ??? coverity issues
+ Google / ossfuzz: ?? fuzzers active now

* Crash Reporting (Xisco)
+ 24.2.0.316665(+670)
+ 24.2.1.170(+5)
+ 24.2.1.212822(+961)
+ 24.2.2.26745(+2138)

* Mentoring (Hossein)
  committer...   1 week 1 month 3 months 12 months
  open 104(22) 169(38) 201(42)   201(42)
   reviews 356(26)1152(-40)   3648(-116)   12418(-90)
merged 288(75) 981(47)3241(-10)12462(-29)
 abandoned  10(-12) 57(3)  174(1)657(-9)
   own commits 194(22) 694(22)2169(2)   9190(-9)
review commits  47(-16)224(-35)856(-15) 3056(-11)
contributor...   1 week 1 month 3 months   12 months
  open  35(-6)  71(-19) 95(-5)  95(-5)
   reviews 792(86)2546(0) 7698(32)   29426(-22)
merged  17(-10)114(-27)378(24)1693(17)
 abandoned  13(2)   54(3)  298(1)  707(15)
   own commits  22(-8) 106(-43)436(-3)1127(6)
review commits   0(0)0(0)0(0)0(0)
+ easyHack statistics:
   needsDevEval 8(8)   needsUXEval 1(1)   cleanup_comments 331(331)
   total 411(411)   assigned 28(28)   open 349(349)
+ top 10 contributors:
  Armin Le Grand (allotropia) made 8 patches in 1 month, and 89 patches 
in 1 year
  Ritobroto Mukherjee made 7 patches in 1 month, and 14 patches in 1 
year
  Rafał Dobrakowski made 5 patches in 1 month, and 16 patches in 1 year
made 5 patches in 1 month, and 5 patches in 1 year
  Juan José González made 4 patches in 1 month, and 11 patches in 1 year
  Kira Tubo made 4 patches in 1 month, and 14 patches in 1 year
  Dione Maddern made 4 patches in 1 month, and 34 patches in 1 year
  colton Garrett made 4 patches in 1 month, and 4 patches in 1 year

ESC meeting agenda: 2024-05-02 16:00 CEST

2024-04-30 Thread Miklos Vajna

Hi,

The prototype agenda is below. Extra items are appreciated either in
this document or as a reply to this mail:

https://pad.documentfoundation.org/p/esc

You can join using Jitsi here:

https://jitsi.documentfoundation.org/esc

Regards,

Miklos

---

* Present:
+

* Completed Action Items:

* Pending Action Items:

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 RC2 this week?
+ 24.2: 24.2.4 RC1 in 2 weeks?

* Documentation (Olivier)
+ Bugzilla Documentation statistics
264(264) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 10(-9)   38(2) 101(3) 223(1)
 commented 18(0)63(3) 251(13)850(-2)
  resolved  6(-3)   19(3)  49(3) 119(2)
+ top 10 contributors:
  Olivier Hallot made 33 changes in 1 month, and 256 changes in 1 year
  Stéphane Guillou made 29 changes in 1 month, and 255 changes in 1 year
  Vernon, Stuart Foote made 22 changes in 1 month, and 105 changes in 1 
year
  Dione Maddern made 10 changes in 1 month, and 31 changes in 1 year
  MeBugzilla made 7 changes in 1 month, and 7 changes in 1 year
  Nabet, Julien made 7 changes in 1 month, and 53 changes in 1 year
  nobu made 7 changes in 1 month, and 16 changes in 1 year
  Ilmari Lauhakangas made 6 changes in 1 month, and 71 changes in 1 year
  Cor Nouws made 5 changes in 1 month, and 8 changes in 1 year
  Kaganski, Mike made 4 changes in 1 month, and 68 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
242(242) (topicUI) bugs open, 35(35) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week1 month3 months   12 months
 added  5(2)   8(-3) 15(-3)  24(-2)
 commented 38(-11)   173(-18)   559(6) 1842(-60)
   removed  3(3)   5(3)   5(3)   14(3)
  resolved  7(-2) 30(-1) 87(-1) 315(0)
+ top 10 contributors:
  Heiko Tietze made 107 changes in 1 month, and 1078 changes in 1 year
  Vernon, Stuart Foote made 105 changes in 1 month, and 306 changes in 
1 year
  Stéphane Guillou made 57 changes in 1 month, and 643 changes in 1 year
  Ilmari Lauhakangas made 19 changes in 1 month, and 142 changes in 1 
year
  Dieter made 15 changes in 1 month, and 136 changes in 1 year
  Eyal Rozenberg made 9 changes in 1 month, and 133 changes in 1 year
  Kaganski, Mike made 7 changes in 1 month, and 96 changes in 1 year
  Petros Christopoulos made 7 changes in 1 month, and 7 changes in 1 
year
  m.a.riosv made 6 changes in 1 month, and 49 changes in 1 year
  *UNKNOWN* made 5 changes in 1 month, and 5 changes in 1 year

* Crash Testing (Caolan)
+ 63(+39) import failure, 59(+40) export failures
+ ??? coverity issues
+ Google / ossfuzz: ?? fuzzers active now

* Crash Reporting (Xisco)
+ 24.2.0.316665(+670)
+ 24.2.1.170(+5)
+ 24.2.1.212822(+961)
+ 24.2.2.26745(+2138)

* Mentoring (Hossein)
  committer...   1 week 1 month 3 months 12 months
  open 104(22) 169(38) 201(42)   201(42)
   reviews 356(26)1152(-40)   3648(-116)   12418(-90)
merged 288(75) 981(47)3241(-10)12462(-29)
 abandoned  10(-12) 57(3)  174(1)657(-9)
   own commits 194(22) 694(22)2169(2)   9190(-9)
review commits  47(-16)224(-35)856(-15) 3056(-11)
contributor...   1 week 1 month 3 months   12 months
  open  35(-6)  71(-19) 95(-5)  95(-5)
   reviews 792(86)2546(0) 7698(32)   29426(-22)
merged  17(-10)114(-27)378(24)1693(17)
 abandoned  13(2)   54(3)  298(1)  707(15)
   own commits  22(-8) 106(-43)436(-3)1127(6)
review commits   0(0)0(0)0(0)0(0)
+ easyHack statistics:
   needsDevEval 8(8)   needsUXEval 1(1)   cleanup_comments 331(331)
   total 411(411)   assigned 28(28)   open 349(349)
+ top 10 contributors:
  Armin Le Grand (allotropia) made 8 patches in 1 month, and 89 patches 
in 1 year
  Ritobroto Mukherjee made 7 patches in 1 month, and 14 patches in 1 
year
  Rafał Dobrakowski made 5 patches in 1 month, and 16 patches in 1 year
made 5 patches in 1 month, and 5 patches in 1 year
  Juan José González made 4 patches in 1 month, and 11 patches in 1 year
  Kira Tubo made 4 patches in 1 month, and 14 patches in 1 year
  Dione Maddern made 4 patches in 1 month, and 34 patches in 1 year
  colton Garrett made 4 patches in 1 month, and 4 patches in 1 year

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

2024-04-30 Thread Miklos Vajna (via logerrit)
 sw/inc/IDocumentSettingAccess.hxx |1 +
 sw/qa/uibase/uno/uno.cxx  |   24 
 sw/source/core/doc/DocumentSettingManager.cxx |   10 ++
 sw/source/core/inc/DocumentSettingManager.hxx |1 +
 sw/source/filter/xml/xmlexp.cxx   |1 +
 sw/source/filter/xml/xmlimp.cxx   |   10 ++
 sw/source/uibase/uno/SwXDocumentSettings.cxx  |   18 ++
 7 files changed, 65 insertions(+)

New commits:
commit 99417eb50996e50c99d9557444ad5ce321901ef4
Author: Miklos Vajna 
AuthorDate: Mon Apr 29 10:39:43 2024 +0200
Commit: Caolán McNamara 
CommitDate: Tue Apr 30 11:51:09 2024 +0200

tdf#160833 sw: add a DoNotMirrorRtlDrawObjs compat flag

The DOCX bugdoc has a circle shape anchored inside an RTL paragraph:
this shows up on the right hand side in Word, but on the left hand side
in Writer.

What happens is that Writer implicitly mirrors draw objects anchored in
RTL paragraphs, while Word doesn't do this.

Start fixing the problem by adding a new layout compatibility flag that
can be used by the DOCX import in the future, to leave the behavior
unchanged for new & existing ODT documents.

An alternative would be to do something similar to the DOC import's
SwWW8ImplReader::MiserableRTLGraphicsHack(), but 1) we don't have the
page margins by the time we import the shape and 2) as its name says, it
doesn't feel like a clean solution, it's better to handle this
difference at a layout level.

(cherry picked from commit c675eaf923cf579670b8ba2f7794b47be7fad39e)

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

diff --git a/sw/inc/IDocumentSettingAccess.hxx 
b/sw/inc/IDocumentSettingAccess.hxx
index 0dd9467bdf13..264860b854c4 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -99,6 +99,7 @@ enum class DocumentSettingId
 // tdf#119908 new paragraph justification
 JUSTIFY_LINES_WITH_SHRINKING,
 APPLY_TEXT_ATTR_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH,
+DO_NOT_MIRROR_RTL_DRAW_OBJS,
 // COMPATIBILITY FLAGS END
 BROWSE_MODE,
 HTML_MODE,
diff --git a/sw/qa/uibase/uno/uno.cxx b/sw/qa/uibase/uno/uno.cxx
index d38d0bbfc967..3e6d9c93d51c 100644
--- a/sw/qa/uibase/uno/uno.cxx
+++ b/sw/qa/uibase/uno/uno.cxx
@@ -560,6 +560,30 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, 
testAllowTextAfterFloatingTableBreak)
 CPPUNIT_ASSERT(bAllowTextAfterFloatingTableBreak);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testDoNotMirrorRtlDrawObjs)
+{
+// Given an empty document:
+createSwDoc();
+
+// When checking the state of the DoNotMirrorRtlDrawObjs compat flag:
+uno::Reference xDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xSettings(
+xDocument->createInstance("com.sun.star.document.Settings"), 
uno::UNO_QUERY);
+bool bDoNotMirrorRtlDrawObjs{};
+// Without the accompanying fix in place, this test would have failed with:
+// An uncaught exception of type 
com.sun.star.beans.UnknownPropertyException
+// i.e. the compat flag was not recognized.
+xSettings->getPropertyValue("DoNotMirrorRtlDrawObjs") >>= 
bDoNotMirrorRtlDrawObjs;
+// Then make sure it's false by default:
+CPPUNIT_ASSERT(!bDoNotMirrorRtlDrawObjs);
+
+// And when setting DoNotMirrorRtlDrawObjs=true:
+xSettings->setPropertyValue("DoNotMirrorRtlDrawObjs", uno::Any(true));
+// Then make sure it gets enabled:
+xSettings->getPropertyValue("DoNotMirrorRtlDrawObjs") >>= 
bDoNotMirrorRtlDrawObjs;
+CPPUNIT_ASSERT(bDoNotMirrorRtlDrawObjs);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index 661c001e98c2..14cfa5fd3c24 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -256,6 +256,8 @@ bool sw::DocumentSettingManager::get(/*[in]*/ 
DocumentSettingId id) const
 return mbDoNotBreakWrappedTables;
 case DocumentSettingId::ALLOW_TEXT_AFTER_FLOATING_TABLE_BREAK:
 return mbAllowTextAfterFloatingTableBreak;
+case DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS:
+return mbDoNotMirrorRtlDrawObjs;
 case DocumentSettingId::JUSTIFY_LINES_WITH_SHRINKING:
 return mbJustifyLinesWithShrinking;
 case DocumentSettingId::NO_NUMBERING_SHOW_FOLLOWBY: return 
mbNoNumberingShowFollowBy;
@@ -450,6 +452,10 @@ void sw::DocumentSettingManager::set(/*[in]*/ 
DocumentSettingId id, /*[in]*/ boo
 mbApplyTextAttrToEmptyLineAtEndOfPara

core.git: sw/qa sw/source

2024-04-30 Thread Miklos Vajna (via logerrit)
 sw/qa/core/txtnode/data/plain-content-control-copy.docx |binary
 sw/qa/core/txtnode/txtnode.cxx  |   23 
 sw/source/core/txtnode/thints.cxx   |4 ++
 3 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 06aeb9c61d50bba7edafe17f9d3513af26b0782f
Author: Miklos Vajna 
AuthorDate: Tue Apr 30 08:44:59 2024 +0200
Commit: Miklos Vajna 
CommitDate: Tue Apr 30 10:12:13 2024 +0200

tdf#159683 sw content controls, plain text: fix crash with the clipboard doc

Regression from commit c804c5354855188b5a37219cfe11dc079dc235f4 (sw
content control: fix lost properties on copy, 2023-03-10), select
a plain text content control, copy it to the clipboard, quit: assertion
fails during shutdown because the doc's "placeholder text" char style is
still referenced by a client.

What happens here is that the SwContentControl copy ctor copies the
plain text flag, and that flag is only read in SwTextNode::InsertHint(),
so that causes the problem. Note how that code is inconsistent: we avoid
the creation of dummy characters in the copy case, but we still try to
adjust the start/end of the content control attribute in the copy case,
which makes not much sense.

Fix the problem by not adjusting the content control attribute
boundaries in the copy case, since the original intention was to do
thees corrections only at a UI level, during interactive edit.

It's not clear why this inconsistency had an influence on the clients of
the char style, though.

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

diff --git a/sw/qa/core/txtnode/data/plain-content-control-copy.docx 
b/sw/qa/core/txtnode/data/plain-content-control-copy.docx
new file mode 100644
index ..80fecae26d5b
Binary files /dev/null and 
b/sw/qa/core/txtnode/data/plain-content-control-copy.docx differ
diff --git a/sw/qa/core/txtnode/txtnode.cxx b/sw/qa/core/txtnode/txtnode.cxx
index dec97c2ab910..b2bc0cec8b22 100644
--- a/sw/qa/core/txtnode/txtnode.cxx
+++ b/sw/qa/core/txtnode/txtnode.cxx
@@ -539,6 +539,29 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, 
testSplitFlyAnchorSplit)
 CPPUNIT_ASSERT_EQUAL(OUString("PortionType::Fly"), aPortionType);
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testPlainContentControlCopy)
+{
+// Given a document with a plain text content control, all text selected 
and copied to the
+// clipboard:
+createSwDoc("plain-content-control-copy.docx");
+SwDocShell* pDocShell = getSwDocShell();
+SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+pWrtShell->SelAll();
+{
+rtl::Reference xTransfer = new 
SwTransferable(*pWrtShell);
+xTransfer->Copy();
+}
+
+// When closing that document, then make sure we don't crash on shutdown:
+uno::Reference xModel(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xFrame(xModel->getCurrentController()->getFrame(),
+uno::UNO_QUERY);
+// Without the accompanying fix in place, this resulted in an assertion 
failure, a char style
+// still had clients by the time it was deleted.
+xFrame->close(false);
+mxComponent.clear();
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 60161c3b8f89..c684b005504f 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1698,7 +1698,9 @@ bool SwTextNode::InsertHint( SwTextAttr * const pAttr, 
const SetAttrMode nMode )
 // for all of its content.
 auto* pTextContentControl = static_txtattr_cast(
 GetTextAttrAt(pAttr->GetStart(), RES_TXTATR_CONTENTCONTROL, 
::sw::GetTextAttrMode::Parent));
-if (pTextContentControl)
+// If the caller is SwTextNode::CopyText, we just copy an existing 
attribute, no need to
+// correct it.
+if (pTextContentControl && !(nMode & SetAttrMode::NOTXTATRCHR))
 {
 auto& rFormatContentControl
 = 
static_cast(pTextContentControl->GetAttr());


core.git: sw/qa sw/source

2024-04-30 Thread Miklos Vajna (via logerrit)
 sw/qa/core/objectpositioning/objectpositioning.cxx  |   48 
 sw/source/core/objectpositioning/anchoredobjectposition.cxx |5 +
 2 files changed, 52 insertions(+), 1 deletion(-)

New commits:
commit 016b2f2f9194a4a1997d0e7bb51bbd1b10bc27ec
Author: Miklos Vajna 
AuthorDate: Tue Apr 30 08:22:03 2024 +0200
Commit: Miklos Vajna 
CommitDate: Tue Apr 30 09:45:40 2024 +0200

tdf#160833 sw DoNotMirrorRtlDrawObjs: add layout

In case this flag is active (intended for DOCX files), then don't
automatically mirror the position of drawing objects, just because they
are anchored in an RTL text node.

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

diff --git a/sw/qa/core/objectpositioning/objectpositioning.cxx 
b/sw/qa/core/objectpositioning/objectpositioning.cxx
index 717d63ded052..60a14c90547a 100644
--- a/sw/qa/core/objectpositioning/objectpositioning.cxx
+++ b/sw/qa/core/objectpositioning/objectpositioning.cxx
@@ -24,6 +24,10 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 
 #include 
 
@@ -418,6 +422,50 @@ CPPUNIT_TEST_FIXTURE(Test, testFloatingTableOverlapCell)
 CPPUNIT_ASSERT(pPage1);
 CPPUNIT_ASSERT(!pPage1->GetNext());
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testDoNotMirrorRtlDrawObjsLayout)
+{
+// Given a document with an RTL paragraph, Word-style compat flag is 
enabled:
+createSwDoc();
+SwDoc* pDoc = getSwDoc();
+auto& rIDSA = pDoc->getIDocumentSettingAccess();
+rIDSA.set(DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS, true);
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+SwView& rView = pWrtShell->GetView();
+SfxItemSetFixed aSet(rView.GetPool());
+SvxFrameDirectionItem aDirection(SvxFrameDirection::Horizontal_RL_TB, 
RES_FRAMEDIR);
+aSet.Put(aDirection);
+pWrtShell->SetAttrSet(aSet, SetAttrMode::DEFAULT, nullptr, 
/*bParagraphSetting=*/true);
+SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+auto pPageFrame = pLayout->Lower()->DynCastPageFrame();
+SwFrame* pBodyFrame = pPageFrame->GetLower();
+
+// When inserting a graphic on the middle of the right margin:
+SfxItemSet aFrameSet(pDoc->GetAttrPool(), svl::Items);
+SwFormatAnchor aAnchor(RndStdIds::FLY_AT_CHAR);
+aFrameSet.Put(aAnchor);
+// Default margin is 1440, this is 1440/2.
+SwFormatFrameSize aSize(SwFrameSize::Fixed, 720, 720);
+aFrameSet.Put(aSize);
+// This is 1440/4.
+SwFormatHoriOrient aOrient(pBodyFrame->getFrameArea().Right() + 360);
+aFrameSet.Put(aOrient);
+Graphic aGrf;
+pWrtShell->SwFEShell::Insert(OUString(), OUString(), , );
+
+// Then make sure that the image is on the right margin:
+SwTwips nBodyRight = pBodyFrame->getFrameArea().Right();
+CPPUNIT_ASSERT(pPageFrame->GetSortedObjs());
+const SwSortedObjs& rPageObjs = *pPageFrame->GetSortedObjs();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rPageObjs.size());
+const SwAnchoredObject* pAnchored = rPageObjs[0];
+Point aAnchoredCenter = 
pAnchored->GetDrawObj()->GetLastBoundRect().Center();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected greater than: 11389
+// - Actual  : 643
+// i.e. the graphic was on the left margin, not on the right margin.
+CPPUNIT_ASSERT_GREATER(nBodyRight, aAnchoredCenter.getX());
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx 
b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index ab35ae7af738..4af3af542b27 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -852,7 +852,10 @@ SwTwips SwAnchoredObjectPosition::CalcRelPosX(
 if ( _rHoriOrient.GetHoriOrient() == text::HoriOrientation::NONE )
 {
 // 'manual' horizontal position
-const bool bR2L = rAnchorFrame.IsRightToLeft();
+const IDocumentSettingAccess& rIDSA = 
mpFrameFormat->getIDocumentSettingAccess();
+// If compat flag is active, then disable automatic mirroring for RTL.
+bool bMirrorRtlDrawObjs = 
!rIDSA.get(DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS);
+const bool bR2L = rAnchorFrame.IsRightToLeft() && bMirrorRtlDrawObjs;
 if( IsAnchoredToChar() && text::RelOrientation::CHAR == eRelOrient )
 {
 if( bR2L )


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

2024-04-30 Thread Miklos Vajna (via logerrit)
 sw/qa/core/frmedt/frmedt.cxx |   35 +
 sw/source/core/frmedt/fefly1.cxx |   47 ++-
 2 files changed, 81 insertions(+), 1 deletion(-)

New commits:
commit d7f6f7bd0dd5428bd1fd483dd13102174a19cd8e
Author: Miklos Vajna 
AuthorDate: Tue Apr 23 08:29:07 2024 +0200
Commit: Miklos Vajna 
CommitDate: Tue Apr 30 09:17:24 2024 +0200

tdf#159379 sw: fix crash on dropping multiple as-char images

Have an empty Writer document, set preferences so images created via
drag are anchored as-char, drop 2 images from a file manager,
crash.

The root of the problem is that the first image gets dropped fine, but
the second one would be anchored to the currently selected graphic node,
since commit 651527b4efe9700c8c8dff58ce5aa86ad5681f16 (sw: fix
double-click opening frame dialog, not graphic dialog on images,
2022-04-26).

The new SwTextCursor::GetModelPositionForViewPoint() returning a graphic
node for a point inside the image looks correct, so fix the problem by
extending SwFEShell::Insert() to take the anchor position as the anchor
for the new image, in case a graphic node is selected.

The original use-case would use SwEditWin::ExecuteDrop(), but keep the
test simple and invoke the underlying SwFEShell::Insert() instead, that
also triggers the problem.

Change-Id: Ibba57aa28d0616ded16b4abb314f04974f1b8f9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166499
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit f9f2b7590bb7b3334d499b6884cc7f3e80843b8c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166511
Reviewed-by: Xisco Fauli 
(cherry picked from commit 008b1c3a8652b33b9b42ca0794a21ce9754e96f2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166884
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/qa/core/frmedt/frmedt.cxx b/sw/qa/core/frmedt/frmedt.cxx
index b2a53e60db27..37425c13060e 100644
--- a/sw/qa/core/frmedt/frmedt.cxx
+++ b/sw/qa/core/frmedt/frmedt.cxx
@@ -250,6 +250,41 @@ CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testSplitFlyUnfloat)
 CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pDoc->GetTableFrameFormatCount(/*bUsed=*/true));
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testInsertOnGrfNodeAsChar)
+{
+// Given a selected as-char image:
+createSwDoc();
+SwDoc* pDoc = getSwDocShell()->GetDoc();
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+{
+SfxItemSet aFrameSet(pDoc->GetAttrPool(), svl::Items);
+SwFormatAnchor aAnchor(RndStdIds::FLY_AS_CHAR);
+aFrameSet.Put(aAnchor);
+Graphic aGrf;
+pWrtShell->SwFEShell::Insert(OUString(), OUString(), , 
);
+}
+
+// When inserting another as-char image:
+SfxItemSet aFrameSet(pDoc->GetAttrPool(), svl::Items);
+SwFormatAnchor aAnchor(RndStdIds::FLY_AS_CHAR);
+aFrameSet.Put(aAnchor);
+Graphic aGrf;
+// Without the accompanying fix in place, this call crashed, we try to set 
a graphic node as an
+// anchor of an as-char image (which should be a text node).
+pWrtShell->SwFEShell::Insert(OUString(), OUString(), , );
+
+// Then make sure that the anchor of the second image is next to the first 
anchor:
+CPPUNIT_ASSERT(pDoc->GetSpzFrameFormats());
+sw::FrameFormats& rFormats = 
*pDoc->GetSpzFrameFormats();
+CPPUNIT_ASSERT_EQUAL(static_cast(2), rFormats.size());
+const sw::SpzFrameFormat& rFormat1 = *rFormats[0];
+const SwPosition* pAnchor1 = rFormat1.GetAnchor().GetContentAnchor();
+const sw::SpzFrameFormat& rFormat2 = *rFormats[1];
+const SwPosition* pAnchor2 = rFormat2.GetAnchor().GetContentAnchor();
+CPPUNIT_ASSERT_EQUAL(pAnchor1->nNode, pAnchor2->nNode);
+CPPUNIT_ASSERT_EQUAL(pAnchor1->GetContentIndex() + 1, 
pAnchor2->GetContentIndex());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 93ad4212cf65..2e5b8bf53d15 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -890,6 +890,43 @@ const SwFrameFormat *SwFEShell::NewFlyFrame( const 
SfxItemSet& rSet, bool bAnchV
 return pRet;
 }
 
+namespace
+{
+/// If pCursor points to an as-char anchored graphic node, then set the node's 
anchor position on
+/// pAnchor and rPam.
+bool SetAnchorOnGrfNodeForAsChar(SwShellCursor *pCursor, SwFormatAnchor* 
pAnchor, std::optional& rPam)
+{
+const SwPosition* pPoint = pCursor->GetPoint();
+if (pAnchor->GetAnchorId() != RndStdIds::FLY_AS_CHAR)
+{
+return false;
+}
+
+if (!pPoint->GetNode().IsGrfNode())
+{
+return false;
+}
+
+SwFrameFormat* pFrameFormat = pPoint->GetNode().GetFlyFormat();
+if (!pFrameFormat)
+{
+return false;
+ 

core.git: Branch 'libreoffice-24-2' - sw/qa sw/source

2024-04-29 Thread Miklos Vajna (via logerrit)
 sw/qa/core/frmedt/frmedt.cxx |   35 +
 sw/source/core/frmedt/fefly1.cxx |   47 ++-
 2 files changed, 81 insertions(+), 1 deletion(-)

New commits:
commit 008b1c3a8652b33b9b42ca0794a21ce9754e96f2
Author: Miklos Vajna 
AuthorDate: Tue Apr 23 08:29:07 2024 +0200
Commit: Xisco Fauli 
CommitDate: Mon Apr 29 20:51:21 2024 +0200

tdf#159379 sw: fix crash on dropping multiple as-char images

Have an empty Writer document, set preferences so images created via
drag are anchored as-char, drop 2 images from a file manager,
crash.

The root of the problem is that the first image gets dropped fine, but
the second one would be anchored to the currently selected graphic node,
since commit 651527b4efe9700c8c8dff58ce5aa86ad5681f16 (sw: fix
double-click opening frame dialog, not graphic dialog on images,
2022-04-26).

The new SwTextCursor::GetModelPositionForViewPoint() returning a graphic
node for a point inside the image looks correct, so fix the problem by
extending SwFEShell::Insert() to take the anchor position as the anchor
for the new image, in case a graphic node is selected.

The original use-case would use SwEditWin::ExecuteDrop(), but keep the
test simple and invoke the underlying SwFEShell::Insert() instead, that
also triggers the problem.

Change-Id: Ibba57aa28d0616ded16b4abb314f04974f1b8f9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166499
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit f9f2b7590bb7b3334d499b6884cc7f3e80843b8c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166511
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/core/frmedt/frmedt.cxx b/sw/qa/core/frmedt/frmedt.cxx
index b2a53e60db27..37425c13060e 100644
--- a/sw/qa/core/frmedt/frmedt.cxx
+++ b/sw/qa/core/frmedt/frmedt.cxx
@@ -250,6 +250,41 @@ CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testSplitFlyUnfloat)
 CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pDoc->GetTableFrameFormatCount(/*bUsed=*/true));
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testInsertOnGrfNodeAsChar)
+{
+// Given a selected as-char image:
+createSwDoc();
+SwDoc* pDoc = getSwDocShell()->GetDoc();
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+{
+SfxItemSet aFrameSet(pDoc->GetAttrPool(), svl::Items);
+SwFormatAnchor aAnchor(RndStdIds::FLY_AS_CHAR);
+aFrameSet.Put(aAnchor);
+Graphic aGrf;
+pWrtShell->SwFEShell::Insert(OUString(), OUString(), , 
);
+}
+
+// When inserting another as-char image:
+SfxItemSet aFrameSet(pDoc->GetAttrPool(), svl::Items);
+SwFormatAnchor aAnchor(RndStdIds::FLY_AS_CHAR);
+aFrameSet.Put(aAnchor);
+Graphic aGrf;
+// Without the accompanying fix in place, this call crashed, we try to set 
a graphic node as an
+// anchor of an as-char image (which should be a text node).
+pWrtShell->SwFEShell::Insert(OUString(), OUString(), , );
+
+// Then make sure that the anchor of the second image is next to the first 
anchor:
+CPPUNIT_ASSERT(pDoc->GetSpzFrameFormats());
+sw::FrameFormats& rFormats = 
*pDoc->GetSpzFrameFormats();
+CPPUNIT_ASSERT_EQUAL(static_cast(2), rFormats.size());
+const sw::SpzFrameFormat& rFormat1 = *rFormats[0];
+const SwPosition* pAnchor1 = rFormat1.GetAnchor().GetContentAnchor();
+const sw::SpzFrameFormat& rFormat2 = *rFormats[1];
+const SwPosition* pAnchor2 = rFormat2.GetAnchor().GetContentAnchor();
+CPPUNIT_ASSERT_EQUAL(pAnchor1->nNode, pAnchor2->nNode);
+CPPUNIT_ASSERT_EQUAL(pAnchor1->GetContentIndex() + 1, 
pAnchor2->GetContentIndex());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 93ad4212cf65..2e5b8bf53d15 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -890,6 +890,43 @@ const SwFrameFormat *SwFEShell::NewFlyFrame( const 
SfxItemSet& rSet, bool bAnchV
 return pRet;
 }
 
+namespace
+{
+/// If pCursor points to an as-char anchored graphic node, then set the node's 
anchor position on
+/// pAnchor and rPam.
+bool SetAnchorOnGrfNodeForAsChar(SwShellCursor *pCursor, SwFormatAnchor* 
pAnchor, std::optional& rPam)
+{
+const SwPosition* pPoint = pCursor->GetPoint();
+if (pAnchor->GetAnchorId() != RndStdIds::FLY_AS_CHAR)
+{
+return false;
+}
+
+if (!pPoint->GetNode().IsGrfNode())
+{
+return false;
+}
+
+SwFrameFormat* pFrameFormat = pPoint->GetNode().GetFlyFormat();
+if (!pFrameFormat)
+{
+return false;
+}
+
+const SwPosition* pContentAnchor = 
pFrameFormat->GetAnchor().GetContentAnchor();
+if (!pContentAnchor)
+{
+return false;
+}
+
+SwPo

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

2024-04-29 Thread Miklos Vajna (via logerrit)
 sw/inc/IDocumentSettingAccess.hxx |1 +
 sw/qa/uibase/uno/uno.cxx  |   24 
 sw/source/core/doc/DocumentSettingManager.cxx |   10 ++
 sw/source/core/inc/DocumentSettingManager.hxx |1 +
 sw/source/filter/xml/xmlexp.cxx   |1 +
 sw/source/filter/xml/xmlimp.cxx   |   10 ++
 sw/source/uibase/uno/SwXDocumentSettings.cxx  |   18 ++
 7 files changed, 65 insertions(+)

New commits:
commit c675eaf923cf579670b8ba2f7794b47be7fad39e
Author: Miklos Vajna 
AuthorDate: Mon Apr 29 10:39:43 2024 +0200
Commit: Miklos Vajna 
CommitDate: Mon Apr 29 20:30:43 2024 +0200

tdf#160833 sw: add a DoNotMirrorRtlDrawObjs compat flag

The DOCX bugdoc has a circle shape anchored inside an RTL paragraph:
this shows up on the right hand side in Word, but on the left hand side
in Writer.

What happens is that Writer implicitly mirrors draw objects anchored in
RTL paragraphs, while Word doesn't do this.

Start fixing the problem by adding a new layout compatibility flag that
can be used by the DOCX import in the future, to leave the behavior
unchanged for new & existing ODT documents.

An alternative would be to do something similar to the DOC import's
SwWW8ImplReader::MiserableRTLGraphicsHack(), but 1) we don't have the
page margins by the time we import the shape and 2) as its name says, it
doesn't feel like a clean solution, it's better to handle this
difference at a layout level.

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

diff --git a/sw/inc/IDocumentSettingAccess.hxx 
b/sw/inc/IDocumentSettingAccess.hxx
index 0dd9467bdf13..264860b854c4 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -99,6 +99,7 @@ enum class DocumentSettingId
 // tdf#119908 new paragraph justification
 JUSTIFY_LINES_WITH_SHRINKING,
 APPLY_TEXT_ATTR_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH,
+DO_NOT_MIRROR_RTL_DRAW_OBJS,
 // COMPATIBILITY FLAGS END
 BROWSE_MODE,
 HTML_MODE,
diff --git a/sw/qa/uibase/uno/uno.cxx b/sw/qa/uibase/uno/uno.cxx
index d38d0bbfc967..3e6d9c93d51c 100644
--- a/sw/qa/uibase/uno/uno.cxx
+++ b/sw/qa/uibase/uno/uno.cxx
@@ -560,6 +560,30 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, 
testAllowTextAfterFloatingTableBreak)
 CPPUNIT_ASSERT(bAllowTextAfterFloatingTableBreak);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testDoNotMirrorRtlDrawObjs)
+{
+// Given an empty document:
+createSwDoc();
+
+// When checking the state of the DoNotMirrorRtlDrawObjs compat flag:
+uno::Reference xDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xSettings(
+xDocument->createInstance("com.sun.star.document.Settings"), 
uno::UNO_QUERY);
+bool bDoNotMirrorRtlDrawObjs{};
+// Without the accompanying fix in place, this test would have failed with:
+// An uncaught exception of type 
com.sun.star.beans.UnknownPropertyException
+// i.e. the compat flag was not recognized.
+xSettings->getPropertyValue("DoNotMirrorRtlDrawObjs") >>= 
bDoNotMirrorRtlDrawObjs;
+// Then make sure it's false by default:
+CPPUNIT_ASSERT(!bDoNotMirrorRtlDrawObjs);
+
+// And when setting DoNotMirrorRtlDrawObjs=true:
+xSettings->setPropertyValue("DoNotMirrorRtlDrawObjs", uno::Any(true));
+// Then make sure it gets enabled:
+xSettings->getPropertyValue("DoNotMirrorRtlDrawObjs") >>= 
bDoNotMirrorRtlDrawObjs;
+CPPUNIT_ASSERT(bDoNotMirrorRtlDrawObjs);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index 4e093c9230bf..55b625932efb 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -257,6 +257,8 @@ bool sw::DocumentSettingManager::get(/*[in]*/ 
DocumentSettingId id) const
 return mbDoNotBreakWrappedTables;
 case DocumentSettingId::ALLOW_TEXT_AFTER_FLOATING_TABLE_BREAK:
 return mbAllowTextAfterFloatingTableBreak;
+case DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS:
+return mbDoNotMirrorRtlDrawObjs;
 case DocumentSettingId::JUSTIFY_LINES_WITH_SHRINKING:
 return mbJustifyLinesWithShrinking;
 case DocumentSettingId::NO_NUMBERING_SHOW_FOLLOWBY: return 
mbNoNumberingShowFollowBy;
@@ -451,6 +453,10 @@ void sw::DocumentSettingManager::set(/*[in]*/ 
DocumentSettingId id, /*[in]*/ boo
 mbApplyTextAttrToEmptyLineAtEndOfParagraph = value;
 break;
 
+case DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS:
+mbDoNotMirrorRtlDrawObjs = value;
+b

core.git: Branch 'libreoffice-7-6' - sc/source

2024-04-29 Thread Miklos Vajna (via logerrit)
 sc/source/core/data/column3.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 58b85fc5e4ebe6c8a77e2b1935c23bf0ebebad0a
Author: Miklos Vajna 
AuthorDate: Wed Apr 24 09:37:35 2024 +0200
Commit: Xisco Fauli 
CommitDate: Mon Apr 29 18:30:50 2024 +0200

sc: fix crash in ScColumn::SetEditText()

Crashreport:

> SIG   Fatal signal received: SIGSEGV code: 128 for address: 0x0
> program/libsclo.so
>   ScColumn::SetEditText(int, std::unique_ptr >)
>   sc/source/core/data/column3.cxx:2362
> program/libsclo.so
>   ScTable::SetEditText(short, int, std::unique_ptr >)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   ScDocument::SetEditText(ScAddress const&, 
std::unique_ptr >)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   ScDocFunc::SetEditCell(ScAddress const&, EditTextObject const&, 
bool)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   (anonymous 
namespace)::finalizeFormulaProcessing(std::shared_ptr<(anonymous 
namespace)::FormulaProcessingContext>)
>   sc/source/ui/view/viewfunc.cxx:565

Change-Id: I331ca8784702fdcb0ebad6a0a73390dbe2615ece
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166612
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit e3ce4aad47c052dcd67107f7c91336f4ecc949be)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166526
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index f0f4cc83263b..5a1582e560d7 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2358,6 +2358,11 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const 
OUString& rString,
 
 void ScColumn::SetEditText( SCROW nRow, std::unique_ptr 
pEditText )
 {
+if (!pEditText)
+{
+return;
+}
+
 pEditText->NormalizeString(GetDoc().GetSharedStringPool());
 std::vector aNewSharedRows;
 sc::CellStoreType::iterator it = GetPositionToInsert(nRow, aNewSharedRows, 
false);


core.git: Branch 'libreoffice-24-2' - sc/source

2024-04-29 Thread Miklos Vajna (via logerrit)
 sc/source/core/data/column3.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit e49f965e6e0ae7f643ecc012c0fffce02a9cef29
Author: Miklos Vajna 
AuthorDate: Wed Apr 24 09:37:35 2024 +0200
Commit: Xisco Fauli 
CommitDate: Mon Apr 29 18:30:26 2024 +0200

sc: fix crash in ScColumn::SetEditText()

Crashreport:

> SIG   Fatal signal received: SIGSEGV code: 128 for address: 0x0
> program/libsclo.so
>   ScColumn::SetEditText(int, std::unique_ptr >)
>   sc/source/core/data/column3.cxx:2362
> program/libsclo.so
>   ScTable::SetEditText(short, int, std::unique_ptr >)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   ScDocument::SetEditText(ScAddress const&, 
std::unique_ptr >)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   ScDocFunc::SetEditCell(ScAddress const&, EditTextObject const&, 
bool)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   (anonymous 
namespace)::finalizeFormulaProcessing(std::shared_ptr<(anonymous 
namespace)::FormulaProcessingContext>)
>   sc/source/ui/view/viewfunc.cxx:565

Change-Id: I331ca8784702fdcb0ebad6a0a73390dbe2615ece
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166612
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit e3ce4aad47c052dcd67107f7c91336f4ecc949be)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166525
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index f0f4cc83263b..5a1582e560d7 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2358,6 +2358,11 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const 
OUString& rString,
 
 void ScColumn::SetEditText( SCROW nRow, std::unique_ptr 
pEditText )
 {
+if (!pEditText)
+{
+return;
+}
+
 pEditText->NormalizeString(GetDoc().GetSharedStringPool());
 std::vector aNewSharedRows;
 sc::CellStoreType::iterator it = GetPositionToInsert(nRow, aNewSharedRows, 
false);


core.git: include/svx svx/source

2024-04-29 Thread Miklos Vajna (via logerrit)
 include/svx/svdlayer.hxx   |4 ++--
 svx/source/svdraw/svdlayer.cxx |   30 +++---
 2 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit 5a61b590ae51ccf28e501bb943f1cf4a3e9835a1
Author: Miklos Vajna 
AuthorDate: Mon Apr 29 08:15:16 2024 +0200
Commit: Miklos Vajna 
CommitDate: Mon Apr 29 10:10:37 2024 +0200

svx: prefix members of SdrLayerAdmin

See tdf#94879 for motivation.

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

diff --git a/include/svx/svdlayer.hxx b/include/svx/svdlayer.hxx
index d2d9f7e7c164..8201478a2fd8 100644
--- a/include/svx/svdlayer.hxx
+++ b/include/svx/svdlayer.hxx
@@ -105,8 +105,8 @@ friend class SdrModel;
 friend class SdrPage;
 
 std::vector> maLayers;
-SdrLayerAdmin* pParent; // The page's admin knows the doc's admin
-SdrModel* pModel; // For broadcasting
+SdrLayerAdmin* m_pParent; // The page's admin knows the doc's admin
+SdrModel* m_pModel; // For broadcasting
 OUString maControlLayerName;
 // Find a LayerID which is not in use yet. If all have been used up,
 // we return 0.
diff --git a/svx/source/svdraw/svdlayer.cxx b/svx/source/svdraw/svdlayer.cxx
index 200dccd2f520..c48ff9641e55 100644
--- a/svx/source/svdraw/svdlayer.cxx
+++ b/svx/source/svdraw/svdlayer.cxx
@@ -99,15 +99,15 @@ bool SdrLayer::operator==(const SdrLayer& rCmpLayer) const
 }
 
 SdrLayerAdmin::SdrLayerAdmin(SdrLayerAdmin* pNewParent):
-pParent(pNewParent),
-pModel(nullptr),
+m_pParent(pNewParent),
+m_pModel(nullptr),
 maControlLayerName("controls")
 {
 }
 
 SdrLayerAdmin::SdrLayerAdmin(const SdrLayerAdmin& rSrcLayerAdmin):
-pParent(nullptr),
-pModel(nullptr),
+m_pParent(nullptr),
+m_pModel(nullptr),
 maControlLayerName("controls")
 {
 *this = rSrcLayerAdmin;
@@ -127,7 +127,7 @@ SdrLayerAdmin& SdrLayerAdmin::operator=(const 
SdrLayerAdmin& rSrcLayerAdmin)
 if (this != )
 {
 maLayers.clear();
-pParent=rSrcLayerAdmin.pParent;
+m_pParent=rSrcLayerAdmin.m_pParent;
 sal_uInt16 i;
 sal_uInt16 nCount=rSrcLayerAdmin.GetLayerCount();
 for (i=0; iBroadcast(aHint);
-pModel->SetChanged();
+m_pModel->Broadcast(aHint);
+m_pModel->SetChanged();
 }
 }
 
 void SdrLayerAdmin::InsertLayer(std::unique_ptr pLayer, sal_uInt16 
nPos)
 {
-pLayer->SetModel(pModel);
+pLayer->SetModel(m_pModel);
 if(nPos==0x)
 maLayers.push_back(std::move(pLayer));
 else
@@ -180,7 +180,7 @@ SdrLayer* SdrLayerAdmin::NewLayer(const OUString& rName, 
sal_uInt16 nPos)
 {
 SdrLayerID nID=GetUniqueLayerID();
 SdrLayer* pLay=new SdrLayer(nID,rName);
-pLay->SetModel(pModel);
+pLay->SetModel(m_pModel);
 if(nPos==0x)
 maLayers.push_back(std::unique_ptr(pLay));
 else
@@ -220,9 +220,9 @@ const SdrLayer* SdrLayerAdmin::GetLayer(const OUString& 
rName) const
 i++;
 }
 
-if(!pLay && pParent)
+if(!pLay && m_pParent)
 {
-pLay = pParent->GetLayer(rName);
+pLay = m_pParent->GetLayer(rName);
 }
 
 return pLay;
@@ -256,7 +256,7 @@ SdrLayerID SdrLayerAdmin::GetUniqueLayerID() const
 aSet.Set(GetLayer(j)->GetID());
 }
 sal_uInt8 i;
-if (pParent != nullptr)
+if (m_pParent != nullptr)
 {
 i = 254;
 while (i && aSet.IsSet(SdrLayerID(i)))


core.git: solenv/gdb

2024-04-27 Thread Miklos Vajna (via logerrit)
 solenv/gdb/libreoffice/sw_writerfilter.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit adaea5d10d157bacf858a31f611bf3f72ec881a2
Author: Miklos Vajna 
AuthorDate: Fri Apr 26 14:54:47 2024 +0200
Commit: Noel Grandin 
CommitDate: Sat Apr 27 19:06:19 2024 +0200

solenv, gdb fix error while loading the sw_writerfilter pretty printer

Fixes:

Traceback (most recent call last):
  File 
"/home/vmiklos/git/libreoffice/core-clang/instdir/program/libsw_writerfilterlo.so-gdb.py",
 line 23, in 
module = importlib.import_module('libreoffice.' + mod)
  File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 994, in _gcd_import
  File "", line 971, in _find_and_load
  File "", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libreoffice.sw_writerfilter'

When loading a DOCX file while gdb is attached to the soffice process.

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

diff --git a/solenv/gdb/libreoffice/writerfilter.py 
b/solenv/gdb/libreoffice/sw_writerfilter.py
similarity index 97%
rename from solenv/gdb/libreoffice/writerfilter.py
rename to solenv/gdb/libreoffice/sw_writerfilter.py
index 487263e92b99..53a5e9a56436 100644
--- a/solenv/gdb/libreoffice/writerfilter.py
+++ b/solenv/gdb/libreoffice/sw_writerfilter.py
@@ -72,7 +72,7 @@ printer = None
 def build_pretty_printers():
 global printer
 
-printer = printing.Printer("libreoffice/writerfilter")
+printer = printing.Printer("libreoffice/sw_writerfilter")
 printer.add('writerfilter::ooxml::OOXMLProperty', OOXMLPropertyPrinter)
 printer.add('writerfilter::ooxml::OOXMLPropertySet', 
OOXMLPropertySetPrinter)
 printer.add('writerfilter::ooxml::OOXMLPropertySetValue', 
OOXMLPropertySetValuePrinter)


ESC meeting minutes: 2024-04-25

2024-04-25 Thread Miklos Vajna

* Present:
+ Cloph, Heiko, Jonathan, Olivier, Caolan, Hossein, Ilmari, Michael W, 
Stephan, Xisco, Miklos, Eike

* Completed Action Items:
+ Update api.libreoffice.org from 7.4 (Cloph)

* Pending Action Items:

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 RC2 next week
+ 24.2: 24.2.3 RC2 this week

* Documentation (Olivier)
+ Helpcontents2
   + updates and fixes (ohallot, fitoshido)
+ Guides
   + published Calc and Writer guides as web pages.

+ Bugzilla Documentation statistics
264(264) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 15(7)37(7)  98(9) 222(4)
 commented 26(23)   68(11)246(11)856(20)
  resolved  5(-1)   17(1)  46(3) 117(1)
+ top 10 contributors:
  Olivier Hallot made 43 changes in 1 month, and 263 changes in 1 year
  Stéphane Guillou made 25 changes in 1 month, and 255 changes in 1 year
  Dione Maddern made 16 changes in 1 month, and 31 changes in 1 year
  MeBugzilla made 7 changes in 1 month, and 7 changes in 1 year
  Weghorn, Michael made 7 changes in 1 month, and 8 changes in 1 year
  Nabet, Julien made 7 changes in 1 month, and 53 changes in 1 year
  Ilmari Lauhakangas made 6 changes in 1 month, and 71 changes in 1 year
  Kaganski, Mike made 4 changes in 1 month, and 68 changes in 1 year
  Adolfo Jayme Barrientos made 3 changes in 1 month, and 24 changes in 
1 year
  Heiko Tietze made 3 changes in 1 month, and 82 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
241(241) (topicUI) bugs open, 38(38) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week1 month3 months   12 months
 added  2(-2)  9(-10)16(-7)  24(-7)
 commented 50(-21)   196(-35)   556(-8)1894(-55)
   removed  1(0)   3(1)   3(1)   12(0)
  resolved  9(1)  32(4)  89(4)  314(-6)
+ top 10 contributors:
  Vernon, Stuart Foote made 109 changes in 1 month, and 309 changes in 
1 year
  Heiko Tietze made 84 changes in 1 month, and 1079 changes in 1 year
  Stéphane Guillou made 79 changes in 1 month, and 644 changes in 1 year
  Ilmari Lauhakangas made 19 changes in 1 month, and 144 changes in 1 
year
  Dieter made 15 changes in 1 month, and 148 changes in 1 year
  Eyal Rozenberg made 15 changes in 1 month, and 143 changes in 1 year
  Justin Luth made 15 changes in 1 month, and 140 changes in 1 year
  Petros Christopoulos made 7 changes in 1 month, and 7 changes in 1 
year
  Robert Großkopf made 6 changes in 1 month, and 11 changes in 1 year
  *UNKNOWN* made 5 changes in 1 month, and 5 changes in 1 year

+ [Bug 158932] Icons for promote / demote outline level should be improved
+ [Bug 160353] List images in order of document appearance in Calc Navigator
+ [Bug 160764] Request: Set the Navigator viewport to default to Headings
   rather than Sections
 -> + [Bug 160734] Support exporting to Markdown
  + we have a mediawiki export extension already (Olivier)
+ good to not base anything on this, it's in Java (Heiko)
  + would this be extension vs inernal? (Hossein)
  + see ESC minutes from a few months ago, best to decide details when 
somebody would start on this (Ilmari)
+ 
https://lists.freedesktop.org/archives/libreoffice/2024-January/091472.html
  + markdown import/export may fit into a gsoc project (Hossein)
  + liked odpdown by Thorsten (Heiko)
+ [Bug 160732] Rename "Navigation" toolbar to clarify its role, avoid 
confusion,
   and relate to "Recency"


* Crash Testing (Caolan)
+ 24(+0) import failure, 19(+0) export failures
 - some new .odt export failures seen
 https://gerrit.libreoffice.org/c/core/+/166572
+ 16 (unchanged) coverity issues
+ 6 ossfuzz issues
 - seem to have developed a new msan error during build
 ==35384==WARNING: MemorySanitizer: use-of-uninitialized-value
icu_73::Package::readPackage(char const*) 
/work/workdir_for_build/UnpackedTarball/icu/source/tools/toolutil/package.cpp:638:19
probably their side, as this hasn't changed on our side(?)
+ workdir_for_build in a fuzzing build? (Miklos)
  + the all-static case is similar to the mobile build, hence the path 
(Caolan)

* Crash Reporting (Xisco)
+ 7.6.5.28995(+892)
+ 7.6.6.31928(+874)
+ 24.2.0.3   16125(+718)
+ 24.2.1.2   12036(+1143)
+ 24.2.2.2   4911(+1790)
+ just sent the current state to the list: 
https://lists.freedesktop.org/archives/libreoffice/2024-April/091880.html

* Mentoring (Hossein)
  + this week: most time went for gsoc
  + reviewed submissions/ from candidates
  committer...   1 week1 month  3 months   

ESC meeting minutes: 2024-04-25

2024-04-25 Thread Miklos Vajna

* Present:
+ Cloph, Heiko, Jonathan, Olivier, Caolan, Hossein, Ilmari, Michael W, 
Stephan, Xisco, Miklos, Eike

* Completed Action Items:
+ Update api.libreoffice.org from 7.4 (Cloph)

* Pending Action Items:

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 RC2 next week
+ 24.2: 24.2.3 RC2 this week

* Documentation (Olivier)
+ Helpcontents2
   + updates and fixes (ohallot, fitoshido)
+ Guides
   + published Calc and Writer guides as web pages.

+ Bugzilla Documentation statistics
264(264) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 15(7)37(7)  98(9) 222(4)
 commented 26(23)   68(11)246(11)856(20)
  resolved  5(-1)   17(1)  46(3) 117(1)
+ top 10 contributors:
  Olivier Hallot made 43 changes in 1 month, and 263 changes in 1 year
  Stéphane Guillou made 25 changes in 1 month, and 255 changes in 1 year
  Dione Maddern made 16 changes in 1 month, and 31 changes in 1 year
  MeBugzilla made 7 changes in 1 month, and 7 changes in 1 year
  Weghorn, Michael made 7 changes in 1 month, and 8 changes in 1 year
  Nabet, Julien made 7 changes in 1 month, and 53 changes in 1 year
  Ilmari Lauhakangas made 6 changes in 1 month, and 71 changes in 1 year
  Kaganski, Mike made 4 changes in 1 month, and 68 changes in 1 year
  Adolfo Jayme Barrientos made 3 changes in 1 month, and 24 changes in 
1 year
  Heiko Tietze made 3 changes in 1 month, and 82 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
241(241) (topicUI) bugs open, 38(38) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week1 month3 months   12 months
 added  2(-2)  9(-10)16(-7)  24(-7)
 commented 50(-21)   196(-35)   556(-8)1894(-55)
   removed  1(0)   3(1)   3(1)   12(0)
  resolved  9(1)  32(4)  89(4)  314(-6)
+ top 10 contributors:
  Vernon, Stuart Foote made 109 changes in 1 month, and 309 changes in 
1 year
  Heiko Tietze made 84 changes in 1 month, and 1079 changes in 1 year
  Stéphane Guillou made 79 changes in 1 month, and 644 changes in 1 year
  Ilmari Lauhakangas made 19 changes in 1 month, and 144 changes in 1 
year
  Dieter made 15 changes in 1 month, and 148 changes in 1 year
  Eyal Rozenberg made 15 changes in 1 month, and 143 changes in 1 year
  Justin Luth made 15 changes in 1 month, and 140 changes in 1 year
  Petros Christopoulos made 7 changes in 1 month, and 7 changes in 1 
year
  Robert Großkopf made 6 changes in 1 month, and 11 changes in 1 year
  *UNKNOWN* made 5 changes in 1 month, and 5 changes in 1 year

+ [Bug 158932] Icons for promote / demote outline level should be improved
+ [Bug 160353] List images in order of document appearance in Calc Navigator
+ [Bug 160764] Request: Set the Navigator viewport to default to Headings
   rather than Sections
 -> + [Bug 160734] Support exporting to Markdown
  + we have a mediawiki export extension already (Olivier)
+ good to not base anything on this, it's in Java (Heiko)
  + would this be extension vs inernal? (Hossein)
  + see ESC minutes from a few months ago, best to decide details when 
somebody would start on this (Ilmari)
+ 
https://lists.freedesktop.org/archives/libreoffice/2024-January/091472.html
  + markdown import/export may fit into a gsoc project (Hossein)
  + liked odpdown by Thorsten (Heiko)
+ [Bug 160732] Rename "Navigation" toolbar to clarify its role, avoid 
confusion,
   and relate to "Recency"


* Crash Testing (Caolan)
+ 24(+0) import failure, 19(+0) export failures
 - some new .odt export failures seen
 https://gerrit.libreoffice.org/c/core/+/166572
+ 16 (unchanged) coverity issues
+ 6 ossfuzz issues
 - seem to have developed a new msan error during build
 ==35384==WARNING: MemorySanitizer: use-of-uninitialized-value
icu_73::Package::readPackage(char const*) 
/work/workdir_for_build/UnpackedTarball/icu/source/tools/toolutil/package.cpp:638:19
probably their side, as this hasn't changed on our side(?)
+ workdir_for_build in a fuzzing build? (Miklos)
  + the all-static case is similar to the mobile build, hence the path 
(Caolan)

* Crash Reporting (Xisco)
+ 7.6.5.28995(+892)
+ 7.6.6.31928(+874)
+ 24.2.0.3   16125(+718)
+ 24.2.1.2   12036(+1143)
+ 24.2.2.2   4911(+1790)
+ just sent the current state to the list: 
https://lists.freedesktop.org/archives/libreoffice/2024-April/091880.html

* Mentoring (Hossein)
  + this week: most time went for gsoc
  + reviewed submissions/ from candidates
  committer...   1 week1 month  3 months   

core.git: sc/source

2024-04-25 Thread Miklos Vajna (via logerrit)
 sc/source/core/data/column3.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit e3ce4aad47c052dcd67107f7c91336f4ecc949be
Author: Miklos Vajna 
AuthorDate: Wed Apr 24 09:37:35 2024 +0200
Commit: Miklos Vajna 
CommitDate: Thu Apr 25 12:19:32 2024 +0200

sc: fix crash in ScColumn::SetEditText()

Crashreport:

> SIG   Fatal signal received: SIGSEGV code: 128 for address: 0x0
> program/libsclo.so
>   ScColumn::SetEditText(int, std::unique_ptr >)
>   sc/source/core/data/column3.cxx:2362
> program/libsclo.so
>   ScTable::SetEditText(short, int, std::unique_ptr >)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   ScDocument::SetEditText(ScAddress const&, 
std::unique_ptr >)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   ScDocFunc::SetEditCell(ScAddress const&, EditTextObject const&, 
bool)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   (anonymous 
namespace)::finalizeFormulaProcessing(std::shared_ptr<(anonymous 
namespace)::FormulaProcessingContext>)
>   sc/source/ui/view/viewfunc.cxx:565

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

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index e7a971e8c613..26fcd36de0ba 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2356,6 +2356,11 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const 
OUString& rString,
 
 void ScColumn::SetEditText( SCROW nRow, std::unique_ptr 
pEditText )
 {
+if (!pEditText)
+{
+return;
+}
+
 pEditText->NormalizeString(GetDoc().GetSharedStringPool());
 std::vector aNewSharedRows;
 sc::CellStoreType::iterator it = GetPositionToInsert(nRow, aNewSharedRows, 
false);


core.git: sw/CppunitTest_sw_writerfilter_rtftok.mk sw/qa

2024-04-25 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_writerfilter_rtftok.mk |
4 
 sw/qa/writerfilter/cppunittests/rtftok/data/old-para-num-left-margin.rtf |   
10 ++
 2 files changed, 14 insertions(+)

New commits:
commit 7ea2bf1c78bc139141c4d8726b1a2345d29fb361
Author: Miklos Vajna 
AuthorDate: Thu Apr 25 08:40:35 2024 +0200
Commit: Miklos Vajna 
CommitDate: Thu Apr 25 10:03:16 2024 +0200

CppunitTest_sw_writerfilter_rtftok: turn on set_non_application_font_use

Similar to commit dc4d7500c9d283e26d1553ce11366a217cf1f69d (Fix
CppunitTest_sd_import_tests-smartart non_application_font_use,
2023-10-23), got rid of a case where the font name was not explicit.

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

diff --git a/sw/CppunitTest_sw_writerfilter_rtftok.mk 
b/sw/CppunitTest_sw_writerfilter_rtftok.mk
index 7addd16d9d47..b5009ca77c31 100644
--- a/sw/CppunitTest_sw_writerfilter_rtftok.mk
+++ b/sw/CppunitTest_sw_writerfilter_rtftok.mk
@@ -58,4 +58,8 @@ $(eval $(call 
gb_CppunitTest_use_configuration,sw_writerfilter_rtftok))
 # by a link relation
 $(call gb_CppunitTest_get_target,sw_writerfilter_rtftok) : $(call 
gb_Library_get_target,sw_writerfilter)
 
+ifneq ($(filter MORE_FONTS,$(BUILD_TYPE)),)
+$(eval $(call 
gb_CppunitTest_set_non_application_font_use,sw_writerfilter_rtftok,abort))
+endif
+
 # vim: set noet sw=4 ts=4:
diff --git 
a/sw/qa/writerfilter/cppunittests/rtftok/data/old-para-num-left-margin.rtf 
b/sw/qa/writerfilter/cppunittests/rtftok/data/old-para-num-left-margin.rtf
index 99825370e3b4..0bd5dde936eb 100644
--- a/sw/qa/writerfilter/cppunittests/rtftok/data/old-para-num-left-margin.rtf
+++ b/sw/qa/writerfilter/cppunittests/rtftok/data/old-para-num-left-margin.rtf
@@ -1,4 +1,14 @@
 { tf1nsi
+{onttbl
+{0 Noto Sans;}
+{1 Noto Sans;}
+{2 Noto Sans;}
+{3 Noto Sans;}
+{4 Noto Sans;}
+{5 Noto Sans;}
+{6 Noto Sans;}
+{7 Noto Sans;}
+}
 \margt1497\margb590\margl590\margr590\pgwsxn11906\pghsxn16838
 \pard\plain First\par
 \pard\plain


ESC meeting agenda: 2024-04-25 16:00 CEST

2024-04-24 Thread Miklos Vajna

Hi,

The prototype agenda is below. Extra items are appreciated either in
this document or as a reply to this mail:

https://pad.documentfoundation.org/p/esc

You can join using Jitsi here:

https://jitsi.documentfoundation.org/esc

Regards,

Miklos

---

* Present:
+

* Completed Action Items:

* Pending Action Items:
+ Update api.libreoffice.org from 7.4 (Cloph)

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 RC2 next week?
+ 24.2: 24.2.3 RC2 this week?

* Documentation (Olivier)
+ Bugzilla Documentation statistics
264(264) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 15(7)37(7)  98(9) 222(4)
 commented 26(23)   68(11)246(11)856(20)
  resolved  5(-1)   17(1)  46(3) 117(1)
+ top 10 contributors:
  Olivier Hallot made 43 changes in 1 month, and 263 changes in 1 year
  Stéphane Guillou made 25 changes in 1 month, and 255 changes in 1 year
  Dione Maddern made 16 changes in 1 month, and 31 changes in 1 year
  MeBugzilla made 7 changes in 1 month, and 7 changes in 1 year
  Weghorn, Michael made 7 changes in 1 month, and 8 changes in 1 year
  Nabet, Julien made 7 changes in 1 month, and 53 changes in 1 year
  Ilmari Lauhakangas made 6 changes in 1 month, and 71 changes in 1 year
  Kaganski, Mike made 4 changes in 1 month, and 68 changes in 1 year
  Adolfo Jayme Barrientos made 3 changes in 1 month, and 24 changes in 
1 year
  Heiko Tietze made 3 changes in 1 month, and 82 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
241(241) (topicUI) bugs open, 38(38) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week1 month3 months   12 months
 added  2(-2)  9(-10)16(-7)  24(-7)
 commented 50(-21)   196(-35)   556(-8)1894(-55)
   removed  1(0)   3(1)   3(1)   12(0)
  resolved  9(1)  32(4)  89(4)  314(-6)
+ top 10 contributors:
  Vernon, Stuart Foote made 109 changes in 1 month, and 309 changes in 
1 year
  Heiko Tietze made 84 changes in 1 month, and 1079 changes in 1 year
  Stéphane Guillou made 79 changes in 1 month, and 644 changes in 1 year
  Ilmari Lauhakangas made 19 changes in 1 month, and 144 changes in 1 
year
  Dieter made 15 changes in 1 month, and 148 changes in 1 year
  Eyal Rozenberg made 15 changes in 1 month, and 143 changes in 1 year
  Justin Luth made 15 changes in 1 month, and 140 changes in 1 year
  Petros Christopoulos made 7 changes in 1 month, and 7 changes in 1 
year
  Robert Großkopf made 6 changes in 1 month, and 11 changes in 1 year
  *UNKNOWN* made 5 changes in 1 month, and 5 changes in 1 year

* Crash Testing (Caolan)
+ 24(+0) import failure, 19(+0) export failures
+ ??? coverity issues
+ Google / ossfuzz: ?? fuzzers active now

* Crash Reporting (Xisco)
+ 24.2.0.316125(+718)
+ 24.2.1.167(+4)
+ 24.2.1.212036(+1143)
+ 24.2.2.24911(+1790)

* Mentoring (Hossein)
  committer...   1 week1 month  3 months 12 months
  open  92(46)143(23)  171(28)   171(28)
   reviews 357(39)   1211(-165)   3695(-167)   12499(-19)
merged 245(32)964(-17)3229(-48)12441(-53)
 abandoned  21(12) 55(6)   171(4)658(-7)
   own commits 183(54)679(38) 2152(8)   9191(-1)
review commits  67(24)264(5)   873(1)   3068(13)
contributor...   1 week 1 month3 months12 months
  open  44(8)   93(-6)103(-2)  103(-2)
   reviews 745(163)   2605(-7)   7649(-41)   29453(-117)
merged  29(12) 147(10)373(17) 1734(10)
 abandoned  12(1)   51(6) 295(5)   698(8)
   own commits  31(15) 151(-2)442(-4) 1122(5)
review commits   0(0)0(0)   0(0) 0(0)
+ easyHack statistics:
   needsDevEval 8(8)   needsUXEval 1(1)   cleanup_comments 331(331)
   total 413(413)   assigned 28(28)   open 351(351)
+ top 10 contributors:
  LeSasse made 19 patches in 1 month, and 19 patches in 1 year
  Armin Le Grand (allotropia) made 12 patches in 1 month, and 89 
patches in 1 year
  Ritobroto Mukherjee made 10 patches in 1 month, and 14 patches in 1 
year
  Rafał Dobrakowski made 8 patches in 1 month, and 16 patches in 1 year
  Dione Maddern made 8 patches in 1 month, and 34 patches in 1 year
  Bogdan B made 5 patches in 1 month, and 20 patches in 1 year
  Aaron Bourdeaux made 5 patches in 1 month, and 5 patches in 1 year
  

ESC meeting agenda: 2024-04-25 16:00 CEST

2024-04-24 Thread Miklos Vajna

Hi,

The prototype agenda is below. Extra items are appreciated either in
this document or as a reply to this mail:

https://pad.documentfoundation.org/p/esc

You can join using Jitsi here:

https://jitsi.documentfoundation.org/esc

Regards,

Miklos

---

* Present:
+

* Completed Action Items:

* Pending Action Items:
+ Update api.libreoffice.org from 7.4 (Cloph)

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 RC2 next week?
+ 24.2: 24.2.3 RC2 this week?

* Documentation (Olivier)
+ Bugzilla Documentation statistics
264(264) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 15(7)37(7)  98(9) 222(4)
 commented 26(23)   68(11)246(11)856(20)
  resolved  5(-1)   17(1)  46(3) 117(1)
+ top 10 contributors:
  Olivier Hallot made 43 changes in 1 month, and 263 changes in 1 year
  Stéphane Guillou made 25 changes in 1 month, and 255 changes in 1 year
  Dione Maddern made 16 changes in 1 month, and 31 changes in 1 year
  MeBugzilla made 7 changes in 1 month, and 7 changes in 1 year
  Weghorn, Michael made 7 changes in 1 month, and 8 changes in 1 year
  Nabet, Julien made 7 changes in 1 month, and 53 changes in 1 year
  Ilmari Lauhakangas made 6 changes in 1 month, and 71 changes in 1 year
  Kaganski, Mike made 4 changes in 1 month, and 68 changes in 1 year
  Adolfo Jayme Barrientos made 3 changes in 1 month, and 24 changes in 
1 year
  Heiko Tietze made 3 changes in 1 month, and 82 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
241(241) (topicUI) bugs open, 38(38) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week1 month3 months   12 months
 added  2(-2)  9(-10)16(-7)  24(-7)
 commented 50(-21)   196(-35)   556(-8)1894(-55)
   removed  1(0)   3(1)   3(1)   12(0)
  resolved  9(1)  32(4)  89(4)  314(-6)
+ top 10 contributors:
  Vernon, Stuart Foote made 109 changes in 1 month, and 309 changes in 
1 year
  Heiko Tietze made 84 changes in 1 month, and 1079 changes in 1 year
  Stéphane Guillou made 79 changes in 1 month, and 644 changes in 1 year
  Ilmari Lauhakangas made 19 changes in 1 month, and 144 changes in 1 
year
  Dieter made 15 changes in 1 month, and 148 changes in 1 year
  Eyal Rozenberg made 15 changes in 1 month, and 143 changes in 1 year
  Justin Luth made 15 changes in 1 month, and 140 changes in 1 year
  Petros Christopoulos made 7 changes in 1 month, and 7 changes in 1 
year
  Robert Großkopf made 6 changes in 1 month, and 11 changes in 1 year
  *UNKNOWN* made 5 changes in 1 month, and 5 changes in 1 year

* Crash Testing (Caolan)
+ 24(+0) import failure, 19(+0) export failures
+ ??? coverity issues
+ Google / ossfuzz: ?? fuzzers active now

* Crash Reporting (Xisco)
+ 24.2.0.316125(+718)
+ 24.2.1.167(+4)
+ 24.2.1.212036(+1143)
+ 24.2.2.24911(+1790)

* Mentoring (Hossein)
  committer...   1 week1 month  3 months 12 months
  open  92(46)143(23)  171(28)   171(28)
   reviews 357(39)   1211(-165)   3695(-167)   12499(-19)
merged 245(32)964(-17)3229(-48)12441(-53)
 abandoned  21(12) 55(6)   171(4)658(-7)
   own commits 183(54)679(38) 2152(8)   9191(-1)
review commits  67(24)264(5)   873(1)   3068(13)
contributor...   1 week 1 month3 months12 months
  open  44(8)   93(-6)103(-2)  103(-2)
   reviews 745(163)   2605(-7)   7649(-41)   29453(-117)
merged  29(12) 147(10)373(17) 1734(10)
 abandoned  12(1)   51(6) 295(5)   698(8)
   own commits  31(15) 151(-2)442(-4) 1122(5)
review commits   0(0)0(0)   0(0) 0(0)
+ easyHack statistics:
   needsDevEval 8(8)   needsUXEval 1(1)   cleanup_comments 331(331)
   total 413(413)   assigned 28(28)   open 351(351)
+ top 10 contributors:
  LeSasse made 19 patches in 1 month, and 19 patches in 1 year
  Armin Le Grand (allotropia) made 12 patches in 1 month, and 89 
patches in 1 year
  Ritobroto Mukherjee made 10 patches in 1 month, and 14 patches in 1 
year
  Rafał Dobrakowski made 8 patches in 1 month, and 16 patches in 1 year
  Dione Maddern made 8 patches in 1 month, and 34 patches in 1 year
  Bogdan B made 5 patches in 1 month, and 20 patches in 1 year
  Aaron Bourdeaux made 5 patches in 1 month, and 5 patches in 1 year
  

core.git: sc/qa sc/source

2024-04-24 Thread Miklos Vajna (via logerrit)
 sc/qa/unit/tiledrendering/tiledrendering.cxx   |4 ++--
 sc/qa/unit/tiledrendering2/tiledrendering2.cxx |8 
 sc/source/ui/view/viewfun3.cxx |2 +-
 3 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 9f7c961e1c6e7b6aec783ba55a6b8cb6ebcf811d
Author: Miklos Vajna 
AuthorDate: Wed Apr 24 08:22:10 2024 +0200
Commit: Miklos Vajna 
CommitDate: Wed Apr 24 15:11:12 2024 +0200

cool#8789 sc lok: classify multi-selection with 2 cells as simple

The trouble was that even if commit
b13c7b31f9ce3c3a25cffd0c35e7ee6b8c2a1895 (cool#8789 sc lok: fix copy for
multi-selections, 2024-04-19) made multi-selection copy work, just 2
cells in a multi-selection was classified as a complex selection at a
LOK level, while 2 cells next to each other is a simple selection, which
is inconsistent. (A LOK client can provide a simpler UI for simple
selections.)

What happens is that the multi-selection clipboard document had no
selection ranges defined, so ScDocument::GetClipArea() returned early,
so the numbers in the ScTransferObj ctor were left initialized, which at
the end lead to a >1000 cells in ScTransferObj::isComplex(), because we
were calculating uninitialized data.

Fix the problem by passing a range (that covers all ranges of the
multi-selection) to ScViewFunc::CopyToTransferable(), which avoids the
wrong col/row start/length, so the selection is classified as simple.

Also adapt testRowColumnSelections, which was just meant to check we
don't crash, but now the cell under the cell cursor is returned, so the
assert about the empty selection would fail.

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

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 6368a7f68b2e..651df397cc71 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -214,7 +214,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testRowColumnSelections)
 // When we copy this, we don't get anything useful, but we must not crash
 // (used to happen)
 aResult = 
apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), 
"text/plain;charset=utf-8"_ostr);
-CPPUNIT_ASSERT_EQUAL(OString(), aResult);
+CPPUNIT_ASSERT_EQUAL("9"_ostr, aResult);
 
 // TODO check that we really selected what we wanted here
 
@@ -226,7 +226,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testRowColumnSelections)
 // When we copy this, we don't get anything useful, but we must not crash
 // (used to happen)
 aResult = 
apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), 
"text/plain;charset=utf-8"_ostr);
-CPPUNIT_ASSERT_EQUAL(OString(), aResult);
+CPPUNIT_ASSERT_EQUAL("1"_ostr, aResult);
 
 // TODO check that we really selected what we wanted here
 
diff --git a/sc/qa/unit/tiledrendering2/tiledrendering2.cxx 
b/sc/qa/unit/tiledrendering2/tiledrendering2.cxx
index 65a85c685b33..737a0be6a3c8 100644
--- a/sc/qa/unit/tiledrendering2/tiledrendering2.cxx
+++ b/sc/qa/unit/tiledrendering2/tiledrendering2.cxx
@@ -11,6 +11,8 @@
 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -203,6 +205,12 @@ CPPUNIT_TEST_FIXTURE(Test, testCopyMultiSelection)
 
 // Make sure we get A1+A3 instead of an error:
 CPPUNIT_ASSERT(xTransferable.is());
+
+// Also make sure that just 2 cells is classified as a simple selection:
+uno::Reference xTransferable2(xTransferable, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xTransferable2.is());
+// Without the fix, the text selection was complex.
+CPPUNIT_ASSERT(!xTransferable2->isComplex());
 }
 }
 
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 615fa4ae89af..e287609906b6 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -462,7 +462,7 @@ rtl::Reference 
ScViewFunc::CopyToTransferable()
 {
 ScDocumentUniquePtr pClipDoc(new ScDocument(SCDOCMODE_CLIP));
 // This takes care of the input line and calls CopyToClipMultiRange() 
for us.
-CopyToClip(pClipDoc.get(), /*bCut=*/false, /*bApi=*/true);
+CopyToClip(pClipDoc.get(), aRange, /*bCut=*/false, /*bApi=*/true);
 TransferableObjectDescriptor aObjDesc;
 return new ScTransferObj(std::move(pClipDoc), std::move(aObjDesc));
 }


core.git: sw/qa

2024-04-24 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/rtfexport/rtfexport4.cxx | 1404 +++---
 1 file changed, 816 insertions(+), 588 deletions(-)

New commits:
commit 88ef23726498b65b33d80a2e4cf71b00205f80bd
Author: Miklos Vajna 
AuthorDate: Wed Apr 24 08:27:19 2024 +0200
Commit: Miklos Vajna 
CommitDate: Wed Apr 24 12:51:23 2024 +0200

CppunitTest_sw_rtfexport4: avoid DECLARE_RTFEXPORT_TEST

No need to go via Writer-specific macros here.

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

diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx 
b/sw/qa/extras/rtfexport/rtfexport4.cxx
index 25f5394b6ae5..d55bb4279252 100644
--- a/sw/qa/extras/rtfexport/rtfexport4.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport4.cxx
@@ -46,294 +46,403 @@ public:
 }
 };
 
-DECLARE_RTFEXPORT_TEST(testCjklist12, "cjklist12.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testCjklist12)
 {
-sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
-CPPUNIT_ASSERT_EQUAL(style::NumberingType::AIU_HALFWIDTH_JA, numFormat);
+auto verify = [this]() {
+sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
+CPPUNIT_ASSERT_EQUAL(style::NumberingType::AIU_HALFWIDTH_JA, 
numFormat);
+};
+createSwDoc("cjklist12.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testCjklist13, "cjklist13.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testCjklist13)
 {
-sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
-CPPUNIT_ASSERT_EQUAL(style::NumberingType::IROHA_HALFWIDTH_JA, numFormat);
+auto verify = [this]() {
+sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
+CPPUNIT_ASSERT_EQUAL(style::NumberingType::IROHA_HALFWIDTH_JA, 
numFormat);
+};
+createSwDoc("cjklist13.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testCjklist16, "cjklist16.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testCjklist16)
 {
-sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
-CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_TRADITIONAL_JA, 
numFormat);
+auto verify = [this]() {
+sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
+CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_TRADITIONAL_JA, 
numFormat);
+};
+createSwDoc("cjklist16.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testCjklist20, "cjklist20.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testCjklist20)
 {
-sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
-CPPUNIT_ASSERT_EQUAL(style::NumberingType::AIU_FULLWIDTH_JA, numFormat);
+auto verify = [this]() {
+sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
+CPPUNIT_ASSERT_EQUAL(style::NumberingType::AIU_FULLWIDTH_JA, 
numFormat);
+};
+createSwDoc("cjklist20.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testCjklist21, "cjklist21.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testCjklist21)
 {
-sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
-CPPUNIT_ASSERT_EQUAL(style::NumberingType::IROHA_FULLWIDTH_JA, numFormat);
+auto verify = [this]() {
+sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
+CPPUNIT_ASSERT_EQUAL(style::NumberingType::IROHA_FULLWIDTH_JA, 
numFormat);
+};
+createSwDoc("cjklist21.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testCjklist24, "cjklist24.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testCjklist24)
 {
-sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
-CPPUNIT_ASSERT_EQUAL(style::NumberingType::HANGUL_SYLLABLE_KO, numFormat);
+auto verify = [this]() {
+sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
+CPPUNIT_ASSERT_EQUAL(style::NumberingType::HANGUL_SYLLABLE_KO, 
numFormat);
+};
+createSwDoc("cjklist24.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testCjklist25, "cjklist25.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testCjklist25)
 {
-sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
-CPPUNIT_ASSERT_EQUAL(style::NumberingType::HANGUL_JAMO_KO, numFormat);
+auto verify = [this]() {
+sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
+CPPUNIT_ASSERT_EQUAL(style::NumberingType::HANGUL_JAMO_KO, numFormat);
+};
+createSwDoc("cjklist25.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testCjklist30, "cjklist30.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testCjklist30)
 {
-sal_Int16 numFormat = getNumberingTypeOfParagraph(1);
-CPPUNIT_ASSERT_EQUAL(style::NumberingType::TIAN_GAN_ZH, numFormat);
+auto verify 

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

2024-04-24 Thread Miklos Vajna (via logerrit)
 sc/qa/unit/tiledrendering/tiledrendering.cxx |   10 --
 sc/source/ui/view/viewfun3.cxx   |2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 5fcde58ce0b2f3e42dd2e62246ca9704560e57d8
Author: Miklos Vajna 
AuthorDate: Wed Apr 24 08:22:10 2024 +0200
Commit: Miklos Vajna 
CommitDate: Wed Apr 24 11:50:13 2024 +0200

cool#8789 sc lok: classify multi-selection with 2 cells as simple

The trouble was that even if commit
b13c7b31f9ce3c3a25cffd0c35e7ee6b8c2a1895 (cool#8789 sc lok: fix copy for
multi-selections, 2024-04-19) made multi-selection copy work, just 2
cells in a multi-selection was classified as a complex selection at a
LOK level, while 2 cells next to each other is a simple selection, which
is inconsistent. (A LOK client can provide a simpler UI for simple
selections.)

What happens is that the multi-selection clipboard document had no
selection ranges defined, so ScDocument::GetClipArea() returned early,
so the numbers in the ScTransferObj ctor were left initialized, which at
the end lead to a >1000 cells in ScTransferObj::isComplex(), because we
were calculating uninitialized data.

Fix the problem by passing a range (that covers all ranges of the
multi-selection) to ScViewFunc::CopyToTransferable(), which avoids the
wrong col/row start/length, so the selection is classified as simple.

Also adapt testRowColumnSelections, which was just meant to check we
don't crash, but now the cell under the cell cursor is returned, so the
assert about the empty selection would fail.

Change-Id: If98212c623fa75adb2ddf628a6e90f3eef450e59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166574
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit fca9f7899843336d0ff0198a522ec8ccbb4273da)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166578
Reviewed-by: Miklos Vajna 

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 3a9ee97ee49a..1c183521b605 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -223,7 +223,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testRowColumnSelections)
 // When we copy this, we don't get anything useful, but we must not crash
 // (used to happen)
 aResult = 
apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), 
"text/plain;charset=utf-8"_ostr);
-CPPUNIT_ASSERT_EQUAL(OString(), aResult);
+CPPUNIT_ASSERT_EQUAL("9"_ostr, aResult);
 
 // TODO check that we really selected what we wanted here
 
@@ -235,7 +235,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testRowColumnSelections)
 // When we copy this, we don't get anything useful, but we must not crash
 // (used to happen)
 aResult = 
apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), 
"text/plain;charset=utf-8"_ostr);
-CPPUNIT_ASSERT_EQUAL(OString(), aResult);
+CPPUNIT_ASSERT_EQUAL("1"_ostr, aResult);
 
 // TODO check that we really selected what we wanted here
 
@@ -3926,6 +3926,12 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testCopyMultiSelection)
 
 // Make sure we get A1+A3 instead of an error:
 CPPUNIT_ASSERT(xTransferable.is());
+
+// Also make sure that just 2 cells is classified as a simple selection:
+uno::Reference xTransferable2(xTransferable, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xTransferable2.is());
+// Without the fix, the text selection was complex.
+CPPUNIT_ASSERT(!xTransferable2->isComplex());
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index aa8daeb8338f..6003878133cd 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -462,7 +462,7 @@ rtl::Reference 
ScViewFunc::CopyToTransferable()
 {
 ScDocumentUniquePtr pClipDoc(new ScDocument(SCDOCMODE_CLIP));
 // This takes care of the input line and calls CopyToClipMultiRange() 
for us.
-CopyToClip(pClipDoc.get(), /*bCut=*/false, /*bApi=*/true);
+CopyToClip(pClipDoc.get(), aRange, /*bCut=*/false, /*bApi=*/true);
 TransferableObjectDescriptor aObjDesc;
 return new ScTransferObj(std::move(pClipDoc), std::move(aObjDesc));
 }


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

2024-04-24 Thread Miklos Vajna (via logerrit)
 sc/source/core/data/column3.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 1f9f5e67a436d3bf2add9c28b09e34743dcac552
Author: Miklos Vajna 
AuthorDate: Wed Apr 24 09:37:35 2024 +0200
Commit: Caolán McNamara 
CommitDate: Wed Apr 24 10:37:25 2024 +0200

sc: fix crash in ScColumn::SetEditText()

Crashreport:

> SIG   Fatal signal received: SIGSEGV code: 128 for address: 0x0
> program/libsclo.so
>   ScColumn::SetEditText(int, std::unique_ptr >)
>   sc/source/core/data/column3.cxx:2362
> program/libsclo.so
>   ScTable::SetEditText(short, int, std::unique_ptr >)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   ScDocument::SetEditText(ScAddress const&, 
std::unique_ptr >)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   ScDocFunc::SetEditCell(ScAddress const&, EditTextObject const&, 
bool)
>   
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:395
> program/libsclo.so
>   (anonymous 
namespace)::finalizeFormulaProcessing(std::shared_ptr<(anonymous 
namespace)::FormulaProcessingContext>)
>   sc/source/ui/view/viewfunc.cxx:565

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

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 911e59ac7613..fdb8f050b196 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2359,6 +2359,11 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const 
OUString& rString,
 
 void ScColumn::SetEditText( SCROW nRow, std::unique_ptr 
pEditText )
 {
+if (!pEditText)
+{
+return;
+}
+
 pEditText->NormalizeString(GetDoc().GetSharedStringPool());
 std::vector aNewSharedRows;
 sc::CellStoreType::iterator it = GetPositionToInsert(nRow, aNewSharedRows, 
false);


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

2024-04-24 Thread Miklos Vajna (via logerrit)
 sc/qa/unit/tiledrendering/tiledrendering.cxx |   10 --
 sc/source/ui/view/viewfun3.cxx   |2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit fca9f7899843336d0ff0198a522ec8ccbb4273da
Author: Miklos Vajna 
AuthorDate: Wed Apr 24 08:22:10 2024 +0200
Commit: Caolán McNamara 
CommitDate: Wed Apr 24 09:37:08 2024 +0200

cool#8789 sc lok: classify multi-selection with 2 cells as simple

The trouble was that even if commit
b13c7b31f9ce3c3a25cffd0c35e7ee6b8c2a1895 (cool#8789 sc lok: fix copy for
multi-selections, 2024-04-19) made multi-selection copy work, just 2
cells in a multi-selection was classified as a complex selection at a
LOK level, while 2 cells next to each other is a simple selection, which
is inconsistent. (A LOK client can provide a simpler UI for simple
selections.)

What happens is that the multi-selection clipboard document had no
selection ranges defined, so ScDocument::GetClipArea() returned early,
so the numbers in the ScTransferObj ctor were left initialized, which at
the end lead to a >1000 cells in ScTransferObj::isComplex(), because we
were calculating uninitialized data.

Fix the problem by passing a range (that covers all ranges of the
multi-selection) to ScViewFunc::CopyToTransferable(), which avoids the
wrong col/row start/length, so the selection is classified as simple.

Also adapt testRowColumnSelections, which was just meant to check we
don't crash, but now the cell under the cell cursor is returned, so the
assert about the empty selection would fail.

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

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 6e47eefd5cd0..65844f2546f8 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -407,7 +407,7 @@ void ScTiledRenderingTest::testRowColumnSelections()
 // When we copy this, we don't get anything useful, but we must not crash
 // (used to happen)
 aResult = 
apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), 
"text/plain;charset=utf-8");
-CPPUNIT_ASSERT_EQUAL(OString(), aResult);
+CPPUNIT_ASSERT_EQUAL(OString("9"), aResult);
 
 // TODO check that we really selected what we wanted here
 
@@ -419,7 +419,7 @@ void ScTiledRenderingTest::testRowColumnSelections()
 // When we copy this, we don't get anything useful, but we must not crash
 // (used to happen)
 aResult = 
apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), 
"text/plain;charset=utf-8");
-CPPUNIT_ASSERT_EQUAL(OString(), aResult);
+CPPUNIT_ASSERT_EQUAL(OString("1"), aResult);
 
 // TODO check that we really selected what we wanted here
 
@@ -4154,6 +4154,12 @@ void ScTiledRenderingTest::testCopyMultiSelection()
 
 // Make sure we get A1+A3 instead of an error:
 CPPUNIT_ASSERT(xTransferable.is());
+
+// Also make sure that just 2 cells is classified as a simple selection:
+uno::Reference xTransferable2(xTransferable, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xTransferable2.is());
+// Without the fix, the text selection was complex.
+CPPUNIT_ASSERT(!xTransferable2->isComplex());
 }
 
 }
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 769805d5d32a..6540e8f15f6f 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -464,7 +464,7 @@ rtl::Reference 
ScViewFunc::CopyToTransferable()
 {
 ScDocumentUniquePtr pClipDoc(new ScDocument(SCDOCMODE_CLIP));
 // This takes care of the input line and calls CopyToClipMultiRange() 
for us.
-CopyToClip(pClipDoc.get(), /*bCut=*/false, /*bApi=*/true);
+CopyToClip(pClipDoc.get(), aRange, /*bCut=*/false, /*bApi=*/true);
 TransferableObjectDescriptor aObjDesc;
 return new ScTransferObj(std::move(pClipDoc), std::move(aObjDesc));
 }


core.git: sw/qa sw/source

2024-04-23 Thread Miklos Vajna (via logerrit)
 sw/qa/core/frmedt/frmedt.cxx |   35 +
 sw/source/core/frmedt/fefly1.cxx |   47 ++-
 sw/source/uibase/inc/frmmgr.hxx  |2 -
 3 files changed, 82 insertions(+), 2 deletions(-)

New commits:
commit f9f2b7590bb7b3334d499b6884cc7f3e80843b8c
Author: Miklos Vajna 
AuthorDate: Tue Apr 23 08:29:07 2024 +0200
Commit: Miklos Vajna 
CommitDate: Tue Apr 23 09:48:01 2024 +0200

tdf#159379 sw: fix crash on dropping multiple as-char images

Have an empty Writer document, set preferences so images created via
drag are anchored as-char, drop 2 images from a file manager,
crash.

The root of the problem is that the first image gets dropped fine, but
the second one would be anchored to the currently selected graphic node,
since commit 651527b4efe9700c8c8dff58ce5aa86ad5681f16 (sw: fix
double-click opening frame dialog, not graphic dialog on images,
2022-04-26).

The new SwTextCursor::GetModelPositionForViewPoint() returning a graphic
node for a point inside the image looks correct, so fix the problem by
extending SwFEShell::Insert() to take the anchor position as the anchor
for the new image, in case a graphic node is selected.

The original use-case would use SwEditWin::ExecuteDrop(), but keep the
test simple and invoke the underlying SwFEShell::Insert() instead, that
also triggers the problem.

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

diff --git a/sw/qa/core/frmedt/frmedt.cxx b/sw/qa/core/frmedt/frmedt.cxx
index b2a53e60db27..37425c13060e 100644
--- a/sw/qa/core/frmedt/frmedt.cxx
+++ b/sw/qa/core/frmedt/frmedt.cxx
@@ -250,6 +250,41 @@ CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testSplitFlyUnfloat)
 CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pDoc->GetTableFrameFormatCount(/*bUsed=*/true));
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testInsertOnGrfNodeAsChar)
+{
+// Given a selected as-char image:
+createSwDoc();
+SwDoc* pDoc = getSwDocShell()->GetDoc();
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+{
+SfxItemSet aFrameSet(pDoc->GetAttrPool(), svl::Items);
+SwFormatAnchor aAnchor(RndStdIds::FLY_AS_CHAR);
+aFrameSet.Put(aAnchor);
+Graphic aGrf;
+pWrtShell->SwFEShell::Insert(OUString(), OUString(), , 
);
+}
+
+// When inserting another as-char image:
+SfxItemSet aFrameSet(pDoc->GetAttrPool(), svl::Items);
+SwFormatAnchor aAnchor(RndStdIds::FLY_AS_CHAR);
+aFrameSet.Put(aAnchor);
+Graphic aGrf;
+// Without the accompanying fix in place, this call crashed, we try to set 
a graphic node as an
+// anchor of an as-char image (which should be a text node).
+pWrtShell->SwFEShell::Insert(OUString(), OUString(), , );
+
+// Then make sure that the anchor of the second image is next to the first 
anchor:
+CPPUNIT_ASSERT(pDoc->GetSpzFrameFormats());
+sw::FrameFormats& rFormats = 
*pDoc->GetSpzFrameFormats();
+CPPUNIT_ASSERT_EQUAL(static_cast(2), rFormats.size());
+const sw::SpzFrameFormat& rFormat1 = *rFormats[0];
+const SwPosition* pAnchor1 = rFormat1.GetAnchor().GetContentAnchor();
+const sw::SpzFrameFormat& rFormat2 = *rFormats[1];
+const SwPosition* pAnchor2 = rFormat2.GetAnchor().GetContentAnchor();
+CPPUNIT_ASSERT_EQUAL(pAnchor1->nNode, pAnchor2->nNode);
+CPPUNIT_ASSERT_EQUAL(pAnchor1->GetContentIndex() + 1, 
pAnchor2->GetContentIndex());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 494b08b1c77c..a67d0753c97d 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -890,6 +890,43 @@ const SwFrameFormat *SwFEShell::NewFlyFrame( const 
SfxItemSet& rSet, bool bAnchV
 return pRet;
 }
 
+namespace
+{
+/// If pCursor points to an as-char anchored graphic node, then set the node's 
anchor position on
+/// pAnchor and rPam.
+bool SetAnchorOnGrfNodeForAsChar(SwShellCursor *pCursor, SwFormatAnchor* 
pAnchor, std::optional& rPam)
+{
+const SwPosition* pPoint = pCursor->GetPoint();
+if (pAnchor->GetAnchorId() != RndStdIds::FLY_AS_CHAR)
+{
+return false;
+}
+
+if (!pPoint->GetNode().IsGrfNode())
+{
+return false;
+}
+
+SwFrameFormat* pFrameFormat = pPoint->GetNode().GetFlyFormat();
+if (!pFrameFormat)
+{
+return false;
+}
+
+const SwPosition* pContentAnchor = 
pFrameFormat->GetAnchor().GetContentAnchor();
+if (!pContentAnchor)
+{
+return false;
+}
+
+SwPosition aPosition(*pContentAnchor);
+++aPosition.nContent;
+pAnchor->SetAnchor();
+rPam.emplace(aPosition);
+

core.git: download.lst external/pdfium

2024-04-22 Thread Miklos Vajna (via logerrit)
 download.lst   |4 +-
 external/pdfium/Library_pdfium.mk  |   11 ++-
 external/pdfium/UnpackedTarball_pdfium.mk  |7 +
 external/pdfium/build.patch.1  |   35 -
 external/pdfium/inc/pch/precompiled_pdfium.hxx |   28 ++--
 external/pdfium/include.patch  |   10 ---
 external/pdfium/windows7.patch.1   |   14 +-
 7 files changed, 30 insertions(+), 79 deletions(-)

New commits:
commit 116ac059a3c30146d7a30bd917e048256f7b3cd8
Author: Miklos Vajna 
AuthorDate: Mon Apr 22 08:17:09 2024 +0200
Commit: Miklos Vajna 
CommitDate: Mon Apr 22 17:02:14 2024 +0200

Update pdfium to 6425

Drop parts of build.patch.1 and the entire include.patch, which are
probably obsolete and don't apply anymore.

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

diff --git a/download.lst b/download.lst
index 48e1cbde01a4..f3086c5cc3cb 100644
--- a/download.lst
+++ b/download.lst
@@ -523,8 +523,8 @@ PAGEMAKER_TARBALL := libpagemaker-0.0.4.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-PDFIUM_SHA256SUM := 
6bc4dac8f1ef646a9bbd50848cb3fb8a108087ed6b3973bbee5846dc371b646d
-PDFIUM_TARBALL := pdfium-6296.tar.bz2
+PDFIUM_SHA256SUM := 
fe0291b96d7352bac530d13ef2e5fd63ad9980e0128911f88b957b5992508f1c
+PDFIUM_TARBALL := pdfium-6425.tar.bz2
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git a/external/pdfium/Library_pdfium.mk 
b/external/pdfium/Library_pdfium.mk
index 85f9d953b752..898cdd12cce1 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -433,6 +433,8 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
 UnpackedTarball/pdfium/core/fxcrt/cfx_read_only_vector_stream \
 UnpackedTarball/pdfium/core/fxcrt/fx_memory_malloc \
 UnpackedTarball/pdfium/core/fxcrt/widetext_buffer \
+UnpackedTarball/pdfium/core/fxcrt/debug/alias \
+UnpackedTarball/pdfium/core/fxcrt/string_template \
 ))
 
 # fxge
@@ -568,12 +570,6 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
 ))
 endif
 
-# pdfium_base
-$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
-UnpackedTarball/pdfium/third_party/base/debug/alias \
-UnpackedTarball/pdfium/third_party/base/memory/aligned_memory \
-))
-
 $(eval $(call gb_Library_use_externals,pdfium,\
 libjpeg \
 lcms2 \
@@ -664,7 +660,8 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
 UnpackedTarball/pdfium/core/fxge/cfx_windowsrenderdevice \
 UnpackedTarball/pdfium/core/fxcrt/cfx_fileaccess_windows \
 UnpackedTarball/pdfium/core/fxcrt/fx_folder_windows \
-UnpackedTarball/pdfium/third_party/base/win/win_util \
+UnpackedTarball/pdfium/core/fxcrt/win/win_util \
+UnpackedTarball/pdfium/core/fxcrt/code_point_view \
 UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_windowsrenderdevice \
 ))
 
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk 
b/external/pdfium/UnpackedTarball_pdfium.mk
index 340036822e88..6c5bce9b2e29 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -18,8 +18,6 @@ pdfium_patches += constexpr-template.patch
 
 pdfium_patches += system-abseil.diff
 
-pdfium_patches += include.patch
-
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
 
 $(eval $(call gb_UnpackedTarball_set_tarball,pdfium,$(PDFIUM_TARBALL)))
@@ -35,9 +33,8 @@ $(eval $(call gb_UnpackedTarball_set_post_action,pdfium,\
 mv third_party/bigint/BigIntegerUtils.cc 
third_party/bigint/BigIntegerUtils.cpp && \
 mv third_party/bigint/BigUnsigned.cc third_party/bigint/BigUnsigned.cpp && 
\
 mv third_party/bigint/BigUnsignedInABase.cc 
third_party/bigint/BigUnsignedInABase.cpp && \
-mv third_party/base/debug/alias.cc third_party/base/debug/alias.cpp && \
-mv third_party/base/memory/aligned_memory.cc 
third_party/base/memory/aligned_memory.cpp && \
-mv third_party/base/win/win_util.cc third_party/base/win/win_util.cpp && \
+mv core/fxcrt/debug/alias.cc core/fxcrt/debug/alias.cpp && \
+mv core/fxcrt/win/win_util.cc core/fxcrt/win/win_util.cpp && \
 mv third_party/libopenjpeg/opj_malloc.cc 
third_party/libopenjpeg/opj_malloc.cpp && \
 mv third_party/abseil-cpp/absl/types/bad_optional_access.cc 
third_party/abseil-cpp/absl/types/bad_optional_access.cpp && \
 mv third_party/abseil-cpp/absl/types/bad_variant_access.cc 
third_party/abseil-cpp/absl/types/bad_variant_access.cpp \
diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1
index 0e8472efe8c8..1a5a35f1cdc7 100644
--- a/external/pdfium/build.patch.1
+++ b/ex

core.git: sc/qa sc/source

2024-04-19 Thread Miklos Vajna (via logerrit)
 sc/qa/unit/tiledrendering2/data/multi-selection.ods |binary
 sc/qa/unit/tiledrendering2/tiledrendering2.cxx  |   45 
 sc/source/ui/view/viewfun3.cxx  |8 +++
 3 files changed, 53 insertions(+)

New commits:
commit 4ffe06a81866a2c9f8598d194e04c114cc083119
Author: Miklos Vajna 
AuthorDate: Fri Apr 19 08:51:34 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri Apr 19 17:14:37 2024 +0200

cool#8789 sc lok: fix copy for multi-selections

Select A1+A3 in Calc, copy, try to paste in B1, nothing happens.

This is because lok::Document::getSelectionTypeAndText() for a Calc
document ends up in ScViewFunc::CopyToTransferable(), which only handles
the SC_MARK_SIMPLE* cases.

Fix the problem by implementing support for SC_MARK_MULTI, similar to
what ScCellShell::ExecuteEdit() does in the SID_COPY case, which also
calls CopyToClip().

Keep the test highlevel as the Calc shell doesn't seem to have an easy
function to do the same as the Ctrl-click on a cell without duplicating
lots of code in the testcase.

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

diff --git a/sc/qa/unit/tiledrendering2/data/multi-selection.ods 
b/sc/qa/unit/tiledrendering2/data/multi-selection.ods
new file mode 100644
index ..9436aaf93c26
Binary files /dev/null and 
b/sc/qa/unit/tiledrendering2/data/multi-selection.ods differ
diff --git a/sc/qa/unit/tiledrendering2/tiledrendering2.cxx 
b/sc/qa/unit/tiledrendering2/tiledrendering2.cxx
index 058e7deb0883..65a85c685b33 100644
--- a/sc/qa/unit/tiledrendering2/tiledrendering2.cxx
+++ b/sc/qa/unit/tiledrendering2/tiledrendering2.cxx
@@ -17,6 +17,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 
@@ -79,6 +81,7 @@ class ViewCallback final
 
 public:
 std::map m_aStateChanges;
+tools::Rectangle m_aCellCursorBounds;
 TestLokCallbackWrapper m_callbackWrapper;
 
 ViewCallback()
@@ -108,6 +111,20 @@ public:
 {
 switch (nType)
 {
+case LOK_CALLBACK_CELL_CURSOR:
+{
+uno::Sequence aSeq = 
comphelper::string::convertCommaSeparated(
+OUString::createFromAscii(pPayload));
+m_aCellCursorBounds = tools::Rectangle();
+if (aSeq.getLength() >= 4)
+{
+m_aCellCursorBounds.SetLeft(aSeq[0].toInt32());
+m_aCellCursorBounds.SetTop(aSeq[1].toInt32());
+m_aCellCursorBounds.setWidth(aSeq[2].toInt32());
+m_aCellCursorBounds.setHeight(aSeq[3].toInt32());
+}
+}
+break;
 case LOK_CALLBACK_STATE_CHANGED:
 {
 std::stringstream aStream(pPayload);
@@ -159,6 +176,34 @@ CPPUNIT_TEST_FIXTURE(Test, testSidebarLocale)
 std::string aLocale = it->second.get("locale");
 CPPUNIT_ASSERT_EQUAL(std::string("de-DE"), aLocale);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testCopyMultiSelection)
+{
+// Given a document with A1 and A3 as selected cells:
+ScModelObj* pModelObj = createDoc("multi-selection.ods");
+ViewCallback aView1;
+// Get the center of A3:
+uno::Sequence aPropertyValues = {
+comphelper::makePropertyValue("ToPoint", OUString("$A$3")),
+};
+dispatchCommand(mxComponent, ".uno:GoToCell", aPropertyValues);
+Point aPoint = aView1.m_aCellCursorBounds.Center();
+// Go to A1:
+aPropertyValues = {
+comphelper::makePropertyValue("ToPoint", OUString("$A$1")),
+};
+dispatchCommand(mxComponent, ".uno:GoToCell", aPropertyValues);
+// Ctrl-click on A3:
+int nCtrl = KEY_MOD1;
+pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, aPoint.getX(), 
aPoint.getY(), 1,
+  MOUSE_LEFT, nCtrl);
+
+// When getting the selection:
+uno::Reference xTransferable = 
pModelObj->getSelection();
+
+// Make sure we get A1+A3 instead of an error:
+CPPUNIT_ASSERT(xTransferable.is());
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index ee2cccf72f35..1c918ff1c04d 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -458,6 +458,14 @@ rtl::Reference 
ScViewFunc::CopyToTransferable()
 return new ScTransferObj( std::move(pClipDoc), std::move(aObjDesc) 
);
 }
 }
+else if (eMarkType == SC_MARK_MULTI)
+{
+ScDocumentUniquePtr pClipDoc(new ScDocument(SCDOCMODE_CLIP));
+// This takes care of the input line and calls CopyToClipMultiRange() 
for us.
+CopyToClip(pClipDoc.get(), /*bCut=*/false, /*bApi=*/true);
+Transferab

Re: Is there an Impress Remote for PC?

2024-04-19 Thread Miklos Vajna
Hi,

On Thu, Apr 18, 2024 at 08:27:44PM +0300, Владислав Тараканов 
 wrote:
> Yes, we want to try to implement this on our own. For now we plan to
> base it on the implementation in
> https://git.libreoffice.org/impress_remote. If I understand correctly,
> we can first look at this part:
> android/sdremote/mobile/src/main/java/org/libreoffice/impressremote/communication.
> At first glance, this package implements data exchange with Impress
> over the network.

Yes, that's the client code. The other side is mostly under
sd/source/ui/remotecontrol/ in core.git, I believe.

Regards,

Miklos


core.git: sw/CppunitTest_sw_uibase_docvw.mk

2024-04-18 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_uibase_docvw.mk |4 
 1 file changed, 4 insertions(+)

New commits:
commit 4322ec8f8f89549410d108551d21f5058b1c8261
Author: Miklos Vajna 
AuthorDate: Thu Apr 18 08:31:50 2024 +0200
Commit: Miklos Vajna 
CommitDate: Thu Apr 18 21:51:08 2024 +0200

CppunitTest_sw_uibase_docvw: turn on set_non_application_font_use

Similar to commit dc4d7500c9d283e26d1553ce11366a217cf1f69d (Fix
CppunitTest_sd_import_tests-smartart non_application_font_use,
2023-10-23), though this didn't find anything.

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

diff --git a/sw/CppunitTest_sw_uibase_docvw.mk 
b/sw/CppunitTest_sw_uibase_docvw.mk
index 603532ca2a56..db3db7a7c461 100644
--- a/sw/CppunitTest_sw_uibase_docvw.mk
+++ b/sw/CppunitTest_sw_uibase_docvw.mk
@@ -73,4 +73,8 @@ $(eval $(call gb_CppunitTest_use_uiconfigs,sw_uibase_docvw, \
 
 $(eval $(call gb_CppunitTest_use_more_fonts,sw_uibase_docvw))
 
+ifneq ($(filter MORE_FONTS,$(BUILD_TYPE)),)
+$(eval $(call 
gb_CppunitTest_set_non_application_font_use,sw_uibase_docvw,abort))
+endif
+
 # vim: set noet sw=4 ts=4:


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

2024-04-18 Thread Miklos Vajna (via logerrit)
 sc/qa/unit/tiledrendering/data/multi-selection.ods |binary
 sc/qa/unit/tiledrendering/tiledrendering.cxx   |   28 +
 sc/source/ui/view/viewfun3.cxx |8 ++
 3 files changed, 36 insertions(+)

New commits:
commit 4d3d1e62003522201a0e6662a76f113c7b13d6ec
Author: Miklos Vajna 
AuthorDate: Wed Apr 17 16:25:19 2024 +0200
Commit: Miklos Vajna 
CommitDate: Thu Apr 18 17:13:14 2024 +0200

cool#8789 sc lok: fix copy for multi-selections

Select A1+A3 in Calc, copy, try to paste in B1, nothing happens.

This is because lok::Document::getSelectionTypeAndText() for a Calc
document ends up in ScViewFunc::CopyToTransferable(), which only handles
the SC_MARK_SIMPLE* cases.

Fix the problem by implementing support for SC_MARK_MULTI, similar to
what ScCellShell::ExecuteEdit() does in the SID_COPY case, which also
calls CopyToClip().

Keep the test highlevel as the Calc shell doesn't seem to have an easy
function to do the same as the Ctrl-click on a cell without duplicating
lots of code in the testcase.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166183
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 
(cherry picked from commit 1eda0a81fcf1bf2ce2fd4f29502eaa62879a50d4)

Conflicts:
sc/qa/unit/tiledrendering/tiledrendering.cxx

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

diff --git a/sc/qa/unit/tiledrendering/data/multi-selection.ods 
b/sc/qa/unit/tiledrendering/data/multi-selection.ods
new file mode 100644
index ..9436aaf93c26
Binary files /dev/null and b/sc/qa/unit/tiledrendering/data/multi-selection.ods 
differ
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 1e6294801caf..3a9ee97ee49a 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -3900,6 +3900,34 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testEditShapeText)
 CPPUNIT_ASSERT_MESSAGE("Text is not visible", aBitmapBefore != 
aBitmapAfter);
 }
 
+CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testCopyMultiSelection)
+{
+// Given a document with A1 and A3 as selected cells:
+ScModelObj* pModelObj = createDoc("multi-selection.ods");
+ViewCallback aView1;
+// Get the center of A3:
+uno::Sequence aPropertyValues = {
+comphelper::makePropertyValue("ToPoint", OUString("$A$3")),
+};
+dispatchCommand(mxComponent, ".uno:GoToCell", aPropertyValues);
+Point aPoint = aView1.m_aCellCursorBounds.Center();
+// Go to A1:
+aPropertyValues = {
+comphelper::makePropertyValue("ToPoint", OUString("$A$1")),
+};
+dispatchCommand(mxComponent, ".uno:GoToCell", aPropertyValues);
+// Ctrl-click on A3:
+int nCtrl = KEY_MOD1;
+pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, aPoint.getX(), 
aPoint.getY(), 1,
+  MOUSE_LEFT, nCtrl);
+
+// When getting the selection:
+uno::Reference xTransferable = 
pModelObj->getSelection();
+
+// Make sure we get A1+A3 instead of an error:
+CPPUNIT_ASSERT(xTransferable.is());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 30c5e0079ea5..aa8daeb8338f 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -458,6 +458,14 @@ rtl::Reference 
ScViewFunc::CopyToTransferable()
 return new ScTransferObj( std::move(pClipDoc), std::move(aObjDesc) 
);
 }
 }
+else if (eMarkType == SC_MARK_MULTI)
+{
+ScDocumentUniquePtr pClipDoc(new ScDocument(SCDOCMODE_CLIP));
+// This takes care of the input line and calls CopyToClipMultiRange() 
for us.
+CopyToClip(pClipDoc.get(), /*bCut=*/false, /*bApi=*/true);
+TransferableObjectDescriptor aObjDesc;
+return new ScTransferObj(std::move(pClipDoc), std::move(aObjDesc));
+}
 
 return nullptr;
 }


ESC meeting minutes: 2024-04-18

2024-04-18 Thread Miklos Vajna

* Present:
+ Olivier, Ilmari, Regina, Michael S, Michael W, Jonathan, Hossein, 
Stephan, Miklos, Xisco, Eike, Heiko, Cloph, Caolan

* Completed Action Items:

* Pending Action Items:
+ Update api.libreoffice.org from 7.4 (Cloph)

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 RC1 this week, probably later today
+ 24.2: 24.2.3 RC2 next week

* Documentation (Olivier)
+ New Help
   + Fix on CSS (Juan José)
+ Helpcontents2
   + New pages for paragraph signature (wip) (Colton Garrett)
 + may be useful to CC Ashod on the change (Miklos)
 + several signature parts: PDF, macros, gpg or not, etc (Olivier)
   + Updates and fixes (ohallot)
+ Guides
   + Work in progress
   + About translations.
+ Bugzilla Documentation statistics
265(265) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 8(1) 30(-22)89(0) 218(-6)
 commented 3(-16)   57(-39)   235(-3)836(-12)
  resolved 6(4) 16(-6) 43(5) 116(2)
+ top 10 contributors:
  Olivier Hallot made 44 changes in 1 month, and 263 changes in 1 year
  Dione Maddern made 17 changes in 1 month, and 31 changes in 1 year
  Kaganski, Mike made 15 changes in 1 month, and 69 changes in 1 year
  MeBugzilla made 7 changes in 1 month, and 7 changes in 1 year
  Weghorn, Michael made 7 changes in 1 month, and 8 changes in 1 year
  Nabet, Julien made 7 changes in 1 month, and 53 changes in 1 year
  Cor Nouws made 3 changes in 1 month, and 3 changes in 1 year
  Adolfo Jayme Barrientos made 3 changes in 1 month, and 24 changes in 
1 year
  nobu made 3 changes in 1 month, and 12 changes in 1 year
  Pierre F made 2 changes in 1 month, and 30 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
243(243) (topicUI) bugs open, 45(45) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
 added  4(-4)19(1) 23(2)   31(2)
 commented 71(41)   231(23)   564(59)1949(-32)
   removed  1(1)  2(1)  2(1)   12(0)
  resolved  8(2) 28(2) 85(3)  320(4)
+ top 10 contributors:
  Stéphane Guillou made 96 changes in 1 month, and 683 changes in 1 year
  Heiko Tietze made 91 changes in 1 month, and 1124 changes in 1 year
  Vernon, Stuart Foote made 68 changes in 1 month, and 274 changes in 1 
year
  Eyal Rozenberg made 27 changes in 1 month, and 156 changes in 1 year
  Ilmari Lauhakangas made 26 changes in 1 month, and 162 changes in 1 
year
  Ady made 20 changes in 1 month, and 141 changes in 1 year
  Justin Luth made 18 changes in 1 month, and 140 changes in 1 year
  Devansh Varshney made 13 changes in 1 month, and 20 changes in 1 year
  Cor Nouws made 10 changes in 1 month, and 18 changes in 1 year
  m.a.riosv made 10 changes in 1 month, and 59 changes in 1 year
+ [Bug 160686] "Left Page" and "Right Page" are nonsensical and should be 
removed
+ [Bug 160684] The Landscape style is nonsensical while we have neither
   hierarchical nor composable page styles
+ [Bug 160682] HTML "page style" is not a page style - move this 
functionality
   elsewhere
 -> + [Bug 154434] FILEOPEN HTML: Writer loses HTML layout
  + wonder to what extent we want to support for format (Heiko)
  + but these days many apps have internal HTML renderers (Hossein)
  + curently closed as wontfix (Heiko)
+ not sure where to draw the line
  + also CSS, do we event handle CSS layout at all? (Ilmari)
+ at layout: things start to fall apart
+ also unclear where to draw the line
  + using a writer2html extension (Olivier)
  + when developing a product, you need to consider your audience / market 
section (Hossein)
+ compare us vs other word processors
+ best to comare us to other word processors, not browsers
+ [Bug 160658] Shortcut key menu's elements are odd and empty
+ [Bug 139112] Accessibility options dialog should adapt its width to long 
labels
+ [Bug 160629] Bullets and Numbering dialog in Writer does not say it's 
about an
   implicit list style
+ [Bug 160608] "Re-type Password" dialog needs UX improvement
+ [Bug 49259] Writer is too jumpy when selecting an object if another object
   was selected
+ [Bug 99608] Using clone formatting enables scrolling with the mouse -- but
   it shouldn't

   + Poll "What kind of User Interface are you using?"
 + https://fosstodon.org/@libodesign/112285659953746809
 + agree with Heiko, it makes sense to invest more into the tabbed 
interface (Hossein)
   + agree (Olivier)
 + would like to define some notebookbar 

ESC meeting minutes: 2024-04-18

2024-04-18 Thread Miklos Vajna

* Present:
+ Olivier, Ilmari, Regina, Michael S, Michael W, Jonathan, Hossein, 
Stephan, Miklos, Xisco, Eike, Heiko, Cloph, Caolan

* Completed Action Items:

* Pending Action Items:
+ Update api.libreoffice.org from 7.4 (Cloph)

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 RC1 this week, probably later today
+ 24.2: 24.2.3 RC2 next week

* Documentation (Olivier)
+ New Help
   + Fix on CSS (Juan José)
+ Helpcontents2
   + New pages for paragraph signature (wip) (Colton Garrett)
 + may be useful to CC Ashod on the change (Miklos)
 + several signature parts: PDF, macros, gpg or not, etc (Olivier)
   + Updates and fixes (ohallot)
+ Guides
   + Work in progress
   + About translations.
+ Bugzilla Documentation statistics
265(265) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 8(1) 30(-22)89(0) 218(-6)
 commented 3(-16)   57(-39)   235(-3)836(-12)
  resolved 6(4) 16(-6) 43(5) 116(2)
+ top 10 contributors:
  Olivier Hallot made 44 changes in 1 month, and 263 changes in 1 year
  Dione Maddern made 17 changes in 1 month, and 31 changes in 1 year
  Kaganski, Mike made 15 changes in 1 month, and 69 changes in 1 year
  MeBugzilla made 7 changes in 1 month, and 7 changes in 1 year
  Weghorn, Michael made 7 changes in 1 month, and 8 changes in 1 year
  Nabet, Julien made 7 changes in 1 month, and 53 changes in 1 year
  Cor Nouws made 3 changes in 1 month, and 3 changes in 1 year
  Adolfo Jayme Barrientos made 3 changes in 1 month, and 24 changes in 
1 year
  nobu made 3 changes in 1 month, and 12 changes in 1 year
  Pierre F made 2 changes in 1 month, and 30 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
243(243) (topicUI) bugs open, 45(45) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
 added  4(-4)19(1) 23(2)   31(2)
 commented 71(41)   231(23)   564(59)1949(-32)
   removed  1(1)  2(1)  2(1)   12(0)
  resolved  8(2) 28(2) 85(3)  320(4)
+ top 10 contributors:
  Stéphane Guillou made 96 changes in 1 month, and 683 changes in 1 year
  Heiko Tietze made 91 changes in 1 month, and 1124 changes in 1 year
  Vernon, Stuart Foote made 68 changes in 1 month, and 274 changes in 1 
year
  Eyal Rozenberg made 27 changes in 1 month, and 156 changes in 1 year
  Ilmari Lauhakangas made 26 changes in 1 month, and 162 changes in 1 
year
  Ady made 20 changes in 1 month, and 141 changes in 1 year
  Justin Luth made 18 changes in 1 month, and 140 changes in 1 year
  Devansh Varshney made 13 changes in 1 month, and 20 changes in 1 year
  Cor Nouws made 10 changes in 1 month, and 18 changes in 1 year
  m.a.riosv made 10 changes in 1 month, and 59 changes in 1 year
+ [Bug 160686] "Left Page" and "Right Page" are nonsensical and should be 
removed
+ [Bug 160684] The Landscape style is nonsensical while we have neither
   hierarchical nor composable page styles
+ [Bug 160682] HTML "page style" is not a page style - move this 
functionality
   elsewhere
 -> + [Bug 154434] FILEOPEN HTML: Writer loses HTML layout
  + wonder to what extent we want to support for format (Heiko)
  + but these days many apps have internal HTML renderers (Hossein)
  + curently closed as wontfix (Heiko)
+ not sure where to draw the line
  + also CSS, do we event handle CSS layout at all? (Ilmari)
+ at layout: things start to fall apart
+ also unclear where to draw the line
  + using a writer2html extension (Olivier)
  + when developing a product, you need to consider your audience / market 
section (Hossein)
+ compare us vs other word processors
+ best to comare us to other word processors, not browsers
+ [Bug 160658] Shortcut key menu's elements are odd and empty
+ [Bug 139112] Accessibility options dialog should adapt its width to long 
labels
+ [Bug 160629] Bullets and Numbering dialog in Writer does not say it's 
about an
   implicit list style
+ [Bug 160608] "Re-type Password" dialog needs UX improvement
+ [Bug 49259] Writer is too jumpy when selecting an object if another object
   was selected
+ [Bug 99608] Using clone formatting enables scrolling with the mouse -- but
   it shouldn't

   + Poll "What kind of User Interface are you using?"
 + https://fosstodon.org/@libodesign/112285659953746809
 + agree with Heiko, it makes sense to invest more into the tabbed 
interface (Hossein)
   + agree (Olivier)
 + would like to define some notebookbar 

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

2024-04-18 Thread Miklos Vajna (via logerrit)
 sc/qa/unit/tiledrendering/data/multi-selection.ods |binary
 sc/qa/unit/tiledrendering/tiledrendering.cxx   |   30 +
 sc/source/ui/view/viewfun3.cxx |8 +
 3 files changed, 38 insertions(+)

New commits:
commit 1eda0a81fcf1bf2ce2fd4f29502eaa62879a50d4
Author: Miklos Vajna 
AuthorDate: Wed Apr 17 16:25:19 2024 +0200
Commit: Caolán McNamara 
CommitDate: Thu Apr 18 09:20:09 2024 +0200

cool#8789 sc lok: fix copy for multi-selections

Select A1+A3 in Calc, copy, try to paste in B1, nothing happens.

This is because lok::Document::getSelectionTypeAndText() for a Calc
document ends up in ScViewFunc::CopyToTransferable(), which only handles
the SC_MARK_SIMPLE* cases.

Fix the problem by implementing support for SC_MARK_MULTI, similar to
what ScCellShell::ExecuteEdit() does in the SID_COPY case, which also
calls CopyToClip().

Keep the test highlevel as the Calc shell doesn't seem to have an easy
function to do the same as the Ctrl-click on a cell without duplicating
lots of code in the testcase.

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

diff --git a/sc/qa/unit/tiledrendering/data/multi-selection.ods 
b/sc/qa/unit/tiledrendering/data/multi-selection.ods
new file mode 100644
index ..9436aaf93c26
Binary files /dev/null and b/sc/qa/unit/tiledrendering/data/multi-selection.ods 
differ
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 6057a1db0b6d..6e47eefd5cd0 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -180,6 +180,7 @@ public:
 void testOptimalRowHeight();
 void testExtendedAreasDontOverlap();
 void testEditShapeText();
+void testCopyMultiSelection();
 
 CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
 CPPUNIT_TEST(testRowColumnHeaders);
@@ -261,6 +262,7 @@ public:
 CPPUNIT_TEST(testOptimalRowHeight);
 CPPUNIT_TEST(testExtendedAreasDontOverlap);
 CPPUNIT_TEST(testEditShapeText);
+CPPUNIT_TEST(testCopyMultiSelection);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -4126,6 +4128,34 @@ void ScTiledRenderingTest::testEditShapeText()
 CPPUNIT_ASSERT_MESSAGE("Text is not visible", aBitmapBefore != 
aBitmapAfter);
 }
 
+void ScTiledRenderingTest::testCopyMultiSelection()
+{
+// Given a document with A1 and A3 as selected cells:
+ScModelObj* pModelObj = createDoc("multi-selection.ods");
+ViewCallback aView1;
+// Get the center of A3:
+uno::Sequence aPropertyValues = {
+comphelper::makePropertyValue("ToPoint", OUString("$A$3")),
+};
+dispatchCommand(mxComponent, ".uno:GoToCell", aPropertyValues);
+Point aPoint = aView1.m_aCellCursorBounds.Center();
+// Go to A1:
+aPropertyValues = {
+comphelper::makePropertyValue("ToPoint", OUString("$A$1")),
+};
+dispatchCommand(mxComponent, ".uno:GoToCell", aPropertyValues);
+// Ctrl-click on A3:
+int nCtrl = KEY_MOD1;
+pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, aPoint.getX(), 
aPoint.getY(), 1,
+  MOUSE_LEFT, nCtrl);
+
+// When getting the selection:
+uno::Reference xTransferable = 
pModelObj->getSelection();
+
+// Make sure we get A1+A3 instead of an error:
+CPPUNIT_ASSERT(xTransferable.is());
+}
+
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest);
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 502340a5bbf0..769805d5d32a 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -460,6 +460,14 @@ rtl::Reference 
ScViewFunc::CopyToTransferable()
 return new ScTransferObj( std::move(pClipDoc), std::move(aObjDesc) 
);
 }
 }
+else if (eMarkType == SC_MARK_MULTI)
+{
+ScDocumentUniquePtr pClipDoc(new ScDocument(SCDOCMODE_CLIP));
+// This takes care of the input line and calls CopyToClipMultiRange() 
for us.
+CopyToClip(pClipDoc.get(), /*bCut=*/false, /*bApi=*/true);
+TransferableObjectDescriptor aObjDesc;
+return new ScTransferObj(std::move(pClipDoc), std::move(aObjDesc));
+}
 
 return nullptr;
 }


Re: Is there an Impress Remote for PC?

2024-04-18 Thread Miklos Vajna
Hi,

On Wed, Apr 17, 2024 at 12:12:52PM +0300, Амин Иргалиев  
wrote:
> Some users report that they would like the LO Impress Remote functionality 
> for computers to make it comfortable to hold conferences. Provide remote 
> access to the device doesn’t solve this problem, since it is not very safe to 
> give access to the device.
> 
> No one knows if it is possible to achieve similar functionality with existing 
> LO features? If not, is there a chance that such an application will be in 
> demand enough that it can be made not as a local solution, but as a whole for 
> LO?

The Impress remote is currently for Android/iOS, but I don't think
anything would stop you from writing a desktop app that uses the same
protocol.

If you are interested in hacking on this yourself? Do you need some code
pointers for the protocol?

Regards,

Miklos


ESC meeting agenda: 2024-04-18 16:00 CEST

2024-04-17 Thread Miklos Vajna

Hi,

The prototype agenda is below. Extra items are appreciated either in
this document or as a reply to this mail:

https://pad.documentfoundation.org/p/esc

You can join using Jitsi here:

https://jitsi.documentfoundation.org/esc

Regards,

Miklos

---

* Present:
+

* Completed Action Items:

* Pending Action Items:
+ Update api.libreoffice.org from 7.4 (Cloph)

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 RC1 this week?
+ 24.2: 24.2.3 RC2 next week?

* Documentation (Olivier)
+ Bugzilla Documentation statistics
265(265) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 8(1) 30(-22)89(0) 218(-6)
 commented 3(-16)   57(-39)   235(-3)836(-12)
  resolved 6(4) 16(-6) 43(5) 116(2)
+ top 10 contributors:
  Olivier Hallot made 44 changes in 1 month, and 263 changes in 1 year
  Dione Maddern made 17 changes in 1 month, and 31 changes in 1 year
  Kaganski, Mike made 15 changes in 1 month, and 69 changes in 1 year
  MeBugzilla made 7 changes in 1 month, and 7 changes in 1 year
  Weghorn, Michael made 7 changes in 1 month, and 8 changes in 1 year
  Nabet, Julien made 7 changes in 1 month, and 53 changes in 1 year
  Cor Nouws made 3 changes in 1 month, and 3 changes in 1 year
  Adolfo Jayme Barrientos made 3 changes in 1 month, and 24 changes in 
1 year
  nobu made 3 changes in 1 month, and 12 changes in 1 year
  Pierre F made 2 changes in 1 month, and 30 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
243(243) (topicUI) bugs open, 45(45) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
 added  4(-4)19(1) 23(2)   31(2)
 commented 71(41)   231(23)   564(59)1949(-32)
   removed  1(1)  2(1)  2(1)   12(0)
  resolved  8(2) 28(2) 85(3)  320(4)
+ top 10 contributors:
  Stéphane Guillou made 96 changes in 1 month, and 683 changes in 1 year
  Heiko Tietze made 91 changes in 1 month, and 1124 changes in 1 year
  Vernon, Stuart Foote made 68 changes in 1 month, and 274 changes in 1 
year
  Eyal Rozenberg made 27 changes in 1 month, and 156 changes in 1 year
  Ilmari Lauhakangas made 26 changes in 1 month, and 162 changes in 1 
year
  Ady made 20 changes in 1 month, and 141 changes in 1 year
  Justin Luth made 18 changes in 1 month, and 140 changes in 1 year
  Devansh Varshney made 13 changes in 1 month, and 20 changes in 1 year
  Cor Nouws made 10 changes in 1 month, and 18 changes in 1 year
  m.a.riosv made 10 changes in 1 month, and 59 changes in 1 year

* Crash Testing (Caolan)
+ 24(+4) import failure, 19(+17) export failures
+ ??? coverity issues
+ Google / ossfuzz: ?? fuzzers active now

* Crash Reporting (Xisco)
+ 24.2.0.315407(+717)
+ 24.2.1.163(+0)
+ 24.2.1.210893(+1203)
+ 24.2.2.23121(+1458)

* Mentoring (Hossein)
  committer...   1 week 1 month  3 months 12 months
  open  46(-31)120(-22) 143(-16)  143(-16)
   reviews 318(14)1376(-164)   3862(-112)   12518(8)
merged 213(19) 981(-34)3277(-84)12494(-1)
 abandoned   9(-7)  49(-2)  167(-3)   665(-1)
   own commits 129(-11)641(-41)2144(-67) 9192(-84)
review commits  43(-14)259(-55) 872(-55) 3055(-10)
contributor...   1 week  1 month  3 months 12 months
  open  36(4)99(0)   105(4)105(4)
   reviews 582(-106)   2612(-172)   7690(-256)   29570(-202)
merged  17(-4)  137(-18) 356(-7)  1724(-73)
 abandoned  11(-6)   45(8)   290(0)690(1)
   own commits  16(-15) 153(-28) 446(-17) 1117(-3)
review commits   0(0) 0(0) 0(0)  0(0)
+ easyHack statistics:
   needsDevEval 8(8)   needsUXEval 1(1)   cleanup_comments 332(332)
   total 415(415)   assigned 28(28)   open 353(353)
+ top 10 contributors:
  LeSasse made 19 patches in 1 month, and 19 patches in 1 year
  Armin Le Grand (allotropia) made 16 patches in 1 month, and 90 
patches in 1 year
  Ritobroto Mukherjee made 13 patches in 1 month, and 13 patches in 1 
year
  Dione Maddern made 10 patches in 1 month, and 34 patches in 1 year
  Rafał Dobrakowski made 8 patches in 1 month, and 17 patches in 1 year
  Bogdan B made 5 patches in 1 month, and 20 patches in 1 year
  Aaron Bourdeaux made 5 patches in 1 month, and 5 patches in 1 year
  

ESC meeting agenda: 2024-04-18 16:00 CEST

2024-04-17 Thread Miklos Vajna

Hi,

The prototype agenda is below. Extra items are appreciated either in
this document or as a reply to this mail:

https://pad.documentfoundation.org/p/esc

You can join using Jitsi here:

https://jitsi.documentfoundation.org/esc

Regards,

Miklos

---

* Present:
+

* Completed Action Items:

* Pending Action Items:
+ Update api.libreoffice.org from 7.4 (Cloph)

* Release Engineering update (Cloph)
+ 7.6: 7.6.7 RC1 this week?
+ 24.2: 24.2.3 RC2 next week?

* Documentation (Olivier)
+ Bugzilla Documentation statistics
265(265) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 8(1) 30(-22)89(0) 218(-6)
 commented 3(-16)   57(-39)   235(-3)836(-12)
  resolved 6(4) 16(-6) 43(5) 116(2)
+ top 10 contributors:
  Olivier Hallot made 44 changes in 1 month, and 263 changes in 1 year
  Dione Maddern made 17 changes in 1 month, and 31 changes in 1 year
  Kaganski, Mike made 15 changes in 1 month, and 69 changes in 1 year
  MeBugzilla made 7 changes in 1 month, and 7 changes in 1 year
  Weghorn, Michael made 7 changes in 1 month, and 8 changes in 1 year
  Nabet, Julien made 7 changes in 1 month, and 53 changes in 1 year
  Cor Nouws made 3 changes in 1 month, and 3 changes in 1 year
  Adolfo Jayme Barrientos made 3 changes in 1 month, and 24 changes in 
1 year
  nobu made 3 changes in 1 month, and 12 changes in 1 year
  Pierre F made 2 changes in 1 month, and 30 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
243(243) (topicUI) bugs open, 45(45) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
 added  4(-4)19(1) 23(2)   31(2)
 commented 71(41)   231(23)   564(59)1949(-32)
   removed  1(1)  2(1)  2(1)   12(0)
  resolved  8(2) 28(2) 85(3)  320(4)
+ top 10 contributors:
  Stéphane Guillou made 96 changes in 1 month, and 683 changes in 1 year
  Heiko Tietze made 91 changes in 1 month, and 1124 changes in 1 year
  Vernon, Stuart Foote made 68 changes in 1 month, and 274 changes in 1 
year
  Eyal Rozenberg made 27 changes in 1 month, and 156 changes in 1 year
  Ilmari Lauhakangas made 26 changes in 1 month, and 162 changes in 1 
year
  Ady made 20 changes in 1 month, and 141 changes in 1 year
  Justin Luth made 18 changes in 1 month, and 140 changes in 1 year
  Devansh Varshney made 13 changes in 1 month, and 20 changes in 1 year
  Cor Nouws made 10 changes in 1 month, and 18 changes in 1 year
  m.a.riosv made 10 changes in 1 month, and 59 changes in 1 year

* Crash Testing (Caolan)
+ 24(+4) import failure, 19(+17) export failures
+ ??? coverity issues
+ Google / ossfuzz: ?? fuzzers active now

* Crash Reporting (Xisco)
+ 24.2.0.315407(+717)
+ 24.2.1.163(+0)
+ 24.2.1.210893(+1203)
+ 24.2.2.23121(+1458)

* Mentoring (Hossein)
  committer...   1 week 1 month  3 months 12 months
  open  46(-31)120(-22) 143(-16)  143(-16)
   reviews 318(14)1376(-164)   3862(-112)   12518(8)
merged 213(19) 981(-34)3277(-84)12494(-1)
 abandoned   9(-7)  49(-2)  167(-3)   665(-1)
   own commits 129(-11)641(-41)2144(-67) 9192(-84)
review commits  43(-14)259(-55) 872(-55) 3055(-10)
contributor...   1 week  1 month  3 months 12 months
  open  36(4)99(0)   105(4)105(4)
   reviews 582(-106)   2612(-172)   7690(-256)   29570(-202)
merged  17(-4)  137(-18) 356(-7)  1724(-73)
 abandoned  11(-6)   45(8)   290(0)690(1)
   own commits  16(-15) 153(-28) 446(-17) 1117(-3)
review commits   0(0) 0(0) 0(0)  0(0)
+ easyHack statistics:
   needsDevEval 8(8)   needsUXEval 1(1)   cleanup_comments 332(332)
   total 415(415)   assigned 28(28)   open 353(353)
+ top 10 contributors:
  LeSasse made 19 patches in 1 month, and 19 patches in 1 year
  Armin Le Grand (allotropia) made 16 patches in 1 month, and 90 
patches in 1 year
  Ritobroto Mukherjee made 13 patches in 1 month, and 13 patches in 1 
year
  Dione Maddern made 10 patches in 1 month, and 34 patches in 1 year
  Rafał Dobrakowski made 8 patches in 1 month, and 17 patches in 1 year
  Bogdan B made 5 patches in 1 month, and 20 patches in 1 year
  Aaron Bourdeaux made 5 patches in 1 month, and 5 patches in 1 year
  

core.git: sw/qa

2024-04-17 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/rtfexport/rtfexport3.cxx |  694 +-
 1 file changed, 448 insertions(+), 246 deletions(-)

New commits:
commit c53b3f08776cfc64f40b4508c44bbd8424769822
Author: Miklos Vajna 
AuthorDate: Wed Apr 17 08:32:48 2024 +0200
Commit: Miklos Vajna 
CommitDate: Wed Apr 17 12:18:19 2024 +0200

CppunitTest_sw_rtfexport3: avoid DECLARE_RTFEXPORT_TEST

No need to go via Writer-specific macros here.

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

diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx 
b/sw/qa/extras/rtfexport/rtfexport3.cxx
index 25dfdab95973..ac894d05212b 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -47,160 +47,244 @@ public:
 }
 };
 
-DECLARE_RTFEXPORT_TEST(testTdf100961_fixedDateTime, 
"tdf100961_fixedDateTime.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testTdf100961_fixedDateTime)
 {
-// This should be a fixed date/time field, not the current time.
-getParagraph(1, "05.01.19 04:06:08");
+auto verify = [this]() {
+// This should be a fixed date/time field, not the current time.
+getParagraph(1, "05.01.19 04:06:08");
 
-uno::Reference xTFS(mxComponent, 
uno::UNO_QUERY);
-uno::Reference 
xFields(xTFS->getTextFields()->createEnumeration());
-CPPUNIT_ASSERT_MESSAGE("constant time", 
getProperty(xFields->nextElement(), "IsFixed"));
+uno::Reference xTFS(mxComponent, 
uno::UNO_QUERY);
+uno::Reference 
xFields(xTFS->getTextFields()->createEnumeration());
+CPPUNIT_ASSERT_MESSAGE("constant time",
+   getProperty(xFields->nextElement(), 
"IsFixed"));
+};
+createSwDoc("tdf100961_fixedDateTime.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testTdf108949, "tdf108949_footnoteCharFormat.odt")
+CPPUNIT_TEST_FIXTURE(Test, testTdf108949)
 {
-CPPUNIT_ASSERT_EQUAL(1, getPages());
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Paragraph Numbering style", OUString(),
- getProperty(getParagraph(2), 
"NumberingStyleName"));
-
-uno::Reference xFootnotesSupplier(mxComponent, 
uno::UNO_QUERY);
-uno::Reference xFootnotes = 
xFootnotesSupplier->getFootnotes();
-
-uno::Reference xFootnoteText;
-xFootnotes->getByIndex(0) >>= xFootnoteText;
-// This was green (0x00A800), the character property of the footnote 
character, not the footnote text
-CPPUNIT_ASSERT_EQUAL_MESSAGE(
-"Footnote Text color", COL_AUTO,
-getProperty(getRun(getParagraphOfText(1, xFootnoteText), 1), 
"CharColor"));
+auto verify = [this]() {
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Paragraph Numbering style", OUString(),
+ getProperty(getParagraph(2), 
"NumberingStyleName"));
+
+uno::Reference 
xFootnotesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference xFootnotes = 
xFootnotesSupplier->getFootnotes();
+
+uno::Reference xFootnoteText;
+xFootnotes->getByIndex(0) >>= xFootnoteText;
+// This was green (0x00A800), the character property of the footnote 
character, not the footnote text
+CPPUNIT_ASSERT_EQUAL_MESSAGE(
+"Footnote Text color", COL_AUTO,
+getProperty(getRun(getParagraphOfText(1, xFootnoteText), 
1), "CharColor"));
+};
+createSwDoc("tdf108949_footnoteCharFormat.odt");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testTdf141964_numId0, "tdf141964_numId0.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testTdf141964_numId0)
 {
-// Unit test added where numId is zero - which is only possible in RTF.
-uno::Reference xPara(getParagraph(3, "Geschichte"), 
uno::UNO_QUERY);
-// Pre-emptive test: ensure that paragraph 3 remains numbered and numId0 
doesn't mean no numbering.
-CPPUNIT_ASSERT(!getProperty(xPara, 
"NumberingStyleName").isEmpty());
+auto verify = [this]() {
+// Unit test added where numId is zero - which is only possible in RTF.
+uno::Reference xPara(getParagraph(3, 
"Geschichte"), uno::UNO_QUERY);
+// Pre-emptive test: ensure that paragraph 3 remains numbered and 
numId0 doesn't mean no numbering.
+CPPUNIT_ASSERT(!getProperty(xPara, 
"NumberingStyleName").isEmpty());
+};
+createSwDoc("tdf141964_numId0.rtf");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
-DECLARE_RTFEXPORT_TEST(testTdf108949_footnote, "tdf108949_footnote.rtf")
+CPPUNIT_TEST_FIXTUR

core.git: sfx2/source

2024-04-16 Thread Miklos Vajna (via logerrit)
 sfx2/source/control/unoctitm.cxx |   35 +--
 1 file changed, 13 insertions(+), 22 deletions(-)

New commits:
commit 875d99c6e5286b9d56bba32a3abbc37068df61c1
Author: Miklos Vajna 
AuthorDate: Mon Apr 15 16:47:59 2024 +0200
Commit: Miklos Vajna 
CommitDate: Tue Apr 16 11:25:51 2024 +0200

sfx2 lok: simplify error handling in InterceptLOKStateChangeEvent()

The whole function is pointless without a viewshell, move the check &
short-circuit to the top of the function, and drop all the duplicate
checks.

Also drop two calls to SfxViewShell::Current(): getting it from the view
frame is better than getting some global state.

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

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 9cbd29034a46..0691a6bad444 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -893,7 +893,8 @@ void 
SfxDispatchController_Impl::StateChangedAtToolBoxControl( sal_uInt16 nSID,
 
 static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* 
pViewFrame, const css::frame::FeatureStateEvent& aEvent, const SfxPoolItem* 
pState)
 {
-if (!comphelper::LibreOfficeKit::isActive())
+const SfxViewShell* pViewShell = pViewFrame->GetViewShell();
+if (!comphelper::LibreOfficeKit::isActive() || !pViewShell)
 return;
 
 OUStringBuffer aBuffer(aEvent.FeatureURL.Complete + "=");
@@ -1121,17 +1122,13 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
 else if (aEvent.FeatureURL.Path == "ParaLeftToRight" ||
  aEvent.FeatureURL.Path == "ParaRightToLeft")
 {
-const SfxViewShell* pViewShell = SfxViewShell::Current();
-if (pViewShell)
-{
-tools::JsonWriter aTree;
-bool bTemp = false;
-aEvent.State >>= bTemp;
-aTree.put("commandName", aEvent.FeatureURL.Complete);
-aTree.put("disabled", !aEvent.IsEnabled);
-aTree.put("state", bTemp ? "true" : "false");
-pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aTree.finishAndGetAsOString());
-}
+tools::JsonWriter aTree;
+bool bTemp = false;
+aEvent.State >>= bTemp;
+aTree.put("commandName", aEvent.FeatureURL.Complete);
+aTree.put("disabled", !aEvent.IsEnabled);
+aTree.put("state", bTemp ? "true" : "false");
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aTree.finishAndGetAsOString());
 return;
 }
 else if (aEvent.FeatureURL.Path == "AssignLayout" ||
@@ -1152,8 +1149,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
  aEvent.FeatureURL.Path == "TransformWidth" ||
  aEvent.FeatureURL.Path == "TransformHeight")
 {
-const SfxViewShell* pViewShell = SfxViewShell::Current();
-if (aEvent.IsEnabled && pViewShell && pViewShell->isLOKMobilePhone())
+if (aEvent.IsEnabled && pViewShell->isLOKMobilePhone())
 {
 boost::property_tree::ptree aTree;
 boost::property_tree::ptree aState;
@@ -1198,11 +1194,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
 aTree.put("state", aString);
 std::stringstream aStream;
 boost::property_tree::write_json(aStream, aTree);
-const SfxViewShell* pShell = pViewFrame->GetViewShell();
-if (pShell)
-{
-pShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
OString(aStream.str()));
-}
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
OString(aStream.str()));
 return;
 }
 else if (aEvent.FeatureURL.Path == "StateTableCell")
@@ -1316,14 +1308,13 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
 else
 {
 // Try to send JSON state version
-SfxLokHelper::sendUnoStatus(pViewFrame->GetViewShell(), pState);
+SfxLokHelper::sendUnoStatus(pViewShell, pState);
 
 return;
 }
 
 OUString payload = aBuffer.makeStringAndClear();
-if (const SfxViewShell* pViewShell = pViewFrame->GetViewShell())
-pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
payload.toUtf8());
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
payload.toUtf8());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2024-04-16 Thread Miklos Vajna (via logerrit)
 sfx2/source/control/unoctitm.cxx |   35 +--
 1 file changed, 13 insertions(+), 22 deletions(-)

New commits:
commit 9e4de8c5f4a0c04d19d823b3deb1f4fcf0a49352
Author: Miklos Vajna 
AuthorDate: Mon Apr 15 16:47:59 2024 +0200
Commit: Miklos Vajna 
CommitDate: Tue Apr 16 08:16:59 2024 +0200

sfx2 lok: simplify error handling in InterceptLOKStateChangeEvent()

The whole function is pointless without a viewshell, move the check &
short-circuit to the top of the function, and drop all the duplicate
checks.

Also drop two calls to SfxViewShell::Current(): getting it from the view
frame is better than getting some global state.

Change-Id: I4aa7aeb7c89841bbced760ce2e43d2312bc97f20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166130
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index d6d13f82f0a4..37286cc2d71d 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -893,7 +893,8 @@ void 
SfxDispatchController_Impl::StateChangedAtToolBoxControl( sal_uInt16 nSID,
 
 static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* 
pViewFrame, const css::frame::FeatureStateEvent& aEvent, const SfxPoolItem* 
pState)
 {
-if (!comphelper::LibreOfficeKit::isActive())
+const SfxViewShell* pViewShell = pViewFrame->GetViewShell();
+if (!comphelper::LibreOfficeKit::isActive() || !pViewShell)
 return;
 
 OUStringBuffer aBuffer(aEvent.FeatureURL.Complete + "=");
@@ -1121,17 +1122,13 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
 else if (aEvent.FeatureURL.Path == "ParaLeftToRight" ||
  aEvent.FeatureURL.Path == "ParaRightToLeft")
 {
-const SfxViewShell* pViewShell = SfxViewShell::Current();
-if (pViewShell)
-{
-tools::JsonWriter aTree;
-bool bTemp = false;
-aEvent.State >>= bTemp;
-aTree.put("commandName", aEvent.FeatureURL.Complete);
-aTree.put("disabled", !aEvent.IsEnabled);
-aTree.put("state", bTemp ? "true" : "false");
-pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aTree.finishAndGetAsOString());
-}
+tools::JsonWriter aTree;
+bool bTemp = false;
+aEvent.State >>= bTemp;
+aTree.put("commandName", aEvent.FeatureURL.Complete);
+aTree.put("disabled", !aEvent.IsEnabled);
+aTree.put("state", bTemp ? "true" : "false");
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aTree.finishAndGetAsOString());
 return;
 }
 else if (aEvent.FeatureURL.Path == "AssignLayout" ||
@@ -1152,8 +1149,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
  aEvent.FeatureURL.Path == "TransformWidth" ||
  aEvent.FeatureURL.Path == "TransformHeight")
 {
-const SfxViewShell* pViewShell = SfxViewShell::Current();
-if (aEvent.IsEnabled && pViewShell && pViewShell->isLOKMobilePhone())
+if (aEvent.IsEnabled && pViewShell->isLOKMobilePhone())
 {
 boost::property_tree::ptree aTree;
 boost::property_tree::ptree aState;
@@ -1198,11 +1194,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
 aTree.put("state", aString);
 std::stringstream aStream;
 boost::property_tree::write_json(aStream, aTree);
-const SfxViewShell* pShell = pViewFrame->GetViewShell();
-if (pShell)
-{
-pShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
OString(aStream.str()));
-}
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
OString(aStream.str()));
 return;
 }
 else if (aEvent.FeatureURL.Path == "StateTableCell")
@@ -1316,14 +1308,13 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
 else
 {
 // Try to send JSON state version
-SfxLokHelper::sendUnoStatus(pViewFrame->GetViewShell(), pState);
+SfxLokHelper::sendUnoStatus(pViewShell, pState);
 
 return;
 }
 
 OUString payload = aBuffer.makeStringAndClear();
-if (const SfxViewShell* pViewShell = pViewFrame->GetViewShell())
-pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
payload.toUtf8());
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
payload.toUtf8());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: Branch 'distro/collabora/co-24.04' - 47 commits - bin/find-can-be-private-symbols.functions.results chart2/source connectivity/source dbaccess/source desktop/source distro-configs/LibreOffic

2024-04-15 Thread Miklos Vajna (via logerrit)
/logicalfontinstance.cxx|   68 
 vcl/quartz/cgutils.mm |   10 
 vcl/skia/osx/gdiimpl.cxx  |   21 
 vcl/source/font/LogicalFontInstance.cxx   |   53 
 vcl/source/font/fontcache.cxx |4 
 vcl/source/gdi/CommonSalLayout.cxx|6 
 vcl/source/gdi/pdfwriter_impl.cxx |4 
 vcl/source/gdi/sallayout.cxx  |   44 
 vcl/source/helper/idletask.cxx|4 
 vcl/source/outdev/font.cxx|4 
 vcl/workben/listglyphs.cxx|2 
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx  |5 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   22 
 writerfilter/source/filter/WriterFilter.cxx   |1 
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx   |8 
 xmlhelp/source/cxxhelp/provider/databases.cxx |3 
 164 files changed, 30030 insertions(+), 935 deletions(-)

New commits:
commit 2bae6eaf65d7ffb17f8a14e80268eb0eaf313669
Author: Miklos Vajna 
AuthorDate: Mon Apr 8 06:36:37 2024 +0200
Commit: Andras Timar 
CommitDate: Mon Apr 15 12:37:30 2024 +0200

tdf#160067 sw floattable: fix missing move bwd of paras in split section 
frame

The last (5th) paragraph in the index was on page 2, even if page 1
still had space for it.

This is a regression from commit
397d72e582c725d162c7e0b819dc6c0bb62e42b0 (Related: tdf#158986 sw
floattable: fix unexpected page break with sections, 2024-02-23), in
case SwLayAction::FormatLayout() doesn't calc its lower content frames
then this bugdoc is good, but the old bugdoc moves its floating table to
the next page, which would be bad.

Fix the problem by making the condition for this "calc lower in
FormatLayout()" action more strict: only do this for content frames
which are in sections, followed by sections.

Note that probably a cleaner way would be to completely stop calculating
content frames in SwLayAction::FormatLayout() and only do that in
FormatContent(), but then it's not clear how to re-fix tdf#158986, and
at least this resolves the regression.

Change-Id: Id671b3b68d8af8ad1cca3399a9aa028de58df3a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165878
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 607fcac441c7f3a7d3c169c19039e581d707f2bb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165841
Reviewed-by: Michael Stahl 

diff --git a/sw/qa/core/layout/data/bad-split-section.odt 
b/sw/qa/core/layout/data/bad-split-section.odt
new file mode 100644
index ..6dbd07802dfd
Binary files /dev/null and b/sw/qa/core/layout/data/bad-split-section.odt differ
diff --git a/sw/qa/core/layout/layact.cxx b/sw/qa/core/layout/layact.cxx
index 8923d6b0e89a..9de0c9ebfa43 100644
--- a/sw/qa/core/layout/layact.cxx
+++ b/sw/qa/core/layout/layact.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace
 {
@@ -108,6 +109,27 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyInSection)
 CPPUNIT_ASSERT(pPage2);
 CPPUNIT_ASSERT(!pPage2->GetSortedObjs());
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testBadSplitSection)
+{
+// Given a document with a section, containing 5 paragraphs:
+createSwDoc("bad-split-section.odt");
+
+// When laying out that document:
+SwDoc* pDoc = getSwDoc();
+SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+
+// Then make sure the entire section is on page 1:
+auto pPage = pLayout->Lower()->DynCastPageFrame();
+CPPUNIT_ASSERT(pPage);
+auto pBody = pPage->FindBodyCont();
+CPPUNIT_ASSERT(pBody);
+auto pSection = dynamic_cast(pBody->GetLastLower());
+CPPUNIT_ASSERT(pSection);
+// Without the fix in place, it would have failed, the section was split 
between page 1 and page
+// 2.
+CPPUNIT_ASSERT(!pSection->GetFollow());
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index 69158b335863..3debf367f05a 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -46,7 +46,7 @@ namespace o3tl {
 template<> struct typed_flags : 
is_typed_flags {};
 }
 
-class SwSectionFrame final: public SwLayoutFrame, public SwFlowFrame
+class SW_DLLPUBLIC SwSectionFrame final: public SwLayoutFrame, public 
SwFlowFrame
 , public SvtListener // TODO?
 {
 SwSection* m_pSection;
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 1a0a1260a135..ad437f98527f 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1439,9 +1439,9 @@ bool SwLayAction::FormatLayout( Ou

core.git: Branch 'libreoffice-24-2' - sw/qa sw/source

2024-04-15 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/data/bad-split-section.odt |binary
 sw/qa/core/layout/layact.cxx |   22 ++
 sw/source/core/inc/sectfrm.hxx   |2 +-
 sw/source/core/layout/layact.cxx |4 ++--
 4 files changed, 25 insertions(+), 3 deletions(-)

New commits:
commit f9a08c15e3a8fb078c1707d67a998f8c4d670e5a
Author: Miklos Vajna 
AuthorDate: Mon Apr 8 06:36:37 2024 +0200
Commit: Michael Stahl 
CommitDate: Mon Apr 15 09:41:17 2024 +0200

tdf#160067 sw floattable: fix missing move bwd of paras in split section 
frame

The last (5th) paragraph in the index was on page 2, even if page 1
still had space for it.

This is a regression from commit
397d72e582c725d162c7e0b819dc6c0bb62e42b0 (Related: tdf#158986 sw
floattable: fix unexpected page break with sections, 2024-02-23), in
case SwLayAction::FormatLayout() doesn't calc its lower content frames
then this bugdoc is good, but the old bugdoc moves its floating table to
the next page, which would be bad.

Fix the problem by making the condition for this "calc lower in
FormatLayout()" action more strict: only do this for content frames
which are in sections, followed by sections.

Note that probably a cleaner way would be to completely stop calculating
content frames in SwLayAction::FormatLayout() and only do that in
FormatContent(), but then it's not clear how to re-fix tdf#158986, and
at least this resolves the regression.

Change-Id: Id671b3b68d8af8ad1cca3399a9aa028de58df3a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165878
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 607fcac441c7f3a7d3c169c19039e581d707f2bb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165841
Reviewed-by: Michael Stahl 

diff --git a/sw/qa/core/layout/data/bad-split-section.odt 
b/sw/qa/core/layout/data/bad-split-section.odt
new file mode 100644
index ..6dbd07802dfd
Binary files /dev/null and b/sw/qa/core/layout/data/bad-split-section.odt differ
diff --git a/sw/qa/core/layout/layact.cxx b/sw/qa/core/layout/layact.cxx
index 8923d6b0e89a..9de0c9ebfa43 100644
--- a/sw/qa/core/layout/layact.cxx
+++ b/sw/qa/core/layout/layact.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace
 {
@@ -108,6 +109,27 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyInSection)
 CPPUNIT_ASSERT(pPage2);
 CPPUNIT_ASSERT(!pPage2->GetSortedObjs());
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testBadSplitSection)
+{
+// Given a document with a section, containing 5 paragraphs:
+createSwDoc("bad-split-section.odt");
+
+// When laying out that document:
+SwDoc* pDoc = getSwDoc();
+SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+
+// Then make sure the entire section is on page 1:
+auto pPage = pLayout->Lower()->DynCastPageFrame();
+CPPUNIT_ASSERT(pPage);
+auto pBody = pPage->FindBodyCont();
+CPPUNIT_ASSERT(pBody);
+auto pSection = dynamic_cast(pBody->GetLastLower());
+CPPUNIT_ASSERT(pSection);
+// Without the fix in place, it would have failed, the section was split 
between page 1 and page
+// 2.
+CPPUNIT_ASSERT(!pSection->GetFollow());
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index 69158b335863..3debf367f05a 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -46,7 +46,7 @@ namespace o3tl {
 template<> struct typed_flags : 
is_typed_flags {};
 }
 
-class SwSectionFrame final: public SwLayoutFrame, public SwFlowFrame
+class SW_DLLPUBLIC SwSectionFrame final: public SwLayoutFrame, public 
SwFlowFrame
 , public SvtListener // TODO?
 {
 SwSection* m_pSection;
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 1a0a1260a135..ad437f98527f 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1439,9 +1439,9 @@ bool SwLayAction::FormatLayout( OutputDevice 
*pRenderContext, SwLayoutFrame *pLa
 PopFormatLayout();
 }
 }
-else if (pLay->IsSctFrame() && pLow->IsTextFrame() && pLow == 
pLay->GetLastLower())
+else if (pLay->IsSctFrame() && pLay->GetNext() && 
pLay->GetNext()->IsSctFrame() && pLow->IsTextFrame() && pLow == 
pLay->GetLastLower())
 {
-// else: only calc the last text lower of sections
+// else: only calc the last text lower of sections, followed by 
sections
 pLow->OptCalc();
 }
 


core.git: download.lst external/xmlsec

2024-04-15 Thread Miklos Vajna (via logerrit)
 download.lst | 
   4 -
 external/xmlsec/UnpackedTarball_xmlsec.mk| 
   2 
 external/xmlsec/xmlsec-nss-Ensure-NSS-algorithms-are-initialized-754.patch.1 | 
  33 --
 3 files changed, 2 insertions(+), 37 deletions(-)

New commits:
commit 1651ced348fa47de3f24650dcad8922121602da4
Author: Miklos Vajna 
AuthorDate: Fri Apr 12 08:36:05 2024 +0200
Commit: Miklos Vajna 
CommitDate: Mon Apr 15 08:03:11 2024 +0200

Update libxmlsec to 1.3.4

Allows dropping
xmlsec-nss-Ensure-NSS-algorithms-are-initialized-754.patch.1, which was
a backport.

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

diff --git a/download.lst b/download.lst
index d8793dbeb620..f36b5fe0da10 100644
--- a/download.lst
+++ b/download.lst
@@ -419,8 +419,8 @@ LIBWEBP_TARBALL := libwebp-1.3.2.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-XMLSEC_SHA256SUM := 
ab5b9a9ffd6960f46f7466d9d91f174ec37e8c31989237ba6b9eacdd816464f2
-XMLSEC_TARBALL := xmlsec1-1.3.3.tar.gz
+XMLSEC_SHA256SUM := 
45ad9078d41ae76844ad2f8651600ffeec0fdd128ead988a8d69e907c57aee75
+XMLSEC_TARBALL := xmlsec1-1.3.4.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git a/external/xmlsec/UnpackedTarball_xmlsec.mk 
b/external/xmlsec/UnpackedTarball_xmlsec.mk
index ad7b4b57c5f3..906aece5f7ed 100644
--- a/external/xmlsec/UnpackedTarball_xmlsec.mk
+++ b/external/xmlsec/UnpackedTarball_xmlsec.mk
@@ -12,8 +12,6 @@ xmlsec_patches :=
 xmlsec_patches += old-nss.patch.1
 # Remove this when Windows 7 is no longer supported
 xmlsec_patches += BCryptKeyDerivation.patch.1
-# Backport of https://github.com/lsh123/xmlsec/pull/754
-xmlsec_patches += xmlsec-nss-Ensure-NSS-algorithms-are-initialized-754.patch.1
 
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,xmlsec))
 
diff --git 
a/external/xmlsec/xmlsec-nss-Ensure-NSS-algorithms-are-initialized-754.patch.1 
b/external/xmlsec/xmlsec-nss-Ensure-NSS-algorithms-are-initialized-754.patch.1
deleted file mode 100644
index bf397bfb9178..
--- 
a/external/xmlsec/xmlsec-nss-Ensure-NSS-algorithms-are-initialized-754.patch.1
+++ /dev/null
@@ -1,33 +0,0 @@
-From 356fdcfaf6e126835ac3bd7f410a3fa4d4a6877b Mon Sep 17 00:00:00 2001
-From: lsh123 
-Date: Sat, 13 Jan 2024 18:07:49 -0500
-Subject: [PATCH] (xmlsec-nss) Ensure NSS algorithms are initialized (#754)
-

- src/nss/crypto.c | 8 
- 1 file changed, 8 insertions(+)
-
-diff --git a/src/nss/crypto.c b/src/nss/crypto.c
-index 6455ec72..7ba0c77a 100644
 a/src/nss/crypto.c
-+++ b/src/nss/crypto.c
-@@ -361,8 +361,16 @@ xmlSecCryptoGetFunctions_nss(void) {
- 
- static void
- xmlSecNssUpdateAvailableCryptoTransforms(xmlSecCryptoDLFunctionsPtr 
functions) {
-+SECStatus rv;
- xmlSecAssert(functions != NULL);
- 
-+/* in theory NSS should be already initialized but just in case */
-+rv = SECOID_Init();
-+if (rv != SECSuccess) {
-+xmlSecNssError("SECOID_Init", NULL);
-+return;
-+}
-+
- /*** AES /
- /* cbc */
- if (xmlSecNssCryptoCheckAlgorithm(SEC_OID_AES_128_CBC) == 0) {
--- 
-2.35.3
-


core.git: sfx2/source

2024-04-13 Thread Miklos Vajna (via logerrit)
 sfx2/source/control/unoctitm.cxx |   18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 1e605412df2ca9aab895b34f256ccd5a8dfdc83d
Author: Miklos Vajna 
AuthorDate: Fri Apr 12 08:52:43 2024 +0200
Commit: Caolán McNamara 
CommitDate: Sat Apr 13 16:52:50 2024 +0200

sfx2: fix crash in InterceptLOKStateChangeEvent()

Notice how e.g. the TransformPosX case already performed the same null
pointer check.

Crashreport backtrace:

> program/libmergedlo.so
>   InterceptLOKStateChangeEvent
>   sfx2/source/control/unoctitm.cxx:1143
> program/libmergedlo.so
>   SfxStateCache::SetState_Impl(SfxItemState, SfxPoolItem const*, bool)
>   sfx2/source/control/statcach.cxx:432
> program/libmergedlo.so
>   SfxBindings::Update_Impl(SfxStateCache&)
>   
/opt/rh/devtoolset-10/root/usr/include/c++/10/bits/stl_vector.h:919 
(discriminator 2)
> program/libmergedlo.so
>   SfxBindings::NextJob_Impl(Timer const*)
>   
/opt/rh/devtoolset-10/root/usr/include/c++/10/bits/unique_ptr.h:173

Change-Id: I141d4f9ec50d0ce7a0eeaba69752c31390a1f9ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166027
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166046
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 333879c24d0f..f49dc2d7336f 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1118,13 +1118,17 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
 else if (aEvent.FeatureURL.Path == "ParaLeftToRight" ||
  aEvent.FeatureURL.Path == "ParaRightToLeft")
 {
-tools::JsonWriter aTree;
-bool bTemp = false;
-aEvent.State >>= bTemp;
-aTree.put("commandName", aEvent.FeatureURL.Complete);
-aTree.put("disabled", !aEvent.IsEnabled);
-aTree.put("state", bTemp ? "true" : "false");
-
SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aTree.finishAndGetAsOString());
+const SfxViewShell* pViewShell = SfxViewShell::Current();
+if (pViewShell)
+{
+tools::JsonWriter aTree;
+bool bTemp = false;
+aEvent.State >>= bTemp;
+aTree.put("commandName", aEvent.FeatureURL.Complete);
+aTree.put("disabled", !aEvent.IsEnabled);
+aTree.put("state", bTemp ? "true" : "false");
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aTree.finishAndGetAsOString());
+}
 return;
 }
 else if (aEvent.FeatureURL.Path == "AssignLayout" ||


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

2024-04-13 Thread Miklos Vajna (via logerrit)
 sfx2/source/control/unoctitm.cxx |   18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 776f73c28f7a4984c8a932a5316a0cc0837e71e3
Author: Miklos Vajna 
AuthorDate: Fri Apr 12 08:52:43 2024 +0200
Commit: Michael Meeks 
CommitDate: Sat Apr 13 12:30:45 2024 +0200

sfx2: fix crash in InterceptLOKStateChangeEvent()

Notice how e.g. the TransformPosX case already performed the same null
pointer check.

Crashreport backtrace:

> program/libmergedlo.so
>   InterceptLOKStateChangeEvent
>   sfx2/source/control/unoctitm.cxx:1143
> program/libmergedlo.so
>   SfxStateCache::SetState_Impl(SfxItemState, SfxPoolItem const*, bool)
>   sfx2/source/control/statcach.cxx:432
> program/libmergedlo.so
>   SfxBindings::Update_Impl(SfxStateCache&)
>   
/opt/rh/devtoolset-10/root/usr/include/c++/10/bits/stl_vector.h:919 
(discriminator 2)
> program/libmergedlo.so
>   SfxBindings::NextJob_Impl(Timer const*)
>   
/opt/rh/devtoolset-10/root/usr/include/c++/10/bits/unique_ptr.h:173

Change-Id: I141d4f9ec50d0ce7a0eeaba69752c31390a1f9ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166027
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165942
Tested-by: Michael Meeks 

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index d99446d01d79..b62f0f4376c4 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1118,13 +1118,17 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
 else if (aEvent.FeatureURL.Path == "ParaLeftToRight" ||
  aEvent.FeatureURL.Path == "ParaRightToLeft")
 {
-tools::JsonWriter aTree;
-bool bTemp = false;
-aEvent.State >>= bTemp;
-aTree.put("commandName", aEvent.FeatureURL.Complete);
-aTree.put("disabled", !aEvent.IsEnabled);
-aTree.put("state", bTemp ? "true" : "false");
-
SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aTree.finishAndGetAsOString());
+const SfxViewShell* pViewShell = SfxViewShell::Current();
+if (pViewShell)
+{
+tools::JsonWriter aTree;
+bool bTemp = false;
+aEvent.State >>= bTemp;
+aTree.put("commandName", aEvent.FeatureURL.Complete);
+aTree.put("disabled", !aEvent.IsEnabled);
+aTree.put("state", bTemp ? "true" : "false");
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aTree.finishAndGetAsOString());
+}
 return;
 }
 else if (aEvent.FeatureURL.Path == "AssignLayout" ||


  1   2   3   4   5   6   7   8   9   10   >