[Libreoffice-commits] core.git: basic/CppunitTest_basic_macros.mk basic/Library_sb.mk

2023-08-01 Thread Mike Kaganski (via logerrit)
 basic/CppunitTest_basic_macros.mk |2 --
 basic/Library_sb.mk   |2 --
 2 files changed, 4 deletions(-)

New commits:
commit 53642824823d47c623527b33f2ea797fbb7383db
Author: Mike Kaganski 
AuthorDate: Wed Aug 2 06:49:49 2023 +0200
Commit: Mike Kaganski 
CommitDate: Wed Aug 2 08:36:32 2023 +0200

No boost in basic

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

diff --git a/basic/CppunitTest_basic_macros.mk 
b/basic/CppunitTest_basic_macros.mk
index 361bd5bb2d2f..a7406efca03e 100644
--- a/basic/CppunitTest_basic_macros.mk
+++ b/basic/CppunitTest_basic_macros.mk
@@ -9,8 +9,6 @@
 
 $(eval $(call gb_CppunitTest_CppunitTest,basic_macros))
 
-$(eval $(call gb_CppunitTest_use_external,basic_macros,boost_headers))
-
 $(eval $(call gb_CppunitTest_add_exception_objects,basic_macros, \
basic/qa/cppunit/basictest \
basic/qa/cppunit/basic_coverage \
diff --git a/basic/Library_sb.mk b/basic/Library_sb.mk
index f640e366a50c..8076f0995873 100644
--- a/basic/Library_sb.mk
+++ b/basic/Library_sb.mk
@@ -27,8 +27,6 @@ $(eval $(call gb_Library_set_include,sb,\
 
 $(eval $(call 
gb_Library_set_precompiled_header,sb,basic/inc/pch/precompiled_sb))
 
-$(eval $(call gb_Library_use_external,sb,boost_headers))
-
 $(eval $(call gb_Library_use_custom_headers,sb,\
officecfg/registry \
 ))


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

2023-08-01 Thread Matt K (via logerrit)
 desktop/inc/app.hxx|3 ++-
 desktop/inc/strings.hrc|1 +
 desktop/source/app/app.cxx |9 +
 3 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit efae7b4a1f7248b01e8cd95577c09d772cfe5709
Author: Matt K 
AuthorDate: Tue Jul 25 19:32:11 2023 -0500
Commit: Stephan Bergmann 
CommitDate: Wed Aug 2 08:25:37 2023 +0200

tdf#129713 Output message when using "--cat" with other LO instances running

This change modifies the code that determines whether a 2nd LibreOffice
instance is running during the startup of the new soffice.bin process.
In that section of code, we simply write a new error message to console
and pop-up a message box via FatalError.  The message tells the user
that they should close other LibreOffice processes if they want to use
the "--cat" or "--script-cat" command line options.

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

diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 3372e751dbf1..9d6ac9864a52 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -58,7 +58,8 @@ class Desktop final : public Application
 BE_LANGUAGE_MISSING,
 BE_USERINSTALL_NOTENOUGHDISKSPACE,
 BE_USERINSTALL_NOWRITEACCESS,
-BE_OFFICECONFIG_BROKEN
+BE_OFFICECONFIG_BROKEN,
+BE_2NDOFFICE_WITHCAT,
 };
 enum BootstrapStatus
 {
diff --git a/desktop/inc/strings.hrc b/desktop/inc/strings.hrc
index b18117bb5a0d..f4af7ad24602 100644
--- a/desktop/inc/strings.hrc
+++ b/desktop/inc/strings.hrc
@@ -163,6 +163,7 @@
 #define STR_BOOTSTRAP_ERR_LANGUAGE_MISSING  
NC_("STR_BOOTSTRAP_ERR_LANGUAGE_MISSING", "The user interface language cannot 
be determined.")
 #define STR_BOOTSTRAP_ERR_USERINSTALL_FAILED
NC_("STR_BOOTSTRAP_ERR_USERINSTALL_FAILED", "User installation could not be 
completed. ")
 #define STR_BOOTSTRAP_ERR_NO_CFG_SERVICE
NC_("STR_BOOTSTRAP_ERR_NO_CFG_SERVICE", "The configuration service is not 
available.")
+#define STR_BOOTSTRAP_ERR_2NDOFFICE_WITHCAT 
NC_("STR_BOOTSTRAP_ERR_2NDOFFICE_WITHCAT", "There is already another 
%PRODUCTNAME instance running.  Please close all %PRODUCTNAME processes before 
running with the '--cat' or '--script-cat' option.")
 #define STR_ASK_START_SETUP_MANUALLY
NC_("STR_ASK_START_SETUP_MANUALLY", "Start the setup application to repair the 
installation from the CD or the folder containing the installation packages.")
 #define STR_CONFIG_ERR_ACCESS_GENERAL   
NC_("STR_CONFIG_ERR_ACCESS_GENERAL", "A general error occurred while accessing 
your central configuration. ")
 #define STR_LO_MUST_BE_RESTARTED
NC_("STR_LO_MUST_BE_RESTARTED", "%PRODUCTNAME must unfortunately be manually 
restarted once after installation or update." )
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index e4058bfe8932..cb3beaf0ae26 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -523,6 +523,10 @@ void Desktop::Init()
 else if ( aStatus == RequestHandler::IPC_STATUS_2ND_OFFICE )
 {
 // 2nd office startup should terminate after sending cmdlineargs 
through pipe
+if (rCmdLineArgs.IsTextCat() || rCmdLineArgs.IsScriptCat())
+{
+HandleBootstrapErrors( BE_2NDOFFICE_WITHCAT, OUString() );
+}
 SetBootstrapStatus(BS_TERMINATE);
 }
 else if ( !rCmdLineArgs.GetUnknown().isEmpty()
@@ -880,6 +884,11 @@ void Desktop::HandleBootstrapErrors(
 
 FatalError(MakeStartupErrorMessage(aDiagnosticMessage));
 }
+else if ( aBootstrapError == BE_2NDOFFICE_WITHCAT )
+{
+OUString aDiagnosticMessage = 
DpResId(STR_BOOTSTRAP_ERR_2NDOFFICE_WITHCAT);
+FatalError(MakeStartupErrorMessage(aDiagnosticMessage));
+}
 }
 
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - desktop/CppunitTest_desktop_lib.mk desktop/qa

2023-08-01 Thread Paris Oplopoios (via logerrit)
 desktop/CppunitTest_desktop_lib.mk  |1 
 desktop/qa/desktop_lib/test_desktop_lib.cxx |   81 
 2 files changed, 82 insertions(+)

New commits:
commit 63b7c15b537308667925d3064916b88ded985006
Author: Paris Oplopoios 
AuthorDate: Tue Aug 1 15:20:08 2023 +0300
Commit: Miklos Vajna 
CommitDate: Wed Aug 2 08:14:17 2023 +0200

Test paintPartTile behavior for views with different schemes

It would be the case that sometimes paintPartTile would use a different
view to draw the tiles without first checking if they have matching
schemes, which would cause bad tiles and previews

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

diff --git a/desktop/CppunitTest_desktop_lib.mk 
b/desktop/CppunitTest_desktop_lib.mk
index d8f58cac18da..878235d4da6f 100644
--- a/desktop/CppunitTest_desktop_lib.mk
+++ b/desktop/CppunitTest_desktop_lib.mk
@@ -26,6 +26,7 @@ $(eval $(call gb_CppunitTest_use_libraries,desktop_lib, \
sfx \
sofficeapp \
subsequenttest \
+svt \
sw \
test \
unotest \
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 3fe78d8cb2d4..fd79c43d9a1a 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -66,6 +66,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #if USE_TLS_NSS
 #include 
@@ -186,6 +188,7 @@ public:
 void testTrackChanges();
 void testRedlineCalc();
 void testPaintPartTile();
+void testPaintPartTileDifferentSchemes();
 #if HAVE_MORE_FONTS
 void testGetFontSubset();
 #endif
@@ -255,6 +258,7 @@ public:
 CPPUNIT_TEST(testTrackChanges);
 CPPUNIT_TEST(testRedlineCalc);
 CPPUNIT_TEST(testPaintPartTile);
+CPPUNIT_TEST(testPaintPartTileDifferentSchemes);
 #if HAVE_MORE_FONTS
 CPPUNIT_TEST(testGetFontSubset);
 #endif
@@ -2303,6 +2307,83 @@ void DesktopLOKTest::testPaintPartTile()
 //CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
 }
 
+void DesktopLOKTest::testPaintPartTileDifferentSchemes()
+{
+Color aDarkColor = Color(0x1c, 0x1c, 0x1c);
+
+// Add a minimal dark scheme
+{
+svtools::EditableColorConfig aColorConfig;
+svtools::ColorConfigValue aValue;
+aValue.bIsVisible = true;
+aValue.nColor = aDarkColor;
+aColorConfig.SetColorValue(svtools::DOCCOLOR, aValue);
+aColorConfig.AddScheme(u"Dark");
+}
+
+// Add a minimal light scheme
+{
+svtools::EditableColorConfig aColorConfig;
+svtools::ColorConfigValue aValue;
+aValue.bIsVisible = true;
+aValue.nColor = COL_WHITE;
+aColorConfig.SetColorValue(svtools::DOCCOLOR, aValue);
+aColorConfig.AddScheme(u"Light");
+}
+
+// This view will default to light scheme
+LibLODocument_Impl* pDocument = loadDoc("2slides.odp");
+pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}");
+int nView1 = pDocument->m_pDocumentClass->getView(pDocument);
+
+// Create a second view
+pDocument->m_pDocumentClass->createView(pDocument);
+pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}");
+
+// Go to the second slide in the second view
+pDocument->m_pDocumentClass->setPart(pDocument, 1);
+
+// Set to dark scheme
+{
+uno::Sequence aPropertyValues = 
comphelper::InitPropertySequence(
+{
+{ "NewTheme", uno::Any(OUString("Dark")) },
+}
+);
+dispatchCommand(mxComponent, ".uno:ChangeTheme", aPropertyValues);
+}
+
+constexpr int nCanvasWidth = 256;
+constexpr int nCanvasHeight = 256;
+
+// Just a random pixel in the middle of the canvas
+constexpr int nPixelX = 128;
+constexpr int nPixelY = 128 * nCanvasWidth;
+
+std::array aPixels;
+
+// Both parts should be painted with dark scheme
+pDocument->m_pDocumentClass->paintPartTile(pDocument, aPixels.data(), 0, 
0, nCanvasWidth, nCanvasHeight, 0, 0, nCanvasWidth, nCanvasHeight);
+Color aPixel(aPixels[nPixelX + nPixelY + 0], aPixels[nPixelX + nPixelY + 
1], aPixels[nPixelX + nPixelY + 2]);
+CPPUNIT_ASSERT_EQUAL(aDarkColor, aPixel);
+
+pDocument->m_pDocumentClass->paintPartTile(pDocument, aPixels.data(), 0, 
0, nCanvasWidth, nCanvasHeight, 0, 0, nCanvasWidth, nCanvasHeight);
+aPixel = Color(aPixels[nPixelX + nPixelY + 0], aPixels[nPixelX + nPixelY + 
1], aPixels[nPixelX + nPixelY + 2]);
+CPPUNIT_ASSERT_EQUAL(aDarkColor, aPixel);
+
+// Switch back to first view
+pDocument->m_pDocumentClass->setView(pDocument, nView1);
+
+// Both parts should be painted with light scheme
+pDocument->m_pDocumentClass->paintPartTile(pDocument, aPixels.data(), 0, 
0, nCanvasWidth, nCanvasHeight, 0, 0, nCanvasWidth, nCanvasHeig

[Libreoffice-commits] core.git: 2 commits - accessibility/inc accessibility/source chart2/source dbaccess/source desktop/source drawinglayer/source embeddedobj/source framework/source include/svtools

2023-08-01 Thread Noel Grandin (via logerrit)
 accessibility/inc/extended/AccessibleBrowseBox.hxx|2 
 accessibility/inc/extended/AccessibleBrowseBoxBase.hxx|4 
 accessibility/inc/extended/AccessibleBrowseBoxHeaderBar.hxx   |2 
 accessibility/inc/extended/AccessibleBrowseBoxHeaderCell.hxx  |2 
 accessibility/inc/extended/AccessibleBrowseBoxTable.hxx   |2 
 accessibility/inc/extended/AccessibleGridControl.hxx  |2 
 accessibility/inc/extended/AccessibleGridControlBase.hxx  |4 
 accessibility/inc/extended/AccessibleGridControlHeader.hxx|2 
 accessibility/inc/extended/AccessibleGridControlHeaderCell.hxx|2 
 accessibility/inc/extended/AccessibleGridControlTable.hxx |2 
 accessibility/inc/extended/AccessibleGridControlTableCell.hxx |2 
 accessibility/inc/extended/accessiblebrowseboxcell.hxx|2 
 accessibility/inc/extended/accessibleiconchoicectrlentry.hxx  |4 
 accessibility/inc/helper/IComboListBoxHelper.hxx  |3 
 accessibility/inc/helper/listboxhelper.hxx|4 
 accessibility/source/extended/AccessibleBrowseBox.cxx |2 
 accessibility/source/extended/AccessibleBrowseBoxBase.cxx |4 
 accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx|4 
 accessibility/source/extended/AccessibleBrowseBoxHeaderCell.cxx   |4 
 accessibility/source/extended/AccessibleBrowseBoxTable.cxx|4 
 accessibility/source/extended/AccessibleGridControl.cxx   |2 
 accessibility/source/extended/AccessibleGridControlBase.cxx   |4 
 accessibility/source/extended/AccessibleGridControlHeader.cxx |8 
 accessibility/source/extended/AccessibleGridControlHeaderCell.cxx |6 
 accessibility/source/extended/AccessibleGridControlTable.cxx  |4 
 accessibility/source/extended/AccessibleGridControlTableCell.cxx  |6 
 accessibility/source/extended/accessiblebrowseboxcell.cxx |4 
 accessibility/source/extended/accessibleiconchoicectrlentry.cxx   |   20 
 accessibility/source/extended/accessiblelistboxentry.cxx  |2 
 accessibility/source/extended/textwindowaccessibility.cxx |2 
 accessibility/source/standard/accessiblemenucomponent.cxx |4 
 accessibility/source/standard/accessiblemenuitemcomponent.cxx |2 
 accessibility/source/standard/vclxaccessiblelistitem.cxx  |2 
 chart2/source/controller/main/ChartController_Tools.cxx   |2 
 dbaccess/source/ui/querydesign/TableWindowAccess.cxx  |4 
 desktop/source/splash/splash.cxx  |4 
 drawinglayer/source/processor2d/vclhelperbufferdevice.cxx |2 
 embeddedobj/source/general/docholder.cxx  |2 
 framework/source/layoutmanager/layoutmanager.cxx  |2 
 include/svtools/brwbox.hxx|2 
 include/toolkit/helper/convert.hxx|4 
 include/tools/gen.hxx |  831 
+-
 include/vcl/accessibletable.hxx   |2 
 include/vcl/accessibletableprovider.hxx   |2 
 include/vcl/svapp.hxx |4 
 include/vcl/toolkit/floatwin.hxx  |   10 
 include/vcl/toolkit/svtabbx.hxx   |2 
 include/vcl/weld.hxx  |4 
 include/vcl/window.hxx|   12 
 sc/source/ui/Accessibility/AccessibleCell.cxx |6 
 sc/source/ui/Accessibility/AccessibleContextBase.cxx  |4 
 sc/source/ui/Accessibility/AccessibleDocument.cxx |6 
 sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx  |4 
 sc/source/ui/Accessibility/AccessibleEditObject.cxx   |   22 
 sc/source/ui/Accessibility/AccessiblePageHeader.cxx   |6 
 sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx   |8 
 sc/source/ui/Accessibility/AccessiblePreviewCell.cxx  |6 
 sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx|6 
 sc/source/ui/Accessibility/AccessiblePreviewTable.cxx |6 
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx  |4 
 sc/source/ui/inc/AccessibleCell.hxx   |2 
 sc/source/ui/inc/AccessibleContextBase.hxx|3 
 sc/source/ui/inc/AccessibleDocument.hxx   |2 
 sc/source/ui/inc/AccessibleDocumentPagePreview.hxx|2 
 sc/source/ui/inc/AccessibleEditObject.hxx |4 
 sc/source/ui/inc/AccessiblePageHeader.hxx |2 
 sc/source/ui/inc/AccessiblePageHeader

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

2023-08-01 Thread Noel Grandin (via logerrit)
 vcl/inc/unx/fontmanager.hxx |3 ++-
 vcl/unx/generic/fontmanager/fontmanager.cxx |6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 39a6740b9b8ebea2cb169392a1cce95bf0633f6e
Author: Noel Grandin 
AuthorDate: Tue Aug 1 19:10:04 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 2 08:12:44 2023 +0200

std::set->o3tl::sorted_vector for m_aFontFileToFontID

sorted_vector is perfect for small sets of small objects, and
fontId is an int.

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

diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx
index 89bf5508879b..21a8d00aa415 100644
--- a/vcl/inc/unx/fontmanager.hxx
+++ b/vcl/inc/unx/fontmanager.hxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -115,7 +116,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
 fontID  m_nNextFontID;
 std::unordered_map< fontID, PrintFont > m_aFonts;
 // for speeding up findFontFileID
-std::unordered_map< OString, std::set< fontID > >
+std::unordered_map< OString, o3tl::sorted_vector< fontID > >
 m_aFontFileToFontID;
 
 std::unordered_map< OString, int >
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx 
b/vcl/unx/generic/fontmanager/fontmanager.cxx
index 1927071bb802..748017252987 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -247,11 +247,11 @@ fontID PrintFontManager::findFontFileID(int nDirID, const 
OString& rFontFile, in
 {
 fontID nID = 0;
 
-std::unordered_map< OString, ::std::set< fontID > >::const_iterator set_it 
= m_aFontFileToFontID.find( rFontFile );
+auto set_it = m_aFontFileToFontID.find( rFontFile );
 if( set_it == m_aFontFileToFontID.end() )
 return nID;
 
-for (auto const& elem : set_it->second)
+for (fontID elem : set_it->second)
 {
 auto it = m_aFonts.find(elem);
 if( it == m_aFonts.end() )
@@ -275,7 +275,7 @@ std::vector PrintFontManager::findFontFileIDs( int 
nDirID, const OString
 {
 std::vector aIds;
 
-std::unordered_map< OString, ::std::set< fontID > >::const_iterator set_it 
= m_aFontFileToFontID.find( rFontFile );
+auto set_it = m_aFontFileToFontID.find( rFontFile );
 if( set_it == m_aFontFileToFontID.end() )
 return aIds;
 


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

2023-08-01 Thread Miklos Vajna (via logerrit)
 dev/null|binary
 sw/qa/core/layout/data/floattable-no-footer-overlap.doc |binary
 sw/qa/core/layout/flycnt.cxx|9 ++
 sw/source/core/layout/flowfrm.cxx   |   13 
 sw/source/core/layout/tabfrm.cxx|   50 +++-
 5 files changed, 70 insertions(+), 2 deletions(-)

New commits:
commit 7278c1facfd675dd1972a01370de4425704d9a16
Author: Miklos Vajna 
AuthorDate: Wed Jul 19 08:29:01 2023 +0200
Commit: Mike Kaganski 
CommitDate: Wed Aug 2 08:12:40 2023 +0200

tdf#120262 sw floattable: no split when none of first row fits the vert 
space

The final problem with the bugdoc is that half row of the second
floating table was still on page 1, while it should be fully on page 2.

The reason for this was that first we thought we can't move forward,
since GetIndPrev() returns nullptr for a table that's inside a fly
frame. Then we thought it's a good idea to split, even if the split
would move the entire first row to the next page.

Fix the problem by:

- In SwTabFrame::MakeAll(), handle split flys after calling
  GetIndPrev(), an indirect prev of the anchor has the same meaning in
  this context.

- In SwTabFrame::Split(), fail for split flys in case only half of the first
  row's first line would fit, which gives an opporunity to call
  MoveFwd().

- In SwTabFrame::MakeAll(), call MoveFwd() in a way that it's not a
  problem that the GetIndPrev() call in MoveFwd() gives us a nullptr.

- At this point we don't split the table, we move it forward, but an
  empty master remains on page 1. Fix that by improving
  SwFlowFrame::MoveSubTree() to mark empty flys for deletion, similar to
  how it does the same for sections.

- Finally avoid a layout warning in SwTabFrame::MakeAll(), it's OK to
  try to split in case our split fly has a follow, we can move there on
  split failure.

Also bring the test document closed to the original bugdoc, so we can
assert the content on both pages.

Change-Id: I2d3f88342d91b3e256bc41416a9afb274a9309d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154633
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 45574624ff05673d44f11cd49e1af599133e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155135
Reviewed-by: Mike Kaganski 

diff --git a/sw/qa/core/layout/data/floattable-no-footer-overlap.doc 
b/sw/qa/core/layout/data/floattable-no-footer-overlap.doc
new file mode 100644
index ..87e301189df5
Binary files /dev/null and 
b/sw/qa/core/layout/data/floattable-no-footer-overlap.doc differ
diff --git a/sw/qa/core/layout/data/floattable-no-footer-overlap.docx 
b/sw/qa/core/layout/data/floattable-no-footer-overlap.docx
deleted file mode 100644
index ca2f0d6d7244..
Binary files a/sw/qa/core/layout/data/floattable-no-footer-overlap.docx and 
/dev/null differ
diff --git a/sw/qa/core/layout/flycnt.cxx b/sw/qa/core/layout/flycnt.cxx
index 106be77ceac2..a1e4c05c6c1d 100644
--- a/sw/qa/core/layout/flycnt.cxx
+++ b/sw/qa/core/layout/flycnt.cxx
@@ -950,7 +950,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyAnchorKeepWithNext)
 CPPUNIT_TEST_FIXTURE(Test, testSplitFlyNoFooterOverlap)
 {
 // Given a document with 2 pages, a floating table on both pages:
-createSwDoc("floattable-no-footer-overlap.docx");
+createSwDoc("floattable-no-footer-overlap.doc");
 
 // When calculating the layout:
 calcLayout();
@@ -960,6 +960,13 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyNoFooterOverlap)
 SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
 auto pPage1 = dynamic_cast(pLayout->Lower());
 CPPUNIT_ASSERT(pPage1);
+CPPUNIT_ASSERT(pPage1->GetSortedObjs());
+const SwSortedObjs& rPage1Objs = *pPage1->GetSortedObjs();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 2
+// i.e. part of the second table was on page 1.
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rPage1Objs.size());
 auto pPage2 = dynamic_cast(pPage1->GetNext());
 // Without the accompanying fix in place, this test would have failed, 
there was no page 2, both
 // floating tables were on page 1.
diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index b7356ec0a059..872e872083f8 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -693,6 +693,7 @@ void SwFlowFrame::MoveSubTree( SwLayoutFrame* pParent, 
SwFrame* pSibling )
 // disappear automatically.
 SwSectionFrame *pSct;
 
+SwFlyFrame* pFly = nullptr;
 if ( pOldParent && !pOldParent->Lower() &&
  ( pOldParent->IsInSct() &&
!(pSct = pOldParent->FindSctFrame())->ContainsContent() &&
@@ -700,6 +701,18 @@ void S

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

2023-08-01 Thread Miklos Vajna (via logerrit)
 sw/qa/core/unocore/data/floattable-split.docx |binary
 sw/qa/core/unocore/unocore.cxx|   19 +++
 sw/source/core/inc/flyfrm.hxx |3 +++
 sw/source/core/layout/fly.cxx |5 +
 sw/source/core/unocore/unoobj2.cxx|   18 ++
 5 files changed, 45 insertions(+)

New commits:
commit 140ebce3b81a09d163c34ae792d090154302c8e7
Author: Miklos Vajna 
AuthorDate: Mon Jul 31 08:24:03 2023 +0200
Commit: Mike Kaganski 
CommitDate: Wed Aug 2 08:11:09 2023 +0200

tdf#156350 sw floattable: fix bad additional  in ODT with layout

The document has a floating table, split on two pages. Saving as ODT
creates two  elements, while we only expect one.

The document model is correct, SwDoc::mpSpzFrameFormatTable only
contains one frame, and in general the ODT export works with the SwDoc,
but CollectFrameAtNode() uses the layout to help performance, and the
layout is available when saving interactively (i.e. not --convert-to),
which visits both layout frames of the same frame format.

Fix the problem by ignoring follow fly frames in
lcl_CollectFrameAtNodeWithLayout(), just working from master should
ensure there is no duplication.

This is similar to 4721729fba32a02683ecc930b630491599f8c6c5
(SwXParaFrameEnumeration: ignore textboxes, 2014-05-27), but that was
for fly frames of draw shapes, and this is for split flys.

Change-Id: I09729c0b0f9afd694e3cbf8886ccbc530bfc9674
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155081
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 2b401b7c0322d9ff972d252208ebe9a77913778d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155136
Reviewed-by: Mike Kaganski 

diff --git a/sw/qa/core/unocore/data/floattable-split.docx 
b/sw/qa/core/unocore/data/floattable-split.docx
new file mode 100644
index ..2e2c9c705df9
Binary files /dev/null and b/sw/qa/core/unocore/data/floattable-split.docx 
differ
diff --git a/sw/qa/core/unocore/unocore.cxx b/sw/qa/core/unocore/unocore.cxx
index 199da2e72a79..cb6f52d0fdbb 100644
--- a/sw/qa/core/unocore/unocore.cxx
+++ b/sw/qa/core/unocore/unocore.cxx
@@ -965,6 +965,25 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testTdf155951)
 xText->insertString(xCursor, "test", /*bAbsorb=*/false);
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testCollectFrameAtNodeWithLayout)
+{
+// Given a document with a floating table on 2 pages, with a calculated 
layout:
+createSwDoc("floattable-split.docx");
+calcLayout();
+
+// When saving to ODT:
+save("writer8");
+
+// Then make sure the output is valid and hasa 1 :
+// Without the accompanying fix in place, this test would have failed with:
+// Error: uncompleted content model.
+// i.e. the output was not valid, the second  has an empty 
 as a child
+// element.
+xmlDocUniquePtr pXmlDoc = parseExport("content.xml");
+// Also make sure that we don't have multiple  elements in the 
first place.
+assertXPath(pXmlDoc, "//draw:frame", 1);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index d3815a82835a..4b47f0ad2b4e 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -38,6 +38,7 @@ class SwFormat;
 class SwViewShell;
 class SwFEShell;
 class SwWrtShell;
+class SwFlyAtContentFrame;
 
 
 /** search an anchor for paragraph bound frames starting from pOldAnch
@@ -307,6 +308,8 @@ public:
 virtual const SwFlyFrame* DynCastFlyFrame() const override;
 virtual SwFlyFrame* DynCastFlyFrame() override;
 
+SwFlyAtContentFrame* DynCastFlyAtContentFrame();
+
 private:
 void UpdateUnfloatButton(SwWrtShell* pWrtSh, bool bShow) const;
 void PaintDecorators() const;
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 68184da48fd6..a365668c4ce2 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -2100,6 +2100,11 @@ void SwFlyFrame::UpdateUnfloatButton(SwWrtShell* pWrtSh, 
bool bShow) const
 rMngr.SetUnfloatTableButton(this, bShow,  aTopRightPixel);
 }
 
+SwFlyAtContentFrame* SwFlyFrame::DynCastFlyAtContentFrame()
+{
+return IsFlyAtContentFrame() ? static_cast(this) : 
nullptr;
+}
+
 SwTwips SwFlyFrame::Grow_( SwTwips nDist, bool bTst )
 {
 SwRectFnSet aRectFnSet(this);
diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index 01682ef48587..472babcd8243 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -48,6 +48,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -123,6 +125,22 @@ struct FrameClientSortListLess
 // Filter out textboxes, which are not interesting at a UNO level.
 if(SwTextB

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

2023-08-01 Thread Miklos Vajna (via logerrit)
 sw/qa/core/doc/data/floating-table-dummy-text.docx  |binary
 sw/qa/core/doc/doc.cxx  |   33 
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   21 ++
 3 files changed, 54 insertions(+)

New commits:
commit 5e19348fb9507882827d29f875696ab225198be2
Author: Miklos Vajna 
AuthorDate: Tue Aug 1 09:06:43 2023 +0200
Commit: Mike Kaganski 
CommitDate: Wed Aug 2 08:06:31 2023 +0200

tdf#156260 sw floattable: avoid overlapping flys on anchor change

Going to the end of the document, typing "dt" and F3 collapses the
multi-page floating table into a single page, with overlapping text.

In practice we insert a new paragraph before the "dt" one, insert the
dummy text there and then re-anchor the floating table from the old
paragraph to the new one. Such re-anchoring isn't really meant to be
done with floating tables, which are always just anchored in the next
paragraph in practice. An additional problem is that the amount of fly
frames created depends on the position of the first fly frame, so if the
anchor changes, we may need a different number of split fly frames.

Fix the problem by not trying to reuse the old fly frames on anchor
change: delete the old frames, change the anchor and finally create the
new frames, which leads to correct layout with complicated logic trying
to update the old fly chain to the new anchor.

The original document still puts some dummy text on page 4 instead of
starting it on page 5, that part is still unfixed.

Change-Id: I74549e2ea8ca0d06a9e4814a58aaa8ca476263dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155122
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 073072f0a3abacfe4f9cc920b8138d7abc84db70)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155137
Reviewed-by: Mike Kaganski 

diff --git a/sw/qa/core/doc/data/floating-table-dummy-text.docx 
b/sw/qa/core/doc/data/floating-table-dummy-text.docx
new file mode 100644
index ..14de5a920a88
Binary files /dev/null and b/sw/qa/core/doc/data/floating-table-dummy-text.docx 
differ
diff --git a/sw/qa/core/doc/doc.cxx b/sw/qa/core/doc/doc.cxx
index 5b523067523a..f8faee3a1bcd 100644
--- a/sw/qa/core/doc/doc.cxx
+++ b/sw/qa/core/doc/doc.cxx
@@ -34,6 +34,10 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 
 /// Covers sw/source/core/doc/ fixes.
 class SwCoreDocTest : public SwModelTestBase
@@ -482,6 +486,35 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testSplitFlyChain)
 CPPUNIT_ASSERT_EQUAL(SwChainRet::IS_IN_CHAIN, eActual);
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testSplitExpandGlossary)
+{
+// Given a document with a split fly (2 pages) and a 'dt' at the end:
+createSwDoc("floating-table-dummy-text.docx");
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+pWrtShell->SttEndDoc(/*bStt=*/false);
+
+// When expanding 'dt' to an actual dummy text:
+dispatchCommand(mxComponent, ".uno:ExpandGlossary", {});
+
+// Then make sure the 2 fly frames stay on the 2 pages:
+SwDoc* pDoc = getSwDoc();
+SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+auto pPage1 = dynamic_cast(pLayout->Lower());
+CPPUNIT_ASSERT(pPage1);
+CPPUNIT_ASSERT(pPage1->GetSortedObjs());
+const SwSortedObjs& rPage1Objs = *pPage1->GetSortedObjs();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 2
+// i.e. both parts of the split fly chain were on page 1.
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rPage1Objs.size());
+auto pPage2 = dynamic_cast(pPage1->GetNext());
+CPPUNIT_ASSERT(pPage2);
+CPPUNIT_ASSERT(pPage2->GetSortedObjs());
+const SwSortedObjs& rPage2Objs = *pPage2->GetSortedObjs();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rPage2Objs.size());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 470a018eb0ef..f7d24dd55ea0 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -70,6 +70,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -5238,7 +5239,27 @@ bool 
DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo
 {
 SwFormatAnchor anchor(*pAnchor);
 anchor.SetAnchor( &startPosAtPara );
+
+bool bSplitFly = false;
+if (pFly->GetFlySplit().GetValue())
+{
+SwIterator aIter(*pFly);
+bSplitFly = aIter.First() && aIter.Next();
+}
+if (bSplitFl

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

2023-08-01 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/htmlexport/htmlexport.cxx |   27 +--
 1 file changed, 17 insertions(+), 10 deletions(-)

New commits:
commit da468c92cfd93c810a79ce7769832367df4ea2b8
Author: Miklos Vajna 
AuthorDate: Tue Aug 1 20:14:31 2023 +0200
Commit: Miklos Vajna 
CommitDate: Wed Aug 2 08:05:32 2023 +0200

CppunitTest_sw_htmlexport: clean up testFdo81276

Still fails with commit 7dff37c65e08985b80ac79e13f5571819a8e739d
(fdo#81276: sw: HTML import: fix inverted test in CSS import,
2014-07-22) reverted, but now avoids the almost unused
DECLARE_HTMLEXPORT_ROUNDTRIP_TEST macro.

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

diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 8032b9dde026..ab825a735fa7 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -290,17 +290,24 @@ void SwHtmlDomExportTest::ImportFromReqif(const OUString& 
rUrl)
 mxComponent = loadFromDesktop(rUrl, "com.sun.star.text.TextDocument", 
aLoadProperties);
 }
 
-DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testFdo81276, "fdo81276.html")
+CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFdo81276)
 {
-uno::Reference 
xPageStyles(getStyles("PageStyles"));
-uno::Reference xStyle(xPageStyles->getByName("HTML"), 
uno::UNO_QUERY);
-// some rounding going on here?
-CPPUNIT_ASSERT(abs(sal_Int32(29700) - getProperty(xStyle, 
"Width")) < 10);
-CPPUNIT_ASSERT(abs(sal_Int32(21006) - getProperty(xStyle, 
"Height")) < 10);
-CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty(xStyle, 
"LeftMargin")) < 10);
-CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty(xStyle, 
"RightMargin")) < 10);
-CPPUNIT_ASSERT(abs(sal_Int32(2000) - getProperty(xStyle, 
"TopMargin")) < 10);
-CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty(xStyle, 
"BottomMargin")) < 10);
+auto verify = [this]() {
+uno::Reference 
xPageStyles(getStyles("PageStyles"));
+uno::Reference 
xStyle(xPageStyles->getByName("HTML"), uno::UNO_QUERY);
+// some rounding going on here?
+CPPUNIT_ASSERT(abs(sal_Int32(29700) - getProperty(xStyle, 
"Width")) < 10);
+CPPUNIT_ASSERT(abs(sal_Int32(21006) - getProperty(xStyle, 
"Height")) < 10);
+CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty(xStyle, 
"LeftMargin")) < 10);
+CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty(xStyle, 
"RightMargin")) < 10);
+CPPUNIT_ASSERT(abs(sal_Int32(2000) - getProperty(xStyle, 
"TopMargin")) < 10);
+CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty(xStyle, 
"BottomMargin")) < 10);
+};
+setImportFilterName(mpFilter);
+createSwDoc("fdo81276.html");
+verify();
+saveAndReload(mpFilter);
+verify();
 }
 
 CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFdo62336)


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

