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

2020-03-07 Thread Matteo Casalin (via logerrit)
 include/vcl/graphicfilter.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6155e69aba4769cac01454bc43270ae3069ef48e
Author: Matteo Casalin 
AuthorDate: Wed Mar 4 18:08:26 2020 +0100
Commit: Matteo Casalin 
CommitDate: Sat Mar 7 22:31:00 2020 +0100

Fix typed flags mask

after commit 2876a0f79f94cdd139cc8fa40669acde9674bf8c

Change-Id: Ibf27d74d73b0e8624efaffdc252b27e366245e38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90165
Tested-by: Jenkins
Reviewed-by: Matteo Casalin 

diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx
index 8a59d2461a2a..20b8abc935de 100644
--- a/include/vcl/graphicfilter.hxx
+++ b/include/vcl/graphicfilter.hxx
@@ -62,7 +62,7 @@ enum class GraphicFilterImportFlags
 };
 namespace o3tl
 {
-template<> struct typed_flags : 
is_typed_flags {};
+template<> struct typed_flags : 
is_typed_flags {};
 }
 
 #define IMP_BMP "SVBMP"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-5-2+backports' - sw/source

2019-09-22 Thread Matteo Casalin (via logerrit)
 sw/source/core/tox/tox.cxx |   33 -
 1 file changed, 16 insertions(+), 17 deletions(-)

New commits:
commit c6ac6b53bcefadb5a62ab6a7e94e9e996f50ba71
Author: Matteo Casalin 
AuthorDate: Sun Jan 14 19:12:30 2018 +0100
Commit: Thorsten Behrens 
CommitDate: Sat Sep 21 03:15:35 2019 +0200

Return correct length for Authority token

Regression from f4fd558ac9d61fe06aa0f56d829916ef9e5ee7b9
Take the chance to calculate token prefix just once.

Change-Id: I19ce5cb037198cb918e79c760a92b285f9b725f1
(cherry picked from commit 34b98af8e5a4e568d8316700bea1ce604d825ce8)
Reviewed-on: https://gerrit.libreoffice.org/52621
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 
(cherry picked from commit c6e8460a5b47fa6fa971dde2a89e80662b6e97ae)
Reviewed-on: https://gerrit.libreoffice.org/52626
Reviewed-by: Noel Grandin 
(cherry picked from commit df041d902eafb1e273eb360103252994bbd2cde2)
Reviewed-on: https://gerrit.libreoffice.org/79276
Reviewed-by: Thorsten Behrens 
Tested-by: Thorsten Behrens 

diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index ee0617d95114..5b56216b1215 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -661,30 +661,29 @@ static FormTokenType lcl_GetTokenType(const OUString & 
sToken,
 {
 static struct
 {
-OUString sNm;
-sal_uInt16 nOffset;
-FormTokenType eToken;
+OUString sTokenStart;
+sal_Int16 nTokenLength;
+FormTokenType eTokenType;
 } const aTokenArr[] = {
-{ SwForm::GetFormTab(), 1, TOKEN_TAB_STOP },
-{ SwForm::GetFormPageNums(),1, TOKEN_PAGE_NUMS },
-{ SwForm::GetFormLinkStt(), 1, TOKEN_LINK_START },
-{ SwForm::GetFormLinkEnd(), 1, TOKEN_LINK_END },
-{ SwForm::GetFormEntryNum(),1, TOKEN_ENTRY_NO },
-{ SwForm::GetFormEntryText(),1, TOKEN_ENTRY_TEXT },
-{ SwForm::GetFormChapterMark(), 1, TOKEN_CHAPTER_INFO },
-{ SwForm::GetFormText(),1, TOKEN_TEXT },
-{ SwForm::GetFormEntry(),   1, TOKEN_ENTRY },
-{ SwForm::GetFormAuth(),3, TOKEN_AUTHORITY }
+{ SwForm::GetFormTab().copy(0, 2), 3, TOKEN_TAB_STOP },
+{ SwForm::GetFormPageNums().copy(0, 2),3, TOKEN_PAGE_NUMS },
+{ SwForm::GetFormLinkStt().copy(0, 3), 4, TOKEN_LINK_START },
+{ SwForm::GetFormLinkEnd().copy(0, 3), 4, TOKEN_LINK_END },
+{ SwForm::GetFormEntryNum().copy(0, 3),4, TOKEN_ENTRY_NO },
+{ SwForm::GetFormEntryText().copy(0, 3),   4, TOKEN_ENTRY_TEXT },
+{ SwForm::GetFormChapterMark().copy(0, 2), 3, TOKEN_CHAPTER_INFO },
+{ SwForm::GetFormText().copy(0, 2),3, TOKEN_TEXT },
+{ SwForm::GetFormEntry().copy(0, 2),   3, TOKEN_ENTRY },
+{ SwForm::GetFormAuth().copy(0, 2),5, TOKEN_AUTHORITY }
 };
 
 for(const auto & i : aTokenArr)
 {
-const sal_Int32 nLen(i.sNm.getLength());
-if( sToken.startsWith( i.sNm.copy(0, nLen - i.nOffset) ))
+if( sToken.startsWith( i.sTokenStart ) )
 {
 if (pTokenLen)
-*pTokenLen = nLen;
-return i.eToken;
+*pTokenLen = i.nTokenLength;
+return i.eTokenType;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-06 Thread Matteo Casalin (via logerrit)
 framework/source/layoutmanager/helpers.cxx |   16 +---
 1 file changed, 5 insertions(+), 11 deletions(-)

New commits:
commit 63497d3a60dfb045cafd6db9ce89c4bff0dc8507
Author: Matteo Casalin 
AuthorDate: Wed Feb 27 08:08:53 2019 +0100
Commit: Matteo Casalin 
CommitDate: Sat Apr 6 23:43:41 2019 +0200

Simplify: avoid OUString copy() and get just needed tokens

Change-Id: I708f222e408223cfaeaac56f87d68375f1d0503f
Reviewed-on: https://gerrit.libreoffice.org/69237
Tested-by: Jenkins
Reviewed-by: Matteo Casalin 

diff --git a/framework/source/layoutmanager/helpers.cxx 
b/framework/source/layoutmanager/helpers.cxx
index a5e4762f2e8b..7659be20cf04 100644
--- a/framework/source/layoutmanager/helpers.cxx
+++ b/framework/source/layoutmanager/helpers.cxx
@@ -197,11 +197,8 @@ OUString getElementTypeFromResourceURL( const OUString& 
aResourceURL )
 OUString aUIResourceURL( UIRESOURCE_URL );
 if ( aResourceURL.startsWith( aUIResourceURL ) )
 {
-sal_Int32   nIndex = 0;
-OUString aPathPart   = aResourceURL.copy( aUIResourceURL.getLength() );
-aPathPart.getToken( 0, '/', nIndex );
-
-return aPathPart.getToken( 0, '/', nIndex );
+sal_Int32 nIndex{ aUIResourceURL.getLength() };
+return aResourceURL.getToken( 1, '/', nIndex );
 }
 
 return OUString();
@@ -212,12 +209,9 @@ void parseResourceURL( const OUString& aResourceURL, 
OUString& aElementType, OUS
 OUString aUIResourceURL( UIRESOURCE_URL );
 if ( aResourceURL.startsWith( aUIResourceURL ) )
 {
-sal_Int32   nIndex = 0;
-OUString aPathPart   = aResourceURL.copy( aUIResourceURL.getLength() );
-aPathPart.getToken( 0, '/', nIndex );
-
-aElementType = aPathPart.getToken( 0, '/', nIndex );
-aElementName = aPathPart.getToken( 0, '/', nIndex );
+sal_Int32 nIndex{ aUIResourceURL.getLength() };
+aElementType = aResourceURL.getToken( 1, '/', nIndex );
+aElementName = aResourceURL.getToken( 0, '/', nIndex );
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-06 Thread Matteo Casalin (via logerrit)
 forms/source/xforms/xpathlib/xpathlib.cxx |   24 
 1 file changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 83f1068ff62f644bc38e54211c48c87362276012
Author: Matteo Casalin 
AuthorDate: Mon Mar 4 16:29:53 2019 +0100
Commit: Matteo Casalin 
CommitDate: Sat Apr 6 23:42:36 2019 +0200

Use char version of OString/OStringBuffer methods

Change-Id: I0222e6675f63797f870746fd34a29702ad190311
Reviewed-on: https://gerrit.libreoffice.org/69240
Tested-by: Jenkins
Reviewed-by: Matteo Casalin 

diff --git a/forms/source/xforms/xpathlib/xpathlib.cxx 
b/forms/source/xforms/xpathlib/xpathlib.cxx
index ac73ec7990df..6fd72e923bf0 100644
--- a/forms/source/xforms/xpathlib/xpathlib.cxx
+++ b/forms/source/xforms/xpathlib/xpathlib.cxx
@@ -234,22 +234,22 @@ static OString makeDateTimeString (const DateTime& 
aDateTime)
 {
 OStringBuffer aDateTimeString;
 aDateTimeString.append(static_cast(aDateTime.GetYear()));
-aDateTimeString.append("-");
-if (aDateTime.GetMonth()<10) aDateTimeString.append("0");
+aDateTimeString.append('-');
+if (aDateTime.GetMonth()<10) aDateTimeString.append('0');
 aDateTimeString.append(static_cast(aDateTime.GetMonth()));
-aDateTimeString.append("-");
-if (aDateTime.GetDay()<10) aDateTimeString.append("0");
+aDateTimeString.append('-');
+if (aDateTime.GetDay()<10) aDateTimeString.append('0');
 aDateTimeString.append(static_cast(aDateTime.GetDay()));
-aDateTimeString.append("T");
-if (aDateTime.GetHour()<10) aDateTimeString.append("0");
+aDateTimeString.append('T');
+if (aDateTime.GetHour()<10) aDateTimeString.append('0');
 aDateTimeString.append(static_cast(aDateTime.GetHour()));
-aDateTimeString.append(":");
-if (aDateTime.GetMin()<10) aDateTimeString.append("0");
+aDateTimeString.append(':');
+if (aDateTime.GetMin()<10) aDateTimeString.append('0');
 aDateTimeString.append(static_cast(aDateTime.GetMin()));
-aDateTimeString.append(":");
-if (aDateTime.GetSec()<10) aDateTimeString.append("0");
+aDateTimeString.append(':');
+if (aDateTime.GetSec()<10) aDateTimeString.append('0');
 aDateTimeString.append(static_cast(aDateTime.GetSec()));
-aDateTimeString.append("Z");
+aDateTimeString.append('Z');
 
 return aDateTimeString.makeStringAndClear();
 }
@@ -305,7 +305,7 @@ static bool parseDateTime(const OUString& aString, 
DateTime& aDateTime)
 Date tmpDate(static_cast(nDay), 
static_cast(nMonth), static_cast(nYear));
 tools::Time tmpTime(nHour, nMinute, nSecond);
 DateTime tmpDateTime(tmpDate, tmpTime);
-if (aString.indexOf("Z") < 0)
+if (aString.lastIndexOf('Z') < 0)
 tmpDateTime.ConvertToUTC();
 
 aDateTime = tmpDateTime;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-06 Thread Matteo Casalin (via logerrit)
 forms/source/component/ListBox.cxx |   14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

New commits:
commit cca2e42926a14ec27c663cd0f495dccb7607d6f9
Author: Matteo Casalin 
AuthorDate: Mon Mar 4 16:20:50 2019 +0100
Commit: Matteo Casalin 
CommitDate: Sat Apr 6 23:41:12 2019 +0200

Use getTokenCount and indexed getToken

Change-Id: Id57a1771c897c69b05d02a359f22e5fb2b1f5a31
Reviewed-on: https://gerrit.libreoffice.org/69239
Tested-by: Jenkins
Reviewed-by: Matteo Casalin 

diff --git a/forms/source/component/ListBox.cxx 
b/forms/source/component/ListBox.cxx
index d6857dcfdcf8..fcf16abe66b4 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -637,19 +638,12 @@ namespace frm
 OUString sListSource;
 _rxInStream >> sListSource;
 
-sal_Int32 nTokens = 1;
-const sal_Unicode* pStr = sListSource.getStr();
-while ( *pStr )
-{
-if ( *pStr == ';' )
-nTokens++;
-pStr++;
-}
+const sal_Int32 nTokens{ 
comphelper::string::getTokenCount(sListSource, ';') };
 aListSourceSeq.realloc( nTokens );
+sal_Int32 nIdx{ 0 };
 for (sal_Int32 i=0; ihttps://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-06 Thread Matteo Casalin (via logerrit)
 filter/source/msfilter/msvbahelper.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 736a481af5c6b7e7d4a652048be14ad0ebbd45e4
Author: Matteo Casalin 
AuthorDate: Wed Mar 13 23:45:42 2019 +0100
Commit: Matteo Casalin 
CommitDate: Sat Apr 6 23:41:49 2019 +0200

Avoid using index for single getToken() call

Change-Id: I76eaf140b153199b62606ac3336d712a64205dcc
Reviewed-on: https://gerrit.libreoffice.org/69246
Tested-by: Jenkins
Reviewed-by: Matteo Casalin 

diff --git a/filter/source/msfilter/msvbahelper.cxx 
b/filter/source/msfilter/msvbahelper.cxx
index fa258ea7f93c..3a6e0a378706 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -115,9 +115,7 @@ static SfxObjectShell* findShellForUrl( const OUString& 
sMacroURLOrPath )
 uno::Reference< frame::XFrame > xFrame( 
xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
 uno::Reference< beans::XPropertySet > xProps( xFrame, 
uno::UNO_QUERY_THROW );
 xProps->getPropertyValue("Title") >>= aName;
-sal_Int32 pos = 0;
-aName = aName.getToken(0,'-',pos);
-aName = aName.trim();
+aName = aName.getToken(0, '-').trim();
 if( sMacroURLOrPath.lastIndexOf( aName ) >= 0 )
 {
 pFoundShell = pShell;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits