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

2022-04-13 Thread NickWingate (via logerrit)
 filter/source/pdf/impdialog.cxx|   48 ++---
 filter/source/pdf/impdialog.hxx|5 ++
 include/svx/AccessibilityCheckDialog.hxx   |1 
 svx/source/dialog/AccessibilityCheckDialog.cxx |9 +---
 sw/source/uibase/shells/basesh.cxx |4 +-
 5 files changed, 36 insertions(+), 31 deletions(-)

New commits:
commit a1f9fea520f5b3f5d54a284886aa531693f32e7a
Author: NickWingate 
AuthorDate: Wed Feb 23 14:11:49 2022 +
Commit: Andras Timar 
CommitDate: Thu Apr 14 08:53:39 2022 +0200

Make accessibility check dialog async

Signed-off-by: NickWingate 
Change-Id: I88913b3d7e580a1d8c69a39454f2598e11ba43ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130438
Reviewed-by: Szymon Kłos 
Reviewed-by: Michael Meeks 
Reviewed-by: Mert Tumer 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 61fed0c4fe53738254d116543417f1c7028a0f39)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130451
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index c1a3c94d5a85..d35396b40e14 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -271,6 +271,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, 
const Sequence< Property
 GetOKButton().set_label(sOkButtonText);
 
 GetCancelButton().connect_clicked(LINK(this, ImpPDFTabDialog, CancelHdl));
+GetOKButton().connect_clicked(LINK(this, ImpPDFTabDialog, OkHdl));
 
 // remove the reset button, not needed in this tabbed dialog
 RemoveResetButton();
@@ -313,10 +314,37 @@ IMPL_LINK_NOARG(ImpPDFTabDialog, CancelHdl, 
weld::Button&, void)
 m_xDialog->response(RET_CANCEL);
 }
 
+IMPL_LINK_NOARG(ImpPDFTabDialog, OkHdl, weld::Button&, void)
+{
+if (getGeneralPage()->IsPdfUaSelected())
+{
+SfxObjectShell* pShell = SfxObjectShell::GetShellFromComponent(mrDoc);
+if (pShell)
+{
+sfx::AccessibilityIssueCollection aCollection = 
pShell->runAccessibilityCheck();
+if (!aCollection.getIssues().empty())
+{
+mpAccessibilityCheckDialog = 
std::make_shared(mpParent, aCollection);
+weld::DialogController::runAsync(mpAccessibilityCheckDialog, 
[this](sal_Int32 retValue){
+m_xDialog->response(retValue);
+});
+}
+}
+}
+else
+{
+m_xDialog->response(RET_OK);
+}
+}
+
 ImpPDFTabDialog::~ImpPDFTabDialog()
 {
 maConfigItem.WriteModifiedConfig();
 maConfigI18N.WriteModifiedConfig();
+if (mpAccessibilityCheckDialog)
+{
+mpAccessibilityCheckDialog->response(RET_CANCEL);
+}
 }
 
 void ImpPDFTabDialog::PageCreated(const OString& rId, SfxTabPage& rPage)
@@ -345,26 +373,6 @@ void ImpPDFTabDialog::PageCreated(const OString& rId, 
SfxTabPage& rPage)
 }
 }
 
