[Libreoffice-commits] core.git: include/svx sc/source sd/source svx/qa svx/source sw/source

2023-01-19 Thread Attila Szűcs (via logerrit)
 include/svx/svdmodel.hxx|4 +
 sc/source/ui/docshell/docsh.cxx |2 
 sd/source/ui/docshell/docshel4.cxx  |1 
 svx/qa/unit/data/tdf148000_EOLinCurvedText.pptx |binary
 svx/qa/unit/data/tdf148000_EOLinCurvedText_Legacy.odp   |binary
 svx/qa/unit/data/tdf148000_EOLinCurvedText_New.odp  |binary
 svx/qa/unit/svdraw.cxx  |   42 +++
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |   57 
 svx/source/svdraw/svdmodel.cxx  |   42 +++
 sw/source/uibase/app/docshini.cxx   |   10 +-
 10 files changed, 142 insertions(+), 16 deletions(-)

New commits:
commit f9d6dd788e82a1964dab9cc0d0436c8c54b775c0
Author: Attila Szűcs 
AuthorDate: Fri Jan 13 04:49:33 2023 +0100
Commit: Miklos Vajna 
CommitDate: Fri Jan 20 07:56:29 2023 +

tdf#148000 impress: Handle linebreaks on fontwork.

Split text lines in a paragraph, right before polygons are created
for rendering, so eol will brake line in fontwork just like eop.

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

diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 7c23b5a24712..b5d93fa53eb7 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -575,6 +575,10 @@ public:
 void SetAnchoredTextOverflowLegacy(bool bEnabled);
 bool IsAnchoredTextOverflowLegacy() const;
 
+// tdf#148000 compatibility flag
+void SetLegacySingleLineFontwork(bool bEnabled);
+bool IsLegacySingleLineFontwork() const;
+
 void ReformatAllTextObjects();
 
 std::unique_ptr createOutliner( OutlinerMode nOutlinerMode );
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 071c2530f61b..1f58bf43f1b7 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -589,6 +589,8 @@ bool ScDocShell::Load( SfxMedium& rMedium )
 {
 if (m_pDocument->GetDrawLayer())
 m_pDocument->GetDrawLayer()->SetAnchoredTextOverflowLegacy(true);
+if (m_pDocument->GetDrawLayer())
+m_pDocument->GetDrawLayer()->SetLegacySingleLineFontwork(true); 
//for tdf#148000
 }
 
 GetUndoManager()->Clear();
diff --git a/sd/source/ui/docshell/docshel4.cxx 
b/sd/source/ui/docshell/docshel4.cxx
index 99d6890fe1f0..4df8aee97a4a 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -269,6 +269,7 @@ bool DrawDocShell::Load( SfxMedium& rMedium )
 if (IsOwnStorageFormat(rMedium))
 {
 mpDoc->SetAnchoredTextOverflowLegacy(true);
+mpDoc->SetLegacySingleLineFontwork(true); //for tdf#148000
 }
 
 bool   bRet = false;
diff --git a/svx/qa/unit/data/tdf148000_EOLinCurvedText.pptx 
b/svx/qa/unit/data/tdf148000_EOLinCurvedText.pptx
new file mode 100644
index ..137fc816697a
Binary files /dev/null and b/svx/qa/unit/data/tdf148000_EOLinCurvedText.pptx 
differ
diff --git a/svx/qa/unit/data/tdf148000_EOLinCurvedText_Legacy.odp 
b/svx/qa/unit/data/tdf148000_EOLinCurvedText_Legacy.odp
new file mode 100644
index ..13e7cc4e5c8a
Binary files /dev/null and 
b/svx/qa/unit/data/tdf148000_EOLinCurvedText_Legacy.odp differ
diff --git a/svx/qa/unit/data/tdf148000_EOLinCurvedText_New.odp 
b/svx/qa/unit/data/tdf148000_EOLinCurvedText_New.odp
new file mode 100644
index ..7ebdb9431b72
Binary files /dev/null and b/svx/qa/unit/data/tdf148000_EOLinCurvedText_New.odp 
differ
diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx
index c2a7f244b8ab..7bf1ceb9d4a1 100644
--- a/svx/qa/unit/svdraw.cxx
+++ b/svx/qa/unit/svdraw.cxx
@@ -382,6 +382,48 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testFontWorks)
 "32");
 }
 
+CPPUNIT_TEST_FIXTURE(SvdrawTest, testTdf148000_EOLinCurvedText)
+{
+std::vector aFilenames
+= { u"tdf148000_EOLinCurvedText.pptx", 
u"tdf148000_EOLinCurvedText_New.odp",
+u"tdf148000_EOLinCurvedText_Legacy.odp" };
+
+for (int i = 0; i < 3; i++)
+{
+loadFromURL(aFilenames[i]);
+
+SdrPage* pSdrPage = getFirstDrawPageWithAssert();
+
+xmlDocUniquePtr pXmlDoc = 
lcl_dumpAndParseFirstObjectWithAssert(pSdrPage);
+
+OString aBasePath
+= 
"/primitive2D/objectinfo[4]/unhandled/unhandled/polypolygoncolor/polypolygon/";
+
+// The text is: "O" + eop + "O" + eol + "O"
+// It should be displayed as 3 line of text. (1 "O" letter in every 
line)
+sal_Int32 nY1 = getXPath(pXmlDoc, aBasePath + "polygon[1]/point[1]", 
"y").toInt32();
+sal_Int32 nY2 = getXPath(pXmlDoc, aBasePath + "polygon[3]/point[1]", 
"y").toInt32();
+sal_Int32 nY3 = getXPath(pXmlDoc, aBasePath + "polygon[5]/point[1]", 
"y").toInt32();
+
+sal_Int32 nDiff21 

[Libreoffice-commits] core.git: include/vcl sw/qa sw/source vcl/source

2023-01-19 Thread Miklos Vajna (via logerrit)
 include/vcl/filter/PDFiumLibrary.hxx |1 +
 sw/qa/core/text/text.cxx |   24 
 sw/source/core/text/itrform2.cxx |   22 ++
 vcl/source/pdf/PDFiumLibrary.cxx |   31 +++
 4 files changed, 66 insertions(+), 12 deletions(-)

New commits:
commit 14da39fcfffe8006a79971ac0b670e12d0d7a0ea
Author: Miklos Vajna 
AuthorDate: Thu Jan 19 19:53:12 2023 +0100
Commit: Miklos Vajna 
CommitDate: Fri Jan 20 07:50:29 2023 +

tdf#153047 sw: fix PDF export of content controls in placeholder mode

Importing an inline content control from DOCX used to be just plain text
in Writer, so the PDF export of that was also just plain text.

Now that content controls are actually supported, we used to not emit
them as plain text in the PDF export, since
82d90529dc2b3cb8359dec78852cbd910a66d275 (sw content controls, rich
text: add initial PDF export, 2022-09-12). Part of this was to write the
string value of the content control as the /V (value) key of the form,
when it's not in placeholder mode. This made sure that once the form is
filled in, no overlap between the plain text and the filled in text
happens.

Try to support both use-cases at the same time by also mapping the value
of the content control to /V, even if it's in placeholder mode. This
keeps avoiding the unwanted overlap, but this way the placeholder text
is no longer lost on PDF export.

An alternative would have been to map the placeholder text to
description when the alias/title is empty, but that would show up only
as a mouse tooltip, so won't change the behavior when the PDF is
printed.

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

diff --git a/include/vcl/filter/PDFiumLibrary.hxx 
b/include/vcl/filter/PDFiumLibrary.hxx
index 347b64619045..9c278d281a1c 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -110,6 +110,7 @@ public:
 virtual OUString getFormAdditionalActionJavaScript(PDFiumDocument* pDoc,
PDFAnnotAActionType 
eEvent)
 = 0;
+virtual OUString getFormFieldValue(PDFiumDocument* pDoc) = 0;
 };
 
 class PDFiumTextPage;
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index db1895b795c0..9391630acd51 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -675,6 +675,30 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDF)
  
pAnnotation->getFormFieldAlternateName(pPdfDocument.get()));
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPlaceholderPDF)
+{
+// Given a file with a content control, in placeholder mode:
+createSwDoc();
+SwDoc* pDoc = getSwDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+pWrtShell->InsertContentControl(SwContentControlType::RICH_TEXT);
+
+// When exporting to PDF:
+save("writer_pdf_Export");
+
+// Then make sure that a fillable form widget is emitted with the expected 
value:
+std::unique_ptr pPdfDocument = parsePDFExport();
+std::unique_ptr pPage = pPdfDocument->openPage(0);
+CPPUNIT_ASSERT_EQUAL(1, pPage->getAnnotationCount());
+std::unique_ptr pAnnotation = 
pPage->getAnnotation(0);
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: Click here to enter text
+// - Actual  :
+// i.e. the value of the content control was empty, the placeholder value 
was lost.
+CPPUNIT_ASSERT_EQUAL(SwResId(STR_CONTENT_CONTROL_PLACEHOLDER),
+ pAnnotation->getFormFieldValue(pPdfDocument.get()));
+}
+
 CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testCheckboxContentControlPDF)
 {
 // Given a file with a checkbox content control:
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 9f075014fd9a..91f73ed87825 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1047,18 +1047,16 @@ bool SwContentControlPortion::DescribePDFControl(const 
SwTextPaintInfo& rInf) co
 pDescriptor->Description = pContentControl->GetAlias();
 }
 
-if (!pContentControl->GetShowingPlaceHolder())
-{
-SwPosition aPoint(*pTextNode, nStart);
-SwPosition aMark(*pTextNode, nEnd);
-SwPaM aPam(aMark, aPoint);
-OUString aText = aPam.GetText();
-static sal_Unicode const aForbidden[] = {
-CH_TXTATR_BREAKWORD,
-0
-};
-pDescriptor->Text = comphelper::string::removeAny(aText, aForbidden);
-}
+// Map the text of the content control to the descriptor's text.
+SwPosition aPoint(*pTextNode, nStart);
+SwPosition aMark(*pTextNode, nEnd);
+SwPaM aPam(aMark, aPo

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svx/source

2023-01-19 Thread Andrea Gelmini (via logerrit)
 svx/source/styles/ColorSets.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 126018f3dee60462207380eba017d0fac6d6b0f8
Author: Andrea Gelmini 
AuthorDate: Sat Jan 14 18:49:26 2023 +0100
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:16:26 2023 +

Typo in "code"

Not sure about this...

Change-Id: I8aebfdf48dc7dc2bdbce180fa2f1bd3305489a24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145516
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 92e6cd75a3599d3d411d123bd1e691ec447fa563)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145856
Tested-by: Tomaž Vajngerl 

diff --git a/svx/source/styles/ColorSets.cxx b/svx/source/styles/ColorSets.cxx
index 439c63d1ee35..66a5e3e91016 100644
--- a/svx/source/styles/ColorSets.cxx
+++ b/svx/source/styles/ColorSets.cxx
@@ -252,7 +252,7 @@ void ColorSets::init()
 maColorSets.push_back(aColorSet);
 }
 {
-ColorSet aColorSet("Forrest");
+ColorSet aColorSet("Forest");
 aColorSet.add(model::ThemeColorType::Dark1, 0x00);
 aColorSet.add(model::ThemeColorType::Light1, 0xFF);
 aColorSet.add(model::ThemeColorType::Dark2, 0x00);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/sfx2 include/svx officecfg/registry svx/Library_svx.mk svx/sdi svx/source svx/uiconfig svx/UIConfig_svx.mk sw/sdi sw/source

2023-01-19 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/sfxsids.hrc |1 
 include/svx/dialog/ThemeDialog.hxx   |   42 ++
 include/svx/theme/IThemeColorChanger.hxx |   26 +
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |8 
 svx/Library_svx.mk   |1 
 svx/UIConfig_svx.mk  |1 
 svx/sdi/svx.sdi  |   17 +
 svx/source/dialog/ThemeDialog.cxx|   63 

 svx/uiconfig/ui/themedialog.ui   |  145 
++
 sw/sdi/_basesh.sdi   |7 
 sw/source/core/inc/ThemeColorChanger.hxx |7 
 sw/source/core/model/ThemeColorChanger.cxx   |2 
 sw/source/uibase/shells/basesh.cxx   |   26 +
 sw/uiconfig/sglobal/menubar/menubar.xml  |1 
 sw/uiconfig/swriter/menubar/menubar.xml  |1 
 15 files changed, 346 insertions(+), 2 deletions(-)

New commits:
commit 1484112b94baef357c91e2e872825ef5f52b09f3
Author: Tomaž Vajngerl 
AuthorDate: Tue Jan 10 20:21:31 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:16:06 2023 +

ThemeDialog added which allows to change the theme used by the doc.

ThemeDialog is a common dialog that can be used to select the
theme used by the document. Currently it only implements colors
but in the future also the fonts and formats (for shapes) will
be adde.

The IThemeColorChanger interface is used by the dialog to change
the actual color values inside the document. For the writer the
existing ThemeColorChanger is now implementing the interface.

The dialog is accessible in Writer at Format -> Theme... in the
main menu.

Change-Id: I23c7dc9668cdc5427f36d604a76c433d6dbef497
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145264
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit d4e4a2b96a787b4f99d68d7a417c37c97b47c170)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145855
Tested-by: Tomaž Vajngerl 

diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index a0289c0881ab..d029b314d4d9 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -469,6 +469,7 @@ class SvxZoomItem;
 #define SID_ACCESSIBILITY_CHECK (SID_SFX_START + 812)
 #define SID_ASYNCHRON   (SID_SFX_START + 813)
 #define SID_ACCESSIBILITY_CHECK_ONLINE  (SID_SFX_START + 814)
+#define SID_THEME_DIALOG(SID_SFX_START + 815)
 
 // default-ids for configuration
 #define SID_CONFIG  (SID_SFX_START + 904)
diff --git a/include/svx/dialog/ThemeDialog.hxx 
b/include/svx/dialog/ThemeDialog.hxx
new file mode 100644
index ..968c54af9e98
--- /dev/null
+++ b/include/svx/dialog/ThemeDialog.hxx
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+namespace svx
+{
+class SVX_DLLPUBLIC ThemeDialog final : public weld::GenericDialogController
+{
+private:
+svx::Theme* mpTheme;
+svx::ColorSets maColorSets;
+std::shared_ptr mpChanger;
+
+std::unique_ptr mxValueSetThemeColors;
+std::unique_ptr mxValueSetThemeColorsWindow;
+
+public:
+ThemeDialog(weld::Window* pParent, svx::Theme* pTheme,
+std::shared_ptr const& pChanger);
+virtual ~ThemeDialog() override;
+
+DECL_LINK(DoubleClickValueSetHdl, ValueSet*, void);
+void DoubleClickHdl();
+};
+
+} // end svx namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/theme/IThemeColorChanger.hxx 
b/include/svx/theme/IThemeColorChanger.hxx
new file mode 100644
index ..5f90f273ee37
--- /dev/null
+++ b/include/svx/theme/IThemeColorChanger.hxx
@@ -0,0 +1,26 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+
+namespace svx
+{
+class SVX_DLLPUBLIC IThemeColorChanger
+{
+public:
+virtual ~IThemeColorChanger() = default;
+virtual void apply

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/inc sw/Library_sw.mk sw/source

2023-01-19 Thread Tomaž Vajngerl (via logerrit)
 sw/Library_sw.mk   |1 
 sw/inc/swtypes.hxx |6 
 sw/source/core/inc/ThemeColorChanger.hxx   |   33 +++
 sw/source/core/inc/UndoAttribute.hxx   |2 
 sw/source/core/model/ThemeColorChanger.cxx |  271 +
 sw/source/core/undo/unattr.cxx |   21 +-
 sw/source/uibase/sidebar/ThemePanel.cxx|   44 
 7 files changed, 331 insertions(+), 47 deletions(-)

New commits:
commit 7283ee786d3234241c595f26463520dfa0c326e9
Author: Tomaž Vajngerl 
AuthorDate: Fri Jan 6 17:28:49 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:15:29 2023 +

sw: add ThemeColorChanger that sweeps the model and changes colors

The ThemeColorChanger responisiblity is to recalculate and change
all the theme colors in the model. This includes styles and direct
formatting changes. It uses ModelTraverser for direct formatting
changes as it already implements traversing through nodes.

The ThemeColorChanger replaces the code to change the colors in
ThemePanel.

Also modify undo/redo for changing of attributes to not move
the cursor and selection when undoing and redoing (new flag
NO_CURSOR_CHANGE), as in this case it is very distrcting.

Change-Id: Ida1912bd0697307daad9244d474862830ab2686f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145263
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 1af58b5acec4a2de095d86feef05ac4aed3edb8f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145854
Tested-by: Tomaž Vajngerl 

diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 478136e50f54..fa2ca1663512 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -366,6 +366,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
 sw/source/core/layout/wsfrm \
 sw/source/core/model/ModelTraverser \
 sw/source/core/model/SearchResultLocator \
+sw/source/core/model/ThemeColorChanger \
 sw/source/core/objectpositioning/anchoredobjectposition \
 sw/source/core/objectpositioning/ascharanchoredobjectposition \
 sw/source/core/objectpositioning/environmentofanchoredobject \
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 96c0fb5008c3..b3cdfa531074 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -143,17 +143,19 @@ enum class SetAttrMode
 NOHINTADJUST= 0x0008,  // No merging of ranges.
 NOFORMATATTR= 0x0010,  // Do not change into format attribute.
 APICALL = 0x0020,  // Called from API (all UI related
-// functionality will 
be disabled).
+   // functionality will be disabled).
 /// Force hint expand (only matters for hints with CH_TXTATR).
 FORCEHINTEXPAND = 0x0040,
 /// The inserted item is a copy -- intended for use in ndtxt.cxx.
 IS_COPY = 0x0080,
 /// for Undo, translated to SwInsertFlags::NOHINTEXPAND
 NOHINTEXPAND= 0x0100,
+/// don't change the cursor position
+NO_CURSOR_CHANGE = 0x0200
 };
 namespace o3tl
 {
-template<> struct typed_flags : is_typed_flags {};
+template<> struct typed_flags : is_typed_flags {};
 }
 
 namespace sw {
diff --git a/sw/source/core/inc/ThemeColorChanger.hxx 
b/sw/source/core/inc/ThemeColorChanger.hxx
new file mode 100644
index ..0698126da3e9
--- /dev/null
+++ b/sw/source/core/inc/ThemeColorChanger.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+#pragma once
+
+#include 
+#include 
+
+namespace sw
+{
+class ThemeColorChanger
+{
+private:
+SwDocShell* mpDocSh;
+
+public:
+ThemeColorChanger(SwDocShell* pDocSh)
+: mpDocSh(pDocSh)
+{
+}
+
+void apply(svx::ColorSet const& rColorSet);
+};
+
+} // end sw namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/UndoAttribute.hxx 
b/sw/source/core/inc/UndoAttribute.hxx
index c3cf4925d95a..e3c40b7f0e87 100644
--- a/sw/source/core/inc/UndoAttribute.hxx
+++ b/sw/source/core/inc/UndoAttribute.hxx
@@ -45,7 +45,7 @@ class SwUndoAttr final : public SwUndo, private SwUndRng
 OUString m_aChrFormatName;
 
 void RemoveIdx( SwDoc& rDoc );
-
+void redoAttribute(SwPaM& rPam, sw::UndoRedoContext& rContext);
 public:
 SwUndoAttr( const SwPaM&, SfxItemSet, const SetAttrMode nFlags );
 SwUndoAttr( const SwPaM&, const SfxPoolItem&, const SetAttrMode nFlags );
diff --git a/sw/source/core/model/ThemeColorChanger.cxx 
b/sw/source/core/model/ThemeColorChanger.cxx
new file mode 100644
index ..ff59c474748b
--- /dev/null
+++ b/sw/sour

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - include/svx svx/Library_svx.mk svx/source sw/source sw/uiconfig

2023-01-19 Thread Tomaž Vajngerl (via logerrit)
 include/svx/dialog/ThemeColorValueSet.hxx |   38 ++
 svx/Library_svx.mk|1 
 svx/source/dialog/ThemeColorValueSet.cxx  |   98 +++
 svx/source/styles/ColorSets.cxx   |  100 +++
 sw/source/uibase/sidebar/ThemePanel.cxx   |  412 +-
 sw/source/uibase/sidebar/ThemePanel.hxx   |7 
 sw/uiconfig/swriter/ui/sidebartheme.ui|  164 +++
 7 files changed, 306 insertions(+), 514 deletions(-)

New commits:
commit 733a7bf52296e941cd77c9bf7a4ff64e69b57879
Author: Tomaž Vajngerl 
AuthorDate: Thu Jan 5 23:58:50 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:14:58 2023 +

sw: rework ThemePanel, theme color ValueSet drawing as custom draw

Rework the ThemePanel to only work with theme colors, as fonts
are uing an old mock implemntation of themes. To do this properly
it is needed to remove the implementation for now.

The theme colors entries were rendered as a bitmap and then shown
in the ValueSet. This has the problem that it doesn't look sharp
on a HiDPI screen, so replace that with a ThemeColorValueSet, which
uses custom draw to render the theme color entries directly.

The ThemeColorValueSet was added to th svx component as it will be
used in other components as well.

Change-Id: I1a727ef4cf4be4e215db57ac33f571f43aaddc15
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145087
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 8bc22ed6899bcbafc3020f0af6c939019506a5fd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145853
Tested-by: Tomaž Vajngerl 

diff --git a/include/svx/dialog/ThemeColorValueSet.hxx 
b/include/svx/dialog/ThemeColorValueSet.hxx
new file mode 100644
index ..4b70ed0f56db
--- /dev/null
+++ b/include/svx/dialog/ThemeColorValueSet.hxx
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+#include 
+#include 
+
+namespace svx
+{
+class SVX_DLLPUBLIC ThemeColorValueSet final : public ValueSet
+{
+std::vector> maColorSets;
+
+public:
+ThemeColorValueSet()
+: ValueSet(nullptr)
+{
+}
+
+void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
+void UserDraw(const UserDrawEvent& rUserDrawEvent) override;
+void StyleUpdated() override;
+
+void insert(svx::ColorSet const& rColorSet);
+};
+
+} // end svx namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index 29f8d16454c7..9021b46d7f1b 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -174,6 +174,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
 svx/source/dialog/svxruler \
 svx/source/dialog/swframeexample \
 svx/source/dialog/swframeposstrings \
+svx/source/dialog/ThemeColorValueSet \
 svx/source/dialog/txencbox \
 svx/source/dialog/txenctab \
 svx/source/dialog/weldeditview \
diff --git a/svx/source/dialog/ThemeColorValueSet.cxx 
b/svx/source/dialog/ThemeColorValueSet.cxx
new file mode 100644
index ..204a37ba72de
--- /dev/null
+++ b/svx/source/dialog/ThemeColorValueSet.cxx
@@ -0,0 +1,98 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+#include 
+#include 
+
+namespace svx
+{
+constexpr tools::Long BORDER = 3;
+constexpr tools::Long SIZE = 14;
+constexpr tools::Long LABEL_HEIGHT = 16;
+constexpr tools::Long LABEL_TEXT_HEIGHT = 14;
+constexpr tools::Long constElementNumber = 8;
+
+void ThemeColorValueSet::insert(svx::ColorSet const& rColorSet)
+{
+maColorSets.push_back(std::cref(rColorSet));
+InsertItem(maColorSets.size());
+}
+
+void ThemeColorValueSet::SetDrawingArea(weld::DrawingArea* pDrawingArea)
+{
+ValueSet::SetDrawingArea(pDrawingArea);
+SetStyle(WB_TABSTOP | WB_ITEMBORDER | WB_DOUBLEBORDER);
+Size aSize(BORDER * 7 + SIZE * 6 + BORDER * 2, BORDER * 3 + SIZE * 2 + 
LABEL_HEIGHT);
+SetItemWidth(aSize.Width());
+SetItemHeight(aSize.Height());
+}
+
+void ThemeColorValueSet::UserDraw(const UserDrawEvent& rUserDrawEvent)
+{
+vcl::RenderContext* pDev = rUserDrawEvent.GetRenderContext();
+tools::Rectangle aRect = rUserDrawEvent.GetRect();
+const Point aPosition = aRect.GetPos();
+const sal_uInt16 nItemId = rUserDrawEvent.GetItemId();
+svx::ColorSet const& 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - include/svx oox/source svx/source

2023-01-19 Thread Tomaž Vajngerl (via logerrit)
 include/svx/ColorSets.hxx  |   15 +---
 oox/source/drawingml/clrscheme.cxx |   24 +++---
 svx/source/styles/ColorSets.cxx|  138 -
 3 files changed, 76 insertions(+), 101 deletions(-)

New commits:
commit ca8e0aadbdc519fe52bd6cba8ef8f8af88bd5ff6
Author: Tomaž Vajngerl 
AuthorDate: Thu Jan 5 23:22:47 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:14:32 2023 +

svx: add resolveColor that resolves the color for input theme

resolveColor added to ColorSet resolves the color for the input
ThemeColor, which contains the index for the color in the ColorSet
and applies all the additional tranformations defined in the
ThemeColor.

Change-Id: I5c6d53d5e1d2c61bdb22b0e58c034ec91fbeb2d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145085
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 4d17d06279d3bceee8d4b92f444b5e425412c576)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145851
Tested-by: Tomaž Vajngerl 

diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx
index d971cb1f5b77..115236da1979 100644
--- a/include/svx/ColorSets.hxx
+++ b/include/svx/ColorSets.hxx
@@ -17,7 +17,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 typedef struct _xmlTextWriter* xmlTextWriterPtr;
@@ -42,15 +42,8 @@ public:
 return maName;
 }
 
-Color getColor(model::ThemeColorType nType) const
-{
-if (nType == model::ThemeColorType::Unknown)
-{
-SAL_WARN("svx", "ColorSet::getColor with ThemeColorType::Unknown");
-return COL_AUTO;
-}
-return maColors[size_t(nType)];
-}
+Color resolveColor(model::ThemeColor const& rThemeColor) const;
+Color getColor(model::ThemeColorType eType) const;
 
 void dumpAsXml(xmlTextWriterPtr pWriter) const;
 };
diff --git a/svx/source/styles/ColorSets.cxx b/svx/source/styles/ColorSets.cxx
index 0f24480c15e6..cf634b735c37 100644
--- a/svx/source/styles/ColorSets.cxx
+++ b/svx/source/styles/ColorSets.cxx
@@ -52,9 +52,7 @@ void UpdateTextPortionColorSet(const 
uno::Reference& xPorti
 if (aThemeColor.getType() == model::ThemeColorType::Unknown)
 return;
 
-Color aColor = rColorSet.getColor(aThemeColor.getType());
-aColor = aThemeColor.applyTransformations(aColor);
-
+Color aColor = rColorSet.resolveColor(aThemeColor);
 xPortion->setPropertyValue(UNO_NAME_EDIT_CHAR_COLOR, 
uno::Any(static_cast(aColor)));
 }
 
@@ -74,8 +72,7 @@ void UpdateFillColorSet(const 
uno::Reference& xShape, const
 if (aThemeColor.getType() == model::ThemeColorType::Unknown)
 return;
 
-Color aColor = rColorSet.getColor(aThemeColor.getType());
-aColor = aThemeColor.applyTransformations(aColor);
+Color aColor = rColorSet.resolveColor(aThemeColor);
 xShape->setPropertyValue(UNO_NAME_FILLCOLOR, 
uno::Any(static_cast(aColor)));
 }
 
@@ -125,6 +122,28 @@ void ColorSet::add(model::ThemeColorType eType, Color 
aColorData)
 maColors[sal_Int16(eType)] = aColorData;
 }
 
+Color ColorSet::getColor(model::ThemeColorType eType) const
+{
+if (eType == model::ThemeColorType::Unknown)
+{
+SAL_WARN("svx", "ColorSet::getColor with ThemeColorType::Unknown");
+return COL_AUTO;
+}
+return maColors[size_t(eType)];
+}
+
+Color ColorSet::resolveColor(model::ThemeColor const& rThemeColor) const
+{
+auto eType = rThemeColor.getType();
+if (eType == model::ThemeColorType::Unknown)
+{
+SAL_WARN("svx", "ColorSet::resolveColor with ThemeColorType::Unknown");
+return COL_AUTO;
+}
+Color aColor = getColor(eType);
+return rThemeColor.applyTransformations(aColor);
+}
+
 void ColorSet::dumpAsXml(xmlTextWriterPtr pWriter) const
 {
 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("ColorSet"));
commit f3bf7ed7a0e788cf5559c65af7327864526cde73
Author: Tomaž Vajngerl 
AuthorDate: Thu Jan 5 14:46:30 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:14:21 2023 +

svx: change ColorSet add method to use ThemeColorTyp enum

Change-Id: I2034a7e915d41c6b55c8344d44be4f6a60e8287e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145072
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 0b35b239c0ff1adad2c4544d8692b5b13a0d363b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145850

diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx
index ac420031527b..d971cb1f5b77 100644
--- a/include/svx/ColorSets.hxx
+++ b/include/svx/ColorSets.hxx
@@ -35,7 +35,7 @@ class SVXCORE_DLLPUBLIC ColorSet
 public:
 ColorSet(OUString const& rName);
 
-void add(sal_uInt32 nIndex, Color aColorData);
+void add(model::ThemeColorType Type, Color aColorData);
 
 const OUString& getName() const
 {
diff --git a/oox/source/drawingml/clrscheme.cxx 
b/oox/source/drawingml/clr

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - include/editeng include/oox include/svx oox/inc oox/qa oox/source sd/source svx/source

2023-01-19 Thread Tomaž Vajngerl (via logerrit)
 include/editeng/unoprnms.hxx   |1 
 include/oox/export/drawingml.hxx   |2 
 include/svx/unoshprp.hxx   |1 
 oox/inc/drawingml/lineproperties.hxx   |3 
 oox/qa/unit/data/ThemeShapesReference.pptx |binary
 oox/qa/unit/drawingml.cxx  |   92 +
 oox/source/drawingml/fillproperties.cxx|2 
 oox/source/drawingml/lineproperties.cxx|   34 +-
 oox/source/drawingml/shape.cxx |4 -
 oox/source/export/drawingml.cxx|   64 
 oox/source/token/properties.txt|1 
 sd/source/core/stlsheet.cxx|   10 +++
 svx/source/table/cell.cxx  |   12 +++
 svx/source/unodraw/unoshape.cxx|   10 +++
 svx/source/xoutdev/xattr.cxx   |   44 +++--
 15 files changed, 205 insertions(+), 75 deletions(-)

New commits:
commit be7284695ac1a2a583f98479cd6864d7ef41c5e0
Author: Tomaž Vajngerl 
AuthorDate: Thu Jan 5 13:12:34 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:14:09 2023 +

support theme color for lines + oox support + tests

Extended XLineColor to handle model::ThemeColor which then maps
to the newly added LineColorThemeData property.

Extended oox import and export to map the scheme color elements
to and from ThemeColor. Added a new test to check the theme line
color in impress shapes.

Change-Id: I23ecc18c88b5b47608c9110f5681f189d02e2f36
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145071
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit af8fdba1194e657237f9abc460381a1c4bc49982)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145849
Tested-by: Tomaž Vajngerl 

diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx
index 7f82cd0b1fea..300a0a2b7765 100644
--- a/include/editeng/unoprnms.hxx
+++ b/include/editeng/unoprnms.hxx
@@ -77,6 +77,7 @@ inline constexpr OUStringLiteral UNO_NAME_LINESTYLE = 
u"LineStyle";
 inline constexpr OUStringLiteral UNO_NAME_LINEDASH = u"LineDash";
 inline constexpr OUStringLiteral UNO_NAME_LINEWIDTH = u"LineWidth";
 inline constexpr OUStringLiteral UNO_NAME_LINECOLOR = u"LineColor";
+inline constexpr OUStringLiteral UNO_NAME_LINECOLOR_THEME_REFERENCE = 
u"LineColorThemeReference";
 inline constexpr OUStringLiteral UNO_NAME_LINEJOINT = u"LineJoint";
 inline constexpr OUStringLiteral UNO_NAME_LINESTART = u"LineStart";
 inline constexpr OUStringLiteral UNO_NAME_LINEEND = u"LineEnd";
diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx
index eb0fea23b95c..c131632aea8d 100644
--- a/include/oox/export/drawingml.hxx
+++ b/include/oox/export/drawingml.hxx
@@ -235,7 +235,7 @@ public:
 void WriteConnectorConnections( sal_Int32 nStartGlueId, sal_Int32 
nEndGlueId, sal_Int32 nStartID, sal_Int32 nEndID );
 
 bool WriteCharColor(const css::uno::Reference& 
xPropertySet);
-bool WriteFillColor(const css::uno::Reference& 
xPropertySet);
+bool WriteSchemeColor(OUString const& rPropertyName, const 
css::uno::Reference& xPropertySet);
 
 void WriteSolidFill( ::Color nColor, sal_Int32 nAlpha = MAX_PERCENT );
 void WriteSolidFill( const OUString& sSchemeName, const 
css::uno::Sequence< css::beans::PropertyValue >& aTransformations, sal_Int32 
nAlpha = MAX_PERCENT );
diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx
index 8af8142c1d43..70be33007013 100644
--- a/include/svx/unoshprp.hxx
+++ b/include/svx/unoshprp.hxx
@@ -236,6 +236,7 @@
 #define LINE_PROPERTIES_DEFAULTS\
 { UNO_NAME_LINECAP,   XATTR_LINECAP,  
::cppu::UnoType::get(), 0, 0}, \
 { UNO_NAME_LINECOLOR, XATTR_LINECOLOR,
::cppu::UnoType::get() ,   0, 0}, \
+{ UNO_NAME_LINECOLOR_THEME_REFERENCE, XATTR_LINECOLOR, 
::cppu::UnoType::get() ,   0, 
MID_COLOR_THEME_REFERENCE}, \
 { UNO_NAME_LINEENDCENTER, XATTR_LINEENDCENTER,
cppu::UnoType::get() ,   0, 0}, \
 { UNO_NAME_LINEENDWIDTH,  XATTR_LINEENDWIDTH, 
::cppu::UnoType::get() ,   0, 0, 
PropertyMoreFlags::METRIC_ITEM}, \
 { UNO_NAME_LINEJOINT, XATTR_LINEJOINT,
::cppu::UnoType::get(), 0, 0}, \
diff --git a/oox/inc/drawingml/lineproperties.hxx 
b/oox/inc/drawingml/lineproperties.hxx
index f2d37a7f8a9f..52c27825bdaf 100644
--- a/oox/inc/drawingml/lineproperties.hxx
+++ b/oox/inc/drawingml/lineproperties.hxx
@@ -69,7 +69,8 @@ struct LineProperties
 voidpushToPropMap(
 ShapePropertyMap& rPropMap,
 const GraphicHelper& rGraphicHelper,
-::Color nPhClr = API_RGB_TRANSPARENT ) const;
+::Color nPhClr = API_RGB_TRANSPARENT,
+sal_Int16 nPhClrTheme = -1) const;
 
 /** Calculates the line s

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - include/xmloff oox/qa schema/libreoffice writerfilter/source xmloff/CppunitTest_xmloff_draw.mk xmloff/CppunitTest_xmlof

2023-01-19 Thread Tomaž Vajngerl (via logerrit)
 dev/null|binary
 include/xmloff/txtprmap.hxx |2 
 include/xmloff/xmltoken.hxx |8 
 oox/qa/unit/data/ReferenceShapeFill.odp |binary
 oox/qa/unit/export.cxx  |   21 
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |   88 ++-
 writerfilter/source/dmapper/TDefTableHandler.cxx|8 
 xmloff/CppunitTest_xmloff_draw.mk   |1 
 xmloff/CppunitTest_xmloff_uxmloff.mk|1 
 xmloff/Library_xo.mk|3 
 xmloff/inc/XMLThemeColorContext.hxx |   33 +
 xmloff/inc/XMLThemeColorExport.hxx  |   30 +
 xmloff/inc/XMLThemeColorHandler.hxx |   40 -
 xmloff/inc/xmlprop.hxx  |8 
 xmloff/qa/unit/data/Reference-ThemeColors-TextAndFill.pptx  |binary
 xmloff/qa/unit/data/ReferenceShapeFill.pptx |binary
 xmloff/qa/unit/draw.cxx |  268 +---
 xmloff/source/core/xmltoken.cxx |8 
 xmloff/source/draw/XMLShapePropertySetContext.cxx   |4 
 xmloff/source/draw/sdpropls.cxx |4 
 xmloff/source/style/PagePropertySetContext.cxx  |4 
 xmloff/source/text/XMLTextPropertySetContext.cxx|6 
 xmloff/source/text/XMLTextShapeStyleContext.cxx |4 
 xmloff/source/text/XMLThemeColorContext.cxx |  116 +
 xmloff/source/text/XMLThemeColorExport.cxx  |   85 +++
 xmloff/source/text/txtexppr.cxx |7 
 xmloff/source/text/txtexppr.hxx |2 
 xmloff/source/text/txtprhdl.cxx |   18 
 xmloff/source/text/txtprmap.cxx |9 
 xmloff/source/token/tokens.txt  |8 
 30 files changed, 607 insertions(+), 179 deletions(-)

New commits:
commit 1f5cfa7be7eb67c602d15f8ce610f61badf47b98
Author: Tomaž Vajngerl 
AuthorDate: Thu Jan 5 12:32:02 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:13:47 2023 +

ooxml: fix theme color type mapping: bg -> light, text -> dark

Change-Id: I19ad3ef7c911943075d7ddc01626047cdf11d5db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145070
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 1a79594a27f41ad369e7c387c51e00afb1352872)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145847
Tested-by: Tomaž Vajngerl 

diff --git a/writerfilter/source/dmapper/TDefTableHandler.cxx 
b/writerfilter/source/dmapper/TDefTableHandler.cxx
index 4d279ac4bc12..b8e0582de033 100644
--- a/writerfilter/source/dmapper/TDefTableHandler.cxx
+++ b/writerfilter/source/dmapper/TDefTableHandler.cxx
@@ -300,13 +300,13 @@ model::ThemeColorType 
TDefTableHandler::getThemeColorTypeIndex(sal_Int32 nType)
 case NS_ooxml::LN_Value_St_ThemeColor_none:
 return model::ThemeColorType::Unknown;
 case NS_ooxml::LN_Value_St_ThemeColor_background1:
-return model::ThemeColorType::Dark1;
-case NS_ooxml::LN_Value_St_ThemeColor_text1:
 return model::ThemeColorType::Light1;
+case NS_ooxml::LN_Value_St_ThemeColor_text1:
+return model::ThemeColorType::Dark1;
 case NS_ooxml::LN_Value_St_ThemeColor_background2:
-return model::ThemeColorType::Dark2;
-case NS_ooxml::LN_Value_St_ThemeColor_text2:
 return model::ThemeColorType::Light2;
+case NS_ooxml::LN_Value_St_ThemeColor_text2:
+return model::ThemeColorType::Dark2;
 default:
 break;
 }
commit d58e3a0716a91e3d1360299a926c7060a47d0650
Author: Tomaž Vajngerl 
AuthorDate: Sat Dec 31 20:59:03 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:13:37 2023 +

xmloff: use XThemeColor in ODF, change the format for themes

Change the xmloff filter to use XThemeColor and the associated
proprties (CharColorThemeReference and FillColorThemeReference).

Change the ODF format for referencing a theme color - make it an
element instead a series of attributes on the *-properties style
element.

Change-Id: I0fa7d8ebffecc02897b7fe9824d6f1776ef36380
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144923
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 3eb53d327fb5d9689b799ff991a6c53c05eff496)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145846
Tested-by: Tomaž Vajngerl 

diff --git a/include/xmloff/txtprmap.hxx b/include/xmloff/txtprmap.hxx
index 37c0d7a9f330..986bbd007d8a 100644
--- a/include/xmloff/txt

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - bin/update_pch cui/inc cui/Library_cui.mk cui/source docmodel/inc docmodel/Library_docmodel.mk docmodel/Makefile docmod

2023-01-19 Thread Tomaž Vajngerl (via logerrit)
 Repository.mk |1 
 RepositoryModule_build.mk |1 
 RepositoryModule_host.mk  |1 
 bin/update_pch|   31 ++--
 cui/Library_cui.mk|1 
 cui/inc/pch/precompiled_cui.hxx   |   14 +-
 cui/source/tabpages/chardlg.cxx   |   12 +
 cui/source/tabpages/tpcolor.cxx   |   10 -
 docmodel/Library_docmodel.mk  |   39 +
 docmodel/Makefile |7 +
 docmodel/Module_docmodel.mk   |   18 ++
 docmodel/README.md|5 
 docmodel/inc/pch/precompiled_docmodel.cxx |   12 +
 docmodel/inc/pch/precompiled_docmodel.hxx |   34 +
 docmodel/source/uno/UnoThemeColor.cxx |   40 ++
 editeng/CppunitTest_editeng_core.mk   |1 
 editeng/Library_editeng.mk|1 
 editeng/inc/pch/precompiled_editeng.hxx   |7 -
 editeng/source/items/textitem.cxx |  124 +++---
 editeng/source/uno/unotext.cxx|   28 +++-
 forms/qa/unoapi/knownissues.xcl   |2 
 include/docmodel/dllapi.h |   21 +++
 include/docmodel/theme/ThemeColor.hxx |  146 ++
 include/docmodel/theme/ThemeColorType.hxx |   42 ++
 include/docmodel/uno/UnoThemeColor.hxx|   55 
 include/editeng/colritem.hxx  |   54 
 include/editeng/memberids.h   |1 
 include/editeng/unoprnms.hxx  |3 
 include/editeng/unotext.hxx   |1 
 include/svx/ColorSets.hxx |   35 +
 include/svx/unoshprp.hxx  |1 
 include/svx/xcolit.hxx|9 -
 offapi/UnoApi_offapi.mk   |1 
 offapi/com/sun/star/util/XThemeColor.idl  |   26 +++
 oox/CppunitTest_oox_drawingml.mk  |1 
 oox/CppunitTest_oox_shape.mk  |1 
 oox/CppunitTest_oox_tokenmap.mk   |1 
 oox/Library_oox.mk|2 
 oox/inc/pch/precompiled_oox.hxx   |   69 +++---
 oox/qa/unit/drawingml.cxx |   71 ++
 oox/qa/unit/shape.cxx |   12 +
 oox/source/drawingml/fillproperties.cxx   |   21 ++-
 oox/source/drawingml/textcharacterproperties.cxx  |   23 ++-
 oox/source/export/ThemeExport.cxx |   28 ++--
 oox/source/export/drawingml.cxx   |   99 +++---
 oox/source/token/properties.txt   |2 
 sd/CppunitTest_sd_uiimpress.mk|1 
 sd/CppunitTest_sd_uimpress.mk |1 
 sd/Library_sd.mk  |1 
 sd/inc/pch/precompiled_sd.hxx |   68 +-
 sd/qa/unit/uiimpress.cxx  |   61 -
 sd/source/core/stlsheet.cxx   |   27 +++-
 sd/source/filter/eppt/pptx-epptooxml.cxx  |2 
 sd/source/ui/func/fuconstr.cxx|4 
 sd/source/ui/view/drtxtob1.cxx|   29 ++--
 sd/source/ui/view/drviews2.cxx|7 -
 solenv/gbuild/extensions/pre_MergedLibsList.mk|1 
 solenv/qa/python/gbuildtojson.py  |2 
 svx/CppunitTest_svx_removewhichrange.mk   |1 
 svx/CppunitTest_svx_styles.mk |1 
 svx/CppunitTest_svx_unit.mk   |1 
 svx/Library_svxcore.mk|1 
 svx/inc/pch/precompiled_svx.hxx   |   29 ++--
 svx/qa/unit/styles.cxx|   43 +++---
 svx/qa/unit/xoutdev.cxx   |   47 +++
 svx/source/styles/ColorSets.cxx   |   68 --
 svx/source/table/cell.cxx |   28 +++-
 svx/source/unodraw/unoprov.cxx|1 
 svx/source/unodraw/unoshap2.cxx   |1 
 svx/source/unodraw/unoshape.cxx   |   27 +++-
 svx/source/xoutdev/xattr.cxx  |   62 +++--
 sw/CppunitTest_sw_apitests.mk |1 
 sw/CppunitTest_sw_core_draw.mk|1 
 sw/CppunitTest_sw_core_theme.mk   |1 
 sw/CppunitTest_sw_macros_test.mk  |1 
 sw/CppunitTest_sw_ooxmlimport.mk  |1 
 sw/CppunitTest_sw_ooxmlimport2.mk |1 
 sw/CppunitTest_sw_tiledrendering.mk   |1 
 sw/CppunitTest_sw_uwriter.mk  |1 
 sw/Library_sw.mk  |1 
 sw/layoutwriter_setup.mk  |   

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - include/oox include/svx oox/Library_oox.mk oox/source svx/source sw/source

2023-01-19 Thread Tomaž Vajngerl (via logerrit)
 include/oox/export/ThemeExport.hxx  |   38 
 include/svx/ColorSets.hxx   |2 
 oox/Library_oox.mk  |1 
 oox/source/export/ThemeExport.cxx   |  263 
 svx/source/styles/ColorSets.cxx |5 
 sw/source/uibase/sidebar/ThemePanel.cxx |   15 +
 6 files changed, 324 insertions(+)

New commits:
commit 299270cadfde2376494d939521c58b5b0797acd5
Author: Tomaž Vajngerl 
AuthorDate: Mon Dec 12 22:26:41 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:13:02 2023 +

sw: add the ColorSet from SdrPage into ColorSets in ThemePanel

Change-Id: I7c4ef103b2be65a8adbad5d4f00304ee22be668f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143997
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 7c10e3b120ba75a2db75342fdc68040a179404b8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145843
Tested-by: Tomaž Vajngerl 

diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx
index bbc3dda2cdee..c966f411efa6 100644
--- a/include/svx/ColorSets.hxx
+++ b/include/svx/ColorSets.hxx
@@ -93,6 +93,8 @@ public:
 }
 
 const ColorSet& getColorSet(std::u16string_view rName);
+
+void insert(ColorSet const& rColorSet);
 };
 
 struct SVXCORE_DLLPUBLIC ThemeSupplementalFont
diff --git a/svx/source/styles/ColorSets.cxx b/svx/source/styles/ColorSets.cxx
index bb8009fdc5be..5511253f3d03 100644
--- a/svx/source/styles/ColorSets.cxx
+++ b/svx/source/styles/ColorSets.cxx
@@ -238,6 +238,11 @@ const ColorSet& ColorSets::getColorSet(std::u16string_view 
rName)
 return maColorSets[0];
 }
 
+void ColorSets::insert(ColorSet const& rColorSet)
+{
+maColorSets.push_back(rColorSet);
+}
+
 Theme::Theme(OUString const& rName)
 : maName(rName)
 {
diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx 
b/sw/source/uibase/sidebar/ThemePanel.cxx
index 9be8649def38..97856cfedbac 100644
--- a/sw/source/uibase/sidebar/ThemePanel.cxx
+++ b/sw/source/uibase/sidebar/ThemePanel.cxx
@@ -30,6 +30,11 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+
 
 namespace
 {
@@ -442,6 +447,16 @@ ThemePanel::ThemePanel(weld::Widget* pParent)
 
 maColorSets.init();
 
+SwDocShell* pDocSh = static_cast(SfxObjectShell::Current());
+SwDoc* pDocument = pDocSh->GetDoc();
+if (pDocument)
+{
+SdrPage* pPage = 
pDocument->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+svx::Theme* pTheme = pPage->getSdrPageProperties().GetTheme();
+if (pTheme)
+maColorSets.insert(*pTheme->GetColorSet());
+}
+
 const std::vector& aColorSets = maColorSets.getColorSets();
 for (size_t i = 0; i < aColorSets.size(); ++i)
 {
commit 09c73ae2bd9c533645c2c8412bf66be92ef6d743
Author: Tomaž Vajngerl 
AuthorDate: Mon Dec 12 22:18:43 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:12:52 2023 +

oox: add ThemeExport that exports a svx::Theme into theme.xml file

Adds ThemeExport that takes a svx::Theme as input and exports that
into a theme.xml file in the OOXML document. Currently supports
exporting of color schemes and font schemes. Format schemes are
hard-coded for now. The ThemeExport isn't yet used in any actual
export functionality.

Change-Id: I5ca9c256da65be77e7192be7d66c73d26d78ebd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143996
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 958d4667e361a1d8461889117ca830a5da85d0ee)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145842
Tested-by: Tomaž Vajngerl 

diff --git a/include/oox/export/ThemeExport.hxx 
b/include/oox/export/ThemeExport.hxx
new file mode 100644
index ..02f222cadafe
--- /dev/null
+++ b/include/oox/export/ThemeExport.hxx
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+#include 
+#include 
+
+namespace oox
+{
+class OOX_DLLPUBLIC ThemeExport
+{
+private:
+oox::core::XmlFilterBase* mpFilterBase;
+
+public:
+ThemeExport(oox::core::XmlFilterBase* pFilterBase);
+
+void write(OUString const& rPath, svx::Theme const& rTheme);
+
+private:
+static bool writeColorSet(sax_fastparser::FSHelperPtr pFS, svx::Theme 
const& rTheme);
+static bool writeFontScheme(sax_fastparser::FSHelperPtr pFS,
+svx::FontScheme const& rFontScheme);
+static bool writeFormatScheme(sax_fastparser::FSHelperPtr pFS);
+};
+
+} // end namespace oox
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/Library_oox.m

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - include/oox include/svx oox/inc oox/Library_oox.mk oox/source solenv/clang-format svx/CppunitTest_svx_unit.mk svx/qa sw

2023-01-19 Thread Tomaž Vajngerl (via logerrit)
 include/oox/drawingml/ThemeFilterBase.hxx  |   58 +
 include/oox/drawingml/theme.hxx|   12 
 include/oox/drawingml/themefragmenthandler.hxx |1 
 include/svx/ColorSets.hxx  |  149 +++
 oox/Library_oox.mk |1 
 oox/inc/drawingml/textfont.hxx |3 
 oox/source/drawingml/ThemeFilterBase.cxx   |   50 +
 oox/source/drawingml/textfont.cxx  |9 
 oox/source/drawingml/theme.cxx |   69 +
 oox/source/drawingml/themeelementscontext.cxx  |   23 
 oox/source/drawingml/themefragmenthandler.cxx  |   56 -
 oox/source/shape/ShapeContextHandler.cxx   |4 
 solenv/clang-format/excludelist|1 
 svx/CppunitTest_svx_unit.mk|1 
 svx/qa/unit/ThemeTest.cxx  |   40 
 sw/qa/core/theme/ThemeTest.cxx |   46 +
 writerfilter/Library_writerfilter.mk   |3 
 writerfilter/inc/ooxml/OOXMLDocument.hxx   |3 
 writerfilter/source/dmapper/DomainMapper.cxx   |   27 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx  |8 
 writerfilter/source/dmapper/DomainMapper_Impl.hxx  |   19 
 writerfilter/source/dmapper/ThemeHandler.cxx   |  422 +
 writerfilter/source/dmapper/ThemeHandler.hxx   |   35 
 writerfilter/source/dmapper/ThemeTable.cxx |  563 -
 writerfilter/source/dmapper/ThemeTable.hxx |   58 -
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx|   14 
 writerfilter/source/ooxml/OOXMLDocumentImpl.hxx|9 
 writerfilter/source/ooxml/OOXMLFactory.hxx |2 
 writerfilter/source/ooxml/OOXMLFastContextHandlerTheme.cxx |   69 +
 writerfilter/source/ooxml/OOXMLFastContextHandlerTheme.hxx |   46 +
 writerfilter/source/ooxml/model.xml|2 
 31 files changed, 1116 insertions(+), 687 deletions(-)

New commits:
commit 330afe0206fb2b8e952d3a46ec809a866fc6fe82
Author: Tomaž Vajngerl 
AuthorDate: Tue Dec 6 17:33:44 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:12:40 2023 +

sw: read theme from OOXML file and set it to the draw page

This change extends writerfilter to use oox::ThemeFragmentHandler
to read the theme properties, and sets that to the one and only
draw page of a Writer document.

This change also removes ThemeTable and replaces it with the
ThemeHandler, which takes theme font data from svx::Theme
instead.

In addition, a test has been writen, which loads a document with
a theme, and asserts the draw page has the theme and the theme
properties currently supported.

Change-Id: Iff0048cd21ea030ac55287707852acc463ec3cb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143699
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 31213fc7cae358038aaec853584782c698f8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145841
Tested-by: Tomaž Vajngerl 

diff --git a/include/oox/drawingml/ThemeFilterBase.hxx 
b/include/oox/drawingml/ThemeFilterBase.hxx
new file mode 100644
index ..7f311e206a90
--- /dev/null
+++ b/include/oox/drawingml/ThemeFilterBase.hxx
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+namespace oox::drawingml
+{
+class OOX_DLLPUBLIC ThemeFilterBase final : public core::XmlFilterBase
+{
+public:
+typedef rtl::Reference Pointer_t;
+
+explicit ThemeFilterBase(css::uno::Reference 
const& rxContext);
+
+virtual ~ThemeFilterBase() override;
+
+/** Has to be implemented by each filter, returns the current theme. */
+virtual const oox::drawingml::Theme* getCurrentTheme() const override;
+
+/** May be implemented by filters which handle Diagrams, default returns 
empty ptr */
+virtual std::shared_ptr getCurrentThemePtr() const 
override;
+
+void setCurrentTheme(const oox::drawingml::ThemePtr& pTheme);
+
+/** Has to be implemented by each filter to return the collection of VML 
shapes. */
+virtual oox::vml::Drawing* getVmlDrawing() override;
+
+/** Has to be implemented by each filter to return TableStyles. */
+virtual oox::drawingml::table::TableStyleListPtr getTableStyles() override;
+
+virtual oox::drawingml::chart::ChartConverter* getChartConver

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - include/oox include/svx oox/source svx/source

2023-01-19 Thread Tomaž Vajngerl (via logerrit)
 include/oox/drawingml/theme.hxx   |8 ---
 include/svx/ColorSets.hxx |   22 ++--
 oox/source/drawingml/themeelementscontext.cxx |   17 +++
 svx/source/styles/ColorSets.cxx   |   28 ++
 4 files changed, 44 insertions(+), 31 deletions(-)

New commits:
commit 77d1b32832cafab03eb858b3b37eeeaf61b51cc4
Author: Tomaž Vajngerl 
AuthorDate: Mon Dec 12 21:48:17 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:12:16 2023 +

svx: use array for colors in ColorSet, add consts, rename vars

Use std::array for colors in ColorSet as there are always only 12
colors for a color scheme.
Add "const" to getters where appropriate.
Rename maColorSetName to maName in ColorSet - long variable name
is not needed.

Change-Id: Iacb976a22af2d2585d627b0ba65d98cbe1b825c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143994
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 29c2bba1f3ef216d226c97197185066880fc1ab5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145839
Tested-by: Tomaž Vajngerl 

diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx
index 692e683218e8..6b4504ebb877 100644
--- a/include/svx/ColorSets.hxx
+++ b/include/svx/ColorSets.hxx
@@ -11,6 +11,7 @@
 #ifndef INCLUDED_SVX_COLORSETS_HXX
 #define INCLUDED_SVX_COLORSETS_HXX
 
+#include 
 #include 
 
 #include 
@@ -52,19 +53,17 @@ constexpr ThemeColorType convertToThemeColorType(sal_Int32 
nIndex)
 
 class SVXCORE_DLLPUBLIC ColorSet
 {
-OUString maColorSetName;
-std::vector maColors;
+OUString maName;
+std::array maColors;
+
 public:
-ColorSet(OUString aName);
+ColorSet(OUString const& rName);
 
-void add(sal_uInt32 nIndex, ::Color aColorData)
-{
-maColors[nIndex] = aColorData;
-}
+void add(sal_uInt32 nIndex, Color aColorData);
 
 const OUString& getName() const
 {
-return maColorSetName;
+return maName;
 }
 
 Color getColor(ThemeColorType nType) const
@@ -88,7 +87,7 @@ public:
 return maColorSets;
 }
 
-const ColorSet& getColorSet(sal_uInt32 nIndex)
+const ColorSet& getColorSet(sal_uInt32 nIndex) const
 {
 return maColorSets[nIndex];
 }
@@ -99,14 +98,15 @@ public:
 /// A named theme has a named color set.
 class SVXCORE_DLLPUBLIC Theme
 {
+private:
 OUString maName;
 std::unique_ptr mpColorSet;
 
 public:
-Theme(OUString sName);
-~Theme();
+Theme(OUString const& rName);
 
 void SetColorSet(std::unique_ptr pColorSet);
+const ColorSet* GetColorSet() const;
 ColorSet* GetColorSet();
 
 void SetName(const OUString& rName);
diff --git a/svx/source/styles/ColorSets.cxx b/svx/source/styles/ColorSets.cxx
index 6af2ee6313bc..bb8009fdc5be 100644
--- a/svx/source/styles/ColorSets.cxx
+++ b/svx/source/styles/ColorSets.cxx
@@ -93,7 +93,7 @@ void UpdateFillColorSet(const 
uno::Reference& xShape, const
 
 void UpdateSdrObject(svx::Theme* pTheme, SdrObject* pObject)
 {
-svx::ColorSet* pColorSet = pTheme->GetColorSet();
+const svx::ColorSet* pColorSet = pTheme->GetColorSet();
 if (!pColorSet)
 {
 return;
@@ -126,20 +126,21 @@ void UpdateSdrObject(svx::Theme* pTheme, SdrObject* 
pObject)
 namespace svx
 {
 
-ColorSet::ColorSet(OUString aColorSetName)
-: maColorSetName(std::move(aColorSetName))
-, maColors(12)
+ColorSet::ColorSet(OUString const& rName)
+: maName(rName)
 {}
 
-ColorSets::ColorSets()
-{}
+void ColorSet::add(sal_uInt32 nIndex, Color aColorData)
+{
+maColors[nIndex] = aColorData;
+}
 
 void ColorSet::dumpAsXml(xmlTextWriterPtr pWriter) const
 {
 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("ColorSet"));
 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", 
this);
-(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("maColorSetName"),
-  
BAD_CAST(maColorSetName.toUtf8().getStr()));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("maName"),
+  BAD_CAST(maName.toUtf8().getStr()));
 
 for (const auto& rColor : maColors)
 {
@@ -153,6 +154,9 @@ void ColorSet::dumpAsXml(xmlTextWriterPtr pWriter) const
 (void)xmlTextWriterEndElement(pWriter);
 }
 
+ColorSets::ColorSets()
+{}
+
 ColorSets::~ColorSets()
 {}
 
@@ -234,15 +238,15 @@ const ColorSet& 
ColorSets::getColorSet(std::u16string_view rName)
 return maColorSets[0];
 }
 
-Theme::Theme(OUString aName)
-: maName(std::move(aName))
+Theme::Theme(OUString const& rName)
+: maName(rName)
 {
 }
 
-Theme::~Theme() {}
-
 void Theme::SetColorSet(std::unique_ptr pColorSet) { mpColorSet = 
std::move(pColorSet); }
 
+const ColorSet* Theme::GetColorSet() const { return mpColorSet.get(); }
+
 ColorSet* Theme::GetColorSet() { return mpColorSet.get(); }
 
 void Theme::SetName(const OUString&

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/oox include/svx oox/source

2023-01-19 Thread Tomaž Vajngerl (via logerrit)
 include/oox/drawingml/clrscheme.hxx |3 +++
 include/svx/ColorSets.hxx   |2 +-
 oox/source/drawingml/clrscheme.cxx  |   27 +++
 oox/source/drawingml/theme.cxx  |   30 --
 4 files changed, 51 insertions(+), 11 deletions(-)

New commits:
commit fa044ee2d251a11e9dda56851d5a06f900db5be7
Author: Tomaž Vajngerl 
AuthorDate: Mon Dec 12 21:13:07 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:11:50 2023 +

oox: set svx::Theme directly to a SdrPage when importing

Bypass the need to set the theme data (svx::Theme) throught UNO
as multiple nested properties. Much more properties will be added
to the svx::Theme and this will simplify handling a lot.

Change-Id: I0b54628ff22c7c823a999de257fd5bb45e736bdb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143992
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit a6253e13e0f3f866ab47e4271db9a80d8cbce708)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145837
Tested-by: Tomaž Vajngerl 

diff --git a/include/oox/drawingml/clrscheme.hxx 
b/include/oox/drawingml/clrscheme.hxx
index a4f0b653441a..fd7662511a88 100644
--- a/include/oox/drawingml/clrscheme.hxx
+++ b/include/oox/drawingml/clrscheme.hxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace oox::drawingml {
 
@@ -94,6 +95,8 @@ public:
 const OUString& GetName() const { return maName; }
 
 void ToAny(css::uno::Any& rVal) const;
+void fill(svx::ColorSet& rColorSet) const;
+
 };
 
 }
diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx
index 71f12c2dbe71..692e683218e8 100644
--- a/include/svx/ColorSets.hxx
+++ b/include/svx/ColorSets.hxx
@@ -50,7 +50,7 @@ constexpr ThemeColorType convertToThemeColorType(sal_Int32 
nIndex)
 return static_cast(nIndex);
 }
 
-class ColorSet
+class SVXCORE_DLLPUBLIC ColorSet
 {
 OUString maColorSetName;
 std::vector maColors;
diff --git a/oox/source/drawingml/clrscheme.cxx 
b/oox/source/drawingml/clrscheme.cxx
index 19c0afd44900..225faf81eecf 100644
--- a/oox/source/drawingml/clrscheme.cxx
+++ b/oox/source/drawingml/clrscheme.cxx
@@ -120,6 +120,33 @@ void ClrScheme::ToAny(css::uno::Any& rVal) const
 rVal <<= comphelper::containerToSequence(aRet);
 }
 
+void ClrScheme::fill(svx::ColorSet& rColorSet) const
+{
+for (const auto& [nToken, rColor] : maClrScheme)
+{
+switch (nToken)
+{
+case XML_tx1:
+case XML_dk1: rColorSet.add(0, rColor); break;
+case XML_bg1:
+case XML_lt1: rColorSet.add(1, rColor); break;
+case XML_tx2:
+case XML_dk2: rColorSet.add(2, rColor); break;
+case XML_bg2:
+case XML_lt2: rColorSet.add(3, rColor); break;
+case XML_accent1: rColorSet.add(4, rColor); break;
+case XML_accent2: rColorSet.add(5, rColor); break;
+case XML_accent3: rColorSet.add(6, rColor); break;
+case XML_accent4: rColorSet.add(7, rColor); break;
+case XML_accent5: rColorSet.add(8, rColor); break;
+case XML_accent6: rColorSet.add(9, rColor); break;
+case XML_hlink: rColorSet.add(10, rColor); break;
+case XML_folHlink: rColorSet.add(11, rColor); break;
+default: break;
+}
+}
+}
+
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/theme.cxx b/oox/source/drawingml/theme.cxx
index f406f829ea91..885d87b1bb0f 100644
--- a/oox/source/drawingml/theme.cxx
+++ b/oox/source/drawingml/theme.cxx
@@ -24,6 +24,11 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 using namespace com::sun::star;
 
@@ -105,16 +110,21 @@ const TextFont* Theme::resolveFont( std::u16string_view 
rName ) const
 
 void Theme::addTheme(const css::uno::Reference& 
xDrawPage) const
 {
-beans::PropertyValue aColorScheme;
-aColorScheme.Name = "ColorScheme";
-maClrScheme.ToAny(aColorScheme.Value);
-beans::PropertyValues aValues = {
-comphelper::makePropertyValue("Name", maThemeName),
-comphelper::makePropertyValue("ColorSchemeName", 
maClrScheme.GetName()),
-aColorScheme,
-};
-uno::Reference xPropertySet(xDrawPage, 
uno::UNO_QUERY);
-xPropertySet->setPropertyValue("Theme", uno::Any(aValues));
+SAL_WARN_IF(!xDrawPage.is(), "oox", "DrawPage is not set");
+
+SdrPage* pPage = GetSdrPageFromXDrawPage(xDrawPage);
+
+SAL_WARN_IF(!pPage, "oox", "Can't get SdrPage from XDrawPage");
+
+if (!pPage)
+return;
+
+auto pTheme = std::make_unique(maThemeName);
+auto pColorSet = std::make_unique(maClrScheme.GetName());
+maClrScheme.fill(*pColorSet);
+pTheme->SetColorSet(std::move(pColorSet));
+
+pPage->getSdrPageProperties().SetTheme(std::move(pTheme));
 }
 
 } // namespace oox::drawingml


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - include/svx oox/inc oox/source sd/source svx/source sw/source

2023-01-19 Thread Tomaž Vajngerl (via logerrit)
 include/svx/ColorSets.hxx|   48 ++-
 oox/inc/drawingml/textfont.hxx   |   10 +++---
 oox/source/drawingml/textfont.cxx|   20 
 sd/source/filter/eppt/pptx-epptooxml.cxx |3 +
 sd/source/ui/func/fuconstr.cxx   |2 -
 svx/source/styles/ColorSets.cxx  |   31 +---
 sw/source/uibase/sidebar/ThemePanel.cxx  |7 ++--
 7 files changed, 69 insertions(+), 52 deletions(-)

New commits:
commit 0edc0b43105b7c326e9501e994a2f039d1915021
Author: Tomaž Vajngerl 
AuthorDate: Mon Dec 12 20:59:59 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:11:39 2023 +

svx: rename mnPitch to mnPitchFamily, add resolvePitchFamily

Rename mnPitch to mnPitchFamily as it contains both. Extract the
code to resolve what is pitch and what is family into its own
(static) function.

Change-Id: I0c17351ea690a85decefb8d73dd07644ce5c78d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143991
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 4ee7e71d850315f5ae4c3b763b0e80e8d83a6454)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145836
Tested-by: Tomaž Vajngerl 

diff --git a/oox/inc/drawingml/textfont.hxx b/oox/inc/drawingml/textfont.hxx
index 6bdf13ab890a..231b18cffecb 100644
--- a/oox/inc/drawingml/textfont.hxx
+++ b/oox/inc/drawingml/textfont.hxx
@@ -51,6 +51,8 @@ public:
 sal_Int16& rnFontFamily,
 const ::oox::core::XmlFilterBase& rFilter ) const;
 
+static void resolvePitch(sal_Int32 nOoxPitch, sal_Int16& rnFontPitch, 
sal_Int16& rnFontFamily);
+
 private:
 boolimplGetFontData(
 OUString& rFontName,
@@ -58,10 +60,10 @@ private:
 sal_Int16& rnFontFamily ) const;
 
 private:
-OUString maTypeface;
-OUString maPanose;
-sal_Int32   mnPitch;
-sal_Int32   mnCharset;
+OUString maTypeface;
+OUString maPanose;
+sal_Int32 mnPitchFamily;
+sal_Int32 mnCharset;
 };
 
 
diff --git a/oox/source/drawingml/textfont.cxx 
b/oox/source/drawingml/textfont.cxx
index bcfe516893ee..e5899780ad2c 100644
--- a/oox/source/drawingml/textfont.cxx
+++ b/oox/source/drawingml/textfont.cxx
@@ -48,7 +48,7 @@ sal_Int16 lclGetFontFamily( sal_Int32 nOoxValue )
 } // namespace
 
 TextFont::TextFont() :
-mnPitch( 0 ),
+mnPitchFamily(0),
 mnCharset( WINDOWS_CHARSET_ANSI )
 {
 }
@@ -56,16 +56,16 @@ TextFont::TextFont() :
 void TextFont::setAttributes( const AttributeList& rAttribs )
 {
 maTypeface = rAttribs.getStringDefaulted( XML_typeface);
-maPanose   = rAttribs.getStringDefaulted( XML_panose);
-mnPitch= rAttribs.getInteger( XML_pitchFamily, 0 );
-mnCharset  = rAttribs.getInteger( XML_charset, WINDOWS_CHARSET_DEFAULT );
+maPanose = rAttribs.getStringDefaulted( XML_panose);
+mnPitchFamily = rAttribs.getInteger( XML_pitchFamily, 0 );
+mnCharset = rAttribs.getInteger( XML_charset, WINDOWS_CHARSET_DEFAULT );
 }
 
 void TextFont::setAttributes( const OUString& sFontName )
 {
 maTypeface = sFontName;
 maPanose.clear();
-mnPitch = 0;
+mnPitchFamily = 0;
 mnCharset = WINDOWS_CHARSET_DEFAULT;
 }
 
@@ -86,11 +86,17 @@ bool TextFont::getFontData( OUString& rFontName, sal_Int16& 
rnFontPitch, sal_Int
 bool TextFont::implGetFontData( OUString& rFontName, sal_Int16& rnFontPitch, 
sal_Int16& rnFontFamily ) const
 {
 rFontName = maTypeface;
-rnFontPitch = lclGetFontPitch( extractValue< sal_Int16 >( mnPitch, 0, 4 ) 
);
-rnFontFamily = lclGetFontFamily( extractValue< sal_Int16 >( mnPitch, 4, 4 
) );
+resolvePitch(mnPitchFamily, rnFontPitch, rnFontFamily);
 return !rFontName.isEmpty();
 }
 
+void TextFont::resolvePitch(sal_Int32 nOoxPitchFamily, sal_Int16& rnFontPitch, 
sal_Int16& rnFontFamily)
+{
+rnFontPitch = lclGetFontPitch(extractValue(nOoxPitchFamily, 0, 
4));
+rnFontFamily = lclGetFontFamily(extractValue(nOoxPitchFamily, 
4, 4));
+}
+
+
 } // namespace oox::drawingml
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 6ff08e13e6eed09a9b51413910947ac4d75bc620
Author: Tomaž Vajngerl 
AuthorDate: Mon Dec 12 20:17:09 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:11:27 2023 +

svx: rename ThemeColorType enum values, use enum instead of index

Change-Id: I81c1553205365c4076562474078b3b0aa834b249
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143990
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 1386e26b2d7fc5173266ffbfb94bc82b1d3f7bb9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145835
Tested-by: Tomaž Vajngerl 

diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx
index 91ac4e1651c7..71f12c2dbe71 100644
--- a/include/svx/ColorSets.hxx
+++ b/include/svx/ColorSets.hxx
@@ -24

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - editeng/source include/editeng sw/CppunitTest_sw_core_theme.mk sw/Module_sw.mk sw/qa sw/source writerfilter/source xmlo

2023-01-19 Thread Tomaž Vajngerl (via logerrit)
 editeng/source/items/textitem.cxx |   25 +++
 include/editeng/colritem.hxx  |   26 ---
 include/editeng/unoprnms.hxx  |2 
 sw/CppunitTest_sw_core_theme.mk   |   62 ++
 sw/Module_sw.mk   |1 
 sw/qa/core/theme/ThemeTest.cxx|   35 ++
 sw/qa/core/theme/data/ThemeColorInHeading.docx|binary
 sw/source/core/unocore/unomap.cxx |4 -
 sw/source/core/unocore/unomap1.cxx|6 +
 sw/source/core/unocore/unomapproperties.hxx   |6 +
 sw/source/uibase/sidebar/ThemePanel.cxx   |   29 ++--
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |   14 ++--
 writerfilter/source/dmapper/DomainMapper.cxx  |   16 
 writerfilter/source/dmapper/PropertyIds.cxx   |2 
 writerfilter/source/dmapper/PropertyIds.hxx   |2 
 writerfilter/source/dmapper/TDefTableHandler.cxx  |   44 
 writerfilter/source/dmapper/TDefTableHandler.hxx  |1 
 xmloff/inc/XMLThemeColorHandler.hxx   |   49 ++
 xmloff/inc/enummaps.hxx   |2 
 xmloff/source/draw/sdpropls.cxx   |3 
 xmloff/source/text/txtprhdl.cxx   |6 +
 21 files changed, 281 insertions(+), 54 deletions(-)

New commits:
commit f627192b6055479a2ac2fecd6a8349c0fdc131fc
Author: Tomaž Vajngerl 
AuthorDate: Mon Dec 5 13:59:22 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 20 07:11:05 2023 +

editeng: move "tint or shade" variable into SvxThemeColor

Change-Id: Ia2094854a8275082cf7444307e17fe5449c43b3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143698
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 6fb682487e355933d79a8ef74560ecf318b4f705)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145834
Tested-by: Tomaž Vajngerl 

diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index 147fa301d548..30b780f1b855 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1354,9 +1354,10 @@ bool SvxContourItem::GetPresentation
 }
 
 SvxThemeColor::SvxThemeColor()
-: maThemeIndex(-1),
-mnLumMod(1),
-mnLumOff(0)
+: maThemeIndex(-1)
+, mnLumMod(1)
+, mnLumOff(0)
+, mnTintOrShade(0)
 {
 }
 
@@ -1364,7 +1365,8 @@ bool SvxThemeColor::operator==(const SvxThemeColor& 
rThemeColor) const
 {
 return maThemeIndex == rThemeColor.maThemeIndex &&
 mnLumMod == rThemeColor.mnLumMod &&
-mnLumOff == rThemeColor.mnLumOff;
+mnLumOff == rThemeColor.mnLumOff &&
+mnTintOrShade  == rThemeColor.mnTintOrShade;
 }
 
 void SvxThemeColor::dumpAsXml(xmlTextWriterPtr pWriter) const
@@ -1377,6 +1379,8 @@ void SvxThemeColor::dumpAsXml(xmlTextWriterPtr pWriter) 
const
   
BAD_CAST(OString::number(mnLumMod).getStr()));
 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("lum-off"),
   
BAD_CAST(OString::number(mnLumOff).getStr()));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("tint-or-shade"),
+  
BAD_CAST(OString::number(mnTintOrShade).getStr()));
 
 (void)xmlTextWriterEndElement(pWriter);
 }
@@ -1384,15 +1388,13 @@ void SvxThemeColor::dumpAsXml(xmlTextWriterPtr pWriter) 
const
 // class SvxColorItem 
 SvxColorItem::SvxColorItem( const sal_uInt16 nId ) :
 SfxPoolItem(nId),
-mColor( COL_BLACK ),
-maTintShade(0)
+mColor( COL_BLACK )
 {
 }
 
 SvxColorItem::SvxColorItem( const Color& rCol, const sal_uInt16 nId ) :
 SfxPoolItem( nId ),
-mColor( rCol ),
-maTintShade(0)
+mColor( rCol )
 {
 }
 
@@ -1406,8 +1408,7 @@ bool SvxColorItem::operator==( const SfxPoolItem& rAttr ) 
const
 const SvxColorItem& rColorItem = static_cast(rAttr);
 
 return mColor == rColorItem.mColor &&
-   maThemeColor == rColorItem.maThemeColor &&
-   maTintShade == rColorItem.maTintShade;
+   maThemeColor == rColorItem.maThemeColor;
 }
 
 bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
@@ -1433,7 +1434,7 @@ bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 }
 case MID_COLOR_TINT_OR_SHADE:
 {
-rVal <<= maTintShade;
+rVal <<= maThemeColor.GetTintOrShade();
 break;
 }
 case MID_COLOR_LUM_MOD:
@@ -1489,7 +1490,7 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 sal_Int16 nTintShade = -1;
 if (!(rVal >>= nTintShade))
 return false;
-maTintShade = nTintShade;
+maThemeColor.S

[Libreoffice-commits] core.git: officecfg/registry sd/source sd/util solenv/bin

2023-01-19 Thread Noel Grandin (via logerrit)
 officecfg/registry/data/org/openoffice/Office/Impress.xcu   |7 -
 officecfg/registry/schema/org/openoffice/Office/Impress.xcs |9 --
 sd/source/ui/framework/factories/PresentationFactory.cxx|   43 --
 sd/source/ui/framework/module/ModuleController.cxx  |   47 +---
 sd/source/ui/inc/framework/ModuleController.hxx |   18 
 sd/source/ui/inc/framework/PresentationFactory.hxx  |9 ++
 sd/util/sd.component|4 -
 solenv/bin/native-code.py   |1 
 8 files changed, 21 insertions(+), 117 deletions(-)

New commits:
commit 4c06cfcd13195e9e996bc09dbee2dcac1c5e8ed2
Author: Noel Grandin 
AuthorDate: Thu Jan 19 12:36:54 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 20 06:26:48 2023 +

[API CHANGE] no need to load PresentationFactoryProvider via UNO and/or 
config

there is no benefit to having this constructed in such a convoluted
manner

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

diff --git a/officecfg/registry/data/org/openoffice/Office/Impress.xcu 
b/officecfg/registry/data/org/openoffice/Office/Impress.xcu
index 112a89e8521f..37ebdf4d005f 100644
--- a/officecfg/registry/data/org/openoffice/Office/Impress.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Impress.xcu
@@ -181,13 +181,6 @@
   
 
   
