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

2022-05-02 Thread Stephan Bergmann (via logerrit)
 sw/qa/extras/layout/layout2.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 6ba14f83add039d0df133febfcf7199c99f8d936
Author: Stephan Bergmann 
AuthorDate: Tue May 3 07:24:44 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue May 3 08:40:31 2022 +0200

Revert "enable test for all platforms"

This reverts commit b294a94861289c322a26edb6b83f0d329575639d, which keeps
failing frequently for Gerrit Jenkins Windows builds now, e.g.,


  
C:/cygwin/home/tdf/jenkins/workspace/gerrit_windows@2/sw/qa/extras/layout/layout2.cxx:1950:testTdf124261::TestBody
  equality assertion failed
  - Expected: 1721
  - Actual  : 3472

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

diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 7453dac90b0e..f88fbdc94f71 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -1920,6 +1920,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, 
testUserFieldTypeLanguage)
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124261)
 {
+#if !defined(_WIN32)
 // Make sure that pressing a key in a btlr cell frame causes an immediate, 
correct repaint.
 SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf124261.docx");
 SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
@@ -1948,6 +1949,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124261)
 SwTextFrame* pTextFrame = static_cast(pFrame);
 SwRect aRect = pTextFrame->GetPaintSwRect();
 CPPUNIT_ASSERT_EQUAL(pTextFrame->getFrameArea().Top(), aRect.Top());
+#endif
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();


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

2022-05-02 Thread Stephan Bergmann (via logerrit)
 vcl/qa/api/XGraphicTest.cxx  |   18 +-
 vcl/qa/cppunit/filter/ipdf/ipdf.cxx  |2 +-
 vcl/qa/cppunit/pdfexport/pdfexport.cxx   |   14 +++---
 vcl/source/components/fontident.cxx  |2 +-
 vcl/source/control/managedmenubutton.cxx |6 +++---
 vcl/source/gdi/pdfwriter_impl2.cxx   |2 +-
 vcl/source/gdi/print3.cxx|   14 +++---
 vcl/source/gdi/vectorgraphicdata.cxx |4 ++--
 vcl/source/outdev/outdev.cxx |2 +-
 vcl/source/window/printdlg.cxx   |   10 +-
 vcl/source/window/winproc.cxx|4 ++--
 vcl/win/dtrans/DOTransferable.cxx|2 +-
 12 files changed, 40 insertions(+), 40 deletions(-)

New commits:
commit c8053f5a5629c04defd813b061f0d59d6bf15f88
Author: Stephan Bergmann 
AuthorDate: Mon May 2 22:23:07 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue May 3 07:15:11 2022 +0200

Just use Any ctor instead of makeAny in vcl

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

diff --git a/vcl/qa/api/XGraphicTest.cxx b/vcl/qa/api/XGraphicTest.cxx
index afe50155a927..df05c05f9f4c 100644
--- a/vcl/qa/api/XGraphicTest.cxx
+++ b/vcl/qa/api/XGraphicTest.cxx
@@ -125,9 +125,9 @@ void XGraphicTest::testGraphicProvider()
 xGraphicProvider.set(graphic::GraphicProvider::create(xContext), 
uno::UNO_SET_THROW);
 
 auto aMediaProperties(comphelper::InitPropertySequence({
-{ "URL", uno::makeAny(aGraphicURL) },
-{ "LazyRead", uno::makeAny(true) },
-{ "LoadAsLink", uno::makeAny(false) },
+{ "URL", uno::Any(aGraphicURL) },
+{ "LazyRead", uno::Any(true) },
+{ "LoadAsLink", uno::Any(false) },
 }));
 
 uno::Reference xGraphic(
@@ -164,9 +164,9 @@ void XGraphicTest::testGraphicProvider()
 xGraphicProvider.set(graphic::GraphicProvider::create(xContext), 
uno::UNO_SET_THROW);
 
 auto aMediaProperties(comphelper::InitPropertySequence({
-{ "URL", uno::makeAny(aGraphicURL) },
-{ "LazyRead", uno::makeAny(false) },
-{ "LoadAsLink", uno::makeAny(true) },
+{ "URL", uno::Any(aGraphicURL) },
+{ "LazyRead", uno::Any(false) },
+{ "LoadAsLink", uno::Any(true) },
 }));
 
 uno::Reference xGraphic(
@@ -201,9 +201,9 @@ void XGraphicTest::testGraphicProvider()
 xGraphicProvider.set(graphic::GraphicProvider::create(xContext), 
uno::UNO_SET_THROW);
 
 auto aMediaProperties(comphelper::InitPropertySequence({
-{ "URL", uno::makeAny(aGraphicURL) },
-{ "LazyRead", uno::makeAny(true) },
-{ "LoadAsLink", uno::makeAny(true) },
+{ "URL", uno::Any(aGraphicURL) },
+{ "LazyRead", uno::Any(true) },
+{ "LoadAsLink", uno::Any(true) },
 }));
 
 uno::Reference xGraphic(
diff --git a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx 
b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
index a2732b58d862..ca5460e63b48 100644
--- a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
+++ b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
@@ -114,7 +114,7 @@ CPPUNIT_TEST_FIXTURE(VclFilterIpdfTest, 
testPDFAddVisibleSignatureLastPage)
 // Select it and assign a certificate.
 uno::Reference 
xSelectionSupplier(pBaseModel->getCurrentController(),
 
uno::UNO_QUERY);
-xSelectionSupplier->select(uno::makeAny(xShape));
+xSelectionSupplier->select(uno::Any(xShape));
 auto xCert = GetValidCertificate(
 
getSecurityContext()->getSecurityEnvironment()->getPersonalCertificates());
 if (!xCert)
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 0bfebea97464..54f9334a1607 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -1513,7 +1513,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf113143)
 // want to test.
 { "ReduceImageResolution", uno::Any(false) },
 // Set a custom PDF version.
-{ "SelectPdfVersion", uno::makeAny(static_cast(16)) },
+{ "SelectPdfVersion", uno::Any(static_cast(16)) },
 }));
 aMediaDescriptor["FilterData"] <<= aFilterData;
 saveAsPDF(u"tdf113143.odp");
@@ -2113,7 +2113,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, 
testPdfImageResourceInlineXObjectRef)
 xFactory->createInstance("com.sun.star.text.TextGraphicObject"), 
uno::UNO_QUERY);
 OUString aURL
 = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"pdf-image-resource-inline-xobject-ref.pdf";
-xGraphicObject->setPropertyValue("GraphicURL", uno::makeAny(aURL));
+xGraphicObject->setPropertyValue("GraphicURL", uno::Any(aURL));
 uno::Reference xShape(xGraphicObject, uno::UNO_QUERY);
 xShape->setSize(awt::Size(1000, 1

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

2022-05-02 Thread Luboš Luňák (via logerrit)
 include/o3tl/lru_map.hxx  |7 ---
 o3tl/qa/test-lru_map.cxx  |   20 
 vcl/source/font/fontcache.cxx |2 +-
 3 files changed, 5 insertions(+), 24 deletions(-)

New commits:
commit 0cc8da4c091ac5784c0b4c2c7850ca8dabffea04
Author: Luboš Luňák 
AuthorDate: Mon May 2 10:52:50 2022 +0200
Commit: Luboš Luňák 
CommitDate: Tue May 3 06:54:54 2022 +0200

remove the o3tl::lru_map "unlimited" hack

It didn't quite make sense before that maxsize == 0 meant no cleanup,
and now with items optionally being count as having size more than 1
it makes even less sense to limit the size to max_size() of the
containers. This comes from 16a338e173083954a9932a3a4005f17230,
so instead make that special caller pass a large size, which in
practice is the same.

Change-Id: Id875862126200ba889211f6e4079ae5921f27650
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133690
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/include/o3tl/lru_map.hxx b/include/o3tl/lru_map.hxx
index 42cb932786b0..859617e5d988 100644
--- a/include/o3tl/lru_map.hxx
+++ b/include/o3tl/lru_map.hxx
@@ -166,10 +166,10 @@ public:
 typedef list_iterator_t iterator;
 typedef list_const_iterator_t const_iterator;
 
-// a size of 0 effectively disables the LRU cleanup code
 lru_map(size_t nMaxSize)
-: mMaxSize(nMaxSize ? nMaxSize : std::min(mLruMap.max_size(), 
mLruList.max_size()))
+: mMaxSize(nMaxSize)
 {
+assert(mMaxSize > 0);
 }
 ~lru_map()
 {
@@ -182,7 +182,8 @@ public:
 
 void setMaxSize(size_t nMaxSize)
 {
-mMaxSize = nMaxSize ? nMaxSize : std::min(mLruMap.max_size(), 
mLruList.max_size());
+mMaxSize = nMaxSize;
+assert(mMaxSize > 0);
 checkLRUMaxSize();
 }
 
diff --git a/o3tl/qa/test-lru_map.cxx b/o3tl/qa/test-lru_map.cxx
index edc9d7e1bf98..c99a803b3163 100644
--- a/o3tl/qa/test-lru_map.cxx
+++ b/o3tl/qa/test-lru_map.cxx
@@ -27,7 +27,6 @@ public:
 void testLruRemoval();
 void testCustomHash();
 void testRemoveIf();
-void testNoAutoCleanup();
 void testChangeMaxSize();
 void testCustomItemSize();
 
@@ -38,7 +37,6 @@ public:
 CPPUNIT_TEST(testLruRemoval);
 CPPUNIT_TEST(testCustomHash);
 CPPUNIT_TEST(testRemoveIf);
-CPPUNIT_TEST(testNoAutoCleanup);
 CPPUNIT_TEST(testChangeMaxSize);
 CPPUNIT_TEST(testCustomItemSize);
 CPPUNIT_TEST_SUITE_END();
@@ -295,24 +293,6 @@ void lru_map_test::testRemoveIf()
 CPPUNIT_ASSERT_EQUAL(size_t(0), lru.size());
 }
 
-void lru_map_test::testNoAutoCleanup()
-{
-o3tl::lru_map lru(0);
-CPPUNIT_ASSERT_EQUAL(size_t(0), lru.size());
-lru.insert({ 0, 0 });
-lru.insert({ 1, 1 });
-CPPUNIT_ASSERT_EQUAL(size_t(2), lru.size());
-lru.insert({ 0, 0 });
-CPPUNIT_ASSERT_EQUAL(size_t(2), lru.size());
-
-int i = 0;
-for (auto& rPair : lru)
-{
-CPPUNIT_ASSERT_EQUAL(i, rPair.first);
-++i;
-}
-}
-
 void lru_map_test::testChangeMaxSize()
 {
 o3tl::lru_map lru(3);
diff --git a/vcl/source/font/fontcache.cxx b/vcl/source/font/fontcache.cxx
index b98d1bb644cc..9a87d02bcda2 100644
--- a/vcl/source/font/fontcache.cxx
+++ b/vcl/source/font/fontcache.cxx
@@ -88,7 +88,7 @@ bool ImplFontCache::IFSD_Equal::operator()(const 
vcl::font::FontSelectPattern& r
 
 ImplFontCache::ImplFontCache()
 : mpLastHitCacheEntry( nullptr )
-, maFontInstanceList(0)
+, maFontInstanceList(std::numeric_limits::max()) // "unlimited", 
i.e. no cleanup
 // The cache limit is set by the rough number of characters needed to read 
your average Asian newspaper.
 , m_aBoundRectCache(3000)
 {}


[Libreoffice-commits] core.git: external/libwebp RepositoryExternal.mk

2022-05-02 Thread Luboš Luňák (via logerrit)
 RepositoryExternal.mk   |2 +-
 external/libwebp/ExternalProject_libwebp.mk |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1661a3ee77d78807f287146f8190d02d89963fe2
Author: Luboš Luňák 
AuthorDate: Mon May 2 16:24:00 2022 +0200
Commit: Luboš Luňák 
CommitDate: Tue May 3 06:54:08 2022 +0200

use proper MSVC runtime lib for libwebp

Change-Id: Icf976bb4a4593bfa8e8fc506d4c5e86cb7f88671
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133705
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index b51660e182cb..590a6093aea1 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -2638,7 +2638,7 @@ $(call gb_LinkTarget_set_include,$(1),\
 )
 ifeq ($(OS),WNT)
 $(call gb_LinkTarget_add_libs,$(1),\
-   $(call 
gb_UnpackedTarball_get_dir,libwebp)/output/lib/libwebp$(gb_StaticLibrary_PLAINEXT)
 \
+   $(call gb_UnpackedTarball_get_dir,libwebp)/output/lib/libwebp$(if 
$(MSVC_USE_DEBUG_RUNTIME),_debug)$(gb_StaticLibrary_PLAINEXT) \
 )
 else
 $(call gb_LinkTarget_add_libs,$(1),\
diff --git a/external/libwebp/ExternalProject_libwebp.mk 
b/external/libwebp/ExternalProject_libwebp.mk
index 3f38572ccefc..0146bd72acfc 100644
--- a/external/libwebp/ExternalProject_libwebp.mk
+++ b/external/libwebp/ExternalProject_libwebp.mk
@@ -21,7 +21,7 @@ $(eval $(call gb_ExternalProject_use_nmake,libwebp,build))
 $(call gb_ExternalProject_get_state_target,libwebp,build):
$(call gb_Trace_StartRange,libwebp,EXTERNAL)
$(call gb_ExternalProject_run,build,\
-   nmake -nologo -f Makefile.vc CFG=release-static RTLIBCFG=static 
OBJDIR=output \
+   nmake -nologo -f Makefile.vc CFG=$(if 
$(MSVC_USE_DEBUG_RUNTIME),debug,release)-static RTLIBCFG=dynamic OBJDIR=output \
$(if $(filter INTEL,$(CPUNAME)),ARCH=x86, \
$(if $(filter X86_64,$(CPUNAME)),ARCH=x64, \
$(if $(filter AARCH64,$(CPUNAME)),ARCH=ARM))) \


[Libreoffice-commits] core.git: helpcontent2

2022-05-02 Thread Seth Chaiklin (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 69f412459257398a7d779541dad95aa7227a5e74
Author: Seth Chaiklin 
AuthorDate: Mon May 2 23:08:02 2022 +0100
Commit: Gerrit Code Review 
CommitDate: Tue May 3 00:08:02 2022 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 42ded671522a4e62659b561b0c8ea67fef5b9cea
  - tdf#148485 add missing options for Vertical positioning

  This patch started with the simple intent to add some
  missing options to the "To" control in the Position section
  of the the Position and Size dialog. However, problems were
  discovered with the names of some of the options to be added,
  as well as some of the existing options. This lead to
  tdf#148591 and tdf#148519, which changed the labels for the
  missing options mentioned in the OP for tdf#148485. Thanks to
  Regina Henschel for essential help in understanding the regions
  to which the labels are supposed to refer.

  Using the new option labels, this patch adds
  "Above page text area", "Below page text area" as "to" options
  in the Vertical position section of the Position and Size dialog,
  and "Frame text area" and "Entire frame" in both the Position
  and Size dialog for Shape and the Type dialog for Image.

  Because Above/Below text page area is not found in the Image dialog
  for Writer, needed to add an additional section to
  swriter/01/05060100.xhp (Image/Frame - Type tab), so that it is
  possible to add the missing options (Above page text area,
  Below page text area) to Position and Size help for Writer
  (shared/01/05230100.xhp), but not have them be part of a section
  that will be embedded in swriter/01/05060100.xhp (for Image/Frame -
  Type tab).

  swriter/01/05060100.xhp
* Corrected description of "to" control
+ Added "Available only..." for "Line of text"
* refactored to 
o All embedded to shared/01/05230100.xhp for Writer (Image - Type).

Change-Id: I9fffec30dd994d15aa9a7c9ef70dec01d63ed98f
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/132709
Tested-by: Jenkins
Reviewed-by: Seth Chaiklin 

diff --git a/helpcontent2 b/helpcontent2
index 834789bd8d25..42ded671522a 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 834789bd8d25cfee57662c8023a34f8e80cc078d
+Subproject commit 42ded671522a4e62659b561b0c8ea67fef5b9cea


[Libreoffice-commits] help.git: source/text

2022-05-02 Thread Seth Chaiklin (via logerrit)
 source/text/shared/01/05230100.xhp  |   10 ++
 source/text/swriter/01/05060100.xhp |   16 +---
 2 files changed, 23 insertions(+), 3 deletions(-)

New commits:
commit 42ded671522a4e62659b561b0c8ea67fef5b9cea
Author: Seth Chaiklin 
AuthorDate: Mon Apr 11 14:49:08 2022 +0100
Commit: Seth Chaiklin 
CommitDate: Tue May 3 00:08:00 2022 +0200

tdf#148485 add missing options for Vertical positioning

  This patch started with the simple intent to add some
  missing options to the "To" control in the Position section
  of the the Position and Size dialog. However, problems were
  discovered with the names of some of the options to be added,
  as well as some of the existing options. This lead to
  tdf#148591 and tdf#148519, which changed the labels for the
  missing options mentioned in the OP for tdf#148485. Thanks to
  Regina Henschel for essential help in understanding the regions
  to which the labels are supposed to refer.

  Using the new option labels, this patch adds
  "Above page text area", "Below page text area" as "to" options
  in the Vertical position section of the Position and Size dialog,
  and "Frame text area" and "Entire frame" in both the Position
  and Size dialog for Shape and the Type dialog for Image.

  Because Above/Below text page area is not found in the Image dialog
  for Writer, needed to add an additional section to
  swriter/01/05060100.xhp (Image/Frame - Type tab), so that it is
  possible to add the missing options (Above page text area,
  Below page text area) to Position and Size help for Writer
  (shared/01/05230100.xhp), but not have them be part of a section
  that will be embedded in swriter/01/05060100.xhp (for Image/Frame -
  Type tab).

  swriter/01/05060100.xhp
* Corrected description of "to" control
+ Added "Available only..." for "Line of text"
* refactored to 
o All embedded to shared/01/05230100.xhp for Writer (Image - Type).

Change-Id: I9fffec30dd994d15aa9a7c9ef70dec01d63ed98f
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/132709
Tested-by: Jenkins
Reviewed-by: Seth Chaiklin 

diff --git a/source/text/shared/01/05230100.xhp 
b/source/text/shared/01/05230100.xhp
index 8ac052e9f..8085a1218 100644
--- a/source/text/shared/01/05230100.xhp
+++ b/source/text/shared/01/05230100.xhp
@@ -149,6 +149,16 @@
 
 
 
+2022-05-01: Following two options are not in Image (Type tab for 
Writer), so not part of sections embedded here.
+
+  
+Below 
page text area: the bottom edge of the page text area to the bottom 
edge of the page.
+  
+  
+Above 
page text area: the top edge of the page to the top of the page text 
area.
+  
+
+
 
   
   
diff --git a/source/text/swriter/01/05060100.xhp 
b/source/text/swriter/01/05060100.xhp
index ca9cad0bb..20224d16c 100644
--- a/source/text/swriter/01/05060100.xhp
+++ b/source/text/swriter/01/05060100.xhp
@@ -145,13 +145,13 @@
 
 Vertical
 Select the vertical alignment option for the object.
-If you anchor 
an object to a frame with a fixed height, only the "Bottom" and "Center" 
alignment options are available.
+If you anchor an object to a 
frame with a fixed height, only the "Bottom" and "Center" alignment options are 
available.
 
 by
 Enter the amount of space to leave between the top edge of the selected 
object and the reference point that you select in the To 
box. This option is only available if you select "From Top" or "From 
Bottom" (as character) in the Vertical box. 
 
 to
-Select the reference point for the selected vertical alignment 
option. The following options are available:
+Select the region or reference point for the  vertical 
alignment. The object can be positioned in relation to the following 
regions or reference points:
 
   
 Margin: Depending on the anchoring type, the 
object is positioned considering the space between the top margin and the 
character ("To character" anchoring) or bottom edge of the paragraph ("To 
paragraph" anchoring) where the anchor is placed.
@@ -165,11 +165,15 @@
   
 Page text 
area: the object is positioned considering the full height available for 
text, from top to bottom margins.
   
+
+  
+  
+
   
 Character: the object is positioned considering 
the vertical space used by the character.
   
   
-Line of 
text: the object is positioned considering the height of the line of 
text where the anchor is placed.
+Line 
of text: available only for "To character" anchoring, the object is 
positioned considering the height of the line of text where the anchor is 
placed.
   
   
 Baseline: available only for "As character" 
anchoring, this option will position the object considering the text baselin

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

2022-05-02 Thread László Németh (via logerrit)
 sw/qa/extras/uiwriter/uiwriter3.cxx |   40 +---
 sw/source/core/fields/cellfml.cxx   |5 +---
 sw/source/core/table/swtable.cxx|3 +-
 3 files changed, 41 insertions(+), 7 deletions(-)

New commits:
commit 978e22f8cfb3db573bed3fd4b14a515cf090f7e5
Author: László Németh 
AuthorDate: Thu Apr 28 19:48:52 2022 +0200
Commit: László Németh 
CommitDate: Mon May 2 22:57:06 2022 +0200

tdf#146573 sw: recalculate cells with footnotes

Commit 915d3eebc1dc4f18d7a1992db801ee8313ee46c0
"tdf#39828 sw: fix table formula calculation at track changes"
allowed to use footnotes in value cells unintentionally.
The only problem was that modifying cells with footnotes didn't
trigger formula recalculation in text tables, according to the
incomplete SwTableBox::IsValidNumTextNd(). Instead of
asking formula recalculation pressing F9, now IsValidNumTextNd
was extended to skip footnotes, similar to the already
skipped comments.

Also clean-up to testTdf39828 (remove copy-paste code), and
clean-up to commit 915d3eebc1dc4f18d7a1992db801ee8313ee46c0
"tdf#39828 sw: fix table formula calculation at track changes"
to avoid of unnecessary calls of GetRedlineText(), which
is an expensive call, especially when there are a lot of redlines
with overlapping (see commit d467cd0dd9e9cf3b018859a592e2638527bc7add
"tdf#135683 speedup DocumentRedlineManager::GetRedlinePos").

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

diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 91b16d045868..341237f75aaa 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -3490,9 +3490,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf87199)
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf39828)
 {
 SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf39828.fodt");
-SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
-
-pWrtShell->GotoNextTOXBase();
 
 // show changes
 pDoc->getIDocumentRedlineAccess().SetRedlineFlags(RedlineFlags::ShowDelete
@@ -3521,6 +3518,43 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf39828)
 CPPUNIT_ASSERT_EQUAL(OUString("8"), xCellA4->getString());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf146573)
+{
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf39828.fodt");
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+// remove redlines, add a footnote, and change the value
+// of the cell with the footnote
+dispatchCommand(mxComponent, ".uno:AcceptAllTrackedChanges", {});
+Scheduler::ProcessEventsToIdle();
+pWrtShell->Right(CRSR_SKIP_CELLS, /*bSelect=*/false, /*nCount=*/1, 
/*bBasicCall=*/false);
+dispatchCommand(mxComponent, ".uno:InsertFootnote", {});
+dispatchCommand(mxComponent, ".uno:PageUp", {}); // leave footnote
+pWrtShell->Left(CRSR_SKIP_CELLS, /*bSelect=*/false, /*nCount=*/1, 
/*bBasicCall=*/false);
+pWrtShell->Left(CRSR_SKIP_CELLS, /*bSelect=*/true, /*nCount=*/1, 
/*bBasicCall=*/false);
+pWrtShell->Insert("100");
+
+// trigger recalculation by leaving the cell
+pWrtShell->Down(/*bSelect=*/false, /*nCount=*/1);
+
+uno::Reference xTextTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference 
xIndexAccess(xTextTablesSupplier->getTextTables(),
+ uno::UNO_QUERY);
+uno::Reference xTextTable(xIndexAccess->getByIndex(0), 
uno::UNO_QUERY);
+
+CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xTextTable->getRows()->getCount());
+
+uno::Reference xCellA1(xTextTable->getCellByName("A1"), 
uno::UNO_QUERY);
+// value "100" and footnote index "1"
+CPPUNIT_ASSERT_EQUAL(OUString("1001"), xCellA1->getString());
+uno::Reference xCellA3(xTextTable->getCellByName("A3"), 
uno::UNO_QUERY);
+// This was 4 (missing recalculation)
+CPPUNIT_ASSERT_EQUAL(OUString("102"), xCellA3->getString());
+uno::Reference xCellA4(xTextTable->getCellByName("A4"), 
uno::UNO_QUERY);
+// This was 8 (missing recalculation)
+CPPUNIT_ASSERT_EQUAL(OUString("204"), xCellA4->getString());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132603)
 {
 createSwDoc();
diff --git a/sw/source/core/fields/cellfml.cxx 
b/sw/source/core/fields/cellfml.cxx
index 12bfec75a4ff..339a0337b561 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -152,9 +152,8 @@ double SwTableBox::GetValue( SwTableCalcPara& rCalcPara ) 
const
 OUString sText = pTextNd->GetText();
 
 // use text of the tracked changes
-if ( sText != pTextNd->GetRedlineText() &&
-sText.getLength() > 0 &&
-sText[0] != CH_TXTATR_BREAKWORD && sText[0] != CH_TXTATR_INWORD )
+if ( sText.getLength() > 0 &&
+ 

[Libreoffice-commits] core.git: compilerplugins/clang writerperfect/qa writerperfect/source

2022-05-02 Thread Stephan Bergmann (via logerrit)
 compilerplugins/clang/redundantfcast.cxx |4 +++
 writerperfect/qa/unit/EPUBExportTest.cxx |   26 +++
 writerperfect/source/writer/EPUBExportFilter.cxx |4 +--
 writerperfect/source/writer/EPUBPackage.cxx  |2 -
 writerperfect/source/writer/exp/xmlimp.cxx   |5 ++--
 5 files changed, 23 insertions(+), 18 deletions(-)

New commits:
commit 64106353c98e8cb0c99c9e4ff509348edf8ed911
Author: Stephan Bergmann 
AuthorDate: Mon May 2 14:31:03 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 2 22:01:00 2022 +0200

Just use Any ctor instead of makeAny in writerperfect

(which needs one more false loplugin:redundantfcast suppression case)

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

diff --git a/compilerplugins/clang/redundantfcast.cxx 
b/compilerplugins/clang/redundantfcast.cxx
index e78f2cf976ab..38a7daf9fff7 100644
--- a/compilerplugins/clang/redundantfcast.cxx
+++ b/compilerplugins/clang/redundantfcast.cxx
@@ -180,6 +180,10 @@ public:
 
 if (m_Seen.insert(arg->getExprLoc()).second)
 {
+if (suppressWarningAt(arg->getBeginLoc()))
+{
+continue;
+}
 report(DiagnosticsEngine::Warning,
"redundant functional cast from %0 to %1 in construct 
expression",
arg->getExprLoc())
diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx 
b/writerperfect/qa/unit/EPUBExportTest.cxx
index 15e70733dda5..71bf41130a9c 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -215,7 +215,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testEPUB2)
 {
 uno::Sequence 
aFilterData(comphelper::InitPropertySequence(
 { // Explicitly request EPUB2.
-  { "EPUBVersion", uno::makeAny(static_cast(20)) } }));
+  { "EPUBVersion", uno::Any(static_cast(20)) } }));
 createDoc(u"hello.fodt", aFilterData);
 
 mpXmlDoc = parseExport("OEBPS/content.opf");
@@ -228,7 +228,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testEPUBFixedLayout)
 uno::Sequence 
aFilterData(comphelper::InitPropertySequence(
 { // Explicitly request fixed layout.
   { "EPUBLayoutMethod",
-
uno::makeAny(static_cast(libepubgen::EPUB_LAYOUT_METHOD_FIXED)) } 
}));
+
uno::Any(static_cast(libepubgen::EPUB_LAYOUT_METHOD_FIXED)) } }));
 createDoc(u"hello.fodt", aFilterData);
 
 mpXmlDoc = parseExport("OEBPS/content.opf");