2023-08-01 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/ooxmlexport/data/longBookmarkName.fodt |   13 +
 sw/qa/extras/ooxmlexport/ooxmlexport19.cxx  |   31 
 sw/source/filter/ww8/docxattributeoutput.cxx|   32 ++---
 sw/source/filter/ww8/docxattributeoutput.hxx|2 
 sw/source/filter/ww8/wrtw8nds.cxx   |   42 -
 sw/source/filter/ww8/wrtww8.cxx |   49 
 sw/source/filter/ww8/wrtww8.hxx |   10 +++-
 sw/source/filter/ww8/ww8atr.cxx |   14 ++---
 8 files changed, 128 insertions(+), 65 deletions(-)

New commits:
commit b586410f13c39b1687cfe02cc48b8c14850eb055
Author: Mike Kaganski 
AuthorDate: Mon Jul 31 15:08:58 2023 +0300
Commit: Miklos Vajna 
CommitDate: Wed Aug 2 08:04:33 2023 +0200

tdf#156548: make truncated long bookmark name unique, and use it in 
hyperlinks

Change-Id: I156359339ff8be85fe90cb6612eafdc6030c851f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155092
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit cba1b5de0bae4712024ccb0a4efd190f64c92ad8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155131
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/ooxmlexport/data/longBookmarkName.fodt 
b/sw/qa/extras/ooxmlexport/data/longBookmarkName.fodt
new file mode 100644
index ..8b09760fcb6f
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/longBookmarkName.fodt
@@ -0,0 +1,13 @@
+
+
+http://www.w3.org/1999/xlink"; 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ 
+  
+   This is a hyperlink 
to the first target paragraph below
+   This is a hyperlink 
to the second target paragraph below
+   
+   The first target 
paragraph with a bookmark with a very long name
+   The second target 
paragraph with a bookmark with a very long name
+  
+ 
+
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
index 2769423eeb43..d6573d98bb21 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
@@ -1039,6 +1039,37 @@ DECLARE_OOXMLEXPORT_TEST(testTdf156372, "tdf156372.doc")
 CPPUNIT_ASSERT_EQUAL(1, getPages());
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf156548)
+{
+// Given a document using two bookmarks with similar names longer than 40 
characters
+loadAndReload("longBookmarkName.fodt");
+
+// After the export, the names must be no longer than 40 characters; they 
must be unique;
+// and the hyperlinks must use the same names, to still point to the 
correct targets:
+
+{
+// 1st  paragraph - hyperlink to 4th paragraph
+auto sURL = getProperty(getRun(getParagraph(1), 1), 
"HyperLinkURL");
+
CPPUNIT_ASSERT_EQUAL(OUString("#A_bookmark_name_longer_than_forty_charac"), 
sURL);
+// 4th paragraph - a bookmark
+auto xBookmark = 
getProperty>(getRun(getParagraph(4), 1),
+
"Bookmark");
+
CPPUNIT_ASSERT_EQUAL(OUString("A_bookmark_name_longer_than_forty_charac"),
+ xBookmark->getName());
+}
+
+{
+// 2nd  paragraph - hyperlink to 5th paragraph
+auto sURL = getProperty(getRun(getParagraph(2), 1), 
"HyperLinkURL");
+
CPPUNIT_ASSERT_EQUAL(OUString("#A_bookmark_name_longer_than_forty_chara1"), 
sURL);
+// 5th paragraph - a bookmark
+auto xBookmark = 
getProperty>(getRun(getParagraph(5), 1),
+
"Bookmark");
+
CPPUNIT_ASSERT_EQUAL(OUString("A_bookmark_name_longer_than_forty_chara1"),
+ xBookmark->getName());
+}
+}
+
 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 21e788665230..f543b08980d0 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2167,11 +2167,11 @@ void DocxAttributeOutput::EndRun(const SwTextNode* 
pNode, sal_Int32 nPos, sal_In
 DoWriteBookmarkEndIfExist(nPos);
 }
 
-void DocxAttributeOutput::DoWriteBookmarkTagStart(std::u16string_view 
bookmarkName)
+void DocxAttributeOutput::DoWriteBookmarkTagStart(const OUString& bookmarkName)
 {
 m_pSerializer->singleElementNS(XML_w, XML_bookmarkStart,
 FSNS(XML_w, XML_id), OString::number(m_nNextBookmarkId),
-FSNS(XML_w, XML_name), BookmarkToWord(bookmarkName));
+FSNS(XML_w, XML_name), GetExport().BookmarkToWord(bookmarkName));
 }
 
 void DocxAttributeOutput::DoWriteBookmarkTagEnd(sal_Int32 const nId)
@@ -2227,7 +2227,7 @@ void 
DocxAttributeOutput::DoWriteBookmarkStartIfExist(sal_Int32 nRunPos)
 {
 DoWriteBookmarkTagS

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

2023-08-01 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/ooxmlexport/data/longBookmarkName.fodt |   13 +
 sw/qa/extras/ooxmlexport/ooxmlexport18.cxx  |   31 
 sw/source/filter/ww8/docxattributeoutput.cxx|   32 ++---
 sw/source/filter/ww8/docxattributeoutput.hxx|2 
 sw/source/filter/ww8/wrtw8nds.cxx   |   42 -
 sw/source/filter/ww8/wrtww8.cxx |   49 
 sw/source/filter/ww8/wrtww8.hxx |   10 +++-
 sw/source/filter/ww8/ww8atr.cxx |   14 ++---
 8 files changed, 128 insertions(+), 65 deletions(-)

New commits:
commit d7ade9e6d0220a9ebc327ed3b73b10da43b2ffa0
Author: Mike Kaganski 
AuthorDate: Mon Jul 31 15:08:58 2023 +0300
Commit: Miklos Vajna 
CommitDate: Wed Aug 2 08:04:17 2023 +0200

tdf#156548: make truncated long bookmark name unique, and use it in 
hyperlinks

Change-Id: I156359339ff8be85fe90cb6612eafdc6030c851f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155092
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155129
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/ooxmlexport/data/longBookmarkName.fodt 
b/sw/qa/extras/ooxmlexport/data/longBookmarkName.fodt
new file mode 100644
index ..8b09760fcb6f
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/longBookmarkName.fodt
@@ -0,0 +1,13 @@
+
+
+http://www.w3.org/1999/xlink"; 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ 
+  
+   This is a hyperlink 
to the first target paragraph below
+   This is a hyperlink 
to the second target paragraph below
+   
+   The first target 
paragraph with a bookmark with a very long name
+   The second target 
paragraph with a bookmark with a very long name
+  
+ 
+
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index 69954c0cbaf8..f9b34e4989c7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -319,6 +319,37 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133560)
 CPPUNIT_ASSERT_EQUAL(12.0f, getProperty(getParagraph(4), 
"CharHeight"));
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf156548)
+{
+// Given a document using two bookmarks with similar names longer than 40 
characters
+loadAndReload("longBookmarkName.fodt");
+
+// After the export, the names must be no longer than 40 characters; they 
must be unique;
+// and the hyperlinks must use the same names, to still point to the 
correct targets:
+
+{
+// 1st  paragraph - hyperlink to 4th paragraph
+auto sURL = getProperty(getRun(getParagraph(1), 1), 
"HyperLinkURL");
+
CPPUNIT_ASSERT_EQUAL(OUString("#A_bookmark_name_longer_than_forty_charac"), 
sURL);
+// 4th paragraph - a bookmark
+auto xBookmark = 
getProperty>(getRun(getParagraph(4), 1),
+
"Bookmark");
+
CPPUNIT_ASSERT_EQUAL(OUString("A_bookmark_name_longer_than_forty_charac"),
+ xBookmark->getName());
+}
+
+{
+// 2nd  paragraph - hyperlink to 5th paragraph
+auto sURL = getProperty(getRun(getParagraph(2), 1), 
"HyperLinkURL");
+
CPPUNIT_ASSERT_EQUAL(OUString("#A_bookmark_name_longer_than_forty_chara1"), 
sURL);
+// 5th paragraph - a bookmark
+auto xBookmark = 
getProperty>(getRun(getParagraph(5), 1),
+
"Bookmark");
+
CPPUNIT_ASSERT_EQUAL(OUString("A_bookmark_name_longer_than_forty_chara1"),
+ xBookmark->getName());
+}
+}
+
 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 3e795eed2bbc..a880e74bab39 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1950,11 +1950,11 @@ void DocxAttributeOutput::EndRun(const SwTextNode* 
pNode, sal_Int32 nPos, sal_In
 DoWriteBookmarkEndIfExist(nPos);
 }
 
-void DocxAttributeOutput::DoWriteBookmarkTagStart(std::u16string_view 
bookmarkName)
+void DocxAttributeOutput::DoWriteBookmarkTagStart(const OUString& bookmarkName)
 {
 m_pSerializer->singleElementNS(XML_w, XML_bookmarkStart,
 FSNS(XML_w, XML_id), OString::number(m_nNextBookmarkId),
-FSNS(XML_w, XML_name), BookmarkToWord(bookmarkName));
+FSNS(XML_w, XML_name), GetExport().BookmarkToWord(bookmarkName));
 }
 
 void DocxAttributeOutput::DoWriteBookmarkTagEnd(sal_Int32 const nId)
@@ -2010,7 +2010,7 @@ void 
DocxAttributeOutput::DoWriteBookmarkStartIfExist(sal_Int32 nRunPos)
 {
 DoWriteBookmarkTagStart(aIter->second);
 m_rOpenedBookmarksIds[a

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

2023-08-01 Thread Michael Weghorn (via logerrit)
 test/source/a11y/AccessibilityTools.cxx|   18 +++---
 toolkit/source/awt/vclxaccessiblecomponent.cxx |6 +-
 2 files changed, 16 insertions(+), 8 deletions(-)

New commits:
commit 3b1da48e8c5506e366977a5e888ec3897e3e1ca3
Author: Michael Weghorn 
AuthorDate: Mon Jul 31 14:48:07 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Aug 2 05:10:18 2023 +0200

a11y: Don't always append window type to a11y name in debug builds

Appending " (Type = )" to the accessible name is probably
meant for debugging purposes to see what type of window is
involved, but doing that by default in debug builds has disadvantages,
e.g.:

1) It affects how assistive tooling, like screen readers, handles
the accessible objects, therefore the behaviour with a debug build
(what a developer working on something experiences) does not
necessarily match what happens in non-debug builds (what end
users will experience).

For instance, when Orca announces the "Update styles" push button
in Writer's formatting toolbar, it not only announces the extra
type information for the objects in the hierarchy it announces
anyway, but announces the panel in addition, since it has a non-empty
name due to the appended type information.

Announcement without this change in place (from Orca log):

INFO:speech:SPEECH OUTPUT: ' (Type = 371) panel.'
INFO:speech:SPEECH OUTPUT: 'Formatting (Type = 356) tool bar'
INFO:speech:SPEECH OUTPUT: 'Update push button.'

Announcement with this change in place:

INFO:speech:SPEECH OUTPUT: 'Formatting tool bar'
INFO:speech:SPEECH OUTPUT: 'Update push button.'

2) It breaks selecting the object under the mouse cursor in
Accerciser at least with the qt6 VCL plugin when the object is in
a dialog, because the window name retrieved via the accessibility
APIs (with the appended type information) does not match the one
retrieved via Wnck [1].

Therefore, don't append the type information by default,
but only if environment variable
`LIBO_APPEND_WINDOW_TYPE_TO_ACCESSIBLE_NAME` ist set
(typically `LIBO_APPEND_WINDOW_TYPE_TO_ACCESSIBLE_NAME=1`,
but any value other than "0" will do),
so that can still be used for cases where having the type as
part of the accessible name is useful.

[1] 
https://gitlab.gnome.org/GNOME/accerciser/-/blob/5af3fdbfb8a7832e434ad6fc7d2ecaad18f2e32e/plugins/quick_select.py#L109

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

diff --git a/test/source/a11y/AccessibilityTools.cxx 
b/test/source/a11y/AccessibilityTools.cxx
index b51c7cbac239..d19c42b388e0 100644
--- a/test/source/a11y/AccessibilityTools.cxx
+++ b/test/source/a11y/AccessibilityTools.cxx
@@ -190,14 +190,18 @@ bool AccessibilityTools::nameEquals(const 
uno::Reference 0
 // see VCLXAccessibleComponent::getAccessibleName()
-auto pVCLXAccessibleComponent = 
dynamic_cast(xCtx.get());
-if (pVCLXAccessibleComponent)
+static const char* pEnvAppendType = 
getenv("LIBO_APPEND_WINDOW_TYPE_TO_ACCESSIBLE_NAME");
+if (pEnvAppendType && OUString::createFromAscii(pEnvAppendType) != u"0")
 {
-auto windowType = pVCLXAccessibleComponent->GetWindow()->GetType();
-if (rest
-== Concat2View(u" (Type = " + 
OUString::number(static_cast(windowType))
-   + ")"))
-return true;
+auto pVCLXAccessibleComponent = 
dynamic_cast(xCtx.get());
+if (pVCLXAccessibleComponent)
+{
+auto windowType = pVCLXAccessibleComponent->GetWindow()->GetType();
+if (rest
+== Concat2View(u" (Type = " + 
OUString::number(static_cast(windowType))
+   + ")"))
+return true;
+}
 }
 #endif
 return false;
diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx 
b/toolkit/source/awt/vclxaccessiblecomponent.cxx
index 19ba5c4fbfc2..36d0451b2575 100644
--- a/toolkit/source/awt/vclxaccessiblecomponent.cxx
+++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx
@@ -629,7 +629,11 @@ OUString VCLXAccessibleComponent::getAccessibleName(  )
 {
 aName = GetWindow()->GetAccessibleName();
 #if OSL_DEBUG_LEVEL > 0
-aName += " (Type = " + 
OUString::number(static_cast(GetWindow()->GetType())) + ")";
+// append window type to accessible name for debugging purposes
+// if LIBO_APPEND_WINDOW_TYPE_TO_ACCESSIBLE_NAME environment variable 
is set
+static const char* pEnvAppendType = 
getenv("LIBO_APPEND_WINDOW_TYPE_TO_ACCESSIBLE_NAME");
+if (pEnvAppendType && OUString::createFromAscii(pEnvAppendType) != 
u"0")
+aName += " (Type = " + 
OUString::number(static_cast(GetWindow()->GetType())) + 

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

2023-08-01 Thread Michael Weghorn (via logerrit)
 accessibility/inc/extended/AccessibleGridControlHeader.hxx|8 -
 accessibility/source/extended/AccessibleGridControl.cxx   |   16 ++-
 accessibility/source/extended/AccessibleGridControlBase.cxx   |   14 +--
 accessibility/source/extended/AccessibleGridControlHeader.cxx |   22 ++---
 accessibility/source/extended/AccessibleGridControlHeaderCell.cxx |4 
 accessibility/source/extended/AccessibleGridControlTable.cxx  |2 
 accessibility/source/extended/AccessibleGridControlTableBase.cxx  |6 -
 accessibility/source/extended/AccessibleGridControlTableCell.cxx  |   17 ++-
 include/vcl/accessibletable.hxx   |   16 +--
 toolkit/source/controls/table/tablecontrol.cxx|   44 
+-
 10 files changed, 79 insertions(+), 70 deletions(-)

New commits:
commit e4ec702df16e04e66af42e2e35a607cb67d7d2c1
Author: Michael Weghorn 
AuthorDate: Tue Aug 1 21:11:57 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Aug 2 05:09:54 2023 +0200

a11y: Convert AccessibleTableControlObjType to enum class

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

diff --git a/accessibility/inc/extended/AccessibleGridControlHeader.hxx 
b/accessibility/inc/extended/AccessibleGridControlHeader.hxx
index 680b1ceced6a..419ec28233cd 100644
--- a/accessibility/inc/extended/AccessibleGridControlHeader.hxx
+++ b/accessibility/inc/extended/AccessibleGridControlHeader.hxx
@@ -33,8 +33,8 @@ class AccessibleGridControlHeader final : public 
AccessibleGridControlTableBase
 public:
 /**  @param rxParent  accessible parent control
  @param rTableaccessible table
- @param eObjType  One of the two allowed types TCTYPE_ROWHEADERBAR or
- TCTYPE_COLUMNHEADERBAR. */
+ @param eObjType  One of the two allowed types 
AccessibleTableControlObjType::ROWHEADERBAR or
+  AccessibleTableControlObjType::COLUMNHEADERBAR. */
 AccessibleGridControlHeader(
 const css::uno::Reference<
 css::accessibility::XAccessible >& rxParent,
@@ -139,12 +139,12 @@ private:
 
 inline bool AccessibleGridControlHeader::isRowBar() const
 {
-return getType() == ::vcl::table::TCTYPE_ROWHEADERBAR;
+return getType() == 
::vcl::table::AccessibleTableControlObjType::ROWHEADERBAR;
 }
 
 inline bool AccessibleGridControlHeader::isColumnBar() const
 {
-return getType() == ::vcl::table::TCTYPE_COLUMNHEADERBAR;
+return getType() == 
::vcl::table::AccessibleTableControlObjType::COLUMNHEADERBAR;
 }
 
 
diff --git a/accessibility/source/extended/AccessibleGridControl.cxx 
b/accessibility/source/extended/AccessibleGridControl.cxx
index 37d5013c8fa6..a9d946c9eea7 100644
--- a/accessibility/source/extended/AccessibleGridControl.cxx
+++ b/accessibility/source/extended/AccessibleGridControl.cxx
@@ -41,7 +41,7 @@ using namespace ::vcl::table;
 AccessibleGridControl::AccessibleGridControl(
 const css::uno::Reference< css::accessibility::XAccessible >& 
_rxParent, const css::uno::Reference< css::accessibility::XAccessible >& 
_rxCreator,
 ::vcl::table::IAccessibleTable& _rTable )
-: AccessibleGridControlBase( _rxParent, _rTable, TCTYPE_GRIDCONTROL ),
+: AccessibleGridControlBase(_rxParent, _rTable, 
AccessibleTableControlObjType::GRIDCONTROL),
   m_aCreator(_rxCreator)
 {
 }
@@ -102,7 +102,8 @@ AccessibleGridControl::getAccessibleChild( sal_Int64 
nChildIndex )
 {
 if(!m_xColumnHeaderBar.is())
 {
-m_xColumnHeaderBar = new 
AccessibleGridControlHeader(m_aCreator, m_aTable, 
vcl::table::TCTYPE_COLUMNHEADERBAR);
+m_xColumnHeaderBar = new 
AccessibleGridControlHeader(m_aCreator, m_aTable,
+ 
vcl::table::AccessibleTableControlObjType::COLUMNHEADERBAR);
 }
 xChild = m_xColumnHeaderBar.get();
 }
@@ -110,7 +111,8 @@ AccessibleGridControl::getAccessibleChild( sal_Int64 
nChildIndex )
 {
 if(!m_xRowHeaderBar.is())
 {
-m_xRowHeaderBar = new AccessibleGridControlHeader(m_aCreator, 
m_aTable, vcl::table::TCTYPE_ROWHEADERBAR);
+m_xRowHeaderBar = new AccessibleGridControlHeader(m_aCreator, 
m_aTable,
+  
vcl::table::AccessibleTableControlObjType::ROWHEADERBAR);
 }
 xChild = m_xRowHeaderBar.get();
 }
@@ -215,9 +217,9 @@ AccessibleGridControl::implGetHeaderBar( 
AccessibleTableControlObjType eObjType
 css::uno::Reference< css::accessibility::XAccessible > xRet;
 rtl::Reference< AccessibleGridControlHeader >* pxMember = nullptr;
 
-if( eObjType == TCTYPE_ROWHEADERBAR )
+if (eObjType == AccessibleTableControlObjT

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

2023-08-01 Thread Michael Weghorn (via logerrit)
 accessibility/source/extended/AccessibleGridControlTable.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit de9de202a6336f3ba8da0d2deeb8e1e34ac569ab
Author: Michael Weghorn 
AuthorDate: Tue Aug 1 19:09:48 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Aug 2 05:09:33 2023 +0200

tdf#156473 a11y: Properly retrireve a11y context from XAccessible

... by using `XAccessible::getAccessibleContext` rather
than trying to just query for the `XAccessibleContext`
interface on the `XAccessible` object.
(While in many cases, the class implementing
both interfaces is the same, that doesn't have to be
the case.)

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

diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx 
b/accessibility/source/extended/AccessibleGridControlTable.cxx
index 4629a4b3ee66..e0c1a9a1d27f 100644
--- a/accessibility/source/extended/AccessibleGridControlTable.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTable.cxx
@@ -372,7 +372,11 @@ Reference< XAccessibleTable > 
AccessibleGridControlTable::implGetHeaderBar(
 sal_Int32 nChildIndex )
 {
 Reference< XAccessible > xRet;
-Reference< XAccessibleContext > xContext( m_xParent, uno::UNO_QUERY );
+
+if (!m_xParent.is())
+return nullptr;
+
+Reference xContext = m_xParent->getAccessibleContext();
 if( xContext.is() )
 {
 try


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

2023-08-01 Thread Michael Weghorn (via logerrit)
 accessibility/source/extended/AccessibleGridControlTable.cxx |   14 +++
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 256926cace5819b0107e8d24579e05bcab9b5a7e
Author: Michael Weghorn 
AuthorDate: Tue Aug 1 18:12:18 2023 +0200
Commit: Michael Weghorn 
CommitDate: Wed Aug 2 05:09:07 2023 +0200

tdf#156473 a11y: Don't use selection index as child index

`XAccessibleSelection::getSelectedAccessibleChild` takes
the index into the selection, not the child index, as its
documentation (in
`offapi/com/sun/star/accessibility/XAccessibleSelection.idl`)
says:

> @param nSelectedChildIndex
> This index refers only to the selected children, not to all the
> children of this object.  Even if all children are selected, the
> indices enumerating the selected children need not be the same
> as those enumerating all children.  If only single selection is
> supported the only valid value is 0.

The previous handling here in
`AccessibleGridControlTable::getSelectedAccessibleChild`
was treating it as the child index, though. Therefore
trying to get the selected children would break once
any row other than the first was selected.

Fix this by calculating the actual row/column index
of the cell from the given *selection* index.

This could be observed e.g. with the qt6 VCL plugin by
querying selection from Accerciser, with the last row
selected in the table from the tdf#156473 macro in LO
and the corresponding table object selected in
Accerciser's tree view of the LO a11y hierarchy:

Before:

In [41]: sel = acc.querySelection()
In [42]: sel.nSelectedChildren
Out[42]: 5
In [43]: sel.getSelectedChild(0)
In [44]: sel.getSelectedChild(0) == None
Out[44]: True

With the fix in place:

In [48]: sel = acc.querySelection()
In [49]: sel.nSelectedChildren
Out[49]: 5
In [50]: sel.getSelectedChild(0)
Out[50]: 
In [51]: sel.getSelectedChild(0).name
Out[51]: 'C1 , R4 , '
In [52]: sel.getSelectedChild(1).name
Out[52]: 'C2 , R4 , '
In [53]: sel.getSelectedChild(4).name
Out[53]: 'Column 5 , R4 , '

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

diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx 
b/accessibility/source/extended/AccessibleGridControlTable.cxx
index 579826195be2..4629a4b3ee66 100644
--- a/accessibility/source/extended/AccessibleGridControlTable.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTable.cxx
@@ -253,10 +253,16 @@ AccessibleGridControlTable::getSelectedAccessibleChild( 
sal_Int64 nSelectedChild
 SolarMutexGuard aSolarGuard;
 
 ensureIsAlive();
-if(isAccessibleChildSelected(nSelectedChildIndex))
-return getAccessibleChild(nSelectedChildIndex);
-else
-return nullptr;
+if (nSelectedChildIndex < 0 || nSelectedChildIndex >= 
getSelectedAccessibleChildCount())
+throw lang::IndexOutOfBoundsException("Invalid index into selection", 
*this);
+
+const sal_Int32 nColCount = getAccessibleColumnCount();
+assert(nColCount > 0 && "Column count non-positive, but child count > 0");
+const sal_Int32 nIndexInSelectedRowsSequence = nSelectedChildIndex / 
nColCount;
+const Sequence aSelectedRows = getSelectedAccessibleRows();
+const sal_Int32 nRowIndex = aSelectedRows[nIndexInSelectedRowsSequence];
+const sal_Int32 nColIndex = nSelectedChildIndex % nColCount;
+return getAccessibleCellAt(nRowIndex, nColIndex);
 }
 //not implemented yet, because only row selection possible
 void SAL_CALL AccessibleGridControlTable::deselectAccessibleChild(


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

2023-08-01 Thread Patrick Luby (via logerrit)
 sc/source/ui/view/cellsh.cxx |   12 
 1 file changed, 12 deletions(-)

New commits:
commit 233f81aaf9b74da8e36e5f5a3ed50a15ba11c6da
Author: Patrick Luby 
AuthorDate: Sun Jul 30 09:04:19 2023 -0400
Commit: Thorsten Behrens 
CommitDate: Wed Aug 2 01:24:33 2023 +0200

tdf#156506 Fix failure to draw copy border on Windows

Revert portion of commit 9d68c794d67259a38de1465090f6f1e7fb588d62
that stops the animated border when a copy action is performed in
a different document by cancelling the animated border.

While the change worked on macOS and Linux, on Windows it stops
the currently active copy border so revert this fix.

Change-Id: I0dbdc8b1bf3077eecadbbe591a27e60ef3d48b7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155039
Reviewed-by: Michael Weghorn 
Reviewed-by: Patrick Luby 
Reviewed-by: Xisco Fauli 
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 

diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 1a8216e6a1ba..ec5914a2224b 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -557,18 +557,6 @@ IMPL_LINK( ScCellShell, ClipboardChanged, 
TransferableDataHelper*, pDataHelper,
 rBindings.Invalidate( SID_PASTE_AS_LINK );
 rBindings.Invalidate( SID_PASTE_TEXTIMPORT_DIALOG );
 rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
-
-// Fix failure to stop the animated border when a copy action is
-// performed in a different document by cancelling the animated border.
-// This transferable has lost ownership of the system clipboard so,
-// in essence, the previous copy action that created this transferable
-// has been cancelled.
-if ( !GetViewData().IsAnyFillMode() )
-{
-GetViewData().SetPasteMode( ScPasteFlags::NONE );
-// Clear CopySourceOverlay in each window of a split/frozen tabview
-GetViewData().GetView()->UpdateCopySourceOverlay();
-}
 }
 
 namespace {


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

2023-08-01 Thread Balazs Varga (via logerrit)
 sw/source/core/access/AccessibilityCheck.cxx |   46 +--
 1 file changed, 37 insertions(+), 9 deletions(-)

New commits:
commit 47ca3f1f762352b488d58b3bf23d5776576f1cca
Author: Balazs Varga 
AuthorDate: Mon Jul 31 15:11:44 2023 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Aug 2 01:15:51 2023 +0200

tdf#156545 - a11y - fix warns about background character style formattings

Do not add warn to a11y sidebar if we use charstyle for character background
format.

Change-Id: Ide558b590cae2bc20c71c5c44909cd2cdeb89985
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155095
Tested-by: Jenkins
Tested-by: Gabor Kelemen 
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index ac0f442a5041..501799a2a2ff 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -480,15 +480,43 @@ private:
 aBackgroundColor = nParaBackColor;
 else
 {
-auto pIssue
-= lclAddIssue(m_rIssueCollection, 
SwResId(STR_TEXT_FORMATTING_CONVEYS_MEANING),
-  sfx::AccessibilityIssueID::TEXT_FORMATTING);
-pIssue->setIssueObject(IssueObject::TEXT);
-pIssue->setNode(pTextNode);
-SwDoc& rDocument = pTextNode->GetDoc();
-pIssue->setDoc(rDocument);
-pIssue->setStart(nTextStart);
-pIssue->setEnd(nTextStart + xTextRange->getString().getLength());
+OUString sCharStyleName;
+Color nCharStyleBackColor(COL_AUTO);
+if (xProperties->getPropertyValue("CharStyleName") >>= 
sCharStyleName)
+{
+try
+{
+uno::Reference 
xStyleFamiliesSupplier(
+pTextNode->GetDoc().GetDocShell()->GetModel(), 
uno::UNO_QUERY);
+uno::Reference xCont
+= xStyleFamiliesSupplier->getStyleFamilies();
+uno::Reference xStyleFamily(
+xCont->getByName("CharacterStyles"), uno::UNO_QUERY);
+uno::Reference xInfo(
+xStyleFamily->getByName(sCharStyleName), 
uno::UNO_QUERY);
+xInfo->getPropertyValue("CharBackColor") >>= 
nCharStyleBackColor;
+}
+catch (const uno::Exception&)
+{
+}
+}
+else
+{
+SAL_WARN("sw.a11y", "CharStyleName void");
+}
+
+if (aBackgroundColor != nCharStyleBackColor)
+{
+auto pIssue
+= lclAddIssue(m_rIssueCollection, 
SwResId(STR_TEXT_FORMATTING_CONVEYS_MEANING),
+  sfx::AccessibilityIssueID::TEXT_FORMATTING);
+pIssue->setIssueObject(IssueObject::TEXT);
+pIssue->setNode(pTextNode);
+SwDoc& rDocument = pTextNode->GetDoc();
+pIssue->setDoc(rDocument);
+pIssue->setStart(nTextStart);
+pIssue->setEnd(nTextStart + 
xTextRange->getString().getLength());
+}
 }
 
 Color aForegroundColor(ColorTransparency, nCharColor);


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

2023-08-01 Thread Gabor Kelemen (via logerrit)
 svx/uiconfig/ui/accessibilitycheckentry.ui |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a454ee60efcb4eb3401d3c6b5196155375452993
Author: Gabor Kelemen 
AuthorDate: Mon Jul 31 12:18:09 2023 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Aug 2 01:13:07 2023 +0200

Add translator comment to clarify meaning of the Fix button

Change-Id: I9e792bb27523a2daf6afca00ad1c210e6b274573
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155087
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/svx/uiconfig/ui/accessibilitycheckentry.ui 
b/svx/uiconfig/ui/accessibilitycheckentry.ui
index 3bf122c0b70f..1eb5511cfd1d 100644
--- a/svx/uiconfig/ui/accessibilitycheckentry.ui
+++ b/svx/uiconfig/ui/accessibilitycheckentry.ui
@@ -46,7 +46,7 @@
 
 
   
-Fix
+Fix
 True
 True
 True


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - editeng/source officecfg/registry sw/qa

2023-08-01 Thread Baole Fang (via logerrit)
 editeng/source/misc/swafopt.cxx|2 
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |2 
 sw/qa/uitest/data/tdf156165.odt|binary
 sw/qa/uitest/writer_tests/tdf156165.py |   80 +
 4 files changed, 82 insertions(+), 2 deletions(-)

New commits:
commit e50ec4d8ddca5dfe6a4f329298c0bae4edc5e41c
Author: Baole Fang 
AuthorDate: Thu Jul 6 12:03:31 2023 -0400
Commit: Thorsten Behrens 
CommitDate: Wed Aug 2 00:36:44 2023 +0200

tdf#156165: Fix replace custom styles while typing

Originally, Replace Custom Styles changes styles to text body by entering 
BuiltText. Since styles change to text body is removed from BuiltTest, it is 
converted independently.

Now, conversion is applied even during typing because m_aFlags.bChgUserColl 
is true (its default value) during typing. Therefore, its default value is 
changed to false.

Change-Id: I8ce067b311922b5e1bdcd84036229c369b50a977
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154144
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit e26aeb882dd236adf19679d5df9b7ba5da1ed226)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155043
Reviewed-by: Thorsten Behrens 

diff --git a/editeng/source/misc/swafopt.cxx b/editeng/source/misc/swafopt.cxx
index f6de4098d2e4..f5f79a45be97 100644
--- a/editeng/source/misc/swafopt.cxx
+++ b/editeng/source/misc/swafopt.cxx
@@ -27,7 +27,6 @@ SvxSwAutoFormatFlags::SvxSwAutoFormatFlags()
 bAutoCorrect =
 bCapitalStartSentence =
 bCapitalStartWord =
-bChgUserColl =
 bChgEnumNum =
 bAddNonBrkSpace =
 bChgOrdinalNumber =
@@ -42,6 +41,7 @@ SvxSwAutoFormatFlags::SvxSwAutoFormatFlags()
 bAFormatByInpDelSpacesAtSttEnd =
 bAFormatByInpDelSpacesBetweenLines = true;
 
+bChgUserColl =
 bReplaceStyles =
 bDelEmptyNode =
 bWithRedlining =
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 0f684bb2eea9..cfa36e974ca8 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -4235,7 +4235,7 @@
   Specifies whether user-defined styles applied in the 
document are replaced by predefined text document styles.
   Replace user-defined styles
 
-true
+false
   
   
 
diff --git a/sw/qa/uitest/data/tdf156165.odt b/sw/qa/uitest/data/tdf156165.odt
new file mode 100644
index ..aabcfef91499
Binary files /dev/null and b/sw/qa/uitest/data/tdf156165.odt differ
diff --git a/sw/qa/uitest/writer_tests/tdf156165.py 
b/sw/qa/uitest/writer_tests/tdf156165.py
new file mode 100644
index ..69d1928bb8ce
--- /dev/null
+++ b/sw/qa/uitest/writer_tests/tdf156165.py
@@ -0,0 +1,80 @@
+# -*- 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/.
+#
+
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+from uitest.uihelper.common import select_pos
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from time import sleep
+
+class tdf156165(UITestCase):
+
+   def test_tdf156165(self):
+with self.ui_test.load_file(get_url_for_data_file("tdf156165.odt")):
+xMainWindow = self.xUITest.getTopFocusWindow()
+writer_edit = xMainWindow.getChild("writer_edit")
+style=xMainWindow.getChild('applystyle')
+
+with 
self.ui_test.execute_dialog_through_command(".uno:AutoCorrectDlg") as xDialog:
+xTabs = xDialog.getChild("tabcontrol")
+select_pos(xTabs, "2")
+options=xDialog.getChild('list')
+checkbox=options.getChild("16")
+self.assertEqual("Replace Custom Styles", 
get_state_as_dict(checkbox)["Text"])
+
+# Replace Custom Styles is default to be false
+self.assertEqual("false", 
get_state_as_dict(checkbox)["IsChecked"])
+
+# Replace Custom Styles when applying manully with it disabled, 
should not change style
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"0", "START_POS": "12"}))
+self.xUITest.executeCommand(".uno:AutoFormatApply")
+sleep(1)
+self.assertEqual(get_state_as_dict(style)["Text"], "eSelah")
+
+# Replace Custom Styles when typing with it disabled, should not 
change style
+writer_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"DOWN"}))
+writer_edit.exe

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

2023-08-01 Thread Xisco Fauli (via logerrit)
 svgio/inc/svgcharacternode.hxx  |2 +
 svgio/qa/cppunit/SvgImportTest.cxx  |   36 ++-
 svgio/qa/cppunit/data/tdf156283.svg |4 +++
 svgio/source/svgreader/svgcharacternode.cxx |   37 +++-
 4 files changed, 67 insertions(+), 12 deletions(-)

New commits:
commit ac8fd70e4e23d12857f766a4918747bbc5a7cb9b
Author: Xisco Fauli 
AuthorDate: Tue Aug 1 18:19:20 2023 +0200
Commit: Xisco Fauli 
CommitDate: Tue Aug 1 23:27:51 2023 +0200

tdf#156283: take remaing dx value into consideration too

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

diff --git a/svgio/inc/svgcharacternode.hxx b/svgio/inc/svgcharacternode.hxx
index 5fad2008ba1c..8861055f8e65 100644
--- a/svgio/inc/svgcharacternode.hxx
+++ b/svgio/inc/svgcharacternode.hxx
@@ -82,6 +82,7 @@ namespace svgio::svgreader
 SvgTextPosition*mpParent;
 ::std::vector< double > maX;
 ::std::vector< double > maY;
+::std::vector< double > maDx;
 ::std::vector< double > maRotate;
 double  mfTextLength;
 
@@ -103,6 +104,7 @@ namespace svgio::svgreader
 // data read access
 const SvgTextPosition* getParent() const { return mpParent; }
 const ::std::vector< double >& getX() const { return maX; }
+const ::std::vector< double >& getDx() const { return maDx; }
 double getTextLength() const { return mfTextLength; }
 bool getLengthAdjust() const { return mbLengthAdjust; }
 bool getAbsoluteX() const { return mbAbsoluteX; }
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx 
b/svgio/qa/cppunit/SvgImportTest.cxx
index 5845b7ea6f52..9bc0dfc24e19 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -1431,6 +1431,39 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156269)
 assertXPath(pDocument, "//textsimpleportion[@text='two']", "fontcolor", 
"#00");
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf156283)
+{
+Primitive2DSequence aSequence = 
parseSvg(u"/svgio/qa/cppunit/data/tdf156283.svg");
+CPPUNIT_ASSERT_EQUAL(1, static_cast(aSequence.getLength()));
+
+drawinglayer::Primitive2dXmlDump dumper;
+xmlDocUniquePtr pDocument = 
dumper.dumpAndParse(Primitive2DContainer(aSequence));
+
+CPPUNIT_ASSERT (pDocument);
+
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", 
"width", "16");
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", 
"height", "16");
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "x", 
"30");
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "y", 
"20");
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", 
"text", "ABC");
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", 
"dx0", "41");
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", 
"dx1", "52");
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", 
"dx2", "63");
+
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", 
"width", "16");
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", 
"height", "16");
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "x", 
"30");
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "y", 
"30");
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", 
"text", "ABC");
+
+// Without the fix in place, this test would have failed with
+// - Expected: 41
+// - Actual  : 12
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", 
"dx0", "41");
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", 
"dx1", "52");
+assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", 
"dx2", "63");
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testTdf156271)
 {
 Primitive2DSequence aSequence = 
parseSvg(u"/svgio/qa/cppunit/data/tdf156271.svg");
@@ -1474,7 +1507,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156271)
 assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[4]", 