-  
-
-  
-
com.sun.star.drawing.framework.PresentationFactoryProvider
-  
-
-  
 
   
   
diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
index fefd4ba2f6bf..e650c48e9766 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
@@ -1319,15 +1319,6 @@
 Multi Pane Framework Resource Factories
   
 
-
-  
-
-  Set of services that are instantiated every time the
-  framework of a Draw or Impress document is initialized.
-
-Multi Pane Framework Startup Services
-  
-
   
   
 
diff --git a/sd/source/ui/framework/factories/PresentationFactory.cxx 
b/sd/source/ui/framework/factories/PresentationFactory.cxx
index 73c2d4bdb732..6603f5db5159 100644
--- a/sd/source/ui/framework/factories/PresentationFactory.cxx
+++ b/sd/source/ui/framework/factories/PresentationFactory.cxx
@@ -39,20 +39,6 @@ namespace sd::framework {
 
 namespace {
 
-typedef comphelper::WeakComponentImplHelper 
PresentationFactoryProviderInterfaceBase;
-
-class PresentationFactoryProvider
-: public PresentationFactoryProviderInterfaceBase
-{
-public:
-PresentationFactoryProvider ();
-
-// XInitialization
-
-virtual void SAL_CALL initialize(
-const css::uno::Sequence& aArguments) override;
-};
-
 typedef comphelper::WeakComponentImplHelper 
PresentationViewInterfaceBase;
 
 /** The PresentationView is not an actual view, it is a marker whose
@@ -143,32 +129,19 @@ void PresentationFactory::ThrowIfDisposed() const
 }
 }
 
-namespace {
-
 //= PresentationFactoryProvider ===
 
-PresentationFactoryProvider::PresentationFactoryProvider ()
-{
-}
-
-// XInitialization
-
-void SAL_CALL PresentationFactoryProvider::initialize(
-const Sequence& aArguments)
+PresentationFactoryProvider::PresentationFactoryProvider (const 
Reference& rxController)
 {
-if (!aArguments.hasElements())
-return;
-
 try
 {
 // Get the XController from the first argument.
-Reference xController (aArguments[0], 
UNO_QUERY_THROW);
-Reference xCM (xController, UNO_QUERY_THROW);
+Reference xCM (rxController, UNO_QUERY_THROW);
 Reference xCC 
(xCM->getConfigurationController());
 if (xCC.is())
 xCC->addResourceFactory(
 gsPresentationViewURL,
-new PresentationFactory(xController));
+new PresentationFactory(rxController));
 }
 catch (RuntimeException&)
 {
@@ -176,17 +149,7 @@ void SAL_CALL PresentationFactoryProvider::initialize(
 }
 }
 
-} // end of anonymous namespace.
-
 } // end of namespace sd::framework
 
 
-extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
-com_sun_star_comp_Draw_framework_PresentationFactoryProvider_get_implementation(css::uno::XComponentContext*,
-
css::uno::Sequence const &)
-{
-return cppu::acquire(new sd::framework::PresentationFactoryProvider);
-}
-
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/framework/module/ModuleController.cxx 
b/sd/source/ui/framework/module/ModuleController.cxx
inde

Re: Mold linker and clang 15: /usr/bin/ld: cannot find -lLLVM-14: No such file or directory

2023-01-19 Thread Ilmari Lauhakangas

On 19.1.2023 16.24, Christian Lohmaier wrote:

On Thu, Jan 19, 2023 at 3:15 PM Ilmari Lauhakangas
 wrote:


After upgrading from llvm 14 to 15 today, I got this:



[GEN] compilerplugins/clang/sharedvisitor/analyzer
/usr/bin/ld: cannot find -lLLVM-14: No such file or directory


FYI: compilerplugins stuff doesn't get wiped with regular make clean,
use make compilerplugins-clean or make distclean


Indeed, make distclean helped, thanks.

Ilmari


[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - vcl/unx

2023-01-19 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

New commits:
commit e49307d408fc95c280da729c6fdfc95d774c8837
Author: Caolán McNamara 
AuthorDate: Thu Jan 19 16:31:03 2023 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Fri Jan 20 03:21:16 2023 +

Resolves: tdf#153091 support text/plain without encoding from nedit

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

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 9a5be553501f..a072db8c5cc8 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -825,16 +825,12 @@ public:
 
 virtual css::uno::Any SAL_CALL getTransferData(const 
css::datatransfer::DataFlavor& rFlavor) override
 {
+css::uno::Any aRet;
+
 css::datatransfer::DataFlavor aFlavor(rFlavor);
 if (aFlavor.MimeType == "text/plain;charset=utf-16")
 aFlavor.MimeType = "text/plain;charset=utf-8";
 
-auto it = m_aMimeTypeToGtkType.find(aFlavor.MimeType);
-if (it == m_aMimeTypeToGtkType.end())
-return css::uno::Any();
-
-css::uno::Any aRet;
-
 GdkClipboard* clipboard = clipboard_get(m_eSelection);
 
 #if !GTK_CHECK_VERSION(4, 0, 0)
@@ -846,21 +842,25 @@ public:
 aRet <<= aStr.replaceAll("\r\n", "\n");
 return aRet;
 }
-else
+#endif
+
+auto it = m_aMimeTypeToGtkType.find(aFlavor.MimeType);
+if (it == m_aMimeTypeToGtkType.end())
+return css::uno::Any();
+
+#if !GTK_CHECK_VERSION(4, 0, 0)
+GtkSelectionData* data = gtk_clipboard_wait_for_contents(clipboard,
+ it->second);
+if (!data)
 {
-GtkSelectionData* data = gtk_clipboard_wait_for_contents(clipboard,
- 
it->second);
-if (!data)
-{
-return css::uno::Any();
-}
-gint length;
-const guchar *rawdata = 
gtk_selection_data_get_data_with_length(data,
-
&length);
-Sequence aSeq(reinterpret_cast(rawdata), length);
-gtk_selection_data_free(data);
-aRet <<= aSeq;
+return css::uno::Any();
 }
+gint length;
+const guchar *rawdata = gtk_selection_data_get_data_with_length(data,
+
&length);
+Sequence aSeq(reinterpret_cast(rawdata), 
length);
+gtk_selection_data_free(data);
+aRet <<= aSeq;
 #else
 SalInstance* pInstance = GetSalInstance();
 read_transfer_result aRes;


[Libreoffice-commits] core.git: writerfilter/source

2023-01-19 Thread Justin Luth (via logerrit)
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   31 --
 1 file changed, 17 insertions(+), 14 deletions(-)

New commits:
commit d2cd7097ab8d8fe1a69b9f6e4a11c978b667951a
Author: Justin Luth 
AuthorDate: Thu Jan 19 12:04:32 2023 -0500
Commit: Justin Luth 
CommitDate: Fri Jan 20 03:06:17 2023 +

NFC writerfilter: avoid unnecessary code processing

Early return on useless parameter,
and conditional processing on missing ID.

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

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 48dfc3434ed4..0b73640fd57f 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -253,27 +253,30 @@ static FieldContextPtr GetParentFieldContext(const 
std::deque&
 /// Decides if the pInner field inside pOuter is allowed in Writer core, 
depending on their type.
 static bool IsFieldNestingAllowed(const FieldContextPtr& pOuter, const 
FieldContextPtr& pInner)
 {
-std::optional oOuterFieldId = pOuter->GetFieldId();
-OUString aCommand = pOuter->GetCommand();
-
-// Ignore leading space before the field name, but don't accept IFF when 
we check for IF.
-if (!aCommand.isEmpty() && aCommand[0] == ' ')
-{
-aCommand = aCommand.subView(1);
-}
-
-if (!oOuterFieldId && aCommand.startsWith("IF "))
+if (!pInner->GetFieldId())
 {
-// This will be FIELD_IF once the command is closed.
-oOuterFieldId = FIELD_IF;
+return true;
 }
 
+std::optional oOuterFieldId = pOuter->GetFieldId();
 if (!oOuterFieldId)
 {
-return true;
+OUString aCommand = pOuter->GetCommand();
+
+// Ignore leading space before the field name, but don't accept IFF 
when we check for IF.
+if (!aCommand.isEmpty() && aCommand[0] == ' ')
+{
+aCommand = aCommand.subView(1);
+}
+
+if (aCommand.startsWith("IF "))
+{
+// This will be FIELD_IF once the command is closed.
+oOuterFieldId = FIELD_IF;
+}
 }
 
-if (!pInner->GetFieldId())
+if (!oOuterFieldId)
 {
 return true;
 }


[Libreoffice-commits] core.git: sw/inc sw/source

2023-01-19 Thread Jim Raykowski (via logerrit)
 sw/inc/bitmaps.hlst|1 
 sw/source/uibase/inc/conttree.hxx  |2 
 sw/source/uibase/utlui/content.cxx |   81 -
 3 files changed, 39 insertions(+), 45 deletions(-)

New commits:
commit 1c638b7ac46d8077994c8483e6becc4a33efd12b
Author: Jim Raykowski 
AuthorDate: Sat Jan 14 22:45:18 2023 -0900
Commit: Jim Raykowski 
CommitDate: Fri Jan 20 01:10:19 2023 +

tdf#149073 SwNavigator: provide an indication for linked images

Sets an image for image content entries that are of linked type

Function 'InsertContent' added to replace duplicated code that
inserts content.

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

diff --git a/sw/inc/bitmaps.hlst b/sw/inc/bitmaps.hlst
index 647d2fb2f073..9606076d3032 100644
--- a/sw/inc/bitmaps.hlst
+++ b/sw/inc/bitmaps.hlst
@@ -81,6 +81,7 @@ inline constexpr OUStringLiteral RID_BMP_NAVI_OUTLINE = 
u"sw/res/nc2.png";
 inline constexpr OUStringLiteral RID_BMP_NAVI_TABLE = u"sw/res/nc20001.png";
 inline constexpr OUStringLiteral RID_BMP_NAVI_FRAME = u"sw/res/nc20002.png";
 inline constexpr OUStringLiteral RID_BMP_NAVI_GRAPHIC = u"sw/res/nc20003.png";
+inline constexpr OUStringLiteral RID_BMP_NAVI_GRAPHIC_LINK = 
u"sw/res/nc20007.png";
 inline constexpr OUStringLiteral RID_BMP_NAVI_OLE = u"sw/res/nc20004.png";
 inline constexpr OUStringLiteral RID_BMP_NAVI_BOOKMARK = u"sw/res/nc20005.png";
 inline constexpr OUStringLiteral RID_BMP_NAVI_REGION = u"sw/res/nc20006.png";
diff --git a/sw/source/uibase/inc/conttree.hxx 
b/sw/source/uibase/inc/conttree.hxx
index b4f352bb6950..c924241d0153 100644
--- a/sw/source/uibase/inc/conttree.hxx
+++ b/sw/source/uibase/inc/conttree.hxx
@@ -155,6 +155,8 @@ class SwContentTree final : public SfxListener
  */
 voidFindActiveTypeAndRemoveUserData();
 
+void InsertContent(const weld::TreeIter& rParent);
+
 void insert(const weld::TreeIter* pParent, const OUString& rStr, const 
OUString& rId,
 bool bChildrenOnDemand, weld::TreeIter* pRet);
 
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index d76b1103991e..1148689ce9d9 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2063,6 +2063,34 @@ IMPL_LINK(SwContentTree, CommandHdl, const 
CommandEvent&, rCEvt, bool)
 return true;
 }
 
+void SwContentTree::InsertContent(const weld::TreeIter& rParent)
+{
+
assert(dynamic_cast(weld::fromId(m_xTreeView->get_id(rParent;
+SwContentType* pCntType = 
weld::fromId(m_xTreeView->get_id(rParent));
+bool bGraphic = pCntType->GetType() == ContentTypeId::GRAPHIC;
+bool bRegion = pCntType->GetType() == ContentTypeId::REGION;
+std::unique_ptr xChild = m_xTreeView->make_iterator();
+const size_t nCount = pCntType->GetMemberCount();
+for(size_t i = 0; i < nCount; ++i)
+{
+const SwContent* pCnt = pCntType->GetMember(i);
+if (pCnt)
+{
+OUString sEntry = pCnt->GetName();
+if (sEntry.isEmpty())
+sEntry = m_sSpace;
+OUString sId(weld::toId(pCnt));
+insert(&rParent, sEntry, sId, false, xChild.get());
+m_xTreeView->set_sensitive(*xChild, !pCnt->IsInvisible());
+if (bGraphic && !static_cast(pCnt)->GetLink().isEmpty())
+m_xTreeView->set_image(*xChild, RID_BMP_NAVI_GRAPHIC_LINK);
+else if (bRegion)
+m_xTreeView->set_extra_row_indent(*xChild,
+static_cast(pCnt)->GetRegionLevel());
+}
+}
+}
+
 void SwContentTree::insert(const weld::TreeIter* pParent, const OUString& 
rStr, const OUString& rId,
bool bChildrenOnDemand, weld::TreeIter* pRet)
 {
@@ -2085,9 +2113,9 @@ void SwContentTree::remove(const weld::TreeIter& rIter)
 // Content will be integrated into the Box only on demand.
 bool SwContentTree::RequestingChildren(const weld::TreeIter& rParent)
 {
-bool bChild = m_xTreeView->iter_has_child(rParent);
-if (bChild || !m_xTreeView->get_children_on_demand(rParent))
-return bChild;
+// Does the parent already have children or is it not a 'children on 
demand' node?
+if (m_xTreeView->iter_has_child(rParent) || 
!m_xTreeView->get_children_on_demand(rParent))
+return false;
 
 // Is this a content type?
 if (lcl_IsContentType(rParent, *m_xTreeView))
@@ -2134,34 +2162,16 @@ bool SwContentTree::RequestingChildren(const 
weld::TreeIter& rParent)
 
 // add this node as a parent candidate for any following 
nodes at a higher outline level
 
aParentCandidates.emplace_back(m_xTreeView->make_iterator(xChild.get()));
-
-bChild = true;
 }
 }
 }
 else
-

[Libreoffice-commits] core.git: sw/qa sw/source

2023-01-19 Thread Justin Luth (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |4 +++-
 sw/qa/extras/ww8export/data/tdf141649_conditionalText.doc |binary
 sw/qa/extras/ww8export/ww8export4.cxx |9 +
 sw/source/filter/ww8/ww8par5.cxx  |   10 ++
 4 files changed, 22 insertions(+), 1 deletion(-)

New commits:
commit 85ae3d1513d4be3eb102bf3065ddfba27cb1f1c3
Author: Justin Luth 
AuthorDate: Wed Jan 18 14:32:21 2023 -0500
Commit: Justin Luth 
CommitDate: Thu Jan 19 23:57:28 2023 +

tdf#141649 doc import: do not duplicate conditional text

This patch is a mixed blessing.
It will be a regression if an IF FIELD was bogus,
and the user only wanted to see the modified, unrefreshed text.

That is because in MS Word, most fields do not update automatically,
but require the user to press F9 to refresh the contents.
The contents are also editable, so the result might not match
either the true or false result-string.

However, in LO the IF FIELD is always refreshed, and thus will
never display any bogus hand-modifications.

The import of these IF fields started in DOC in LO 6.1,
but it was never correct and immediately duplicated content.
Additionally, DOC format didn't export at all, so anything
to do with IF FIELDS was lost - meaning that after a round-trip
the result was the same as what MS Word last saw with the field gone.

So in the eyes of the user, the fixing of import and export
might be causing a regression of changed text.
So be it.

I can only assume that in most cases the use of an IF FIELD
is intentional and that it would be desirsable to have it working.

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index d20cf2338a07..11ddc54f1717 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -824,7 +824,9 @@ CPPUNIT_TEST_FIXTURE(Test, testConditionalText2)
 // Load a document which has a conditional text field in it.
 xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
 std::u16string_view aExpected(u" IF 1 = 1 \"test1\" \"test2\"");
-assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[3]/w:instrText", 
OUString(aExpected));
+assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText", 
OUString(aExpected));
+
+getParagraph(1, "test1");
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf142464_ampm, "tdf142464_ampm.docx")
diff --git a/sw/qa/extras/ww8export/data/tdf141649_conditionalText.doc 
b/sw/qa/extras/ww8export/data/tdf141649_conditionalText.doc
new file mode 100644
index ..9e4ec49e38a6
Binary files /dev/null and 
b/sw/qa/extras/ww8export/data/tdf141649_conditionalText.doc differ
diff --git a/sw/qa/extras/ww8export/ww8export4.cxx 
b/sw/qa/extras/ww8export/ww8export4.cxx
index 1910178d0ac8..6889b587ac6a 100644
--- a/sw/qa/extras/ww8export/ww8export4.cxx
+++ b/sw/qa/extras/ww8export/ww8export4.cxx
@@ -78,6 +78,15 @@ DECLARE_WW8EXPORT_TEST(testTdf151548_formFieldMacros, 
"tdf151548_formFieldMacros
 }
 }
 
+DECLARE_WW8EXPORT_TEST(testTdf141649_conditionalText, 
"tdf141649_conditionalText.doc")
+{
+// In MS Word, the IF field is editable and requires manual update, so the 
most correct
+// result is "manual refresh with F9" inside a text field,
+// but for our purposes, a single instance of "trueResult" is appropriate.
+getParagraph(1, "trueResult");
+}
+
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 35cb2b507369..ddaad0e3f741 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -1026,6 +1026,16 @@ tools::Long 
SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
 m_bEmbeddObj = true;
 // Field not supported: store the field code for later use
 m_aFieldStack.back().SetBookmarkCode( aStr );
+
+if (aF.nId == ww::eIF)
+{
+// In MS Word, the IF field is editable and requires a manual 
refresh
+// so the last, saved result might not match either of the 
true or false options.
+// But in LO the field is automatically updated and not 
editable,
+// so the previous result is of no value to import since it 
could never be seen.
+return aF.nLen;
+}
+
 return aF.nLen - aF.nLRes - 1;  // skipped too many, the resulted 
field will be read like main text
 }
 }


[Libreoffice-commits] core.git: sw/qa

2023-01-19 Thread Andreas Heinisch (via logerrit)
 sw/qa/uitest/writer_tests7/tdf135938.py |   25 +++--
 1 file changed, 15 insertions(+), 10 deletions(-)

New commits:
commit a29ec09f7c2a01f131095fd9b2ecafa0812e8325
Author: Andreas Heinisch 
AuthorDate: Thu Jan 19 15:57:27 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Thu Jan 19 22:57:59 2023 +

tdf#135938 - Search for "insert reference" tree entry

Instead of assuming that the "insert reference" entry is always the second 
item of the menu tree, search for the correct child in the tree list. This 
commit addresses the failing build from 
https://gerrit.libreoffice.org/c/core/+/140985.

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

diff --git a/sw/qa/uitest/writer_tests7/tdf135938.py 
b/sw/qa/uitest/writer_tests7/tdf135938.py
index 013da93624da..00a72bec26ff 100755
--- a/sw/qa/uitest/writer_tests7/tdf135938.py
+++ b/sw/qa/uitest/writer_tests7/tdf135938.py
@@ -31,16 +31,21 @@ class tdf135938(UITestCase):
 xName.executeAction("TYPE", mkPropertyValues({"TEXT": "DEF"}))
 xInsert.executeAction("CLICK", tuple())
 
-# Select insert reference type
-xTreeEntry = xTreelistType.getChild('1')
-self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], 
"Insert Reference")
-xTreeEntry.executeAction("SELECT", tuple())
+# Search for insert reference type
+xFilter = None
+for childIx in range(len(xTreelistType.getChildren())):
+xTreeEntry = xTreelistType.getChild(childIx)
+if get_state_as_dict(xTreeEntry)["Text"] == "Insert 
Reference":
+xTreeEntry.executeAction("SELECT", tuple())
+# Filter the cross references
+xFilter = xDialog.getChild("filter")
+xFilter.executeAction("TYPE", 
mkPropertyValues({"TEXT": "A"}))
+# Without the fix in place, this test would have 
failed with
+# AssertionError: 'ABC' != 'DEF', i.e., the text of 
the name field did not change
+self.assertEqual(get_state_as_dict(xName)["Text"], 
"ABC")
+break
 
-# Filter the cross references
-xFilter = xDialog.getChild("filter")
-xFilter.executeAction("TYPE", mkPropertyValues({"TEXT": "A"}))
-# Without the fix in place, this test would have failed with
-# AssertionError: 'ABC' != 'DEF', i.e., the text of the name 
field did not change
-self.assertEqual(get_state_as_dict(xName)["Text"], "ABC")
+# Check if insert reference entry was found
+self.assertFalse(xFilter is None)
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


[Libreoffice-commits] core.git: odk/examples

2023-01-19 Thread Chenxiong Qi (via logerrit)
 odk/examples/examples.html |   47 +++-
 odk/examples/python/Spreadsheet/ChartTypeChange.py |  101 +
 odk/examples/python/Spreadsheet/EuroAdaption.py|  164 +++
 odk/examples/python/Spreadsheet/SCalc.py   |  225 +
 4 files changed, 530 insertions(+), 7 deletions(-)

New commits:
commit 9753aa4a776af24c1bfb9cd41867ee2078438934
Author: Chenxiong Qi 
AuthorDate: Thu Dec 8 18:47:13 2022 +0800
Commit: Hossein 
CommitDate: Thu Jan 19 21:39:01 2023 +

tdf#143123 Port some Spreadsheet Java examples to Python

Some examples inside odk/examples/java/Spreadsheet are ported to
Python:

ChartTypeChange.java-> ChartTypeChange.py
EuroAdaption.java   -> EuroAdaption.py
SCalc.java  -> SCalc.py

Code format is checked with 'pycodestyle':