@@ -254,7 +254,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, 
testEPUBFixedLayoutImplicitBreak)
 uno::Sequence 
aFilterData(comphelper::InitPropertySequence(
 { // Explicitly request fixed layout.
   { "EPUBLayoutMethod",
-
uno::makeAny(static_cast(libepubgen::EPUB_LAYOUT_METHOD_FIXED)) } 
}));
+
uno::Any(static_cast(libepubgen::EPUB_LAYOUT_METHOD_FIXED)) } }));
 createDoc(u"fxl-2page.fodt", aFilterData);
 
 CPPUNIT_ASSERT(mxZipFile->hasByName("OEBPS/sections/section0001.xhtml"));
@@ -275,7 +275,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testPageBreakSplit)
 uno::Sequence 
aFilterData(comphelper::InitPropertySequence(
 { // Explicitly request split on page break (instead of on heading).
   { "EPUBSplitMethod",
-
uno::makeAny(static_cast(libepubgen::EPUB_SPLIT_METHOD_PAGE_BREAK)) 
} }));
+
uno::Any(static_cast(libepubgen::EPUB_SPLIT_METHOD_PAGE_BREAK)) } 
}));
 createDoc(u"2pages.fodt", aFilterData);
 
 // Make sure that the output is split into two.
@@ -345,11 +345,11 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testMetaXMP)
 CPPUNIT_TEST_FIXTURE(EPUBExportTest, testMetaAPI)
 {
 uno::Sequence 
aFilterData(comphelper::InitPropertySequence(
-{ { "RVNGIdentifier", 
uno::makeAny(OUString("deadc0de-e394-4cd6-9b83-7172794612e5")) },
-  { "RVNGTitle", uno::makeAny(OUString("unknown title from api")) },
-  { "RVNGInitialCreator", uno::makeAny(OUString("unknown author from 
api")) },
-  { "RVNGLanguage", uno::makeAny(OUString("hu")) },
-  { "RVNGDate", uno::makeAny(OUString("2015-11-20T17:16:07Z")) } }));
+{ { "RVNGIdentifier", 
uno::Any(OUString("deadc0de-e394-4cd6-9b83-7172794612e5")) },
+  { "RVNGTitle", uno::Any(OUString("unknown title from api")) },
+  { "RVNGInitialCreator", uno::Any(OUString("unknown author from 
api")) },
+  { "RVNGLanguage", uno::Any(OUString("hu")) },
+  { "RVNGDate", uno::Any(OUString("2015-11-20T17:16:07Z")) } }));
 createDoc(u"meta-xmp.fodt", aFilterData);
 mpXmlDoc = parseExport("OEBPS/content.opf");
 
@@ -367,7 +367,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testCoverImage)
 {
 OUString aCoverURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"meta.cover-image.png";
 un

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

2022-05-02 Thread Stephan Bergmann (via logerrit)
 writerfilter/qa/cppunittests/filters-test/filters-test.cxx |2 
 writerfilter/source/dmapper/BorderHandler.cxx  |2 
 writerfilter/source/dmapper/CellColorHandler.cxx   |   30 
 writerfilter/source/dmapper/DomainMapper.cxx   |  338 +-
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx   |   58 -
 writerfilter/source/dmapper/DomainMapperTableManager.cxx   |   34 -
 writerfilter/source/dmapper/DomainMapper_Impl.cxx  |  430 ++---
 writerfilter/source/dmapper/FormControlHelper.cxx  |   28 
 writerfilter/source/dmapper/GraphicImport.cxx  |  130 +--
 writerfilter/source/dmapper/NumberingManager.cxx   |   22 
 writerfilter/source/dmapper/OLEHandler.cxx |6 
 writerfilter/source/dmapper/PropertyMap.cxx|  152 ++--
 writerfilter/source/dmapper/SdtHelper.cxx  |   30 
 writerfilter/source/dmapper/SettingsTable.cxx  |   18 
 writerfilter/source/dmapper/StyleSheetTable.cxx|   48 -
 writerfilter/source/dmapper/TDefTableHandler.cxx   |   12 
 writerfilter/source/dmapper/TableManager.cxx   |8 
 writerfilter/source/dmapper/TablePropertiesHandler.cxx |   22 
 writerfilter/source/dmapper/TblStylePrHandler.cxx  |   12 
 writerfilter/source/dmapper/TextEffectsHandler.cxx |   32 
 writerfilter/source/filter/RtfFilter.cxx   |4 
 writerfilter/source/filter/WriterFilter.cxx|   56 -
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx  |2 
 writerfilter/source/rtftok/rtfdispatchdestination.cxx  |3 
 writerfilter/source/rtftok/rtfdispatchflag.cxx |4 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   28 
 writerfilter/source/rtftok/rtfsdrimport.cxx|  103 +--
 27 files changed, 804 insertions(+), 810 deletions(-)

New commits:
commit 92fc91bbb865af2888a0717cdaef5e2af5b4b719
Author: Stephan Bergmann 
AuthorDate: Mon May 2 17:56:05 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 2 21:59:54 2022 +0200

Just use Any ctor instead of makeAny in writerfilter

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

diff --git a/writerfilter/qa/cppunittests/filters-test/filters-test.cxx 
b/writerfilter/qa/cppunittests/filters-test/filters-test.cxx
index f377e8894c32..36ebeee2142e 100644
--- a/writerfilter/qa/cppunittests/filters-test/filters-test.cxx
+++ b/writerfilter/qa/cppunittests/filters-test/filters-test.cxx
@@ -46,7 +46,7 @@ bool RtfTest::load(const OUString&, const OUString& rURL, 
const OUString&, SfxFi
SotClipboardFormatId, unsigned int)
 {
 uno::Sequence aDescriptor = { beans::PropertyValue(
-"URL", sal_Int32(0), uno::makeAny(rURL), 
beans::PropertyState_DIRECT_VALUE) };
+"URL", sal_Int32(0), uno::Any(rURL), 
beans::PropertyState_DIRECT_VALUE) };
 try
 {
 return m_xFilter->filter(aDescriptor);
diff --git a/writerfilter/source/dmapper/BorderHandler.cxx 
b/writerfilter/source/dmapper/BorderHandler.cxx
index c9c793ca35ff..cb8e38c7512e 100644
--- a/writerfilter/source/dmapper/BorderHandler.cxx
+++ b/writerfilter/source/dmapper/BorderHandler.cxx
@@ -168,7 +168,7 @@ PropertyMapPtr  BorderHandler::getProperties()
 for( auto nProp: o3tl::enumrange())
 {
 if ( m_aFilledLines[nProp] ) {
-pPropertyMap->Insert( aPropNames[nProp], uno::makeAny( 
m_aBorderLines[nProp] ) );
+pPropertyMap->Insert( aPropNames[nProp], uno::Any( 
m_aBorderLines[nProp] ) );
 }
 }
 }
diff --git a/writerfilter/source/dmapper/CellColorHandler.cxx 
b/writerfilter/source/dmapper/CellColorHandler.cxx
index 765d5a3a5273..439806e20fa8 100644
--- a/writerfilter/source/dmapper/CellColorHandler.cxx
+++ b/writerfilter/source/dmapper/CellColorHandler.cxx
@@ -92,7 +92,7 @@ static uno::Any lcl_ConvertShd(sal_Int32 nIntValue)
 case NS_ooxml::LN_Value_ST_Shd_pct95: aRet = "pct95"; break;
 case NS_ooxml::LN_Value_ST_Shd_nil: aRet = "nil"; break;
 }
-return uno::makeAny(aRet);
+return uno::Any(aRet);
 }
 
 void CellColorHandler::lcl_attribute(Id rName, Value & rVal)
@@ -107,7 +107,7 @@ void CellColorHandler::lcl_attribute(Id rName, Value & rVal)
 }
 break;
 case NS_ooxml::LN_CT_Shd_fill:
-createGrabBag("fill", 
uno::makeAny(msfilter::util::ConvertColorOU(Color(ColorTransparency, 
nIntValue;
+createGrabBag("fill", 
uno::Any(msfilter::util::ConvertColorOU(Color(ColorTransparency, nIntValue;
 if( nIntValue == sal_Int32(COL_AUTO) )
 nIntValue = 0xff; //fill color auto means white
 else
@@ -117,29 +117,29 @@ void CellColorHandler::lcl_attribute(Id rName, Value & 
rVal)

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

2022-05-02 Thread Miklos Vajna (via logerrit)
 framework/inc/dispatch/dispatchprovider.hxx|2 ++
 framework/source/dispatch/dispatchprovider.cxx |   22 +-
 2 files changed, 19 insertions(+), 5 deletions(-)

New commits:
commit 3f768cddd28a2f04eb1ffa30bed4474deb6fbfc4
Author: Miklos Vajna 
AuthorDate: Mon May 2 16:25:31 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 2 21:59:28 2022 +0200

framework: avoid re-creating protocol handler instances all the time

Once you install an extension that adds its own protocol handlers (e.g.
), DispatchProvider
re-creates this protocol handler every time the custom menu gets opened
or a command gets dispatched.

This allows the dispatch provider to avoid managing the lifecycle of
those protocol handler instances, but in case the constructor of those
handlers is expensive, this leads to performance problems.

Introduce a map of handler instances in DispatchProvider to avoid
unnecessary re-creation and re-initialization: these instances get the
same XFrame anyway (the DispatchProvider is owned by the frame), so this
is meant to be safe.

No testcase for this -- the problem is only visible if you have an UNO
service registered in the global UNO service registry, but by the time
our cppunit tests run, that is already a fixed list, so this would be
hard to test from code.

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

diff --git a/framework/inc/dispatch/dispatchprovider.hxx 
b/framework/inc/dispatch/dispatchprovider.hxx
index 804df44abc0c..4552e0580d2c 100644
--- a/framework/inc/dispatch/dispatchprovider.hxx
+++ b/framework/inc/dispatch/dispatchprovider.hxx
@@ -74,6 +74,8 @@ class DispatchProvider final : public ::cppu::WeakImplHelper< 
css::frame::XDispa
 css::uno::WeakReference< css::frame::XFrame > m_xFrame;
 /// cache of some other dispatch provider which are registered inside 
configuration to handle special URL protocols
 HandlerCache m_aProtocolHandlerCache;
+std::unordered_map>
+m_aProtocolHandlers;
 
 /* interface */
 public:
diff --git a/framework/source/dispatch/dispatchprovider.cxx 
b/framework/source/dispatch/dispatchprovider.cxx
index 578170227578..bcfa07bb333a 100644
--- a/framework/source/dispatch/dispatchprovider.cxx
+++ b/framework/source/dispatch/dispatchprovider.cxx
@@ -440,18 +440,30 @@ css::uno::Reference< css::frame::XDispatch > 
DispatchProvider::implts_searchProt
 SolarMutexGuard g;
 
 // create it
+bool bInitialize = true;
 try
 {
-xHandler.set(
-
css::uno::Reference(m_xContext->getServiceManager(),
 css::uno::UNO_QUERY_THROW)
-  ->createInstance(aHandler.m_sUNOName),
-css::uno::UNO_QUERY);
+// Only create the protocol handler instance once, the 
creation is expensive.
+auto it = m_aProtocolHandlers.find(aHandler.m_sUNOName);
+if (it == m_aProtocolHandlers.end())
+{
+xHandler.set(
+
css::uno::Reference(m_xContext->getServiceManager(),
 css::uno::UNO_QUERY_THROW)
+  ->createInstance(aHandler.m_sUNOName),
+css::uno::UNO_QUERY);
+m_aProtocolHandlers.emplace(aHandler.m_sUNOName, xHandler);
+}
+else
+{
+xHandler = it->second;
+bInitialize = false;
+}
 }
 catch(const css::uno::Exception&) {}
 
 // look if initialization is necessary
 css::uno::Reference< css::lang::XInitialization > xInit( xHandler, 
css::uno::UNO_QUERY );
-if (xInit.is())
+if (xInit.is() && bInitialize)
 {
 css::uno::Reference< css::frame::XFrame > xOwner( 
m_xFrame.get(), css::uno::UNO_QUERY );
 SAL_WARN_IF(!xOwner.is(), "fwk", 
"DispatchProvider::implts_searchProtocolHandler(): Couldn't get reference to my 
owner frame. So I can't set may needed context information for this protocol 
handler.");


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

2022-05-02 Thread Andrea Gelmini (via logerrit)
 sc/source/ui/view/cellsh3.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit f8d35a20be7c3dc6eff5e79965b631e004d24a54
Author: Andrea Gelmini 
AuthorDate: Mon May 2 13:20:35 2022 +0200
Commit: Julien Nabet 
CommitDate: Mon May 2 21:53:10 2022 +0200

Remove duplicated includes

Change-Id: I22e66f3cb370c53e1c5ca1e5fa6760d152def374
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133696
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 6a23b5ab9e43..143f61be24af 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -47,7 +47,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 


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

2022-05-02 Thread xuenhua (via logerrit)
 vcl/osx/salmenu.cxx |   19 +++
 1 file changed, 3 insertions(+), 16 deletions(-)

New commits:
commit a2c6e46cecfb50f1f3558b078479c89c068df279
Author: xuenhua 
AuthorDate: Fri Apr 29 01:01:32 2022 +0800
Commit: Caolán McNamara 
CommitDate: Mon May 2 21:52:44 2022 +0200

Delete mnemonics for CJK translations on macOS

'Cop~y' translated into Chinese is '复制(~Y)'
But the mnemonics '(Y)' is useless on macOS.
In English, 'Cop~y' with the '~' removed is the correct result.
But in CJK should remove along with '(' and ')',
not just only for mbMenuBar. Use the method 
MnemonicGenerator::EraseAllMnemonicChars
already defined in vcl/mnemonic.hxx

Change-Id: Ic37ce566923e3dea47535d187b1b3dba2088e960
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133572
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit 7fd1b0aa2ba741103a7d9ac835514ebbeae3bcff)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133714

diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 3164ba873bae..12291be3df83 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace {
 
@@ -588,22 +589,8 @@ void AquaSalMenu::SetItemText( unsigned /*i_nPos*/, 
SalMenuItem* i_pSalMenuItem,
 
 AquaSalMenuItem *pAquaSalMenuItem = static_cast(i_pSalMenuItem);
 
-// Delete mnemonics
-OUString aText = i_rText.replaceAll("~", "");
-
-/* #i90015# until there is a correct solution
-   strip out any appended (.*) in menubar entries
-*/
-if( mbMenuBar )
-{
-sal_Int32 nPos = aText.lastIndexOf( '(' );
-if( nPos != -1 )
-{
-sal_Int32 nPos2 = aText.indexOf( ')' );
-if( nPos2 != -1 )
-aText = aText.replaceAt( nPos, nPos2-nPos+1, u"" );
-}
-}
+// Delete all mnemonics of mbMenuBar and CJK-style mnemonic
+OUString aText = MnemonicGenerator::EraseAllMnemonicChars(i_rText);
 
 if (aText.endsWith("...", &aText))
 aText += u"\u2026";


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sfx2/source

2022-05-02 Thread Ashod Nakashian (via logerrit)
 sfx2/source/doc/objstor.cxx |   31 +++
 1 file changed, 31 insertions(+)

New commits:
commit 01a9f402db5840801e0eb004112bf19d5225f32c
Author: Ashod Nakashian 
AuthorDate: Sun May 1 16:52:30 2022 -0400
Commit: Michael Meeks 
CommitDate: Mon May 2 20:02:03 2022 +0200

sw: restore UI language to en while saving

Because the XML writer used in sw invokes the
translation logic, which uses the UI language,
saving can fail in case there are multiple
views with different langauges. This restores
the default language before saving to avoid
such issues and to make sure the document
xml is generated in the default language.

Signed-off-by: Ashod Nakashian 
Change-Id: Ibc0813de33cf7cf3528b0ff1d95560e799903fb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133676
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
(cherry picked from commit f4ef1e3e580f7a590496d62aaa3dc7e092510a9c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133611

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 8d101e8aac04..e456f5ea951a 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -105,6 +105,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -3158,6 +3159,11 @@ bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium )
 return false;
 }
 
+namespace
+{
+static LanguageTag g_defaultLanguageTag("en-US", true);
+}
+
 bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium )
 {
 uno::Reference< embed::XStorage > xStorage = rMedium.GetStorage();
@@ -3180,6 +3186,31 @@ bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium 
)
 pImpl->aBasicManager.storeLibrariesToStorage( xStorage );
 }
 #endif
+
+// Because XMLTextFieldExport::ExportFieldDeclarations (called from 
SwXMLExport)
+// calls SwXTextFieldMasters::getByName, which in turn maps property 
names by
+// calling SwStyleNameMapper::GetTextUINameArray, which uses
+// SvtSysLocale().GetUILanguageTag() to do the mapping, saving 
indirectly depends
+// on the UI language. This is an unfortunate depenency.
+// Here we restore to English
+const auto viewLanguage = comphelper::LibreOfficeKit::getLanguageTag();
+
+// Use the default language for saving and restore later if necessary.
+bool restoreLanguage = false;
+if (comphelper::LibreOfficeKit::isActive() && viewLanguage != 
g_defaultLanguageTag)
+{
+restoreLanguage = true;
+comphelper::LibreOfficeKit::setLanguageTag(g_defaultLanguageTag);
+}
+
+// Restore the view's original language automatically and as necessary.
+const ::comphelper::ScopeGuard aGuard(
+[&viewLanguage, restoreLanguage]()
+{
+if (restoreLanguage && viewLanguage != 
comphelper::LibreOfficeKit::getLanguageTag())
+comphelper::LibreOfficeKit::setLanguageTag(viewLanguage);
+});
+
 return SaveAs( rMedium );
 }
 else return false;


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

2022-05-02 Thread Stephan Bergmann (via logerrit)
 xmlhelp/source/treeview/tvread.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 75fe4051320ef9b1f4323fa958e8df3db2066882
Author: Stephan Bergmann 
AuthorDate: Mon May 2 14:28:01 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 2 20:02:03 2022 +0200

Just use Any ctor instead of makeAny in xmlhelp

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

diff --git a/xmlhelp/source/treeview/tvread.cxx 
b/xmlhelp/source/treeview/tvread.cxx
index 60e207d109ea..1a56533fd27b 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -762,7 +762,7 @@ TVChildTarget::getHierAccess( const Reference< 
XMultiServiceFactory >& sProvider
 {
 xHierAccess =
 Reference< XHierarchicalNameAccess >
-( sProvider->createInstanceWithArguments( 
"com.sun.star.configuration.ConfigurationAccess", { 
makeAny(OUString::createFromAscii(file)) }),
+( sProvider->createInstanceWithArguments( 
"com.sun.star.configuration.ConfigurationAccess", { 
Any(OUString::createFromAscii(file)) }),
   UNO_QUERY );
 }
 catch( const css::uno::Exception& )


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

2022-05-02 Thread Ashod Nakashian (via logerrit)
 sfx2/source/doc/objstor.cxx |   31 +++
 1 file changed, 31 insertions(+)

New commits:
commit 7e088fe43ae7c2647e634faa57e5905f39c4a522
Author: Ashod Nakashian 
AuthorDate: Sun May 1 16:52:30 2022 -0400
Commit: Michael Meeks 
CommitDate: Mon May 2 20:02:19 2022 +0200

sw: restore UI language to en while saving

Because the XML writer used in sw invokes the
translation logic, which uses the UI language,
saving can fail in case there are multiple
views with different langauges. This restores
the default language before saving to avoid
such issues and to make sure the document
xml is generated in the default language.

Signed-off-by: Ashod Nakashian 
Change-Id: Ibc0813de33cf7cf3528b0ff1d95560e799903fb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133676
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
(cherry picked from commit f4ef1e3e580f7a590496d62aaa3dc7e092510a9c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133610

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 548ce34b1c21..65a340221223 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -91,6 +91,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -3175,6 +3176,11 @@ bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium )
 return false;
 }
 
+namespace
+{
+static LanguageTag g_defaultLanguageTag("en-US", true);
+}
+
 bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium )
 {
 uno::Reference< embed::XStorage > xStorage = rMedium.GetStorage();
@@ -3197,6 +3203,31 @@ bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium 
)
 pImpl->aBasicManager.storeLibrariesToStorage( xStorage );
 }
 #endif
+
+// Because XMLTextFieldExport::ExportFieldDeclarations (called from 
SwXMLExport)
+// calls SwXTextFieldMasters::getByName, which in turn maps property 
names by
+// calling SwStyleNameMapper::GetTextUINameArray, which uses
+// SvtSysLocale().GetUILanguageTag() to do the mapping, saving 
indirectly depends
+// on the UI language. This is an unfortunate depenency.
+// Here we restore to English
+const auto viewLanguage = comphelper::LibreOfficeKit::getLanguageTag();
+
+// Use the default language for saving and restore later if necessary.
+bool restoreLanguage = false;
+if (comphelper::LibreOfficeKit::isActive() && viewLanguage != 
g_defaultLanguageTag)
+{
+restoreLanguage = true;
+comphelper::LibreOfficeKit::setLanguageTag(g_defaultLanguageTag);
+}
+
+// Restore the view's original language automatically and as necessary.
+const ::comphelper::ScopeGuard aGuard(
+[&viewLanguage, restoreLanguage]()
+{
+if (restoreLanguage && viewLanguage != 
comphelper::LibreOfficeKit::getLanguageTag())
+comphelper::LibreOfficeKit::setLanguageTag(viewLanguage);
+});
+
 return SaveAs( rMedium );
 }
 else return false;


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

2022-05-02 Thread Stephan Bergmann (via logerrit)
 vcl/source/helper/strhelper.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 7ae3fbe10811443050068627d0fdde66c551cd13
Author: Stephan Bergmann 
AuthorDate: Mon May 2 15:01:17 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 2 20:01:38 2022 +0200

Silence -Werror=maybe-uninitialized

> vcl/source/helper/strhelper.cxx: In function ‘rtl::OString 
psp::WhitespaceToSpace(std::string_view)’:
> vcl/source/helper/strhelper.cxx:365:9: error: ‘pBuffer[-1]’ may be used 
uninitialized [-Werror=maybe-uninitialized]
>   365 | if( *pLeap == ' ' )
>   | ^~

that hits at least with GCC 13 trunk now (and which actually is a false 
positive
as far as I can tell)

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

diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index 3413d454d131..e44ba8530542 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -361,6 +361,7 @@ OString WhitespaceToSpace(std::string_view rLine)
 *pLeap = 0;
 
 // there might be a space at beginning or end
+assert(pLeap > pBuffer);
 pLeap--;
 if( *pLeap == ' ' )
 *pLeap = 0;


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

2022-05-02 Thread Stephan Bergmann (via logerrit)
 hwpfilter/source/hwpread.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2256912336fbcf0b985d84dfbf355d1728ee425c
Author: Stephan Bergmann 
AuthorDate: Wed Apr 13 17:55:25 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 2 20:01:01 2022 +0200

Pick a better variable type

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

diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index a1b9415f70b4..6477b193b204 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -106,7 +106,7 @@ bool FieldCode::Read(HWPFile & hwpf)
 
 if( type[0] == 3 && type[1] == 2 ){ /* It must create a format as created 
date. */
   DateCode *pDate = new DateCode;
-  for (int i = 0 ; i < static_cast(len3_); i++) {
+  for (uint i = 0 ; i < len3_; i++) {
 if(str3[i] == 0 ) break;
 if( i >= DATE_SIZE ) break;
 pDate->format[i] = str3[i];


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

2022-05-02 Thread Xisco Fauli (via logerrit)
 sw/source/core/text/frmpaint.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit fae937b6859517bd9fe8e400cad3c84561ff98ab
Author: Xisco Fauli 
AuthorDate: Mon May 2 11:37:18 2022 +0200
Commit: Caolán McNamara 
CommitDate: Mon May 2 18:56:15 2022 +0200

sw: avoid one more EXCEPTION_INT_DIVIDE_BY_ZERO

Seen in

https://crashreport.libreoffice.org/stats/signature/SwTextFrame::PaintExtraData(SwRect%20const%20&)

Change-Id: Ie6924254dca73360d384987834460a6f813e0d69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133691
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 95ecf6cd54ff..8637faca988c 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -82,9 +82,14 @@ public:
 sal_Int16 eHor, bool bLnNm );
 SwFont* GetFont() const { return m_pFnt.get(); }
 void IncLineNr() { ++m_nLineNr; }
-bool HasNumber() const { return !( m_nLineNr % m_rLineInf.GetCountBy() ); }
+bool HasNumber() const {
+if( m_rLineInf.GetCountBy() == 0 )
+return false;
+return !( m_nLineNr % m_rLineInf.GetCountBy() );
+}
 bool HasDivider() const {
-if( !m_nDivider ) return false;
+if( !m_nDivider || m_rLineInf.GetDividerCountBy() == 0 )
+return false;
 return !(m_nLineNr % m_rLineInf.GetDividerCountBy());
 }
 


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

2022-05-02 Thread xuenhua (via logerrit)
 vcl/osx/salmenu.cxx |   19 +++
 1 file changed, 3 insertions(+), 16 deletions(-)

New commits:
commit 7fd1b0aa2ba741103a7d9ac835514ebbeae3bcff
Author: xuenhua 
AuthorDate: Fri Apr 29 01:01:32 2022 +0800
Commit: Caolán McNamara 
CommitDate: Mon May 2 18:54:20 2022 +0200

Delete mnemonics for CJK translations on macOS

'Cop~y' translated into Chinese is '复制(~Y)'
But the mnemonics '(Y)' is useless on macOS.
In English, 'Cop~y' with the '~' removed is the correct result.
But in CJK should remove along with '(' and ')',
not just only for mbMenuBar. Use the method 
MnemonicGenerator::EraseAllMnemonicChars
already defined in vcl/mnemonic.hxx

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

diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 3164ba873bae..12291be3df83 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace {
 
@@ -588,22 +589,8 @@ void AquaSalMenu::SetItemText( unsigned /*i_nPos*/, 
SalMenuItem* i_pSalMenuItem,
 
 AquaSalMenuItem *pAquaSalMenuItem = static_cast(i_pSalMenuItem);
 
-// Delete mnemonics
-OUString aText = i_rText.replaceAll("~", "");
-
-/* #i90015# until there is a correct solution
-   strip out any appended (.*) in menubar entries
-*/
-if( mbMenuBar )
-{
-sal_Int32 nPos = aText.lastIndexOf( '(' );
-if( nPos != -1 )
-{
-sal_Int32 nPos2 = aText.indexOf( ')' );
-if( nPos2 != -1 )
-aText = aText.replaceAt( nPos, nPos2-nPos+1, u"" );
-}
-}
+// Delete all mnemonics of mbMenuBar and CJK-style mnemonic
+OUString aText = MnemonicGenerator::EraseAllMnemonicChars(i_rText);
 
 if (aText.endsWith("...", &aText))
 aText += u"\u2026";


[Libreoffice-commits] core.git: include/o3tl

2022-05-02 Thread Andrea Gelmini (via logerrit)
 include/o3tl/lru_map.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1139013b129fb7f3c58583cdef86b3cdae469f20
Author: Andrea Gelmini 
AuthorDate: Mon May 2 13:23:10 2022 +0200
Commit: Julien Nabet 
CommitDate: Mon May 2 18:52:36 2022 +0200

Fix typo

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

diff --git a/include/o3tl/lru_map.hxx b/include/o3tl/lru_map.hxx
index b3c90621edf2..42cb932786b0 100644
--- a/include/o3tl/lru_map.hxx
+++ b/include/o3tl/lru_map.hxx
@@ -55,7 +55,7 @@ template <> class lru_map_base
  *
  * It is optionally possible to specify a function for ValueSize template
  * argument (that can be called as 'size_t func(Value)') that will return
- * a size (cost) for an item istead of the default size of 1 for each item.
+ * a size (cost) for an item instead of the default size of 1 for each item.
  * The size of an item must not change for an item (if needed, re-insert
  * the item). A newly inserted item is guaranteed to be in the container,
  * even if its size exceeds the maximum size.


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

2022-05-02 Thread Mike Kaganski (via logerrit)
 vcl/source/treelist/iconview.cxx |  153 ++-
 1 file changed, 73 insertions(+), 80 deletions(-)

New commits:
commit 21a0e9ae540f1f0244ddfcb0389deb47567b2f3a
Author: Mike Kaganski 
AuthorDate: Mon May 2 09:46:52 2022 +0100
Commit: Mike Kaganski 
CommitDate: Mon May 2 18:46:03 2022 +0200

Reimplement IconView::PaintEntry

Use spacing between top, bottom, icon and text (the case of sum
of items heights greater than element height is not yet handled).

Draw the background even when there's no text: that allows to
center the icon in the item, and still have proper highlight of
selected item.

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

diff --git a/vcl/source/treelist/iconview.cxx b/vcl/source/treelist/iconview.cxx
index c46862434120..c1ed4b028726 100644
--- a/vcl/source/treelist/iconview.cxx
+++ b/vcl/source/treelist/iconview.cxx
@@ -82,59 +82,45 @@ tools::Rectangle IconView::GetFocusRect(const 
SvTreeListEntry*, tools::Long nEnt
 void IconView::PaintEntry(SvTreeListEntry& rEntry, tools::Long nX, tools::Long 
nY,
   vcl::RenderContext& rRenderContext)
 {
-tools::Rectangle aRect; // multi purpose
+const int nSpacing = 5; // 5 pixels from top, from bottom, between icon 
and label
 
 pImpl->UpdateContextBmpWidthMax(&rEntry);
 
 short nTempEntryHeight = GetEntryHeight();
 short nTempEntryWidth = GetEntryWidth();
 
-Point aEntryPos;
+Point aEntryPos(nX, nY);
 
-Color aBackupTextColor(rRenderContext.GetTextColor());
-vcl::Font aBackupFont(rRenderContext.GetFont());
-Color aBackupColor = rRenderContext.GetFillColor();
+const Color aBackupTextColor(rRenderContext.GetTextColor());
+const vcl::Font aBackupFont(rRenderContext.GetFont());
+const Color aBackupColor = rRenderContext.GetFillColor();
 
-bool bCurFontIsSel = false;
-const WinBits nWindowStyle = GetStyle();
-const bool bHideSelection = (nWindowStyle & WB_HIDESELECTION) != 0 && 
!HasFocus();
 const StyleSettings& rSettings = 
rRenderContext.GetSettings().GetStyleSettings();
 
-vcl::Font aHighlightFont(rRenderContext.GetFont());
-const Color aHighlightTextColor(rSettings.GetHighlightTextColor());
-aHighlightFont.SetColor(aHighlightTextColor);
-
-Size aOutputSize = GetOutputSizePixel();
+const Size aOutputSize = GetOutputSizePixel();
 if (aOutputSize.getHeight() < nTempEntryHeight)
 nTempEntryHeight = aOutputSize.getHeight();
 
-Size aRectSize(nTempEntryWidth, nTempEntryHeight);
-
-SvViewDataEntry* pViewDataEntry = GetViewDataEntry(&rEntry);
+const SvViewDataEntry* pViewDataEntry = GetViewDataEntry(&rEntry);
 
-sal_uInt16 nItemCount = rEntry.ItemCount();
-sal_uInt16 nCurItem = 0;
-sal_uInt16 nIconItem = nItemCount;
-
-while (nCurItem < nItemCount)
+bool bCurFontIsSel = false;
+if (pViewDataEntry->IsHighlighted())
 {
-SvLBoxItem* pItem = nCurItem < nItemCount ? &rEntry.GetItem(nCurItem) 
: nullptr;
-SvLBoxItemType nItemType = pItem->GetType();
-
-if (nItemType == SvLBoxItemType::ContextBmp)
-{
-nIconItem = nCurItem;
-nCurItem++;
-continue;
-}
-
-auto nItemHeight = SvLBoxItem::GetHeight(pViewDataEntry, nCurItem);
-
-aEntryPos.setX(nX);
-aEntryPos.setY(nY);
+vcl::Font aHighlightFont(rRenderContext.GetFont());
+const Color aHighlightTextColor(rSettings.GetHighlightTextColor());
+aHighlightFont.SetColor(aHighlightTextColor);
+
+// set font color to highlight
+rRenderContext.SetTextColor(aHighlightTextColor);
+rRenderContext.SetFont(aHighlightFont);
+bCurFontIsSel = true;
+}
 
+bool bFillColorSet = false;
+// draw background
+if (!(nTreeFlags & SvTreeFlags::USESEL))
+{
 // set background pattern/color
-
 Wallpaper aWallpaper = rRenderContext.GetBackground();
 
 if (pViewDataEntry->IsHighlighted())
@@ -142,80 +128,87 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, 
tools::Long nX, tools::Long n
 Color aNewWallColor = rSettings.GetHighlightColor();
 // if the face color is bright then the deactivate color is also 
bright
 // -> so you can't see any deactivate selection
+const WinBits nWindowStyle = GetStyle();
+const bool bHideSelection = (nWindowStyle & WB_HIDESELECTION) != 0 
&& !HasFocus();
 if (bHideSelection && !rSettings.GetFaceColor().IsBright()
 && aWallpaper.GetColor().IsBright() != 
rSettings.GetDeactiveColor().IsBright())
 {
 aNewWallColor = rSettings.GetDeactiveColor();
 }
-// set font color to highlight
-if (!bCurFontIsSel)
-

LibreOffice Conference 2022

2022-05-02 Thread Italo Vignoli
The LibreOffice Conference 2022 will be a hybrid event (in presence + 
remote) from September 28 (community day) to October 1st, with opening 
session on September 29 at 9:30AM and closing session on October 1st at 1PM.


The venue is NOI Tech Park in Bolzano/Bozen/Bulsan (trilingual area) in 
South Tyrol (Northern Italy), a very well known location for FOSS and 
the home of the SFScon (South Tyrol FOSS Conference).


We will publish the official announcement on the blog and social media, 
including the sponsorship packages for the ecosystem companies, later 
this week.


Best regards, Italo

--
Italo Vignoli - LibreOffice Marketing & PR
mobile/signal +39.348.5653829 - email it...@libreoffice.org
GPG Key ID - 0xAAB8D5C0
DB75 1534 3FD0 EA5F 56B5 FDA6 DE82 934C AAB8 D5C0



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

2022-05-02 Thread Caolán McNamara (via logerrit)
 vcl/headless/CairoCommon.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 00e43c14558fa4d0369820fa3d2cd7b987e61377
Author: Caolán McNamara 
AuthorDate: Sun May 1 15:58:22 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 2 18:37:33 2022 +0200

Related: tdf#148433 experiment with CAIRO_OPERATOR_EXCLUSION

export SAL_DISABLE_CAIRO_DIFFERENCE=1 to experiment with this

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

diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index 02c281fea3cb..7cf2951b9da6 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -966,6 +966,7 @@ bool bDisableDifference(nullptr != pDisableDifference);
 
 #if defined CAIRO_VERSION && CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0)
 #define CAIRO_OPERATOR_DIFFERENCE (static_cast(23))
+#define CAIRO_OPERATOR_EXCLUSION (static_cast(24))
 #endif
 
 void CairoCommon::invert(const basegfx::B2DPolygon& rPoly, SalInvert nFlags, 
bool bAntiAlias)
@@ -980,13 +981,13 @@ void CairoCommon::invert(const basegfx::B2DPolygon& 
rPoly, SalInvert nFlags, boo
 
 cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
 
-if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 10, 0) && 
!bDisableDifference)
+if (bDisableDifference)
 {
-cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
+cairo_set_operator(cr, CAIRO_OPERATOR_EXCLUSION);
 }
 else
 {
-SAL_WARN("vcl.gdi", "SvpSalGraphics::invert, archaic cairo");
+cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
 }
 
 if (nFlags & SalInvert::TrackFrame)


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

2022-05-02 Thread Stephan Bergmann (via logerrit)
 embeddedobj/source/msole/graphconvert.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8e08e6c0ce6a7e5190cd9db7dc76e9774e9bb5a8
Author: Stephan Bergmann 
AuthorDate: Mon May 2 08:51:29 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 2 17:51:11 2022 +0200

loplugin:stringview

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

diff --git a/embeddedobj/source/msole/graphconvert.cxx 
b/embeddedobj/source/msole/graphconvert.cxx
index cadc1f946de9..f853f03dc19b 100644
--- a/embeddedobj/source/msole/graphconvert.cxx
+++ b/embeddedobj/source/msole/graphconvert.cxx
@@ -54,7 +54,7 @@ bool ConvertBufferToFormat( void* pBuf,
 SvMemoryStream aMemoryStream(pBuf, nBufSize, StreamMode::READ);
 GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
 sal_uInt16 nRetFormat = 0;
-if (rFilter.CanImportGraphic(OUString(), aMemoryStream, 
GRFILTER_FORMAT_DONTKNOW, &nRetFormat) == ERRCODE_NONE &&
+if (rFilter.CanImportGraphic(u"", aMemoryStream, 
GRFILTER_FORMAT_DONTKNOW, &nRetFormat) == ERRCODE_NONE &&
 rFilter.GetImportFormatMediaType(nRetFormat) == aMimeType)
 {
 aResult <<= uno::Sequence< sal_Int8 >( static_cast< const 
sal_Int8* >( aMemoryStream.GetData() ), aMemoryStream.TellEnd() );


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

2022-05-02 Thread Stephan Bergmann (via logerrit)
 xmlscript/source/xmldlg_imexp/imp_share.hxx|4 
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx|4 
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |   46 +-
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx|   88 ++---
 4 files changed, 71 insertions(+), 71 deletions(-)

New commits:
commit 0c34f61772a3d4b3169af869149bed5e4850eb14
Author: Stephan Bergmann 
AuthorDate: Mon May 2 14:22:13 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 2 17:24:32 2022 +0200

Just use Any ctor instead of makeAny in xmlscript

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

diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx 
b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 3b52f683b1e0..12da217242de 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -486,13 +486,13 @@ public:
 try
 {
 _pImport->_xDialogModel->insertByName(
-_aId, css::uno::makeAny(
+_aId, css::uno::Any(
 css::uno::Reference::query(
 _xControlModel ) ) );
 }
 catch(const css::container::ElementExistException &e)
 {
-throw css::lang::WrappedTargetRuntimeException("", e.Context, 
makeAny(e));
+throw css::lang::WrappedTargetRuntimeException("", e.Context, 
css::uno::Any(e));
 }
 }
 };
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index 6a7af3fc3d85..cc561a08d3ca 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -937,7 +937,7 @@ void ElementDescriptor::readDataAwareAttr( OUString const & 
rAttrName )
 {
 table::CellAddress aAddress;
 xBindable->getPropertyValue( "BoundCell" ) >>= aAddress;
-xConvertor->setPropertyValue( "Address", makeAny( aAddress ) );
+xConvertor->setPropertyValue( "Address", Any( aAddress ) );
 OUString sAddress;
 xConvertor->getPropertyValue( "PersistentRepresentation" ) >>= 
sAddress;
 if ( !sAddress.isEmpty() )
@@ -967,7 +967,7 @@ void ElementDescriptor::readDataAwareAttr( OUString const & 
rAttrName )
 xListSource->getPropertyValue( "CellRange" ) >>= aAddress;
 
 OUString sAddress;
-xConvertor->setPropertyValue( "Address", makeAny( aAddress ) );
+xConvertor->setPropertyValue( "Address", Any( aAddress ) );
 xConvertor->getPropertyValue( "PersistentRepresentation" ) >>= 
sAddress;
 SAL_INFO("xmlscript.xmldlg"," cell range source list " << sAddress 
);
 if ( !sAddress.isEmpty() )
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 66a69a2b5518..e74e35ece9e2 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -86,7 +86,7 @@ void Frame::endElement()
 ctx.importDefaults( 0, 0, _xAttributes ); // inherited from 
BulletinBoardElement
 if (!_label.isEmpty())
 {
-xControlModel->setPropertyValue( "Label" , makeAny( _label ) );
+xControlModel->setPropertyValue( "Label" , Any( _label ) );
 }
 ctx.importEvents( _events );
 // avoid ring-reference:
@@ -468,7 +468,7 @@ void FormattedFieldElement::endElement()
 ctx.importShortProperty( "MaxTextLen", "maxlength", _xAttributes );
 ctx.importBooleanProperty( "Spin",  "spin", _xAttributes );
 if (ctx.importLongProperty( "RepeatDelay", "repeat", _xAttributes ))
-ctx.getControlModel()->setPropertyValue( "Repeat" , makeAny(true) );
+ctx.getControlModel()->setPropertyValue( "Repeat" , Any(true) );
 
 OUString 
sDefault(_xAttributes->getValueByUidName(m_pImport->XMLNS_DIALOGS_UID, 
"value-default") );
 if (!sDefault.isEmpty())
@@ -476,16 +476,16 @@ void FormattedFieldElement::endElement()
 double d = sDefault.toDouble();
 if (d != 0.0 || sDefault == "0" || sDefault == "0.0" )
 {
-ctx.getControlModel()->setPropertyValue( "EffectiveDefault", 
makeAny( d ) );
+ctx.getControlModel()->setPropertyValue( "EffectiveDefault", Any( 
d ) );
 }
 else // treat as string
 {
-ctx.getControlModel()->setPropertyValue( "EffectiveDefault", 
makeAny( sDefault ) );
+ctx.getControlModel()->setPropertyValue( "EffectiveDefault", Any( 
sDefault ) );
 }
 }
 
 // format spec
-ctx.getControlModel()->setPropertyValue("FormatsSupplier", makeAny( 
m_pImport->getNumberFormatsSupplier() ) );
+ctx.getControlModel()->setPropertyValue("FormatsSupplier", Any( 
m_pImport->getN

[Libreoffice-commits] core.git: helpcontent2

2022-05-02 Thread Olivier Hallot (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f13b8908d280a25e8a8753070862a2dda32dbf85
Author: Olivier Hallot 
AuthorDate: Mon May 2 12:19:22 2022 -0300
Commit: Gerrit Code Review 
CommitDate: Mon May 2 17:19:22 2022 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 834789bd8d25cfee57662c8023a34f8e80cc078d
  - Update Basic function Shell page

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

diff --git a/helpcontent2 b/helpcontent2
index b218d6ebe0f4..834789bd8d25 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit b218d6ebe0f497748414b3a7fd173cff363b76ae
+Subproject commit 834789bd8d25cfee57662c8023a34f8e80cc078d


[Libreoffice-commits] help.git: source/text

2022-05-02 Thread Olivier Hallot (via logerrit)
 source/text/sbasic/shared/03130500.xhp |   33 -
 1 file changed, 20 insertions(+), 13 deletions(-)

New commits:
commit 834789bd8d25cfee57662c8023a34f8e80cc078d
Author: Olivier Hallot 
AuthorDate: Thu Apr 28 10:29:01 2022 -0300
Commit: Olivier Hallot 
CommitDate: Mon May 2 17:19:18 2022 +0200

Update Basic function Shell page

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

diff --git a/source/text/sbasic/shared/03130500.xhp 
b/source/text/sbasic/shared/03130500.xhp
index 3bc1f9b10..c6c6fb321 100644
--- a/source/text/sbasic/shared/03130500.xhp
+++ b/source/text/sbasic/shared/03130500.xhp
@@ -27,29 +27,37 @@
 
 
 
-
 
 
   Shell function
 
 
-
-Shell 
Function
+Shell Function
 Starts another 
application and defines the respective window style, if necessary.
 
 
-Syntax
-Shell 
(Pathname As String[, Windowstyle As Integer][, Param As String][, bSync]) 

+
+Shell (Pathname As 
String[, Windowstyle As Integer][, Param As String][, bSync]) 
 
-Parameter
+
 
-Pathname
+Pathname
 Complete path 
and program name of the program that you want to start.
 
-Windowstyle
+Windowstyle
 Optional 
integer expression that specifies the style of the window that the program is 
executed in. The following values are possible:
 
 
+
+
+
+Windowstyle
+
+
+Meaning
+
+
+
   
 
   0
@@ -108,18 +116,17 @@
   
 
 
-
-Param
+Param
 Any string 
expression that specifies the command line that want to pass.
 
-bSync
+bSync
 If this value 
is set to true, the Shell command and all 
$[officename] tasks wait until the shell process completes. If the value is set 
to false, the shell returns directly. The default value is 
false.
 
 
 
 
 
-Example
+
 
 Sub ExampleShellForWin
 Shell("c:\windows\calc.exe",2)
@@ -127,4 +134,4 @@
 
 
 
-
\ No newline at end of file
+


[Libreoffice-commits] core.git: Changes to 'refs/tags/cp-21.06.28-1'

2022-05-02 Thread Andras Timar (via logerrit)
Tag 'cp-21.06.28-1' created by Andras Timar  at 
2022-05-02 14:10 +

cp-21.06.28-1

Changes since cp-21.06.27-1-7:
---
 0 files changed
---


[Libreoffice-commits] translations.git: Changes to 'refs/tags/cp-21.06.28-1'

2022-05-02 Thread Andras Timar (via logerrit)
Tag 'cp-21.06.28-1' created by Andras Timar  at 
2022-05-02 14:10 +

cp-21.06.28-1

Changes since cp-21.06.13-1-1:
---
 0 files changed
---


[Libreoffice-commits] help.git: Changes to 'refs/tags/cp-21.06.28-1'

2022-05-02 Thread Adolfo Jayme Barrientos (via logerrit)
Tag 'cp-21.06.28-1' created by Andras Timar  at 
2022-05-02 14:10 +

cp-21.06.28-1

Changes since co-2021-branch-point-10:
---
 0 files changed
---


[Libreoffice-commits] dictionaries.git: Changes to 'refs/tags/cp-21.06.28-1'

2022-05-02 Thread Andras Timar (via logerrit)
Tag 'cp-21.06.28-1' created by Andras Timar  at 
2022-05-02 14:10 +

cp-21.06.28-1

Changes since libreoffice-7-1-branch-point-5:
---
 0 files changed
---


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - configure.ac

2022-05-02 Thread Andras Timar (via logerrit)
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f63c415e21453a558b894c141efe7a0431ff96d9
Author: Andras Timar 
AuthorDate: Mon May 2 16:09:09 2022 +0200
Commit: Andras Timar 
CommitDate: Mon May 2 16:09:20 2022 +0200

Bump package version to 21.06.28.1

Change-Id: I9c6a3393b1c8d9bf8712099f7517e79da501c2ed

diff --git a/configure.ac b/configure.ac
index 93c0932db850..99951bcb1bca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for 
the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no 
idea.
 
-AC_INIT([Collabora Office],[21.06.27.1],[],[],[https://collaboraoffice.com/])
+AC_INIT([Collabora Office],[21.06.28.1],[],[],[https://collaboraoffice.com/])
 
 dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just 
fine if it is installed
 dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails 
hard


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

2022-05-02 Thread Luboš Luňák (via logerrit)
 vcl/source/gdi/CommonSalLayout.cxx |5 -
 vcl/source/outdev/font.cxx |3 ---
 vcl/source/text/ImplLayoutArgs.cxx |3 +++
 3 files changed, 3 insertions(+), 8 deletions(-)

New commits:
commit 8ff55ff8c9779fd308cc50587d2f283d15518192
Author: Luboš Luňák 
AuthorDate: Mon May 2 10:39:04 2022 +0200
Commit: Luboš Luňák 
CommitDate: Mon May 2 15:59:03 2022 +0200

better for fix glyph font fallback with null character

Text layout code already filters out unsuitable characters,
the null character just wasn't included there because it's normally
not expected to be present in text, only something broken like
ofz34898-1.doc causes it.

This basically reverts commit 3d7ca1bd1c4cc9d468ae214ecb497f71bad340f8.

Change-Id: Ic29674d9507340c2a43098a88c0320d4253a0bf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133689
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/source/gdi/CommonSalLayout.cxx 
b/vcl/source/gdi/CommonSalLayout.cxx
index e2b9e79bfba4..0007e3f355d1 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -165,11 +165,6 @@ void 
GenericSalLayout::SetNeedFallback(vcl::text::ImplLayoutArgs& rArgs, sal_Int
 if (nCharPos < 0 || mbFuzzing)
 return;
 
-// Do not try to find fallback for null character, as that is pointless 
and it would break
-// searching for it (the broken ofz34898-1.doc document triggers this).
-if (rArgs.mrStr[nCharPos] == '\0')
-return;
-
 using namespace ::com::sun::star;
 
 if (!mxBreak.is())
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index de3a0726c72c..ba487b0198c3 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -1208,10 +1208,7 @@ std::unique_ptr 
OutputDevice::ImplGlyphFallbackLayout( std::unique_pt
 bool bRTL = false;
 OUStringBuffer aMissingCodeBuf(512);
 while (rLayoutArgs.GetNextPos( &nCharPos, &bRTL))
-{
-assert(rLayoutArgs.mrStr[nCharPos] != '\0');
 aMissingCodeBuf.append(rLayoutArgs.mrStr[nCharPos]);
-}
 rLayoutArgs.ResetPos();
 OUString aMissingCodes = aMissingCodeBuf.makeStringAndClear();
 
diff --git a/vcl/source/text/ImplLayoutArgs.cxx 
b/vcl/source/text/ImplLayoutArgs.cxx
index 55e01d2737b8..0638473f4168 100644
--- a/vcl/source/text/ImplLayoutArgs.cxx
+++ b/vcl/source/text/ImplLayoutArgs.cxx
@@ -141,6 +141,9 @@ static bool IsControlChar(sal_UCS4 cChar)
 // byte order markers and invalid unicode
 if ((cChar == 0xFEFF) || (cChar == 0xFFFE) || (cChar == 0x))
 return true;
+// drop null character too, broken documents may contain it 
(ofz34898-1.doc)
+if (cChar == 0)
+return true;
 return false;
 }
 


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

2022-05-02 Thread Regina Henschel (via logerrit)
 svx/qa/unit/customshapes.cxx|   73 
 svx/qa/unit/data/tdf148714_CurvedArrows.ppt |binary
 svx/source/customshapes/EnhancedCustomShapeGeometry.cxx |   12 +-
 3 files changed, 81 insertions(+), 4 deletions(-)

New commits:
commit fdf4390415a6956144d055a32579105deaef913a
Author: Regina Henschel 
AuthorDate: Thu Apr 28 23:35:44 2022 +0200
Commit: Xisco Fauli 
CommitDate: Mon May 2 15:56:25 2022 +0200

tdf#148714 connect first and second arc with arcTo

The curved*Arrows start with two arcs, which should be connected by a
line. The used commands are double V and double B respectively. Both
have an implicit moveTo, so that there should be no line between.
Other applications show the shapes correctly without line. But because
of bug 148714 LO shows a connecting line so that the error was not
earlier detected.
The patch changes the segment definition so that for the second
command the variant with implicit lineTo is used. This does not change
rendering in LO but makes other applications rendering the shapes
like LO.

Change-Id: I4f799f89497e52b1a7e00d8e5345a66ce21c00a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133586
Tested-by: Jenkins
Reviewed-by: Regina Henschel 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133640

diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx
index 690d6c02aa45..ff2617db4eb0 100644
--- a/svx/qa/unit/customshapes.cxx
+++ b/svx/qa/unit/customshapes.cxx
@@ -38,6 +38,8 @@
 #include 
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -1214,6 +1216,77 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf148501_OctagonBevel)
 nColorDistance = aExpectedColor.GetColorError(aActualColor);
 CPPUNIT_ASSERT_LESS(sal_uInt16(6), nColorDistance);
 }
+
+bool lcl_getShapeSegments(uno::Sequence& 
rSegments,
+  const uno::Reference& xShape)
+{
+uno::Reference xShapeProps(xShape, 
uno::UNO_QUERY_THROW);
+uno::Any anotherAny = xShapeProps->getPropertyValue("CustomShapeGeometry");
+uno::Sequence aCustomShapeGeometry;
+if (!(anotherAny >>= aCustomShapeGeometry))
+return false;
+uno::Sequence aPathProps;
+for (beans::PropertyValue const& rProp : 
std::as_const(aCustomShapeGeometry))
+{
+if (rProp.Name == "Path")
+{
+rProp.Value >>= aPathProps;
+break;
+}
+}
+
+for (beans::PropertyValue const& rProp : std::as_const(aPathProps))
+{
+if (rProp.Name == "Segments")
+{
+rProp.Value >>= rSegments;
+break;
+}
+}
+if (rSegments.getLength() > 2)
+return true;
+else
+return false;
+}
+
+CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf148714_CurvedArrows)
+{
+// Error was, that the line between 1. and 2. arc was missing.
+OUString sURL = m_directories.getURLFromSrc(sDataDirectory) + 
"tdf148714_CurvedArrows.ppt";
+mxComponent = loadFromDesktop(sURL, 
"com.sun.star.presentation.PresentationDocument");
+
+for (sal_Int32 nShapeIndex = 0; nShapeIndex < 4; nShapeIndex++)
+{
+uno::Reference xShape(getShape(nShapeIndex));
+uno::Sequence aSegments;
+CPPUNIT_ASSERT(lcl_getShapeSegments(aSegments, xShape));
+
+if (nShapeIndex == 0 || nShapeIndex == 3)
+{
+// curvedDownArrow or curvedLeftArrow. Segments should start with 
VW. Without fix it was
+// V with count 2, which means VV.
+CPPUNIT_ASSERT_EQUAL(
+
sal_Int16(drawing::EnhancedCustomShapeSegmentCommand::CLOCKWISEARC),
+aSegments[0].Command);
+CPPUNIT_ASSERT_EQUAL(sal_Int16(1), aSegments[0].Count);
+CPPUNIT_ASSERT_EQUAL(
+
sal_Int16(drawing::EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO),
+aSegments[1].Command);
+CPPUNIT_ASSERT_EQUAL(sal_Int16(1), aSegments[1].Count);
+}
+else
+{
+// curvedUpArrow or curvedRightArrow. Segments should start with 
BA. Without fix is was
+// B with count 2, which means BB.
+
CPPUNIT_ASSERT_EQUAL(sal_Int16(drawing::EnhancedCustomShapeSegmentCommand::ARC),
+ aSegments[0].Command);
+CPPUNIT_ASSERT_EQUAL(sal_Int16(1), aSegments[0].Count);
+
CPPUNIT_ASSERT_EQUAL(sal_Int16(drawing::EnhancedCustomShapeSegmentCommand::ARCTO),
+ aSegments[1].Command);
+CPPUNIT_ASSERT_EQUAL(sal_Int16(1), aSegments[1].Count);
+}
+}
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/qa/unit/data/tdf148714_CurvedArrows.ppt 
b/svx/qa/unit/data/tdf148714_CurvedArrows.ppt
new file mode 100644
index ..23e4ed0ad3eb
Binary files /dev/null and b/svx/qa/unit/data/tdf

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

2022-05-02 Thread Luboš Luňák (via logerrit)
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |9 ++
 vcl/source/text/TextLayoutCache.cxx|   17 +++--
 2 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit 4bb730be0909d9cf55b7a44d7e916aa5de16b9f7
Author: Luboš Luňák 
AuthorDate: Sun May 1 19:24:26 2022 +0200
Commit: Luboš Luňák 
CommitDate: Mon May 2 15:06:43 2022 +0200

better cache size limit for vcl::text::TextLayoutCache

This is not as important as SalLayoutGlyphsCache, as these should
be smaller and less needed, but still, make sure to limit the memory
the cache may use.

Change-Id: I4051331f8c5254cb5723772bac4dd1bceb9a2a41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133674
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 67fa3478b8fe..16d069ffd93a 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -1604,6 +1604,15 @@
   
   2000
 
+
+  
+Specifies the maximum cache size in bytes for all text run 
data used
+when laying out text. Larger size may improve text drawing 
performance
+in large documents.
+Text Runs Cache Size
+  
+  10
+
   
 
 
diff --git a/vcl/source/text/TextLayoutCache.cxx 
b/vcl/source/text/TextLayoutCache.cxx
index e1e4321a98d3..7cbc7c4dc744 100644
--- a/vcl/source/text/TextLayoutCache.cxx
+++ b/vcl/source/text/TextLayoutCache.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace vcl::text
 {
@@ -37,12 +38,24 @@ TextLayoutCache::TextLayoutCache(sal_Unicode const* pStr, 
sal_Int32 const nEnd)
 }
 }
 
+namespace
+{
+struct TextLayoutCacheCost
+{
+size_t operator()(const std::shared_ptr& item) const
+{
+return item->runs.size() * sizeof(item->runs.front());
+}
+};
+} // namespace
+
 std::shared_ptr TextLayoutCache::Create(OUString const& 
rString)
 {
 typedef o3tl::lru_map, 
FirstCharsStringHash,
-  FastStringCompareEqual>
+  FastStringCompareEqual, TextLayoutCacheCost>
 Cache;
-static vcl::DeleteOnDeinit cache(1000);
+static vcl::DeleteOnDeinit cache(
+officecfg::Office::Common::Cache::Font::TextRunsCacheSize::get());
 if (Cache* map = cache.get())
 {
 auto it = map->find(rString);


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

2022-05-02 Thread Luboš Luňák (via logerrit)
 include/vcl/glyphitemcache.hxx |8 -
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |   14 +
 vcl/source/gdi/impglyphitem.cxx|   19 -
 3 files changed, 39 insertions(+), 2 deletions(-)

New commits:
commit 8e6ab6502278702499e7468404d1010069176578
Author: Luboš Luňák 
AuthorDate: Sun May 1 19:14:50 2022 +0200
Commit: Luboš Luňák 
CommitDate: Mon May 2 15:06:26 2022 +0200

better cache size limit for SalLayoutGlyphsCache

With just limit on the number of cached SalLayoutGlyphs instances
the actual memory used could vary wildly depending on how long
the text is.

Change-Id: Ibcf6918e562e81276d21876c532838996e275bd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133673
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/include/vcl/glyphitemcache.hxx b/include/vcl/glyphitemcache.hxx
index a7a49ca7a8f2..998dcf97f915 100644
--- a/include/vcl/glyphitemcache.hxx
+++ b/include/vcl/glyphitemcache.hxx
@@ -85,7 +85,13 @@ private:
 {
 size_t operator()(const CachedGlyphsKey& key) const { return 
key.hashValue; }
 };
-typedef o3tl::lru_map 
GlyphsCache;
+struct GlyphsCost
+{
+size_t operator()(const SalLayoutGlyphs&) const;
+};
+typedef o3tl::lru_map, GlyphsCost>
+GlyphsCache;
 GlyphsCache mCachedGlyphs;
 // Last temporary glyphs returned (pointer is returned, so the object 
needs to be kept somewhere).
 std::optional mLastTemporaryKey;
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index f839f5778316..67fa3478b8fe 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -1591,6 +1591,20 @@
   6400
 
   
+  
+
+  Specifies the cache related options for fonts.
+
+
+  
+Specifies the maximum cache size in bytes for all glyphs used
+when laying out text. Larger size may improve text drawing 
performance
+in large documents.
+Glyphs Cache Size
+  
+  2000
+
+  
 
 
   
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index 0ae4e979e141..769c1afb9743 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 // These need being explicit because of SalLayoutGlyphsImpl being private in 
vcl.
 SalLayoutGlyphs::SalLayoutGlyphs() {}
@@ -208,7 +209,8 @@ bool SalLayoutGlyphsImpl::IsValid() const
 
 SalLayoutGlyphsCache* SalLayoutGlyphsCache::self()
 {
-static vcl::DeleteOnDeinit cache(1000);
+static vcl::DeleteOnDeinit cache(
+officecfg::Office::Common::Cache::Font::GlyphsCacheSize::get());
 return cache.get();
 }
 
@@ -419,4 +421,19 @@ inline bool 
SalLayoutGlyphsCache::CachedGlyphsKey::operator==(const CachedGlyphs
 // Slower things last in the comparison.
 }
 
+size_t SalLayoutGlyphsCache::GlyphsCost::operator()(const SalLayoutGlyphs& 
glyphs) const
+{
+size_t cost = 0;
+for (int level = 0;; ++level)
+{
+const SalLayoutGlyphsImpl* impl = glyphs.Impl(level);
+if (impl == nullptr)
+break;
+// Count size in bytes, both the SalLayoutGlyphsImpl instance and 
contained GlyphItem's.
+cost += sizeof(*impl);
+cost += impl->size() * sizeof(impl->front());
+}
+return cost;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-05-02 Thread Stephan Bergmann (via logerrit)
 vcl/win/gdi/salfont.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit bc7ea0a75911a782c0008be64508cbf3e0d74cc3
Author: Stephan Bergmann 
AuthorDate: Mon May 2 08:47:34 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 2 14:39:17 2022 +0200

loplugin:stringviewparam

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

diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index acaca76584a3..bc112a26d2ee 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -1090,7 +1091,7 @@ void ImplReleaseTempFonts(SalData& rSalData, bool bAll)
 }
 }
 
-static OUString lcl_GetFontFamilyName(const OUString& rFontFileURL)
+static OUString lcl_GetFontFamilyName(std::u16string_view rFontFileURL)
 {
 // Create temporary file name
 OUString aTempFileURL;


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

2022-05-02 Thread Stephan Bergmann (via logerrit)
 sfx2/source/appl/appdde.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 5d4ba848a378063ff7965a5871602525ac482703
Author: Stephan Bergmann 
AuthorDate: Mon May 2 08:49:36 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 2 14:11:50 2022 +0200

loplugin:stringviewparam

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

diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index 6e7db00012c7..d725d050f0a7 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -19,6 +19,8 @@
 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -78,7 +80,7 @@ public:
 virtual bool SysTopicExecute( const OUString* pStr );
 };
 
-bool lcl_IsDocument( const OUString& rContent )
+bool lcl_IsDocument( std::u16string_view rContent )
 {
 using namespace com::sun::star;
 


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

2022-05-02 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport17.cxx   |   36 ++
 sw/source/filter/ww8/docxattributeoutput.cxx |   66 ++-
 sw/source/filter/ww8/docxattributeoutput.hxx |3 -
 3 files changed, 84 insertions(+), 21 deletions(-)

New commits:
commit 38ae2a54e2efc1c957868b6d8e93bd49bb3e08c7
Author: Miklos Vajna 
AuthorDate: Thu Apr 28 10:12:29 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 2 13:49:06 2022 +0200

sw content controls, checkbox: add DOCX export

Map the 4 UNO properties to the following XML construct:

  



  

(cherry picked from commit 8642389b954a0b8f5673c85f44d8b0ea34eb3430)

Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport17.cxx

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index b72a470978cc..38a17bca714b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -146,6 +146,42 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlExport)
 assertXPath(pXmlDoc, "//w:sdt/w:sdtContent", 1);
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testCheckboxContentControlExport)
+{
+// Given a document with a checkbox content control around a text portion:
+mxComponent = loadFromDesktop("private:factory/swriter");
+uno::Reference xMSF(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xText = xTextDocument->getText();
+uno::Reference xCursor = xText->createTextCursor();
+xText->insertString(xCursor, OUString(u"☐"), /*bAbsorb=*/false);
+xCursor->gotoStart(/*bExpand=*/false);
+xCursor->gotoEnd(/*bExpand=*/true);
+uno::Reference xContentControl(
+xMSF->createInstance("com.sun.star.text.ContentControl"), 
uno::UNO_QUERY);
+uno::Reference xContentControlProps(xContentControl, 
uno::UNO_QUERY);
+xContentControlProps->setPropertyValue("Checkbox", uno::makeAny(true));
+xContentControlProps->setPropertyValue("Checked", uno::makeAny(true));
+xContentControlProps->setPropertyValue("CheckedState", 
uno::makeAny(OUString(u"☒")));
+xContentControlProps->setPropertyValue("UncheckedState", 
uno::makeAny(OUString(u"☐")));
+xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true);
+
+// When exporting to DOCX:
+save("Office Open XML Text", maTempFile);
+mbExported = true;
+
+// Then make sure the expected markup is used:
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+// Without the fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// - XPath '//w:sdt/w:sdtPr/w14:checkbox/w14:checked' number of nodes is 
incorrect
+// i.e.  and its child elements were lost.
+assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w14:checkbox/w14:checked", "val", 
"1");
+assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w14:checkbox/w14:checkedState", 
"val", "2612");
+assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w14:checkbox/w14:uncheckedState", 
"val", "2610");
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf137466, "tdf137466.docx")
 {
 xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 059c7204b01f..2fd7a442c77d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1635,8 +1635,7 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, 
sal_Int32 nPos, bool /
 for (; m_nCloseContentControlInPreviousRun > 0; 
--m_nCloseContentControlInPreviousRun)
 {
 // Not the last run of this paragraph.
-m_pSerializer->endElementNS(XML_w, XML_sdtContent);
-m_pSerializer->endElementNS(XML_w, XML_sdt);
+WriteContentControlEnd();
 }
 
 if ( m_closeHyperlinkInPreviousRun )
@@ -1736,18 +1735,7 @@ void DocxAttributeOutput::EndRun(const SwTextNode* 
pNode, sal_Int32 nPos, bool /
 m_nHyperLinkCount++;
 }
 
-if (m_pContentControl)
-{
-m_pSerializer->startElementNS(XML_w, XML_sdt);
-m_pSerializer->startElementNS(XML_w, XML_sdtPr);
-if (m_pContentControl->GetShowingPlaceHolder())
-{
-m_pSerializer->singleElementNS(XML_w, XML_showingPlcHdr);
-}
-m_pSerializer->endElementNS(XML_w, XML_sdtPr);
-m_pSerializer->startElementNS(XML_w, XML_sdtContent);
-m_pContentControl = nullptr;
-}
+WriteContentControlStart();
 
 // if there is some redlining in the document, output it
 StartRedline( m_pRedlineData );
@@ -1862,8 +1850,7 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, 
sal_Int32 n

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

2022-05-02 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_core_text.mk  |2 +
 sw/qa/core/text/text.cxx|   44 
 sw/source/core/inc/rootfrm.hxx  |2 -
 sw/source/core/text/frmform.cxx |   18 
 4 files changed, 65 insertions(+), 1 deletion(-)

New commits:
commit 28ef822f16826debaaca9e25ca69b1dec83cb755
Author: Miklos Vajna 
AuthorDate: Fri Apr 29 12:10:13 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 2 13:06:02 2022 +0200

tdf#148683 sw: fix crash on deleting text with redlining enabled, but hidden

Regression from commit 32902f66e7749b2d06d13f50416be5323a0c0ea9
(sw_redlinehide: make layout based Show/Hide mode the default,
2018-11-30), deleting some text in the middle of the paragraph with the
bugdoc results in an assertion failure in the SwDrawTextInfo ctor.

Normally this doesn't happen on text deletion as we already have a
mechanism for truncating no longer needed lines in
SwTextFrame::Format_(), though that only checks the length of the
current line.

Fix the problem by extending this mechanism to also check the remaining
lines: if change tracking is on and the total of all line lengths is
more than the string length of the text frame, then time to
re-calculate.

It seems this is not needed in practice when redlining is disabled,
though we might want to enable this for the non-redline case as well in
the future.

(cherry picked from commit 515bf5d4afa3a8ed413fd6f17f66fa98b6dbf29e)

Conflicts:
sw/qa/core/text/text.cxx

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

diff --git a/sw/CppunitTest_sw_core_text.mk b/sw/CppunitTest_sw_core_text.mk
index b0c4d03fac38..aeb8d30f939d 100644
--- a/sw/CppunitTest_sw_core_text.mk
+++ b/sw/CppunitTest_sw_core_text.mk
@@ -21,9 +21,11 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_core_text, \
 comphelper \
 cppu \
 cppuhelper \
+editeng \
 sal \
 sfx \
 sw \
+svl \
swqahelper \
 test \
 unotest \
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 7d0495cbb69c..f9cd7c6bda93 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -14,6 +14,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 char const DATA_DIRECTORY[] = "/sw/qa/core/text/data/";
 
@@ -83,6 +86,47 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, 
testTabOverMarginSection)
 CPPUNIT_ASSERT_LESS(static_cast(5000), nWidth);
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRedlineDelete)
+{
+// Given a document with A4 paper size, some text, redlining on, but 
hidden:
+SwDoc* pDoc = createSwDoc();
+SwDocShell* pDocShell = pDoc->GetDocShell();
+SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+{
+// Set page size to A4.
+size_t nCurIdx = pWrtShell->GetCurPageDesc();
+SwPageDesc aPageDesc(pWrtShell->GetPageDesc(nCurIdx));
+SwFrameFormat& rMaster = aPageDesc.GetMaster();
+SwFormatFrameSize aSize(SwFrameSize::Fixed);
+aSize.SetSize(Size(11906, 16838));
+rMaster.SetFormatAttr(aSize);
+pWrtShell->ChgPageDesc(nCurIdx, aPageDesc);
+}
+OUString aBefore("a aa aa aa aa ");
+OUString aDelete("delete eee ee eee ee ee");
+pWrtShell->Insert(aBefore + " " + aDelete
+  + " zz zzz z zzz   z zz zzz 
zzz zzz");
+// Enable redlining.
+pDocShell->SetChangeRecording(/*bActivate=*/true);
+// Hide redlining.
+pWrtShell->StartAllAction();
+pWrtShell->GetLayout()->SetHideRedlines(true);
+pWrtShell->EndAllAction();
+
+// When deleting content in the middle of the paragraph:
+pWrtShell->SttEndDoc(/*bStt=*/true);
+pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 
/*nCount=*/aBefore.getLength(),
+ /*bBasicCall=*/false);
+pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 
/*nCount=*/aDelete.getLength(),
+ /*bBasicCall=*/false);
+// Without the accompanying fix in place, this test would have crashed:
+pWrtShell->Delete();
+
+// Then make sure that the redline is created:
+CPPUNIT_ASSERT_EQUAL(static_cast(1),
+ 
pDoc->getIDocumentRedlineAccess().GetRedlineTable().size());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index fbc95b8a8691..7039e0d2eece 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -79,7 +79,7 @@ using SwDestroyList = o3tl::sorted_vector;
 
 /// The root element of a Writer document layout. Lower frames are expected to
 /// be SwPageFrame instances.
-class SAL_DLLPU

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

2022-05-02 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_core_text.mk  |1 
 sw/qa/core/text/text.cxx|   44 +++-
 sw/source/core/text/frmform.cxx |   18 
 3 files changed, 62 insertions(+), 1 deletion(-)

New commits:
commit 112309a07b55d5b4a9a4b7395df7612240df5684
Author: Miklos Vajna 
AuthorDate: Fri Apr 29 12:10:13 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 2 13:05:13 2022 +0200

tdf#148683 sw: fix crash on deleting text with redlining enabled, but hidden

Regression from commit 32902f66e7749b2d06d13f50416be5323a0c0ea9
(sw_redlinehide: make layout based Show/Hide mode the default,
2018-11-30), deleting some text in the middle of the paragraph with the
bugdoc results in an assertion failure in the SwDrawTextInfo ctor.

Normally this doesn't happen on text deletion as we already have a
mechanism for truncating no longer needed lines in
SwTextFrame::Format_(), though that only checks the length of the
current line.

Fix the problem by extending this mechanism to also check the remaining
lines: if change tracking is on and the total of all line lengths is
more than the string length of the text frame, then time to
re-calculate.

It seems this is not needed in practice when redlining is disabled,
though we might want to enable this for the non-redline case as well in
the future.

(cherry picked from commit 515bf5d4afa3a8ed413fd6f17f66fa98b6dbf29e)

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

diff --git a/sw/CppunitTest_sw_core_text.mk b/sw/CppunitTest_sw_core_text.mk
index 19d8cd422edc..c3025f007a9a 100644
--- a/sw/CppunitTest_sw_core_text.mk
+++ b/sw/CppunitTest_sw_core_text.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_core_text, \
 comphelper \
 cppu \
 cppuhelper \
+editeng \
 sal \
 sfx \
 svl \
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 0cd732c4a4af..f43727ed5f3f 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -24,13 +24,14 @@
 #include 
 #include 
 #include 
-
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
 
 constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/text/data/";
 
@@ -407,6 +408,47 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, 
testAsCharImageDocModelFromViewPoint)
 CPPUNIT_ASSERT_EQUAL(aGraphicNode, pShellCursor->GetMark()->nNode);
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRedlineDelete)
+{
+// Given a document with A4 paper size, some text, redlining on, but 
hidden:
+SwDoc* pDoc = createSwDoc();
+SwDocShell* pDocShell = pDoc->GetDocShell();
+SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+{
+// Set page size to A4.
+size_t nCurIdx = pWrtShell->GetCurPageDesc();
+SwPageDesc aPageDesc(pWrtShell->GetPageDesc(nCurIdx));
+SwFrameFormat& rMaster = aPageDesc.GetMaster();
+SwFormatFrameSize aSize(SwFrameSize::Fixed);
+aSize.SetSize(Size(11906, 16838));
+rMaster.SetFormatAttr(aSize);
+pWrtShell->ChgPageDesc(nCurIdx, aPageDesc);
+}
+OUString aBefore("a aa aa aa aa ");
+OUString aDelete("delete eee ee eee ee ee");
+pWrtShell->Insert(aBefore + " " + aDelete
+  + " zz zzz z zzz   z zz zzz 
zzz zzz");
+// Enable redlining.
+pDocShell->SetChangeRecording(/*bActivate=*/true);
+// Hide redlining.
+pWrtShell->StartAllAction();
+pWrtShell->GetLayout()->SetHideRedlines(true);
+pWrtShell->EndAllAction();
+
+// When deleting content in the middle of the paragraph:
+pWrtShell->SttEndDoc(/*bStt=*/true);
+pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 
/*nCount=*/aBefore.getLength(),
+ /*bBasicCall=*/false);
+pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 
/*nCount=*/aDelete.getLength(),
+ /*bBasicCall=*/false);
+// Without the accompanying fix in place, this test would have crashed:
+pWrtShell->Delete();
+
+// Then make sure that the redline is created:
+CPPUNIT_ASSERT_EQUAL(static_cast(1),
+ 
pDoc->getIDocumentRedlineAccess().GetRedlineTable().size());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 2eba32cdef55..9837d3df6c2f 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1611,8 +1611,26 @@ void SwTextFrame::Format_( SwTextFormatter &rLine, 
SwTextFormatInfo &rInf,
 // If we're finished formatting the text and we still
 // have other line objects left, these are superfluous
 // 

[Libreoffice-commits] core.git: officecfg/registry sw/inc sw/qa sw/sdi sw/source sw/uiconfig

2022-05-02 Thread Miklos Vajna (via logerrit)
 officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu |   13 
 sw/inc/cmdid.h  |1 
 sw/inc/formatcontentcontrol.hxx |6 +
 sw/qa/uibase/wrtsh/wrtsh.cxx|   23 
+++
 sw/sdi/_textsh.sdi  |6 +
 sw/sdi/swriter.sdi  |   17 
+
 sw/source/uibase/inc/wrtsh.hxx  |3 
 sw/source/uibase/shells/textsh.cxx  |8 ++
 sw/source/uibase/uiview/view.cxx|2 
 sw/source/uibase/wrtsh/wrtsh1.cxx   |   31 
--
 sw/uiconfig/swriter/menubar/menubar.xml |7 +-
 11 files changed, 106 insertions(+), 11 deletions(-)

New commits:
commit 02a5bd2e6c4eee50cbd8cb4ed009731c409711a5
Author: Miklos Vajna 
AuthorDate: Mon May 2 08:43:19 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 2 12:54:27 2022 +0200

sw content controls, checkbox: add insert UI

- extend SwWrtShell::InsertContentControl() to be able to create
  multiple content control types

- a new checkbox content control's content is always a non-checked
  checkbox

- expose this as a new .uno:InsertCheckboxContentControl uno command

- add this new command to the bottom of the form menu -- now that we
  have two types of content controls, have that in a sub-menu

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

diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 8835deef87a7..b36802016c1d 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -614,6 +614,11 @@
   1
 
   
+  
+
+  Content Controls
+
+  
   
 
   Insert Rich Text Content Control
@@ -622,6 +627,14 @@
   1
 
   
+  
+
+  Insert Check Box Content Control
+
+
+  1
+
+  
   
 
   Insert Other Objects
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 29adc6a580d6..355d607a5bc5 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -218,6 +218,7 @@ class SwUINumRuleItem;
 #define FN_INSERT_LINEBREAK (FN_INSERT + 18)/* Newline */
 #define FN_INSERT_FIELD_DATA_ONLY (FN_INSERT + 19)  /* Field dialog for mail 
merge*/
 #define FN_INSERT_CONTENT_CONTROL (FN_INSERT + 20)  /* Content control */
+#define FN_INSERT_CHECKBOX_CONTENT_CONTROL (FN_INSERT + 21)  /* Checkbox 
content control */
 #define FN_INSERT_OBJECT_DLG(FN_INSERT + 22)/* Object */
 #define FN_INSERT_PAGEBREAK (FN_INSERT + 23)/* Page break*/
 #define FN_POSTIT   (FN_INSERT + 29)/* Insert/edit PostIt */
diff --git a/sw/inc/formatcontentcontrol.hxx b/sw/inc/formatcontentcontrol.hxx
index 368720a0cb76..8419446f59c0 100644
--- a/sw/inc/formatcontentcontrol.hxx
+++ b/sw/inc/formatcontentcontrol.hxx
@@ -32,6 +32,12 @@ class SwTextContentControl;
 class SwTextNode;
 class SwXContentControl;
 
+enum class SwContentControlType
+{
+RICH_TEXT,
+CHECKBOX,
+};
+
 /// SfxPoolItem subclass that wraps an SwContentControl.
 class SAL_DLLPUBLIC_RTTI SwFormatContentControl final : public SfxPoolItem
 {
diff --git a/sw/qa/uibase/wrtsh/wrtsh.cxx b/sw/qa/uibase/wrtsh/wrtsh.cxx
index b4d4cca09df6..5fddff1d884f 100644
--- a/sw/qa/uibase/wrtsh/wrtsh.cxx
+++ b/sw/qa/uibase/wrtsh/wrtsh.cxx
@@ -136,7 +136,7 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertContentControl)
 
 // When inserting a content control:
 SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
-pWrtShell->InsertContentControl();
+pWrtShell->InsertContentControl(SwContentControlType::RICH_TEXT);
 
 // Then make sure that the matching text attribute is added to the 
document model:
 SwTextNode* pTextNode = pWrtShell->GetCursor()->GetNode().GetTextNode();
@@ -144,6 +144,27 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertContentControl)
 // InsertContentControl().
 CPPUNIT_ASSERT(pTextNode->GetTextAttrForCharAt(0, 
RES_TXTATR_CONTENTCONTROL));
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testInsertCheckboxContentControl)
+{
+// Given an empty document:
+SwDoc* pDoc = createSwDoc();
+
+// When inserting a content control:
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+pWrtShell->InsertContentControl(SwContentControlType::CHECKBOX);
+
+// Then make sure that the matching text attribute is added to the 
document model:
+SwTextNode* pTextNode =

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

2022-05-02 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_core_text.mk  |1 
 sw/qa/core/text/text.cxx|   44 +++-
 sw/source/core/text/frmform.cxx |   18 
 3 files changed, 62 insertions(+), 1 deletion(-)

New commits:
commit 571e546bcc76e21f16a9f2929caa48c7abd8055a
Author: Miklos Vajna 
AuthorDate: Fri Apr 29 12:10:13 2022 +0200
Commit: Xisco Fauli 
CommitDate: Mon May 2 12:18:07 2022 +0200

tdf#148683 sw: fix crash on deleting text with redlining enabled, but hidden

Regression from commit 32902f66e7749b2d06d13f50416be5323a0c0ea9
(sw_redlinehide: make layout based Show/Hide mode the default,
2018-11-30), deleting some text in the middle of the paragraph with the
bugdoc results in an assertion failure in the SwDrawTextInfo ctor.

Normally this doesn't happen on text deletion as we already have a
mechanism for truncating no longer needed lines in
SwTextFrame::Format_(), though that only checks the length of the
current line.

Fix the problem by extending this mechanism to also check the remaining
lines: if change tracking is on and the total of all line lengths is
more than the string length of the text frame, then time to
re-calculate.

It seems this is not needed in practice when redlining is disabled,
though we might want to enable this for the non-redline case as well in
the future.

(cherry picked from commit 515bf5d4afa3a8ed413fd6f17f66fa98b6dbf29e)

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

diff --git a/sw/CppunitTest_sw_core_text.mk b/sw/CppunitTest_sw_core_text.mk
index 19d8cd422edc..c3025f007a9a 100644
--- a/sw/CppunitTest_sw_core_text.mk
+++ b/sw/CppunitTest_sw_core_text.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_core_text, \
 comphelper \
 cppu \
 cppuhelper \
+editeng \
 sal \
 sfx \
 svl \
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 845eb2fd5b15..f8a30dfcf8d4 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -24,12 +24,13 @@
 #include 
 #include 
 #include 
-
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
 
 constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/text/data/";
 
@@ -278,6 +279,47 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, 
testAsCharImageDocModelFromViewPoint)
 CPPUNIT_ASSERT_EQUAL(aGraphicNode, pShellCursor->GetMark()->nNode);
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRedlineDelete)
+{
+// Given a document with A4 paper size, some text, redlining on, but 
hidden:
+SwDoc* pDoc = createSwDoc();
+SwDocShell* pDocShell = pDoc->GetDocShell();
+SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+{
+// Set page size to A4.
+size_t nCurIdx = pWrtShell->GetCurPageDesc();
+SwPageDesc aPageDesc(pWrtShell->GetPageDesc(nCurIdx));
+SwFrameFormat& rMaster = aPageDesc.GetMaster();
+SwFormatFrameSize aSize(SwFrameSize::Fixed);
+aSize.SetSize(Size(11906, 16838));
+rMaster.SetFormatAttr(aSize);
+pWrtShell->ChgPageDesc(nCurIdx, aPageDesc);
+}
+OUString aBefore("a aa aa aa aa ");
+OUString aDelete("delete eee ee eee ee ee");
+pWrtShell->Insert(aBefore + " " + aDelete
+  + " zz zzz z zzz   z zz zzz 
zzz zzz");
+// Enable redlining.
+pDocShell->SetChangeRecording(/*bActivate=*/true);
+// Hide redlining.
+pWrtShell->StartAllAction();
+pWrtShell->GetLayout()->SetHideRedlines(true);
+pWrtShell->EndAllAction();
+
+// When deleting content in the middle of the paragraph:
+pWrtShell->SttEndDoc(/*bStt=*/true);
+pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 
/*nCount=*/aBefore.getLength(),
+ /*bBasicCall=*/false);
+pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 
/*nCount=*/aDelete.getLength(),
+ /*bBasicCall=*/false);
+// Without the accompanying fix in place, this test would have crashed:
+pWrtShell->Delete();
+
+// Then make sure that the redline is created:
+CPPUNIT_ASSERT_EQUAL(static_cast(1),
+ 
pDoc->getIDocumentRedlineAccess().GetRedlineTable().size());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 2eba32cdef55..9837d3df6c2f 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1611,8 +1611,26 @@ void SwTextFrame::Format_( SwTextFormatter &rLine, 
SwTextFormatInfo &rInf,
 // If we're finished formatting the text and we still
 // have other line objects left, these are superfluous
 // now because the text has got

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

2022-05-02 Thread Caolán McNamara (via logerrit)
 sw/qa/extras/layout/layout2.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit b294a94861289c322a26edb6b83f0d329575639d
Author: Caolán McNamara 
AuthorDate: Sun May 1 21:02:48 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 2 11:33:09 2022 +0200

enable test for all platforms

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

diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index f88fbdc94f71..7453dac90b0e 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -1920,7 +1920,6 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, 
testUserFieldTypeLanguage)
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124261)
 {
-#if !defined(_WIN32)
 // Make sure that pressing a key in a btlr cell frame causes an immediate, 
correct repaint.
 SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf124261.docx");
 SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
@@ -1949,7 +1948,6 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124261)
 SwTextFrame* pTextFrame = static_cast(pFrame);
 SwRect aRect = pTextFrame->GetPaintSwRect();
 CPPUNIT_ASSERT_EQUAL(pTextFrame->getFrameArea().Top(), aRect.Top());
-#endif
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();


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

2022-05-02 Thread Caolán McNamara (via logerrit)
 sw/qa/extras/layout/layout2.cxx |   35 +++
 sw/qa/extras/uiwriter/uiwriter5.cxx |   34 --
 2 files changed, 35 insertions(+), 34 deletions(-)

New commits:
commit d0d780a05e03414e59a40e5c950bd2487a55e714
Author: Caolán McNamara 
AuthorDate: Sun May 1 15:23:54 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 2 11:32:51 2022 +0200

move layout-dependent test to explicit layout cppunit target

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

diff --git a/sw/qa/extras/uiwriter/data/tdf124261.docx 
b/sw/qa/extras/layout/data/tdf124261.docx
similarity index 100%
rename from sw/qa/extras/uiwriter/data/tdf124261.docx
rename to sw/qa/extras/layout/data/tdf124261.docx
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index faf978d65f1e..f88fbdc94f71 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1917,6 +1918,40 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, 
testUserFieldTypeLanguage)
 "1,234.56");
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf124261)
+{
+#if !defined(_WIN32)
+// Make sure that pressing a key in a btlr cell frame causes an immediate, 
correct repaint.
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf124261.docx");
+SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+SwFrame* pPageFrame = pLayout->GetLower();
+CPPUNIT_ASSERT(pPageFrame->IsPageFrame());
+
+SwFrame* pBodyFrame = pPageFrame->GetLower();
+CPPUNIT_ASSERT(pBodyFrame->IsBodyFrame());
+
+SwFrame* pTabFrame = pBodyFrame->GetLower();
+CPPUNIT_ASSERT(pTabFrame->IsTabFrame());
+
+SwFrame* pRowFrame = pTabFrame->GetLower();
+CPPUNIT_ASSERT(pRowFrame->IsRowFrame());
+
+SwFrame* pCellFrame = pRowFrame->GetLower();
+CPPUNIT_ASSERT(pCellFrame->IsCellFrame());
+
+SwFrame* pFrame = pCellFrame->GetLower();
+CPPUNIT_ASSERT(pFrame->IsTextFrame());
+
+// Make sure that the text frame's area and the paint rectangle match.
+// Without the accompanying fix in place, this test would have failed with 
'Expected: 1721;
+// Actual: 1547', i.e. an area other than the text frame was invalidated 
for a single-line
+// paragraph.
+SwTextFrame* pTextFrame = static_cast(pFrame);
+SwRect aRect = pTextFrame->GetPaintSwRect();
+CPPUNIT_ASSERT_EQUAL(pTextFrame->getFrameArea().Top(), aRect.Top());
+#endif
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/uiwriter/uiwriter5.cxx 
b/sw/qa/extras/uiwriter/uiwriter5.cxx
index dbd804164671..dec49313d195 100644
--- a/sw/qa/extras/uiwriter/uiwriter5.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter5.cxx
@@ -943,40 +943,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf147006)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rIDMA.getAllMarksCount());
 }
 
-CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf124261)
-{
-#if !defined(_WIN32)
-// Make sure that pressing a key in a btlr cell frame causes an immediate, 
correct repaint.
-SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf124261.docx");
-SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
-SwFrame* pPageFrame = pLayout->GetLower();
-CPPUNIT_ASSERT(pPageFrame->IsPageFrame());
-
-SwFrame* pBodyFrame = pPageFrame->GetLower();
-CPPUNIT_ASSERT(pBodyFrame->IsBodyFrame());
-
-SwFrame* pTabFrame = pBodyFrame->GetLower();
-CPPUNIT_ASSERT(pTabFrame->IsTabFrame());
-
-SwFrame* pRowFrame = pTabFrame->GetLower();
-CPPUNIT_ASSERT(pRowFrame->IsRowFrame());
-
-SwFrame* pCellFrame = pRowFrame->GetLower();
-CPPUNIT_ASSERT(pCellFrame->IsCellFrame());
-
-SwFrame* pFrame = pCellFrame->GetLower();
-CPPUNIT_ASSERT(pFrame->IsTextFrame());
-
-// Make sure that the text frame's area and the paint rectangle match.
-// Without the accompanying fix in place, this test would have failed with 
'Expected: 1721;
-// Actual: 1547', i.e. an area other than the text frame was invalidated 
for a single-line
-// paragraph.
-SwTextFrame* pTextFrame = static_cast(pFrame);
-SwRect aRect = pTextFrame->GetPaintSwRect();
-CPPUNIT_ASSERT_EQUAL(pTextFrame->getFrameArea().Top(), aRect.Top());
-#endif
-}
-
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testDocxAttributeTableExport)
 {
 createSwDoc(DATA_DIRECTORY, "floating-table-position.docx");


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

2022-05-02 Thread Noel Grandin (via logerrit)
 editeng/inc/editdoc.hxx |   38 ++--
 editeng/qa/unit/core-test.cxx   |4 
 editeng/source/editeng/editdbg.cxx  |   32 ++--
 editeng/source/editeng/editdoc.cxx  |  114 --
 editeng/source/editeng/editeng.cxx  |   24 +--
 editeng/source/editeng/impedit.cxx  |   16 +-
 editeng/source/editeng/impedit.hxx  |8 -
 editeng/source/editeng/impedit2.cxx |  211 ++-
 editeng/source/editeng/impedit3.cxx |  279 ++--
 editeng/source/editeng/impedit4.cxx |   79 +-
 editeng/source/editeng/impedit5.cxx |   10 -
 11 files changed, 428 insertions(+), 387 deletions(-)

New commits:
commit 0a312357e50de2a868effeb436b339258cbd0d58
Author: Noel Grandin 
AuthorDate: Mon Apr 18 16:30:55 2022 +0200
Commit: Michael Stahl 
CommitDate: Mon May 2 11:30:47 2022 +0200

tdf#148620 Crash in Draw using Format > Lists > Move Down

This reverts
commit 35f03f26799747894d1534796b6cb227bd4f233b
speed up loading large ODS a little
since ImpEditEngine::ImpMoveParagraphs wants to manipulate
ParaPortion's and also identify them by pointer

Also convert the OSL_ASSERT in this method to an assert
to catch such problems earlier

Change-Id: Id924d00c9524223db9a96e487b331ce60e3a4fff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133128
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133300
(cherry picked from commit 697d7b8bf50bdbf097c45f5d7974a27a14e1dd9e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133407
Reviewed-by: Adolfo Jayme Barrientos 
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx
index 133ea1ca9daa..353273c847e2 100644
--- a/editeng/inc/editdoc.hxx
+++ b/editeng/inc/editdoc.hxx
@@ -433,10 +433,8 @@ class TextPortionList
 PortionsType maPortions;
 
 public:
-   TextPortionList();
-~TextPortionList();
-TextPortionList(TextPortionList&&) = default;
-TextPortionList& operator=(TextPortionList&&) = default;
+TextPortionList();
+~TextPortionList();
 
 voidReset();
 sal_Int32 FindPortion(
@@ -477,7 +475,9 @@ private:
 boolbInvalid:1;   // for skillful formatting
 
 public:
-EditLine();
+EditLine();
+EditLine( const EditLine& );
+~EditLine();
 
 boolIsIn( sal_Int32 nIndex ) const
 { return ( (nIndex >= nStart ) && ( nIndex < nEnd ) ); 
}
@@ -532,6 +532,7 @@ public:
 
 EditLine*   Clone() const;
 
+EditLine&   operator = ( const EditLine& rLine );
 friend bool operator == ( const EditLine& r1,  const EditLine& r2  );
 };
 
@@ -543,10 +544,8 @@ class EditLineList
 LinesType maLines;
 
 public:
-EditLineList();
-~EditLineList();
-EditLineList(EditLineList&&) = default;
-EditLineList& operator=(EditLineList&&) = default;
+EditLineList();
+~EditLineList();
 
 void Reset();
 void DeleteFromLine(sal_Int32 nDelFrom);
@@ -583,11 +582,11 @@ private:
 boolbVisible: 1;// Belongs to the node!
 boolbForceRepaint   : 1;
 
+ParaPortion( const ParaPortion& ) = delete;
+
 public:
-ParaPortion( ContentNode* pNode );
-~ParaPortion();
-ParaPortion( ParaPortion&& ) = default;
-ParaPortion& operator=( ParaPortion&& ) = default;
+ParaPortion( ContentNode* pNode );
+~ParaPortion();
 
 sal_Int32 GetLineNumber( sal_Int32 nIndex ) const;
 
@@ -634,7 +633,7 @@ public:
 class ParaPortionList
 {
 mutable sal_Int32 nLastCache;
-std::vector maPortions;
+std::vector> maPortions;
 public:
 ParaPortionList();
 ~ParaPortionList();
@@ -647,12 +646,13 @@ public:
 ParaPortion* SafeGetObject(sal_Int32 nPos);
 
 sal_Int32 GetPos(const ParaPortion* p) const;
-ParaPortion& operator[](sal_Int32 nPos);
-const ParaPortion& operator[](sal_Int32 nPos) const;
+ParaPortion* operator[](sal_Int32 nPos);
+const ParaPortion* operator[](sal_Int32 nPos) const;
 
-ParaPortion Remove(sal_Int32 nPos);
-ParaPortion& Insert(sal_Int32 nPos, ParaPortion&& p);
-void Append(ParaPortion&& p);
+std::unique_ptr Release(sal_Int32 nPos);
+void Remove(sal_Int32 nPos);
+void Insert(sal_Int32 nPos, std::unique_ptr p);
+void Append(std::unique_ptr p);
 sal_Int32 Count() const;
 
 #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 0859a018ca0a..5e99d63c8746 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -191,8 +191,8 @@ void Test::testLineSpacing()
 aEditEngine.Q

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

2022-05-02 Thread Ashod Nakashian (via logerrit)
 sfx2/source/doc/objstor.cxx |   31 +++
 1 file changed, 31 insertions(+)

New commits:
commit f4ef1e3e580f7a590496d62aaa3dc7e092510a9c
Author: Ashod Nakashian 
AuthorDate: Sun May 1 16:52:30 2022 -0400
Commit: Michael Meeks 
CommitDate: Mon May 2 10:43:13 2022 +0200

sw: restore UI language to en while saving

Because the XML writer used in sw invokes the
translation logic, which uses the UI language,
saving can fail in case there are multiple
views with different langauges. This restores
the default language before saving to avoid
such issues and to make sure the document
xml is generated in the default language.

Signed-off-by: Ashod Nakashian 
Change-Id: Ibc0813de33cf7cf3528b0ff1d95560e799903fb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133676
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 7ccee4f3a970..238369b746e6 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -91,6 +91,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -3168,6 +3169,11 @@ bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium )
 return false;
 }
 
+namespace
+{
+static LanguageTag g_defaultLanguageTag("en-US", true);
+}
+
 bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium )
 {
 uno::Reference< embed::XStorage > xStorage = rMedium.GetStorage();
@@ -3190,6 +3196,31 @@ bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium 
)
 pImpl->aBasicManager.storeLibrariesToStorage( xStorage );
 }
 #endif
+
+// Because XMLTextFieldExport::ExportFieldDeclarations (called from 
SwXMLExport)
+// calls SwXTextFieldMasters::getByName, which in turn maps property 
names by
+// calling SwStyleNameMapper::GetTextUINameArray, which uses
+// SvtSysLocale().GetUILanguageTag() to do the mapping, saving 
indirectly depends
+// on the UI language. This is an unfortunate depenency.
+// Here we restore to English
+const auto viewLanguage = comphelper::LibreOfficeKit::getLanguageTag();
+
+// Use the default language for saving and restore later if necessary.
+bool restoreLanguage = false;
+if (comphelper::LibreOfficeKit::isActive() && viewLanguage != 
g_defaultLanguageTag)
+{
+restoreLanguage = true;
+comphelper::LibreOfficeKit::setLanguageTag(g_defaultLanguageTag);
+}
+
+// Restore the view's original language automatically and as necessary.
+const ::comphelper::ScopeGuard aGuard(
+[&viewLanguage, restoreLanguage]()
+{
+if (restoreLanguage && viewLanguage != 
comphelper::LibreOfficeKit::getLanguageTag())
+comphelper::LibreOfficeKit::setLanguageTag(viewLanguage);
+});
+
 return SaveAs( rMedium );
 }
 else return false;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 12 commits - configure.ac extras/source framework/uiconfig svx/source sw/qa sw/source vcl/qa vcl/source vcl/unx

2022-05-02 Thread Caolán McNamara (via logerrit)
 configure.ac   
  |   28 
 extras/source/templates/draw/bpmn/content.xml  
  |   92 
 extras/source/templates/draw/bpmn/meta.xml 
  |   12 
 extras/source/templates/draw/bpmn/styles.xml   
  |   36 
 
extras/source/templates/offimisc/Businesscard-with-logo/Thumbnails/thumbnail.png
 |binary
 extras/source/templates/offimisc/Businesscard-with-logo/content.xml
  | 1920 --
 extras/source/templates/offimisc/Businesscard-with-logo/meta.xml   
  |5 
 extras/source/templates/offimisc/Businesscard-with-logo/settings.xml   
  |  124 
 extras/source/templates/offimisc/Businesscard-with-logo/styles.xml 
  |   86 
 framework/uiconfig/startmodule/menubar/menubar.xml 
  |1 
 svx/source/xml/xmlxtimp.cxx
  |2 
 sw/qa/extras/layout/data/forcepoint93-1.rtf
  |binary
 sw/qa/extras/layout/data/forcepoint93-2.rtf
  |binary
 sw/qa/extras/layout/layout.cxx 
  |7 
 sw/qa/uitest/writer_tests/trackedChanges.py
  |   30 
 sw/source/core/inc/frame.hxx   
  |   11 
 sw/source/core/layout/objectformattertxtfrm.cxx
  |2 
 sw/source/core/layout/wsfrm.cxx
  |2 
 sw/source/uibase/misc/redlndlg.cxx 
  |   27 
 vcl/qa/cppunit/mnemonic.cxx
  |2 
 vcl/source/app/IconThemeInfo.cxx   
  |   20 
 vcl/source/filter/itiff/itiff.cxx  
  |   34 
 vcl/source/window/brdwin.cxx   
  |   12 
 vcl/source/window/mnemonic.cxx 
  |2 
 vcl/unx/gtk3/gtkframe.cxx  
  |   43 
 25 files changed, 337 insertions(+), 2161 deletions(-)

New commits:
commit 28df187c10dc65b7879c6415749f9e786cf9ffbc
Author: Caolán McNamara 
AuthorDate: Tue Apr 26 14:37:10 2022 +0100
Commit: Andras Timar 
CommitDate: Mon May 2 10:28:52 2022 +0200

tdf#140272 gtk3: fix crash with dnd using touch

gdk_wayland_drag_context_manage_dnd needs
gdk_device_window_at_position(device, ...)
to succeed

similar to the problem of https://gitlab.gnome.org/GNOME/gtk/-/issues/1080

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

diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index 8864a60cc50d..c6fb8ac14ac1 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -5815,16 +5815,39 @@ void GtkSalFrame::startDrag(const 
css::datatransfer::dnd::DragGestureEvent& rEve
 aFakeEvent.type = GDK_BUTTON_PRESS;
 aFakeEvent.button.window = widget_get_surface(getMouseEventWidget());
 aFakeEvent.button.time = GDK_CURRENT_TIME;
-GdkDeviceManager* pDeviceManager = 
gdk_display_get_device_manager(getGdkDisplay());
-aFakeEvent.button.device = 
gdk_device_manager_get_client_pointer(pDeviceManager);
-
-GdkDragContext *pDrag = 
gtk_drag_begin_with_coordinates(getMouseEventWidget(),
-pTargetList,
-sourceActions,
-nDragButton,
-&aFakeEvent,
-rEvent.DragOriginX,
-
rEvent.DragOriginY);
+
+aFakeEvent.button.device = gtk_get_current_event_device();
+// if no current event to determine device, or (tdf#140272) the device 
will be unsuitable then find an
+// appropiate device to use.
+if (!aFakeEvent.button.device || 
!gdk_device_get_window_at_position(aFakeEvent.button.device, nullptr, nullptr))
+{
+GdkDeviceManager* pDeviceManager = 
gdk_display_get_device_manager(getGdkDisplay());
+GList* pDevices = gdk_device_manager_list_devices(pDeviceManager, 
GDK_DEVICE_TYPE_MASTER);
+for (GList* pEntry = pDevices; pEntry; pEntry = pEntry->next)
+{
+GdkDevice* pDevice = static_cast(pEntry->data);
+if (gdk_device_get_source(pDevice) == GDK_SOURCE_KEYBOARD)
+continue;
+if (gdk_device_get_window_at_position(pDevice, nullptr, null

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

2022-05-02 Thread Heiko Tietze (via logerrit)
 sc/source/ui/sparklines/SparklineAttributes.cxx |   19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit ee1705a95bdfffbe0e36d449378be726733d7141
Author: Heiko Tietze 
AuthorDate: Fri Apr 29 14:00:46 2022 +0200
Commit: Heiko Tietze 
CommitDate: Mon May 2 10:22:25 2022 +0200

Use colors from standard palette for sparklines

Change-Id: I95cfb74efd5e28e048c8057a464a57c88aab7e7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133634
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/sc/source/ui/sparklines/SparklineAttributes.cxx 
b/sc/source/ui/sparklines/SparklineAttributes.cxx
index 1203b9f67eb0..cbc8d369ded9 100644
--- a/sc/source/ui/sparklines/SparklineAttributes.cxx
+++ b/sc/source/ui/sparklines/SparklineAttributes.cxx
@@ -48,15 +48,18 @@ public:
 std::optional m_aManualMax;
 std::optional m_aManualMin;
 
+static constexpr ::Color COL_STANDARD_RED = 0xff;
+static constexpr ::Color COL_STANDARD_BLUE = 0x2a6099;
+
 Implementation()
-: m_aColorSeries(COL_BLUE)
-, m_aColorNegative(COL_RED)
-, m_aColorAxis(COL_RED)
-, m_aColorMarkers(COL_RED)
-, m_aColorFirst(COL_RED)
-, m_aColorLast(COL_RED)
-, m_aColorHigh(COL_RED)
-, m_aColorLow(COL_RED)
+: m_aColorSeries(COL_STANDARD_BLUE)
+, m_aColorNegative(COL_STANDARD_RED)
+, m_aColorAxis(COL_STANDARD_RED)
+, m_aColorMarkers(COL_STANDARD_RED)
+, m_aColorFirst(COL_STANDARD_RED)
+, m_aColorLast(COL_STANDARD_RED)
+, m_aColorHigh(COL_STANDARD_RED)
+, m_aColorLow(COL_STANDARD_RED)
 , m_eMinAxisType(AxisType::Individual)
 , m_eMaxAxisType(AxisType::Individual)
 , m_fLineWeight(0.75)


[Libreoffice-commits] core.git: include/tools

2022-05-02 Thread Stephan Bergmann (via logerrit)
 include/tools/color.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 40edf4e6ae3e0bedd978fcaacc9d731094000ecb
Author: Stephan Bergmann 
AuthorDate: Sun May 1 23:16:03 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 2 10:01:54 2022 +0200

Add css::uno::Any(Color) specialization

...like was already present for css::uno::makeAny, in preparation of 
getting rid
of makeAny

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

diff --git a/include/tools/color.hxx b/include/tools/color.hxx
index 0cf6e122eb90..e2b1783f5e5d 100644
--- a/include/tools/color.hxx
+++ b/include/tools/color.hxx
@@ -437,6 +437,8 @@ inline void operator <<=( css::uno::Any & rAny, Color value 
)
 }
 
 namespace com::sun::star::uno {
+template<> inline Any::Any(Color const & value): Any(sal_Int32(value)) {}
+
 template<>
 inline Any makeAny( Color const & value )
 {


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

2022-05-02 Thread Miklos Vajna (via logerrit)
 sw/source/filter/ww8/wrtw8esh.cxx |   20 +++
 sw/source/filter/ww8/wrtw8sty.cxx |  108 +++---
 sw/source/filter/ww8/wrtww8.cxx   |   56 +--
 sw/source/filter/ww8/wrtww8.hxx   |   32 +--
 4 files changed, 108 insertions(+), 108 deletions(-)

New commits:
commit 55c3860f98fc198bdbf21e2acbb37c5541bb7e6a
Author: Miklos Vajna 
AuthorDate: Mon May 2 08:04:06 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 2 09:37:26 2022 +0200

sw: prefix members of WW8_WrPlcPn, WW8_WrPlcSepx, WW8_WrPlcSubDoc and ...

... WW8_WrPlcTextBoxes

See tdf#94879 for motivation.

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

diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index f9746b13fa00..e9a00f95ec89 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -904,15 +904,15 @@ void DrawObj::SetShapeDetails(sal_uInt32 nId, sal_Int32 
nThick)
 bool WW8_WrPlcTextBoxes::WriteText( WW8Export& rWrt )
 {
 rWrt.m_bInWriteEscher = true;
-WW8_CP& rccp=TXT_TXTBOX == nTyp ? rWrt.m_pFib->m_ccpTxbx : 
rWrt.m_pFib->m_ccpHdrTxbx;
+WW8_CP& rccp=TXT_TXTBOX == m_nTyp ? rWrt.m_pFib->m_ccpTxbx : 
rWrt.m_pFib->m_ccpHdrTxbx;
 
-bool bRet = WriteGenericText( rWrt, nTyp, rccp );
+bool bRet = WriteGenericText( rWrt, m_nTyp, rccp );
 
 WW8_CP nCP = rWrt.Fc2Cp( rWrt.Strm().Tell() );
 WW8Fib& rFib = *rWrt.m_pFib;
 WW8_CP nMyOffset = rFib.m_ccpText + rFib.m_ccpFootnote + rFib.m_ccpHdr + 
rFib.m_ccpAtn
 + rFib.m_ccpEdn;
-if( TXT_TXTBOX == nTyp )
+if( TXT_TXTBOX == m_nTyp )
 rWrt.m_pFieldTextBxs->Finish( nCP, nMyOffset );
 else
 rWrt.m_pFieldHFTextBxs->Finish( nCP, nMyOffset + rFib.m_ccpTxbx );
@@ -922,23 +922,23 @@ bool WW8_WrPlcTextBoxes::WriteText( WW8Export& rWrt )
 
 void WW8_WrPlcTextBoxes::Append( const SdrObject& rObj, sal_uInt32 nShapeId )
 {
-aContent.push_back( &rObj );
-aShapeIds.push_back( nShapeId );
+m_aContent.push_back( &rObj );
+m_aShapeIds.push_back( nShapeId );
 //save NULL, if we have an actual SdrObject
-aSpareFormats.push_back(nullptr);
+m_aSpareFormats.push_back(nullptr);
 }
 
 void WW8_WrPlcTextBoxes::Append( const SwFrameFormat* pFormat, sal_uInt32 
nShapeId )
 {
 //no sdr object, we insert a NULL in the aContent and save the real fmt in 
aSpareFormats.
-aContent.push_back( nullptr );
-aShapeIds.push_back( nShapeId );
-aSpareFormats.push_back(pFormat);
+m_aContent.push_back( nullptr );
+m_aShapeIds.push_back( nShapeId );
+m_aSpareFormats.push_back(pFormat);
 }
 
 const std::vector* WW8_WrPlcTextBoxes::GetShapeIdArr() const
 {
-return &aShapeIds;
+return &m_aShapeIds;
 }
 
 sal_uInt32 WW8Export::GetSdrOrdNum( const SwFrameFormat& rFormat ) const
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index 6f16b9ac1d64..dec8d2445678 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1051,7 +1051,7 @@ WW8_WrPlcSepx::WW8_WrPlcSepx( MSWordExportBase& rExport )
 {
 // to be in sync with the AppendSection() call in the MSWordSections
 // constructor
-aCps.push_back( 0 );
+m_aCps.push_back( 0 );
 }
 
 MSWordSections::~MSWordSections()
@@ -1124,7 +1124,7 @@ void WW8_WrPlcSepx::AppendSep( WW8_CP nStartCp, const 
SwPageDesc* pPd,
 if (HeaderFooterWritten()) {
 return; // #i117955# prevent new sections in endnotes
 }
-aCps.push_back( nStartCp );
+m_aCps.push_back( nStartCp );
 AppendSection( pPd, pSectionFormat, nLnNumRestartNo );
 }
 
@@ -1147,7 +1147,7 @@ void WW8_WrPlcSepx::AppendSep( WW8_CP nStartCp, const 
SwFormatPageDesc& rPD,
 if (HeaderFooterWritten()) {
 return; // #i117955# prevent new sections in endnotes
 }
-aCps.push_back( nStartCp );
+m_aCps.push_back( nStartCp );
 AppendSection( rPD, rNd, pSectionFormat, nLnNumRestartNo );
 }
 
@@ -1161,33 +1161,33 @@ void WW8_WrPlcSepx::WriteFootnoteEndText( WW8Export& 
rWrt, sal_uLong nCpStt )
 sal_uInt8 nEmptyStt = 0;
 if( nInfoFlags )
 {
-pTextPos->Append( nCpStt );  // empty footnote separator
+m_pTextPos->Append( nCpStt );  // empty footnote separator
 
 if( 0x02 & nInfoFlags ) // Footnote continuation separator
 {
-pTextPos->Append( nCpStt );
+m_pTextPos->Append( nCpStt );
 rWrt.WriteStringAsPara( rInfo.m_aErgoSum );
 rWrt.WriteStringAsPara( OUString() );
 nCpStt = rWrt.Fc2Cp( rWrt.Strm().Tell() );
 }
 else
-pTextPos->Append( nCpStt );
+m_pTextPos->Append( nCpStt );
 
 if( 0x04 & nInfoFlags ) // Footnote continuation notice
 {
-pText

[Libreoffice-commits] core.git: include/o3tl o3tl/qa

2022-05-02 Thread Luboš Luňák (via logerrit)
 include/o3tl/lru_map.hxx |  136 ++-
 o3tl/qa/test-lru_map.cxx |   30 ++
 2 files changed, 154 insertions(+), 12 deletions(-)

New commits:
commit 46097559ed1ca17c08fd77943e088451d633adfe
Author: Luboš Luňák 
AuthorDate: Sun May 1 18:52:19 2022 +0200
Commit: Tomaž Vajngerl 
CommitDate: Mon May 2 09:26:31 2022 +0200

support custom item size (cost) for o3tl::lru_map

When used with items that may vary significantly in size (such
as SalLayoutGlyphsCache storing glyphs for texts of different sizes)
limiting lru_map to just the number of items performs poorly,
since it may use only small amount of memory if items are small
or it may spent a huge amount of memory if items are large.

As extra optional template argument to o3tl::lru_map that is a functor
that provides cost of item each, and the total size is based on this
instead of each item having cost 1.

Change-Id: I2b326754fe63eb4bd20010d4cea615187407e26c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133672
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/o3tl/lru_map.hxx b/include/o3tl/lru_map.hxx
index 41c215255c7a..b3c90621edf2 100644
--- a/include/o3tl/lru_map.hxx
+++ b/include/o3tl/lru_map.hxx
@@ -16,9 +16,31 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace o3tl
 {
+namespace detail
+{
+// Helper base class to keep total cost for lru_map with custom item size.
+// Custom size is specified by the ValueSize functor, the default of each
+// item counting as 1 is specified using the void type.
+template  class lru_map_base
+{
+public:
+// Returns total of ValueSize for all items.
+size_t total_size() const { return mCurrentSize; }
+
+protected:
+size_t mCurrentSize = 0; // sum of ValueSize for all items
+};
+
+// By default cost of each item is 1, so it doesn't need to be tracked.
+template <> class lru_map_base
+{
+};
+} // namespace
+
 /** LRU map
  *
  * Similar to unordered_map (it actually uses it) with additionally 
functionality
@@ -31,10 +53,17 @@ namespace o3tl
  * The implementation is as simple as possible but it still uses O(1) 
complexity
  * for most of the operations with a combination unordered map and linked list.
  *
+ * It is optionally possible to specify a function for ValueSize template
+ * argument (that can be called as 'size_t func(Value)') that will return
+ * a size (cost) for an item istead of the default size of 1 for each item.
+ * The size of an item must not change for an item (if needed, re-insert
+ * the item). A newly inserted item is guaranteed to be in the container,
+ * even if its size exceeds the maximum size.
+ *
  **/
 template ,
-  class KeyEqual = std::equal_to>
-class lru_map final
+  class KeyEqual = std::equal_to, class ValueSize = void>
+class lru_map final : public detail::lru_map_base
 {
 public:
 typedef typename std::pair key_value_pair_t;
@@ -52,14 +81,84 @@ private:
 map_t mLruMap;
 size_t mMaxSize;
 
-void checkLRU()
+void addSize(const Value& value)
+{
+// by default total size is equal to number of items
+if constexpr (!std::is_void_v)
+this->mCurrentSize += ValueSize()(value);
+}
+
+void removeSize(const Value& value)
+{
+// by default total size is equal to number of items
+if constexpr (!std::is_void_v)
+{
+size_t itemSize = ValueSize()(value);
+assert(itemSize <= this->mCurrentSize);
+this->mCurrentSize -= itemSize;
+}
+}
+
+void removeOldestItem()
+{
+removeSize(mLruList.back().second);
+// remove from map
+mLruMap.erase(mLruList.back().first);
+// remove from list
+mLruList.pop_back();
+}
+
+void checkLRUItemInsert()
 {
-if (mLruMap.size() > mMaxSize)
+if constexpr (std::is_void_v)
+{ // One added, so it's enough to remove one, if needed.
+if (mLruMap.size() > mMaxSize)
+removeOldestItem();
+}
+else
 {
-// remove from map
-mLruMap.erase(mLruList.back().first);
-// remove from list
-mLruList.pop_back();
+// This must leave at least one item (it's called from insert).
+while (this->mCurrentSize > mMaxSize && mLruList.size() > 1)
+removeOldestItem();
+}
+}
+
+void checkLRUItemUpdate()
+{
+// Item update does not change total size by default.
+if constexpr (!std::is_void_v)
+{
+// This must leave at least one item (it's called from insert).
+while (this->mCurrentSize > mMaxSize && mLruList.size() > 1)
+removeOldestItem();
+}
+}
+
+void checkLRUMaxSize()
+{
+if constexpr (std::is_void_v)
+{
+while (

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

2022-05-02 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkframe.cxx |   43 +--
 1 file changed, 33 insertions(+), 10 deletions(-)

New commits:
commit 8bf70e7af7ae596edf7610cdfc8a728801dd259a
Author: Caolán McNamara 
AuthorDate: Tue Apr 26 14:37:10 2022 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon May 2 09:03:52 2022 +0200

tdf#140272 gtk3: fix crash with dnd using touch

gdk_wayland_drag_context_manage_dnd needs
gdk_device_window_at_position(device, ...)
to succeed

similar to the problem of https://gitlab.gnome.org/GNOME/gtk/-/issues/1080

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

diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index 8864a60cc50d..c6fb8ac14ac1 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -5815,16 +5815,39 @@ void GtkSalFrame::startDrag(const 
css::datatransfer::dnd::DragGestureEvent& rEve
 aFakeEvent.type = GDK_BUTTON_PRESS;
 aFakeEvent.button.window = widget_get_surface(getMouseEventWidget());
 aFakeEvent.button.time = GDK_CURRENT_TIME;
-GdkDeviceManager* pDeviceManager = 
gdk_display_get_device_manager(getGdkDisplay());
-aFakeEvent.button.device = 
gdk_device_manager_get_client_pointer(pDeviceManager);
-
-GdkDragContext *pDrag = 
gtk_drag_begin_with_coordinates(getMouseEventWidget(),
-pTargetList,
-sourceActions,
-nDragButton,
-&aFakeEvent,
-rEvent.DragOriginX,
-
rEvent.DragOriginY);
+
+aFakeEvent.button.device = gtk_get_current_event_device();
+// if no current event to determine device, or (tdf#140272) the device 
will be unsuitable then find an
+// appropiate device to use.
+if (!aFakeEvent.button.device || 
!gdk_device_get_window_at_position(aFakeEvent.button.device, nullptr, nullptr))
+{
+GdkDeviceManager* pDeviceManager = 
gdk_display_get_device_manager(getGdkDisplay());
+GList* pDevices = gdk_device_manager_list_devices(pDeviceManager, 
GDK_DEVICE_TYPE_MASTER);
+for (GList* pEntry = pDevices; pEntry; pEntry = pEntry->next)
+{
+GdkDevice* pDevice = static_cast(pEntry->data);
+if (gdk_device_get_source(pDevice) == GDK_SOURCE_KEYBOARD)
+continue;
+if (gdk_device_get_window_at_position(pDevice, nullptr, nullptr))
+{
+aFakeEvent.button.device = pDevice;
+break;
+}
+}
+g_list_free(pDevices);
+}
+
+GdkDragContext *pDrag;
+if (!aFakeEvent.button.device || 
!gdk_device_get_window_at_position(aFakeEvent.button.device, nullptr, nullptr))
+pDrag = nullptr;
+else
+pDrag = gtk_drag_begin_with_coordinates(getMouseEventWidget(),
+pTargetList,
+sourceActions,
+nDragButton,
+&aFakeEvent,
+rEvent.DragOriginX,
+rEvent.DragOriginY);
 
 gtk_target_list_unref(pTargetList);