"x", "40");
 assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[4]", 
"y", "40");
 assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[4]", 
"text", "AB");
-assertXPathNoAttribute(pDocument, 
"/primitive2D/transform/mask/textsimpleportion[4]", "dx0");
+assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[4]", 
"dx0", "12");
+assertXPath(pDocument, "/primitive2D/transform/mask/textsimpleportion[4]", 
"dx1", "23");
 }
 
 CPPUNIT_TEST_FIXTURE(Test, testTdf149880)
diff --git a/svgio/qa/cppunit/data/tdf156283.svg 
b/svgio/qa/cppunit/data

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

2023-08-01 Thread Patrick Luby (via logerrit)
 reportdesign/source/ui/report/ViewsWindow.cxx |   14 --
 svx/source/svdraw/svdhdl.cxx  |1 +
 2 files changed, 1 insertion(+), 14 deletions(-)

New commits:
commit 73adf93acc9bbac4c8db9aa844930629a429410e
Author: Patrick Luby 
AuthorDate: Tue Aug 1 16:09:53 2023 +0200
Commit: Patrick Luby 
CommitDate: Tue Aug 1 21:23:30 2023 +0200

Revert "tdf#144072 prevent use of a deleted pointer"

This reverts commit 01a1d2a84992973b8a0e5f1ae99fd32f5913b58f.

That commit appeared to fix tdf#144072 but it only delays the crash as the 
reportdesign module will keep reusing the same SdHdl pointer that has already 
been deleted.

Change-Id: I8e416b0376aa8724b697f54ed45f58341b47dc2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155181
Tested-by: Patrick Luby 
Reviewed-by: Patrick Luby 

diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx 
b/reportdesign/source/ui/report/ViewsWindow.cxx
index a5ad82e818e2..e11735bf72ca 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -1043,21 +1043,7 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, 
SdrHdl* _pHdl,const OSectionVi
 "createInvisible X:" << aRect.Left() << " Y:"
 << aRect.Top() << " on View #" << nViewCount);
 
-// tdf#144072 prevent use of a deleted pointer
-// BegDragObj_createInvisibleObjectAtPosition() may clear
-// the handle list and that will delete the SdrHdl 
instances
-// owned by this section view so set _pHdl to null if it 
has
-// been deleted during the call.
-bool bHdlInList = false;
-const SdrHdlList& rHdlList = rView.GetHdlList();
-if (_pHdl && rHdlList.GetHdlNum(_pHdl) < 
rHdlList.GetHdlCount())
-bHdlInList = true;
 BegDragObj_createInvisibleObjectAtPosition(aRect, rView);
-if (bHdlInList && rHdlList.GetHdlNum(_pHdl) >= 
rHdlList.GetHdlCount())
-{
-SAL_WARN("reportdesign", "SdrHdl pointer parameter has 
been deleted");
-_pHdl = nullptr;
-}
 }
 }
 }
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 3bcebf59ea26..de6ffcd8175f 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -2282,6 +2282,7 @@ size_t SdrHdlList::GetHdlNum(const SdrHdl* pHdl) const
 return SAL_MAX_SIZE;
 auto it = std::find_if( maList.begin(), maList.end(),
 [&](const std::unique_ptr & p) { return p.get() == pHdl; });
+assert(it != maList.end());
 if( it == maList.end() )
 return SAL_MAX_SIZE;
 return it - maList.begin();


[Libreoffice-commits] core.git: salhelper/qa sal/IwyuFilter_sal.yaml sal/osl sax/source

2023-08-01 Thread Venetia Furtado (via logerrit)
 sal/IwyuFilter_sal.yaml  |6 ++
 sal/osl/all/debugbase.cxx|1 -
 sal/osl/all/loadmodulerelative.cxx   |3 ---
 sal/osl/all/log.cxx  |2 --
 sal/osl/all/signalshared.cxx |1 -
 salhelper/qa/test_api.cxx|3 ---
 sax/source/fastparser/fastparser.cxx |1 -
 sax/source/tools/fastattribs.cxx |1 -
 sax/source/tools/fastserializer.cxx  |1 -
 9 files changed, 6 insertions(+), 13 deletions(-)

New commits:
commit 025f540dba1c5b046b4fdbd9418dcaaa900e006d
Author: Venetia Furtado 
AuthorDate: Fri Jul 28 19:46:39 2023 -0600
Commit: Gabor Kelemen 
CommitDate: Tue Aug 1 21:13:47 2023 +0200

tdf#146619 Remove unused #includes from C/C++ files

Change-Id: Ia8b406b6a59086160a5167480c6d3bde6574ffbe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155029
Tested-by: Jenkins
Tested-by: Gabor Kelemen 
Reviewed-by: Gabor Kelemen 

diff --git a/sal/IwyuFilter_sal.yaml b/sal/IwyuFilter_sal.yaml
new file mode 100644
index ..4337fa73b4c3
--- /dev/null
+++ b/sal/IwyuFilter_sal.yaml
@@ -0,0 +1,6 @@
+---
+assumeFilename: sal/osl/all/log.cxx
+excludelist:
+sal/osl/all/log.cxx:
+#sal_use_syslog required from this file
+- salusesyslog.hxx
\ No newline at end of file
diff --git a/sal/osl/all/debugbase.cxx b/sal/osl/all/debugbase.cxx
index b4b598589a00..51656e7d37d2 100644
--- a/sal/osl/all/debugbase.cxx
+++ b/sal/osl/all/debugbase.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
 #include 
 #include 
 #include 
diff --git a/sal/osl/all/loadmodulerelative.cxx 
b/sal/osl/all/loadmodulerelative.cxx
index 242bb6210a76..f7a6938ed130 100644
--- a/sal/osl/all/loadmodulerelative.cxx
+++ b/sal/osl/all/loadmodulerelative.cxx
@@ -18,9 +18,6 @@
  */
 
 #include 
-
-#include 
-
 #include 
 #include 
 #include 
diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx
index e9895e14cb7b..15cb269a1976 100644
--- a/sal/osl/all/log.cxx
+++ b/sal/osl/all/log.cxx
@@ -11,11 +11,9 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
diff --git a/sal/osl/all/signalshared.cxx b/sal/osl/all/signalshared.cxx
index 530413f2604c..9ed08626f74f 100644
--- a/sal/osl/all/signalshared.cxx
+++ b/sal/osl/all/signalshared.cxx
@@ -23,7 +23,6 @@
 
 #include 
 
-#include 
 #include 
 
 namespace
diff --git a/salhelper/qa/test_api.cxx b/salhelper/qa/test_api.cxx
index 2d4b8be0e2a8..54353e228479 100644
--- a/salhelper/qa/test_api.cxx
+++ b/salhelper/qa/test_api.cxx
@@ -18,9 +18,6 @@
  */
 
 #include 
-
-#include 
-
 #include 
 #include 
 #include 
diff --git a/sax/source/fastparser/fastparser.cxx 
b/sax/source/fastparser/fastparser.cxx
index 344dda9cd63e..fd1b147f044e 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -34,7 +34,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx
index 917e9c8ab048..45e2e9c5ebba 100644
--- a/sax/source/tools/fastattribs.cxx
+++ b/sax/source/tools/fastattribs.cxx
@@ -20,7 +20,6 @@
 #include 
 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/sax/source/tools/fastserializer.cxx 
b/sax/source/tools/fastserializer.cxx
index 9461e784ca4a..50408e4dc284 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 


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

2023-08-01 Thread Xisco Fauli (via logerrit)
 sc/qa/unit/uicalc/data/tdf156462.ods |binary
 sc/qa/unit/uicalc/uicalc.cxx |   15 +++
 2 files changed, 15 insertions(+)

New commits:
commit cfb1e6354e095d0addf9f7a1114902b2bce5f627
Author: Xisco Fauli 
AuthorDate: Tue Aug 1 16:17:32 2023 +0200
Commit: Xisco Fauli 
CommitDate: Tue Aug 1 19:33:34 2023 +0200

tdf#156462: sc_uicalc: Add unittest

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

diff --git a/sc/qa/unit/uicalc/data/tdf156462.ods 
b/sc/qa/unit/uicalc/data/tdf156462.ods
new file mode 100644
index ..3f77ac3be0b3
Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf156462.ods differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index d96b78b87136..9a795f4a5bde 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -1227,6 +1227,21 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf68290)
 lcl_AssertCurrentCursorPosition(*pDocSh, u"M3");
 }
 
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf156462)
+{
+createScDoc("tdf156462.ods");
+ScDocShell* pDocSh = getScDocShell();
+
+lcl_AssertCurrentCursorPosition(*pDocSh, u"G2");
+
+ScModelObj* pModelObj = 
comphelper::getFromUnoTunnel(mxComponent);
+pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_MOD1 | KEY_LEFT);
+Scheduler::ProcessEventsToIdle();
+
+// Without the fix in place, the cursor would have jumped to cell C2
+lcl_AssertCurrentCursorPosition(*pDocSh, u"D2");
+}
+
 CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf132057)
 {
 createScDoc("tdf132057.ods");


New tests: GTK3 platform accessibility

2023-08-01 Thread Colomban Wendling

Hello everyone,

Platform accessibility (a11y) conformance tests for the GTK3 VCL [1] 
have been merged a couple days ago.  This is a set of tests validating 
that the a11y exposed to the platform on Linux using the GTK3 VCL is 
coherent with the internal representation in LO.  This can catch (and 
already had caught) issues in the VCL layer not correctly transmitting 
data over -- and even more [2].  You can read a bit more on the 
technical side of things on the wiki page [3].


These tests are enabled by default if all dependencies are available. 
That is a working Xvfb [4], dbus-launch, and the AT-SPI2 library [5] 
which is used to communicate with the platform accessibility daemon.  It 
is also possible to either enable or disable them forcefully, using 
--enable-atspi-test and --disable-atspi-tests respectively.


Linux CIs are running these tests, but anybody willing is encouraged to 
enable those locally and report any issue (don't hesitate to CC me).


Anybody interested is also more than welcome to extend coverage of these 
tests!  At the moment only a subset of the a11y APIs are checked, yet it 
should not be very hard to add more.  If you're interested, give [3] a 
look and again, don't hesitate to get in touch with me.
If you're interested in making this work with another VCL (Qt6, GTK4, 
etc.) it would also be great, but probably require a tad more work.  It 
would however be very interesting, and would add coverage for another 
substantial module :)


You're also more than welcome to build on the concept for other 
platforms (e.g. Window or macos).  I expect those to look fairly 
similar, but require a wholly different platform wrapping layer 
(obviously they'd use something other than libatspi, and they might need 
to adapt to differences in the platform's expectations, although they 
are actually fairly similar).


Happy testing!
Regards,
Colomban

PS: huge thanks to everyone that helped me getting this finally done, 
including but not limited to testing, fixing blocker bugs, adjust CI 
environment, and everything else :)


[1] https://gerrit.libreoffice.org/c/core/+/153069
[2] e.g. https://bugs.documentfoundation.org/show_bug.cgi?id=155625
[3] 
https://wiki.documentfoundation.org/Development/Accessibility_Unit_Tests#Platform_accessibility_tests

[4] https://en.wikipedia.org/wiki/Xvfb
[5] https://docs.gtk.org/atspi2/index.html


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

2023-08-01 Thread Khaled Hosny (via logerrit)
 vcl/qa/cppunit/complextext.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 21f13b90295edf84f87125791e05810666058a1c
Author: Khaled Hosny 
AuthorDate: Tue Aug 1 14:49:12 2023 +0300
Commit: خالد حسني 
CommitDate: Tue Aug 1 18:43:58 2023 +0200

Fix reversed expected and actual unit test results

Change-Id: Ie7eaec7ce9ad6f85b02edc831f1d138f45c18220
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155152
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx
index ec6ce0ccd0e2..a0ab0c4c00bc 100644
--- a/vcl/qa/cppunit/complextext.cxx
+++ b/vcl/qa/cppunit/complextext.cxx
@@ -566,10 +566,10 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testTdf107612)
 
 // Assert that U+202F is included in the fallback run.
 // Without the fix this fails with:
-// - Expected: { 2 }
-// - Actual  : { 1, 2 }
+// - Expected: { 1, 2 }
+// - Actual  : { 2 }
 std::vector aExpctedFallbacks = { 1, 2 };
-CPPUNIT_ASSERT_EQUAL(aFallbacks, aExpctedFallbacks);
+CPPUNIT_ASSERT_EQUAL(aExpctedFallbacks, aExpctedFallbacks);
 #endif
 }
 


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

2023-08-01 Thread Andrea Gelmini (via logerrit)
 vcl/inc/qt5/QtMenu.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 27701d49327f8303ec1791f1b3fa4661b0480ac9
Author: Andrea Gelmini 
AuthorDate: Tue Aug 1 15:27:12 2023 +0200
Commit: Julien Nabet 
CommitDate: Tue Aug 1 18:36:53 2023 +0200

Fix typo

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

diff --git a/vcl/inc/qt5/QtMenu.hxx b/vcl/inc/qt5/QtMenu.hxx
index bd704507f69c..ffc00d402950 100644
--- a/vcl/inc/qt5/QtMenu.hxx
+++ b/vcl/inc/qt5/QtMenu.hxx
@@ -68,7 +68,7 @@ private:
 QPushButton* ImplAddMenuBarButton(const QIcon& rIcon, const QString& 
rToolTip, int nId);
 void ImplRemoveMenuBarButton(int nId);
 void connectHelpShortcut(QMenu* pMenu);
-// set slots that handle signals relevent for help menu
+// set slots that handle signals relevant for help menu
 void connectHelpSignalSlots(QMenu* pMenu, QtMenuItem* pSalMenuItem);
 
 public:


[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - download.lst

2023-08-01 Thread Stephan Bergmann (via logerrit)
 download.lst |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4b8da4693bf5322e4f18ae9168ec434c99f4f9f6
Author: Stephan Bergmann 
AuthorDate: Mon Jul 31 21:34:49 2023 +0200
Commit: Xisco Fauli 
CommitDate: Tue Aug 1 17:57:26 2023 +0200

Update to curl-8.2.1.tar.xz

...obtained from 

Change-Id: I7260f79e2f72501869ff58c77f0d9dfa3ebdece1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155116
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit 85c07891ad9424661d8e1adb8e93364e3964ce34)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155133
Reviewed-by: Xisco Fauli 

diff --git a/download.lst b/download.lst
index 515c1fab7ab6..754fdb56e150 100644
--- a/download.lst
+++ b/download.lst
@@ -75,8 +75,8 @@ CPPUNIT_TARBALL := cppunit-1.15.1.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-CURL_SHA256SUM := 
31b1118eb8bfd43cd95d9a3f146f814ff874f6ed3999b29d94f4d1e7dbac5ef6
-CURL_TARBALL := curl-8.1.2.tar.xz
+CURL_SHA256SUM := 
dd322f6bd0a20e6cebdfd388f69e98c3d183bed792cf4713c8a7ef498cba4894
+CURL_TARBALL := curl-8.2.1.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - connectivity/source

2023-08-01 Thread jucasaca (via logerrit)
 connectivity/source/parse/sqlbison.y |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b42238e7ab74b53c2b2f6b9463297aa9bde23119
Author: jucasaca 
AuthorDate: Sat Jul 22 17:40:58 2023 +0200
Commit: Xisco Fauli 
CommitDate: Tue Aug 1 17:56:45 2023 +0200

fixing a typo in sqlbison.y

schema_glement_list is not registered, son can't be used. 
schema_element_list is registered and defined and seems to be the correct

Change-Id: I7661532707ce6ddb32b95629192e9ba9847f21df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154766
Reviewed-by: Julien Nabet 
Reviewed-by: Lionel Mamane 
Tested-by: Lionel Mamane 
(cherry picked from commit f8a312617838e8626e6e406791ad8d0aac368f23)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155171
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/connectivity/source/parse/sqlbison.y 
b/connectivity/source/parse/sqlbison.y
index cbad86149fc2..b06a75fd3739 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -323,7 +323,7 @@ schema:
 
 opt_schema_element_list:
{$$ = SQL_NEW_RULE;}
-   |   schema_glement_list
+   |   schema_element_list
;
 
 schema_element_list:


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

2023-08-01 Thread László Németh (via logerrit)
 sw/qa/extras/uiwriter/uiwriter5.cxx |   76 
 sw/source/core/frmedt/fetab.cxx |4 +
 2 files changed, 79 insertions(+), 1 deletion(-)

New commits:
commit 33058b5dc47a140516669945efbdd30ea65138a6
Author: László Németh 
AuthorDate: Tue Aug 1 13:10:07 2023 +0200
Commit: László Németh 
CommitDate: Tue Aug 1 17:22:03 2023 +0200

tdf#156544 sw tracked table column: delete empty column

Empty table columns were removed without change tracking
in Record Changes mode, too.

Follow-up to commit fe43f5971dfd2a121634eea9e39c7ad0cf3f962a
"tdf#156475 sw tracked table column: delete empty cell".

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

diff --git a/sw/qa/extras/uiwriter/uiwriter5.cxx 
b/sw/qa/extras/uiwriter/uiwriter5.cxx
index 07579cc6662a..3e8babfff390 100644
--- a/sw/qa/extras/uiwriter/uiwriter5.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter5.cxx
@@ -2701,6 +2701,82 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf155747)
 assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 1);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf156544)