-short ImpPDFTabDialog::Ok( )
-{
-// here the whole mechanism of the base class is not used
-// when Ok is hit, the user means 'convert to PDF', so simply close with ok
-
-if (getGeneralPage()->IsPdfUaSelected())
-{
-SfxObjectShell* pShell = SfxObjectShell::GetShellFromComponent(mrDoc);
-if (pShell)
-{
-sfx::AccessibilityIssueCollection aCollection = 
pShell->runAccessibilityCheck();
-if (!aCollection.getIssues().empty())
-{
-svx::AccessibilityCheckDialog aDialog(mpParent, aCollection);
-return aDialog.run();
-}
-}
-}
-return RET_OK;
-}
 
 Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
 {
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 9682adbc111d..219d47e6d613 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -20,6 +20,7 @@
 #pragma once
 
 #include 
+#include 
 
 #include 
 #include 
@@ -66,6 +67,7 @@ class ImpPDFTabDialog final : public SfxTabDialogController
 Any maSelection;
 
 DECL_LINK(CancelHdl, weld::Button&, void);
+DECL_LINK(OkHdl, weld::Button&, void);
 
 // the following data are the configuration used throughout the dialog and 
pages
 boolmbIsPresentation;
@@ -123,6 +125,8 @@ class ImpPDFTabDialog final : public SfxTabDialogController
 boolmbCanExtractForAccessibility;
 css::uno::Reference< css::beans::XMaterialHolder > mxPreparedPasswords;
 
+std::shared_ptr< svx::AccessibilityCheckDialog > 
mpAccessibilityCheckDialog;
+
 boolmbIsRangeChecked;
 OUStringmsPageRange;
 boolmbSelectionIsChecked;
@@ -163,7 +167,6 @@ public:
 
 private:
 virtual voidPageCreated(const OString& rId, SfxTabPage& 
rPage) override;
-virtual short   Ok() 

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

2022-04-13 Thread Luboš Luňák (via logerrit)
 include/vcl/glyphitemcache.hxx |   24 --
 vcl/inc/impglyphitem.hxx   |   33 ++--
 vcl/source/gdi/CommonSalLayout.cxx |   12 ++-
 vcl/source/gdi/impglyphitem.cxx|  144 ++---
 vcl/source/gdi/pdfwriter_impl.cxx  |2 
 5 files changed, 190 insertions(+), 25 deletions(-)

New commits:
commit 6c8dffc19e2a570d5665344dcba6afedd3dc2e15
Author: Luboš Luňák 
AuthorDate: Fri Apr 8 21:17:58 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Apr 14 08:34:20 2022 +0200

compute subset of glyphs in SalLayoutGlyphsCache (tdf#139604)

When OutputDevice::ImplLayout() computes glyphs, the result
is always the same for the same string (and font etc.),
and if the function is asked to work on just a subset of the string,
the returned glyphs are often also a subset of glyphs for the full
string. Since e.g. EditEngine breaks text into lines by first
laying out a full string and then repeatedly calls the same function
for a subset of the string with increasing starting index. So if
the full result is cached, it's faster to just make a subset of that,
adjust it as necessary and return that, instead of doing a layout
again.

This requires support from harfbuzz to tell us if it's safe to break
at a given position, and HB_GLYPH_FLAG_UNSAFE_TO_BREAK is that
(https://harfbuzz.github.io/harfbuzz-hb-buffer.html#hb-glyph-flags-t).

I'm keeping the optimization for tdf#144515, as avoiding the extra
layout altogether is still useful.

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

diff --git a/include/vcl/glyphitemcache.hxx b/include/vcl/glyphitemcache.hxx
index e0ab8aaf1013..ab9ad877059a 100644
--- a/include/vcl/glyphitemcache.hxx
+++ b/include/vcl/glyphitemcache.hxx
@@ -30,6 +30,8 @@
 #include 
 #include 
 
+#include 
+
 /**
 A cache for SalLayoutGlyphs objects.
 
@@ -40,16 +42,18 @@ If something more changes, call clear().
 class VCL_DLLPUBLIC SalLayoutGlyphsCache final
 {
 public:
-const SalLayoutGlyphs*
-GetLayoutGlyphs(VclPtr outputDevice, const OUString& 
text,
-const vcl::text::TextLayoutCache* layoutCache = nullptr) 
const
+// NOTE: The lifetime of the returned value is guaranteed only until the 
next call
+// to any function in this class.
+const SalLayoutGlyphs* GetLayoutGlyphs(VclPtr 
outputDevice,
+   const OUString& text,
+   const vcl::text::TextLayoutCache* 
layoutCache = nullptr)
 {
 return GetLayoutGlyphs(outputDevice, text, 0, text.getLength(), 0, 
layoutCache);
 }
-const SalLayoutGlyphs*
-GetLayoutGlyphs(VclPtr outputDevice, const OUString& 
text, sal_Int32 nIndex,
-sal_Int32 nLen, tools::Long nLogicWidth = 0,
-const vcl::text::TextLayoutCache* layoutCache = nullptr) 
const;
+const SalLayoutGlyphs* GetLayoutGlyphs(VclPtr 
outputDevice,
+   const OUString& text, sal_Int32 
nIndex, sal_Int32 nLen,
+   tools::Long nLogicWidth = 0,
+   const vcl::text::TextLayoutCache* 
layoutCache = nullptr);
 void clear() { mCachedGlyphs.clear(); }
 
 static SalLayoutGlyphsCache* self();
@@ -80,7 +84,11 @@ private:
 {
 size_t operator()(const CachedGlyphsKey& key) const { return 
key.hashValue; }
 };
-mutable o3tl::lru_map 
mCachedGlyphs;
+typedef o3tl::lru_map 
GlyphsCache;
+GlyphsCache mCachedGlyphs;
+// Last temporary glyphs returned (pointer is returned, so the object 
needs to be kept somewhere).
+std::optional mLastTemporaryKey;
+SalLayoutGlyphs mLastTemporaryGlyphs;
 
 SalLayoutGlyphsCache(const SalLayoutGlyphsCache&) = delete;
 SalLayoutGlyphsCache& operator=(const SalLayoutGlyphsCache&) = delete;
diff --git a/vcl/inc/impglyphitem.hxx b/vcl/inc/impglyphitem.hxx
index 7228911a3ed7..e86c2652100a 100644
--- a/vcl/inc/impglyphitem.hxx
+++ b/vcl/inc/impglyphitem.hxx
@@ -29,7 +29,7 @@
 #include "fontinstance.hxx"
 #include "glyphid.hxx"
 
-enum class GlyphItemFlags : sal_uInt8
+enum class GlyphItemFlags : sal_uInt16
 {
 NONE = 0,
 IS_IN_CLUSTER = 0x01,
@@ -39,11 +39,12 @@ enum class GlyphItemFlags : sal_uInt8
 IS_SPACING = 0x10,
 ALLOW_KASHIDA = 0x20,
 IS_DROPPED = 0x40,
-IS_CLUSTER_START = 0x80
+IS_CLUSTER_START = 0x80,
+IS_UNSAFE_TO_BREAK = 0x100 // HB_GLYPH_FLAG_UNSAFE_TO_BREAK from harfbuzz
 };
 namespace o3tl
 {
-template <> struct typed_flags : 
is_typed_flags
+template <> struct typed_flags : 
is_typed_flags
 {
 };
 };
@@ -54,22 +55,24 @@ class VCL_DLLPUBLIC GlyphItem
 sal_Int32 m_nOrigWidth; // original glyph width
 sal_Int32 m_nCharPos; // index in string
 sal_In

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

2022-04-13 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx  |1 +
 sfx2/source/control/unoctitm.cxx |1 +
 2 files changed, 2 insertions(+)

New commits:
commit 63abdec59d2fc23c988cb7c160bd4625e7e464a9
Author: Szymon Kłos 
AuthorDate: Tue Apr 5 19:07:26 2022 +0200
Commit: Szymon Kłos 
CommitDate: Thu Apr 14 08:30:42 2022 +0200

lok: send status update for .uno:SplitCell

Change-Id: Ic972d3ff3334f4c3a507868a95ac955c9ffbc614
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132585
Reviewed-by: Mert Tumer 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132871
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index dd9c3874b93c..d8e0ca6c95ee 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3109,6 +3109,7 @@ static void doc_iniUnoCommands ()
 OUString(".uno:InsertCaptionDialog"),
 OUString(".uno:FormatGroup"),
 OUString(".uno:SplitTable"),
+OUString(".uno:SplitCell"),
 OUString(".uno:MergeCells"),
 OUString(".uno:DeleteNote"),
 OUString(".uno:AcceptChanges"),
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index dde7c4cc6e6b..3ea0a1f9e397 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1053,6 +1053,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
  aEvent.FeatureURL.Path == "InsertCaptionDialog" ||
  aEvent.FeatureURL.Path == "MergeCells" ||
  aEvent.FeatureURL.Path == "SplitTable" ||
+ aEvent.FeatureURL.Path == "SplitCell" ||
  aEvent.FeatureURL.Path == "DeleteNote" ||
  aEvent.FeatureURL.Path == "AcceptChanges" ||
  aEvent.FeatureURL.Path == "SetDefault" ||


[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-7-3+backports' - 19 commits - basctl/source configure.ac connectivity/source cui/uiconfig oox/inc oox/source sc/inc sc/qa sc/source sd/qa

2022-04-13 Thread Michael Weghorn (via logerrit)
 basctl/source/basicide/baside3.cxx |2 
 configure.ac   |2 
 connectivity/source/drivers/dbase/DTable.cxx   |2 
 cui/uiconfig/ui/optviewpage.ui |4 
 oox/inc/drawingml/table/tablecell.hxx  |2 
 oox/source/drawingml/table/tablecell.cxx   |  106 ++---
 oox/source/drawingml/table/tableproperties.cxx |   16 +++
 oox/source/export/shapes.cxx   |6 +
 sc/inc/scmod.hxx   |2 
 sc/qa/unit/tiledrendering/data/validity.xlsx   |binary
 sc/qa/unit/tiledrendering/tiledrendering.cxx   |   85 ++--
 sc/source/core/data/column2.cxx|2 
 sc/source/ui/app/inputhdl.cxx  |   12 ++
 sc/source/ui/app/scmod.cxx |4 
 sc/source/ui/docshell/impex.cxx|2 
 sc/source/ui/inc/inputhdl.hxx  |2 
 sc/source/ui/view/tabvwsha.cxx |   11 ++
 sd/qa/unit/data/pptx/bnc480256-2.pptx  |binary
 sd/qa/unit/data/pptx/tdf135843_insideH.pptx|binary
 sd/qa/unit/export-tests.cxx|3 
 sd/qa/unit/layout-tests.cxx|   38 
 sw/source/core/text/porfld.cxx |   14 ++-
 translations   |2 
 vcl/inc/qt5/QtFrame.hxx|3 
 vcl/inc/qt5/QtMenu.hxx |1 
 vcl/inc/qt5/QtWidget.hxx   |2 
 vcl/qt5/QtData.cxx |2 
 vcl/qt5/QtFrame.cxx|8 +
 vcl/qt5/QtMenu.cxx |8 +
 vcl/qt5/QtWidget.cxx   |   19 
 vcl/source/outdev/text.cxx |2 
 vcl/win/window/salframe.cxx|5 -
 32 files changed, 316 insertions(+), 51 deletions(-)

New commits:
commit c60b1a4f728fbde4518d01bae34b57e5d1da662a
Merge: e2c329d8d077 7fc871299080
Author: Michael Weghorn 
AuthorDate: Thu Apr 14 07:35:30 2022 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 14 07:35:30 2022 +0200

Merge branch 'libreoffice-7-3'

into distro/lhm/libreoffice-7-3+backports

Change-Id: I662bbd61af08f4d2d5a64374325f35648e816931

commit 7fc871299080427587307932c505d3ae93d6a357
Author: Jan-Marek Glogowski 
AuthorDate: Tue Apr 12 00:29:56 2022 +0200
Commit: Jan-Marek Glogowski 
CommitDate: Wed Apr 13 22:31:30 2022 +0200

tdf#148115 Qt handle tooltips via event loop

Instead of calling QToolTip::showText directly from LO, this
defers showing the tooltip to the QEvent processing, which takes
the tooltip timeouts into account. So tooltips are shown with
a slight delay, therefore they happen less fast on mouse move,
reducing / avoiding artifacts of fast changing windows.

This unfortunately comes with yet an other hack in the area of
our fake popup windows...

New handling is based on the code of the Qt Tool Tips example.

Change-Id: I42634ad36dd12171c30f52f07a02a88d3c48a718
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132841
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
(cherry picked from commit af6dd54d53eee0d0de1164bff0a77c6b433b3935)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132864
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/inc/qt5/QtFrame.hxx b/vcl/inc/qt5/QtFrame.hxx
index 5ffaacf3ad94..23a4fd9887f1 100644
--- a/vcl/inc/qt5/QtFrame.hxx
+++ b/vcl/inc/qt5/QtFrame.hxx
@@ -111,6 +111,9 @@ class VCLPLUG_QT_PUBLIC QtFrame : public QObject, public 
SalFrame
 
 LanguageType m_nInputLanguage;
 
+OUString m_aTooltipText;
+QRect m_aTooltipArea;
+
 void SetDefaultPos();
 Size CalcDefaultSize();
 void SetDefaultSize();
diff --git a/vcl/inc/qt5/QtWidget.hxx b/vcl/inc/qt5/QtWidget.hxx
index 575cef11014f..878c8b1229ce 100644
--- a/vcl/inc/qt5/QtWidget.hxx
+++ b/vcl/inc/qt5/QtWidget.hxx
@@ -87,7 +87,7 @@ public:
 void endExtTextInput();
 void fakeResize();
 
-static bool handleEvent(QtFrame&, const QWidget&, QEvent*);
+static bool handleEvent(QtFrame&, QWidget&, QEvent*);
 // key events might be propagated further down => call base on false
 static inline bool handleKeyReleaseEvent(QtFrame&, const QWidget&, 
QKeyEvent*);
 // mouse events are always accepted
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index c78417b3070a..f6f4b6c2611d 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -175,7 +175,12 @@ QtFrame::QtFrame(QtFrame* pParent, SalFrameStyleFlags 
nStyle, bool bUseCairo)
 m_pTopLevel->setFocusProxy(m_pQWidget);
 }
 else
+{
 m_pQWidget = new QtWidget(*this, aWinFlags);
+// from Qt's POV the popup window doesn't have the input focus, so we 
must force tooltips...
+if (isPopup())
+m_pQWidget->setAttribute(Qt::WA_AlwaysShowToolTips);
+

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-7-3+backports' - 3 commits - android/source solenv/bin

2022-04-13 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/LOKitThread.java |   33 +++
 solenv/bin/native-code.py|2 
 2 files changed, 10 insertions(+), 25 deletions(-)

New commits:
commit e2c329d8d077e2b4baa35dc8e6094d5897ce5b00
Author: Michael Weghorn 
AuthorDate: Wed Apr 13 13:52:40 2022 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 14 07:34:28 2022 +0200

android: Deduplicate LOKitThread#load{,New}Document

After Change-Id I15ecc2eba6c5ee441f6e14f8229594cab05dbba7
"tdf#148556 android: Don't delay refresh when loading doc",
the only thing that `LOKitThread#loadNewDocument` does
in addition to `LOKithThread#loadDocument` is to save the
newly created document (to a temp file) if loading was
successful.

So, have `loadDocument` return a boolean saying whether
loading was successful and call that method from
`loadNewDocument` to reduce duplication.

Change-Id: I9b99e011b3f5105bb60f95174de393462ff08271
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132966
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit d2572dc9d6c7cda9d6e08e46c42048e12e4f04e0)

diff --git a/android/source/src/java/org/libreoffice/LOKitThread.java 
b/android/source/src/java/org/libreoffice/LOKitThread.java
index b4aee40c1cd3..c29f98461fb9 100644
--- a/android/source/src/java/org/libreoffice/LOKitThread.java
+++ b/android/source/src/java/org/libreoffice/LOKitThread.java
@@ -204,8 +204,9 @@ class LOKitThread extends Thread {
 /**
  * Handle load document event.
  * @param filePath - filePath to where the document is located
+ * @return Whether the document has been loaded successfully.
  */
-private void loadDocument(String filePath) {
+private boolean loadDocument(String filePath) {
 mLayerClient = mContext.getLayerClient();
 
 mInvalidationHandler = new InvalidationHandler(mContext);
@@ -216,8 +217,10 @@ class LOKitThread extends Thread {
 updateZoomConstraints();
 refresh(true);
 LOKitShell.hideProgressSpinner(mContext);
+return true;
 } else {
 closeDocument();
+return false;
 }
 }
 
@@ -227,20 +230,9 @@ class LOKitThread extends Thread {
  * @param fileType - fileType what type of new document is to be loaded
  */
 private void loadNewDocument(String filePath, String fileType) {
-mLayerClient = mContext.getLayerClient();
-
-mInvalidationHandler = new InvalidationHandler(mContext);
-mTileProvider = TileProviderFactory.create(mContext, 
mInvalidationHandler, fileType);
-
-if (mTileProvider.isReady()) {
-LOKitShell.showProgressSpinner(mContext);
-updateZoomConstraints();
-refresh(true);
-LOKitShell.hideProgressSpinner(mContext);
-
+boolean ok = loadDocument(fileType);
+if (ok) {
 mTileProvider.saveDocumentAs(filePath, true);
-} else {
-closeDocument();
 }
 }
 
commit 537e6f0ae333cd8e5f1f8f037d30ecabd12f0745
Author: Michael Weghorn 
AuthorDate: Wed Apr 13 12:59:08 2022 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 14 07:34:18 2022 +0200

tdf#148556 android: Don't delay refresh when loading doc

The previous way of using a separate Runnable
to do the refresh and posting that to the
main handler instead of doing the refresh
right away resulted in a timing issue, due
to which it could happen that a Calc document
would not be rendered when initally loaded
(but only after another tile reevaluation was
triggered, e.g. by tapping on the screen).

While this appears to happen mostly on fast hardware,
I could reproduce on my AVD as well when increasing
the minimum time that has to pass between
tile reevaluations to 100 ms:

--- 
a/android/source/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
+++ 
b/android/source/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
@@ -157,7 +157,7 @@ public abstract class ComposedTileLayer extends 
Layer implements ComponentCallba
 }

 long currentReevaluationNanoTime = System.nanoTime();
-if ((currentReevaluationNanoTime - reevaluationNanoTime) < 25 
* 100) {
+if ((currentReevaluationNanoTime - reevaluationNanoTime) < 100 
* 100) {
 return;
 }

For the bad case, the Runnable that triggers the
refresh would be taken from the message queue and
run on the main thread at a point in time that
resulted in `LOKitShell.sendTileReevaluationRequest`
not getting called in `ComposedTileLayer#reevaluateTiles`
due to the above-mentioned minimum time in between
tile reevaluations.

Avoid the problem and simplify the whole handling by
no longe

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

2022-04-13 Thread Seth Chaiklin (via logerrit)
 officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu |   12 
+-
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 3b222bcd75d57db404cd2ed5dc97a5c492c28060
Author: Seth Chaiklin 
AuthorDate: Thu Apr 14 00:11:28 2022 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Apr 14 04:27:05 2022 +0200

tdf#147107 "chapter" -> "item" in B&N toolbar and menu

  Changes to:  Move Chapter Up, Move Chapter Down,
   Move Chapter Up with Subpoints,
   Move Chapter Down with Subpoints

   Also capitalization correction ("With"->"with") for
   Demote Outline Level with Subpoints in Bullets & Numbering
   toolbar and menu.

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

diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 39e115b0b628..9ca5a77217b4 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -1882,7 +1882,7 @@
   
   
 
-  Move Chapter Up
+  Move Item Up
 
 
   7
@@ -1895,7 +1895,7 @@
   
   
 
-  Move Chapter Down
+  Move Item Down
 
 
   7
@@ -1942,7 +1942,7 @@
   
   
 
-  Demote Outline Level With Subpoints
+  Demote Outline Level with Subpoints
 
 
   7
@@ -1955,7 +1955,7 @@
   
   
 
-  Promote Outline Level With Subpoints
+  Promote Outline Level with Subpoints
 
 
   7
@@ -1963,7 +1963,7 @@
   
   
 
-  Move Chapter Up with Subpoints
+  Move Item Up with Subpoints
 
 
   7
@@ -1976,7 +1976,7 @@
   
   
 
-  Move Chapter Down with Subpoints
+  Move Item Down with Subpoints
 
 
   7


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - desktop/source include/LibreOfficeKit include/sal include/vcl vcl/unx

2022-04-13 Thread Tor Lillqvist (via logerrit)
 desktop/source/lib/init.cxx|   27 ++---
 include/LibreOfficeKit/LibreOfficeKit.hxx  |4 +++
 include/LibreOfficeKit/LibreOfficeKitInit.h|2 +
 include/sal/log-areas.dox  |1 
 include/vcl/outdev.hxx |4 +--
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |7 ++
 6 files changed, 40 insertions(+), 5 deletions(-)

New commits:
commit 7eec383744f6e5c36362ef22e2fd0c526e3077b1
Author: Tor Lillqvist 
AuthorDate: Wed Mar 9 11:33:16 2022 +0200
Commit: Tor Lillqvist 
CommitDate: Thu Apr 14 03:05:03 2022 +0200

Handle "addfont" from Collabora Online

We use the AddTempDevFont() API to add a new font. Sadly there is no
corresponding way to remove such a temporarily added font.

In this branch this commit also includes a follow-up fix to avoid an
assertion failure (in a build with assertions).

Change-Id: I6fe61919daa5af29e964cec1caf7293aefa8ea4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132948
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132967
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 18259e045415..82bb8715960b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4119,6 +4119,13 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, 
const char *pOption, const c
 else
 sal_detail_set_log_selector(pCurrentSalLogOverride);
 }
+else if (strcmp(pOption, "addfont") == 0)
+{
+OutputDevice *pDevice = Application::GetDefaultDevice();
+OutputDevice::ImplClearAllFontData(false);
+pDevice->AddTempDevFont(OUString::fromUtf8(pValue), "");
+OutputDevice::ImplRefreshAllFontData(false);
+}
 }
 
 static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* 
pCommand, const char* pArguments, bool bNotifyWhenFinished)
@@ -6482,7 +6489,11 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 
 // What stage are we at ?
 if (pThis == nullptr)
+{
 eStage = PRE_INIT;
+SAL_INFO("lok", "Create libreoffice object");
+gImpl = new LibLibreOffice_Impl();
+}
 else if (bPreInited)
 eStage = SECOND_INIT;
 else
@@ -6766,11 +6777,12 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 SAL_JNI_EXPORT
 LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* 
user_profile_url)
 {
-if (!gImpl)
+static bool alreadyCalled = false;
+
+if (!alreadyCalled)
 {
-SAL_INFO("lok", "Create libreoffice object");
+alreadyCalled = true;
 
-gImpl = new LibLibreOffice_Impl();
 if (!lo_initialize(gImpl, install_path, user_profile_url))
 {
 lo_destroy(gImpl);
@@ -6791,6 +6803,15 @@ int lok_preinit(const char* install_path, const char* 
user_profile_url)
 return lo_initialize(nullptr, install_path, user_profile_url);
 }
 
+SAL_JNI_EXPORT
+int lok_preinit_2(const char* install_path, const char* user_profile_url, 
LibLibreOffice_Impl** kit)
+{
+int result = lo_initialize(nullptr, install_path, user_profile_url);
+if (kit != nullptr)
+*kit = gImpl;
+return result;
+}
+
 static void lo_destroy(LibreOfficeKit* pThis)
 {
 SolarMutexClearableGuard aGuard;
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 064caae2729b..912b3e0d2203 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -1036,6 +1036,10 @@ public:
  * environment variable SAL_LOG is again used as by default. You
  * can switch back and forth as you like.
  *
+ * "addfont": ""
+ *
+ * Adds the font at the URL given.
+ *
  * @param pOption the option name
  * @param pValue its value
  */
diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index ccd42863ba25..5bbb722b5b18 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -255,6 +255,8 @@ typedef LibreOfficeKit *(LokHookFunction2)( const char 
*install_path, const char
 
 typedef int (LokHookPreInit)  ( const char *install_path, const 
char *user_profile_url );
 
+typedef int (LokHookPreInit2) ( const char *install_path, const 
char *user_profile_url, LibreOfficeKit** kit);
+
 #if defined(IOS) || defined(ANDROID)
 LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* 
user_profile_path);
 #endif
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 9a623b88dc8f..b1f8bb99723a 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -509,6 +509,7 @@ certain functionality.
 @li @c vcl

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

2022-04-13 Thread Xisco Fauli (via logerrit)
 sw/qa/extras/rtfexport/data/tdf114303.rtf |   11 +++
 sw/qa/extras/rtfexport/rtfexport4.cxx |   13 +
 2 files changed, 24 insertions(+)

New commits:
commit 187bf06aabf1b730cfcd47cbdf976f58b4960dcb
Author: Xisco Fauli 
AuthorDate: Wed Apr 13 16:46:33 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Apr 14 00:41:51 2022 +0200

tdf#114303: sw_rtfexport4: Add unittest

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

diff --git a/sw/qa/extras/rtfexport/data/tdf114303.rtf 
b/sw/qa/extras/rtfexport/data/tdf114303.rtf
new file mode 100644
index ..78f866fc5d52
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf114303.rtf
@@ -0,0 +1,11 @@
+{\rtf1\ansi\deff0
+{\fonttbl
+{\f0\fnil\fcharset204\fprq0\cpg1251 Arial;}
+{\f1\fnil\fcharset204\fprq0\cpg1251 Times New Roman;}
+{\f2\fnil\fcharset204\fprq0\cpg1251 Courier New;}
+}
+{\*\viewkind1}{\*\viewscale100}\margl0\margr0\margt0\margb0
+\paperw11905\paperh16837
+{\shp{\*\shpinst\shpleft1120\shptop8200\shpright11320\shpbottom8200\shpfhdr0\shpbxpage\shpbypage\shpwr3\shpwrk0\shpfblwtxt1\shpz0{\sp{\sn
 shapeType}{\sv 20
+{\par\plain\par
+}}
diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx 
b/sw/qa/extras/rtfexport/rtfexport4.cxx
index c2af71a93f63..276bdd963b26 100644
--- a/sw/qa/extras/rtfexport/rtfexport4.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport4.cxx
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -249,6 +250,18 @@ DECLARE_RTFEXPORT_TEST(testBtlrCell, "btlr-cell.rtf")
 CPPUNIT_ASSERT_EQUAL(text::WritingMode2::TB_RL, 
getProperty(xC1, "WritingMode"));
 }
 
+DECLARE_RTFEXPORT_TEST(testTdf114303, "tdf114303.rtf")
+{
+CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::NONE,
+ getProperty(getShape(1), "HoriOrient"));
+
+// Without the fix in place, this test would have failed with
+// - Expected: 0
+// - Actual  : 1
+CPPUNIT_ASSERT_EQUAL(text::VertOrientation::NONE,
+ getProperty(getShape(1), "VertOrient"));
+}
+
 DECLARE_RTFEXPORT_TEST(testTbrlFrame, "tbrl-frame.odt")
 {
 CPPUNIT_ASSERT_EQUAL(1, getShapes());


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

2022-04-13 Thread Jan-Marek Glogowski (via logerrit)
 vcl/inc/qt5/QtFrame.hxx  |3 +++
 vcl/inc/qt5/QtWidget.hxx |2 +-
 vcl/qt5/QtFrame.cxx  |8 +++-
 vcl/qt5/QtWidget.cxx |   19 ++-
 4 files changed, 29 insertions(+), 3 deletions(-)

New commits:
commit 7fc871299080427587307932c505d3ae93d6a357
Author: Jan-Marek Glogowski 
AuthorDate: Tue Apr 12 00:29:56 2022 +0200
Commit: Jan-Marek Glogowski 
CommitDate: Wed Apr 13 22:31:30 2022 +0200

tdf#148115 Qt handle tooltips via event loop

Instead of calling QToolTip::showText directly from LO, this
defers showing the tooltip to the QEvent processing, which takes
the tooltip timeouts into account. So tooltips are shown with
a slight delay, therefore they happen less fast on mouse move,
reducing / avoiding artifacts of fast changing windows.

This unfortunately comes with yet an other hack in the area of
our fake popup windows...

New handling is based on the code of the Qt Tool Tips example.

Change-Id: I42634ad36dd12171c30f52f07a02a88d3c48a718
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132841
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
(cherry picked from commit af6dd54d53eee0d0de1164bff0a77c6b433b3935)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132864
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/inc/qt5/QtFrame.hxx b/vcl/inc/qt5/QtFrame.hxx
index 5ffaacf3ad94..23a4fd9887f1 100644
--- a/vcl/inc/qt5/QtFrame.hxx
+++ b/vcl/inc/qt5/QtFrame.hxx
@@ -111,6 +111,9 @@ class VCLPLUG_QT_PUBLIC QtFrame : public QObject, public 
SalFrame
 
 LanguageType m_nInputLanguage;
 
+OUString m_aTooltipText;
+QRect m_aTooltipArea;
+
 void SetDefaultPos();
 Size CalcDefaultSize();
 void SetDefaultSize();
diff --git a/vcl/inc/qt5/QtWidget.hxx b/vcl/inc/qt5/QtWidget.hxx
index 575cef11014f..878c8b1229ce 100644
--- a/vcl/inc/qt5/QtWidget.hxx
+++ b/vcl/inc/qt5/QtWidget.hxx
@@ -87,7 +87,7 @@ public:
 void endExtTextInput();
 void fakeResize();
 
-static bool handleEvent(QtFrame&, const QWidget&, QEvent*);
+static bool handleEvent(QtFrame&, QWidget&, QEvent*);
 // key events might be propagated further down => call base on false
 static inline bool handleKeyReleaseEvent(QtFrame&, const QWidget&, 
QKeyEvent*);
 // mouse events are always accepted
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index c78417b3070a..f6f4b6c2611d 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -175,7 +175,12 @@ QtFrame::QtFrame(QtFrame* pParent, SalFrameStyleFlags 
nStyle, bool bUseCairo)
 m_pTopLevel->setFocusProxy(m_pQWidget);
 }
 else
+{
 m_pQWidget = new QtWidget(*this, aWinFlags);
+// from Qt's POV the popup window doesn't have the input focus, so we 
must force tooltips...
+if (isPopup())
+m_pQWidget->setAttribute(Qt::WA_AlwaysShowToolTips);
+}
 
 QWindow* pChildWindow = windowHandle();
 connect(pChildWindow, &QWindow::screenChanged, this, 
&QtFrame::screenChanged);
@@ -855,7 +860,8 @@ bool QtFrame::ShowTooltip(const OUString& rText, const 
tools::Rectangle& rHelpAr
 QRect aHelpArea(toQRect(rHelpArea));
 if (QGuiApplication::isRightToLeft())
 aHelpArea.moveLeft(maGeometry.nWidth - aHelpArea.width() - 
aHelpArea.left() - 1);
-QToolTip::showText(QCursor::pos(), toQString(rText), m_pQWidget, 
aHelpArea);
+m_aTooltipText = rText;
+m_aTooltipArea = aHelpArea;
 return true;
 }
 
diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx
index 1fe2ce9a7159..017249b05434 100644
--- a/vcl/qt5/QtWidget.cxx
+++ b/vcl/qt5/QtWidget.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -562,7 +563,7 @@ bool QtWidget::handleKeyEvent(QtFrame& rFrame, const 
QWidget& rWidget, QKeyEvent
 return bStopProcessingKey;
 }
 
-bool QtWidget::handleEvent(QtFrame& rFrame, const QWidget& rWidget, QEvent* 
pEvent)
+bool QtWidget::handleEvent(QtFrame& rFrame, QWidget& rWidget, QEvent* pEvent)
 {
 if (pEvent->type() == QEvent::ShortcutOverride)
 {
@@ -589,6 +590,22 @@ bool QtWidget::handleEvent(QtFrame& rFrame, const QWidget& 
rWidget, QEvent* pEve
ButtonKeyState::Pressed))
 return true;
 }
+else if (pEvent->type() == QEvent::ToolTip)
+{
+// Qt's POV on focus is wrong for our fake popup windows, so check 
LO's state.
+// Otherwise Qt will continue handling ToolTip events from the 
"parent" window.
+const vcl::Window* pFocusWin = Application::GetFocusWindow();
+if (!rFrame.m_aTooltipText.isEmpty() && pFocusWin
+&& pFocusWin->GetFrameWindow() == rFrame.GetWindow())
+QToolTip::showText(QCursor::pos(), 
toQString(rFrame.m_aTooltipText), &rWidget,
+   rFrame.m_aTooltipArea);
+else
+{
+QToolTip::hideText();
+pEvent->ignore();
+}
+return

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

2022-04-13 Thread Caolán McNamara (via logerrit)
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 056b81ff51f57da83c4d4b5de479bac1aa366694
Author: Caolán McNamara 
AuthorDate: Wed Apr 13 17:09:01 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Apr 13 22:12:22 2022 +0200

Resolves: tdf#148122 Celtic MD font appears wrong

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

diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 781dcde05734..f839f5778316 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5408,6 +5408,8 @@
   
 
 
+  
+  Celticmd,1571,-567,1571,-547,2126,559
   
   DIN Light,1509,-503,1509,-483,1997,483
 


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

2022-04-13 Thread Tor Lillqvist (via logerrit)
 desktop/source/lib/init.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 126e1d15fd8764fe95c1df5de28a6149c0b3d380
Author: Tor Lillqvist 
AuthorDate: Wed Apr 13 16:50:17 2022 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Apr 13 21:57:52 2022 +0200

Follow-up fix to Collabora Online "addfont" handling: avoid assertion 
failure

Change-Id: Ib75954a39d515088dbd432d0aa0ca5893194ecc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132969
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8f991c37f818..392441079820 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4164,9 +4164,9 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, const 
char *pOption, const c
 else if (strcmp(pOption, "addfont") == 0)
 {
 OutputDevice *pDevice = Application::GetDefaultDevice();
-OutputDevice::ImplClearAllFontData(true);
+OutputDevice::ImplClearAllFontData(false);
 pDevice->AddTempDevFont(OUString::fromUtf8(OString(pValue)), "");
-OutputDevice::ImplRefreshAllFontData(true);
+OutputDevice::ImplRefreshAllFontData(false);
 }
 }
 


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

2022-04-13 Thread Dennis Francis (via logerrit)
 sc/qa/unit/tiledrendering/data/validity.xlsx |binary
 sc/qa/unit/tiledrendering/tiledrendering.cxx |   57 ---
 2 files changed, 52 insertions(+), 5 deletions(-)

New commits:
commit 3c9cbc43b0cdb12e0bdfb95e797357de5b7c74db
Author: Dennis Francis 
AuthorDate: Thu Apr 7 13:14:59 2022 +0530
Commit: Michael Meeks 
CommitDate: Wed Apr 13 21:54:48 2022 +0200

lok: unit test for invalid entry save

Unit test related to the fix

lok: avoid validation-dialog yield when saving
e0175ee821eaff56c4b8e0a1b7afa1cabe0ab593

The test ensures that the document is marked unmodified after save has
been executed in the middle of entering partial data to a validation
cell.

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

diff --git a/sc/qa/unit/tiledrendering/data/validity.xlsx 
b/sc/qa/unit/tiledrendering/data/validity.xlsx
new file mode 100644
index ..54a92acd5979
Binary files /dev/null and b/sc/qa/unit/tiledrendering/data/validity.xlsx differ
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 3364e049c22f..9894da18e018 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -127,6 +127,7 @@ public:
 void testSheetViewDataCrash();
 void testTextBoxInsert();
 void testCommentCellCopyPaste();
+void testInvalidEntrySave();
 
 CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
 CPPUNIT_TEST(testRowColumnHeaders);
@@ -182,6 +183,7 @@ public:
 CPPUNIT_TEST(testSheetViewDataCrash);
 CPPUNIT_TEST(testTextBoxInsert);
 CPPUNIT_TEST(testCommentCellCopyPaste);
+CPPUNIT_TEST(testInvalidEntrySave);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -2701,18 +2703,25 @@ void ScTiledRenderingTest::testSortAscendingDescending()
 CPPUNIT_ASSERT_EQUAL(OString("rows"), aView.m_sInvalidateSheetGeometry);
 }
 
-void lcl_typeCharsInCell(const std::string& aStr, SCCOL nCol, SCROW nRow, 
ScTabViewShell* pView, ScModelObj* pModelObj)
+void lcl_typeCharsInCell(const std::string& aStr, SCCOL nCol, SCROW nRow, 
ScTabViewShell* pView,
+ScModelObj* pModelObj, bool bInEdit = false, bool bCommit = true)
 {
-pView->SetCursor(nCol, nRow);
+if (!bInEdit)
+pView->SetCursor(nCol, nRow);
+
 for (const char& cChar : aStr)
 {
 pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, cChar, 0);
 pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, cChar, 0);
 Scheduler::ProcessEventsToIdle();
 }
-pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN);
-pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
-Scheduler::ProcessEventsToIdle();
+
+if (bCommit)
+{
+pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN);
+pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
+Scheduler::ProcessEventsToIdle();
+}
 }
 
 void ScTiledRenderingTest::testAutoInputExactMatch()
@@ -3019,6 +3028,44 @@ void ScTiledRenderingTest::testCommentCellCopyPaste()
 comphelper::LibreOfficeKit::setTiledAnnotations(true);
 }
 
+void ScTiledRenderingTest::testInvalidEntrySave()
+{
+// Load a document
+comphelper::LibreOfficeKit::setActive();
+
+ScModelObj* pModelObj = createDoc("validity.xlsx");
+const ScDocument* pDoc = pModelObj->GetDocument();
+ViewCallback aView;
+int nView = SfxLokHelper::getView();
+
+SfxLokHelper::setView(nView);
+
+ScDocShell* pDocSh = dynamic_cast< ScDocShell* >( 
pModelObj->GetEmbeddedObject() );
+ScTabViewShell* pTabViewShell = 
dynamic_cast(SfxViewShell::Current());
+CPPUNIT_ASSERT(pTabViewShell);
+
+// Type partial date "7/8" of "7/8/2013" that
+// the validation cell at A8 can accept
+lcl_typeCharsInCell("7/8", 0, 7, pTabViewShell, pModelObj,
+false /* bInEdit */, false /* bCommit */); // Type "7/8" in A8
+
+uno::Sequence aArgs;
+comphelper::dispatchCommand(".uno:Save", aArgs);
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT_MESSAGE("Should not be marked modified after save", 
!pDocSh->IsModified());
+
+// Complete the date in A8 by appending "/2013" and commit.
+lcl_typeCharsInCell("/2013", 0, 7, pTabViewShell, pModelObj,
+true /* bInEdit */, true /* bCommit */);
+
+// This would hang if the date entered "7/8/2013" is not acceptable.
+Scheduler::ProcessEventsToIdle();
+
+// Ensure that the correct date is recorded in the document.
+CPPUNIT_ASSERT_EQUAL(double(41463), pDoc->GetValue(ScAddress(0, 7, 0)));
+}
+
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest);


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