pycodestyle --ignore=E501,E722 odk/examples/python/Spreadsheet/*.py

Signed-off-by: Chenxiong Qi 
Change-Id: If0631b5970faab6499cfea3eef559e003fad24d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143810
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/odk/examples/examples.html b/odk/examples/examples.html
index 86589c3624a0..f50dffbc79e8 100644
--- a/odk/examples/examples.html
+++ b/odk/examples/examples.html
@@ -509,13 +509,46 @@
 
 
   
-  
- 
- 
- No Additional information
- 
- 
- 
+
+  
+
+  Spreadsheet Document Examples
+  Description
+
+
+  ChartTypeChange
+  This class loads a LibreOffice 
%PRODUCT_RELEASE% Calc document and changes the type of the embedded chart.
+
+
+  EuroAdaption
+  The application connects to the office 
server and gets
+the  multi component factory, opens 
an empty Calc document, enters an
+example text, sets the number format to DM, changes the 
number format to
+EUR (Euro), and uses the DM/EUR factor on each cell with 
content.
+  
+
+
+  SCalc
+  The program connects to the office server 
and gets the
+ multi component factory. Then an 
empty calc document will be opened,
+cell styles will be created, some data will be inserted 
into the sheets,
+and the created cell styles will be applied. Finally, a 3D 
chart will be
+inserted.
+  
+
+  
+
+  
+
+
+  
+
+  
+
+ No Additional information
+
+  
+
   
 
   
diff --git a/odk/examples/python/Spreadsheet/ChartTypeChange.py 
b/odk/examples/python/Spreadsheet/ChartTypeChange.py
new file mode 100644
index ..6ee2c31d6766
--- /dev/null
+++ b/odk/examples/python/Spreadsheet/ChartTypeChange.py
@@ -0,0 +1,101 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+import sys
+import time
+import traceback
+from typing import Union
+
+import officehelper
+from com.sun.star.awt import Rectangle
+
+
+def main():
+try:
+remote_context = officehelper.bootstrap()
+srv_mgr = remote_context.getServiceManager()
+desktop = srv_mgr.createInstanceWithContext(
+"com.sun.star.frame.Desktop", remote_context
+)
+doc = desktop.loadComponentFromURL("private:factory/scalc", "_blank", 
0, tuple())
+sheet = doc.Sheets[0]
+
+cell_values = (
+("", "Jan", "Feb", "Mar", "Apr", "Mai"),
+("Profit", 12.3, 43.2, 5.1, 76, 56.8),
+("Rival in business", 12.2, 12.6, 17.7, 20.4, 100),
+)
+
+# Write the data into spreadsheet.
+for row, row_data in enumerate(cell_values):
+for column, cell_value in enumerate(row_data):
+insert_into_cell(column, row, cell_value, sheet)
+
+# Create a rectangle, which holds the size of the chart.
+rect = Rectangle()
+rect.X, rect.Y, rect.Width, rect.Height = 500, 3000, 25000, 11000
+
+# Create the Unicode of the character for the column name.
+char_rect = chr(65 + len(cell_values[0]) - 1)
+# Get the cell range of the written values.
+chart_cell_range = sheet[f"A1:{char_rect}{len(cell_values)}"]
+

[Libreoffice-commits] core.git: sw/inc sw/source

2023-01-19 Thread Noel Grandin (via logerrit)
 sw/inc/unotextrange.hxx  |4 +---
 sw/source/core/unocore/unocrsrhelper.cxx |3 +--
 sw/source/core/unocore/unoobj2.cxx   |   15 ---
 3 files changed, 2 insertions(+), 20 deletions(-)

New commits:
commit 8d68c4e24ecf117f89d6af81cfbebc0cf6a6c039
Author: Noel Grandin 
AuthorDate: Wed Jan 18 15:34:40 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 19 20:31:25 2023 +

XUnoTunnel->dynamic_cast in SwXTextRanges

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

diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx
index 76e2621fd933..b64712b5ba5a 100644
--- a/sw/inc/unotextrange.hxx
+++ b/sw/inc/unotextrange.hxx
@@ -210,8 +210,7 @@ public:
 };
 
 typedef ::cppu::WeakImplHelper
-<   css::lang::XUnoTunnel
-,   css::lang::XServiceInfo
+<   css::lang::XServiceInfo
 ,   css::container::XIndexAccess
 > SwXTextRanges_Base;
 
@@ -219,7 +218,6 @@ struct SwXTextRanges : public SwXTextRanges_Base
 {
 virtual SwUnoCursor* GetCursor() =0;
 static rtl::Reference Create(SwPaM* const pCursor);
-static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
 };
 
 #endif // INCLUDED_SW_INC_UNOTEXTRANGE_HXX
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx 
b/sw/source/core/unocore/unocrsrhelper.cxx
index d41bf32e4ba9..df73ee184c04 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -177,8 +177,7 @@ void GetSelectableFromAny(uno::Reference 
const& xIfc,
 return;
 }
 
-SwXTextRanges* const pRanges(
-comphelper::getFromUnoTunnel(xTunnel));
+SwXTextRanges* const pRanges = dynamic_cast(xIfc.get());
 if (pRanges)
 {
 SwUnoCursor const* pUnoCursor = pRanges->GetCursor();
diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index 87abdf72ffd1..75461d29f549 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1550,9 +1550,6 @@ namespace {
 struct SwXTextRangesImpl final : public SwXTextRanges
 {
 
-// XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& rIdentifier) override;
-
 // XServiceInfo
 virtual OUString SAL_CALL getImplementationName() override
 { return "SwXTextRanges"; };
@@ -1614,18 +1611,6 @@ void SwXTextRangesImpl::MakeRanges()
 rtl::Reference SwXTextRanges::Create(SwPaM *const pPaM)
 { return new SwXTextRangesImpl(pPaM); }
 
-const uno::Sequence< sal_Int8 > & SwXTextRanges::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theSwXTextRangesUnoTunnelId;
-return theSwXTextRangesUnoTunnelId.getSeq();
-}
-
-sal_Int64 SAL_CALL
-SwXTextRangesImpl::getSomething(const uno::Sequence< sal_Int8 >& rId)
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
 /*
  *  Text positions
  * Up to the first access to a text position, only a SwCursor is stored.


[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - unoxml/inc unoxml/source

2023-01-19 Thread Michael Stahl (via logerrit)
 unoxml/inc/node.hxx|3 ++-
 unoxml/source/dom/attr.cxx |2 +-
 unoxml/source/dom/attr.hxx |3 ++-
 unoxml/source/dom/document.cxx |8 +---
 unoxml/source/dom/document.hxx |3 ++-
 unoxml/source/dom/documentfragment.cxx |2 +-
 unoxml/source/dom/documentfragment.hxx |3 ++-
 unoxml/source/dom/element.cxx  |2 +-
 unoxml/source/dom/element.hxx  |3 ++-
 unoxml/source/dom/entity.cxx   |2 +-
 unoxml/source/dom/entity.hxx   |3 ++-
 unoxml/source/dom/entityreference.cxx  |2 +-
 unoxml/source/dom/entityreference.hxx  |3 ++-
 unoxml/source/dom/node.cxx |8 
 14 files changed, 28 insertions(+), 19 deletions(-)

New commits:
commit f91be4463ee303b11ec4b60186e9fbec390f7f11
Author: Michael Stahl 
AuthorDate: Wed Jan 18 20:58:47 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Jan 19 19:40:53 2023 +

tdf#153039 unoxml: replace root element of CDocument throws

XForms replace doesn't work because:

CDocument::IsChildTypeAllowed() tests that the document node does not
already have an element child, because only one is allowed - but when
called from CNode::replaceChild(), the existing child will be removed,
so that needs to be allowed to proceed (check that removed child is
also element).

(regression from commit c5db3b93ee1058bd20ebcde2e757b52b9a67b74a)

Change-Id: I167de3462f4d1934dbf8404ad395349897cfd981
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145757
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 9b9bc7461e0513e2bb493e7f00f800b2463751e1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145788
Reviewed-by: Caolán McNamara 

diff --git a/unoxml/inc/node.hxx b/unoxml/inc/node.hxx
index e6974271f83a..bc93c5871b55 100644
--- a/unoxml/inc/node.hxx
+++ b/unoxml/inc/node.hxx
@@ -130,7 +130,8 @@ namespace DOM
 virtual void fastSaxify( Context& io_rContext );
 
 // constrains child relationship between nodes based on type
-virtual bool IsChildTypeAllowed(css::xml::dom::NodeType const 
nodeType);
+virtual bool IsChildTypeAllowed(css::xml::dom::NodeType nodeType,
+css::xml::dom::NodeType const* pReplacedNodeType);
 
 //  DOM interfaces
 
diff --git a/unoxml/source/dom/attr.cxx b/unoxml/source/dom/attr.cxx
index 1a993e152bd7..4988aa4211ec 100644
--- a/unoxml/source/dom/attr.cxx
+++ b/unoxml/source/dom/attr.cxx
@@ -70,7 +70,7 @@ namespace DOM
 return pNs;
 }
 
-bool CAttr::IsChildTypeAllowed(NodeType const nodeType)
+bool CAttr::IsChildTypeAllowed(NodeType const nodeType, NodeType 
const*const)
 {
 switch (nodeType) {
 case NodeType_TEXT_NODE:
diff --git a/unoxml/source/dom/attr.hxx b/unoxml/source/dom/attr.hxx
index 30c0aa25bb34..f30b25896158 100644
--- a/unoxml/source/dom/attr.hxx
+++ b/unoxml/source/dom/attr.hxx
@@ -52,7 +52,8 @@ namespace DOM
 /// return the libxml namespace corresponding to m_pNamespace on pNode
 xmlNsPtr GetNamespace(xmlNodePtr const pNode);
 
-virtual bool IsChildTypeAllowed(css::xml::dom::NodeType const 
nodeType) override;
+virtual bool IsChildTypeAllowed(css::xml::dom::NodeType const nodeType,
+css::xml::dom::NodeType const*) override;
 
 /**
 Returns the name of this attribute.
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx
index 49c524b5ee99..413f764815e5 100644
--- a/unoxml/source/dom/document.cxx
+++ b/unoxml/source/dom/document.cxx
@@ -291,7 +291,7 @@ namespace DOM
 rContext.mxDocHandler->endDocument();
 }
 
-bool CDocument::IsChildTypeAllowed(NodeType const nodeType)
+bool CDocument::IsChildTypeAllowed(NodeType const nodeType, NodeType 
const*const pReplacedNodeType)
 {
 switch (nodeType) {
 case NodeType_PROCESSING_INSTRUCTION_NODE:
@@ -299,10 +299,12 @@ namespace DOM
 return true;
 case NodeType_ELEMENT_NODE:
  // there may be only one!
-return nullptr == lcl_getDocumentRootPtr(m_aDocPtr);
+return (pReplacedNodeType && *pReplacedNodeType == nodeType)
+|| nullptr == lcl_getDocumentRootPtr(m_aDocPtr);
 case NodeType_DOCUMENT_TYPE_NODE:
  // there may be only one!
-return nullptr == lcl_getDocumentType(m_aDocPtr);
+return (pReplacedNodeType && *pReplacedNodeType == nodeType)
+|| nullptr == lcl_getDocumentType(m_aDocPtr);
 default:
 return false;
 }
diff --git a/unoxml/source/dom/document.hxx b/unoxml/source/dom/document.hxx
index 291535ebf8e5..450b9200f86f 100644
--- a/unoxml/source/dom/document.hxx
+++ b/unoxml/source/dom/document.hxx
@@ -114,7 +114,8 @@ n

[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - unoxml/inc unoxml/source

2023-01-19 Thread Michael Stahl (via logerrit)
 unoxml/inc/node.hxx|3 ++-
 unoxml/source/dom/attr.cxx |2 +-
 unoxml/source/dom/attr.hxx |3 ++-
 unoxml/source/dom/document.cxx |8 +---
 unoxml/source/dom/document.hxx |3 ++-
 unoxml/source/dom/documentfragment.cxx |2 +-
 unoxml/source/dom/documentfragment.hxx |3 ++-
 unoxml/source/dom/element.cxx  |2 +-
 unoxml/source/dom/element.hxx  |3 ++-
 unoxml/source/dom/entity.cxx   |2 +-
 unoxml/source/dom/entity.hxx   |3 ++-
 unoxml/source/dom/entityreference.cxx  |2 +-
 unoxml/source/dom/entityreference.hxx  |3 ++-
 unoxml/source/dom/node.cxx |8 
 14 files changed, 28 insertions(+), 19 deletions(-)

New commits:
commit eb40bf437756d7f27fe08d039353b89251b5447f
Author: Michael Stahl 
AuthorDate: Wed Jan 18 20:58:47 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Jan 19 19:40:44 2023 +

tdf#153039 unoxml: replace root element of CDocument throws

XForms replace doesn't work because:

CDocument::IsChildTypeAllowed() tests that the document node does not
already have an element child, because only one is allowed - but when
called from CNode::replaceChild(), the existing child will be removed,
so that needs to be allowed to proceed (check that removed child is
also element).

(regression from commit c5db3b93ee1058bd20ebcde2e757b52b9a67b74a)

Change-Id: I167de3462f4d1934dbf8404ad395349897cfd981
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145757
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 9b9bc7461e0513e2bb493e7f00f800b2463751e1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145731
Reviewed-by: Caolán McNamara 

diff --git a/unoxml/inc/node.hxx b/unoxml/inc/node.hxx
index 852bcd1ae972..36301e10f22c 100644
--- a/unoxml/inc/node.hxx
+++ b/unoxml/inc/node.hxx
@@ -136,7 +136,8 @@ namespace DOM
 virtual void fastSaxify( Context& io_rContext );
 
 // constrains child relationship between nodes based on type
-virtual bool IsChildTypeAllowed(css::xml::dom::NodeType const 
nodeType);
+virtual bool IsChildTypeAllowed(css::xml::dom::NodeType nodeType,
+css::xml::dom::NodeType const* pReplacedNodeType);
 
 //  DOM interfaces
 
diff --git a/unoxml/source/dom/attr.cxx b/unoxml/source/dom/attr.cxx
index 1a993e152bd7..4988aa4211ec 100644
--- a/unoxml/source/dom/attr.cxx
+++ b/unoxml/source/dom/attr.cxx
@@ -70,7 +70,7 @@ namespace DOM
 return pNs;
 }
 
-bool CAttr::IsChildTypeAllowed(NodeType const nodeType)
+bool CAttr::IsChildTypeAllowed(NodeType const nodeType, NodeType 
const*const)
 {
 switch (nodeType) {
 case NodeType_TEXT_NODE:
diff --git a/unoxml/source/dom/attr.hxx b/unoxml/source/dom/attr.hxx
index 30c0aa25bb34..f30b25896158 100644
--- a/unoxml/source/dom/attr.hxx
+++ b/unoxml/source/dom/attr.hxx
@@ -52,7 +52,8 @@ namespace DOM
 /// return the libxml namespace corresponding to m_pNamespace on pNode
 xmlNsPtr GetNamespace(xmlNodePtr const pNode);
 
-virtual bool IsChildTypeAllowed(css::xml::dom::NodeType const 
nodeType) override;
+virtual bool IsChildTypeAllowed(css::xml::dom::NodeType const nodeType,
+css::xml::dom::NodeType const*) override;
 
 /**
 Returns the name of this attribute.
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx
index 49c524b5ee99..413f764815e5 100644
--- a/unoxml/source/dom/document.cxx
+++ b/unoxml/source/dom/document.cxx
@@ -291,7 +291,7 @@ namespace DOM
 rContext.mxDocHandler->endDocument();
 }
 
-bool CDocument::IsChildTypeAllowed(NodeType const nodeType)
+bool CDocument::IsChildTypeAllowed(NodeType const nodeType, NodeType 
const*const pReplacedNodeType)
 {
 switch (nodeType) {
 case NodeType_PROCESSING_INSTRUCTION_NODE:
@@ -299,10 +299,12 @@ namespace DOM
 return true;
 case NodeType_ELEMENT_NODE:
  // there may be only one!
-return nullptr == lcl_getDocumentRootPtr(m_aDocPtr);
+return (pReplacedNodeType && *pReplacedNodeType == nodeType)
+|| nullptr == lcl_getDocumentRootPtr(m_aDocPtr);
 case NodeType_DOCUMENT_TYPE_NODE:
  // there may be only one!
-return nullptr == lcl_getDocumentType(m_aDocPtr);
+return (pReplacedNodeType && *pReplacedNodeType == nodeType)
+|| nullptr == lcl_getDocumentType(m_aDocPtr);
 default:
 return false;
 }
diff --git a/unoxml/source/dom/document.hxx b/unoxml/source/dom/document.hxx
index 291535ebf8e5..450b9200f86f 100644
--- a/unoxml/source/dom/document.hxx
+++ b/unoxml/source/dom/document.hxx
@@ -114,7 +114,8 @@ n

[Libreoffice-commits] core.git: vcl/unx

2023-01-19 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 6ef1b38885b748d8d48e0628acdf4491f4d8803f
Author: Caolán McNamara 
AuthorDate: Thu Jan 19 16:31:03 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 19 19:39:53 2023 +

Resolves: tdf#153091 support text/plain without encoding from nedit

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

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 90055b3ecc57..4fa9dce0a5b5 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -825,16 +825,12 @@ public:
 
 virtual css::uno::Any SAL_CALL getTransferData(const 
css::datatransfer::DataFlavor& rFlavor) override
 {
+css::uno::Any aRet;
+
 css::datatransfer::DataFlavor aFlavor(rFlavor);
 if (aFlavor.MimeType == "text/plain;charset=utf-16")
 aFlavor.MimeType = "text/plain;charset=utf-8";
 
-auto it = m_aMimeTypeToGtkType.find(aFlavor.MimeType);
-if (it == m_aMimeTypeToGtkType.end())
-return css::uno::Any();
-
-css::uno::Any aRet;
-
 GdkClipboard* clipboard = clipboard_get(m_eSelection);
 
 #if !GTK_CHECK_VERSION(4, 0, 0)
@@ -846,21 +842,25 @@ public:
 aRet <<= aStr.replaceAll("\r\n", "\n");
 return aRet;
 }
-else
+#endif
+
+auto it = m_aMimeTypeToGtkType.find(aFlavor.MimeType);
+if (it == m_aMimeTypeToGtkType.end())
+return css::uno::Any();
+
+#if !GTK_CHECK_VERSION(4, 0, 0)
+GtkSelectionData* data = gtk_clipboard_wait_for_contents(clipboard,
+ it->second);
+if (!data)
 {
-GtkSelectionData* data = gtk_clipboard_wait_for_contents(clipboard,
- 
it->second);
-if (!data)
-{
-return css::uno::Any();
-}
-gint length;
-const guchar *rawdata = 
gtk_selection_data_get_data_with_length(data,
-
&length);
-Sequence aSeq(reinterpret_cast(rawdata), length);
-gtk_selection_data_free(data);
-aRet <<= aSeq;
+return css::uno::Any();
 }
+gint length;
+const guchar *rawdata = gtk_selection_data_get_data_with_length(data,
+
&length);
+Sequence aSeq(reinterpret_cast(rawdata), 
length);
+gtk_selection_data_free(data);
+aRet <<= aSeq;
 #else
 SalInstance* pInstance = GetSalInstance();
 read_transfer_result aRes;


[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - vcl/unx

2023-01-19 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 68b28057a00a152dc23d3363dd413556882e2bfd
Author: Caolán McNamara 
AuthorDate: Thu Jan 19 16:31:03 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 19 19:39:14 2023 +

Resolves: tdf#153091 support text/plain without encoding from nedit

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

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index b697b0b50a3c..8697f7f7eb47 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -824,16 +824,12 @@ public:
 
 virtual css::uno::Any SAL_CALL getTransferData(const 
css::datatransfer::DataFlavor& rFlavor) override
 {
+css::uno::Any aRet;
+
 css::datatransfer::DataFlavor aFlavor(rFlavor);
 if (aFlavor.MimeType == "text/plain;charset=utf-16")
 aFlavor.MimeType = "text/plain;charset=utf-8";
 
-auto it = m_aMimeTypeToGtkType.find(aFlavor.MimeType);
-if (it == m_aMimeTypeToGtkType.end())
-return css::uno::Any();
-
-css::uno::Any aRet;
-
 GdkClipboard* clipboard = clipboard_get(m_eSelection);
 
 #if !GTK_CHECK_VERSION(4, 0, 0)
@@ -845,21 +841,25 @@ public:
 aRet <<= aStr.replaceAll("\r\n", "\n");
 return aRet;
 }
-else
+#endif
+
+auto it = m_aMimeTypeToGtkType.find(aFlavor.MimeType);
+if (it == m_aMimeTypeToGtkType.end())
+return css::uno::Any();
+
+#if !GTK_CHECK_VERSION(4, 0, 0)
+GtkSelectionData* data = gtk_clipboard_wait_for_contents(clipboard,
+ it->second);
+if (!data)
 {
-GtkSelectionData* data = gtk_clipboard_wait_for_contents(clipboard,
- 
it->second);
-if (!data)
-{
-return css::uno::Any();
-}
-gint length;
-const guchar *rawdata = 
gtk_selection_data_get_data_with_length(data,
-
&length);
-Sequence aSeq(reinterpret_cast(rawdata), length);
-gtk_selection_data_free(data);
-aRet <<= aSeq;
+return css::uno::Any();
 }
+gint length;
+const guchar *rawdata = gtk_selection_data_get_data_with_length(data,
+
&length);
+Sequence aSeq(reinterpret_cast(rawdata), 
length);
+gtk_selection_data_free(data);
+aRet <<= aSeq;
 #else
 SalInstance* pInstance = GetSalInstance();
 read_transfer_result aRes;


[Libreoffice-commits] core.git: sw/source

2023-01-19 Thread Michael Stahl (via logerrit)
 sw/source/core/crsr/bookmark.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 959f64dbb85d1785dbea5a4d2a41519c98769a7c
Author: Michael Stahl 
AuthorDate: Thu Jan 19 18:45:39 2023 +0100
Commit: Michael Stahl 
CommitDate: Thu Jan 19 19:06:26 2023 +

sw: crashtesting forum-mso-en-12641.docx, fix assert in FindFieldSep

The fieldmark may overlap a section; at the start was considered here,
but at the end was not and so the assertion wrongly fired.

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

diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx
index feb7e77a3163..2520e6312b79 100644
--- a/sw/source/core/crsr/bookmark.cxx
+++ b/sw/source/core/crsr/bookmark.cxx
@@ -113,7 +113,8 @@ namespace sw::mark
 }
 else
 {
-assert(pNode->IsNoTextNode() || pNode->IsSectionNode());
+assert(pNode->IsNoTextNode() || pNode->IsSectionNode()
+|| (pNode->IsEndNode() && 
pNode->StartOfSectionNode()->IsSectionNode()));
 }
 }
 assert(ret); // must have found it


[Libreoffice-commits] core.git: accessibility/inc

2023-01-19 Thread Stephan Bergmann (via logerrit)
 accessibility/inc/extended/AccessibleGridControlBase.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c83ec45d7d36d8371ec3fab843fdace6b23ac153
Author: Stephan Bergmann 
AuthorDate: Thu Jan 19 14:58:40 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 19 18:40:14 2023 +

Base AccessibleGridControlBase on WeakComponentImplHelper

...rather than on the deprecated WeakAggComponentImplHelper4.

It was found that e.g. GridControlAccessibleElement, deriving from
AccessibleGridControlBase, was implementing queryInterface in a way that is
incompatible with the XAggregation protocol inherited via
WeakAggComponentImplHelper4.  It looks like no code actually made use of the
XAggregation offered by this class hierarchy, so the easiest fix for that
queryInterface implementation appears to switch from
WeakAggComponentImplHelper4 to WeakComponentImplHelper (thereby dropping
XAggregation, and thus rendering the existing queryInterface implementation 
OK).

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

diff --git a/accessibility/inc/extended/AccessibleGridControlBase.hxx 
b/accessibility/inc/extended/AccessibleGridControlBase.hxx
index ca706c977fcd..75bfa96ce87e 100644
--- a/accessibility/inc/extended/AccessibleGridControlBase.hxx
+++ b/accessibility/inc/extended/AccessibleGridControlBase.hxx
@@ -24,7 +24,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -41,7 +41,7 @@ namespace vcl { class Window; }
 
 namespace accessibility {
 
-typedef ::cppu::WeakAggComponentImplHelper4<
+typedef ::cppu::WeakComponentImplHelper<
 css::accessibility::XAccessibleContext,
 css::accessibility::XAccessibleComponent,
 css::accessibility::XAccessibleEventBroadcaster,


Ekta Goel License Statement

2023-01-19 Thread Ekta Goel
All of my past & future contributions to LibreOffice may be
   licensed under the MPLv2/LGPLv3+ dual license.


[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2023-01-19 Thread Noel Grandin (via logerrit)
 sw/inc/unotbl.hxx|   19 +++
 sw/source/core/unocore/unocrsrhelper.cxx |6 ++
 sw/source/core/unocore/unotbl.cxx|   30 +-
 sw/source/core/unocore/unotext.cxx   |   12 
 sw/source/filter/xml/xmltble.cxx |3 +--
 sw/source/filter/xml/xmltbli.cxx |2 +-
 sw/source/ui/vba/vbatablehelper.cxx  |3 +--
 7 files changed, 13 insertions(+), 62 deletions(-)

New commits:
commit 7d2bee35c46018e9699d76f117f9a80f71cb4597
Author: Noel Grandin 
AuthorDate: Wed Jan 18 15:21:27 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 19 17:56:25 2023 +

XUnoTunnel->dynamic_cast in SwXTextTable

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

diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index c9483a020bfc..d7074b5919bf 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -246,7 +246,7 @@ struct SwRangeDescriptor
 void Normalize();
 };
 
-class SAL_DLLPUBLIC_RTTI SwXTextTable final : public cppu::WeakImplHelper
+class SW_DLLPUBLIC SwXTextTable final : public cppu::WeakImplHelper
 <
 css::text::XTextTable,
 css::lang::XServiceInfo,
@@ -256,7 +256,6 @@ class SAL_DLLPUBLIC_RTTI SwXTextTable final : public 
cppu::WeakImplHelper
 css::container::XNamed,
 css::table::XAutoFormattable,
 css::util::XSortable,
-css::lang::XUnoTunnel,
 css::sheet::XCellRangeData
 >
 {
@@ -272,15 +271,9 @@ public:
 static rtl::Reference
 CreateXTextTable(SwFrameFormat * pFrameFormat);
 
-SW_DLLPUBLIC static const css::uno::Sequence< sal_Int8 > & 
getUnoTunnelId();
-
-SW_DLLPUBLIC static void GetCellPosition(std::u16string_view aCellName, 
sal_Int32& o_rColumn, sal_Int32& o_rRow);
-
-SW_DLLPUBLIC SwFrameFormat* GetFrameFormat();
-
-//XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
+static void GetCellPosition(std::u16string_view aCellName, sal_Int32& 
o_rColumn, sal_Int32& o_rRow);
 
+SwFrameFormat* GetFrameFormat();
 
 //XTextTable
 virtual void SAL_CALL initialize( sal_Int32 nRows, sal_Int32 nColumns ) 
override;
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx 
b/sw/source/core/unocore/unocrsrhelper.cxx
index 0c4721c954bd..d41bf32e4ba9 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -202,8 +202,7 @@ void GetSelectableFromAny(uno::Reference 
const& xIfc,
 return;
 }
 
-SwXTextTable *const pTextTable(
-comphelper::getFromUnoTunnel(xTunnel));
+SwXTextTable *const pTextTable = dynamic_cast(xIfc.get());
 if (pTextTable)
 {
 SwFrameFormat *const pFrameFormat(pTextTable->GetFrameFormat());
diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index 18fde41a8e7a..0aaedfa8b8d3 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1947,18 +1947,6 @@ public:
 
 };
 
-const uno::Sequence< sal_Int8 > & SwXTextTable::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theSwXTextTableUnoTunnelId;
-return theSwXTextTableUnoTunnelId.getSeq();
-}
-
-sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 
>& rId )
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
-
 SwXTextTable::SwXTextTable()
 : m_pImpl(new Impl(nullptr))
 {
@@ -2072,7 +2060,7 @@ SwXTextTable::attach(const 
uno::Reference & xTextRange)
 if (!m_pImpl->IsDescriptor())  /* already attached ? */
 throw uno::RuntimeException("SwXTextTable: already attached to 
range.", static_cast(this));
 
-uno::Reference xRangeTunnel(xTextRange, uno::UNO_QUERY);
+uno::Reference xRangeTunnel(xTextRange, uno::UNO_QUERY);
 SwXTextRange* 
pRange(comphelper::getFromUnoTunnel(xRangeTunnel));
 OTextCursorHelper* 
pCursor(dynamic_cast(xTextRange.get()));
 SwDoc* pDoc = pRange ? &pRange->GetDoc() : pCursor ? pCursor->GetDoc() : 
nullptr;
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index 6248e0dfc8e3..52df5295dea7 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -647,8 +647,7 @@ SwXText::insertTextContentBefore(
 uno::UNO_QUERY);
 SwXTextSection *const pXSection =
 comphelper::getFromUnoTunnel(xSuccTunnel);
-SwXTextTable *const pXTable =
-comphelper::getFromUnoTunnel(xSuccTunnel);
+SwXTextTable *const pXTable = 
dynamic_cast(xSuccessor.get());
 SwFrameFormat *const pTableFormat = pXTable ? pXTable->GetFrameFormat() : 
nullptr;
 SwTextNode * pTextNode = nullptr;
 if(pTableFormat && pTableFormat->GetDoc() == GetDoc())
@@ -701,8 +700,7 @@ SwXText::insertTextContentAfter(
 uno::UNO_QUERY);
 SwXTextSect

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2023-01-19 Thread Noel Grandin (via logerrit)
 sw/inc/unosett.hxx   |   10 ++
 sw/inc/unosrch.hxx   |9 +
 sw/source/core/unocore/unocrsrhelper.cxx |2 +-
 sw/source/core/unocore/unosett.cxx   |   16 
 sw/source/core/unocore/unosrch.cxx   |   11 ---
 sw/source/core/unocore/unostyle.cxx  |6 +++---
 sw/source/uibase/uno/unotxdoc.cxx|5 ++---
 sw/source/uibase/utlui/uiitems.cxx   |2 +-
 8 files changed, 10 insertions(+), 51 deletions(-)

New commits:
commit bc87e206f4201cbd3d4df8f14355fb29643768f7
Author: Noel Grandin 
AuthorDate: Wed Jan 18 15:13:06 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 19 17:56:04 2023 +

XUnoTunnel->dynamic_cast in SwXTextSearch

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

diff --git a/sw/inc/unosrch.hxx b/sw/inc/unosrch.hxx
index ac8623160fa0..169903764377 100644
--- a/sw/inc/unosrch.hxx
+++ b/sw/inc/unosrch.hxx
@@ -21,7 +21,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -37,8 +36,7 @@ namespace i18nutil {
 class SwXTextSearch final : public cppu::WeakImplHelper
 <
 css::util::XPropertyReplace,
-css::lang::XServiceInfo,
-css::lang::XUnoTunnel
+css::lang::XServiceInfo
 >
 {
 friend class SwXTextDocument;
@@ -68,11 +66,6 @@ class SwXTextSearch final : public cppu::WeakImplHelper
 public:
 SwXTextSearch();
 
-static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
-
-//XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
-
 //XSearchDescriptor
 virtual OUString SAL_CALL getSearchString(  ) override;
 virtual void SAL_CALL setSearchString( const OUString& aString ) override;
diff --git a/sw/source/core/unocore/unosrch.cxx 
b/sw/source/core/unocore/unosrch.cxx
index ee260c077b61..e7684861b5c9 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -346,17 +346,6 @@ namespace
 {
 }
 
-const uno::Sequence< sal_Int8 > & SwXTextSearch::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theSwXTextSearchUnoTunnelId;
-return theSwXTextSearchUnoTunnelId.getSeq();
-}
-
-sal_Int64 SAL_CALL SwXTextSearch::getSomething( const uno::Sequence< sal_Int8 
>& rId )
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
 OUString SwXTextSearch::getSearchString()
 {
 SolarMutexGuard aGuard;
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 6b5b52d105dd..b19827e1ad74 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -696,9 +696,8 @@ SwUnoCursor* 
SwXTextDocument::CreateCursorForSearch(Reference< XTextCursor > & x
 sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor 
> & xDesc)
 {
 SolarMutexGuard aGuard;
-Reference< XUnoTunnel > xDescTunnel(xDesc, UNO_QUERY_THROW);
 SwXTextSearch* pSearch;
-if (!IsValid() || !(pSearch = 
comphelper::getFromUnoTunnel(xDescTunnel)))
+if (!IsValid() || !(pSearch = dynamic_cast(xDesc.get(
 throw DisposedException("", static_cast< XTextDocument* >(this));
 
 Reference< XTextCursor >  xCursor;
@@ -770,7 +769,7 @@ SwUnoCursor* SwXTextDocument::FindAny(const Reference< 
util::XSearchDescriptor >
  sal_Int32& nResult,
  Reference< XInterface > const & 
xLastResult)
 {
-const auto pSearch = comphelper::getFromUnoTunnel(xDesc);
+const auto pSearch = dynamic_cast(xDesc.get());
 if(!IsValid() || !pSearch)
 return nullptr;
 
commit 9ebf0023e663b18f06631dbd4fd5782a626c2458
Author: Noel Grandin 
AuthorDate: Wed Jan 18 12:45:10 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 19 17:55:53 2023 +

XUnoTunnel->dynamic_cast in SwXNumberingRules

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

diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx
index fcaed54b1bfe..590046b97412 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -26,12 +26,11 @@
 #include "swtypes.hxx"
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
-#include 
+#include 
 #include "unobaseclass.hxx"
 
 class SwDoc;
@@ -132,10 +131,9 @@ public:
 voidInvalidate() {m_pDoc = nullptr;}
 };
 
-class SwXNumberingRules : public cppu::WeakAggImplHelper5
+class SwXNumberingRules : public cppu::WeakAggImplHelper4
 <
 css::container::XIndexReplace,
-css::lang::XUnoTunnel,
 css::beans::XPropertySet,
 css::container::XNamed,
 css::lang::XServiceInfo
@@ -161,10 +159,6 @@ public:
 SwXNumberingRules(const SwNumRule& rRule, SwDoc* doc = nullptr); // 
NumRule

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2023-01-19 Thread Noel Grandin (via logerrit)
 sw/inc/unochart.hxx |   17 ++--
 sw/inc/unoparagraph.hxx |8 -
 sw/source/core/unocore/unochart.cxx |   43 ++--
 sw/source/core/unocore/unodraw.cxx  |2 -
 sw/source/core/unocore/unoobj2.cxx  |2 -
 sw/source/core/unocore/unoparagraph.cxx |   12 
 sw/source/core/unocore/unotext.cxx  |6 +---
 sw/source/uibase/uno/unotxvw.cxx|2 -
 8 files changed, 34 insertions(+), 58 deletions(-)

New commits:
commit 70eb1c9838bf9ab7650318381e7d48f811e761d4
Author: Noel Grandin 
AuthorDate: Wed Jan 18 12:41:50 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 19 17:55:44 2023 +

XUnoTunnel->dynamic_cast in SwXParagraph

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

diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx
index ab1bb903a7cd..860edc18e938 100644
--- a/sw/inc/unoparagraph.hxx
+++ b/sw/inc/unoparagraph.hxx
@@ -22,7 +22,6 @@
 
 #include 
 
-#include 
 #include 
 #include 
 #include 
@@ -49,7 +48,6 @@ class SwXTextPortionEnumeration;
 
 typedef ::cppu::ImplInheritanceHelper
 <   ::sfx2::MetadatableMixin
-,   css::lang::XUnoTunnel
 ,   css::lang::XServiceInfo
 ,   css::beans::XPropertySet
 ,   css::beans::XPropertyState
@@ -99,12 +97,6 @@ public:
 virtual css::uno::Reference< css::frame::XModel >
 GetModel() override;
 
-static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
-
-// XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething(
-const css::uno::Sequence< sal_Int8 >& rIdentifier) override;
-
 // XServiceInfo
 virtual OUString SAL_CALL getImplementationName() override;
 virtual sal_Bool SAL_CALL supportsService(
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index 00685756c39d..a11dff3a87cc 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1995,7 +1995,7 @@ void SwXShape::attach(const uno::Reference< 
text::XTextRange > & xTextRange)
 pDoc = pCursor->GetDoc();
 else if (auto pPortion = 
comphelper::getFromUnoTunnel(xRangeTunnel))
 pDoc = &pPortion->GetCursor().GetDoc();
-else if (auto pParagraph = 
comphelper::getFromUnoTunnel(xRangeTunnel);
+else if (auto pParagraph = dynamic_cast(xTextRange.get());
  pParagraph && pParagraph->GetTextNode())
 pDoc = &pParagraph->GetTextNode()->GetDoc();
 
diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index a40e92a92cec..87abdf72ffd1 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -,7 +,7 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill,
 OTextCursorHelper* pCursor = 
dynamic_cast(xTextRange.get());
 SwXTextPortion* pPortion = 
comphelper::getFromUnoTunnel(xRangeTunnel);
 SwXText* pText = dynamic_cast(xTextRange.get());
-SwXParagraph* pPara = 
comphelper::getFromUnoTunnel(xRangeTunnel);
+SwXParagraph* pPara = dynamic_cast(xTextRange.get());
 SwXHeadFootText* pHeadText
 = eMode == TextRangeMode::AllowTableNode ? 
dynamic_cast(pText) : nullptr;
 
diff --git a/sw/source/core/unocore/unoparagraph.cxx 
b/sw/source/core/unocore/unoparagraph.cxx
index a41f11ef873c..55c71ca730a4 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -295,18 +295,6 @@ bool SwXParagraph::SelectPaM(SwPaM & rPaM)
 return true;
 }
 
-const uno::Sequence< sal_Int8 > & SwXParagraph::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theSwXParagraphUnoTunnelId;
-return theSwXParagraphUnoTunnelId.getSeq();
-}
-
-sal_Int64 SAL_CALL
-SwXParagraph::getSomething(const uno::Sequence< sal_Int8 >& rId)
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
 OUString SAL_CALL
 SwXParagraph::getImplementationName()
 {
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index b38c14c9e5fe..6248e0dfc8e3 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -636,8 +636,7 @@ SwXText::insertTextContentBefore(
 throw aRuntime;
 }
 
-SwXParagraph *const pPara =
-comphelper::getFromUnoTunnel(xNewContent);
+SwXParagraph *const pPara = dynamic_cast(xNewContent.get());
 if (!pPara || !pPara->IsDescriptor() || !xSuccessor.is())
 {
 throw lang::IllegalArgumentException();
@@ -692,8 +691,7 @@ SwXText::insertTextContentAfter(
 throw uno::RuntimeException();
 }
 
-SwXParagraph *const pPara =
-comphelper::getFromUnoTunnel(xNewContent);
+SwXParagraph *const pPara = dynamic_cast(xNewContent.get());
 if(!pPara || !pPara->IsDescriptor() || !xPredecessor.is())
 {
 throw lang::IllegalArgumentException();
diff --git a/sw/

[Libreoffice-commits] core.git: sw/inc sw/source

2023-01-19 Thread Stephan Bergmann (via logerrit)
 sw/inc/unodraw.hxx |5 ++---
 sw/source/core/unocore/unodraw.cxx |8 
 2 files changed, 2 insertions(+), 11 deletions(-)

New commits:
commit b09c70ec15b4f94688a19f72782c3dc627590c8c
Author: Stephan Bergmann 
AuthorDate: Thu Jan 19 09:55:21 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 19 16:57:16 2023 +

Fix SwFmDrawPage queryAggregation

The base SvxDrawPage uses WeakAggImplHelper7, so (for better or worse) 
derives
from XAggregation, but SwFmDrawPage failed to properly implement the
XAggregation protocol.

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

diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index f9d60f447dd2..947d3817cded 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -39,7 +40,7 @@ class SdrView;
 class SwDoc;
 class SwXShape;
 
-typedef cppu::ImplInheritanceHelper
+typedef cppu::AggImplInheritanceHelper1
 <
 SvxFmDrawPage,
 css::container::XEnumerationAccess
@@ -76,8 +77,6 @@ public:
 //XEnumerationAccess
 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL 
createEnumeration() override;
 
-virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType 
) override;
-
 //XIndexAccess
 virtual sal_Int32 SAL_CALL getCount() override;
 virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override;
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index 7541eacd59d4..00685756c39d 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -470,14 +470,6 @@ uno::Sequence< OUString > 
SwFmDrawPage::getSupportedServiceNames()
 return { "com.sun.star.drawing.GenericDrawPage" };
 }
 
-uno::Any SwFmDrawPage::queryInterface( const uno::Type& aType )
-{
-uno::Any aRet = SvxFmDrawPage::queryInterface(aType);
-if(!aRet.hasValue())
-aRet = SwFmDrawPage_Base::queryInterface(aType);
-return aRet;
-}
-
 sal_Int32 SwFmDrawPage::getCount()
 {
 SolarMutexGuard aGuard;


[Libreoffice-commits] core.git: sd/uiconfig

2023-01-19 Thread Szymon Kłos (via logerrit)
 sd/uiconfig/simpress/ui/customanimationspanel.ui |  979 +++
 1 file changed, 482 insertions(+), 497 deletions(-)

New commits:
commit 280e55bf440b32ec87ce79271276c24f55172663
Author: Szymon Kłos 
AuthorDate: Thu Jun 23 16:25:11 2022 +0200
Commit: Szymon Kłos 
CommitDate: Thu Jan 19 16:13:25 2023 +

Remove not necessary container in Animation Panel in Impress Sidebar

It was causing layouting issues in LOK.

Change-Id: Ic7520f46efa764d2d6b50b021b44e0a5dd07d837
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136343
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Rashesh Padia 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145791
Tested-by: Jenkins

diff --git a/sd/uiconfig/simpress/ui/customanimationspanel.ui 
b/sd/uiconfig/simpress/ui/customanimationspanel.ui
index 2d8bd06d6118..8625fbe97cf0 100644
--- a/sd/uiconfig/simpress/ui/customanimationspanel.ui
+++ b/sd/uiconfig/simpress/ui/customanimationspanel.ui
@@ -75,625 +75,610 @@
 6
 vertical
 
-  
+  
 True
 True
-True
-True
-vertical
-True
+never
 
-  
+  
 True
-True
-never
+False
 
-  
+  
 True
 False
+True
+True
 
-  
-True
-False
+  
+True
 True
 True
+in
 
-  
+  
+260
 True
+True
+True
 True
 True
-in
+liststore1
+False
+True
+1
+
+  
+
 
-  
-260
-True
-True
-True
-True
-True
-liststore1
-False
-True
-1
-
-  
-
+  
+6
 
-  
-6
-
-  
-  
-0
-  
-
-
-  
-  
-1
-  
-
-  
+  
+  
+0
+  
 
-
-  
-The 
animation list displays all animations for the current slide.
-  
+
+  
+  
+1
+  
 
   
 
+
+  
+The 
animation list displays all animations for the current slide.
+  
+
   
-  
-True
-True
-0
-  
 
+  
+  
+True
+True
+0
+  
+
+
+  
+True
+True
+True
+True
+in
 
-  
+  
 True
-True
-True
-True
-in
+False
 
-  
+  
+260
 True
 False
-  

[Libreoffice-commits] core.git: basic/source

2023-01-19 Thread Stephan Bergmann (via logerrit)
 basic/source/inc/namecont.hxx |7 +++
 basic/source/uno/namecont.cxx |8 
 2 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit 41f659b49250dd62abc141afaa3c73cc63a425e3
Author: Stephan Bergmann 
AuthorDate: Thu Jan 19 14:47:03 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 19 16:07:12 2023 +

Base SfxLibrary on WeakComponentImplHelper

...rather than on the deprecated OComponentHelper.

The two classes SfxDialogLibrary and SfxScriptLibrary, both deriving from
SfxLibrary, had been found to implement their respective queryInterface in 
a way
that is incompatible with the XAggregation protocol inherited via
OComponentHelper.  It looks like no code actually made use of the 
XAggregation
offered by these Sfx*Library classes, so the easiest fix for those
queryInterface implementations appears to switch from OComponentHelper to
WeakComponentImplHelper (thereby dropping XAggregation, and thus rendering 
the
existing queryInterface implementations OK).

Ideally, SfxLibrary would derive from 
WeakComponentImplHelper covering all 
the
UNO interface classes from which it currently derives manually.  But 
changing
that manual implementation across SfxLibrary and its SfxDialogLibrary and
SfxScriptLibrary derived classes looks tricky, so merely introduce an 
"empty"
WeakComponentImplHelper<> for now and keep all the manual stuff, and leave
proper clean up for later.

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

diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index 5875b6369faf..b5a261c2dde1 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -47,7 +47,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -470,7 +469,7 @@ class SfxLibrary
 , public css::container::XContainer
 , public css::util::XChangesNotifier
 , public ::cppu::BaseMutex
-, public ::cppu::OComponentHelper
+, public ::cppu::WeakComponentImplHelper<>
 {
 friend class SfxLibraryContainer;
 friend class SfxDialogLibraryContainer;
@@ -550,8 +549,8 @@ public:
 
 // Methods XInterface
 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType 
) override;
-virtual void SAL_CALL acquire() noexcept override { 
OComponentHelper::acquire(); }
-virtual void SAL_CALL release() noexcept override { 
OComponentHelper::release(); }
+virtual void SAL_CALL acquire() noexcept override { 
WeakComponentImplHelper::acquire(); }
+virtual void SAL_CALL release() noexcept override { 
WeakComponentImplHelper::release(); }
 
 // Methods XElementAccess
 virtual css::uno::Type SAL_CALL getElementType(  ) override;
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 431f55b2a4d2..24bcddbded53 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -2930,7 +2930,7 @@ sal_Bool SAL_CALL SfxLibraryContainer::supportsService( 
const OUString& _rServic
 // Ctor
 SfxLibrary::SfxLibrary( ModifiableHelper& _rModifiable, const Type& aType,
 const Reference< XSimpleFileAccess3 >& xSFI )
-: OComponentHelper( m_aMutex )
+: WeakComponentImplHelper( m_aMutex )
 , mxSFI( xSFI )
 , mrModifiable( _rModifiable )
 , maNameContainer( new NameContainer(aType) )
@@ -2952,7 +2952,7 @@ SfxLibrary::SfxLibrary( ModifiableHelper& _rModifiable, 
const Type& aType,
 SfxLibrary::SfxLibrary( ModifiableHelper& _rModifiable, const Type& aType,
 const Reference< XSimpleFileAccess3 >& xSFI,
 OUString aLibInfoFileURL, OUString aStorageURL, bool ReadOnly )
-: OComponentHelper( m_aMutex )
+: WeakComponentImplHelper( m_aMutex )
 , mxSFI( xSFI )
 , mrModifiable( _rModifiable )
 , maNameContainer( new NameContainer(aType) )
@@ -3004,7 +3004,7 @@ Any SAL_CALL SfxLibrary::queryInterface( const Type& 
rType )
 static_cast< XChangesNotifier * >( this ) );
 if( !aRet.hasValue() )
 {
-aRet = OComponentHelper::queryInterface( rType );
+aRet = WeakComponentImplHelper::queryInterface( rType );
 }
 return aRet;
 }
@@ -3140,7 +3140,7 @@ Sequence< Type > SfxLibrary::getTypes()
 cppu::UnoType::get(),
 cppu::UnoType::get(),
 cppu::UnoType::get(),
-OComponentHelper::getTypes() );
+WeakComponentImplHelper::getTypes() );
 
 return ourTypes_NameContainer.getTypes();
 }


[Libreoffice-commits] core.git: writerfilter/source

2023-01-19 Thread Andrea Gelmini (via logerrit)
 writerfilter/source/dmapper/StyleSheetTable.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 52b465e271961a65f356c9a5b354acead3c0a849
Author: Andrea Gelmini 
AuthorDate: Thu Jan 19 15:51:02 2023 +0100
Commit: Julien Nabet 
CommitDate: Thu Jan 19 16:05:38 2023 +

Fix typo

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

diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index c0a8e32845c9..f7dfa61e779a 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1420,7 +1420,7 @@ const StyleSheetEntryPtr & 
StyleSheetTable::GetCurrentEntry() const
  Tragically there are references to the localised style name itself in TOC
  fields.
  Hopefully this works and a complete map of >100 built-in style names
- localised to all langauges isn't needed.
+ localised to all languages isn't needed.
 */
 static auto FilterChars(OUString const& rStyleName) -> OUString
 {


[Libreoffice-commits] core.git: sw/qa sw/source

2023-01-19 Thread Miklos Vajna (via logerrit)
 sw/qa/filter/html/html.cxx |   30 ++
 sw/source/filter/html/css1atr.cxx  |   11 +++
 sw/source/filter/html/htmltabw.cxx |   14 --
 3 files changed, 53 insertions(+), 2 deletions(-)

New commits:
commit 6ce374140f3bd1cede959ccc8da69fdacecff191
Author: Miklos Vajna 
AuthorDate: Thu Jan 19 15:46:37 2023 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 19 15:54:08 2023 +

sw XHTML export: use CSS instead of  for tables

 is not valid XHTML, have to use CSS styling instead.

HTML export uses  by default around tables where the alignment
is center.

Fix the problem by avoiding  in the XHTML case and set the left
and right margin to auto, which means:

If the values of margin-left and margin-right are both auto, the
calculated space is evenly distributed.

according to
.

The import will be adjusted to recognize the new markup in a follow-up
change.

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

diff --git a/sw/qa/filter/html/html.cxx b/sw/qa/filter/html/html.cxx
index 537b437c4bdb..65f67b7378d1 100644
--- a/sw/qa/filter/html/html.cxx
+++ b/sw/qa/filter/html/html.cxx
@@ -196,6 +196,36 @@ CPPUNIT_TEST_FIXTURE(Test, testTableRowSpanInAllCells)
 assertXPathNoAttribute(pHtmlDoc, "//tr[1]/td[1]", "rowspan");
 assertXPath(pHtmlDoc, "//tr", 1);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testCenteredTableCSSExport)
+{
+// Given a document with a centered table:
+createSwDoc();
+SwDoc* pDoc = getSwDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+SwInsertTableOptions aTableOptions(SwInsertTableFlags::NONE, 0);
+pWrtShell->InsertTable(aTableOptions, 1, 1);
+pWrtShell->MoveTable(GotoPrevTable, fnTableStart);
+SfxItemSetFixed 
aSet(pWrtShell->GetAttrPool());
+SwFormatHoriOrient aHoriOrientItem(/*nX=*/0, 
text::HoriOrientation::CENTER);
+aSet.Put(aHoriOrientItem);
+pWrtShell->SetTableAttr(aSet);
+
+// When exporting to XHTML:
+setFilterOptions("xhtmlns=reqif-xhtml");
+save("HTML (StarWriter)");
+
+// Then make sure that CSS is used to horizontally position the table:
+SvMemoryStream aStream;
+WrapReqifFromTempFile(aStream);
+xmlDocUniquePtr pXmlDoc = parseXmlStream(&aStream);
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 0
+// - Actual  : 1
+// i.e  was used to position the table, not CSS.
+assertXPath(pXmlDoc, "//reqif-xhtml:center", 0);
+assertXPath(pXmlDoc, "//reqif-xhtml:table", "style", "margin-left: auto; 
margin-right: auto");
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/html/css1atr.cxx 
b/sw/source/filter/html/css1atr.cxx
index 135494df00ca..28c5cc5dea8f 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -2064,6 +2064,17 @@ void SwHTMLWriter::OutCSS1_TableFrameFormatOptions( 
const SwFrameFormat& rFrameF
 if( SfxItemState::SET==rItemSet.GetItemState( RES_LAYOUT_SPLIT, false, 
&pItem ) )
 OutCSS1_SwFormatLayoutSplit( *this, *pItem );
 
+if (mbXHTML)
+{
+sal_Int16 eTabHoriOri = rFrameFormat.GetHoriOrient().GetHoriOrient();
+if (eTabHoriOri == text::HoriOrientation::CENTER)
+{
+// Emit XHTML's center using inline CSS.
+OutCSS1_Property(sCSS1_P_margin_left, "auto", nullptr, 
sw::Css1Background::Table);
+OutCSS1_Property(sCSS1_P_margin_right, "auto", nullptr, 
sw::Css1Background::Table);
+}
+}
+
 if( !m_bFirstCSS1Property )
 Strm().WriteChar( '\"' );
 }
diff --git a/sw/source/filter/html/htmltabw.cxx 
b/sw/source/filter/html/htmltabw.cxx
index ddb8c8eb5f10..a1dee0f75333 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -1113,7 +1113,13 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & 
rNode,
 if( rHTMLWrt.m_bLFPossible )
 rHTMLWrt.OutNewLine();  //  in new line
 if( text::HoriOrientation::CENTER==eDivHoriOri )
-HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), 
Concat2View(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_center) );
+{
+if (!rHTMLWrt.mbXHTML)
+{
+// Not XHTML's css center: start .
+HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), 
Concat2View(rHTMLWrt.GetNamespace() + OOO_STRING_SVTOOLS_HTML_center) );
+}
+}
 else
 {
 OStringLiteral sOut = OOO_STRING_SVTOOLS_HTML_division
@@ -1166,7 +1172,11 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & 
rNode,
 OString aTag = text::HoriOrientation::CENTER == eDivHoriOri
? O

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/qa sw/source

2023-01-19 Thread Miklos Vajna (via logerrit)
 sw/qa/uibase/shells/textfld.cxx |   28 
 sw/source/uibase/shells/textfld.cxx |8 ++--
 2 files changed, 34 insertions(+), 2 deletions(-)

New commits:
commit 22f3aff3a1582f17f314e13f2685fefddccfae4a
Author: Miklos Vajna 
AuthorDate: Thu Jan 19 08:19:46 2023 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 19 15:48:33 2023 +

sw, .uno:InsertField: handle Endnote as a value for the Wrapper parameter

This is similar to commit 43d80906c8693ca27c5b3077fbaa259df4004924 (sw:
.uno:TextFormField: handle Endnote as a value for the Wrapper parameter,
2023-01-17), but that was for fieldmarks & endnotes, this is for
refmarks & endnotes.

(cherry picked from commit 04d988d3c368fe07ae3c44c536a4513e424f104e)

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

diff --git a/sw/qa/uibase/shells/textfld.cxx b/sw/qa/uibase/shells/textfld.cxx
index 7799063a016c..1ef61b658c4a 100644
--- a/sw/qa/uibase/shells/textfld.cxx
+++ b/sw/qa/uibase/shells/textfld.cxx
@@ -57,4 +57,32 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertRefmarkFootnote)
 CPPUNIT_ASSERT_EQUAL(OUString("content"), 
rFormatNote.GetFootnoteText(*pWrtShell->GetLayout()));
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testInsertRefmarkEndnote)
+{
+// Given an empty document:
+SwDoc* pDoc = createSwDoc();
+
+// When inserting a refmark inside an endnote:
+uno::Sequence aArgs = {
+comphelper::makePropertyValue("TypeName", 
uno::Any(OUString("SetRef"))),
+comphelper::makePropertyValue("Name", uno::Any(OUString("myref"))),
+comphelper::makePropertyValue("Content", 
uno::Any(OUString("content"))),
+comphelper::makePropertyValue("Wrapper", 
uno::Any(OUString("Endnote"))),
+};
+dispatchCommand(mxComponent, ".uno:InsertField", aArgs);
+
+// Then make sure that the note body contains the refmark:
+SwFootnoteIdxs& rNotes = pDoc->GetFootnoteIdxs();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// i.e. no endnote was inserted.
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rNotes.size());
+SwTextFootnote* pNote = rNotes[0];
+const SwFormatFootnote& rNote = pNote->GetFootnote();
+CPPUNIT_ASSERT(rNote.IsEndNote());
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+CPPUNIT_ASSERT_EQUAL(OUString("content"), 
rNote.GetFootnoteText(*pWrtShell->GetLayout()));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index a68b17124d2b..a59a5616ffcf 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -292,13 +292,17 @@ void SwTextShell::ExecField(SfxRequest &rReq)
 }
 if (pArgs->GetItemState(FN_PARAM_5, false, &pItem) == 
SfxItemState::SET)
 {
+// Wrap the field in the requested container instead of 
inserting it
+// directly at the cursor position.
 const OUString& rWrapper = static_cast(pItem)->GetValue();
 if (rWrapper == "Footnote")
 {
-// Wrap the field in the requested container instead 
of inserting it
-// directly at the cursor position.
 GetShellPtr()->InsertFootnote(OUString());
 }
+else if (rWrapper == "Endnote")
+{
+GetShellPtr()->InsertFootnote(OUString(), 
/*bEndNote=*/true);
+}
 }
 SwInsertField_Data aData(nType, nSubType, aPar1, aPar2, 
nFormat, GetShellPtr(), cSeparator );
 bRes = aFieldMgr.InsertField( aData );


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sw/source

2023-01-19 Thread Mike Kaganski (via logerrit)
 sw/source/filter/ww8/ww8atr.cxx |   21 -
 1 file changed, 8 insertions(+), 13 deletions(-)

New commits:
commit 9c2adfdfed56b19adf90e7ec3f0b8fbf1c819784
Author: Mike Kaganski 
AuthorDate: Wed Jan 18 16:16:07 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Jan 19 15:48:17 2023 +

Simplify a bit

Change-Id: I3e3d13f468192967056af5c5c21709352a7acf8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145741
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit ce805e052a4d0278190603021103dfe53439b463)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145795
Tested-by: Mike Kaganski 

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index fbdedc3b64c9..2e14a90dbfe7 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3669,10 +3669,9 @@ void AttributeOutputBase::ParaOutlineLevelBase( const 
SfxUInt16Item& rItem )
 
 void AttributeOutputBase::ParaNumRule( const SwNumRuleItem& rNumRule )
 {
-const SwTextNode* pTextNd = nullptr;
 if (rNumRule.GetValue().isEmpty())
 {
-ParaNumRule_Impl(pTextNd, 0, 0);
+ParaNumRule_Impl(nullptr, 0, 0);
 return;
 }
 const SwNumRule* pRule = GetExport().m_rDoc.FindNumRulePtr(
@@ -3683,17 +3682,13 @@ void AttributeOutputBase::ParaNumRule( const 
SwNumRuleItem& rNumRule )
 sal_uInt16 nNumId = GetExport().GetNumberingId(*pRule) + 1;
 sal_uInt8 nLvl = 0;
 
-if (!GetExport().m_pOutFormatNode)
-{
-ParaNumRule_Impl(pTextNd, nLvl, nNumId);
-return;
-}
-
-if (pTextNd = dynamic_cast(GetExport().m_pOutFormatNode); pTextNd)
+const SwTextNode* pTextNd = dynamic_cast(GetExport().m_pOutFormatNode);
+if (pTextNd)
 {
 if( pTextNd->IsCountedInList())
 {
 nLvl = std::clamp(pTextNd->GetActualListLevel(), 0, MAXLEVEL - 1);
+const bool bListRestart = pTextNd->IsListRestart();
 
 if (GetExport().GetExportFormat() == MSWordExportBase::DOCX) // 
FIXME
 {
@@ -3701,7 +3696,7 @@ void AttributeOutputBase::ParaNumRule( const 
SwNumRuleItem& rNumRule )
 OUString const listId(pTextNd->GetListId());
 if (!listId.isEmpty()
 && (listId != pRule->GetDefaultListId() // default list id 
uses the 1:1 mapping
-|| pTextNd->IsListRestart())// or restarting 
previous list
+|| bListRestart)// or restarting previous list
 )
 {
 SwList const*const pList(
@@ -3712,7 +3707,7 @@ void AttributeOutputBase::ParaNumRule( const 
SwNumRuleItem& rNumRule )
 GetExport().m_rDoc.FindNumRulePtr(
 pList->GetDefaultListStyleName()));
 assert(pAbstractRule);
-if (pAbstractRule == pRule && 
!pTextNd->IsListRestart())
+if (pAbstractRule == pRule && !bListRestart)
 {
 // different list, but no override
 nNumId = GetExport().DuplicateAbsNum(listId, 
*pAbstractRule) + 1;
@@ -3722,7 +3717,7 @@ void AttributeOutputBase::ParaNumRule( const 
SwNumRuleItem& rNumRule )
 nNumId = GetExport().OverrideNumRule(
 *pRule, listId, *pAbstractRule) + 1;
 
-if (pTextNd->IsListRestart())
+if (bListRestart)
 {
 // For restarted lists we should also keep 
value for
 // future w:lvlOverride / w:startOverride
@@ -3733,7 +3728,7 @@ void AttributeOutputBase::ParaNumRule( const 
SwNumRuleItem& rNumRule )
 }
 }
 }
-else if (pTextNd->IsListRestart())
+else if (bListRestart)
 {
 sal_uInt16 nStartWith = 
static_cast(pTextNd->GetActualListStartValue());
 nNumId = GetExport().DuplicateNumRule(pRule, nLvl, nStartWith);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/CppunitTest_sw_uibase_shells.mk sw/qa sw/sdi sw/source

2023-01-19 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_uibase_shells.mk  |1 
 sw/qa/uibase/shells/textfld.cxx |   60 
 sw/sdi/swriter.sdi  |2 -
 sw/source/uibase/shells/textfld.cxx |   10 ++
 4 files changed, 72 insertions(+), 1 deletion(-)

New commits:
commit 13594ec9080912f59a0700fed603022138c5f806
Author: Miklos Vajna 
AuthorDate: Wed Jan 18 08:20:24 2023 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 19 15:48:28 2023 +

sw, .uno:InsertField: add a new Wrapper parameter

This is similar to ceea8f3924f26d5f10adc41b9ea587c77c2fda74 (sw:
.uno:TextFormField: add new Wrapper parameter, 2023-01-16), but that was
for fieldmarks & footnotes, while this is for refmarks & footnotes.

Also start a new test file as the one for the entire directory starts to
grow too long.

(cherry picked from commit e9d5ccd5a0822969412dbddf0191e28703e72e82)

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

diff --git a/sw/CppunitTest_sw_uibase_shells.mk 
b/sw/CppunitTest_sw_uibase_shells.mk
index a3d880458663..c4a1cee37a74 100644
--- a/sw/CppunitTest_sw_uibase_shells.mk
+++ b/sw/CppunitTest_sw_uibase_shells.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_CppunitTest_CppunitTest,sw_uibase_shells))
 $(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_uibase_shells))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,sw_uibase_shells, \
+sw/qa/uibase/shells/textfld \
 sw/qa/uibase/shells/shells \
 ))
 
diff --git a/sw/qa/uibase/shells/textfld.cxx b/sw/qa/uibase/shells/textfld.cxx
new file mode 100644
index ..7799063a016c
--- /dev/null
+++ b/sw/qa/uibase/shells/textfld.cxx
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+namespace
+{
+/// Covers sw/source/uibase/shells/textfld.cxx fixes.
+class Test : public SwModelTestBase
+{
+public:
+Test()
+: SwModelTestBase("/sw/qa/uibase/shells/data/")
+{
+}
+};
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testInsertRefmarkFootnote)
+{
+// Given an empty document:
+SwDoc* pDoc = createSwDoc();
+
+// When inserting a refmark inside a footnote:
+uno::Sequence aArgs = {
+comphelper::makePropertyValue("TypeName", 
uno::Any(OUString("SetRef"))),
+comphelper::makePropertyValue("Name", uno::Any(OUString("myref"))),
+comphelper::makePropertyValue("Content", 
uno::Any(OUString("content"))),
+comphelper::makePropertyValue("Wrapper", 
uno::Any(OUString("Footnote"))),
+};
+dispatchCommand(mxComponent, ".uno:InsertField", aArgs);
+
+// Then make sure that the note body contains the refmark:
+SwFootnoteIdxs& rNotes = pDoc->GetFootnoteIdxs();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// i.e. no note was inserted.
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rNotes.size());
+SwTextFootnote* pNote = rNotes[0];
+const SwFormatFootnote& rFormatNote = pNote->GetFootnote();
+CPPUNIT_ASSERT(!rFormatNote.IsEndNote());
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+CPPUNIT_ASSERT_EQUAL(OUString("content"), 
rFormatNote.GetFootnoteText(*pWrtShell->GetLayout()));
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 64da3512ef94..ea549387516c 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -2911,7 +2911,7 @@ SfxVoidItem InsertEnvelope FN_ENVELOP
 ]
 
 SfxVoidItem InsertField FN_INSERT_FIELD