+{
+// load a table, and insert a column without change tracking,
+// and delete the first column with the empty cell in the second row with 
change tracking
+createSwDoc("tdf118311.fodt");
+SwDoc* pDoc = getSwDoc();
+
+// turn off red-lining and show changes
+pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::ShowDelete
+  | 
RedlineFlags::ShowInsert);
+CPPUNIT_ASSERT_MESSAGE("redlining should be off",
+   !pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+
+CPPUNIT_ASSERT_MESSAGE(
+"redlines should be visible",
+
IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+
+// insert table column without change tracking
+// (HasTextChangesOnly property of the cell will be false)
+dispatchCommand(mxComponent, ".uno:InsertColumnsBefore", {});
+
+// check table
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "//page[1]//body/tab");
+assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
+assertXPath(pXmlDoc, "//page[1]//body/tab/row[1]/cell", 3);
+
+// turn on red-lining
+pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::On | 
RedlineFlags::ShowDelete
+  | 
RedlineFlags::ShowInsert);
+CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+   pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+
+// go to the empty column
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, 
/*bBasicCall=*/false);
+
+// delete table column with enabled change tracking
+// (HasTextChangesOnly property of the cell will be false)
+dispatchCommand(mxComponent, ".uno:DeleteColumns", {});
+
+discardDumpedLayout();
+pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "//page[1]//body/tab");
+assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
+
+// This was 2 (deleted column)
+assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 3);
+
+// accept the deletion of the empty column
+dispatchCommand(mxComponent, ".uno:AcceptTrackedChange", {});
+
+discardDumpedLayout();
+pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "//page[1]//body/tab");
+assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
+assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+
+// test Undo/Redo
+dispatchCommand(mxComponent, ".uno:Undo", {});
+
+discardDumpedLayout();
+pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "//page[1]//body/tab");
+assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
+assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 3);
+
+dispatchCommand(mxComponent, ".uno:Redo", {});
+
+discardDumpedLayout();
+pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "//page[1]//body/tab");
+assertXPath(pXmlDoc, "//page[1]//body/tab/row", 1);
+assertXPath(pXmlDoc, "//page[1]//body/tab/row/cell", 2);
+}
+
 #ifndef DBG_UTIL
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf149498)
 {
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index c271d975d567..8a6a664fe206 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -283,6 +283,7 @@ bool SwFEShell::DeleteCol()
 // and set IsNoTracked table box property to false
 if ( GetDoc()->GetDocShell()->IsChangeRecording() )
 {
+bool bDeletedEmptyCell = false;
 StartUndo(SwUndoId::COL_DELETE);
 StartAllAction();
 
@@ -317,6 +318,7 @@ bool SwFEShell::DeleteCol()
  

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

2023-08-01 Thread Jim Raykowski (via logerrit)
 svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 617558caec55960183c19ec8bedd701a674c8984
Author: Jim Raykowski 
AuthorDate: Wed Jul 19 21:35:16 2023 -0800
Commit: Xisco Fauli 
CommitDate: Tue Aug 1 17:19:11 2023 +0200

tdf#154038 tdf#83618 fix wrong line spacing value

Impress and Writer seem to require different MapUnit values for fixed
line spacing metric values to be correctly calculated. This patch
initially sets the MapUnit unit value to Map100thMM, which is what it
was before commit 849b837d1a3b185a8dd893a8f6eaed53605bcab1, which works
for Impress. For Writer, the value is set to MapTwip.

Change-Id: I49e9b80aa4d3fbda1f19101903d2a4459089024c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154665
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 
(cherry picked from commit efbdd13f96888ae06717afafb1e4014ce502aa3e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155170
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx 
b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
index fee659817a14..4c756a5b1224 100644
--- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
+++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
@@ -32,6 +32,8 @@
 
 #include 
 
+#include 
+
 #define DEFAULT_LINE_SPACING  200
 #define FIX_DIST_DEF  283
 #define LINESPACE_1   100
@@ -134,7 +136,12 @@ void ParaLineSpacingControl::Initialize()
 if( bItemStateSet && (eState == SfxItemState::DEFAULT || eState == 
SfxItemState::SET) )
 {
 const SvxLineSpacingItem* currSPItem = pItem;
-MapUnit eUnit = pCurrent->GetPool().GetMetric(currSPItem->Which());
+// It seems draw/impress and writer require different MapUnit values 
for fixed line spacing
+// metric values to be correctly calculated.
+MapUnit eUnit = MapUnit::Map100thMM; // works for draw/impress
+if 
(vcl::CommandInfoProvider::GetModuleIdentifier(pCurrent->GetFrame().GetFrameInterface())
+== "com.sun.star.text.TextDocument")
+eUnit = MapUnit::MapTwip; // works for writer
 meLNSpaceUnit = eUnit;
 
 switch( currSPItem->GetLineSpaceRule() )


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - 2 commits - download.lst ucb/qa

2023-08-01 Thread Stephan Bergmann (via logerrit)
 download.lst|4 ++--
 ucb/qa/cppunit/webdav/webdav_local_neon.cxx |8 
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 573df3d22abc47ac8ceb3bfe2401d82d6aec5f5d
Author: Stephan Bergmann 
AuthorDate: Mon Jul 31 21:34:49 2023 +0200
Commit: Xisco Fauli 
CommitDate: Tue Aug 1 16:48:55 2023 +0200

Update to curl-8.2.1.tar.xz

...obtained from 

Change-Id: I7260f79e2f72501869ff58c77f0d9dfa3ebdece1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155116
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155132

diff --git a/download.lst b/download.lst
index cd4f75c9d2e4..1bb3767bcbe8 100644
--- a/download.lst
+++ b/download.lst
@@ -75,8 +75,8 @@ CPPUNIT_TARBALL := cppunit-1.15.1.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-CURL_SHA256SUM := 
31b1118eb8bfd43cd95d9a3f146f814ff874f6ed3999b29d94f4d1e7dbac5ef6
-CURL_TARBALL := curl-8.1.2.tar.xz
+CURL_SHA256SUM := 
dd322f6bd0a20e6cebdfd388f69e98c3d183bed792cf4713c8a7ef498cba4894
+CURL_TARBALL := curl-8.2.1.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
commit aa02fba0a0de468002f115932277fb890e95ecc8
Author: Stephan Bergmann 
AuthorDate: Mon Jul 31 17:09:32 2023 +0200
Commit: Xisco Fauli 
CommitDate: Tue Aug 1 16:48:49 2023 +0200

Adapt test code to cURL 8.2.0

...for which CppunitTest_ucb_webdav_core would fail with

> ucb/qa/cppunit/webdav/webdav_local_neon.cxx:60:(anonymous 
namespace)::webdav_local_test::WebdavUriTest
> equality assertion failed
> - Expected: ?query#fragment
> - Actual  : /?query#fragment

and

> ucb/qa/cppunit/webdav/webdav_local_neon.cxx:89:(anonymous 
namespace)::webdav_local_test::WebdavUriTest2
> equality assertion failed
> - Expected: ?query
> - Actual  : /?query

because of


"urlapi: have *set(PATH) prepend a slash if one is missing".

All that test code had been added with 
b03e070420606d407df2ec5e9dfa7043ecc46177
"ucb: webdav-curl: fix CurlUri::CloneWithRelativeRefPathAbsolute()", and it
looks harmless for our use cases that cURL started to behave differently 
there
now.  So instead of accepting either of the outcomes depending on what cURL
version is being used, just change the test code to not leave out the
path-absolute in the calls to CloneWithRelativeRefPathAbsolute (which is
documented in ucb/source/ucp/webdav-curl/CurlUri.hxx to take

> /// @param matches: relative-ref = path-absolute [ "?" query ] [ "#" 
fragment ]

and path-absolute cannot be empty as per RFC 3986 "Uniform Resource 
Identifier
(URI): Generic Syntax").

Change-Id: If07a28598dfa047ebe89d8bcda19e8fcaa36aed0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155099
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155150

diff --git a/ucb/qa/cppunit/webdav/webdav_local_neon.cxx 
b/ucb/qa/cppunit/webdav/webdav_local_neon.cxx
index bde7652b9ffa..a457bc6d2b28 100644
--- a/ucb/qa/cppunit/webdav/webdav_local_neon.cxx
+++ b/ucb/qa/cppunit/webdav/webdav_local_neon.cxx
@@ -52,12 +52,12 @@ namespace
 CPPUNIT_ASSERT_EQUAL( OUString("/foo/bar"), 
uri2.GetRelativeReference() );
 CPPUNIT_ASSERT_EQUAL( 
OUString("http://user%40anothern...@server.biz:8040/foo/bar";), uri2.GetURI() );
 
-CurlUri 
uri3(aURI.CloneWithRelativeRefPathAbsolute(u"?query#fragment"));
+CurlUri 
uri3(aURI.CloneWithRelativeRefPathAbsolute(u"/?query#fragment"));
 CPPUNIT_ASSERT_EQUAL( OUString("http"), uri3.GetScheme() );
 CPPUNIT_ASSERT_EQUAL( OUString("server.biz"), uri3.GetHost() );
 CPPUNIT_ASSERT_EQUAL( OUString("user%40anothername"), uri3.GetUser() );
 CPPUNIT_ASSERT_EQUAL( sal_uInt16(8040), uri3.GetPort() );
-CPPUNIT_ASSERT_EQUAL( OUString("?query#fragment"), 
uri3.GetRelativeReference() );
+CPPUNIT_ASSERT_EQUAL( OUString("/?query#fragment"), 
uri3.GetRelativeReference() );
 CPPUNIT_ASSERT_EQUAL( 
OUString("http://user%40anothern...@server.biz:8040/?query#fragment";), 
uri3.GetURI() );
 }
 
@@ -80,13 +80,13 @@ namespace
 CPPUNIT_ASSERT_EQUAL( OUString("/foo/bar"), 
uri2.GetRelativeReference() );
 CPPUNIT_ASSERT_EQUAL( 
OUString("https://foo:b...@server.biz:8040/foo/bar";), uri2.GetURI() );
 
-CurlUri uri3(aURI.CloneWithRelativeRefPathAbsolute(u"?query"));
+CurlUri uri3(aURI.CloneWithRelativeRefPathAbsolute(u"/?query"));
 CPPUNIT_ASSERT_EQUAL( OUString("https"), uri3.GetScheme() );
 CPPUNIT_AS

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - embeddedobj/source

2023-08-01 Thread Noel Grandin (via logerrit)
 embeddedobj/source/general/docholder.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 70141d86a6ccf6f40f16151dfb9c47a94d83a73b
Author: Noel Grandin 
AuthorDate: Tue Jul 25 15:25:48 2023 +0200
Commit: Xisco Fauli 
CommitDate: Tue Aug 1 16:06:47 2023 +0200

tdf#156463 crash on exit after editing a chart (gtk3)

regression from
commit 1ed765c818af2186e459c5ad0eff24dc39a20d34
tdf#155235 workaround gtk3 accessiblibility crashes on close

Change-Id: I1a43c7df6394426d8ce09ed382dcc6833dbe1c6b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154893
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 05d1790f746dfb7367a4c79aa43b00457b7b2cc9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155146
Reviewed-by: Xisco Fauli 

diff --git a/embeddedobj/source/general/docholder.cxx 
b/embeddedobj/source/general/docholder.cxx
index fe48ec5b2d45..bcac2d08c9e5 100644
--- a/embeddedobj/source/general/docholder.cxx
+++ b/embeddedobj/source/general/docholder.cxx
@@ -233,8 +233,12 @@ void DocumentHolder::CloseFrame()
 
 void DocumentHolder::FreeOffice()
 {
-uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create( 
m_xContext );
-xDesktop->removeTerminateListener( this );
+try {
+uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create( 
m_xContext );
+xDesktop->removeTerminateListener( this );
+} catch (const css::uno::DeploymentException&) {
+// if this happens, the desktop is already gone
+}
 
 // the following code is commented out since for now there is still no 
completely correct way to detect
 // whether the office can be terminated, so it is better to have 
unnecessary process running than


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

2023-08-01 Thread Caolán McNamara (via logerrit)
 sc/source/core/data/table1.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit ce8c23e885404f971bc41b48cea8f9b56e345f80
Author: Caolán McNamara 
AuthorDate: Tue Jul 25 10:08:38 2023 +0100
Commit: Xisco Fauli 
CommitDate: Tue Aug 1 16:04:20 2023 +0200

Resolves: tdf#156462 ctrl+left in calc doesn't always jump to the correct 
cell

since:

commit 9e2d48b9e04f7ea895fb095699c32ed8a44eb129
Date:   Wed Mar 30 11:58:04 2022 +0200

reduce Calc's INITIALCOLCOUNT to 1

but:

commit a680f6988482f13489d6c802b6078d43564ae934
Date:   Wed Jun 7 22:48:01 2017 +0530

tdf#50916 : More refactoring in table1.cxx

is likely also relevant wrt: "If nCol is in the unallocated range
[nLastCol+1, MAXCOL], then move it directly to nLastCol"

If the cursor is outside the allocated column range then the search
started 1 cell to the left of the last allocated column

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

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 308025656319..9064c5241acf 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1344,14 +1344,14 @@ SCCOL ScTable::FindNextVisibleColWithContent( SCCOL 
nCol, bool bRight, SCROW nRo
 }
 else
 {
-// If nCol is in the unallocated range [nLastCol+1, 
rDocument.MaxCol()], then move it directly to nLastCol
+if(nCol == 0)
+return 0;
+
+// If nCol is in the unallocated range [nLastCol+1, 
rDocument.MaxCol()], then move it directly after nLastCol
 // as there is no data in the unallocated range. This also makes the 
search faster and avoids
 // the need for more range checks in the loop below.
 if ( nCol > nLastCol )
-nCol = nLastCol;
-
-if(nCol == 0)
-return 0;
+nCol = nLastCol + 1;
 
 do
 {


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

2023-08-01 Thread Caolán McNamara (via logerrit)
 sc/source/core/data/table1.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 6f67c238f69e6d3b83967547de2f6649f0af766d
Author: Caolán McNamara 
AuthorDate: Tue Jul 25 10:08:38 2023 +0100
Commit: Xisco Fauli 
CommitDate: Tue Aug 1 16:03:53 2023 +0200

Resolves: tdf#156462 ctrl+left in calc doesn't always jump to the correct 
cell

since:

commit 9e2d48b9e04f7ea895fb095699c32ed8a44eb129
Date:   Wed Mar 30 11:58:04 2022 +0200

reduce Calc's INITIALCOLCOUNT to 1

but:

commit a680f6988482f13489d6c802b6078d43564ae934
Date:   Wed Jun 7 22:48:01 2017 +0530

tdf#50916 : More refactoring in table1.cxx

is likely also relevant wrt: "If nCol is in the unallocated range
[nLastCol+1, MAXCOL], then move it directly to nLastCol"

If the cursor is outside the allocated column range then the search
started 1 cell to the left of the last allocated column

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

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index c5d4de055f8d..5e40d9bc4381 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1342,14 +1342,14 @@ SCCOL ScTable::FindNextVisibleColWithContent( SCCOL 
nCol, bool bRight, SCROW nRo
 }
 else
 {
-// If nCol is in the unallocated range [nLastCol+1, 
rDocument.MaxCol()], then move it directly to nLastCol
+if(nCol == 0)
+return 0;
+
+// If nCol is in the unallocated range [nLastCol+1, 
rDocument.MaxCol()], then move it directly after nLastCol
 // as there is no data in the unallocated range. This also makes the 
search faster and avoids
 // the need for more range checks in the loop below.
 if ( nCol > nLastCol )
-nCol = nLastCol;
-
-if(nCol == 0)
-return 0;
+nCol = nLastCol + 1;
 
 do
 {


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

2023-08-01 Thread Caolán McNamara (via logerrit)
 desktop/qa/desktop_lib/test_desktop_lib.cxx  |4 +-
 sc/inc/postit.hxx|2 +
 sc/qa/unit/tiledrendering/tiledrendering.cxx |8 ++--
 sc/source/ui/docshell/docsh4.cxx |   25 --
 sc/source/ui/unoobj/docuno.cxx   |   47 ---
 5 files changed, 30 insertions(+), 56 deletions(-)

New commits:
commit f363777f1c518ed9633596e482d4a11eee17295d
Author: Caolán McNamara 
AuthorDate: Mon Jul 31 11:29:05 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 1 14:55:54 2023 +0200

cool#6911 report the position of comments as cell addresses

and leave it to the client to determine the bounds of the cell

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

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index e93cf695068f..8b21f905f71d 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -2407,14 +2407,14 @@ void DesktopLOKTest::testCommentsCalc()
 {
 CPPUNIT_ASSERT_EQUAL(std::string("4"), 
rComment.second.get("tab"));
 CPPUNIT_ASSERT_EQUAL(std::string("Comment1"), 
rComment.second.get("text"));
-CPPUNIT_ASSERT_EQUAL(std::string("7650, 3570, 1274, 254"), 
rComment.second.get("cellPos"));
+CPPUNIT_ASSERT_EQUAL(std::string("6 14 6 14"), 
rComment.second.get("cellRange"));
 }
 break;
 case 1:
 {
 CPPUNIT_ASSERT_EQUAL(std::string("4"), 
rComment.second.get("tab"));
 CPPUNIT_ASSERT_EQUAL(std::string("Comment2"), 
rComment.second.get("text"));
-CPPUNIT_ASSERT_EQUAL(std::string("8925, 4335, 1274, 254"), 
rComment.second.get("cellPos"));
+CPPUNIT_ASSERT_EQUAL(std::string("7 17 7 17"), 
rComment.second.get("cellRange"));
 }
 break;
 }
diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx
index 52872b8d650e..828d094e49d1 100644
--- a/sc/inc/postit.hxx
+++ b/sc/inc/postit.hxx
@@ -155,6 +155,8 @@ public:
 /** Updates caption position according to position of the passed cell. */
 voidUpdateCaptionPos( const ScAddress& rPos );
 
+static OString  NoteRangeToJsonString(const ScDocument& rDoc, const 
ScAddress& rPos);
+
 private:
 ScPostIt( const ScPostIt& ) = delete;
 ScPostIt&   operator=( const ScPostIt& ) = delete;
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 254fb5e8a042..c0fc36968c58 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1110,8 +1110,8 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testCommentCallback)
 CPPUNIT_ASSERT_EQUAL(std::string("LOK User1"), 
aView2.m_aCommentCallbackResult.get("author"));
 CPPUNIT_ASSERT_EQUAL(std::string("Comment"), 
aView1.m_aCommentCallbackResult.get("text"));
 CPPUNIT_ASSERT_EQUAL(std::string("Comment"), 
aView2.m_aCommentCallbackResult.get("text"));
-CPPUNIT_ASSERT_EQUAL(std::string("0, 255, 1274, 254"), 
aView1.m_aCommentCallbackResult.get("cellPos"));
-CPPUNIT_ASSERT_EQUAL(std::string("0, 255, 1274, 254"), 
aView2.m_aCommentCallbackResult.get("cellPos"));
+CPPUNIT_ASSERT_EQUAL(std::string("0 1 0 1"), 
aView1.m_aCommentCallbackResult.get("cellRange"));
+CPPUNIT_ASSERT_EQUAL(std::string("0 1 0 1"), 
aView2.m_aCommentCallbackResult.get("cellRange"));
 
 std::string aCommentId = 
aView1.m_aCommentCallbackResult.get("id");
 
@@ -1138,8 +1138,8 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testCommentCallback)
 CPPUNIT_ASSERT_EQUAL(std::string("LOK User2"), 
aView2.m_aCommentCallbackResult.get("author"));
 CPPUNIT_ASSERT_EQUAL(std::string("Edited comment"), 
aView1.m_aCommentCallbackResult.get("text"));
 CPPUNIT_ASSERT_EQUAL(std::string("Edited comment"), 
aView2.m_aCommentCallbackResult.get("text"));
-CPPUNIT_ASSERT_EQUAL(std::string("0, 255, 1274, 254"), 
aView1.m_aCommentCallbackResult.get("cellPos"));
-CPPUNIT_ASSERT_EQUAL(std::string("0, 255, 1274, 254"), 
aView2.m_aCommentCallbackResult.get("cellPos"));
+CPPUNIT_ASSERT_EQUAL(std::string("0 1 0 1"), 
aView1.m_aCommentCallbackResult.get("cellRange"));
+CPPUNIT_ASSERT_EQUAL(std::string("0 1 0 1"), 
aView2.m_aCommentCallbackResult.get("cellRange"));
 
 // Delete the comment
 if (pTabViewShell)
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 8c9d227a84ca..7e4370b7e6db 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2561,30 +2561,7 @@ void 
ScDocShell::LOKCommentNotify(LO

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

2023-08-01 Thread Mike Kaganski (via logerrit)
 vcl/qa/cppunit/pdfexport/data/wide_page1.fodt |   40 ++
 vcl/qa/cppunit/pdfexport/pdfexport.cxx|   56 ++
 vcl/source/gdi/pdfwriter_impl.cxx |8 ---
 3 files changed, 98 insertions(+), 6 deletions(-)

New commits:
commit e5b3b2204e975ffe1d2ebc14b92c0fc9e3f17417
Author: Mike Kaganski 
AuthorDate: Fri Jul 28 17:55:17 2023 +0300
Commit: Xisco Fauli 
CommitDate: Tue Aug 1 14:41:32 2023 +0200

tdf#156528: Fix handling PDF page scaling factor after large pages

The map mode wasn't set when current page's user unit was 1, which meant
that it used the unchanged value from the previous page, where it could
be different.

Change-Id: Id1f1515dceac25cddc12081a86fabf8b32d633f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155025
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 
(cherry picked from commit 0b6fc1fdcc67cc6e13ca3c0e4c81742a43488ed6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155141
Reviewed-by: خالد حسني 
Tested-by: Jenkins

diff --git a/vcl/qa/cppunit/pdfexport/data/wide_page1.fodt 
b/vcl/qa/cppunit/pdfexport/data/wide_page1.fodt
new file mode 100644
index ..9e7390a8e22a
--- /dev/null
+++ b/vcl/qa/cppunit/pdfexport/data/wide_page1.fodt
@@ -0,0 +1,40 @@
+
+
+http://openoffice.org/2004/office"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta: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:rpt="http://openoffice.org/2005/report"; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d: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:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:ooow="http://openoffice.org/200
 4/writer" xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; xmlns
 :css3t="http://www.w3.org/TR/css3-text/"; 
xmlns:officeooo="http://openoffice.org/2009/office"; office:version="1.3" 
office:mimetype="application/vnd.oasis.opendocument.text">
+ 
+ 
+ 
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+  
+   
+  
+ 
+ 
+  
+  
+ 
+ 
+  
+   
+ 
+ 
+
+   
+ 
+ 
+
+  
+ 
+
\ No newline at end of file
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 95667732c549..bf35818056df 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -4735,6 +4735,62 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf48707_2)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf156528)
+{
+aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
+saveAsPDF(u"wide_page1.fodt");
+std::unique_ptr pPdfDocument = parsePDFExport();
+
+// The document has two pages
+CPPUNIT_ASSERT_EQUAL(2, pPdfDocument->getPageCount());
+
+// 1st page (5100 mm width x 210 mm high, UserUnit = 2)
+auto pPdfPage = pPdfDocument->openPage(0);
+CPPUNIT_ASSERT(pPdfPage);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(o3tl::convert(5100.0 / 2, o3tl::Length::mm, 
o3tl::Length::pt),
+ pPdfPage->getWidth(), 1);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(o3tl::convert(210.0 / 2, o3tl::Length::mm, 
o3tl::Length::pt),
+ pPdfPage->getHeight(), 1);
+
+// 1 object (rectangle 5060 mm width x 170 mm high, UserUnit = 2)
+CPPUNIT_ASSERT_EQUAL(1, pPdfPage->getObjectCount());
+auto pRect = pPdfPage->getObject(0);
+CPPUNIT_ASSERT(pRect);
+CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFPageObjectType::Path, p

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

2023-08-01 Thread Eike Rathke (via logerrit)
 i18npool/source/localedata/data/eo.xml |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 596dd17209c7039fc1711216465a6b6dcba18574
Author: Eike Rathke 
AuthorDate: Mon Jul 31 20:13:02 2023 +0200
Commit: Xisco Fauli 
CommitDate: Tue Aug 1 14:41:01 2023 +0200

Correct Esperanto {eo} group separator formats wrong since initial 2005 
commit

Instead of # ##0,00 and similar it used # #0,00 that probably went
unnoticed since ever because it generates an expected display
string using the group separator at the right position; editing
such format yielded the format code ##0,00 with the group
separator flag set.

Change-Id: Id6ebb533f43a49a9aea1dd9ba87230e5d59901ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155114
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 613c3524eb798392040c691d5c0e17fac0b654b8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155048
Reviewed-by: Adolfo Jayme Barrientos 
(cherry picked from commit b6ed7c7be2a94777ee9b1c4a5ddf77e3f5343efe)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155142
Reviewed-by: Xisco Fauli 

diff --git a/i18npool/source/localedata/data/eo.xml 
b/i18npool/source/localedata/data/eo.xml
index 6cef3274b54d..ba718f92f4a1 100644
--- a/i18npool/source/localedata/data/eo.xml
+++ b/i18npool/source/localedata/data/eo.xml
@@ -157,31 +157,31 @@
   0,00
 
 
-  # #0
+  # ##0
 
 
-  # #0,00
+  # ##0,00
 
 
-  # ##,00
+  # ###,00
 
 
-  # #0 [CURRENCY];-# #0 [CURRENCY]
+  # ##0 [CURRENCY];-# ##0 [CURRENCY]
 
 
-  # #0,00 [CURRENCY];-# #0,00 [CURRENCY]
+  # ##0,00 [CURRENCY];-# ##0,00 [CURRENCY]
 
 
-  # #0 [CURRENCY];[RED]-# #0 [CURRENCY]
+  # ##0 [CURRENCY];[RED]-# ##0 [CURRENCY]
 
 
-  # #0,00 [CURRENCY];[RED]-# #0,00 [CURRENCY]
+  # ##0,00 [CURRENCY];[RED]-# ##0,00 [CURRENCY]
 
 
-  # #0,00 CCC
+  # ##0,00 CCC
 
 
-  # #0,-- [CURRENCY];[RED]-# #0,-- [CURRENCY]
+  # ##0,-- [CURRENCY];[RED]-# ##0,-- [CURRENCY]
 
 
   0%


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

2023-08-01 Thread Andreas Heinisch (via logerrit)
 sc/source/ui/miscdlgs/linkarea.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit bcbcb3f692f51085ba8a9ad6ea2be410dc79dd7b
Author: Andreas Heinisch 
AuthorDate: Fri Jul 28 09:37:47 2023 +0200
Commit: Eike Rathke 
CommitDate: Tue Aug 1 14:39:43 2023 +0200

tdf#142600 - External links dialog: list database ranges

Regression from commit 462f9d1f589a7afd66d3fc61925467d3b68e5b31 where
the database ranges were dropped.

Change-Id: Ic0e453fc6fe62849d72b6acf88ed7ebd3c47775b
(cherry picked from commit f7c3ded18a757e31b23723ea335febf442acae68)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155035
Reviewed-by: Adolfo Jayme Barrientos 
Reviewed-by: Patrick Luby 
Tested-by: Eike Rathke 
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/miscdlgs/linkarea.cxx 
b/sc/source/ui/miscdlgs/linkarea.cxx
index 09cfe6c3c285..6b1716407561 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -259,6 +260,13 @@ void ScLinkedAreaDlg::UpdateSourceRanges()
 m_xLbRanges->append_text(pRangeData->GetName());
 }
 }
+// tdf#142600 - list database ranges
+if (const auto pDBs = m_pSourceShell->GetDocument().GetDBCollection())
+{
+const auto& rNamedDBs = pDBs->getNamedDBs();
+for (const auto& rNamedDB : rNamedDBs)
+m_xLbRanges->append_text(rNamedDB->GetName());
+}
 }
 
 m_xLbRanges->thaw();


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

2023-08-01 Thread Stephan Bergmann (via logerrit)
 ucb/qa/cppunit/webdav/webdav_local_neon.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 22dd5db19cfe578a0aef5e816b4ebf5282c3f53f
Author: Stephan Bergmann 
AuthorDate: Mon Jul 31 17:09:32 2023 +0200
Commit: Xisco Fauli 
CommitDate: Tue Aug 1 14:38:47 2023 +0200

Adapt test code to cURL 8.2.0

...for which CppunitTest_ucb_webdav_core would fail with

> ucb/qa/cppunit/webdav/webdav_local_neon.cxx:60:(anonymous 
namespace)::webdav_local_test::WebdavUriTest
> equality assertion failed
> - Expected: ?query#fragment
> - Actual  : /?query#fragment

and

> ucb/qa/cppunit/webdav/webdav_local_neon.cxx:89:(anonymous 
namespace)::webdav_local_test::WebdavUriTest2
> equality assertion failed
> - Expected: ?query
> - Actual  : /?query

because of


"urlapi: have *set(PATH) prepend a slash if one is missing".

All that test code had been added with 
b03e070420606d407df2ec5e9dfa7043ecc46177
"ucb: webdav-curl: fix CurlUri::CloneWithRelativeRefPathAbsolute()", and it
looks harmless for our use cases that cURL started to behave differently 
there
now.  So instead of accepting either of the outcomes depending on what cURL
version is being used, just change the test code to not leave out the
path-absolute in the calls to CloneWithRelativeRefPathAbsolute (which is
documented in ucb/source/ucp/webdav-curl/CurlUri.hxx to take

> /// @param matches: relative-ref = path-absolute [ "?" query ] [ "#" 
fragment ]

and path-absolute cannot be empty as per RFC 3986 "Uniform Resource 
Identifier
(URI): Generic Syntax").

Change-Id: If07a28598dfa047ebe89d8bcda19e8fcaa36aed0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155099
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155134

diff --git a/ucb/qa/cppunit/webdav/webdav_local_neon.cxx 
b/ucb/qa/cppunit/webdav/webdav_local_neon.cxx
index bde7652b9ffa..a457bc6d2b28 100644
--- a/ucb/qa/cppunit/webdav/webdav_local_neon.cxx
+++ b/ucb/qa/cppunit/webdav/webdav_local_neon.cxx
@@ -52,12 +52,12 @@ namespace
 CPPUNIT_ASSERT_EQUAL( OUString("/foo/bar"), 
uri2.GetRelativeReference() );
 CPPUNIT_ASSERT_EQUAL( 
OUString("http://user%40anothern...@server.biz:8040/foo/bar";), uri2.GetURI() );
 
-CurlUri 
uri3(aURI.CloneWithRelativeRefPathAbsolute(u"?query#fragment"));
+CurlUri 
uri3(aURI.CloneWithRelativeRefPathAbsolute(u"/?query#fragment"));
 CPPUNIT_ASSERT_EQUAL( OUString("http"), uri3.GetScheme() );
 CPPUNIT_ASSERT_EQUAL( OUString("server.biz"), uri3.GetHost() );
 CPPUNIT_ASSERT_EQUAL( OUString("user%40anothername"), uri3.GetUser() );
 CPPUNIT_ASSERT_EQUAL( sal_uInt16(8040), uri3.GetPort() );
