core.git: editeng/source

2024-10-04 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/eehtml.cxx |   28 
 editeng/source/editeng/eehtml.hxx |1 +
 2 files changed, 17 insertions(+), 12 deletions(-)

New commits:
commit 5739280623bcc111a0d8b808ca4cc5e6598f9cce
Author: Caolán McNamara 
AuthorDate: Wed Oct 2 13:25:09 2024 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 4 13:01:10 2024 +0200

Split out this html parsing hunk as a separate NewLine method

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

diff --git a/editeng/source/editeng/eehtml.cxx 
b/editeng/source/editeng/eehtml.cxx
index 1b73960d129f..24fd670ad9ba 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -95,6 +95,14 @@ SvParserState EditHTMLParser::CallParser(EditEngine* pEE, 
const EditPaM& rPaM)
 return _eState;
 }
 
+void EditHTMLParser::Newline()
+{
+bool bHasText = HasTextInCurrentPara();
+if ( bHasText )
+ImpInsertParaBreak();
+StartPara( false );
+}
+
 void EditHTMLParser::NextToken( HtmlTokenId nToken )
 {
 switch( nToken )
@@ -280,7 +288,8 @@ void EditHTMLParser::NextToken( HtmlTokenId nToken )
 case HtmlTokenId::TABLEHEADER_ON:
 case HtmlTokenId::TABLEDATA_ON:
 nInCell++;
-[[fallthrough]];
+Newline();
+break;
 case HtmlTokenId::BLOCKQUOTE_ON:
 case HtmlTokenId::BLOCKQUOTE_OFF:
 case HtmlTokenId::BLOCKQUOTE30_ON:
@@ -291,28 +300,23 @@ void EditHTMLParser::NextToken( HtmlTokenId nToken )
 case HtmlTokenId::DT_ON:
 case HtmlTokenId::ORDERLIST_ON:
 case HtmlTokenId::UNORDERLIST_ON:
-{
-bool bHasText = HasTextInCurrentPara();
-if ( bHasText )
-ImpInsertParaBreak();
-StartPara( false );
-}
+Newline();
 break;
 
 case HtmlTokenId::TABLEHEADER_OFF:
 case HtmlTokenId::TABLEDATA_OFF:
-{
 if ( nInCell )
 nInCell--;
-[[fallthrough]];
-}
+EndPara();
+break;
 case HtmlTokenId::LISTHEADER_OFF:
 case HtmlTokenId::LI_OFF:
 case HtmlTokenId::DD_OFF:
 case HtmlTokenId::DT_OFF:
 case HtmlTokenId::ORDERLIST_OFF:
-case HtmlTokenId::UNORDERLIST_OFF:  EndPara();
-break;
+case HtmlTokenId::UNORDERLIST_OFF:
+EndPara();
+break;
 
 case HtmlTokenId::TABLEROW_ON:
 case HtmlTokenId::TABLEROW_OFF: // A RETURN only after a CELL, for Calc
diff --git a/editeng/source/editeng/eehtml.hxx 
b/editeng/source/editeng/eehtml.hxx
index fddd567ac6ba..9f8009c715c8 100644
--- a/editeng/source/editeng/eehtml.hxx
+++ b/editeng/source/editeng/eehtml.hxx
@@ -53,6 +53,7 @@ private:
 sal_uInt8   nDefListLevel;
 
 voidStartPara( bool bReal );
+voidNewline();
 voidEndPara();
 voidAnchorStart();
 voidAnchorEnd();


core.git: sc/sdi sc/source sd/sdi sd/source sfx2/sdi sfx2/source sw/sdi sw/source

2024-10-04 Thread Hossein (via logerrit)
 sc/sdi/tabvwsh.sdi   |1 -
 sc/source/ui/view/tabvwshb.cxx   |   20 
 sd/sdi/_drvwsh.sdi   |5 -
 sd/source/ui/view/drviews2.cxx   |   22 --
 sfx2/sdi/appslots.sdi|4 
 sfx2/sdi/docslots.sdi|5 -
 sfx2/sdi/sfx.sdi |1 +
 sfx2/source/appl/appserv.cxx |   20 
 sw/sdi/viewsh.sdi|6 --
 sw/source/uibase/uiview/viewdlg2.cxx |   18 --
 10 files changed, 25 insertions(+), 77 deletions(-)

New commits:
commit bb0e5aa97965b2710200da677db032289c373afe
Author: Hossein 
AuthorDate: Fri Oct 4 11:27:02 2024 +0200
Commit: Hossein 
CommitDate: Fri Oct 4 13:04:38 2024 +0200

tdf#163291 Fix AdditionsDialog in start center

Previously, AdditionsDialog was not working while in start center. Also,
there were a lot of code duplicates. This patch fixes these issues.

The UNO command .uno:AdditionsDialog was incorrectly implemented as
application specific. There were multiple duplicate conditions for
checking SID_ADDITIONS_DIALOG in each and every application. Now, this
is only done in sfx2/source/appl/appserv.cxx in a single point.

The AdditionsDialog can now be opened while in start center in different
places of "Tools > Options" for icons, dictionaries, etc. Also, this
LibreOffice BASIC code snippet opens it:

Sub Main()
oDispatch = CreateUnoService("com.sun.star.frame.DispatchHelper")
Dim args(0) As New com.sun.star.beans.PropertyValue
oDispatch.executeDispatch(StarDesktop.ActiveFrame,
".uno:AdditionsDialog", "", 0, args)
End Sub

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

diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi
index 48afa923e6fc..af9f3458b0d1 100644
--- a/sc/sdi/tabvwsh.sdi
+++ b/sc/sdi/tabvwsh.sdi
@@ -62,7 +62,6 @@ interface BaseSelection
 
 SID_INSERT_QRCODE   [ ExecMethod = ExecDrawIns; StateMethod = 
GetDrawInsState; ]
 SID_EDIT_QRCODE [ ExecMethod = ExecDrawIns; StateMethod = 
GetDrawInsState; ]
-SID_ADDITIONS_DIALOG[ ExecMethod = ExecDrawIns; StateMethod = 
GetDrawInsState; ]
 
 SID_IMAP[ ExecMethod = ExecImageMap; StateMethod = 
GetImageMapState; ]
 SID_IMAP_EXEC   [ ExecMethod = ExecImageMap; StateMethod = 
GetImageMapState; ]
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index a4204f57e767..0a174df6d84b 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -466,26 +466,6 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
 break;
 }
 
-case SID_ADDITIONS_DIALOG:
-{
-OUString sAdditionsTag = u""_ustr;
-
-const SfxStringItem* pStringArg = 
rReq.GetArg(FN_PARAM_ADDITIONS_TAG);
-if (pStringArg)
-sAdditionsTag = pStringArg->GetValue();
-
-VclAbstractDialogFactory* pFact = 
VclAbstractDialogFactory::Create();
-VclPtr pDialog(
-pFact->CreateAdditionsDialog(pWin->GetFrameWeld(), 
sAdditionsTag));
-pDialog->StartExecuteAsync(
-[pDialog] (sal_Int32 /*nResult*/)->void
-{
-pDialog->disposeOnce();
-}
-);
-break;
-}
-
 case SID_OBJECTRESIZE:
 {
 // the server would like to change the client size
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index f44bbfec51d7..159b5ffc75e4 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -2923,11 +2923,6 @@ interface DrawView
 ExecMethod = FuTemporary ;
 StateMethod = GetMenuState ;
 ]
-SID_ADDITIONS_DIALOG
-[
-ExecMethod = FuTemporary ;
-StateMethod = GetMenuState ;
-]
 SID_ATTR_GLOW_COLOR
 [
 ExecMethod = FuTemporary ;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index ded35227175d..aafee36fa8b4 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -3601,28 +3601,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 }
 break;
 
-case SID_ADDITIONS_DIALOG:
-{
-OUString sAdditionsTag = u""_ustr;
-
-const SfxStringItem* pStringArg = 
rReq.GetArg(FN_PARAM_ADDITIONS_TAG);
-if (pStringArg)
-sAdditionsTag = pStringArg->GetValue();
-
-VclAbstractDialogFactory* pFact = 
VclAbstractDialogFactory::Create();
-VclPtr pDlg(
-pFact->CreateAdditionsDialog(GetFrameWeld()

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

2024-10-04 Thread Michael Stahl (via logerrit)
 sw/qa/extras/layout/data/i94666.odt |binary
 sw/qa/extras/layout/layout.cxx  |   46 
 sw/source/core/layout/wsfrm.cxx |5 +++
 sw/source/uibase/inc/wrtsh.hxx  |2 -
 4 files changed, 51 insertions(+), 2 deletions(-)

New commits:
commit a984eea00bf3102294e9e860b9d8b9e5ccc34292
Author: Michael Stahl 
AuthorDate: Thu Sep 19 12:37:35 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 09:33:26 2024 +0200

i#94666 sw: layout: fix problem with WIDOW_MAGIC in sections

This was already fixed in CWS sw301bf03 with commit
5559afee02fc2be18cded35a17a03aa8191b08f5 but then broken again, perhaps
by commit f2e3655255db4032738849cd4b77ce67a6e2c984 "Avoid
-fsanitize=signed-integer-overflow", which changed a magic constant,
effectively disabling the fix.

The problem (in a different document than attached at the bug) is that
the first text frame 128 in a section frame 258 gets its height set to
WIDOW_MAGIC in CalcPreps(), which grows the section frame to the maximum
allowed by its upper, and then when the real size of the text frame is
set it shrinks the section frame to be far too small, so the last text
frames and the whole table remain formatted at a position on the page
but are not painted because the paint is cut off at the (wrong) bottom
of the section frame.

(On master, the problem with the internal document cannot be reproduced
due to some other change which causes the text frame at the cut-off
position to have mbFramePrintAreaValid=false which causes it to MoveFwd
and that calls SwSectionFrame::SimpleFormat() which fixes the height,
but that all looks accidental.)

Change-Id: If13d993a0cab5701f45223a70b2c5c8b0690ebeb
(cherry picked from commit d77d3af9e4983edd7cd1cac5faecd8253db1a6ee)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173672
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
(cherry picked from commit 5725374d6286653fbcdd50ec4999606e4932824d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173640
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/layout/data/i94666.odt 
b/sw/qa/extras/layout/data/i94666.odt
new file mode 100644
index ..2652e89570a5
Binary files /dev/null and b/sw/qa/extras/layout/data/i94666.odt differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index ea03eef254de..bfbbc4f0aee2 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -852,6 +852,52 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testFieldHideSection)
 discardDumpedLayout();
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestI94666)
+{
+createSwDoc("i94666.odt");
+SwDoc* pDoc = getSwDoc();
+CPPUNIT_ASSERT(pDoc);
+
+{
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "/root/page"_ostr, 2);
+assertXPath(
+pXmlDoc,
+
"/root/page[2]/body/section/txt[1]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]"_ostr,
+"portion"_ostr, "pulled off ");
+discardDumpedLayout();
+}
+
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+pWrtShell->GotoPage(2, false);
+pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 11, 
/*bBasicCall=*/false);
+pWrtShell->SetMark();
+pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 11, 
/*bBasicCall=*/false);
+pWrtShell->DelToEndOfPara();
+
+{
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+// the problem was that the last paragraph moved to page 3
+assertXPath(
+pXmlDoc,
+
"/root/page[2]/body/section/txt[1]/SwParaPortion/SwLineLayout[1]/SwLinePortion[1]"_ostr,
+"portion"_ostr,
+"Widows & orphans He heard quiet steps behind him. That didn't 
bode well. Who could be "
+"following");
+assertXPath(
+pXmlDoc,
+
"/root/page[2]/body/section/txt[1]/SwParaPortion/SwLineLayout[3]/SwLinePortion[1]"_ostr,
+"portion"_ostr, "pulled off ");
+assertXPath(
+pXmlDoc,
+
"/root/page[2]/body/section/txt[2]/SwParaPortion/SwLineLayout[1]/SwParaPortion[1]"_ostr,
+"portion"_ostr, "Moved paragraph");
+assertXPath(pXmlDoc, "/root/page[2]//txt"_ostr, 3);
+assertXPath(pXmlDoc, "/root/page"_ostr, 2);
+discardDumpedLayout();
+}
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf134272)
 {
 createSwDoc("tdf134472.odt");
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 225416da96af..db42935339c8 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -2279,7 +2279,10 @@ SwTwips SwContentFrame::ShrinkFrame( SwTwips nDist, bool 
bTst, bool bInfo )
 if( nRstHeight < 0 )
 {
 SwTwips nNextHeight = 0;
-if( GetUpper()->I

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

2024-10-04 Thread Gökay Şatır (via logerrit)
 sd/inc/sdpage.hxx|3 +++
 sd/source/core/sdpage.cxx|   34 ++
 sd/source/ui/unoidl/unomodel.cxx |   33 +++--
 3 files changed, 56 insertions(+), 14 deletions(-)

New commits:
commit 304264810f6475c0f3c12a0f4eba88c61fe1d799
Author: Gökay Şatır 
AuthorDate: Thu Oct 3 17:31:09 2024 +0300
Commit: Miklos Vajna 
CommitDate: Fri Oct 4 09:33:07 2024 +0200

cool#7406: Refactor Impress->getPartInfo & use JsonWriter.

We need to add more information to getPartInfo function for getting grid 
properties.
While doing this, i refactored current function to use JsonWriter.
We also need to inform client side when a page border, size or margin 
change happens.
This commit also adds a shared function for these events.

Signed-off-by: Gökay Şatır 
Change-Id: I9dad094545c7cf0e072a7831f300dd0401ebf4a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174434
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index 5de35a9fb3a9..c41825024e33 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -36,6 +36,7 @@
 #include "shapelist.hxx"
 #include "misc/scopelock.hxx"
 #include "sddllapi.h"
+#include 
 
 namespace com::sun::star::animations {
 class XAnimationNode;
@@ -171,6 +172,8 @@ public:
 OUStringGetPresObjText(PresObjKind eObjKind) const;
 SfxStyleSheet* GetStyleSheetForMasterPageBackground() const;
 SfxStyleSheet*  GetStyleSheetForPresObj(PresObjKind eObjKind) const;
+voidGetPageInfo(::tools::JsonWriter& jsonWriter);
+voidNotifyPagePropertyChanges();
 boolRestoreDefaultText( SdrObject* pObj );
 
 /** @return true if the given SdrObject is inside the presentation object 
list */
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 07df2efa4b1d..7560c303262b 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -22,6 +22,8 @@
 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -1744,6 +1746,32 @@ void SdPage::onRemoveObject( SdrObject* pObject )
 }
 }
 
+void SdPage::GetPageInfo(::tools::JsonWriter& jsonWriter)
+{
+jsonWriter.put("visible", static_cast(!this->IsExcluded()));
+jsonWriter.put("selected", static_cast(this->IsSelected()));
+jsonWriter.put("width", GetWidth());
+jsonWriter.put("height", GetHeight());
+jsonWriter.put("leftBorder", GetLeftBorder());
+jsonWriter.put("rightBorder", GetRightBorder());
+jsonWriter.put("upperBorder", GetUpperBorder());
+jsonWriter.put("lowerBorder", GetLowerBorder());
+jsonWriter.put("name", GetName());
+jsonWriter.put("hash", GetUniqueID());
+}
+
+void SdPage::NotifyPagePropertyChanges()
+{
+// Send the new size info to views, snapping to grid feature uses this 
info (maybe some others in the future).
+::tools::JsonWriter jsonWriter;
+jsonWriter.put("commandName", ".uno:PageSetup");
+GetPageInfo(jsonWriter);
+
+OString out = jsonWriter.finishAndGetAsOString();
+
SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
out);
+SfxViewShell::Current()->NotifyOtherViews(LOK_CALLBACK_STATE_CHANGED, 
".uno:PageSetup"_ostr, out);
+}
+
 void SdPage::SetSize(const Size& aSize)
 {
 Size aOldSize = GetSize();
@@ -1751,6 +1779,9 @@ void SdPage::SetSize(const Size& aSize)
 if (aSize != aOldSize)
 {
 FmFormPage::SetSize(aSize);
+
+if (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current())
+NotifyPagePropertyChanges();
 }
 }
 
@@ -1760,6 +1791,9 @@ void SdPage::SetBorder(sal_Int32 nLft, sal_Int32 nUpp, 
sal_Int32 nRgt, sal_Int32
 nRgt != GetRightBorder() || nLwr != GetLowerBorder() )
 {
 FmFormPage::SetBorder(nLft, nUpp, nRgt, nLwr);
+
+if (comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current())
+NotifyPagePropertyChanges();
 }
 }
 
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 16e34f3ac0da..597b388eb5de 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -3671,22 +3671,27 @@ OUString SdXImpressDocument::getPartInfo(int nPart)
 if (!pViewSh)
 return OUString();
 
-const SdPage* pSdPage = mpDoc->GetSdPage(nPart, pViewSh->GetPageKind());
-const bool bIsVisible = pSdPage && !pSdPage->IsExcluded();
-const bool bIsSelected = pViewSh->IsSelected(nPart);
+SdPage* pSdPage = mpDoc->GetSdPage(nPart, pViewSh->GetPageKind());
 const sal_Int16 nMasterPageCount= 
pViewSh->GetDoc()->GetMasterSdPageCount(pViewSh->GetPageKind());
 
-OUString aPartInfo = "{ \"visible\": \"" +
-OUString::number(static_cast(bIsVisible)) +
-"\", \"selected\": \"" +
-OUString::number(static_cast(bIsSelected)) +
-"\", \"masterPageCount\": \"" +
-   

core.git: sd/source

2024-10-04 Thread Armin Le Grand (allotropia) (via logerrit)
 sd/source/ui/view/drviews4.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 37d3e978c95a99bffda6d6d2c6b76cbf7521b185
Author: Armin Le Grand (allotropia) 
AuthorDate: Thu Oct 3 20:24:53 2024 +0200
Commit: Armin Le Grand 
CommitDate: Fri Oct 4 11:29:45 2024 +0200

tdf#163124: Show correct PopUp when SlideShow running

When the non-native SlideShow in DrawViewShell::Command
in drviews4.cxx (see !bNativeShow) is active, the above
checks/actions have to be done to make the EditView work
normally, but use the "page" standard context menu
fallback only when SlideShow is not running to get the
SlideShow popup menu - as expected when SlideShow is
running.

Change-Id: I6e3bc69023218fc0decce61581ddbc498e00d39c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174437
Reviewed-by: Armin Le Grand 
Tested-by: Jenkins

diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index b0ce3a71e0ca..776546ed9cfc 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -795,8 +795,13 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, 
::sd::Window* pWin)
 }
 
 // nothing selected
-else
+else if (!SlideShow::IsRunning(GetViewShellBase()))
 {
+// tdf#163124 this is the non-native SlideShow (see 
!bNativeShow),
+// thus the above checks/actions have to be done to make the
+// EditView work normally, but use the "page" standard context 
menu
+// fallback only when SlideShow is not running to get the
+// SlideShow popup menu - as expected when SlideShow is running
 aPopupId = "page";
 }
 }


core.git: sc/qa sc/source

2024-10-04 Thread Andreas Heinisch (via logerrit)
 sc/qa/unit/uicalc/uicalc.cxx |   39 +++
 sc/source/core/data/document.cxx |8 +++-
 2 files changed, 46 insertions(+), 1 deletion(-)

New commits:
commit 9a2c38530dd5e479a96953980ee7f6c448dce87a
Author: Andreas Heinisch 
AuthorDate: Thu Sep 26 10:31:41 2024 +0200
Commit: Andreas Heinisch 
CommitDate: Fri Oct 4 18:56:08 2024 +0200

tdf#163019 - Remove the formula of a cell during paste special

Remove the formula of a cell during paste special and not only the required 
for insertion. Otherwise, the formula listeners are not updated correctly 
leading to a crash during the repaint process.

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

diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 68a4289417af..76d55137e98b 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -2311,6 +2311,45 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf141440)
 CPPUNIT_ASSERT_EQUAL(u"Note in A1"_ustr, pDoc->GetNote(ScAddress(0, 0, 
0))->GetText());
 }
 
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf163019)
+{
+createScDoc();
+ScDocument* pDoc = getScDoc();
+
+// Disable replace cell warning
+ScModule* pMod = SC_MOD();
+ScInputOptions aInputOption = pMod->GetInputOptions();
+bool bOldStatus = aInputOption.GetReplaceCellsWarn();
+aInputOption.SetReplaceCellsWarn(false);
+pMod->SetInputOptions(aInputOption);
+
+// Insert test data and formulas to create a sample crash document
+insertStringToCell(u"B1"_ustr, u"1");
+insertStringToCell(u"A2"_ustr, u"1");
+insertStringToCell(u"A3"_ustr, u"1");
+insertStringToCell(u"B2"_ustr, u"=B1-A2");
+insertStringToCell(u"B3"_ustr, u"=B2-A3");
+
+// Copy content from B2 to B2 using paste special command as a number 
(Flags )
+goToCell(u"B2"_ustr);
+dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+goToCell(u"B2"_ustr);
+uno::Sequence aArgs = 
comphelper::InitPropertySequence(
+{ { "Flags", uno::Any(u"V"_ustr) },
+  { "FormulaCommand", uno::Any(sal_uInt16(ScPasteFunc::NONE)) },
+  { "SkipEmptyCells", uno::Any(false) },
+  { "Transpose", uno::Any(false) },
+  { "AsLink", uno::Any(false) },
+  { "MoveMode", uno::Any(sal_uInt16(InsCellCmd::INS_NONE)) } });
+//  Without the fix in place, this test would have crashed here
+dispatchCommand(mxComponent, u".uno:InsertContents"_ustr, aArgs);
+CPPUNIT_ASSERT_EQUAL(u"0"_ustr, pDoc->GetString(ScAddress(1, 1, 0)));
+
+// Restore previous replace cell warning status
+aInputOption.SetReplaceCellsWarn(bOldStatus);
+pMod->SetInputOptions(aInputOption);
+}
+
 CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf158551)
 {
 createScDoc();
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index bbce2d15031b..f1ff4241413d 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2899,7 +2899,13 @@ void ScDocument::CopyFromClip(
 these cells. In this case, just delete old notes from the
 destination area. */
 InsertDeleteFlags nDelFlag = nInsFlag;
-if ( (nInsFlag & (InsertDeleteFlags::CONTENTS | 
InsertDeleteFlags::ADDNOTES)) == (InsertDeleteFlags::NOTE | 
InsertDeleteFlags::ADDNOTES) )
+// tdf#163019 - remove formula of the cell to update formula listeners
+if (nInsFlag & InsertDeleteFlags::CONTENTS)
+nDelFlag |= InsertDeleteFlags::FORMULA;
+
+// tdf#161189 - remove the note deletion flag if no notes are included
+if ((nInsFlag & (InsertDeleteFlags::CONTENTS | 
InsertDeleteFlags::ADDNOTES))
+== (InsertDeleteFlags::NOTE | InsertDeleteFlags::ADDNOTES))
 nDelFlag &= ~InsertDeleteFlags::NOTE;
 
 if (nInsFlag & InsertDeleteFlags::ATTRIB)


core.git: Branch 'libreoffice-24-8' - sc/qa

2024-10-04 Thread Xisco Fauli (via logerrit)
 sc/qa/unit/subsequent_export_test4.cxx  |   65 
 sc/qa/unit/subsequent_filters_test4.cxx |   58 
 2 files changed, 65 insertions(+), 58 deletions(-)

New commits:
commit 81268254b69ae1a9acbe52e4aa63910343f4987c
Author: Xisco Fauli 
AuthorDate: Fri Oct 4 13:10:54 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 16:48:58 2024 +0200

sc: convert import test into export test

In preparation for a follow-up patch

Change-Id: I3a981d28004e9888b749eb497ef871a9cac658c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174473
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174487

diff --git a/sc/qa/unit/subsequent_export_test4.cxx 
b/sc/qa/unit/subsequent_export_test4.cxx
index e194568803c0..8983756b6d41 100644
--- a/sc/qa/unit/subsequent_export_test4.cxx
+++ b/sc/qa/unit/subsequent_export_test4.cxx
@@ -11,6 +11,8 @@
 
 #include "helper/qahelper.hxx"
 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -95,6 +97,69 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, 
testCommentTextVAlignment)
u"Center"_ustr);
 }
 
+namespace
+{
+void testComplexIconSetsXLSX_Impl(const ScDocument& rDoc, SCCOL nCol, 
ScIconSetType eType)
+{
+ScConditionalFormat* pFormat = rDoc.GetCondFormat(nCol, 1, 0);
+CPPUNIT_ASSERT(pFormat);
+CPPUNIT_ASSERT_EQUAL(size_t(1), pFormat->size());
+const ScFormatEntry* pEntry = pFormat->GetEntry(0);
+CPPUNIT_ASSERT(pEntry);
+CPPUNIT_ASSERT_EQUAL(ScFormatEntry::Type::Iconset, pEntry->GetType());
+const ScIconSetFormat* pIconSet = static_cast(pEntry);
+CPPUNIT_ASSERT_EQUAL(eType, pIconSet->GetIconSetData()->eIconSetType);
+}
+
+void testCustomIconSetsXLSX_Impl(const ScDocument& rDoc, SCCOL nCol, SCROW 
nRow,
+ ScIconSetType eType, sal_Int32 nIndex)
+{
+ScConditionalFormat* pFormat = rDoc.GetCondFormat(nCol, 1, 1);
+CPPUNIT_ASSERT(pFormat);
+CPPUNIT_ASSERT_EQUAL(size_t(1), pFormat->size());
+const ScFormatEntry* pEntry = pFormat->GetEntry(0);
+CPPUNIT_ASSERT(pEntry);
+CPPUNIT_ASSERT_EQUAL(ScFormatEntry::Type::Iconset, pEntry->GetType());
+const ScIconSetFormat* pIconSet = static_cast(pEntry);
+std::unique_ptr 
pInfo(pIconSet->GetIconSetInfo(ScAddress(nCol, nRow, 1)));
+if (nIndex == -1)
+CPPUNIT_ASSERT(!pInfo);
+else
+{
+CPPUNIT_ASSERT(pInfo);
+CPPUNIT_ASSERT_EQUAL(nIndex, pInfo->nIconIndex);
+CPPUNIT_ASSERT_EQUAL(eType, pInfo->eIconSetType);
+}
+}
+}
+
+CPPUNIT_TEST_FIXTURE(ScExportTest4, testComplexIconSetsXLSX)
+{
+auto verify = [this]() {
+ScDocument* pDoc = getScDoc();
+CPPUNIT_ASSERT_EQUAL(size_t(3), pDoc->GetCondFormList(0)->size());
+testComplexIconSetsXLSX_Impl(*pDoc, 1, IconSet_3Triangles);
+testComplexIconSetsXLSX_Impl(*pDoc, 3, IconSet_3Stars);
+testComplexIconSetsXLSX_Impl(*pDoc, 5, IconSet_5Boxes);
+
+CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetCondFormList(1)->size());
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 1, IconSet_3ArrowsGray, 0);
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 2, IconSet_3ArrowsGray, -1);
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 3, IconSet_3Arrows, 1);
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 4, IconSet_3ArrowsGray, -1);
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 5, IconSet_3Arrows, 2);
+
+testCustomIconSetsXLSX_Impl(*pDoc, 3, 1, IconSet_4RedToBlack, 3);
+testCustomIconSetsXLSX_Impl(*pDoc, 3, 2, IconSet_3TrafficLights1, 1);
+testCustomIconSetsXLSX_Impl(*pDoc, 3, 3, IconSet_3Arrows, 2);
+};
+
+createScDoc("xlsx/complex_icon_set.xlsx");
+verify();
+saveAndReload(u"Calc Office Open XML"_ustr);
+verify();
+}
+
 CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentTextHAlignment)
 {
 // Testing comment text alignments.
diff --git a/sc/qa/unit/subsequent_filters_test4.cxx 
b/sc/qa/unit/subsequent_filters_test4.cxx
index d016ebbb8b01..caf29b9f9c03 100644
--- a/sc/qa/unit/subsequent_filters_test4.cxx
+++ b/sc/qa/unit/subsequent_filters_test4.cxx
@@ -860,64 +860,6 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, 
testCondFormatThemeColor3XLSX)
 checkDatabarPositiveColor(pFormat, Color(217, 217, 217));
 }
 
-namespace
-{
-void testComplexIconSetsXLSX_Impl(const ScDocument& rDoc, SCCOL nCol, 
ScIconSetType eType)
-{
-ScConditionalFormat* pFormat = rDoc.GetCondFormat(nCol, 1, 0);
-CPPUNIT_ASSERT(pFormat);
-CPPUNIT_ASSERT_EQUAL(size_t(1), pFormat->size());
-const ScFormatEntry* pEntry = pFormat->GetEntry(0);
-CPPUNIT_ASSERT(pEntry);
-CPPUNIT_ASSERT_EQUAL(ScFormatEntry::Type::Iconset, pEntry->GetType());
-const ScIconSetFormat* pIconSet = static_cast(pEntry);
-CPPUNIT_ASSERT_EQUAL(eType, pIconSet->GetIconSetData()->eIconSetType);
-}
-
-void testCustomIconSetsXLSX_Impl(const ScDocument& rDoc, 

help.git: AllLangHelp_scalc.mk helpers/calc_text_func.xsl source/text

2024-10-04 Thread Pierre F (via logerrit)
 AllLangHelp_scalc.mk   |2 +
 helpers/calc_text_func.xsl |   48 +
 source/text/scalc/01/04060110.xhp  |   50 +--
 source/text/scalc/01/func_bahttext.xhp |   42 ++
 source/text/scalc/01/func_base.xhp |   53 +
 5 files changed, 147 insertions(+), 48 deletions(-)

New commits:
commit a3d5c1442a38c08407b4a0e4e54d4ca79d14e380
Author: Pierre F 
AuthorDate: Mon Sep 2 12:33:30 2024 +0200
Commit: Olivier Hallot 
CommitDate: Fri Oct 4 18:20:25 2024 +0200

tdf#143846 split BASE + BAHTTEXT

new helper : xsltproc  --stringparam func BAHTTEXT 
helpers/calc_text_func.xsl source/text/scalc/01/04060110.xhp > 
source/text/scalc/01/bahttext.xhp

Change-Id: I40c33d486c45ef0a3316dba1c0aea4af68ff9f37
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/172748
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/AllLangHelp_scalc.mk b/AllLangHelp_scalc.mk
index e291a4a258..c1b44cdbc4 100644
--- a/AllLangHelp_scalc.mk
+++ b/AllLangHelp_scalc.mk
@@ -200,6 +200,8 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,scalc,\
 helpcontent2/source/text/scalc/01/func_asc \
 helpcontent2/source/text/scalc/01/func_averageif \
 helpcontent2/source/text/scalc/01/func_averageifs \
+helpcontent2/source/text/scalc/01/func_base \
+helpcontent2/source/text/scalc/01/func_bahttext \
 helpcontent2/source/text/scalc/01/func_ceiling \
 helpcontent2/source/text/scalc/01/func_countifs \
 helpcontent2/source/text/scalc/01/func_color \
diff --git a/helpers/calc_text_func.xsl b/helpers/calc_text_func.xsl
new file mode 100644
index 00..e2d379d9e7
--- /dev/null
+++ b/helpers/calc_text_func.xsl
@@ -0,0 +1,48 @@
+
+http://www.w3.org/1999/XSL/Transform";>
+
+
+
+
+
+  
+   
+   
+  
+ 
+
+
+  
+  
+* 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/.
+*
+  
+  
+
+ Function
+/text/scalc/01/func_.xhp
+
+  
+  
+  
+
+
+
+  
+
+  
+
+   
+
+
+
+
+  
+
+
+
+
diff --git a/source/text/scalc/01/04060110.xhp 
b/source/text/scalc/01/04060110.xhp
index 4e36aec2d5..9b56a621df 100644
--- a/source/text/scalc/01/04060110.xhp
+++ b/source/text/scalc/01/04060110.xhp
@@ -91,57 +91,11 @@
 
 
 
-
-  BAHTTEXT function
-
-i66350
-BAHTTEXT
-Converts a number to Thai text, 
including the Thai currency names.
-
-
-BAHTTEXT(Number)
- Number is any 
number. "Baht" is appended to the integral part of the number, and "Satang" is 
appended to the decimal part of the number.
-
-
- =BAHTTEXT(12.65) returns a string in Thai characters with 
the meaning of "Twelve Baht and sixty five Satang".
-
-
-COM.MICROSOFT.BAHTTEXT
+  
 
 
 
-
-  BASE function
-
-
-
-
-  decimal system; converting to
-
-BASE
-Converts a positive integer to a specified base into a 
text from the numbering 
system. The digits 0-9 and the letters A-Z are used.
-
-
-BASE(Number; Radix [; 
MinimumLength])
- Number is the 
positive integer to be converted.
- Radix indicates 
the base of the numeral system. It may be any positive integer between 2 and 
36.
- MinimumLength 
(optional) determines the minimum length of the character sequence that has 
been created. If the text is shorter than the indicated minimum length, zeros 
are added to the left of the string.
-
-
- =BASE(17;10;4) returns 0017 in the decimal 
system.
-
-  binary system; converting to
-
-
- =BASE(17;2) returns 10001 in the binary system.
-
-  hexadecimal system; converting to
-
-
- =BASE(255;16;4) returns 00FF in the hexadecimal 
system.
-
-
-DECIMAL
+  
 
 
 
diff --git a/source/text/scalc/01/func_bahttext.xhp 
b/source/text/scalc/01/func_bahttext.xhp
new file mode 100644
index 00..aad6e7d8c1
--- /dev/null
+++ b/source/text/scalc/01/func_bahttext.xhp
@@ -0,0 +1,42 @@
+
+
+
+  
+
+  BAHTTEXT Function
+  /text/scalc/01/func_bahttext.xhp
+
+  
+  
+
+  BAHTTEXT function
+
+
+i66350
+
+  
+
+  BAHTTEXT
+
+  
+  Converts a number to Thai 
text, including the Thai currency names.
+
+
+BAHTTEXT(Number)
+ Number is any 
number. "Baht" is appended to the integral part of the number, and "Satang" is 
appended to the decimal part of the number.
+
+ =BAHTTEXT(12.65) returns a string in Thai characters with 
the meaning of "Twelve Baht and sixty five Satang".
+
+
+
+  COM.MICROSOFT.BAHTTEXT
+
+  
+
diff --git a/source/text/scalc/01/func_base.xhp 
b/source/text/scalc/01/func_base.xhp
new file mode 100644
index 00..50c923a0cd
--- /dev/null
+++ b/source/text/scalc/01/func_base.xhp
@@ -0,0 +1,53 @@
+
+
+
+  
+
+  BASE

core.git: helpcontent2

2024-10-04 Thread Pierre F (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5ac3a1565101fdda980a28a26e3baca36293a472
Author: Pierre F 
AuthorDate: Fri Oct 4 18:20:25 2024 +0200
Commit: Gerrit Code Review 
CommitDate: Fri Oct 4 18:20:25 2024 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to a3d5c1442a38c08407b4a0e4e54d4ca79d14e380
  - tdf#143846 split BASE + BAHTTEXT

new helper : xsltproc  --stringparam func BAHTTEXT 
helpers/calc_text_func.xsl source/text/scalc/01/04060110.xhp > 
source/text/scalc/01/bahttext.xhp

Change-Id: I40c33d486c45ef0a3316dba1c0aea4af68ff9f37
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/172748
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index e377c9e11519..a3d5c1442a38 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit e377c9e115198486cb2b1c6f0348453653a906a5
+Subproject commit a3d5c1442a38c08407b4a0e4e54d4ca79d14e380


core.git: 2 commits - accessibility/inc translations

2024-10-04 Thread Caolán McNamara (via logerrit)
 accessibility/inc/extended/AccessibleBrowseBox.hxx |   28 +++--
 translations   |2 -
 2 files changed, 11 insertions(+), 19 deletions(-)

New commits:
commit 67d01815daee05e7991b12a0696888e7c8f6b3d9
Author: Caolán McNamara 
AuthorDate: Fri Oct 4 14:20:04 2024 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 4 17:07:27 2024 +0200

expand and drop getContext

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

diff --git a/accessibility/inc/extended/AccessibleBrowseBox.hxx 
b/accessibility/inc/extended/AccessibleBrowseBox.hxx
index b7e912df6e92..a81ace673c88 100644
--- a/accessibility/inc/extended/AccessibleBrowseBox.hxx
+++ b/accessibility/inc/extended/AccessibleBrowseBox.hxx
@@ -207,9 +207,6 @@ public:
 ::vcl::IAccessibleTableProvider& _rBrowseBox
 );
 
-/// returns the AccessibleContext belonging to this Accessible
-AccessibleBrowseBox*getContext() { return m_xContext.get(); }
-
 private:
 virtual ~AccessibleBrowseBoxAccess() override;
 
@@ -227,40 +224,35 @@ private:
 getHeaderBar( AccessibleBrowseBoxObjType _eObjType ) override
 {
 css::uno::Reference< css::accessibility::XAccessible > xAccessible;
-AccessibleBrowseBox* pContext( getContext() );
-if ( pContext )
-xAccessible = pContext->getHeaderBar( _eObjType );
+if (m_xContext)
+xAccessible = m_xContext->getHeaderBar( _eObjType );
 return xAccessible;
 }
 virtual css::uno::Reference< css::accessibility::XAccessible >
 getTable() override
 {
 css::uno::Reference< css::accessibility::XAccessible > xAccessible;
-AccessibleBrowseBox* pContext( getContext() );
-if ( pContext )
-xAccessible = pContext->getTable();
+if (m_xContext)
+xAccessible = m_xContext->getTable();
 return xAccessible;
 }
 virtual void commitHeaderBarEvent( sal_Int16 nEventId, const 
css::uno::Any& rNewValue,
 const css::uno::Any& rOldValue, bool _bColumnHeaderBar ) override
 {
-AccessibleBrowseBox* pContext( getContext() );
-if ( pContext )
-pContext->commitHeaderBarEvent( nEventId, rNewValue, rOldValue, 
_bColumnHeaderBar );
+if (m_xContext)
+m_xContext->commitHeaderBarEvent( nEventId, rNewValue, rOldValue, 
_bColumnHeaderBar );
 }
 virtual void commitTableEvent( sal_Int16 nEventId,
 const css::uno::Any& rNewValue, const css::uno::Any& rOldValue ) 
override
 {
-AccessibleBrowseBox* pContext( getContext() );
-if ( pContext )
-pContext->commitTableEvent( nEventId, rNewValue, rOldValue );
+if (m_xContext)
+m_xContext->commitTableEvent( nEventId, rNewValue, rOldValue );
 }
 virtual void commitEvent( sal_Int16 nEventId,
 const css::uno::Any& rNewValue, const css::uno::Any& rOldValue ) 
override
 {
-AccessibleBrowseBox* pContext( getContext() );
-if ( pContext )
-pContext->commitEvent( nEventId, rNewValue, rOldValue );
+if (m_xContext)
+m_xContext->commitEvent( nEventId, rNewValue, rOldValue );
 }
 
 private:
commit e98b65e47182dba766bb7e3b2cd26e90da89fb93
Author: Christian Lohmaier 
AuthorDate: Fri Oct 4 17:06:42 2024 +0200
Commit: Gerrit Code Review 
CommitDate: Fri Oct 4 17:06:42 2024 +0200

Update git submodules

* Update translations from branch 'master'
  to d5e786eb569095ac348028ca7878e44bc4543dc1
  - update translations for master

and force-fix errors using pocheck

Change-Id: Ic61d23eabfdbe3635267c095d71fc71cd0a455fe

diff --git a/translations b/translations
index 42ecd2971a60..d5e786eb5690 16
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit 42ecd2971a60e08485dbafbace2f2ed7245cd48c
+Subproject commit d5e786eb569095ac348028ca7878e44bc4543dc1


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

2024-10-04 Thread Caolán McNamara (via logerrit)
 sw/source/core/access/AccessibilityCheck.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit e66f6f7765ba7855df65deea94ecb0aaefc8488a
Author: Caolán McNamara 
AuthorDate: Thu Oct 3 15:14:05 2024 +0100
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 09:29:40 2024 +0200

check for null DocShell before deref

an effort to fix:

https://crashreport.libreoffice.org/stats/signature/static%20void%20sw::%60anonymous%20namespace'::TextFormattingCheck::check(class%20SwNode%20*)

Change-Id: I5adb0a1c244ec3372bd58e5a5493cbce80684ae1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174425
Reviewed-by: Xisco Fauli 
Tested-by: Jenkins
(cherry picked from commit c5f4fe10589acff4d253cc3d32acaf67c7456bd7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/17

diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index ff7a6b1b2d3c..df4a710ecf9c 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -1348,7 +1348,12 @@ public:
 return;
 
 SwTextNode* pTextNode = pCurrent->GetTextNode();
-SwWrtShell* pWrtShell = 
pTextNode->GetDoc().GetDocShell()->GetWrtShell();
+
+SwDocShell* pDocShell = pTextNode->GetDoc().GetDocShell();
+if (!pDocShell)
+return;
+
+SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
 if (pWrtShell && !pTextNode->getLayoutFrame(pWrtShell->GetLayout()))
 return;
 


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

2024-10-04 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/ooxmlexport/data/too_many_styles.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport18.cxx|7 +++
 sw/source/filter/ww8/docxattributeoutput.cxx  |2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 14b24b022d004def4d33920461cbf2fa1d906611
Author: Mike Kaganski 
AuthorDate: Tue Aug 6 17:32:55 2024 +0500
Commit: Miklos Vajna 
CommitDate: Fri Oct 4 15:57:41 2024 +0200

tdf#162370: check if nNext is valid, too

0xfff is a special value for a style slot on MS formats export: see
MSWordStyles::GetSlot and BuildGetSlot. The slot in nNext must be
checked the same way as nBase and nLink around it.

Change-Id: I94836bc3f624eb99655e005217707e0ea7210c8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171547
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171562
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 5797d70b10fff42b7ae0b94cd3b25e75139f7be4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174483

diff --git a/sw/qa/extras/ooxmlexport/data/too_many_styles.odt 
b/sw/qa/extras/ooxmlexport/data/too_many_styles.odt
new file mode 100644
index ..c3260792eee7
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/too_many_styles.odt 
differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index 7541d831c6ed..9e9589dcab42 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -841,6 +841,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf158971)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf162370)
+{
+// This must not crash on save; without the fix, it would fail with
+// "Assertion failed: vector subscript out of range"
+loadAndSave("too_many_styles.odt");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 1ae2a8ae6071..86ec8a634b7b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6664,7 +6664,7 @@ void DocxAttributeOutput::StartStyle( const OUString& 
rName, StyleType eType,
 FSNS( XML_w, XML_val ), m_rExport.m_pStyles->GetStyleId(nBase) 
);
 }
 
-if ( nNext != nSlot && eType != STYLE_TYPE_LIST)
+if (nNext != nSlot && nNext != 0x0FFF && eType != STYLE_TYPE_LIST)
 {
 m_pSerializer->singleElementNS( XML_w, XML_next,
 FSNS( XML_w, XML_val ), m_rExport.m_pStyles->GetStyleId(nNext) 
);


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

2024-10-04 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/eehtml.cxx |   28 
 editeng/source/editeng/eehtml.hxx |1 +
 2 files changed, 17 insertions(+), 12 deletions(-)

New commits:
commit d6b5d08041b68946f655524c43360f12a72c7185
Author: Caolán McNamara 
AuthorDate: Wed Oct 2 13:25:09 2024 +0100
Commit: Miklos Vajna 
CommitDate: Fri Oct 4 09:07:01 2024 +0200

Split out this html parsing hunk as a separate NewLine method

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

diff --git a/editeng/source/editeng/eehtml.cxx 
b/editeng/source/editeng/eehtml.cxx
index b3ed28395506..3db92d077694 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -95,6 +95,14 @@ SvParserState EditHTMLParser::CallParser(EditEngine* pEE, 
const EditPaM& rPaM)
 return _eState;
 }
 
+void EditHTMLParser::Newline()
+{
+bool bHasText = HasTextInCurrentPara();
+if ( bHasText )
+ImpInsertParaBreak();
+StartPara( false );
+}
+
 void EditHTMLParser::NextToken( HtmlTokenId nToken )
 {
 switch( nToken )
@@ -280,7 +288,8 @@ void EditHTMLParser::NextToken( HtmlTokenId nToken )
 case HtmlTokenId::TABLEHEADER_ON:
 case HtmlTokenId::TABLEDATA_ON:
 nInCell++;
-[[fallthrough]];
+Newline();
+break;
 case HtmlTokenId::BLOCKQUOTE_ON:
 case HtmlTokenId::BLOCKQUOTE_OFF:
 case HtmlTokenId::BLOCKQUOTE30_ON:
@@ -291,28 +300,23 @@ void EditHTMLParser::NextToken( HtmlTokenId nToken )
 case HtmlTokenId::DT_ON:
 case HtmlTokenId::ORDERLIST_ON:
 case HtmlTokenId::UNORDERLIST_ON:
-{
-bool bHasText = HasTextInCurrentPara();
-if ( bHasText )
-ImpInsertParaBreak();
-StartPara( false );
-}
+Newline();
 break;
 
 case HtmlTokenId::TABLEHEADER_OFF:
 case HtmlTokenId::TABLEDATA_OFF:
-{
 if ( nInCell )
 nInCell--;
-[[fallthrough]];
-}
+EndPara();
+break;
 case HtmlTokenId::LISTHEADER_OFF:
 case HtmlTokenId::LI_OFF:
 case HtmlTokenId::DD_OFF:
 case HtmlTokenId::DT_OFF:
 case HtmlTokenId::ORDERLIST_OFF:
-case HtmlTokenId::UNORDERLIST_OFF:  EndPara();
-break;
+case HtmlTokenId::UNORDERLIST_OFF:
+EndPara();
+break;
 
 case HtmlTokenId::TABLEROW_ON:
 case HtmlTokenId::TABLEROW_OFF: // A RETURN only after a CELL, for Calc
diff --git a/editeng/source/editeng/eehtml.hxx 
b/editeng/source/editeng/eehtml.hxx
index fddd567ac6ba..9f8009c715c8 100644
--- a/editeng/source/editeng/eehtml.hxx
+++ b/editeng/source/editeng/eehtml.hxx
@@ -53,6 +53,7 @@ private:
 sal_uInt8   nDefListLevel;
 
 voidStartPara( bool bReal );
+voidNewline();
 voidEndPara();
 voidAnchorStart();
 voidAnchorEnd();


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

2024-10-04 Thread Justin Luth (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx   |4 ++--
 writerfilter/source/dmapper/StyleSheetTable.cxx |   20 
 2 files changed, 10 insertions(+), 14 deletions(-)

New commits:
commit 6b05df5ec009f28263873bc215f4bea73c912ea5
Author: Justin Luth 
AuthorDate: Wed Sep 11 14:07:39 2024 -0400
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 09:25:39 2024 +0200

related tdf#162884 writerfilter: map to built-in Internet link, etc.

This partial revert fixes a 24.2.4 regression from
commit 72ea1005b987159a6a59f9379e63321e0b0dd44f
Author: Michael Stahl on Mon May 6 15:58:36 2024 +0200
tdf#160402 writerfilter: extend StyleMap with all Word styles

By using the English localization name,
the style was imported, used, and exported as English
instead of being mapped to the built-in style
whose name depends on the UI language in use.
So, revert back to using the internal version of the style names.

For English -> Dutch, that means that
Internet Link -> (MS Word's) Hyperlink -> Internetkoppeling
instead of remaining as the English "Internet Link"

For non-English UIs, the Internet Link character style
was duplicating on each file save (or perhaps each language switch).

I didn't notice the endless duplication for the other styles,
because they aren't used very much,
and are only written if used.
At worst, each localized versions was written once.

Change-Id: Icf58d7d716ac40f05f170c31787d8a8a9942868e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173230
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174280
Reviewed-by: Michael Stahl 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174351
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index a91723b4f6d5..c801d0477fe5 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -687,8 +687,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112352_nextPageColumns, 
"tdf112352_nextPageColum
 CPPUNIT_TEST_FIXTURE(Test, testTdf109310_endnoteStyleForMSO)
 {
 loadAndSave("tdf109310_endnoteStyleForMSO.docx");
-xmlDocUniquePtr pXmlDoc = parseExport("word/endnotes.xml");
-// Check w:rStyle element has w:val attribute - note that w: is not 
specified for attribute
+xmlDocUniquePtr pXmlDoc = parseExport(u"word/endnotes.xml"_ustr);
+// It is important that EndnoteCharacters exists, and is not duplicated on 
each round-trip
 assertXPath(pXmlDoc, 
"/w:endnotes/w:endnote[@w:id='2']/w:p/w:r[1]/w:rPr/w:rStyle"_ostr, "val"_ostr,
 u"EndnoteCharacters"_ustr);
 }
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index f4cbd6d688f9..6004af2132c9 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1571,8 +1571,6 @@ StyleSheetTable::ConvertStyleName(const OUString& rWWName)
 // These are from the w:latentStyles in the styles.xml of a Word 15.0 DOCX,
 // plus some pre-existing additions and variants.
 static const std::map< OUString, OUString> StyleNameMap {
-//FIXME: testFdo77716, testTdf129575_docDefault etc. fail with correct 
mapping
-//{ "Normal", "Default Paragraph Style" }, // RES_POOLCOLL_STANDARD
 { "Normal", "Standard" }, // RES_POOLCOLL_STANDARD
 { "heading 1", "Heading 1" }, // RES_POOLCOLL_HEADLINE1
 { "heading 2", "Heading 2" }, // RES_POOLCOLL_HEADLINE2
@@ -1660,8 +1658,8 @@ StyleSheetTable::ConvertStyleName(const OUString& rWWName)
 { "Footnote Reference", "Footnote Symbol" }, // RES_POOLCHR_FOOTNOTE; 
tdf#82173 tdf#162884
 { "Annotation Reference", "" },
 { "annotation reference", "" },
-{ "Line Number", "Line Numbering" }, // RES_POOLCHR_LINENUM
-{ "line number", "Line Numbering" }, // RES_POOLCHR_LINENUM
+{ "Line Number", "Line numbering" }, // RES_POOLCHR_LINENUM
+{ "line number", "Line numbering" }, // RES_POOLCHR_LINENUM
 { "Page Number", "Page Number" }, // RES_POOLCHR_PAGENO
 { "page number", "Page Number" }, // RES_POOLCHR_PAGENO
 { "PageNumber", "Page Number" }, // RES_POOLCHR_PAGENO
@@ -1694,13 +1692,11 @@ StyleSheetTable::ConvertStyleName(const OUString& 
rWWName)
 { "Signature", "Signature" }, // RES_POOLCOLL_SIGNATURE
 { "Default Paragraph Font", "" },
 { "DefaultParagraphFont", "" },
-//FIXME: testTdf118947_tableStyle fails with correct mapping
-//{ "Body Text", "Body Text" }, // RES_POOLCOLL_TEXT
 { "Body Text", "Text body" }, // RES_POOLCOLL_TEXT
-{ "BodyText", "Body Text" }, // RES_POOLCOLL_TEXT
+{ "BodyText", "Text body" }, // RES_POOLCOLL_TEXT
 { "BodyTextIndentIta

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

2024-10-04 Thread László Németh (via logerrit)
 sw/qa/extras/layout/data/tdf161810.fodt |  204 
 sw/qa/extras/layout/layout3.cxx |   35 +
 sw/source/core/text/itradj.cxx  |   11 -
 3 files changed, 243 insertions(+), 7 deletions(-)

New commits:
commit 4bad9220b911f1624520ff2719571bc3acf99c00
Author: László Németh 
AuthorDate: Mon Sep 16 13:36:41 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 09:27:01 2024 +0200

tdf#161810 sw smart justify: fix overhanging lines containing tabs

Length of tabulator portions wasn't taken into account
during calculating overhanging lines, resulting missing
space shrinking.

Regression from commit 17eaebee279772b6062ae3448012133897fc71bb
"tdf#119908 sw smart justify: fix justification by shrinking".

Change-Id: I34bb007940b91e861b24413e76c910ee62aed158
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173451
Reviewed-by: László Németh 
Tested-by: Jenkins
(cherry picked from commit 857dd6000c877f2c6d8bb73806a8557fa0baea73)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173486
Reviewed-by: Xisco Fauli 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173649

diff --git a/sw/qa/extras/layout/data/tdf161810.fodt 
b/sw/qa/extras/layout/data/tdf161810.fodt
new file mode 100644
index ..5233d8c68335
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf161810.fodt
@@ -0,0 +1,204 @@
+
+
+http://www.w3.org/TR/css3-text/"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:c
 alcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:
 meta:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ 
+  
+   0
+   0
+   27481
+   16293
+   true
+   false
+   
+
+ view2
+ 5039
+ 2300
+ 0
+ 0
+ 27480
+ 16291
+ 0
+ 1
+ false
+ 140
+ false
+ false
+ false
+ false
+ false
+ false
+
+   
+  
+  
+   false
+   true
+   true
+   
+   false
+   0
+   false
+   true
+   false
+   true
+   false
+   true
+   0
+   true
+   false
+   false
+   false
+   true
+   false
+   true
+   false
+   false
+   false
+   false
+   true
+   true
+   false
+   false
+   false
+   false
+   false
+   false
+   false
+   true
+   false
+   false
+   false
+   false
+   false
+   false
+   high-resolution
+   true
+   2040775
+   false
+   false
+   false
+   
+   
+   true
+   
+   false
+   false
+   false
+   true
+   true
+   true
+   false
+   0
+   true
+   false
+   true
+   false
+   true
+   false
+   false
+   true
+   true
+   false
+   false
+   false
+   false
+   true
+   true
+   true
+   
+   false
+   false
+   true
+   0
+   false
+   true
+   
+   false
+   false
+   true
+   true
+   false
+   false
+   false
+   1
+   true
+   true
+   true
+   false
+   false
+   true
+   false
+   false
+   true
+   false
+   true
+   false
+   false
+   
+   true
+   2157109
+   true
+   false
+   false
+   true
+  
+ 
+ 
+  
+  
+ 
+ 
+  
+   
+   
+  

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

2024-10-04 Thread Justin Luth (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport12.cxx|6 +-
 sw/qa/extras/ww8export/ww8export3.cxx |   12 ++--
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   13 -
 3 files changed, 11 insertions(+), 20 deletions(-)

New commits:
commit 1a4baa7d2907a9a3317b25762cbe11ae27389fea
Author: Justin Luth 
AuthorDate: Fri Sep 27 17:03:53 2024 -0400
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 09:25:03 2024 +0200

tdf#163154 revert "tdf120224 writerfilter: consume excess bookmark

... from fields"

The intention of my 6.2 commit 579c0749bef8c980507229439715e72060c1b077
hack was to avoid importing duplicate LO-exported bookmarks.
(LO exported the bookmarks inside the field definition,
while MS normally has the bookmarks outside the field.)

So the impact of this revert should be neglible,
affecting mainly documents that LO round-tripped before 6.2
which would just import one more "Copy" of a bookmark.

The reason for doing the revert is also not terribly important.
For a few odd documents that otherwise wouldn't import a bookmark
around a field, it will allow the LO navigator a way to quickly
jump to the field (since Legacy Fields are not included
in the Navigator's field list).

Note that what I am reverting was a HACK any way.
It did a pretty good job of only ignoring LO-exported bookmarks,
since MS Word usually puts the bookmark around the OUTSIDE
of the field, while LO always puts the bookmark
inside the field definition (and thus IsOpenField())

make CppunitTest_sw_ww8export3 \
CPPUNIT_TEST_NAME=testTdf79435_legacyInputFields

make CppunitTest_sw_ooxmlexport12 \
CPPUNIT_TEST_NAME=testTdf120224_textControlCrossRef

Change-Id: Iefaf1173794c66b2a6f3e5c2143ed594de7efe35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174081
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 7f84c993d3d2b5f05b18e740fea960901da57f80)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174020
Reviewed-by: Michael Stahl 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174309

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index c77936a8d66c..aff6a689a9dd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -800,6 +800,10 @@ 
DECLARE_OOXMLEXPORT_TEST(testTdf120224_textControlCrossRef, "tdf120224_textContr
 xRunEnum->nextElement(); //Text
 uno::Reference xPropertySet(xRunEnum->nextElement(), 
uno::UNO_QUERY);
 
+CPPUNIT_ASSERT_EQUAL(OUString("Bookmark"),
+ getProperty(xPropertySet, 
"TextPortionType"));
+
+xPropertySet.set(xRunEnum->nextElement(), uno::UNO_QUERY);
 CPPUNIT_ASSERT_EQUAL(OUString("TextFieldStart"),
  getProperty(xPropertySet, 
"TextPortionType"));
 uno::Reference xBookmark(
@@ -819,7 +823,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf120224_textControlCrossRef, 
"tdf120224_textContr
 uno::Reference 
xBookmarksByIdx(xBookmarksSupplier->getBookmarks(),
 uno::UNO_QUERY);
 // TextFields should not be turned into real bookmarks.
-CPPUNIT_ASSERT_EQUAL(static_cast(1), 
xBookmarksByIdx->getCount());
+CPPUNIT_ASSERT_EQUAL(static_cast(2), 
xBookmarksByIdx->getCount());
 
 // The actual name isn't critical, but if it fails, it is worth asking why.
 CPPUNIT_ASSERT_EQUAL(OUString("Text1"), sTextFieldName);
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx 
b/sw/qa/extras/ww8export/ww8export3.cxx
index 97ea979d01e8..34bc542da52c 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -415,7 +415,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf79435_legacyInputFields)
 {
 loadAndReload("tdf79435_legacyInputFields.docx");
 //using .docx input file to verify cross-format compatibility.
-uno::Reference xFormField = getProperty< 
uno::Reference >(getRun(getParagraph(5), 3), "Bookmark");
+uno::Reference xFormField = getProperty< 
uno::Reference >(getRun(getParagraph(5), 4), "Bookmark");
 uno::Reference 
xParameters(xFormField->getParameters());
 
 OUString sTmp;
@@ -439,27 +439,27 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf79435_legacyInputFields)
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Max Length", sal_uInt16(10), nMaxLength);
 
 // too bad this is based on character runs - just found try trial and 
error.
-xFormField = getProperty< uno::Reference 
>(getRun(getParagraph(6), 2), "Bookmark");
+xFormField = getProperty< uno::Reference 
>(getRun(getParagraph(6), 3), "Bookmark");
 xParameters.set(xFormField->getParameters());
 xParameters->getByName("Type") >>= sTmp;
 CPPUNIT_ASSERT_EQUAL(OUString("calculated"), sTmp);
 
-xFormField = getProperty< u

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

2024-10-04 Thread Justin Luth (via logerrit)
 sc/source/ui/app/inputhdl.cxx |   12 
 1 file changed, 12 deletions(-)

New commits:
commit be818a6d53f9b5dfa0d23b807463b1c00d67800d
Author: Justin Luth 
AuthorDate: Wed Oct 2 12:15:31 2024 -0400
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 09:24:52 2024 +0200

tdf#159690 tdf#159938 Revert "tdf#158252 sc: Enable text wrapping...

... when inputting line breaks in cell"

This reverts 24.2 commit 17e362e56f9e15d0214c441e632c91d22e58519d
because it was made as a regression fix
for a commit that I just reverted,
AS WELL AS having several (duplicate) regression bugs of its own.

Duplicate Bug 163150 is a good example of why a linefeed shouldn't
automatically imply wrap text - it specified "fit to cell size".

Duplicate Bug 159834 complains about this happening on drag/drop.

Change-Id: Iad5fb87f9ab71230221c402a84ca682dba0ed004
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174402
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit 55a8fce5d76bba0657ed76c85439fac8d1d00c8d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174339
Reviewed-by: Xisco Fauli 
(cherry picked from commit c1d2902b64dc02026f7842a43e540283b67df13d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174445

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 519ebea36b8d..3144f31995a3 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -47,7 +47,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -3143,17 +3142,6 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode, bool bBeforeSavingInL
 lcl_RemoveTabs(aString);
 lcl_RemoveTabs(aPreAutoCorrectString);
 
-if (bModified && aString.indexOf('
') != -1)
-{
-// Cell contains line breaks, enable wrapping
-ScLineBreakCell aBreakItem(true);
-pActiveViewSh->ApplyAttr(aBreakItem);
-
-SfxViewFrame* pViewFrm = SfxViewFrame::Current();
-if (pViewFrm)
-pViewFrm->GetBindings().Invalidate(SID_ATTR_ALIGN_LINEBREAK);
-}
-
 // Test if valid (always with simple string)
 if (bModified && nValidation)
 {


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

2024-10-04 Thread Gökay Şatır (via logerrit)
 sc/source/ui/unoobj/docuno.cxx |   29 +++--
 1 file changed, 19 insertions(+), 10 deletions(-)

New commits:
commit 7ea2394e7b4370186c58001549a51acb58c7e49f
Author: Gökay Şatır 
AuthorDate: Thu Oct 3 12:12:27 2024 +0300
Commit: Miklos Vajna 
CommitDate: Fri Oct 4 09:24:42 2024 +0200

cool#7406: Refactor Calc->getPartInfo & use JsonWriter.

Indeed this seems unrelated to the task. But grid in Impress requires to 
add new properties to "getPartInfo (impress)".
When i checked the code, i saw that we use getPartInfo's result (on server 
side) like it's a text instead of JSON. So we'll refactor that part.
Touching that part requires also touching some other shared functions on 
COOL side. And those changes also required adding new props here.

We have been fetching this data (without adding new properties) one by one. 
We now will be able to fetch the whole part's data at once.

This commit also uses JsonWriter class.

Signed-off-by: Gökay Şatır 
Change-Id: Icc26ae71c668c391218e2d517259e1ef32a0832f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174433
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index eee0f203b73a..cc3ea8d9cab9 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -648,16 +648,25 @@ OUString ScModelObj::getPartInfo( int nPart )
 const bool bIsSelected = false; 
//pViewData->GetDocument()->IsSelected(nPart);
 const bool bIsRTLLayout = pViewData->GetDocument().IsLayoutRTL(nPart);
 
-OUString aPartInfo = "{ \"visible\": \"" +
-OUString::number(static_cast(bIsVisible)) +
-"\", \"selected\": \"" +
-OUString::number(static_cast(bIsSelected)) +
-"\", \"rtllayout\": \"" +
-OUString::number(static_cast(bIsRTLLayout)) +
-"\", \"protected\": \"" +
-OUString::number(static_cast(bIsProtected)) +
-"\" }";
-return aPartInfo;
+::tools::JsonWriter jsonWriter;
+jsonWriter.put("visible", static_cast(bIsVisible));
+jsonWriter.put("rtllayout", static_cast(bIsRTLLayout));
+jsonWriter.put("protected", static_cast(bIsProtected));
+jsonWriter.put("selected", static_cast(bIsSelected));
+
+OUString tabName;
+pViewData->GetDocument().GetName(nPart, tabName);
+jsonWriter.put("name", tabName);
+
+sal_Int64 hashCode;
+pViewData->GetDocument().GetHashCode(nPart, hashCode);
+jsonWriter.put("hash", hashCode);
+
+Size lastColRow = getDataArea(nPart);
+jsonWriter.put("lastcolumn", lastColRow.getWidth());
+jsonWriter.put("lastrow", lastColRow.getHeight());
+
+return OStringToOUString(jsonWriter.finishAndGetAsOString(), 
RTL_TEXTENCODING_UTF8);
 }
 
 OUString ScModelObj::getPartName( int nPart )


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

2024-10-04 Thread László Németh (via logerrit)
 sw/qa/extras/layout/data/tdf163060.fodt |  205 
 sw/qa/extras/layout/layout3.cxx |   26 
 sw/source/core/text/guess.cxx   |4 
 sw/source/core/text/inftxt.cxx  |8 -
 sw/source/core/text/inftxt.hxx  |5 
 sw/source/core/text/itrform2.cxx|1 
 sw/source/core/text/portxt.cxx  |2 
 7 files changed, 247 insertions(+), 4 deletions(-)

New commits:
commit 654f913f567db163c06e7388b59b3844fe81a11a
Author: László Németh 
AuthorDate: Wed Sep 25 22:45:05 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 09:32:10 2024 +0200

tdf#163060 sw smart justify: fix unwanted line break inside words

End-of-line narrow line portion was broken into the
following line, despite that it was inside a word,
if the remaining free space for the line portion
was negative in the line (GetLineWidth()), because
of missing calculation with the extra available
line width resulted by space shrinking.

Regression from commit 53de98b29548ded88e0a44c80256fc5e340d551e
"tdf#158333 sw smart justify: fix multiple text portions".

Change-Id: I802b8469c82250be7ac6f3a73a4dc457deb72a19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173961
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit 7a78be5090d2dabf03e18471ba718f2c4f25f740)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173919
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/layout/data/tdf163060.fodt 
b/sw/qa/extras/layout/data/tdf163060.fodt
new file mode 100644
index ..a5f7291e09a5
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf163060.fodt
@@ -0,0 +1,205 @@
+
+
+http://www.w3.org/TR/css3-text/"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:c
 alcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:
 meta:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ 
+  
+   0
+   0
+   27481
+   16293
+   true
+   false
+   
+
+ view2
+ 21758
+ 2300
+ 0
+ 0
+ 27480
+ 16291
+ 0
+ 1
+ false
+ 140
+ false
+ false
+ false
+ false
+ false
+ false
+
+   
+  
+  
+   false
+   true
+   true
+   
+   false
+   0
+   false
+   true
+   false
+   true
+   false
+   false
+   true
+   0
+   true
+   false
+   false
+   false
+   true
+   false
+   true
+   false
+   false
+   false
+   false
+   true
+   true
+   false
+   false
+   false
+   false
+   false
+   false
+   false
+   true
+   false
+   false
+   false
+   false
+   false
+   false
+   high-resolution
+   true
+   2040775
+   false
+   false
+   false
+   
+   
+   true
+   
+   false
+   false
+   false
+   true
+   true
+   true
+   false
+   0
+   true
+   false
+   true
+   false
+   true
+   false
+   false
+   true
+   true
+   false
+   false
+   false
+   false
+   true
+   true
+   true
+   
+   false
+   false
+   true
+   0
+   false
+   true
+   
+   false
+   false
+  

Tea Time Training, week 40

2024-10-04 Thread Miklos Vajna
Hi,

Collabora runs a Tea Time Training (TTT) on Fridays. The topics are
typically focused around LibreOffice Technology and Collabora Online.

These are developer-centric calls & opportunity to ask questions to the
experts right there.

The session today is at 13:00 CEST.

Topic: Drawings and SdrObjects by Tomaž Vajngerl

Duration: 15-45 minutes

Join via this link: https://meet.jit.si/Fri-TTT-CPTEAM

More info about TTTs in general: 
https://collaboraonline.github.io/post/communicate/#tea-time-trainings

Regards,

Miklos


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

2024-10-04 Thread Caolán McNamara (via logerrit)
 include/svx/svxids.hrc   |4 +++-
 svx/sdi/svx.sdi  |   10 --
 sw/inc/AnnotationWin.hxx |3 ++-
 sw/sdi/swriter.sdi   |9 +++--
 sw/source/uibase/docvw/AnnotationWin.cxx |   10 ++
 sw/source/uibase/shells/textfld.cxx  |   16 ++--
 6 files changed, 40 insertions(+), 12 deletions(-)

New commits:
commit b4e424adbfdd5c4e18240ddec1405690e8718d2b
Author: Caolán McNamara 
AuthorDate: Tue Oct 1 20:27:19 2024 +0100
Commit: Miklos Vajna 
CommitDate: Fri Oct 4 09:35:49 2024 +0200

support setting writer comment contents from simple-html

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

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 7cc55ac02813..0a2bc143210a 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -1058,8 +1058,10 @@ class XFillGradientItem;
 #define SID_CHAR_DLG_FOR_PARAGRAPH  ( SID_SVX_START + 1210 
)
 #define SID_SET_DOCUMENT_LANGUAGE   
TypedWhichId( SID_SVX_START + 1211 )
 
+#define SID_ATTR_POSTIT_HTML
TypedWhichId( SID_SVX_START + 1212 )
+
 // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE   ( SID_SVX_START + 1211 
+ 1 )
+#define SID_SVX_FIRSTFREE   ( SID_SVX_START + 1212 
+ 1 )
 
 
 // Overflow check for slot IDs
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index bab0601c2f28..7bb020e0149c 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -4684,7 +4684,10 @@ SfxVoidItem InPlaceObjectResize SID_OBJECTRESIZE
 
 
 SfxVoidItem InsertAnnotation SID_INSERT_POSTIT
-(SvxPostItAuthorItem Author SID_ATTR_POSTIT_AUTHOR,SvxPostItDateItem Date 
SID_ATTR_POSTIT_DATE,SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT)
+(SvxPostItAuthorItem Author SID_ATTR_POSTIT_AUTHOR,
+ SvxPostItDateItem Date SID_ATTR_POSTIT_DATE,
+ SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT,
+ SvxPostItTextItem Html SID_ATTR_POSTIT_HTML)
 [
 AutoUpdate = FALSE,
 FastCall = FALSE,
@@ -4705,6 +4708,7 @@ SfxVoidItem EditAnnotation SID_EDIT_POSTIT
  SvxPostItAuthorItem Author SID_ATTR_POSTIT_AUTHOR,
  SvxPostItDateItem Date SID_ATTR_POSTIT_DATE,
  SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT,
+ SvxPostItTextItem Html SID_ATTR_POSTIT_HTML,
  SfxInt32Item PositionX SID_ATTR_POSTIT_POSITION_X
  SfxInt32Item PositionY SID_ATTR_POSTIT_POSITION_Y)
 [
@@ -4758,7 +4762,9 @@ SfxVoidItem ShowResolvedAnnotations 
SID_TOGGLE_RESOLVED_NOTES
 
 
 SfxVoidItem ReplyToAnnotation SID_REPLYTO_POSTIT
-(SvxPostItIdItem Id SID_ATTR_POSTIT_ID,SvxPostItTextItem Text 
SID_ATTR_POSTIT_TEXT)
+(SvxPostItIdItem Id SID_ATTR_POSTIT_ID,
+ SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT,
+ SvxPostItTextItem Html SID_ATTR_POSTIT_HTML)
 [
 AutoUpdate = FALSE,
 FastCall = FALSE,
diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index aee382e51a82..235a1a70b587 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -71,7 +71,8 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public 
InterimItemWindow
 voidDelete();
 voidGotoPos();
 const SwPostItField* GetPostItField() const { return mpField; }
-void UpdateText(const OUString& aText);
+void UpdateText(const OUString& rText);
+void UpdateHTML(const OUString& rHtml);
 
 OUString GetAuthor() const;
 Date GetDate() const;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 77ef4f2e3332..0068641cb3b6 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -2519,7 +2519,10 @@ SfxVoidItem IndexMarkToIndex FN_IDX_MARK_TO_IDX
 ]
 
 SfxVoidItem InsertAnnotation FN_POSTIT
-(SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT,SvxPostItAuthorItem Author 
SID_ATTR_POSTIT_AUTHOR,SvxPostItDateItem Date SID_ATTR_POSTIT_DATE)
+(SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT,
+ SvxPostItTextItem Html SID_ATTR_POSTIT_HTML,
+ SvxPostItAuthorItem Author SID_ATTR_POSTIT_AUTHOR,
+ SvxPostItDateItem Date SID_ATTR_POSTIT_DATE)
 [
 AutoUpdate = FALSE,
 FastCall = FALSE,
@@ -7702,7 +7705,9 @@ SfxBoolItem SelectionModeDefault FN_SELECTION_MODE_DEFAULT
 ]
 
 SfxVoidItem ReplyComment FN_REPLY
-(SvxPostItIdItem Id SID_ATTR_POSTIT_ID,SvxPostItTextItem Text 
SID_ATTR_POSTIT_TEXT)
+(SvxPostItIdItem Id SID_ATTR_POSTIT_ID,
+ SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT,
+ SvxPostItTextItem Html SID_ATTR_POSTIT_HTML)
 [
 AutoUpdate = FALSE,
 FastCall = FALSE,
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx 
b/sw/source/uibase/docvw/AnnotationWin.cxx
index 75569fcd5cf3..41e5bac03dc5 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -484,6 +484,16 @@ void SwAnnotationWin::UpdateText(const OUString& 

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

2024-10-04 Thread Darshan-upadhyay1110 (via logerrit)
 sw/source/ui/index/cnttab.cxx   |   37 +++-
 sw/source/uibase/inc/swuicnttab.hxx |5 ++--
 2 files changed, 27 insertions(+), 15 deletions(-)

New commits:
commit dbb054045fae8605794c17aae052a9d588fe33fc
Author: Darshan-upadhyay1110 
AuthorDate: Thu Oct 3 18:31:22 2024 +0530
Commit: Szymon Kłos 
CommitDate: Fri Oct 4 10:56:58 2024 +0200

Refactor focus handling in `LevelHdl` and `SwTokenWindow`

- Added a new `LevelHdlImpl` method with a `bool bGrabFocus` argument.
- Refactored `LevelHdl` to call `LevelHdlImpl` with `true`.
- Adjusted `SwTokenWindow::SetActiveControl` and `SwTokenWindow::SetForm` 
to skip `GrabFocus` when the argument is `false`.
- Ensured focus behavior remains unchanged except for the initial 
"ActivatePage".

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

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 535dc298dd5a..287c117a217c 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -2263,7 +2263,7 @@ void SwTOXEntryTabPage::ActivatePage( const SfxItemSet& 
/*rSet*/)
 
 //invalidate PatternWindow
 m_xTokenWIN->SetInvalid();
-LevelHdl(*m_xLevelLB);
+LevelHdlImpl(*m_xLevelLB, false);
 }
 
 void SwTOXEntryTabPage::UpdateDescriptor()
@@ -2437,20 +2437,21 @@ void SwTOXEntryTabPage::WriteBackLevel()
 }
 }
 
-IMPL_LINK(SwTOXEntryTabPage, LevelHdl, weld::TreeView&, rBox, void)
+void SwTOXEntryTabPage::LevelHdlImpl(weld::TreeView& rBox, bool bGrabFocus)
 {
-if(m_bInLevelHdl)
+if (m_bInLevelHdl)
 return;
 m_bInLevelHdl = true;
 WriteBackLevel();
 
 const sal_uInt16 nLevel = rBox.get_selected_index();
-m_xTokenWIN->SetForm(*m_pCurrentForm, nLevel);
+m_xTokenWIN->SetForm(*m_pCurrentForm, nLevel, bGrabFocus);
+
 if(TOX_AUTHORITIES == m_pCurrentForm->GetTOXType())
 {
 //fill the types in
 m_xAuthFieldsLB->clear();
-for( sal_uInt32 i = 0; i < AUTH_FIELD_END; i++)
+for(sal_uInt32 i = 0; i < AUTH_FIELD_END; i++)
 {
 m_xAuthFieldsLB->append(OUString::number(i), 
SwResId(STR_AUTH_FIELD_ARY[i]));
 }
@@ -2471,9 +2472,19 @@ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, weld::TreeView&, 
rBox, void)
 m_xAuthFieldsLB->set_active(0);
 }
 m_bInLevelHdl = false;
-rBox.grab_focus();
+
+if (bGrabFocus)
+{
+rBox.grab_focus();
+}
 }
 
+IMPL_LINK(SwTOXEntryTabPage, LevelHdl, weld::TreeView&, rBox, void)
+{
+LevelHdlImpl(rBox, true);
+}
+
+
 IMPL_LINK_NOARG(SwTOXEntryTabPage, SortKeyHdl, weld::Toggleable&, void)
 {
 bool bEnable = m_xSortContentRB->get_active();
@@ -2792,9 +2803,9 @@ SwTokenWindow::~SwTokenWindow()
 {
 }
 
-void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)
+void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL, bool bGrabFocus)
 {
-SetActiveControl(nullptr);
+SetActiveControl(nullptr, bGrabFocus);
 m_bValid = true;
 
 if (m_pForm)
@@ -2821,7 +2832,7 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)
 SwTOXWidget* pCtrl = InsertItem(aToken.sText, aToken);
 bLastWasText = true;
 if (!GetActiveControl())
-SetActiveControl(pCtrl);
+SetActiveControl(pCtrl, bGrabFocus);
 }
 else
 {
@@ -2859,12 +2870,12 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 
nL)
 if(!pSetActiveControl)
 pSetActiveControl = pCtrl;
 }
-SetActiveControl(pSetActiveControl);
+SetActiveControl(pSetActiveControl, bGrabFocus);
 }
 AdjustScrolling();
 }
 