2022-04-13 Thread Stephan Bergmann (via logerrit)
 desktop/source/app/cmdlineargs.cxx |2 -
 include/rtl/strbuf.hxx |   34 -
 include/rtl/ustrbuf.hxx|   33 +++-
 sw/source/core/fields/authfld.cxx  |2 -
 vcl/source/filter/ipdf/pdfdocument.cxx |2 -
 5 files changed, 36 insertions(+), 37 deletions(-)

New commits:
commit 58f533029b5cbd31993f2c667b16d3b487258e85
Author: Stephan Bergmann 
AuthorDate: Wed Apr 13 11:01:42 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Apr 13 21:46:48 2022 +0200

Clean up O[U]StringBuffer ctors taking a length parameter

For !LIBO_INTERNAL_ONLY, go back to the state before
d91d98a53612a972de368186415aa48698e074d9 "fix gcc-4.0.1 and/or 32bit build 
for
string literals" of having just a sal_Int32 overload.  (For 
!LIBO_INTERNAL_ONLY,
the current state was confusing, as the existence of further overloads 
depended
on __cplusplus >= 201103L.)

And for LIBO_INTERNAL_ONLY:

* Have overloads for all integral types, with an assert checking that they 
do
  not use out-of-bounds length arguments.  (The std::make_unsigned_t dance 
in
  the assert is needed to avoid signed/unsigned mismatch warnings as seen at
  least with MSVC.)  This removes the need for explicitly casting arguments 
that
  are larger than (unsigned) int.  (And I cleaned up two such places that I 
had
  become aware of with the abandoned previous attempt
   "Let O[U]StringBuffer 
ctors
  take sal_Int32 length parameters"; there may be more places to clean up,
  though.)

* Have deleted overloads for all integral types that are not actually 
integer
  types.  (This excludes signed char and unsigned char, as at least

> OUStringBuffer aBuf( rToken.GetByte());

  in ScTokenConversion::ConvertToTokenSequence in
  sc/source/ui/unoobj/tokenuno.cxx does a legitimate call with an argument 
of
  type sal_Int8 aka signed char.)

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

diff --git a/desktop/source/app/cmdlineargs.cxx 
b/desktop/source/app/cmdlineargs.cxx
index 95f00cb097bc..0a9d21e3caae 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -219,7 +219,7 @@ CommandLineEvent CheckWebQuery(/* in,out */ OUString& arg, 
CommandLineEvent curE
 if (!SkipNewline(pPos))
 return curEvt;
 
-OStringBuffer aResult(static_cast(nRead));
+OStringBuffer aResult(nRead);
 do
 {
 const char* pPos1 = pPos;
diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx
index 7434b2f653a8..89301a088d34 100644
--- a/include/rtl/strbuf.hxx
+++ b/include/rtl/strbuf.hxx
@@ -27,6 +27,7 @@
 
 #include 
 #include 
+#include 
 
 #include "rtl/strbuf.h"
 #include "rtl/string.hxx"
@@ -35,6 +36,7 @@
 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
 #include "rtl/stringconcat.hxx"
 #include 
+#include 
 #endif
 
 #ifdef RTL_STRING_UNITTEST
@@ -99,31 +101,29 @@ public:
 
 @param  length   the initial capacity.
  */
-explicit OStringBuffer(int length)
+explicit OStringBuffer(sal_Int32 length)
 : pData(NULL)
 , nCapacity( length )
 {
 rtl_string_new_WithLength( &pData, length );
 }
-#if __cplusplus >= 201103L
-explicit OStringBuffer(unsigned int length)
-: OStringBuffer(static_cast(length))
-{
-}
-#if SAL_TYPES_SIZEOFLONG == 4
-// additional overloads for sal_Int32 sal_uInt32
-explicit OStringBuffer(long length)
-: OStringBuffer(static_cast(length))
-{
-}
-explicit OStringBuffer(unsigned long length)
-: OStringBuffer(static_cast(length))
+#if defined LIBO_INTERNAL_ONLY
+template
+explicit OStringBuffer(T length, std::enable_if_t, 
int> = 0)
+: OStringBuffer(static_cast(length))
 {
+assert(
+length >= 0
+&& static_cast>(length)
+<= static_cast>(
+std::numeric_limits::max()));
 }
-#endif
-// avoid obvious bugs
+// avoid (obvious) bugs
+explicit OStringBuffer(bool) = delete;
 explicit OStringBuffer(char) = delete;
-explicit OStringBuffer(sal_Unicode) = delete;
+explicit OStringBuffer(wchar_t) = delete;
+explicit OStringBuffer(char16_t) = delete;
+explicit OStringBuffer(char32_t) = delete;
 #endif
 
 /**
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index fa8fa511071a..bb1bb9cef366 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -33,6 +33,7 @@
 
 #if defined LIBO_INTERNAL_ONLY
 #include 
+#include 
 #endif
 
 #include "rtl/ustrbuf.h"
@@ -100,31 +101,29 @@ public:
 
 @param  length   the initial 

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

2022-04-13 Thread Michael Stahl (via logerrit)
 ucb/source/ucp/webdav-curl/CurlSession.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ab65a74998b498ff49c15db87fc14a9afa89d8bf
Author: Michael Stahl 
AuthorDate: Wed Apr 13 20:18:31 2022 +0200
Commit: Michael Stahl 
CommitDate: Wed Apr 13 21:33:29 2022 +0200

ucb: webdav-curl: oops, increment after checking

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

diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index ed0fb60fb2b9..79574118d210 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -1374,7 +1374,6 @@ auto CurlProcessor::ProcessRequest(
 }
 else if (pEnv && pEnv->m_xAuthListener)
 {
-++rnAuthRequests;
 ::std::optional const 
oRealm(ExtractRealm(
 headers, statusCode == SC_UNAUTHORIZED ? 
"WWW-Authenticate"
: 
"Proxy-Authenticate"));
@@ -1398,6 +1397,7 @@ auto CurlProcessor::ProcessRequest(
 // will always force its use no matter how hopeless
 bool const isSystemCredSupported((authAvail & 
authSystem) != 0
  && rnAuthRequests 
== 0);
+++rnAuthRequests;
 
 // Ask user via XInteractionHandler.
 // Warning: This likely runs an event loop which 
may


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

2022-04-13 Thread Noel Grandin (via logerrit)
 include/xmloff/unoatrcn.hxx |2 +-
 xmloff/inc/txtflde.hxx  |2 +-
 xmloff/source/chart/SchXMLTools.cxx |8 
 xmloff/source/core/unoatrcn.cxx |   10 +-
 xmloff/source/core/xmlexp.cxx   |8 
 xmloff/source/draw/shapeexport.cxx  |   23 ---
 xmloff/source/text/txtflde.cxx  |   10 +-
 7 files changed, 32 insertions(+), 31 deletions(-)

New commits:
commit 0d55188fbf7b0399f01bae521f1a34d22ad8ba18
Author: Noel Grandin 
AuthorDate: Wed Apr 13 16:14:26 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 13 20:36:16 2022 +0200

use more string_view in xmloff

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

diff --git a/include/xmloff/unoatrcn.hxx b/include/xmloff/unoatrcn.hxx
index 68baa3bd8b2e..8e5556bb18aa 100644
--- a/include/xmloff/unoatrcn.hxx
+++ b/include/xmloff/unoatrcn.hxx
@@ -45,7 +45,7 @@ class XMLOFF_DLLPUBLIC SvUnoAttributeContainer final :
 private:
 std::unique_ptr mpContainer;
 
-SAL_DLLPRIVATE sal_uInt16 getIndexByName(const OUString& aName )
+SAL_DLLPRIVATE sal_uInt16 getIndexByName(std::u16string_view aName )
 const;
 
 public:
diff --git a/xmloff/inc/txtflde.hxx b/xmloff/inc/txtflde.hxx
index 66c5eed3f67e..8670cac40cf6 100644
--- a/xmloff/inc/txtflde.hxx
+++ b/xmloff/inc/txtflde.hxx
@@ -395,7 +395,7 @@ private:
 
 /// explode a field master name into field type and field name
 static void ExplodeFieldMasterName(
-const OUString& sMasterName, /// name as returned by SO API
+std::u16string_view sMasterName, /// name as returned by SO API
 OUString& sFieldType,/// out: field type
 OUString& sVarName); /// out: variable name
 
diff --git a/xmloff/source/chart/SchXMLTools.cxx 
b/xmloff/source/chart/SchXMLTools.cxx
index 27fa23987b59..828d550e9f56 100644
--- a/xmloff/source/chart/SchXMLTools.cxx
+++ b/xmloff/source/chart/SchXMLTools.cxx
@@ -86,15 +86,15 @@ OUString lcl_getGeneratorFromModelOrItsParent( const 
uno::Reference< frame::XMod
 return aGenerator;
 }
 
-sal_Int32 lcl_getBuildIDFromGenerator( const OUString& rGenerator )
+sal_Int32 lcl_getBuildIDFromGenerator( std::u16string_view rGenerator )
 {
 //returns -1 if nothing found
 sal_Int32 nBuildId = -1;
 static const OUStringLiteral sBuildCompare(  u"$Build-"  );
-sal_Int32 nBegin = rGenerator.indexOf( sBuildCompare );
-if( nBegin >= 0 )
+size_t nBegin = rGenerator.find( sBuildCompare );
+if( nBegin != std::u16string_view::npos )
 {
-OUString sBuildId( rGenerator.copy( nBegin + sBuildCompare.getLength() 
) );
+OUString sBuildId( rGenerator.substr( nBegin + 
sBuildCompare.getLength() ) );
 nBuildId = sBuildId.toInt32();
 }
 return nBuildId;
diff --git a/xmloff/source/core/unoatrcn.cxx b/xmloff/source/core/unoatrcn.cxx
index 9125e6cfb93c..354cd47b49ce 100644
--- a/xmloff/source/core/unoatrcn.cxx
+++ b/xmloff/source/core/unoatrcn.cxx
@@ -56,12 +56,12 @@ sal_Bool SAL_CALL SvUnoAttributeContainer::hasElements()
 return mpContainer->GetAttrCount() != 0;
 }
 
-sal_uInt16 SvUnoAttributeContainer::getIndexByName(const OUString& aName ) 
const
+sal_uInt16 SvUnoAttributeContainer::getIndexByName(std::u16string_view aName ) 
const
 {
 const sal_uInt16 nAttrCount = mpContainer->GetAttrCount();
 
-sal_Int32 nPos = aName.indexOf( ':' );
-if( nPos == -1 )
+size_t nPos = aName.find( ':' );
+if( nPos == std::u16string_view::npos )
 {
 for( sal_uInt16 nAttr = 0; nAttr < nAttrCount; nAttr++ )
 {
@@ -72,8 +72,8 @@ sal_uInt16 SvUnoAttributeContainer::getIndexByName(const 
OUString& aName ) const
 }
 else
 {
-const OUString aPrefix( aName.copy( 0L, nPos ) );
-const OUString aLName( aName.copy( nPos+1 ) );
+const std::u16string_view aPrefix( aName.substr( 0L, nPos ) );
+const std::u16string_view aLName( aName.substr( nPos+1 ) );
 
 for( sal_uInt16 nAttr = 0; nAttr < nAttrCount; nAttr++ )
 {
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index e0110892a6f3..cc4eb39b3bd8 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -265,11 +265,11 @@ public:
 bool
mbExportTextNumberElement;
 boolmbNullDateInitialized;
 
-void SetSchemeOf( const OUString& rOrigFileName )
+void SetSchemeOf( std::u16string_view rOrigFileName )
 {
-sal_Int32 nSep = rOrigFileName.indexOf(':');
-if( nSep != -1 )
-msPackageURIScheme = rOrigFileName.copy( 0, nSep );
+size_t nSep = rOrigFileName.find(':');
+if( nSep != std::u16string_view::npos )
+msPackageURIScheme = rOrigFileName.substr( 0, nSep );

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

2022-04-13 Thread Noel Grandin (via logerrit)
 configmgr/source/components.cxx |   14 +++---
 configmgr/source/components.hxx |2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 902e81b1b0c62993270846962d44aea6774e9687
Author: Noel Grandin 
AuthorDate: Wed Apr 13 16:13:41 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 13 20:35:21 2022 +0200

use more string_view in configmgr

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

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index cf1375956571..57f9e30e185b 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -405,15 +405,15 @@ void Components::insertModificationXcuFile(
 }
 
 css::beans::Optional< css::uno::Any > Components::getExternalValue(
-OUString const & descriptor)
+std::u16string_view descriptor)
 {
-sal_Int32 i = descriptor.indexOf(' ');
-if (i <= 0) {
+size_t i = descriptor.find(' ');
+if (i == 0 || i == std::u16string_view::npos) {
 throw css::uno::RuntimeException(
-"bad external value descriptor " + descriptor);
+OUString::Concat("bad external value descriptor ") + descriptor);
 }
 //TODO: Do not make calls with mutex locked:
-OUString name(descriptor.copy(0, i));
+OUString name(descriptor.substr(0, i));
 ExternalServices::iterator j(externalServices_.find(name));
 if (j == externalServices_.end()) {
 css::uno::Reference< css::uno::XInterface > service;
@@ -439,11 +439,11 @@ css::beans::Optional< css::uno::Any > 
Components::getExternalValue(
 css::beans::Optional< css::uno::Any > value;
 if (j->second.is()) {
 try {
-if (!(j->second->getPropertyValue(descriptor.copy(i + 1)) >>=
+if (!(j->second->getPropertyValue(OUString(descriptor.substr(i + 
1))) >>=
   value))
 {
 throw css::uno::RuntimeException(
-"cannot obtain external value through " + descriptor);
+OUString::Concat("cannot obtain external value through ") 
+ descriptor);
 }
 } catch (css::beans::UnknownPropertyException & e) {
 throw css::uno::RuntimeException(
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index 08f14a8b7bf9..5d7b6b5967ee 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -96,7 +96,7 @@ public:
 Modifications * modifications);
 
 css::beans::Optional< css::uno::Any >
-getExternalValue(OUString const & descriptor);
+getExternalValue(std::u16string_view descriptor);
 
 private:
 Components(const Components&) = delete;


Minutes from the UX/design meeting 2022-Apr-13

2022-04-13 Thread Heiko Tietze

Present: Heiko

Tickets/Topics

 * MASTER DOCUMENT: Allow to customize numbering formats of subdocuments
   when creating Master Document with File -> Send
   + https://bugs.documentfoundation.org/show_bug.cgi?id=147943
   + having options or even make configurable is over-engineering
   => use a different default namely 01_, ideally with digits
  according the maximum number

 * FILEOPEN (csv import): Allow resizing of preview columns
   + https://bugs.documentfoundation.org/show_bug.cgi?id=141380
   + little benefit not worth the effort
   + better auto size dep. on content
   => resolve WF

 * Use attention-attracting cue when pressing Ctrl+F when in find bar
   + https://bugs.documentfoundation.org/show_bug.cgi?id=148349
   + change the bg color of "Find" field for a few ms?
   + sounds like a good idea and perhaps not too difficult to implement
   + would suggest to change the frame color and fade slowly out
   => go ahead

 * Allows to paint color cells while protecting the sheet
   + https://bugs.documentfoundation.org/show_bug.cgi?id=140787
   + worry about conditional formatting but eventually it's a (hopefully)
 conscious user decision
   => option to change cell attributes except number format as other cells
  may depend on it

 * Improve labels for [M] and [T] in AutoCorrect Options tab and
   add labels in Localized Options tab
   + https://bugs.documentfoundation.org/show_bug.cgi?id=139954
   + tooltip is fine, guess [M] means to finish editing with a white-space
 or return
   => needsDevAdvice to find better tooltips

 * Tools > AutoCorrect > Apply and Edit Changes - drop first dialog
   go directly to Edit
   + https://bugs.documentfoundation.org/show_bug.cgi?id=139953
   + drop the first confirmation dialog and always show TC with
 Accept/Reject All?
   => reasonable request, do it


OpenPGP_signature
Description: OpenPGP digital signature


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

2022-04-13 Thread Tor Lillqvist (via logerrit)
 desktop/source/lib/init.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ab612633003c75dfb30664db8cc8924c086a91ee
Author: Tor Lillqvist 
AuthorDate: Wed Apr 13 16:50:17 2022 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Apr 13 20:09:54 2022 +0200

Follow-up fix to Collabora Online "addfont" handling: avoid assertion 
failure

Change-Id: Ib75954a39d515088dbd432d0aa0ca5893194ecc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132970
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 442297d5d348..dd9c3874b93c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4116,9 +4116,9 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, const 
char *pOption, const c
 else if (strcmp(pOption, "addfont") == 0)
 {
 OutputDevice *pDevice = Application::GetDefaultDevice();
-OutputDevice::ImplClearAllFontData(true);
+OutputDevice::ImplClearAllFontData(false);
 pDevice->AddTempDevFont(OUString::fromUtf8(pValue), "");
-OutputDevice::ImplRefreshAllFontData(true);
+OutputDevice::ImplRefreshAllFontData(false);
 }
 }
 


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

2022-04-13 Thread Michael Stahl (via logerrit)
 ucb/source/ucp/webdav-curl/CurlSession.cxx |   20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

New commits:
commit 2bc4d1d22fdbd9d97c66bb53762b4b4bf7b61b47
Author: Michael Stahl 
AuthorDate: Wed Apr 13 16:50:30 2022 +0200
Commit: Michael Stahl 
CommitDate: Wed Apr 13 20:09:18 2022 +0200

ucb: webdav-curl: only allow system credentials for auth once

... and in any case abort authentication after 10 failed attempts.

Apparently some PasswordContainer can turn this into an infinite loop.

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

diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index 7ad84fb9b217..ed0fb60fb2b9 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -1221,6 +1221,8 @@ auto CurlProcessor::ProcessRequest(
 }
 }
 bool isRetry(false);
+int nAuthRequests(0);
+int nAuthRequestsProxy(0);
 
 // libcurl does not have an authentication callback so handle auth
 // related status codes and requesting credentials via this loop
@@ -1363,8 +1365,16 @@ auto CurlProcessor::ProcessRequest(
 case SC_UNAUTHORIZED:
 case SC_PROXY_AUTHENTICATION_REQUIRED:
 {
-if (pEnv && pEnv->m_xAuthListener)
+auto& rnAuthRequests(statusCode == SC_UNAUTHORIZED ? 
nAuthRequests
+   : 
nAuthRequestsProxy);
+if (rnAuthRequests == 10)
 {
+SAL_INFO("ucb.ucp.webdav.curl", "aborting 
authentication after "
+<< 
rnAuthRequests << " attempts");
+}
+else if (pEnv && pEnv->m_xAuthListener)
+{
+++rnAuthRequests;
 ::std::optional const 
oRealm(ExtractRealm(
 headers, statusCode == SC_UNAUTHORIZED ? 
"WWW-Authenticate"
: 
"Proxy-Authenticate"));
@@ -1381,7 +1391,13 @@ auto CurlProcessor::ProcessRequest(
   &authAvail);
 assert(rc == CURLE_OK);
 (void)rc;
-bool const isSystemCredSupported((authAvail & 
authSystem) != 0);
+// only allow SystemCredentials once - the
+// PasswordContainer may have stored it in the
+// Config (TrySystemCredentialsFirst or
+// AuthenticateUsingSystemCredentials) and then it
+// will always force its use no matter how hopeless
+bool const isSystemCredSupported((authAvail & 
authSystem) != 0
+ && rnAuthRequests 
== 0);
 
 // Ask user via XInteractionHandler.
 // Warning: This likely runs an event loop which 
may


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

2022-04-13 Thread Noel Grandin (via logerrit)
 include/sfx2/childwin.hxx  |2 +-
 include/sfx2/sfxhtml.hxx   |2 +-
 sfx2/source/appl/childwin.cxx  |8 
 sfx2/source/bastyp/sfxhtml.cxx |6 +++---
 sfx2/source/view/frmload.cxx   |   21 +++--
 5 files changed, 20 insertions(+), 19 deletions(-)

New commits:
commit 1aced94715b73cc0de2ab91963a4f2a2102d845a
Author: Noel Grandin 
AuthorDate: Wed Apr 13 14:33:56 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 13 19:02:00 2022 +0200

use more string_view in sfx2

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

diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index ccfb32235e77..68ad6ff509f9 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -228,7 +228,7 @@ const int nCloseResponseToJustHide = -42;
 
 bool GetPosSizeFromString( std::u16string_view rStr, Point& rPos, Size& rSize 
);
 
-bool GetSplitSizeFromString( const OUString& rStr, Size& rSize );
+bool GetSplitSizeFromString( std::u16string_view rStr, Size& rSize );
 
 #endif
 
diff --git a/include/sfx2/sfxhtml.hxx b/include/sfx2/sfxhtml.hxx
index ff7ee4bfb96e..af22df207b83 100644
--- a/include/sfx2/sfxhtml.hxx
+++ b/include/sfx2/sfxhtml.hxx
@@ -68,7 +68,7 @@ public:
 // 
 static double GetTableDataOptionsValNum( sal_uInt32& nNumForm,
 LanguageType& eNumLang, const OUString& aValStr,
-const OUString& aNumStr, SvNumberFormatter& rFormatter );
+std::u16string_view aNumStr, SvNumberFormatter& rFormatter );
 
 protected:
 // Start a file download. This is done asynchronously or synchronously.
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 5cc448b2ccc3..a3c3a6ae1f73 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -121,12 +121,12 @@ bool GetPosSizeFromString( std::u16string_view rStr, 
Point& rPos, Size& rSize )
 return rSize.Width() >= 0 && rSize.Height() >= 0;
 }
 
-bool GetSplitSizeFromString( const OUString& rStr, Size& rSize )
+bool GetSplitSizeFromString( std::u16string_view rStr, Size& rSize )
 {
-sal_Int32 nIndex = rStr.indexOf( ',' );
-if ( nIndex != -1 )
+size_t nIndex = rStr.find( ',' );
+if ( nIndex != std::u16string_view::npos )
 {
-OUString aStr = rStr.copy( nIndex+1 );
+std::u16string_view aStr = rStr.substr( nIndex+1 );
 
 sal_Int32 nCount = comphelper::string::getTokenCount(aStr, ';');
 if ( nCount != 2 )
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index 9116ae8efa32..efaab39ff881 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -314,10 +314,10 @@ const OUString& SfxHTMLParser::GetScriptTypeString(
 }
 
 double SfxHTMLParser::GetTableDataOptionsValNum( sal_uInt32& nNumForm,
-LanguageType& eNumLang, const OUString& aValStr, const OUString& 
aNumStr,
+LanguageType& eNumLang, const OUString& aValStr, std::u16string_view 
aNumStr,
 SvNumberFormatter& rFormatter )
 {
-LanguageType eParseLang(aNumStr.toInt32());
+LanguageType eParseLang(o3tl::toInt32(aNumStr));
 sal_uInt32 nParseForm = rFormatter.GetFormatForLanguageIfBuiltIn( 0, 
eParseLang );
 double fVal;
 (void)rFormatter.IsNumberFormat(aValStr, nParseForm, fVal);
@@ -325,7 +325,7 @@ double SfxHTMLParser::GetTableDataOptionsValNum( 
sal_uInt32& nNumForm,
 {
 sal_Int32 nIdx {0};
 eNumLang = LanguageType(o3tl::toInt32(o3tl::getToken(aNumStr, 1, ';', 
nIdx )));
-OUString aFormat( aNumStr.copy( nIdx ) );
+OUString aFormat( aNumStr.substr( nIdx ) );
 sal_Int32 nCheckPos;
 SvNumFormatType nType;
 if ( eNumLang != LANGUAGE_SYSTEM )
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index bd0329fb2ac3..f45124849241 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -62,6 +62,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace com::sun::star;
 using ::com::sun::star::beans::PropertyValue;
@@ -141,7 +142,7 @@ private:
 ) const;
 
 static sal_uInt16   impl_findSlotParam(
-const OUString& i_rFactoryURL
+std::u16string_view i_rFactoryURL
 );
 
 static SfxObjectShellRef   impl_findObjectShell(
@@ -444,20 +445,20 @@ bool SfxFrameLoader_Impl::impl_determineTemplateDocument( 
::comphelper::NamedVal
 }
 
 
-sal_uInt16 SfxFrameLoader_Impl::impl_findSlotParam( const OUString& 
i_rFactoryURL )
+sal_uInt16 SfxFrameLoader_Impl::impl_findSlotParam( std::u16string_view 
i_rFactoryURL )
 {
-OUString sSlotParam;
-const sal_Int32 nParamPos = i_rFactoryURL.indexOf( '?' );
-if ( nParamPos >= 0 )
+std::u16string_view sSlotParam;
+const size_t nParamPos = i_rFactoryU

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

2022-04-13 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/LOKitThread.java |   20 ---
 1 file changed, 6 insertions(+), 14 deletions(-)

New commits:
commit d2572dc9d6c7cda9d6e08e46c42048e12e4f04e0
Author: Michael Weghorn 
AuthorDate: Wed Apr 13 13:52:40 2022 +0200
Commit: Michael Weghorn 
CommitDate: Wed Apr 13 18:23:02 2022 +0200

android: Deduplicate LOKitThread#load{,New}Document

After Change-Id I15ecc2eba6c5ee441f6e14f8229594cab05dbba7
"tdf#148556 android: Don't delay refresh when loading doc",
the only thing that `LOKitThread#loadNewDocument` does
in addition to `LOKithThread#loadDocument` is to save the
newly created document (to a temp file) if loading was
successful.

So, have `loadDocument` return a boolean saying whether
loading was successful and call that method from
`loadNewDocument` to reduce duplication.

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

diff --git a/android/source/src/java/org/libreoffice/LOKitThread.java 
b/android/source/src/java/org/libreoffice/LOKitThread.java
index b4aee40c1cd3..c29f98461fb9 100644
--- a/android/source/src/java/org/libreoffice/LOKitThread.java
+++ b/android/source/src/java/org/libreoffice/LOKitThread.java
@@ -204,8 +204,9 @@ class LOKitThread extends Thread {
 /**
  * Handle load document event.
  * @param filePath - filePath to where the document is located
+ * @return Whether the document has been loaded successfully.
  */
-private void loadDocument(String filePath) {
+private boolean loadDocument(String filePath) {
 mLayerClient = mContext.getLayerClient();
 
 mInvalidationHandler = new InvalidationHandler(mContext);
@@ -216,8 +217,10 @@ class LOKitThread extends Thread {
 updateZoomConstraints();
 refresh(true);
 LOKitShell.hideProgressSpinner(mContext);
+return true;
 } else {
 closeDocument();
+return false;
 }
 }
 
@@ -227,20 +230,9 @@ class LOKitThread extends Thread {
  * @param fileType - fileType what type of new document is to be loaded
  */
 private void loadNewDocument(String filePath, String fileType) {
-mLayerClient = mContext.getLayerClient();
-
-mInvalidationHandler = new InvalidationHandler(mContext);
-mTileProvider = TileProviderFactory.create(mContext, 
mInvalidationHandler, fileType);
-
-if (mTileProvider.isReady()) {
-LOKitShell.showProgressSpinner(mContext);
-updateZoomConstraints();
-refresh(true);
-LOKitShell.hideProgressSpinner(mContext);
-
+boolean ok = loadDocument(fileType);
+if (ok) {
 mTileProvider.saveDocumentAs(filePath, true);
-} else {
-closeDocument();
 }
 }
 


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

2022-04-13 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/LOKitThread.java |   13 ++---
 1 file changed, 2 insertions(+), 11 deletions(-)

New commits:
commit 4476fd51a324930e832535c10979564afc6968f2
Author: Michael Weghorn 
AuthorDate: Wed Apr 13 12:59:08 2022 +0200
Commit: Michael Weghorn 
CommitDate: Wed Apr 13 18:22:49 2022 +0200

tdf#148556 android: Don't delay refresh when loading doc

The previous way of using a separate Runnable
to do the refresh and posting that to the
main handler instead of doing the refresh
right away resulted in a timing issue, due
to which it could happen that a Calc document
would not be rendered when initally loaded
(but only after another tile reevaluation was
triggered, e.g. by tapping on the screen).

While this appears to happen mostly on fast hardware,
I could reproduce on my AVD as well when increasing
the minimum time that has to pass between
tile reevaluations to 100 ms:

--- 
a/android/source/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
+++ 
b/android/source/src/java/org/mozilla/gecko/gfx/ComposedTileLayer.java
@@ -157,7 +157,7 @@ public abstract class ComposedTileLayer extends 
Layer implements ComponentCallba
 }

 long currentReevaluationNanoTime = System.nanoTime();
-if ((currentReevaluationNanoTime - reevaluationNanoTime) < 25 
* 100) {
+if ((currentReevaluationNanoTime - reevaluationNanoTime) < 100 
* 100) {
 return;
 }

For the bad case, the Runnable that triggers the
refresh would be taken from the message queue and
run on the main thread at a point in time that
resulted in `LOKitShell.sendTileReevaluationRequest`
not getting called in `ComposedTileLayer#reevaluateTiles`
due to the above-mentioned minimum time in between
tile reevaluations.

Avoid the problem and simplify the whole handling by
no longer posting a Runnable to the main handler, but
calling `refresh()` right away.

Posting to the main handler had been introduced in

commit 27326e0f587c20d8dcf1595829233de1bd3fbe9e
Date:   Fri Aug 3 07:13:00 2018 -0700

tdf#119082 Exception wrong thread on Android Viewer

to avoid crashes due to things being done on the wrong thread
when switching to another app and then back to Android Viewer
(s. tdf#119082), but that is no longer a problem, because the
document is no longer loaded anew in that case since

commit 1bc42472200c32c9a0a10dd1c3cd6c6a8a5d47d2
Date:   Fri Apr 9 13:59:43 2021 +0200

tdf#95517 android: Rework app/doc lifecycle handling

, so the code path is not used there any more, but only when
the document is initially loaded, triggered in
`LibreOfficeMainActivity#onCreate`.

After all, the problem seems to be a similar one as fixed in

commit 128f67e0efa02294205a1abe1be874557ecdcecd
Date:   Tue May 18 14:27:51 2021 +0200

tdf#142348 android: Avoid extra refresh after loading doc

, where another timing issue in the handling of a refresh event could
result in a blank page instead of the Calc doc being rendered.

With the refresh being done right away, the synchronization added
in

commit 55661298bb3e9087a89a08637e4285f090c4e0e8
Date:   Wed Apr 1 09:00:13 2020 +0200

tdf#131195 android: Don't destroy doc while loading it

is also no more needed, because the situation described in its
commit message no longer applies:

> Since the 'refresh()' in 'LOKitThread::loadDocument' is
> not executed synchronously but posted to the main handler,
> this needs to be synchronized to prevent the document from
> being deleted while it's being used.

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

diff --git a/android/source/src/java/org/libreoffice/LOKitThread.java 
b/android/source/src/java/org/libreoffice/LOKitThread.java
index a4d5ba99f1a2..b4aee40c1cd3 100644
--- a/android/source/src/java/org/libreoffice/LOKitThread.java
+++ b/android/source/src/java/org/libreoffice/LOKitThread.java
@@ -214,15 +214,7 @@ class LOKitThread extends Thread {
 if (mTileProvider.isReady()) {
 LOKitShell.showProgressSpinner(mContext);
 updateZoomConstraints();
-LOKitShell.getMainHandler().post(new Runnable() {
-@Override
-public void run() {
-// synchronize to avoid deletion while loading
-synchronized (LOKitThread.this) {
-refresh(true);
-}
-}
-});
+refresh(tr

[Libreoffice-commits] core.git: solenv/bin

2022-04-13 Thread Michael Weghorn (via logerrit)
 solenv/bin/native-code.py |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 827d97887a8284e09fdeb2aa2918f60f09fd1a4a
Author: Michael Weghorn 
AuthorDate: Wed Apr 13 10:16:00 2022 +0200
Commit: Michael Weghorn 
CommitDate: Wed Apr 13 18:22:29 2022 +0200

tdf#148553 liblo-native-code: Add services for numeric controls

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

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 88d53d320602..6b9ebdbb4601 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -190,6 +190,7 @@ core_constructor_list = [
 ("com_sun_star_form_OListBoxControl_get_implementation", "#if 
HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS"),
 ("com_sun_star_form_OListBoxModel_get_implementation", "#if 
HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS"),
 ("com_sun_star_form_ONumericModel_get_implementation", "#if 
HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS"),
+("com_sun_star_form_ONumericControl_get_implementation", "#if 
HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS"),
 ("com_sun_star_form_ORadioButtonControl_get_implementation", "#if 
HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS"),
 ("com_sun_star_form_ORadioButtonModel_get_implementation", "#if 
HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS"),
 ("com_sun_star_form_XForms_get_implementation", "#if 
HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS"),
@@ -419,6 +420,7 @@ core_constructor_list = [
 "stardiv_Toolkit_UnoDateFieldControl_get_implementation",
 "stardiv_Toolkit_UnoGroupBoxControl_get_implementation",
 "stardiv_Toolkit_UnoListBoxControl_get_implementation",
+"stardiv_Toolkit_UnoNumericFieldControl_get_implementation",
 "stardiv_Toolkit_UnoRadioButtonControl_get_implementation",
 "stardiv_Toolkit_UnoSpinButtonModel_get_implementation",
 "stardiv_Toolkit_VCLXPointer_get_implementation",


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

2022-04-13 Thread Luboš Luňák (via logerrit)
 vcl/source/gdi/impglyphitem.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit cd1b93aafad2bd868025d363be9a913a2913ef39
Author: Luboš Luňák 
AuthorDate: Wed Apr 13 15:42:26 2022 +0200
Commit: Luboš Luňák 
CommitDate: Wed Apr 13 17:42:46 2022 +0200

empty SalLayoutGlyphsImpl is not automatically invalid

Empty SalLayoutGlyphs is considered invalid, because otherwise
it should have at least one *Impl, but an empty *Impl is apparently
possible if it's a fallback but it doesn't find a single glyph.
This avoid the warning in OutputDevice::ImplLayout(), triggered
e.g. by CppunitTest_writerperfect_writer.

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

diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index b97096cd199c..bd1138c8d68a 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 
+// These need being explicit because of SalLayoutGlyphsImpl being private in 
vcl.
 SalLayoutGlyphs::SalLayoutGlyphs() {}
 
 SalLayoutGlyphs::~SalLayoutGlyphs() {}
@@ -92,8 +93,6 @@ bool SalLayoutGlyphsImpl::IsValid() const
 {
 if (!m_rFontInstance.is())
 return false;
-if (empty())
-return false;
 return true;
 }
 


[Libreoffice-commits] core.git: drawinglayer/README.md emfio/README.md

2022-04-13 Thread Hossein (via logerrit)
 drawinglayer/README.md |   17 +
 emfio/README.md|6 ++
 2 files changed, 23 insertions(+)

New commits:
commit 3a641c344d35df13437f97e68ee5cfd993845e91
Author: Hossein 
AuthorDate: Wed Apr 13 13:06:01 2022 +0200
Commit: Miklos Vajna 
CommitDate: Wed Apr 13 17:04:35 2022 +0200

Add info on limerest / dump drawyinglayer primitives

* Add information on dumping drawyinglayer primitives as xml
* Add link to a new tool named limerest on gitlab

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

diff --git a/drawinglayer/README.md b/drawinglayer/README.md
index 04ebcadf0b17..a22dc0b68343 100644
--- a/drawinglayer/README.md
+++ b/drawinglayer/README.md
@@ -82,3 +82,20 @@ printing), etc.
 above)
 
 * Custom widgets (like the Header / Footer indicator button)
+
+## Dumping DrawingLayer Primitives as XML
+
+For debugging purposes, it is possible to dump the drawinglayer primitives as
+as an xml file. The drawinglayer xml dump can show possible problems with the
+rendering.
+
+For example, in `emfio/qa/cppunit/emf/EmfImportTest.cxx`, one can write:
+
+Primitive2DSequence aSequence = 
parseEmf(u"emfio/qa/cppunit/wmf/data/stockobject.emf");
+drawinglayer::Primitive2dXmlDump dumper;
+Primitive2DContainer aContainer(aSequence);
+dumper.dump(aContainer, "/tmp/drawyinglayer.xml");
+
+Then, after invoking `make CppunitTest_emfio_emf`, `/tmp/drawyinglayer.xml` 
will
+be the dump of the drawinglayer primitives used to draw the emf file in
+LibreOffice. The top level tag will be .
diff --git a/emfio/README.md b/emfio/README.md
index 665af1fa4e0c..db7393d9018c 100644
--- a/emfio/README.md
+++ b/emfio/README.md
@@ -49,6 +49,10 @@ documentation.
 ## How does it work?
 `emfio` module takes a byte array and turns it into a `drawinglayer` primitive 
container. The rendering is done via `drawinglayer` primitives. For more 
information, you should refer to [VCL](../vcl) documentation.
 
+The drawinglayer primitives created to draw the emf/wmf files can be dumped as
+xml for debugging purposes. For more information, please refer to the
+[drawyinglayer](../drawyinglayer) documentation.
+
 ## Limitations
 Not all the WMF/EMF/EMF+ records are supported by this module. Unsupported
 records are marked as "not implemented", and a warning message will printed
@@ -114,6 +118,8 @@ formats. Some of them are:
 modifies several binary formats from Microsoft including WMF/EMF/EMF+, and also
 other companies.
 * [EMF+ diagnostics reporting 
tool](https://github.com/chrissherlock/emfplus-decoder)
+* [limerest](https://gitlab.com/re-lab-project/limerest): A new gui tool based
+on OLEToy for working with verious binary formats
 
 ## Related Software
 * [libemf](http://libemf.sourceforge.net/)


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

2022-04-13 Thread Mark Hung (via logerrit)
 vcl/win/window/salframe.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit c3189d9527ee6e5923bfc897428b1b1ade803a47
Author: Mark Hung 
AuthorDate: Mon Apr 4 20:12:36 2022 +0800
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Apr 13 16:56:45 2022 +0200

tdf#143447 ignore IME candidate window state.

Some traditional Chinese IMEs ( Input Method Editors ) under
Windows10 send WM_IME_NOTIFY with IMN_OPENCANDIDATE but not
IMN_CLOSECANDIDATE. The behavior is different if users configure
the IME and enable "legacy" option.

That caused the cursor been hidden, misled by mbCandidateMode.

The patch ignores the candidate window mode in case the length
of the composition string is 0, assume in that case candidate
window is useless, and resets the candidate window mode when
composition ended to maintain the state as much as we can.

Change-Id: I91a1c23ee1a031313243e032653f50f39b0f2a3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132512
Tested-by: Jenkins
Reviewed-by: Mark Hung 
(cherry picked from commit 2b2d1c08c94fdc3982971c2b19ea241f05e578c9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132858
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 6593b2fbebb6..4556c850edec 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -5079,7 +5079,7 @@ static bool ImplHandleIMECompositionInput( WinSalFrame* 
pFrame,
 if ( (nTextLen > 0) || !(lParam & GCS_RESULTSTR) )
 {
 // End the mode, if the last character is deleted
-if ( !nTextLen && !pFrame->mbCandidateMode )
+if ( !nTextLen )
 {
 pFrame->CallCallback( SalEvent::ExtTextInput, &aEvt );
 pFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
@@ -5164,7 +5164,10 @@ static bool ImplHandleIMEEndComposition( HWND hWnd )
 if ( pFrame && pFrame->mbHandleIME )
 {
 if ( pFrame->mbAtCursorIME )
+{
+pFrame->mbCandidateMode = false;
 bDef = false;
+}
 }
 
 ImplSalYieldMutexRelease();


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

2022-04-13 Thread Noel Grandin (via logerrit)
 include/vcl/IconThemeInfo.hxx|4 +-
 include/vcl/font/FeatureParser.hxx   |2 -
 include/vcl/i18nhelp.hxx |2 -
 vcl/inc/sallayout.hxx|2 -
 vcl/qa/cppunit/FontFeatureTest.cxx   |   42 +--
 vcl/qa/cppunit/app/test_IconThemeInfo.cxx|   10 +++---
 vcl/qa/cppunit/app/test_IconThemeScanner.cxx |4 +-
 vcl/source/app/IconThemeInfo.cxx |   26 
 vcl/source/app/i18nhelp.cxx  |8 ++---
 vcl/source/control/field2.cxx|   12 +++
 vcl/source/font/FeatureParser.cxx|8 ++---
 vcl/source/gdi/CommonSalLayout.cxx   |2 -
 vcl/source/image/ImplImageTree.cxx   |   23 +++---
 13 files changed, 73 insertions(+), 72 deletions(-)

New commits:
commit 239752d358a44d9bd9e5e2a9b7e6084da97d8862
Author: Noel Grandin 
AuthorDate: Wed Apr 13 14:32:50 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 13 16:55:54 2022 +0200

use more string_view in vcl

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

diff --git a/include/vcl/IconThemeInfo.hxx b/include/vcl/IconThemeInfo.hxx
index ec116ca2f4fc..f061821ceaa1 100644
--- a/include/vcl/IconThemeInfo.hxx
+++ b/include/vcl/IconThemeInfo.hxx
@@ -51,7 +51,7 @@ public:
 static Size SizeByThemeName(std::u16string_view);
 
 /** Check whether an IconThemeInfo can be constructed from a URL */
-static bool UrlCanBeParsed(const OUString& url);
+static bool UrlCanBeParsed(std::u16string_view url);
 
 /** Find an icon theme by its id in a vector.
  * Throws a runtime_error if the theme is not contained in the vector
@@ -73,7 +73,7 @@ private:
  * If the name does not have an underscore in it, the whole name until the 
last dot is returned,
  * e.g. default.zip becomes default
  */
-static OUString FileNameToThemeId(const OUString&);
+static OUString FileNameToThemeId(std::u16string_view);
 
 /** Creates the display name for the given id of a file.
  * Currently, we only uppercase the id.
diff --git a/include/vcl/font/FeatureParser.hxx 
b/include/vcl/font/FeatureParser.hxx
index 3662c6a20baf..93fe6eabe261 100644
--- a/include/vcl/font/FeatureParser.hxx
+++ b/include/vcl/font/FeatureParser.hxx
@@ -32,7 +32,7 @@ private:
 std::vector m_aFeatures;
 
 public:
-FeatureParser(OUString const& sFontName);
+FeatureParser(std::u16string_view sFontName);
 
 OUString const& getLanguage() const { return m_sLanguage; }
 
diff --git a/include/vcl/i18nhelp.hxx b/include/vcl/i18nhelp.hxx
index f48d562c40a9..e5368da08547 100644
--- a/include/vcl/i18nhelp.hxx
+++ b/include/vcl/i18nhelp.hxx
@@ -63,7 +63,7 @@ public:
 sal_Int32   CompareString( const OUString& rStr1, const OUString& rStr2 ) 
const;
 
 boolMatchString( const OUString& rStr1, const OUString& rStr2 ) const;
-boolMatchMnemonic( const OUString& rString, sal_Unicode cMnemonicChar 
) const;
+boolMatchMnemonic( std::u16string_view rString, sal_Unicode 
cMnemonicChar ) const;
 
 OUStringGetNum( tools::Long nNumber, sal_uInt16 nDecimals, bool 
bUseThousandSep = true, bool bTrailingZeros = true ) const;
 
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index 75110158dc53..894be0a3098b 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -154,7 +154,7 @@ private:
 
 boolHasVerticalAlternate(sal_UCS4 aChar, sal_UCS4 aNextChar);
 
-voidParseFeatures(const OUString& name);
+voidParseFeatures(std::u16string_view name);
 
 css::uno::Reference mxBreak;
 
diff --git a/vcl/qa/cppunit/FontFeatureTest.cxx 
b/vcl/qa/cppunit/FontFeatureTest.cxx
index 091654b8a87a..0e9ada19cdd4 100644
--- a/vcl/qa/cppunit/FontFeatureTest.cxx
+++ b/vcl/qa/cppunit/FontFeatureTest.cxx
@@ -128,11 +128,11 @@ void FontFeatureTest::testGetFontFeatures()
 void FontFeatureTest::testParseFeature()
 {
 { // No font features specified
-vcl::font::FeatureParser aParser("Font name with no features");
+vcl::font::FeatureParser aParser(u"Font name with no features");
 CPPUNIT_ASSERT_EQUAL(size_t(0), aParser.getFeatures().size());
 }
 { // One feature specified, no value
-vcl::font::FeatureParser aParser("Font name:abcd");
+vcl::font::FeatureParser aParser(u"Font name:abcd");
 CPPUNIT_ASSERT_EQUAL(size_t(1), aParser.getFeatures().size());
 auto aFeatures = aParser.getFeatures();
 
@@ -140,7 +140,7 @@ void FontFeatureTest::testParseFeature()
 CPPUNIT_ASSERT_EQUAL(uint32_t(1), aFeatures[0].m_nValue);
 }
 { // One feature specified, explicit value
-vcl::font::FeatureParser aParser("Font name:abcd=5");
+vcl::font::FeatureParser aParser(u"Font name:abcd=5");
 CPPUNIT_ASSER

[Libreoffice-commits] core.git: include/svl svl/source

2022-04-13 Thread Noel Grandin (via logerrit)
 include/svl/inettype.hxx   |2 -
 svl/source/misc/inettype.cxx   |   18 
 svl/source/passwordcontainer/passwordcontainer.cxx |   23 +
 svl/source/passwordcontainer/passwordcontainer.hxx |4 +--
 4 files changed, 27 insertions(+), 20 deletions(-)

New commits:
commit dae0083c69e91fff3c4f5db762e4189bbdc6eb7f
Author: Noel Grandin 
AuthorDate: Wed Apr 13 14:05:07 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 13 16:55:35 2022 +0200

use more string_view in svl

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

diff --git a/include/svl/inettype.hxx b/include/svl/inettype.hxx
index dc5aa4f3a732..ea955437e472 100644
--- a/include/svl/inettype.hxx
+++ b/include/svl/inettype.hxx
@@ -252,7 +252,7 @@ public:
 
 static INetContentType GetContentTypeFromURL(OUString const& rURL);
 
-static bool GetExtensionFromURL(OUString const& rURL, OUString& 
rExtension);
+static bool GetExtensionFromURL(std::u16string_view rURL, OUString& 
rExtension);
 
 static bool parse(OUString const& rMediaType, OUString& rType, OUString& 
rSubType,
   INetContentTypeParameterList* pParameters = nullptr);
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index c1d4e4b1ba6e..25b92d390e2c 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -392,26 +392,26 @@ INetContentType 
INetContentTypes::GetContentTypeFromURL(OUString const & rURL)
 }
 
 //static
-bool INetContentTypes::GetExtensionFromURL(OUString const & rURL,
+bool INetContentTypes::GetExtensionFromURL(std::u16string_view rURL,
OUString & rExtension)
 {
-sal_Int32 nSlashPos = 0;
-sal_Int32 i = 0;
-while (i >= 0)
+size_t nSlashPos = 0;
+size_t i = 0;
+while (i != std::u16string_view::npos)
 {
 nSlashPos = i;
-i = rURL.indexOf('/', i + 1);
+i = rURL.find('/', i + 1);
 }
 if (nSlashPos != 0)
 {
-sal_Int32 nLastDotPos = i = rURL.indexOf('.', nSlashPos);
-while (i >= 0)
+size_t nLastDotPos = i = rURL.find('.', nSlashPos);
+while (i != std::u16string_view::npos)
 {
 nLastDotPos = i;
-i = rURL.indexOf('.', i + 1);
+i = rURL.find('.', i + 1);
 }
 if (nLastDotPos >- 0)
-rExtension = rURL.copy(nLastDotPos + 1);
+rExtension = rURL.substr(nLastDotPos + 1);
 return true;
 }
 return false;
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx 
b/svl/source/passwordcontainer/passwordcontainer.cxx
index 04eb0951f0ac..66cfda5e9aad 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -412,7 +412,7 @@ void SAL_CALL PasswordContainer::disposing( const 
EventObject& )
 }
 }
 
-std::vector< OUString > PasswordContainer::DecodePasswords( 
std::u16string_view aLine, const OUString& aIV, const OUString& aMasterPasswd, 
css::task::PasswordRequestMode mode )
+std::vector< OUString > PasswordContainer::DecodePasswords( 
std::u16string_view aLine, std::u16string_view aIV, const OUString& 
aMasterPasswd, css::task::PasswordRequestMode mode )
 {
 if( !aMasterPasswd.isEmpty() )
 {
@@ -428,10 +428,13 @@ std::vector< OUString > 
PasswordContainer::DecodePasswords( std::u16string_view
 code[ ind ] = static_cast(aMasterPasswd.copy( ind*2, 2 
).toUInt32(16));
 
 unsigned char iv[RTL_DIGEST_LENGTH_MD5] = {0};
-if (!aIV.isEmpty())
+if (!aIV.empty())
 {
 for( int ind = 0; ind < RTL_DIGEST_LENGTH_MD5; ind++ )
-iv[ ind ] = static_cast(aIV.copy( ind*2, 2 
).toUInt32(16));
+{
+auto tmp = aIV.substr( ind*2, 2 );
+iv[ ind ] = 
static_cast(rtl_ustr_toInt64_WithLength(tmp.data(), 16, tmp.size()));
+}
 }
 
 rtlCipherError result = rtl_cipher_init (
@@ -469,7 +472,7 @@ std::vector< OUString > PasswordContainer::DecodePasswords( 
std::u16string_view
 "Can't decode!", css::uno::Reference(), mode);
 }
 
-OUString PasswordContainer::EncodePasswords(const std::vector< OUString >& 
lines, const OUString& aIV, const OUString& aMasterPasswd)
+OUString PasswordContainer::EncodePasswords(const std::vector< OUString >& 
lines, std::u16string_view aIV, const OUString& aMasterPasswd)
 {
 if( !aMasterPasswd.isEmpty() )
 {
@@ -487,10 +490,13 @@ OUString PasswordContainer::EncodePasswords(const 
std::vector< OUString >& lines
 code[ ind ] = static_cast(aMasterPasswd.copy( ind*2, 2 
).toUInt32(16));
 
 unsigned char iv[RTL_DIGEST_LENGTH_MD5] = {0};
-if (!aIV.isEm

[Libreoffice-commits] core.git: cppuhelper/source cppu/source

2022-04-13 Thread Noel Grandin (via logerrit)
 cppu/source/uno/EnvStack.cxx|4 ++--
 cppu/source/uno/cascade_mapping.cxx |4 ++--
 cppuhelper/source/typemanager.cxx   |8 
 cppuhelper/source/typemanager.hxx   |2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit a5343a89f898468178f04c241de0b2c2a314a1b5
Author: Noel Grandin 
AuthorDate: Wed Apr 13 14:04:09 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 13 16:11:49 2022 +0200

use more string_view in cppu

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

diff --git a/cppu/source/uno/EnvStack.cxx b/cppu/source/uno/EnvStack.cxx
index 880b922886d1..2daf56a21a79 100644
--- a/cppu/source/uno/EnvStack.cxx
+++ b/cppu/source/uno/EnvStack.cxx
@@ -141,7 +141,7 @@ extern "C" void SAL_CALL 
uno_getCurrentEnvironment(uno_Environment ** ppEnv, rtl
 }
 }
 
-static OUString s_getPrefix(OUString const & str1, std::u16string_view str2)
+static OUString s_getPrefix(std::u16string_view str1, std::u16string_view str2)
 {
 sal_Int32 nIndex1 = 0;
 sal_Int32 nIndex2 = 0;
@@ -163,7 +163,7 @@ static OUString s_getPrefix(OUString const & str1, 
std::u16string_view str2)
 OUString result;
 
 if (sim)
-result = str1.copy(0, sim - 1);
+result = str1.substr(0, sim - 1);
 
 return result;
 }
diff --git a/cppu/source/uno/cascade_mapping.cxx 
b/cppu/source/uno/cascade_mapping.cxx
index dbfbfc6c4dba..f03d88e529d6 100644
--- a/cppu/source/uno/cascade_mapping.cxx
+++ b/cppu/source/uno/cascade_mapping.cxx
@@ -156,7 +156,7 @@ extern "C" { static void s_MediatorMapping_free(uno_Mapping 
* pMapping)
 }}
 
 
-static OUString getPrefix(OUString const & str1, std::u16string_view str2)
+static OUString getPrefix(std::u16string_view str1, std::u16string_view str2)
 {
 sal_Int32 nIndex1 = 0;
 sal_Int32 nIndex2 = 0;
@@ -178,7 +178,7 @@ static OUString getPrefix(OUString const & str1, 
std::u16string_view str2)
 OUString result;
 
 if (sim)
-result = str1.copy(0, sim - 1);
+result = str1.substr(0, sim - 1);
 
 return result;
 }
diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index 28ef85189f29..44105df033fa 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -2149,15 +2149,15 @@ css::uno::Any 
cppuhelper::TypeManager::getInstantiatedStruct(
 }
 
 css::uno::Any cppuhelper::TypeManager::getInterfaceMember(
-OUString const & name, sal_Int32 separator)
+std::u16string_view name, sal_Int32 separator)
 {
-assert(name.indexOf("::") == separator && separator != -1);
+assert(static_cast(name.find(u"::")) == separator && separator 
!= -1);
 css::uno::Reference< css::reflection::XInterfaceTypeDescription2 > ifc(
-resolveTypedefs(find(name.copy(0, separator))), css::uno::UNO_QUERY);
+resolveTypedefs(find(OUString(name.substr(0, separator, 
css::uno::UNO_QUERY);
 if (!ifc.is()) {
 return css::uno::Any();
 }
-OUString member(name.copy(separator + std::strlen("::")));
+std::u16string_view member = name.substr(separator + std::strlen("::"));
 const css::uno::Sequence<
 css::uno::Reference<
 css::reflection::XInterfaceMemberTypeDescription > > mems(
diff --git a/cppuhelper/source/typemanager.hxx 
b/cppuhelper/source/typemanager.hxx
index 1ee264bf16ff..28c193191267 100644
--- a/cppuhelper/source/typemanager.hxx
+++ b/cppuhelper/source/typemanager.hxx
@@ -100,7 +100,7 @@ private:
 OUString const & name, sal_Int32 separator);
 
 css::uno::Any getInterfaceMember(
-OUString const & name, sal_Int32 separator);
+std::u16string_view name, sal_Int32 separator);
 
 css::uno::Any getNamed(
 OUString const & name,


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

2022-04-13 Thread Noel Grandin (via logerrit)
 l10ntools/inc/export.hxx  |6 +++---
 l10ntools/inc/po.hxx  |2 +-
 l10ntools/source/helpex.cxx   |2 +-
 l10ntools/source/localize.cxx |8 
 l10ntools/source/merge.cxx|   16 
 l10ntools/source/po.cxx   |6 +++---
 6 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit 74957c7d2f3697fbf2b6f4d6a31c61d5d7df039b
Author: Noel Grandin 
AuthorDate: Wed Apr 13 13:54:22 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 13 16:11:27 2022 +0200

use more string_view in l10ntools

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

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 64091d6cc5b8..3f46c552f575 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -120,11 +120,11 @@ class MergeDataFile
 void InsertEntry(std::string_view rTYP, std::string_view rGID,
 std::string_view rLID, const OString &nLang,
 const OString &rTEXT, const OString &rQHTEXT,
-const OString &rTITLE, const OString &sFilename,
+const OString &rTITLE, std::string_view sFilename,
 bool bFirstLang, bool bCaseSensitive);
 public:
 explicit MergeDataFile(
-const OString &rFileName, const OString& rFile,
+const OString &rFileName, std::string_view rFile,
 bool bCaseSensitive, bool bWithQtz = true );
 ~MergeDataFile();
 
@@ -135,7 +135,7 @@ class MergeDataFile
 MergeEntrys *GetMergeEntrysCaseSensitive( ResData *pResData );
 
 static OString CreateKey(std::string_view rTYP, std::string_view rGID,
-std::string_view rLID, const OString& rFilename, bool 
bCaseSensitive);
+std::string_view rLID, std::string_view rFilename, bool 
bCaseSensitive);
 };
 
 
diff --git a/l10ntools/inc/po.hxx b/l10ntools/inc/po.hxx
index 8267525133b7..9b33d2b7788e 100644
--- a/l10ntools/inc/po.hxx
+++ b/l10ntools/inc/po.hxx
@@ -46,7 +46,7 @@ public:
 enum Exception { NOSOURCFILE, NORESTYPE, NOGROUPID, NOSTRING, 
WRONGHELPTEXT };
 
 PoEntry();
-PoEntry( const OString& rSourceFile, std::string_view 
rResType, std::string_view rGroupId,
+PoEntry( std::string_view rSourceFile, std::string_view 
rResType, std::string_view rGroupId,
  std::string_view rLocalId, std::string_view 
rHelpText, const OString& rText,
  const TYPE eType );
 ~PoEntry();
diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx
index e9f744a95bbc..97e574fc7dde 100644
--- a/l10ntools/source/helpex.cxx
+++ b/l10ntools/source/helpex.cxx
@@ -81,7 +81,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
 std::unique_ptr pMergeDataFile;
 if( aArgs.m_sLanguage != "qtz")
 {
-pMergeDataFile.reset(new MergeDataFile(aArgs.m_sMergeSrc, 
OString(), false, false ));
+pMergeDataFile.reset(new MergeDataFile(aArgs.m_sMergeSrc, 
"", false, false ));
 }
 std::string sTemp;
 aInput >> sTemp;
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index d89f89150d04..2ec0123616f4 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -116,7 +116,7 @@ void handleCommand(
 }
 
 void InitPoFile(
-std::string_view rProject, const OString& rInPath,
+std::string_view rProject, std::string_view rInPath,
 std::string_view rPotDir, const OString& rOutPath )
 {
 //Create directory for po file
@@ -150,9 +150,9 @@ void InitPoFile(
 throw false; //TODO
 }
 
-const sal_Int32 nProjectInd = rInPath.indexOf(rProject);
-const OString relativPath =
-rInPath.copy(nProjectInd, rInPath.lastIndexOf('/')- nProjectInd);
+const size_t nProjectInd = rInPath.find(rProject);
+const std::string_view relativPath =
+rInPath.substr(nProjectInd, rInPath.rfind('/')- nProjectInd);
 
 PoHeader aTmp(relativPath);
 aPoOutPut.writeHeader(aTmp);
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 78334c70c8fe..8a6964c61fa4 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -32,12 +32,12 @@
 
 namespace
 {
-OString lcl_NormalizeFilename(const OString& rFilename)
+OString lcl_NormalizeFilename(std::string_view rFilename)
 {
-return rFilename.copy(
+return OString(rFilename.substr(
 std::max(
-rFilename.lastIndexOf( '\\' ),
-rFilename.lastIndexOf( '/' ))+1);
+rFilename.rfind( '\\' ),
+rFilename.rfind( '/' ))+1));
 };
 
 bool lcl_ReadPoChecked(
@@ -111,7 +111,7 @@ OString MergeEntrys::GetQTZText(const ResData& rRe

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

2022-04-13 Thread Caolán McNamara (via logerrit)
 sw/source/core/text/frmform.cxx |   13 +++--
 sw/source/core/text/porlay.hxx  |4 ++--
 sw/source/core/text/txtfrm.cxx  |2 +-
 3 files changed, 10 insertions(+), 9 deletions(-)

New commits:
commit e8c2ae74ea433d9d75baf7ff8a349a0c86ace657
Author: Caolán McNamara 
AuthorDate: Wed Apr 13 10:32:21 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Apr 13 15:52:08 2022 +0200

give SwParaPortion a const GetDelta() and non-const SetDelta()

instead of two GetDeltas() one of which is non-const and returning a
reference that can be used to modify the delta

no logic change intended

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

diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 6b28e2fc1d69..861d143dc96a 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -214,7 +214,7 @@ bool SwTextFrame::CalcFollow(TextFrameIndex const nTextOfst)
 if( pPara )
 {
 pPara->GetReformat() = SwCharRange();
-pPara->GetDelta() = 0;
+pPara->SetDelta(0);
 }
 }
 
@@ -312,7 +312,7 @@ bool SwTextFrame::CalcFollow(TextFrameIndex const nTextOfst)
 if( pPara )
 {
 pPara->GetReformat() = SwCharRange();
-pPara->GetDelta() = 0;
+pPara->SetDelta(0);
 }
 }
 
@@ -775,7 +775,7 @@ void SwTextFrame::SetOffset_(TextFrameIndex const nNewOfst)
 SwCharRange &rReformat = pPara->GetReformat();
 rReformat.Start() = TextFrameIndex(0);
 rReformat.Len() = TextFrameIndex(GetText().getLength());
-pPara->GetDelta() = sal_Int32(rReformat.Len());
+pPara->SetDelta(sal_Int32(rReformat.Len()));
 }
 InvalidateSize();
 }
@@ -1059,7 +1059,7 @@ void SwTextFrame::FormatAdjust( SwTextFormatter &rLine,
 // are valid now
 pPara->GetReformat() = SwCharRange();
 bool bDelta = pPara->GetDelta() != 0;
-pPara->GetDelta() = 0;
+pPara->SetDelta(0);
 
 if( rLine.IsStop() )
 {
@@ -1300,7 +1300,8 @@ bool SwTextFrame::FormatLine( SwTextFormatter &rLine, 
const bool bPrev )
 }
 
 // Calculating the good ol' nDelta
-pPara->GetDelta() -= sal_Int32(pNew->GetLen()) - sal_Int32(nOldLen);
+const sal_Int32 nDiff = sal_Int32(pNew->GetLen()) - sal_Int32(nOldLen);
+pPara->SetDelta(pPara->GetDelta() - nDiff);
 
 // Stop!
 if( rLine.IsStop() )
@@ -2077,7 +2078,7 @@ bool SwTextFrame::FormatQuick( bool bForceQuickFormat )
 
 // Delete reformat
 pPara->GetReformat() = SwCharRange();
-pPara->GetDelta() = 0;
+pPara->SetDelta(0);
 
 return true;
 }
diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx
index eb0d5e8bf768..3960671fcca6 100644
--- a/sw/source/core/text/porlay.hxx
+++ b/sw/source/core/text/porlay.hxx
@@ -286,8 +286,8 @@ public:
 const SwRepaint& GetRepaint() const { return m_aRepaint; }
 SwCharRange& GetReformat() { return m_aReformat; }
 const SwCharRange& GetReformat() const { return m_aReformat; }
-tools::Long& GetDelta() { return m_nDelta; }
-const tools::Long& GetDelta() const { return m_nDelta; }
+void SetDelta(tools::Long nDelta) { m_nDelta = nDelta; }
+tools::Long GetDelta() const { return m_nDelta; }
 SwScriptInfo& GetScriptInfo() { return m_aScriptInfo; }
 const SwScriptInfo& GetScriptInfo() const { return m_aScriptInfo; }
 
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index dafcd98a8561..76f05e2c8d80 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1710,7 +1710,7 @@ void SwTextFrame::InvalidateRange_( const SwCharRange 
&aRange, const tools::Long
 // linelengths are being added, that's why it's negative
 // if chars have been added and positive, if chars have
 // deleted
-pPara->GetDelta() += nD;
+pPara->SetDelta(pPara->GetDelta() + nD);
 bInv = true;
 }
 SwCharRange &rReformat = pPara->GetReformat();


[Libreoffice-commits] core.git: filter/CppunitTest_filter_textfilterdetect.mk filter/qa filter/source sfx2/source

2022-04-13 Thread Mike Kaganski (via logerrit)
 filter/CppunitTest_filter_textfilterdetect.mk   |1 
 filter/qa/unit/data/calc.ots|binary
 filter/qa/unit/data/impress.otp |binary
 filter/qa/unit/data/writer.ott  |binary
 filter/qa/unit/textfilterdetect.cxx |  159 +++-
 filter/source/textfilterdetect/filterdetect.cxx |   53 
 sfx2/source/doc/objstor.cxx |   12 -
 sfx2/source/view/frmload.cxx|   60 +
 8 files changed, 170 insertions(+), 115 deletions(-)

New commits:
commit 064f4fe82c30118a34c4aeb47bf8604f0b8356a1
Author: Mike Kaganski 
AuthorDate: Wed Apr 13 08:40:23 2022 +0300
Commit: Mike Kaganski 
CommitDate: Wed Apr 13 15:46:59 2022 +0200

tdf#139991: move 0-byte file handling to SfxFrameLoader_Impl::load

This centralizes the code that handles templates, and allows the empty
files to use default templates.

This partially reverts commits:

ada07f303e7cd1e39c73abe0741aefe7d9d73a57
  Author Miklos Vajna 
  Date   Wed Oct 28 14:54:52 2020 +0100
tdf#123476 filter: try to detect 0-byte files based on extension

2854362f429e476d4a1ab4759c6a1f1c04150280
  Author Mike Kaganski 
  Date   Wed Jan 27 16:05:54 2021 +0100
   tdf#123476 filter: Also handle empty ODF

dff586735b6618d9b011823594a33287d8f7f223
  Author Mike Kaganski 
  Date   Mon May 03 17:04:04 2021 +0200
tdf#123476: also use filter by extension when its service is the same

The unit tests from these commits are retained and extended for templates.

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

diff --git a/filter/CppunitTest_filter_textfilterdetect.mk 
b/filter/CppunitTest_filter_textfilterdetect.mk
index 4066c26591a3..6fb22f8b074e 100644
--- a/filter/CppunitTest_filter_textfilterdetect.mk
+++ b/filter/CppunitTest_filter_textfilterdetect.mk
@@ -21,6 +21,7 @@ $(eval $(call 
gb_CppunitTest_use_libraries,filter_textfilterdetect, \
cppu \
cppuhelper \
sal \
+   sfx \
test \
textfd \
tl \
diff --git a/filter/qa/unit/data/calc.ots b/filter/qa/unit/data/calc.ots
new file mode 100644
index ..d16d2307fee9
Binary files /dev/null and b/filter/qa/unit/data/calc.ots differ
diff --git a/filter/qa/unit/data/impress.otp b/filter/qa/unit/data/impress.otp
new file mode 100644
index ..199a5f9d470f
Binary files /dev/null and b/filter/qa/unit/data/impress.otp differ
diff --git a/filter/qa/unit/data/writer.ott b/filter/qa/unit/data/writer.ott
new file mode 100644
index ..1ded03150e01
Binary files /dev/null and b/filter/qa/unit/data/writer.ott differ
diff --git a/filter/qa/unit/textfilterdetect.cxx 
b/filter/qa/unit/textfilterdetect.cxx
index bbb9b91b527f..3c8daf2f2ef9 100644
--- a/filter/qa/unit/textfilterdetect.cxx
+++ b/filter/qa/unit/textfilterdetect.cxx
@@ -13,8 +13,13 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -31,12 +36,8 @@ namespace
 /// Test class for PlainTextFilterDetect.
 class TextFilterDetectTest : public test::BootstrapFixture, public 
unotest::MacrosTest
 {
-uno::Reference mxComponent;
-
 public:
 void setUp() override;
-void tearDown() override;
-uno::Reference& getComponent() { return mxComponent; }
 };
 
 void TextFilterDetectTest::setUp()
@@ -46,14 +47,6 @@ void TextFilterDetectTest::setUp()
 mxDesktop.set(frame::Desktop::create(mxComponentContext));
 }
 
-void TextFilterDetectTest::tearDown()
-{
-if (mxComponent.is())
-mxComponent->dispose();
-
-test::BootstrapFixture::tearDown();
-}
-
 constexpr OUStringLiteral DATA_DIRECTORY = u"/filter/qa/unit/data/";
 
 CPPUNIT_TEST_FIXTURE(TextFilterDetectTest, testTdf114428)
@@ -78,68 +71,126 @@ CPPUNIT_TEST_FIXTURE(TextFilterDetectTest, testTdf114428)
 
 CPPUNIT_TEST_FIXTURE(TextFilterDetectTest, testEmptyFile)
 {
-// Given an empty file, with a pptx extension
-OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "empty.pptx";
+const OUString sDataDirectory = 
m_directories.getURLFromSrc(DATA_DIRECTORY);
+auto supportsService = [](const uno::Reference& x, const 
OUString& s) {
+return uno::Reference(x, 
uno::UNO_QUERY_THROW)->supportsService(s);
+};
 
+// Given an empty file, with a pptx extension
 // When loading the file
-getComponent() = loadFromDesktop(aURL);
+auto xComponent = loadFromDesktop(sDataDirectory + "empty.pptx");
 
 // Then make sure it is opened in Impress.
-uno::Reference xServiceInfo(getComponent(), 
uno::UNO_QUERY);
-CPPUNIT_ASSERT(xServiceInfo.is());
-
 // Without the accompanying fix in place, this test would have failed, as 
it was opened in
 // Writer instead.
-

[Libreoffice-commits] core.git: download.lst

2022-04-13 Thread Caolán McNamara (via logerrit)
 download.lst |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 15f70da655301be4d66abf91ee788b50e8ab1215
Author: Caolán McNamara 
AuthorDate: Wed Apr 13 09:01:14 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Apr 13 15:46:44 2022 +0200

upgrade to libwebp-1.2.2

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

diff --git a/download.lst b/download.lst
index 1a7fb47063a5..e847f736046f 100644
--- a/download.lst
+++ b/download.lst
@@ -162,8 +162,8 @@ export LIBNUMBERTEXT_SHA256SUM := 
a285573864eaac8d36a0f66d946e9b1d3cf01c5d93d31f
 export LIBNUMBERTEXT_TARBALL := libnumbertext-1.0.10.tar.xz
 export LIBTOMMATH_SHA256SUM := 
083daa92d8ee6f4af96a6143b12d7fc8fe1a547e14f862304f7281f8f7347483
 export LIBTOMMATH_TARBALL := ltm-1.0.zip
-export LIBWEBP_SHA256SUM := 
808b98d2f5b84e9b27fdef6c5372dac769c3bda4502febbfa5031bd3c4d7d018
-export LIBWEBP_TARBALL := libwebp-1.2.1.tar.gz
+export LIBWEBP_SHA256SUM := 
7656532f837af5f4cec3ff6bafe552c044dc39bf453587bd5b77450802f4aee6
+export LIBWEBP_TARBALL := libwebp-1.2.2.tar.gz
 export XMLSEC_SHA256SUM := 
26041d35a20a245ed5a2fb9ee075f10825664d274220cb5190340fa87a4d0931
 export XMLSEC_TARBALL := xmlsec1-1.2.33.tar.gz
 export LIBXML_SHA256SUM := 
276130602d12fe484ecc03447ee5e759d0465558fbc9d6bd144e3745306ebf0e


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

2022-04-13 Thread xuenhua (via logerrit)
 avmedia/source/framework/soundhandler.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0be48023938b74e1bde3b675bbc5481df7550470
Author: xuenhua 
AuthorDate: Tue Apr 12 22:20:09 2022 +0800
Commit: Ilmari Lauhakangas 
CommitDate: Wed Apr 13 15:07:01 2022 +0200

Fix typo

Change-Id: I77ee60e6e7c5482f49cb671d793687f831856628
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132918
Reviewed-by: Ilmari Lauhakangas 
Tested-by: Ilmari Lauhakangas 

diff --git a/avmedia/source/framework/soundhandler.cxx 
b/avmedia/source/framework/soundhandler.cxx
index 7d26c252201b..2392c3dd1ae1 100644
--- a/avmedia/source/framework/soundhandler.cxx
+++ b/avmedia/source/framework/soundhandler.cxx
@@ -144,7 +144,7 @@ SoundHandler::~SoundHandler()
 
 @short  try to load audio file
 @descr  This method try to load given audio file by URL and play it. 
We use vcl/Sound class to do that.
-Playing of sound is asynchron every time.
+Playing of sound is asynchronous every time.
 
 @attention  We must hold us alive by ourself ... because we use async. vcl 
sound player ... but playing is started
 in async interface call "dispatch()" too. And caller forget us 
immediately. But then our uno ref count


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

2022-04-13 Thread Eike Rathke (via logerrit)
 svl/source/numbers/zforfind.cxx |   23 +++
 1 file changed, 23 insertions(+)

New commits:
commit 91d9204d8eb1fd6b923d5af618f66acdbdf0d75d
Author: Eike Rathke 
AuthorDate: Fri Apr 8 21:46:47 2022 +0200
Commit: Xisco Fauli 
CommitDate: Wed Apr 13 14:39:31 2022 +0200

Resolves: tdf#148052 accept a ". Month " name for matching DMY format

... even if the locale doesn't define such DM order or
LongDateDaySeparator.

Change-Id: I4bef720dff3582de9b60313824a84b570c153e98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132741
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 7a16002ede5fd31ae8f3358136ad49de40465ac1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132703
Reviewed-by: Caolán McNamara 
(cherry picked from commit 29f7b81afcf2e21c88c38fbae31fb463b26040c1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132859
Reviewed-by: Xisco Fauli 

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 9d3c3baec899..ffe31e9be8b0 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -2605,6 +2605,29 @@ bool ImpSvNumberInputScan::ScanMidString( const 
OUString& rString, sal_uInt16 nS
 SkipBlanks(rString, nPos);
 bDate = SkipString( rDate, rString, nPos);  // 10.  10-  10/
 }
+if (!bDate && nStringPos == 1 && mpFormat && (mpFormat->GetType() & 
SvNumFormatType::DATE))
+{
+// If a DMY format was given and a mid string starts with a literal
+// ". " dot+space and could contain a following month name and ends
+// with a space or LongDateMonthSeparator, like it's scanned in
+// `14". AUG "18`, then it may be a date as well. Regardless whether
+// defined such by the locale or not.
+// This *could* check for presence of ". "MMM or ". " in the actual
+// format code for further restriction to match only if present, but..
+
+const sal_uInt32 nExactDateOrder = mpFormat->GetExactDateOrder();
+// Exactly DMY.
+if (((nExactDateOrder & 0xff) == 'Y') && (((nExactDateOrder >> 8) & 
0xff) == 'M')
+&& (((nExactDateOrder >> 16) & 0xff) == 'D'))
+{
+const sal_Int32 nTmpPos = nPos;
+if (SkipChar('.', rString, nPos) && SkipBlanks(rString, nPos) && 
nPos + 2 < rString.getLength()
+&& (rString.endsWith(" ") || rString.endsWith( 
pLoc->getLongDateMonthSep(
+bDate = true;
+else
+nPos = nTmpPos;
+}
+}
 if (bDate || ((MayBeIso8601() || MayBeMonthDate()) &&// 1999-12-31  
31-Dec-1999
   SkipChar( '-', rString, nPos)))
 {


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

2022-04-13 Thread Noel Grandin (via logerrit)
 svx/source/unodraw/unoprov.cxx |2 +-
 svx/source/xml/xmlxtimp.cxx|2 +-
 vcl/source/image/ImplImageTree.cxx |   12 
 3 files changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 05867c4e5f6d244f0f18db2a00e6fbc0d8141a41
Author: Noel Grandin 
AuthorDate: Wed Apr 13 11:29:01 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 13 13:44:44 2022 +0200

tdf#80633 speed up dialog layout

some small speedups when opening Format->Paragraph

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

diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index 85892826ed99..b209f23ac0d3 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -1998,7 +1998,7 @@ static bool 
SvxUnoConvertResourceStringBuiltInFromApi(rtl::OUStringConstExpr con
 if( sStr == pSourceResIds[i].asView() )
 {
 OUString aReplace = SvxResId(pDestResIds[i]);
-rString = rString.replaceAt( 0, 
OUString(pSourceResIds[i]).getLength(), aReplace );
+rString = aReplace + rString.subView( 
pSourceResIds[i].asView().size() );
 return true;
 }
 }
diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx
index 9bf7b6996b43..e79ec19daea8 100644
--- a/svx/source/xml/xmlxtimp.cxx
+++ b/svx/source/xml/xmlxtimp.cxx
@@ -203,7 +203,7 @@ void SvxXMLTableImportContext::importColor( const 
uno::Reference< XFastAttribute
 case XML_ELEMENT(DRAW_OOO, XML_COLOR):
 {
 sal_Int32 nColor(0);
-::sax::Converter::convertColor(nColor, aIter.toString());
+::sax::Converter::convertColor(nColor, aIter.toView());
 rAny <<= nColor;
 break;
 }
diff --git a/vcl/source/image/ImplImageTree.cxx 
b/vcl/source/image/ImplImageTree.cxx
index 4c2e63c57cae..3979206cb184 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -107,10 +107,14 @@ OUString createPath(std::u16string_view name, sal_Int32 
pos, std::u16string_view
 
 OUString getIconCacheUrl(std::u16string_view sVariant, ImageRequestParameters 
const & rParameters)
 {
-OUString sUrl = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" 
SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache/"
-+ rParameters.msStyle + "/" + sVariant + "/" + rParameters.msName;
-rtl::Bootstrap::expandMacros(sUrl);
-return sUrl;
+// the macro expansion can be expensive in bulk, so cache that
+static OUString CACHE_DIR = []()
+{
+OUString sDir = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" 
SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache/";
+rtl::Bootstrap::expandMacros(sDir);
+return sDir;
+}();
+return CACHE_DIR + rParameters.msStyle + "/" + sVariant + "/" + 
rParameters.msName;
 }
 
 OUString createIconCacheUrl(


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source include/LibreOfficeKit include/vcl vcl/unx

2022-04-13 Thread Tor Lillqvist (via logerrit)
 desktop/source/lib/init.cxx|   27 ++---
 include/LibreOfficeKit/LibreOfficeKit.hxx  |4 +++
 include/LibreOfficeKit/LibreOfficeKitInit.h|2 +
 include/vcl/outdev.hxx |4 +--
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |7 ++
 5 files changed, 39 insertions(+), 5 deletions(-)

New commits:
commit cef57d2bfa19d249e1c1721f32640f955a137955
Author: Tor Lillqvist 
AuthorDate: Wed Mar 9 11:33:16 2022 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Apr 13 12:54:33 2022 +0200

Handle "addfont" from Collabora Online

We use the AddTempDevFont() API to add a new font. Sadly there is no
corresponding way to remove such a temporarily added font.

Change-Id: I6fe61919daa5af29e964cec1caf7293aefa8ea4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131250
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3e4265969053..8f991c37f818 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4161,6 +4161,13 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, 
const char *pOption, const c
 else
 sal_detail_set_log_selector(pCurrentSalLogOverride);
 }
+else if (strcmp(pOption, "addfont") == 0)
+{
+OutputDevice *pDevice = Application::GetDefaultDevice();
+OutputDevice::ImplClearAllFontData(true);
+pDevice->AddTempDevFont(OUString::fromUtf8(OString(pValue)), "");
+OutputDevice::ImplRefreshAllFontData(true);
+}
 }
 
 static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* 
pCommand, const char* pArguments, bool bNotifyWhenFinished)
@@ -6528,7 +6535,11 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 
 // What stage are we at ?
 if (pThis == nullptr)
+{
 eStage = PRE_INIT;
+SAL_INFO("lok", "Create libreoffice object");
+gImpl = new LibLibreOffice_Impl();
+}
 else if (bPreInited)
 eStage = SECOND_INIT;
 else
@@ -6815,11 +6826,12 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 SAL_JNI_EXPORT
 LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* 
user_profile_url)
 {
-if (!gImpl)
+static bool alreadyCalled = false;
+
+if (!alreadyCalled)
 {
-SAL_INFO("lok", "Create libreoffice object");
+alreadyCalled = true;
 
-gImpl = new LibLibreOffice_Impl();
 if (!lo_initialize(gImpl, install_path, user_profile_url))
 {
 lo_destroy(gImpl);
@@ -6840,6 +6852,15 @@ int lok_preinit(const char* install_path, const char* 
user_profile_url)
 return lo_initialize(nullptr, install_path, user_profile_url);
 }
 
+SAL_JNI_EXPORT
+int lok_preinit_2(const char* install_path, const char* user_profile_url, 
LibLibreOffice_Impl** kit)
+{
+int result = lo_initialize(nullptr, install_path, user_profile_url);
+if (kit != nullptr)
+*kit = gImpl;
+return result;
+}
+
 static void lo_destroy(LibreOfficeKit* pThis)
 {
 SolarMutexClearableGuard aGuard;
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 2a4a8fd72661..507d1c5202b5 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -1037,6 +1037,10 @@ public:
  * environment variable SAL_LOG is again used as by default. You
  * can switch back and forth as you like.
  *
+ * "addfont": ""
+ *
+ * Adds the font at the URL given.
+ *
  * @param pOption the option name
  * @param pValue its value
  */
diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 8a48bd8392be..b1bfd2b54d7f 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -249,6 +249,8 @@ typedef LibreOfficeKit *(LokHookFunction2)( const char 
*install_path, const char
 
 typedef int (LokHookPreInit)  ( const char *install_path, const 
char *user_profile_url );
 
+typedef int (LokHookPreInit2) ( const char *install_path, const 
char *user_profile_url, LibreOfficeKit** kit);
+
 #if defined(IOS) || defined(ANDROID)
 LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* 
user_profile_path);
 #endif
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index ac5fa932a5b0..06f902388a8b 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1286,10 +1286,10 @@ public:
 
 //drop font data for all outputdevices.
 //If bNewFontLists is true then empty lists of system fonts
-SAL_DLLPRIVATE static void  ImplClearAllFontData( bool bNewFontLists );
+static void  ImplClearAllFontData( bool bNewFontLists );
 //fetch font data for all outputdevices
 //If b

[Libreoffice-commits] core.git: desktop/source include/LibreOfficeKit include/sal include/vcl vcl/unx

2022-04-13 Thread Tor Lillqvist (via logerrit)
 desktop/source/lib/init.cxx|   27 ++---
 include/LibreOfficeKit/LibreOfficeKit.hxx  |4 +++
 include/LibreOfficeKit/LibreOfficeKitInit.h|2 +
 include/sal/log-areas.dox  |1 
 include/vcl/outdev.hxx |4 +--
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |7 ++
 6 files changed, 40 insertions(+), 5 deletions(-)

New commits:
commit 5de22d1e559cd0f1f5fa4e247f0ce153710fbeab
Author: Tor Lillqvist 
AuthorDate: Wed Mar 9 11:33:16 2022 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Apr 13 12:54:04 2022 +0200

Handle "addfont" from Collabora Online

We use the AddTempDevFont() API to add a new font. Sadly there is no
corresponding way to remove such a temporarily added font.

Change-Id: I6fe61919daa5af29e964cec1caf7293aefa8ea4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132948
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 33b763b3a1cb..442297d5d348 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4113,6 +4113,13 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, 
const char *pOption, const c
 else
 sal_detail_set_log_selector(pCurrentSalLogOverride);
 }
+else if (strcmp(pOption, "addfont") == 0)
+{
+OutputDevice *pDevice = Application::GetDefaultDevice();
+OutputDevice::ImplClearAllFontData(true);
+pDevice->AddTempDevFont(OUString::fromUtf8(pValue), "");
+OutputDevice::ImplRefreshAllFontData(true);
+}
 }
 
 static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* 
pCommand, const char* pArguments, bool bNotifyWhenFinished)
@@ -6476,7 +6483,11 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 
 // What stage are we at ?
 if (pThis == nullptr)
+{
 eStage = PRE_INIT;
+SAL_INFO("lok", "Create libreoffice object");
+gImpl = new LibLibreOffice_Impl();
+}
 else if (bPreInited)
 eStage = SECOND_INIT;
 else
@@ -6760,11 +6771,12 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 SAL_JNI_EXPORT
 LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* 
user_profile_url)
 {
-if (!gImpl)
+static bool alreadyCalled = false;
+
+if (!alreadyCalled)
 {
-SAL_INFO("lok", "Create libreoffice object");
+alreadyCalled = true;
 
-gImpl = new LibLibreOffice_Impl();
 if (!lo_initialize(gImpl, install_path, user_profile_url))
 {
 lo_destroy(gImpl);
@@ -6785,6 +6797,15 @@ int lok_preinit(const char* install_path, const char* 
user_profile_url)
 return lo_initialize(nullptr, install_path, user_profile_url);
 }
 
+SAL_JNI_EXPORT
+int lok_preinit_2(const char* install_path, const char* user_profile_url, 
LibLibreOffice_Impl** kit)
+{
+int result = lo_initialize(nullptr, install_path, user_profile_url);
+if (kit != nullptr)
+*kit = gImpl;
+return result;
+}
+
 static void lo_destroy(LibreOfficeKit* pThis)
 {
 SolarMutexClearableGuard aGuard;
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 064caae2729b..912b3e0d2203 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -1036,6 +1036,10 @@ public:
  * environment variable SAL_LOG is again used as by default. You
  * can switch back and forth as you like.
  *
+ * "addfont": ""
+ *
+ * Adds the font at the URL given.
+ *
  * @param pOption the option name
  * @param pValue its value
  */
diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index ccd42863ba25..5bbb722b5b18 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -255,6 +255,8 @@ typedef LibreOfficeKit *(LokHookFunction2)( const char 
*install_path, const char
 
 typedef int (LokHookPreInit)  ( const char *install_path, const 
char *user_profile_url );
 
+typedef int (LokHookPreInit2) ( const char *install_path, const 
char *user_profile_url, LibreOfficeKit** kit);
+
 #if defined(IOS) || defined(ANDROID)
 LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* 
user_profile_path);
 #endif
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index b00d1c1c8236..4e9c3105c844 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -509,6 +509,7 @@ certain functionality.
 @li @c vcl.uitest - The UI testing framework code
 @li @c vcl.unity
 @li @c vcl.unx.dtrans
+@li @c vcl.unx.freetype
 @li @c vcl.unx.print
 @li @c vcl.virdev
 @li @c vcl.watchdog
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index d

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

2022-04-13 Thread Caolán McNamara (via logerrit)
 sc/source/ui/docshell/impex.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3b91c4cdbca6ae02fa8c195ac8a6715ac8dcdf52
Author: Caolán McNamara 
AuthorDate: Tue Apr 12 12:26:54 2022 +0100
Commit: Michael Stahl 
CommitDate: Wed Apr 13 11:25:00 2022 +0200

ofz#46352 assert on bad string offset

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

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 3e257bbcfbc7..5bd8052e0bec 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2340,7 +2340,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
 aFormats.push_back( nKey );
 }
 }
-else if( cTag == 'I' && *p == 'D' )
+else if (cTag == 'I' && *p == 'D' && aLine.getLength() > 4)
 {
 aLine = aLine.copy(4);
 if (aLine == "CALCOOO32")


[Libreoffice-commits] core.git: configure.ac

2022-04-13 Thread xuenhua (via logerrit)
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 64c61aeb6be78bcfe458e72054bcea4792eb40e0
Author: xuenhua 
AuthorDate: Fri Apr 8 23:41:47 2022 +0800
Commit: Julien Nabet 
CommitDate: Wed Apr 13 11:04:23 2022 +0200

Fix the error message for GNU Make version

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

diff --git a/configure.ac b/configure.ac
index 3738349717df..6d992b20ef50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6265,7 +6265,7 @@ _make_longver=`echo $_make_version | $AWK -F. '{ print 
\$1*1+\$2*100+\$3 }'`
 if test "$_make_longver" -ge "038200"; then
 AC_MSG_RESULT([$GNUMAKE $_make_version])
 else
-AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
+AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
 fi
 
 # find if gnumake support file function


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

2022-04-13 Thread Mike Kaganski (via logerrit)
 sfx2/source/bastyp/fltfnc.cxx |   27 +--
 1 file changed, 13 insertions(+), 14 deletions(-)

New commits:
commit b210c45d19e8791402d1f3aa9b3bb5bcd6c95f79
Author: Mike Kaganski 
AuthorDate: Wed Apr 13 07:49:32 2022 +0100
Commit: Mike Kaganski 
CommitDate: Wed Apr 13 10:34:07 2022 +0200

Move extension preparation out of the loop

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

diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index d554d8e9652d..942109db2699 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -652,23 +652,22 @@ std::shared_ptr 
SfxFilterMatcher::GetFilter4Extension( const OU
 {
 if ( m_rImpl.pList )
 {
-for (const std::shared_ptr& pFilter : *m_rImpl.pList)
+if (OUString sExt = ToUpper_Impl(rExt); !sExt.isEmpty())
 {
-SfxFilterFlags nFlags = pFilter->GetFilterFlags();
-if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) )
-{
-OUString sWildCard = ToUpper_Impl( 
pFilter->GetWildcard().getGlob() );
-OUString sExt  = ToUpper_Impl( rExt );
-
-if (sExt.isEmpty())
-continue;
+if (sExt[0] != '.')
+sExt = "." + sExt;
 
-if (sExt[0] != '.')
-sExt = "." + sExt;
+for (const std::shared_ptr& pFilter : 
*m_rImpl.pList)
+{
+SfxFilterFlags nFlags = pFilter->GetFilterFlags();
+if ((nFlags & nMust) == nMust && !(nFlags & nDont))
+{
+OUString sWildCard = 
ToUpper_Impl(pFilter->GetWildcard().getGlob());
 
-WildCard aCheck(sWildCard, ';');
-if (aCheck.Matches(sExt))
-return pFilter;
+WildCard aCheck(sWildCard, ';');
+if (aCheck.Matches(sExt))
+return pFilter;
+}
 }
 }
 


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

2022-04-13 Thread Caolán McNamara (via logerrit)
 sc/source/ui/docshell/impex.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f34a205e60846c91bcd22116c9e6e667ebb1e515
Author: Caolán McNamara 
AuthorDate: Tue Apr 12 12:26:54 2022 +0100
Commit: Xisco Fauli 
CommitDate: Wed Apr 13 10:29:52 2022 +0200

ofz#46352 assert on bad string offset

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

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 260db563e203..a2360eb494c9 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2206,7 +2206,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
 aFormats.push_back( nKey );
 }
 }
-else if( cTag == 'I' && *p == 'D' )
+else if (cTag == 'I' && *p == 'D' && aLine.getLength() > 4)
 {
 aLine = aLine.copy(4);
 if (aLine == "CALCOOO32")


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

2022-04-13 Thread Justin Luth (via logerrit)
 sw/qa/extras/ww8export/data/tdf148380_createField.doc |binary
 sw/qa/extras/ww8export/ww8export3.cxx |   13 +
 sw/source/filter/ww8/ww8atr.cxx   |3 +--
 sw/source/filter/ww8/ww8par5.cxx  |   11 ++-
 4 files changed, 20 insertions(+), 7 deletions(-)

New commits:
commit 55c7691fadfb9b3a4869cc14432ec57c858f693f
Author: Justin Luth 
AuthorDate: Wed Apr 6 11:44:34 2022 +0200
Commit: Miklos Vajna 
CommitDate: Wed Apr 13 09:57:33 2022 +0200

tdf#148380 doc: Import AUTHOR/CREATEDATE as FIXEDFLD

Writerfilter already did this earlier in the patch set.
So now change DOC format to do all the same things.

Change-Id: I8db2b4e3fc227b73c4d075ee624117e1b1f1d92e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132663
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/ww8export/data/tdf148380_createField.doc 
b/sw/qa/extras/ww8export/data/tdf148380_createField.doc
new file mode 100644
index ..79c5e59c5ecd
Binary files /dev/null and 
b/sw/qa/extras/ww8export/data/tdf148380_createField.doc differ
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx 
b/sw/qa/extras/ww8export/ww8export3.cxx
index de913f30c451..5f0bf54078cd 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -119,6 +119,19 @@ DECLARE_WW8EXPORT_TEST(testTdf147861_customField, 
"tdf147861_customField.doc")
 CPPUNIT_ASSERT_EQUAL(OUString("DocInformation:Title (fixed)"), 
xField->getPresentation(true));
 }
 
+DECLARE_WW8EXPORT_TEST(testTdf148380_createField, "tdf148380_createField.doc")
+{
+// Verify that these are fields, and not just plain text
+uno::Reference xTextFieldsSupplier(mxComponent, 
uno::UNO_QUERY);
+auto xFieldsAccess(xTextFieldsSupplier->getTextFields());
+uno::Reference 
xFields(xFieldsAccess->createEnumeration());
+uno::Reference xField(xFields->nextElement(), 
uno::UNO_QUERY);
+// This should NOT be "Lorenzo Chavez", or a real date since the user 
hand-modified the result.
+CPPUNIT_ASSERT_EQUAL(OUString("Myself - that's who"), 
xField->getPresentation(false));
+xField.set(xFields->nextElement(), uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("yesterday at noon"), 
xField->getPresentation(false));
+}
+
 DECLARE_WW8EXPORT_TEST(testTdf138345_paraCharHighlight, 
"tdf138345_paraCharHighlight.doc")
 {
 uno::Reference xRun(getRun(getParagraph(9), 1, "A 
side benefit is that "), uno::UNO_QUERY_THROW);
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 032c302460c6..551152e875f8 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2939,8 +2939,7 @@ void AttributeOutputBase::TextField( const SwFormatField& 
rField )
 eField = ww::eCREATEDATE;
 
 // Create author/time are always imported as fixed. Safe 
to ignore on export
-if (GetExport().GetExportFormat() != MSWordExportBase::DOC)
-bWriteExpand = false;
+bWriteExpand = false;
 break;
 
 case DI_CHANGE:
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index fd19f6c11630..1029e98fabe7 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -1714,7 +1714,7 @@ eF_ResT SwWW8ImplReader::Read_F_DocInfo( WW8FieldDesc* 
pF, OUString& rStr )
 nReg = DI_SUB_AUTHOR;
 break;
 case 21:
-nSub = DI_CREATE;
+nSub = DI_CREATE | DI_SUB_FIXED;
 nReg = DI_SUB_DATE;
 bDateTime = true;
 break;
@@ -1790,8 +1790,9 @@ eF_ResT SwWW8ImplReader::Read_F_DocInfo( WW8FieldDesc* 
pF, OUString& rStr )
 aData = aData.replaceAll("\"", "");
 }
 
-SwDocInfoField aField( static_cast(
-m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( SwFieldIds::DocInfo 
)), nSub|nReg, aData, nFormat );
+const auto pType(static_cast(
+
m_rDoc.getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::DocInfo)));
+SwDocInfoField aField(pType, nSub|nReg, aData, GetFieldResult(pF), 
nFormat);
 if (bDateTime)
 ForceFieldLanguage(aField, nLang);
 m_rDoc.getIDocumentContentOperations().InsertPoolItem(*m_pPaM, 
SwFormatField(aField));
@@ -1799,12 +1800,12 @@ eF_ResT SwWW8ImplReader::Read_F_DocInfo( WW8FieldDesc* 
pF, OUString& rStr )
 return eF_ResT::OK;
 }
 
-eF_ResT SwWW8ImplReader::Read_F_Author( WW8FieldDesc*, OUString& )
+eF_ResT SwWW8ImplReader::Read_F_Author(WW8FieldDesc* pF, OUString&)
 {
 // SH: The SwAuthorField refers not to the original author but to the 
current user, better use DocInfo
 SwDocInfoField aField( static_cast(
  m_rDoc.getIDocumentFieldsAccess().GetSysFieldType( 
SwFieldIds::DocInfo )),
- DI_CREAT

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

2022-04-13 Thread Miklos Vajna (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |   19 +--
 sw/source/filter/ww8/docxattributeoutput.hxx |3 ++-
 2 files changed, 19 insertions(+), 3 deletions(-)

New commits:
commit ada2d449175afd9a6aa1db9281739e5ad6ac6fef
Author: Miklos Vajna 
AuthorDate: Wed Apr 13 08:34:33 2022 +0200
Commit: Miklos Vajna 
CommitDate: Wed Apr 13 09:54:04 2022 +0200

sw content controls, DOCX export: handle SDT end at para end

Once the DOCX import maps Run SDTs to SwContentControl,

make -C sw -sr CppunitTest_sw_ooxmlexport17 
CPPUNIT_TEST_NAME=testTdf148361

starts to fail without this fix. Previously we only tested
SwContentControl end in the middle of a paragraph. Fix the paragraph end
case similar to how hyperlinks are handled to be consistent.

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 847888dfba75..bf120d3e47a9 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -367,7 +367,10 @@ void DocxAttributeOutput::StartContentControl(const 
SwFormatContentControl& rFor
 m_pContentControl = rFormatContentControl.GetContentControl();
 }
 
-void DocxAttributeOutput::EndContentControl() { ++m_nCloseContentControl; }
+void DocxAttributeOutput::EndContentControl()
+{
+++m_nCloseContentControlInThisRun;
+}
 
 static void checkAndWriteFloatingTables(DocxAttributeOutput& 
rDocxAttributeOutput)
 {
@@ -1628,8 +1631,9 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, 
sal_Int32 nPos, bool /
 m_bEndCharSdt = false;
 }
 
-for (; m_nCloseContentControl > 0; --m_nCloseContentControl)
+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);
 }
@@ -1854,6 +1858,13 @@ void DocxAttributeOutput::EndRun(const SwTextNode* 
pNode, sal_Int32 nPos, bool /
 m_pRedlineData = nullptr;
 }
 
+for (; m_nCloseContentControlInThisRun > 0; 
--m_nCloseContentControlInThisRun)
+{
+// Last run of this paragraph.
+m_pSerializer->endElementNS(XML_w, XML_sdtContent);
+m_pSerializer->endElementNS(XML_w, XML_sdt);
+}
+
 if ( m_closeHyperlinkInThisRun )
 {
 if ( m_startedHyperlink )
@@ -3259,6 +3270,10 @@ void DocxAttributeOutput::RunText( const OUString& 
rText, rtl_TextEncoding /*eCh
 {
 m_closeHyperlinkInPreviousRun = true;
 }
+if (m_nCloseContentControlInThisRun > 0)
+{
+++m_nCloseContentControlInPreviousRun;
+}
 m_bRunTextIsOn = true;
 // one text can be split into more blah's by line breaks etc.
 const sal_Unicode *pBegin = rText.getStr();
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx 
b/sw/source/filter/ww8/docxattributeoutput.hxx
index 4b4be1ca6160..00549f5d8beb 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -911,7 +911,8 @@ private:
 o3tl::sorted_vector m_aFloatingTablesOfParagraph;
 sal_Int32 m_nTextFrameLevel;
 
-sal_Int32 m_nCloseContentControl = 0;
+sal_Int32 m_nCloseContentControlInThisRun = 0;
+sal_Int32 m_nCloseContentControlInPreviousRun = 0;
 
 // close of hyperlink needed
 bool m_closeHyperlinkInThisRun;


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

2022-04-13 Thread Stephan Bergmann (via logerrit)
 include/rtl/strbuf.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 634990f32c354dd7690b6ae44b19a94c9f19ffc4
Author: Stephan Bergmann 
AuthorDate: Wed Apr 13 08:10:55 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Apr 13 09:47:11 2022 +0200

Fix copy/paste typo in comment

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

diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx
index 5c8080466365..7434b2f653a8 100644
--- a/include/rtl/strbuf.hxx
+++ b/include/rtl/strbuf.hxx
@@ -1068,7 +1068,7 @@ public:
 
 This function should be used with care.  After you have called this
 function, you may use the returned pInternalData and pInternalCapacity
-only as long as you make no other calls on this OUStringBuffer.
+only as long as you make no other calls on this OStringBuffer.
 
 @param pInternalData
 This output parameter receives a pointer to the internal data


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

2022-04-13 Thread Szymon Kłos (via logerrit)
 sc/source/ui/cctrl/checklistmenu.cxx |4 -
 vcl/inc/jsdialog/jsdialogbuilder.hxx |5 --
 vcl/jsdialog/enabled.cxx |5 +-
 vcl/jsdialog/jsdialogbuilder.cxx |   78 ++-
 vcl/source/window/builder.cxx|6 --
 5 files changed, 27 insertions(+), 71 deletions(-)

New commits:
commit b632135072090bd241caee25814a07d7c8c36d00
Author: Szymon Kłos 
AuthorDate: Mon Apr 4 11:30:33 2022 +0200
Commit: Szymon Kłos 
CommitDate: Wed Apr 13 09:19:30 2022 +0200

jsdialog: reenable after welding, unify with dialogs

Change-Id: I4a589f68fcdaa1c62ac08bd6075071d0fed0b28b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132538
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mert Tumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132915
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 60a89b6aeac3..b1e2f5ca1644 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -330,10 +330,6 @@ void ScCheckListMenuControl::launchSubMenu()
 
 mxMenu->select(*mxScratchIter);
 pSubMenu->GrabFocus();
-
-// TODO: still needed?
-//if (comphelper::LibreOfficeKit::isActive())
-//jsdialog::SendFullUpdate(std::to_string(pSubMenu->GetLOKWindowId()), 
"toggle_all");
 }
 
 IMPL_LINK_NOARG(ScCheckListMenuControl, PostPopdownHdl, void*, void)
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 7aac0d4e25dd..e0232e32f241 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -242,8 +242,6 @@ public:
 JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const 
OUString& rUIFile,
   const css::uno::Reference& rFrame,
   sal_uInt64 nWindowId = 0);
-/// for autofilter dropdown
-JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const 
OUString& rUIFile);
 
 static std::unique_ptr
 CreateDialogBuilder(weld::Widget* pParent, const OUString& rUIRoot, const 
OUString& rUIFile);
@@ -251,9 +249,6 @@ public:
 CreateNotebookbarBuilder(vcl::Window* pParent, const OUString& rUIRoot, 
const OUString& rUIFile,
  const css::uno::Reference& 
rFrame,
  sal_uInt64 nWindowId = 0);
-static std::unique_ptr
-CreateAutofilterWindowBuilder(vcl::Window* pParent, const OUString& 
rUIRoot,
-  const OUString& rUIFile);
 static std::unique_ptr 
CreateSidebarBuilder(weld::Widget* pParent,
const 
OUString& rUIRoot,
const 
OUString& rUIFile,
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 100741447b6e..a37d77602766 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -90,8 +90,9 @@ bool isBuilderEnabledForPopup(std::u16string_view rUIFile)
 || rUIFile == u"svx/ui/floatinglineend.ui"
 || rUIFile == u"svx/ui/fontworkalignmentcontrol.ui"
 || rUIFile == u"svx/ui/fontworkcharacterspacingcontrol.ui"
-|| rUIFile == u"svx/ui/floatingareastyle.ui"
-|| rUIFile == u"modules/scalc/ui/filterlist.ui")
+|| rUIFile == u"svx/ui/floatingareastyle.ui" || rUIFile == 
u"modules/scalc/ui/filterlist.ui"
+|| rUIFile == u"modules/scalc/ui/filterdropdown.ui"
+|| rUIFile == u"modules/scalc/ui/filtersubdropdown.ui")
 return true;
 
 return false;
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 7854e81360fe..778b174bde21 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -137,26 +137,6 @@ std::unique_ptr 
JSDialogNotifyIdle::generateFullUpdate() cons
 aJsonWriter->put("id", m_aNotifierWindow->GetLOKWindowId());
 aJsonWriter->put("jsontype", m_sTypeOfJSON);
 
-if (m_sTypeOfJSON == "autofilter")
-{
-vcl::Window* pWindow = m_aContentWindow.get();
-DockingWindow* pDockingWindow = dynamic_cast(pWindow);
-while (pWindow && !pDockingWindow)
-{
-pWindow = pWindow->GetParent();
-pDockingWindow = dynamic_cast(pWindow);
-}
-
-if (pDockingWindow)
-{
-Point aPos = pDockingWindow->GetFloatingPos();
-aJsonWriter->put("posx", aPos.getX());
-aJsonWriter->put("posy", aPos.getY());
-if (!pDockingWindow->IsVisible())
-aJsonWriter->put("visible", "false");
-}
-}
-
 return aJsonWriter;
 }
 
@@ -231,7 +211,27 @@ 
JSDialogNotifyIdle::generatePopupMessage(VclPtr pWindow, OUString s
 }
 }
 
-aJsonWriter->put("jsontype", "dialog");
+if (m_sTypeOfJSON == "autofilter")
+{
+v