-CPPUNIT_ASSERT_EQUAL( OUString("?query#fragment"), 
uri3.GetRelativeReference() );
+CPPUNIT_ASSERT_EQUAL( OUString("/?query#fragment"), 
uri3.GetRelativeReference() );
 CPPUNIT_ASSERT_EQUAL( 
OUString("http://user%40anothern...@server.biz:8040/?query#fragment";), 
uri3.GetURI() );
 }
 
@@ -80,13 +80,13 @@ namespace
 CPPUNIT_ASSERT_EQUAL( OUString("/foo/bar"), 
uri2.GetRelativeReference() );
 CPPUNIT_ASSERT_EQUAL( 
OUString("https://foo:b...@server.biz:8040/foo/bar";), uri2.GetURI() );
 
-CurlUri uri3(aURI.CloneWithRelativeRefPathAbsolute(u"?query"));
+CurlUri uri3(aURI.CloneWithRelativeRefPathAbsolute(u"/?query"));
 CPPUNIT_ASSERT_EQUAL( OUString("https"), uri3.GetScheme() );
 CPPUNIT_ASSERT_EQUAL( OUString("server.biz"), uri3.GetHost() );
 CPPUNIT_ASSERT_EQUAL( OUString("foo"), uri3.GetUser() );
 CPPUNIT_ASSERT_EQUAL( OUString("bar"), uri3.GetPassword() );
 CPPUNIT_ASSERT_EQUAL( sal_uInt16(8040), uri3.GetPort() );
-CPPUNIT_ASSERT_EQUAL( OUString("?query"), uri3.GetRelativeReference() 
);
+CPPUNIT_ASSERT_EQUAL( OUString("/?query"), uri3.GetRelativeReference() 
);
 CPPUNIT_ASSERT_EQUAL( 
OUString("https://foo:b...@server.biz:8040/?query";), uri3.GetURI() );
 }
 


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

2023-08-01 Thread Patrick Luby (via logerrit)
 reportdesign/source/ui/report/ViewsWindow.cxx |   14 ++
 svx/source/svdraw/svdhdl.cxx  |1 -
 2 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 01a1d2a84992973b8a0e5f1ae99fd32f5913b58f
Author: Patrick Luby 
AuthorDate: Mon Jul 31 20:03:13 2023 -0400
Commit: Patrick Luby 
CommitDate: Tue Aug 1 14:27:49 2023 +0200

tdf#144072 prevent use of a deleted pointer

BegDragObj_createInvisibleObjectAtPosition() may clear the handle
list and that will delete the SdrHdl instances owned by this section
view so set _pHdl to null if it has been deleted during the call.

Change-Id: I89606958f8a76a2c35685d1aff6b0159739a464a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155119
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx 
b/reportdesign/source/ui/report/ViewsWindow.cxx
index e11735bf72ca..a5ad82e818e2 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -1043,7 +1043,21 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, 
SdrHdl* _pHdl,const OSectionVi
 "createInvisible X:" << aRect.Left() << " Y:"
 << aRect.Top() << " on View #" << nViewCount);
 
+// tdf#144072 prevent use of a deleted pointer
+// BegDragObj_createInvisibleObjectAtPosition() may clear
+// the handle list and that will delete the SdrHdl 
instances
+// owned by this section view so set _pHdl to null if it 
has
+// been deleted during the call.
+bool bHdlInList = false;
+const SdrHdlList& rHdlList = rView.GetHdlList();
+if (_pHdl && rHdlList.GetHdlNum(_pHdl) < 
rHdlList.GetHdlCount())
+bHdlInList = true;
 BegDragObj_createInvisibleObjectAtPosition(aRect, rView);
+if (bHdlInList && rHdlList.GetHdlNum(_pHdl) >= 
rHdlList.GetHdlCount())
+{
+SAL_WARN("reportdesign", "SdrHdl pointer parameter has 
been deleted");
+_pHdl = nullptr;
+}
 }
 }
 }
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index de6ffcd8175f..3bcebf59ea26 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -2282,7 +2282,6 @@ size_t SdrHdlList::GetHdlNum(const SdrHdl* pHdl) const
 return SAL_MAX_SIZE;
 auto it = std::find_if( maList.begin(), maList.end(),
 [&](const std::unique_ptr & p) { return p.get() == pHdl; });
-assert(it != maList.end());
 if( it == maList.end() )
 return SAL_MAX_SIZE;
 return it - maList.begin();


GSoC'23 Week 8 Report: Certificate Manager Tree View and Caching

2023-08-01 Thread Ahmed Gamal Eltokhy
Dear all,

I hope this email finds you well. Here is another update in my GSoC project
for the week! There is no blog post this week since not much information
has changed from the last one, however, wait for one next week.

TL;DR: WIP on customization of tree view in certificate chooser and
session-wise certificate caching.

I'd like to thank my mentors, including Thorsten Behrens, Heiko Tietze, and
Hossein Nourikhah, for their continuous support.. Their mentorship has been
invaluable throughout this journey.

Stay tuned for more updates in the upcoming weeks.

Best regards,

Tokhy


[Libreoffice-commits] core.git: include/vcl sc/inc sc/source sd/source sw/inc sw/source

2023-08-01 Thread Paris Oplopoios (via logerrit)
 include/vcl/ITiledRenderable.hxx  |4 +++-
 sc/inc/docuno.hxx |2 +-
 sc/source/ui/unoobj/docuno.cxx|   15 +--
 sd/source/ui/inc/unomodel.hxx |2 +-
 sd/source/ui/unoidl/unomodel.cxx  |   15 +--
 sw/inc/unotxdoc.hxx   |2 +-
 sw/source/uibase/uno/unotxdoc.cxx |4 ++--
 7 files changed, 34 insertions(+), 10 deletions(-)

New commits:
commit 0004de149269ed2ab5423947b9930653f3da6038
Author: Paris Oplopoios 
AuthorDate: Wed Jul 26 17:20:59 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Tue Aug 1 13:49:06 2023 +0200

Allow getViewRenderState to get from a specific view

getViewRenderState would get its output from the current view, make it
so that it's possible to specify a specific view

Change-Id: I279b215f8311b079c220c79b8b41c76bc0210154
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154943
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
(cherry picked from commit eff5643dbc5bb9dfede530e8e07261bb9bdc98f0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155046
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios 

diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index 9fa61258fc7a..9b76eb11200e 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -10,6 +10,7 @@
 
 #pragma once
 
+#include 
 #include 
 #include 
 #include 
@@ -380,8 +381,9 @@ public:
 /**
  * Returns an opaque string reflecting the render state of a component
  * eg. 'PD' - P for non-printing-characters, D for dark-mode.
+ * @param pViewShell the view to get the options from, if nullptr the 
current view shell is used
  */
-virtual OString getViewRenderState() { return rtl::OString(); }
+virtual OString getViewRenderState(SfxViewShell* = nullptr) { return 
rtl::OString(); }
 };
 } // namespace vcl
 
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index a75afa2834df..611b0c22d2b9 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -396,7 +396,7 @@ public:
 virtual void completeFunction(const OUString& rFunctionName) override;
 
 /// @see vcl::ITiledRenderable::getViewRenderState().
-OString getViewRenderState() override;
+OString getViewRenderState(SfxViewShell* pViewShell = nullptr) override;
 
 private:
 Size getDocumentSize(SCCOL& rnTiledRenderingAreaEndCol, SCROW& 
rnTiledRenderingAreaEndRow );
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 66c2667a1a1f..fe1cf4dbe6b3 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1254,10 +1254,21 @@ void ScModelObj::completeFunction(const OUString& 
rFunctionName)
 }
 }
 
-OString ScModelObj::getViewRenderState()
+OString ScModelObj::getViewRenderState(SfxViewShell* pViewShell)
 {
 OStringBuffer aState;
-ScViewData* pViewData = ScDocShell::GetViewData();
+ScViewData* pViewData = nullptr;
+
+if (pViewShell)
+{
+ScTabViewShell* pTabViewShell = dynamic_cast< 
ScTabViewShell*>(pViewShell);
+if (pTabViewShell)
+pViewData = &pTabViewShell->GetViewData();
+}
+else
+{
+pViewData = ScDocShell::GetViewData();
+}
 
 if (pViewData)
 {
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index 008c9459e1c4..e0fa051d8826 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -285,7 +285,7 @@ public:
 virtual void setPaintTextEdit(bool bPaint) override { mbPaintTextEdit = 
bPaint; }
 
 /// @see vcl::ITiledRenderable::getViewRenderState().
-OString getViewRenderState() override;
+OString getViewRenderState(SfxViewShell* pViewShell = nullptr) override;
 
 // XComponent
 
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 9f906dc404a0..789f419716f8 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2326,10 +2326,21 @@ void SdXImpressDocument::paintTile( VirtualDevice& 
rDevice,
 comphelper::LibreOfficeKit::setTiledPainting(false);
 }
 
-OString SdXImpressDocument::getViewRenderState()
+OString SdXImpressDocument::getViewRenderState(SfxViewShell* pViewShell)
 {
 OStringBuffer aState;
-DrawViewShell* pView = GetViewShell();
+DrawViewShell* pView = nullptr;
+
+if (pViewShell)
+{
+ViewShellBase* pShellBase = dynamic_cast(pViewShell);
+pView = 
dynamic_cast(pShellBase->GetMainViewShell().get());
+}
+else
+{
+pView = GetViewShell();
+}
+
 if (pView)
 {
 const SdViewOptions& pVOpt = pView->GetViewOptions();
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 056013d75056..01619df1d382 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -463,7 +463,7 @@ public:
 void getCommandValues(tools::JsonWriter& rJsonWriter, std::string_view 
rCommand) override;
 
 

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

2023-08-01 Thread Satya (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf155736_PageNumbers_footer.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport18.cxx  |   14 ++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx   |   21 
+++---
 writerfilter/source/dmapper/DomainMapper_Impl.hxx   |2 
 4 files changed, 30 insertions(+), 7 deletions(-)

New commits:
commit d3cf473ceb2a0711ca723ed680034b9251dccbbd
Author: Satya 
AuthorDate: Wed Jun 14 18:15:35 2023 +0530
Commit: Justin Luth 
CommitDate: Tue Aug 1 13:18:12 2023 +0200

tdf#155736 Modified IsInTOC() to handle IsInHeaderFooter() case.

This fixes a problem of page numbers missing in the footer.
The importer might start processing the footer before the
TOC has finished - m_bStartTOC might be true.
In this case we are not actually IsInTOC,and m_bStartTOC
should be ignored and make use of IsInHeaderFooter() and 
m_bStartTOCHeaderFooter to confirm if the footer/header itself
has TOC.

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

diff --git a/sw/qa/extras/ooxmlexport/data/tdf155736_PageNumbers_footer.docx 
b/sw/qa/extras/ooxmlexport/data/tdf155736_PageNumbers_footer.docx
new file mode 100644
index ..58e36988002a
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf155736_PageNumbers_footer.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index c8dca64723a1..62dc42dba5af 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -856,6 +856,20 @@ DECLARE_OOXMLEXPORT_TEST(testTdf155903, "tdf155903.odt")
 // because the exported file was corrupted.
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf155736, "tdf155736_PageNumbers_footer.docx")
+{
+CPPUNIT_ASSERT_EQUAL(2, getPages());
+
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "/root/page[1]/footer");
+assertXPath(pXmlDoc, "/root/page[2]/footer");
+//Without the fix in place, it would have failed with
+//- Expected: Page * of *
+//- Actual  : Page of
+CPPUNIT_ASSERT_EQUAL(OUString("Page * of *"), 
parseDump("/root/page[1]/footer/txt/text()"));
+CPPUNIT_ASSERT_EQUAL(OUString("Page * of *"), 
parseDump("/root/page[2]/footer/txt/text()"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 308768cc78eb..1758f7662c49 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2996,7 +2996,7 @@ void DomainMapper_Impl::appendTextPortion( const 
OUString& rString, const Proper
 // If we are in comments, then disable CharGrabBag, comment text 
doesn't support that.
 uno::Sequence< beans::PropertyValue > aValues = 
pPropertyMap->GetPropertyValues(/*bCharGrabBag=*/!m_bIsInComments);
 
-if (m_bStartTOC || m_bStartIndex || m_bStartBibliography)
+if (IsInTOC() || m_bStartIndex || m_bStartBibliography)
 for( auto& rValue : asNonConstRange(aValues) )
 {
 if (rValue.Name == "CharHidden")
@@ -3409,6 +3409,14 @@ void 
DomainMapper_Impl::fillEmptyFrameProperties(std::vector(0)));
 }
 
+bool DomainMapper_Impl::IsInTOC() const
+{
+if (IsInHeaderFooter())
+return m_bStartTOCHeaderFooter;
+else
+return m_bStartTOC;
+}
+
 void DomainMapper_Impl::ConvertHeaderFooterToTextFrame(bool bDynamicHeightTop, 
bool bDynamicHeightBottom)
 {
 while (!m_aHeaderFooterTextAppendStack.empty())
@@ -7125,7 +7133,7 @@ void DomainMapper_Impl::CloseFieldCommand()
 break;
 }
 }
-if (m_bStartTOC && (aIt->second.eFieldId == FIELD_PAGEREF) )
+if (IsInTOC() && (aIt->second.eFieldId == FIELD_PAGEREF))
 {
 bCreateField = false;
 }
@@ -7541,7 +7549,7 @@ void DomainMapper_Impl::CloseFieldCommand()
 break;
 case FIELD_PAGEREF:
 case FIELD_REF:
-if (xFieldProperties.is() && !m_bStartTOC)
+if (xFieldProperties.is() && !IsInTOC())
 {
 bool bPageRef = aIt->second.eFieldId == FIELD_PAGEREF;
 
@@ -8223,9 +8231,9 @@ void DomainMapper_Impl::PopFieldContext()
 else
 {
 xToInsert.set(pContext->GetTC(), uno::UNO_QUERY);
-if( !xToInsert.is() && !m_bStartTOC && !m_bStartIndex && 
!m_bStartBibliography )
+if (!xToInsert.is() && !IsInTOC() && !m_bStartIndex && 
!m_bStartBibliography)
  

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

2023-08-01 Thread Michael Weghorn (via logerrit)
 winaccessibility/inc/AccContainerEventListener.hxx|4 
 winaccessibility/inc/AccDescendantManagerEventListener.hxx|4 
 winaccessibility/inc/AccDialogEventListener.hxx   |3 
 winaccessibility/inc/AccEventListener.hxx |2 
 winaccessibility/inc/AccFrameEventListener.hxx|2 
 winaccessibility/inc/AccMenuEventListener.hxx |3 
 winaccessibility/inc/AccWindowEventListener.hxx   |3 
 winaccessibility/source/service/AccContainerEventListener.cxx |   44 
--
 winaccessibility/source/service/AccDescendantManagerEventListener.cxx |   40 
-
 winaccessibility/source/service/AccDialogEventListener.cxx|   40 
-
 winaccessibility/source/service/AccEventListener.cxx  |   34 
+++
 winaccessibility/source/service/AccFrameEventListener.cxx |   19 

 winaccessibility/source/service/AccMenuEventListener.cxx  |   41 
-
 winaccessibility/source/service/AccWindowEventListener.cxx|   38 

 14 files changed, 37 insertions(+), 240 deletions(-)

New commits:
commit f9631765c9dfd805ae486a94eacb69d307c9eef1
Author: Michael Weghorn 
AuthorDate: Tue Aug 1 09:35:48 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Aug 1 13:14:46 2023 +0200

wina11y: Drop/Clean up CHILD event handling in subclasses

Now that Change-Id I62ab32342ef67c770ced9f0d2be867dc9355bd4a
("tdf#156561 wina11y: Handle CHILD event") has implemented
handling for the CHILD event in `AccEventListener`,
drop the overrides in child classes that effectively
do the same.

For the case that a new child gets added,
`AccFrameEventListener::HandleChildChangedEvent`
also passes the HWND, so leave that and only
forward to the base class for the other case.

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

diff --git a/winaccessibility/inc/AccContainerEventListener.hxx 
b/winaccessibility/inc/AccContainerEventListener.hxx
index cf1cdb2157c4..0ce0c217548a 100644
--- a/winaccessibility/inc/AccContainerEventListener.hxx
+++ b/winaccessibility/inc/AccContainerEventListener.hxx
@@ -45,10 +45,6 @@ public:
 //AccessibleEventListener
 virtual void SAL_CALL notifyEvent( const 
css::accessibility::AccessibleEventObject& aEvent ) override;
 
-//for child changed event
-virtual void HandleChildChangedEvent(
-css::uno::Any oldValue, css::uno::Any newValue) override;
-
 //for selection changed event
 virtual void HandleSelectionChangedEvent(
 const css::uno::Any &oldValue, const css::uno::Any &newValue);
diff --git a/winaccessibility/inc/AccDescendantManagerEventListener.hxx 
b/winaccessibility/inc/AccDescendantManagerEventListener.hxx
index 0f0e30ed3af1..4cae3c808dd0 100644
--- a/winaccessibility/inc/AccDescendantManagerEventListener.hxx
+++ b/winaccessibility/inc/AccDescendantManagerEventListener.hxx
@@ -49,10 +49,6 @@ public:
 virtual void HandleSelectionChangedEvent(
 css::uno::Any oldValue, css::uno::Any newValue);
 
-//for child changed event
-virtual void HandleChildChangedEvent(
-css::uno::Any oldValue, css::uno::Any newValue) override;
-
 virtual void HandleChildChangedNoFocusEvent(
 css::uno::Any oldValue, css::uno::Any newValue);
 
diff --git a/winaccessibility/inc/AccDialogEventListener.hxx 
b/winaccessibility/inc/AccDialogEventListener.hxx
index 49482474f811..f2d7ff9a0005 100644
--- a/winaccessibility/inc/AccDialogEventListener.hxx
+++ b/winaccessibility/inc/AccDialogEventListener.hxx
@@ -40,9 +40,6 @@ public:
 virtual void SAL_CALL
 notifyEvent(const css::accessibility::AccessibleEventObject& aEvent) 
override;
 
-//for child changed event
-virtual void HandleChildChangedEvent(css::uno::Any oldValue, css::uno::Any 
newValue) override;
-
 //state changed
 virtual void SetComponentState(sal_Int64 state, bool enable) override;
 };
diff --git a/winaccessibility/inc/AccMenuEventListener.hxx 
b/winaccessibility/inc/AccMenuEventListener.hxx
index 93c9f0f2f867..354d7166029d 100644
--- a/winaccessibility/inc/AccMenuEventListener.hxx
+++ b/winaccessibility/inc/AccMenuEventListener.hxx
@@ -40,9 +40,6 @@ public:
 virtual void SAL_CALL
 notifyEvent(const css::accessibility::AccessibleEventObject& aEvent) 
override;
 
-//for child changed event
-virtual void HandleChildChangedEvent(css::uno::Any oldValue, css::uno::Any 
newValue) override;
-
 //for selection changed event
 virtual void HandleSelectionChangedEventNoArgs();
 
diff --git a/winaccessibility/inc/AccWindowEventListener.hxx 
b/winaccessibility/inc/AccWindowEventListener.hxx
index 6fb20892813b..dfc3e2756b2e 100644
--- a

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

2023-08-01 Thread Michael Weghorn (via logerrit)
 vcl/source/window/dockmgr.cxx |   16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 3bb762c53ea79f8915a1b8fa39f3f5f57aa68c84
Author: Michael Weghorn 
AuthorDate: Tue Aug 1 09:44:56 2023 +0200
Commit: Michael Weghorn 
CommitDate: Tue Aug 1 13:11:19 2023 +0200

tdf#156100 tdf#156561 Revert to previous behavior for gtk popups

In order to fix announcement of items in the popups with at
least NVDA on Windows,

commit dc0706cabfe39ddb6ea23d60ccfb756f2b9e6efb
Date:   Wed Mar 15 17:00:27 2023 +0100

tdf#140762 tdf#152671 Make dock win visible before showing popup

made sure that the dock window is made visible before the
popup is shown.

That's problematic for the gtk implementations, though.

On issue was addressed with

commit 70642bb7afd2cee6f7ae6eff2936a35978bd0597
Date:   Thu Apr 6 15:07:15 2023 +0100

tdf#154470 try moving the Show of the client to after the float 
positioning

, but there's still an issue for the RTL case (tdf#156100).

To unbreak that while leaving the announcement with NVDA working
properly, effectively revert to the original behavior for the
gtk VCL plugins (which have their own implementation for popup
handling) for now.

Further analysis of the root causes is planned in the context of
tdf#156561, so hopefully the code paths can be unified again in
the future.
(One issue is addressed by Change-Id 
I62ab32342ef67c770ced9f0d2be867dc9355bd4a,
"tdf#156561 wina11y: Handle CHILD event", but that's not enough
by itself.)

Change-Id: Ie67bded6c380695866d5343dab9d3f563ada057a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155125
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index 5112c322abda..cc122a71dd0d 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -821,7 +821,21 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox 
*pParentToolBox, FloatWin
 if( pParentToolBox->IsKeyEvent() )
 nFlags |= FloatWinPopupFlags::GrabFocus;
 
-mpFloatWin->StartPopupMode( pParentToolBox, nFlags | 
FloatWinPopupFlags::MakeClientWindowVisibleBeforePopup);
+// tdf#140762, tdf#152671, tdf#154470, tdf#156100: Without client window 
being visible
+// before showing popup, at least NVDA on Windows does not announce items 
in the popup,
+// so make the client window visible first. This is problematic for gtk 
VCL plugins though,
+// so don't do it there and use different code paths for now.
+// For further analysis of the root causes, there's tdf#156561.
+const OUString sToolkit = Application::GetToolkitName();
+if (sToolkit == "gtk3" || sToolkit == "gtk4")
+{
+mpFloatWin->StartPopupMode( pParentToolBox, nFlags);
+GetWindow()->Show();
+}
+else
+{
+mpFloatWin->StartPopupMode( pParentToolBox, nFlags | 
FloatWinPopupFlags::MakeClientWindowVisibleBeforePopup);
+}
 
 if( pParentToolBox->IsKeyEvent() )
 {


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

2023-08-01 Thread Tünde Tóth (via logerrit)
 sc/qa/unit/uicalc/uicalc2.cxx|   26 ++
 sc/source/core/tool/refupdat.cxx |7 +--
 2 files changed, 27 insertions(+), 6 deletions(-)

New commits:
commit 04098a535bf25494379678b9539c4987cb33431f
Author: Tünde Tóth 
AuthorDate: Tue Jul 18 15:20:47 2023 +0200
Commit: László Németh 
CommitDate: Tue Aug 1 12:16:11 2023 +0200

tdf#156174 sc DBData: fix regression of database ranges

Regression from commit 0c0444c44107f1a18f23dd0833d462d8dbf56569
"tdf#126926 sc DBData: delete the database range".

Change-Id: If641af42a44cadbb8485bfa5b9a8eca5a757
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154582
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 94ca402cd1fe2fd9776d08448f7216b7f638e69a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155041

diff --git a/sc/qa/unit/uicalc/uicalc2.cxx b/sc/qa/unit/uicalc/uicalc2.cxx
index 3be123de219d..1ec77ad7ad37 100644
--- a/sc/qa/unit/uicalc/uicalc2.cxx
+++ b/sc/qa/unit/uicalc/uicalc2.cxx
@@ -1419,6 +1419,32 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf152577)
 CPPUNIT_ASSERT(!pDBs->empty());
 }
 
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf156174)
+{
+createScDoc();
+ScDocument* pDoc = getScDoc();
+
+insertNewSheet(*pDoc);
+
+insertStringToCell("A1", u"1");
+insertStringToCell("A2", u"2");
+insertStringToCell("B1", u"3");
+insertStringToCell("B2", u"4");
+
+ScDBData* pDBData = new ScDBData("testDB", 1, 0, 0, 1, 1);
+bool bInserted
+= 
pDoc->GetDBCollection()->getNamedDBs().insert(std::unique_ptr(pDBData));
+CPPUNIT_ASSERT(bInserted);
+
+insertNewSheet(*pDoc);
+uno::Sequence aArgs(
+comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(3)) 
} }));
+dispatchCommand(mxComponent, ".uno:Remove", aArgs);
+
+ScDBCollection* pDBs = pDoc->GetDBCollection();
+CPPUNIT_ASSERT(!pDBs->empty());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx
index ef0902aab3f4..e05a14d0137f 100644
--- a/sc/source/core/tool/refupdat.cxx
+++ b/sc/source/core/tool/refupdat.cxx
@@ -286,12 +286,7 @@ ScRefUpdateRes ScRefUpdate::Update( const ScDocument* 
pDoc, UpdateRefMode eUpdat
 bool bExp = (bExpand && IsExpand( theTab1, theTab2, nTab1, nDz ));
 bCut1 = lcl_MoveStart( theTab1, nTab1, nDz, nMaxTab );
 bCut2 = lcl_MoveEnd( theTab2, nTab1, nDz, nMaxTab );
-if ( theTab2 < theTab1 )
-{
-eRet = UR_INVALID;
-theTab2 = theTab1;
-}
-else if ( bCut1 || bCut2 )
+if ( bCut1 || bCut2 )
 eRet = UR_UPDATED;
 if ( bExp )
 {


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

2023-08-01 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/ooxmlexport/data/longBookmarkName.fodt |   13 +
 sw/qa/extras/ooxmlexport/ooxmlexport19.cxx  |   31 
 sw/source/filter/ww8/docxattributeoutput.cxx|   32 ++---
 sw/source/filter/ww8/docxattributeoutput.hxx|2 
 sw/source/filter/ww8/wrtw8nds.cxx   |   42 -
 sw/source/filter/ww8/wrtww8.cxx |   49 
 sw/source/filter/ww8/wrtww8.hxx |   10 +++-
 sw/source/filter/ww8/ww8atr.cxx |   14 ++---
 8 files changed, 128 insertions(+), 65 deletions(-)

New commits:
commit 38feff6a04b2785b219fabe7172c857e97ef90ae
Author: Mike Kaganski 
AuthorDate: Mon Jul 31 15:08:58 2023 +0300
Commit: Mike Kaganski 
CommitDate: Tue Aug 1 10:36:30 2023 +0200

tdf#156548: make truncated long bookmark name unique, and use it in 
hyperlinks

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

diff --git a/sw/qa/extras/ooxmlexport/data/longBookmarkName.fodt 
b/sw/qa/extras/ooxmlexport/data/longBookmarkName.fodt
new file mode 100644
index ..8b09760fcb6f
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/longBookmarkName.fodt
@@ -0,0 +1,13 @@
+
+
+http://www.w3.org/1999/xlink"; 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ 
+  
+   This is a hyperlink 
to the first target paragraph below
+   This is a hyperlink 
to the second target paragraph below
+   
+   The first target 
paragraph with a bookmark with a very long name
+   The second target 
paragraph with a bookmark with a very long name
+  
+ 
+
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
index 6e784193ba97..69a3fc137acb 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
@@ -1059,6 +1059,37 @@ DECLARE_OOXMLEXPORT_TEST(testTdf156372, "tdf156372.doc")
 CPPUNIT_ASSERT_EQUAL(1, getPages());
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf156548)
+{
+// Given a document using two bookmarks with similar names longer than 40 
characters
+loadAndReload("longBookmarkName.fodt");
+
+// After the export, the names must be no longer than 40 characters; they 
must be unique;
+// and the hyperlinks must use the same names, to still point to the 
correct targets:
+
+{
+// 1st  paragraph - hyperlink to 4th paragraph
+auto sURL = getProperty(getRun(getParagraph(1), 1), 
"HyperLinkURL");
+
CPPUNIT_ASSERT_EQUAL(OUString("#A_bookmark_name_longer_than_forty_charac"), 
sURL);
+// 4th paragraph - a bookmark
+auto xBookmark = 
getProperty>(getRun(getParagraph(4), 1),
+
"Bookmark");
+
CPPUNIT_ASSERT_EQUAL(OUString("A_bookmark_name_longer_than_forty_charac"),
+ xBookmark->getName());
+}
+
+{
+// 2nd  paragraph - hyperlink to 5th paragraph
+auto sURL = getProperty(getRun(getParagraph(2), 1), 
"HyperLinkURL");
+
CPPUNIT_ASSERT_EQUAL(OUString("#A_bookmark_name_longer_than_forty_chara1"), 
sURL);
+// 5th paragraph - a bookmark
+auto xBookmark = 
getProperty>(getRun(getParagraph(5), 1),
+
"Bookmark");
+
CPPUNIT_ASSERT_EQUAL(OUString("A_bookmark_name_longer_than_forty_chara1"),
+ xBookmark->getName());
+}
+}
+
 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 c97000ca3e4b..ec55455d5d3c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2170,11 +2170,11 @@ void DocxAttributeOutput::EndRun(const SwTextNode* 
pNode, sal_Int32 nPos, sal_In
 DoWriteBookmarkEndIfExist(nPos);
 }
 
-void DocxAttributeOutput::DoWriteBookmarkTagStart(std::u16string_view 
bookmarkName)
+void DocxAttributeOutput::DoWriteBookmarkTagStart(const OUString& bookmarkName)
 {
 m_pSerializer->singleElementNS(XML_w, XML_bookmarkStart,
 FSNS(XML_w, XML_id), OString::number(m_nNextBookmarkId),
-FSNS(XML_w, XML_name), BookmarkToWord(bookmarkName));
+FSNS(XML_w, XML_name), GetExport().BookmarkToWord(bookmarkName));
 }
 
 void DocxAttributeOutput::DoWriteBookmarkTagEnd(sal_Int32 const nId)
@@ -2230,7 +2230,7 @@ void 
DocxAttributeOutput::DoWriteBookmarkStartIfExist(sal_Int32 nRunPos)
 {
 DoWriteBookmarkTagStart(aIter->second);
 m_rOpenedBookmarksIds[aIter->second] = m_nNextBookmarkId;
-m_sLastOpenedBookmark = BookmarkToWord(aIter->second);
+m_sLas

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

2023-08-01 Thread Miklos Vajna (via logerrit)
 sw/source/core/unocore/unostyle.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 358f0313846da3b41aaea87be6fe0b286a25cef1
Author: Miklos Vajna 
AuthorDate: Tue Aug 1 09:18:13 2023 +0200
Commit: Andras Timar 
CommitDate: Tue Aug 1 10:20:28 2023 +0200

sw: fix build

/home/vmiklos/git/libreoffice/co-23.05/sw/source/core/unocore/unostyle.cxx: 
In member function ‘virtual 
com::sun::star::uno::Sequence 
{anonymous}::SwXStyle::getPropertyStates(const 
com::sun::star::uno::Sequence&)’:

/home/vmiklos/git/libreoffice/co-23.05/sw/source/core/unocore/unostyle.cxx:2554:30:
 error: ‘SfxStyleFamily {anonymous}::StyleFamilyEntry::m_eFamily’ is private 
within this context
 if (m_rEntry.m_eFamily == SfxStyleFamily::Frame
  ^

/home/vmiklos/git/libreoffice/co-23.05/sw/source/core/unocore/unostyle.cxx:201:20:
 note: declared private here
 SfxStyleFamily m_eFamily;
^
make[1]: *** 
[/home/vmiklos/git/libreoffice/co-23.05/solenv/gbuild/LinkTarget.mk:337: 
/home/vmiklos/git/libreoffice/co-23.05/workdir/CxxObject/sw/source/core/unocore/unostyle.o]
 Error 1

Change-Id: I3674834ad13efd070f057a981297c6c4d05d10e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155123
Reviewed-by: Andras Timar 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index bfc39c11992b..5f2bd6207894 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -2551,7 +2551,7 @@ uno::Sequence 
SwXStyle::getPropertyStates(const uno::Seque
 break;
 case XATTR_FILLSTYLE:
 {
-if (m_rEntry.m_eFamily == SfxStyleFamily::Frame
+if (m_rEntry.family() == SfxStyleFamily::Frame
 && xStyle->GetFrameFormat()->DerivedFrom() == 
GetDoc()->GetDfltFrameFormat())
 {   // tdf#156155 mpDfltFrameFormat is the parent, but because
 // it IsDefault() it is not enumerated/exported as a style


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

2023-08-01 Thread Caolán McNamara (via logerrit)
 chart2/source/controller/dialogs/tp_AxisPositions.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit eff5a3fe98ca5d1d28c4f5386c4af8a3be8f5703
Author: Caolán McNamara 
AuthorDate: Mon Jul 31 14:45:42 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 1 10:15:14 2023 +0200

gtk_tree_view_scroll_to_cell: assertion 'tree_view->priv->tree != NULL' 
failed

on loading sw//qa/extras/layout/data/tdf125334.odt and double clicking
chart

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

diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.cxx 
b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
index 8a31c73f3dfc..4e3e4bb75987 100644
--- a/chart2/source/controller/dialogs/tp_AxisPositions.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
@@ -295,7 +295,7 @@ IMPL_LINK_NOARG(AxisPositionsTabPage, CrossesAtSelectHdl, 
weld::ComboBox&, void)
 
 if (m_xED_CrossesAt->get_text().isEmpty())
 m_xED_CrossesAt->GetFormatter().SetValue(0.0);
-if (m_xED_CrossesAtCategory->get_active() == -1)
+if (m_xED_CrossesAtCategory->get_active() == -1 && 
m_xED_CrossesAtCategory->get_count())
 m_xED_CrossesAtCategory->set_active(0);
 
 PlaceLabelsSelectHdl(*m_xLB_PlaceLabels);


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

2023-08-01 Thread Miklos Vajna (via logerrit)
 sw/qa/core/doc/data/floating-table-dummy-text.docx  |binary
 sw/qa/core/doc/doc.cxx  |   33 
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   21 ++
 3 files changed, 54 insertions(+)

New commits:
commit 073072f0a3abacfe4f9cc920b8138d7abc84db70
Author: Miklos Vajna 
AuthorDate: Tue Aug 1 09:06:43 2023 +0200
Commit: Miklos Vajna 
CommitDate: Tue Aug 1 09:59:02 2023 +0200

tdf#156260 sw floattable: avoid overlapping flys on anchor change

Going to the end of the document, typing "dt" and F3 collapses the
multi-page floating table into a single page, with overlapping text.

In practice we insert a new paragraph before the "dt" one, insert the
dummy text there and then re-anchor the floating table from the old
paragraph to the new one. Such re-anchoring isn't really meant to be
done with floating tables, which are always just anchored in the next
paragraph in practice. An additional problem is that the amount of fly
frames created depends on the position of the first fly frame, so if the
anchor changes, we may need a different number of split fly frames.

Fix the problem by not trying to reuse the old fly frames on anchor
change: delete the old frames, change the anchor and finally create the
new frames, which leads to correct layout with complicated logic trying
to update the old fly chain to the new anchor.

The original document still puts some dummy text on page 4 instead of
starting it on page 5, that part is still unfixed.

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

diff --git a/sw/qa/core/doc/data/floating-table-dummy-text.docx 
b/sw/qa/core/doc/data/floating-table-dummy-text.docx
new file mode 100644
index ..14de5a920a88
Binary files /dev/null and b/sw/qa/core/doc/data/floating-table-dummy-text.docx 
differ
diff --git a/sw/qa/core/doc/doc.cxx b/sw/qa/core/doc/doc.cxx
index 5b523067523a..f8faee3a1bcd 100644
--- a/sw/qa/core/doc/doc.cxx
+++ b/sw/qa/core/doc/doc.cxx
@@ -34,6 +34,10 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 
 /// Covers sw/source/core/doc/ fixes.
 class SwCoreDocTest : public SwModelTestBase
@@ -482,6 +486,35 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testSplitFlyChain)
 CPPUNIT_ASSERT_EQUAL(SwChainRet::IS_IN_CHAIN, eActual);
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testSplitExpandGlossary)
+{
+// Given a document with a split fly (2 pages) and a 'dt' at the end:
+createSwDoc("floating-table-dummy-text.docx");
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+pWrtShell->SttEndDoc(/*bStt=*/false);
+
+// When expanding 'dt' to an actual dummy text:
+dispatchCommand(mxComponent, ".uno:ExpandGlossary", {});
+
+// Then make sure the 2 fly frames stay on the 2 pages:
+SwDoc* pDoc = getSwDoc();
+SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+auto pPage1 = dynamic_cast(pLayout->Lower());
+CPPUNIT_ASSERT(pPage1);
+CPPUNIT_ASSERT(pPage1->GetSortedObjs());
+const SwSortedObjs& rPage1Objs = *pPage1->GetSortedObjs();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 2
+// i.e. both parts of the split fly chain were on page 1.
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rPage1Objs.size());
+auto pPage2 = dynamic_cast(pPage1->GetNext());
+CPPUNIT_ASSERT(pPage2);
+CPPUNIT_ASSERT(pPage2->GetSortedObjs());
+const SwSortedObjs& rPage2Objs = *pPage2->GetSortedObjs();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rPage2Objs.size());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 0b51fc65e46e..4ad364ea6afc 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -70,6 +70,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -5241,7 +5242,27 @@ bool 
DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo
 {
 SwFormatAnchor anchor(*pAnchor);
 anchor.SetAnchor( &startPosAtPara );
+
+bool bSplitFly = false;
+if (pFly->GetFlySplit().GetValue())
+{
+SwIterator aIter(*pFly);
+bSplitFly = aIter.First() && aIter.Next();
+}
+if (bSplitFly)
+{
+// This fly format has multiple frames, and we change 
the anchor. Remove the
+// old frames, w

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

2023-08-01 Thread Paris Oplopoios (via logerrit)
 desktop/source/lib/init.cxx |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit d13b5f4d2eaa63cb94ba9e3603d49afa8ecf7c65
Author: Paris Oplopoios 
AuthorDate: Wed Jul 26 14:19:35 2023 +0300
Commit: Miklos Vajna 
CommitDate: Tue Aug 1 09:09:31 2023 +0200

Compare viewRenderState before setting view on doc_paintPartTile

It shouldn't be the case that the view is changed upon painting a tile
if the new view has different view options, as it may have a different
theme (light/dark)

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 112b134b5e84..62107c0f7e57 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4156,6 +4156,8 @@ static void doc_paintPartTile(LibreOfficeKitDocument* 
pThis,
 int nViewId = nOrigViewId;
 int nLastNonEditorView = -1;
 int nViewMatchingMode = -1;
+SfxViewShell* pCurrentViewShell = SfxViewShell::Current();
+
 if (!isText)
 {
 // Check if just switching to another view is enough, that has
@@ -4167,11 +4169,16 @@ static void doc_paintPartTile(LibreOfficeKitDocument* 
pThis,
 {
 bool bIsInEdit = pViewShell->GetDrawView() &&
 pViewShell->GetDrawView()->GetTextEditOutliner();
-if (!bIsInEdit)
+
+OString sCurrentViewRenderState = 
pDoc->getViewRenderState(pCurrentViewShell);
+OString sNewRenderState = 
pDoc->getViewRenderState(pViewShell);
+
+if (sCurrentViewRenderState == sNewRenderState && 
!bIsInEdit)
 nLastNonEditorView = 
pViewShell->GetViewShellId().get();
 
 if (pViewShell->getPart() == nPart &&
 pViewShell->getEditMode() == nMode &&
+sCurrentViewRenderState == sNewRenderState &&
 !bIsInEdit)
 {
 nViewId = pViewShell->GetViewShellId().get();
@@ -4180,7 +4187,7 @@ static void doc_paintPartTile(LibreOfficeKitDocument* 
pThis,
 doc_setView(pThis, nViewId);
 break;
 }
-else if (pViewShell->getEditMode() == nMode && !bIsInEdit)
+else if (pViewShell->getEditMode() == nMode && 
sCurrentViewRenderState == sNewRenderState && !bIsInEdit)
 {
 nViewMatchingMode = pViewShell->GetViewShellId().get();
 }
@@ -4192,7 +4199,6 @@ static void doc_paintPartTile(LibreOfficeKitDocument* 
pThis,
 // if not found view with correct part
 // - at least avoid rendering active textbox, This is for Impress.
 // - prefer view with the same mode
-SfxViewShell* pCurrentViewShell = SfxViewShell::Current();
 if (nViewMatchingMode >= 0 && nViewMatchingMode != nViewId)
 {
 nViewId = nViewMatchingMode;