-void SwTokenWindow::SetActiveControl(SwTOXWidget* pSet)
+void SwTokenWindow::SetActiveControl(SwTOXWidget* pSet, bool bGrabFocus)
 {
 if (pSet == m_pActiveCtrl)
 return;
@@ -2872,8 +2883,8 @@ void SwTokenWindow::SetActiveControl(SwTOXWidget* pSet)
 m_pActiveCtrl = pSet;
 if( !m_pActiveCtrl )
 return;
-
-m_pActiveCtrl->GrabFocus();
+if (bGrabFocus)
+m_pActiveCtrl->GrabFocus();
 //it must be a SwTOXEdit
 const SwFormToken* pFToken;
 if( WindowType::EDIT == m_pActiveCtrl->GetType() )
diff --git a/sw/source/uibase/inc/swuicnttab.hxx 
b/sw/source/uibase/inc/swuicnttab.hxx
index 103f65e7cb93..8dfb3da9b6a7 100644
--- a/sw/source/uibase/inc/swuicnttab.hxx
+++ b/sw/source/uibase/inc/swuicnttab.hxx
@@ -261,7 +261,7 @@ class SwTokenWindow
 DECL_LINK(ScrollHdl, weld::ScrolledWindow&, void);
 DECL_LINK(AdjustPositionsHdl, const Size&, void);
 
-voidSetActiveControl(SwTOXWidget* pSet);
+voidSetActiveControl(SwTOXWidget* pSet, bool bGrabFocus = true);
 
 SwTOXWidget* InsertItem(const OUString& rText, const SwFormToken& aToken);
 voidAdjustPosition

core.git: editeng/source sw/source

2024-10-04 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/eehtml.cxx|   30 --
 editeng/source/editeng/eehtml.hxx|2 ++
 sw/source/uibase/docvw/AnnotationWin.cxx |7 ++-
 3 files changed, 36 insertions(+), 3 deletions(-)

New commits:
commit f61cc4f12249bf4905355cee35bfc44e88d9fc39
Author: Caolán McNamara 
AuthorDate: Wed Oct 2 14:18:45 2024 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 4 15:28:47 2024 +0200

allow editeng html import to treat divs as inserting a newline

optional, currently cowardly defaulted off, except for the specific
use-case.

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

diff --git a/editeng/source/editeng/eehtml.cxx 
b/editeng/source/editeng/eehtml.cxx
index 24fd670ad9ba..11cf8811bf9d 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -41,6 +41,7 @@ EditHTMLParser::EditHTMLParser( SvStream& rIn, OUString 
_aBaseURL, SvKeyValueIte
 mpEditEngine(nullptr),
 bInPara(false),
 bWasInPara(false),
+mbBreakForDivs(false),
 bFieldsInserted(false),
 bInTitle(false),
 nInTable(0),
@@ -57,7 +58,25 @@ EditHTMLParser::EditHTMLParser( SvStream& rIn, OUString 
_aBaseURL, SvKeyValueIte
 SetSwitchToUCS2( true );
 
 if ( pHTTPHeaderAttrs )
+{
 SetEncodingByHTTPHeader( pHTTPHeaderAttrs );
+SetBreakForDivs(*pHTTPHeaderAttrs);
+}
+}
+
+void EditHTMLParser::SetBreakForDivs(SvKeyValueIterator& rHTTPOptions)
+{
+SvKeyValue aKV;
+bool bCont = rHTTPOptions.GetFirst(aKV);
+while (bCont)
+{
+if (aKV.GetKey() == "newline-on-div")
+{
+mbBreakForDivs = aKV.GetValue() == "true";
+break;
+}
+bCont = rHTTPOptions.GetNext(aKV);
+}
 }
 
 EditHTMLParser::~EditHTMLParser()
@@ -290,6 +309,15 @@ void EditHTMLParser::NextToken( HtmlTokenId nToken )
 nInCell++;
 Newline();
 break;
+
+case HtmlTokenId::DIVISION_ON:
+case HtmlTokenId::DIVISION_OFF:
+{
+if (mbBreakForDivs)
+Newline();
+break;
+}
+
 case HtmlTokenId::BLOCKQUOTE_ON:
 case HtmlTokenId::BLOCKQUOTE_OFF:
 case HtmlTokenId::BLOCKQUOTE30_ON:
@@ -356,8 +384,6 @@ void EditHTMLParser::NextToken( HtmlTokenId nToken )
 // HTML 3.0
 case HtmlTokenId::BANNER_ON:
 case HtmlTokenId::BANNER_OFF:
-case HtmlTokenId::DIVISION_ON:
-case HtmlTokenId::DIVISION_OFF:
 //  case HtmlTokenId::LISTHEADER_ON://! special handling
 //  case HtmlTokenId::LISTHEADER_OFF:
 case HtmlTokenId::NOTE_ON:
diff --git a/editeng/source/editeng/eehtml.hxx 
b/editeng/source/editeng/eehtml.hxx
index 9f8009c715c8..7b6591e2ccf4 100644
--- a/editeng/source/editeng/eehtml.hxx
+++ b/editeng/source/editeng/eehtml.hxx
@@ -45,6 +45,7 @@ private:
 
 boolbInPara:1;
 boolbWasInPara:1; // Remember bInPara before 
HeadingStart, because afterwards it will be gone.
+boolmbBreakForDivs:1; // Create newlines on 
encountering divs
 boolbFieldsInserted:1;
 boolbInTitle:1;
 
@@ -68,6 +69,7 @@ private:
 voidImpSetAttribs( const SfxItemSet& rItems );
 voidImpSetStyleSheet( sal_uInt16 nHeadingLevel );
 
+voidSetBreakForDivs(SvKeyValueIterator& rHTTPOptions);
 protected:
 virtual voidNextToken( HtmlTokenId nToken ) override;
 
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx 
b/sw/source/uibase/docvw/AnnotationWin.cxx
index 670425779212..1ad47437caa7 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -32,6 +32,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -490,7 +491,11 @@ void SwAnnotationWin::UpdateHTML(const OUString& rHtml)
 OString sHtmlContent(rHtml.toUtf8());
 SvMemoryStream aHTMLStream(const_cast(sHtmlContent.getStr()),
sHtmlContent.getLength(), StreamMode::READ);
-GetOutlinerView()->Read(aHTMLStream, EETextFormat::Html, nullptr);
+SvKeyValueIteratorRef xValues(new SvKeyValueIterator);
+// Insert newlines for divs, not normally done, so to keep things simple
+// only enable tthat for this case.
+xValues->Append(SvKeyValue("newline-on-div", "true"));
+GetOutlinerView()->Read(aHTMLStream, EETextFormat::Html, xValues.get());
 UpdateData();
 }
 


core.git: include/svx svx/sdi sw/inc sw/sdi sw/source

2024-10-04 Thread Caolán McNamara (via logerrit)
 include/svx/svxids.hrc   |4 +++-
 svx/sdi/svx.sdi  |   10 --
 sw/inc/AnnotationWin.hxx |3 ++-
 sw/sdi/swriter.sdi   |9 +++--
 sw/source/uibase/docvw/AnnotationWin.cxx |   10 ++
 sw/source/uibase/shells/textfld.cxx  |   16 ++--
 6 files changed, 40 insertions(+), 12 deletions(-)

New commits:
commit 6d94b7988f2fa90d7ca4790183cefea8950da834
Author: Caolán McNamara 
AuthorDate: Tue Oct 1 20:27:19 2024 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 4 15:28:21 2024 +0200

support setting writer comment contents from simple-html

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

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 895507c4696b..ebfc2d1582cf 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -1070,8 +1070,10 @@ class XFillGradientItem;
 #define SID_ATTR_BULLET_FONT
TypedWhichId(SID_SVX_START + 1213)
 #define SID_ATTR_BULLET_INDEX   
TypedWhichId(SID_SVX_START + 1214)
 
+#define SID_ATTR_POSTIT_HTML
TypedWhichId( SID_SVX_START + 1215 )
+
 // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE   ( SID_SVX_START + 1214 
+ 1 )
+#define SID_SVX_FIRSTFREE   ( SID_SVX_START + 1215 
+ 1 )
 
 
 // Overflow check for slot IDs
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index ef8c9e32fd98..53f531866276 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -4684,7 +4684,10 @@ SfxVoidItem InPlaceObjectResize SID_OBJECTRESIZE
 
 
 SfxVoidItem InsertAnnotation SID_INSERT_POSTIT