-(SfxUInt16Item Type FN_PARAM_FIELD_TYPE,SfxUInt16Item SubType 
FN_PARAM_FIELD_SUBTYPE,SfxStringItem Name FN_INSERT_FIELD,SfxStringItem Content 
FN_PARAM_FIELD_CONTENT,SfxUInt32Item Format FN_PARAM_FIELD_FORMAT,SfxStringItem 
Separator FN_PARAM_3, SfxStringItem TypeName FN_PARAM_4)
+(SfxUInt16Item Type FN_PARAM_FIELD_TYPE,SfxUInt16Item SubType 
FN_PARAM_FIELD_SUBTYPE,SfxStringItem Name FN_INSERT_FIELD,SfxStringItem Content 
FN_PARAM_FIELD_CONTENT,SfxUInt32Item Format FN_PARAM_FIELD_FORMAT,SfxStringItem 
Separator FN_PARAM_3, SfxStringItem TypeName FN_PARAM_4, SfxStringItem Wrapper 
FN_PARAM_5)
 [
 AutoUpdate = FALSE,
 FastCall = FALSE,
diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index bce713647c62..a68b17124d2b 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -290,6 +290,16 @@ void SwTextShell::ExecField(SfxRequest &rReq)
 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - sw/source

2023-01-19 Thread Mike Kaganski (via logerrit)
 sw/source/filter/ww8/ww8atr.cxx |   16 +++-
 1 file changed, 3 insertions(+), 13 deletions(-)

New commits:
commit dfe14b390f5e2f533fb8578164e8cb8f48943525
Author: Mike Kaganski 
AuthorDate: Wed Jan 18 08:05:49 2023 +
Commit: Mike Kaganski 
CommitDate: Thu Jan 19 15:48:02 2023 +

Use std::clamp

Change-Id: I754ec67601b45542553e1070c0eb5489ed23a722
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145714
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit eb760387efbc804c8a8b0c1cc630d6dba2699284)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145794
Tested-by: Mike Kaganski 

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index b8dedd686840..fbdedc3b64c9 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3693,15 +3693,7 @@ void AttributeOutputBase::ParaNumRule( const 
SwNumRuleItem& rNumRule )
 {
 if( pTextNd->IsCountedInList())
 {
-int nLevel = pTextNd->GetActualListLevel();
-
-if (nLevel < 0)
-nLevel = 0;
-
-if (nLevel >= MAXLEVEL)
-nLevel = MAXLEVEL - 1;
-
-nLvl = static_cast< sal_uInt8 >(nLevel);
+nLvl = std::clamp(pTextNd->GetActualListLevel(), 0, MAXLEVEL - 1);
 
 if (GetExport().GetExportFormat() == MSWordExportBase::DOCX) // 
FIXME
 {
commit 4a01ca082024c0752e6cb4f0ba985b980fb6c861
Author: Mike Kaganski 
AuthorDate: Wed Jan 18 06:30:56 2023 +
Commit: Mike Kaganski 
CommitDate: Thu Jan 19 15:47:55 2023 +

Use dynamic_cast result instead of following static_cast

And make the dynamic_cast more specific, matching the now-removed
unconditional static_cast.

Change-Id: I322312eb8675b28af79b7cca552d6347f74c5faa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145593
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 
(cherry picked from commit 81d333990474615ba1474e4e4229588b3869424f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145733

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index d0bed9c5c5bf..b8dedd686840 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3689,10 +3689,8 @@ void AttributeOutputBase::ParaNumRule( const 
SwNumRuleItem& rNumRule )
 return;
 }
 
-if ( dynamic_cast< const SwContentNode *>( GetExport().m_pOutFormatNode ) 
!= nullptr  )
+if (pTextNd = dynamic_cast(GetExport().m_pOutFormatNode); pTextNd)
 {
-pTextNd = static_cast(GetExport().m_pOutFormatNode);
-
 if( pTextNd->IsCountedInList())
 {
 int nLevel = pTextNd->GetActualListLevel();
@@ -3761,7 +3759,7 @@ void AttributeOutputBase::ParaNumRule( const 
SwNumRuleItem& rNumRule )
 }
 else if ( auto pC = dynamic_cast< const SwTextFormatColl *>( 
GetExport().m_pOutFormatNode ) )
 {
-if ( pC && pC->IsAssignedToListLevelOfOutlineStyle() )
+if (pC->IsAssignedToListLevelOfOutlineStyle())
 nLvl = static_cast< sal_uInt8 >( 
pC->GetAssignedOutlineStyleLevel() );
 else
 {


ESC meeting minutes: 2023-01-19

2023-01-19 Thread Miklos Vajna

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

* Completed Action Items:
+ send the welcome mail to Patrick (Xisco)
+ set the commit bit (Cloph)

* Pending Action Items:

* Release Engineering update (Cloph)
+ 7.5.0 status: rc3 in 1 week
+ 7.4.4 + hotfix is planned with just one RC: in 1 week

- https://bugs.documentfoundation.org/show_bug.cgi?id=153059

- thanks Caolan for fixing

- version will be 7.4.5 to avoid confusion, but only changes are the 
bugfix and translation updates


* Documentation (Olivier)
+ New Help (no news)
+ Helpcontents 2
   + Updates (ohallot)
+ Guides
   + work in progress for 7.5
+ Bugzilla Documentation statistics
252(252) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 12(-5)   36(2)  95(1)  306(-6)
 commented 16(-1)   57(-13)   298(7) 1099(-45)
  resolved  5(0)14(0)  46(0)  187(-6)
+ top 10 contributors:
  Stéphane Guillou made 48 changes in 1 month, and 100 changes in 1 year
  Ilmari Lauhakangas made 29 changes in 1 month, and 101 changes in 1 
year
  Olivier Hallot made 29 changes in 1 month, and 433 changes in 1 year
  Seth Chaiklin made 9 changes in 1 month, and 333 changes in 1 year
  Bogdan B made 7 changes in 1 month, and 178 changes in 1 year
  Rafael Lima made 7 changes in 1 month, and 135 changes in 1 year
  Vernon, Stuart Foote made 7 changes in 1 month, and 23 changes in 1 
year
  Kaganski, Mike made 6 changes in 1 month, and 116 changes in 1 year
  Roman Kuznetsov made 5 changes in 1 month, and 55 changes in 1 year
  Faure, Jean-Baptiste made 4 changes in 1 month, and 4 changes in 1 
year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
278(278) (topicUI) bugs open, 66(66) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
 added  8(2) 11(-7)21(-10) 56(-9)
 commented 87(20)   216(-1)   527(0) 2189(10)
   removed  0(-3) 0(-5) 8(-5)  34(-6)
  resolved 11(1) 29(3) 76(8)  300(5)
+ top 10 contributors:
  Heiko Tietze made 119 changes in 1 month, and 1480 changes in 1 year
  Stéphane Guillou made 53 changes in 1 month, and 111 changes in 1 year
  Dieter made 42 changes in 1 month, and 224 changes in 1 year
  Vernon, Stuart Foote made 37 changes in 1 month, and 150 changes in 1 
year
  Eyal Rozenberg made 35 changes in 1 month, and 233 changes in 1 year
  Kaganski, Mike made 35 changes in 1 month, and 139 changes in 1 year
  Ilmari Lauhakangas made 31 changes in 1 month, and 186 changes in 1 
year
  maicol figueroa made 22 changes in 1 month, and 31 changes in 1 year
  David Melik made 16 changes in 1 month, and 16 changes in 1 year
  Rafael Lima made 16 changes in 1 month, and 222 changes in 1 year
 -> + [Bug 153089] Allow separator (for Numbering by Chapter) to be greater than
   one character in the Edit Fields dialog
+ [Bug 153084] Disable gutter position when page layout is set to "mirrored"
+ [Bug 153079] [Feature request] -Update Index- to add MS Office option
+ [Bug 149362] Indicate slide direction when it is out-of-view
+ [Bug 149358] Autotext should be available in Impress
 -> + [Bug 153065] Tool names are different between the toolbar and Visible
   Buttons list
+ [Bug 149376] Allow overlap option for Frame and Graphics styles should be
   disabled by default
+ [Bug 153051] Improvement of Calc's csv import dialog.
+ [Bug 149163] Track changes in a spreadsheet shows the most recent change
   in a transaction instead of the change from the start of that 
transaction.
+ [Bug 153024] LibreOffice - Calc - New sheet as "Text Document"

* Crash Testing (Caolan)
+ 104(+3) import failure, 4(+0) export failures
  - summary of related backtraces available
- seeing a few fixes from Michael S already, thanks
- Calc issues are still outstanding
+ 3 coverity issues
+ 5 ossfuzz issues, no crashes
https://bugs.documentfoundation.org/show_bug.cgi?id=151930 leak fixed by 
someone

* Crash Reporting (Xisco)
   + https://crashreport.libreoffice.org/stats/version/7.3.7.2
 + (+53) 893 840 606 533 431 460 855 217 0
   + https://crashreport.libreoffice.org/stats/version/7.4.2.3
 + (+110) 884 774 1365 1537 1746 2048 1986 1732 1632 1253 650 0
   + https://crashreport.libreoffice.org/stats/version/7.4.3.2
 + (-327) 1463 1790 1246 910 712 0
   + https://crashreport.libreoffice.org/stats/version/7.4.4.2
 + (+832) 832 0

   

[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sc/source

2023-01-19 Thread Miklos Vajna (via logerrit)
 sc/source/ui/view/viewdata.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9cab31e8c3a497685a2695a774e06b2277623f91
Author: Miklos Vajna 
AuthorDate: Fri Jan 13 08:56:29 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Jan 19 15:18:18 2023 +

sc: fix crash in ScViewData::GetCurXForTab()

Crashreport signature:

program/libsclo.so
ScViewData::GetCurXForTab(short) const
sc/source/ui/view/viewdata.cxx:1431
program/libsclo.so
ScViewFunc::OnLOKInsertDeleteColumn(short, long)
sc/source/ui/view/viewfunc.cxx:1552
program/libsclo.so
ScDocFunc::InsertCells(ScRange const&, ScMarkData const*, 
InsCellCmd, bool, bool, bool)
source/ui/docshell/docfunc.cxx:2256
program/libsclo.so
ScViewFunc::InsertCells(InsCellCmd, bool, bool)
sc/source/ui/view/viewfunc.cxx:1658

Seeing that e.g. ScViewData::WriteUserDataSequence() already checks if
the pointer in maTabData is a nullptr, do the same here.

Change-Id: I0ebdba8c8a5bedd3c3c57c36bdf0632e2fee45c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145697
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit 1f8c02353d653a6d4a72d918aaf6be5f367137c9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145730
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 0ef96d96c7ae..ae68a5dfc725 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1429,7 +1429,7 @@ SCROW ScViewData::GetPosY( ScVSplitPos eWhich, SCTAB 
nForTab ) const
 
 SCCOL ScViewData::GetCurXForTab( SCTAB nTabIndex ) const
 {
-if (!ValidTab(nTabIndex) || (nTabIndex >= 
static_cast(maTabData.size(
+if (!ValidTab(nTabIndex) || (nTabIndex >= 
static_cast(maTabData.size())) || !maTabData[nTabIndex])
 return -1;
 
 return maTabData[nTabIndex]->nCurX;


[Libreoffice-commits] core.git: ucb/source

2023-01-19 Thread Michael Stahl (via logerrit)
 ucb/source/ucp/webdav-curl/CurlSession.cxx |   12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 261b1237532f431963358a7b4ac5fd1ad6e5d223
Author: Michael Stahl 
AuthorDate: Thu Jan 19 12:28:57 2023 +0100
Commit: Michael Stahl 
CommitDate: Thu Jan 19 15:05:57 2023 +

tdf#153039 ucb: webdav-curl: fix POST, which was actually doing PUT

The problem is that first CURLOPT_POST was set and later CURLOPT_UPLOAD,
which overrides the HTTP method to PUT.  Move this out to the 4
functions that need it.

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

diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index 7353c8c9fa7e..1632881cb824 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -875,9 +875,6 @@ auto CurlProcessor::ProcessRequestImpl(
 oUploadSource.emplace(*pInData);
 rc = curl_easy_setopt(rSession.m_pCurl.get(), CURLOPT_READDATA, 
&*oUploadSource);
 assert(rc == CURLE_OK);
-// libcurl won't upload without setting this
-rc = curl_easy_setopt(rSession.m_pCurl.get(), CURLOPT_UPLOAD, 1L);
-assert(rc == CURLE_OK);
 }
 rSession.m_ErrorBuffer[0] = '\0';
 
@@ -1638,6 +1635,7 @@ auto CurlProcessor::PropFind(
 curl_off_t const len(xSeqOutStream->getWrittenBytes().getLength());
 
 ::std::vector const options{
+{ CURLOPT_UPLOAD, 1L, nullptr },
 { CURLOPT_CUSTOMREQUEST, "PROPFIND", "CURLOPT_CUSTOMREQUEST" },
 // note: Sharepoint cannot handle "Transfer-Encoding: chunked"
 { CURLOPT_INFILESIZE_LARGE, len, nullptr, CurlOption::Type::CurlOffT }
@@ -1792,6 +1790,7 @@ auto CurlSession::PROPPATCH(OUString const& rURIReference,
 curl_off_t const len(xSeqOutStream->getWrittenBytes().getLength());
 
 ::std::vector const options{
+{ CURLOPT_UPLOAD, 1L, nullptr },
 { CURLOPT_CUSTOMREQUEST, "PROPPATCH", "CURLOPT_CUSTOMREQUEST" },
 // note: Sharepoint cannot handle "Transfer-Encoding: chunked"
 { CURLOPT_INFILESIZE_LARGE, len, nullptr, CurlOption::Type::CurlOffT }
@@ -1945,8 +1944,10 @@ auto CurlSession::PUT(OUString const& rURIReference,
 // lock m_Mutex after accessing global LockStore to avoid deadlock
 
 // note: Nextcloud 20 cannot handle "Transfer-Encoding: chunked"
-::std::vector const options{ { CURLOPT_INFILESIZE_LARGE, len, 
nullptr,
-   CurlOption::Type::CurlOffT } };
+::std::vector const options{
+{ CURLOPT_UPLOAD, 1L, nullptr }, // libcurl won't upload without 
setting this
+{ CURLOPT_INFILESIZE_LARGE, len, nullptr, CurlOption::Type::CurlOffT }
+};
 
 CurlProcessor::ProcessRequest(*this, uri, "PUT", options, &rEnv, 
::std::move(pList), nullptr,
   &rxInStream, nullptr);
@@ -2127,6 +2128,7 @@ auto CurlProcessor::Lock(
 }
 
 ::std::vector const options{
+{ CURLOPT_UPLOAD, 1L, nullptr },
 { CURLOPT_CUSTOMREQUEST, "LOCK", "CURLOPT_CUSTOMREQUEST" },
 // note: Sharepoint cannot handle "Transfer-Encoding: chunked"
 { CURLOPT_INFILESIZE_LARGE, len, nullptr, CurlOption::Type::CurlOffT }


[Libreoffice-commits] core.git: comphelper/source

2023-01-19 Thread Stephan Bergmann (via logerrit)
 comphelper/source/property/opropertybag.hxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 925dfcb507c4054e00e5aa9acdbfa095b6a32d05
Author: Stephan Bergmann 
AuthorDate: Thu Jan 19 14:10:22 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 19 15:00:56 2023 +

Base OPropertyBag on WeakImplHelper

...rather than on the deprecated WeakAggImplHellper5

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

diff --git a/comphelper/source/property/opropertybag.hxx 
b/comphelper/source/property/opropertybag.hxx
index 28333901c2e3..66c38d870c10 100644
--- a/comphelper/source/property/opropertybag.hxx
+++ b/comphelper/source/property/opropertybag.hxx
@@ -25,7 +25,7 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -55,12 +55,12 @@ namespace comphelper
 typedef std::map< sal_Int32, css::uno::Any > MapInt2Any;
 typedef std::set< css::uno::Type, UnoTypeLess >  TypeBag;
 
-typedef ::cppu::WeakAggImplHelper5  <   css::beans::XPropertyBag
-,   css::util::XModifiable
-,   css::lang::XServiceInfo
-,   css::lang::XInitialization
-,   css::container::XSet
->   OPropertyBag_Base;
+typedef ::cppu::WeakImplHelper  <   css::beans::XPropertyBag
+,   css::util::XModifiable
+,   css::lang::XServiceInfo
+,   css::lang::XInitialization
+,   css::container::XSet
+>   OPropertyBag_Base;
 typedef ::comphelper::OPropertyStateHelper  OPropertyBag_PBase;
 
 class OPropertyBag final : public ::comphelper::OMutexAndBroadcastHelper  
// must be before OPropertyBag_PBase


[Libreoffice-commits] core.git: stoc/source

2023-01-19 Thread Stephan Bergmann (via logerrit)
 stoc/source/corereflection/base.hxx  |   23 +
 stoc/source/corereflection/crefl.cxx |   47 +--
 2 files changed, 9 insertions(+), 61 deletions(-)

New commits:
commit 1786cd0687c5223821e673fe4d2f7b2ff65deb00
Author: Stephan Bergmann 
AuthorDate: Thu Jan 19 14:05:58 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 19 15:00:41 2023 +

Base IdlReflectionServiceImpl on WeakComponentImplHelper

...rather than on the deprecated OComponentHelper

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

diff --git a/stoc/source/corereflection/base.hxx 
b/stoc/source/corereflection/base.hxx
index 05975d3d24b7..03d844de3cc9 100644
--- a/stoc/source/corereflection/base.hxx
+++ b/stoc/source/corereflection/base.hxx
@@ -28,7 +28,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -74,10 +74,10 @@ typedef std::unordered_map< OUString, 
css::uno::WeakReference< css::reflection::
 
 
 class IdlReflectionServiceImpl
-: public ::cppu::OComponentHelper
-, public css::reflection::XIdlReflection
-, public css::container::XHierarchicalNameAccess
-, public css::lang::XServiceInfo
+: public ::cppu::WeakComponentImplHelper<
+  css::reflection::XIdlReflection,
+  css::container::XHierarchicalNameAccess,
+  css::lang::XServiceInfo>
 {
 ::osl::Mutex_aComponentMutex;
 css::uno::Reference< css::container::XHierarchicalNameAccess >_xTDMgr;
@@ -102,23 +102,14 @@ public:
 explicit IdlReflectionServiceImpl( const css::uno::Reference< 
css::uno::XComponentContext > & xContext );
 virtual ~IdlReflectionServiceImpl() override;
 
-// XInterface
-virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & 
rType ) override;
-virtual void SAL_CALL acquire() noexcept override;
-virtual void SAL_CALL release() noexcept override;
-
-// some XComponent part from OComponentHelper
-virtual void SAL_CALL dispose() override;
+// WeakComponentImplHelper
+virtual void SAL_CALL disposing() override;
 
 // XServiceInfo
 virtual OUString SAL_CALL getImplementationName() override;
 virtual sal_Bool SAL_CALL supportsService( const OUString & rServiceName ) 
override;
 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() 
override;
 
-// XTypeProvider
-virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
-virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() 
override;
-
 // XIdlReflection
 virtual css::uno::Reference< css::reflection::XIdlClass > SAL_CALL 
forName( const OUString & rTypeName ) override;
 virtual css::uno::Reference< css::reflection::XIdlClass > SAL_CALL 
getType( const css::uno::Any & rObj ) override;
diff --git a/stoc/source/corereflection/crefl.cxx 
b/stoc/source/corereflection/crefl.cxx
index af1854e7e3b4..4f396065b478 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -45,7 +45,7 @@ namespace stoc_corefl
 
 IdlReflectionServiceImpl::IdlReflectionServiceImpl(
 const Reference< XComponentContext > & xContext )
-: OComponentHelper( _aComponentMutex )
+: WeakComponentImplHelper( _aComponentMutex )
 {
 xContext->getValueByName(
 "/singletons/com.sun.star.reflection.theTypeDescriptionManager" ) >>= 
_xTDMgr;
@@ -54,53 +54,10 @@ IdlReflectionServiceImpl::IdlReflectionServiceImpl(
 
 IdlReflectionServiceImpl::~IdlReflectionServiceImpl() {}
 
-// XInterface
-
-Any IdlReflectionServiceImpl::queryInterface( const Type & rType )
-{
-Any aRet( ::cppu::queryInterface(
-rType,
-static_cast< XIdlReflection * >( this ),
-static_cast< XHierarchicalNameAccess * >( this ),
-static_cast< XServiceInfo * >( this ) ) );
-
-return (aRet.hasValue() ? aRet : OComponentHelper::queryInterface( rType 
));
-}
-
-void IdlReflectionServiceImpl::acquire() noexcept
-{
-OComponentHelper::acquire();
-}
-
-void IdlReflectionServiceImpl::release() noexcept
-{
-OComponentHelper::release();
-}
-
-// XTypeProvider
-
-Sequence< Type > IdlReflectionServiceImpl::getTypes()
-{
-static OTypeCollection s_aTypes(
-cppu::UnoType::get(),
-cppu::UnoType::get(),
-cppu::UnoType::get(),
-OComponentHelper::getTypes() );
-
-return s_aTypes.getTypes();
-}
-
-Sequence< sal_Int8 > IdlReflectionServiceImpl::getImplementationId()
-{
-return css::uno::Sequence();
-}
-
 // XComponent
 
-void IdlReflectionServiceImpl::dispose()
+void IdlReflectionServiceImpl::disposing()
 {
-OComponentHelper::dispose();
-
 MutexGuard aGuard( _aComponentMutex );
 _aElements.clear();
 #ifdef TEST_LIST_CLASSES


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/source

2023-01-19 Thread Pranam Lashkari (via logerrit)
 sw/source/core/crsr/bookmark.cxx |   20 
 sw/source/core/inc/bookmark.hxx  |1 +
 2 files changed, 21 insertions(+)

New commits:
commit 3a6b7e2c07566f22f33189ad4e8393767df5b9f8
Author: Pranam Lashkari 
AuthorDate: Thu Jan 19 00:14:50 2023 +0530
Commit: Miklos Vajna 
CommitDate: Thu Jan 19 14:44:53 2023 +

sw: send LOK call back on fieldmark deletion

this helps with zotero when user deletes a fieldmark or use undo
without this online will be unaware of any such changes made by user

Signed-off-by: Pranam Lashkari 
Change-Id: I93cf102c20b3861140508aee5d81e65f5b9207ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145753
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx
index 95de1b15a0df..23e7ed6f85fe 100644
--- a/sw/source/core/crsr/bookmark.cxx
+++ b/sw/source/core/crsr/bookmark.cxx
@@ -47,6 +47,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::sw::mark;
 using namespace ::com::sun::star;
@@ -565,6 +566,25 @@ namespace sw::mark
 m_aName = rName;
 }
 
+TextFieldmark::~TextFieldmark()
+{
+SfxViewShell* pViewShell = SfxViewShell::Current();
+if (!pViewShell)
+return;
+
+OUString fieldCommand;
+(*GetParameters())[OUString(ODF_CODE_PARAM)] >>= fieldCommand;
+tools::JsonWriter aJson;
+aJson.put("commandName", ".uno:DeleteTextFormField");
+aJson.put("success", true);
+{
+auto result = aJson.startNode("result");
+aJson.put("DeleteTextFormField", fieldCommand);
+}
+
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_UNO_COMMAND_RESULT, 
aJson.extractData());
+}
+
 void TextFieldmark::InitDoc(SwDoc& io_rDoc,
 sw::mark::InsertMode const eMode, SwPosition const*const pSepPos)
 {
diff --git a/sw/source/core/inc/bookmark.hxx b/sw/source/core/inc/bookmark.hxx
index 8769dfffb1ee..5d44c3454882 100644
--- a/sw/source/core/inc/bookmark.hxx
+++ b/sw/source/core/inc/bookmark.hxx
@@ -239,6 +239,7 @@ namespace sw::mark {
 {
 public:
 TextFieldmark(const SwPaM& rPaM, const OUString& rName);
+~TextFieldmark();
 void InitDoc(SwDoc& io_rDoc, sw::mark::InsertMode eMode, 
SwPosition const* pSepPos) override;
 void ReleaseDoc(SwDoc& rDoc) override;
 


[Libreoffice-commits] core.git: sc/qa

2023-01-19 Thread Xisco Fauli (via logerrit)
 sc/qa/uitest/calc_tests4/trackedChanges.py |   76 +
 1 file changed, 76 insertions(+)

New commits:
commit 8e4740e7a93a03ca0faab40b163a1ec7da806a72
Author: Xisco Fauli 
AuthorDate: Thu Jan 19 11:15:48 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Jan 19 14:42:57 2023 +

tdf#153096: sc: Add UItest

Also add a test for checking the right behaviour when
changing the content of a cell

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

diff --git a/sc/qa/uitest/calc_tests4/trackedChanges.py 
b/sc/qa/uitest/calc_tests4/trackedChanges.py
index de42128acaaf..53306de0c88b 100644
--- a/sc/qa/uitest/calc_tests4/trackedChanges.py
+++ b/sc/qa/uitest/calc_tests4/trackedChanges.py
@@ -54,6 +54,82 @@ class CalcTrackedChanges(UITestCase):
 xpass = xDialog.getChild("pass1ed")
 xpass.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
 
+def test_ContentChange(self):
+
+with self.ui_test.create_doc_in_start_center("calc") as document:
+self.ui_test.wait_until_child_is_available("grid_window")
+xCalcDoc = self.xUITest.getTopFocusWindow()
+gridwin = xCalcDoc.getChild("grid_window")
+#track changes;  enter text to cell
+self.xUITest.executeCommand(".uno:TraceChangeMode")
+enter_text_to_cell(gridwin, "A1", "Hello")
+enter_text_to_cell(gridwin, "A1", "There")
+
+with 
self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges", 
close_button="close") as xTrackDlg:
+
+xChangesList = xTrackDlg.getChild("calcchanges")
+self.assertEqual(1, len(xChangesList.getChildren()))
+
+textStart = "Changed contents\tSheet1.A1\t \t" + 
datetime.datetime.now().strftime("%m/%d/%Y")
+
+xChild = xChangesList.getChild('0')
+
self.assertTrue(get_state_as_dict(xChild)["Text"].startswith(textStart))
+
+xChild.executeAction("EXPAND", tuple())
+
+self.assertEqual(3, len(xChild.getChildren()))
+textStartChild1 = "\tSheet1.A1\t \t" + 
datetime.datetime.now().strftime("%m/%d/%Y")
+textEndChild1 = "(Original: )"
+textStartChild2 = "'Hello'\tSheet1.A1\t \t" + 
datetime.datetime.now().strftime("%m/%d/%Y")
+textEndChild2 = "(Changed to 'Hello')"
+textStartChild3 = "'There'\tSheet1.A1\t \t" + 
datetime.datetime.now().strftime("%m/%d/%Y")
+textEndChild3 = "(Changed to 'There')"
+
+
self.assertTrue(get_state_as_dict(xChild.getChild('0'))["Text"].startswith(textStartChild1))
+
self.assertTrue(get_state_as_dict(xChild.getChild('0'))["Text"].endswith(textEndChild1))
+
self.assertTrue(get_state_as_dict(xChild.getChild('1'))["Text"].startswith(textStartChild2))
+
self.assertTrue(get_state_as_dict(xChild.getChild('1'))["Text"].endswith(textEndChild2))
+
self.assertTrue(get_state_as_dict(xChild.getChild('2'))["Text"].startswith(textStartChild3))
+
self.assertTrue(get_state_as_dict(xChild.getChild('2'))["Text"].endswith(textEndChild3))
+
+self.assertEqual("There", get_cell_by_position(document, 0, 0, 
0).getString())
+
+def test_Tdf153096(self):
+
+with self.ui_test.create_doc_in_start_center("calc") as document:
+self.ui_test.wait_until_child_is_available("grid_window")
+xCalcDoc = self.xUITest.getTopFocusWindow()
+gridwin = xCalcDoc.getChild("grid_window")
+#track changes;  enter text to cell
+self.xUITest.executeCommand(".uno:TraceChangeMode")
+enter_text_to_cell(gridwin, "A1", "Hello")
+
+gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+
+self.xUITest.executeCommand(".uno:DeleteRows")
+
+with 
self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges", 
close_button="close") as xTrackDlg:
+
+xChangesList = xTrackDlg.getChild("calcchanges")
+self.assertEqual(1, len(xChangesList.getChildren()))
+
+textStart = "Row deleted\t(Sheet1.1:1)\t \t" + 
datetime.datetime.now().strftime("%m/%d/%Y")
+textEnd = "(Row 1:1 deleted)"
+
+xChild = xChangesList.getChild('0')
+
+# Without the fix in place, this test would have failed here
+
self.assertTrue(get_state_as_dict(xChild)["Text"].startswith(textStart))
+
self.assertTrue(get_state_as_dict(xChild)["Text"].endswith(textEnd))
+
+xChild.executeAction("EXPAND", tuple())
+
+self.assertEqual(1, len(xChild.getChildren()))
+textStartChild1 = "Changed contents\t(Sheet1.A

[Libreoffice-commits] core.git: sw/qa sw/source

2023-01-19 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf153104.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport18.cxx   |   22 ++
 sw/source/filter/ww8/docxattributeoutput.cxx |8 ++--
 3 files changed, 28 insertions(+), 2 deletions(-)

New commits:
commit a93cb8acdb1b5986c9fdb11f4d33c92925bd
Author: Mike Kaganski 
AuthorDate: Thu Jan 19 12:16:06 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Jan 19 14:36:10 2023 +

tdf#153104: fix the "dummy" levels when overriding lower numbering levels

The problem was that Word treats empty w:num/w:lvlOverride elements
for higher levels as defining corresponding w:startOverride equal
to 0. This only shows when the first list element has a lower level
and resets numbering; in this case, implicit higher levels get zero
value, and the following higher level items start from 1.

This writes the correct w:startOverride values (from the respective
rule) to the gap-filling levels.

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

diff --git a/sw/qa/extras/ooxmlexport/data/tdf153104.docx 
b/sw/qa/extras/ooxmlexport/data/tdf153104.docx
new file mode 100644
index ..d70b09852a83
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf153104.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index 7b7213e0f019..5328c19081fb 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -272,6 +272,28 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf152425)
 CPPUNIT_ASSERT_EQUAL(OUString("List 5"), Para5Style);
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf153104)
+{
+loadAndReload("tdf153104.docx");
+
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+OUString numId = getXPath(pXmlDoc, 
"/w:document/w:body/w:p[1]/w:pPr/w:numPr/w:numId", "val");
+
+xmlDocUniquePtr pXmlNum = parseExport("word/numbering.xml");
+OString numPath = "/w:numbering/w:num[@w:numId='"
+  + OUStringToOString(numId, RTL_TEXTENCODING_ASCII_US) + 
"']/";
+
+// Check that first level's w:lvlOverride/w:startOverride is written 
correctly:
+// the list defines starting value of 10, which must be kept upon second 
level
+// numbering reset.
+// Without the fix, this would fail with
+// - Expected: 1
+// - Actual  : 0
+// - In <>, XPath 
'/w:numbering/w:num[@w:numId='3']/w:lvlOverride[@w:ilvl='0']/w:startOverride' 
number of nodes is incorrect
+assertXPath(pXmlNum, numPath + 
"w:lvlOverride[@w:ilvl='0']/w:startOverride", "val", "10");
+assertXPath(pXmlNum, numPath + 
"w:lvlOverride[@w:ilvl='1']/w:startOverride", "val", "1");
+}
+
 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 477768e7019a..dfdaa4013bb3 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -8004,10 +8004,14 @@ void DocxAttributeOutput::OverrideNumberingDefinition(
 if (bListsAreDifferent || levelOverride != rLevelOverrides.end())
 {
 // If there are "gaps" in w:lvlOverride numbers, MS Word can have 
issues with numbering.
-// So we need to emit empty override tokens up to current one.
+// So we need to emit default override tokens up to current one.
 while (nPreviousOverrideLevel < nLevel)
 {
-m_pSerializer->singleElementNS(XML_w, XML_lvlOverride, 
FSNS(XML_w, XML_ilvl), OString::number(nPreviousOverrideLevel));
+const SwNumFormat& rFormat = rRule.Get(nPreviousOverrideLevel);
+m_pSerializer->startElementNS(XML_w, XML_lvlOverride, 
FSNS(XML_w, XML_ilvl), OString::number(nPreviousOverrideLevel));
+// tdf#153104: absent startOverride is treated by Word as 
"startOverride value 0".
+m_pSerializer->singleElementNS(XML_w, XML_startOverride, 
FSNS(XML_w, XML_val), OString::number(rFormat.GetStart()));
+m_pSerializer->endElementNS(XML_w, XML_lvlOverride);
 nPreviousOverrideLevel++;
 }
 


Re: Mold linker and clang 15: /usr/bin/ld: cannot find -lLLVM-14: No such file or directory

2023-01-19 Thread Christian Lohmaier
On Thu, Jan 19, 2023 at 3:15 PM Ilmari Lauhakangas
 wrote:
>
> After upgrading from llvm 14 to 15 today, I got this:

> [GEN] compilerplugins/clang/sharedvisitor/analyzer
> /usr/bin/ld: cannot find -lLLVM-14: No such file or directory

FYI: compilerplugins stuff doesn't get wiped with regular make clean,
use make compilerplugins-clean or make distclean

ciao
Christian


Mold linker and clang 15: /usr/bin/ld: cannot find -lLLVM-14: No such file or directory

2023-01-19 Thread Ilmari Lauhakangas

After upgrading from llvm 14 to 15 today, I got this:

[GEN] compilerplugins/clang/sharedvisitor/analyzer
/usr/bin/ld: cannot find -lLLVM-14: No such file or directory
clang-15: error: linker command failed with exit code 1 (use -v to see 
invocation)
make[1]: *** 
[/home/user/libreoffice/compilerplugins/Makefile-clang.mk:274: 
/home/user/libreoffice/compilerplugins/clang/sharedvisitor/analyzer] Error 1


The problem was solved by switching to --enable-ld=lld

So why is /usr/bin/ld giving its silly outdated opinion here? All the 
CLANG_VERSION checks failed as a result. Looking at the makefile it is 
not obvious to me.


Ilmari


[Libreoffice-commits] core.git: 2 commits - vcl/unx

2023-01-19 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 2f901e483b5ab029a2f809acb68b49aafa2c77c3
Author: Caolán McNamara 
AuthorDate: Thu Jan 19 11:13:50 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 19 14:03:30 2023 +

save last mouse press location even if no handlers set

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

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 6b658d24fae7..90055b3ecc57 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -3010,6 +3010,14 @@ private:
 return true;
 }
 
+/* Save press to possibly begin a drag */
+if (pEvent->type != GDK_BUTTON_RELEASE)
+{
+m_nPressedButton = pEvent->button;
+m_nPressStartX = pEvent->x;
+m_nPressStartY = pEvent->y;
+}
+
 if (!m_aMousePressHdl.IsSet() && !m_aMouseReleaseHdl.IsSet())
 return false;
 
@@ -3060,14 +3068,6 @@ private:
 return false;
 }
 
-/* Save press to possibly begin a drag */
-if (pEvent->type != GDK_BUTTON_RELEASE)
-{
-m_nPressedButton = pEvent->button;
-m_nPressStartX = pEvent->x;
-m_nPressStartY = pEvent->y;
-}
-
 sal_uInt32 nModCode = GtkSalFrame::GetMouseModCode(pEvent->state);
 // strip out which buttons are involved from the nModCode and replace 
with m_nLastMouseButton
 sal_uInt16 nCode = m_nLastMouseButton | (nModCode & (KEY_SHIFT | 
KEY_MOD1 | KEY_MOD2));
commit a7a842f4a437216cba8cd623306506aa30db7d8e
Author: Caolán McNamara 
AuthorDate: Thu Jan 19 10:28:47 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 19 14:03:23 2023 +

use cairo_surface_destroy after gtk_drag_set_icon_surface

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

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index c051da78b969..6b658d24fae7 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -3135,6 +3135,7 @@ private:
 {
 cairo_surface_t *surface = 
cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 0, 0);
 gtk_drag_set_icon_surface(pContext, surface);
+cairo_surface_destroy(surface);
 }
 
 m_nPressedButton = -1;
@@ -3287,6 +3288,7 @@ private:
 {
 cairo_surface_t *surface = 
cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 0, 0);
 gtk_drag_set_icon_surface(context, surface);
+cairo_surface_destroy(surface);
 }
 #endif
 if (!m_xDragSource)


[Libreoffice-commits] core.git: Branch 'libreoffice-7-5-0' - vcl/osx

2023-01-19 Thread Patrick Luby (via logerrit)
 vcl/osx/salframeview.mm |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit d6958883a48d5ed4774b558f5e1fe9f878b7d2f5
Author: Patrick Luby 
AuthorDate: Tue Jan 17 16:26:00 2023 -0500
Commit: Patrick Luby 
CommitDate: Thu Jan 19 13:47:47 2023 +

Related: tdf#42437 Skip special press-and-hold handling for action keys

Pressing and holding action keys such as arrow keys must not be handled
like pressing and holding a character key as it will insert unexpected
text.

Change-Id: I6beaff265e6cae30337b025791692ff67b760ff8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145592
Reviewed-by: Adolfo Jayme Barrientos 
Reviewed-by: Patrick Luby 
Tested-by: Patrick Luby 

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 355fc84a76b4..09643b5c307d 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1028,7 +1028,11 @@ static AquaSalFrame* getMouseContainerFrame()
 // Handle repeat key events by explicitly inserting the text if
 // -[NSResponder interpretKeyEvents:] does not insert or mark any
 // text. Note: do not do this step if there is uncommitted text.
-if ( !mpLastMarkedText && mpLastEvent && [mpLastEvent type] == 
NSEventTypeKeyDown && [mpLastEvent isARepeat] )
+// Related: tdf#42437 Skip special press-and-hold handling for 
action keys
+// Pressing and holding action keys such as arrow keys must not be
+// handled like pressing and holding a character key as it will
+// insert unexpected text.
+if ( !mbKeyHandled && !mpLastMarkedText && mpLastEvent && 
[mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent isARepeat] )
 {
 NSString *pChars = [mpLastEvent characters];
 [self insertText:pChars replacementRange:NSMakeRange( 0, 
[pChars length] )];
@@ -1177,9 +1181,13 @@ static AquaSalFrame* getMouseContainerFrame()
 mpFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
 
 }
-mbKeyHandled = true;
 [self unmarkText];
 }
+
+// Mark event as handled even if the frame isn't valid like is done in
+// [self setMarkedText:selectedRange:replacementRange:] and
+// [self doCommandBySelector:]
+mbKeyHandled = true;
 }
 
 -(void)insertTab: (id)aSender


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - filter/source include/sfx2 sfx2/source vcl/jsdialog

2023-01-19 Thread NickWingate (via logerrit)
 filter/source/pdf/impdialog.cxx |   73 
 filter/source/pdf/impdialog.hxx |4 ++
 include/sfx2/passwd.hxx |6 +++
 sfx2/source/dialog/passwd.cxx   |   30 
 vcl/jsdialog/enabled.cxx|1 
 5 files changed, 78 insertions(+), 36 deletions(-)

New commits:
commit 7166529189ad2044e71cfe9528185a87d96b4baa
Author: NickWingate 
AuthorDate: Wed Dec 28 17:27:31 2022 +
Commit: Andras Timar 
CommitDate: Thu Jan 19 14:40:26 2023 +0100

Make PDFExport Password Subdialog Async

Dialog in File>Export As PDF>Security>Set Password
Close subdialog when parent dialog is closed

Signed-off-by: NickWingate 
Change-Id: I9db8459309f2806ed47f9f932e0bde246400b2dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144854
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145759
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index fd68322f1a23..159271f8a6f8 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -1156,6 +1156,10 @@ 
ImpPDFTabSecurityPage::ImpPDFTabSecurityPage(weld::Container* pPage, weld::Dialo
 
 ImpPDFTabSecurityPage::~ImpPDFTabSecurityPage()
 {
+if (mpPasswordDialog)
+mpPasswordDialog->response(RET_CANCEL);
+if (mpUnsupportedMsgDialog)
+mpUnsupportedMsgDialog->response(RET_CANCEL);
 }
 
 std::unique_ptr ImpPDFTabSecurityPage::Create(weld::Container* 
pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet)
@@ -1246,40 +1250,51 @@ void ImpPDFTabSecurityPage::SetFilterConfigItem( const  
ImpPDFTabDialog* pParent
 
 IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl, weld::Button&, void)
 {
-SfxPasswordDialog aPwdDialog(m_xContainer.get(), &msUserPwdTitle);
-aPwdDialog.SetMinLen(0);
-aPwdDialog.ShowMinLengthText(false);
-aPwdDialog.ShowExtras( SfxShowExtras::CONFIRM | SfxShowExtras::PASSWORD2 | 
SfxShowExtras::CONFIRM2 );
-aPwdDialog.set_title(msStrSetPwd);
-aPwdDialog.SetGroup2Text(msOwnerPwdTitle);
-aPwdDialog.AllowAsciiOnly();
-if (aPwdDialog.run() == RET_OK)  // OK issued get password and set it
-{
-OUString aUserPW(aPwdDialog.GetPassword());
-OUString aOwnerPW(aPwdDialog.GetPassword2());
+if(mpPasswordDialog)
+mpPasswordDialog->response(RET_CANCEL);
 
-mbHaveUserPassword = !aUserPW.isEmpty();
-mbHaveOwnerPassword = !aOwnerPW.isEmpty();
+mpPasswordDialog = std::make_shared(m_xContainer.get(), 
&msUserPwdTitle);
 
-mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, 
aUserPW );
-if (!mxPreparedPasswords.is()) {
-OUString msg;
-ErrorHandler::GetErrorString(ERRCODE_IO_NOTSUPPORTED, msg); 
//TODO: handle failure
-std::unique_ptr(
-Application::CreateMessageDialog(
-GetFrameWeld(), VclMessageType::Error, VclButtonsType::Ok, 
msg))
-->run();
-return;
-}
+mpPasswordDialog->SetMinLen(0);
+mpPasswordDialog->ShowMinLengthText(false);
+mpPasswordDialog->ShowExtras( SfxShowExtras::CONFIRM | 
SfxShowExtras::PASSWORD2 | SfxShowExtras::CONFIRM2 );
+mpPasswordDialog->set_title(msStrSetPwd);
+mpPasswordDialog->SetGroup2Text(msOwnerPwdTitle);
+mpPasswordDialog->AllowAsciiOnly();
+
+mpPasswordDialog->PreRun();
 
-if( mbHaveOwnerPassword )
+weld::DialogController::runAsync(mpPasswordDialog, [this](sal_Int32 
response){
+if (response == RET_OK)
 {
-maPreparedOwnerPassword = 
comphelper::OStorageHelper::CreatePackageEncryptionData( aOwnerPW );
+OUString aUserPW(mpPasswordDialog->GetPassword());
+OUString aOwnerPW(mpPasswordDialog->GetPassword2());
+
+mbHaveUserPassword = !aUserPW.isEmpty();
+mbHaveOwnerPassword = !aOwnerPW.isEmpty();
+
+mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, 
aUserPW );
+if (!mxPreparedPasswords.is())
+{
+OUString msg;
+ErrorHandler::GetErrorString(ERRCODE_IO_NOTSUPPORTED, msg); 
//TODO: handle failure
+mpUnsupportedMsgDialog = std::shared_ptr(
+Application::CreateMessageDialog(
+GetFrameWeld(), VclMessageType::Error, VclButtonsType::Ok, 
msg));
+
+mpUnsupportedMsgDialog->runAsync(mpUnsupportedMsgDialog, 
[](sal_Int32){ });
+return;
+}
+
+if( mbHaveOwnerPassword )
+maPreparedOwnerPassword = 
comphelper::OStorageHelper::CreatePackageEncryptionData( aOwnerPW );
+else
+maPreparedOwnerPassword = Sequence< NamedValue >();
 }
-else
-maPreparedOwnerPassword = Sequence< 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - oox/source sd/qa

2023-01-19 Thread Attila Szűcs (via logerrit)
 oox/source/ppt/slidepersist.cxx   |   72 +-
 sd/qa/unit/data/pptx/tdf153036_resizedConnectorL.pptx |binary
 sd/qa/unit/import-tests.cxx   |   17 
 3 files changed, 69 insertions(+), 20 deletions(-)

New commits:
commit 379866dd23be2cd3eb9952fbc6b106daaec0cdea
Author: Attila Szűcs 
AuthorDate: Mon Jan 16 04:13:07 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Jan 19 13:29:10 2023 +

tdf#153036 PPTX import resized connector broken

Fixed the EdgeLine1Delta calculation in case of bentConnector2.
(when L shape imported as a special Z shape)

Co-authored-by: Tibor Nagy (NISZ)
Change-Id: I08c92e63adc744322061e4e433bfdc512745eda1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145548
Tested-by: Jenkins
Reviewed-by: Andras Timar 
(cherry picked from commit 17c68fad2aef917adfdd3d4d651da786e620699c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145766
Reviewed-by: Xisco Fauli 

diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 657703fff239..dc068b0b699e 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -342,6 +342,36 @@ void SlidePersist::hideShapesAsMasterShapes()
 }
 }
 
+// This angle determines in the direction of the line
+static sal_Int32 lcl_GetAngle(uno::Reference& rXShape, 
awt::Point& rPt)
+{
+SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rXShape);
+tools::Rectangle aR(pObj->GetSnapRect());
+sal_Int32 nLeftX = rPt.X - aR.Left();
+sal_Int32 nTopY = rPt.Y - aR.Top();
+sal_Int32 nRightX = aR.Right() - rPt.X;
+sal_Int32 nBottomY = aR.Bottom() - rPt.Y;
+sal_Int32 nX = std::min(nLeftX, nRightX);
+sal_Int32 nY = std::min(nTopY, nBottomY);
+
+sal_Int32 nAngle;
+if (nX < nY)
+{
+if (nLeftX < nRightX)
+nAngle = 180; // Left
+else
+nAngle = 0; // Right
+}
+else
+{
+if (nTopY < nBottomY)
+nAngle = 270; // Top
+else
+nAngle = 90; // Bottom
+}
+return nAngle;
+}
+
 Reference SlidePersist::getAnimationNode(const OUString& sId) 
const
 {
 const auto& pIter = maAnimNodesMap.find(sId);
@@ -373,6 +403,8 @@ static void 
lcl_SetEdgeLineValue(uno::Reference& rXConnector,
 SdrObject* pEndObj = xEndSp.is() ? 
SdrObject::getSdrObjectFromXShape(xEndSp) : nullptr;
 
 sal_Int32 nStartSpLineW = 0;
+sal_Int32 nStartA = -1;
+sal_Int32 nEndA = -1;
 if (pStartObj)
 {
 aStartRect = pStartObj->GetSnapRect();
@@ -380,6 +412,7 @@ static void 
lcl_SetEdgeLineValue(uno::Reference& rXConnector,
 xPropxStartSp->getPropertyValue("LineWidth") >>= nStartSpLineW;
 if (nStartSpLineW)
 nStartSpLineW = nStartSpLineW / 2;
+nStartA = lcl_GetAngle(xStartSp, aStartPt);
 }
 sal_Int32 nEndSpLineW = 0;
 if (pEndObj)
@@ -389,6 +422,7 @@ static void 
lcl_SetEdgeLineValue(uno::Reference& rXConnector,
 xPropxEndSp->getPropertyValue("LineWidth") >>= nEndSpLineW;
 if (nEndSpLineW)
 nEndSpLineW = nEndSpLineW / 2;
+nEndA = lcl_GetAngle(xEndSp, aEndPt);
 }
 
 const OUString sConnectorName = rShapePtr->getConnectorName();
@@ -397,27 +431,25 @@ static void 
lcl_SetEdgeLineValue(uno::Reference& rXConnector,
 awt::Size aConnSize = rXConnector->getSize();
 if (xStartSp.is() || xEndSp.is())
 {
-if (aConnSize.Height < aConnSize.Width)
+if (nStartA >= 0)
 {
-if (xStartSp.is())
-nEdge = (aStartPt.Y > aEndPt.Y)
-? (nStartSpLineW - (aStartRect.Top() - 
aEndPt.Y))
-: ((aEndPt.Y - aStartRect.Bottom()) - 
nStartSpLineW);
-else
-nEdge = (aStartPt.Y > aEndPt.Y)
-? ((aStartPt.Y - aEndRect.Bottom()) - 
nEndSpLineW)
-: (nEndSpLineW - (aEndRect.Top() - 
aStartPt.Y));
-}
-else
-{
-if (xStartSp.is())
-nEdge = (aStartPt.X > aEndPt.X)
-? (nStartSpLineW - (aStartRect.Left() - 
aEndPt.X))
-: ((aEndPt.X - aStartRect.Right()) - 
nStartSpLineW);
-else
-nEdge = (aStartPt.X > aEndPt.X)
-? ((aStartPt.X - aEndRect.Right()) - 
nEndSpLineW)
-: (nEndSpLineW - (aEndRect.Left() - 
aStartPt.X));
+switch (nStartA)
+{
+case 0: nEdge = aEndPt.X - aStartRect.Right();  break;
+case 180:   nEdge = aEndPt.X - aStartRect.Left();   break;
+case 90:nEdge = aEndPt.Y - aStartRect.Bottom(); break;
+case 270:   nEdge = aEndPt.Y - a

[Libreoffice-commits] core.git: cui/inc cui/source cui/uiconfig

2023-01-19 Thread Szymon Kłos (via logerrit)
 cui/inc/widgettestdlg.hxx|4 
 cui/source/dialogs/widgettestdlg.cxx |   26 
 cui/uiconfig/ui/widgettestdialog.ui  |  200 +++
 3 files changed, 210 insertions(+), 20 deletions(-)

New commits:
commit 24c9373409dda957ad6e1f1b4e3ec6c7135ecf1a
Author: Szymon Kłos 
AuthorDate: Thu Dec 15 13:59:15 2022 +0100
Commit: Szymon Kłos 
CommitDate: Thu Jan 19 13:03:59 2023 +

jsdialog: add TreeView to TestWidgetDialog

Change-Id: I5c4f70d98dd8ea03c137cd368a2c097cd866609d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144222
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Rashesh Padia 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145067
Tested-by: Jenkins

diff --git a/cui/inc/widgettestdlg.hxx b/cui/inc/widgettestdlg.hxx
index dabc2ee14e75..02ab7f317894 100644
--- a/cui/inc/widgettestdlg.hxx
+++ b/cui/inc/widgettestdlg.hxx
@@ -18,10 +18,14 @@ class WidgetTestDialog final : public 
weld::GenericDialogController
 private:
 std::unique_ptr m_xOKButton;
 std::unique_ptr m_xCancelButton;
+std::unique_ptr m_xTreeView;
+std::unique_ptr m_xTreeView2;
 
 DECL_LINK(OkHdl, weld::Button&, void);
 DECL_LINK(CancelHdl, weld::Button&, void);
 
+void FillTreeView();
+
 public:
 WidgetTestDialog(weld::Window* pParent);
 ~WidgetTestDialog();
diff --git a/cui/source/dialogs/widgettestdlg.cxx 
b/cui/source/dialogs/widgettestdlg.cxx
index 5475151a9af2..51ecef3105d0 100644
--- a/cui/source/dialogs/widgettestdlg.cxx
+++ b/cui/source/dialogs/widgettestdlg.cxx
@@ -8,15 +8,20 @@
 */
 
 #include 
+#include 
 
 WidgetTestDialog::WidgetTestDialog(weld::Window* pParent)
 : GenericDialogController(pParent, "cui/ui/widgettestdialog.ui", 
"WidgetTestDialog")
 {
 m_xOKButton = m_xBuilder->weld_button("ok_btn");
 m_xCancelButton = m_xBuilder->weld_button("cancel_btn");
+m_xTreeView = m_xBuilder->weld_tree_view("contenttree");
+m_xTreeView2 = m_xBuilder->weld_tree_view("contenttree2");
 
 m_xOKButton->connect_clicked(LINK(this, WidgetTestDialog, OkHdl));
 m_xCancelButton->connect_clicked(LINK(this, WidgetTestDialog, CancelHdl));
+
+FillTreeView();
 }
 
 WidgetTestDialog::~WidgetTestDialog() {}
@@ -28,4 +33,25 @@ IMPL_LINK_NOARG(WidgetTestDialog, CancelHdl, weld::Button&, 
void)
 m_xDialog->response(RET_CANCEL);
 }
 
+void WidgetTestDialog::FillTreeView()
+{
+OUString aImage1(RID_SVXBMP_CELL_LR);
+OUString aImage2(RID_SVXBMP_SHADOW_BOT_LEFT);
+
+for (size_t nCount = 0; nCount < 4; nCount++)
+{
+OUString sText = OUString::Concat("Test ") + 
OUString::Concat(OUString::number(nCount));
+std::unique_ptr xEntry = m_xTreeView->make_iterator();
+m_xTreeView->insert(nullptr, -1, &sText, &sText, nullptr, nullptr, 
false, xEntry.get());
+m_xTreeView->set_image(*xEntry, (nCount % 2 == 0) ? aImage1 : aImage2);
+
+m_xTreeView2->append();
+m_xTreeView2->set_image(nCount, (nCount % 2 == 0) ? aImage1 : aImage2);
+m_xTreeView2->set_text(nCount, "First Column", 0);
+m_xTreeView2->set_text(
+nCount, OUString::Concat("Row ") + 
OUString::Concat(OUString::number(nCount)), 1);
+m_xTreeView2->set_id(nCount, OUString::number(nCount));
+}
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/uiconfig/ui/widgettestdialog.ui 
b/cui/uiconfig/ui/widgettestdialog.ui
index 787deda37171..4f4b3cfc23b9 100644
--- a/cui/uiconfig/ui/widgettestdialog.ui
+++ b/cui/uiconfig/ui/widgettestdialog.ui
@@ -8,11 +8,8 @@
 dialog
 
   
-True
-False
-vertical
-5
-
+  vertical
+  
   
 False
 end
@@ -46,9 +43,16 @@
   
 False
 False
-0
+1
   
 
+  
+  
+  
+True
+False
+5
+5
 
   
   
@@ -286,18 +290,8 @@
   
 False
 True
-0
-  
-
-
-  
-True
-False
-  
-  
-False
-True
-1
+0
+0
   
 
 
@@ -455,11 +449,151 @@
   
 False
 True
-2
+0
+1
+  
+
+
+  
+True
+False
+True
+True
+vertical
+
+  
+True
+True
+True
+True
+in
+
+  
+-1
+True
+True
+True
+True
+True
+True
+liststore2
+False
+   

[Libreoffice-commits] core.git: filter/source include/sfx2 sfx2/source vcl/jsdialog

2023-01-19 Thread NickWingate (via logerrit)
 filter/source/pdf/impdialog.cxx |   73 
 filter/source/pdf/impdialog.hxx |4 ++
 include/sfx2/passwd.hxx |6 +++
 sfx2/source/dialog/passwd.cxx   |   30 
 vcl/jsdialog/enabled.cxx|1 
 5 files changed, 78 insertions(+), 36 deletions(-)

New commits:
commit 7ebe5e19fb379c88b8e455693a23fd9036c1b517
Author: NickWingate 
AuthorDate: Wed Dec 28 17:27:31 2022 +
Commit: Andras Timar 
CommitDate: Thu Jan 19 12:48:06 2023 +

Make PDFExport Password Subdialog Async

Dialog in File>Export As PDF>Security>Set Password
Close subdialog when parent dialog is closed

Signed-off-by: NickWingate 
Change-Id: I9db8459309f2806ed47f9f932e0bde246400b2dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144854
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145759
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 4a03de89fdef..2516342cde70 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -1171,6 +1171,10 @@ 
ImpPDFTabSecurityPage::ImpPDFTabSecurityPage(weld::Container* pPage, weld::Dialo
 
 ImpPDFTabSecurityPage::~ImpPDFTabSecurityPage()
 {
+if (mpPasswordDialog)
+mpPasswordDialog->response(RET_CANCEL);
+if (mpUnsupportedMsgDialog)
+mpUnsupportedMsgDialog->response(RET_CANCEL);
 }
 
 std::unique_ptr ImpPDFTabSecurityPage::Create(weld::Container* 
pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet)
@@ -1261,40 +1265,51 @@ void ImpPDFTabSecurityPage::SetFilterConfigItem( const  
ImpPDFTabDialog* pParent
 
 IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl, weld::Button&, void)
 {
-SfxPasswordDialog aPwdDialog(m_xContainer.get(), &msUserPwdTitle);
-aPwdDialog.SetMinLen(0);
-aPwdDialog.ShowMinLengthText(false);
-aPwdDialog.ShowExtras( SfxShowExtras::CONFIRM | SfxShowExtras::PASSWORD2 | 
SfxShowExtras::CONFIRM2 );
-aPwdDialog.set_title(msStrSetPwd);
-aPwdDialog.SetGroup2Text(msOwnerPwdTitle);
-aPwdDialog.AllowAsciiOnly();
-if (aPwdDialog.run() == RET_OK)  // OK issued get password and set it
-{
-OUString aUserPW(aPwdDialog.GetPassword());
-OUString aOwnerPW(aPwdDialog.GetPassword2());
+if(mpPasswordDialog)
+mpPasswordDialog->response(RET_CANCEL);
 
-mbHaveUserPassword = !aUserPW.isEmpty();
-mbHaveOwnerPassword = !aOwnerPW.isEmpty();
+mpPasswordDialog = std::make_shared(m_xContainer.get(), 
&msUserPwdTitle);
 
-mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, 
aUserPW );
-if (!mxPreparedPasswords.is()) {
-OUString msg;
-ErrorHandler::GetErrorString(ERRCODE_IO_NOTSUPPORTED, msg); 
//TODO: handle failure
-std::unique_ptr(
-Application::CreateMessageDialog(
-GetFrameWeld(), VclMessageType::Error, VclButtonsType::Ok, 
msg))
-->run();
-return;
-}
+mpPasswordDialog->SetMinLen(0);
+mpPasswordDialog->ShowMinLengthText(false);
+mpPasswordDialog->ShowExtras( SfxShowExtras::CONFIRM | 
SfxShowExtras::PASSWORD2 | SfxShowExtras::CONFIRM2 );
+mpPasswordDialog->set_title(msStrSetPwd);
+mpPasswordDialog->SetGroup2Text(msOwnerPwdTitle);
+mpPasswordDialog->AllowAsciiOnly();
+
+mpPasswordDialog->PreRun();
 
-if( mbHaveOwnerPassword )
+weld::DialogController::runAsync(mpPasswordDialog, [this](sal_Int32 
response){
+if (response == RET_OK)
 {
-maPreparedOwnerPassword = 
comphelper::OStorageHelper::CreatePackageEncryptionData( aOwnerPW );
+OUString aUserPW(mpPasswordDialog->GetPassword());
+OUString aOwnerPW(mpPasswordDialog->GetPassword2());
+
+mbHaveUserPassword = !aUserPW.isEmpty();
+mbHaveOwnerPassword = !aOwnerPW.isEmpty();
+
+mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, 
aUserPW );
+if (!mxPreparedPasswords.is())
+{
+OUString msg;
+ErrorHandler::GetErrorString(ERRCODE_IO_NOTSUPPORTED, msg); 
//TODO: handle failure
+mpUnsupportedMsgDialog = std::shared_ptr(
+Application::CreateMessageDialog(
+GetFrameWeld(), VclMessageType::Error, VclButtonsType::Ok, 
msg));
+
+mpUnsupportedMsgDialog->runAsync(mpUnsupportedMsgDialog, 
[](sal_Int32){ });
+return;
+}
+
+if( mbHaveOwnerPassword )
+maPreparedOwnerPassword = 
comphelper::OStorageHelper::CreatePackageEncryptionData( aOwnerPW );
+else
+maPreparedOwnerPassword = Sequence< NamedValue >();
 }
-else
-maPreparedOwnerPassword = Sequence< 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/qa sw/source writerfilter/source

2023-01-19 Thread Michael Stahl (via logerrit)
 sw/qa/extras/ooxmlexport/data/custom-styles-TOC-semicolon.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport17.cxx |   24 
 sw/source/filter/ww8/ww8atr.cxx|   27 
--
 writerfilter/source/dmapper/DomainMapper_Impl.cxx  |7 +-
 4 files changed, 51 insertions(+), 7 deletions(-)

New commits:
commit 5b8de6f5e19b4b85e9d13d86aa71ee6b7adae5f3
Author: Michael Stahl 
AuthorDate: Wed Jan 18 11:56:30 2023 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 19 12:43:48 2023 +

tdf#153082 writerfilter,sw: import/export locale-dependent TOC ...

... \t style name separators.

OOXML says in 17.16.5.68 TOC:

  \t field-argument
  Uses paragraphs formatted with styles other than the built-in
  heading styles. text in this switch's field-argument specifies those
  styles as a set of comma-separated doublets, with each doublet
  being a comma-separated set of style name and table of content
  level.

The reality is documented in Word online help:

https://support.microsoft.com/en-us/office/field-codes-toc-table-of-contents-field-1f538bc4-60e6-4854-9f64-67754d78d05c?ui=en-US&rs=en-US&ad=US

  Note: Syntax shown here uses a comma (,) between the Style and Level
  parameters. A semicolon (;) is also valid, depending on which
  character is specified as the list separator in your operating
  system's regional and language settings. Because of language-specific
  dependencies, we recommend not using the \t switch in templates or
  documents that are intended for users across multiple language
  configurations.

It's easy enough to recognize both ',' and ';' as separators on import,
and unlikely that anybody would use these characters inside a style
name; for export, both can't be written and a decision must be made.

So do the same thing on export as Word does, assuming most document
exchange is between users in the same locale; currently only for "de"
locales but more can be added.

Interestingly WW8 used to write ';' before 2009 when CWS hb32bugs01
changed it to ','.

Change-Id: I2dcfdd009f448f6fae37cbd28929d0bbe504acf9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145744
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 7b62d09090e5172e26141694fb97bc27562a81ce)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145722
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/ooxmlexport/data/custom-styles-TOC-semicolon.docx 
b/sw/qa/extras/ooxmlexport/data/custom-styles-TOC-semicolon.docx
new file mode 100644
index ..bef835c9bb46
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/custom-styles-TOC-semicolon.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index b216e14d22fe..0e000bff9641 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -702,6 +702,30 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148361, "tdf148361.docx")
 CPPUNIT_ASSERT_EQUAL(OUString("[Type text]"), aActual);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf153082_semicolon, 
"custom-styles-TOC-semicolon.docx")
+{
+uno::Reference xIndexSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xIndexes = 
xIndexSupplier->getDocumentIndexes();
+uno::Reference xTOC(xIndexes->getByIndex(0), 
uno::UNO_QUERY);
+// check styles
+uno::Reference xParaStyles =
+getProperty>(xTOC, 
"LevelParagraphStyles");
+uno::Sequence styles;
+xParaStyles->getByIndex(0) >>= styles;
+CPPUNIT_ASSERT_EQUAL(uno::Sequence{}, styles);
+xParaStyles->getByIndex(1) >>= styles;
+CPPUNIT_ASSERT_EQUAL(uno::Sequence{}, styles);
+xParaStyles->getByIndex(2) >>= styles;
+// the first one is built-in Word style that was localised DE "Intensives 
Zitat" in the file
+CPPUNIT_ASSERT_EQUAL((uno::Sequence{"Intense Quote", "Custom1", 
"_MyStyle0"}), styles);
+xTOC->update();
+OUString const tocContent(xTOC->getAnchor()->getString());
+CPPUNIT_ASSERT(tocContent.startsWith("Table of Contents"));
+CPPUNIT_ASSERT(tocContent.indexOf("Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit.") != -1);
+CPPUNIT_ASSERT(tocContent.indexOf("Fusce posuere, magna sed pulvinar 
ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis 
urna.") != -1);
+CPPUNIT_ASSERT(tocContent.indexOf("Proin pharetra nonummy pede. Mauris et 
orci.") != -1);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf153082_comma, "custom-styles-TOC-comma.docx")
 {
 uno::Reference xIndexSupplier(mxComponent, 
uno::UNO_QUERY);
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index d0bed9c5c5bf..301b46e86319 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -138,6 +138,7 @@
 #include 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/inc sw/qa sw/source

2023-01-19 Thread Michael Stahl (via logerrit)
 sw/inc/doc.hxx  |3 
 sw/qa/extras/layout/data/hidden-para-separator.docx |binary
 sw/qa/extras/layout/layout2.cxx |   37 +
 sw/source/core/doc/doctxm.cxx   |5 -
 sw/source/core/docnode/ndsect.cxx   |2 
 sw/source/core/inc/UndoSection.hxx  |5 -
 sw/source/core/inc/rootfrm.hxx  |9 +-
 sw/source/core/layout/newfrm.cxx|3 
 sw/source/core/layout/wsfrm.cxx |   22 -
 sw/source/core/text/redlnitr.cxx|   76 ++--
 sw/source/core/undo/unsect.cxx  |   14 ++-
 sw/source/core/view/viewsh.cxx  |8 +-
 12 files changed, 156 insertions(+), 28 deletions(-)

New commits:
commit 42e261fe7ce2ba598941febffea51914dd1fe681
Author: Michael Stahl 
AuthorDate: Fri Jan 6 19:07:35 2023 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 19 12:43:29 2023 +

tdf#152872 sw: conditionally hide paragraph breaks

Add a 3rd kind of hiding to SwRootFrame and CheckParaRedlineMerge().

This is quite simple as only consecutive paragraphs are merged.

There is an existing similar feature described in
http://www.openoffice.org/specs/writer/hidden_text/hidden_text.sxw
which results in 0-height text frames if all text is hidden
- but that is unconditional, while Word shows the paragraph when
control chars are shown, and hides it otherwise *iff* its paragraph
marker is hidden (and there's no page break on it).

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145162
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 2bcfb7231b5ca74f02274cfb74ca8463f78905d6)

tdf#152872 sw: fix crash on ooo27109-1.sxw
Has a redline that ends on the body end node.
(regression from commit 2bcfb7231b5ca74f02274cfb74ca8463f78905d6)
(cherry picked from commit 29507e398d27bdfceb9155d24a20986ee997d70c)

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

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 80aa234cc6e3..4a399b839896 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -142,6 +142,7 @@ namespace sw::mark { class MarkManager; }
 namespace sw {
 enum class RedlineMode;
 enum class FieldmarkMode;
+enum class ParagraphBreakMode;
 class MetaFieldManager;
 class UndoManager;
 class IShellCursorSupplier;
@@ -1337,7 +1338,7 @@ public:
 
 // insert section (the ODF kind of section, not the nodesarray kind)
 SwSection * InsertSwSection(SwPaM const& rRange, SwSectionData &,
-std::tuple 
const* pTOXBase,
+std::tuple const* pTOXBase,
 SfxItemSet const*const pAttr, bool const bUpdate = true);
 static sal_uInt16 IsInsRegionAvailable( const SwPaM& rRange,
 const SwNode** ppSttNd = nullptr );
diff --git a/sw/qa/extras/layout/data/hidden-para-separator.docx 
b/sw/qa/extras/layout/data/hidden-para-separator.docx
new file mode 100644
index ..1d5d26075f22
Binary files /dev/null and 
b/sw/qa/extras/layout/data/hidden-para-separator.docx differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 0b528753aa9a..434bf6376ebc 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -636,6 +636,43 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, 
testTdf149711_importDOCXMoveToParagraphMar
 assertXPath(pXmlDoc, "/root/page[1]/body/txt", 5);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf152872)
+{
+createSwDoc("hidden-para-separator.docx");
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+
+assertXPath(pXmlDoc, "/root/page[1]/body/txt", 2);
+assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout", 
"portion", "C DE");
+assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion", 0); // 5 is 
empty
+assertXPath(pXmlDoc, "/root/page/body/txt[2]/infos/bounds", "height", 
"379");
+
+dispatchCommand(mxComponent, ".uno:ControlCodes", {});
+
+discardDumpedLayout();
+pXmlDoc = parseLayoutDump();
+
+assertXPath(pXmlDoc, "/root/page[1]/body/txt", 5);
+assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout", 
"portion", "C ");
+assertXPath(pXmlDoc, "/root/page/body/txt[2]/SwParaPortion/SwLineLayout", 
"portion", "D");
+// 3 is an empty paragraph with RES_CHRATR_HIDDEN which results in 0-height
+// frame; ideally it should only be hidden when control codes are hidden
+// and be a full-height frame now, but that needs more work...
+assertXPath(pXmlDoc, "/root/page/body/txt[3]/infos/bounds", "height", "0");
+assertXPath(pXmlDoc, "/root/page/body/txt[4]/SwParaPortion/SwLineLayout", 
"portion", "E");
+ass

[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/qa writerfilter/source

2023-01-19 Thread Michael Stahl (via logerrit)
 sw/qa/extras/ooxmlexport/data/custom-styles-TOC-comma.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport17.cxx |   25 +++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx  |4 +
 writerfilter/source/dmapper/StyleSheetTable.cxx|   29 +
 4 files changed, 57 insertions(+), 1 deletion(-)

New commits:
commit d42e7d50225d5ff7359cfc765ec9694cf83c9749
Author: Michael Stahl 
AuthorDate: Wed Jan 18 15:41:57 2023 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 19 12:43:03 2023 +

tdf#153083 writerfilter: import locale-dependent TOC \t style names

The bugdoc contains this style:

  




...

which is referred to by:

  TOC \o "1-3" \h \z \t "Intensives Zitat;3;Custom1;3;_MyStyle0;3"

Word in an "en" locale is unable to match the "Intensives Zitat" in the
TOC field with the style "Intense Quote", which is a built-in style
in Word (no equivalent in Writer).

At first glance nothing in styles.xml matches the localised built-in
style name in the TOC field.

But it looks like the w:styleId value is somehow generated from the
localised style name by omitting certain characters like SPACE and
non-ASCII letters.

Change-Id: I2050f7cf7f8d80bee1f667ee53b7f9981bbf7b49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145745
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit ecbad22fdf81c6f072b6c9f9c16dbba47fe4748c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145721
Tested-by: Michael Stahl 
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/ooxmlexport/data/custom-styles-TOC-comma.docx 
b/sw/qa/extras/ooxmlexport/data/custom-styles-TOC-comma.docx
new file mode 100644
index ..1b013086dcc6
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/custom-styles-TOC-comma.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index d9d5802e0606..b216e14d22fe 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -701,6 +702,30 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148361, "tdf148361.docx")
 CPPUNIT_ASSERT_EQUAL(OUString("[Type text]"), aActual);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf153082_comma, "custom-styles-TOC-comma.docx")
+{
+uno::Reference xIndexSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xIndexes = 
xIndexSupplier->getDocumentIndexes();
+uno::Reference xTOC(xIndexes->getByIndex(0), 
uno::UNO_QUERY);
+// check styles
+uno::Reference xParaStyles =
+getProperty>(xTOC, 
"LevelParagraphStyles");
+uno::Sequence styles;
+xParaStyles->getByIndex(0) >>= styles;
+CPPUNIT_ASSERT_EQUAL(uno::Sequence{"_MyStyle0"}, styles);
+xParaStyles->getByIndex(1) >>= styles;
+CPPUNIT_ASSERT_EQUAL(uno::Sequence{"Custom1"}, styles);
+xParaStyles->getByIndex(2) >>= styles;
+// the first one is built-in Word style that was localised DE "Intensives 
Zitat" in the file
+CPPUNIT_ASSERT_EQUAL(uno::Sequence{"Intense Quote"}, styles);
+xTOC->update();
+OUString const tocContent(xTOC->getAnchor()->getString());
+CPPUNIT_ASSERT(tocContent.startsWith("Table of Contents"));
+CPPUNIT_ASSERT(tocContent.indexOf("Lorem ipsum dolor sit amet, 
consectetuer adipiscing elit.") != -1);
+CPPUNIT_ASSERT(tocContent.indexOf("Fusce posuere, magna sed pulvinar 
ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis 
urna.") != -1);
+CPPUNIT_ASSERT(tocContent.indexOf("Pellentesque habitant morbi tristique 
senectus et netus et malesuada fames ac turpis egestas.") != -1);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf142407, "tdf142407.docx")
 {
 uno::Reference xPageStyles = 
getStyles("PageStyles");
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index bcfcbc7c72dd..3f33280f5a22 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -6279,7 +6279,9 @@ void DomainMapper_Impl::handleToc
 uno::Sequence< OUString> aStyles( nLevelCount );
 for ( auto& rStyle : asNonConstRange(aStyles) )
 {
-rStyle = (aTOCStyleIter++)->second;
+// tdf#153082 must map w:styleId to w:name
+rStyle = 
GetStyleSheetTable()->ConvertStyleName(aTOCStyleIter->second, true);
+++aTOCStyleIter;
 }
 xParaStyles->replaceByIndex(nLevel - 1, uno::Any(aStyles));
 }
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 9641a

[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/inc sw/qa sw/source writerfilter/source

2023-01-19 Thread Michael Stahl (via logerrit)
 sw/inc/IDocumentSettingAccess.hxx |1 
 sw/qa/extras/layout/data/Hyphenated-link.fodt |  254 ++
 sw/qa/extras/layout/data/Hyphenated-link.rtf  |   41 
 sw/qa/extras/layout/layout2.cxx   |   26 ++
 sw/source/core/doc/DocumentSettingManager.cxx |9 
 sw/source/core/inc/DocumentSettingManager.hxx |1 
 sw/source/core/text/guess.cxx |   30 +++
 sw/source/filter/ww8/ww8par.cxx   |1 
 sw/source/filter/xml/xmlimp.cxx   |   10 +
 sw/source/uibase/uno/SwXDocumentSettings.cxx  |   18 +
 writerfilter/source/filter/WriterFilter.cxx   |1 
 11 files changed, 392 insertions(+)

New commits:
commit 84526ec730029fbf81242253bfaed67c85bcfbbd
Author: Michael Stahl 
AuthorDate: Thu Jan 12 14:24:11 2023 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 19 12:42:21 2023 +

tdf#152952 sw: don't hyphenate URLs by default

New compatibility flag HyphenateURLs, disabled by default for Word
interop and enabled for old ODT documents.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145415
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit de2b1a3a22a0a3bf5dfdd44c57c09e1fd0ba39d2)

CppunitTest_sw_layoutwriter2: fix testTdf152952_compat with en-only hyph 
dict
The bugdoc had German text, but the test was only checking for an English
hyphenation dictionary, so adapt the bugdoc.
Also, now that the text is English, it's hyphenated a little bit
differently, so adapt the asserts. The point is that it's still
hyphenated.
(cherry picked from commit cb3027f90fc7bc1de9eb7cf200b17da49ca064d5)

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

diff --git a/sw/inc/IDocumentSettingAccess.hxx 
b/sw/inc/IDocumentSettingAccess.hxx
index 1f81ead70645..e891a2b8c058 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -92,6 +92,7 @@ enum class DocumentSettingId
 EMPTY_DB_FIELD_HIDES_PARA,
 // tdf#129448: Auto first-line indent should not be effected by line space
 AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE,
+HYPHENATE_URLS, ///< tdf#152952
 // COMPATIBILITY FLAGS END
 BROWSE_MODE,
 HTML_MODE,
diff --git a/sw/qa/extras/layout/data/Hyphenated-link.fodt 
b/sw/qa/extras/layout/data/Hyphenated-link.fodt
new file mode 100644
index ..300c2491bf2d
--- /dev/null
+++ b/sw/qa/extras/layout/data/Hyphenated-link.fodt
@@ -0,0 +1,254 @@
+
+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">
+ Gabor Kelemen 
LO2023-01-09T23:24:002023-01-09T23:25:003PT3SLibreOfficeDev/7.4.5.0.0$Linux_X86_64
 
LibreOffice_project/f2d3658697f22090ee138cebda4d10c3ede21230Gábor

[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/CppunitTest_sw_rtfimport.mk sw/qa writerfilter/source

2023-01-19 Thread Michael Stahl (via logerrit)
 sw/CppunitTest_sw_rtfimport.mk|1 
 sw/qa/extras/rtfimport/data/hidden-para-separator.rtf |   67 ++
 sw/qa/extras/rtfimport/rtfimport.cxx  |   37 +
 writerfilter/source/rtftok/rtfdispatchsymbol.cxx  |4 -
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|   17 +++-
 writerfilter/source/rtftok/rtfdocumentimpl.hxx|3 
 6 files changed, 120 insertions(+), 9 deletions(-)

New commits:
commit 1ed691c4685baa6170829bc8fc464f4036806a92
Author: Michael Stahl 
AuthorDate: Fri Jan 13 17:49:58 2023 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 19 12:41:54 2023 +

tdf#131386 writerfilter: RTF import paragraph mark formatting

One obstacle was remove in commit 02f53bd61222d7999b847a22fd24d65195f129e5

To fix it, when \par is handled, runProps() just has to be called
unconditionally.

Now one test fails with:

rtfexport5.cxx:438:Assertion
Test name: testTdf107413::Load_Verify_Reload_Verify
equality assertion failed
- Expected: 14578
- Actual  : 14698

The spacing above the first paragraph in the table in the footer
is not imported - because this is recorded in a buffer, and when replaying,
getProperties() is called with Id 0, and not LN_Value_ST_StyleType_character
as when it's called immediately without buffering.

Change-Id: If86ed2fa88eb2ac0eafd7a8be411bbfa341619b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145490
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit a25eda715591cfa96136bcfd95360156516239d1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145439
Reviewed-by: Miklos Vajna 

diff --git a/sw/CppunitTest_sw_rtfimport.mk b/sw/CppunitTest_sw_rtfimport.mk
index 650abb178408..e961c4c2304b 100644
--- a/sw/CppunitTest_sw_rtfimport.mk
+++ b/sw/CppunitTest_sw_rtfimport.mk
@@ -25,6 +25,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_rtfimport, \
 sfx \
subsequenttest \
i18nlangtag \
+   svl \
sw \
swqahelper \
 test \
diff --git a/sw/qa/extras/rtfimport/data/hidden-para-separator.rtf 
b/sw/qa/extras/rtfimport/data/hidden-para-separator.rtf
new file mode 100644
index ..b35bdcf710e3
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/hidden-para-separator.rtf
@@ -0,0 +1,67 @@
+{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch0\stshfloch31506\stshfhich31506\stshfbi31506\deflang1033\deflangfe1033\themelang1038\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi
 \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt 
Times New Roman};}
+{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 
020b0604020202020204}Arial;}{\f34\fbidi \froman\fcharset1\fprq2{\*\panose 
02040503050406030204}Cambria Math;}{\f60\fbidi 
\fswiss\fcharset0\fprq2{\*\panose }Verdana;}
+{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 
02020603050405020304}Times New Roman{\*\falt Times New 
Roman};}{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 
02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\fhimajor\f31502\fbidi \fswiss\fcharset0\fprq2{\*\panose 
020f0302020204030204}Calibri Light;}{\fbimajor\f31503\fbidi 
\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt 
Times New Roman};}
+{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 
02020603050405020304}Times New Roman{\*\falt Times New 
Roman};}{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 
02020603050405020304}Times New Roman{\*\falt Times New Roman};}
+{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 
020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi 
\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt 
Times New Roman};}
+{\f61\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times New 
Roman};}{\f62\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times 
New Roman};}{\f64\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt 
Times New Roman};}
+{\f65\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times New 
Roman};}{\f66\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt 
Times New Roman};}
+{\f67\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times 
New Roman};}{\f68\fbidi \froman\fcharset186\fprq2 Times New Roman 
Baltic{\*\falt Times New Roman};}
+{\f69\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt 
Times New Roman};}{\f71\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f72\fbidi 
\fswiss\fcharset204\fprq2 Arial Cyr;}{\f74\fbidi \fswiss\fcharset161\fprq2 
Arial Greek;}
+{\f75\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f76\fbidi 
\fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f77\fbidi \fswiss\fcharset178\fprq2 
Arial (Arabic);}{\f78\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}
+{\f79\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\

[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/qa sw/source

2023-01-19 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/layout.cxx |   37 +
 sw/source/core/layout/tabfrm.cxx |6 +-
 2 files changed, 42 insertions(+), 1 deletion(-)

New commits:
commit 29b25f012cf799d8e352d3b8dd890a642b35fef8
Author: Miklos Vajna 
AuthorDate: Wed Jan 18 20:18:39 2023 +0100
Commit: Michael Stahl 
CommitDate: Thu Jan 19 12:23:42 2023 +

tdf#153045 sw: fix incorrect height of row in table

The bugdoc DOCX had a shape anchored in a table cell, and the cell had
large enough height so the shape could fit into the cell, while the
expected cell height was independent (smaller) from the shape.

The problem is around the follow-text-flow feature, which is called
"keep inside cell boundaries" in Word. This setting would normally
increase the size of the cell, so the shape remains inside the cell. An
exception from this increase request is the wrap-through wrap mode,
which leaves the cell size unchanged.

Fix the problem by considering two previous use-cases:
1d9221ebc86f2696a65c12287ea19eea44d680cf (tdf#145688 sw: fix misplaced
images in table cells, 2022-11-29) and
489eef894e7034873ad262f9dfca554022db1b09 (tdf#124601 sw FollowTextFlow:
fix vert pos of objects outside the current cell, 2019-10-01):

- tdf#145688 is a legacy ODF document: do require the the "in
  background" wrapping, otherwise make the cells big

- tdf#124601 & tdf#153045 are Word documents: here don't require the "in
  background" wrapping and go with small cells when the wrap type is
  through

This requires adjusting the tdf#145688 testcase that minimized the
original bugdoc incorrectly.

Change-Id: Ieaf3d9c1c4477e5e57e5e1e825775648840ab32b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145756
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit 6819b7eb6ca5187b82833965c8198f3ca868b27a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145727
Reviewed-by: Michael Stahl 

diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index 792466098066..c47bec8dfc6c 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -858,6 +859,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, 
testFollowTextFlowWrapInBackground)
 // through and follow-text-flow set to true:
 createSwDoc();
 SwDoc* pDoc = getSwDoc();
+
pDoc->getIDocumentSettingAccess().set(DocumentSettingId::USE_FORMER_TEXT_WRAPPING,
 true);
 SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
 SwInsertTableOptions aTableOptions(SwInsertTableFlags::DefaultBorder, 0);
 pWrtShell->InsertTable(aTableOptions, 1, 1);
@@ -927,6 +929,41 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, 
testPageRemoveFlyNoTable)
 calcLayout();
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testNewFollowTextFlowWrapInBackground)
+{
+// Given a document with a table, and a graphic inside that table -- 
anchored, wrap set to
+// through and follow-text-flow set to true, legacy 
USE_FORMER_TEXT_WRAPPING is not set:
+createSwDoc();
+SwDoc* pDoc = getSwDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+SwInsertTableOptions aTableOptions(SwInsertTableFlags::DefaultBorder, 0);
+pWrtShell->InsertTable(aTableOptions, 1, 1);
+pWrtShell->MoveTable(GotoPrevTable, fnTableStart);
+SfxItemSet aFrameSet(pDoc->GetAttrPool(), svl::Items);
+SwFormatAnchor aAnchor(RndStdIds::FLY_AT_CHAR);
+aFrameSet.Put(aAnchor);
+SwFormatSurround aSurround(text::WrapTextMode_THROUGH);
+aFrameSet.Put(aSurround);
+SwFormatFrameSize aSize(SwFrameSize::Fixed, 1000, 1000);
+aFrameSet.Put(aSize);
+SwFormatFollowTextFlow aFlow(true);
+aFrameSet.Put(aFlow);
+Graphic aGrf;
+
+// When inserting that image:
+pWrtShell->SwFEShell::Insert(OUString(), OUString(), &aGrf, &aFrameSet);
+
+// Then make sure that the cell height grows to have space for the 
graphic, given that
+// background=true is not specified.
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+sal_Int32 nCellHeight = getXPath(pXmlDoc, "//cell[1]/infos/bounds", 
"height").toInt32();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected less than: 1000
+// - Actual  : 1120
+// i.e. the cell height was too large, the image influenced it, which is 
not expected.
+CPPUNIT_ASSERT_LESS(static_cast(1000), nCellHeight);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 2cf9b75a62b0..b95f8ca45b25 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -4112,7 +4112,11 @@ tools::Long CalcHeightWithFlys( const SwFrame *pFrame )

[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - desktop/qa

2023-01-19 Thread Caolán McNamara (via logerrit)
 desktop/qa/desktop_lib/test_desktop_lib.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 71fe800c7fb70be83a1b4e3c61de61d7cbd3538e
Author: Caolán McNamara 
AuthorDate: Wed Jan 18 15:07:29 2023 +
Commit: Michael Stahl 
CommitDate: Thu Jan 19 12:12:44 2023 +

don't crash with --disable-pdfium

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

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index e7762753775f..c8fe6e733008 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -687,6 +687,10 @@ void DesktopLOKTest::testSaveAsJsonOptions()
 OString aOptions("{\"PageRange\":{\"type\":\"string\",\"value\":\"2-\"}}");
 CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, 
maTempFile.GetURL().toUtf8().getStr(), "pdf", aOptions.getStr()));
 
+std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get();
+if (!pPDFium)
+return;
+
 // Then make sure the resulting PDF has 2 pages:
 std::unique_ptr pPdfDocument
 = parsePDFExport();


[Libreoffice-commits] core.git: svx/source sw/inc sw/source

2023-01-19 Thread Stephan Bergmann (via logerrit)
 svx/source/form/fmdpage.cxx|2 +-
 sw/inc/unodraw.hxx |1 -
 sw/source/core/unocore/unodraw.cxx |8 
 3 files changed, 1 insertion(+), 10 deletions(-)

New commits:
commit ee8aa3dbaf6c02c9ea1bd7781e5e71847b4e614b
Author: Stephan Bergmann 
AuthorDate: Thu Jan 19 10:45:14 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 19 12:09:34 2023 +

Fix SvxFmDrawPage et al getTypes

The implementation of SxvFmDrawPage::getTypes was presumably forgotten when
e97beb270fd1a5121cdb69ffafd12ea04100e290 "NTEGRATION: CWS xmlperf02" changed
SvxFmDrawPage from supporting XFormsSupplier to supporting XFormsSupplier2
(which derives from XFormsSupplier).

And SwFmDrawPage uses ImplInheritanceHelper to derivefrom SvxFmDrawPage, so
there should be no need to implement SwFmDrawPage::getTypes manually (and
wrongly, at that, in that it included the types of SvxFmDrawPage twice, once
directly via SvxFmDrawPage::getTypes(), and once indirectly via
SwFmDrawPage_Base::getTypes()).

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

diff --git a/svx/source/form/fmdpage.cxx b/svx/source/form/fmdpage.cxx
index 3846d65cda8f..dbf8ccc001aa 100644
--- a/svx/source/form/fmdpage.cxx
+++ b/svx/source/form/fmdpage.cxx
@@ -56,7 +56,7 @@ Any SAL_CALL SvxFmDrawPage::queryAggregation( const 
css::uno::Type& _rType )
 css::uno::Sequence< css::uno::Type > SAL_CALL SvxFmDrawPage::getTypes(  )
 {
 return comphelper::concatSequences(SvxDrawPage::getTypes(),
-css::uno::Sequence { cppu::UnoType::get() 
});
+css::uno::Sequence { cppu::UnoType::get() 
});
 }
 
 rtl::Reference SvxFmDrawPage::CreateSdrObject_( const 
css::uno::Reference< css::drawing::XShape > & xDescr )
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index d7a768317bbf..f9d60f447dd2 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -77,7 +77,6 @@ public:
 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL 
createEnumeration() override;
 
 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType 
) override;
-virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) 
override;
 
 //XIndexAccess
 virtual sal_Int32 SAL_CALL getCount() override;
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index 76355ce44a9e..7541eacd59d4 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -478,14 +478,6 @@ uno::Any SwFmDrawPage::queryInterface( const uno::Type& 
aType )
 return aRet;
 }
 
-uno::Sequence< uno::Type > SwFmDrawPage::getTypes()
-{
-return comphelper::concatSequences(
-SvxFmDrawPage::getTypes(),
-SwFmDrawPage_Base::getTypes(),
-uno::Sequence { cppu::UnoType::get() });
-}
-
 sal_Int32 SwFmDrawPage::getCount()
 {
 SolarMutexGuard aGuard;


[Libreoffice-commits] core.git: unoxml/inc unoxml/source

2023-01-19 Thread Michael Stahl (via logerrit)
 unoxml/inc/node.hxx|3 ++-
 unoxml/source/dom/attr.cxx |2 +-
 unoxml/source/dom/attr.hxx |3 ++-
 unoxml/source/dom/document.cxx |8 +---
 unoxml/source/dom/document.hxx |3 ++-
 unoxml/source/dom/documentfragment.cxx |2 +-
 unoxml/source/dom/documentfragment.hxx |3 ++-
 unoxml/source/dom/element.cxx  |2 +-
 unoxml/source/dom/element.hxx  |3 ++-
 unoxml/source/dom/entity.cxx   |2 +-
 unoxml/source/dom/entity.hxx   |3 ++-
 unoxml/source/dom/entityreference.cxx  |2 +-
 unoxml/source/dom/entityreference.hxx  |3 ++-
 unoxml/source/dom/node.cxx |8 
 14 files changed, 28 insertions(+), 19 deletions(-)

New commits:
commit 9b9bc7461e0513e2bb493e7f00f800b2463751e1
Author: Michael Stahl 
AuthorDate: Wed Jan 18 20:58:47 2023 +0100
Commit: Noel Grandin 
CommitDate: Thu Jan 19 11:28:50 2023 +

tdf#153039 unoxml: replace root element of CDocument throws

XForms replace doesn't work because:

CDocument::IsChildTypeAllowed() tests that the document node does not
already have an element child, because only one is allowed - but when
called from CNode::replaceChild(), the existing child will be removed,
so that needs to be allowed to proceed (check that removed child is
also element).

(regression from commit c5db3b93ee1058bd20ebcde2e757b52b9a67b74a)

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

diff --git a/unoxml/inc/node.hxx b/unoxml/inc/node.hxx
index c4933dbdc234..17e474bf9683 100644
--- a/unoxml/inc/node.hxx
+++ b/unoxml/inc/node.hxx
@@ -134,7 +134,8 @@ namespace DOM
 virtual void fastSaxify( Context& io_rContext );
 
 // constrains child relationship between nodes based on type
-virtual bool IsChildTypeAllowed(css::xml::dom::NodeType const 
nodeType);
+virtual bool IsChildTypeAllowed(css::xml::dom::NodeType nodeType,
+css::xml::dom::NodeType const* pReplacedNodeType);
 
 //  DOM interfaces
 
diff --git a/unoxml/source/dom/attr.cxx b/unoxml/source/dom/attr.cxx
index 1a993e152bd7..4988aa4211ec 100644
--- a/unoxml/source/dom/attr.cxx
+++ b/unoxml/source/dom/attr.cxx
@@ -70,7 +70,7 @@ namespace DOM
 return pNs;
 }
 
-bool CAttr::IsChildTypeAllowed(NodeType const nodeType)
+bool CAttr::IsChildTypeAllowed(NodeType const nodeType, NodeType 
const*const)
 {
 switch (nodeType) {
 case NodeType_TEXT_NODE:
diff --git a/unoxml/source/dom/attr.hxx b/unoxml/source/dom/attr.hxx
index 30c0aa25bb34..f30b25896158 100644
--- a/unoxml/source/dom/attr.hxx
+++ b/unoxml/source/dom/attr.hxx
@@ -52,7 +52,8 @@ namespace DOM
 /// return the libxml namespace corresponding to m_pNamespace on pNode
 xmlNsPtr GetNamespace(xmlNodePtr const pNode);
 
-virtual bool IsChildTypeAllowed(css::xml::dom::NodeType const 
nodeType) override;
+virtual bool IsChildTypeAllowed(css::xml::dom::NodeType const nodeType,
+css::xml::dom::NodeType const*) override;
 
 /**
 Returns the name of this attribute.
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx
index 49c524b5ee99..413f764815e5 100644
--- a/unoxml/source/dom/document.cxx
+++ b/unoxml/source/dom/document.cxx
@@ -291,7 +291,7 @@ namespace DOM
 rContext.mxDocHandler->endDocument();
 }
 
-bool CDocument::IsChildTypeAllowed(NodeType const nodeType)
+bool CDocument::IsChildTypeAllowed(NodeType const nodeType, NodeType 
const*const pReplacedNodeType)
 {
 switch (nodeType) {
 case NodeType_PROCESSING_INSTRUCTION_NODE:
@@ -299,10 +299,12 @@ namespace DOM
 return true;
 case NodeType_ELEMENT_NODE:
  // there may be only one!
-return nullptr == lcl_getDocumentRootPtr(m_aDocPtr);
+return (pReplacedNodeType && *pReplacedNodeType == nodeType)
+|| nullptr == lcl_getDocumentRootPtr(m_aDocPtr);
 case NodeType_DOCUMENT_TYPE_NODE:
  // there may be only one!
-return nullptr == lcl_getDocumentType(m_aDocPtr);
+return (pReplacedNodeType && *pReplacedNodeType == nodeType)
+|| nullptr == lcl_getDocumentType(m_aDocPtr);
 default:
 return false;
 }
diff --git a/unoxml/source/dom/document.hxx b/unoxml/source/dom/document.hxx
index 291535ebf8e5..450b9200f86f 100644
--- a/unoxml/source/dom/document.hxx
+++ b/unoxml/source/dom/document.hxx
@@ -114,7 +114,8 @@ namespace DOM
 
 virtual void fastSaxify( Context& rContext ) override;
 
-virtual bool IsChildTypeAllowed(css::xml::dom::NodeType const 
nodeType) override;
+

[Libreoffice-commits] core.git: sc/source

2023-01-19 Thread Szymon Kłos (via logerrit)
 sc/source/ui/view/gridwin4.cxx |9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

New commits:
commit 451ed0f27716906f2015f0c063f6c4ab3704ee66
Author: Szymon Kłos 
AuthorDate: Tue Jan 10 10:56:18 2023 +0100
Commit: Szymon Kłos 
CommitDate: Thu Jan 19 11:18:01 2023 +

lok: adjust paint rect for in-place editing

This allows to send correct cursor position (at the very end
of the cell) when typing numbers in LOK mode.

This fixes regression from:
commit  9257486636dfe95b73e5690462ba6e8408a12166
lok: sc: render expanded EditEngine when editing in-place

Change-Id: I1f6c7ce3de7a2ba7ccbd4f9f9becd49e352cf05e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145260
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145769
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 07265d4cf23e..5b41a6227b54 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1176,7 +1176,9 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
 // Get top-left offset because of margin and 
indent.
 lcl_GetEditAreaTLOffset(nOffsetX, nOffsetY, 
ScAddress(nCol1, nRow1, nTab), mrViewData, rDoc);
 aEditRect.AdjustLeft(nOffsetX + 1);
+aEditRect.AdjustRight(1);
 aEditRect.AdjustTop(nOffsetY + 1);
+aEditRect.AdjustBottom(1);
 
 // EditView has an 'output area' which is used to 
clip the 'paint area' we provide below.
 // So they need to be in the same 
coordinates/units. This is tied to the mapmode of the gridwin
@@ -1308,13 +1310,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
 // paint the editeng text
 if (bIsTiledRendering)
 {
-tools::Rectangle aEditRect(aBackground);
-tools::Long nOffsetX = 0, nOffsetY = 0;
-// Get top-left offset because of margin and indent.
-lcl_GetEditAreaTLOffset(nOffsetX, nOffsetY, ScAddress(nCol1, 
nRow1, mrViewData.GetTabNo()), mrViewData, rDoc);
-aEditRect.AdjustLeft(nOffsetX + 1);
-aEditRect.AdjustTop(nOffsetY + 1);
-
 // EditView has an 'output area' which is used to clip the paint 
area we provide below.
 // So they need to be in the same coordinates/units. This is tied 
to the mapmode of the gridwin
 // attached to the EditView, so we have to change its mapmode too 
(temporarily). We save the


[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - oox/source sd/qa

2023-01-19 Thread Attila Szűcs (via logerrit)
 oox/source/ppt/slidepersist.cxx   |   72 +-
 sd/qa/unit/data/pptx/tdf153036_resizedConnectorL.pptx |binary
 sd/qa/unit/import-tests.cxx   |   16 
 3 files changed, 68 insertions(+), 20 deletions(-)

New commits:
commit a44ab07e05521b987c842265184240661e330ea4
Author: Attila Szűcs 
AuthorDate: Mon Jan 16 04:13:07 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Jan 19 11:13:11 2023 +

tdf#153036 PPTX import resized connector broken

Fixed the EdgeLine1Delta calculation in case of bentConnector2.
(when L shape imported as a special Z shape)

Co-authored-by: Tibor Nagy (NISZ)
Change-Id: I08c92e63adc744322061e4e433bfdc512745eda1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145548
Tested-by: Jenkins
Reviewed-by: Andras Timar 
(cherry picked from commit 17c68fad2aef917adfdd3d4d651da786e620699c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145728

diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index c875239aac46..ca296561a52f 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -341,6 +341,36 @@ void SlidePersist::hideShapesAsMasterShapes()
 }
 }
 
+// This angle determines in the direction of the line
+static sal_Int32 lcl_GetAngle(uno::Reference& rXShape, 
awt::Point& rPt)
+{
+SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rXShape);
+tools::Rectangle aR(pObj->GetSnapRect());
+sal_Int32 nLeftX = rPt.X - aR.Left();
+sal_Int32 nTopY = rPt.Y - aR.Top();
+sal_Int32 nRightX = aR.Right() - rPt.X;
+sal_Int32 nBottomY = aR.Bottom() - rPt.Y;
+sal_Int32 nX = std::min(nLeftX, nRightX);
+sal_Int32 nY = std::min(nTopY, nBottomY);
+
+sal_Int32 nAngle;
+if (nX < nY)
+{
+if (nLeftX < nRightX)
+nAngle = 180; // Left
+else
+nAngle = 0; // Right
+}
+else
+{
+if (nTopY < nBottomY)
+nAngle = 270; // Top
+else
+nAngle = 90; // Bottom
+}
+return nAngle;
+}
+
 Reference SlidePersist::getAnimationNode(const OUString& sId) 
const
 {
 const auto& pIter = maAnimNodesMap.find(sId);
@@ -372,6 +402,8 @@ static void 
lcl_SetEdgeLineValue(uno::Reference& rXConnector,
 SdrObject* pEndObj = xEndSp.is() ? 
SdrObject::getSdrObjectFromXShape(xEndSp) : nullptr;
 
 sal_Int32 nStartSpLineW = 0;
+sal_Int32 nStartA = -1;
+sal_Int32 nEndA = -1;
 if (pStartObj)
 {
 aStartRect = pStartObj->GetSnapRect();
@@ -379,6 +411,7 @@ static void 
lcl_SetEdgeLineValue(uno::Reference& rXConnector,
 xPropxStartSp->getPropertyValue("LineWidth") >>= nStartSpLineW;
 if (nStartSpLineW)
 nStartSpLineW = nStartSpLineW / 2;
+nStartA = lcl_GetAngle(xStartSp, aStartPt);
 }
 sal_Int32 nEndSpLineW = 0;
 if (pEndObj)
@@ -388,6 +421,7 @@ static void 
lcl_SetEdgeLineValue(uno::Reference& rXConnector,
 xPropxEndSp->getPropertyValue("LineWidth") >>= nEndSpLineW;
 if (nEndSpLineW)
 nEndSpLineW = nEndSpLineW / 2;
+nEndA = lcl_GetAngle(xEndSp, aEndPt);
 }
 
 const OUString sConnectorName = rShapePtr->getConnectorName();
@@ -396,27 +430,25 @@ static void 
lcl_SetEdgeLineValue(uno::Reference& rXConnector,
 awt::Size aConnSize = rXConnector->getSize();
 if (xStartSp.is() || xEndSp.is())
 {
-if (aConnSize.Height < aConnSize.Width)
+if (nStartA >= 0)
 {
-if (xStartSp.is())
-nEdge = (aStartPt.Y > aEndPt.Y)
-? (nStartSpLineW - (aStartRect.Top() - 
aEndPt.Y))
-: ((aEndPt.Y - aStartRect.Bottom()) - 
nStartSpLineW);
-else
-nEdge = (aStartPt.Y > aEndPt.Y)
-? ((aStartPt.Y - aEndRect.Bottom()) - 
nEndSpLineW)
-: (nEndSpLineW - (aEndRect.Top() - 
aStartPt.Y));
-}
-else
-{
-if (xStartSp.is())
-nEdge = (aStartPt.X > aEndPt.X)
-? (nStartSpLineW - (aStartRect.Left() - 
aEndPt.X))
-: ((aEndPt.X - aStartRect.Right()) - 
nStartSpLineW);
-else
-nEdge = (aStartPt.X > aEndPt.X)
-? ((aStartPt.X - aEndRect.Right()) - 
nEndSpLineW)
-: (nEndSpLineW - (aEndRect.Left() - 
aStartPt.X));
+switch (nStartA)
+{
+case 0: nEdge = aEndPt.X - aStartRect.Right();  break;
+case 180:   nEdge = aEndPt.X - aStartRect.Left();   break;
+case 90:nEdge = aEndPt.Y - aStartRect.Bottom(); break;
+case 270:   nEdge = aEndPt.Y - aStartRect.Top();break;
+  

[Libreoffice-commits] core.git: sw/inc sw/source

2023-01-19 Thread Noel Grandin (via logerrit)
 sw/inc/unoframe.hxx  |   11 +--
 sw/inc/unotbl.hxx|7 +--
 sw/inc/unotext.hxx   |8 
 sw/source/core/inc/unofootnote.hxx   |   10 +-
 sw/source/core/unocore/unocrsrhelper.cxx |6 ++
 sw/source/core/unocore/unodraw.cxx   |4 ++--
 sw/source/core/unocore/unoframe.cxx  |   23 +--
 sw/source/core/unocore/unoftn.cxx|   13 -
 sw/source/core/unocore/unoobj.cxx|2 +-
 sw/source/core/unocore/unoobj2.cxx   |2 +-
 sw/source/core/unocore/unotbl.cxx|   11 ---
 sw/source/core/unocore/unotext.cxx   |   26 +-
 sw/source/filter/xml/xmlexp.cxx  |4 +---
 sw/source/filter/xml/xmlimp.cxx  |4 +---
 sw/source/filter/xml/xmltexte.cxx|4 +---
 sw/source/filter/xml/xmltexti.cxx|4 +---
 sw/source/uibase/uno/unoatxt.cxx |4 ++--
 17 files changed, 17 insertions(+), 126 deletions(-)

New commits:
commit 4dac12efdce4f5cd83fd78a901186c68f020b7fa
Author: Noel Grandin 
AuthorDate: Wed Jan 18 10:40:34 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 19 10:44:06 2023 +

XUnoTunnel->dynamic_cast for SwXFrame

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

diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx
index e87cb87e0675..7c62cc7ba2a5 100644
--- a/sw/inc/unoframe.hxx
+++ b/sw/inc/unoframe.hxx
@@ -45,10 +45,9 @@ class SfxItemPropertySet;
 namespace com::sun::star::frame { class XModel; }
 
 class BaseFrameProperties_Impl;
-class SAL_DLLPUBLIC_RTTI SwXFrame : public cppu::WeakImplHelper
+class SAL_DLLPUBLIC_RTTI SAL_LOPLUGIN_ANNOTATE("crosscast") SwXFrame : public 
cppu::WeakImplHelper
 <
 css::lang::XServiceInfo,
-css::lang::XUnoTunnel,
 css::beans::XPropertySet,
 css::beans::XPropertyState,
 css::drawing::XShape,
@@ -97,11 +96,6 @@ protected:
 CreateXFrame(SwDoc & rDoc, SwFrameFormat *const pFrameFormat);
 
 public:
-static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
-
-//XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
-
 
 //XNamed
 virtual OUString SAL_CALL getName() override;
@@ -234,9 +228,6 @@ public:
 // XEventsSupplier
 virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL 
getEvents(  ) override;
 
-//XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
-
 //XPropertySet
 virtual SW_DLLPUBLIC css::uno::Any SAL_CALL getPropertyValue( const 
OUString& PropertyName ) override;
 using SwXFrame::setPropertyValue;
diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index 160d29290d8d..4bd7e2efe118 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -20,6 +20,7 @@
 #ifndef INCLUDED_SW_INC_UNOTBL_HXX
 #define INCLUDED_SW_INC_UNOTBL_HXX
 
+#include 
 #include 
 #include 
 #include 
@@ -89,12 +90,6 @@ public:
 SwXCell(SwFrameFormat* pTableFormat, SwTableBox* pBox, size_t nPos);
 SwXCell(SwFrameFormat* pTableFormat, const SwStartNode& rStartNode); // 
XML import interface
 
-
-static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
-
-//XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
-
 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType 
) override;
 virtual void SAL_CALL acquire(  ) noexcept override;
 virtual void SAL_CALL release(  ) noexcept override;
diff --git a/sw/inc/unotext.hxx b/sw/inc/unotext.hxx
index 8bc221b7fa63..ddd16012d225 100644
--- a/sw/inc/unotext.hxx
+++ b/sw/inc/unotext.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_SW_INC_UNOTEXT_HXX
 #define INCLUDED_SW_INC_UNOTEXT_HXX
 
-#include 
 #include 
 #include 
 #include 
@@ -44,7 +43,6 @@ class SwPaM;
 
 class SAL_DLLPUBLIC_RTTI SwXText
 : public css::lang::XTypeProvider
-, public css::lang::XUnoTunnel
 , public css::beans::XPropertySet
 , public css::text::XTextAppendAndConvert
 , public css::text::XTextCopy
@@ -96,12 +94,6 @@ public:
 virtual css::uno::Sequence< css::uno::Type >
 SAL_CALL getTypes() override;
 
-static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
-
-// XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething(
-const css::uno::Sequence< sal_Int8 >& rIdentifier) override;
-
 // XPropertySet
 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
 getPropertySetInfo() override;
diff --git a/sw/source/core/inc/unofootnote.hxx 
b/sw/source/core/inc/unofootnote.hxx
index 0303ee12335b..b10a3555674c 100644
--- a/sw/source/core/inc/unofootnote.hxx
+++ b/sw/source/core/inc/unofootnote.hxx
@@

[Libreoffice-commits] core.git: forms/source

2023-01-19 Thread Caolán McNamara (via logerrit)
 forms/source/xforms/model.cxx|2 +-
 forms/source/xforms/model_helper.hxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c6668bf7f87bb50ee5d795f17a67666018931b9a
Author: Caolán McNamara 
AuthorDate: Thu Jan 19 09:03:01 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 19 10:33:16 2023 +

cid#1520418 Unchecked dynamic_cast

and

cid#1520419 Unchecked dynamic_cast
cid#1520420 Unchecked dynamic_cast

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

diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx
index 0bab14a61cc8..0cab2350385e 100644
--- a/forms/source/xforms/model.cxx
+++ b/forms/source/xforms/model.cxx
@@ -428,7 +428,7 @@ void SAL_CALL Model::submitWithInteraction(
 {
 Submission* pSubmission =
 dynamic_cast( mxSubmissions->getItem( sID ).get() );
-OSL_ENSURE( pSubmission != nullptr, "no submission?" );
+assert(pSubmission && "no submission?");
 OSL_ENSURE( pSubmission->getModelImpl() == this,
 "wrong model" );
 
diff --git a/forms/source/xforms/model_helper.hxx 
b/forms/source/xforms/model_helper.hxx
index 0ec03591bc0a..ae8d78da7c0d 100644
--- a/forms/source/xforms/model_helper.hxx
+++ b/forms/source/xforms/model_helper.hxx
@@ -91,14 +91,14 @@ protected:
 virtual void _insert( const T& t ) override
 {
 auto pSubmission = dynamic_cast( t.get() );
-OSL_ENSURE( pSubmission != nullptr, "invalid item?" );
+assert(pSubmission && "invalid item?");
 pSubmission->setModel( mpModel );
 }
 
 virtual void _remove( const T& t ) override
 {
 auto pSubmission = dynamic_cast( t.get() );
-OSL_ENSURE( pSubmission != nullptr, "invalid item?" );
+assert(pSubmission && "invalid item?");
 pSubmission->setModel( nullptr );
 }
 };


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - bin/gen-boost-headers external/boost

2023-01-19 Thread Stephan Bergmann (via logerrit)
 bin/gen-boost-headers  |1 +
 external/boost/include/boost/algorithm/string.hpp  |1 +
 external/boost/include/boost/algorithm/string/predicate.hpp|1 +
 external/boost/include/boost/archive/iterators/base64_from_binary.hpp  |1 +
 external/boost/include/boost/archive/iterators/binary_from_base64.hpp  |1 +
 external/boost/include/boost/archive/iterators/remove_whitespace.hpp   |1 +
 external/boost/include/boost/archive/iterators/transform_width.hpp |1 +
 external/boost/include/boost/bind.hpp  |1 +
 external/boost/include/boost/cast.hpp  |1 +
 external/boost/include/boost/circular_buffer.hpp   |1 +
 external/boost/include/boost/cstdint.hpp   |1 +
 external/boost/include/boost/current_function.hpp  |1 +
 external/boost/include/boost/date_time.hpp |1 +
 external/boost/include/boost/date_time/posix_time/posix_time.hpp   |1 +
 external/boost/include/boost/filesystem.hpp|1 +
 external/boost/include/boost/filesystem/path.hpp   |1 +
 external/boost/include/boost/functional/hash.hpp   |1 +
 external/boost/include/boost/fusion/adapted/std_pair.hpp   |1 +
 external/boost/include/boost/fusion/include/adapt_struct.hpp   |1 +
 external/boost/include/boost/intrusive/circular_list_algorithms.hpp|1 +
 external/boost/include/boost/intrusive_ptr.hpp |1 +
 external/boost/include/boost/io/ios_state.hpp  |1 +
 external/boost/include/boost/iostreams/filter/gzip.hpp |1 +
 external/boost/include/boost/iostreams/filtering_stream.hpp|1 +
 external/boost/include/boost/iterator/iterator_facade.hpp  |1 +
 external/boost/include/boost/lexical_cast.hpp  |1 +
 external/boost/include/boost/locale.hpp|1 +
 external/boost/include/boost/locale/gnu_gettext.hpp|1 +
 external/boost/include/boost/make_shared.hpp   |1 +
 external/boost/include/boost/math/common_factor_rt.hpp |1 +
 external/boost/include/boost/math/special_functions/expm1.hpp  |1 +
 external/boost/include/boost/math/special_functions/sinc.hpp   |1 +
 external/boost/include/boost/multi_array.hpp   |1 +
 external/boost/include/boost/multi_index/composite_key.hpp |1 +
 external/boost/include/boost/multi_index/identity.hpp  |1 +
 external/boost/include/boost/multi_index/mem_fun.hpp   |1 +
 external/boost/include/boost/multi_index/ordered_index.hpp |1 +
 external/boost/include/boost/multi_index/random_access_index.hpp   |1 +
 external/boost/include/boost/multi_index_container.hpp |1 +
 external/boost/include/boost/noncopyable.hpp   |1 +
 external/boost/include/boost/none.hpp  |1 +
 external/boost/include/boost/numeric/conversion/cast.hpp   |1 +
 external/boost/include/boost/operators.hpp |1 +
 external/boost/include/boost/optional.hpp  |1 +
 external/boost/include/boost/program_options.hpp   |1 +
 external/boost/include/boost/property_tree/json_parser.hpp |1 +
 external/boost/include/boost/property_tree/ptree.hpp   |1 +
 external/boost/include/boost/property_tree/ptree_fwd.hpp   |1 +
 external/boost/include/boost/range/adaptor/reversed.hpp|1 +
 external/boost/include/boost/range/iterator_range.hpp  |1 +
 external/boost/include/boost/rational.hpp  |1 +
 external/boost/include/boost/scoped_ptr.hpp|1 +
 external/boost/include/boost/shared_ptr.hpp|1 +
 external/boost/include/boost/spirit/include/classic.hpp|1 +
 external/boost/include/boost/spirit/include/classic_core.hpp   |1 +
 external/boost/include/boost/spirit/include/classic_error_handling.hpp |1 +
 external/boost/include/boost/spirit/include/classic_file_iterator.hpp  |1 +
 external/boost/include/boost/spirit/include/classic_utility.hpp|1 +
 external/boost/include/boost/spirit/include/phoenix.hpp|1 +
 external/boost/include/boost/spirit/include/qi.hpp |1 +
 external/boost/include/boost/spirit/include/qi_attr.hpp|1 +
 external/boost/include/boost/spirit/include/qi_lit.hpp   

[Libreoffice-commits] core.git: toolkit/inc toolkit/source

2023-01-19 Thread Stephan Bergmann (via logerrit)
 toolkit/inc/controls/roadmapcontrol.hxx  |4 +++-
 toolkit/source/controls/grid/gridcontrol.hxx |4 ++--
 toolkit/source/controls/roadmapcontrol.cxx   |9 -
 toolkit/source/controls/tree/treecontrol.cxx |4 ++--
 4 files changed, 15 insertions(+), 6 deletions(-)

New commits:
commit 579d144290c1617fdb38d09b30900a6bbe390b8d
Author: Stephan Bergmann 
AuthorDate: Thu Jan 19 09:42:08 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 19 09:53:24 2023 +

Fix some toolkit UnoControlBase derivates' queryAggregation

The base UnoControl uses WeakAggImplHelper9, so (for better or worse) 
derives
from XAggregation, but UnoGridControl, UnoRoadmapControl, and 
UnoTreeControl all
failed to properly implement the XAggregation protocol.

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

diff --git a/toolkit/inc/controls/roadmapcontrol.hxx 
b/toolkit/inc/controls/roadmapcontrol.hxx
index 2a4a1021e0ad..cfc7fbdb9c74 100644
--- a/toolkit/inc/controls/roadmapcontrol.hxx
+++ b/toolkit/inc/controls/roadmapcontrol.hxx
@@ -168,7 +168,9 @@ namespace toolkit
 
 // XTypeProvider
 DECLARE_XTYPEPROVIDER( )
-DECLARE_XINTERFACE()
+DECLARE_UNO3_AGG_DEFAULTS(UnoRoadmapControl, UnoControlRoadmap_Base)
+
+css::uno::Any SAL_CALL queryAggregation(css::uno::Type const & aType) 
override;
 
 // css::lang::XServiceInfo
 OUString SAL_CALL getImplementationName() override;
diff --git a/toolkit/source/controls/grid/gridcontrol.hxx 
b/toolkit/source/controls/grid/gridcontrol.hxx
index 6b4f8152bbd0..435ff2fab089 100644
--- a/toolkit/source/controls/grid/gridcontrol.hxx
+++ b/toolkit/source/controls/grid/gridcontrol.hxx
@@ -25,7 +25,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include 
@@ -78,7 +78,7 @@ public:
 
 // = UnoGridControl
 
-typedef ::cppu::ImplInheritanceHelper  <   UnoControlBase
+typedef ::cppu::AggImplInheritanceHelper2  <   UnoControlBase
 ,   css::awt::grid::XGridControl
 ,   css::awt::grid::XGridRowSelection
 >   UnoGridControl_Base;
diff --git a/toolkit/source/controls/roadmapcontrol.cxx 
b/toolkit/source/controls/roadmapcontrol.cxx
index 2640dc6b5b67..84d49a78f48b 100644
--- a/toolkit/source/controls/roadmapcontrol.cxx
+++ b/toolkit/source/controls/roadmapcontrol.cxx
@@ -362,7 +362,14 @@ static void lcl_throwIndexOutOfBoundsException( )
 }
 
 IMPLEMENT_FORWARD_XTYPEPROVIDER2( UnoRoadmapControl, UnoControlRoadmap_Base, 
UnoControlRoadmap_IBase )
-IMPLEMENT_FORWARD_XINTERFACE2( UnoRoadmapControl, UnoControlRoadmap_Base, 
UnoControlRoadmap_IBase )
+
+css::uno::Any UnoRoadmapControl::queryAggregation(css::uno::Type const & 
aType) {
+auto ret = UnoControlRoadmap_Base::queryAggregation(aType);
+if (!ret.hasValue()) {
+ret = UnoControlRoadmap_IBase::queryInterface(aType);
+}
+return ret;
+}
 
 
 sal_Bool SAL_CALL UnoRoadmapControl::setModel(const Reference< XControlModel 
>& _rModel)
diff --git a/toolkit/source/controls/tree/treecontrol.cxx 
b/toolkit/source/controls/tree/treecontrol.cxx
index d4439a4ff1e3..43d353079f43 100644
--- a/toolkit/source/controls/tree/treecontrol.cxx
+++ b/toolkit/source/controls/tree/treecontrol.cxx
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 
@@ -120,7 +120,7 @@ Reference< XPropertySetInfo > 
UnoTreeModel::getPropertySetInfo(  )
 
 namespace {
 
-typedef ::cppu::ImplInheritanceHelper< UnoControlBase, 
css::awt::tree::XTreeControl > UnoTreeControl_Base;
+typedef ::cppu::AggImplInheritanceHelper1< UnoControlBase, 
css::awt::tree::XTreeControl > UnoTreeControl_Base;
 class UnoTreeControl : public UnoTreeControl_Base
 {
 public:


[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - svx/source

2023-01-19 Thread Caolán McNamara (via logerrit)
 svx/source/dialog/fntctrl.cxx |   17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

New commits:
commit fa62e63d6b75aac80dd23520351de11c5a0c9ea4
Author: Caolán McNamara 
AuthorDate: Wed Jan 18 21:19:26 2023 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Jan 19 09:51:08 2023 +

tdf#153088 format cells example text black on dark background

with application colors, scheme: LibreOffice Dark enabled

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

diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index de39993061fd..255d8ab8d9d9 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -475,8 +475,12 @@ static void SetPrevFontEscapement(SvxFont& rFont, 
sal_uInt8 nProp, sal_uInt8 nEs
 
 void SvxFontPrevWindow::ApplySettings(vcl::RenderContext& rRenderContext)
 {
-rRenderContext.SetTextColor( 
svtools::ColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
-rRenderContext.SetBackground( 
svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor );
+Color aBgColor = 
svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+Color aFgColor = svtools::ColorConfig().GetColorValue(svtools::FONTCOLOR, 
false).nColor;
+if (aFgColor == COL_AUTO)
+aFgColor = aBgColor.IsDark() ? COL_WHITE : COL_BLACK;
+rRenderContext.SetBackground(aBgColor);
+rRenderContext.SetTextColor(aFgColor);
 }
 
 void SvxFontPrevWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea)
@@ -583,6 +587,7 @@ void SvxFontPrevWindow::Paint(vcl::RenderContext& 
rRenderContext, const tools::R
 rRenderContext.SetMapMode(MapMode(MapUnit::MapTwip));
 
 ApplySettings(rRenderContext);
+rRenderContext.Erase();
 
 Printer* pPrinter = pImpl->mpPrinter;
 const SvxFont& rFont = pImpl->maFont;
@@ -985,8 +990,12 @@ void SvxFontPrevWindow::SetFromItemSet(const SfxItemSet 
&rSet, bool bPreviewBack
 if( GetWhich( rSet, SID_ATTR_BRUSH, nWhich ) )
 {
 const SvxBrushItem& rBrush = static_cast( 
rSet.Get( nWhich ) );
-if( GPOS_NONE == rBrush.GetGraphicPos() )
-pImpl->mxBackColor = rBrush.GetColor();
+if (GPOS_NONE == rBrush.GetGraphicPos())
+{
+const Color& rBrushColor = rBrush.GetColor();
+if (rBrushColor != COL_TRANSPARENT)
+pImpl->mxBackColor = rBrush.GetColor();
+}
 }
 }
 


[Libreoffice-commits] core.git: sd/source

2023-01-19 Thread Stephan Bergmann (via logerrit)
 sd/source/ui/inc/unopage.hxx|6 ++
 sd/source/ui/unoidl/unopage.cxx |   18 +++---
 2 files changed, 21 insertions(+), 3 deletions(-)

New commits:
commit ede696562a38a8ffe5c27b397108ee1f59716ae3
Author: Stephan Bergmann 
AuthorDate: Thu Jan 19 08:41:32 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 19 09:38:57 2023 +

Fix SdGenericDrawPage et al queryAggregation

The base SvxDrawPage uses WeakAggImplHelper7, so (for better or worse) 
derives
from XAggregation, but SdGenericDrawPage and its derived classes 
(SdDrawPage,
SdMasterPage) failed to properly implement the XAggregation protocol.

When fixing this, it became apparent that SdGenericDrawPage::queryInterface 
had
erroneously delegated to SvxDrawPage::queryInterface rather than to the
intermediary SvxFmDrawPage::queryInterface, so that querying for e.g.
XFormsSupplier had only worked by accident:  
SdGenericDrawPage::queryInterface
didn't support it, so delegated to SvxDrawPage::queryInterface, which didn't
support it, so delegated to WeakAggImplHelper7::queryInterface, which didn't
support it, so delegated to OWeakAggObject::queryInterface, which (as there 
was
no delegator set) delegated to the most derived 
SvxFmDrawPage::queryAggregation,
which supports it.

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

diff --git a/sd/source/ui/inc/unopage.hxx b/sd/source/ui/inc/unopage.hxx
index 1eb3cb6d83b1..b6a6f0d6d9b6 100644
--- a/sd/source/ui/inc/unopage.hxx
+++ b/sd/source/ui/inc/unopage.hxx
@@ -112,6 +112,8 @@ public:
 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & 
rType ) override;
 virtual void SAL_CALL release() noexcept override;
 
+css::uno::Any SAL_CALL queryAggregation(css::uno::Type const & rType) 
override;
+
 // XShapeCombiner
 virtual css::uno::Reference< css::drawing::XShape > SAL_CALL combine( 
const css::uno::Reference< css::drawing::XShapes >& xShapes ) override;
 virtual void SAL_CALL split( const css::uno::Reference< 
css::drawing::XShape >& xGroup ) override;
@@ -179,6 +181,8 @@ public:
 virtual void SAL_CALL acquire() noexcept override;
 virtual void SAL_CALL release() noexcept override;
 
+css::uno::Any SAL_CALL queryAggregation(css::uno::Type const & rType) 
override;
+
 // XTypeProvider
 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() 
override;
@@ -236,6 +240,8 @@ public:
 virtual void SAL_CALL acquire() noexcept override;
 virtual void SAL_CALL release() noexcept override;
 
+css::uno::Any SAL_CALL queryAggregation(css::uno::Type const & rType) 
override;
+
 // XTypeProvider
 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() 
override;
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 4831b29bb53d..ae05e5ce79ed 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -509,6 +509,10 @@ rtl::Reference 
SdGenericDrawPage::CreateSdrObject_( const Reference<
 // XInterface
 Any SAL_CALL SdGenericDrawPage::queryInterface( const uno::Type & rType )
 {
+return SvxFmDrawPage::queryInterface(rType);
+}
+
+css::uno::Any SdGenericDrawPage::queryAggregation(css::uno::Type const & 
rType) {
 Any aAny;
 
 if (rType == cppu::UnoType::get())
@@ -555,7 +559,7 @@ Any SAL_CALL SdGenericDrawPage::queryInterface( const 
uno::Type & rType )
 return Any( Reference< XAnimationNodeSupplier >( this ) );
 }
 else
-return SvxDrawPage::queryInterface( rType );
+return SvxFmDrawPage::queryAggregation( rType );
 
 return aAny;
 }
@@ -2041,6 +2045,10 @@ SdDrawPage::~SdDrawPage() noexcept
 // XInterface
 Any SAL_CALL SdDrawPage::queryInterface( const uno::Type & rType )
 {
+return SdGenericDrawPage::queryInterface(rType);
+}
+
+css::uno::Any SdDrawPage::queryAggregation(css::uno::Type const & rType) {
 if( rType == cppu::UnoType::get() )
 {
 return Any( Reference< drawing::XMasterPageTarget >( this ) );
@@ -2055,7 +2063,7 @@ Any SAL_CALL SdDrawPage::queryInterface( const uno::Type 
& rType )
 }
 }
 
-return SdGenericDrawPage::queryInterface( rType );
+return SdGenericDrawPage::queryAggregation( rType );
 }
 
 void SAL_CALL SdDrawPage::acquire() noexcept
@@ -2638,6 +2646,10 @@ SdMasterPage::~SdMasterPage() noexcept
 // XInterface
 Any SAL_CALL SdMasterPage::queryInterface( const uno::Type & rType )
 {
+return SdGenericDrawPage::queryInterface(rType);
+}
+
+css::uno::Any SdMasterPage::queryAggregation(css::uno::Type const & rType) {
 ::SolarMutexGuard aGuard;
 
 throwIfDisposed()

[Libreoffice-commits] core.git: sw/qa sw/source

2023-01-19 Thread Miklos Vajna (via logerrit)
 sw/qa/uibase/shells/textfld.cxx |   29 +
 sw/source/uibase/shells/textfld.cxx |8 ++--
 2 files changed, 35 insertions(+), 2 deletions(-)

New commits:
commit 04d988d3c368fe07ae3c44c536a4513e424f104e
Author: Miklos Vajna 
AuthorDate: Thu Jan 19 08:19:46 2023 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 19 08:56:55 2023 +

sw, .uno:InsertField: handle Endnote as a value for the Wrapper parameter

This is similar to commit 43d80906c8693ca27c5b3077fbaa259df4004924 (sw:
.uno:TextFormField: handle Endnote as a value for the Wrapper parameter,
2023-01-17), but that was for fieldmarks & endnotes, this is for
refmarks & endnotes.

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

diff --git a/sw/qa/uibase/shells/textfld.cxx b/sw/qa/uibase/shells/textfld.cxx
index ef4da3aa65b1..6f9fa0c1c2f6 100644
--- a/sw/qa/uibase/shells/textfld.cxx
+++ b/sw/qa/uibase/shells/textfld.cxx
@@ -58,4 +58,33 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertRefmarkFootnote)
 CPPUNIT_ASSERT_EQUAL(OUString("content"), 
rFormatNote.GetFootnoteText(*pWrtShell->GetLayout()));
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testInsertRefmarkEndnote)
+{
+// Given an empty document:
+createSwDoc();
+
+// When inserting a refmark inside an endnote:
+uno::Sequence aArgs = {
+comphelper::makePropertyValue("TypeName", 
uno::Any(OUString("SetRef"))),
+comphelper::makePropertyValue("Name", uno::Any(OUString("myref"))),
+comphelper::makePropertyValue("Content", 
uno::Any(OUString("content"))),
+comphelper::makePropertyValue("Wrapper", 
uno::Any(OUString("Endnote"))),
+};
+dispatchCommand(mxComponent, ".uno:InsertField", aArgs);
+
+// Then make sure that the note body contains the refmark:
+SwDoc* pDoc = getSwDoc();
+SwFootnoteIdxs& rNotes = pDoc->GetFootnoteIdxs();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// i.e. no endnote was inserted.
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rNotes.size());
+SwTextFootnote* pNote = rNotes[0];
+const SwFormatFootnote& rNote = pNote->GetFootnote();
+CPPUNIT_ASSERT(rNote.IsEndNote());
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+CPPUNIT_ASSERT_EQUAL(OUString("content"), 
rNote.GetFootnoteText(*pWrtShell->GetLayout()));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index 6c4fa4297c46..a70d3c248c7d 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -301,13 +301,17 @@ void SwTextShell::ExecField(SfxRequest &rReq)
 }
 if (pArgs->GetItemState(FN_PARAM_5, false, &pItem) == 
SfxItemState::SET)
 {
+// Wrap the field in the requested container instead of 
inserting it
+// directly at the cursor position.
 const OUString& rWrapper = static_cast(pItem)->GetValue();
 if (rWrapper == "Footnote")
 {
-// Wrap the field in the requested container instead 
of inserting it
-// directly at the cursor position.
 GetShellPtr()->InsertFootnote(OUString());
 }
+else if (rWrapper == "Endnote")
+{
+GetShellPtr()->InsertFootnote(OUString(), 
/*bEndNote=*/true);
+}
 }
 SwInsertField_Data aData(nType, nSubType, aPar1, aPar2, 
nFormat, GetShellPtr(), cSeparator );
 bRes = aFieldMgr.InsertField( aData );


[Libreoffice-commits] core.git: oox/source sd/qa

2023-01-19 Thread Attila Szűcs (via logerrit)
 oox/source/ppt/slidepersist.cxx   |   72 +-
 sd/qa/unit/data/pptx/tdf153036_resizedConnectorL.pptx |binary
 sd/qa/unit/import-tests.cxx   |   16 
 3 files changed, 68 insertions(+), 20 deletions(-)

New commits:
commit 17c68fad2aef917adfdd3d4d651da786e620699c
Author: Attila Szűcs 
AuthorDate: Mon Jan 16 04:13:07 2023 +0100
Commit: Andras Timar 
CommitDate: Thu Jan 19 08:27:39 2023 +

tdf#153036 PPTX import resized connector broken

Fixed the EdgeLine1Delta calculation in case of bentConnector2.
(when L shape imported as a special Z shape)

Co-authored-by: Tibor Nagy (NISZ)
Change-Id: I08c92e63adc744322061e4e433bfdc512745eda1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145548
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index c875239aac46..ca296561a52f 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -341,6 +341,36 @@ void SlidePersist::hideShapesAsMasterShapes()
 }
 }
 
+// This angle determines in the direction of the line
+static sal_Int32 lcl_GetAngle(uno::Reference& rXShape, 
awt::Point& rPt)
+{
+SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rXShape);
+tools::Rectangle aR(pObj->GetSnapRect());
+sal_Int32 nLeftX = rPt.X - aR.Left();
+sal_Int32 nTopY = rPt.Y - aR.Top();
+sal_Int32 nRightX = aR.Right() - rPt.X;
+sal_Int32 nBottomY = aR.Bottom() - rPt.Y;
+sal_Int32 nX = std::min(nLeftX, nRightX);
+sal_Int32 nY = std::min(nTopY, nBottomY);
+
+sal_Int32 nAngle;
+if (nX < nY)
+{
+if (nLeftX < nRightX)
+nAngle = 180; // Left
+else
+nAngle = 0; // Right
+}
+else
+{
+if (nTopY < nBottomY)
+nAngle = 270; // Top
+else
+nAngle = 90; // Bottom
+}
+return nAngle;
+}
+
 Reference SlidePersist::getAnimationNode(const OUString& sId) 
const
 {
 const auto& pIter = maAnimNodesMap.find(sId);
@@ -372,6 +402,8 @@ static void 
lcl_SetEdgeLineValue(uno::Reference& rXConnector,
 SdrObject* pEndObj = xEndSp.is() ? 
SdrObject::getSdrObjectFromXShape(xEndSp) : nullptr;
 
 sal_Int32 nStartSpLineW = 0;
+sal_Int32 nStartA = -1;
+sal_Int32 nEndA = -1;
 if (pStartObj)
 {
 aStartRect = pStartObj->GetSnapRect();
@@ -379,6 +411,7 @@ static void 
lcl_SetEdgeLineValue(uno::Reference& rXConnector,
 xPropxStartSp->getPropertyValue("LineWidth") >>= nStartSpLineW;
 if (nStartSpLineW)
 nStartSpLineW = nStartSpLineW / 2;
+nStartA = lcl_GetAngle(xStartSp, aStartPt);
 }
 sal_Int32 nEndSpLineW = 0;
 if (pEndObj)
@@ -388,6 +421,7 @@ static void 
lcl_SetEdgeLineValue(uno::Reference& rXConnector,
 xPropxEndSp->getPropertyValue("LineWidth") >>= nEndSpLineW;
 if (nEndSpLineW)
 nEndSpLineW = nEndSpLineW / 2;
+nEndA = lcl_GetAngle(xEndSp, aEndPt);
 }
 
 const OUString sConnectorName = rShapePtr->getConnectorName();
@@ -396,27 +430,25 @@ static void 
lcl_SetEdgeLineValue(uno::Reference& rXConnector,
 awt::Size aConnSize = rXConnector->getSize();
 if (xStartSp.is() || xEndSp.is())
 {
-if (aConnSize.Height < aConnSize.Width)
+if (nStartA >= 0)
 {
-if (xStartSp.is())
-nEdge = (aStartPt.Y > aEndPt.Y)
-? (nStartSpLineW - (aStartRect.Top() - 
aEndPt.Y))
-: ((aEndPt.Y - aStartRect.Bottom()) - 
nStartSpLineW);
-else
-nEdge = (aStartPt.Y > aEndPt.Y)
-? ((aStartPt.Y - aEndRect.Bottom()) - 
nEndSpLineW)
-: (nEndSpLineW - (aEndRect.Top() - 
aStartPt.Y));
-}
-else
-{
-if (xStartSp.is())
-nEdge = (aStartPt.X > aEndPt.X)
-? (nStartSpLineW - (aStartRect.Left() - 
aEndPt.X))
-: ((aEndPt.X - aStartRect.Right()) - 
nStartSpLineW);
-else
-nEdge = (aStartPt.X > aEndPt.X)
-? ((aStartPt.X - aEndRect.Right()) - 
nEndSpLineW)
-: (nEndSpLineW - (aEndRect.Left() - 
aStartPt.X));
+switch (nStartA)
+{
+case 0: nEdge = aEndPt.X - aStartRect.Right();  break;
+case 180:   nEdge = aEndPt.X - aStartRect.Left();   break;
+case 90:nEdge = aEndPt.Y - aStartRect.Bottom(); break;
+case 270:   nEdge = aEndPt.Y - aStartRect.Top();break;
+}
+nEdge += nStartSpLineW * (nStartA >= 180 ? +1 : -1);
+} else {
+switch (nEn

[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sc/source

2023-01-19 Thread Eike Rathke (via logerrit)
 sc/source/ui/miscdlgs/acredlin.cxx |   96 +++--
 1 file changed, 39 insertions(+), 57 deletions(-)

New commits:
commit 138c6f1d1371f89e379f1a58b38ef8a60d63077e
Author: Eike Rathke 
AuthorDate: Wed Jan 18 18:40:50 2023 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Jan 19 08:24:39 2023 +

Resolves: tdf#153096 Split change track content action into columns again

Old SvTreeList did split a string on embedded \t Tab characters,
the new weld::TreeView does not but needs column text set
explicitly.

Regression from

commit 56dd851cfc77c362c3db5c0aae4a490c7f6782cc
CommitDate: Sat Apr 27 12:41:14 2019 +0200

weld cluster of change tracking dialogs

that did the necessary changes for
ScAcceptChgDlg::AppendFilteredAction() but not for
ScAcceptChgDlg::AppendChangeAction() and
ScAcceptChgDlg::InsertChangeActionContent().

Odd that no one reported this in all the time..

Additionally, the "Changed contents" label being used instead of
"Row inserted"/"Column inserted"/"Row deleted"/"Column deleted" as
soon as cell content change is present depending on such action,
was a copypasta fallout from

commit e7c76b30bd2ef802ce08f8739eac186253c79696
CommitDate: Mon Aug 29 17:21:12 2011 -0400

String to rtl::OUString.

Change-Id: I855c527da61723c104c743e3b3f159fb026917df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145749
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit fc441f3886330c4ae2abeb67c0758b935ba23f47)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145725
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/miscdlgs/acredlin.cxx 
b/sc/source/ui/miscdlgs/acredlin.cxx
index d1427a8a3c28..87292fe06c1e 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -369,12 +369,13 @@ std::unique_ptr 
ScAcceptChgDlg::AppendChangeAction(
 bool bFlag = false;
 
 ScRange aRef=pScChangeAction->GetBigRange().MakeRange(*pDoc);
-OUString aUser=pScChangeAction->GetUser();
 DateTime aDateTime=pScChangeAction->GetDateTime();
 
-OUString aRefStr;
 ScChangeActionType eType=pScChangeAction->GetType();
-OUStringBuffer aBuf;
+OUString aActionString;
+OUString aRefStr;
+OUString aUser;
+OUString aDate;
 OUString aDesc;
 
 std::unique_ptr pNewData(new ScRedlinData);
@@ -392,20 +393,20 @@ std::unique_ptr 
ScAcceptChgDlg::AppendChangeAction(
 {
 if(pScChangeAction->IsDialogParent())
 {
-aBuf.append(aStrContentWithChild);
+aActionString = aStrContentWithChild;
 pNewData->nInfo=RD_SPECIAL_VISCONTENT;
 pNewData->bIsRejectable=false;
 pNewData->bIsAcceptable=false;
 }
 else
 {
-aBuf.append(*MakeTypeString(eType));
+aActionString = *MakeTypeString(eType);
 aDesc = pScChangeAction->GetDescription(*pDoc, true);
 }
 }
 else
 {
-aBuf.append(aStrContentWithChild);
+aActionString = *MakeTypeString(eType);
 
 if(bDelMaster)
 {
@@ -420,27 +421,16 @@ std::unique_ptr 
ScAcceptChgDlg::AppendChangeAction(
 
 aRefStr = pScChangeAction->GetRefString(*pDoc, true);
 
-aBuf.append('\t');
-aBuf.append(aRefStr);
-aBuf.append('\t');
-
 bool bIsGenerated = false;
 
 if(!pChanges->IsGenerated(pScChangeAction->GetActionNumber()))
 {
-aBuf.append(aUser);
-aBuf.append('\t');
-aBuf.append(ScGlobal::getLocaleData().getDate(aDateTime));
-aBuf.append(' ');
-aBuf.append(ScGlobal::getLocaleData().getTime(aDateTime));
-aBuf.append('\t');
-
+aUser = pScChangeAction->GetUser();
+aDate = ScGlobal::getLocaleData().getDate(aDateTime) + " " + 
ScGlobal::getLocaleData().getTime(aDateTime);
 bIsGenerated = false;
 }
 else
 {
-aBuf.append('\t');
-aBuf.append('\t');
 bIsGenerated = true;
 }
 
@@ -451,8 +441,6 @@ std::unique_ptr 
ScAcceptChgDlg::AppendChangeAction(
 aComment +=  " (" + aDesc + ")";
 }
 
-aBuf.append(aComment);
-
 if (pTheView->IsValidEntry(aUser, aDateTime) || bIsGenerated)
 {
 if (pTheView->IsValidComment(aComment))
@@ -480,9 +468,15 @@ std::unique_ptr 
ScAcceptChgDlg::AppendChangeAction(
 
 weld::TreeView& rTreeView = pTheView->GetWidget();
 std::unique_ptr xEntry(rTreeView.make_iterator());
-OUString sString(aBuf.makeStringAndClear());
 OUString sId(weld::toId(pNewData.release()));
-rTreeView.insert(pParent, -1, &sString, &sId, nullptr, nullptr, 
bCreateOnDemand, xEntry.get());
+rTreeView.insert(pParent, -1, &aActionString, &sId, nullptr, nullptr, 
bCreateOnDemand, xEntry.get());
+rTreeView.set_text( *xEntry, aRefStr, 1);
+if

[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sc/source

2023-01-19 Thread Eike Rathke (via logerrit)
 sc/source/ui/miscdlgs/acredlin.cxx |   96 +++--
 1 file changed, 39 insertions(+), 57 deletions(-)

New commits:
commit 7ad6682475df099643c344b5d1cfefef9189d932
Author: Eike Rathke 
AuthorDate: Wed Jan 18 18:40:50 2023 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Jan 19 08:19:03 2023 +

Resolves: tdf#153096 Split change track content action into columns again

Old SvTreeList did split a string on embedded \t Tab characters,
the new weld::TreeView does not but needs column text set
explicitly.

Regression from

commit 56dd851cfc77c362c3db5c0aae4a490c7f6782cc
CommitDate: Sat Apr 27 12:41:14 2019 +0200

weld cluster of change tracking dialogs

that did the necessary changes for
ScAcceptChgDlg::AppendFilteredAction() but not for
ScAcceptChgDlg::AppendChangeAction() and
ScAcceptChgDlg::InsertChangeActionContent().

Odd that no one reported this in all the time..

Additionally, the "Changed contents" label being used instead of
"Row inserted"/"Column inserted"/"Row deleted"/"Column deleted" as
soon as cell content change is present depending on such action,
was a copypasta fallout from

commit e7c76b30bd2ef802ce08f8739eac186253c79696
CommitDate: Mon Aug 29 17:21:12 2011 -0400

String to rtl::OUString.

Change-Id: I855c527da61723c104c743e3b3f159fb026917df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145749
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit fc441f3886330c4ae2abeb67c0758b935ba23f47)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145724
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/miscdlgs/acredlin.cxx 
b/sc/source/ui/miscdlgs/acredlin.cxx
index d1427a8a3c28..87292fe06c1e 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -369,12 +369,13 @@ std::unique_ptr 
ScAcceptChgDlg::AppendChangeAction(
 bool bFlag = false;
 
 ScRange aRef=pScChangeAction->GetBigRange().MakeRange(*pDoc);
-OUString aUser=pScChangeAction->GetUser();
 DateTime aDateTime=pScChangeAction->GetDateTime();
 
-OUString aRefStr;
 ScChangeActionType eType=pScChangeAction->GetType();
-OUStringBuffer aBuf;
+OUString aActionString;
+OUString aRefStr;
+OUString aUser;
+OUString aDate;
 OUString aDesc;
 
 std::unique_ptr pNewData(new ScRedlinData);
@@ -392,20 +393,20 @@ std::unique_ptr 
ScAcceptChgDlg::AppendChangeAction(
 {
 if(pScChangeAction->IsDialogParent())
 {
-aBuf.append(aStrContentWithChild);
+aActionString = aStrContentWithChild;
 pNewData->nInfo=RD_SPECIAL_VISCONTENT;
 pNewData->bIsRejectable=false;
 pNewData->bIsAcceptable=false;
 }
 else
 {
-aBuf.append(*MakeTypeString(eType));
+aActionString = *MakeTypeString(eType);
 aDesc = pScChangeAction->GetDescription(*pDoc, true);
 }
 }
 else
 {
-aBuf.append(aStrContentWithChild);
+aActionString = *MakeTypeString(eType);
 
 if(bDelMaster)
 {
@@ -420,27 +421,16 @@ std::unique_ptr 
ScAcceptChgDlg::AppendChangeAction(
 
 aRefStr = pScChangeAction->GetRefString(*pDoc, true);
 
-aBuf.append('\t');
-aBuf.append(aRefStr);
-aBuf.append('\t');
-
 bool bIsGenerated = false;
 
 if(!pChanges->IsGenerated(pScChangeAction->GetActionNumber()))
 {
-aBuf.append(aUser);
-aBuf.append('\t');
-aBuf.append(ScGlobal::getLocaleData().getDate(aDateTime));
-aBuf.append(' ');
-aBuf.append(ScGlobal::getLocaleData().getTime(aDateTime));
-aBuf.append('\t');
-
+aUser = pScChangeAction->GetUser();
+aDate = ScGlobal::getLocaleData().getDate(aDateTime) + " " + 
ScGlobal::getLocaleData().getTime(aDateTime);
 bIsGenerated = false;
 }
 else
 {
-aBuf.append('\t');
-aBuf.append('\t');
 bIsGenerated = true;
 }
 
@@ -451,8 +441,6 @@ std::unique_ptr 
ScAcceptChgDlg::AppendChangeAction(
 aComment +=  " (" + aDesc + ")";
 }
 
-aBuf.append(aComment);
-
 if (pTheView->IsValidEntry(aUser, aDateTime) || bIsGenerated)
 {
 if (pTheView->IsValidComment(aComment))
@@ -480,9 +468,15 @@ std::unique_ptr 
ScAcceptChgDlg::AppendChangeAction(
 
 weld::TreeView& rTreeView = pTheView->GetWidget();
 std::unique_ptr xEntry(rTreeView.make_iterator());
-OUString sString(aBuf.makeStringAndClear());
 OUString sId(weld::toId(pNewData.release()));
-rTreeView.insert(pParent, -1, &sString, &sId, nullptr, nullptr, 
bCreateOnDemand, xEntry.get());
+rTreeView.insert(pParent, -1, &aActionString, &sId, nullptr, nullptr, 
bCreateOnDemand, xEntry.get());
+rTreeView.set_text( *xEntry, aRefStr, 1);
+if