[Libreoffice-commits] core.git: compilerplugins/clang include/rtl sal/osl sal/rtl vcl/source

2022-04-14 Thread Stephan Bergmann (via logerrit)
 compilerplugins/clang/implicitboolconversion.cxx  |   21 +-
 compilerplugins/clang/test/implicitboolconversion.cxx |3 
 include/rtl/uri.hxx   |   41 
 sal/osl/unx/file_url.cxx  |   23 --
 sal/rtl/uri.cxx   |  159 ++
 vcl/source/treelist/transfer.cxx  |   17 -
 6 files changed, 91 insertions(+), 173 deletions(-)

New commits:
commit 6a9f342addf8b1c766163575c7b63e7fcc1f714e
Author: Stephan Bergmann 
AuthorDate: Thu Apr 14 23:09:41 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 15 08:39:21 2022 +0200

Introduce rtl::createUriCharClass

...to make those char class array initializations more readable.  (Making 
the
corresponding variables constexpr is mostly done so that failures in the
provided `unencoded` arguments, like non-ASCII characters or duplicate
character typos, would lead to compile-time errors also for 
!HAVE_CPP_CONSTEVAL.
And assigning to a sal_Bool std::array needs another hack to avoid false
loplugin:implicitboolconversion warnings.)

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

diff --git a/compilerplugins/clang/implicitboolconversion.cxx 
b/compilerplugins/clang/implicitboolconversion.cxx
index d0bdff190807..29b82d8eae25 100644
--- a/compilerplugins/clang/implicitboolconversion.cxx
+++ b/compilerplugins/clang/implicitboolconversion.cxx
@@ -179,16 +179,23 @@ bool isBoolExpr(Expr const * expr) {
 (void)op;
 TemplateDecl const * d
 = t->getTemplateName().getAsTemplateDecl();
-if (d == nullptr
-|| 
!loplugin::DeclCheck(d->getTemplatedDecl()).Class("Sequence")
-
.Namespace("uno").Namespace("star").Namespace("sun").Namespace("com")
-.GlobalNamespace()
-|| t->getNumArgs() != 1
-|| t->getArg(0).getKind() != TemplateArgument::Type)
+if (d == nullptr) {
+break;
+}
+auto const dc = loplugin::DeclCheck(d->getTemplatedDecl());
+if (dc.ClassOrStruct("array").StdNamespace() && 
t->getNumArgs() >= 2
+   && t->getArg(0).getKind() == TemplateArgument::Type)
 {
+ty = t->getArg(0).getAsType();
+} else if 
(dc.Class("Sequence").Namespace("uno").Namespace("star").Namespace("sun")
+   .Namespace("com").GlobalNamespace()
+   && t->getNumArgs() == 1
+   && t->getArg(0).getKind() == TemplateArgument::Type)
+{
+ty = t->getArg(0).getAsType();
+} else {
 break;
 }
-ty = t->getArg(0).getAsType();
 }
 stack.pop();
 if (stack.empty()) {
diff --git a/compilerplugins/clang/test/implicitboolconversion.cxx 
b/compilerplugins/clang/test/implicitboolconversion.cxx
index fa5a2b84b905..122ee363ae68 100644
--- a/compilerplugins/clang/test/implicitboolconversion.cxx
+++ b/compilerplugins/clang/test/implicitboolconversion.cxx
@@ -9,6 +9,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -75,6 +76,8 @@ void f()
 h(w1.element);
 css::uno::Sequence s7(1);
 h(s7[0]);
+std::array s8;
+s8[0] = false;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/include/rtl/uri.hxx b/include/rtl/uri.hxx
index 0ab1726dab99..1b2601e7d1d1 100644
--- a/include/rtl/uri.hxx
+++ b/include/rtl/uri.hxx
@@ -30,6 +30,14 @@
 #include "rtl/ustring.hxx"
 #include "sal/types.h"
 
+#if defined LIBO_INTERNAL_ONLY
+#include 
+#include 
+#include 
+#include 
+#include "config_global.h"
+#endif
+
 namespace rtl {
 
 /** A wrapper around the C functions from .
@@ -131,6 +139,39 @@ inline rtl::OUString Uri::convertRelToAbs(rtl::OUString 
const & rBaseUriRef,
 return aResult;
 }
 
+#if defined LIBO_INTERNAL_ONLY
+
+constexpr std::size_t UriCharClassSize = 128;
+
+// Create a char class (for use with rtl_uriEncode and rtl::Uri::encode), 
represented as a
+// compile-time std::array, from an UTF-8 string literal.
+//
+// The given `unencoded` lists each ASCII character once that shall not be 
encoded.  (It uses an
+// UTF-8 string type to emphasize that its characters' values are always 
interpreted as ASCII
+// values.)
+#if HAVE_CPP_CONSTEVAL
+consteval
+#else
+constexpr
+#endif
+auto createUriCharClass(
+#if defined __cpp_lib_char8_t
+std::u8string_view
+#else
+std::string_view
+#endif
+unencoded)
+{
+std::array a = {};
+for (auto c: unencoded) {
+assert(!a[c]); // would presumably ind

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

2022-04-14 Thread Stephan Bergmann (via logerrit)
 include/o3tl/string_view.hxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit d7480ed72d225ee1b2b9a6ec996eeeb7a18c98a8
Author: Stephan Bergmann 
AuthorDate: Thu Apr 14 23:05:42 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 15 08:39:01 2022 +0200

Add some clarifying comments for o3tl::getToken overloads

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

diff --git a/include/o3tl/string_view.hxx b/include/o3tl/string_view.hxx
index 903cc5ced758..2438500768fe 100644
--- a/include/o3tl/string_view.hxx
+++ b/include/o3tl/string_view.hxx
@@ -74,6 +74,11 @@ inline std::basic_string_view 
getToken(std::basic_string_view(sv, delimiter, position);
@@ -133,6 +138,9 @@ inline std::basic_string_view 
getToken(std::basic_string_view();
 }
+// The following two overloads prevent deduction failures that would occur 
with their template
+// counterpart, when sv is of a type that is implicitly convertible to 
basic_string_view (like
+// OString or OUString):
 inline std::string_view getToken(std::string_view sv, sal_Int32 nToken, char 
cTok,
  sal_Int32& rnIndex)
 {


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

2022-04-14 Thread Stephan Bergmann (via logerrit)
 basic/source/runtime/dllmgr-x64.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit f23f594b17a2b117e0940ecff86b878955bf6e3e
Author: Stephan Bergmann 
AuthorDate: Thu Apr 14 23:03:16 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 15 08:38:43 2022 +0200

loplugin:stringviewparam

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

diff --git a/basic/source/runtime/dllmgr-x64.cxx 
b/basic/source/runtime/dllmgr-x64.cxx
index 82d909398a77..0a3d334ce49d 100644
--- a/basic/source/runtime/dllmgr-x64.cxx
+++ b/basic/source/runtime/dllmgr-x64.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -483,7 +484,7 @@ struct ProcData {
 };
 
 ErrCode call(
-OUString const & dll, ProcData const & proc, SbxArray * arguments,
+std::u16string_view dll, ProcData const & proc, SbxArray * arguments,
 SbxVariable & result)
 {
 if (arguments && arguments->Count() > 20)
@@ -497,7 +498,7 @@ ErrCode call(
 // requires special handling in unmarshalString; other functions might
 // require similar treatment, too:
 bool special =
-dll.equalsIgnoreAsciiCase("KERNEL32.DLL") &&
+o3tl::equalsIgnoreAsciiCase(dll, u"KERNEL32.DLL") &&
 (proc.name == "GetLogicalDriveStringsA");
 for (sal_uInt32 i = 1; i < (arguments == nullptr ? 0 : 
arguments->Count()); ++i)
 {


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

2022-04-14 Thread Stephan Bergmann (via logerrit)
 vcl/win/dtrans/ftransl.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 6457b72667de2a203e25a18b0f58cde67d41bbf4
Author: Stephan Bergmann 
AuthorDate: Thu Apr 14 23:01:05 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 15 08:38:25 2022 +0200

loplugin:stringviewparam

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

diff --git a/vcl/win/dtrans/ftransl.cxx b/vcl/win/dtrans/ftransl.cxx
index 2d5ecd492754..ad41a95b0ae2 100644
--- a/vcl/win/dtrans/ftransl.cxx
+++ b/vcl/win/dtrans/ftransl.cxx
@@ -17,6 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+
+#include 
+
+#include 
 #include 
 
 #include "ftransl.hxx"
@@ -418,9 +423,9 @@ void findStdFormatIdOrNativeFormatNameForFullMediaType(
 }
 }
 
-bool isTextPlainMediaType( const OUString& fullMediaType )
+bool isTextPlainMediaType( std::u16string_view fullMediaType )
 {
-return fullMediaType.equalsIgnoreAsciiCase("text/plain");
+return o3tl::equalsIgnoreAsciiCase(fullMediaType, u"text/plain");
 }
 
 DataFlavor mkDataFlv(const OUString& cnttype, const OUString& hpname, Type 
dtype)


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

2022-04-14 Thread Stephan Bergmann (via logerrit)
 shell/source/win32/SysShExec.cxx |   17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit dcd969ba5237e897c5767854df30f31fc8b4ee32
Author: Stephan Bergmann 
AuthorDate: Thu Apr 14 23:00:06 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 15 08:38:07 2022 +0200

loplugin:stringviewparam

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

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index d01c01f839ea..066b818abe92 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -19,6 +19,8 @@
 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -34,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -166,12 +169,12 @@ CSysShExec::~CSysShExec()
 
 namespace
 {
-bool checkExtension(OUString const & extension, OUString const & denylist) {
-assert(!extension.isEmpty());
-for (sal_Int32 i = 0; i != -1;) {
-OUString tok = denylist.getToken(0, ';', i);
-tok.startsWith(".", &tok);
-if (extension.equalsIgnoreAsciiCase(tok)) {
+bool checkExtension(std::u16string_view extension, std::u16string_view 
denylist) {
+assert(!extension.empty());
+for (std::size_t i = 0; i != std::u16string_view::npos;) {
+std::u16string_view tok = o3tl::getToken(denylist, ';', i);
+o3tl::starts_with(tok, u'.', &tok);
+if (o3tl::equalsIgnoreAsciiCase(extension, tok)) {
 return false;
 }
 }
@@ -343,7 +346,7 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 if (!(checkExtension(ext, env)
   && checkExtension(
   ext,
-  
".ADE;.ADP;.APK;.APPLICATION;.APPX;.APPXBUNDLE;.BAT;.CAB;.CHM;.CLASS;"
+  
u".ADE;.ADP;.APK;.APPLICATION;.APPX;.APPXBUNDLE;.BAT;.CAB;.CHM;.CLASS;"
   
".CMD;.COM;.CPL;.DLL;.DMG;.EX;.EX_;.EXE;.GADGET;.HTA;.INF;.INS;.IPA;"
   
".ISO;.ISP;.JAR;.JS;.JSE;.LIB;.LNK;.MDE;.MSC;.MSH;.MSH1;.MSH2;.MSHXML;"
   
".MSH1XML;.MSH2XML;.MSI;.MSIX;.MSIXBUNDLE;.MSP;.MST;.NSH;.PIF;.PS1;"


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

2022-04-14 Thread Mike Kaganski (via logerrit)
 vcl/win/gdi/salprn.cxx |   29 +
 1 file changed, 5 insertions(+), 24 deletions(-)

New commits:
commit a8383345174d91f6e722128e1d53c9a4ebc18195
Author: Mike Kaganski 
AuthorDate: Thu Apr 14 14:41:33 2022 +0100
Commit: Mike Kaganski 
CommitDate: Fri Apr 15 07:06:57 2022 +0200

No Win16-style WIN.INI since Windows Vista

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

diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx
index 835c571785a6..724c4f18e2e1 100644
--- a/vcl/win/gdi/salprn.cxx
+++ b/vcl/win/gdi/salprn.cxx
@@ -22,6 +22,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -224,31 +225,11 @@ OUString WinSalInstance::GetDefaultPrinter()
 GetDefaultPrinterW( nullptr, &nChars );
 if( nChars )
 {
-LPWSTR  pStr = static_cast(std::malloc(nChars*sizeof(WCHAR)));
-OUString aDefPrt;
-if( GetDefaultPrinterW( pStr, &nChars ) )
-{
-aDefPrt = o3tl::toU(pStr);
-}
-std::free( pStr );
-if( !aDefPrt.isEmpty() )
-return aDefPrt;
-}
-
-// get default printer from win.ini
-wchar_t szBuffer[256];
-GetProfileStringW( aImplWindows, aImplDevice, L"", szBuffer, 
SAL_N_ELEMENTS( szBuffer ) );
-if ( szBuffer[0] )
-{
-// search for printer name
-wchar_t* pBuf = szBuffer;
-wchar_t* pTmp = pBuf;
-while ( *pTmp && (*pTmp != ',') )
-pTmp++;
-return OUString( o3tl::toU(pBuf), static_cast(pTmp-pBuf) );
+std::vector pStr(nChars);
+if (GetDefaultPrinterW(pStr.data(), &nChars))
+return OUString(o3tl::toU(pStr.data()));
 }
-else
-return OUString();
+return OUString();
 }
 
 static DWORD ImplDeviceCaps( WinSalInfoPrinter const * pPrinter, WORD nCaps,


[Libreoffice-commits] core.git: include/vcl officecfg/registry sc/inc sc/Library_sc.mk sc/sdi sc/source sc/uiconfig sc/UIConfig_scalc.mk svx/source vcl/source

2022-04-14 Thread Tomaž Vajngerl (via logerrit)
 include/vcl/EnumContext.hxx|1 
 officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu   |5 
 officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs |2 
 sc/Library_sc.mk   |1 
 sc/UIConfig_scalc.mk   |1 
 sc/inc/document.hxx|8 
 sc/inc/shellids.hxx|1 
 sc/sdi/SparklineShell.sdi  |   17 ++
 sc/sdi/scslots.sdi |1 
 sc/source/ui/app/scdll.cxx |2 
 sc/source/ui/inc/SparklineShell.hxx|   40 
 sc/source/ui/inc/tabvwsh.hxx   |6 
 sc/source/ui/view/SparklineShell.cxx   |   54 ++
 sc/source/ui/view/tabview3.cxx |   13 +
 sc/source/ui/view/tabvwsh4.cxx |   42 -
 sc/uiconfig/scalc/popupmenu/sparkline.xml  |   81 
++
 svx/source/sidebar/paragraph/ParaPropertyPanel.cxx |1 
 vcl/source/window/EnumContext.cxx  |1 
 18 files changed, 269 insertions(+), 8 deletions(-)

New commits:
commit e1f3f2e00c37173e5f6f1cbb5235ab95b100bde7
Author: Tomaž Vajngerl 
AuthorDate: Fri Apr 15 00:55:54 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Apr 15 02:49:00 2022 +0200

sc: introduce SparklineShell and Sparkline context

Having a separate sparkline context is very useful, so we can add
a custom UI when the user has the cursor over a sparkline. This
will allow a "Sparkline" tab for NotebookBar and its own deck in
Sidebar, activated only when the sparkline is present. Also the
pop-up menu can be customized specifically for the sparkline, but
this may be less useful.

For the sparkline context we need a custom shell - SparklineShell
where now all the UNO commands can be implemented (not done in
this commit).

Change-Id: Idca2ad946af3afdd1b494744b80c9c093eec602c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133022
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/EnumContext.hxx b/include/vcl/EnumContext.hxx
index 639a427a138a..dec5711b6ba5 100644
--- a/include/vcl/EnumContext.hxx
+++ b/include/vcl/EnumContext.hxx
@@ -96,6 +96,7 @@ public:
 Text,
 TextObject,
 Trendline,
+Sparkline,
 
 // Default context of an application.  Do we need this?
 Default,
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index ad61ee9033d6..c64da92d8789 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -337,6 +337,7 @@
 Calc, default,visible;
 Calc, EditCell,   visible;
 Calc, Pivot,  visible;
+Calc, Sparkline,  visible;
   
 
 
@@ -372,6 +373,7 @@
 Calc, DrawLine,   hidden ;
 Calc, EditCell,   visible;
 Calc, Pivot,  visible,  .uno:CellTextDlg ;
+Calc, Sparkline,  visible;
 DrawImpress,  Draw,   hidden ;
 DrawImpress,  DrawFontwork,   hidden ;
 DrawImpress,  DrawText,   visible;
@@ -1205,6 +1207,7 @@
 Calc,  default,  visible ;
 Calc,  EditCell, visible ;
 Calc,  Pivot,visible ;
+Calc,  Sparkline, visible ;
   
 
 
@@ -1238,6 +1241,7 @@
 Calc,  EditCell, visible ;
 Calc,  default,  visible ;
 Calc,  Pivot,visible ;
+Calc,  Sparkline, visible ;
   
 
 
@@ -1271,6 +1275,7 @@
 Calc,  EditCell, visible ;
 Calc,  default,  visible ;
 Calc,  Pivot,visible ;
+Calc,  Sparkline, visible ;
   
 
 
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs 
b/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs
index 53ad678e3574..1eb7007d3008 100644
--- a/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs
@@ -109,7 +109,7 @@
   2  Context na

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

2022-04-14 Thread Eike Rathke (via logerrit)
 chart2/source/tools/DiagramHelper.cxx |2 -
 include/svl/numformat.hxx |   11 +++--
 sc/source/core/data/column3.cxx   |4 +--
 svl/source/numbers/zforlist.cxx   |   40 ++
 4 files changed, 34 insertions(+), 23 deletions(-)

New commits:
commit abe0080d66fe81013d92bbc3521980e049640f6d
Author: Eike Rathke 
AuthorDate: Thu Apr 14 18:23:04 2022 +0200
Commit: Eike Rathke 
CommitDate: Fri Apr 15 01:40:05 2022 +0200

Prepare SvNumberFormatter::GetEditFormat() to obtain for another locale

Change-Id: Iab8b9a802ebac60b52007754430352d3de925374
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133026
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/chart2/source/tools/DiagramHelper.cxx 
b/chart2/source/tools/DiagramHelper.cxx
index f1021442f617..51bcd4cf9f0c 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -1061,7 +1061,7 @@ sal_Int32 DiagramHelper::getDateTimeInputNumberFormat( 
const Reference< util::XN
 // Obtain best matching date, time or datetime format.
 nRet = pNumFormatter->GuessDateTimeFormat( nType, fNumber, 
LANGUAGE_SYSTEM);
 // Obtain the corresponding edit format.
-nRet = pNumFormatter->GetEditFormat( fNumber, nRet, nType, 
LANGUAGE_SYSTEM, nullptr);
+nRet = pNumFormatter->GetEditFormat( fNumber, nRet, nType, nullptr);
 }
 return nRet;
 }
diff --git a/include/svl/numformat.hxx b/include/svl/numformat.hxx
index e002349b2dad..9cdb414346c5 100644
--- a/include/svl/numformat.hxx
+++ b/include/svl/numformat.hxx
@@ -306,9 +306,16 @@ public:
 should not be used otherwise. */
 sal_uInt32 GuessDateTimeFormat(SvNumFormatType& rType, double fNumber, 
LanguageType eLnge);
 
-/** Return the corresponding edit format of a format. */
+/** Return the corresponding edit format of a format.
+
+nFIndex, eType and pFormat (if not nullptr) are assumed to match each
+other / be of one format. The locale to use is obtained from pFormat,
+if nullptr then LANGUAGE_SYSTEM is used. This can be overriden by
+specifying eForLocale other than LANGUAGE_DONTKNOW.
+ */
 sal_uInt32 GetEditFormat(double fNumber, sal_uInt32 nFIndex, 
SvNumFormatType eType,
- LanguageType eLnge, SvNumberformat const* 
pFormat);
+ SvNumberformat const* pFormat,
+ LanguageType eForLocale = LANGUAGE_DONTKNOW);
 
 /// Return the reference date
 const Date& GetNullDate() const;
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 56aff45386b5..8d5a9363a02a 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2064,8 +2064,8 @@ bool ScColumn::ParseString(
 bForceFormatDate = false;
 else
 {
-nIndex = aParam.mpNumFormatter->GetEditFormat( 
aCell.getValue(), nOldIndex, eNumFormatType,
-pOldFormat->GetLanguage(), pOldFormat);
+nIndex = aParam.mpNumFormatter->GetEditFormat(
+aCell.getValue(), nOldIndex, 
eNumFormatType, pOldFormat);
 eEvalDateFormat = 
aParam.mpNumFormatter->GetEvalDateFormat();
 aParam.mpNumFormatter->SetEvalDateFormat( 
NF_EVALDATEFORMAT_FORMAT_INTL);
 }
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 8606a4a24226..1ea60fc81784 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1594,10 +1594,14 @@ sal_uInt32 SvNumberFormatter::GuessDateTimeFormat( 
SvNumFormatType& rType, doubl
 }
 
 sal_uInt32 SvNumberFormatter::GetEditFormat( double fNumber, sal_uInt32 
nFIndex,
- SvNumFormatType eType, 
LanguageType eLang,
- SvNumberformat const * pFormat )
+ SvNumFormatType eType,
+ SvNumberformat const * pFormat,
+ LanguageType eForLocale )
 {
 ::osl::MutexGuard aGuard( GetInstanceMutex() );
+const LanguageType eLang = (pFormat ? pFormat->GetLanguage() : 
LANGUAGE_SYSTEM);
+if (eForLocale == LANGUAGE_DONTKNOW)
+eForLocale = eLang;
 sal_uInt32 nKey = nFIndex;
 switch ( eType )
 {
@@ -1615,16 +1619,16 @@ sal_uInt32 SvNumberFormatter::GetEditFormat( double 
fNumber, sal_uInt32 nFIndex,
 // fdo#34977 preserve time when editing even if only date was
 // displayed.
 if (bIsoDate)
-nKey = GetFormatIndex( NF_DATETIME_ISO_MMDD_HHMMSS, 
eLang);
+nKey = GetFormatInde

[Libreoffice-commits] core.git: 2 commits - desktop/source oox/inc oox/Library_oox.mk oox/source sfx2/source

2022-04-14 Thread Tomaž Vajngerl (via logerrit)
 desktop/source/lib/init.cxx |   10 +++
 oox/Library_oox.mk  |1 
 oox/inc/drawingml/chart/datatablecontext.hxx|   42 ++
 oox/inc/drawingml/chart/datatablemodel.hxx  |   41 ++
 oox/inc/drawingml/chart/plotareacontext.hxx |   15 -
 oox/inc/drawingml/chart/plotareamodel.hxx   |9 ---
 oox/source/drawingml/chart/datatablecontext.cxx |   68 
 oox/source/drawingml/chart/plotareacontext.cxx  |   32 ---
 oox/source/drawingml/chart/plotareamodel.cxx|7 --
 sfx2/source/control/unoctitm.cxx|8 ++
 10 files changed, 171 insertions(+), 62 deletions(-)

New commits:
commit 32e38ec654cfd467aad74da59366bd41142b3bdc
Author: Tomaž Vajngerl 
AuthorDate: Thu Apr 14 15:57:01 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Apr 15 01:35:09 2022 +0200

oox: move DataTable{Context,Model} into own file, prop. "showKeys"

Move DataTableContext and DataTableModel into its own files and
add the missing "showKeys" property of the data table (dTable).

Change-Id: I44fb436000c7f00a596fc9b12489d15ea1368e68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133021
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index ca88ab100039..01da0aa4374d 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -100,6 +100,7 @@ $(eval $(call gb_Library_add_exception_objects,oox,\
 oox/source/drawingml/chart/datasourcecontext \
 oox/source/drawingml/chart/datasourceconverter \
 oox/source/drawingml/chart/datasourcemodel \
+oox/source/drawingml/chart/datatablecontext \
 oox/source/drawingml/chart/modelbase \
 oox/source/drawingml/chart/objectformatter \
 oox/source/drawingml/chart/plotareacontext \
diff --git a/oox/inc/drawingml/chart/datatablecontext.hxx 
b/oox/inc/drawingml/chart/datatablecontext.hxx
new file mode 100644
index ..01a75c6e634d
--- /dev/null
+++ b/oox/inc/drawingml/chart/datatablecontext.hxx
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include 
+
+namespace oox::drawingml::chart
+{
+struct DataTableModel;
+
+/** Handler for a data table context (c:dTable element).
+ */
+class DataTableContext final : public ContextBase
+{
+public:
+explicit DataTableContext(::oox::core::ContextHandler2Helper& rParent, 
DataTableModel& rModel);
+virtual ~DataTableContext() override;
+
+virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement,
+   const 
AttributeList& rAttribs) override;
+};
+
+} // namespace oox::drawingml::chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/drawingml/chart/datatablemodel.hxx 
b/oox/inc/drawingml/chart/datatablemodel.hxx
new file mode 100644
index ..5c7fe7901200
--- /dev/null
+++ b/oox/inc/drawingml/chart/datatablemodel.hxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+namespace oox::drawingml::chart
+{
+struct DataTableModel
+{
+bool mbShowHBorder : 1; /// Show Horizontal Border
+bool mbShowVBorder : 1; /// Show V

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

2022-04-14 Thread Stephan Bergmann (via logerrit)
 include/o3tl/string_view.hxx |   16 
 1 file changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 7582286258984d790274295aea1cd7eb6ad96602
Author: Stephan Bergmann 
AuthorDate: Thu Apr 14 14:17:50 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Apr 14 22:35:39 2022 +0200

Add some clarifying comments for o3lt::getToken

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

diff --git a/include/o3tl/string_view.hxx b/include/o3tl/string_view.hxx
index bf72c0b2b976..903cc5ced758 100644
--- a/include/o3tl/string_view.hxx
+++ b/include/o3tl/string_view.hxx
@@ -48,9 +48,13 @@ inline int compareToIgnoreAsciiCase(std::u16string_view s1, 
std::u16string_view
 return rtl_ustr_compareIgnoreAsciiCase_WithLength(s1.data(), s1.size(), 
s2.data(), s2.size());
 };
 
-// Similar to O[U]String::getToken, returning the first token of a 
std::[u16]string_view, starting
-// at a given position (and if needed, it can be extended to return the n'th 
token instead of just
-// the first, or support an initial position of npos):
+// Similar to O[U]String::getToken, returning the first token of a 
std::[u16]string_view starting
+// at a given position.
+//
+// Attention:  There are two sets of o3tl::getToken overloads here.  This 
first set has an interface
+// based on std::size_t length parameters, and its semantics don't match those 
of
+// O[U]String::getToken exactly (buf if needed, it can be extended to return 
the n'th token instead
+// of just the first, and/or support an initial position of npos, to make the 
semantics match).
 template >
 inline std::basic_string_view 
getToken(std::basic_string_view sv,
   charT delimiter, 
std::size_t& position)
@@ -80,7 +84,11 @@ inline std::u16string_view getToken(std::u16string_view sv, 
char16_t delimiter,
 return getToken(sv, delimiter, position);
 }
 
-// Similar to OUString::getToken
+// Similar to O[U]String::getToken.
+//
+// Attention:  There are two sets of o3tl::getToken overloads here.  This 
second set has an
+// interface based on sal_Int32 length parameters, and is meant to be a 
drop-in replacement for
+// O[U]String::getToken.
 template >
 inline std::basic_string_view 
getToken(std::basic_string_view pStr,
   sal_Int32 nToken, charT 
cTok,


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

2022-04-14 Thread Luboš Luňák (via logerrit)
 vcl/inc/TextLayoutCache.hxx |2 ++
 vcl/inc/sallayout.hxx   |1 -
 vcl/source/gdi/CommonSalLayout.cxx  |   20 
 vcl/source/gdi/impglyphitem.cxx |2 +-
 vcl/source/outdev/text.cxx  |3 ++-
 vcl/source/text/TextLayoutCache.cxx |   25 -
 6 files changed, 29 insertions(+), 24 deletions(-)

New commits:
commit 4557ea11aeda19b705b4d701bdd1b85db7f0b206
Author: Luboš Luňák 
AuthorDate: Thu Apr 14 16:11:06 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Apr 14 21:48:56 2022 +0200

move vcl::text::TextLayoutCache caching to the class itself

I have no idea why I did that in GenericSalLayout.

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

diff --git a/vcl/inc/TextLayoutCache.hxx b/vcl/inc/TextLayoutCache.hxx
index ecb85ea7043d..46e5c80dc320 100644
--- a/vcl/inc/TextLayoutCache.hxx
+++ b/vcl/inc/TextLayoutCache.hxx
@@ -49,6 +49,8 @@ class VCL_DLLPUBLIC TextLayoutCache
 public:
 std::vector runs;
 TextLayoutCache(sal_Unicode const* pStr, sal_Int32 const nEnd);
+// Creates a cached instance.
+static std::shared_ptr Create(OUString 
const&);
 };
 
 struct FirstCharsStringHash
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index 894be0a3098b..75f7cb3c6ea0 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -113,7 +113,6 @@ public:
 voidAdjustLayout(vcl::text::ImplLayoutArgs&) final override;
 boolLayoutText(vcl::text::ImplLayoutArgs&, const 
SalLayoutGlyphsImpl*) final override;
 voidDrawText(SalGraphics&) const final override;
-static std::shared_ptr 
CreateTextLayoutCache(OUString const&);
 SalLayoutGlyphs GetGlyphs() const final override;
 
 boolIsKashidaPosValid(int nCharPos) const final override;
diff --git a/vcl/source/gdi/CommonSalLayout.cxx 
b/vcl/source/gdi/CommonSalLayout.cxx
index 628938c5b123..0007e3f355d1 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -21,11 +21,8 @@
 
 #include 
 #include 
-#include 
-#include 
 #include 
 
-#include 
 #include 
 #include 
 #include 
@@ -156,23 +153,6 @@ namespace {
 
 } // namespace
 
-std::shared_ptr 
GenericSalLayout::CreateTextLayoutCache(OUString const& rString)
-{
-typedef o3tl::lru_map,
-vcl::text::FirstCharsStringHash, vcl::text::FastStringCompareEqual> 
Cache;
-static vcl::DeleteOnDeinit< Cache > cache( 1000 );
-if( Cache* map = cache.get())
-{
-auto it = map->find(rString);
-if( it != map->end())
-return it->second;
-auto ret = std::make_shared(rString.getStr(), rString.getLength());
-map->insert( { rString, ret } );
-return ret;
-}
-return std::make_shared(rString.getStr(), rString.getLength());
-}
-
 SalLayoutGlyphs GenericSalLayout::GetGlyphs() const
 {
 SalLayoutGlyphs glyphs;
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index d581715dc9cd..0268eb3861c0 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -256,7 +256,7 @@ SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr outputDevice, c
 std::shared_ptr tmpLayoutCache;
 if (layoutCache == nullptr)
 {
-tmpLayoutCache = OutputDevice::CreateTextLayoutCache(text);
+tmpLayoutCache = vcl::text::TextLayoutCache::Create(text);
 layoutCache = tmpLayoutCache.get();
 }
 std::unique_ptr layout = outputDevice->ImplLayout(
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 522fd348c7ee..840341502beb 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -51,6 +51,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #define TEXT_DRAW_ELLIPSIS  (DrawTextFlags::EndEllipsis | 
DrawTextFlags::PathEllipsis | DrawTextFlags::NewsEllipsis)
@@ -1459,7 +1460,7 @@ std::unique_ptr OutputDevice::ImplLayout(const 
OUString& rOrigStr,
 std::shared_ptr 
OutputDevice::CreateTextLayoutCache(
 OUString const& rString)
 {
-return GenericSalLayout::CreateTextLayoutCache(rString);
+return vcl::text::TextLayoutCache::Create(rString);
 }
 
 bool OutputDevice::GetTextIsRTL( const OUString& rString, sal_Int32 nIndex, 
sal_Int32 nLen ) const
diff --git a/vcl/source/text/TextLayoutCache.cxx 
b/vcl/source/text/TextLayoutCache.cxx
index 00e9f9405358..e1e4321a98d3 100644
--- a/vcl/source/text/TextLayoutCache.cxx
+++ b/vcl/source/text/TextLayoutCache.cxx
@@ -17,9 +17,14 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
 #include 
 
+#include 
+
+#include 
+#include 
+#include 
+
 namespace vcl::text
 {
 TextLayoutCache::TextLayoutCache(sal_Unicode const* pStr, sal_Int32 const nEnd)
@@ -31,6 +36,24 @@ TextLayoutCache::TextLayoutCache(sal_Unicode const* pStr, 
sal_Int32

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

2022-04-14 Thread Noel Grandin (via logerrit)
 sd/qa/unit/SVGExportTests.cxx|   10 +-
 sd/qa/unit/tiledrendering/tiledrendering.cxx |4 ++--
 sd/source/ui/docshell/docshel4.cxx   |   21 +++--
 sd/source/ui/inc/DrawDocShell.hxx|2 +-
 sd/source/ui/inc/DrawViewShell.hxx   |2 +-
 sd/source/ui/inc/unopage.hxx |2 +-
 sd/source/ui/unoidl/unopage.cxx  |   10 +-
 sd/source/ui/view/drviewsh.cxx   |2 +-
 8 files changed, 27 insertions(+), 26 deletions(-)

New commits:
commit 4475483b92da89f6ab7fa503c6db920b7b50d1b7
Author: Noel Grandin 
AuthorDate: Thu Apr 14 11:48:13 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Apr 14 21:13:00 2022 +0200

use more string_view in sd

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

diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx
index d43815264d26..4878eca27972 100644
--- a/sd/qa/unit/SVGExportTests.cxx
+++ b/sd/qa/unit/SVGExportTests.cxx
@@ -46,13 +46,13 @@ bool isValidBitmapId(const OUString& sId)
 return std::regex_match(sId.toUtf8().getStr(), aRegEx);
 }
 
-BitmapChecksum getBitmapChecksumFromId(const OUString& sId)
+BitmapChecksum getBitmapChecksumFromId(std::u16string_view sId)
 {
-sal_Int32 nStart = sId.indexOf("(") + 1;
-sal_Int32 nCount = sId.indexOf(")") - nStart;
-bool bIsValidRange = nStart > 0 && nCount > 0;
+size_t nStart = sId.find(u"(") + 1;
+size_t nCount = sId.find(u")") - nStart;
+bool bIsValidRange = nStart > 0 && nStart != std::u16string_view::npos && 
nCount > 0;
 CPPUNIT_ASSERT(bIsValidRange);
-OUString sChecksum = sId.copy( nStart, nCount );
+OUString sChecksum( sId.substr( nStart, nCount ) );
 return sChecksum.toUInt64();
 }
 
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 4207f6bbce7f..9ce85a102f83 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -2676,9 +2676,9 @@ void SdTiledRenderingTest::testSlideDuplicateUndo()
 namespace
 {
 
-void lcl_extractHandleParameters(const OString& selection, sal_uInt32& id, 
sal_uInt32& x, sal_uInt32& y)
+void lcl_extractHandleParameters(std::string_view selection, sal_uInt32& id, 
sal_uInt32& x, sal_uInt32& y)
 {
-OString extraInfo = selection.copy(selection.indexOf("{"));
+OString extraInfo( selection.substr(selection.find("{")) );
 std::stringstream aStream(extraInfo.getStr());
 boost::property_tree::ptree aTree;
 boost::property_tree::read_json(aStream, aTree);
diff --git a/sd/source/ui/docshell/docshel4.cxx 
b/sd/source/ui/docshell/docshel4.cxx
index 6150321ca33a..6fe599e44197 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -72,6 +72,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -698,7 +699,7 @@ SfxStyleSheetBasePool* DrawDocShell::GetStyleSheetPool()
 return mpDoc->GetStyleSheetPool();
 }
 
-void DrawDocShell::GotoBookmark(const OUString& rBookmark)
+void DrawDocShell::GotoBookmark(std::u16string_view rBookmark)
 {
 auto pDrawViewShell = dynamic_cast( mpViewShell );
 if (!pDrawViewShell)
@@ -710,28 +711,28 @@ void DrawDocShell::GotoBookmark(const OUString& rBookmark)
 sal_uInt16 nPageNumber = SDRPAGE_NOTFOUND;
 SdrObject* pObj = nullptr;
 
-static const OUStringLiteral sInteraction( u"action?" );
-if ( rBookmark.match( sInteraction ) )
+static constexpr std::u16string_view sInteraction( u"action?" );
+if ( o3tl::starts_with(rBookmark, sInteraction ) )
 {
-static const OUStringLiteral sJump( u"jump=" );
-if ( rBookmark.match( sJump, sInteraction.getLength() ) )
+static constexpr std::u16string_view sJump( u"jump=" );
+if ( o3tl::starts_with(rBookmark.substr( sInteraction.size() ), sJump 
) )
 {
-OUString aDestination( rBookmark.copy( sInteraction.getLength() + 
sJump.getLength() ) );
-if ( aDestination.match( "firstslide" ) )
+std::u16string_view aDestination( rBookmark.substr( 
sInteraction.size() + sJump.size() ) );
+if ( o3tl::starts_with(aDestination, u"firstslide" ) )
 {
 nPageNumber = 1;
 }
-else if ( aDestination.match( "lastslide" ) )
+else if ( o3tl::starts_with(aDestination, u"lastslide" ) )
 {
 nPageNumber = mpDoc->GetPageCount() - 2;
 }
-else if ( aDestination.match( "previousslide" ) )
+else if ( o3tl::starts_with(aDestination, u"previousslide" ) )
 {
 SdPage* pPage = pDrawViewShell->GetActualPage();
 nPageNumber = pPage->GetPageNum();
 nPageNumber = nPageNumber > 2 ? nPageNumber - 2 : 
S

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

2022-04-14 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java |5 
+++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 003e2873e4463974e59e1f909f9250cde743851f
Author: Michael Weghorn 
AuthorDate: Thu Apr 14 09:34:28 2022 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 14 20:40:23 2022 +0200

android: Use proper Intent to open doc for API level < 19

`Intent.ACTION_OPEN_DOCUMENT` was introduced in API level 19,
therefore `Intent.ACTION_GET_CONTENT` is supposed to be used
for older Android versions.

The previous attempt at doing so didn't work, since no
`ActivityNotFoundException` is thrown when trying
to set the action to `Intent.ACTION_OPEN_DOCUMENT` on
older Android versions.

Fix that by using a proper version check instead.

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

diff --git 
a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java 
b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
index c18b784e581b..f2e366c90ed3 100644
--- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -258,9 +258,10 @@ public class LibreOfficeUIActivity extends 
AppCompatActivity implements Settings
 
 private void showSystemFilePickerAndOpenFile() {
 Intent intent = new Intent();
-try {
+if (Build.VERSION.SDK_INT >= 19) {
 intent.setAction(Intent.ACTION_OPEN_DOCUMENT);
-} catch (ActivityNotFoundException exception) {
+}
+else {
 // Intent.ACTION_OPEN_DOCUMENT added in API level 19, but 
minSdkVersion is currently 16
 intent.setAction(Intent.ACTION_GET_CONTENT);
 }


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

2022-04-14 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/ui/FileUtilities.java |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f869807175f1fc49328465473aa8e90b6f1876ff
Author: Michael Weghorn 
AuthorDate: Thu Apr 14 17:17:04 2022 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 14 20:40:09 2022 +0200

android: Use "ContentResolver#query" available from API level 1

Use the `ContentResolver#query` overload that is available from
Android API level 1 on, not the one that's only available from
API level 26 on [2], which would otherwise trigger an exception
if run on devices running Android version < 8.0, as seen
on an AVD with API level 21:

> E/AndroidRuntime( 2914): FATAL EXCEPTION: main
> E/AndroidRuntime( 2914): Process: org.libreoffice, PID: 2914
> E/AndroidRuntime( 2914): java.lang.NoSuchMethodError: No virtual method 
query(Landroid/net/Uri;[Ljava/lang/String;Landroid/os/Bundle;Landroid/os/CancellationSignal;)Landroid/database/Cursor;
 in class Landroid/content/ContentResolver; or its super classes (declaration 
of 'android.content.ContentResolver' appears in /system/framework/framework.jar)
> E/AndroidRuntime( 2914):at 
org.libreoffice.ui.FileUtilities.retrieveDisplayNameForDocumentUri(FileUtilities.java:137)
> E/AndroidRuntime( 2914):at 
org.libreoffice.ui.LibreOfficeUIActivity.createUI(LibreOfficeUIActivity.java:206)
> E/AndroidRuntime( 2914):at 
org.libreoffice.ui.LibreOfficeUIActivity.onCreate(LibreOfficeUIActivity.java:147)
> E/AndroidRuntime( 2914):at 
android.app.Activity.performCreate(Activity.java:5937)
> E/AndroidRuntime( 2914):at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
> E/AndroidRuntime( 2914):at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
> E/AndroidRuntime( 2914):at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
> E/AndroidRuntime( 2914):at 
android.app.ActivityThread.access$800(ActivityThread.java:144)
> E/AndroidRuntime( 2914):at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
> E/AndroidRuntime( 2914):at 
android.os.Handler.dispatchMessage(Handler.java:102)
> E/AndroidRuntime( 2914):at android.os.Looper.loop(Looper.java:135)
> E/AndroidRuntime( 2914):at 
android.app.ActivityThread.main(ActivityThread.java:5221)
> E/AndroidRuntime( 2914):at java.lang.reflect.Method.invoke(Native 
Method)
> E/AndroidRuntime( 2914):at 
java.lang.reflect.Method.invoke(Method.java:372)
> E/AndroidRuntime( 2914):at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
> E/AndroidRuntime( 2914):at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
>

[1] 
https://developer.android.com/reference/android/content/ContentResolver#query(android.net.Uri,%20java.lang.String[],%20java.lang.String,%20java.lang.String[],%20java.lang.String)
[2] 
https://developer.android.com/reference/android/content/ContentResolver#query(android.net.Uri,%20java.lang.String[],%20android.os.Bundle,%20android.os.CancellationSignal)

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

diff --git a/android/source/src/java/org/libreoffice/ui/FileUtilities.java 
b/android/source/src/java/org/libreoffice/ui/FileUtilities.java
index 5bfb93b4c1f5..72da47b8cc3a 100644
--- a/android/source/src/java/org/libreoffice/ui/FileUtilities.java
+++ b/android/source/src/java/org/libreoffice/ui/FileUtilities.java
@@ -134,7 +134,7 @@ public class FileUtilities {
 Cursor cursor = null;
 try {
 String[] columns = {OpenableColumns.DISPLAY_NAME};
-cursor = resolver.query(docUri, columns, null, null);
+cursor = resolver.query(docUri, columns, null, null, null);
 if (cursor != null && cursor.moveToFirst()) {
 displayName = 
cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
 }


[Libreoffice-commits] core.git: 2 commits - emfio/README.md vcl/source

2022-04-14 Thread Andrea Gelmini (via logerrit)
 emfio/README.md|2 +-
 vcl/source/filter/imet/ios2met.cxx |1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 84de0b351c959c9a1ebbbd61bf0702561afc4d82
Author: Andrea Gelmini 
AuthorDate: Thu Apr 14 05:14:32 2022 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Apr 14 20:38:02 2022 +0200

Fix typo

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

diff --git a/emfio/README.md b/emfio/README.md
index db7393d9018c..283e0c3f41c7 100644
--- a/emfio/README.md
+++ b/emfio/README.md
@@ -119,7 +119,7 @@ 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
+on OLEToy for working with various binary formats
 
 ## Related Software
 * [libemf](http://libemf.sourceforge.net/)
commit 6e53140dd3d7b414e81718d55ec288c4640ed587
Author: Caolán McNamara 
AuthorDate: Thu Apr 14 16:43:35 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 14 20:37:52 2022 +0200

cid#1504075 Uninitialized scalar field

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

diff --git a/vcl/source/filter/imet/ios2met.cxx 
b/vcl/source/filter/imet/ios2met.cxx
index 9054a244d62c..fe856c1d7bb6 100644
--- a/vcl/source/filter/imet/ios2met.cxx
+++ b/vcl/source/filter/imet/ios2met.cxx
@@ -345,6 +345,7 @@ struct OSAttr
 , nArcR(0)
 , nArcS(0)
 , nChrAng(0)
+, nChrCellHeight(0)
 , nChrSet(0)
 , eLinStyle(PEN_NULL)
 , nLinWidth(0)


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - binaryurp/source

2022-04-14 Thread Noel Grandin (via logerrit)
 binaryurp/source/binaryurp.component |5 ++--
 binaryurp/source/bridgefactory.cxx   |   39 +--
 binaryurp/source/bridgefactory.hxx   |   12 --
 3 files changed, 10 insertions(+), 46 deletions(-)

New commits:
commit 65fc5bd895948d73f3d1eec14a669ada3e3465f0
Author: Noel Grandin 
AuthorDate: Sat Jul 4 09:12:35 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Apr 14 19:32:18 2022 +0200

binaryurp: create instances with uno constructors

See tdf#74608 for motivation

Change-Id: Ide39715f83b0183f560e16fa69fcb3112496936d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97933
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 9be078ae0d4cc4e4c01952bb42c9bb5943bbde86)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132945
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 

diff --git a/binaryurp/source/binaryurp.component 
b/binaryurp/source/binaryurp.component
index 1eff0c2c18d6..e2581c76411e 100644
--- a/binaryurp/source/binaryurp.component
+++ b/binaryurp/source/binaryurp.component
@@ -18,8 +18,9 @@
  -->
 
 http://openoffice.org/2010/uno-components";>
-  
+xmlns="http://openoffice.org/2010/uno-components";>
+  
 
   
 
diff --git a/binaryurp/source/bridgefactory.cxx 
b/binaryurp/source/bridgefactory.cxx
index 6563b101f1df..f653d40cc68c 100644
--- a/binaryurp/source/bridgefactory.cxx
+++ b/binaryurp/source/bridgefactory.cxx
@@ -43,21 +43,6 @@
 
 namespace binaryurp {
 
-css::uno::Reference< css::uno::XInterface > BridgeFactory::static_create(
-css::uno::Reference< css::uno::XComponentContext > const & /*xContext*/)
-{
-return static_cast< cppu::OWeakObject * >(new BridgeFactory);
-}
-
-OUString BridgeFactory::static_getImplementationName() {
-return "com.sun.star.comp.bridge.BridgeFactory";
-}
-
-css::uno::Sequence< OUString >
-BridgeFactory::static_getSupportedServiceNames() {
-return css::uno::Sequence{ "com.sun.star.bridge.BridgeFactory" };
-}
-
 void BridgeFactory::removeBridge(
 css::uno::Reference< css::bridge::XBridge > const & bridge)
 {
@@ -85,7 +70,7 @@ BridgeFactory::~BridgeFactory() {}
 
 OUString BridgeFactory::getImplementationName()
 {
-return static_getImplementationName();
+return "com.sun.star.comp.bridge.BridgeFactory";
 }
 
 sal_Bool BridgeFactory::supportsService(OUString const & ServiceName)
@@ -95,7 +80,7 @@ sal_Bool BridgeFactory::supportsService(OUString const & 
ServiceName)
 
 css::uno::Sequence< OUString > BridgeFactory::getSupportedServiceNames()
 {
-return static_getSupportedServiceNames();
+return { "com.sun.star.bridge.BridgeFactory" };
 }
 
 css::uno::Reference< css::bridge::XBridge > BridgeFactory::createBridge(
@@ -198,23 +183,11 @@ void BridgeFactory::disposing() {
 
 }
 
-namespace {
-
-static cppu::ImplementationEntry const services[] = {
-{ &binaryurp::BridgeFactory::static_create,
-  &binaryurp::BridgeFactory::static_getImplementationName,
-  &binaryurp::BridgeFactory::static_getSupportedServiceNames,
-  &cppu::createOneInstanceComponentFactory, nullptr, 0 },
-{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
-
-}
-
-extern "C" SAL_DLLPUBLIC_EXPORT void * binaryurp_component_getFactory(
-char const * pImplName, void * pServiceManager, void * pRegistryKey)
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+com_sun_star_comp_bridge_BridgeFactory_get_implementation(
+css::uno::XComponentContext* , css::uno::Sequence const&)
 {
-return cppu::component_getFactoryHelper(
-pImplName, pServiceManager, pRegistryKey, services);
+return cppu::acquire(static_cast< cppu::OWeakObject * >(new 
binaryurp::BridgeFactory));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binaryurp/source/bridgefactory.hxx 
b/binaryurp/source/bridgefactory.hxx
index 1a83962ee6b7..bbe2e39fd46a 100644
--- a/binaryurp/source/bridgefactory.hxx
+++ b/binaryurp/source/bridgefactory.hxx
@@ -57,16 +57,6 @@ typedef
 class BridgeFactory : private cppu::BaseMutex, public BridgeFactoryBase
 {
 public:
-static com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
-SAL_CALL static_create(
-com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext 
>
-const & xContext);
-
-static OUString SAL_CALL static_getImplementationName();
-
-static com::sun::star::uno::Sequence< OUString > SAL_CALL
-static_getSupportedServiceNames();
-
 void removeBridge(
 com::sun::star::uno::Reference< com::sun::star::bridge::XBridge >
 const & bridge);
@@ -74,7 +64,6 @@ public:
 using BridgeFactoryBase::acquire;
 using BridgeFactoryBase::release;
 
-private:
 BridgeFactory(const BridgeFactory&) = delete;
 BridgeFactory& operator=(const BridgeFactory&) = delete;
 
@@ -82,6 +71,7 @@ private:
 
 virtual ~BridgeFactory() override;
 
+private:
 virtual OUString SAL_CALL getImplem

[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source

2022-04-14 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/doc/objmisc.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 6520d6f9b09085af9c63d3c35108fb8083abbefa
Author: Samuel Mehrbrodt 
AuthorDate: Wed Apr 13 08:01:29 2022 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Apr 14 19:31:51 2022 +0200

Prevent save interception when sharing Calc doc

Using the dispatch mechanism means that this can be caught by the dispatch 
interceptor
which we don't want in this place.

Change-Id: Ie7e5f92e6043e2aff98d4887829a3573c12c6d08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132946
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 4afaf1cc5d7b..04ff6ecd5314 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -113,6 +113,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "objstor.hxx"
@@ -521,9 +522,16 @@ bool SfxObjectShell::SwitchToShared( bool bShared, bool 
bSave )
 {
 // TODO/LATER: currently the application guards against the 
reentrance problem
 SetModified(); // the modified flag has to be set to let the 
document be stored with the shared flag
-const SfxPoolItem* pItem = 
pViewFrame->GetBindings().ExecuteSynchron( HasName() ? SID_SAVEDOC : 
SID_SAVEASDOC );
-const SfxBoolItem* pResult = dynamic_cast( 
pItem  );
-bResult = ( pResult && pResult->GetValue() );
+try
+{
+// Do *not* use dispatch mechanism in this place - we 
don't want others (extensions etc.) to intercept this.
+pImpl->pBaseModel->store();
+bResult = true;
+}
+catch (...)
+{
+bResult = false;
+}
 }
 }
 


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

2022-04-14 Thread Thorsten Behrens (via logerrit)
 slideshow/source/engine/activities/simplecontinuousactivitybase.cxx |   12 
+++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit e1db8c27875eac73b1e619e4a23ecdb7a9924b61
Author: Thorsten Behrens 
AuthorDate: Thu Apr 14 12:01:50 2022 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Apr 14 19:29:03 2022 +0200

Resolves: tdf#143615 clamp relative times to 1.0

User input permits zero-length animations, so whenever we calculate
relative position within the animation time frame, the case
mnMinSimpleDuration == 0.0 means: we're already at the end of the
animation, i.e. set relative time to 1.0

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

diff --git 
a/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx 
b/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx
index 9e23fc2c76c8..01cb3b75007b 100644
--- a/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx
+++ b/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx
@@ -63,9 +63,12 @@ namespace slideshow::internal
 // perform will be called at least mnMinNumberOfTurns
 // times.
 
-// fraction of time elapsed
+// fraction of time elapsed (clamp to 1.0 for zero-length
+// animations)
 const double nFractionElapsedTime(
-nCurrElapsedTime / mnMinSimpleDuration );
+mnMinSimpleDuration != 0.0 ?
+nCurrElapsedTime / mnMinSimpleDuration :
+1.0 );
 
 // fraction of minimum calls performed
 const double nFractionRequiredCalls(
@@ -115,7 +118,10 @@ namespace slideshow::internal
 // ===
 
 const double nCurrElapsedTime( maTimer.getElapsedTime() );
-double nT( nCurrElapsedTime / mnMinSimpleDuration );
+// clamp to 1.0 for zero animation duration
+double nT( mnMinSimpleDuration != 0.0 ?
+   nCurrElapsedTime / mnMinSimpleDuration :
+   1.0 );
 
 
 // one of the stop criteria reached?


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-1' - sfx2/source

2022-04-14 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/doc/objmisc.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit e0a27e60ab8e37d89b350efc0c3c7abf65f483d0
Author: Samuel Mehrbrodt 
AuthorDate: Wed Apr 13 08:01:29 2022 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Apr 14 19:28:41 2022 +0200

Prevent save interception when sharing Calc doc

Using the dispatch mechanism means that this can be caught by the dispatch 
interceptor
which we don't want in this place.

Change-Id: Ie7e5f92e6043e2aff98d4887829a3573c12c6d08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132947
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 91817a637620..5b078261910f 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -106,6 +106,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "objstor.hxx"
@@ -496,9 +497,16 @@ bool SfxObjectShell::SwitchToShared( bool bShared, bool 
bSave )
 {
 // TODO/LATER: currently the application guards against the 
reentrance problem
 SetModified(); // the modified flag has to be set to let the 
document be stored with the shared flag
-const SfxPoolItem* pItem = 
pViewFrame->GetBindings().ExecuteSynchron( HasName() ? SID_SAVEDOC : 
SID_SAVEASDOC );
-const SfxBoolItem* pResult = dynamic_cast( 
pItem  );
-bResult = ( pResult && pResult->GetValue() );
+try
+{
+// Do *not* use dispatch mechanism in this place - we 
don't want others (extensions etc.) to intercept this.
+pImpl->pBaseModel->store();
+bResult = true;
+}
+catch (...)
+{
+bResult = false;
+}
 }
 }
 


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

2022-04-14 Thread Noel Grandin (via logerrit)
 include/o3tl/string_view.hxx   |3 ++-
 unotools/source/config/bootstrap.cxx   |6 +++---
 unotools/source/ucbhelper/tempfile.cxx |8 
 3 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit af4407649d2c8a2ea59487d5fc1f8cc742ddd0b2
Author: Noel Grandin 
AuthorDate: Thu Apr 14 13:46:06 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Apr 14 19:26:04 2022 +0200

use more string_view in unotools

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

diff --git a/unotools/source/config/bootstrap.cxx 
b/unotools/source/config/bootstrap.cxx
index 09c52157024b..ef7ba57000c1 100644
--- a/unotools/source/config/bootstrap.cxx
+++ b/unotools/source/config/bootstrap.cxx
@@ -413,12 +413,12 @@ char const IS_MISSING[] = "is missing";
 char const IS_INVALID[] = "is corrupt";
 char const PERIOD[] = ". ";
 
-static void addFileError(OUStringBuffer& _rBuf, OUString const& _aPath, 
AsciiString _sWhat)
+static void addFileError(OUStringBuffer& _rBuf, std::u16string_view _aPath, 
AsciiString _sWhat)
 {
-OUString sSimpleFileName = _aPath.copy(1 
+_aPath.lastIndexOf(cURLSeparator));
+std::u16string_view sSimpleFileName = _aPath.substr(1 
+_aPath.rfind(cURLSeparator));
 
 _rBuf.append("The configuration file");
-_rBuf.append(" '" + sSimpleFileName + "' ");
+_rBuf.append(OUString::Concat(" '") + sSimpleFileName + "' ");
 _rBuf.appendAscii(_sWhat).append(PERIOD);
 }
 
diff --git a/unotools/source/ucbhelper/tempfile.cxx 
b/unotools/source/ucbhelper/tempfile.cxx
index 4fac0bacd782..e912c609337b 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -47,14 +47,14 @@ namespace
 namespace utl
 {
 
-static OUString getParentName( const OUString& aFileName )
+static OUString getParentName( std::u16string_view aFileName )
 {
-sal_Int32 lastIndex = aFileName.lastIndexOf( '/' );
+size_t lastIndex = aFileName.rfind( '/' );
 OUString aParent;
 
-if (lastIndex > -1)
+if (lastIndex != std::u16string_view::npos)
 {
-aParent = aFileName.copy(0, lastIndex);
+aParent = aFileName.substr(0, lastIndex);
 
 if (aParent.endsWith(":") && aParent.getLength() == 6)
 aParent += "/";
commit 2a5b28eaaaf8ff56778fcdfb28f0a660592c7866
Author: Noel Grandin 
AuthorDate: Thu Apr 14 13:16:58 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Apr 14 19:25:52 2022 +0200

address review comments

(*) fix parameter type of getToken()

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

diff --git a/include/o3tl/string_view.hxx b/include/o3tl/string_view.hxx
index eb98e243c8b1..bf72c0b2b976 100644
--- a/include/o3tl/string_view.hxx
+++ b/include/o3tl/string_view.hxx
@@ -74,7 +74,8 @@ inline std::string_view getToken(std::string_view sv, char 
delimiter, std::size_
 {
 return getToken(sv, delimiter, position);
 }
-inline std::u16string_view getToken(std::u16string_view sv, char delimiter, 
std::size_t& position)
+inline std::u16string_view getToken(std::u16string_view sv, char16_t delimiter,
+std::size_t& position)
 {
 return getToken(sv, delimiter, position);
 }


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

2022-04-14 Thread Jim Raykowski (via logerrit)
 sw/inc/editsh.hxx  |2 +-
 sw/source/core/edit/editsh.cxx |   14 +-
 sw/source/uibase/utlui/content.cxx |2 +-
 3 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 78b723c3a1fad1c095de1e5c746aef513556a53b
Author: Jim Raykowski 
AuthorDate: Wed Apr 13 18:15:11 2022 -0800
Commit: Jim Raykowski 
CommitDate: Thu Apr 14 18:44:14 2022 +0200

tdf#52113, tdf#148312 Don't include table of contents hyperlinks

in the Navigator content tree Hyperlinks entries

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

diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 95faaf6003cd..9439d8a777e0 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -826,7 +826,7 @@ public:
 
 bool InsertURL( const SwFormatINetFormat& rFormat, const OUString& rStr,
 bool bKeepSelection = false );
-void GetINetAttrs( SwGetINetAttrs& rArr );
+void GetINetAttrs(SwGetINetAttrs& rArr , bool bIncludeInToxContent = true);
 
 OUString GetDropText( const sal_Int32 nChars ) const;
 void   ReplaceDropText( const OUString &rStr, SwPaM* pPaM = nullptr );
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index b1d265305321..a6a27bcc5b57 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -685,7 +685,7 @@ bool SwEditShell::InsertURL( const SwFormatINetFormat& 
rFormat, const OUString&
 return true;
 }
 
-void SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
+void SwEditShell::GetINetAttrs(SwGetINetAttrs& rArr, bool bIncludeInToxContent)
 {
 rArr.clear();
 
@@ -705,6 +705,18 @@ void SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
 && pFrame->MapModelToView(pTextNd, pFnd->GetStart())
 != pFrame->MapModelToView(pTextNd, *pFnd->GetEnd()))
 {
+// tdf#52113, tdf#148312 Don't include table of contents 
hyperlinks in the
+// Navigator content tree Hyperlinks entries
+if (!bIncludeInToxContent)
+{
+if(const SwSectionNode* pSectNd = 
pTextNd->FindSectionNode())
+{
+SectionType eType = pSectNd->GetSection().GetType();
+if(SectionType::ToxContent == eType)
+continue;
+}
+}
+
 SwTextINetFormat& rAttr = *pFnd;
 OUString sText( pTextNd->GetExpandText(GetLayout(),
 rAttr.GetStart(), *rAttr.GetEnd() - rAttr.GetStart()) 
);
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 719b2016e1b7..c614ee4d7c7d 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -714,7 +714,7 @@ void SwContentType::FillMemberList(bool* pbContentChanged)
 case ContentTypeId::URLFIELD:
 {
 SwGetINetAttrs aArr;
-m_pWrtShell->GetINetAttrs(aArr);
+m_pWrtShell->GetINetAttrs(aArr, false);
 
 if (m_bAlphabeticSort)
 {


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

2022-04-14 Thread Stephan Bergmann (via logerrit)
 compilerplugins/clang/implicitboolconversion.cxx  |5 +++--
 compilerplugins/clang/test/implicitboolconversion.cxx |7 ++-
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 36b7288a0ce9588b958e0b3a68613e9ee11cf17c
Author: Stephan Bergmann 
AuthorDate: Thu Apr 14 15:49:01 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Apr 14 18:25:49 2022 +0200

Use DeclCheck at one place in loplugin:implicitboolconversion

...and add tests for those additions to isBoolExpr done in
8e4d82cd1125502c26ddaaa85c49c4aa44f65811 "loplugin:implicitboolconversion: 
warn
about conversions to unsigned char" (and which were added to avoid false
warnings like

> testtools/source/bridgetest/bridgetest.cxx:643:21: error: implicit 
conversion (IntegralToBoolean) of call argument from 'unsigned char' to 'bool' 
[loplugin:implicitboolconversion]
> (xLBT->transportPolyBoolean(
> ^~~~

and

> cui/source/options/optaboutconfig.cxx:359:62: error: implicit conversion 
(IntegralToBoolean) of call argument from 'unsigned char' to 'bool' 
[loplugin:implicitboolconversion]
> sValue.append(OUString::boolean( seq[j] ));
>  ^~

)

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

diff --git a/compilerplugins/clang/implicitboolconversion.cxx 
b/compilerplugins/clang/implicitboolconversion.cxx
index e61f4a14cf0f..d0bdff190807 100644
--- a/compilerplugins/clang/implicitboolconversion.cxx
+++ b/compilerplugins/clang/implicitboolconversion.cxx
@@ -180,8 +180,9 @@ bool isBoolExpr(Expr const * expr) {
 TemplateDecl const * d
 = t->getTemplateName().getAsTemplateDecl();
 if (d == nullptr
-|| (d->getQualifiedNameAsString()
-!= "com::sun::star::uno::Sequence")
+|| 
!loplugin::DeclCheck(d->getTemplatedDecl()).Class("Sequence")
+
.Namespace("uno").Namespace("star").Namespace("sun").Namespace("com")
+.GlobalNamespace()
 || t->getNumArgs() != 1
 || t->getArg(0).getKind() != TemplateArgument::Type)
 {
diff --git a/compilerplugins/clang/test/implicitboolconversion.cxx 
b/compilerplugins/clang/test/implicitboolconversion.cxx
index 47c015261fef..fa5a2b84b905 100644
--- a/compilerplugins/clang/test/implicitboolconversion.cxx
+++ b/compilerplugins/clang/test/implicitboolconversion.cxx
@@ -12,6 +12,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 template  struct Sequence
@@ -35,6 +36,8 @@ template  struct Wrap2
 
 bool g();
 
+void h(bool);
+
 void f()
 {
 // expected-error@+1 {{implicit conversion (IntegralCast) from 'bool' to 
'int' [loplugin:implicitboolconversion]}}
@@ -63,13 +66,15 @@ void f()
 Sequence> s4{ { false } };
 (void)s4;
 Wrap1 w1{ false };
-(void)w1;
 Sequence> s5{ { false } };
 (void)s5;
 Wrap2 w2{ false };
 (void)w2;
 Sequence> s6{ { false } };
 (void)s6;
+h(w1.element);
+css::uno::Sequence s7(1);
+h(s7[0]);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */


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

2022-04-14 Thread Noel Grandin (via logerrit)
 ucb/source/ucp/file/bc.cxx  |2 +-
 ucb/source/ucp/file/filglob.cxx |   14 +++---
 ucb/source/ucp/file/filglob.hxx |4 ++--
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 9798f8ad50602cf1313a2804b86e79fb80c1ec4d
Author: Noel Grandin 
AuthorDate: Thu Apr 14 13:46:47 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Apr 14 17:45:14 2022 +0200

use more string_view in ucb

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

diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index fe6086160ac6..e4ed0f180333 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -1086,7 +1086,7 @@ void BaseContent::insert( sal_Int32 nMyCommandIdentifier,
 
 XInteractionRequestImpl aRequestImpl(
 rtl::Uri::decode(
-getTitle(m_aUncPath),
+OUString(getTitle(m_aUncPath)),
 rtl_UriDecodeWithCharset,
 RTL_TEXTENCODING_UTF8),
 static_cast(this),
diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx
index 5772934cd161..d93c41b514de 100644
--- a/ucb/source/ucp/file/filglob.cxx
+++ b/ucb/source/ucp/file/filglob.cxx
@@ -183,17 +183,17 @@ namespace fileaccess {
 }
 
 
-OUString getTitle( const OUString& aPath )
+std::u16string_view getTitle( std::u16string_view aPath )
 {
-sal_Int32 lastIndex = aPath.lastIndexOf( '/' );
-return aPath.copy( lastIndex + 1 );
+size_t lastIndex = aPath.rfind( '/' );
+return aPath.substr( lastIndex + 1 );
 }
 
 
-OUString getParentName( const OUString& aFileName )
+OUString getParentName( std::u16string_view aFileName )
 {
-sal_Int32 lastIndex = aFileName.lastIndexOf( '/' );
-OUString aParent = aFileName.copy( 0,lastIndex );
+size_t lastIndex = aFileName.rfind( '/' );
+OUString aParent( aFileName.substr( 0,lastIndex ) );
 
 if( aParent.endsWith(":") && aParent.getLength() == 6 )
 aParent += "/";
@@ -561,7 +561,7 @@ namespace fileaccess {
 prop.Handle = -1;
 OUString aClashingName(
 rtl::Uri::decode(
-getTitle(aUncPath),
+OUString(getTitle(aUncPath)),
 rtl_UriDecodeWithCharset,
 RTL_TEXTENCODING_UTF8));
 prop.Value <<= aClashingName;
diff --git a/ucb/source/ucp/file/filglob.hxx b/ucb/source/ucp/file/filglob.hxx
index 8d3412cdeb7b..b1235056ee18 100644
--- a/ucb/source/ucp/file/filglob.hxx
+++ b/ucb/source/ucp/file/filglob.hxx
@@ -50,12 +50,12 @@ namespace fileaccess {
std::u16string_view old_Name );
 
 // returns the last part of the given url as title
-extern OUString getTitle( const OUString& aPath );
+extern std::u16string_view getTitle( std::u16string_view aPath );
 
 // returns the url without last part as parentname
 // In case aFileName is root ( file:/// ) root is returned
 
-extern OUString getParentName( const OUString& aFileName );
+extern OUString getParentName( std::u16string_view aFileName );
 
 /**
  *  special copy:


New Defects reported by Coverity Scan for LibreOffice

2022-04-14 Thread scan-admin
Hi,

Please find the latest report on new defect(s) introduced to LibreOffice found 
with Coverity Scan.

2 new defect(s) introduced to LibreOffice found with Coverity Scan.


New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)


** CID 1504075:  Uninitialized members  (UNINIT_CTOR)
/vcl/source/filter/imet/ios2met.cxx: 357 in ::OSAttr::OSAttr()()



*** CID 1504075:  Uninitialized members  (UNINIT_CTOR)
/vcl/source/filter/imet/ios2met.cxx: 357 in ::OSAttr::OSAttr()()
351 , nMrkPrec(0)
352 , nMrkSet(0)
353 , nMrkSymbol(0)
354 , bFill(false)
355 , nStrLinWidth(0)
356 {
>>> CID 1504075:  Uninitialized members  (UNINIT_CTOR)
>>> Non-static class member "nChrCellHeight" is not initialized in this 
>>> constructor nor in any functions that it calls.
357 }
358 };
359 
360 class OS2METReader {
361 
362 private:

** CID 1504074:  Integer handling issues  (NEGATIVE_RETURNS)



*** CID 1504074:  Integer handling issues  (NEGATIVE_RETURNS)
/sc/source/ui/view/viewdata.cxx: 3339 in 
ScViewData::ReadUserData(std::basic_string_view>)()
 sal_Unicode cMode = o3tl::getToken(aZoomStr, 2, '/', nIdx)[0]; 
// 0 or "0"/"1"
3334 SetPagebreakMode( cMode == '1' );
3335 // SetPagebreakMode must always be called due to CalcPPT / 
RecalcPixPos()
3336 
3337 // sheet may have become invalid (for instance last version):
3338 SCTAB nNewTab = 
static_cast(o3tl::toInt64(o3tl::getToken(rData, 0, ';', nMainIdx)));
>>> CID 1504074:  Integer handling issues  (NEGATIVE_RETURNS)
>>> "nNewTab" is passed to a parameter that cannot be negative.
3339 if (mrDoc.HasTable(nNewTab))
3340 SetTabNo(nNewTab);
3341 
3342 // if available, get tab bar width:
3343 const sal_Int32 nMainIdxRef {nMainIdx};
3344 std::u16string_view aTabOpt = o3tl::getToken(rData, 0, ';', 
nMainIdx);



To view the defects in Coverity Scan visit, 
https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3D0zDy_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJiaUJNvlCq4ij5DSrRhpFH621TKgDyPEvfdPz8Pt1MppgZYjj2Q5NjlZc4gB-2Bf8A6Q0ojB4m-2FlL3fI1jiMGhCEg8-2BRigHJSrxlZT8R1KdfbIi5YNJNpxJk2K0W3fTjAkHpgREtFlADEu96YR04hw31CyqKk4gYAs3cXLYcFa863yQ-3D



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

2022-04-14 Thread Caolán McNamara (via logerrit)
 include/vcl/syswin.hxx|2 +-
 vcl/source/app/salvtables.cxx |6 +++---
 vcl/source/window/layout.cxx  |2 +-
 vcl/source/window/syswin.cxx  |9 -
 4 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 0d5c5c17a43726c1407d100e440a87ed06966d30
Author: Caolán McNamara 
AuthorDate: Thu Apr 14 10:37:04 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 14 17:15:56 2022 +0200

Resolves: tdf#148476 allow dialog resize buttons to "shrink" again

a problem since:

commit 5d388b94735e34ba445d65e1d5030a646aad7dbe
Date:   Thu Jan 27 12:17:48 2022 +

Related: tdf#146648 let SetWindowState size trump the initial layout 
pref size

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

diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index 03d79f2e3497..24f41331eb21 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -159,7 +159,7 @@ public:
 virtual SizeGetOptimalSize() const override;
 virtual voidqueue_resize(StateChangedType eReason = 
StateChangedType::Layout) override;
 boolisLayoutEnabled() const;
-voidsetOptimalLayoutSize();
+voidsetOptimalLayoutSize(bool bAllowWindowShrink);
 boolisCalculatingInitialLayoutSize() const { return 
mbIsCalculatingInitialLayoutSize; }
 
 voidSetIcon( sal_uInt16 nIcon );
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 7d0a62057231..fad841f45787 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1439,7 +1439,7 @@ void resize_to_request(vcl::Window* pWindow)
 {
 if (SystemWindow* pSysWin = dynamic_cast(pWindow))
 {
-pSysWin->setOptimalLayoutSize();
+pSysWin->setOptimalLayoutSize(true);
 return;
 }
 if (DockingWindow* pDockWin = dynamic_cast(pWindow))
@@ -1695,7 +1695,7 @@ void SalInstanceDialog::collapse(weld::Widget* pEdit, 
weld::Widget* pButton)
 m_xDialog->set_border_width(0);
 if (vcl::Window* pActionArea = m_xDialog->get_action_area())
 pActionArea->Hide();
-m_xDialog->setOptimalLayoutSize();
+m_xDialog->setOptimalLayoutSize(true);
 m_xRefEdit = pRefEdit;
 }
 
@@ -1713,7 +1713,7 @@ void SalInstanceDialog::undo_collapse()
 m_xDialog->set_border_width(m_nOldBorderWidth);
 if (vcl::Window* pActionArea = m_xDialog->get_action_area())
 pActionArea->Show();
-m_xDialog->setOptimalLayoutSize();
+m_xDialog->setOptimalLayoutSize(true);
 }
 
 void SalInstanceDialog::SetInstallLOKNotifierHdl(
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 99b60673b7c0..b67ffeabbfd4 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1812,7 +1812,7 @@ IMPL_LINK( VclExpander, ClickHdl, CheckBox&, rBtn, void )
 queue_resize();
 Dialog* pResizeDialog = m_bResizeTopLevel ? GetParentDialog() : 
nullptr;
 if (pResizeDialog)
-pResizeDialog->setOptimalLayoutSize();
+pResizeDialog->setOptimalLayoutSize(true);
 }
 maExpandedHdl.Call(*this);
 }
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index bf6be3b0ab10..40fff00aa7d9 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -1070,7 +1070,7 @@ void SystemWindow::settingOptimalLayoutSize(Window* 
/*pBox*/)
 {
 }
 
-void SystemWindow::setOptimalLayoutSize()
+void SystemWindow::setOptimalLayoutSize(bool bAllowWindowShrink)
 {
 maLayoutIdle.Stop();
 
@@ -1088,9 +1088,7 @@ void SystemWindow::setOptimalLayoutSize()
 
 SetMinOutputSizePixel(aSize);
 
-if (!mbInitialLayoutSizeCalculated)
-mbInitialLayoutSizeCalculated = true;
-else
+if (!bAllowWindowShrink)
 {
 Size aCurrentSize = GetSizePixel();
 aSize.setWidth(std::max(aSize.Width(), aCurrentSize.Width()));
@@ -1110,7 +1108,8 @@ void SystemWindow::DoInitialLayout()
 {
 mbIsCalculatingInitialLayoutSize = true;
 setDeferredProperties();
-setOptimalLayoutSize();
+setOptimalLayoutSize(!mbInitialLayoutSizeCalculated);
+mbInitialLayoutSizeCalculated = true;
 mbIsCalculatingInitialLayoutSize = false;
 }
 }


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

2022-04-14 Thread Michael Weghorn (via logerrit)
 android/source/AndroidManifest.xml |   
 2 
 android/source/build.gradle|   
 4 -
 android/source/gradle.properties   |   
 2 
 android/source/res/layout/activity_document_browser.xml|   
28 +-
 android/source/res/layout/activity_main.xml|   
14 ++---
 android/source/res/layout/number_picker.xml|   
 4 -
 android/source/res/layout/toolbar_bottom.xml   |   
 2 
 android/source/res/layout/toolbar_color_picker.xml |   
12 ++--
 android/source/src/java/org/libreoffice/AboutDialogFragment.java   |   
 4 -
 android/source/src/java/org/libreoffice/ColorPaletteAdapter.java   |   
 4 -
 android/source/src/java/org/libreoffice/ColorPickerAdapter.java|   
 4 -
 android/source/src/java/org/libreoffice/FontController.java|   
 6 +-
 android/source/src/java/org/libreoffice/FormattingController.java  |   
 4 -
 android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java   |   
10 +--
 android/source/src/java/org/libreoffice/PasswordDialogFragment.java|   
 6 +-
 android/source/src/java/org/libreoffice/PresentationActivity.java  |   
 8 +-
 android/source/src/java/org/libreoffice/ToolbarController.java |   
 2 
 android/source/src/java/org/libreoffice/UNOCommandsController.java |   
 2 
 android/source/src/java/org/libreoffice/canvas/BitmapHandle.java   |   
 2 
 android/source/src/java/org/libreoffice/overlay/CalcHeadersController.java |   
 2 
 android/source/src/java/org/libreoffice/overlay/CalcHeadersView.java   |   
 2 
 android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java  |   
18 +++---
 android/source/src/java/org/libreoffice/ui/RecentFilesAdapter.java |   
 4 -
 configure.ac   |   
 8 --
 24 files changed, 73 insertions(+), 81 deletions(-)

New commits:
commit 70cb4955f1c099b030567e6bf4702f7dc6ee521a
Author: Michael Weghorn 
AuthorDate: Thu Apr 14 11:29:27 2022 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 14 16:49:41 2022 +0200

android: Port from Android Support Lib to AndroidX

Replace the no longer maintained Android Support Library
with the Android Jetpack libraries.

Quoting [1]:

> Version 28.0.0 is the last release of the Support Library. There will be
> no more android.support library releases. All new feature development
> will be in the androidx namespace.

Most porting was done automatically by using Android Studio's
"Refactor" -> "Migrate to AndroidX..." function.

In `android/source/res/layout/toolbar_bottom.xml` and
`android/source/res/layout/toolbar_color_picker.xml`,
the uses of
`app:layout_behavior="android.support.design.widget.BottomSheetBehavior"`
had to be replaced manually as described at [2], because
the app would crash when using the old "android.support"
values.

Also drop the Android Support Library related bits from configure.ac

In a quick test, this worked fine and no obvious
difference was visible when running this in various AVDs.

When trying to test this in an x86 AVD still using
SDK 16 (Android 4.1), which is currently specified
as Android Viewer's `minSdkVersion`, only various
unrelated issues showed up, some of which will be
handled in follow-up commits.

After the migration, many weird errors showed up in
Android Studio, which disappeared after invalidating
the caches (via "File" -> "Invalidate Caches...").

[1] https://developer.android.com/jetpack/androidx
[2] 
https://stackoverflow.com/questions/45100963/runtimeexception-could-not-inflate-behavior-subclass

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

diff --git a/android/source/AndroidManifest.xml 
b/android/source/AndroidManifest.xml
index 987aeed66ae6..43f790fca985 100644
--- a/android/source/AndroidManifest.xml
+++ b/android/source/AndroidManifest.xml
@@ -116,7 +116,7 @@
 
 
 
diff --git a/android/source/build.gradle b/android/source/build.gradle
index a690749ff0ee..7dc93e778a7c 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -27,8 +27,8 @@ dependencies {
 "libreoffice.jar",
 "unoloader.jar"
 ])
-implementation 'com.android.support:design:27.1.1' // also pulls-in 
corresponding support libraries
-implementation 'com.android.support.constraint:constraint-layout:1.1.2'
+implementation 'com.google.android.material:material:1.0.0'
+implementation 'androidx.constraintl

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - officecfg/registry

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

New commits:
commit 75893fb99173f615d9fa40b50dfba147d22967b4
Author: Caolán McNamara 
AuthorDate: Wed Apr 13 17:09:01 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 14 16:36:56 2022 +0200

Resolves: tdf#148122 Celtic MD font appears wrong

Change-Id: Ib551f073b8ea0e0662660ccf01ebf56c2fd7f340
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132868
Reviewed-by: Michael Stahl 
Tested-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 0c7b9d1741a3..72ba024f8bc3 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5581,6 +5581,8 @@
   
 
 
+  
+  Celticmd,1571,-567,1571,-547,2126,559
   
   DIN Light,1509,-503,1509,-483,1997,483
 


ESC meeting minutes: 2022-04-14

2022-04-14 Thread Stephan Bergmann

* Present:
+ sberg, Heiko, caolan, erAck, Gabriel, michaelw, mst, Hossein, 
Thorsten, OHallot, Lubos


* Completed Action Items:
+ add configure warning if MSVC version is older than 16.11 (Hossein)
+ take the updated ESC composition proposal from 2022-04-07 to the 
board (Kendy)


* Pending Action Items:
+ None

* Release Engineering update (Cloph)
+ 7.4 status: feature freeze in June
+ 7.3 status: 7.3.3 rc1
   + tagged, on mirrors
+ 7.2 status: 7.2.7 rc1
   + in one week
+ Remotes: Android, iOS
+ Android viewer
+ issue with odd link-error on Windows ARM tinderbox (Thorsten)
   + updated to latest compiler version, but still failing
   + neither an incremental build, unclear what's the cause
   + will try other boxes whether they fail the same (Cloph)

* Documentation (Olivier)
+ New Help
   + no news
+ Helcontents
   + Updates and fixes (ohallot, fitoshido)

+ Google Seasons of Doc
   + Response in April 14
  + later today
+ Guides
   + Work in progress for Impress and Draw 7.3 (P. Schofield)
   + WIP for Base Guide 7.3 (S. Fanning, Dev, ohallot, flywire)
   + Export HTML of Spanish guide in progress
+ general
   + Testing Discourse forum for Documentation (thx Sophie & Guilhem)
   https://communitytest.documentfoundation.org/c/documentation/8

+ Bugzilla Documentation statistics
218(218) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 36(23)   58(24)117(5)  333(10)
 commented 23(12)   75(7) 324(-24)   1458(4)
  resolved 26(19)   36(19) 69(12) 233(25)
+ top 10 contributors:
  Olivier Hallot made 80 changes in 1 month, and 555 changes in 
1 year
  Seth Chaiklin made 37 changes in 1 month, and 82 changes in 1 
year

  Dieter made 16 changes in 1 month, and 116 changes in 1 year
  Alain Romedenne made 8 changes in 1 month, and 33 changes in 
1 year
  Nabet, Julien made 7 changes in 1 month, and 73 changes in 1 
year
  Ilmari Lauhakangas made 5 changes in 1 month, and 111 changes 
in 1 year

  Heiko Tietze made 4 changes in 1 month, and 87 changes in 1 year
  steve -_- made 4 changes in 1 month, and 7 changes in 1 year
  Telesto made 4 changes in 1 month, and 24 changes in 1 year
  Xisco Fauli made 4 changes in 1 month, and 83 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
268(268) (topicUI) bugs open, 91(91) (needsUXEval) needs to be 
evaluated by the UXteam

+ Updates:
BZ changes   1 week1 month3 months   12 months
 added  9(-12)24(0)  36(0)   61(-2)
 commented 91(11)218(-15)   677(27)2639(-80)
   removed  2(2)   5(1)  16(2)   36(0)
  resolved  8(0)  28(2) 103(1)  393(-14)
+ top 10 contributors:
  Heiko Tietze made 225 changes in 1 month, and 1975 changes in 
1 year
  Ilmari Lauhakangas made 55 changes in 1 month, and 293 
changes in 1 year
  Seth Chaiklin made 40 changes in 1 month, and 99 changes in 1 
year
  Roman Kuznetsov made 31 changes in 1 month, and 218 changes 
in 1 year
  Eyal Rozenberg made 31 changes in 1 month, and 118 changes in 
1 year

  Telesto made 24 changes in 1 month, and 274 changes in 1 year
  Dieter made 19 changes in 1 month, and 234 changes in 1 year
  Robert Großkopf made 13 changes in 1 month, and 28 changes in 
1 year

  Cor Nouws made 12 changes in 1 month, and 37 changes in 1 year
  Timur made 12 changes in 1 month, and 125 changes in 1 year
   + 23 new tickets with needsUXEval Apr/07-14
   + [Bug 148593] "Left page border" and "right page border" options 
for Horizontal
  "to" position in Position and Size for shapes are misleading 
names, which

  should be changed
   + [Bug 148272] Cross-reference to numbering wrongly includes 
separator character
   + [Bug 148591] Rename "page text area top" and "page text area 
bottom" to "Above

  (or Below) page text area
   + [Bug 148568] Rework the Sparklines dialog
-> + [Bug 86297] Wrong Field reference when heading is in a frame
 + interesting abuse of frames to misplace outlines
   + [Bug 71991] FORMATTING: arrow end default sizes incoherent with 
"Synchronize

  end" checked by default
   + [Bug 148533] Selecting an Arrow Style in Arrow Styles tab changes 
the arrow style

  of a selected line
-> + [Bug 148523] Table properties changes only a cell in Impress (full 
table expected)
 + Writer smart-selects the unformatted cells and proposal is to do 
the same for

   Draw/Impress
   + [Bug 148519] Change "Margin" to "Entire Frame" in "to" field for 
Vertical Position

  when anchoring "To frame" in Position and Shape tab
   

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

2022-04-14 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/doc/objmisc.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit bfc43aad0e8eb90e9d3495b940bc2283081f04c6
Author: Samuel Mehrbrodt 
AuthorDate: Wed Apr 13 08:01:29 2022 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Thu Apr 14 16:15:25 2022 +0200

Prevent save interception when sharing Calc doc

Using the dispatch mechanism means that this can be caught by the dispatch 
interceptor
which we don't want in this place.

Change-Id: Ie7e5f92e6043e2aff98d4887829a3573c12c6d08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132941
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 9acfe6d1651b..a09a7ac9feef 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -97,6 +97,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "objstor.hxx"
 #include 
@@ -507,9 +508,16 @@ bool SfxObjectShell::SwitchToShared( bool bShared, bool 
bSave )
 {
 // TODO/LATER: currently the application guards against the 
reentrance problem
 SetModified(); // the modified flag has to be set to let the 
document be stored with the shared flag
-const SfxPoolItem* pItem = 
pViewFrame->GetBindings().ExecuteSynchron( HasName() ? SID_SAVEDOC : 
SID_SAVEASDOC );
-const SfxBoolItem* pResult = dynamic_cast( 
pItem  );
-bResult = ( pResult && pResult->GetValue() );
+try
+{
+// Do *not* use dispatch mechanism in this place - we 
don't want others (extensions etc.) to intercept this.
+pImpl->pBaseModel->store();
+bResult = true;
+}
+catch (...)
+{
+bResult = false;
+}
 }
 }
 


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

2022-04-14 Thread Caolán McNamara (via logerrit)
 fpicker/source/office/autocmpledit.cxx |   25 -
 fpicker/source/office/autocmpledit.hxx |2 ++
 sfx2/source/appl/newhelp.cxx   |1 +
 svx/source/table/tablecontroller.cxx   |2 ++
 4 files changed, 29 insertions(+), 1 deletion(-)

New commits:
commit 3f793465819f63aa001f5842f232be24d13153fd
Author: Caolán McNamara 
AuthorDate: Thu Apr 14 12:05:49 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 14 16:10:37 2022 +0200

tdf#148101 don't autocomplete remote files dialog entry on delete/backspace

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

diff --git a/fpicker/source/office/autocmpledit.cxx 
b/fpicker/source/office/autocmpledit.cxx
index 5a31c7bdc501..89a2d0b0c245 100644
--- a/fpicker/source/office/autocmpledit.cxx
+++ b/fpicker/source/office/autocmpledit.cxx
@@ -7,21 +7,44 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
 #include "autocmpledit.hxx"
 
 AutocompleteEdit::AutocompleteEdit(std::unique_ptr xEntry)
 : m_xEntry(std::move(xEntry))
 , m_aChangedIdle("fpicker::AutocompleteEdit m_aChangedIdle")
+, m_nLastCharCode(0)
 {
 m_xEntry->connect_changed(LINK(this, AutocompleteEdit, ChangedHdl));
+m_xEntry->connect_key_press(LINK(this, AutocompleteEdit, KeyInputHdl));
 
 m_aChangedIdle.SetInvokeHandler(LINK(this, AutocompleteEdit, 
TryAutoComplete));
 }
 
+IMPL_LINK(AutocompleteEdit, KeyInputHdl, const KeyEvent&, rKEvt, bool)
+{
+m_nLastCharCode = rKEvt.GetKeyCode().GetCode();
+return false;
+}
+
 IMPL_LINK_NOARG(AutocompleteEdit, ChangedHdl, weld::Entry&, void)
 {
 m_aChangeHdl.Call(*m_xEntry);
-m_aChangedIdle.Start(); //launch this to happen on idle after cursor 
position will have been set
+
+switch (m_nLastCharCode)
+{
+case css::awt::Key::DELETE_WORD_BACKWARD:
+case css::awt::Key::DELETE_WORD_FORWARD:
+case css::awt::Key::DELETE_TO_BEGIN_OF_LINE:
+case css::awt::Key::DELETE_TO_END_OF_LINE:
+case KEY_BACKSPACE:
+case KEY_DELETE:
+m_aChangedIdle.Stop();
+break;
+default:
+m_aChangedIdle.Start(); //launch this to happen on idle after 
cursor position will have been set
+break;
+}
 }
 
 void AutocompleteEdit::AddEntry( const OUString& rEntry )
diff --git a/fpicker/source/office/autocmpledit.hxx 
b/fpicker/source/office/autocmpledit.hxx
index bfb2ee096a63..3eb79eb14aa6 100644
--- a/fpicker/source/office/autocmpledit.hxx
+++ b/fpicker/source/office/autocmpledit.hxx
@@ -22,7 +22,9 @@ private:
 std::vector m_aMatching;
 Idle m_aChangedIdle;
 Link m_aChangeHdl;
+sal_uInt16 m_nLastCharCode;
 
+DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
 DECL_LINK(ChangedHdl, weld::Entry&, void);
 DECL_LINK(TryAutoComplete, Timer*, void);
 
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 58818c3a248d..a120a99f41bb 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -475,6 +475,7 @@ IMPL_LINK_NOARG(IndexTabPage_Impl, EntryChangeHdl, 
weld::Entry&, void)
 case css::awt::Key::DELETE_TO_END_OF_LINE:
 case KEY_BACKSPACE:
 case KEY_DELETE:
+aAutoCompleteIdle.Stop();
 break;
 default:
 aAutoCompleteIdle.Start();
commit ae0e7e3918284c31a91acca0f733919926ae3a62
Author: Caolán McNamara 
AuthorDate: Thu Apr 14 11:20:23 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 14 16:10:20 2022 +0200

tdf#141812 keep focus in an impress table cell when row/col deleted

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

diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 3a60e5c773ac..8ef76acd377e 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -827,6 +827,7 @@ void SvxTableController::onDelete( sal_uInt16 nSId )
 {
 Reference< XTableColumns > xCols( mxTable->getColumns() );
 xCols->removeByIndex( aStart.mnCol, nRemovedColumns );
+EditCell(aStart, nullptr, TblAction::NONE);
 }
 break;
 }
@@ -842,6 +843,7 @@ void SvxTableController::onDelete( sal_uInt16 nSId )
 {
 Reference< XTableRows > xRows( mxTable->getRows() );
 xRows->removeByIndex( aStart.mnRow, nRemovedRows );
+EditCell(aStart, nullptr, TblAction::NONE);
 }
 break;
 }


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

2022-04-14 Thread Noel Grandin (via logerrit)
 dbaccess/qa/extras/hsql_schema_import.cxx  |   16 +++---
 dbaccess/source/filter/hsqldb/createparser.cxx |   60 -
 dbaccess/source/filter/hsqldb/createparser.hxx |4 -
 dbaccess/source/filter/hsqldb/utils.cxx|   12 ++---
 dbaccess/source/filter/hsqldb/utils.hxx|2 
 5 files changed, 48 insertions(+), 46 deletions(-)

New commits:
commit 590323f4235e5ec3de2dc6dee28a4f03288ac6d7
Author: Noel Grandin 
AuthorDate: Thu Apr 14 12:19:57 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Apr 14 16:00:47 2022 +0200

use more string_view in dbaccess

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

diff --git a/dbaccess/qa/extras/hsql_schema_import.cxx 
b/dbaccess/qa/extras/hsql_schema_import.cxx
index 6d714ae9a8ae..f5f34d38b69a 100644
--- a/dbaccess/qa/extras/hsql_schema_import.cxx
+++ b/dbaccess/qa/extras/hsql_schema_import.cxx
@@ -62,7 +62,7 @@ public:
 void HsqlSchemaImportTest::testIntegerPrimaryKeyNotNull()
 {
 FbCreateStmtParser aCreateParser;
-aCreateParser.parse("CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT 
NULL PRIMARY KEY)");
+aCreateParser.parse(u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT 
NULL PRIMARY KEY)");
 
 CPPUNIT_ASSERT_EQUAL(OUString{ "\"myTable\"" }, 
aCreateParser.getTableName());
 const auto& columns = aCreateParser.getColumnDef();
@@ -79,7 +79,7 @@ void HsqlSchemaImportTest::testVarcharWithParam()
 {
 FbCreateStmtParser aCreateParser;
 aCreateParser.parse(
-"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, 
\"myText\" "
+u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, 
\"myText\" "
 "VARCHAR(50))");
 
 const auto& columns = aCreateParser.getColumnDef();
@@ -101,7 +101,7 @@ void HsqlSchemaImportTest::testVarcharWithoutParam()
 {
 FbCreateStmtParser aCreateParser;
 aCreateParser.parse(
-"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, 
\"myText\" "
+u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, 
\"myText\" "
 "VARCHAR)");
 
 const auto& columns = aCreateParser.getColumnDef();
@@ -116,7 +116,7 @@ void HsqlSchemaImportTest::testNumericWithTwoParam()
 {
 FbCreateStmtParser aCreateParser;
 aCreateParser.parse(
-"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, 
\"Betrag\" "
+u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, 
\"Betrag\" "
 "NUMERIC(8,2))");
 
 const auto& columns = aCreateParser.getColumnDef();
@@ -137,7 +137,7 @@ void HsqlSchemaImportTest::testIntegerAutoincremental()
 {
 FbCreateStmtParser aCreateParser;
 aCreateParser.parse(
-"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY 
GENERATED "
+u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY 
GENERATED "
 "BY DEFAULT AS IDENTITY(START WITH 0), \"myText\" VARCHAR(50))");
 
 const auto& columns = aCreateParser.getColumnDef();
@@ -157,7 +157,7 @@ void HsqlSchemaImportTest::testTimestampWithParam()
 {
 FbCreateStmtParser aCreateParser;
 aCreateParser.parse(
-"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, 
\"myText\" "
+u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, 
\"myText\" "
 "TIMESTAMP(0))");
 
 const auto& columns = aCreateParser.getColumnDef();
@@ -179,7 +179,7 @@ void HsqlSchemaImportTest::testDefaultValueNow()
 {
 FbCreateStmtParser aCreateParser;
 aCreateParser.parse(
-"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, 
\"myDate\" "
+u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT NULL PRIMARY KEY, 
\"myDate\" "
 "TIMESTAMP DEFAULT NOW)");
 
 const auto& columns = aCreateParser.getColumnDef();
@@ -194,7 +194,7 @@ void HsqlSchemaImportTest::testDefaultValueNow()
 void HsqlSchemaImportTest::testEvilNullColumnName()
 {
 FbCreateStmtParser aCreateParser;
-aCreateParser.parse("CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT 
NULL PRIMARY KEY, "
+aCreateParser.parse(u"CREATE CACHED TABLE \"myTable\"(\"id\" INTEGER NOT 
NULL PRIMARY KEY, "
 "\"myEvilNOT NULLName\" "
 "VARCHAR(20))");
 
diff --git a/dbaccess/source/filter/hsqldb/createparser.cxx 
b/dbaccess/source/filter/hsqldb/createparser.cxx
index c62640e8bc3f..03952655dfd8 100644
--- a/dbaccess/source/filter/hsqldb/createparser.cxx
+++ b/dbaccess/source/filter/hsqldb/createparser.cxx
@@ -23,6 +23,7 @@
 #include "createparser.hxx"
 #include "utils.hxx"
 #include 
+#include 
 
 using namespace ::comphelper;
 using namespace css::sdbc;
@@ -31,16 +32,17 @@ namespace
 {
 /// Returns substring of sSql from the first occurrence of '(' until the
 /// last 

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

2022-04-14 Thread Noel Grandin (via logerrit)
 chart2/qa/extras/PivotChartTest.cxx  |4 
 chart2/qa/extras/chart2_trendcalculators.cxx |2 
 chart2/qa/extras/chart2export.cxx|  186 +--
 chart2/qa/extras/chart2export2.cxx   |  142 
 chart2/qa/extras/chart2geometry.cxx  |   28 -
 chart2/qa/extras/chart2import.cxx|  162 -
 chart2/qa/extras/chart2import2.cxx   |   74 ++--
 chart2/qa/extras/charttest.hxx   |   22 -
 chart2/qa/extras/xshape/chart2xshape.cxx |   12 
 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx  |   27 -
 chart2/source/controller/dialogs/ObjectNameProvider.cxx  |5 
 chart2/source/controller/dialogs/dlg_ObjectProperties.cxx|4 
 chart2/source/controller/main/ChartController_Properties.cxx |9 
 chart2/source/controller/main/ChartController_Tools.cxx  |4 
 chart2/source/inc/ObjectIdentifier.hxx   |   12 
 chart2/source/tools/ObjectIdentifier.cxx |   85 ++---
 chart2/source/tools/XMLRangeHelper.cxx   |4 
 17 files changed, 393 insertions(+), 389 deletions(-)

New commits:
commit dbe92dcfa79e3336411661fc94106deeba9317d6
Author: Noel Grandin 
AuthorDate: Thu Apr 14 11:45:25 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Apr 14 15:13:34 2022 +0200

use more string_view in chart2

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

diff --git a/chart2/qa/extras/PivotChartTest.cxx 
b/chart2/qa/extras/PivotChartTest.cxx
index ee024531e88b..baa1c925132e 100644
--- a/chart2/qa/extras/PivotChartTest.cxx
+++ b/chart2/qa/extras/PivotChartTest.cxx
@@ -316,7 +316,7 @@ void PivotChartTest::testRoundtrip()
 
 std::vector aReference2 { 101879.458079, 178636.929704, 
314626.484864 };
 
-load(u"/chart2/qa/extras/data/ods/", "PivotChartRoundTrip.ods");
+load(u"/chart2/qa/extras/data/ods/", u"PivotChartRoundTrip.ods");
 
 xChartDoc = getPivotChartDocFromSheet(1, mxComponent);
 CPPUNIT_ASSERT(xChartDoc.is());
@@ -371,7 +371,7 @@ void PivotChartTest::testChangePivotTable()
 uno::Sequence xSequence;
 Reference xChartDoc;
 
-load(u"/chart2/qa/extras/data/ods/", "PivotTableExample.ods");
+load(u"/chart2/qa/extras/data/ods/", u"PivotTableExample.ods");
 
 // Check we have the Pivot Table
 OUString sPivotTableName("DataPilot1");
diff --git a/chart2/qa/extras/chart2_trendcalculators.cxx 
b/chart2/qa/extras/chart2_trendcalculators.cxx
index c13c1666725e..309df9f2bfb4 100644
--- a/chart2/qa/extras/chart2_trendcalculators.cxx
+++ b/chart2/qa/extras/chart2_trendcalculators.cxx
@@ -64,7 +64,7 @@ private:
 void Chart2TrendCalculators::setUp()
 {
 ChartTest::setUp();
-load(u"/chart2/qa/extras/data/ods/", "trend_calculators.ods");
+load(u"/chart2/qa/extras/data/ods/", u"trend_calculators.ods");
 }
 
 void Chart2TrendCalculators::tearDown()
diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index c333ab9d651e..fc6ffc4d4dbf 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -385,7 +385,7 @@ void checkTrendlinesInChart(uno::Reference< 
chart2::XChartDocument > const & xCh
 // improve the test
 void Chart2ExportTest::testErrorBarXLSX()
 {
-load(u"/chart2/qa/extras/data/ods/", "error_bar.ods");
+load(u"/chart2/qa/extras/data/ods/", u"error_bar.ods");
 {
 // make sure the ODS import was successful
 uno::Reference< chart2::XChartDocument > xChartDoc = 
getChartDocFromSheet( 0, mxComponent );
@@ -421,7 +421,7 @@ void Chart2ExportTest::testErrorBarXLSX()
 
 void Chart2ExportTest::testErrorBarPropXLSX()
 {
-load(u"/chart2/qa/extras/data/xlsx/", "testErrorBarProp.xlsx");
+load(u"/chart2/qa/extras/data/xlsx/", u"testErrorBarProp.xlsx");
 xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open 
XML");
 CPPUNIT_ASSERT(pXmlDoc);
 
@@ -441,7 +441,7 @@ void Chart2ExportTest::testErrorBarPropXLSX()
 void Chart2ExportTest::testTrendline()
 {
 mbSkipValidation = true;
-load(u"/chart2/qa/extras/data/ods/", "trendline.ods");
+load(u"/chart2/qa/extras/data/ods/", u"trendline.ods");
 checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent));
 reload("calc8");
 checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent));
@@ -449,7 +449,7 @@ void Chart2ExportTest::testTrendline()
 
 void Chart2ExportTest::testTrendlineOOXML()
 {
-load(u"/chart2/qa/extras/data/ods/", "trendline.ods");
+load(u"/chart2/qa/extras/data/ods/", u"trendline.ods");
 checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent));
 reload("Calc Office Open XML");
 checkTrendlinesInChart(getChartDocFromSheet( 0, mxC

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 9 commits - basctl/source chart2/source include/sfx2 oox/inc oox/source sc/qa sc/source sd/qa sfx2/source ucb/source vcl/inc vcl/qt

2022-04-14 Thread Michael Stahl (via logerrit)
 basctl/source/basicide/baside3.cxx |2 
 chart2/source/controller/dialogs/tp_Scale.cxx  |7 +
 include/sfx2/dialoghelper.hxx  |5 -
 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/qa/unit/tiledrendering/tiledrendering.cxx   |   30 ++-
 sc/source/ui/docshell/impex.cxx|2 
 sc/source/ui/miscdlgs/sharedocdlg.cxx  |6 -
 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 
 sfx2/source/dialog/dialoghelper.cxx|8 -
 sfx2/source/dialog/versdlg.cxx |8 -
 ucb/source/ucp/webdav-curl/CurlSession.cxx |   20 
 vcl/inc/qt5/QtFrame.hxx|3 
 vcl/inc/qt5/QtWidget.hxx   |2 
 vcl/qt5/QtFrame.cxx|8 +
 vcl/qt5/QtWidget.cxx   |   19 
 vcl/win/window/salframe.cxx|5 -
 22 files changed, 258 insertions(+), 38 deletions(-)

New commits:
commit 5041e2901513b46df7881d492ebe941324793a69
Author: Michael Stahl 
AuthorDate: Wed Apr 13 16:50:30 2022 +0200
Commit: Andras Timar 
CommitDate: Thu Apr 14 14:02:12 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.

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

ucb: webdav-curl: oops, increment after checking
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132982
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
(cherry picked from commit ab65a74998b498ff49c15db87fc14a9afa89d8bf)

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

diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index 70f9f828467d..813988c78489 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -1223,6 +1223,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
@@ -1365,7 +1367,14 @@ 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)
 {
 ::std::optional const 
oRealm(ExtractRealm(
 headers, statusCode == SC_UNAUTHORIZED ? 
"WWW-Authenticate"
@@ -1383,7 +1392,14 @@ 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);
+++rnAuthRequests;
 
 // Ask user via XInteractionHandler.
 // Warning: This likely runs a

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 11 commits - connectivity/source cui/uiconfig sc/inc sc/qa sc/source sw/qa sw/source vcl/inc vcl/qt5 vcl/source writerfilter/source

2022-04-14 Thread Dennis Francis (via logerrit)
 connectivity/source/drivers/dbase/DTable.cxx|2 
 cui/uiconfig/ui/optviewpage.ui  |4 
 sc/inc/scmod.hxx|2 
 sc/qa/unit/tiledrendering/data/validity.xlsx|binary
 sc/qa/unit/tiledrendering/tiledrendering.cxx|   57 +++-
 sc/source/core/data/column2.cxx |2 
 sc/source/ui/app/inputhdl.cxx   |   12 +
 sc/source/ui/app/scmod.cxx  |4 
 sc/source/ui/inc/inputhdl.hxx   |2 
 sc/source/ui/view/tabvwsha.cxx  |   11 +
 sw/qa/extras/rtfexport/data/tdf95706_2.rtf  |   17 ++
 sw/qa/extras/rtfexport/rtfexport4.cxx   |   12 +
 sw/source/core/text/porfld.cxx  |   14 +-
 sw/source/ui/dbui/mmoutputtypepage.cxx  |4 
 vcl/inc/qt5/QtMenu.hxx  |1 
 vcl/qt5/QtData.cxx  |2 
 vcl/qt5/QtMenu.cxx  |8 -
 vcl/source/outdev/text.cxx  |2 
 writerfilter/source/rtftok/rtfdispatchvalue.cxx |4 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx  |  162 +---
 writerfilter/source/rtftok/rtfdocumentimpl.hxx  |1 
 21 files changed, 220 insertions(+), 103 deletions(-)

New commits:
commit 0a8e00063ef6868c1a661c883ccb5b2a93325925
Author: Dennis Francis 
AuthorDate: Thu Apr 7 13:14:59 2022 +0530
Commit: Andras Timar 
CommitDate: Thu Apr 14 13:55:19 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.

Conflicts:
sc/qa/unit/tiledrendering/tiledrendering.cxx

Change-Id: Idffd6d647034e128d0d800fe8e29efc333c03db6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132657
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

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 09c198adbf1b..e17bf999a010 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -126,6 +126,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:
@@ -2691,18 +2693,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::testAutoInputStringBlock()
@@ -3044,6 +3053,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());
+CP

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

2022-04-14 Thread Stephan Bergmann (via logerrit)
 include/o3tl/string_view.hxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 871adb006645d0fd5eeecab70ea4c937de85c38e
Author: Stephan Bergmann 
AuthorDate: Thu Apr 14 11:00:36 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Apr 14 13:29:41 2022 +0200

Fix comment again

...which had been butchered by c7fb93764b321e5bf4cd143dd0c29be60de6d8f8 
"Cleanup
comment":  e4ff847fe0796420ba8023b70cad8589f5f19e9f "loplugin:stringview 
check
for getToken and trim" had turned this into a template, but had not lifted 
the
other restrictions.  But while at it, also adapt the mention of "OString" 
and
"std::string_view" in the comment to that
e4ff847fe0796420ba8023b70cad8589f5f19e9f change.

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

diff --git a/include/o3tl/string_view.hxx b/include/o3tl/string_view.hxx
index dec21bd70338..eb98e243c8b1 100644
--- a/include/o3tl/string_view.hxx
+++ b/include/o3tl/string_view.hxx
@@ -48,8 +48,9 @@ inline int compareToIgnoreAsciiCase(std::u16string_view s1, 
std::u16string_view
 return rtl_ustr_compareIgnoreAsciiCase_WithLength(s1.data(), s1.size(), 
s2.data(), s2.size());
 };
 
-// Similar to OString::getToken, returning the first token of a 
std::string_view, starting at a
-// given position:
+// Similar to O[U]String::getToken, returning the first token of a 
std::[u16]string_view, starting
+// at a given position (and if needed, it can be extended to return the n'th 
token instead of just
+// the first, or support an initial position of npos):
 template >
 inline std::basic_string_view 
getToken(std::basic_string_view sv,
   charT delimiter, 
std::size_t& position)


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

2022-04-14 Thread Luboš Luňák (via logerrit)
 sc/inc/column.hxx  |5 +
 sc/qa/unit/data/xlsx/too-many-cols-rows.xlsx   |binary
 sc/qa/unit/subsequent_filters_test2.cxx|6 ++
 sc/source/core/data/column.cxx |4 -
 sc/source/core/data/document.cxx   |   18 +++---
 sc/source/core/data/table2.cxx |5 -
 sc/source/core/data/table3.cxx |6 ++
 sc/source/core/data/table4.cxx |1 
 sc/source/filter/oox/excelfilter.cxx   |   74 -
 sc/source/filter/xml/XMLStylesExportHelper.cxx |1 
 sc/source/ui/view/viewdata.cxx |8 ++
 11 files changed, 51 insertions(+), 77 deletions(-)

New commits:
commit b22d37182ff6c7fd9a40aec8f412760cb440bbaa
Author: Luboš Luňák 
AuthorDate: Tue Apr 12 13:01:13 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Apr 14 13:12:32 2022 +0200

compress row height calculation (tdf#148492)

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

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 76ec80c44ac2..62bdca38a3e4 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -2994,8 +2994,14 @@ void ScViewData::RecalcPixPos() // after 
zoom changes
 
 tools::Long nPixPosY = 0;
 SCROW nPosY = pThisTab->nPosY[eWhich];
+tools::Long nRowHeight = -1;
+SCROW nLastSameHeightRow = -1;
 for (SCROW j=0; jnPixPosY[eWhich] = nPixPosY;
 }
 }
commit 62a80bf2cd2b876989e39b535710f017b8250f86
Author: Luboš Luňák 
AuthorDate: Wed Mar 30 12:00:25 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Apr 14 13:12:23 2022 +0200

don't clamp columns to allocated ones for flags

Flags and attributes can be set even for unallocated columns.

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

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index bc5a523ebffe..415507f313e1 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -2640,8 +2640,6 @@ bool ScTable::IsBlockEditable( SCCOL nCol1, SCROW nRow1, 
SCCOL nCol2,
 *pOnlyNotBecauseOfMatrix = false;
 return false;
 }
-nCol1 = ClampToAllocatedColumns(nCol1);
-nCol2 = ClampToAllocatedColumns(nCol2);
 
 bool bIsEditable = true;
 if ( nLockCount )
commit 0de230a0a3edf64402cdeda379fd039fccda2462
Author: Luboš Luňák 
AuthorDate: Wed Mar 23 11:48:09 2022 +0100
Commit: Luboš Luňák 
CommitDate: Thu Apr 14 13:12:15 2022 +0200

handle xlsx with too large sheets the same way as e.g. ods

The generic approach sets an error code on import and then
SfxBaseModel::handleLoadError() takes care of it. This also
allows checking for the warning in unittests. A drawback is
that this generic approach can handle only one error code,
so if a sheets has too many rows and column, there will be
only one warning, but I consider that to be minor.

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

diff --git a/sc/qa/unit/data/xlsx/too-many-cols-rows.xlsx 
b/sc/qa/unit/data/xlsx/too-many-cols-rows.xlsx
new file mode 100644
index ..45ef9a11f5e8
Binary files /dev/null and b/sc/qa/unit/data/xlsx/too-many-cols-rows.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx 
b/sc/qa/unit/subsequent_filters_test2.cxx
index 70466d7816c8..ead6c8da4070 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -3061,6 +3061,12 @@ void ScFiltersTest2::testTooManyColsRows()
 CPPUNIT_ASSERT(xDocSh->GetErrorCode() == SCWARN_IMPORT_ROW_OVERFLOW
|| xDocSh->GetErrorCode() == SCWARN_IMPORT_COLUMN_OVERFLOW);
 xDocSh->DoClose();
+
+xDocSh = loadDoc(u"too-many-cols-rows.", FORMAT_XLSX);
+CPPUNIT_ASSERT(xDocSh.is());
+CPPUNIT_ASSERT(xDocSh->GetErrorCode() == SCWARN_IMPORT_ROW_OVERFLOW
+   || xDocSh->GetErrorCode() == SCWARN_IMPORT_COLUMN_OVERFLOW);
+xDocSh->DoClose();
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(ScFiltersTest2);
diff --git a/sc/source/filter/oox/excelfilter.cxx 
b/sc/source/filter/oox/excelfilter.cxx
index e5815200e063..e73e0204c50f 100644
--- a/sc/source/filter/oox/excelfilter.cxx
+++ b/sc/source/filter/oox/excelfilter.cxx
@@ -33,11 +33,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
 
 namespace oox::xls {
@@ -108,66 +103,23 @@ bool ExcelFilter::importDocument()
 WorkbookGlobalsRef xBookGlob(WorkbookHelper::constructGlobals(*this));
 if (xBoo

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

2022-04-14 Thread Justin Luth (via logerrit)
 sw/source/filter/ww8/ww8atr.cxx |   10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 206efef78ea367de76f000a1760dbd8bc7785b0c
Author: Justin Luth 
AuthorDate: Thu Apr 7 08:30:54 2022 +0200
Commit: Justin Luth 
CommitDate: Thu Apr 14 13:04:30 2022 +0200

tdf#148380 sw ms export: DI_EDIT is simply EDITTIME

There can be no author related to total editing time,
and SAVEDATE is the modified date, so this was all
completely bogus code.

No unit tests hit SAVEDATE on a make check assert.

This all came from very early 2000 code,
at which point DI_CHANGE only handled AUTHOR,
so likely things were very confused back then,
and when SAVEDATE was connected with DI_CHANGE in 2003,
they failed to remove it from DI_EDIT.

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

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 551152e875f8..72bdc213f4b3 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2932,6 +2932,9 @@ void AttributeOutputBase::TextField( const SwFormatField& 
rField )
 case DI_DOCNO:
 eField = ww::eREVNUM;
 break;
+case DI_EDIT:
+eField = ww::eEDITTIME;
+break;
 case DI_CREATE:
 if (DI_SUB_AUTHOR == (nSubType & DI_SUB_MASK))
 eField = ww::eAUTHOR;
@@ -2954,13 +2957,6 @@ void AttributeOutputBase::TextField( const 
SwFormatField& rField )
 GetExport().GetNumberFormat(*pField, sStr))
 eField = ww::ePRINTDATE;
 break;
-case DI_EDIT:
-if( DI_SUB_AUTHOR != (nSubType & DI_SUB_MASK ) &&
-GetExport().GetNumberFormat( *pField, sStr ))
-eField = ww::eSAVEDATE;
-else
-eField = ww::eEDITTIME;
-break;
 case DI_CUSTOM:
 eField = ww::eDOCPROPERTY;
 {


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - ucb/source

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

New commits:
commit d98aa6397dce8c3ad27cee7faaeb3048c5933b75
Author: Michael Stahl 
AuthorDate: Wed Apr 13 16:50:30 2022 +0200
Commit: Michael Stahl 
CommitDate: Thu Apr 14 12:15:44 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.

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

ucb: webdav-curl: oops, increment after checking
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132982
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
(cherry picked from commit ab65a74998b498ff49c15db87fc14a9afa89d8bf)

Change-Id: Ib2333b371a770999e8407ce7e1af21512aadb70d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132867
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 6b54e6a8e64233de63b826211b81a8ed6767483f)

diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index bddefa1ad117..dbc2e45cd3eb 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -1222,6 +1222,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
@@ -1364,7 +1366,14 @@ 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)
 {
 ::std::optional const 
oRealm(ExtractRealm(
 headers, statusCode == SC_UNAUTHORIZED ? 
"WWW-Authenticate"
@@ -1382,7 +1391,14 @@ 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);
+++rnAuthRequests;
 
 // Ask user via XInteractionHandler.
 // Warning: This likely runs an event loop which 
may


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

2022-04-14 Thread Caolán McNamara (via logerrit)
 offapi/com/sun/star/frame/status/ItemState.idl |   12 ++--
 vcl/unx/gtk3/gtkinst.cxx   |2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit dfafd186f5884bfb7a19582b36677a051bde8101
Author: Caolán McNamara 
AuthorDate: Thu Apr 14 09:30:00 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 14 12:16:44 2022 +0200

warning: explicit link request to 'ItemState' could not be resolved

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

diff --git a/offapi/com/sun/star/frame/status/ItemState.idl 
b/offapi/com/sun/star/frame/status/ItemState.idl
index 011f5ba2b6fd..c4c02d56c821 100644
--- a/offapi/com/sun/star/frame/status/ItemState.idl
+++ b/offapi/com/sun/star/frame/status/ItemState.idl
@@ -46,12 +46,12 @@ constants ItemState
  * anymore due to not being used, so remove for simplification
  * reasons and to prepare rework of Item/ItemSet/ItemPool stuff.
  *
- * There are only three usages of ::ItemState in the code which
- * all set the internal SfxItem to SfxVoidItem when triggered,
- * which is equivalent to state SfxItemState::DISABLED (see
- * e.g. SfxItemSet::GetItemState), so READ_ONLY gets not used
- * in internal handling, even when eventually existing UNO API
- * usages hand it over the office.
+ * There are only three usages of com::sun::star::frame::status::ItemState
+ * in the code which all set the internal SfxItem to SfxVoidItem when
+ * triggered, which is equivalent to state SfxItemState::DISABLED (see e.g.
+ * SfxItemSet::GetItemState), so READ_ONLY gets not used in internal
+ * handling, even when eventually existing UNO API usages hand it over the
+ * office.
  */
 const short READ_ONLY  = 2;
 
commit a8f89d5a6240b5e374e19c0c4df377f8b1f80e2f
Author: Caolán McNamara 
AuthorDate: Thu Apr 14 09:13:35 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 14 12:16:30 2022 +0200

tdf#148197 gtk_tree_row_reference_new_proxy warning on docking navigator

Gtk-CRITICAL **: 09:05:11.124: gtk_tree_row_reference_new_proxy: assertion 
'path->depth > 0' failed

from TreeView::set_cursor(-1)

gtk_tree_view_set_cursor is ok (and documented as such) with an
"invalid" path to unset the cursor, but there isn't the same for
gtk_tree_view_scroll_to_cell, though there null is docs as acceptable.

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

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 4d6679a31ef7..42e5b6971b8c 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -14682,7 +14682,7 @@ public:
 virtual void set_cursor(int pos) override
 {
 disable_notify_events();
-GtkTreePath* path = gtk_tree_path_new_from_indices(pos, -1);
+GtkTreePath* path = pos != -1 ? gtk_tree_path_new_from_indices(pos, 
-1) : nullptr;
 gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, false, 0, 0);
 gtk_tree_view_set_cursor(m_pTreeView, path, nullptr, false);
 gtk_tree_path_free(path);


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

2022-04-14 Thread Stephan Bergmann (via logerrit)
 hwpfilter/source/fontmap.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit c36f9e981d583c5f62943db9cf4116cbda0f0501
Author: Stephan Bergmann 
AuthorDate: Wed Apr 13 17:53:58 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Apr 14 11:41:21 2022 +0200

Pick a better variable type

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

diff --git a/hwpfilter/source/fontmap.cxx b/hwpfilter/source/fontmap.cxx
index fcd6c4822169..7eba07c03ad3 100644
--- a/hwpfilter/source/fontmap.cxx
+++ b/hwpfilter/source/fontmap.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #ifdef __sun
 #include 
@@ -151,7 +152,7 @@ const char* const RepFontTab[] =
 
 int getRepFamilyName(const char* orig, char *buf, double &ratio)
 {
-for( int i = 0 ; i < int(SAL_N_ELEMENTS(FontMapTab)); i++)
+for( std::size_t i = 0 ; i < SAL_N_ELEMENTS(FontMapTab); i++)
 {
 if( !strcmp(orig, FontMapTab[i].familyname) ){
 ratio = FontMapTab[i].ratio;


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

2022-04-14 Thread Luboš Luňák (via logerrit)
 vcl/source/gdi/impglyphitem.cxx |   30 +++---
 1 file changed, 19 insertions(+), 11 deletions(-)

New commits:
commit 4fc3466d23010d9553c31c662650072483b81588
Author: Luboš Luňák 
AuthorDate: Thu Apr 14 09:19:35 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Apr 14 11:31:30 2022 +0200

do not cache layout glyphs if fallback is involved

In some rare cases (CppunitTest_writerperfect_writer can trigger them
on Win/Mac) the fonts used for fallback change and it's not included
in the cache key.

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

diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index ab615ae270b0..d581715dc9cd 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -173,8 +173,6 @@ static SalLayoutGlyphs makeGlyphsSubset(const 
SalLayoutGlyphs& source, sal_Int32
 const SalLayoutGlyphsImpl* sourceLevel = source.Impl(level);
 if (sourceLevel == nullptr)
 break;
-if (level > 0) // TODO: Fallbacks do not work reliably.
-return SalLayoutGlyphs();
 SalLayoutGlyphsImpl* cloned = sourceLevel->cloneCharRange(index, len);
 // If the glyphs range cannot be cloned, bail out.
 if (cloned == nullptr)
@@ -265,16 +263,26 @@ SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr outputDevice, c
 text, nIndex, nLen, Point(0, 0), nLogicWidth, {}, 
glyphItemsOnlyLayout, layoutCache);
 if (layout)
 {
-mCachedGlyphs.insert(std::make_pair(key, layout->GetGlyphs()));
-assert(mCachedGlyphs.find(key) == mCachedGlyphs.begin()); // newly 
inserted item is first
-return &mCachedGlyphs.begin()->second;
-}
-else
-{
-// Failure, cache it too as invalid glyphs.
-mCachedGlyphs.insert(std::make_pair(key, SalLayoutGlyphs()));
-return nullptr;
+SalLayoutGlyphs glyphs = layout->GetGlyphs();
+if (glyphs.IsValid())
+{
+// TODO: Fallbacks do not work reliably (fallback font not 
included in the key),
+// so do not cache (but still return once, using the temporary 
without a key set).
+if (glyphs.Impl(1) != nullptr)
+{
+mLastTemporaryGlyphs = std::move(glyphs);
+mLastTemporaryKey.reset();
+return &mLastTemporaryGlyphs;
+}
+mCachedGlyphs.insert(std::make_pair(key, layout->GetGlyphs()));
+assert(mCachedGlyphs.find(key)
+   == mCachedGlyphs.begin()); // newly inserted item is first
+return &mCachedGlyphs.begin()->second;
+}
 }
+// Failure, cache it too as invalid glyphs.
+mCachedGlyphs.insert(std::make_pair(key, SalLayoutGlyphs()));
+return nullptr;
 }
 
 SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(const VclPtr& d,


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

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

New commits:
commit 6b54e6a8e64233de63b826211b81a8ed6767483f
Author: Michael Stahl 
AuthorDate: Wed Apr 13 16:50:30 2022 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Apr 14 11:26:15 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.

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

ucb: webdav-curl: oops, increment after checking
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132982
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
(cherry picked from commit ab65a74998b498ff49c15db87fc14a9afa89d8bf)

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

diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index 70f9f828467d..813988c78489 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -1223,6 +1223,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
@@ -1365,7 +1367,14 @@ 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)
 {
 ::std::optional const 
oRealm(ExtractRealm(
 headers, statusCode == SC_UNAUTHORIZED ? 
"WWW-Authenticate"
@@ -1383,7 +1392,14 @@ 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);
+++rnAuthRequests;
 
 // Ask user via XInteractionHandler.
 // Warning: This likely runs an event loop which 
may


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

2022-04-14 Thread Noel Grandin (via logerrit)
 include/oox/dump/dumperbase.hxx   |2 -
 oox/source/core/relations.cxx |9 +--
 oox/source/crypto/AgileEngine.cxx |   43 --
 oox/source/dump/dumperbase.cxx|   12 +-
 oox/source/dump/pptxdumper.cxx|2 -
 5 files changed, 37 insertions(+), 31 deletions(-)

New commits:
commit 250a70dc37a921b71049817d5e46aae2eb4cced6
Author: Noel Grandin 
AuthorDate: Wed Apr 13 21:04:09 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Apr 14 11:25:07 2022 +0200

use more string_view in oox

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

diff --git a/include/oox/dump/dumperbase.hxx b/include/oox/dump/dumperbase.hxx
index 9ce382ece7b9..10d3ed78ac2f 100644
--- a/include/oox/dump/dumperbase.hxx
+++ b/include/oox/dump/dumperbase.hxx
@@ -103,7 +103,7 @@ public:
 
 static OUString convertFileNameToUrl( const OUString& rFileName );
 static sal_Int32getFileNamePos( std::u16string_view rFileUrl );
-static OUString getFileNameExtension( const OUString& rFileUrl );
+static std::u16string_view getFileNameExtension( std::u16string_view 
rFileUrl );
 
 // input streams --
 
diff --git a/oox/source/core/relations.cxx b/oox/source/core/relations.cxx
index 9b29f20a1124..f927c542c89e 100644
--- a/oox/source/core/relations.cxx
+++ b/oox/source/core/relations.cxx
@@ -28,9 +28,12 @@ namespace oox::core {
 
 namespace {
 
-OUString lclRemoveFileName( const OUString& rPath )
+std::u16string_view lclRemoveFileName( std::u16string_view rPath )
 {
-return rPath.copy( 0, ::std::max< sal_Int32 >( rPath.lastIndexOf( '/' ), 0 
) );
+size_t idx = rPath.rfind( '/' );
+if (idx == std::u16string_view::npos)
+return std::u16string_view();
+return rPath.substr( 0, idx );
 }
 
 OUString lclAppendFileName( std::u16string_view rPath, const OUString& 
rFileName )
@@ -108,7 +111,7 @@ OUString Relations::getFragmentPathFromRelation( const 
Relation& rRelation ) con
 return rRelation.maTarget;
 
 // resolve relative target path according to base path
-OUString aPath = lclRemoveFileName( maFragmentPath );
+OUString aPath( lclRemoveFileName( maFragmentPath ) );
 sal_Int32 nStartPos = 0;
 while( nStartPos < rRelation.maTarget.getLength() )
 {
diff --git a/oox/source/crypto/AgileEngine.cxx 
b/oox/source/crypto/AgileEngine.cxx
index 0fd655ced63c..09748e9dfd7b 100644
--- a/oox/source/crypto/AgileEngine.cxx
+++ b/oox/source/crypto/AgileEngine.cxx
@@ -44,9 +44,12 @@ namespace oox::crypto {
 
 namespace {
 
-OUString stripNamespacePrefix(OUString const & rsInputName)
+std::u16string_view stripNamespacePrefix(std::u16string_view rsInputName)
 {
-return rsInputName.copy(rsInputName.indexOf(":") + 1);
+size_t idx = rsInputName.find(':');
+if (idx == std::u16string_view::npos)
+return rsInputName;
+return rsInputName.substr(idx + 1);
 }
 
 class AgileTokenHandler : public sax_fastparser::FastTokenHandlerBase
@@ -85,79 +88,79 @@ public:
 
 void SAL_CALL startUnknownElement( const OUString& /*aNamespace*/, const 
OUString& rName, const Reference< XFastAttributeList >& aAttributeList ) 
override
 {
-const OUString& rLocalName = stripNamespacePrefix(rName);
+std::u16string_view rLocalName = stripNamespacePrefix(rName);
 
 const css::uno::Sequence aUnknownAttributes = 
aAttributeList->getUnknownAttributes();
 for (const Attribute& rAttribute : aUnknownAttributes)
 {
-const OUString& rAttrLocalName = 
stripNamespacePrefix(rAttribute.Name);
+std::u16string_view rAttrLocalName = 
stripNamespacePrefix(rAttribute.Name);
 
-if (rAttrLocalName == "spinCount")
+if (rAttrLocalName == u"spinCount")
 {
 ::sax::Converter::convertNumber(mInfo.spinCount, 
rAttribute.Value);
 }
-else if (rAttrLocalName == "saltSize")
+else if (rAttrLocalName == u"saltSize")
 {
 ::sax::Converter::convertNumber(mInfo.saltSize, 
rAttribute.Value);
 }
-else if (rAttrLocalName == "blockSize")
+else if (rAttrLocalName == u"blockSize")
 {
 ::sax::Converter::convertNumber(mInfo.blockSize, 
rAttribute.Value);
 }
-else if (rAttrLocalName == "keyBits")
+else if (rAttrLocalName == u"keyBits")
 {
 ::sax::Converter::convertNumber(mInfo.keyBits, 
rAttribute.Value);
 }
-else if (rAttrLocalName == "hashSize")
+else if (rAttrLocalName == u"hashSize")
 {
 ::sax::Converter::convertNumber(mInfo.hashSize, 
rAttribute.Value);
 }
-else if (rAttrLocalName == "cipherAlgorithm")
+

[Libreoffice-commits] core.git: 2 commits - editeng/source filter/source include/editeng include/filter sw/source writerfilter/source

2022-04-14 Thread Noel Grandin (via logerrit)
 editeng/source/misc/svxacorr.cxx |8 +++---
 filter/source/msfilter/util.cxx  |   14 +--
 filter/source/xsltdialog/typedetectionimport.cxx |   23 +--
 filter/source/xsltdialog/xmlfiltercommon.hxx |2 -
 filter/source/xsltdialog/xmlfiltersettingsdialog.cxx |   12 -
 include/editeng/svxacorr.hxx |4 +--
 include/filter/msfilter/util.hxx |2 -
 sw/source/filter/ww8/docxattributeoutput.cxx |2 -
 writerfilter/source/dmapper/DomainMapper_Impl.cxx|4 +--
 9 files changed, 36 insertions(+), 35 deletions(-)

New commits:
commit 41fa4bb83ad95f0b2171808b405fa755613cef81
Author: Noel Grandin 
AuthorDate: Wed Apr 13 21:00:50 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Apr 14 11:24:53 2022 +0200

use more string_view in filter

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

diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx
index a1d3929a218c..7747c9a0ecd1 100644
--- a/filter/source/msfilter/util.cxx
+++ b/filter/source/msfilter/util.cxx
@@ -309,19 +309,19 @@ const ApiPaperSize& 
PaperSizeConv::getApiSizeForMSPaperSizeIndex( sal_Int32 nMSO
 return spPaperSizeTable[ nMSOPaperIndex ];
 }
 
-OUString findQuotedText( const OUString& rCommand,
+std::u16string_view findQuotedText( std::u16string_view rCommand,
 const char* cStartQuote, const sal_Unicode uEndQuote )
 {
-OUString sRet;
+std::u16string_view sRet;
 OUString sStartQuote( OUString::createFromAscii(cStartQuote) );
-sal_Int32 nStartIndex = rCommand.indexOf( sStartQuote );
-if( nStartIndex >= 0 )
+size_t nStartIndex = rCommand.find( sStartQuote );
+if( nStartIndex != std::u16string_view::npos )
 {
 sal_Int32 nStartLength = sStartQuote.getLength();
-sal_Int32 nEndIndex = rCommand.indexOf( uEndQuote, nStartIndex + 
nStartLength);
-if( nEndIndex > nStartIndex )
+size_t nEndIndex = rCommand.find( uEndQuote, nStartIndex + 
nStartLength);
+if( nEndIndex != std::u16string_view::npos && nEndIndex > nStartIndex )
 {
-sRet = rCommand.copy( nStartIndex + nStartLength, nEndIndex - 
nStartIndex - nStartLength);
+sRet = rCommand.substr( nStartIndex + nStartLength, nEndIndex - 
nStartIndex - nStartLength);
 }
 }
 return sRet;
diff --git a/filter/source/xsltdialog/typedetectionimport.cxx 
b/filter/source/xsltdialog/typedetectionimport.cxx
index bba302de703c..5fc5ae582951 100644
--- a/filter/source/xsltdialog/typedetectionimport.cxx
+++ b/filter/source/xsltdialog/typedetectionimport.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "typedetectionimport.hxx"
 #include "xmlfiltercommon.hxx"
@@ -80,18 +81,18 @@ void TypeDetectionImporter::fillFilterVector(  std::vector< 
std::unique_ptr 
TypeDetectionImporter::createFilterForNode( No
 pFilter->maDocumentService = getSubdata( 2, aComma, aData );
 
 OUString aFilterService( getSubdata( 3, aComma, aData ) );
-pFilter->maFlags = getSubdata( 4, aComma, aData ).toInt32();
+pFilter->maFlags = o3tl::toInt32(getSubdata( 4, aComma, aData ));
 
 // parse filter user data
 sal_Unicode aDelim(';');
@@ -144,7 +145,7 @@ std::unique_ptr 
TypeDetectionImporter::createFilterForNode( No
 
 OUString aAdapterService( getSubdata( 0, aDelim, aFilterUserData ) );
 //Import/ExportService
-pFilter->mbNeedsXSLT2 = getSubdata( 1, aDelim, aFilterUserData 
).toBoolean();
+pFilter->mbNeedsXSLT2 = OUString(getSubdata( 1, aDelim, aFilterUserData 
)).toBoolean();
 pFilter->maImportService = getSubdata( 2, aDelim, aFilterUserData );
 pFilter->maExportService = getSubdata( 3, aDelim, aFilterUserData );
 pFilter->maImportXSLT = getSubdata( 4, aDelim, aFilterUserData );
@@ -161,7 +162,7 @@ std::unique_ptr 
TypeDetectionImporter::createFilterForNode( No
 
 pFilter->maDocType = getSubdata( 2, aComma, aTypeUserData );
 pFilter->maExtension = getSubdata( 4, aComma, aTypeUserData );
-pFilter->mnDocumentIconID = getSubdata( 5, aComma, aTypeUserData 
).toInt32();
+pFilter->mnDocumentIconID = o3tl::toInt32(getSubdata( 5, aComma, 
aTypeUserData ));
 }
 
 bool bOk = true;
diff --git a/filter/source/xsltdialog/xmlfiltercommon.hxx 
b/filter/source/xsltdialog/xmlfiltercommon.hxx
index 0d340fa12e0f..4ac225183e60 100644
--- a/filter/source/xsltdialog/xmlfiltercommon.hxx
+++ b/filter/source/xsltdialog/xmlfiltercommon.hxx
@@ -30,7 +30,7 @@ extern OUString string_encode( const OUString & rText );
 extern OUString string_decode( const OUString & rText );
 
 bool copyStreams( const css::uno::Reference< css::io::XInputStream >& xIS, 
const css::uno::Reference< css::io::XOutputStream >& xOS );
-bool createDire

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

2022-04-14 Thread Caolán McNamara (via logerrit)
 chart2/source/controller/dialogs/tp_Scale.cxx |7 +++
 include/sfx2/dialoghelper.hxx |5 +++--
 sc/source/ui/miscdlgs/sharedocdlg.cxx |6 +++---
 sfx2/source/dialog/dialoghelper.cxx   |8 
 sfx2/source/dialog/versdlg.cxx|8 
 5 files changed, 21 insertions(+), 13 deletions(-)

New commits:
commit 5d9ba65897d2ba2998e43e97b25dbb9a560a16a1
Author: Caolán McNamara 
AuthorDate: Wed Apr 13 16:49:27 2022 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Apr 14 11:12:44 2022 +0200

Resolves: tdf#141625 give enough space to see full date+time

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

diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx 
b/chart2/source/controller/dialogs/tp_Scale.cxx
index 6c7effde6707..3bb247a7075b 100644
--- a/chart2/source/controller/dialogs/tp_Scale.cxx
+++ b/chart2/source/controller/dialogs/tp_Scale.cxx
@@ -26,6 +26,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -558,6 +559,12 @@ void ScaleTabPage::SetNumFormat()
 nFmt = pNumFormatter->GetStandardFormat( 
SvNumFormatType::TIME, pFormat->GetLanguage() );
 else
 nFmt = pNumFormatter->GetStandardFormat( SvNumFormatType::TIME 
);
+
+// tdf#141625 give enough space to see full date+time
+int 
nWidestTime(m_xFmtFldMin->get_pixel_size(getWidestDateTime(Application::GetSettings().GetLocaleDataWrapper(),
 true)).Width());
+int nWidthChars = std::ceil(nWidestTime / 
m_xFmtFldMin->get_approximate_digit_width()) + 1;
+m_xFmtFldMin->set_width_chars(nWidthChars);
+m_xFmtFldMax->set_width_chars(nWidthChars);
 }
 
 if( m_nAxisType == chart2::AxisType::DATE && ( eType != 
SvNumFormatType::DATE && eType != SvNumFormatType::DATETIME) )
diff --git a/include/sfx2/dialoghelper.hxx b/include/sfx2/dialoghelper.hxx
index e76304ac6808..a853d5d9de5c 100644
--- a/include/sfx2/dialoghelper.hxx
+++ b/include/sfx2/dialoghelper.hxx
@@ -31,9 +31,10 @@ Size SFX2_DLLPUBLIC getPreviewStripSize(const OutputDevice& 
rReference);
 
 Size SFX2_DLLPUBLIC getPreviewOptionsSize(const OutputDevice& rReference);
 
-OUString SFX2_DLLPUBLIC getWidestTime(const LocaleDataWrapper& rWrapper);
+OUString SFX2_DLLPUBLIC getWidestDateTime(const LocaleDataWrapper& rWrapper, 
bool bWithSec);
 
-OUString SFX2_DLLPUBLIC formatTime(const DateTime& rDateTime, const 
LocaleDataWrapper& rWrapper);
+OUString SFX2_DLLPUBLIC formatDateTime(const DateTime& rDateTime, const 
LocaleDataWrapper& rWrapper,
+   bool bWithSec);
 
 #endif
 
diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx 
b/sc/source/ui/miscdlgs/sharedocdlg.cxx
index ec019fb70655..294a69e93c2b 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -39,7 +39,7 @@ using namespace ::com::sun::star;
 
 IMPL_LINK(ScShareDocumentDlg, SizeAllocated, const Size&, rSize, void)
 {
-OUString sWidestAccessString = getWidestTime(ScGlobal::getLocaleData());
+OUString sWidestAccessString = 
getWidestDateTime(ScGlobal::getLocaleData(), false);
 const int nAccessWidth = 
m_xLbUsers->get_pixel_size(sWidestAccessString).Width() * 2;
 std::vector aWidths
 {
@@ -151,7 +151,7 @@ void ScShareDocumentDlg::UpdateView()
 tools::Time aTime( nHours, nMinutes );
 DateTime aDateTime( aDate, aTime );
 
-OUString aString = formatTime(aDateTime, 
ScGlobal::getLocaleData());
+OUString aString = formatDateTime(aDateTime, 
ScGlobal::getLocaleData(), false);
 
 m_xLbUsers->append_text(aUser);
 m_xLbUsers->set_text(m_xLbUsers->n_children() - 1, 
aString, 1);
@@ -201,7 +201,7 @@ void ScShareDocumentDlg::UpdateView()
 util::DateTime uDT(xDocProps->getModificationDate());
 DateTime aDateTime(uDT);
 
-OUString aString = formatTime(aDateTime, ScGlobal::getLocaleData()) + 
" " +
+OUString aString = formatDateTime(aDateTime, 
ScGlobal::getLocaleData(), false) + " " +
 ScGlobal::getLocaleData().getTime( aDateTime, false );
 
 m_xLbUsers->append_text(aUser);
diff --git a/sfx2/source/dialog/dialoghelper.cxx 
b/sfx2/source/dialog/dialoghelper.cxx
index 93e697b29517..9585c8baac80 100644
--- a/sfx2/source/dialog/dialoghelper.cxx
+++ b/sfx2/source/dialog/dialoghelper.cxx
@@ -32,17 +32,17 @@ Size getPreviewOptionsSize(const OutputDevice& rReference)
 return rReference.LogicToPixel(Size(70, 27), MapMode(MapUnit::MapAppFont));
 }
 
-OUString getWidestTime(const LocaleDataWrapper& rWrapper)
+OUString getWidestDateTime(const LocaleDataWrapper& rWrapper, bool bWithSec)
 {
 Date aDate(22, 12, 2000);
 too

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

2022-04-14 Thread Armin Le Grand (Allotropia) (via logerrit)
 include/svx/diagram/datamodel.hxx  |   18 ++
 oox/source/drawingml/diagram/datamodel.cxx |   13 +
 oox/source/drawingml/diagram/diagram.cxx   |   39 -
 oox/source/drawingml/diagram/diagram.hxx   |4 
 oox/source/drawingml/diagram/diagramhelper.cxx |   49 +--
 svx/source/diagram/datamodel.cxx   |  171 -
 6 files changed, 270 insertions(+), 24 deletions(-)

New commits:
commit edadfb564f1334887df473f9bc05dab6b1e7ef9d
Author: Armin Le Grand (Allotropia) 
AuthorDate: Wed Apr 13 17:17:35 2022 +0200
Commit: Armin Le Grand 
CommitDate: Thu Apr 14 11:02:19 2022 +0200

Advanced Diagram support: Secure properties at Diagram ModelData

Additionally to the Text/Attributes already saved/secured after
Diagram import, secure more data that is part of the Diagram
ModelData. This is about attributes (e.g. FillStyle/LineStyle,
TextAttributes, ...) in UNO API formt that will be secured/
attached to the Diagram ModelData in it's
svx::diagram::Point structure.
This is done for all those entries for which a XShape will/
would be incarnated, thus associated to entries that will
get a visualization, including the BackgroundObject.
From that data, at re-creation time, the attributes can be
re-applied to the re-created XShape(s), also after changes
to the Diagram Model Data (e.g. Add/Remove).
This is - besides the already added securing of the Style/
Theme - a 2nd method for lossless re-creation. For the
BackgroundObject - if it has FillStyles - it is even the
only method to secure that data and thus necessary for that
case. The selection of atributes that gets secured is minimal
for now and may/need to be extended for existing cases
accordingly.

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

diff --git a/include/svx/diagram/datamodel.hxx 
b/include/svx/diagram/datamodel.hxx
index c42a3d26a115..686835ee378f 100644
--- a/include/svx/diagram/datamodel.hxx
+++ b/include/svx/diagram/datamodel.hxx
@@ -29,8 +29,8 @@
 #include 
 
 #include 
-#include 
 #include 
+#include 
 
 namespace svx::diagram {
 
@@ -83,11 +83,21 @@ struct SVXCORE_DLLPUBLIC TextBody
 OUString msText;
 
 // attributes from TextBody::getTextProperties()
-css::uno::Sequence< css::beans::PropertyValue > maTextProps;
+std::vector< std::pair< OUString, css::uno::Any >> maTextProps;
 };
 
 typedef std::shared_ptr< TextBody > TextBodyPtr;
 
+/** Styles for a Point (FillStyle/LineStyle/...)
+ */
+struct SVXCORE_DLLPUBLIC PointStyle
+{
+// attributes (LineStyle/FillStyle/...)
+std::vector< std::pair< OUString, css::uno::Any >> maProperties;
+};
+
+typedef std::shared_ptr< PointStyle > PointStylePtr;
+
 /** A point
  */
 struct SVXCORE_DLLPUBLIC Point
@@ -95,6 +105,7 @@ struct SVXCORE_DLLPUBLIC Point
 Point();
 
 TextBodyPtr msTextBody;
+PointStylePtr msPointStylePtr;
 
 OUString msCnxId;
 OUString msModelId;
@@ -136,6 +147,9 @@ struct SVXCORE_DLLPUBLIC Point
 bool  mbCustomVerticalFlip;
 bool  mbCustomText;
 bool  mbIsPlaceholder;
+
+void securePropertiesFromXShape(const css::uno::Reference< 
css::drawing::XShape >& rXShape);
+void restorePropertiesToXShape(const css::uno::Reference< 
css::drawing::XShape >& rXShape) const;
 };
 
 typedef std::vector< Point >Points;
diff --git a/oox/source/drawingml/diagram/datamodel.cxx 
b/oox/source/drawingml/diagram/datamodel.cxx
index cc8924228e23..f0a3cef66903 100644
--- a/oox/source/drawingml/diagram/datamodel.cxx
+++ b/oox/source/drawingml/diagram/datamodel.cxx
@@ -68,15 +68,15 @@ void 
DiagramData::restoreDataFromModelToShapeAfterReCreation(const svx::diagram:
 pTextRun->getText() = rPoint.msTextBody->msText;
 aNewTextBody->addParagraph().addRun(pTextRun);
 
-if(rPoint.msTextBody->maTextProps.hasElements())
+if(!rPoint.msTextBody->maTextProps.empty())
 {
 oox::PropertyMap& 
rTargetMap(aNewTextBody->getTextProperties().maPropertyMap);
 
 for (auto const& prop : rPoint.msTextBody->maTextProps)
 {
-sal_Int32 nPropId(oox::PropertyMap::getPropertyId(prop.Name));
+const sal_Int32 
nPropId(oox::PropertyMap::getPropertyId(prop.first));
 if(nPropId > 0)
-rTargetMap.setAnyProperty(nPropId, prop.Value);
+rTargetMap.setAnyProperty(nPropId, prop.second);
 }
 }
 }
@@ -99,7 +99,12 @@ void 
DiagramData::secureDataFromShapeToModelAfterDiagramImport()
 {
 point.msTextBody = std::make_shared();
 point.msTextBody->msText = 
pShapeCandidate->getTextBody()->toString();
-point.msTextBody->maTextProps = 
pShapeCandidate->getTe

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

2022-04-14 Thread Andrea Gelmini (via logerrit)
 vcl/source/image/ImplImageTree.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 16bbd139d6a54c47e4fd4a034dbcc238a75f2097
Author: Andrea Gelmini 
AuthorDate: Thu Apr 14 05:10:00 2022 +0200
Commit: Julien Nabet 
CommitDate: Thu Apr 14 10:59:41 2022 +0200

Removed duplicated include

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

diff --git a/vcl/source/image/ImplImageTree.cxx 
b/vcl/source/image/ImplImageTree.cxx
index eb6dd1ecc4d8..827df39a32bc 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -56,7 +56,6 @@
 #include 
 #include 
 #include 
-#include 
 
 using namespace css;
 


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

2022-04-14 Thread Stephan Bergmann (via logerrit)
 cppu/source/uno/eq.hxx |  128 +++--
 1 file changed, 71 insertions(+), 57 deletions(-)

New commits:
commit 9a42c99d7b3e8a8429f14d7d851f3d186fa04594
Author: Stephan Bergmann 
AuthorDate: Wed Apr 13 17:45:52 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Apr 14 10:21:42 2022 +0200

Simplify equality comparison among the various UNOIDL integer types

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

diff --git a/cppu/source/uno/eq.hxx b/cppu/source/uno/eq.hxx
index 6287cdcc3506..e81f0972e801 100644
--- a/cppu/source/uno/eq.hxx
+++ b/cppu/source/uno/eq.hxx
@@ -20,6 +20,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -259,6 +260,27 @@ inline bool _equalSequence(
 }
 }
 
+template
+std::enable_if_t && std::is_signed_v, bool> equal(T1 
value1, T2 value2) {
+return value1 == value2;
+}
+
+template
+std::enable_if_t && std::is_unsigned_v, bool> 
equal(T1 value1, T2 value2) {
+return value1 >= 0 && static_cast>(value1) == 
value2;
+}
+
+template
+std::enable_if_t && std::is_signed_v, bool> 
equal(T1 value1, T2 value2) {
+return value2 >= 0 && value1 == 
static_cast>(value2);
+}
+
+template
+std::enable_if_t && std::is_unsigned_v, bool> 
equal(T1 value1, T2 value2)
+{
+return value1 == value2;
+}
+
 inline bool _equalData(
 void * pDest,
 typelib_TypeDescriptionReference * pDestType, typelib_TypeDescription * 
pDestTypeDescr,
@@ -294,20 +316,19 @@ inline bool _equalData(
 switch (eSourceTypeClass)
 {
 case typelib_TypeClass_BYTE:
-return (*static_cast(pDest) == *static_cast(pSource));
+return equal(*static_cast(pDest), 
*static_cast(pSource));
 case typelib_TypeClass_SHORT:
-return (static_cast(*static_cast(pDest)) == 
*static_cast(pSource));
+return equal(*static_cast(pDest), 
*static_cast(pSource));
 case typelib_TypeClass_UNSIGNED_SHORT:
-return (static_cast(*static_cast(pDest)) == 
static_cast(*static_cast(pSource)));
+return equal(*static_cast(pDest), 
*static_cast(pSource));
 case typelib_TypeClass_LONG:
-return (static_cast(*static_cast(pDest)) == 
*static_cast(pSource));
+return equal(*static_cast(pDest), 
*static_cast(pSource));
 case typelib_TypeClass_UNSIGNED_LONG:
-return (static_cast(*static_cast(pDest)) == 
static_cast(*static_cast(pSource)));
+return equal(*static_cast(pDest), 
*static_cast(pSource));
 case typelib_TypeClass_HYPER:
-return (static_cast(*static_cast(pDest)) == 
*static_cast(pSource));
+return equal(*static_cast(pDest), 
*static_cast(pSource));
 case typelib_TypeClass_UNSIGNED_HYPER:
-return (*static_cast(pDest) >= 0 &&
-static_cast(*static_cast(pDest)) == 
*static_cast(pSource)); // same size
+return equal(*static_cast(pDest), 
*static_cast(pSource));
 case typelib_TypeClass_FLOAT:
 return (static_cast(*static_cast(pDest)) == 
*static_cast(pSource));
 case typelib_TypeClass_DOUBLE:
@@ -319,20 +340,19 @@ inline bool _equalData(
 switch (eSourceTypeClass)
 {
 case typelib_TypeClass_BYTE:
-return (*static_cast(pDest) == 
static_cast(*static_cast(pSource)));
+return equal(*static_cast(pDest), 
*static_cast(pSource));
 case typelib_TypeClass_SHORT:
-return (*static_cast(pDest) == *static_cast(pSource));
+return equal(*static_cast(pDest), 
*static_cast(pSource));
 case typelib_TypeClass_UNSIGNED_SHORT:
-return (static_cast(*static_cast(pDest)) 
== static_cast(*static_cast(pSource)));
+return equal(*static_cast(pDest), 
*static_cast(pSource));
 case typelib_TypeClass_LONG:
-return (static_cast(*static_cast(pDest)) 
== *static_cast(pSource));
+return equal(*static_cast(pDest), 
*static_cast(pSource));
 case typelib_TypeClass_UNSIGNED_LONG:
-return (static_cast(*static_cast(pDest)) 
== static_cast(*static_cast(pSource)));
+return equal(*static_cast(pDest), 
*static_cast(pSource));
 case typelib_TypeClass_HYPER:
-return (static_cast(*static_cast(pDest)) 
== *static_cast(pSource));
+return equal(*static_cast(pDest), 
*static_cast(pSource));
 case typelib_TypeClass_UNSIGNED_HYPER:
-return (*static_cast(pDest) >= 0 &&
-static_cast(*static_cast(pDest)) 
== *static_cast(pSource)); // same size
+return equal(*static_cast(pDest), 
*static_cast(pSource));
 case typelib_TypeClass_FLOAT:
 return (static_cast(*static_cast(pDest)) == 
*static_cast(pSource));
 case typelib_TypeClass_DOUBLE:
@@ -344,19 +3

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 17 commits - compilerplugins/clang include/svx sal/cppunittester sc/inc sc/qa sc/source svx/source

2022-04-14 Thread Luboš Luňák (via logerrit)
 compilerplugins/clang/redundantfcast.cxx |3 
 include/svx/framelink.hxx|   11 ++
 sal/cppunittester/cppunittester.cxx  |5 -
 sc/inc/attarray.hxx  |4 
 sc/inc/column.hxx|   17 ++-
 sc/inc/dociter.hxx   |4 
 sc/inc/document.hxx  |   14 +--
 sc/inc/documentimport.hxx|9 +-
 sc/inc/fillinfo.hxx  |2 
 sc/inc/table.hxx |   14 +--
 sc/qa/unit/data/xlsx/tdf58243.xlsx   |binary
 sc/qa/unit/subsequent_export_test2.cxx   |   44 +
 sc/qa/unit/ucalc.cxx |  138 +--
 sc/source/core/data/attarray.cxx |9 ++
 sc/source/core/data/column3.cxx  |2 
 sc/source/core/data/dociter.cxx  |   82 --
 sc/source/core/data/document.cxx |   12 +-
 sc/source/core/data/documentimport.cxx   |   17 +--
 sc/source/core/data/table2.cxx   |   82 ++
 sc/source/filter/excel/xistyle.cxx   |   17 +++
 sc/source/filter/inc/sheetdatabuffer.hxx |   12 +-
 sc/source/filter/oox/sheetdatabuffer.cxx |   34 ++-
 sc/source/filter/xml/xmlcoli.cxx |1 
 sc/source/filter/xml/xmlexprt.cxx|8 -
 sc/source/ui/unoobj/cellsuno.cxx |7 -
 sc/source/ui/view/output.cxx |   38 
 sc/source/ui/view/tabview.cxx|8 -
 svx/source/dialog/framelink.cxx  |5 -
 28 files changed, 409 insertions(+), 190 deletions(-)

New commits:
commit 033fe3f340a3d47bb87099e23aaa101781932262
Author: Luboš Luňák 
AuthorDate: Tue Apr 12 14:33:55 2022 +0200
Commit: Luboš Luňák 
CommitDate: Thu Apr 14 10:18:24 2022 +0200

bail out of the loop when the item is found

Change-Id: If0816f38eeeb3330738ab40bc8a72f1e14575c33

diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 532e675ad08b..ca77bae6c093 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -8819,7 +8819,6 @@ rtl::Reference 
ScCellFormatsObj::GetObjectByIndex_Impl(tools::Lo
 {
 //! access the AttrArrays directly 
 
-rtl::Reference pRet;
 if (pDocShell)
 {
 ScDocument& rDoc = pDocShell->GetDocument();
@@ -8837,14 +8836,14 @@ rtl::Reference 
ScCellFormatsObj::GetObjectByIndex_Impl(tools::Lo
 ScRange aNext( nCol1, nRow1, nTab, nCol2, nRow2, nTab );
 
 if ( aNext.aStart == aNext.aEnd )
-pRet = new ScCellObj( pDocShell, aNext.aStart );
+return new ScCellObj( pDocShell, aNext.aStart );
 else
-pRet = new ScCellRangeObj( pDocShell, aNext );
+return new ScCellRangeObj( pDocShell, aNext );
 }
 ++nPos;
 }
 }
-return pRet;
+return {};
 }
 
 // XIndexAccess
commit 1de6fcb8e43a1bdac0b49b843172a634227e6303
Author: Luboš Luňák 
AuthorDate: Fri Mar 25 12:42:58 2022 +0100
Commit: Luboš Luňák 
CommitDate: Thu Apr 14 10:18:15 2022 +0200

fix ScTable::GetLastChangedCol() for unallocated columns

Column flags and widths are stored separately from ScColumn data,
and so don't depend on allocated columns count.

Also rename the functions from the misleading generic name to what
they actually do.

Change-Id: If85ae80efda1d8b382fa3b559aa65be0292e25ba

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index d9e9b22be9f6..9bf190571f56 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -2027,17 +2027,17 @@ public:
  */
 voidSyncColRowFlags();
 
-/// @return  the index of the last row with any set flags 
(auto-pagebreak is ignored).
+/// @return  the index of the last row with any set flags (auto-pagebreak 
is ignored).
 SC_DLLPUBLIC SCROW  GetLastFlaggedRow( SCTAB nTab ) const;
 
-/// @return  the index of the last changed column (flags 
and column width, auto pagebreak is ignored).
-SCCOL   GetLastChangedCol( SCTAB nTab ) const;
-/// @return  the index of the last changed row (flags and 
row height, auto pagebreak is ignored).
-SCROW   GetLastChangedRow( SCTAB nTab ) const;
+/// @return  the index of the last changed column (flags and column width, 
auto pagebreak is ignored).
+SCCOL   GetLastChangedColFlagsWidth( SCTAB nTab ) const;
+/// @return  the index of the last changed row (flags and row height, auto 
pagebreak is ignored).
+SCROW   GetLastChangedRowFlagsWidth( SCTAB nTab ) const;
 
-SCCOL   GetNextDifferentChangedCol( SCTAB nTab, SCCOL nStart) 
const;
+SCCOL   GetNextDifferentChangedColFlagsWidth( SCTAB nTab, SCCOL 
nStart) const;
 
-SCROW   GetNextDifferentChangedRow( SCTAB nTab, SCROW nStart) 
const;
+SCROW 

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

2022-04-14 Thread Stephan Bergmann (via logerrit)
 binaryurp/qa/test-cache.cxx |   20 
 1 file changed, 12 insertions(+), 8 deletions(-)

New commits:
commit fc2413e9a8f509bc6835cae473bf5053728c419a
Author: Stephan Bergmann 
AuthorDate: Wed Apr 13 17:48:13 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Apr 14 09:58:00 2022 +0200

Pick better variable types

...tweaking the code slightly to guarantee that j will always be 
non-negative

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

diff --git a/binaryurp/qa/test-cache.cxx b/binaryurp/qa/test-cache.cxx
index c024f1f711d6..c4696f78395f 100644
--- a/binaryurp/qa/test-cache.cxx
+++ b/binaryurp/qa/test-cache.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+
+#include 
+
 #include 
 #include 
 #include 
@@ -39,13 +43,13 @@ private:
 // cf. jurt/test/com/sun/star/lib/uno/protocols/urp/Cache_Test.java:
 void Test::testNothingLostFromLruList() {
 int a[8];
-for (int i = 0; i != int(std::size(a)); ++i) {
-for (int j = 0; j != i; ++j) {
+for (std::size_t i = 0; i != std::size(a); ++i) {
+for (std::size_t j = 0; j != i; ++j) {
 a[j] = 0;
 }
 for (;;) {
 binaryurp::Cache< int > c(4);
-for (int k = 0; k != i; ++k) {
+for (std::size_t k = 0; k != i; ++k) {
 bool f;
 c.add(a[k], &f);
 }
@@ -53,15 +57,15 @@ void Test::testNothingLostFromLruList() {
 CPPUNIT_ASSERT_EQUAL(
 6,
 c.add(-1, &f) + c.add(-2, &f) + c.add(-3, &f) + c.add(-4, &f));
-int j = i - 1;
-while (j >= 0 && a[j] == 3) {
+std::size_t j = i;
+while (j != 0 && a[j - 1] == 3) {
 --j;
 }
-if (j < 0) {
+if (j == 0) {
 break;
 }
-++a[j];
-for (int k = j + 1; k != i; ++k) {
+++a[j - 1];
+for (std::size_t k = j; k != i; ++k) {
 a[k] = 0;
 }
 }


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

2022-04-14 Thread Caolán McNamara (via logerrit)
 filter/source/msfilter/msdffimp.cxx |  122 +---
 1 file changed, 60 insertions(+), 62 deletions(-)

New commits:
commit 5bfbb64cb9ae102e5a1f5b4cd020d0cd006d0a92
Author: Caolán McNamara 
AuthorDate: Wed Apr 13 20:54:22 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 14 09:55:47 2022 +0200

ofz#46630 Indirect leak

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

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index 745a085c7dce..7fae12fc40ea 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4214,13 +4214,11 @@ SdrObject* SvxMSDffManager::ImportShape( const 
DffRecordHeader& rHd, SvStream& r
 tools::Rectangle& rClientRect, 
const tools::Rectangle& rGlobalChildRect,
 int nCalledByGroup, sal_Int32* 
pShapeId )
 {
-SdrObject* pRet = nullptr;
-
 if( pShapeId )
 *pShapeId = 0;
 
 if (!rHd.SeekToBegOfRecord(rSt))
-return pRet;
+return nullptr;
 
 DffObjData aObjData( rHd, rClientRect, nCalledByGroup );
 
@@ -4271,7 +4269,7 @@ SdrObject* SvxMSDffManager::ImportShape( const 
DffRecordHeader& rHd, SvStream& r
 if ( aObjData.bOpt )
 {
 if (!maShapeRecords.Current()->SeekToBegOfRecord(rSt))
-return pRet;
+return nullptr;
 #ifdef DBG_AUTOSHAPE
 ReadPropSet( rSt, &rClientData, (sal_uInt32)aObjData.eShapeType );
 #else
@@ -4326,6 +4324,8 @@ SdrObject* SvxMSDffManager::ImportShape( const 
DffRecordHeader& rHd, SvStream& r
 if ( aObjData.nSpFlags & ShapeFlag::Background )
 aObjData.aBoundRect = tools::Rectangle( Point(), Size( 1, 1 ) );
 
+SdrObjectUniquePtr xRet;
+
 tools::Rectangle aTextRect;
 if ( !aObjData.aBoundRect.IsEmpty() )
 {   // apply rotation to the BoundingBox BEFORE an object has been 
generated
@@ -4350,7 +4350,7 @@ SdrObject* SvxMSDffManager::ImportShape( const 
DffRecordHeader& rHd, SvStream& r
 
 if ( aObjData.nSpFlags & ShapeFlag::Group )
 {
-pRet = new SdrObjGroup(*pSdrModel);
+xRet.reset(new SdrObjGroup(*pSdrModel));
 /*  After CWS aw033 has been integrated, an empty group object
 cannot store its resulting bounding rectangle anymore. We have
 to return this rectangle via rClientRect now, but only, if
@@ -4370,9 +4370,9 @@ SdrObject* SvxMSDffManager::ImportShape( const 
DffRecordHeader& rHd, SvStream& r
 if ( bGraphic )
 {
 if (!mbSkipImages) {
-pRet = ImportGraphic( rSt, aSet, aObjData );// SJ: 
#68396# is no longer true (fixed in ppt2000)
+xRet.reset(ImportGraphic(rSt, aSet, aObjData));// 
SJ: #68396# is no longer true (fixed in ppt2000)
 ApplyAttributes( rSt, aSet, aObjData );
-pRet->SetMergedItemSet(aSet);
+xRet->SetMergedItemSet(aSet);
 }
 }
 else if ( aObjData.eShapeType == mso_sptLine && !( 
GetPropertyValue( DFF_Prop_fc3DLightFace, 0 ) & 8 ) )
@@ -4380,12 +4380,12 @@ SdrObject* SvxMSDffManager::ImportShape( const 
DffRecordHeader& rHd, SvStream& r
 basegfx::B2DPolygon aPoly;
 aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), 
aObjData.aBoundRect.Top()));
 aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), 
aObjData.aBoundRect.Bottom()));
-pRet = new SdrPathObj(
+xRet.reset(new SdrPathObj(
 *pSdrModel,
 SdrObjKind::Line,
-basegfx::B2DPolyPolygon(aPoly));
+basegfx::B2DPolyPolygon(aPoly)));
 ApplyAttributes( rSt, aSet, aObjData );
-pRet->SetMergedItemSet(aSet);
+xRet->SetMergedItemSet(aSet);
 }
 else
 {
@@ -4394,7 +4394,7 @@ SdrObject* SvxMSDffManager::ImportShape( const 
DffRecordHeader& rHd, SvStream& r
 
 ApplyAttributes( rSt, aSet, aObjData );
 
-pRet = new SdrObjCustomShape(*pSdrModel);
+xRet.reset(new SdrObjCustomShape(*pSdrModel));
 
 sal_uInt32 ngtextFStrikethrough = GetPropertyValue( 
DFF_Prop_gtextFStrikethrough, 0 );
 bool bIsFontwork = ( ngtextFStrikethrough & 0x4000 ) != 0;
@@ -4430,12 +4430,12 @@ SdrObject* SvxMSDffManager::ImportShape( const 
DffRecordHeader& rHd, SvStream& r
 // this should be replaced through "CharacterRotation"
 // by 90 degrees, therefore a new Item has to be
 // supported by svx core, api and x

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

2022-04-14 Thread Caolán McNamara (via logerrit)
 chart2/source/controller/dialogs/tp_Scale.cxx |7 +++
 include/sfx2/dialoghelper.hxx |5 +++--
 sc/source/ui/miscdlgs/sharedocdlg.cxx |6 +++---
 sfx2/source/dialog/dialoghelper.cxx   |8 
 sfx2/source/dialog/versdlg.cxx|8 
 5 files changed, 21 insertions(+), 13 deletions(-)

New commits:
commit c15fceae5e70483daf8355a9b7d53215b7643c2b
Author: Caolán McNamara 
AuthorDate: Wed Apr 13 16:49:27 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 14 09:54:37 2022 +0200

Resolves: tdf#141625 give enough space to see full date+time

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

diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx 
b/chart2/source/controller/dialogs/tp_Scale.cxx
index 5c60dce0872d..7147dfa84a31 100644
--- a/chart2/source/controller/dialogs/tp_Scale.cxx
+++ b/chart2/source/controller/dialogs/tp_Scale.cxx
@@ -26,6 +26,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -557,6 +558,12 @@ void ScaleTabPage::SetNumFormat()
 nFmt = pNumFormatter->GetStandardFormat( 
SvNumFormatType::TIME, pFormat->GetLanguage() );
 else
 nFmt = pNumFormatter->GetStandardFormat( SvNumFormatType::TIME 
);
+
+// tdf#141625 give enough space to see full date+time
+int 
nWidestTime(m_xFmtFldMin->get_pixel_size(getWidestDateTime(Application::GetSettings().GetLocaleDataWrapper(),
 true)).Width());
+int nWidthChars = std::ceil(nWidestTime / 
m_xFmtFldMin->get_approximate_digit_width()) + 1;
+m_xFmtFldMin->set_width_chars(nWidthChars);
+m_xFmtFldMax->set_width_chars(nWidthChars);
 }
 
 if( m_nAxisType == chart2::AxisType::DATE && ( eType != 
SvNumFormatType::DATE && eType != SvNumFormatType::DATETIME) )
diff --git a/include/sfx2/dialoghelper.hxx b/include/sfx2/dialoghelper.hxx
index e76304ac6808..a853d5d9de5c 100644
--- a/include/sfx2/dialoghelper.hxx
+++ b/include/sfx2/dialoghelper.hxx
@@ -31,9 +31,10 @@ Size SFX2_DLLPUBLIC getPreviewStripSize(const OutputDevice& 
rReference);
 
 Size SFX2_DLLPUBLIC getPreviewOptionsSize(const OutputDevice& rReference);
 
-OUString SFX2_DLLPUBLIC getWidestTime(const LocaleDataWrapper& rWrapper);
+OUString SFX2_DLLPUBLIC getWidestDateTime(const LocaleDataWrapper& rWrapper, 
bool bWithSec);
 
-OUString SFX2_DLLPUBLIC formatTime(const DateTime& rDateTime, const 
LocaleDataWrapper& rWrapper);
+OUString SFX2_DLLPUBLIC formatDateTime(const DateTime& rDateTime, const 
LocaleDataWrapper& rWrapper,
+   bool bWithSec);
 
 #endif
 
diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx 
b/sc/source/ui/miscdlgs/sharedocdlg.cxx
index 4fd2137b519c..66904fe65fdb 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -40,7 +40,7 @@ using namespace ::com::sun::star;
 
 IMPL_LINK(ScShareDocumentDlg, SizeAllocated, const Size&, rSize, void)
 {
-OUString sWidestAccessString = getWidestTime(ScGlobal::getLocaleData());
+OUString sWidestAccessString = 
getWidestDateTime(ScGlobal::getLocaleData(), false);
 const int nAccessWidth = 
m_xLbUsers->get_pixel_size(sWidestAccessString).Width() * 2;
 std::vector aWidths
 {
@@ -152,7 +152,7 @@ void ScShareDocumentDlg::UpdateView()
 tools::Time aTime( nHours, nMinutes );
 DateTime aDateTime( aDate, aTime );
 
-OUString aString = formatTime(aDateTime, 
ScGlobal::getLocaleData());
+OUString aString = formatDateTime(aDateTime, 
ScGlobal::getLocaleData(), false);
 
 m_xLbUsers->append_text(aUser);
 m_xLbUsers->set_text(m_xLbUsers->n_children() - 1, 
aString, 1);
@@ -202,7 +202,7 @@ void ScShareDocumentDlg::UpdateView()
 util::DateTime uDT(xDocProps->getModificationDate());
 DateTime aDateTime(uDT);
 
-OUString aString = formatTime(aDateTime, ScGlobal::getLocaleData()) + 
" " +
+OUString aString = formatDateTime(aDateTime, 
ScGlobal::getLocaleData(), false) + " " +
 ScGlobal::getLocaleData().getTime( aDateTime, false );
 
 m_xLbUsers->append_text(aUser);
diff --git a/sfx2/source/dialog/dialoghelper.cxx 
b/sfx2/source/dialog/dialoghelper.cxx
index 93e697b29517..9585c8baac80 100644
--- a/sfx2/source/dialog/dialoghelper.cxx
+++ b/sfx2/source/dialog/dialoghelper.cxx
@@ -32,17 +32,17 @@ Size getPreviewOptionsSize(const OutputDevice& rReference)
 return rReference.LogicToPixel(Size(70, 27), MapMode(MapUnit::MapAppFont));
 }
 
-OUString getWidestTime(const LocaleDataWrapper& rWrapper)
+OUString getWidestDateTime(const LocaleDataWrapper& rWrapper, bool bWithSec)
 {
 Date aDate(22, 12, 2000);
 tools::Time aTime(2