-(SvxPostItAuthorItem Author SID_ATTR_POSTIT_AUTHOR,SvxPostItDateItem Date 
SID_ATTR_POSTIT_DATE,SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT)
+(SvxPostItAuthorItem Author SID_ATTR_POSTIT_AUTHOR,
+ SvxPostItDateItem Date SID_ATTR_POSTIT_DATE,
+ SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT,
+ SvxPostItTextItem Html SID_ATTR_POSTIT_HTML)
 [
 AutoUpdate = FALSE,
 FastCall = FALSE,
@@ -4705,6 +4708,7 @@ SfxVoidItem EditAnnotation SID_EDIT_POSTIT
  SvxPostItAuthorItem Author SID_ATTR_POSTIT_AUTHOR,
  SvxPostItDateItem Date SID_ATTR_POSTIT_DATE,
  SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT,
+ SvxPostItTextItem Html SID_ATTR_POSTIT_HTML,
  SfxInt32Item PositionX SID_ATTR_POSTIT_POSITION_X
  SfxInt32Item PositionY SID_ATTR_POSTIT_POSITION_Y)
 [
@@ -4758,7 +4762,9 @@ SfxVoidItem ShowResolvedAnnotations 
SID_TOGGLE_RESOLVED_NOTES
 
 
 SfxVoidItem ReplyToAnnotation SID_REPLYTO_POSTIT
-(SvxPostItIdItem Id SID_ATTR_POSTIT_ID,SvxPostItTextItem Text 
SID_ATTR_POSTIT_TEXT)
+(SvxPostItIdItem Id SID_ATTR_POSTIT_ID,
+ SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT,
+ SvxPostItTextItem Html SID_ATTR_POSTIT_HTML)
 [
 AutoUpdate = FALSE,
 FastCall = FALSE,
diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index ec6a09cd8775..291978eee471 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -72,7 +72,8 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public 
InterimItemWindow
 voidGotoPos();
 const SwPostItField* GetPostItField() const { return mpField; }
 SwFormatField* GetFormatField() const { return mpFormatField; }
-void UpdateText(const OUString& aText);
+void UpdateText(const OUString& rText);
+void UpdateHTML(const OUString& rHtml);
 
 OUString GetAuthor() const;
 Date GetDate() const;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 7ece653275d0..20a23b745338 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -2519,7 +2519,10 @@ SfxVoidItem IndexMarkToIndex FN_IDX_MARK_TO_IDX
 ]
 
 SfxVoidItem InsertAnnotation FN_POSTIT
-(SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT,SvxPostItAuthorItem Author 
SID_ATTR_POSTIT_AUTHOR,SvxPostItDateItem Date SID_ATTR_POSTIT_DATE)
+(SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT,
+ SvxPostItTextItem Html SID_ATTR_POSTIT_HTML,
+ SvxPostItAuthorItem Author SID_ATTR_POSTIT_AUTHOR,
+ SvxPostItDateItem Date SID_ATTR_POSTIT_DATE)
 [
 AutoUpdate = FALSE,
 FastCall = FALSE,
@@ -7684,7 +7687,9 @@ SfxBoolItem SelectionModeDefault FN_SELECTION_MODE_DEFAULT
 ]
 
 SfxVoidItem ReplyComment FN_REPLY
-(SvxPostItIdItem Id SID_ATTR_POSTIT_ID,SvxPostItTextItem Text 
SID_ATTR_POSTIT_TEXT)
+(SvxPostItIdItem Id SID_ATTR_POSTIT_ID,
+ SvxPostItTextItem Text SID_ATTR_POSTIT_TEXT,
+ SvxPostItTextItem Html SID_ATTR_POSTIT_HTML)
 [
 AutoUpdate = FALSE,
 FastCall = FALSE,
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx 
b/sw/source/uibase/docvw/AnnotationWin.cxx
index 46628b098527..670425779212 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -484,6 +484,16 @@ void S

core.git: sfx2/source

2024-10-04 Thread Xisco Fauli (via logerrit)
 sfx2/source/doc/templatedlg.cxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit df54f8a4bd8970cf13e6a6aaf9056afccf2cc758
Author: Xisco Fauli 
AuthorDate: Fri Oct 4 14:08:03 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 15:30:03 2024 +0200

related tdf#163291: revert workaround for tdf#137922

It's no longer needed after bb0e5aa97965b2710200da677db032289c373afe
"tdf#163291 Fix AdditionsDialog in start center"

This reverts commit 63b0565ad137e5d81932f1fabba732ba40f6cb70

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

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index f0f0322a14d9..e32445fcbcfa 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -206,11 +206,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(weld::Window 
*pParent)
 mxLocalViewWeld->set_size_request(TEMPLATE_ITEM_MAX_WIDTH * 5, 
TEMPLATE_ITEM_MAX_HEIGHT_SUB * 3);
 
 mxOKButton->connect_clicked(LINK(this, SfxTemplateManagerDlg, OkClickHdl));
-// FIXME: rather than disabling make 
dispatchCommand(".uno:AdditionsDialog") work in start center
-if ( !SfxModule::GetActiveModule() )
-mxActionBar->set_item_sensitive(MNI_ACTION_EXTENSIONS, false);
-else
-mxActionBar->set_item_sensitive(MNI_ACTION_EXTENSIONS, true);
+mxActionBar->set_item_sensitive(MNI_ACTION_EXTENSIONS, true);
 mxListViewButton->connect_toggled(LINK(this, SfxTemplateManagerDlg, 
ListViewHdl));
 mxThumbnailViewButton->connect_toggled(LINK(this, SfxTemplateManagerDlg, 
ThumbnailViewHdl));
 


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

2024-10-04 Thread Xisco Fauli (via logerrit)
 sc/inc/colorscale.hxx  |3 +
 sc/qa/unit/data/xlsx/tdf162948.xlsx|binary
 sc/qa/unit/subsequent_export_test4.cxx |   46 ++---
 sc/source/core/data/colorscale.cxx |   36 ---
 sc/source/filter/excel/xecontent.cxx   |3 +
 sc/source/filter/inc/condformatbuffer.hxx  |4 +-
 sc/source/filter/oox/condformatbuffer.cxx  |9 
 sc/source/ui/condformat/condformatdlgentry.cxx |4 ++
 8 files changed, 85 insertions(+), 20 deletions(-)

New commits:
commit acc52f9bc0dbfcb5a8893b5aff2d18a2360d46e2
Author: Xisco Fauli 
AuthorDate: Fri Oct 4 12:53:28 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 15:30:55 2024 +0200

tdf#162948: Add support for gte attribute in conditional format

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

diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx
index bc3b646fe457..373c06eda05c 100644
--- a/sc/inc/colorscale.hxx
+++ b/sc/inc/colorscale.hxx
@@ -48,6 +48,7 @@ private:
 ScConditionalFormat* mpFormat;
 Color maColor;
 ScColorScaleEntryType meType;
+bool mbGreaterThanOrEqual;
 
 void setListener();
 
@@ -62,6 +63,8 @@ public:
 void SetColor(const Color&);
 SC_DLLPUBLIC double GetValue() const;
 SC_DLLPUBLIC void SetValue(double nValue);
+SC_DLLPUBLIC bool GetGreaterThanOrEqual() const;
+SC_DLLPUBLIC void SetGreaterThanOrEqual(bool bGreaterThanOrEqual);
 SC_DLLPUBLIC void SetFormula(const OUString& rFormula, ScDocument& rDoc, 
const ScAddress& rAddr,
 formula::FormulaGrammar::Grammar eGrammar = 
formula::FormulaGrammar::GRAM_DEFAULT);
 
diff --git a/sc/qa/unit/data/xlsx/tdf162948.xlsx 
b/sc/qa/unit/data/xlsx/tdf162948.xlsx
new file mode 100644
index ..bc04c6a53c0f
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf162948.xlsx differ
diff --git a/sc/qa/unit/subsequent_export_test4.cxx 
b/sc/qa/unit/subsequent_export_test4.cxx
index 8983756b6d41..67de68174002 100644
--- a/sc/qa/unit/subsequent_export_test4.cxx
+++ b/sc/qa/unit/subsequent_export_test4.cxx
@@ -111,17 +111,17 @@ void testComplexIconSetsXLSX_Impl(const ScDocument& rDoc, 
SCCOL nCol, ScIconSetT
 CPPUNIT_ASSERT_EQUAL(eType, pIconSet->GetIconSetData()->eIconSetType);
 }
 
-void testCustomIconSetsXLSX_Impl(const ScDocument& rDoc, SCCOL nCol, SCROW 
nRow,
+void testCustomIconSetsXLSX_Impl(const ScDocument& rDoc, SCCOL nCol, SCROW 
nRow, SCTAB nTab,
  ScIconSetType eType, sal_Int32 nIndex)
 {
-ScConditionalFormat* pFormat = rDoc.GetCondFormat(nCol, 1, 1);
+ScConditionalFormat* pFormat = rDoc.GetCondFormat(nCol, nRow, nTab);
 CPPUNIT_ASSERT(pFormat);
 CPPUNIT_ASSERT_EQUAL(size_t(1), pFormat->size());
 const ScFormatEntry* pEntry = pFormat->GetEntry(0);
 CPPUNIT_ASSERT(pEntry);
 CPPUNIT_ASSERT_EQUAL(ScFormatEntry::Type::Iconset, pEntry->GetType());
 const ScIconSetFormat* pIconSet = static_cast(pEntry);
-std::unique_ptr 
pInfo(pIconSet->GetIconSetInfo(ScAddress(nCol, nRow, 1)));
+std::unique_ptr 
pInfo(pIconSet->GetIconSetInfo(ScAddress(nCol, nRow, nTab)));
 if (nIndex == -1)
 CPPUNIT_ASSERT(!pInfo);
 else
@@ -143,15 +143,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, 
testComplexIconSetsXLSX)
 testComplexIconSetsXLSX_Impl(*pDoc, 5, IconSet_5Boxes);
 
 CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetCondFormList(1)->size());
-testCustomIconSetsXLSX_Impl(*pDoc, 1, 1, IconSet_3ArrowsGray, 0);
-testCustomIconSetsXLSX_Impl(*pDoc, 1, 2, IconSet_3ArrowsGray, -1);
-testCustomIconSetsXLSX_Impl(*pDoc, 1, 3, IconSet_3Arrows, 1);
-testCustomIconSetsXLSX_Impl(*pDoc, 1, 4, IconSet_3ArrowsGray, -1);
-testCustomIconSetsXLSX_Impl(*pDoc, 1, 5, IconSet_3Arrows, 2);
-
-testCustomIconSetsXLSX_Impl(*pDoc, 3, 1, IconSet_4RedToBlack, 3);
-testCustomIconSetsXLSX_Impl(*pDoc, 3, 2, IconSet_3TrafficLights1, 1);
-testCustomIconSetsXLSX_Impl(*pDoc, 3, 3, IconSet_3Arrows, 2);
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 1, 1, IconSet_3ArrowsGray, 0);
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 2, 1, IconSet_3ArrowsGray, -1);
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 3, 1, IconSet_3Arrows, 1);
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 4, 1, IconSet_3ArrowsGray, -1);
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 5, 1, IconSet_3Arrows, 2);
+
+testCustomIconSetsXLSX_Impl(*pDoc, 3, 1, 1, IconSet_4RedToBlack, 3);
+testCustomIconSetsXLSX_Impl(*pDoc, 3, 2, 1, IconSet_3TrafficLights1, 
1);
+testCustomIconSetsXLSX_Impl(*pDoc, 3, 3, 1, IconSet_3Arrows, 2);
 };
 
 createScDoc("xlsx/complex_icon_set.xlsx");
@@ -160,6 +160,28 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, 
testComplexIconSetsXLSX)
 verify();
 }
 
+CPPUNIT_TEST_FIXTURE(Sc

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

2024-10-04 Thread Tibor Nagy (via logerrit)
 include/oox/drawingml/color.hxx  |2 
 include/oox/helper/graphichelper.hxx |2 
 include/oox/ppt/pptimport.hxx|1 
 include/oox/ppt/presentationfragmenthandler.hxx  |1 
 oox/source/drawingml/color.cxx   |   15 
 oox/source/drawingml/fillproperties.cxx  |8 ++
 oox/source/drawingml/textcharacterproperties.cxx |8 ++
 oox/source/helper/graphichelper.cxx  |2 
 oox/source/ppt/pptimport.cxx |   28 
 oox/source/ppt/presentationfragmenthandler.cxx   |   56 
 sd/qa/unit/data/pptx/tdf160591.pptx  |binary
 sd/qa/unit/export-tests-ooxml4.cxx   |   23 ++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   80 ++-
 13 files changed, 212 insertions(+), 14 deletions(-)

New commits:
commit dd42aa47b2d7d105aed2d3f4a458b76d4dcde70b
Author: Tibor Nagy 
AuthorDate: Thu Jun 6 19:47:45 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri Oct 4 09:40:15 2024 +0200

tdf#160591 PPTX export: fix colormap mapping in slide master

Change-Id: I154f0ff1769fbda361ec62f1dd589ca0d7686bd9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168506
Tested-by: Jenkins
Reviewed-by: Nagy Tibor 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174440
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx
index ea02ef8a03e4..dc8be778f665 100644
--- a/include/oox/drawingml/color.hxx
+++ b/include/oox/drawingml/color.hxx
@@ -122,6 +122,8 @@ public:
 static OUString getColorTransformationName( sal_Int32 nElement );
 /** Translates between color transformation token names and the 
corresponding token */
 static sal_Int32getColorTransformationToken( std::u16string_view sName 
);
+/** Translates between ColorMap token names and the corresponding token */
+static sal_Int32getColorMapToken(std::u16string_view sName);
 
 /// Compares this color with rOther.
 bool equals(const Color& rOther, const GraphicHelper& rGraphicHelper, 
::Color nPhClr) const;
diff --git a/include/oox/helper/graphichelper.hxx 
b/include/oox/helper/graphichelper.hxx
index 0d0b69216617..906d7330dff3 100644
--- a/include/oox/helper/graphichelper.hxx
+++ b/include/oox/helper/graphichelper.hxx
@@ -77,6 +77,8 @@ public:
 ::ColorgetSystemColor( sal_Int32 nToken, ::Color nDefaultRgb = 
API_RGB_TRANSPARENT ) const;
 /** Derived classes may implement to resolve a scheme color from the 
passed XML token identifier. */
 virtual ::ColorgetSchemeColor( sal_Int32 nToken ) const;
+/** Derived classes may implement to resolve a ColorMap token from the 
passed XML token identifier. */
+virtual void   getSchemeColorToken(sal_Int32& nToken) const;
 /** Derived classes may implement to resolve a palette index to an RGB 
color. */
 virtual ::ColorgetPaletteColor( sal_Int32 nPaletteIdx ) const;
 
diff --git a/include/oox/ppt/pptimport.hxx b/include/oox/ppt/pptimport.hxx
index 2d7367c4c63e..9591560d0326 100644
--- a/include/oox/ppt/pptimport.hxx
+++ b/include/oox/ppt/pptimport.hxx
@@ -74,6 +74,7 @@ public:
 
 virtual sal_Bool SAL_CALL filter( const css::uno::Sequence<   
css::beans::PropertyValue >& rDescriptor ) override;
 
+void getSchemeColorToken(sal_Int32& nToken) const;
 ::Color getSchemeColor( sal_Int32 nToken ) const;
 virtual std::shared_ptr<::oox::drawingml::Theme> getCurrentThemePtr() 
const override;
 
diff --git a/include/oox/ppt/presentationfragmenthandler.hxx 
b/include/oox/ppt/presentationfragmenthandler.hxx
index 20fc521ae8c5..29e7bcf12bfc 100644
--- a/include/oox/ppt/presentationfragmenthandler.hxx
+++ b/include/oox/ppt/presentationfragmenthandler.hxx
@@ -57,6 +57,7 @@ private:
::oox::ppt::PowerPointImport& rFilter,
const OUString& rMasterFragmentPath);
 void saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, 
sal_Int32 nThemeIdx);
+void saveColorMapToGrabBag(const oox::drawingml::ClrMapPtr& pClrMapPtr);
 void importCustomSlideShow(std::vector& rCustomShowList);
 static void importSlideNames(::oox::core::XmlFilterBase& rFilter, const 
std::vector& rSlidePersist);
 
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx
index 9462fc03095c..fea1dd0766a1 100644
--- a/oox/source/drawingml/color.cxx
+++ b/oox/source/drawingml/color.cxx
@@ -455,6 +455,21 @@ void Color::clearTransformations()
 clearTransparence();
 }
 
+constexpr frozen::unordered_map 
constColorMapTokenMap
+= { { u"bg1", XML_bg1 }, { u"tx1", XML_tx1 }, { u"bg2", 
XML_bg2 },
+{ u"tx2", XML_tx2 }, { u"accent1", XML_accent1 }, { 
u"accent2", XML_accent2 },
+{ u"accent3", XML_accent3 }, { u"accent4", XML_accent4

core.git: sd/source

2024-10-04 Thread Marco Cecchetti (via logerrit)
 sd/source/ui/unoidl/unomodel.cxx |   34 --
 1 file changed, 28 insertions(+), 6 deletions(-)

New commits:
commit a983af222ef3c227b22101578a5dba2c18688df0
Author: Marco Cecchetti 
AuthorDate: Tue Jul 23 23:03:02 2024 +0200
Commit: Miklos Vajna 
CommitDate: Fri Oct 4 11:53:29 2024 +0200

fix-up slideshow: provide animations info

Avoid to export json node with the same name
node name moved to nodeName property

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

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index b5e2bb9dbf0b..0242b2530e37 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -475,6 +475,7 @@ public:
 
 private:
 void exportNode(const Reference& xNode);
+void exportNodeImpl(const Reference& xNode);
 void exportContainer(const Reference& xContainer);
 
 void exportAnimate(const Reference& xAnimate);
@@ -574,24 +575,43 @@ void convertColor(OStringBuffer& rBuffer, sal_Int32 
nColor)
 rBuffer.append(aUBuffer.makeStringAndClear().toUtf8());
 }
 
+bool isValidNode(const Reference& xNode)
+{
+if (xNode.is())
+{
+sal_Int16 nNodeType = xNode->getType();
+auto iterator = constAnimationNodeTypeToString.find(nNodeType);
+return iterator != constAnimationNodeTypeToString.end();
+}
+return false;
+}
+
 void AnimationsExporter::exportAnimations()
 {
 if (!mxDrawPage.is() || !mxPageProps.is() || !mxRootNode.is() || 
!hasEffects())
 return;
 
-exportNode(mxRootNode);
+if (isValidNode(mxRootNode))
+{
+auto aNode = mrWriter.startNode("root");
+exportNodeImpl(mxRootNode);
+}
 }
-
 void AnimationsExporter::exportNode(const Reference& xNode)
+{
+ if (!isValidNode(mxRootNode))
+ return;
+ auto aStruct = mrWriter.startStruct();
+ exportNodeImpl(xNode);
+}
+
+void AnimationsExporter::exportNodeImpl(const Reference& xNode)
 {
 try
 {
 sal_Int16 nNodeType = xNode->getType();
 auto iterator = constAnimationNodeTypeToString.find(nNodeType);
-if (iterator == constAnimationNodeTypeToString.end())
-return;
-
-auto aNode = mrWriter.startNode(iterator->second);
+mrWriter.put("nodeName", iterator->second);
 
 // common properties
 OStringBuffer sTmp;
@@ -851,6 +871,8 @@ void AnimationsExporter::exportContainer(const 
Reference& xConta
 {
 try
 {
+auto anArray = mrWriter.startArray("children");
+
 Reference xEnumerationAccess(xContainer, 
UNO_QUERY_THROW);
 Reference 
xEnumeration(xEnumerationAccess->createEnumeration(),
  css::uno::UNO_SET_THROW);


core.git: Branch 'libreoffice-24-8' - forms/source

2024-10-04 Thread Noel Grandin (via logerrit)
 forms/source/misc/limitedformats.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 3e5c424a5b2a2739dd4a50bfc14ac350b9638837
Author: Noel Grandin 
AuthorDate: Tue Oct 1 15:39:51 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 10:32:27 2024 +0200

tdf#162713 Changed format for date-field and time-field in form

regression from
commit 9c92eb6800468de34c5aec3690c1b990a4e763c9
Author: Noel Grandin 
Date:   Mon May 13 15:42:27 2024 +0200
createFromAscii -> OUString literals in OLimitedFormats

Change-Id: I620526e3e0efd9e9376e428881e0240e2d3017d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174352
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 54fa4c438bd458d72a8e23a6819c7be639eaee92)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174329
Reviewed-by: Xisco Fauli 

diff --git a/forms/source/misc/limitedformats.cxx 
b/forms/source/misc/limitedformats.cxx
index c40de6b23430..628a42c55892 100644
--- a/forms/source/misc/limitedformats.cxx
+++ b/forms/source/misc/limitedformats.cxx
@@ -243,8 +243,8 @@ namespace frm
 std::span pFormats = lcl_getFormatTable(m_nTableId);
 
 // seek to the nValue'th entry
-OSL_ENSURE(pFormats.size() < o3tl::make_unsigned(nValue), 
"OLimitedFormats::getFormatKeyPropertyValue: did not find the value!");
-if (pFormats.size() < o3tl::make_unsigned(nValue))
+OSL_ENSURE(o3tl::make_unsigned(nValue) < pFormats.size(), 
"OLimitedFormats::getFormatKeyPropertyValue: did not find the value!");
+if (o3tl::make_unsigned(nValue) < pFormats.size())
 _rValue <<= pFormats[nValue].nKey;
 
 // TODO: should use a standard format for the control type we're 
working for


core.git: unoxml/qa

2024-10-04 Thread Xisco Fauli (via logerrit)
 unoxml/qa/complex/unoxml/DOMTest.java |   43 --
 unoxml/qa/unit/domtest.cxx|   48 ++
 2 files changed, 48 insertions(+), 43 deletions(-)

New commits:
commit c914a9da325616cb7a6319ffdc80b584db236cb4
Author: Xisco Fauli 
AuthorDate: Fri Oct 4 14:37:20 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 16:31:03 2024 +0200

unoxml: port testXNodeList_ChildList from java to c++

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

diff --git a/unoxml/qa/complex/unoxml/DOMTest.java 
b/unoxml/qa/complex/unoxml/DOMTest.java
index f61e448ba491..2e262f083b77 100644
--- a/unoxml/qa/complex/unoxml/DOMTest.java
+++ b/unoxml/qa/complex/unoxml/DOMTest.java
@@ -2220,49 +2220,6 @@ public class DOMTest
 }
 */
 
-@Test public void testXNodeList_ChildList() throws Exception
-{
-XDocumentBuilder xBuilder =
-UnoRuntime.queryInterface(XDocumentBuilder.class,
-m_xMSF.createInstance("com.sun.star.xml.dom.DocumentBuilder"));
-XDocument xDoc = xBuilder.newDocument();
-
-XElement xRoot = xDoc.createElement("root");
-XElement xFoo = xDoc.createElement("foo");
-XElement xBar = xDoc.createElement("bar");
-XElement xBaz = xDoc.createElement("baz");
-
-xDoc.appendChild(xRoot);
-
-XNodeList xChildList = xRoot.getChildNodes();
-assertNotNull(xChildList);
-assertSame("ChildList.getLength()", 0, xChildList.getLength());
-
-try {
-xChildList.item(4);
-} catch (Exception e) { /* expected */ }
-
-xRoot.appendChild(xFoo);
-assertSame("ChildList.getLength()", 1, xChildList.getLength());
-assertEquals("ChildList.item", xFoo, xChildList.item(0));
-
-xRoot.appendChild(xBar);
-assertSame("ChildList.getLength()", 2, xChildList.getLength());
-assertEquals("ChildList.item", xFoo, xChildList.item(0));
-assertEquals("ChildList.item", xBar, xChildList.item(1));
-
-xRoot.appendChild(xBaz);
-assertSame("ChildList.getLength()", 3, xChildList.getLength());
-assertEquals("ChildList.item", xFoo, xChildList.item(0));
-assertEquals("ChildList.item", xBar, xChildList.item(1));
-assertEquals("ChildList.item", xBaz, xChildList.item(2));
-
-xRoot.removeChild(xBar);
-assertSame("ChildList.getLength()", 2, xChildList.getLength());
-assertEquals("ChildList.item", xFoo, xChildList.item(0));
-assertEquals("ChildList.item", xBaz, xChildList.item(1));
-}
-
 @Test public void testXNodeList_ElementList() throws Exception
 {
 XDocumentBuilder xBuilder =
diff --git a/unoxml/qa/unit/domtest.cxx b/unoxml/qa/unit/domtest.cxx
index d0c262123bf7..612d36654993 100644
--- a/unoxml/qa/unit/domtest.cxx
+++ b/unoxml/qa/unit/domtest.cxx
@@ -560,6 +560,53 @@ public:
 }
 }
 
+void testXNodeList_ChildList()
+{
+Reference< xml::dom::XDocument > xDocument = 
mxDomBuilder->newDocument();
+CPPUNIT_ASSERT(xDocument);
+
+Reference< xml::dom::XElement > xRoot = 
xDocument->createElement(u"root"_ustr);
+Reference< xml::dom::XElement > xFoo = 
xDocument->createElement(u"foo"_ustr);
+Reference< xml::dom::XElement > xBar = 
xDocument->createElement(u"bar"_ustr);
+Reference< xml::dom::XElement > xBaz = 
xDocument->createElement(u"baz"_ustr);
+
+xDocument->appendChild(xRoot);
+
+uno::Reference xChildList = 
xRoot->getChildNodes();
+CPPUNIT_ASSERT(xChildList);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xChildList->getLength());
+
+CPPUNIT_ASSERT(!xChildList->item(4));
+
+xRoot->appendChild(xFoo);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xChildList->getLength());
+CPPUNIT_ASSERT_EQUAL(Reference< XInterface >(xFoo, uno::UNO_QUERY),
+Reference< XInterface >(xChildList->item(0), uno::UNO_QUERY));
+
+xRoot->appendChild(xBar);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xChildList->getLength());
+CPPUNIT_ASSERT_EQUAL(Reference< XInterface >(xFoo, uno::UNO_QUERY),
+Reference< XInterface >(xChildList->item(0), uno::UNO_QUERY));
+CPPUNIT_ASSERT_EQUAL(Reference< XInterface >(xBar, uno::UNO_QUERY),
+Reference< XInterface >(xChildList->item(1), uno::UNO_QUERY));
+
+xRoot->appendChild(xBaz);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xChildList->getLength());
+CPPUNIT_ASSERT_EQUAL(Reference< XInterface >(xFoo, uno::UNO_QUERY),
+Reference< XInterface >(xChildList->item(0), uno::UNO_QUERY));
+CPPUNIT_ASSERT_EQUAL(Reference< XInterface >(xBar, uno::UNO_QUERY),
+Reference< XInterface >(xChildList->item(1), uno::UNO_QUERY));
+CPPUNIT_ASSERT_EQUAL(Reference< XInterface >(x

core.git: sw/source

2024-10-04 Thread Stephan Bergmann (via logerrit)
 sw/source/core/doc/DocumentSettingManager.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 75f3ee7e8a06ed5fec17c358c62e3efeb8d13e8d
Author: Stephan Bergmann 
AuthorDate: Fri Oct 4 16:35:56 2024 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 4 21:29:48 2024 +0200

Initialize sw::DocumentSettingManager::mbNoClippingWithWrapPolygon

...newly introduced in 3800ab58355385dcb482d3089accc7ce141f5ee9 "tdf#161233
paint pictures completely also with contour wrap", and which started to make
CppunitTest_vcl_pdfexport2 CPPUNIT_TEST_NAME=testTdf124272::TestBody fail 
with

> pdfexport2.cxx:180:Assertion
> Test name: (anonymous namespace)::testTdf124272::TestBody
> assertion failed
> - Expression: it != pEnd

in some builds like 

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

diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index 942272abc3b6..9f3858f8c0b6 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -110,7 +110,8 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc 
&rDoc)
 mbUseVariableWidthNBSP(false),
 mbPaintHellOverHeaderFooter(false),
 mbMinRowHeightInclBorder(false),
-mbMsWordCompGridMetrics(false) // tdf#129808
+mbMsWordCompGridMetrics(false), // tdf#129808
+mbNoClippingWithWrapPolygon(false)
 
 // COMPATIBILITY FLAGS END
 {


core.git: external/skia

2024-10-04 Thread Noel Grandin (via logerrit)
 external/skia/Library_skia.mk |  989 +-
 external/skia/README  |3 
 2 files changed, 600 insertions(+), 392 deletions(-)

New commits:
commit 19566380abbb936104076ae42d34f2075a89dc65
Author: Noel Grandin 
AuthorDate: Fri Oct 4 13:31:00 2024 +0200
Commit: Noel Grandin 
CommitDate: Sat Oct 5 08:41:16 2024 +0200

Re-organise the skia makefile

so it more closely corresponds to the GN buildfiles that it is derived
from, in order to make updating to newer versions of skia easier

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

diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk
index 9d240e40da0c..a12d339ba7a9 100644
--- a/external/skia/Library_skia.mk
+++ b/external/skia/Library_skia.mk
@@ -139,10 +139,188 @@ $(eval $(call gb_Library_add_exception_objects,skia,\
 
 $(eval $(call gb_Library_set_generated_cxx_suffix,skia,cpp))
 
+# from file skia/gn/BUILD.gn:416, target "optional("fontmgr_fontconfig")"
+#
+ifneq ($(filter-out WNT MACOSX,$(OS)),)
+$(eval $(call gb_Library_add_generated_exception_objects,skia,\
+UnpackedTarball/skia/src/ports/SkFontMgr_fontconfig \
+))
+endif
+
+# from file skia/gn/BUILD.gn:426, target 
"optional("fontmgr_fontconfig_factory")"
+#
+ifneq ($(filter-out WNT MACOSX,$(OS)),)
+$(eval $(call gb_Library_add_generated_exception_objects,skia,\
+UnpackedTarball/skia/src/ports/SkFontMgr_fontconfig_factory \
+))
+endif
+
+# from file skia/gn/BUILD.gn:432, target 
"optional("fontmgr_FontConfigInterface")"
+#
+ifneq ($(filter-out WNT MACOSX,$(OS)),)
+$(eval $(call gb_Library_add_generated_exception_objects,skia,\
+UnpackedTarball/skia/src/ports/SkFontConfigInterface \
+UnpackedTarball/skia/src/ports/SkFontConfigInterface_direct \
+UnpackedTarball/skia/src/ports/SkFontConfigInterface_direct_factory \
+UnpackedTarball/skia/src/ports/SkFontMgr_FontConfigInterface \
+))
+endif
+
+# from file skia/gn/BUILD.gn:472, target "optional("fontmgr_mac_ct")"
+#
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_Library_add_generated_exception_objects,skia,\
+UnpackedTarball/skia/src/ports/SkFontMgr_mac_ct \
+UnpackedTarball/skia/src/ports/SkScalerContext_mac_ct \
+UnpackedTarball/skia/src/ports/SkTypeface_mac_ct \
+))
+endif
+
+# from file skia/gn/BUILD.gn:508, target "optional("fontmgr_mac_ct_factory")"
+#
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_Library_add_generated_exception_objects,skia,\
+UnpackedTarball/skia/src/ports/SkFontMgr_mac_ct_factory \
+))
+endif
+
+# from file skia/gn/BUILD.gn:514, target "optional("fontmgr_win")"
+#
+ifeq ($(OS),WNT)
+$(eval $(call gb_Library_add_generated_exception_objects,skia,\
+UnpackedTarball/skia/src/fonts/SkFontMgr_indirect \
+UnpackedTarball/skia/src/ports/SkFontMgr_win_dw \
+UnpackedTarball/skia/src/ports/SkScalerContext_win_dw \
+UnpackedTarball/skia/src/ports/SkTypeface_win_dw \
+))
+endif
+
+# from file skia/gn/BUILD.gn:530, target "optional("fontmgr_win_factory")"
+#
+ifeq ($(OS),WNT)
+$(eval $(call gb_Library_add_generated_exception_objects,skia,\
+UnpackedTarball/skia/src/ports/SkFontMgr_win_dw_factory \
+))
+endif
+
+# from file skia/gn/BUILD.gn:536, target "optional("fontmgr_win_gdi")"
+#
+ifeq ($(OS),WNT)
+$(eval $(call gb_Library_add_generated_exception_objects,skia,\
+UnpackedTarball/skia/src/ports/SkFontHost_win \
+))
+endif
+
+# from file skia/gn/BUILD.gn:1278, target "optional("png_decode")"
+#
+$(eval $(call gb_Library_add_generated_exception_objects,skia,\
+UnpackedTarball/skia/src/codec/SkIcoCodec \
+UnpackedTarball/skia/src/codec/SkPngCodec \
+))
+
+# from file skia/gn/BUILD.gn:1314, target "typeface_freetype"
+#
+ifneq ($(filter-out WNT MACOSX,$(OS)),)
+$(eval $(call gb_Library_add_generated_exception_objects,skia,\
+UnpackedTarball/skia/src/ports/SkFontHost_FreeType \
+UnpackedTarball/skia/src/ports/SkFontHost_FreeType_common \
+))
+endif
+
+# from file skia/gn/BUILD.gn:1400, target "skia_component("skia")"
+#
+$(eval $(call gb_Library_add_generated_exception_objects,skia,\
+UnpackedTarball/skia/src/codec/SkAndroidCodec \
+UnpackedTarball/skia/src/codec/SkAndroidCodecAdapter \
+UnpackedTarball/skia/src/codec/SkEncodedInfo \
+UnpackedTarball/skia/src/codec/SkParseEncodedOrigin \
+UnpackedTarball/skia/src/codec/SkSampledCodec \
+UnpackedTarball/skia/src/ports/SkGlobalInitialization_default \
+UnpackedTarball/skia/src/ports/SkOSFile_stdio \
+UnpackedTarball/skia/src/sfnt/SkOTTable_name \
+UnpackedTarball/skia/src/sfnt/SkOTUtils \
+))
+ifeq ($(OS),WNT)
+$(eval $(call gb_Library_add_generated_exception_objects,skia,\
+UnpackedTarball/skia/src/ports/SkDebug_win \
+UnpackedTarball/skia/src/ports/SkOSFile_win \
+UnpackedTarball/skia/src/ports/SkOSLibrary_win \
+))
+else ifeq ($(OS),MACOSX)
+$(eval $(call gb_Library

core.git: 2 commits - sfx2/source stoc/source

2024-10-04 Thread Noel Grandin (via logerrit)
 sfx2/source/control/thumbnailviewacc.hxx |6 +-
 stoc/source/inspect/introspection.cxx|   27 +++
 2 files changed, 8 insertions(+), 25 deletions(-)

New commits:
commit 46f5aa4f5897b6c3a151cf7bca0d4fcc6cd985c4
Author: Noel Grandin 
AuthorDate: Thu Oct 3 19:08:14 2024 +0200
Commit: Noel Grandin 
CommitDate: Sat Oct 5 08:57:34 2024 +0200

cid#1607010 Data race condition

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

diff --git a/stoc/source/inspect/introspection.cxx 
b/stoc/source/inspect/introspection.cxx
index 716e35c95df1..114983d08a7f 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -785,15 +785,8 @@ ImplIntrospectionAccess::ImplIntrospectionAccess
 Reference ImplIntrospectionAccess::getXElementAccess()
 {
 std::unique_lock aGuard( m_aMutex );
-
 if( !mxObjElementAccess.is() )
-{
-aGuard.unlock();
-Reference xElementAccess( mxIface, UNO_QUERY );
-aGuard.lock();
-if( !mxObjElementAccess.is() )
-mxObjElementAccess = std::move(xElementAccess);
-}
+mxObjElementAccess.set( mxIface, UNO_QUERY );
 return mxObjElementAccess;
 }
 
@@ -922,30 +915,16 @@ Reference 
ImplIntrospectionAccess::getXIndexAccess()
 Reference ImplIntrospectionAccess::getXEnumerationAccess()
 {
 std::unique_lock aGuard( m_aMutex );
-
 if( !mxObjEnumerationAccess.is() )
-{
-aGuard.unlock();
-Reference xEnumerationAccess( mxIface, UNO_QUERY );
-aGuard.lock();
-if( !mxObjEnumerationAccess.is() )
-mxObjEnumerationAccess = std::move(xEnumerationAccess);
-}
+mxObjEnumerationAccess.set( mxIface, UNO_QUERY );
 return mxObjEnumerationAccess;
 }
 
 Reference ImplIntrospectionAccess::getXIdlArray()
 {
 std::unique_lock aGuard( m_aMutex );
-
 if( !mxObjIdlArray.is() )
-{
-aGuard.unlock();
-Reference xIdlArray( mxIface, UNO_QUERY );
-aGuard.lock();
-if( !mxObjIdlArray.is() )
-mxObjIdlArray = std::move(xIdlArray);
-}
+mxObjIdlArray.set( mxIface, UNO_QUERY );
 return mxObjIdlArray;
 }
 
commit 5195aadf1cfcf53316ff4d5b36635548e95120cb
Author: Noel Grandin 
AuthorDate: Thu Oct 3 18:57:07 2024 +0200
Commit: Noel Grandin 
CommitDate: Sat Oct 5 08:57:25 2024 +0200

cid#1607477 Data race condition

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

diff --git a/sfx2/source/control/thumbnailviewacc.hxx 
b/sfx2/source/control/thumbnailviewacc.hxx
index 63ea533009ad..e483e64a7afc 100644
--- a/sfx2/source/control/thumbnailviewacc.hxx
+++ b/sfx2/source/control/thumbnailviewacc.hxx
@@ -54,7 +54,11 @@ public:
   const css::uno::Any& rOldValue,
   const css::uno::Any& rNewValue );
 
-bool HasAccessibleListeners() const { return( mxEventListeners.size() > 0 
); }
+bool HasAccessibleListeners() const
+{
+std::unique_lock aGuard (m_aMutex);
+return( mxEventListeners.size() > 0 );
+}
 
 public:
 /** Called by the corresponding ValueSet when it gets the focus.


core.git: svl/source

2024-10-04 Thread Noel Grandin (via logerrit)
 svl/source/fsstor/ostreamcontainer.cxx |   40 ++---
 1 file changed, 18 insertions(+), 22 deletions(-)

New commits:
commit e1e7a1ef0f4abc10a55cf9b093468ba6adf0505e
Author: Noel Grandin 
AuthorDate: Thu Oct 3 19:11:33 2024 +0200
Commit: Noel Grandin 
CommitDate: Sat Oct 5 08:57:43 2024 +0200

cid#1556892 Data race condition

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

diff --git a/svl/source/fsstor/ostreamcontainer.cxx 
b/svl/source/fsstor/ostreamcontainer.cxx
index 53814285880e..78a168f04b49 100644
--- a/svl/source/fsstor/ostreamcontainer.cxx
+++ b/svl/source/fsstor/ostreamcontainer.cxx
@@ -135,31 +135,27 @@ void SAL_CALL OFSStreamContainer::release()
 //  XTypeProvider
 uno::Sequence< uno::Type > SAL_CALL OFSStreamContainer::getTypes()
 {
+std::scoped_lock aGuard( m_aMutex );
 if ( !m_aTypes.hasElements() )
 {
-std::scoped_lock aGuard( m_aMutex );
-
-if ( !m_aTypes.hasElements() )
+std::vector tmp
 {
-std::vector tmp
-{
-cppu::UnoType::get(),
-cppu::UnoType::get()
-};
-
-if ( m_xSeekable.is() )
-tmp.push_back(cppu::UnoType::get());
-if ( m_xInputStream.is() )
-tmp.push_back(cppu::UnoType::get());
-if ( m_xOutputStream.is() )
-tmp.push_back(cppu::UnoType::get());
-if ( m_xTruncate.is() )
-tmp.push_back(cppu::UnoType::get());
-if ( m_xAsyncOutputMonitor.is() )
-tmp.push_back(cppu::UnoType::get());
-
-m_aTypes = comphelper::containerToSequence(tmp);
-}
+cppu::UnoType::get(),
+cppu::UnoType::get()
+};
+
+if ( m_xSeekable.is() )
+tmp.push_back(cppu::UnoType::get());
+if ( m_xInputStream.is() )
+tmp.push_back(cppu::UnoType::get());
+if ( m_xOutputStream.is() )
+tmp.push_back(cppu::UnoType::get());
+if ( m_xTruncate.is() )
+tmp.push_back(cppu::UnoType::get());
+if ( m_xAsyncOutputMonitor.is() )
+tmp.push_back(cppu::UnoType::get());
+
+m_aTypes = comphelper::containerToSequence(tmp);
 }
 return m_aTypes;
 }


core.git: Branch 'libreoffice-24-8' - desktop/source

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

New commits:
commit 75fb6915e68098daeec632c1d38935c5556a17a2
Author: Miklos Vajna 
AuthorDate: Fri Sep 27 08:52:57 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 10:04:40 2024 +0200

desktop lok: fix crash in getStyles()

Crashreport backtrace:

> program/libmergedlo.so
>   getStyles
>   desktop/source/lib/init.cxx:6411
> program/libmergedlo.so
>   doc_getCommandValues
>   desktop/source/lib/init.cxx:

Which is probably a call on an already disposed document. Fix it similar
to how getFonts() does it.

Change-Id: I1744bd04b7ebdea1b69ca121b8cfa47314d67528
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174372
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit d5d7883fdecfb2c98c880ee2e957a1e34cba45bf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174330
Reviewed-by: Xisco Fauli 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a892eb51a981..90cfba8e4e87 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -6145,6 +6145,10 @@ static char* getStyles(LibreOfficeKitDocument* pThis, 
const char* pCommand)
 aTree.put("commandName", pCommand);
 uno::Reference 
xStyleFamiliesSupplier(pDocument->mxComponent, uno::UNO_QUERY);
 const uno::Reference xStyleFamilies = 
xStyleFamiliesSupplier->getStyleFamilies();
+if (!xStyleFamilies.is())
+{
+return nullptr;
+}
 const uno::Sequence aStyleFamilies = 
xStyleFamilies->getElementNames();
 
 static constexpr OUString aWriterStyles[] =


core.git: sc/qa

2024-10-04 Thread Xisco Fauli (via logerrit)
 sc/qa/unit/subsequent_export_test4.cxx  |   65 
 sc/qa/unit/subsequent_filters_test4.cxx |   58 
 2 files changed, 65 insertions(+), 58 deletions(-)

New commits:
commit 71293e4c194850b9f56fe9cc6eee2531e225b94c
Author: Xisco Fauli 
AuthorDate: Fri Oct 4 13:10:54 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 14:32:06 2024 +0200

sc: convert import test into export test

In preparation for a follow-up patch

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

diff --git a/sc/qa/unit/subsequent_export_test4.cxx 
b/sc/qa/unit/subsequent_export_test4.cxx
index e194568803c0..8983756b6d41 100644
--- a/sc/qa/unit/subsequent_export_test4.cxx
+++ b/sc/qa/unit/subsequent_export_test4.cxx
@@ -11,6 +11,8 @@
 
 #include "helper/qahelper.hxx"
 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -95,6 +97,69 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, 
testCommentTextVAlignment)
u"Center"_ustr);
 }
 
+namespace
+{
+void testComplexIconSetsXLSX_Impl(const ScDocument& rDoc, SCCOL nCol, 
ScIconSetType eType)
+{
+ScConditionalFormat* pFormat = rDoc.GetCondFormat(nCol, 1, 0);
+CPPUNIT_ASSERT(pFormat);
+CPPUNIT_ASSERT_EQUAL(size_t(1), pFormat->size());
+const ScFormatEntry* pEntry = pFormat->GetEntry(0);
+CPPUNIT_ASSERT(pEntry);
+CPPUNIT_ASSERT_EQUAL(ScFormatEntry::Type::Iconset, pEntry->GetType());
+const ScIconSetFormat* pIconSet = static_cast(pEntry);
+CPPUNIT_ASSERT_EQUAL(eType, pIconSet->GetIconSetData()->eIconSetType);
+}
+
+void testCustomIconSetsXLSX_Impl(const ScDocument& rDoc, SCCOL nCol, SCROW 
nRow,
+ ScIconSetType eType, sal_Int32 nIndex)
+{
+ScConditionalFormat* pFormat = rDoc.GetCondFormat(nCol, 1, 1);
+CPPUNIT_ASSERT(pFormat);
+CPPUNIT_ASSERT_EQUAL(size_t(1), pFormat->size());
+const ScFormatEntry* pEntry = pFormat->GetEntry(0);
+CPPUNIT_ASSERT(pEntry);
+CPPUNIT_ASSERT_EQUAL(ScFormatEntry::Type::Iconset, pEntry->GetType());
+const ScIconSetFormat* pIconSet = static_cast(pEntry);
+std::unique_ptr 
pInfo(pIconSet->GetIconSetInfo(ScAddress(nCol, nRow, 1)));
+if (nIndex == -1)
+CPPUNIT_ASSERT(!pInfo);
+else
+{
+CPPUNIT_ASSERT(pInfo);
+CPPUNIT_ASSERT_EQUAL(nIndex, pInfo->nIconIndex);
+CPPUNIT_ASSERT_EQUAL(eType, pInfo->eIconSetType);
+}
+}
+}
+
+CPPUNIT_TEST_FIXTURE(ScExportTest4, testComplexIconSetsXLSX)
+{
+auto verify = [this]() {
+ScDocument* pDoc = getScDoc();
+CPPUNIT_ASSERT_EQUAL(size_t(3), pDoc->GetCondFormList(0)->size());
+testComplexIconSetsXLSX_Impl(*pDoc, 1, IconSet_3Triangles);
+testComplexIconSetsXLSX_Impl(*pDoc, 3, IconSet_3Stars);
+testComplexIconSetsXLSX_Impl(*pDoc, 5, IconSet_5Boxes);
+
+CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetCondFormList(1)->size());
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 1, IconSet_3ArrowsGray, 0);
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 2, IconSet_3ArrowsGray, -1);
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 3, IconSet_3Arrows, 1);
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 4, IconSet_3ArrowsGray, -1);
+testCustomIconSetsXLSX_Impl(*pDoc, 1, 5, IconSet_3Arrows, 2);
+
+testCustomIconSetsXLSX_Impl(*pDoc, 3, 1, IconSet_4RedToBlack, 3);
+testCustomIconSetsXLSX_Impl(*pDoc, 3, 2, IconSet_3TrafficLights1, 1);
+testCustomIconSetsXLSX_Impl(*pDoc, 3, 3, IconSet_3Arrows, 2);
+};
+
+createScDoc("xlsx/complex_icon_set.xlsx");
+verify();
+saveAndReload(u"Calc Office Open XML"_ustr);
+verify();
+}
+
 CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentTextHAlignment)
 {
 // Testing comment text alignments.
diff --git a/sc/qa/unit/subsequent_filters_test4.cxx 
b/sc/qa/unit/subsequent_filters_test4.cxx
index 0fc2b9d16767..3c24cf4a8a21 100644
--- a/sc/qa/unit/subsequent_filters_test4.cxx
+++ b/sc/qa/unit/subsequent_filters_test4.cxx
@@ -882,64 +882,6 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, 
testCondFormatThemeColor3XLSX)
 checkDatabarPositiveColor(pFormat, Color(217, 217, 217));
 }
 
-namespace
-{
-void testComplexIconSetsXLSX_Impl(const ScDocument& rDoc, SCCOL nCol, 
ScIconSetType eType)
-{
-ScConditionalFormat* pFormat = rDoc.GetCondFormat(nCol, 1, 0);
-CPPUNIT_ASSERT(pFormat);
-CPPUNIT_ASSERT_EQUAL(size_t(1), pFormat->size());
-const ScFormatEntry* pEntry = pFormat->GetEntry(0);
-CPPUNIT_ASSERT(pEntry);
-CPPUNIT_ASSERT_EQUAL(ScFormatEntry::Type::Iconset, pEntry->GetType());
-const ScIconSetFormat* pIconSet = static_cast(pEntry);
-CPPUNIT_ASSERT_EQUAL(eType, pIconSet->GetIconSetData()->eIconSetType);
-}
-
-void testCustomIconSetsXLSX_Impl(const ScDocument& rDoc, SCCOL nCol, SCROW 
nRow,
- ScIconSetType eType, sal_Int32 nIndex

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

2024-10-04 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/eehtml.cxx|   30 --
 editeng/source/editeng/eehtml.hxx|2 ++
 sw/source/uibase/docvw/AnnotationWin.cxx |7 ++-
 3 files changed, 36 insertions(+), 3 deletions(-)

New commits:
commit 26e4f2fdca356fd060bcafa5216c1a5de488510a
Author: Caolán McNamara 
AuthorDate: Wed Oct 2 14:18:45 2024 +0100
Commit: Miklos Vajna 
CommitDate: Fri Oct 4 09:53:12 2024 +0200

allow editeng html import to treat divs as inserting a newline

optional, currently cowardly defaulted off, except for the specific
use-case.

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

diff --git a/editeng/source/editeng/eehtml.cxx 
b/editeng/source/editeng/eehtml.cxx
index 3db92d077694..046bab27fbee 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -41,6 +41,7 @@ EditHTMLParser::EditHTMLParser( SvStream& rIn, OUString 
_aBaseURL, SvKeyValueIte
 mpEditEngine(nullptr),
 bInPara(false),
 bWasInPara(false),
+mbBreakForDivs(false),
 bFieldsInserted(false),
 bInTitle(false),
 nInTable(0),
@@ -57,7 +58,25 @@ EditHTMLParser::EditHTMLParser( SvStream& rIn, OUString 
_aBaseURL, SvKeyValueIte
 SetSwitchToUCS2( true );
 
 if ( pHTTPHeaderAttrs )
+{
 SetEncodingByHTTPHeader( pHTTPHeaderAttrs );
+SetBreakForDivs(*pHTTPHeaderAttrs);
+}
+}
+
+void EditHTMLParser::SetBreakForDivs(SvKeyValueIterator& rHTTPHeader)
+{
+SvKeyValue aKV;
+bool bCont = rHTTPHeader.GetFirst(aKV);
+while (bCont)
+{
+if (aKV.GetKey() == "newline-on-div")
+{
+mbBreakForDivs = aKV.GetValue() == "true";
+break;
+}
+bCont = rHTTPHeader.GetNext(aKV);
+}
 }
 
 EditHTMLParser::~EditHTMLParser()
@@ -290,6 +309,15 @@ void EditHTMLParser::NextToken( HtmlTokenId nToken )
 nInCell++;
 Newline();
 break;
+
+case HtmlTokenId::DIVISION_ON:
+case HtmlTokenId::DIVISION_OFF:
+{
+if (mbBreakForDivs)
+Newline();
+break;
+}
+
 case HtmlTokenId::BLOCKQUOTE_ON:
 case HtmlTokenId::BLOCKQUOTE_OFF:
 case HtmlTokenId::BLOCKQUOTE30_ON:
@@ -356,8 +384,6 @@ void EditHTMLParser::NextToken( HtmlTokenId nToken )
 // HTML 3.0
 case HtmlTokenId::BANNER_ON:
 case HtmlTokenId::BANNER_OFF:
-case HtmlTokenId::DIVISION_ON:
-case HtmlTokenId::DIVISION_OFF:
 //  case HtmlTokenId::LISTHEADER_ON://! special handling
 //  case HtmlTokenId::LISTHEADER_OFF:
 case HtmlTokenId::NOTE_ON:
diff --git a/editeng/source/editeng/eehtml.hxx 
b/editeng/source/editeng/eehtml.hxx
index 9f8009c715c8..0cdb1c8553e8 100644
--- a/editeng/source/editeng/eehtml.hxx
+++ b/editeng/source/editeng/eehtml.hxx
@@ -45,6 +45,7 @@ private:
 
 boolbInPara:1;
 boolbWasInPara:1; // Remember bInPara before 
HeadingStart, because afterwards it will be gone.
+boolmbBreakForDivs:1; // Create newlines on 
encountering divs
 boolbFieldsInserted:1;
 boolbInTitle:1;
 
@@ -68,6 +69,7 @@ private:
 voidImpSetAttribs( const SfxItemSet& rItems );
 voidImpSetStyleSheet( sal_uInt16 nHeadingLevel );
 
+voidSetBreakForDivs(SvKeyValueIterator& rHTTPHeader);
 protected:
 virtual voidNextToken( HtmlTokenId nToken ) override;
 
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx 
b/sw/source/uibase/docvw/AnnotationWin.cxx
index 41e5bac03dc5..3bb933f61fbd 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -32,6 +32,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -490,7 +491,11 @@ void SwAnnotationWin::UpdateHTML(const OUString& rHtml)
 OString sHtmlContent(rHtml.toUtf8());
 SvMemoryStream aHTMLStream(const_cast(sHtmlContent.getStr()),
sHtmlContent.getLength(), StreamMode::READ);
-GetOutlinerView()->Read(aHTMLStream, EETextFormat::Html, nullptr);
+SvKeyValueIteratorRef xValues(new SvKeyValueIterator);
+// Insert newlines for divs, not normally done, so to keep things simple
+// only enable tthat for this case.
+xValues->Append(SvKeyValue("newline-on-div", "true"));
+GetOutlinerView()->Read(aHTMLStream, EETextFormat::Html, xValues.get());
 UpdateData();
 }
 


core.git: sc/source

2024-10-04 Thread Rashesh (via logerrit)
 sc/source/ui/app/inputhdl.cxx |   14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

New commits:
commit 263e0c5665a45bc181ac00803127ce2e12dfadc0
Author: Rashesh 
AuthorDate: Fri Sep 13 15:48:16 2024 +0530
Commit: vivek javiya 
CommitDate: Fri Oct 4 12:26:43 2024 +0200

cool#10040: fix: send LOK_CALLBACK_CELLFORMULA with LOK formulabar update

- we were not getting the cell content when we are editing cell using
formulabar in online. This message is important to autocomplete formulas
in online.

Change-Id: I62da49cb8800583931ffefcc39ab181ab9562eb6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/17
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
(cherry picked from commit 67699071ba8bf51055028ea185b0afc2a1540f9e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174006
Reviewed-by: vivek javiya 
Tested-by: Jenkins

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index e2401b7f915d..d6b7544d33cb 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2806,15 +2806,6 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, 
bool bSetModified )
 // If we will end up updating LoKit at the end, we can skip it here
 pInputWin->SetTextString(aText, !bUpdateKit);
 }
-
-if (comphelper::LibreOfficeKit::isActive())
-{
-if (pActiveViewSh)
-{
-// TODO: deprecated?
-
pActiveViewSh->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_FORMULA, 
aText.toUtf8());
-}
-}
 }
 
 // If the cursor is before the end of a paragraph, parts are being pushed 
to
@@ -2857,8 +2848,10 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, 
bool bSetModified )
 if (pActiveView)
 aSel = pActiveView->GetSelection();
 
+OUString aText = ScEditUtil::GetMultilineString(*mpEditEngine);
+pActiveViewSh->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_FORMULA, 
aText.toUtf8());
 pActiveViewSh->LOKSendFormulabarUpdate(pActiveView,
-   
ScEditUtil::GetMultilineString(*mpEditEngine),
+   aText,
aSel);
 }
 
@@ -4365,7 +4358,6 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* 
pState,
 aSel.nEndPara = 0;
 
 pActiveViewSh->LOKSendFormulabarUpdate(pActiveView, 
aString, aSel);
-// TODO: deprecated?
 
pActiveViewSh->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_FORMULA, 
aString.toUtf8());
 }
 }


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

2024-10-04 Thread Caolán McNamara (via logerrit)
 editeng/source/editeng/editview.cxx  |5 ++
 editeng/source/editeng/impedit.hxx   |1 
 editeng/source/editeng/impedit4.cxx  |   55 +++
 include/editeng/editview.hxx |1 
 sw/inc/AnnotationWin.hxx |2 +
 sw/source/uibase/docvw/AnnotationWin.cxx |5 ++
 sw/source/uibase/docvw/PostItMgr.cxx |1 
 sw/source/uibase/uno/unotxdoc.cxx|1 
 8 files changed, 71 insertions(+)

New commits:
commit ac5d2b5bad52179f2930f9baac8f78ec90d7ee11
Author: Caolán McNamara 
AuthorDate: Wed Oct 2 14:20:55 2024 +0100
Commit: Miklos Vajna 
CommitDate: Fri Oct 4 13:30:32 2024 +0200

add a 'simple-html' export to editeng

currently justs supports hyperlinks and nothing else over plain
text.

puts each paragraph in a separate div

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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index d4b60fecf415..0be3f1d1cb96 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -666,6 +666,11 @@ ErrCode EditView::Read( SvStream& rInput, EETextFormat 
eFormat, SvKeyValueIterat
 return rInput.GetError();
 }
 
+OString EditView::GetSimpleHtml() const
+{
+return pImpEditView->pEditEngine->pImpEditEngine->GetSimpleHtml();
+}
+
 void EditView::Cut()
 {
 Reference 
aClipBoard(GetClipboard());
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 6c6ddf43f135..58a72816d8fb 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -929,6 +929,7 @@ public:
 
 EditPaM Read(SvStream& rInput, const OUString& rBaseURL, 
EETextFormat eFormat, const EditSelection& rSel, SvKeyValueIterator* 
pHTTPHeaderAttrs = nullptr);
 voidWrite(SvStream& rOutput, EETextFormat eFormat, const 
EditSelection& rSel);
+OString GetSimpleHtml() const;
 
 std::unique_ptr CreateTextObject();
 std::unique_ptr CreateTextObject(const EditSelection& 
rSel);
diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index d3dc29892d6a..adbdf2ccee62 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -58,6 +58,7 @@
 #include 
 #include "textconv.hxx"
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1039,6 +1040,60 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& 
rItem, SvStream& rOutput,
 }
 }
 
+// Currently not good enough to be used for a ::Write of EETextFormat::Html, it
+// only supports hyperlinks over plain text
+OString ImpEditEngine::GetSimpleHtml() const
+{
+OStringBuffer aOutput;
+
+sal_Int32 nStartNode = 0;
+sal_Int32 nEndNode = maEditDoc.Count()-1;
+
+// iterate over the paragraphs ...
+for (sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++)
+{
+const ContentNode* pNode = maEditDoc.GetObject( nNode );
+
+const ParaPortion* pParaPortion = FindParaPortion( pNode );
+
+sal_Int32 nIndex = 0;
+sal_Int32 nEndPortion = pParaPortion->GetTextPortions().Count() - 1;
+
+aOutput.append("");
+for (sal_Int32 n = 0; n <= nEndPortion; n++)
+{
+const TextPortion& rTextPortion = 
pParaPortion->GetTextPortions()[n];
+
+const SvxURLField* pURLField = nullptr;
+if ( rTextPortion.GetKind() == PortionKind::FIELD )
+{
+const EditCharAttrib* pAttr = 
pNode->GetCharAttribs().FindFeature(nIndex);
+const SvxFieldItem* pFieldItem = dynamic_cast(pAttr->GetItem());
+if( pFieldItem )
+{
+const SvxFieldData* pFieldData = pFieldItem->GetField();
+pURLField = dynamic_cast(pFieldData);
+}
+}
+
+OUString aRTFStr = EditDoc::GetParaAsString(pNode, nIndex, nIndex 
+ rTextPortion.GetLen());
+if (pURLField)
+aOutput.append("GetURL().toUtf8() + 
"\">");
+
+aOutput.append(HTMLOutFuncs::ConvertStringToHTML(aRTFStr));
+
+if (pURLField)
+aOutput.append("");
+
+nIndex = nIndex + rTextPortion.GetLen();
+}
+
+aOutput.append("");
+}
+
+return aOutput.makeStringAndClear();
+}
+
 std::unique_ptr ImpEditEngine::GetEmptyTextObject()
 {
 EditSelection aEmptySel;
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 0bafa99bb35f..852e43e9e5ff 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -279,6 +279,7 @@ public:
 voidRemoveAttribsKeepLanguages( bool bRemoveParaAttribs );
 
 ErrCode Read( SvStream& rInput, EETextFormat eFormat, 
SvKeyValueI

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

2024-10-04 Thread Jonathan Clark (via logerrit)
 i18nutil/qa/cppunit/test_kashida.cxx |2 +-
 i18nutil/source/utility/kashida.cxx  |   19 ++-
 sw/source/core/text/itradj.cxx   |   15 ---
 sw/source/core/text/porlay.cxx   |   23 ++-
 4 files changed, 37 insertions(+), 22 deletions(-)

New commits:
commit 99c7cf2816b2d0016832552dbe6c55456ade42e0
Author: Jonathan Clark 
AuthorDate: Fri Oct 4 11:50:25 2024 -0600
Commit: Jonathan Clark 
CommitDate: Sat Oct 5 00:05:05 2024 +0200

crashtesting: fix font-dependent infinite loop in kashida justification

Commit c3c29d31d77ff93aa50634cfd51c62d12dc0f6ec (tdf#140767 Implemented
Syriac justification) indirectly introduced a font-dependent infinite
loop in Writer layout by relaxing some restrictions on kashida candidate
positions. The infinite loop was found in tdf97806-2.odt.

This change fixes an underlying logic bug in Writer, which caused Writer
to attempt to apply kashida justification to non-Arabic/Syriac CTL
scripts. This change also reintroduces some of the previously-lifted
restrictions on kashida candidate positions.

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

diff --git a/i18nutil/qa/cppunit/test_kashida.cxx 
b/i18nutil/qa/cppunit/test_kashida.cxx
index e0526c4c8f93..fa47e4cf135f 100644
--- a/i18nutil/qa/cppunit/test_kashida.cxx
+++ b/i18nutil/qa/cppunit/test_kashida.cxx
@@ -86,7 +86,7 @@ void KashidaTest::testNoZwnjExpansion()
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0), 
GetWordKashidaPosition(u"نویس\u200Cه"_ustr).value().nIndex);
 
 CPPUNIT_ASSERT_EQUAL(sal_Int32(1), 
GetWordKashidaPosition(u"متن"_ustr).value().nIndex);
-CPPUNIT_ASSERT_EQUAL(sal_Int32(0), 
GetWordKashidaPosition(u"مت\u200Cن"_ustr).value().nIndex);
+CPPUNIT_ASSERT(!GetWordKashidaPosition(u"مت\u200Cن"_ustr).has_value());
 }
 
 // tdf#163105: Do not insert kashida if the position is invalid
diff --git a/i18nutil/source/utility/kashida.cxx 
b/i18nutil/source/utility/kashida.cxx
index a992e5c8e643..aff667033a11 100644
--- a/i18nutil/source/utility/kashida.cxx
+++ b/i18nutil/source/utility/kashida.cxx
@@ -134,6 +134,13 @@ bool CanConnectToPrev(sal_Unicode cCh, sal_Unicode cPrevCh)
 return bRet;
 }
 
+bool isSyriacChar(sal_Unicode cCh)
+{
+return (cCh >= 0x700 && cCh <= 0x74F) || (cCh >= 0x860 && cCh <= 0x86A);
+}
+
+bool isArabicChar(sal_Unicode cCh) { return cCh >= 0x60C && cCh <= 0x6FE; }
+
 std::optional
 GetWordKashidaPositionArabic(const OUString& rWord, const std::vector& 
pValidPositions)
 {
@@ -283,7 +290,7 @@ GetWordKashidaPositionArabic(const OUString& rWord, const 
std::vector& pVa
 {
 // Reh, Zain (right joining) final form may appear in the middle 
of word
 // All others except Yeh - only at end of word
-if (isRehChar(cCh) || (0x60C <= cCh && 0x6FE >= cCh && nIdx == 
nWordLen - 1))
+if (isRehChar(cCh) || (isArabicChar(cCh) && nIdx == nWordLen - 1))
 {
 SAL_WARN_IF(0 == cPrevCh, "i18n", "No previous character");
 // check if character is connectable to previous character,
@@ -295,7 +302,8 @@ GetWordKashidaPositionArabic(const OUString& rWord, const 
std::vector& pVa
 }
 
 // 8. Try any valid position
-if (nPriorityLevel >= 7 && nIdx > 0)
+if (nPriorityLevel >= 7 && nIdx > 0 && isArabicChar(cPrevCh) && 
isArabicChar(cCh)
+&& !pValidPositions.empty())
 {
 fnTryInsertBefore(7);
 }
@@ -339,7 +347,7 @@ GetWordKashidaPositionSyriac(const OUString& rWord, const 
std::vector& pVa
 
 sal_Int32 nWordMidpoint = nWordLen / 2;
 
-auto fnPositionValid = [&pValidPositions](sal_Int32 nIdx) {
+auto fnPositionValid = [&pValidPositions, &rWord](sal_Int32 nIdx) {
 // Exclusions:
 
 // tdf#163105: Do not insert kashida if the position is invalid
@@ -348,7 +356,8 @@ GetWordKashidaPositionSyriac(const OUString& rWord, const 
std::vector& pVa
 return false;
 }
 
-return true;
+sal_Unicode cCh = rWord[nIdx];
+return isSyriacChar(cCh);
 };
 
 // End to midpoint
@@ -385,7 +394,7 @@ i18nutil::GetWordKashidaPosition(const OUString& rWord, 
const std::vector&
 {
 auto cCh = rWord[nIdx];
 
-if ((cCh >= 0x700 && cCh <= 0x74F) || (cCh >= 0x860 && cCh <= 0x86A))
+if (isSyriacChar(cCh))
 {
 // This word contains Syriac characters.
 return GetWordKashidaPositionSyriac(rWord, pValidPositions);
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index c072025e7a96..be004457b407 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -167,10 +167,11 @@ static bool lcl_CheckKashidaPositions(SwScriptInfo& rSI, 
SwTextSizeInfo& rInf, S
 const OUS

core.git: accessibility/inc

2024-10-04 Thread Caolán McNamara (via logerrit)
 accessibility/inc/extended/AccessibleBrowseBox.hxx |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 67158da00e965c90495bb4f339ea25bbec898c60
Author: Caolán McNamara 
AuthorDate: Fri Oct 4 14:22:22 2024 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 4 20:30:27 2024 +0200

cid#1608061 Data race condition

and

cid#1607995 Data race condition

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

diff --git a/accessibility/inc/extended/AccessibleBrowseBox.hxx 
b/accessibility/inc/extended/AccessibleBrowseBox.hxx
index a81ace673c88..50486973d4cd 100644
--- a/accessibility/inc/extended/AccessibleBrowseBox.hxx
+++ b/accessibility/inc/extended/AccessibleBrowseBox.hxx
@@ -194,7 +194,7 @@ private:
 class AccessibleBrowseBoxAccess final : public ::vcl::IAccessibleBrowseBox
 {
 private:
-std::mutex  m_aMutex;
+mutable std::mutex  m_aMutex;
 css::uno::Reference< css::accessibility::XAccessible >
 m_xParent;
 ::vcl::IAccessibleTableProvider&m_rBrowseBox;
@@ -218,39 +218,39 @@ private:
 void dispose() override;
 virtual bool isAlive() const override
 {
+std::unique_lock aGuard(m_aMutex);
 return m_xContext.is() && m_xContext->isAlive();
 }
 virtual css::uno::Reference< css::accessibility::XAccessible >
 getHeaderBar( AccessibleBrowseBoxObjType _eObjType ) override
 {
-css::uno::Reference< css::accessibility::XAccessible > xAccessible;
-if (m_xContext)
-xAccessible = m_xContext->getHeaderBar( _eObjType );
-return xAccessible;
+std::unique_lock aGuard(m_aMutex);
+return m_xContext ? m_xContext->getHeaderBar(_eObjType) : nullptr;
 }
 virtual css::uno::Reference< css::accessibility::XAccessible >
 getTable() override
 {
-css::uno::Reference< css::accessibility::XAccessible > xAccessible;
-if (m_xContext)
-xAccessible = m_xContext->getTable();
-return xAccessible;
+std::unique_lock aGuard(m_aMutex);
+return m_xContext ? m_xContext->getTable() : nullptr;
 }
 virtual void commitHeaderBarEvent( sal_Int16 nEventId, const 
css::uno::Any& rNewValue,
 const css::uno::Any& rOldValue, bool _bColumnHeaderBar ) override
 {
+std::unique_lock aGuard(m_aMutex);
 if (m_xContext)
 m_xContext->commitHeaderBarEvent( nEventId, rNewValue, rOldValue, 
_bColumnHeaderBar );
 }
 virtual void commitTableEvent( sal_Int16 nEventId,
 const css::uno::Any& rNewValue, const css::uno::Any& rOldValue ) 
override
 {
+std::unique_lock aGuard(m_aMutex);
 if (m_xContext)
 m_xContext->commitTableEvent( nEventId, rNewValue, rOldValue );
 }
 virtual void commitEvent( sal_Int16 nEventId,
 const css::uno::Any& rNewValue, const css::uno::Any& rOldValue ) 
override
 {
+std::unique_lock aGuard(m_aMutex);
 if (m_xContext)
 m_xContext->commitEvent( nEventId, rNewValue, rOldValue );
 }


core.git: 2 commits - cppuhelper/source cui/source jvmfwk/source

2024-10-04 Thread Caolán McNamara (via logerrit)
 cppuhelper/source/servicemanager.cxx |1 +
 cui/source/customize/cfg.cxx |1 +
 jvmfwk/source/framework.cxx  |3 ++-
 3 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 037efad7b73f183a5d54808fa12c519276a8e7ce
Author: Caolán McNamara 
AuthorDate: Thu Oct 3 09:33:36 2024 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 4 20:30:58 2024 +0200

cid#1607024 silence Overflowed constant

and

cid#1607900 silence Overflowed constant

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

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index ddc8afcda681..295ca5a034e9 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -1466,6 +1466,7 @@ OUString cppuhelper::ServiceManager::readLegacyRdbString(
 }
 OUString val;
 std::vector< char > v(s); // assuming sal_uInt32 fits into 
vector::size_type
+assert(s > 0 && "throw above otherwise");
 if (subkey.getValue(OUString(), v.data()) != RegError::NO_ERROR
 || v.back() != '
 || !rtl_convertStringToUString(
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 6907a2dcaaf5..04db1bf78dca 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2983,6 +2983,7 @@ bool SvxIconSelectorDialog::ReplaceGraphicItem(
 for (size_t n = 0; n < nCount; ++n)
 {
 sal_uInt16 nId = m_xTbSymbol->GetItemId( n );
+assert(nId > 0 && "otherwise totally broken");
 
 if ( m_xTbSymbol->GetItemText( nId ) == aURL )
 {
commit ed75a40d3c971ed9b74a0a130d9d082bdf751589
Author: Caolán McNamara 
AuthorDate: Thu Oct 3 13:07:51 2024 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 4 20:30:43 2024 +0200

cid#1606631 Overflowed constant

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

diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index eea9cc92c388..a20d08fd1a99 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -159,7 +159,8 @@ std::vector 
jfw_convertUserPathList(std::u16string_view sUserPath)
 if (nBootstrapVarEnd == std::u16string_view::npos)
 {
 // Current colon is part of bootstrap variable - skip it!
-nextColon = sUserPath.find(SAL_PATHSEPARATOR, nextColon + 
1);
+const auto nAfterColon = (nextColon != 
std::string_view::npos) ? (nextColon + 1) : 0;
+nextColon = sUserPath.find(SAL_PATHSEPARATOR, nAfterColon);
 if (nextColon != 0 && nextColon != 
std::u16string_view::npos)
 sToken = sUserPath.substr(nIdx, nextColon - nIdx);
 else


core.git: sfx2/source

2024-10-04 Thread Ilmari Lauhakangas (via logerrit)
 sfx2/source/control/recentdocsviewitem.cxx |8 
 sfx2/source/control/recentdocsviewitem.hxx |2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit f37542a29121ce64a306abb2c7e4d572cf245e35
Author: Ilmari Lauhakangas 
AuthorDate: Fri Oct 4 18:18:07 2024 +0300
Commit: Andreas Heinisch 
CommitDate: Fri Oct 4 19:48:29 2024 +0200

Make Start Center pin icon highlight behave as intended

After
commit 9a37652b79001bf5208841b9221dee851b9b6d0f
Author: Andreas Heinisch 
Date:   Wed Sep 6 17:03:26 2023 +0200

tdf#156959 - Remove pinned icons from thumbnail view item

Remove pinned icons from thumbnail view item and pushed it down
to the recent documents view item. This avoids that the pinned
icon will be shown in a simple thumbnail view, e.g., in the
thumbnail view of the side pane in base.

In addition, fixed an error with the number of elements in the
thumbnail view in the start center when items are pinned, i.e.,
removed a spurious new line.

... the pin icon stopped changing its state to highlighted.

I believe my commit makes it work like Andreas intended.

Also fix a typo in a member name to prevent accidents in the future.

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

diff --git a/sfx2/source/control/recentdocsviewitem.cxx 
b/sfx2/source/control/recentdocsviewitem.cxx
index d5ae52e297d8..e557c66fdb77 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -134,7 +134,7 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView 
&rView, const OUStri
   m_bPinned(isPinned),
   m_bPinnedIconHighlighted(false),
   m_aPinnedDocumentBitmap(BMP_PIN_DOC),
-  m_aPinnedDocumentBitmapHiglighted(BMP_PIN_DOC_HIGHLIGHTED)
+  m_aPinnedDocumentBitmapHighlighted(BMP_PIN_DOC_HIGHLIGHTED)
 {
 OUString aTitle(rTitle);
 INetURLObject aURLObj(rURL);
@@ -311,7 +311,8 @@ void 
RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc
 // tdf#38742 - draw pinned icon
 const Point aPinnedIconPos(getPinnedIconArea().TopLeft());
 aSeq.push_back(new DiscreteBitmapPrimitive2D(
-m_aPinnedDocumentBitmap, B2DPoint(aPinnedIconPos.X(), 
aPinnedIconPos.Y(;
+m_bPinnedIconHighlighted ? m_aPinnedDocumentBitmapHighlighted : 
m_aPinnedDocumentBitmap,
+B2DPoint(aPinnedIconPos.X(), aPinnedIconPos.Y(;
 
 pProcessor->process(aSeq);
 }
@@ -321,8 +322,7 @@ void 
RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc
 const Point aPinnedIconPos(getPinnedIconArea().TopLeft());
 drawinglayer::primitive2d::Primitive2DContainer aSeq {
 new DiscreteBitmapPrimitive2D(
-m_bPinnedIconHighlighted ? m_aPinnedDocumentBitmapHiglighted : 
m_aPinnedDocumentBitmap,
-B2DPoint(aPinnedIconPos.X(), aPinnedIconPos.Y())) };
+m_aPinnedDocumentBitmap, B2DPoint(aPinnedIconPos.X(), 
aPinnedIconPos.Y())) };
 
 pProcessor->process(aSeq);
 }
diff --git a/sfx2/source/control/recentdocsviewitem.hxx 
b/sfx2/source/control/recentdocsviewitem.hxx
index 9fd1b760b08f..3c5a5a6973f3 100644
--- a/sfx2/source/control/recentdocsviewitem.hxx
+++ b/sfx2/source/control/recentdocsviewitem.hxx
@@ -68,7 +68,7 @@ private:
 bool m_bPinned;
 bool m_bPinnedIconHighlighted;
 BitmapEx m_aPinnedDocumentBitmap;
-BitmapEx m_aPinnedDocumentBitmapHiglighted;
+BitmapEx m_aPinnedDocumentBitmapHighlighted;
 };
 
 #endif // INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX