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

2021-09-23 Thread Eike Rathke (via logerrit)
 svl/source/numbers/zforlist.cxx |   20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit c8d66a4d53acf1b0c0de45335015b72ee72cd0fd
Author: Eike Rathke 
AuthorDate: Thu Sep 23 16:23:47 2021 +0200
Commit: Eike Rathke 
CommitDate: Thu Sep 23 17:17:02 2021 +0200

Reorder the internal ZF_STANDARD_DATETIME offsets to a more logical sequence

These once were to be strictly kept for the binary file format but
nowadays only serve as a position / key index offset within the
numberformat map.

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

diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index ae6710ee18f1..721c71ce8b0a 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -160,7 +160,7 @@ sal_uInt32 const indexTable[NF_INDEX_TABLE_ENTRIES] = {
 ZF_STANDARD_DATETIME + 1, // NF_DATETIME_SYS_DDMM_HHMMSS
 ZF_STANDARD_LOGICAL, // NF_BOOLEAN
 ZF_STANDARD_TEXT, // NF_TEXT
-ZF_STANDARD_DATETIME + 4, // NF_DATETIME_SYS_DDMM_HHMM
+ZF_STANDARD_DATETIME + 2, // NF_DATETIME_SYS_DDMM_HHMM
 ZF_STANDARD_FRACTION + 2, // NF_FRACTION_3D
 ZF_STANDARD_FRACTION + 3, // NF_FRACTION_2
 ZF_STANDARD_FRACTION + 4, // NF_FRACTION_4
@@ -168,10 +168,10 @@ sal_uInt32 const indexTable[NF_INDEX_TABLE_ENTRIES] = {
 ZF_STANDARD_FRACTION + 6, // NF_FRACTION_16
 ZF_STANDARD_FRACTION + 7, // NF_FRACTION_10
 ZF_STANDARD_FRACTION + 8, // NF_FRACTION_100
-ZF_STANDARD_DATETIME + 2, // NF_DATETIME_ISO_MMDD_HHMMSS
-ZF_STANDARD_DATETIME + 6, // NF_DATETIME_ISO_MMDD_HHMMSS000
-ZF_STANDARD_DATETIME + 3, // NF_DATETIME_ISO_MMDDTHHMMSS
-ZF_STANDARD_DATETIME + 5  // NF_DATETIME_ISO_MMDDTHHMMSS000
+ZF_STANDARD_DATETIME + 3, // NF_DATETIME_ISO_MMDD_HHMMSS
+ZF_STANDARD_DATETIME + 4, // NF_DATETIME_ISO_MMDD_HHMMSS000
+ZF_STANDARD_DATETIME + 5, // NF_DATETIME_ISO_MMDDTHHMMSS
+ZF_STANDARD_DATETIME + 6  // NF_DATETIME_ISO_MMDDTHHMMSS000
 };
 
 /**
@@ -2875,7 +2875,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 
CLOffset, bool bNoAdditio
 // DD.MM. HH:MM   System
 nIdx = ImpGetFormatCodeIndex( aFormatSeq, NF_DATETIME_SYS_DDMM_HHMM );
 ImpInsertFormat( aFormatSeq[nIdx],
- CLOffset + ZF_STANDARD_DATETIME+4 /* 
NF_DATETIME_SYS_DDMM_HHMM */ );
+ CLOffset + ZF_STANDARD_DATETIME+2 /* 
NF_DATETIME_SYS_DDMM_HHMM */ );
 
 const NfKeywordTable & rKeyword = pFormatScanner->GetKeywords();
 i18n::NumberFormatCode aSingleFormatCode;
@@ -2890,7 +2890,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 
CLOffset, bool bNoAdditio
 rKeyword[NF_KEY_MMI] + ":" +
 rKeyword[NF_KEY_SS];
 SvNumberformat* pFormat = ImpInsertFormat( aSingleFormatCode,
- CLOffset + ZF_STANDARD_DATETIME+2 /* 
NF_DATETIME_ISO_MMDD_HHMMSS */ );
+ CLOffset + ZF_STANDARD_DATETIME+3 /* 
NF_DATETIME_ISO_MMDD_HHMMSS */ );
 assert(pFormat);
 
 // -MM-DD HH:MM:SS,000   ISO (with blank instead of 'T') and
@@ -2904,7 +2904,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 
CLOffset, bool bNoAdditio
 rKeyword[NF_KEY_SS] + GetLocaleData()->getTime100SecSep() +
 "000";
 pFormat = ImpInsertFormat( aSingleFormatCode,
- CLOffset + ZF_STANDARD_DATETIME+6 /* 
NF_DATETIME_ISO_MMDD_HHMMSS000 */ );
+ CLOffset + ZF_STANDARD_DATETIME+4 /* 
NF_DATETIME_ISO_MMDD_HHMMSS000 */ );
 assert(pFormat);
 
 // -MM-DD"T"HH:MM:SS   ISO
@@ -2916,7 +2916,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 
CLOffset, bool bNoAdditio
 rKeyword[NF_KEY_MMI] + ":" +
 rKeyword[NF_KEY_SS];
 pFormat = ImpInsertFormat( aSingleFormatCode,
- CLOffset + ZF_STANDARD_DATETIME+3 /* 
NF_DATETIME_ISO_MMDDTHHMMSS */ );
+ CLOffset + ZF_STANDARD_DATETIME+5 /* 
NF_DATETIME_ISO_MMDDTHHMMSS */ );
 assert(pFormat);
 pFormat->SetComment("ISO 8601");// not to be localized
 
@@ -2930,7 +2930,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 
CLOffset, bool bNoAdditio
 rKeyword[NF_KEY_SS] + (GetLocaleData()->getTime100SecSep() == "." ? 
"." : ",") +
 "000";
 pFormat = ImpInsertFormat( aSingleFormatCode,
- CLOffset + ZF_STANDARD_DATETIME+5 /* 
NF_DATETIME_ISO_MMDDTHHMMSS000 */ );
+ CLOffset + ZF_STANDARD_DATETIME+6 /* 
NF_DATETIME_ISO_MMDDTHHMMSS000 */ );
 assert(pFormat);
 pFormat->SetComment("ISO 8601");// not to be localized
 


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

2021-09-23 Thread Eike Rathke (via logerrit)
 include/svl/zforlist.hxx|5 +++--
 svl/qa/unit/svl.cxx |3 ++-
 svl/source/numbers/zforlist.cxx |   25 +
 svx/source/items/numfmtsh.cxx   |1 +
 4 files changed, 27 insertions(+), 7 deletions(-)

New commits:
commit cda7dff78a113a18cdcc23274454cfef982a17c2
Author: Eike Rathke 
AuthorDate: Thu Sep 23 01:20:57 2021 +0200
Commit: Eike Rathke 
CommitDate: Thu Sep 23 10:28:11 2021 +0200

Add not-quite-ISO date+time with space and milliseconds and locale's 
separator

NF_DATETIME_ISO_MMDD_HHMMSS000
-MM-DD HH:MM:SS.000

Users may expect to see that if they enter such, instead of the
real ISO 8601 "T" format.

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

diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index 59b748e4381e..9836f5047542 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -246,13 +246,14 @@ enum NfIndexTableOffset
 NF_FRACTION_100,// # ??/100
 
 NF_DATETIME_ISO_MMDD_HHMMSS,// 1997-10-08 01:23:45  
ISO (with blank instead of T)
+NF_DATETIME_ISO_MMDD_HHMMSS000, // 1997-10-08 01:23:45.678  
not quite ISO with locale's separator
 NF_DATETIME_ISO_MMDDTHHMMSS,// 1997-10-08T01:23:45  ISO
-NF_DATETIME_ISO_MMDDTHHMMSS000, // 1997-10-08T01:23:45,678  
ISO with milliseconds
+NF_DATETIME_ISO_MMDDTHHMMSS000, // 1997-10-08T01:23:45,678  
ISO with milliseconds and ',' or '.'
 
 // XXX When adding values here, follow the comment above about
 // svx/source/items/numfmtsh.cxx
 
-NF_INDEX_TABLE_ENTRIES  // == 61, reserved to not be used 
in i18npool locale data.
+NF_INDEX_TABLE_ENTRIES  // == 62, reserved to not be used 
in i18npool locale data.
 
 // XXX Adding values above may increment the reserved area that can't be
 // used by i18npool's locale data FormatCode definitions, see the
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index 155fc9cbf1da..075515bca512 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -232,6 +232,7 @@ void Test::testNumberFormat()
 
 const char* pDateTimeExt2[] = {
 "-MM-DD HH:MM:SS",
+"-MM-DD HH:MM:SS.000",
 "-MM-DD\"T\"HH:MM:SS",
 "-MM-DD\"T\"HH:MM:SS.000",
 nullptr
@@ -265,7 +266,7 @@ void Test::testNumberFormat()
 { NF_TEXT, NF_TEXT, 1, pText },
 { NF_DATETIME_SYS_DDMM_HHMM, NF_DATETIME_SYS_DDMM_HHMM, 1, 
pDateTimeExt1 },
 { NF_FRACTION_3D, NF_FRACTION_100, 7, pFractionExt },
-{ NF_DATETIME_ISO_MMDD_HHMMSS, NF_DATETIME_ISO_MMDDTHHMMSS000, 
3, pDateTimeExt2 }
+{ NF_DATETIME_ISO_MMDD_HHMMSS, NF_DATETIME_ISO_MMDDTHHMMSS000, 
4, pDateTimeExt2 }
 };
 
 SvNumberFormatter aFormatter(m_xContext, eLang);
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index dca678d81abd..ae6710ee18f1 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -169,6 +169,7 @@ sal_uInt32 const indexTable[NF_INDEX_TABLE_ENTRIES] = {
 ZF_STANDARD_FRACTION + 7, // NF_FRACTION_10
 ZF_STANDARD_FRACTION + 8, // NF_FRACTION_100
 ZF_STANDARD_DATETIME + 2, // NF_DATETIME_ISO_MMDD_HHMMSS
+ZF_STANDARD_DATETIME + 6, // NF_DATETIME_ISO_MMDD_HHMMSS000
 ZF_STANDARD_DATETIME + 3, // NF_DATETIME_ISO_MMDDTHHMMSS
 ZF_STANDARD_DATETIME + 5  // NF_DATETIME_ISO_MMDDTHHMMSS000
 };
@@ -1281,9 +1282,8 @@ bool SvNumberFormatter::IsNumberFormat(const OUString& 
sString,
 }
 else if (pStringScanner->CanForceToIso8601( DateOrder::Invalid))
 {
-/* TODO: add a millisecond format with space instead of 'T'? */
 if (pStringScanner->GetDecPos())
-F_Index = GetFormatIndex( 
NF_DATETIME_ISO_MMDDTHHMMSS000, ActLnge );
+F_Index = GetFormatIndex( 
NF_DATETIME_ISO_MMDD_HHMMSS000, ActLnge );
 else
 F_Index = GetFormatIndex( NF_DATETIME_ISO_MMDD_HHMMSS, 
ActLnge );
 }
@@ -1649,6 +1649,8 @@ sal_uInt32 SvNumberFormatter::GetEditFormat( double 
fNumber, sal_uInt32 nFIndex,
 nKey = GetFormatIndex( NF_DATETIME_ISO_MMDDTHHMMSS, eLang );
 else if (nFIndex == GetFormatIndex( 
NF_DATETIME_ISO_MMDDTHHMMSS000, eLang))
 nKey = GetFormatIndex( NF_DATETIME_ISO_MMDDTHHMMSS000, eLang );
+else if (nFIndex == GetFormatIndex( 
NF_DATETIME_ISO_MMDD_HHMMSS000, eLang))
+nKey = GetFormatIndex( NF_DATETIME_ISO_MMDD_HHMMSS000, eLang );
 else if (nFIndex == GetFormatInde

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

2021-09-21 Thread Eike Rathke (via logerrit)
 include/svl/zforlist.hxx|3 ++-
 svl/qa/unit/svl.cxx |3 ++-
 svl/source/numbers/zforlist.cxx |   30 +++---
 svl/source/numbers/zforscan.cxx |   32 ++--
 svx/source/items/numfmtsh.cxx   |3 ++-
 5 files changed, 63 insertions(+), 8 deletions(-)

New commits:
commit 508f5b7767210318f1a23efc6db928c87a5eca6f
Author: Eike Rathke 
AuthorDate: Tue Sep 21 19:26:51 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Sep 21 21:00:45 2021 +0200

Add ISO 8601 date+time with milliseconds format

NF_DATETIME_ISO_MMDDTHHMMSS000
-MM-DD"T"HH:MM:SS,000

using either ',' or '.' separator,
'.' if Time100SecSep is '.'
',' else

A prerequisite for tdf#88359 to not lose data when importing such,
especially without "Detect special numbers" on.

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

diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index a9b9fa37748a..59b748e4381e 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -247,11 +247,12 @@ enum NfIndexTableOffset
 
 NF_DATETIME_ISO_MMDD_HHMMSS,// 1997-10-08 01:23:45  
ISO (with blank instead of T)
 NF_DATETIME_ISO_MMDDTHHMMSS,// 1997-10-08T01:23:45  ISO
+NF_DATETIME_ISO_MMDDTHHMMSS000, // 1997-10-08T01:23:45,678  
ISO with milliseconds
 
 // XXX When adding values here, follow the comment above about
 // svx/source/items/numfmtsh.cxx
 
-NF_INDEX_TABLE_ENTRIES  // == 60, reserved to not be used 
in i18npool locale data.
+NF_INDEX_TABLE_ENTRIES  // == 61, reserved to not be used 
in i18npool locale data.
 
 // XXX Adding values above may increment the reserved area that can't be
 // used by i18npool's locale data FormatCode definitions, see the
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index 8ba86cab..155fc9cbf1da 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -233,6 +233,7 @@ void Test::testNumberFormat()
 const char* pDateTimeExt2[] = {
 "-MM-DD HH:MM:SS",
 "-MM-DD\"T\"HH:MM:SS",
+"-MM-DD\"T\"HH:MM:SS.000",
 nullptr
 };
 
@@ -264,7 +265,7 @@ void Test::testNumberFormat()
 { NF_TEXT, NF_TEXT, 1, pText },
 { NF_DATETIME_SYS_DDMM_HHMM, NF_DATETIME_SYS_DDMM_HHMM, 1, 
pDateTimeExt1 },
 { NF_FRACTION_3D, NF_FRACTION_100, 7, pFractionExt },
-{ NF_DATETIME_ISO_MMDD_HHMMSS, NF_DATETIME_ISO_MMDDTHHMMSS, 2, 
pDateTimeExt2 }
+{ NF_DATETIME_ISO_MMDD_HHMMSS, NF_DATETIME_ISO_MMDDTHHMMSS000, 
3, pDateTimeExt2 }
 };
 
 SvNumberFormatter aFormatter(m_xContext, eLang);
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index e623a0239743..dca678d81abd 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -169,7 +169,8 @@ sal_uInt32 const indexTable[NF_INDEX_TABLE_ENTRIES] = {
 ZF_STANDARD_FRACTION + 7, // NF_FRACTION_10
 ZF_STANDARD_FRACTION + 8, // NF_FRACTION_100
 ZF_STANDARD_DATETIME + 2, // NF_DATETIME_ISO_MMDD_HHMMSS
-ZF_STANDARD_DATETIME + 3  // NF_DATETIME_ISO_MMDDTHHMMSS
+ZF_STANDARD_DATETIME + 3, // NF_DATETIME_ISO_MMDDTHHMMSS
+ZF_STANDARD_DATETIME + 5  // NF_DATETIME_ISO_MMDDTHHMMSS000
 };
 
 /**
@@ -1273,11 +1274,18 @@ bool SvNumberFormatter::IsNumberFormat(const OUString& 
sString,
 // Preserve ISO 8601 input.
 if (pStringScanner->HasIso8601Tsep())
 {
-F_Index = GetFormatIndex( NF_DATETIME_ISO_MMDDTHHMMSS, 
ActLnge );
+if (pStringScanner->GetDecPos())
+F_Index = GetFormatIndex( 
NF_DATETIME_ISO_MMDDTHHMMSS000, ActLnge );
+else
+F_Index = GetFormatIndex( NF_DATETIME_ISO_MMDDTHHMMSS, 
ActLnge );
 }
 else if (pStringScanner->CanForceToIso8601( DateOrder::Invalid))
 {
-F_Index = GetFormatIndex( NF_DATETIME_ISO_MMDD_HHMMSS, 
ActLnge );
+/* TODO: add a millisecond format with space instead of 'T'? */
+if (pStringScanner->GetDecPos())
+F_Index = GetFormatIndex( 
NF_DATETIME_ISO_MMDDTHHMMSS000, ActLnge );
+else
+F_Index = GetFormatIndex( NF_DATETIME_ISO_MMDD_HHMMSS, 
ActLnge );
 }
 else
 {
@@ -1639,6 +1647,8 @@ sal_uInt32 SvNumberFormatter::GetEditFormat( double 
fNumber, sal_uInt32 nFIndex,
 case SvNumFormatType::DATETIME :
 if (nFIndex == GetFormatIndex( NF_DATETIME_ISO_MMDDTHHMMSS, eLang))
 

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

2021-09-21 Thread Eike Rathke (via logerrit)
 svl/source/numbers/zformat.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e430d82ec56f34fb5ae45a50eb12cd03c7e40ba3
Author: Eike Rathke 
AuthorDate: Tue Sep 21 17:09:28 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Sep 21 18:46:32 2021 +0200

SvNumberformat: preserve error position if already set

ImpSvNumberformatScan::ScanType() may already return an error
position in which case FinalScan() is not executed but
nResultStringsCnt is set only there and otherwise 0, so after
ScanFormat() force a different error position only if both are 0.

This in the dialog positions the error selection correctly instead
of after the first character.

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

diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 22a377a6cc69..0f618e75ca02 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1112,7 +1112,7 @@ SvNumberformat::SvNumberformat(OUString& rString,
 }
 sal_Int32 nStrPos = pSc->ScanFormat( sStr);
 sal_uInt16 nCnt = pSc->GetResultStringsCnt();
-if (nCnt == 0)  // error
+if (nCnt == 0 && nStrPos == 0)  // error
 {
 nStrPos = 1;
 }


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

2021-09-15 Thread Eike Rathke (via logerrit)
 sc/inc/column.hxx|   17 -
 sc/inc/document.hxx  |   23 -
 sc/inc/sortparam.hxx |   69 
 sc/inc/table.hxx |   24 +
 sc/qa/unit/ucalc_sort.cxx|8 
 sc/source/core/data/column2.cxx  |   81 ++---
 sc/source/core/data/document.cxx |5 
 sc/source/core/data/sortparam.cxx|   41 +-
 sc/source/core/data/table1.cxx   |   56 ++-
 sc/source/core/data/table3.cxx   |  338 +++
 sc/source/filter/xml/XMLExportDatabaseRanges.cxx |2 
 sc/source/ui/app/transobj.cxx|   22 +
 sc/source/ui/dbgui/tpsort.cxx|   12 
 sc/source/ui/docshell/dbdocfun.cxx   |   64 +++-
 sc/source/ui/undo/undosort.cxx   |   15 -
 sc/source/ui/unoobj/datauno.cxx  |4 
 sc/source/ui/view/cellsh2.cxx|   12 
 sc/source/ui/view/gridwin.cxx|6 
 18 files changed, 518 insertions(+), 281 deletions(-)

New commits:
commit fff92a72443842dda94a36fba753673066aeb399
Author: Eike Rathke 
AuthorDate: Sun Sep 12 20:15:01 2021 +0200
Commit: Mike Kaganski 
CommitDate: Wed Sep 15 18:54:15 2021 +0200

Resolves: tdf#144135 Rework Sort with area extras

Since

commit 774a61afa9fc281290e7bfad4e28c05978b82d73
CommitDate: Wed Apr 14 08:46:03 2021 +0200

tdf#126678 - Consider "Include formats" option during sort

a sheet formatted with visible attributes like cell background
colour up to the end if for Sort all columns and/or rows are
selected lead to an excessive memory allocation and slow execution
time if it didn't get killed by the operating system before due to
memory exhaustion.

The same could had happened already before if graphics or comments
were to be included that could had resulted in a similar large
range. However, cell formats across sheets are more likely.

This changes the strategy how the to be sorted data range is
determined (range only with data) and additional area extras
ranges without data that are only to be rearranged. Those are then
processed in chunks (limited to ~512MB per chunk).

Cell formats that are identical within one column's rows range do
not even need to be covered as they are not rearranged, in the
best case leading to all trailing formats' ranges being excluded
from the sort.

Additionally optimize the cell gathering of formats, graphics and
comments such that for the area extras they are only collected if
actually requested.

The overall performance gain is in an order of magnitudes even if
some extras are to be collected.

Change-Id: If3abbaeaa615aaff7d88a82a5b3fc7ac633d770d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122013
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 0a9b68c9f9880655576e3220d8b70064b367dbee)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121981
Reviewed-by: Mike Kaganski 

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 20ae065c1613..72527a76cd9e 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -218,19 +218,16 @@ public:
 // data only:
 boolIsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const;
 SCSIZE  GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, 
ScDirection eDir ) const;
-boolHasDataAt(SCROW nRow, bool bConsiderCellNotes = false,
-   bool bConsiderCellDrawObjects = false, bool 
bConsiderCellFormats = false) const;
-boolHasDataAt(sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow,
-   bool bConsiderCellNotes = false, bool 
bConsiderCellDrawObjects = false,
-   bool bConsiderCellFormats = false) const;
-boolHasDataAt(sc::ColumnBlockPosition& rBlockPos, SCROW nRow, bool 
bConsiderCellNotes = false,
-   bool bConsiderCellDrawObjects = false, bool 
bConsiderCellFormats = false);
+boolHasDataAt( SCROW nRow, ScDataAreaExtras* pDataAreaExtras = 
nullptr ) const;
+boolHasDataAt( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow,
+   ScDataAreaExtras* pDataAreaExtras = nullptr ) const;
+boolHasDataAt( sc::ColumnBlockPosition& rBlockPos, SCROW nRow,
+   ScDataAreaExtras* pDataAreaExtras = nullptr );
+voidGetDataExtrasAt( SCROW nRow, ScDataAreaExtras& rDataAreaExtras 
) const;
 boolHasVisibleDataAt(SCROW nRow) const;
 SCROW   GetFirstDataPos() const;
 SCROW   GetLastDataPos() const;
-SCROW   GetLastDataPos(SCROW nLastRow, bool bConsiderCellNotes = false,
- bool bC

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

2021-09-14 Thread Eike Rathke (via logerrit)
 svl/source/numbers/zforfind.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit d2a78a49438134e174bb8fc83d4adb486f692ff7
Author: Eike Rathke 
AuthorDate: Mon Sep 13 11:42:39 2021 +0200
Commit: Xisco Fauli 
CommitDate: Tue Sep 14 10:26:37 2021 +0200

Resolves: tdf#116184 Check that there is no trailing number behind a match

... without being separated by a blank so the match is rejected if
it doesn't possibly form a date+time input and input can be
accepted as decimal fraction.

Change-Id: Iabd1d216366ecb8454c59822ce58f112bfa6091e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122024
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit eb0b4ab2d3b86d77ee0edb652d4486343e5b3b1f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122055
Reviewed-by: Xisco Fauli 

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 191a388581ea..9f90dd28b732 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1487,8 +1487,9 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( 
sal_uInt16 nStartPatternAt )
 if (!IsNum[nCheck])
 {
 // Trailing (or separating if time follows) blanks are ok.
-SkipBlanks( sStrArray[nCheck], nPos);
-if (nPos == sStrArray[nCheck].getLength())
+// No blank and a following number is not.
+const bool bBlanks = SkipBlanks( sStrArray[nCheck], nPos);
+if (nPos == sStrArray[nCheck].getLength() && (bBlanks || 
!IsNum[nNext]))
 {
 nAcceptedDatePattern = nPattern;
 return true;


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - cui/source

2021-09-14 Thread Eike Rathke (via logerrit)
 cui/source/options/optgdlg.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 0d957c6474f6dfb713fd7ed6edc6edf70efe42b3
Author: Eike Rathke 
AuthorDate: Mon Sep 13 16:24:23 2021 +0200
Commit: Xisco Fauli 
CommitDate: Tue Sep 14 10:15:44 2021 +0200

Explicitly set cursor position for x11 'gen' backend, tdf#144457 follow-up

... (and other backends?)

Change-Id: If45b83080aa2df50ef27ad282eb6fa1d4a022703
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122037
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 37e2e99f7a3018dce0337b582b139d41e1e81a9a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122060
Reviewed-by: Xisco Fauli 

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index b5c6bcb49584..a36aac47abc3 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1819,7 +1819,13 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, 
weld::Entry&, rEd, void )
 }
 }
 if (bModified)
-rEd.set_text(aBuf.makeStringAndClear());  // This even keeps the 
cursor position so all good.
+{
+// gtk3 keeps the cursor position on equal length set_text() but at
+// least the 'gen' backend does not and resets to 0.
+const int nCursorPos = rEd.get_position();
+rEd.set_text(aBuf.makeStringAndClear());
+rEd.set_position(nCursorPos);
+}
 if (bValid)
 rEd.set_message_type(weld::EntryMessageType::Normal);
 else


[Libreoffice-commits] core.git: helpcontent2

2021-09-13 Thread Eike Rathke (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 80a47aae1419842f4496f02028e2b49763aea25b
Author: Eike Rathke 
AuthorDate: Tue Sep 14 01:18:50 2021 +0200
Commit: Gerrit Code Review 
CommitDate: Tue Sep 14 01:18:50 2021 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 7fcb420ec4010eeaad4176d6df0dcc7451aa9094
  - Update ICU regexp URL

Change-Id: Id64c141945e981560e01b789a3664955af923528
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/122074
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/helpcontent2 b/helpcontent2
index 74c629f13542..7fcb420ec401 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 74c629f13542c1ee188cd5e9723528e97536e80e
+Subproject commit 7fcb420ec4010eeaad4176d6df0dcc7451aa9094


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

2021-09-13 Thread Eike Rathke (via logerrit)
 source/text/scalc/01/func_regex.xhp |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7fcb420ec4010eeaad4176d6df0dcc7451aa9094
Author: Eike Rathke 
AuthorDate: Tue Sep 14 01:15:51 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Sep 14 01:18:49 2021 +0200

Update ICU regexp URL

Change-Id: Id64c141945e981560e01b789a3664955af923528
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/122074
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/source/text/scalc/01/func_regex.xhp 
b/source/text/scalc/01/func_regex.xhp
index f0b497dd1..9c48cf219 100644
--- a/source/text/scalc/01/func_regex.xhp
+++ b/source/text/scalc/01/func_regex.xhp
@@ -30,7 +30,7 @@
 
 REGEX( 
Text ; Expression [ ; [ Replacement ] [ ; Flags|Occurrence ] ] )
 Text: A text or reference to a cell where the 
regular expression is to be applied.
-Expression: A text representing the regular 
expression, using http://userguide.icu-project.org/strings/regexp; 
name="ICU REGEXP">ICU regular expressions. If there is no match and 
Replacement is not given, #N/A is returned.
+Expression: A text representing the regular 
expression, using https://unicode-org.github.io/icu/userguide/strings/regexp.html; 
name="ICU REGEXP">ICU regular expressions. If there is no match and 
Replacement is not given, #N/A is returned.
 Replacement: Optional. The replacement text and 
references to capture groups. If there is no match, Text is 
returned unmodified.
 Flags: Optional. "g" replaces all matches of 
Expression in Text, not extracted. If there is no 
match, Text is returned unmodified.
 Occurrence: Optional. Number to indicate which 
match of Expression in Text is to be extracted or 
replaced. If there is no match and Replacement is not given, #N/A 
is returned. If there is no match and Replacement is given, 
Text is returned unmodified. If Occurrence is 0, 
Text is returned unmodified.
@@ -42,7 +42,7 @@
 =REGEX("axbxcxd";"(.)x";"$1y";2)  
returns "axbycxd", the second match of "(.)x" (i.e. "bx") replaced with the 
captured group of one character (i.e. "b") followed by "y".
 
 List of regular expressions
-http://userguide.icu-project.org/strings/regexp; 
name="ICU REGEXP">ICU regular expressions
+https://unicode-org.github.io/icu/userguide/strings/regexp.html; 
name="ICU REGEXP">ICU regular expressions
 
 
 


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

2021-09-13 Thread Eike Rathke (via logerrit)
 cui/source/options/optgdlg.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 2adcd82658f8c536e8288b4906b005b8ebe3fbb8
Author: Eike Rathke 
AuthorDate: Mon Sep 13 16:24:23 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Sep 13 18:28:33 2021 +0200

Explicitly set cursor position for x11 'gen' backend, tdf#144457 follow-up

... (and other backends?)

Change-Id: If45b83080aa2df50ef27ad282eb6fa1d4a022703
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122037
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 37e2e99f7a3018dce0337b582b139d41e1e81a9a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122059
Reviewed-by: Xisco Fauli 

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 4d376043ced7..baa96ad3166c 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1783,7 +1783,13 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, 
weld::Entry&, rEd, void )
 }
 }
 if (bModified)
-rEd.set_text(aBuf.makeStringAndClear());  // This even keeps the 
cursor position so all good.
+{
+// gtk3 keeps the cursor position on equal length set_text() but at
+// least the 'gen' backend does not and resets to 0.
+const int nCursorPos = rEd.get_position();
+rEd.set_text(aBuf.makeStringAndClear());
+rEd.set_position(nCursorPos);
+}
 if (bValid)
 rEd.set_message_type(weld::EntryMessageType::Normal);
 else


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

2021-09-13 Thread Eike Rathke (via logerrit)
 cui/source/options/optgdlg.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 37e2e99f7a3018dce0337b582b139d41e1e81a9a
Author: Eike Rathke 
AuthorDate: Mon Sep 13 16:24:23 2021 +0200
Commit: Eike Rathke 
CommitDate: Mon Sep 13 17:18:30 2021 +0200

Explicitly set cursor position for x11 'gen' backend, tdf#144457 follow-up

... (and other backends?)

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

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 92acc1bc0001..5424c03622f4 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1789,7 +1789,13 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, 
weld::Entry&, rEd, void )
 }
 }
 if (bModified)
-rEd.set_text(aBuf.makeStringAndClear());  // This even keeps the 
cursor position so all good.
+{
+// gtk3 keeps the cursor position on equal length set_text() but at
+// least the 'gen' backend does not and resets to 0.
+const int nCursorPos = rEd.get_position();
+rEd.set_text(aBuf.makeStringAndClear());
+rEd.set_position(nCursorPos);
+}
 if (bValid)
 rEd.set_message_type(weld::EntryMessageType::Normal);
 else


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

2021-09-13 Thread Eike Rathke (via logerrit)
 svl/source/numbers/zforfind.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 366b5878015b8cd75ceb7f2db00d286dafa365bd
Author: Eike Rathke 
AuthorDate: Mon Sep 13 12:02:41 2021 +0200
Commit: Eike Rathke 
CommitDate: Mon Sep 13 16:25:22 2021 +0200

Check string bounds

Doesn't occur in practice because all date acceptance patterns
start with a YMD character, enforced by the dialog, but just in case..

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

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 9d3c3baec899..330921242a01 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1476,7 +1476,7 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( 
sal_uInt16 nStartPatternAt )
 {
 ++nPos;
 c = rPat[--nPatCheck];
-} while (c != 'Y' && c != 'M' && c != 'D');
+} while (c != 'Y' && c != 'M' && c != 'D' && 
nPatCheck > 0);
 }
 }
 }


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

2021-09-13 Thread Eike Rathke (via logerrit)
 svl/source/numbers/zforfind.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit c2d838598add1daff8c7429432715a8dd78231f0
Author: Eike Rathke 
AuthorDate: Mon Sep 13 11:42:39 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Sep 13 15:14:54 2021 +0200

Resolves: tdf#116184 Check that there is no trailing number behind a match

... without being separated by a blank so the match is rejected if
it doesn't possibly form a date+time input and input can be
accepted as decimal fraction.

Change-Id: Iabd1d216366ecb8454c59822ce58f112bfa6091e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122024
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit eb0b4ab2d3b86d77ee0edb652d4486343e5b3b1f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122054
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 121b9bd406f6..9d3c3baec899 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1487,8 +1487,9 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( 
sal_uInt16 nStartPatternAt )
 if (!IsNum[nCheck])
 {
 // Trailing (or separating if time follows) blanks are ok.
-SkipBlanks( sStrArray[nCheck], nPos);
-if (nPos == sStrArray[nCheck].getLength())
+// No blank and a following number is not.
+const bool bBlanks = SkipBlanks( sStrArray[nCheck], nPos);
+if (nPos == sStrArray[nCheck].getLength() && (bBlanks || 
!IsNum[nNext]))
 {
 nAcceptedDatePattern = nPattern;
 return true;


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

2021-09-13 Thread Eike Rathke (via logerrit)
 svl/source/numbers/zforfind.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit eb0b4ab2d3b86d77ee0edb652d4486343e5b3b1f
Author: Eike Rathke 
AuthorDate: Mon Sep 13 11:42:39 2021 +0200
Commit: Eike Rathke 
CommitDate: Mon Sep 13 13:57:19 2021 +0200

Resolves: tdf#116184 Check that there is no trailing number behind a match

... without being separated by a blank so the match is rejected if
it doesn't possibly form a date+time input and input can be
accepted as decimal fraction.

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

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 121b9bd406f6..9d3c3baec899 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1487,8 +1487,9 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( 
sal_uInt16 nStartPatternAt )
 if (!IsNum[nCheck])
 {
 // Trailing (or separating if time follows) blanks are ok.
-SkipBlanks( sStrArray[nCheck], nPos);
-if (nPos == sStrArray[nCheck].getLength())
+// No blank and a following number is not.
+const bool bBlanks = SkipBlanks( sStrArray[nCheck], nPos);
+if (nPos == sStrArray[nCheck].getLength() && (bBlanks || 
!IsNum[nNext]))
 {
 nAcceptedDatePattern = nPattern;
 return true;


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - cui/source

2021-09-12 Thread Eike Rathke (via logerrit)
 cui/source/options/optgdlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e6b70cde3a34bcdbf200d3b9fb53cfdc9bef4f22
Author: Eike Rathke 
AuthorDate: Sun Sep 12 17:47:35 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Sep 13 03:04:42 2021 +0200

Resolves: tdf#144457 Use weld::set_text() instead of replace_selection()

... to replace entire field with modified text, instead of
inserting the text at the cursor position without selection, thus
effectively duplicating it (modulo modification).

Fallout from

commit 08101a1ab3b5d7c41488e93a2af518462286844f
CommitDate: Tue Jul 30 14:04:17 2019 +0200

weld OfaLanguagesTabPage

that did

 if (bModified)
-{
-// Do not use SetText(...,GetSelection()) because internally the
-// reference's pointer of the selection is obtained resulting in 
the
-// entire text being selected at the end.
-Selection aSelection( rEd.GetSelection());
-rEd.SetText( aBuf.makeStringAndClear(), aSelection);
-}
+rEd.replace_selection(aBuf.makeStringAndClear());

replacing the workaround needed for the old toolkit with something
similar from the new toolkit but behaving differently..

Change-Id: I9ff325eecd747bbecb36eb2a1150ae4472e475e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122000
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit db90a6cedbc261ad711ff13c4f69db65946486da)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121979
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 07435990a234..b5c6bcb49584 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1819,7 +1819,7 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, 
weld::Entry&, rEd, void )
 }
 }
 if (bModified)
-rEd.replace_selection(aBuf.makeStringAndClear());
+rEd.set_text(aBuf.makeStringAndClear());  // This even keeps the 
cursor position so all good.
 if (bValid)
 rEd.set_message_type(weld::EntryMessageType::Normal);
 else


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

2021-09-12 Thread Eike Rathke (via logerrit)
 cui/source/options/optgdlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit aa2ebf7d77527a12246797f637a06af0e9dea5f9
Author: Eike Rathke 
AuthorDate: Sun Sep 12 17:47:35 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Sep 13 03:04:17 2021 +0200

Resolves: tdf#144457 Use weld::set_text() instead of replace_selection()

... to replace entire field with modified text, instead of
inserting the text at the cursor position without selection, thus
effectively duplicating it (modulo modification).

Fallout from

commit 08101a1ab3b5d7c41488e93a2af518462286844f
CommitDate: Tue Jul 30 14:04:17 2019 +0200

weld OfaLanguagesTabPage

that did

 if (bModified)
-{
-// Do not use SetText(...,GetSelection()) because internally the
-// reference's pointer of the selection is obtained resulting in 
the
-// entire text being selected at the end.
-Selection aSelection( rEd.GetSelection());
-rEd.SetText( aBuf.makeStringAndClear(), aSelection);
-}
+rEd.replace_selection(aBuf.makeStringAndClear());

replacing the workaround needed for the old toolkit with something
similar from the new toolkit but behaving differently..

Change-Id: I9ff325eecd747bbecb36eb2a1150ae4472e475e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122000
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit db90a6cedbc261ad711ff13c4f69db65946486da)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121978
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index fd79d34926f1..4d376043ced7 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1783,7 +1783,7 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, 
weld::Entry&, rEd, void )
 }
 }
 if (bModified)
-rEd.replace_selection(aBuf.makeStringAndClear());
+rEd.set_text(aBuf.makeStringAndClear());  // This even keeps the 
cursor position so all good.
 if (bValid)
 rEd.set_message_type(weld::EntryMessageType::Normal);
 else


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

2021-09-12 Thread Eike Rathke (via logerrit)
 sc/inc/column.hxx|   17 -
 sc/inc/document.hxx  |   23 -
 sc/inc/sortparam.hxx |   69 
 sc/inc/table.hxx |   24 +
 sc/qa/unit/ucalc_sort.cxx|8 
 sc/source/core/data/column2.cxx  |   81 ++---
 sc/source/core/data/document.cxx |5 
 sc/source/core/data/sortparam.cxx|   41 +-
 sc/source/core/data/table1.cxx   |   56 ++-
 sc/source/core/data/table3.cxx   |  338 +++
 sc/source/filter/xml/XMLExportDatabaseRanges.cxx |2 
 sc/source/ui/app/transobj.cxx|   22 +
 sc/source/ui/dbgui/tpsort.cxx|   12 
 sc/source/ui/docshell/dbdocfun.cxx   |   64 +++-
 sc/source/ui/undo/undosort.cxx   |   15 -
 sc/source/ui/unoobj/datauno.cxx  |4 
 sc/source/ui/view/cellsh2.cxx|   12 
 sc/source/ui/view/gridwin.cxx|6 
 18 files changed, 518 insertions(+), 281 deletions(-)

New commits:
commit 0a9b68c9f9880655576e3220d8b70064b367dbee
Author: Eike Rathke 
AuthorDate: Sun Sep 12 20:15:01 2021 +0200
Commit: Eike Rathke 
CommitDate: Mon Sep 13 00:39:14 2021 +0200

Resolves: tdf#144135 Rework Sort with area extras

Since

commit 774a61afa9fc281290e7bfad4e28c05978b82d73
CommitDate: Wed Apr 14 08:46:03 2021 +0200

tdf#126678 - Consider "Include formats" option during sort

a sheet formatted with visible attributes like cell background
colour up to the end if for Sort all columns and/or rows are
selected lead to an excessive memory allocation and slow execution
time if it didn't get killed by the operating system before due to
memory exhaustion.

The same could had happened already before if graphics or comments
were to be included that could had resulted in a similar large
range. However, cell formats across sheets are more likely.

This changes the strategy how the to be sorted data range is
determined (range only with data) and additional area extras
ranges without data that are only to be rearranged. Those are then
processed in chunks (limited to ~512MB per chunk).

Cell formats that are identical within one column's rows range do
not even need to be covered as they are not rearranged, in the
best case leading to all trailing formats' ranges being excluded
from the sort.

Additionally optimize the cell gathering of formats, graphics and
comments such that for the area extras they are only collected if
actually requested.

The overall performance gain is in an order of magnitudes even if
some extras are to be collected.

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

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 01cf0da1f404..6300fe70bca1 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -219,19 +219,16 @@ public:
 // data only:
 boolIsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const;
 SCSIZE  GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, 
ScDirection eDir ) const;
-boolHasDataAt(SCROW nRow, bool bConsiderCellNotes = false,
-   bool bConsiderCellDrawObjects = false, bool 
bConsiderCellFormats = false) const;
-boolHasDataAt(sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow,
-   bool bConsiderCellNotes = false, bool 
bConsiderCellDrawObjects = false,
-   bool bConsiderCellFormats = false) const;
-boolHasDataAt(sc::ColumnBlockPosition& rBlockPos, SCROW nRow, bool 
bConsiderCellNotes = false,
-   bool bConsiderCellDrawObjects = false, bool 
bConsiderCellFormats = false);
+boolHasDataAt( SCROW nRow, ScDataAreaExtras* pDataAreaExtras = 
nullptr ) const;
+boolHasDataAt( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow,
+   ScDataAreaExtras* pDataAreaExtras = nullptr ) const;
+boolHasDataAt( sc::ColumnBlockPosition& rBlockPos, SCROW nRow,
+   ScDataAreaExtras* pDataAreaExtras = nullptr );
+voidGetDataExtrasAt( SCROW nRow, ScDataAreaExtras& rDataAreaExtras 
) const;
 boolHasVisibleDataAt(SCROW nRow) const;
 SCROW   GetFirstDataPos() const;
 SCROW   GetLastDataPos() const;
-SCROW   GetLastDataPos(SCROW nLastRow, bool bConsiderCellNotes = false,
- bool bConsiderCellDrawObjects = false,
- bool bConsiderCellFormats = false) const;
+SCROW   GetLastDataPos( SCROW nLastRow, ScDataAreaExtras* 
pDa

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

2021-09-12 Thread Eike Rathke (via logerrit)
 cui/source/options/optgdlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit db90a6cedbc261ad711ff13c4f69db65946486da
Author: Eike Rathke 
AuthorDate: Sun Sep 12 17:47:35 2021 +0200
Commit: Eike Rathke 
CommitDate: Sun Sep 12 18:42:00 2021 +0200

Resolves: tdf#144457 Use weld::set_text() instead of replace_selection()

... to replace entire field with modified text, instead of
inserting the text at the cursor position without selection, thus
effectively duplicating it (modulo modification).

Fallout from

commit 08101a1ab3b5d7c41488e93a2af518462286844f
CommitDate: Tue Jul 30 14:04:17 2019 +0200

weld OfaLanguagesTabPage

that did

 if (bModified)
-{
-// Do not use SetText(...,GetSelection()) because internally the
-// reference's pointer of the selection is obtained resulting in 
the
-// entire text being selected at the end.
-Selection aSelection( rEd.GetSelection());
-rEd.SetText( aBuf.makeStringAndClear(), aSelection);
-}
+rEd.replace_selection(aBuf.makeStringAndClear());

replacing the workaround needed for the old toolkit with something
similar from the new toolkit but behaving differently..

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

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 7f5ad32fce0b..92acc1bc0001 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1789,7 +1789,7 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, 
weld::Entry&, rEd, void )
 }
 }
 if (bModified)
-rEd.replace_selection(aBuf.makeStringAndClear());
+rEd.set_text(aBuf.makeStringAndClear());  // This even keeps the 
cursor position so all good.
 if (bValid)
 rEd.set_message_type(weld::EntryMessageType::Normal);
 else


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

2021-09-03 Thread Eike Rathke (via logerrit)
 include/svl/zformat.hxx  |   11 ---
 sc/source/core/data/documen4.cxx |   17 +
 svl/source/numbers/zformat.cxx   |   16 
 3 files changed, 37 insertions(+), 7 deletions(-)

New commits:
commit eedfa91e777423cb3cd025c8eafd7e031c98f6b9
Author: Eike Rathke 
AuthorDate: Wed Sep 1 15:35:11 2021 +0200
Commit: Caolán McNamara 
CommitDate: Fri Sep 3 16:05:49 2021 +0200

Resolves: tdf#144209 Handle General containing formats in 
RoundValueAsShown()

Calling SvNumberformat::GetThousandDivisorPrecision() for a

"AA "General

format resulted in 3000 as that was implemented for tdf#106253
without taking into account that ImpSvNumberformatInfo::nThousand
may be abused under some conditions, which here is having
FLAG_STANDARD_IN_FORMAT = 1000 as nThousand, multiplied by 3 gives
3000. Subtracted from the 0 precision gave -3000 decimals for
which of course the new rounding produced 0 where it previously
simply ignored the decimals and returned the original value.

Change-Id: I66afaf1e2d8b2654d9f7cc8cfb66389357fb742d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121447
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 71b003a12f8afdff42a25786ad0a12ddd6609d59)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121460
Reviewed-by: Xisco Fauli 
Reviewed-by: Michael Stahl 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index 976488257218..abbf92e92af8 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -271,10 +271,15 @@ public:
 { return NumFor[nIx].Info().nCntPre; }
 
 /** Count of hidden integer digits with thousands divisor:
- * formats like "0," to show only thousands
+formats like "0," to show only thousands.
+
+Works only with SvNumFormatType::NUMBER and SvNumFormatType::CURRENCY,
+returns 0 otherwise.
+
+Returns SvNumberFormatter::UNLIMITED_PRECISION for formats that contain
+the General keyword.
  */
-sal_uInt16 GetThousandDivisorPrecision( sal_uInt16 nIx = 0 ) const
-{ return NumFor[nIx].Info().nThousand * 3; }
+sal_uInt16 GetThousandDivisorPrecision( sal_uInt16 nIx = 0 ) const;
 
 //! Read/write access on a special sal_uInt16 component, may only be used 
on the
 //! standard format 0, 1, ... and only by the number formatter!
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index aee431660d0a..9d124f5acc2f 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -640,8 +640,12 @@ double ScDocument::RoundValueAsShown( double fVal, 
sal_uInt32 nFormat, const ScI
 SvNumFormatType nType = pFormat->GetMaskedType();
 if (nType != SvNumFormatType::DATE && nType != SvNumFormatType::TIME && 
nType != SvNumFormatType::DATETIME )
 {
-short nPrecision;
-if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
+// MSVC doesn't recognize all paths init nPrecision and wails about
+// "potentially uninitialized local variable 'nPrecision' used"
+// so init to some random sensible value preserving all decimals.
+short nPrecision = 20;
+bool bStdPrecision = ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0);
+if (!bStdPrecision)
 {
 sal_uInt16 nIdx = pFormat->GetSubformatIndex( fVal );
 nPrecision = static_cast(pFormat->GetFormatPrecision( nIdx 
));
@@ -678,13 +682,18 @@ double ScDocument::RoundValueAsShown( double fVal, 
sal_uInt32 nFormat, const ScI
 case SvNumFormatType::NUMBER:
 case SvNumFormatType::CURRENCY:
 {   // tdf#106253 Thousands divisors for format "0,"
-nPrecision -=  pFormat->GetThousandDivisorPrecision( nIdx 
);
+const sal_uInt16 nTD = 
pFormat->GetThousandDivisorPrecision( nIdx );
+if (nTD == SvNumberFormatter::UNLIMITED_PRECISION)
+// Format contains General keyword, handled below.
+bStdPrecision = true;
+else
+nPrecision -= nTD;
 break;
 }
 default: break;
 }
 }
-else
+if (bStdPrecision)
 {
 nPrecision = static_cast(GetDocOptions().GetStdPrecision());
 // #i115512# no rounding for automatic decimals
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 255bfb09b5f7..bf95fd717cb1 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -5946,6 +5946,22 @@ OUString 
SvNumberformat::GetFormatStringForTimePrecision( int nPrecision 

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

2021-09-02 Thread Eike Rathke (via logerrit)
 include/svl/zformat.hxx  |   11 ---
 sc/source/core/data/documen4.cxx |   17 +
 svl/source/numbers/zformat.cxx   |   16 
 3 files changed, 37 insertions(+), 7 deletions(-)

New commits:
commit 3879accdfbee52b3bbecbe20fd1cf4d391189b70
Author: Eike Rathke 
AuthorDate: Wed Sep 1 15:35:11 2021 +0200
Commit: Xisco Fauli 
CommitDate: Thu Sep 2 16:47:14 2021 +0200

Resolves: tdf#144209 Handle General containing formats in 
RoundValueAsShown()

Calling SvNumberformat::GetThousandDivisorPrecision() for a

"AA "General

format resulted in 3000 as that was implemented for tdf#106253
without taking into account that ImpSvNumberformatInfo::nThousand
may be abused under some conditions, which here is having
FLAG_STANDARD_IN_FORMAT = 1000 as nThousand, multiplied by 3 gives
3000. Subtracted from the 0 precision gave -3000 decimals for
which of course the new rounding produced 0 where it previously
simply ignored the decimals and returned the original value.

Change-Id: I66afaf1e2d8b2654d9f7cc8cfb66389357fb742d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121447
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 71b003a12f8afdff42a25786ad0a12ddd6609d59)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121459
Reviewed-by: Xisco Fauli 

diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index 976488257218..abbf92e92af8 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -271,10 +271,15 @@ public:
 { return NumFor[nIx].Info().nCntPre; }
 
 /** Count of hidden integer digits with thousands divisor:
- * formats like "0," to show only thousands
+formats like "0," to show only thousands.
+
+Works only with SvNumFormatType::NUMBER and SvNumFormatType::CURRENCY,
+returns 0 otherwise.
+
+Returns SvNumberFormatter::UNLIMITED_PRECISION for formats that contain
+the General keyword.
  */
-sal_uInt16 GetThousandDivisorPrecision( sal_uInt16 nIx = 0 ) const
-{ return NumFor[nIx].Info().nThousand * 3; }
+sal_uInt16 GetThousandDivisorPrecision( sal_uInt16 nIx = 0 ) const;
 
 //! Read/write access on a special sal_uInt16 component, may only be used 
on the
 //! standard format 0, 1, ... and only by the number formatter!
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index aee431660d0a..9d124f5acc2f 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -640,8 +640,12 @@ double ScDocument::RoundValueAsShown( double fVal, 
sal_uInt32 nFormat, const ScI
 SvNumFormatType nType = pFormat->GetMaskedType();
 if (nType != SvNumFormatType::DATE && nType != SvNumFormatType::TIME && 
nType != SvNumFormatType::DATETIME )
 {
-short nPrecision;
-if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
+// MSVC doesn't recognize all paths init nPrecision and wails about
+// "potentially uninitialized local variable 'nPrecision' used"
+// so init to some random sensible value preserving all decimals.
+short nPrecision = 20;
+bool bStdPrecision = ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0);
+if (!bStdPrecision)
 {
 sal_uInt16 nIdx = pFormat->GetSubformatIndex( fVal );
 nPrecision = static_cast(pFormat->GetFormatPrecision( nIdx 
));
@@ -678,13 +682,18 @@ double ScDocument::RoundValueAsShown( double fVal, 
sal_uInt32 nFormat, const ScI
 case SvNumFormatType::NUMBER:
 case SvNumFormatType::CURRENCY:
 {   // tdf#106253 Thousands divisors for format "0,"
-nPrecision -=  pFormat->GetThousandDivisorPrecision( nIdx 
);
+const sal_uInt16 nTD = 
pFormat->GetThousandDivisorPrecision( nIdx );
+if (nTD == SvNumberFormatter::UNLIMITED_PRECISION)
+// Format contains General keyword, handled below.
+bStdPrecision = true;
+else
+nPrecision -= nTD;
 break;
 }
 default: break;
 }
 }
-else
+if (bStdPrecision)
 {
 nPrecision = static_cast(GetDocOptions().GetStdPrecision());
 // #i115512# no rounding for automatic decimals
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 255bfb09b5f7..bf95fd717cb1 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -5946,6 +5946,22 @@ OUString 
SvNumberformat::GetFormatStringForTimePrecision( int nPrecision ) const
 return sString.makeStringAndClear();
 }
 
+sal_uInt16 SvNumberformat::GetThousandDivisorPrecision( sal_uInt16 nIx ) 

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

2021-09-01 Thread Eike Rathke (via logerrit)
 include/svl/zformat.hxx  |   11 ---
 sc/source/core/data/documen4.cxx |   17 +
 svl/source/numbers/zformat.cxx   |   16 
 3 files changed, 37 insertions(+), 7 deletions(-)

New commits:
commit 71b003a12f8afdff42a25786ad0a12ddd6609d59
Author: Eike Rathke 
AuthorDate: Wed Sep 1 15:35:11 2021 +0200
Commit: Eike Rathke 
CommitDate: Wed Sep 1 22:53:55 2021 +0200

Resolves: tdf#144209 Handle General containing formats in 
RoundValueAsShown()

Calling SvNumberformat::GetThousandDivisorPrecision() for a

"AA "General

format resulted in 3000 as that was implemented for tdf#106253
without taking into account that ImpSvNumberformatInfo::nThousand
may be abused under some conditions, which here is having
FLAG_STANDARD_IN_FORMAT = 1000 as nThousand, multiplied by 3 gives
3000. Subtracted from the 0 precision gave -3000 decimals for
which of course the new rounding produced 0 where it previously
simply ignored the decimals and returned the original value.

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

diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index 3fdee06d99dc..cd04f96ac8a1 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -272,10 +272,15 @@ public:
 { return NumFor[nIx].Info().nCntPre; }
 
 /** Count of hidden integer digits with thousands divisor:
- * formats like "0," to show only thousands
+formats like "0," to show only thousands.
+
+Works only with SvNumFormatType::NUMBER and SvNumFormatType::CURRENCY,
+returns 0 otherwise.
+
+Returns SvNumberFormatter::UNLIMITED_PRECISION for formats that contain
+the General keyword.
  */
-sal_uInt16 GetThousandDivisorPrecision( sal_uInt16 nIx = 0 ) const
-{ return NumFor[nIx].Info().nThousand * 3; }
+sal_uInt16 GetThousandDivisorPrecision( sal_uInt16 nIx = 0 ) const;
 
 //! Read/write access on a special sal_uInt16 component, may only be used 
on the
 //! standard format 0, 1, ... and only by the number formatter!
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 951a02700ec6..8f8bd3d43e98 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -641,8 +641,12 @@ double ScDocument::RoundValueAsShown( double fVal, 
sal_uInt32 nFormat, const ScI
 SvNumFormatType nType = pFormat->GetMaskedType();
 if (nType != SvNumFormatType::DATE && nType != SvNumFormatType::TIME && 
nType != SvNumFormatType::DATETIME )
 {
-short nPrecision;
-if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
+// MSVC doesn't recognize all paths init nPrecision and wails about
+// "potentially uninitialized local variable 'nPrecision' used"
+// so init to some random sensible value preserving all decimals.
+short nPrecision = 20;
+bool bStdPrecision = ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0);
+if (!bStdPrecision)
 {
 sal_uInt16 nIdx = pFormat->GetSubformatIndex( fVal );
 nPrecision = static_cast(pFormat->GetFormatPrecision( nIdx 
));
@@ -679,13 +683,18 @@ double ScDocument::RoundValueAsShown( double fVal, 
sal_uInt32 nFormat, const ScI
 case SvNumFormatType::NUMBER:
 case SvNumFormatType::CURRENCY:
 {   // tdf#106253 Thousands divisors for format "0,"
-nPrecision -=  pFormat->GetThousandDivisorPrecision( nIdx 
);
+const sal_uInt16 nTD = 
pFormat->GetThousandDivisorPrecision( nIdx );
+if (nTD == SvNumberFormatter::UNLIMITED_PRECISION)
+// Format contains General keyword, handled below.
+bStdPrecision = true;
+else
+nPrecision -= nTD;
 break;
 }
 default: break;
 }
 }
-else
+if (bStdPrecision)
 {
 nPrecision = static_cast(GetDocOptions().GetStdPrecision());
 // #i115512# no rounding for automatic decimals
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 6b68e79f1517..22a377a6cc69 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -5947,6 +5947,22 @@ OUString 
SvNumberformat::GetFormatStringForTimePrecision( int nPrecision ) const
 return sString.makeStringAndClear();
 }
 
+sal_uInt16 SvNumberformat::GetThousandDivisorPrecision( sal_uInt16 nIx ) const
+{
+if (nIx >= 4)
+return 0;
+
+const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
+
+if (rInfo.eScannedType != SvNumF

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

2021-08-31 Thread Eike Rathke (via logerrit)
 sc/source/ui/docshell/impex.cxx |   32 
 1 file changed, 16 insertions(+), 16 deletions(-)

New commits:
commit d5ade739771ddf06cc7ee6d4af15672bfcf09ed6
Author: Eike Rathke 
AuthorDate: Tue Aug 31 16:04:51 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Aug 31 22:32:08 2021 +0200

CSV/Paste: setting a text format is only necessary when using 
ScDocumentImport

For ScDocument::SetTextCell() it is forced anyway so was actually
done twice, in the case of Paste and TextToColumns.

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

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 577bcd1930c2..27221c581f4e 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1040,23 +1040,22 @@ static bool lcl_PutString(
 const bool bForceFormulaText = (!bEvaluateFormulas && rStr[0] == '=');
 if (nColFormat == SC_COL_TEXT || bForceFormulaText)
 {
-double fDummy;
-sal_uInt32 nIndex = 0;
-if (bForceFormulaText || rDoc.GetFormatTable()->IsNumberFormat(rStr, 
nIndex, fDummy))
-{
-// Set the format of this cell to Text.
-/* TODO: is this even necessary as ScSetStringParam should take
- * care of it and we're doing this twice? Investigate all paths
- * taken below. */
-sal_uInt32 nFormat = 
rDoc.GetFormatTable()->GetStandardFormat(SvNumFormatType::TEXT);
-ScPatternAttr aNewAttrs(rDoc.GetPool());
-SfxItemSet& rSet = aNewAttrs.GetItemSet();
-rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat) );
-rDoc.ApplyPattern(nCol, nRow, nTab, aNewAttrs);
-}
 if ( bUseDocImport )
 {
-if(ScStringUtil::isMultiline(rStr))
+double fDummy;
+sal_uInt32 nIndex = 0;
+if (bForceFormulaText || 
rDoc.GetFormatTable()->IsNumberFormat(rStr, nIndex, fDummy))
+{
+// Set the format of this cell to Text.
+// This is only necessary for ScDocumentImport,
+// ScDocument::SetTextCell() forces it by ScSetStringParam.
+sal_uInt32 nFormat = 
rDoc.GetFormatTable()->GetStandardFormat(SvNumFormatType::TEXT);
+ScPatternAttr aNewAttrs(rDoc.GetPool());
+SfxItemSet& rSet = aNewAttrs.GetItemSet();
+rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat) );
+rDoc.ApplyPattern(nCol, nRow, nTab, aNewAttrs);
+}
+if (ScStringUtil::isMultiline(rStr))
 {
 ScFieldEditEngine& rEngine = rDoc.GetEditEngine();
 rEngine.SetTextCurrentDefaults(rStr);
@@ -1068,7 +1067,8 @@ static bool lcl_PutString(
 rDocImport.setStringCell(ScAddress(nCol, nRow, nTab), rStr);
 return false;
 }
-} else
+}
+else
 {
 rDoc.SetTextCell(ScAddress(nCol, nRow, nTab), rStr);
 return bMultiLine;


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

2021-08-31 Thread Eike Rathke (via logerrit)
 sc/source/ui/docshell/impex.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 8a45eac81686ccc06b7f028594770ad18ae66057
Author: Eike Rathke 
AuthorDate: Tue Aug 31 12:15:49 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Aug 31 15:59:47 2021 +0200

CSV: use target doc's formatter to determine and set forced text

If text is to be forced check if the string is a number in the
target doc's locale which then needs to be forced to text format,
not in the input parsing locale. Also set the text format of the
document's default locale, not the input locale's text format
(which may or may not match the document locale).

Question remains if this isn't duplicated work anyway because
setting text at cells forces text format if necessary if
ScSetStringParam is setup correctly. To be investigated if all
paths taken actually do that.

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

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index c5102cf483b9..577bcd1930c2 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1042,10 +1042,13 @@ static bool lcl_PutString(
 {
 double fDummy;
 sal_uInt32 nIndex = 0;
-if (bForceFormulaText || pFormatter->IsNumberFormat(rStr, nIndex, 
fDummy))
+if (bForceFormulaText || rDoc.GetFormatTable()->IsNumberFormat(rStr, 
nIndex, fDummy))
 {
 // Set the format of this cell to Text.
-sal_uInt32 nFormat = 
pFormatter->GetStandardFormat(SvNumFormatType::TEXT);
+/* TODO: is this even necessary as ScSetStringParam should take
+ * care of it and we're doing this twice? Investigate all paths
+ * taken below. */
+sal_uInt32 nFormat = 
rDoc.GetFormatTable()->GetStandardFormat(SvNumFormatType::TEXT);
 ScPatternAttr aNewAttrs(rDoc.GetPool());
 SfxItemSet& rSet = aNewAttrs.GetItemSet();
 rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat) );


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

2021-08-31 Thread Eike Rathke (via logerrit)
 i18nlangtag/source/isolang/mslangid.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit c42356ad2798e9aa6c724a99f39ff15a253ef0c2
Author: Eike Rathke 
AuthorDate: Mon Aug 30 12:43:34 2021 +0200
Commit: Michael Stahl 
CommitDate: Tue Aug 31 11:36:02 2021 +0200

Resolves: tdf#144059 Tigrigna {ti-*} (Ethi) is CTL

Change-Id: I5fb56e039c854471ae444395feee27e820902181
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121297
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 158cc1d81121df12edfaf9ce80a7745e6aaad46b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121281
Reviewed-by: Michael Stahl 

diff --git a/i18nlangtag/source/isolang/mslangid.cxx 
b/i18nlangtag/source/isolang/mslangid.cxx
index ae6cd6291672..995e7271ab06 100644
--- a/i18nlangtag/source/isolang/mslangid.cxx
+++ b/i18nlangtag/source/isolang/mslangid.cxx
@@ -400,6 +400,7 @@ sal_Int16 MsLangId::getScriptType( LanguageType nLang )
 primary(LANGUAGE_TELUGU  ),
 primary(LANGUAGE_THAI),
 primary(LANGUAGE_TIBETAN ),  // also LANGUAGE_DZONGKHA
+primary(LANGUAGE_TIGRIGNA_ETHIOPIA   ),
 primary(LANGUAGE_UIGHUR_CHINA),
 primary(LANGUAGE_URDU_INDIA  ),
 primary(LANGUAGE_USER_BODO_INDIA ),


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

2021-08-30 Thread Eike Rathke (via logerrit)
 officecfg/registry/schema/org/openoffice/Office/Calc.xcs |   21 ++
 sc/source/ui/dbgui/asciiopt.cxx  |   28 ++-
 sc/source/ui/dbgui/imoptdlg.cxx  |7 
 sc/source/ui/dbgui/scuiasciiopt.cxx  |   37 +++-
 sc/source/ui/docshell/impex.cxx  |   16 +
 sc/source/ui/inc/asciiopt.hxx|3 
 sc/source/ui/inc/imoptdlg.hxx|3 
 sc/source/ui/inc/scuiasciiopt.hxx|1 
 sc/uiconfig/scalc/ui/textimportcsv.ui|  125 +--
 9 files changed, 169 insertions(+), 72 deletions(-)

New commits:
commit 4c29c2bfab18b25229e0bc71014fd2ca42ec5bff
Author: Eike Rathke 
AuthorDate: Tue Aug 31 00:10:40 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Aug 31 02:55:04 2021 +0200

Resolves: tdf#114878 Add 'Evaluate formulas' option to CSV import and paste

... and Text to Columns, defaulting to false for CSV import via dialog
and stored as config item option similar to all other CSV/Text options.

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

diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 95c1aed3ab0b..84545054859a 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1119,6 +1119,13 @@
   
   false
 
+
+  
+If true, formula expressions are evaluated, else set as text 
cell content.
+EvaluateFormulas
+  
+  false
+
 
   
 If true, quoted field is always imported as text with no 
exception.
@@ -1201,6 +1208,13 @@
   
   false
 
+
+  
+If true, formula expressions are evaluated, else set as text 
cell content.
+EvaluateFormulas
+  
+  true
+
 
   
 If true, quoted field is always imported as text with no 
exception.
@@ -1290,6 +1304,13 @@
   
   false
 
+
+  
+If true, formula expressions are evaluated, else set as text 
cell content.
+EvaluateFormulas
+  
+  true
+
 
   
 List of Separators - as a String
diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx
index af65dbc54956..3bb97c5b3236 100644
--- a/sc/source/ui/dbgui/asciiopt.cxx
+++ b/sc/source/ui/dbgui/asciiopt.cxx
@@ -32,6 +32,7 @@ ScAsciiOptions::ScAsciiOptions() :
 bRemoveSpace( false ),
 bQuotedFieldAsText(false),
 bDetectSpecialNumber(false),
+bEvaluateFormulas(true),
 bSkipEmptyCells(false),
 bSaveAsShown(true),
 bSaveFormulas(false),
@@ -176,14 +177,19 @@ void ScAsciiOptions::ReadFromString( const OUString& 
rString )
 bRemoveSpace = false;
 
 // Token 11: sheet to export for --convert-to csv
-// Does not need to be evaluated here but may be present, so in case
-// there'll be yet another token 12 then do some dummy like
-#if 0
+// Does not need to be evaluated here but may be present.
 if (nPos >= 0)
 {
 rString.getToken(0, ',', nPos);
 }
-#endif
+
+// Token 12: evaluate formulas.
+if (nPos >= 0)
+{
+bEvaluateFormulas = rString.getToken(0, ',', nPos) == "true";
+}
+else
+bEvaluateFormulas = true;   // default of versions that didn't add the 
parameter
 }
 
 OUString ScAsciiOptions::WriteToString() const
@@ -238,20 +244,22 @@ OUString ScAsciiOptions::WriteToString() const
 // Always keep in sync with ScImportOptions.
 
 aOutStr.append("," +
-   //Token 5: Language
+   // Token 5: Language
OUString::number(static_cast(eLang)) + "," +
-   //Token 6: Import quoted field as text.
+   // Token 6: Import quoted field as text.
OUString::boolean( bQuotedFieldAsText ) + "," +
-   //Token 7: Detect special numbers.
+   // Token 7: Detect special numbers.
OUString::boolean( bDetectSpecialNumber ) + "," +
// Token 8: used for "Save as shown" in export options
OUString::boolean( bSaveAsShown ) +"," +
// Token 9: used for "Save cell formulas" in export options
OUString::boolean( bSaveFormulas ) + "," +
-   //Token 10: Trim Space
+   // Token 10: Trim Space
OUString::boolean( bRemoveSpace ) +
-   //Token 11: sheet to export, always 0 for current

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

2021-08-30 Thread Eike Rathke (via logerrit)
 sc/uiconfig/scalc/ui/textimportcsv.ui |  391 --
 1 file changed, 194 insertions(+), 197 deletions(-)

New commits:
commit faff8fd27ac38d2001b6bf26b02381801b8844ea
Author: Eike Rathke 
AuthorDate: Tue Aug 31 00:01:29 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Aug 31 02:54:47 2021 +0200

Resave with glade 3.38.2 to convert property names with '_' to '-'

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

diff --git a/sc/uiconfig/scalc/ui/textimportcsv.ui 
b/sc/uiconfig/scalc/ui/textimportcsv.ui
index 3aad7cf3a59f..1a4daef1efd6 100644
--- a/sc/uiconfig/scalc/ui/textimportcsv.ui
+++ b/sc/uiconfig/scalc/ui/textimportcsv.ui
@@ -1,49 +1,49 @@
 
-
+
 
   
   
 1
 4294967295
 1
-1
-10
+1
+10
   
   
 100
-1
-10
+1
+10
   
   
 100
-1
-10
+1
+10
   
   
-False
-6
+False
+6
 Text Import
 True
-0
-0
-dialog
+0
+0
+dialog
 
   
-False
+False
 vertical
 12
 
   
-False
-end
+False
+end
 
   
 _OK
 True
-True
-True
-True
-True
+True
+True
+True
+True
 True
   
   
@@ -56,8 +56,8 @@
   
 _Cancel
 True
-True
-True
+True
+True
 True
   
   
@@ -70,8 +70,8 @@
   
 _Help
 True
-True
-True
+True
+True
 True
   
   
@@ -85,79 +85,79 @@
   
 False
 True
-end
+end
 0
   
 
 
   
 True
-False
+False
 True
 vertical
 12
 
   
 True
-False
+False
 True
-0
-none
+0
+none
 
-  
+  
   
 True
-False
-6
-12
+False
 12
 6
+6
+12
 
   
 True
-False
+False
 Ch_aracter set:
-True
-charset
+True
+charset
 0
   
   
-0
-0
+0
+0
   
 
 
   
 True
-False
+False
 _Language:
-True
-language
+True
+language
 0
   
   
-0
-1
+0
+1
   
 
 
   
 True
-False
+False
 From ro_w:
-True
-fromrow
+True
+fromrow
 0
   
   
-0
-2
+0
+2
   
 
 
   
 True
-False
+False
 
   
 Specifies the 
character set to be used in the imported file.
@@ -165,14 +165,14 @@
 
   
   
-1
-0
+1
+0

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

2021-08-30 Thread Eike Rathke (via logerrit)
 i18nlangtag/source/isolang/mslangid.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 158cc1d81121df12edfaf9ce80a7745e6aaad46b
Author: Eike Rathke 
AuthorDate: Mon Aug 30 12:43:34 2021 +0200
Commit: Eike Rathke 
CommitDate: Mon Aug 30 16:20:12 2021 +0200

Resolves: tdf#144059 Tigrigna {ti-*} (Ethi) is CTL

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

diff --git a/i18nlangtag/source/isolang/mslangid.cxx 
b/i18nlangtag/source/isolang/mslangid.cxx
index 9e6f2a7532ad..d3bcee020a00 100644
--- a/i18nlangtag/source/isolang/mslangid.cxx
+++ b/i18nlangtag/source/isolang/mslangid.cxx
@@ -400,6 +400,7 @@ sal_Int16 MsLangId::getScriptType( LanguageType nLang )
 primary(LANGUAGE_TELUGU  ),
 primary(LANGUAGE_THAI),
 primary(LANGUAGE_TIBETAN ),  // also LANGUAGE_DZONGKHA
+primary(LANGUAGE_TIGRIGNA_ETHIOPIA   ),
 primary(LANGUAGE_UIGHUR_CHINA),
 primary(LANGUAGE_URDU_INDIA  ),
 primary(LANGUAGE_USER_BODO_INDIA ),


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

2021-08-29 Thread Eike Rathke (via logerrit)
 sc/source/ui/dbgui/scuiasciiopt.cxx |   89 
 sc/source/ui/docshell/docsh.cxx |   43 +
 sc/source/ui/inc/scuiasciiopt.hxx   |5 +-
 3 files changed, 117 insertions(+), 20 deletions(-)

New commits:
commit 451e4abb5377f6d923860e9adfce82d46f31e049
Author: Eike Rathke 
AuthorDate: Sun Aug 29 18:23:35 2021 +0200
Commit: Eike Rathke 
CommitDate: Sun Aug 29 22:09:29 2021 +0200

Resolves: tdf#117868 CSV: support sep=; and "sep=;" separator setting

When reading CSV the separator (any BMP character) is taken from
an initial

sep=;
or
"sep=;"

single field if that is the only row content.
The quoted form is preserved as (unquoted) cell content, of the
unquoted form the separator is discarded as contextually it is a
real field separator.

When writing CSV an existing single top left cell's content if
that is the only cell in the row is adapted to the current
separator (any BMP character) in the quoted form

"sep=;"

(if quotes / text delimiters aren't set empty ...) and always uses
the ASCII '"' double quote character.

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

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 3ed0b05cf677..7390786c5cd9 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -381,14 +381,6 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, 
const OUString& aDatNa
 if (nFromRow != 1)
 mxNfRow->set_value(nFromRow);
 
-if ( bIsTSV )
-mxCkbTab->set_active(true);
-else
-SetSeparators(); // Set Separators in the dialog from 
maFieldSeparators (empty are not set)
-
-// Get Separators from the dialog (empty are set from default)
-maFieldSeparators = GetSeparators();
-
 // Clipboard is always Unicode, else detect.
 rtl_TextEncoding ePreselectUnicode = (meCall == SC_IMPORTFILE ?
 RTL_TEXTENCODING_DONTKNOW : RTL_TEXTENCODING_UNICODE);
@@ -438,6 +430,40 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, 
const OUString& aDatNa
 mnStreamPos = mpDatStream->Tell();
 }
 
+if (bIsTSV)
+SetSeparators('\t');
+else
+{
+// Some MS-Excel convention is the first line containing the field
+// separator as "sep=|" (without quotes and any field separator
+// character). The second possibility seems to be it is present *with*
+// quotes so it shows up as cell content *including* the separator and
+// can be preserved during round trips. Check for an exact match of
+// any such and set separator.
+/* TODO: it is debatable whether the unquoted form should rather be
+ * treated special to actually include the separator in the field data.
+ * Currently it does not. */
+sal_Unicode cSep = 0;
+OUString aLine;
+// Try to read one more character, if more than 7 it can't be an exact
+// match of any.
+mpDatStream->ReadUniOrByteStringLine( aLine, 
mpDatStream->GetStreamCharSet(), 8);
+mpDatStream->Seek(mnStreamPos);
+if (aLine.getLength() == 8)
+;   // nothing
+else if (aLine.getLength() == 5 && 
aLine.startsWithIgnoreAsciiCase("sep="))
+cSep = aLine[4];
+else if (aLine.getLength() == 7 && aLine[6] == '"' && 
aLine.startsWithIgnoreAsciiCase("\"sep="))
+cSep = aLine[5];
+
+// Set Separators in the dialog from maFieldSeparators (empty are not
+// set) or an optionally defined by file content field separator.
+SetSeparators(cSep);
+}
+
+// Get Separators from the dialog (empty are set from default)
+maFieldSeparators = GetSeparators();
+
 mxNfRow->connect_value_changed( LINK( this, ScImportAsciiDlg, FirstRowHdl 
) );
 
 // *** Separator characters ***
@@ -650,19 +676,46 @@ void ScImportAsciiDlg::SaveParameters()
  mxCkbSkipEmptyCells->get_active(), 
mxCkbRemoveSpace->get_active(), meCall );
 }
 
-void ScImportAsciiDlg::SetSeparators()
+void ScImportAsciiDlg::SetSeparators( sal_Unicode cSep )
 {
-for (sal_Int32 i = 0; i < maFieldSeparators.getLength(); ++i)
+if (cSep)
 {
-switch (maFieldSeparators[i])
+// Exclusively set a separator, maFieldSeparators needs not be
+// modified, it's obtained by GetSeparators() after this call.
+constexpr sal_Unicode aSeps[] = { '\t', ';', ',', ' ' };
+for (const sal_Unicode c : aSeps)
 {
-case '\t':  mxCkbTab->set_active(true);break;
-case ';':   mxCk

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

2021-08-26 Thread Eike Rathke (via logerrit)
 download.lst |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 89621030789921bcb6b1877b7d01d3d446a560eb
Author: Eike Rathke 
AuthorDate: Thu Aug 26 00:22:32 2021 +0200
Commit: Michael Stahl 
CommitDate: Thu Aug 26 16:15:20 2021 +0200

Update language-subtag-registry to 2021-08-06

Change-Id: I0a2b43f291ef15f0bdacfb33b5396658efd1ea2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121047
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 61626cf179bf2166462e4e9d3222caaf388e81e0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121055
Reviewed-by: Michael Stahl 

diff --git a/download.lst b/download.lst
index 183b8358aae8..4a46891079e0 100644
--- a/download.lst
+++ b/download.lst
@@ -140,8 +140,8 @@ export JFREEREPORT_SAC_SHA256SUM := 
085f2112c51fa8c1783fac12fbd45265059641512134
 export JFREEREPORT_SAC_TARBALL := 
39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip
 export LIBJPEG_TURBO_SHA256SUM := 
b24890e2bb46e12e72a79f7e965f409f4e16466d00e1dd15d93d73ee6b592523
 export LIBJPEG_TURBO_TARBALL := libjpeg-turbo-1.5.3.tar.gz
-export LANGTAGREG_SHA256SUM := 
ce80e8face06bf2ada363e0c159e3f990c4116fdae9232ca43e6369aa82bf16a
-export LANGTAGREG_TARBALL := language-subtag-registry-2021-03-05.tar.bz2
+export LANGTAGREG_SHA256SUM := 
08452d3997c78e21f2d81e31409dc46557707be6dc1df3129674019659e5ff9b
+export LANGTAGREG_TARBALL := language-subtag-registry-2021-08-06.tar.bz2
 export LANGUAGETOOL_SHA256SUM := 
48c87e41636783bba438b65fd895821e369ed139e1465fac654323ad93c5a82d
 export LANGUAGETOOL_TARBALL := 
b63e6340a02ff1cacfeadb2c42286161-JLanguageTool-1.7.0.tar.bz2
 export LCMS2_SHA256SUM := 
dc49b9c8e4d7cdff376040571a722902b682a795bf92985a85b48854c270772e


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

2021-08-26 Thread Eike Rathke (via logerrit)
 download.lst |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 61626cf179bf2166462e4e9d3222caaf388e81e0
Author: Eike Rathke 
AuthorDate: Thu Aug 26 00:22:32 2021 +0200
Commit: Eike Rathke 
CommitDate: Thu Aug 26 11:03:59 2021 +0200

Update language-subtag-registry to 2021-08-06

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

diff --git a/download.lst b/download.lst
index 59367d25c67b..b41c7468f4e7 100644
--- a/download.lst
+++ b/download.lst
@@ -140,8 +140,8 @@ export JFREEREPORT_SAC_SHA256SUM := 
085f2112c51fa8c1783fac12fbd45265059641512134
 export JFREEREPORT_SAC_TARBALL := 
39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip
 export LIBJPEG_TURBO_SHA256SUM := 
b24890e2bb46e12e72a79f7e965f409f4e16466d00e1dd15d93d73ee6b592523
 export LIBJPEG_TURBO_TARBALL := libjpeg-turbo-1.5.3.tar.gz
-export LANGTAGREG_SHA256SUM := 
ce80e8face06bf2ada363e0c159e3f990c4116fdae9232ca43e6369aa82bf16a
-export LANGTAGREG_TARBALL := language-subtag-registry-2021-03-05.tar.bz2
+export LANGTAGREG_SHA256SUM := 
08452d3997c78e21f2d81e31409dc46557707be6dc1df3129674019659e5ff9b
+export LANGTAGREG_TARBALL := language-subtag-registry-2021-08-06.tar.bz2
 export LANGUAGETOOL_SHA256SUM := 
48c87e41636783bba438b65fd895821e369ed139e1465fac654323ad93c5a82d
 export LANGUAGETOOL_TARBALL := 
b63e6340a02ff1cacfeadb2c42286161-JLanguageTool-1.7.0.tar.bz2
 export LCMS2_SHA256SUM := 
dc49b9c8e4d7cdff376040571a722902b682a795bf92985a85b48854c270772e


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

2021-08-25 Thread Eike Rathke (via logerrit)
 include/xmloff/xmlnumfe.hxx  |3 ++-
 include/xmloff/xmlnumfi.hxx  |2 ++
 xmloff/source/style/xmlnumfe.cxx |   16 +---
 xmloff/source/style/xmlnumfi.cxx |   20 
 4 files changed, 37 insertions(+), 4 deletions(-)

New commits:
commit 5d6a91b8ea40ec79c746e5c1d486be6e25a2856d
Author: Eike Rathke 
AuthorDate: Sun Aug 22 22:13:23 2021 +0200
Commit: Xisco Fauli 
CommitDate: Wed Aug 25 09:54:38 2021 +0200

Resolves: tdf#143979 Write and read empty text element in number formats

... as they may be significant as separators between keywords of
same letters.

Also strip trailing empty text as meaningless, except if the only
element.

>General;General<
earlier both General were written as


  
  


for which now  is not.

Change-Id: I4809b1c784667994303b49d8e4ab0e857367e2cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120856
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit c6f15d228489ccfd0628ca80b45a5c2faaacc7d3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120728
Reviewed-by: Xisco Fauli 

diff --git a/include/xmloff/xmlnumfe.hxx b/include/xmloff/xmlnumfe.hxx
index 98584ac93873..28bfe8d1a2ad 100644
--- a/include/xmloff/xmlnumfe.hxx
+++ b/include/xmloff/xmlnumfe.hxx
@@ -50,7 +50,8 @@ private:
 SvXMLExport&rExport;
 OUStringsPrefix;
 SvNumberFormatter*  pFormatter;
-OUStringBuffer   sTextContent;
+OUStringBuffer  sTextContent;
+boolbHasText;
 std::unique_ptr  pUsedList;
 std::unique_ptr  pCharClass;
 std::unique_ptr  pLocaleData;
diff --git a/include/xmloff/xmlnumfi.hxx b/include/xmloff/xmlnumfi.hxx
index 0f6384f3b785..8026b4e1846b 100644
--- a/include/xmloff/xmlnumfi.hxx
+++ b/include/xmloff/xmlnumfi.hxx
@@ -145,6 +145,7 @@ private:
 boolbAutoDec;   // set in AddNumber
 boolbAutoInt;   // set in AddNumber
 boolbHasExtraText;
+boolbHasTrailingEmptyText;
 OUStringBuffer aFormatCode{64};
 OUStringBuffer aConditions{32};
 boolbHasLongDoW;
@@ -189,6 +190,7 @@ public:
 
 bool HasLongDoW() const { return bHasLongDoW; }
 void SetHasLongDoW(bool bSet)   { bHasLongDoW = bSet; }
+void SetHasTrailingEmptyText(bool bSet) { bHasTrailingEmptyText = 
bSet; }
 
 void UpdateCalendar( const OUString& rNewCalendar );
 ImplicitCalendar GetImplicitCalendarState() const { return 
eImplicitCalendar; }
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 38c4d42d2986..59e6e8d9bf5c 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -209,7 +209,8 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
 const uno::Reference< util::XNumberFormatsSupplier >& rSupp ) :
 rExport( rExp ),
 sPrefix( OUString("N") ),
-pFormatter( nullptr )
+pFormatter( nullptr ),
+bHasText( false )
 {
 //  supplier must be SvNumberFormatsSupplierObj
 SvNumberFormatsSupplierObj* pObj =
@@ -241,7 +242,8 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
const OUString& rPrefix ) :
 rExport( rExp ),
 sPrefix( rPrefix ),
-pFormatter( nullptr )
+pFormatter( nullptr ),
+bHasText( false )
 {
 //  supplier must be SvNumberFormatsSupplierObj
 SvNumberFormatsSupplierObj* pObj =
@@ -319,16 +321,21 @@ void SvXMLNumFmtExport::AddToTextElement_Impl( 
std::u16string_view rString )
 //  to avoid several text elements following each other
 
 sTextContent.append( rString );
+// Also empty string leads to a number:text element as it may separate
+// keywords of the same letter (e.g. MM""MMM) that otherwise would be
+// concatenated when reading back in.
+bHasText = true;
 }
 
 void SvXMLNumFmtExport::FinishTextElement_Impl(bool bUseExtensionNS)
 {
-if ( !sTextContent.isEmpty() )
+if ( bHasText )
 {
 sal_uInt16 nNS = bUseExtensionNS ? XML_NAMESPACE_LO_EXT : 
XML_NAMESPACE_NUMBER;
 SvXMLElementExport aElem( rExport, nNS, XML_TEXT,
   true, false );
 rExport.Characters( sTextContent.makeStringAndClear() );
+bHasText = false;
 }
 }
 
@@ -1414,6 +1421,8 @@ void SvXMLNumFmtExport::ExportPart_Impl( const 
SvNumberformat& rFormat, sal_uInt
 {
 case 0:
 bEnd = true;// end of format reached
+if (bHasText && sTextContent.isEmpty())
+bHasText = false;   // don't write trailing empty 
text
 break;
 case NF_SYMBOLTYPE_STRING:
 case NF_SYMB

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

2021-08-22 Thread Eike Rathke (via logerrit)
 include/xmloff/xmlnumfe.hxx  |3 ++-
 include/xmloff/xmlnumfi.hxx  |2 ++
 xmloff/source/style/xmlnumfe.cxx |   16 +---
 xmloff/source/style/xmlnumfi.cxx |   20 
 4 files changed, 37 insertions(+), 4 deletions(-)

New commits:
commit c6f15d228489ccfd0628ca80b45a5c2faaacc7d3
Author: Eike Rathke 
AuthorDate: Sun Aug 22 22:13:23 2021 +0200
Commit: Eike Rathke 
CommitDate: Sun Aug 22 23:12:57 2021 +0200

Resolves: tdf#143979 Write and read empty text element in number formats

... as they may be significant as separators between keywords of
same letters.

Also strip trailing empty text as meaningless, except if the only
element.

>General;General<
earlier both General were written as


  
  


for which now  is not.

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

diff --git a/include/xmloff/xmlnumfe.hxx b/include/xmloff/xmlnumfe.hxx
index 98584ac93873..28bfe8d1a2ad 100644
--- a/include/xmloff/xmlnumfe.hxx
+++ b/include/xmloff/xmlnumfe.hxx
@@ -50,7 +50,8 @@ private:
 SvXMLExport&rExport;
 OUStringsPrefix;
 SvNumberFormatter*  pFormatter;
-OUStringBuffer   sTextContent;
+OUStringBuffer  sTextContent;
+boolbHasText;
 std::unique_ptr  pUsedList;
 std::unique_ptr  pCharClass;
 std::unique_ptr  pLocaleData;
diff --git a/include/xmloff/xmlnumfi.hxx b/include/xmloff/xmlnumfi.hxx
index 0f6384f3b785..8026b4e1846b 100644
--- a/include/xmloff/xmlnumfi.hxx
+++ b/include/xmloff/xmlnumfi.hxx
@@ -145,6 +145,7 @@ private:
 boolbAutoDec;   // set in AddNumber
 boolbAutoInt;   // set in AddNumber
 boolbHasExtraText;
+boolbHasTrailingEmptyText;
 OUStringBuffer aFormatCode{64};
 OUStringBuffer aConditions{32};
 boolbHasLongDoW;
@@ -189,6 +190,7 @@ public:
 
 bool HasLongDoW() const { return bHasLongDoW; }
 void SetHasLongDoW(bool bSet)   { bHasLongDoW = bSet; }
+void SetHasTrailingEmptyText(bool bSet) { bHasTrailingEmptyText = 
bSet; }
 
 void UpdateCalendar( const OUString& rNewCalendar );
 ImplicitCalendar GetImplicitCalendarState() const { return 
eImplicitCalendar; }
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 2695a84fa38b..caba160252f3 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -210,7 +210,8 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
 const uno::Reference< util::XNumberFormatsSupplier >& rSupp ) :
 rExport( rExp ),
 sPrefix( OUString("N") ),
-pFormatter( nullptr )
+pFormatter( nullptr ),
+bHasText( false )
 {
 //  supplier must be SvNumberFormatsSupplierObj
 SvNumberFormatsSupplierObj* pObj =
@@ -242,7 +243,8 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
const OUString& rPrefix ) :
 rExport( rExp ),
 sPrefix( rPrefix ),
-pFormatter( nullptr )
+pFormatter( nullptr ),
+bHasText( false )
 {
 //  supplier must be SvNumberFormatsSupplierObj
 SvNumberFormatsSupplierObj* pObj =
@@ -320,16 +322,21 @@ void SvXMLNumFmtExport::AddToTextElement_Impl( 
std::u16string_view rString )
 //  to avoid several text elements following each other
 
 sTextContent.append( rString );
+// Also empty string leads to a number:text element as it may separate
+// keywords of the same letter (e.g. MM""MMM) that otherwise would be
+// concatenated when reading back in.
+bHasText = true;
 }
 
 void SvXMLNumFmtExport::FinishTextElement_Impl(bool bUseExtensionNS)
 {
-if ( !sTextContent.isEmpty() )
+if ( bHasText )
 {
 sal_uInt16 nNS = bUseExtensionNS ? XML_NAMESPACE_LO_EXT : 
XML_NAMESPACE_NUMBER;
 SvXMLElementExport aElem( rExport, nNS, XML_TEXT,
   true, false );
 rExport.Characters( sTextContent.makeStringAndClear() );
+bHasText = false;
 }
 }
 
@@ -1415,6 +1422,8 @@ void SvXMLNumFmtExport::ExportPart_Impl( const 
SvNumberformat& rFormat, sal_uInt
 {
 case 0:
 bEnd = true;// end of format reached
+if (bHasText && sTextContent.isEmpty())
+bHasText = false;   // don't write trailing empty 
text
 break;
 case NF_SYMBOLTYPE_STRING:
 case NF_SYMBOLTYPE_DATESEP:
@@ -1463,6 +1472,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const 
SvNumberformat& rFormat, sal_uInt

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

2021-08-21 Thread Eike Rathke (via logerrit)
 i18nlangtag/qa/cppunit/test_languagetag.cxx |1 -
 i18nlangtag/source/isolang/isolang.cxx  |2 ++
 include/i18nlangtag/lang.h  |1 +
 svtools/inc/langtab.hrc |3 ++-
 4 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit bae2fbfd341b2cb5e5053c7977176f68b5d658dd
Author: Eike Rathke 
AuthorDate: Sat Aug 21 12:05:05 2021 +0200
Commit: Eike Rathke 
CommitDate: Sat Aug 21 14:38:35 2021 +0200

Resolves: tdf#143946 Add Klingon, tlhIngan Hol {tlh} 0x06AC to language list

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

diff --git a/i18nlangtag/qa/cppunit/test_languagetag.cxx 
b/i18nlangtag/qa/cppunit/test_languagetag.cxx
index 8f76fb58d6f1..4b9a462f59fb 100644
--- a/i18nlangtag/qa/cppunit/test_languagetag.cxx
+++ b/i18nlangtag/qa/cppunit/test_languagetag.cxx
@@ -69,7 +69,6 @@ void TestLanguageTag::testAllTags()
 CPPUNIT_ASSERT_EQUAL( OUString("tlh"), aLocale.Language );
 CPPUNIT_ASSERT( aLocale.Country.isEmpty() );
 CPPUNIT_ASSERT( aLocale.Variant.isEmpty() );
-CPPUNIT_ASSERT( LanguageTag::isOnTheFlyID( klingon.getLanguageType()) 
);
 CPPUNIT_ASSERT( klingon.isValidBcp47() );
 CPPUNIT_ASSERT( klingon.isIsoLocale() );
 CPPUNIT_ASSERT( klingon.isIsoODF() );
diff --git a/i18nlangtag/source/isolang/isolang.cxx 
b/i18nlangtag/source/isolang/isolang.cxx
index cb1d5956d6ea..eea9592d907c 100644
--- a/i18nlangtag/source/isolang/isolang.cxx
+++ b/i18nlangtag/source/isolang/isolang.cxx
@@ -693,6 +693,7 @@ IsoLanguageCountryEntry const aImplIsoLangEntries[] =
 { LANGUAGE_USER_BRIBRI,"bzd", "CR", k0},
 { LANGUAGE_USER_ENGLISH_DENMARK,"en", "DK", k0},
 { LANGUAGE_USER_SESOTHO_LESOTHO,"st", "LS", k0},
+{ LANGUAGE_USER_KLINGON,   "tlh", ""  , k0},
 { LANGUAGE_MULTIPLE,   "mul", ""  , k0},// 
multiple languages, many languages are used
 { LANGUAGE_UNDETERMINED,   "und", ""  , k0},// 
undetermined language, language cannot be identified
 { LANGUAGE_NONE,   "zxx", ""  , k0},// added 
to ISO 639-2 on 2006-01-11: Used to declare the absence of linguistic 
information
@@ -1183,6 +1184,7 @@ css::lang::Locale 
MsLangId::Conversion::lookupFallbackLocale(
 LANGUAGE_USER_INTERLINGUE,
 LANGUAGE_USER_LOJBAN,
 LANGUAGE_KASHMIRI,
+LANGUAGE_USER_KLINGON,
 LANGUAGE_USER_KEYID,
 // And the special codes without country.
 LANGUAGE_MULTIPLE,
diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h
index 4b28d9dc3ac6..6303ac111b7b 100644
--- a/include/i18nlangtag/lang.h
+++ b/include/i18nlangtag/lang.h
@@ -769,6 +769,7 @@ namespace o3tl
 #define LANGUAGE_USER_ENGLISH_DENMARK   LanguageType(0xB009)  /* 
makeLangID( 0x2C, getPrimaryLanguage( LANGUAGE_ENGLISH_UK)) */
 #define LANGUAGE_USER_SESOTHO_LESOTHO   LanguageType(0x8030)  /* 
makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_SESOTHO)) */
 #define LANGUAGE_USER_YIDDISH_ISRAELLanguageType(0x843D)  /* 
makeLangID( 0x21, getPrimaryLanguage( LANGUAGE_YIDDISH)) */
+#define LANGUAGE_USER_KLINGON   LanguageType(0x06AC)
 
 
 /* XXX Add new user defined LCIDs ^^^ there.
diff --git a/svtools/inc/langtab.hrc b/svtools/inc/langtab.hrc
index 155be7b45358..547b9992455d 100644
--- a/svtools/inc/langtab.hrc
+++ b/svtools/inc/langtab.hrc
@@ -432,7 +432,8 @@ const std::pair 
STR_ARR_SVT_LANGUAGE_TABLE[] =
 { NC_("STR_ARR_SVT_LANGUAGE_TABLE", "Cabécar") , LANGUAGE_USER_CABECAR },
 { NC_("STR_ARR_SVT_LANGUAGE_TABLE", "Bribri") , LANGUAGE_USER_BRIBRI },
 { NC_("STR_ARR_SVT_LANGUAGE_TABLE", "English (Denmark)") , 
LANGUAGE_USER_ENGLISH_DENMARK },
-{ NC_("STR_ARR_SVT_LANGUAGE_TABLE", "Sesotho") , 
LANGUAGE_USER_SESOTHO_LESOTHO }
+{ NC_("STR_ARR_SVT_LANGUAGE_TABLE", "Sesotho") , 
LANGUAGE_USER_SESOTHO_LESOTHO },
+{ NC_("STR_ARR_SVT_LANGUAGE_TABLE", "Klingon, tlhIngan Hol") , 
LANGUAGE_USER_KLINGON }
 };
 
 


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

2021-08-20 Thread Eike Rathke (via logerrit)
 svtools/source/misc/langtab.cxx |   38 +-
 1 file changed, 25 insertions(+), 13 deletions(-)

New commits:
commit 05924f9b2e651f545d8ceea883d9b1729257349d
Author: Eike Rathke 
AuthorDate: Fri Aug 20 23:17:27 2021 +0200
Commit: Eike Rathke 
CommitDate: Sat Aug 21 01:58:59 2021 +0200

Use LanguageTagIcu::getDisplayName() for on-the-fly language list entries

So the for {tag} entries "too geeky" argument of spell-checker
dictionary developers and language enthusiasts will be moot in
future and we can stop adding 100 more tags if it's not for locale
data.

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

diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 7bd30f365158..9981cf6862b3 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -29,8 +29,11 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -156,16 +159,25 @@ OUString ApplyLreOrRleEmbedding( const OUString  )
 return aRes;
 }
 
-static OUString lcl_getDescription( std::u16string_view rBcp47 )
+static OUString lcl_getDescription( const LanguageTag& rTag )
 {
-// Place in curly brackets, so all on-the-fly tags are grouped together at
-// the top of a listbox (but behind the "[None]" entry), and not sprinkled
-// all over, which alphabetically might make sense in an English UI only
-// anyway. Also a visual indicator that it is a programmatical name, IMHO.
-/* TODO: pulling descriptive names (language, script, country, subtags)
- * from liblangtag or ISO databases might be nice, but those are English
- * only. Maybe ICU, that has translations for language and country. */
-return OUString::Concat("{") + rBcp47 + "}";
+OUString aStr( LanguageTagIcu::getDisplayName( rTag, 
Application::GetSettings().GetUILanguageTag()));
+if (aStr.isEmpty() || aStr == rTag.getBcp47())
+{
+// Place in curly brackets, so all on-the-fly tags without display name
+// are grouped together at the top of a listbox (but behind the
+// "[None]" entry), and not sprinkled all over, which alphabetically
+// might make sense in an English UI only anyway. Also a visual
+// indicator that it is a programmatical name, IMHO.
+return OUString::Concat("{") + aStr + "}";
+}
+else
+{
+// The ICU display name might be identical to a predefined name or even
+// to another tag's ICU name; clarify that this is a generated name and
+// append the language tag in curly brackets to distinguish.
+return aStr + " {" + rTag.getBcp47() + "}";
+}
 }
 
 SvtLanguageTableImpl::SvtLanguageTableImpl()
@@ -193,7 +205,7 @@ SvtLanguageTableImpl::SvtLanguageTableImpl()
 aLang.setScriptType(LanguageTag::ScriptType(nType));
 sal_uInt32 nPos = FindIndex(nLangType);
 if (nPos == RESARRAY_INDEX_NOTFOUND)
-AddItem((aName.isEmpty() ? lcl_getDescription(rBcp47) : 
aName), nLangType);
+AddItem((aName.isEmpty() ? lcl_getDescription(aLang) : aName), 
nLangType);
 }
 }
 }
@@ -219,8 +231,8 @@ OUString SvtLanguageTableImpl::GetString( const 
LanguageType eType ) const
 if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < GetEntryCount() )
 return m_aStrings[nPos].first;
 
-//Rather than return a fairly useless "Unknown" name, return a geeky but 
usable-in-a-pinch lang-tag
-OUString sLangTag( lcl_getDescription( 
LanguageTag::convertToBcp47(eType)));
+// Obtain from ICU, or a geeky but usable-in-a-pinch lang-tag.
+OUString sLangTag( lcl_getDescription( LanguageTag(eType)));
 SAL_WARN("svtools.misc", "Language: 0x"
 << std::hex << eType
 << " with unknown name, so returning lang-tag of: "
@@ -287,7 +299,7 @@ LanguageType SvtLanguageTable::GetLanguageTypeAtIndex( 
sal_uInt32 nIndex )
 
 sal_uInt32 SvtLanguageTable::AddLanguageTag( const LanguageTag& rLanguageTag )
 {
-return theLanguageTable::get().AddItem( 
lcl_getDescription(rLanguageTag.getBcp47()),
+return theLanguageTable::get().AddItem( lcl_getDescription(rLanguageTag),
 rLanguageTag.getLanguageType());
 }
 


[Libreoffice-commits] core.git: i18nlangtag/CppunitTest_i18nlangtag_test_languagetag.mk i18nlangtag/qa

2021-08-20 Thread Eike Rathke (via logerrit)
 i18nlangtag/CppunitTest_i18nlangtag_test_languagetag.mk |2 
 i18nlangtag/qa/cppunit/test_languagetag.cxx |   75 
 2 files changed, 77 insertions(+)

New commits:
commit 6d6119bc4e4a783c76b3ae35626d6fea0de0abac
Author: Eike Rathke 
AuthorDate: Fri Aug 20 22:49:40 2021 +0200
Commit: Eike Rathke 
CommitDate: Sat Aug 21 01:58:16 2021 +0200

Unit test for LanguageTagIcu::getDisplayName()

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

diff --git a/i18nlangtag/CppunitTest_i18nlangtag_test_languagetag.mk 
b/i18nlangtag/CppunitTest_i18nlangtag_test_languagetag.mk
index 72402632d341..801bfe7b99ff 100644
--- a/i18nlangtag/CppunitTest_i18nlangtag_test_languagetag.mk
+++ b/i18nlangtag/CppunitTest_i18nlangtag_test_languagetag.mk
@@ -21,6 +21,8 @@ $(eval $(call 
gb_CppunitTest_use_libraries,i18nlangtag_test_languagetag,\
 ))
 
 $(eval $(call gb_CppunitTest_use_externals,i18nlangtag_test_languagetag,\
+   icu_headers \
+   icuuc \
liblangtag \
libxml2 \
 ))
diff --git a/i18nlangtag/qa/cppunit/test_languagetag.cxx 
b/i18nlangtag/qa/cppunit/test_languagetag.cxx
index c3dfb151e14e..8f76fb58d6f1 100644
--- a/i18nlangtag/qa/cppunit/test_languagetag.cxx
+++ b/i18nlangtag/qa/cppunit/test_languagetag.cxx
@@ -16,6 +16,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -33,10 +34,12 @@ public:
 
 void testAllTags();
 void testAllIsoLangEntries();
+void testDisplayNames();
 
 CPPUNIT_TEST_SUITE(TestLanguageTag);
 CPPUNIT_TEST(testAllTags);
 CPPUNIT_TEST(testAllIsoLangEntries);
+CPPUNIT_TEST(testDisplayNames);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -803,6 +806,78 @@ void TestLanguageTag::testAllIsoLangEntries()
 //CPPUNIT_ASSERT( true == false );
 }
 
+void TestLanguageTag::testDisplayNames()
+{
+OUString aStr;
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("en-US"), 
LanguageTag("en-US"));
+CPPUNIT_ASSERT_EQUAL( OUString("English (United States)"), aStr);
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("en-US"), 
LanguageTag("en"));
+CPPUNIT_ASSERT_EQUAL( OUString("English (United States)"), aStr);
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("en"), 
LanguageTag("en"));
+CPPUNIT_ASSERT_EQUAL( OUString("English"), aStr);
+
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("en-US"), 
LanguageTag("de-DE"));
+CPPUNIT_ASSERT_EQUAL( OUString("Englisch (Vereinigte Staaten)"), aStr);
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("en-US"), 
LanguageTag("de"));
+CPPUNIT_ASSERT_EQUAL( OUString("Englisch (Vereinigte Staaten)"), aStr);
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("en"), 
LanguageTag("de"));
+CPPUNIT_ASSERT_EQUAL( OUString("Englisch"), aStr);
+
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("de-DE"), 
LanguageTag("en"));
+CPPUNIT_ASSERT_EQUAL( OUString("German (Germany)"), aStr);
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("de"), 
LanguageTag("en"));
+CPPUNIT_ASSERT_EQUAL( OUString("German"), aStr);
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("de-DE-1901"), 
LanguageTag("en"));
+CPPUNIT_ASSERT_EQUAL( OUString("German (Germany, Traditional German 
orthography)"), aStr);
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("de-DE-1901"), 
LanguageTag("de-DE"));
+CPPUNIT_ASSERT_EQUAL( OUString("Deutsch (Deutschland, Alte deutsche 
Rechtschreibung)"), aStr);
+
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("en-GB"), 
LanguageTag("en"));
+CPPUNIT_ASSERT_EQUAL( OUString("English (United Kingdom)"), aStr);
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("en-GB-oxendict"), 
LanguageTag("en"));
+CPPUNIT_ASSERT_EQUAL( OUString("English (United Kingdom, Oxford English 
Dictionary spelling)"), aStr);
+
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("ca-ES-valencia"), 
LanguageTag("en"));
+CPPUNIT_ASSERT_EQUAL( OUString("Catalan (Spain, Valencian)"), aStr);
+
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("sr-Cyrl-RS"), 
LanguageTag("en"));
+CPPUNIT_ASSERT_EQUAL( OUString("Serbian (Serbia)"), aStr);
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("sr-Latn-RS"), 
LanguageTag("en"));
+CPPUNIT_ASSERT_EQUAL( OUString("Serbian (Latin, Serbia)"), aStr);
+
+aStr = LanguageTagIcu::getDisplayName( LanguageTag("tlh"), 
LanguageTag("en"));
+CP

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

2021-08-20 Thread Eike Rathke (via logerrit)
 i18nlangtag/source/languagetag/languagetagicu.cxx |   22 ++
 include/i18nlangtag/languagetagicu.hxx|   17 +
 2 files changed, 39 insertions(+)

New commits:
commit c482aefe08e4486aa35ba87edea1a341c97b8610
Author: Eike Rathke 
AuthorDate: Fri Aug 20 22:47:08 2021 +0200
Commit: Eike Rathke 
CommitDate: Sat Aug 21 00:11:47 2021 +0200

Introduce LanguageTagIcu::getDisplayName()

To be used in generating display names for on-the-fly language
tags in the language listbox.

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

diff --git a/i18nlangtag/source/languagetag/languagetagicu.cxx 
b/i18nlangtag/source/languagetag/languagetagicu.cxx
index c35e7a85ef8b..fd1c9bc75670 100644
--- a/i18nlangtag/source/languagetag/languagetagicu.cxx
+++ b/i18nlangtag/source/languagetag/languagetagicu.cxx
@@ -46,4 +46,26 @@ icu::Locale LanguageTagIcu::getIcuLocale( const LanguageTag 
& rLanguageTag, std:
);
 }
 
+// static
+OUString LanguageTagIcu::getDisplayName( const LanguageTag & rLanguageTag, 
const LanguageTag & rDisplayLanguage )
+{
+// This will be initialized by the first call; as the UI language doesn't
+// change the tag mostly stays the same, unless someone overrides it for a
+// call here, and thus obtaining the UI icu::Locale has to be done only
+// once.
+static thread_local LanguageTag aUITag( LANGUAGE_SYSTEM);
+static thread_local icu::Locale aUILocale;
+
+if (aUITag != rDisplayLanguage)
+{
+aUITag = rDisplayLanguage;
+aUILocale = getIcuLocale( rDisplayLanguage);
+}
+
+icu::Locale aLocale( getIcuLocale( rLanguageTag));
+icu::UnicodeString aResult;
+aLocale.getDisplayName( aUILocale, aResult);
+return OUString( reinterpret_cast(aResult.getBuffer()), aResult.length());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/i18nlangtag/languagetagicu.hxx 
b/include/i18nlangtag/languagetagicu.hxx
index 755d8eb12c76..430c483f344d 100644
--- a/include/i18nlangtag/languagetagicu.hxx
+++ b/include/i18nlangtag/languagetagicu.hxx
@@ -15,6 +15,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 class LanguageTag;
@@ -49,6 +50,22 @@ public:
 Always resolves an empty tag to the system locale.
  */
 static  icu::Locale getIcuLocale( const LanguageTag & rLanguageTag, 
std::u16string_view rVariant, std::u16string_view rKeywords);
+
+/** Obtain the display name for a language tag.
+
+Gets a localized name from icu::Locale::getDisplayName(). Meant to be
+used only with language tags that do not have a language list entry in
+svtools/inc/langtab.hrc STR_ARR_SVT_LANGUAGE_TABLE, thus used by
+SvtLanguageTable::GetLanguageString()
+
+@param  rLanguageTag
+The language tag for which the name is to be displayed.
+
+@param  rDisplayLanguage
+The language in which the name is to be displayed.
+Usually Application::GetSettings().GetUILanguageTag().
+ */
+static  OUStringgetDisplayName( const LanguageTag & rLanguageTag, 
const LanguageTag & rDisplayLanguage );
 };
 
 #endif  // INCLUDED_I18NLANGTAG_LANGUAGETAGICU_HXX


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

2021-08-20 Thread Eike Rathke (via logerrit)
 sc/source/ui/dbgui/scuiasciiopt.cxx |   40 
 sc/source/ui/docshell/impex.cxx |   50 
 sc/source/ui/inc/impex.hxx  |   18 ++--
 sc/source/ui/inc/scuiasciiopt.hxx   |2 -
 4 files changed, 85 insertions(+), 25 deletions(-)

New commits:
commit 8bcfa0829bc5741141d1c491a527bc53b51b4f33
Author: Eike Rathke 
AuthorDate: Wed Aug 18 19:05:08 2021 +0200
Commit: Caolán McNamara 
CommitDate: Fri Aug 20 09:49:08 2021 +0200

Resolves: tdf#102846 CSV: Detect separator, limit preview line 
concatenations

In CSV import preview, if a line starts with a quote character and
none of the remembered last field separators used occur in data in
conjunction with a closing quote, then reading data tried to
concatenate line by line to form a data field to be presented in
the preview, worst case the entire file..

For the preview, detect one possible not yet selected separator if
used with a quoted field (similar to commit
c807e7ea7a0725a4d8375eda07d6f70870e0d50a for tdf#56910 space
separator) and limit the number of source lines that are tried to
be concatenated if no separator was encountered after a possibly
closing field quote.

Change-Id: Iefd37a8301161e72cb607cea88d4faadad47b4ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120690
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit ff62e0165a0add7c7e3cb606df5b24b20c822d8a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120717
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index b66403492961..a95d8bdfff7a 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -44,6 +44,14 @@
 //! TODO make dynamic
 const SCSIZE ASCIIDLG_MAXROWS= MAXROWCOUNT;
 
+// Maximum number of source lines to concatenate while generating the preview
+// for one logical line. This may result in a wrong preview if the actual
+// number of embedded line feeds is greater, but a number too high would take
+// too much time (loop excessively if unlimited and large data) if none of the
+// selected separators are actually used in data but a field at start of line
+// is quoted.
+constexpr sal_uInt32 kMaxEmbeddedLinefeeds = 500;
+
 using namespace com::sun::star::uno;
 
 namespace {
@@ -293,7 +301,7 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, 
const OUString& aDatNa
 , mnRowPosCount(0)
 , mcTextSep(ScAsciiOptions::cDefaultTextSep)
 , meCall(eCall)
-, mbDetectSpaceSep(eCall != SC_TEXTTOCOLUMNS)
+, mbDetectSep(eCall != SC_TEXTTOCOLUMNS)
 , mxFtCharSet(m_xBuilder->weld_label("textcharset"))
 , mxLbCharSet(new 
SvxTextEncodingBox(m_xBuilder->weld_combo_box("charset")))
 , mxFtCustomLang(m_xBuilder->weld_label("textlanguage"))
@@ -579,7 +587,7 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, OUString 
, sal_Unicode& r
 break;
 }
 rText = ReadCsvLine(*mpDatStream, !bFixed, maFieldSeparators,
-mcTextSep, rcDetectSep);
+mcTextSep, rcDetectSep, kMaxEmbeddedLinefeeds);
 mnStreamPos = mpDatStream->Tell();
 mpRowPosArray[++mnRowPosCount] = mnStreamPos;
 } while (nLine >= mnRowPosCount && mpDatStream->good());
@@ -594,7 +602,7 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, OUString 
, sal_Unicode& r
 else
 {
 Seek( mpRowPosArray[nLine]);
-rText = ReadCsvLine(*mpDatStream, !bFixed, maFieldSeparators, 
mcTextSep, rcDetectSep);
+rText = ReadCsvLine(*mpDatStream, !bFixed, maFieldSeparators, 
mcTextSep, rcDetectSep, kMaxEmbeddedLinefeeds);
 mnStreamPos = mpDatStream->Tell();
 }
 
@@ -793,7 +801,11 @@ IMPL_LINK_NOARG(ScImportAsciiDlg, UpdateTextHdl, 
ScCsvTableBox&, void)
 // when the dialog wasn't already presented to the user.
 // As a side effect this has the benefit that the check is only done on the
 // first set of visible lines.
-sal_Unicode cDetectSep = (mbDetectSpaceSep && !mxRbFixed->get_active() && 
!mxCkbSpace->get_active() ? 0 : 0x);
+sal_Unicode cDetectSep = ((mbDetectSep && !mxRbFixed->get_active()
+&& (!mxCkbTab->get_active() || !mxCkbSemicolon->get_active()
+|| !mxCkbComma->get_active() || 
!mxCkbSpace->get_active())) ? 0 : 0x);
+if (cDetectSep == 0x)
+mbDetectSep = false;
 
 sal_Int32 nBaseLine = mxTableBox->GetGrid().GetFirstVisLine();
 sal_Int32 nRead = mxTableBox->GetGrid().GetVisLineCount();
@@ -813,16 +825,22 @@ IMPL_LINK_NOARG(ScImportAsciiDlg, UpdateTextHdl, 
ScCsvTableBox&, void)
 for (; i < CSV_PREVIEW_LINES; i++)
 m

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

2021-08-19 Thread Eike Rathke (via logerrit)
 sc/source/ui/dbgui/scuiasciiopt.cxx |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit c374d8ed86262c8b09c158d22ec7e4b9dee115dd
Author: Eike Rathke 
AuthorDate: Thu Aug 19 19:00:38 2021 +0200
Commit: Eike Rathke 
CommitDate: Thu Aug 19 19:51:08 2021 +0200

Make the logic more logical.., tdf#102846 follow-up

Same functionality better readable.

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

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index a95d8bdfff7a..3ed0b05cf677 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -801,11 +801,10 @@ IMPL_LINK_NOARG(ScImportAsciiDlg, UpdateTextHdl, 
ScCsvTableBox&, void)
 // when the dialog wasn't already presented to the user.
 // As a side effect this has the benefit that the check is only done on the
 // first set of visible lines.
-sal_Unicode cDetectSep = ((mbDetectSep && !mxRbFixed->get_active()
+mbDetectSep = (mbDetectSep && !mxRbFixed->get_active()
 && (!mxCkbTab->get_active() || !mxCkbSemicolon->get_active()
-|| !mxCkbComma->get_active() || 
!mxCkbSpace->get_active())) ? 0 : 0x);
-if (cDetectSep == 0x)
-mbDetectSep = false;
+|| !mxCkbComma->get_active() || 
!mxCkbSpace->get_active()));
+sal_Unicode cDetectSep = (mbDetectSep ? 0 : 0x);
 
 sal_Int32 nBaseLine = mxTableBox->GetGrid().GetFirstVisLine();
 sal_Int32 nRead = mxTableBox->GetGrid().GetVisLineCount();


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

2021-08-19 Thread Eike Rathke (via logerrit)
 sc/source/ui/dbgui/scuiasciiopt.cxx |   40 
 sc/source/ui/docshell/impex.cxx |   50 
 sc/source/ui/inc/impex.hxx  |   18 ++--
 sc/source/ui/inc/scuiasciiopt.hxx   |2 -
 4 files changed, 85 insertions(+), 25 deletions(-)

New commits:
commit ff62e0165a0add7c7e3cb606df5b24b20c822d8a
Author: Eike Rathke 
AuthorDate: Wed Aug 18 19:05:08 2021 +0200
Commit: Eike Rathke 
CommitDate: Thu Aug 19 17:27:51 2021 +0200

Resolves: tdf#102846 CSV: Detect separator, limit preview line 
concatenations

In CSV import preview, if a line starts with a quote character and
none of the remembered last field separators used occur in data in
conjunction with a closing quote, then reading data tried to
concatenate line by line to form a data field to be presented in
the preview, worst case the entire file..

For the preview, detect one possible not yet selected separator if
used with a quoted field (similar to commit
c807e7ea7a0725a4d8375eda07d6f70870e0d50a for tdf#56910 space
separator) and limit the number of source lines that are tried to
be concatenated if no separator was encountered after a possibly
closing field quote.

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

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index b66403492961..a95d8bdfff7a 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -44,6 +44,14 @@
 //! TODO make dynamic
 const SCSIZE ASCIIDLG_MAXROWS= MAXROWCOUNT;
 
+// Maximum number of source lines to concatenate while generating the preview
+// for one logical line. This may result in a wrong preview if the actual
+// number of embedded line feeds is greater, but a number too high would take
+// too much time (loop excessively if unlimited and large data) if none of the
+// selected separators are actually used in data but a field at start of line
+// is quoted.
+constexpr sal_uInt32 kMaxEmbeddedLinefeeds = 500;
+
 using namespace com::sun::star::uno;
 
 namespace {
@@ -293,7 +301,7 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, 
const OUString& aDatNa
 , mnRowPosCount(0)
 , mcTextSep(ScAsciiOptions::cDefaultTextSep)
 , meCall(eCall)
-, mbDetectSpaceSep(eCall != SC_TEXTTOCOLUMNS)
+, mbDetectSep(eCall != SC_TEXTTOCOLUMNS)
 , mxFtCharSet(m_xBuilder->weld_label("textcharset"))
 , mxLbCharSet(new 
SvxTextEncodingBox(m_xBuilder->weld_combo_box("charset")))
 , mxFtCustomLang(m_xBuilder->weld_label("textlanguage"))
@@ -579,7 +587,7 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, OUString 
, sal_Unicode& r
 break;
 }
 rText = ReadCsvLine(*mpDatStream, !bFixed, maFieldSeparators,
-mcTextSep, rcDetectSep);
+mcTextSep, rcDetectSep, kMaxEmbeddedLinefeeds);
 mnStreamPos = mpDatStream->Tell();
 mpRowPosArray[++mnRowPosCount] = mnStreamPos;
 } while (nLine >= mnRowPosCount && mpDatStream->good());
@@ -594,7 +602,7 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, OUString 
, sal_Unicode& r
 else
 {
 Seek( mpRowPosArray[nLine]);
-rText = ReadCsvLine(*mpDatStream, !bFixed, maFieldSeparators, 
mcTextSep, rcDetectSep);
+rText = ReadCsvLine(*mpDatStream, !bFixed, maFieldSeparators, 
mcTextSep, rcDetectSep, kMaxEmbeddedLinefeeds);
 mnStreamPos = mpDatStream->Tell();
 }
 
@@ -793,7 +801,11 @@ IMPL_LINK_NOARG(ScImportAsciiDlg, UpdateTextHdl, 
ScCsvTableBox&, void)
 // when the dialog wasn't already presented to the user.
 // As a side effect this has the benefit that the check is only done on the
 // first set of visible lines.
-sal_Unicode cDetectSep = (mbDetectSpaceSep && !mxRbFixed->get_active() && 
!mxCkbSpace->get_active() ? 0 : 0x);
+sal_Unicode cDetectSep = ((mbDetectSep && !mxRbFixed->get_active()
+&& (!mxCkbTab->get_active() || !mxCkbSemicolon->get_active()
+|| !mxCkbComma->get_active() || 
!mxCkbSpace->get_active())) ? 0 : 0x);
+if (cDetectSep == 0x)
+mbDetectSep = false;
 
 sal_Int32 nBaseLine = mxTableBox->GetGrid().GetFirstVisLine();
 sal_Int32 nRead = mxTableBox->GetGrid().GetVisLineCount();
@@ -813,16 +825,22 @@ IMPL_LINK_NOARG(ScImportAsciiDlg, UpdateTextHdl, 
ScCsvTableBox&, void)
 for (; i < CSV_PREVIEW_LINES; i++)
 maPreviewLine[i].clear();
 
-if (mbDetectSpaceSep)
+if (mbDetectSep)
 {
-mbDetectSpaceSep = false;
-if (cDetectSep == ' ')
+mbDetectSep = fal

Re: Building failure on Windows 10

2021-08-19 Thread Eike Rathke
Hi Julien,

On Wednesday, 2021-08-18 12:25:14 +0200, Julien Nabet wrote:

> warn:configmgr:3524:1564:configmgr/source/components.cxx:658: error reading 
> "/user/registrymodifications.xcu" com.sun.star.uno.RuntimeException message: 
> cannot open /user/registrymodifications.xcu: 21

Are you passing -env:UserInstallation= with an empty URI?
Or somehow else that path is empty.

  Eike

-- 
GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A


signature.asc
Description: PGP signature


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

2021-08-18 Thread Eike Rathke (via logerrit)
 sc/source/ui/inc/gridwin.hxx   |8 ++--
 sc/source/ui/view/gridwin4.cxx |   73 -
 sc/source/ui/view/tabview5.cxx |5 ++
 3 files changed, 52 insertions(+), 34 deletions(-)

New commits:
commit f58f35b2c8ca1efbacec642a8f3de5b0c499bc6b
Author: Eike Rathke 
AuthorDate: Wed Aug 18 23:42:45 2021 +0200
Commit: Eike Rathke 
CommitDate: Thu Aug 19 01:19:32 2021 +0200

Do not count pages for initial page breaks, tdf#124983 follow-up

Use a loaded page size or leave it. Otherwise the previous
implementation could had lead to tremendous waiting time blocking
everything on large data without. See source code comment.

Also trigger updating page breaks only for one grid window, not
multiple repeating everything all over.

Remove bSetup parameter that does nothing but either doing something or
nothing, check in caller instead.

Move member variables to where they belong.

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

diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 10d9fc68557a..50109106aa5d 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -200,6 +200,8 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::Window, 
public DropTargetHel
 
 RfCorneraRFSelectedCorned;
 
+Timer   maShowPageBreaksTimer;
+
 boolbEEMouse:1;   // Edit Engine has mouse
 boolbDPMouse:1;   // DataPilot D (new 
Pivot table)
 boolbRFMouse:1;   // RangeFinder drag
@@ -210,6 +212,7 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::Window, 
public DropTargetHel
 boolbNeedsRepaint:1;
 boolbAutoMarkVisible:1;
 boolbListValButton:1;
+boolbInitialPageBreaks:1;
 
 DECL_LINK( PopupModeEndHdl, weld::Popover&, void );
 DECL_LINK( PopupSpellingHdl, SpellCallbackInfo&, void );
@@ -309,10 +312,9 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public 
vcl::Window, public DropTargetHel
 voidInvalidateLOKViewCursor(const tools::Rectangle& 
rCursorRect,
 const Fraction aScaleX, const 
Fraction aScaleY);
 
-Timer   maShowPageBreaksTimer;
-boolbInitialPageBreaks;
-voidSetupInitialPageBreaks(const ScDocument& rDoc, SCTAB nTab, 
bool bSetup);
+voidSetupInitialPageBreaks(const ScDocument& rDoc, SCTAB nTab);
 DECL_LINK(InitiatePageBreaksTimer, Timer*, void);
+
 protected:
 virtual voidPrePaint(vcl::RenderContext& rRenderContext) override;
 virtual voidPaint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect) override;
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index eecf6a4d814b..f810efbb8c19 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1271,29 +1271,27 @@ void ScGridWindow::DrawContent(OutputDevice , 
const ScTableInfo& rTableI
 if (mpNoteMarker)
 mpNoteMarker->Draw(); // Above the cursor, in drawing map mode
 
-SetupInitialPageBreaks(rDoc, nTab, bPage&& bInitialPageBreaks);
+if (bPage && bInitialPageBreaks)
+SetupInitialPageBreaks(rDoc, nTab);
 }
 
 
-void ScGridWindow::SetupInitialPageBreaks(const ScDocument& rDoc, SCTAB nTab, 
bool bSetup)
+void ScGridWindow::SetupInitialPageBreaks(const ScDocument& rDoc, SCTAB nTab)
 {
 // tdf#124983, if option LibreOfficeDev Calc/View/Visual Aids/Page breaks
 // is enabled, breaks should be visible. If the document is opened the 
first
 // time, the breaks are not calculated yet, so for this initialization
 // a timer will be triggered here.
-if (bSetup)
-{
-std::set aColBreaks;
-std::set aRowBreaks;
-rDoc.GetAllColBreaks(aColBreaks, nTab, true, false);
-rDoc.GetAllRowBreaks(aRowBreaks, nTab, true, false);
-if (aColBreaks.size() == 0 || aRowBreaks.size() == 0)
-{
-maShowPageBreaksTimer.SetPriority(TaskPriority::DEFAULT_IDLE);
-maShowPageBreaksTimer.Start();
-bInitialPageBreaks = false;
-}
+std::set aColBreaks;
+std::set aRowBreaks;
+rDoc.GetAllColBreaks(aColBreaks, nTab, true, false);
+rDoc.GetAllRowBreaks(aRowBreaks, nTab, true, false);
+if (aColBreaks.size() == 0 || aRowBreaks.size() == 0)
+{
+maShowPageBreaksTimer.SetPriority(TaskPriority::DEFAULT_IDLE);
+maShowPageBreaksTimer.Start();
 }
+bInitialPageBreaks = false;
 }
 
 namespace
@@ -2353,27 +2351,42 @@ IMPL_LINK(ScGridWindow, Ini

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

2021-08-17 Thread Eike Rathke (via logerrit)
 sc/inc/document.hxx|1 +
 sc/source/core/data/documen3.cxx   |8 
 sc/source/core/data/table6.cxx |   11 +--
 sc/source/ui/dialogs/searchresults.cxx |   25 -
 sc/source/ui/inc/searchresults.hxx |2 +-
 sc/source/ui/view/viewfun2.cxx |   13 +++--
 6 files changed, 42 insertions(+), 18 deletions(-)

New commits:
commit 14f259faf4b5620f520ca358edb3b03f2368db9d
Author: Eike Rathke 
AuthorDate: Mon Aug 9 01:04:56 2021 +0200
Commit: Xisco Fauli 
CommitDate: Tue Aug 17 16:01:50 2021 +0200

Related: tdf#143759 Display results of find empty or replace to empty

Searching for empty cells or replacing to empty cells didn't list
the results because ScCellIterator iterates over cells with
content only.

Change-Id: If6ea65f853cae621e54ce545fe7fbed2b445fd14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120189
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 1c5b3cb3dd4dab6b0db409b6cc75b303820f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120136
Reviewed-by: Xisco Fauli 

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 63aec33a5161..7d1aac444847 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1862,6 +1862,7 @@ public:
SCCOL& rCol, SCROW& rRow, SCTAB& 
rTab,
const ScMarkData& rMark, 
ScRangeList& rMatchedRanges,
OUString& rUndoStr, ScDocument* 
pUndoDoc = nullptr );
+static bool  IsEmptyCellSearch( const SvxSearchItem& rSearchItem );
 
 // determine Col/Row of subsequent calls
 // (e.g. not found from the beginning, or subsequent 
tables)
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 8d6f6a2baadf..6ab51853 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1297,6 +1297,14 @@ void ScDocument::GetSearchAndReplaceStart( const 
SvxSearchItem& rSearchItem,
 }
 }
 
+// static
+bool ScDocument::IsEmptyCellSearch( const SvxSearchItem& rSearchItem )
+{
+return !rSearchItem.GetPattern() && (rSearchItem.GetCellType() != 
SvxSearchCellType::NOTE)
+&& (rSearchItem.GetSearchOptions().searchString.isEmpty()
+|| (rSearchItem.GetRegExp() && 
rSearchItem.GetSearchOptions().searchString == "^$"));
+}
+
 bool ScDocument::SearchAndReplace(
 const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, SCTAB& rTab,
 const ScMarkData& rMark, ScRangeList& rMatchedRanges,
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index fca6dea1c61b..6b3321d2440c 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -817,18 +817,17 @@ bool ScTable::SearchAndReplace(
 else if (nCommand == SvxSearchCmd::REPLACE_ALL)
 bFound = ReplaceAllStyle(rSearchItem, rMark, rMatchedRanges, 
pUndoDoc);
 }
+else if (ScDocument::IsEmptyCellSearch( rSearchItem))
+{
+// Search for empty cells.
+bFound = SearchAndReplaceEmptyCells(rSearchItem, rCol, rRow, 
rMark, rMatchedRanges, rUndoStr, pUndoDoc);
+}
 else
 {
 //  SearchParam no longer needed - SearchOptions contains all 
settings
 i18nutil::SearchOptions2 aSearchOptions = 
rSearchItem.GetSearchOptions();
 aSearchOptions.Locale = *ScGlobal::GetLocale();
 
-if (aSearchOptions.searchString.isEmpty() || ( 
rSearchItem.GetRegExp() && aSearchOptions.searchString == "^$" ) )
-{
-// Search for empty cells.
-return SearchAndReplaceEmptyCells(rSearchItem, rCol, rRow, 
rMark, rMatchedRanges, rUndoStr, pUndoDoc);
-}
-
 //  reflect UseAsianOptions flag in SearchOptions
 //  (use only ignore case and width if asian options are disabled).
 //  This is also done in SvxSearchDialog CommandHdl, but not in 
API object.
diff --git a/sc/source/ui/dialogs/searchresults.cxx 
b/sc/source/ui/dialogs/searchresults.cxx
index c9558c5376f3..db9dae68bfc8 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -92,7 +92,8 @@ namespace
 };
 }
 
-void SearchResultsDlg::FillResults( ScDocument& rDoc, const ScRangeList 
, bool bCellNotes )
+void SearchResultsDlg::FillResults( ScDocument& rDoc, const ScRangeList 
, bool bCellNotes,
+bool bEmptyCells )
 {
 ListWrapper aList(*mxList);
 std::vector aTabNames = rDoc.GetAllTableNames();
@@ -103,13 +104,10 @@ void SearchResultsDlg::FillResults( ScDocument& rDoc, 
const ScRangeList 
 if (nMatchMax >

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

2021-08-17 Thread Eike Rathke (via logerrit)
 sc/source/ui/docshell/impex.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit c061dc196a30dc14acba5aba5bf538edb3d4fcc4
Author: Eike Rathke 
AuthorDate: Mon Aug 16 21:46:44 2021 +0200
Commit: Caolán McNamara 
CommitDate: Tue Aug 17 10:52:36 2021 +0200

Resolves: tdf#96561 Include embedded null-characters while assembling CSV 
line

... instead of prematurely ending analysis and skipping the
remainder that is still part of data read.

Change-Id: I8f34bc9672e37f9c1c1ae81ddeba464360add7c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120555
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 7bd03074ae7362d8fffe5182529626a0b43a0ed1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120572
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 3f86cc86edb7..7233b14ad640 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2476,8 +2476,17 @@ Label_RetryWithNewSep:
 while (!rStream.eof() && aStr.getLength() < nArbitraryLineLengthLimit)
 {
 const sal_Unicode * p = aStr.getStr() + nLastOffset;
-while (*p)
+const sal_Unicode * const pStop = aStr.getStr() + aStr.getLength();
+while (p < pStop)
 {
+if (!*p)
+{
+// Skip embedded null-characters. They don't change
+// anything and are handled at a higher level.
+++p;
+continue;
+}
+
 if (nQuotes)
 {
 if (*p == cFieldQuote)


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

2021-08-17 Thread Eike Rathke (via logerrit)
 sc/source/ui/docshell/impex.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit d6808f6ba03f74f99759e8d59ac0a04fcc9c6dd8
Author: Eike Rathke 
AuthorDate: Mon Aug 16 21:46:44 2021 +0200
Commit: Caolán McNamara 
CommitDate: Tue Aug 17 10:51:59 2021 +0200

Resolves: tdf#96561 Include embedded null-characters while assembling CSV 
line

... instead of prematurely ending analysis and skipping the
remainder that is still part of data read.

Change-Id: I8f34bc9672e37f9c1c1ae81ddeba464360add7c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120555
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 7bd03074ae7362d8fffe5182529626a0b43a0ed1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120451
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 380bd875fadc..6297fba3a1a7 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2515,8 +2515,17 @@ Label_RetryWithNewSep:
 while (!rStream.eof() && aStr.getLength() < nArbitraryLineLengthLimit)
 {
 const sal_Unicode * p = aStr.getStr() + nLastOffset;
-while (*p)
+const sal_Unicode * const pStop = aStr.getStr() + aStr.getLength();
+while (p < pStop)
 {
+if (!*p)
+{
+// Skip embedded null-characters. They don't change
+// anything and are handled at a higher level.
+++p;
+continue;
+}
+
 if (nQuotes)
 {
 if (*p == cFieldQuote)


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

2021-08-16 Thread Eike Rathke (via logerrit)
 sc/source/ui/docshell/impex.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 7bd03074ae7362d8fffe5182529626a0b43a0ed1
Author: Eike Rathke 
AuthorDate: Mon Aug 16 21:46:44 2021 +0200
Commit: Eike Rathke 
CommitDate: Mon Aug 16 23:31:11 2021 +0200

Resolves: tdf#96561 Include embedded null-characters while assembling CSV 
line

... instead of prematurely ending analysis and skipping the
remainder that is still part of data read.

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

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index f64cf4b0e5e8..3a798b37e50e 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2516,8 +2516,17 @@ Label_RetryWithNewSep:
 while (!rStream.eof() && aStr.getLength() < nArbitraryLineLengthLimit)
 {
 const sal_Unicode * p = aStr.getStr() + nLastOffset;
-while (*p)
+const sal_Unicode * const pStop = aStr.getStr() + aStr.getLength();
+while (p < pStop)
 {
+if (!*p)
+{
+// Skip embedded null-characters. They don't change
+// anything and are handled at a higher level.
+++p;
+continue;
+}
+
 if (nQuotes)
 {
 if (*p == cFieldQuote)


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

2021-08-16 Thread Eike Rathke (via logerrit)
 framework/source/fwe/helper/undomanagerhelper.cxx |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 4ecb94da9fdd00f24b02020151ac4d27d5514d5f
Author: Eike Rathke 
AuthorDate: Tue Jul 20 16:12:26 2021 +0200
Commit: Eike Rathke 
CommitDate: Mon Aug 16 17:09:21 2021 +0200

Resolves: tdf#142980 Special-case the very first listener added during 
action

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

diff --git a/framework/source/fwe/helper/undomanagerhelper.cxx 
b/framework/source/fwe/helper/undomanagerhelper.cxx
index a621a39ae320..33d1fade47c7 100644
--- a/framework/source/fwe/helper/undomanagerhelper.cxx
+++ b/framework/source/fwe/helper/undomanagerhelper.cxx
@@ -210,6 +210,7 @@ namespace framework
 IUndoManagerImplementation& m_rUndoManagerImplementation;
 ::std::stack< bool >m_aContextVisibilities;
 #if OSL_DEBUG_LEVEL > 0
+boolm_bContextAPIFlagsEverPushed = 
{false};
 ::std::stack< bool >m_aContextAPIFlags;
 #endif
 ::std::queue< ::rtl::Reference< UndoManagerRequest > >
@@ -797,6 +798,7 @@ namespace framework
 {
 #if OSL_DEBUG_LEVEL > 0
 m_aContextAPIFlags.push( m_bAPIActionRunning );
+m_bContextAPIFlagsEverPushed = true;
 #endif
 
 if ( m_bAPIActionRunning )
@@ -808,9 +810,18 @@ namespace framework
 void UndoManagerHelper_Impl::listActionLeft( const OUString& i_comment )
 {
 #if OSL_DEBUG_LEVEL > 0
-const bool bCurrentContextIsAPIContext = m_aContextAPIFlags.top();
-m_aContextAPIFlags.pop();
-OSL_ENSURE( bCurrentContextIsAPIContext == m_bAPIActionRunning, 
"UndoManagerHelper_Impl::listActionLeft: API and non-API contexts interwoven!" 
);
+// It may happen that the very first event listener is added during a
+// list action after listActionEntered() was already called, e.g. Calc
+// formula calculation event listener during the input of the very
+// first formula. Instead of checking m_aContextAPIFlags for empty,
+// still assert (on calling top()) other stack mismatches but ignore
+// this one case. See tdf#142980
+if (m_bContextAPIFlagsEverPushed)
+{
+const bool bCurrentContextIsAPIContext = m_aContextAPIFlags.top();
+m_aContextAPIFlags.pop();
+OSL_ENSURE( bCurrentContextIsAPIContext == m_bAPIActionRunning, 
"UndoManagerHelper_Impl::listActionLeft: API and non-API contexts interwoven!" 
);
+}
 #endif
 
 if ( m_bAPIActionRunning )


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

2021-08-16 Thread Eike Rathke (via logerrit)
 writerfilter/source/dmapper/DomainMapper.cxx |   24 +++-
 1 file changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 118eb9e426fe729324347685f986ff9e78d49483
Author: Eike Rathke 
AuthorDate: Sat Aug 14 23:32:39 2021 +0200
Commit: Caolán McNamara 
CommitDate: Mon Aug 16 12:18:11 2021 +0200

Resolves: tdf#137742 Workaround cheesy Google Docs writing language-only 
tags

Change-Id: I2dc85abb70d53769d2e36102070e30ed71e8d888
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120495
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 23f17b7ea6fbd2f422c7e40192ae60e4df25224c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120438
Reviewed-by: Caolán McNamara 

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 25ce4297fa98..6f00e9fdb460 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -666,7 +666,29 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
 m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "val", 
sStringValue);
 else if (nName == NS_ooxml::LN_CT_Language_bidi)
 m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "bidi", 
sStringValue);
-lang::Locale aLocale( LanguageTag::convertToLocale( sStringValue));
+lang::Locale aLocale;
+if (sStringValue.getLength() <= 3 && sStringValue.getLength() >= 1)
+{
+// Cheesy Google Docs is known to tag language-only even for
+// "en" or others that need some region to distinguish language
+// variants for spell-checker and hyphenation. Obtain our known
+// fallback to clarify and match. The original value/context is
+// unknown anyway.
+LanguageTag aLanguageTag( sStringValue);
+aLanguageTag.makeFallback();
+if (aLanguageTag.getLanguage() == sStringValue)
+aLocale = aLanguageTag.getLocale();
+else
+{
+// Do not fallback for an unknown language, which usually
+// results in "en-US", or any other non-matching case.
+aLocale = LanguageTag::convertToLocale( sStringValue);
+}
+}
+else
+{
+aLocale = LanguageTag::convertToLocale( sStringValue);
+}
 if (m_pImpl->GetTopContext())
 
m_pImpl->GetTopContext()->Insert(NS_ooxml::LN_CT_Language_val== nName ? 
PROP_CHAR_LOCALE :
  NS_ooxml::LN_CT_Language_eastAsia == nName ? 
PROP_CHAR_LOCALE_ASIAN : PROP_CHAR_LOCALE_COMPLEX,


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

2021-08-15 Thread Eike Rathke (via logerrit)
 sc/inc/compiler.hxx  |1 +
 sc/source/core/tool/compiler.cxx |   37 ++---
 2 files changed, 31 insertions(+), 7 deletions(-)

New commits:
commit c5dbe94eb71acd9ab19cd9a8d561dd75da82d3d7
Author: Eike Rathke 
AuthorDate: Wed Aug 11 20:03:36 2021 +0200
Commit: Xisco Fauli 
CommitDate: Sun Aug 15 18:25:52 2021 +0200

Resolves: tdf#143809 "INF" may be a named expression or DB area name

... to not be caught by rtl::math::stringToDouble() handling
XMLSchema-2 "INF" and "NaN" and set as error.

Change-Id: I9bf7aad416a69d4c3c0d49d6c80168097040a3e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120337
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit b37fd7f38165dadc5b1a674b73f4b18824e4789e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120435
Reviewed-by: Xisco Fauli 

diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index b051f3ad4b4e..8ff420001d2b 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -344,6 +344,7 @@ private:
 bool IsColRowName( const OUString& );
 bool IsBoolean( const OUString& );
 void AutoCorrectParsedSymbol();
+const ScRangeData* GetRangeData( SCTAB& rSheet, const OUString& rUpperName 
) const;
 
 void AdjustSheetLocalNameRelReferences( SCTAB nDelta );
 void SetRelNameReference();
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 274205f5734b..b2b008b13d55 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -3093,7 +3093,24 @@ bool ScCompiler::IsValue( const OUString& rSym )
 return false;
 }
 if (eStatus == rtl_math_ConversionStatus_OutOfRange)
+{
+// rtl::math::stringToDouble() recognizes XMLSchema-2 "INF" and
+// "NaN" (case sensitive) that could be named expressions or DB
+// areas as well.
+// rSym is already upper so "NaN" is not possible here.
+if (!std::isfinite(fVal) && rSym == "INF")
+{
+SCTAB nSheet = -1;
+if (GetRangeData( nSheet, rSym))
+return false;
+if 
(rDoc.GetDBCollection()->getNamedDBs().findByUpperName(rSym))
+return false;
+}
+/* TODO: is there a specific reason why we don't accept an infinity
+ * value that would raise an error in the interpreter, instead of
+ * setting the hard error at the token array already? */
 SetError( FormulaError::IllegalArgument );
+}
 maRawToken.SetDouble( fVal );
 return true;
 }
@@ -3511,13 +3528,11 @@ bool ScCompiler::IsMacro( const OUString& rName )
 #endif
 }
 
-bool ScCompiler::IsNamedRange( const OUString& rUpperName )
+const ScRangeData* ScCompiler::GetRangeData( SCTAB& rSheet, const OUString& 
rUpperName ) const
 {
-// IsNamedRange is called only from NextNewToken, with an upper-case string
-
 // try local names first
-sal_Int16 nSheet = aPos.Tab();
-ScRangeName* pRangeName = rDoc.GetRangeName(nSheet);
+rSheet = aPos.Tab();
+const ScRangeName* pRangeName = rDoc.GetRangeName(rSheet);
 const ScRangeData* pData = nullptr;
 if (pRangeName)
 pData = pRangeName->findByUpperName(rUpperName);
@@ -3527,9 +3542,17 @@ bool ScCompiler::IsNamedRange( const OUString& 
rUpperName )
 if (pRangeName)
 pData = pRangeName->findByUpperName(rUpperName);
 if (pData)
-nSheet = -1;
+rSheet = -1;
 }
+return pData;
+}
+
+bool ScCompiler::IsNamedRange( const OUString& rUpperName )
+{
+// IsNamedRange is called only from NextNewToken, with an upper-case string
 
+SCTAB nSheet = -1;
+const ScRangeData* pData = GetRangeData( nSheet, rUpperName);
 if (pData)
 {
 maRawToken.SetName( nSheet, pData->GetIndex());
@@ -3540,7 +3563,7 @@ bool ScCompiler::IsNamedRange( const OUString& rUpperName 
)
 if (mnCurrentSheetEndPos > 0 && mnCurrentSheetTab >= 0)
 {
 OUString aName( rUpperName.copy( mnCurrentSheetEndPos));
-pRangeName = rDoc.GetRangeName( mnCurrentSheetTab);
+const ScRangeName* pRangeName = rDoc.GetRangeName( mnCurrentSheetTab);
 if (pRangeName)
 {
 pData = pRangeName->findByUpperName(aName);


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

2021-08-14 Thread Eike Rathke (via logerrit)
 configmgr/source/access.cxx |   14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 6c4ff1d23ef61e708f3450d1b0ae77cc78cac731
Author: Eike Rathke 
AuthorDate: Sun Aug 15 01:44:54 2021 +0200
Commit: Eike Rathke 
CommitDate: Sun Aug 15 02:57:21 2021 +0200

Avoid computing LanguageTag fallbacks several hundred times

... over and over again even for known and present locales for
each and every localizable config item.

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

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 02e3f557c684..28ef91000fb1 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1385,8 +1385,14 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 locale = comphelper::LibreOfficeKit::getLanguageTag().getBcp47();
 
 if (!locale.isEmpty()) {
-// Find the best match using the LanguageTag fallback mechanism
-std::vector aFallbacks = 
LanguageTag(locale).getFallbackStrings(true);
+// Try exact match first, avoiding all fallback overhead.
+rtl::Reference directChild(getChild(locale));
+if (directChild.is())
+return directChild;
+
+// Find the best match using the LanguageTag fallback mechanism,
+// excluding the original tag.
+std::vector aFallbacks = 
LanguageTag(locale).getFallbackStrings(false);
 for (const OUString& rFallback : aFallbacks)
 {
 rtl::Reference child(getChild(rFallback));
@@ -1398,8 +1404,8 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 // xml:lang attributes, look for the first entry with the same 
first
 // segment as the requested language tag before falling back to
 // defaults (see fdo#33638):
-assert(aFallbacks.size() > 0);
-locale = aFallbacks[aFallbacks.size() - 1];
+if (aFallbacks.size() > 0)
+locale = aFallbacks[aFallbacks.size() - 1];
 assert(
 !locale.isEmpty() && locale.indexOf('-') == -1 &&
 locale.indexOf('_') == -1);


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

2021-08-14 Thread Eike Rathke (via logerrit)
 writerfilter/source/dmapper/DomainMapper.cxx |   24 +++-
 1 file changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 23f17b7ea6fbd2f422c7e40192ae60e4df25224c
Author: Eike Rathke 
AuthorDate: Sat Aug 14 23:32:39 2021 +0200
Commit: Eike Rathke 
CommitDate: Sun Aug 15 01:46:08 2021 +0200

Resolves: tdf#137742 Workaround cheesy Google Docs writing language-only 
tags

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

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index b74ee3d02daf..ac63dc699fd2 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -666,7 +666,29 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
 m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "val", 
sStringValue);
 else if (nName == NS_ooxml::LN_CT_Language_bidi)
 m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "bidi", 
sStringValue);
-lang::Locale aLocale( LanguageTag::convertToLocale( sStringValue));
+lang::Locale aLocale;
+if (sStringValue.getLength() <= 3 && sStringValue.getLength() >= 1)
+{
+// Cheesy Google Docs is known to tag language-only even for
+// "en" or others that need some region to distinguish language
+// variants for spell-checker and hyphenation. Obtain our known
+// fallback to clarify and match. The original value/context is
+// unknown anyway.
+LanguageTag aLanguageTag( sStringValue);
+aLanguageTag.makeFallback();
+if (aLanguageTag.getLanguage() == sStringValue)
+aLocale = aLanguageTag.getLocale();
+else
+{
+// Do not fallback for an unknown language, which usually
+// results in "en-US", or any other non-matching case.
+aLocale = LanguageTag::convertToLocale( sStringValue);
+}
+}
+else
+{
+aLocale = LanguageTag::convertToLocale( sStringValue);
+}
 if (m_pImpl->GetTopContext())
 
m_pImpl->GetTopContext()->Insert(NS_ooxml::LN_CT_Language_val== nName ? 
PROP_CHAR_LOCALE :
  NS_ooxml::LN_CT_Language_eastAsia == nName ? 
PROP_CHAR_LOCALE_ASIAN : PROP_CHAR_LOCALE_COMPLEX,


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

2021-08-12 Thread Eike Rathke (via logerrit)
 sc/inc/compiler.hxx  |1 +
 sc/source/core/tool/compiler.cxx |   37 ++---
 2 files changed, 31 insertions(+), 7 deletions(-)

New commits:
commit 3dd3c1ed99a014cb98a7a68668b9426020094ec2
Author: Eike Rathke 
AuthorDate: Wed Aug 11 20:03:36 2021 +0200
Commit: Caolán McNamara 
CommitDate: Thu Aug 12 17:17:04 2021 +0200

Resolves: tdf#143809 "INF" may be a named expression or DB area name

... to not be caught by rtl::math::stringToDouble() handling
XMLSchema-2 "INF" and "NaN" and set as error.

Change-Id: I9bf7aad416a69d4c3c0d49d6c80168097040a3e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120337
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit b37fd7f38165dadc5b1a674b73f4b18824e4789e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120352
Reviewed-by: Caolán McNamara 

diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 4eadf561eacf..48d5230bbc14 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -343,6 +343,7 @@ private:
 bool IsColRowName( const OUString& );
 bool IsBoolean( const OUString& );
 void AutoCorrectParsedSymbol();
+const ScRangeData* GetRangeData( SCTAB& rSheet, const OUString& rUpperName 
) const;
 
 void AdjustSheetLocalNameRelReferences( SCTAB nDelta );
 void SetRelNameReference();
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 0d1dc9d52aa6..4ff62fc5862a 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -3088,7 +3088,24 @@ bool ScCompiler::IsValue( const OUString& rSym )
 return false;
 }
 if (eStatus == rtl_math_ConversionStatus_OutOfRange)
+{
+// rtl::math::stringToDouble() recognizes XMLSchema-2 "INF" and
+// "NaN" (case sensitive) that could be named expressions or DB
+// areas as well.
+// rSym is already upper so "NaN" is not possible here.
+if (!std::isfinite(fVal) && rSym == "INF")
+{
+SCTAB nSheet = -1;
+if (GetRangeData( nSheet, rSym))
+return false;
+if 
(rDoc.GetDBCollection()->getNamedDBs().findByUpperName(rSym))
+return false;
+}
+/* TODO: is there a specific reason why we don't accept an infinity
+ * value that would raise an error in the interpreter, instead of
+ * setting the hard error at the token array already? */
 SetError( FormulaError::IllegalArgument );
+}
 maRawToken.SetDouble( fVal );
 return true;
 }
@@ -3506,13 +3523,11 @@ bool ScCompiler::IsMacro( const OUString& rName )
 #endif
 }
 
-bool ScCompiler::IsNamedRange( const OUString& rUpperName )
+const ScRangeData* ScCompiler::GetRangeData( SCTAB& rSheet, const OUString& 
rUpperName ) const
 {
-// IsNamedRange is called only from NextNewToken, with an upper-case string
-
 // try local names first
-sal_Int16 nSheet = aPos.Tab();
-ScRangeName* pRangeName = rDoc.GetRangeName(nSheet);
+rSheet = aPos.Tab();
+const ScRangeName* pRangeName = rDoc.GetRangeName(rSheet);
 const ScRangeData* pData = nullptr;
 if (pRangeName)
 pData = pRangeName->findByUpperName(rUpperName);
@@ -3522,9 +3537,17 @@ bool ScCompiler::IsNamedRange( const OUString& 
rUpperName )
 if (pRangeName)
 pData = pRangeName->findByUpperName(rUpperName);
 if (pData)
-nSheet = -1;
+rSheet = -1;
 }
+return pData;
+}
+
+bool ScCompiler::IsNamedRange( const OUString& rUpperName )
+{
+// IsNamedRange is called only from NextNewToken, with an upper-case string
 
+SCTAB nSheet = -1;
+const ScRangeData* pData = GetRangeData( nSheet, rUpperName);
 if (pData)
 {
 maRawToken.SetName( nSheet, pData->GetIndex());
@@ -3535,7 +3558,7 @@ bool ScCompiler::IsNamedRange( const OUString& rUpperName 
)
 if (mnCurrentSheetEndPos > 0 && mnCurrentSheetTab >= 0)
 {
 OUString aName( rUpperName.copy( mnCurrentSheetEndPos));
-pRangeName = rDoc.GetRangeName( mnCurrentSheetTab);
+const ScRangeName* pRangeName = rDoc.GetRangeName( mnCurrentSheetTab);
 if (pRangeName)
 {
 pData = pRangeName->findByUpperName(aName);


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

2021-08-11 Thread Eike Rathke (via logerrit)
 sc/inc/compiler.hxx  |1 +
 sc/source/core/tool/compiler.cxx |   37 ++---
 2 files changed, 31 insertions(+), 7 deletions(-)

New commits:
commit b37fd7f38165dadc5b1a674b73f4b18824e4789e
Author: Eike Rathke 
AuthorDate: Wed Aug 11 20:03:36 2021 +0200
Commit: Eike Rathke 
CommitDate: Wed Aug 11 22:20:57 2021 +0200

Resolves: tdf#143809 "INF" may be a named expression or DB area name

... to not be caught by rtl::math::stringToDouble() handling
XMLSchema-2 "INF" and "NaN" and set as error.

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

diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 8ae65a4eb8b3..be4c4cadcb1a 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -363,6 +363,7 @@ private:
 bool IsColRowName( const OUString& );
 bool IsBoolean( const OUString& );
 void AutoCorrectParsedSymbol();
+const ScRangeData* GetRangeData( SCTAB& rSheet, const OUString& rUpperName 
) const;
 
 void AdjustSheetLocalNameRelReferences( SCTAB nDelta );
 void SetRelNameReference();
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index d6ae770e5c91..434bd157bd4c 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -3126,7 +3126,24 @@ bool ScCompiler::IsValue( const OUString& rSym )
 return false;
 }
 if (eStatus == rtl_math_ConversionStatus_OutOfRange)
+{
+// rtl::math::stringToDouble() recognizes XMLSchema-2 "INF" and
+// "NaN" (case sensitive) that could be named expressions or DB
+// areas as well.
+// rSym is already upper so "NaN" is not possible here.
+if (!std::isfinite(fVal) && rSym == "INF")
+{
+SCTAB nSheet = -1;
+if (GetRangeData( nSheet, rSym))
+return false;
+if 
(rDoc.GetDBCollection()->getNamedDBs().findByUpperName(rSym))
+return false;
+}
+/* TODO: is there a specific reason why we don't accept an infinity
+ * value that would raise an error in the interpreter, instead of
+ * setting the hard error at the token array already? */
 SetError( FormulaError::IllegalArgument );
+}
 maRawToken.SetDouble( fVal );
 return true;
 }
@@ -3544,13 +3561,11 @@ bool ScCompiler::IsMacro( const OUString& rName )
 #endif
 }
 
-bool ScCompiler::IsNamedRange( const OUString& rUpperName )
+const ScRangeData* ScCompiler::GetRangeData( SCTAB& rSheet, const OUString& 
rUpperName ) const
 {
-// IsNamedRange is called only from NextNewToken, with an upper-case string
-
 // try local names first
-sal_Int16 nSheet = aPos.Tab();
-ScRangeName* pRangeName = rDoc.GetRangeName(nSheet);
+rSheet = aPos.Tab();
+const ScRangeName* pRangeName = rDoc.GetRangeName(rSheet);
 const ScRangeData* pData = nullptr;
 if (pRangeName)
 pData = pRangeName->findByUpperName(rUpperName);
@@ -3560,9 +3575,17 @@ bool ScCompiler::IsNamedRange( const OUString& 
rUpperName )
 if (pRangeName)
 pData = pRangeName->findByUpperName(rUpperName);
 if (pData)
-nSheet = -1;
+rSheet = -1;
 }
+return pData;
+}
+
+bool ScCompiler::IsNamedRange( const OUString& rUpperName )
+{
+// IsNamedRange is called only from NextNewToken, with an upper-case string
 
+SCTAB nSheet = -1;
+const ScRangeData* pData = GetRangeData( nSheet, rUpperName);
 if (pData)
 {
 maRawToken.SetName( nSheet, pData->GetIndex());
@@ -3573,7 +3596,7 @@ bool ScCompiler::IsNamedRange( const OUString& rUpperName 
)
 if (mnCurrentSheetEndPos > 0 && mnCurrentSheetTab >= 0)
 {
 OUString aName( rUpperName.copy( mnCurrentSheetEndPos));
-pRangeName = rDoc.GetRangeName( mnCurrentSheetTab);
+const ScRangeName* pRangeName = rDoc.GetRangeName( mnCurrentSheetTab);
 if (pRangeName)
 {
 pData = pRangeName->findByUpperName(aName);


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

2021-08-10 Thread Eike Rathke (via logerrit)
 basic/source/sbx/sbxscan.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit e89404f00b25cfddd4098b4b2cf900d190617221
Author: Eike Rathke 
AuthorDate: Wed Aug 11 01:16:16 2021 +0200
Commit: Eike Rathke 
CommitDate: Wed Aug 11 02:34:36 2021 +0200

There is no LANGUAGE_ENGLISH {en} locale but LANGUAGE_ENGLISH_US {en-US}

The known fallback locale is en-US so this worked by chance..

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

diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index a632a689a42f..08f43ab475fa 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -720,7 +720,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt 
) const
 else
 {
 aFmtStr = OUString::createFromAscii(pInfo->mpOOoFormat);
-pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, nType, 
nIndex, LANGUAGE_ENGLISH, eLangType, true);
+pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, nType, 
nIndex, LANGUAGE_ENGLISH_US, eLangType, true);
 }
 pFormatter->GetOutputString( nNumber, nIndex, rRes,  );
 }
@@ -737,7 +737,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt 
) const
 if( floor( nNumber ) != nNumber )
 {
 aFmtStr = "H:MM:SS AM/PM";
-pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, 
nType, nIndex, LANGUAGE_ENGLISH, eLangType, true);
+pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, 
nType, nIndex, LANGUAGE_ENGLISH_US, eLangType, true);
 OUString aTime;
 pFormatter->GetOutputString( nNumber, nIndex, aTime, 
 );
 rRes += " " + aTime;
@@ -747,7 +747,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt 
) const
 {
 // long time only
 aFmtStr = "H:MM:SS AM/PM";
-pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, nType, 
nIndex, LANGUAGE_ENGLISH, eLangType, true);
+pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, nType, 
nIndex, LANGUAGE_ENGLISH_US, eLangType, true);
 pFormatter->GetOutputString( nNumber, nIndex, rRes,  
);
 }
 }
@@ -783,7 +783,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt 
) const
 }
 else
 {
-pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, nType, 
nIndex, LANGUAGE_ENGLISH, eLangType, true);
+pFormatter->PutandConvertEntry( aFmtStr, nCheckPos, nType, 
nIndex, LANGUAGE_ENGLISH_US, eLangType, true);
 pFormatter->GetOutputString( nNumber, nIndex, rRes,  );
 }
 


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

2021-08-09 Thread Eike Rathke (via logerrit)
 svl/source/numbers/zformat.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1db5e59aa2fcccb070388c2b817737caa17ed4f0
Author: Eike Rathke 
AuthorDate: Sun Aug 8 15:42:19 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 9 17:48:58 2021 +0200

Year without leading 0 if era code is also used

 GG or GG 
shall display 1 BC not 0001 BC, or AD 1 not AD 0001

Change-Id: I1955f55d37a4af5075c9cfc20c3ea200ba340765
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120174
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 5e69c5fbdb44cd782080e7f4d9ad89dc48b2d1b1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120133
Reviewed-by: Mike Kaganski 
Reviewed-by: Xisco Fauli 

diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index d14bf73841ee..255bfb09b5f7 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -3834,7 +3834,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber,
 sBuff.append('-');
 }
 aStr = rCal.getDisplayString( CalendarDisplayCode::LONG_YEAR, 
nNatNum );
-if (aStr.getLength() < 4)
+if (aStr.getLength() < 4 && !lcl_hasEra(NumFor[nIx]))
 {
 using namespace comphelper::string;
 // Ensure that year consists of at least 4 digits, so it
@@ -4199,7 +4199,7 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
 sBuff.append('-');
 }
 aYear = rCal.getDisplayString( CalendarDisplayCode::LONG_YEAR, 
nNatNum );
-if (aYear.getLength() < 4)
+if (aYear.getLength() < 4 && !lcl_hasEra(NumFor[nIx]))
 {
 using namespace comphelper::string;
 // Ensure that year consists of at least 4 digits, so it


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

2021-08-08 Thread Eike Rathke (via logerrit)
 sc/inc/document.hxx|1 +
 sc/source/core/data/documen3.cxx   |8 
 sc/source/core/data/table6.cxx |   11 +--
 sc/source/ui/dialogs/searchresults.cxx |   25 -
 sc/source/ui/inc/searchresults.hxx |2 +-
 sc/source/ui/view/viewfun2.cxx |   13 +++--
 6 files changed, 42 insertions(+), 18 deletions(-)

New commits:
commit 1c5b3cb3dd4dab6b0db409b6cc75b303820f
Author: Eike Rathke 
AuthorDate: Mon Aug 9 01:04:56 2021 +0200
Commit: Eike Rathke 
CommitDate: Mon Aug 9 02:24:54 2021 +0200

Related: tdf#143759 Display results of find empty or replace to empty

Searching for empty cells or replacing to empty cells didn't list
the results because ScCellIterator iterates over cells with
content only.

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

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 0706cd2b4a07..2038e9d59725 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1862,6 +1862,7 @@ public:
SCCOL& rCol, SCROW& rRow, SCTAB& 
rTab,
const ScMarkData& rMark, 
ScRangeList& rMatchedRanges,
OUString& rUndoStr, ScDocument* 
pUndoDoc = nullptr );
+static bool  IsEmptyCellSearch( const SvxSearchItem& rSearchItem );
 
 // determine Col/Row of subsequent calls
 // (e.g. not found from the beginning, or subsequent 
tables)
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 8d6f6a2baadf..6ab51853 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1297,6 +1297,14 @@ void ScDocument::GetSearchAndReplaceStart( const 
SvxSearchItem& rSearchItem,
 }
 }
 
+// static
+bool ScDocument::IsEmptyCellSearch( const SvxSearchItem& rSearchItem )
+{
+return !rSearchItem.GetPattern() && (rSearchItem.GetCellType() != 
SvxSearchCellType::NOTE)
+&& (rSearchItem.GetSearchOptions().searchString.isEmpty()
+|| (rSearchItem.GetRegExp() && 
rSearchItem.GetSearchOptions().searchString == "^$"));
+}
+
 bool ScDocument::SearchAndReplace(
 const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, SCTAB& rTab,
 const ScMarkData& rMark, ScRangeList& rMatchedRanges,
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index fca6dea1c61b..6b3321d2440c 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -817,18 +817,17 @@ bool ScTable::SearchAndReplace(
 else if (nCommand == SvxSearchCmd::REPLACE_ALL)
 bFound = ReplaceAllStyle(rSearchItem, rMark, rMatchedRanges, 
pUndoDoc);
 }
+else if (ScDocument::IsEmptyCellSearch( rSearchItem))
+{
+// Search for empty cells.
+bFound = SearchAndReplaceEmptyCells(rSearchItem, rCol, rRow, 
rMark, rMatchedRanges, rUndoStr, pUndoDoc);
+}
 else
 {
 //  SearchParam no longer needed - SearchOptions contains all 
settings
 i18nutil::SearchOptions2 aSearchOptions = 
rSearchItem.GetSearchOptions();
 aSearchOptions.Locale = *ScGlobal::GetLocale();
 
-if (aSearchOptions.searchString.isEmpty() || ( 
rSearchItem.GetRegExp() && aSearchOptions.searchString == "^$" ) )
-{
-// Search for empty cells.
-return SearchAndReplaceEmptyCells(rSearchItem, rCol, rRow, 
rMark, rMatchedRanges, rUndoStr, pUndoDoc);
-}
-
 //  reflect UseAsianOptions flag in SearchOptions
 //  (use only ignore case and width if asian options are disabled).
 //  This is also done in SvxSearchDialog CommandHdl, but not in 
API object.
diff --git a/sc/source/ui/dialogs/searchresults.cxx 
b/sc/source/ui/dialogs/searchresults.cxx
index c9558c5376f3..db9dae68bfc8 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -92,7 +92,8 @@ namespace
 };
 }
 
-void SearchResultsDlg::FillResults( ScDocument& rDoc, const ScRangeList 
, bool bCellNotes )
+void SearchResultsDlg::FillResults( ScDocument& rDoc, const ScRangeList 
, bool bCellNotes,
+bool bEmptyCells )
 {
 ListWrapper aList(*mxList);
 std::vector aTabNames = rDoc.GetAllTableNames();
@@ -103,13 +104,10 @@ void SearchResultsDlg::FillResults( ScDocument& rDoc, 
const ScRangeList 
 if (nMatchMax > ListWrapper::mnMaximum)
 nMatchMax = ListWrapper::mnMaximum;
 
-if (bCellNotes)
+if (bCellNotes || bEmptyCells)
 {
 for (size_t i = 0, n = nMatc

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

2021-08-08 Thread Eike Rathke (via logerrit)
 sc/source/core/data/table6.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit f20c91fe2c997bd5966c902ee28f95531435ec26
Author: Eike Rathke 
AuthorDate: Sun Aug 8 18:39:39 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Aug 8 22:50:31 2021 +0200

Resolves: tdf#143759 Limit empty search's empty column to actual search 
range

... instead of the non-/filtered last row.

Change-Id: I9b941af688a8083d472a793a6bc6b6dbb7b916ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120176
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 15960931988cfd898e14a12d6b9cddaf6d8b0ade)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120135
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index b52247f35e14..fca6dea1c61b 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -1081,10 +1081,14 @@ bool ScTable::SearchRangeForAllEmptyCells(
 if (aCol[nCol].IsEmptyData())
 {
 // The entire column is empty.
-for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); 
++nRow)
+const SCROW nEndRow = rRange.aEnd.Row();
+for (SCROW nRow = rRange.aStart.Row(); nRow <= nEndRow; ++nRow)
 {
 SCROW nLastRow;
-if (!RowFiltered(nRow, nullptr, ))
+const bool bFiltered = RowFiltered(nRow, nullptr, );
+if (nLastRow > nEndRow)
+nLastRow = nEndRow;
+if (!bFiltered)
 {
 rMatchedRanges.Join(ScRange(nCol, nRow, nTab, nCol, 
nLastRow, nTab));
 if (bReplace)


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

2021-08-08 Thread Eike Rathke (via logerrit)
 sc/source/core/data/table6.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit b8fc2696e72f8941ad8032d8534a983a81e98a9b
Author: Eike Rathke 
AuthorDate: Sun Aug 8 18:39:39 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Aug 8 22:49:43 2021 +0200

Resolves: tdf#143759 Limit empty search's empty column to actual search 
range

... instead of the non-/filtered last row.

Change-Id: I9b941af688a8083d472a793a6bc6b6dbb7b916ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120176
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 15960931988cfd898e14a12d6b9cddaf6d8b0ade)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120134
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index b52247f35e14..fca6dea1c61b 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -1081,10 +1081,14 @@ bool ScTable::SearchRangeForAllEmptyCells(
 if (aCol[nCol].IsEmptyData())
 {
 // The entire column is empty.
-for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); 
++nRow)
+const SCROW nEndRow = rRange.aEnd.Row();
+for (SCROW nRow = rRange.aStart.Row(); nRow <= nEndRow; ++nRow)
 {
 SCROW nLastRow;
-if (!RowFiltered(nRow, nullptr, ))
+const bool bFiltered = RowFiltered(nRow, nullptr, );
+if (nLastRow > nEndRow)
+nLastRow = nEndRow;
+if (!bFiltered)
 {
 rMatchedRanges.Join(ScRange(nCol, nRow, nTab, nCol, 
nLastRow, nTab));
 if (bReplace)


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

2021-08-08 Thread Eike Rathke (via logerrit)
 sc/source/core/data/table6.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 15960931988cfd898e14a12d6b9cddaf6d8b0ade
Author: Eike Rathke 
AuthorDate: Sun Aug 8 18:39:39 2021 +0200
Commit: Eike Rathke 
CommitDate: Sun Aug 8 19:38:22 2021 +0200

Resolves: tdf#143759 Limit empty search's empty column to actual search 
range

... instead of the non-/filtered last row.

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

diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index b52247f35e14..fca6dea1c61b 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -1081,10 +1081,14 @@ bool ScTable::SearchRangeForAllEmptyCells(
 if (aCol[nCol].IsEmptyData())
 {
 // The entire column is empty.
-for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); 
++nRow)
+const SCROW nEndRow = rRange.aEnd.Row();
+for (SCROW nRow = rRange.aStart.Row(); nRow <= nEndRow; ++nRow)
 {
 SCROW nLastRow;
-if (!RowFiltered(nRow, nullptr, ))
+const bool bFiltered = RowFiltered(nRow, nullptr, );
+if (nLastRow > nEndRow)
+nLastRow = nEndRow;
+if (!bFiltered)
 {
 rMatchedRanges.Join(ScRange(nCol, nRow, nTab, nCol, 
nLastRow, nTab));
 if (bReplace)


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

2021-08-08 Thread Eike Rathke (via logerrit)
 svl/source/numbers/zformat.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5e69c5fbdb44cd782080e7f4d9ad89dc48b2d1b1
Author: Eike Rathke 
AuthorDate: Sun Aug 8 15:42:19 2021 +0200
Commit: Eike Rathke 
CommitDate: Sun Aug 8 16:44:25 2021 +0200

Year without leading 0 if era code is also used

 GG or GG 
shall display 1 BC not 0001 BC, or AD 1 not AD 0001

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

diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 6cedc976c74c..6b68e79f1517 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -3835,7 +3835,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber,
 sBuff.append('-');
 }
 aStr = rCal.getDisplayString( CalendarDisplayCode::LONG_YEAR, 
nNatNum );
-if (aStr.getLength() < 4)
+if (aStr.getLength() < 4 && !lcl_hasEra(NumFor[nIx]))
 {
 using namespace comphelper::string;
 // Ensure that year consists of at least 4 digits, so it
@@ -4200,7 +4200,7 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
 sBuff.append('-');
 }
 aYear = rCal.getDisplayString( CalendarDisplayCode::LONG_YEAR, 
nNatNum );
-if (aYear.getLength() < 4)
+if (aYear.getLength() < 4 && !lcl_hasEra(NumFor[nIx]))
 {
 using namespace comphelper::string;
 // Ensure that year consists of at least 4 digits, so it


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

2021-08-07 Thread Eike Rathke (via logerrit)
 solenv/bin/modules/installer/worker.pm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 51406e88a93008458cf4a7d4f84aa0b169cb7d0b
Author: Eike Rathke 
AuthorDate: Sat Aug 7 18:16:59 2021 +0200
Commit: Eike Rathke 
CommitDate: Sat Aug 7 19:43:14 2021 +0200

Create destination directory also for non-empty sourcepath directory

Do not attempt to copy anything. This can happen with
instdir/share/extensions being populated from some build (e.g. by
dictionaries) but no extension to be installed.

The result was
ERROR: Can't copy file: /build/core/instdir/share/extensions -> 
/build/usr/opt/core/lib/libreoffice/share/extensions
Is a directory at /build/core/solenv/bin/modules/installer/worker.pm line 
350.

and the copy() created the destination as 0-length file instead.

The recent changes not copying extensions/packages.txt anymore and
related may have triggered this:

6c487d2d7e8aa5cdef55cbd7bc78058184671d82 Fix and simplify "any bundled 
extensions installed" check
626050e86b7d5ca0c3bfc265cc33ce8e9d1bf195 gb_Package_Package must specify a 
directory
f267340d300da6318435ed1b2ae48b9f4275e2c4 Remove unused 
$(LIBO_SHARE_FOLDER)/extensions/package.txt

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

diff --git a/solenv/bin/modules/installer/worker.pm 
b/solenv/bin/modules/installer/worker.pm
index dcdfdce7d28e..8da6b14ba7fe 100644
--- a/solenv/bin/modules/installer/worker.pm
+++ b/solenv/bin/modules/installer/worker.pm
@@ -343,7 +343,7 @@ sub install_simple ($$)
 if ( -l "$sourcepath" ) {
 symlink (readlink ("$sourcepath"), "$destdir$destination") || die 
"Can't symlink $destdir$destination -> " . readlink ("$sourcepath") . "$!";
 }
-elsif ( -d $sourcepath && 
installer::systemactions::is_empty_dir($sourcepath) ) {
+elsif ( -d $sourcepath ) {
 `mkdir -p "$destdir$destination"`;
 }
 else {


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

2021-08-06 Thread Eike Rathke (via logerrit)
 i18nlangtag/qa/cppunit/test_languagetag.cxx|   10 ++--
 i18nlangtag/source/isolang/isolang.cxx |   54 +
 i18nlangtag/source/isolang/mslangid.cxx|4 +
 i18nlangtag/source/languagetag/languagetag.cxx |2 
 include/i18nlangtag/lang.h |   22 +-
 svtools/inc/langtab.hrc|2 
 6 files changed, 52 insertions(+), 42 deletions(-)

New commits:
commit 46131c5f8238bc3dca9a8d4eb097ad07f2d46fe0
Author: Eike Rathke 
AuthorDate: Fri Aug 6 21:29:48 2021 +0200
Commit: Eike Rathke 
CommitDate: Fri Aug 6 23:44:49 2021 +0200

Adapt LCIDs and language tags to [MS-LCID] rev.15

See

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f

https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-LCID/%5bMS-LCID%5d-210625.pdf

and

commit 402dab839b2e451dec81bfb83dadbe0d5a231db2
CommitDate: Wed Aug 4 21:21:51 2021 +0200

update list of [MS-LCID] from 6/25/2021 15.0 rev.

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

diff --git a/i18nlangtag/qa/cppunit/test_languagetag.cxx 
b/i18nlangtag/qa/cppunit/test_languagetag.cxx
index 4fcc05785f2e..c3dfb151e14e 100644
--- a/i18nlangtag/qa/cppunit/test_languagetag.cxx
+++ b/i18nlangtag/qa/cppunit/test_languagetag.cxx
@@ -683,7 +683,8 @@ void TestLanguageTag::testAllTags()
 
 bool checkMapping( std::u16string_view rStr1, std::u16string_view rStr2 )
 {
-if (rStr1 == u"la-Latn" ) return rStr2 == u"la";
+if (rStr1 == u"la"  ) return rStr2 == u"la-VA";
+if (rStr1 == u"la-Latn" ) return rStr2 == u"la-VA";
 if (rStr1 == u"tzm-Latn-DZ" ) return rStr2 == u"kab-DZ";
 if (rStr1 == u"bs-Latn-BA"  ) return rStr2 == u"bs-BA";
 if (rStr1 == u"bs-Latn" ) return rStr2 == u"bs";
@@ -705,7 +706,8 @@ bool checkMapping( std::u16string_view rStr1, 
std::u16string_view rStr2 )
 if (rStr1 == u"ven-ZA"  ) return rStr2 == u"ve-ZA";
 if (rStr1 == u"qu-EC"   ) return rStr2 == u"quz-EC";
 if (rStr1 == u"qu-PE"   ) return rStr2 == u"quz-PE";
-if (rStr1 == u"ff-NG"   ) return rStr2 == u"fuv-NG";
+if (rStr1 == u"ff-Latn-NG"  ) return rStr2 == u"ff-NG";
+if (rStr1 == u"fuv-NG"  ) return rStr2 == u"ff-NG";
 if (rStr1 == u"ji-IL"   ) return rStr2 == u"yi-IL";
 if (rStr1 == u"iu-CA"   ) return rStr2 == u"iu-Latn-CA";
 if (rStr1 == u"iu"  ) return rStr2 == u"iu-Latn";
@@ -716,6 +718,7 @@ bool checkMapping( std::u16string_view rStr1, 
std::u16string_view rStr2 )
 if (rStr1 == u"mg-MG"   ) return rStr2 == u"plt-MG";
 if (rStr1 == u"pli" ) return rStr2 == u"pi-Latn";
 if (rStr1 == u"ks"  ) return rStr2 == u"ks-Arab";
+if (rStr1 == u"ks-IN"   ) return rStr2 == u"ks-Deva-IN";
 if (rStr1 == u"chr-US"  ) return rStr2 == u"chr-Cher-US";
 if (rStr1 == u"sd-PK"   ) return rStr2 == u"sd-Arab-PK";
 if (rStr1 == u"sr-Cyrl-RS"  ) return rStr2 == u"sr-RS";
@@ -760,8 +763,7 @@ void TestLanguageTag::testAllIsoLangEntries()
 LanguageTag aTagID( elem.mnLang);
 if (!checkMapping( elem.maBcp47, aTagString.getBcp47()))
 {
-OString aMessage( OUStringToOString( elem.maBcp47, 
RTL_TEXTENCODING_ASCII_US) + " -> " + OUStringToOString( aTagString.getBcp47(), 
RTL_TEXTENCODING_ASCII_US) );
-CPPUNIT_ASSERT_EQUAL_MESSAGE( aMessage.getStr(), 
aTagString.getBcp47(), elem.maBcp47 );
+CPPUNIT_ASSERT_EQUAL_MESSAGE( "defined elem to tag", elem.maBcp47, 
aTagString.getBcp47() );
 }
 if (elem.maBcp47 != aTagID.getBcp47())
 {
diff --git a/i18nlangtag/source/isolang/isolang.cxx 
b/i18nlangtag/source/isolang/isolang.cxx
index 941a73b25766..cb1d5956d6ea 100644
--- a/i18nlangtag/source/isolang/isolang.cxx
+++ b/i18nlangtag/source/isolang/isolang.cxx
@@ -251,7 +251,7 @@ IsoLanguageCountryEntry const aImplIsoLangEntries[] =
 { LANGUAGE_ENGLISH_BELIZE,  "en", "BZ", k0},
 { LANGUAGE_ENGLISH_TRINIDAD,"en", "TT", k0},
 { LANGUAGE_ENGLISH_ZIMBABWE,"en", "ZW", k0},
-{ LANGUAGE_ENGLISH_INDONESIA,   "en", "ID", k0},
+{ 

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

2021-08-04 Thread Eike Rathke (via logerrit)
 svl/source/numbers/zforfind.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit c23422c0f320df8ef27dbe3ba0a4ac5ead47d6a8
Author: Eike Rathke 
AuthorDate: Mon Aug 2 22:11:29 2021 +0200
Commit: Caolán McNamara 
CommitDate: Wed Aug 4 12:37:24 2021 +0200

Resolves: tdf#143664 {de-*} accept "Mär" and "Mrz" for March

Change-Id: I82c094687137995a634450cb4f617909859d1688
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119916
    Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 4961dbaecc9e5cac57d99d2ea9d265a90daa4a8b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119859
Reviewed-by: Caolán McNamara 

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 87c64df62c2a..191a388581ea 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -649,9 +649,25 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 res = sal::static_int_cast< short >(-(i+1)); // negative
 break;  // for
 }
+else if (i == 2 && pFormatter->GetLanguageTag().getLanguage() == 
"de")
+{
+if (pUpperAbbrevMonthText[i] == u"M\u00C4R" && 
StringContainsWord( "MRZ", rString, nPos))
+{   // Accept MRZ for MÄR
+nPos = nPos + 3;
+res = sal::static_int_cast< short >(-(i+1)); // negative
+break;  // for
+}
+else if (pUpperAbbrevMonthText[i] == "MRZ" && 
StringContainsWord( u"M\u00C4R", rString, nPos))
+{   // And vice versa, accept MÄR for MRZ
+nPos = nPos + 3;
+res = sal::static_int_cast< short >(-(i+1)); // negative
+break;  // for
+}
+}
 else if (i == 8)
 {
 // This assumes the weirdness is applicable to all locales.
+// It is the case for at least en-* and de-* locales.
 if (pUpperAbbrevMonthText[i] == "SEPT" && StringContainsWord( 
"SEP", rString, nPos))
 {   // #102136# The correct English form of month September 
abbreviated is
 // SEPT, but almost every data contains SEP instead.


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

2021-08-04 Thread Eike Rathke (via logerrit)
 i18npool/source/localedata/data/de_DE.xml |2 +-
 i18npool/source/localedata/data/de_LU.xml |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e927071730668b37f1721b65721a0e5308e88b00
Author: Eike Rathke 
AuthorDate: Mon Aug 2 22:16:44 2021 +0200
Commit: Caolán McNamara 
CommitDate: Wed Aug 4 12:35:05 2021 +0200

Related: tdf#143664 Change {de-*} March "Mrz" to "Mär"

Change-Id: Id4a4ebe432bf5badae96eadb723336648d2ce690
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119917
    Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 400a44f9ac7792ffe3665f70507324e4a64dca2b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119858
Reviewed-by: Caolán McNamara 

diff --git a/i18npool/source/localedata/data/de_DE.xml 
b/i18npool/source/localedata/data/de_DE.xml
index 6eb8307d3c13..95f07a1e14ed 100644
--- a/i18npool/source/localedata/data/de_DE.xml
+++ b/i18npool/source/localedata/data/de_DE.xml
@@ -266,7 +266,7 @@
 
 
   mar
-  Mrz
+  Mär
   März
 
 
diff --git a/i18npool/source/localedata/data/de_LU.xml 
b/i18npool/source/localedata/data/de_LU.xml
index 3dcf21c6b616..00e5a7980e3d 100644
--- a/i18npool/source/localedata/data/de_LU.xml
+++ b/i18npool/source/localedata/data/de_LU.xml
@@ -254,7 +254,7 @@
 
 
   mar
-  Mrz
+  Mär
   März
 
 


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

2021-08-04 Thread Eike Rathke (via logerrit)
 svl/source/numbers/zforfind.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit 5dd4c279a6bb6f297f1c02f2aeb905a81e5fa80d
Author: Eike Rathke 
AuthorDate: Mon Aug 2 22:11:29 2021 +0200
Commit: Caolán McNamara 
CommitDate: Wed Aug 4 12:34:31 2021 +0200

Resolves: tdf#143664 {de-*} accept "Mär" and "Mrz" for March

Change-Id: I82c094687137995a634450cb4f617909859d1688
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119916
    Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 4961dbaecc9e5cac57d99d2ea9d265a90daa4a8b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119857
Reviewed-by: Caolán McNamara 

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 8b01debbb1d4..121b9bd406f6 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -649,9 +649,25 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 res = sal::static_int_cast< short >(-(i+1)); // negative
 break;  // for
 }
+else if (i == 2 && pFormatter->GetLanguageTag().getLanguage() == 
"de")
+{
+if (pUpperAbbrevMonthText[i] == u"M\u00C4R" && 
StringContainsWord( "MRZ", rString, nPos))
+{   // Accept MRZ for MÄR
+nPos = nPos + 3;
+res = sal::static_int_cast< short >(-(i+1)); // negative
+break;  // for
+}
+else if (pUpperAbbrevMonthText[i] == "MRZ" && 
StringContainsWord( u"M\u00C4R", rString, nPos))
+{   // And vice versa, accept MÄR for MRZ
+nPos = nPos + 3;
+res = sal::static_int_cast< short >(-(i+1)); // negative
+break;  // for
+}
+}
 else if (i == 8)
 {
 // This assumes the weirdness is applicable to all locales.
+// It is the case for at least en-* and de-* locales.
 if (pUpperAbbrevMonthText[i] == "SEPT" && StringContainsWord( 
"SEP", rString, nPos))
 {   // #102136# The correct English form of month September 
abbreviated is
 // SEPT, but almost every data contains SEP instead.


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

2021-08-03 Thread Eike Rathke (via logerrit)
 sc/source/filter/oox/excelfilter.cxx |8 ++-
 sc/source/filter/xml/xmlimprt.cxx|3 +
 sc/source/ui/docshell/arealink.cxx   |3 +
 sc/source/ui/docshell/docsh.cxx  |   25 +
 sc/source/ui/docshell/docsh4.cxx |   90 +--
 sc/source/ui/inc/docsh.hxx   |1 
 6 files changed, 71 insertions(+), 59 deletions(-)

New commits:
commit 1663fd0f85a523bfbd46e836436e979344f009d3
Author: Eike Rathke 
AuthorDate: Sun Aug 1 21:40:15 2021 +0200
Commit: Caolán McNamara 
CommitDate: Tue Aug 3 12:40:30 2021 +0200

Consolidate link update handling

Have it at one central place and identical for all document
loading paths.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119835
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 55abc3eb93fb8314b413453e384261cb00fde087)

 Conflicts:
sc/source/ui/docshell/docsh4.cxx

Change-Id: Ib00153a9f5831e223d0129df0538353a7e20961e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119852
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/filter/oox/excelfilter.cxx 
b/sc/source/filter/oox/excelfilter.cxx
index b5d01215baf8..e5815200e063 100644
--- a/sc/source/filter/oox/excelfilter.cxx
+++ b/sc/source/filter/oox/excelfilter.cxx
@@ -109,14 +109,18 @@ bool ExcelFilter::importDocument()
 if (xBookGlob)
 {
 rtl::Reference xWorkbookFragment( new 
WorkbookFragment(*xBookGlob, aWorkbookPath));
+
+const WorkbookFragment* pWF = static_cast(xWorkbookFragment.get());
+const ScDocument& rDoc = pWF->getScDocument();
+if (ScDocShell* pDocSh = 
static_cast(rDoc.GetDocumentShell()))
+pDocSh->SetInitialLinkUpdate( pDocSh->GetMedium());
+
 bool bRet = importFragment( xWorkbookFragment);
 if (bRet)
 {
-const WorkbookFragment* pWF = static_cast(xWorkbookFragment.get());
 const AddressConverter& rAC = pWF->getAddressConverter();
 if (rAC.isTabOverflow() || rAC.isColOverflow() || 
rAC.isRowOverflow())
 {
-const ScDocument& rDoc = pWF->getScDocument();
 if (rDoc.IsUserInteractionEnabled())
 {
 // Show data loss warning.
diff --git a/sc/source/filter/xml/xmlimprt.cxx 
b/sc/source/filter/xml/xmlimprt.cxx
index 968ebb0cdbfe..99d33d2416db 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1138,6 +1138,9 @@ void SAL_CALL ScXMLImport::setTargetDocument( const 
css::uno::Reference< css::la
 if (!pDoc)
 throw lang::IllegalArgumentException();
 
+if (ScDocShell* pDocSh = 
static_cast(pDoc->GetDocumentShell()))
+pDocSh->SetInitialLinkUpdate( pDocSh->GetMedium());
+
 mpDocImport.reset(new ScDocumentImport(*pDoc));
 mpComp.reset(new ScCompiler(*pDoc, ScAddress(), 
formula::FormulaGrammar::GRAM_ODFF));
 
diff --git a/sc/source/ui/docshell/arealink.cxx 
b/sc/source/ui/docshell/arealink.cxx
index 2b66e13e2327..e44e364c461a 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -226,6 +226,9 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const 
OUString& rNewFilter,
 if (rNewFile.isEmpty() || rNewFilter.isEmpty())
 return false;
 
+if (!m_pDocSh->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate())
+return false;
+
 OUString aNewUrl( ScGlobal::GetAbsDocName( rNewFile, m_pDocSh ) );
 bool bNewUrlName = (aNewUrl != aFileName);
 
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 29435d90a2f4..8e2c3c45218f 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -586,21 +586,7 @@ bool ScDocShell::Load( SfxMedium& rMedium )
 bool bRet = SfxObjectShell::Load(rMedium);
 if (bRet)
 {
-if (GetMedium())
-{
-const SfxUInt16Item* pUpdateDocItem = 
SfxItemSet::GetItem(rMedium.GetItemSet(), SID_UPDATEDOCMODE, 
false);
-m_nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : 
css::document::UpdateDocMode::NO_UPDATE;
-}
-
-// GetLinkUpdateModeState() evaluates m_nCanUpdate so that must have
-// been set first. Do not override an already forbidden LinkUpdate (the
-// default is allow).
-comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = 
getEmbeddedObjectContainer();
-if (rEmbeddedObjectContainer.getUserAllowsLinkUpdate())
-{
-// For anything else than LM_ALWAYS we need user confirmation.
-rEmbeddedObjectContainer.setUserAllowsLinkUpdate( 
GetLinkUpdateModeState() == LM_ALWAYS);
-}
+SetInitialLinkUpdate();
 
  

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

2021-08-03 Thread Eike Rathke (via logerrit)
 sc/source/filter/oox/excelfilter.cxx |8 ++-
 sc/source/filter/xml/xmlimprt.cxx|3 +
 sc/source/ui/docshell/arealink.cxx   |3 +
 sc/source/ui/docshell/docsh.cxx  |   25 +
 sc/source/ui/docshell/docsh4.cxx |   90 +--
 sc/source/ui/inc/docsh.hxx   |1 
 6 files changed, 71 insertions(+), 59 deletions(-)

New commits:
commit 75a88761b70a098e77c73a0ba716d0e78a6d4659
Author: Eike Rathke 
AuthorDate: Sun Aug 1 21:40:15 2021 +0200
Commit: Caolán McNamara 
CommitDate: Tue Aug 3 12:39:55 2021 +0200

Consolidate link update handling

Have it at one central place and identical for all document
loading paths.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119835
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 55abc3eb93fb8314b413453e384261cb00fde087)

 Conflicts:
sc/source/ui/docshell/docsh4.cxx

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

diff --git a/sc/source/filter/oox/excelfilter.cxx 
b/sc/source/filter/oox/excelfilter.cxx
index 4c59a0e9393b..b015f82500c2 100644
--- a/sc/source/filter/oox/excelfilter.cxx
+++ b/sc/source/filter/oox/excelfilter.cxx
@@ -109,14 +109,18 @@ bool ExcelFilter::importDocument()
 if (xBookGlob)
 {
 rtl::Reference xWorkbookFragment( new 
WorkbookFragment(*xBookGlob, aWorkbookPath));
+
+const WorkbookFragment* pWF = static_cast(xWorkbookFragment.get());
+const ScDocument& rDoc = pWF->getScDocument();
+if (ScDocShell* pDocSh = 
static_cast(rDoc.GetDocumentShell()))
+pDocSh->SetInitialLinkUpdate( pDocSh->GetMedium());
+
 bool bRet = importFragment( xWorkbookFragment);
 if (bRet)
 {
-const WorkbookFragment* pWF = static_cast(xWorkbookFragment.get());
 const AddressConverter& rAC = pWF->getAddressConverter();
 if (rAC.isTabOverflow() || rAC.isColOverflow() || 
rAC.isRowOverflow())
 {
-const ScDocument& rDoc = pWF->getScDocument();
 if (rDoc.IsUserInteractionEnabled())
 {
 // Show data loss warning.
diff --git a/sc/source/filter/xml/xmlimprt.cxx 
b/sc/source/filter/xml/xmlimprt.cxx
index e29112fab2b1..1fff4f1c3a32 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1308,6 +1308,9 @@ void SAL_CALL ScXMLImport::setTargetDocument( const 
css::uno::Reference< css::la
 if (!pDoc)
 throw lang::IllegalArgumentException();
 
+if (ScDocShell* pDocSh = 
static_cast(pDoc->GetDocumentShell()))
+pDocSh->SetInitialLinkUpdate( pDocSh->GetMedium());
+
 mpDocImport.reset(new ScDocumentImport(*pDoc));
 mpComp.reset(new ScCompiler(*pDoc, ScAddress(), 
formula::FormulaGrammar::GRAM_ODFF));
 
diff --git a/sc/source/ui/docshell/arealink.cxx 
b/sc/source/ui/docshell/arealink.cxx
index 2920ca6ad08d..0d3c51116b0b 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -227,6 +227,9 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const 
OUString& rNewFilter,
 if (rNewFile.isEmpty() || rNewFilter.isEmpty())
 return false;
 
+if (!m_pDocSh->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate())
+return false;
+
 OUString aNewUrl( ScGlobal::GetAbsDocName( rNewFile, m_pDocSh ) );
 bool bNewUrlName = (aNewUrl != aFileName);
 
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 91020db0b2e0..e588494e3055 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -583,21 +583,7 @@ bool ScDocShell::Load( SfxMedium& rMedium )
 bool bRet = SfxObjectShell::Load(rMedium);
 if (bRet)
 {
-if (GetMedium())
-{
-const SfxUInt16Item* pUpdateDocItem = 
SfxItemSet::GetItem(rMedium.GetItemSet(), SID_UPDATEDOCMODE, 
false);
-m_nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : 
css::document::UpdateDocMode::NO_UPDATE;
-}
-
-// GetLinkUpdateModeState() evaluates m_nCanUpdate so that must have
-// been set first. Do not override an already forbidden LinkUpdate (the
-// default is allow).
-comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = 
getEmbeddedObjectContainer();
-if (rEmbeddedObjectContainer.getUserAllowsLinkUpdate())
-{
-// For anything else than LM_ALWAYS we need user confirmation.
-rEmbeddedObjectContainer.setUserAllowsLinkUpdate( 
GetLinkUpdateModeState() == LM_ALWAYS);
-}
+SetInitialLinkUpdate();
 
 {
 //  prepare a valid d

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

2021-08-03 Thread Eike Rathke (via logerrit)
 sc/source/filter/oox/excelfilter.cxx |8 ++-
 sc/source/filter/xml/xmlimprt.cxx|3 +
 sc/source/ui/docshell/arealink.cxx   |3 +
 sc/source/ui/docshell/docsh.cxx  |   25 +
 sc/source/ui/docshell/docsh4.cxx |   90 +--
 sc/source/ui/inc/docsh.hxx   |1 
 6 files changed, 71 insertions(+), 59 deletions(-)

New commits:
commit b6cd39b8adf8148c20ccdfe49841431bd1b9c3a1
Author: Eike Rathke 
AuthorDate: Sun Aug 1 21:40:15 2021 +0200
Commit: Caolán McNamara 
CommitDate: Tue Aug 3 12:39:35 2021 +0200

Consolidate link update handling

Have it at one central place and identical for all document
loading paths.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119835
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 55abc3eb93fb8314b413453e384261cb00fde087)

 Conflicts:
sc/source/ui/docshell/docsh4.cxx

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

diff --git a/sc/source/filter/oox/excelfilter.cxx 
b/sc/source/filter/oox/excelfilter.cxx
index b5d01215baf8..e5815200e063 100644
--- a/sc/source/filter/oox/excelfilter.cxx
+++ b/sc/source/filter/oox/excelfilter.cxx
@@ -109,14 +109,18 @@ bool ExcelFilter::importDocument()
 if (xBookGlob)
 {
 rtl::Reference xWorkbookFragment( new 
WorkbookFragment(*xBookGlob, aWorkbookPath));
+
+const WorkbookFragment* pWF = static_cast(xWorkbookFragment.get());
+const ScDocument& rDoc = pWF->getScDocument();
+if (ScDocShell* pDocSh = 
static_cast(rDoc.GetDocumentShell()))
+pDocSh->SetInitialLinkUpdate( pDocSh->GetMedium());
+
 bool bRet = importFragment( xWorkbookFragment);
 if (bRet)
 {
-const WorkbookFragment* pWF = static_cast(xWorkbookFragment.get());
 const AddressConverter& rAC = pWF->getAddressConverter();
 if (rAC.isTabOverflow() || rAC.isColOverflow() || 
rAC.isRowOverflow())
 {
-const ScDocument& rDoc = pWF->getScDocument();
 if (rDoc.IsUserInteractionEnabled())
 {
 // Show data loss warning.
diff --git a/sc/source/filter/xml/xmlimprt.cxx 
b/sc/source/filter/xml/xmlimprt.cxx
index 968ebb0cdbfe..99d33d2416db 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1138,6 +1138,9 @@ void SAL_CALL ScXMLImport::setTargetDocument( const 
css::uno::Reference< css::la
 if (!pDoc)
 throw lang::IllegalArgumentException();
 
+if (ScDocShell* pDocSh = 
static_cast(pDoc->GetDocumentShell()))
+pDocSh->SetInitialLinkUpdate( pDocSh->GetMedium());
+
 mpDocImport.reset(new ScDocumentImport(*pDoc));
 mpComp.reset(new ScCompiler(*pDoc, ScAddress(), 
formula::FormulaGrammar::GRAM_ODFF));
 
diff --git a/sc/source/ui/docshell/arealink.cxx 
b/sc/source/ui/docshell/arealink.cxx
index 2b66e13e2327..e44e364c461a 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -226,6 +226,9 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const 
OUString& rNewFilter,
 if (rNewFile.isEmpty() || rNewFilter.isEmpty())
 return false;
 
+if (!m_pDocSh->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate())
+return false;
+
 OUString aNewUrl( ScGlobal::GetAbsDocName( rNewFile, m_pDocSh ) );
 bool bNewUrlName = (aNewUrl != aFileName);
 
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 29435d90a2f4..8e2c3c45218f 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -586,21 +586,7 @@ bool ScDocShell::Load( SfxMedium& rMedium )
 bool bRet = SfxObjectShell::Load(rMedium);
 if (bRet)
 {
-if (GetMedium())
-{
-const SfxUInt16Item* pUpdateDocItem = 
SfxItemSet::GetItem(rMedium.GetItemSet(), SID_UPDATEDOCMODE, 
false);
-m_nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : 
css::document::UpdateDocMode::NO_UPDATE;
-}
-
-// GetLinkUpdateModeState() evaluates m_nCanUpdate so that must have
-// been set first. Do not override an already forbidden LinkUpdate (the
-// default is allow).
-comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = 
getEmbeddedObjectContainer();
-if (rEmbeddedObjectContainer.getUserAllowsLinkUpdate())
-{
-// For anything else than LM_ALWAYS we need user confirmation.
-rEmbeddedObjectContainer.setUserAllowsLinkUpdate( 
GetLinkUpdateModeState() == LM_ALWAYS);
-}
+SetInitialLinkUpdate();
 
 {
 //  prepare a valid d

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

2021-08-02 Thread Eike Rathke (via logerrit)
 i18npool/source/localedata/data/de_DE.xml |2 +-
 i18npool/source/localedata/data/de_LU.xml |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 400a44f9ac7792ffe3665f70507324e4a64dca2b
Author: Eike Rathke 
AuthorDate: Mon Aug 2 22:16:44 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Aug 3 01:11:32 2021 +0200

Related: tdf#143664 Change {de-*} March "Mrz" to "Mär"

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

diff --git a/i18npool/source/localedata/data/de_DE.xml 
b/i18npool/source/localedata/data/de_DE.xml
index 6eb8307d3c13..95f07a1e14ed 100644
--- a/i18npool/source/localedata/data/de_DE.xml
+++ b/i18npool/source/localedata/data/de_DE.xml
@@ -266,7 +266,7 @@
 
 
   mar
-  Mrz
+  Mär
   März
 
 
diff --git a/i18npool/source/localedata/data/de_LU.xml 
b/i18npool/source/localedata/data/de_LU.xml
index 3dcf21c6b616..00e5a7980e3d 100644
--- a/i18npool/source/localedata/data/de_LU.xml
+++ b/i18npool/source/localedata/data/de_LU.xml
@@ -254,7 +254,7 @@
 
 
   mar
-  Mrz
+  Mär
   März
 
 


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

2021-08-02 Thread Eike Rathke (via logerrit)
 svl/source/numbers/zforfind.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit 4961dbaecc9e5cac57d99d2ea9d265a90daa4a8b
Author: Eike Rathke 
AuthorDate: Mon Aug 2 22:11:29 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Aug 3 01:11:11 2021 +0200

Resolves: tdf#143664 {de-*} accept "Mär" and "Mrz" for March

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

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 8b01debbb1d4..121b9bd406f6 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -649,9 +649,25 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 res = sal::static_int_cast< short >(-(i+1)); // negative
 break;  // for
 }
+else if (i == 2 && pFormatter->GetLanguageTag().getLanguage() == 
"de")
+{
+if (pUpperAbbrevMonthText[i] == u"M\u00C4R" && 
StringContainsWord( "MRZ", rString, nPos))
+{   // Accept MRZ for MÄR
+nPos = nPos + 3;
+res = sal::static_int_cast< short >(-(i+1)); // negative
+break;  // for
+}
+else if (pUpperAbbrevMonthText[i] == "MRZ" && 
StringContainsWord( u"M\u00C4R", rString, nPos))
+{   // And vice versa, accept MÄR for MRZ
+nPos = nPos + 3;
+res = sal::static_int_cast< short >(-(i+1)); // negative
+break;  // for
+}
+}
 else if (i == 8)
 {
 // This assumes the weirdness is applicable to all locales.
+// It is the case for at least en-* and de-* locales.
 if (pUpperAbbrevMonthText[i] == "SEPT" && StringContainsWord( 
"SEP", rString, nPos))
 {   // #102136# The correct English form of month September 
abbreviated is
 // SEPT, but almost every data contains SEP instead.


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

2021-08-01 Thread Eike Rathke (via logerrit)
 sc/source/filter/oox/excelfilter.cxx |8 ++-
 sc/source/filter/xml/xmlimprt.cxx|3 +
 sc/source/ui/docshell/arealink.cxx   |3 +
 sc/source/ui/docshell/docsh.cxx  |   25 +
 sc/source/ui/docshell/docsh4.cxx |   90 +--
 sc/source/ui/inc/docsh.hxx   |1 
 6 files changed, 71 insertions(+), 59 deletions(-)

New commits:
commit 55abc3eb93fb8314b413453e384261cb00fde087
Author: Eike Rathke 
AuthorDate: Sun Aug 1 21:40:15 2021 +0200
Commit: Eike Rathke 
CommitDate: Sun Aug 1 22:35:28 2021 +0200

Consolidate link update handling

Have it at one central place and identical for all document
loading paths.

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

diff --git a/sc/source/filter/oox/excelfilter.cxx 
b/sc/source/filter/oox/excelfilter.cxx
index b5d01215baf8..e5815200e063 100644
--- a/sc/source/filter/oox/excelfilter.cxx
+++ b/sc/source/filter/oox/excelfilter.cxx
@@ -109,14 +109,18 @@ bool ExcelFilter::importDocument()
 if (xBookGlob)
 {
 rtl::Reference xWorkbookFragment( new 
WorkbookFragment(*xBookGlob, aWorkbookPath));
+
+const WorkbookFragment* pWF = static_cast(xWorkbookFragment.get());
+const ScDocument& rDoc = pWF->getScDocument();
+if (ScDocShell* pDocSh = 
static_cast(rDoc.GetDocumentShell()))
+pDocSh->SetInitialLinkUpdate( pDocSh->GetMedium());
+
 bool bRet = importFragment( xWorkbookFragment);
 if (bRet)
 {
-const WorkbookFragment* pWF = static_cast(xWorkbookFragment.get());
 const AddressConverter& rAC = pWF->getAddressConverter();
 if (rAC.isTabOverflow() || rAC.isColOverflow() || 
rAC.isRowOverflow())
 {
-const ScDocument& rDoc = pWF->getScDocument();
 if (rDoc.IsUserInteractionEnabled())
 {
 // Show data loss warning.
diff --git a/sc/source/filter/xml/xmlimprt.cxx 
b/sc/source/filter/xml/xmlimprt.cxx
index 968ebb0cdbfe..99d33d2416db 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1138,6 +1138,9 @@ void SAL_CALL ScXMLImport::setTargetDocument( const 
css::uno::Reference< css::la
 if (!pDoc)
 throw lang::IllegalArgumentException();
 
+if (ScDocShell* pDocSh = 
static_cast(pDoc->GetDocumentShell()))
+pDocSh->SetInitialLinkUpdate( pDocSh->GetMedium());
+
 mpDocImport.reset(new ScDocumentImport(*pDoc));
 mpComp.reset(new ScCompiler(*pDoc, ScAddress(), 
formula::FormulaGrammar::GRAM_ODFF));
 
diff --git a/sc/source/ui/docshell/arealink.cxx 
b/sc/source/ui/docshell/arealink.cxx
index 2b66e13e2327..e44e364c461a 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -226,6 +226,9 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const 
OUString& rNewFilter,
 if (rNewFile.isEmpty() || rNewFilter.isEmpty())
 return false;
 
+if (!m_pDocSh->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate())
+return false;
+
 OUString aNewUrl( ScGlobal::GetAbsDocName( rNewFile, m_pDocSh ) );
 bool bNewUrlName = (aNewUrl != aFileName);
 
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 29435d90a2f4..8e2c3c45218f 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -586,21 +586,7 @@ bool ScDocShell::Load( SfxMedium& rMedium )
 bool bRet = SfxObjectShell::Load(rMedium);
 if (bRet)
 {
-if (GetMedium())
-{
-const SfxUInt16Item* pUpdateDocItem = 
SfxItemSet::GetItem(rMedium.GetItemSet(), SID_UPDATEDOCMODE, 
false);
-m_nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : 
css::document::UpdateDocMode::NO_UPDATE;
-}
-
-// GetLinkUpdateModeState() evaluates m_nCanUpdate so that must have
-// been set first. Do not override an already forbidden LinkUpdate (the
-// default is allow).
-comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = 
getEmbeddedObjectContainer();
-if (rEmbeddedObjectContainer.getUserAllowsLinkUpdate())
-{
-// For anything else than LM_ALWAYS we need user confirmation.
-rEmbeddedObjectContainer.setUserAllowsLinkUpdate( 
GetLinkUpdateModeState() == LM_ALWAYS);
-}
+SetInitialLinkUpdate();
 
 {
 //  prepare a valid document for XML filter
@@ -1090,11 +1076,7 @@ bool ScDocShell::LoadFrom( SfxMedium& rMedium )
 
 bool bRet = false;
 
-if (GetMedium())
-{
-const SfxUInt16Item* pUpdateDocItem = 
SfxItemSet::GetItem(rMedium.GetItemSet(), SID_UPDATEDOCMODE,

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

2021-07-31 Thread Eike Rathke (via logerrit)
 sc/source/ui/view/printfun.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit f1f15123bb6af38866b40f8e0d0b6530f69e1eca
Author: Eike Rathke 
AuthorDate: Sat Jul 31 12:25:01 2021 +0200
Commit: Eike Rathke 
CommitDate: Sat Jul 31 14:02:40 2021 +0200

Check nNextPageBreak for ScRowBreakIterator::NOT_FOUND, tdf#64703 follow-up

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

diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 0fc79a76b397..f8e7c302b971 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -3199,7 +3199,8 @@ void PrintPageRanges::calculate(ScDocument& rDoc,
 else
 {
 // Skip all hidden rows until next pagebreak.
-nRow = std::min(nLastRow, nNextPageBreak - 1);
+nRow = ((nNextPageBreak == ScRowBreakIterator::NOT_FOUND) ? 
nLastRow :
+std::min(nLastRow, nNextPageBreak - 1));
 }
 }
 


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

2021-07-29 Thread Eike Rathke (via logerrit)
 i18npool/qa/cppunit/test_defaultnumberingprovider.cxx |4 --
 i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx |   17 
++
 2 files changed, 17 insertions(+), 4 deletions(-)

New commits:
commit ac80ec817eb07c77a51bc0729985a473c734182e
Author: Eike Rathke 
AuthorDate: Thu Jul 29 17:49:08 2021 +0200
Commit: Eike Rathke 
CommitDate: Thu Jul 29 23:39:47 2021 +0200

Make duplicate generated numbering identifiers unique, tdf#143526 follow-up

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

diff --git a/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx 
b/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx
index 4770abb93808..f7382ede1a9f 100644
--- a/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx
+++ b/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx
@@ -57,10 +57,6 @@ CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, 
testNumberingIdentifi
 // FIXME: duplicate of NUMBER_UPPER_ZH_TW
 case css::style::NumberingType::NUMBER_INDIC_DEVANAGARI:
 // FIXME: duplicate of NUMBER_EAST_ARABIC_INDIC
-case css::style::NumberingType::NUMBER_DIGITAL_KO:
-// FIXME: duplicate of NUMBER_HANGUL_KO
-case css::style::NumberingType::NUMBER_DIGITAL2_KO:
-// FIXME: duplicate of NUMBER_LOWER_ZH
 break;
 default:
 if (aID.isEmpty() || !aMap.insert(std::pair(aID, i)).second)
diff --git 
a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx 
b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index b7ee64cac5eb..a5a604903ad6 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -1128,6 +1128,23 @@ OUString 
DefaultNumberingProvider::makeNumberingIdentifier(sal_Int16 index)
 result.append(", ");
 }
 result.append("...");
+// Make known duplicate generated identifiers unique.
+// Note this alone works only for newly added numberings, if duplicates
+// are in the wild further handling is needed when loading documents
+// and asking for numberings.
+switch (aSupportedTypes[index].nType)
+{
+case css::style::NumberingType::NUMBER_DIGITAL_KO:
+// Duplicate of NUMBER_HANGUL_KO.
+result.append(" (ko-x-digital)");
+break;
+case css::style::NumberingType::NUMBER_DIGITAL2_KO:
+// Duplicate of NUMBER_LOWER_ZH.
+result.append(" (ko)");
+break;
+default:
+; // nothing
+}
 return result.makeStringAndClear();
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-29 Thread Eike Rathke (via logerrit)
 i18npool/qa/cppunit/test_defaultnumberingprovider.cxx |   61 ++
 1 file changed, 61 insertions(+)

New commits:
commit c186d09f88d6a4992382a1d15b60db6dbed3a91b
Author: Eike Rathke 
AuthorDate: Thu Jul 29 16:35:24 2021 +0200
Commit: Eike Rathke 
CommitDate: Thu Jul 29 18:49:57 2021 +0200

Add NumberingIdentifier unit test, tdf#143526 related

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

diff --git a/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx 
b/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx
index dbe55050a01c..4770abb93808 100644
--- a/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx
+++ b/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx
@@ -12,9 +12,12 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
+#include 
+
 using namespace ::com::sun::star;
 
 /// i18npool defaultnumberingprovider tests.
@@ -22,6 +25,64 @@ class I18npoolDefaultnumberingproviderTest : public 
test::BootstrapFixture
 {
 };
 
+CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, 
testNumberingIdentifiers)
+{
+// All numbering identifiers must be unique.
+std::unordered_map aMap;
+std::vector aFail;
+
+uno::Reference xFormatter(
+text::DefaultNumberingProvider::create(mxComponentContext), 
uno::UNO_QUERY);
+
+// Do not use getSupportedNumberingTypes() because it depends on
+// configuration whether CTL and CJK numberings are included or not.
+// Also do not test for known values of
+// offapi/com/sun/star/style/NumberingType.idl and miss newly added values.
+// Instead, enumerate until an empty ID is returned but also check there
+// are at least the known NumberingType values covered, just in case the
+// table wasn't maintained. So this may have to be adapted from time to
+// time.
+constexpr sal_Int16 kLastKnown = 
css::style::NumberingType::NUMBER_LEGAL_KO;
+for (sal_Int16 i = 0; i < SAL_MAX_INT16; ++i)
+{
+OUString aID(xFormatter->getNumberingIdentifier(i));
+if (aID.isEmpty() && i > kLastKnown)
+break; // for
+
+switch (i)
+{
+case css::style::NumberingType::TRANSLITERATION:
+// TODO: why does this have no identifier?
+case css::style::NumberingType::NUMBER_UPPER_KO:
+// FIXME: duplicate of NUMBER_UPPER_ZH_TW
+case css::style::NumberingType::NUMBER_INDIC_DEVANAGARI:
+// FIXME: duplicate of NUMBER_EAST_ARABIC_INDIC
+case css::style::NumberingType::NUMBER_DIGITAL_KO:
+// FIXME: duplicate of NUMBER_HANGUL_KO
+case css::style::NumberingType::NUMBER_DIGITAL2_KO:
+// FIXME: duplicate of NUMBER_LOWER_ZH
+break;
+default:
+if (aID.isEmpty() || !aMap.insert(std::pair(aID, i)).second)
+{
+aFail.emplace_back(
+"Numbering: " + OString::number(i) + " \"" + 
aID.toUtf8() + "\""
++ (aID.isEmpty() ? ""
+ : OString(" duplicate of " + 
OString::number(aMap[aID])))
++ "\n");
+}
+}
+}
+
+if (!aFail.empty())
+{
+OString aMsg("Not unique numbering identifiers:\n");
+for (auto const& r : aFail)
+aMsg += r;
+CPPUNIT_ASSERT_MESSAGE(aMsg.getStr(), false);
+}
+}
+
 CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testArabicZero)
 {
 // 1 -> "01"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-28 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/parclass.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 56cebfdbce89e7400a89678d14b847243e88f971
Author: Eike Rathke 
AuthorDate: Wed Jul 28 18:36:51 2021 +0200
Commit: Eike Rathke 
CommitDate: Wed Jul 28 20:08:46 2021 +0200

Keep ScParameterClassification sorted, tdf#76310 follow-up

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

diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx
index 6c560b07b42f..eca9d204855a 100644
--- a/sc/source/core/tool/parclass.cxx
+++ b/sc/source/core/tool/parclass.cxx
@@ -74,7 +74,6 @@ const ScParameterClassification::RawData 
ScParameterClassification::pRawData[] =
 { ocSep, {{ Bounds 
  }, 0, Bounds }},
 { ocSkip,{{ Bounds 
  }, 0, Bounds }},
 { ocSpaces,  {{ Bounds 
  }, 0, Bounds }},
-{ ocWhitespace,  {{ Bounds 
  }, 0, Bounds }},
 { ocStop,{{ Bounds 
  }, 0, Bounds }},
 { ocStringXML,   {{ Bounds 
  }, 0, Bounds }},
 { ocTableRef,{{ Bounds 
  }, 0, Value }},// or Reference?
@@ -263,6 +262,7 @@ const ScParameterClassification::RawData 
ScParameterClassification::pRawData[] =
 { ocVarPA,   {{ ReferenceOrRefArray
  }, 1, Value }},
 { ocVarP_MS, {{ Reference  
  }, 1, Value }},
 { ocVarS,{{ Reference  
  }, 1, Value }},
+{ ocWhitespace,  {{ Bounds 
  }, 0, Bounds }},
 { ocWorkday_MS,  {{ Value, Value, Value, Reference 
  }, 0, Value }},
 { ocXor, {{ Reference  
  }, 1, Value }},
 { ocZTest,   {{ Reference, Value, Value
  }, 0, Value }},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: formula/source include/formula offapi/com sc/inc sc/source

2021-07-28 Thread Eike Rathke (via logerrit)
 formula/source/core/api/FormulaCompiler.cxx|   29 +++-
 formula/source/core/api/token.cxx  |   39 +-
 formula/source/ui/dlg/formula.cxx  |8 -
 include/formula/compiler.hxx   |   41 +++---
 include/formula/opcode.hxx |2 
 include/formula/token.hxx  |   20 +++
 offapi/com/sun/star/sheet/FormulaMapGroupSpecialOffset.idl |   24 +++-
 sc/inc/compiler.hxx|   20 +++
 sc/source/core/tool/compiler.cxx   |   78 +
 sc/source/core/tool/parclass.cxx   |1 
 sc/source/core/tool/token.cxx  |   18 ++-
 sc/source/filter/excel/xeformula.cxx   |8 +
 sc/source/filter/excel/xlformula.cxx   |5 
 sc/source/ui/app/inputhdl.cxx  |2 
 sc/source/ui/unoobj/tokenuno.cxx   |   13 ++
 sc/source/ui/view/viewfunc.cxx |2 
 16 files changed, 240 insertions(+), 70 deletions(-)

New commits:
commit 516318113f0bd2b3c658aba9b285165e63a280e2
Author: Eike Rathke 
AuthorDate: Wed Jul 28 17:31:56 2021 +0200
Commit: Eike Rathke 
CommitDate: Wed Jul 28 18:56:29 2021 +0200

Resolves: tdf#76310 Preserve whitespace TAB, CR, LF in formula expressions

Allowed whitespace in ODFF and OOXML are
U+0020 SPACE
U+0009 CHARACTER TABULATION
U+000A LINE FEED
U+000D CARRIAGE RETURN

Line feed and carriage return look a bit funny in the Function Wizard if
part of a function's argument but work. Once a formula is edited, CR are
converted to LF though, probably already in EditEngine, didn't
investigate.

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

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index be5ce09d132f..f7174807f0f4 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -475,7 +475,8 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > 
FormulaCompiler::OpCodeMap::create
 { FormulaMapGroupSpecialOffset::DB_AREA   , ocDBArea } 
,
 /* TODO: { FormulaMapGroupSpecialOffset::TABLE_REF , 
ocTableRef }   , */
 { FormulaMapGroupSpecialOffset::MACRO , ocMacro }  
,
-{ FormulaMapGroupSpecialOffset::COL_ROW_NAME  , ocColRowName }
+{ FormulaMapGroupSpecialOffset::COL_ROW_NAME  , ocColRowName } 
,
+{ FormulaMapGroupSpecialOffset::WHITESPACE, ocWhitespace }
 };
 const size_t nCount = SAL_N_ELEMENTS(aMap);
 // Preallocate vector elements.
@@ -1267,14 +1268,18 @@ bool FormulaCompiler::GetToken()
  nWasColRowName = 1;
 else
  nWasColRowName = 0;
+OpCode eTmpOp;
 mpToken = maArrIterator.Next();
-while( mpToken && mpToken->GetOpCode() == ocSpaces )
+while (mpToken && ((eTmpOp = mpToken->GetOpCode()) == ocSpaces || 
eTmpOp == ocWhitespace))
 {
-// For significant whitespace remember last ocSpaces token. Usually
-// there's only one even for multiple spaces.
-pSpacesToken = mpToken;
-if ( nWasColRowName )
-nWasColRowName++;
+if (eTmpOp == ocSpaces)
+{
+// For significant whitespace remember last ocSpaces token.
+// Usually there's only one even for multiple spaces.
+pSpacesToken = mpToken;
+if ( nWasColRowName )
+nWasColRowName++;
+}
 if ( bAutoCorrect && !pStack )
 CreateStringFromToken( aCorrectedFormula, mpToken.get() );
 mpToken = maArrIterator.Next();
@@ -2272,10 +2277,10 @@ const FormulaToken* 
FormulaCompiler::CreateStringFromToken( OUStringBuffer& rBuf
 if( bSpaces )
 rBuffer.append( ' ');
 
-if( eOp == ocSpaces )
+if (eOp == ocSpaces || eOp == ocWhitespace)
 {
 bool bWriteSpaces = true;
-if (mxSymbols->isODFF())
+if (eOp == ocSpaces && mxSymbols->isODFF())
 {
 const FormulaToken* p = maArrIterator.PeekPrevNoSpaces();
 bool bIntersectionOp = (p && p->GetOpCode() == ocColRowName);
@@ -2316,7 +2321,10 @@ const FormulaToken* 
FormulaCompiler::CreateStringFromToken( OUStringBuffer& rBuf
 sal_uInt8 n = t->GetByte();
 for ( sal_uInt8 j=0; jGetChar());
+else
+rBuffer.append( ' ');
 

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

2021-07-28 Thread Eike Rathke (via logerrit)
 formula/source/core/api/FormulaCompiler.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 6eb9fde88af245a00247fca8a592ed08ee4b8bbe
Author: Eike Rathke 
AuthorDate: Wed Jul 28 02:00:53 2021 +0200
Commit: Eike Rathke 
CommitDate: Wed Jul 28 11:42:30 2021 +0200

ODFF: eliminate spaces between function name and initial opening parenthesis

Same as for OOXML, they are disallowed in ODFF as well.

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

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 3907c1ac8314..be5ce09d132f 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -2290,11 +2290,18 @@ const FormulaToken* 
FormulaCompiler::CreateStringFromToken( OUStringBuffer& rBuf
 bWriteSpaces = false;
 }
 }
-else if (mxSymbols->isOOXML())
+if (bWriteSpaces)
 {
+// ODF v1.3 OpenFormula 5.14 Whitespace states "whitespace shall
+// not separate a function name from its initial opening
+// parenthesis".
+//
 // ECMA-376-1:2016 18.17.2 Syntax states "that no space characters
 // shall separate a function-name from the left parenthesis (()
 // that follows it." and Excel even chokes on it.
+//
+// Suppress/remove it in any case also in UI, it will not be
+// preserved.
 const FormulaToken* p = maArrIterator.PeekPrevNoSpaces();
 if (p && p->IsFunction())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-26 Thread Eike Rathke (via logerrit)
 include/formula/grammar.hxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit 3c766512984feff739377d0f0af46558ee7139fd
Author: Eike Rathke 
AuthorDate: Mon Jul 26 16:05:22 2021 +0200
Commit: Eike Rathke 
CommitDate: Mon Jul 26 21:41:55 2021 +0200

Related: tdf#64086 Add FormulaGrammar::isRefConventionOOXML()

... to prepare detailed compiler scanner handling.

Change-Id: I4a50491b4fa95516773adbd7b86e91ab121b1820
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119517
Tested-by: Eike Rathke 
Reviewed-by: Eike Rathke 

diff --git a/include/formula/grammar.hxx b/include/formula/grammar.hxx
index 5d7933dee24a..b5b499d5aab4 100644
--- a/include/formula/grammar.hxx
+++ b/include/formula/grammar.hxx
@@ -209,6 +209,19 @@ public:
 css::sheet::FormulaLanguage::OOXML;
 }
 
+/** If reference convention is OOXML.
+
+Note this is not equivalent to isOOXML() as it does not have to be
+FormulaLanguage::OOXML but can be Grammar::GRAM_EXTERNAL merged with
+AddressConvention::CONV_XL_OOX, which is used by various parts of OOXML
+import through the API FormulaParser.
+ */
+static bool isRefConventionOOXML( const Grammar eGrammar )
+{
+return extractRefConvention( eGrammar) ==
+FormulaGrammar::AddressConvention::CONV_XL_OOX;
+}
+
 /// If grammar has an Excel syntax, determined by address convention.
 static bool isExcelSyntax( const Grammar eGrammar )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-25 Thread Eike Rathke (via logerrit)
 desktop/source/app/dispatchwatcher.cxx |   19 +++--
 sc/source/ui/docshell/docsh.cxx|   48 +++--
 2 files changed, 45 insertions(+), 22 deletions(-)

New commits:
commit 55f0121dd7ed2d7e84adc597bdd24ca40e0b0ce4
Author: Eike Rathke 
AuthorDate: Tue Jul 20 23:09:59 2021 +0200
Commit: Caolán McNamara 
CommitDate: Sun Jul 25 15:54:14 2021 +0200

Related: tdf#135762 Suppress cout if not command line

Change-Id: I9431221aadf97739bb197871f25fa151ef4c391c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119294
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 0cda081c9aa3b3dcb363f97bac60c845ce9a13e0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119255
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 1c4d878614c5..0e39415d8fab 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -608,15 +608,17 @@ bool DispatchWatcher::executeDispatchRequests( const 
std::vector conversionProperties( 
nProps );
-conversionProperties[0].Name = "Overwrite";
-conversionProperties[0].Value <<= true;
+conversionProperties[0].Name = 
"ConversionRequestOrigin";
+conversionProperties[0].Value <<= 
OUString("CommandLine");
+conversionProperties[1].Name = "Overwrite";
+conversionProperties[1].Value <<= true;
 
-conversionProperties[1].Name = "FilterName";
+conversionProperties[2].Name = "FilterName";
 if( 0 < nFilterOptionsIndex )
 {
 OUString sFilterName = aFilter.copy(0, 
nFilterOptionsIndex);
@@ -641,18 +643,19 @@ bool DispatchWatcher::executeDispatchRequests( const 
std::vector & rArgs = 
rMed.GetArgs();
+const auto pProp = std::find_if( rArgs.begin(), rArgs.end(),
+[](const css::beans::PropertyValue& rProp) { return 
rProp.Name == "ConversionRequestOrigin"; });
+if (pProp != rArgs.end())
+{
+OUString aOrigin;
+pProp->Value >>= aOrigin;
+bVerbose = (aOrigin == "CommandLine");
+}
+
 SCTAB nStartTab;
 SCTAB nCount = m_aDocument.GetTableCount();
 if (aOptions.nSheetToExport == -1)
@@ -2433,11 +2446,14 @@ bool ScDocShell::ConvertTo( SfxMedium  )
 else
 {
 // Usage error, no export but log.
-if (aOptions.nSheetToExport < 0)
-std::cout << "Bad sheet number string given." << std::endl;
-else
-std::cout << "No sheet number " << 
OString::number(aOptions.nSheetToExport)
-<< ", number of sheets is 
" << nCount << std::endl;
+if (bVerbose)
+{
+if (aOptions.nSheetToExport < 0)
+std::cout << "Bad sheet number string given." << 
std::endl;
+else
+std::cout << "No sheet number " << 
aOptions.nSheetToExport
+<< ", number of sheets is " << nCount << std::endl;
+}
 nStartTab = 0;
 nCount = 0;
 SetError(SCERR_EXPORT_DATA);
@@ -2462,15 +2478,19 @@ bool ScDocShell::ConvertTo( SfxMedium  )
 
 // log similar to DispatchWatcher::executeDispatchRequests
 OUString aOutFile = 
aSheetURLObject.GetMainURL(INetURLObject::DecodeMechanism::NONE);
-OUString aDisplayedName;
-if (osl::FileBase::E_None != 
osl::FileBase::getSystemPathFromFileURL(aOutFile, aDisplayedName))
-aDisplayedName = aOutFile;
-std::cout << "Writing sheet " << OUStringToOString(sTabName, 
osl_getThreadTextEncoding()) << " -> "
-  << 
OUStringToOString(aDisplayedName, osl_getThreadTextEncoding())
-  << std::endl;
-
-if (FStatHelper::IsDocument(aOutFile))
-std::cout << "Overwriting: " << 
OUStringToOString(aDisplayedName, osl_getThreadTextEncoding()) << std::endl ;
+if (bVer

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

2021-07-20 Thread Eike Rathke (via logerrit)
 desktop/source/app/dispatchwatcher.cxx |   19 +++--
 sc/source/ui/docshell/docsh.cxx|   48 +++--
 2 files changed, 45 insertions(+), 22 deletions(-)

New commits:
commit 0cda081c9aa3b3dcb363f97bac60c845ce9a13e0
Author: Eike Rathke 
AuthorDate: Tue Jul 20 23:09:59 2021 +0200
Commit: Eike Rathke 
CommitDate: Wed Jul 21 01:26:15 2021 +0200

Related: tdf#135762 Suppress cout if not command line

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

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 1c4d878614c5..0e39415d8fab 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -608,15 +608,17 @@ bool DispatchWatcher::executeDispatchRequests( const 
std::vector conversionProperties( 
nProps );
-conversionProperties[0].Name = "Overwrite";
-conversionProperties[0].Value <<= true;
+conversionProperties[0].Name = 
"ConversionRequestOrigin";
+conversionProperties[0].Value <<= 
OUString("CommandLine");
+conversionProperties[1].Name = "Overwrite";
+conversionProperties[1].Value <<= true;
 
-conversionProperties[1].Name = "FilterName";
+conversionProperties[2].Name = "FilterName";
 if( 0 < nFilterOptionsIndex )
 {
 OUString sFilterName = aFilter.copy(0, 
nFilterOptionsIndex);
@@ -641,18 +643,19 @@ bool DispatchWatcher::executeDispatchRequests( const 
std::vector & rArgs = 
rMed.GetArgs();
+const auto pProp = std::find_if( rArgs.begin(), rArgs.end(),
+[](const css::beans::PropertyValue& rProp) { return 
rProp.Name == "ConversionRequestOrigin"; });
+if (pProp != rArgs.end())
+{
+OUString aOrigin;
+pProp->Value >>= aOrigin;
+bVerbose = (aOrigin == "CommandLine");
+}
+
 SCTAB nStartTab;
 SCTAB nCount = m_aDocument.GetTableCount();
 if (aOptions.nSheetToExport == -1)
@@ -2433,11 +2446,14 @@ bool ScDocShell::ConvertTo( SfxMedium  )
 else
 {
 // Usage error, no export but log.
-if (aOptions.nSheetToExport < 0)
-std::cout << "Bad sheet number string given." << std::endl;
-else
-std::cout << "No sheet number " << 
OString::number(aOptions.nSheetToExport)
-<< ", number of sheets is 
" << nCount << std::endl;
+if (bVerbose)
+{
+if (aOptions.nSheetToExport < 0)
+std::cout << "Bad sheet number string given." << 
std::endl;
+else
+std::cout << "No sheet number " << 
aOptions.nSheetToExport
+<< ", number of sheets is " << nCount << std::endl;
+}
 nStartTab = 0;
 nCount = 0;
 SetError(SCERR_EXPORT_DATA);
@@ -2462,15 +2478,19 @@ bool ScDocShell::ConvertTo( SfxMedium  )
 
 // log similar to DispatchWatcher::executeDispatchRequests
 OUString aOutFile = 
aSheetURLObject.GetMainURL(INetURLObject::DecodeMechanism::NONE);
-OUString aDisplayedName;
-if (osl::FileBase::E_None != 
osl::FileBase::getSystemPathFromFileURL(aOutFile, aDisplayedName))
-aDisplayedName = aOutFile;
-std::cout << "Writing sheet " << OUStringToOString(sTabName, 
osl_getThreadTextEncoding()) << " -> "
-  << 
OUStringToOString(aDisplayedName, osl_getThreadTextEncoding())
-  << std::endl;
-
-if (FStatHelper::IsDocument(aOutFile))
-std::cout << "Overwriting: " << 
OUStringToOString(aDisplayedName, osl_getThreadTextEncoding()) << std::endl ;
+if (bVerbose)
+{
+OUString aDisplayedName;
+if (osl::FileBase::E_None != 
osl::FileBase::getSystemPathFromFileURL(aOutFile, aDisplayedName))
+ 

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

2021-07-17 Thread Eike Rathke (via logerrit)
 sw/source/core/text/inftxt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e9014226d5ef3db2e2b40ab86f50e41256142641
Author: Eike Rathke 
AuthorDate: Fri Jul 16 11:50:39 2021 +0200
Commit: Caolán McNamara 
CommitDate: Sat Jul 17 20:48:01 2021 +0200

Fix lang::Locale.Language usage, tdf#128191 follow-up

Using plain lang::Locale.Language is always wrong, it may even be
'qlt' for a more complex language tag. As the InfoBar message is
"Please install the hyphenation package for locale “%1”."
actually use the BCP 47 language tag of that character/paragraph
attribution.

Spotted in

https://ask.libreoffice.org/en/question/280102/install-the-hyphenation-package-for-locale-ka/

https://ask.libreoffice.org/en/question/238764/error-message-reads-install-the-hyphenation-package-for-locale-zh/

Change-Id: I5805d4d711989a9d0260940666d3eb33eae830af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119020
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 64f885a6c9d51999b737c0f61bc3a7fa311a5a94)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119032
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index ac0b61f29a79..20120767266c 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1501,7 +1501,7 @@ bool SwTextFormatInfo::IsHyphenate() const
 pShell->AppendInfoBarWhenReady(
 "hyphenationmissing", SwResId(STR_HYPH_MISSING),
 SwResId(STR_HYPH_MISSING_DETAIL)
-.replaceFirst("%1", g_pBreakIt->GetLocale(eTmp).Language),
+.replaceFirst("%1", LanguageTag::convertToBcp47( 
g_pBreakIt->GetLocale(eTmp))),
 InfobarType::WARNING);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-16 Thread Eike Rathke (via logerrit)
 sw/source/core/text/inftxt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit afe8b282d79d1f5c848558200363b65def201ded
Author: Eike Rathke 
AuthorDate: Fri Jul 16 11:50:39 2021 +0200
Commit: Michael Stahl 
CommitDate: Fri Jul 16 17:04:40 2021 +0200

Fix lang::Locale.Language usage, tdf#128191 follow-up

Using plain lang::Locale.Language is always wrong, it may even be
'qlt' for a more complex language tag. As the InfoBar message is
"Please install the hyphenation package for locale “%1”."
actually use the BCP 47 language tag of that character/paragraph
attribution.

Spotted in

https://ask.libreoffice.org/en/question/280102/install-the-hyphenation-package-for-locale-ka/

https://ask.libreoffice.org/en/question/238764/error-message-reads-install-the-hyphenation-package-for-locale-zh/

Change-Id: I5805d4d711989a9d0260940666d3eb33eae830af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119020
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 64f885a6c9d51999b737c0f61bc3a7fa311a5a94)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118931
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index f43f811bd744..ddfc54bc6fc3 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1504,7 +1504,7 @@ bool SwTextFormatInfo::IsHyphenate() const
 pShell->AppendInfoBarWhenReady(
 "hyphenationmissing", SwResId(STR_HYPH_MISSING),
 SwResId(STR_HYPH_MISSING_DETAIL)
-.replaceFirst("%1", g_pBreakIt->GetLocale(eTmp).Language),
+.replaceFirst("%1", LanguageTag::convertToBcp47( 
g_pBreakIt->GetLocale(eTmp))),
 InfobarType::WARNING);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-16 Thread Eike Rathke (via logerrit)
 unotools/source/i18n/calendarwrapper.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 75b789a8f542e729e9e5e21031b7baf452a8c174
Author: Eike Rathke 
AuthorDate: Fri Jul 16 15:43:00 2021 +0200
Commit: Eike Rathke 
CommitDate: Fri Jul 16 16:41:32 2021 +0200

Output proper language tag instead of Language+Country concatenation

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

diff --git a/unotools/source/i18n/calendarwrapper.cxx 
b/unotools/source/i18n/calendarwrapper.cxx
index 7f0cc753a2c5..fd5d166fdcf9 100644
--- a/unotools/source/i18n/calendarwrapper.cxx
+++ b/unotools/source/i18n/calendarwrapper.cxx
@@ -19,6 +19,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -62,7 +63,7 @@ void CalendarWrapper::loadCalendar( const OUString& 
rUniqueID, const css::lang::
 catch (const Exception&)
 {
 TOOLS_WARN_EXCEPTION( "unotools.i18n", "loadCalendar: "
-<< rUniqueID << "   Locale: " << rLocale.Language << "_" << 
rLocale.Country );
+<< rUniqueID << "   Locale: " << 
LanguageTag::convertToBcp47(rLocale) );
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-16 Thread Eike Rathke (via logerrit)
 desktop/source/lib/init.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 627a069822c8bd106fc05e1549997179143c6916
Author: Eike Rathke 
AuthorDate: Fri Jul 16 15:15:48 2021 +0200
Commit: Eike Rathke 
CommitDate: Fri Jul 16 16:31:01 2021 +0200

Output proper language tag instead of Language+Country concatenation

That way also for more complex tags with 'qlt' language you get a
meaningful output. It's only stderr, but..

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 4060af238700..58ac041a78ab 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -6056,7 +6056,7 @@ static void preloadData()
 uno::Sequence< css::lang::Locale > aLocales = xSpellLocales->getLocales();
 for (auto  : aLocales)
 {
-std::cerr << it.Language << "_" << it.Country << " ";
+std::cerr << LanguageTag::convertToBcp47(it) << " ";
 css::beans::PropertyValues aNone;
 xSpellChecker->isValid("forcefed", it, aNone);
 }
@@ -6077,7 +6077,7 @@ static void preloadData()
 std::cerr << "Preloading thesauri: ";
 for (auto  : aLocales)
 {
-std::cerr << it.Language << "_" << it.Country << " ";
+std::cerr << LanguageTag::convertToBcp47(it) << " ";
 css::beans::PropertyValues aNone;
 xThesaurus->queryMeanings("forcefed", it, aNone);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-16 Thread Eike Rathke (via logerrit)
 include/svtools/langtab.hxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit d019d044baa9ee798f8f9977ab5f89513dce5d23
Author: Eike Rathke 
AuthorDate: Fri Jul 16 14:15:35 2021 +0200
Commit: Eike Rathke 
CommitDate: Fri Jul 16 15:06:46 2021 +0200

Clarify that SvtLanguageTable::GetLanguageType() expects the UI name

Apparently several places get that wrong and pass a
lang::Locale.Language instead.. to be investigated.

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

diff --git a/include/svtools/langtab.hxx b/include/svtools/langtab.hxx
index 61e2f0815022..2d71901c17f3 100644
--- a/include/svtools/langtab.hxx
+++ b/include/svtools/langtab.hxx
@@ -29,7 +29,13 @@ class SVT_DLLPUBLIC SvtLanguageTable
 public:
 
 static bool HasLanguageType( const LanguageType eType );
+/** Obtain the UI name for a LanguageType of a language/locale (string
+resource STR_ARR_SVT_LANGUAGE_TABLE).
+ */
 static OUString GetLanguageString( const LanguageType eType );
+/** Obtain the LanguageType for a UI name of a language/locale (string
+resource STR_ARR_SVT_LANGUAGE_TABLE).
+ */
 static LanguageType GetLanguageType( std::u16string_view rStr );
 static sal_uInt32   GetLanguageEntryCount();
 static LanguageType GetLanguageTypeAtIndex( sal_uInt32 nIndex );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-16 Thread Eike Rathke (via logerrit)
 sw/source/core/text/inftxt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 64f885a6c9d51999b737c0f61bc3a7fa311a5a94
Author: Eike Rathke 
AuthorDate: Fri Jul 16 11:50:39 2021 +0200
Commit: Eike Rathke 
CommitDate: Fri Jul 16 13:27:05 2021 +0200

Fix lang::Locale.Language usage, tdf#128191 follow-up

Using plain lang::Locale.Language is always wrong, it may even be
'qlt' for a more complex language tag. As the InfoBar message is
"Please install the hyphenation package for locale “%1”."
actually use the BCP 47 language tag of that character/paragraph
attribution.

Spotted in

https://ask.libreoffice.org/en/question/280102/install-the-hyphenation-package-for-locale-ka/

https://ask.libreoffice.org/en/question/238764/error-message-reads-install-the-hyphenation-package-for-locale-zh/

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

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index f43f811bd744..ddfc54bc6fc3 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1504,7 +1504,7 @@ bool SwTextFormatInfo::IsHyphenate() const
 pShell->AppendInfoBarWhenReady(
 "hyphenationmissing", SwResId(STR_HYPH_MISSING),
 SwResId(STR_HYPH_MISSING_DETAIL)
-.replaceFirst("%1", g_pBreakIt->GetLocale(eTmp).Language),
+.replaceFirst("%1", LanguageTag::convertToBcp47( 
g_pBreakIt->GetLocale(eTmp))),
 InfobarType::WARNING);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-16 Thread Eike Rathke (via logerrit)
 svx/source/dialog/langbox.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d82896f74d703bd9122eebc63ee9338328aadc43
Author: Eike Rathke 
AuthorDate: Thu Jul 15 23:53:04 2021 +0200
Commit: Caolán McNamara 
CommitDate: Fri Jul 16 10:17:55 2021 +0200

Resolves: tdf#143372 Exclude {qtz} KeyID from SvxLanguageBox list

Change-Id: I3e52407a33f79713635063ff4ba374267eb98005
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119002
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit da13b76e07231131cb951868a314ee6f51c0f254)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118928
Reviewed-by: Caolán McNamara 

diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 5b7526d94084..9e9863cb1408 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -95,6 +95,7 @@ bool lcl_isPrerequisite( LanguageType nLangType )
 nLangType != LANGUAGE_DONTKNOW &&
 nLangType != LANGUAGE_SYSTEM &&
 nLangType != LANGUAGE_NONE &&
+nLangType != LANGUAGE_USER_KEYID &&
 !MsLangId::isLegacy( nLangType) &&
 MsLangId::getSubLanguage( nLangType);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-16 Thread Eike Rathke (via logerrit)
 svx/source/dialog/langbox.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 00bfb02010b0ee83c60d7fa80975f37ca8010b2e
Author: Eike Rathke 
AuthorDate: Thu Jul 15 23:53:04 2021 +0200
Commit: Caolán McNamara 
CommitDate: Fri Jul 16 10:16:39 2021 +0200

Resolves: tdf#143372 Exclude {qtz} KeyID from SvxLanguageBox list

Change-Id: I3e52407a33f79713635063ff4ba374267eb98005
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119002
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit da13b76e07231131cb951868a314ee6f51c0f254)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118927
Reviewed-by: Caolán McNamara 

diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 49f608629890..fcd9c54e3774 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -95,6 +95,7 @@ bool lcl_isPrerequisite( LanguageType nLangType )
 nLangType != LANGUAGE_DONTKNOW &&
 nLangType != LANGUAGE_SYSTEM &&
 nLangType != LANGUAGE_NONE &&
+nLangType != LANGUAGE_USER_KEYID &&
 !MsLangId::isLegacy( nLangType) &&
 MsLangId::getSubLanguage( nLangType);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-15 Thread Eike Rathke (via logerrit)
 svx/source/dialog/langbox.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit da13b76e07231131cb951868a314ee6f51c0f254
Author: Eike Rathke 
AuthorDate: Thu Jul 15 23:53:04 2021 +0200
Commit: Eike Rathke 
CommitDate: Fri Jul 16 00:35:46 2021 +0200

Resolves: tdf#143372 Exclude {qtz} KeyID from SvxLanguageBox list

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

diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 49f608629890..fcd9c54e3774 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -95,6 +95,7 @@ bool lcl_isPrerequisite( LanguageType nLangType )
 nLangType != LANGUAGE_DONTKNOW &&
 nLangType != LANGUAGE_SYSTEM &&
 nLangType != LANGUAGE_NONE &&
+nLangType != LANGUAGE_USER_KEYID &&
 !MsLangId::isLegacy( nLangType) &&
 MsLangId::getSubLanguage( nLangType);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-15 Thread Eike Rathke (via logerrit)
 sc/source/ui/dbgui/asciiopt.cxx |   16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 92d7ab0f9822bad7b003b317b6f08b7f84441ff0
Author: Eike Rathke 
AuthorDate: Thu Jul 15 17:33:57 2021 +0200
Commit: Eike Rathke 
CommitDate: Thu Jul 15 19:20:16 2021 +0200

Keep ScAsciiOptions in sync with ScImportOptions, tdf#135762 related

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

diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx
index 4d9e8dea6fe8..af65dbc54956 100644
--- a/sc/source/ui/dbgui/asciiopt.cxx
+++ b/sc/source/ui/dbgui/asciiopt.cxx
@@ -174,6 +174,16 @@ void ScAsciiOptions::ReadFromString( const OUString& 
rString )
 }
 else
 bRemoveSpace = false;
+
+// Token 11: sheet to export for --convert-to csv
+// Does not need to be evaluated here but may be present, so in case
+// there'll be yet another token 12 then do some dummy like
+#if 0
+if (nPos >= 0)
+{
+rString.getToken(0, ',', nPos);
+}
+#endif
 }
 
 OUString ScAsciiOptions::WriteToString() const
@@ -225,6 +235,7 @@ OUString ScAsciiOptions::WriteToString() const
 
 // #i112025# the options string is used in macros and linked sheets,
 // so new options must be added at the end, to remain compatible
+// Always keep in sync with ScImportOptions.
 
 aOutStr.append("," +
//Token 5: Language
@@ -238,7 +249,10 @@ OUString ScAsciiOptions::WriteToString() const
// Token 9: used for "Save cell formulas" in export options
OUString::boolean( bSaveFormulas ) + "," +
//Token 10: Trim Space
-   OUString::boolean( bRemoveSpace ));
+   OUString::boolean( bRemoveSpace ) +
+   //Token 11: sheet to export, always 0 for current sheet
+   ",0"
+);
 return aOutStr.makeStringAndClear();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-15 Thread Eike Rathke (via logerrit)
 desktop/source/app/dispatchwatcher.cxx |   13 ++--
 sc/source/ui/dbgui/imoptdlg.cxx|   15 +++---
 sc/source/ui/docshell/docsh.cxx|   34 ++---
 sc/source/ui/inc/imoptdlg.hxx  |8 +++
 4 files changed, 58 insertions(+), 12 deletions(-)

New commits:
commit d756a599298abb23657469cfd94c4a201824c419
Author: Eike Rathke 
AuthorDate: Thu Jul 15 10:37:57 2021 +0200
Commit: Caolán McNamara 
CommitDate: Thu Jul 15 14:54:48 2021 +0200

Related: tdf#135762 Allow --convert-to csv to specify 1-based sheet number

Same multifile mechanism as for -1 all sheets is used, so

soffice --convert-to csv:"Text - txt - csv 
(StarCalc)":44,34,UTF8,1,,0,false,true,false,false,false,2 sample.ods

writes a file sample-Sheet2.csv

Change-Id: Ib9248c9561e4e340c88458ac5dfd159e443a4cfd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118971
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit fda91f8be16ba760e360940ebafd6244c648cb8c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118920
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 8541c273cc83..1c4d878614c5 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -625,11 +625,20 @@ bool DispatchWatcher::executeDispatchRequests( const 
std::vector0 then that sheet 
(1-based) with the output
+// filename concatenated with the 
sheet name. So even if
+// that is a single file, the multi 
file target mechanism is
+// used.
+const OUString 
aTok(sFilterOptions.getToken(11, ',', nIdx));
+// Actual validity is checked in Calc, 
here just check for
+// presence of numeric value at start.
+bMultiFileTarget = (!aTok.isEmpty() && 
aTok.toInt32() != 0);
 }
 
 conversionProperties[1].Value <<= 
sFilterName;
diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx
index d8c4fd810ea3..a362e4df0ee7 100644
--- a/sc/source/ui/dbgui/imoptdlg.cxx
+++ b/sc/source/ui/dbgui/imoptdlg.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -43,7 +44,7 @@ ScImportOptions::ScImportOptions( const OUString& rStr )
 bSaveNumberAsSuch = true;
 bSaveFormulas = false;
 bRemoveSpace = false;
-bNewFilePerSheet = false;
+nSheetToExport = 0;
 sal_Int32 nTokenCount = comphelper::string::getTokenCount(rStr, ',');
 if ( nTokenCount < 3 )
 return;
@@ -79,7 +80,15 @@ ScImportOptions::ScImportOptions( const OUString& rStr )
 if ( nTokenCount >= 11 )
 bRemoveSpace = rStr.getToken(0, ',', nIdx) == "true";
 if ( nTokenCount >= 12 )
-bNewFilePerSheet = rStr.getToken(0, ',', nIdx) == "-1";
+{
+const OUString aTok(rStr.getToken(0, ',', nIdx));
+if (aTok == "-1")
+nSheetToExport = -1;// all
+else if (aTok.isEmpty() || CharClass::isAsciiNumeric(aTok))
+nSheetToExport = aTok.toInt32();
+else
+nSheetToExport = -23;   // invalid, force error
+}
 }
 }
 
@@ -104,7 +113,7 @@ OUString ScImportOptions::BuildString() const
 "," +
 OUString::boolean( bRemoveSpace ) +  // same as "Remove space" in 
ScAsciiOptions
 "," +
-std::u16string_view(bNewFilePerSheet ? u"-1" : u"0") ;  // Only 
available for command line --convert-to
+OUString::number(nSheetToExport) ;  // Only available for command 
line --convert-to
 
 return aResult;
 }
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 873e5c598bab..21137a7bb1b6 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2412,16 +2412,44 @@ bool ScDocShell::ConvertTo( SfxMedium  )
 weld::WaitObject aWait( GetActiveDialogParent() );
 ScImportOptions aOptions( sItStr );
 
-if (aOptions.bNewFilePerSheet)
+if (aOptions.nSheetToExport)
 {
+// Only from command line --convert-to
 bRet = true;
 
+SCTAB nStartTab;
+SCTAB nCount = m_aDocument.GetTableCount();
+if (aOptions.nSheetToExport == -1)
+{
+// All sheets.
+nStartTab = 0;
+}
+else if (0 < aOptions.nSheetToExport && aOptions

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

2021-07-15 Thread Eike Rathke (via logerrit)
 desktop/source/app/dispatchwatcher.cxx |   13 ++--
 sc/source/ui/dbgui/imoptdlg.cxx|   15 +++---
 sc/source/ui/docshell/docsh.cxx|   34 ++---
 sc/source/ui/inc/imoptdlg.hxx  |8 +++
 4 files changed, 58 insertions(+), 12 deletions(-)

New commits:
commit fda91f8be16ba760e360940ebafd6244c648cb8c
Author: Eike Rathke 
AuthorDate: Thu Jul 15 10:37:57 2021 +0200
Commit: Eike Rathke 
CommitDate: Thu Jul 15 13:02:04 2021 +0200

Related: tdf#135762 Allow --convert-to csv to specify 1-based sheet number

Same multifile mechanism as for -1 all sheets is used, so

soffice --convert-to csv:"Text - txt - csv 
(StarCalc)":44,34,UTF8,1,,0,false,true,false,false,false,2 sample.ods

writes a file sample-Sheet2.csv

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

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 8541c273cc83..1c4d878614c5 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -625,11 +625,20 @@ bool DispatchWatcher::executeDispatchRequests( const 
std::vector0 then that sheet 
(1-based) with the output
+// filename concatenated with the 
sheet name. So even if
+// that is a single file, the multi 
file target mechanism is
+// used.
+const OUString 
aTok(sFilterOptions.getToken(11, ',', nIdx));
+// Actual validity is checked in Calc, 
here just check for
+// presence of numeric value at start.
+bMultiFileTarget = (!aTok.isEmpty() && 
aTok.toInt32() != 0);
 }
 
 conversionProperties[1].Value <<= 
sFilterName;
diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx
index d8c4fd810ea3..a362e4df0ee7 100644
--- a/sc/source/ui/dbgui/imoptdlg.cxx
+++ b/sc/source/ui/dbgui/imoptdlg.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -43,7 +44,7 @@ ScImportOptions::ScImportOptions( const OUString& rStr )
 bSaveNumberAsSuch = true;
 bSaveFormulas = false;
 bRemoveSpace = false;
-bNewFilePerSheet = false;
+nSheetToExport = 0;
 sal_Int32 nTokenCount = comphelper::string::getTokenCount(rStr, ',');
 if ( nTokenCount < 3 )
 return;
@@ -79,7 +80,15 @@ ScImportOptions::ScImportOptions( const OUString& rStr )
 if ( nTokenCount >= 11 )
 bRemoveSpace = rStr.getToken(0, ',', nIdx) == "true";
 if ( nTokenCount >= 12 )
-bNewFilePerSheet = rStr.getToken(0, ',', nIdx) == "-1";
+{
+const OUString aTok(rStr.getToken(0, ',', nIdx));
+if (aTok == "-1")
+nSheetToExport = -1;// all
+else if (aTok.isEmpty() || CharClass::isAsciiNumeric(aTok))
+nSheetToExport = aTok.toInt32();
+else
+nSheetToExport = -23;   // invalid, force error
+}
 }
 }
 
@@ -104,7 +113,7 @@ OUString ScImportOptions::BuildString() const
 "," +
 OUString::boolean( bRemoveSpace ) +  // same as "Remove space" in 
ScAsciiOptions
 "," +
-std::u16string_view(bNewFilePerSheet ? u"-1" : u"0") ;  // Only 
available for command line --convert-to
+OUString::number(nSheetToExport) ;  // Only available for command 
line --convert-to
 
 return aResult;
 }
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 873e5c598bab..21137a7bb1b6 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2412,16 +2412,44 @@ bool ScDocShell::ConvertTo( SfxMedium  )
 weld::WaitObject aWait( GetActiveDialogParent() );
 ScImportOptions aOptions( sItStr );
 
-if (aOptions.bNewFilePerSheet)
+if (aOptions.nSheetToExport)
 {
+// Only from command line --convert-to
 bRet = true;
 
+SCTAB nStartTab;
+SCTAB nCount = m_aDocument.GetTableCount();
+if (aOptions.nSheetToExport == -1)
+{
+// All sheets.
+nStartTab = 0;
+}
+else if (0 < aOptions.nSheetToExport && aOptions.nSheetToExport <= 
nCount)
+{
+// One sheet, 1-based.
+nCount = aOptions.nSheetToExport;
+nStartTab = nCount - 1;
+

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

2021-07-12 Thread Eike Rathke (via logerrit)
 i18nlangtag/source/isolang/isolang.cxx |1 +
 include/i18nlangtag/lang.h |1 +
 2 files changed, 2 insertions(+)

New commits:
commit 815817fa8f5c04bd20965691d72c83659b082745
Author: Eike Rathke 
AuthorDate: Mon Jul 12 18:53:46 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Jul 12 23:48:37 2021 +0200

Resolves: tdf#123466 Add Microsoft ill-used {x-none} to known language tags

'x-none' is a private-use tag and letting it escape into the wild
isn't such a private use..

This just prevents the lt_string_value assertion that doesn't harm
anyway but seems to confuse people and makes the tag known to
LibreOffice with a reproducible assigned LCID instead of an
on-the-fly generated one.

Whatever it may take to actually support something tagged with
'x-none'.

Change-Id: I3f32c9ba18a2528584a112157509c1dfda75e29c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118788
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 4e0a7df2dfa10bc52d5dbda34f43e0bc0df22ae7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118794
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/i18nlangtag/source/isolang/isolang.cxx 
b/i18nlangtag/source/isolang/isolang.cxx
index 1ca95bb35244..941a73b25766 100644
--- a/i18nlangtag/source/isolang/isolang.cxx
+++ b/i18nlangtag/source/isolang/isolang.cxx
@@ -955,6 +955,7 @@ IsoLangOtherEntry const aImplPrivateUseEntries[] =
 { LANGUAGE_USER_PRIV_NOTRANSLATE,   "x-no-translate" }, //! not BCP47 
but legacy in .xcu configmgr
 { LANGUAGE_USER_PRIV_DEFAULT,   "x-default"  },
 { LANGUAGE_USER_PRIV_COMMENT,   "x-comment"  },
+{ LANGUAGE_USER_PRIV_NONE,  "x-none" },
 { LANGUAGE_USER_PRIV_JOKER, "*"  }, //! not BCP47 
but transferable in configmgr
 { LANGUAGE_DONTKNOW,nullptr }  // marks 
end of table
 };
diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h
index b4b6aa69fa6d..c319b068b215 100644
--- a/include/i18nlangtag/lang.h
+++ b/include/i18nlangtag/lang.h
@@ -781,6 +781,7 @@ namespace o3tl
 #define LANGUAGE_ON_THE_FLY_SUB_END LanguageType(0x3E)
 
 /* 0xFFE0 to 0x reserved for privateuse and specials. */
+#define LANGUAGE_USER_PRIV_NONE LanguageType(0xFFEA)  /* 
privateuse "x-none", MS ill-escaped into the wild, primary 0x3ea, sub 0x3f */
 #define LANGUAGE_USER_PRIV_JOKERLanguageType(0xFFEB)  /* 
privateuse "*" (sic! bad! nasty!), primary 0x3eb, sub 0x3f */
 #define LANGUAGE_USER_PRIV_COMMENT  LanguageType(0xFFEC)  /* 
privateuse "x-comment", primary 0x3ec, sub 0x3f */
 #define LANGUAGE_USER_PRIV_DEFAULT  LanguageType(0xFFED)  /* 
privateuse "x-default", primary 0x3ed, sub 0x3f */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-12 Thread Eike Rathke (via logerrit)
 i18nlangtag/source/isolang/isolang.cxx |1 +
 include/i18nlangtag/lang.h |1 +
 2 files changed, 2 insertions(+)

New commits:
commit 4e0a7df2dfa10bc52d5dbda34f43e0bc0df22ae7
Author: Eike Rathke 
AuthorDate: Mon Jul 12 18:53:46 2021 +0200
Commit: Eike Rathke 
CommitDate: Mon Jul 12 22:00:10 2021 +0200

Resolves: tdf#123466 Add Microsoft ill-used {x-none} to known language tags

'x-none' is a private-use tag and letting it escape into the wild
isn't such a private use..

This just prevents the lt_string_value assertion that doesn't harm
anyway but seems to confuse people and makes the tag known to
LibreOffice with a reproducible assigned LCID instead of an
on-the-fly generated one.

Whatever it may take to actually support something tagged with
'x-none'.

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

diff --git a/i18nlangtag/source/isolang/isolang.cxx 
b/i18nlangtag/source/isolang/isolang.cxx
index 1ca95bb35244..941a73b25766 100644
--- a/i18nlangtag/source/isolang/isolang.cxx
+++ b/i18nlangtag/source/isolang/isolang.cxx
@@ -955,6 +955,7 @@ IsoLangOtherEntry const aImplPrivateUseEntries[] =
 { LANGUAGE_USER_PRIV_NOTRANSLATE,   "x-no-translate" }, //! not BCP47 
but legacy in .xcu configmgr
 { LANGUAGE_USER_PRIV_DEFAULT,   "x-default"  },
 { LANGUAGE_USER_PRIV_COMMENT,   "x-comment"  },
+{ LANGUAGE_USER_PRIV_NONE,  "x-none" },
 { LANGUAGE_USER_PRIV_JOKER, "*"  }, //! not BCP47 
but transferable in configmgr
 { LANGUAGE_DONTKNOW,nullptr }  // marks 
end of table
 };
diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h
index b4b6aa69fa6d..c319b068b215 100644
--- a/include/i18nlangtag/lang.h
+++ b/include/i18nlangtag/lang.h
@@ -781,6 +781,7 @@ namespace o3tl
 #define LANGUAGE_ON_THE_FLY_SUB_END LanguageType(0x3E)
 
 /* 0xFFE0 to 0x reserved for privateuse and specials. */
+#define LANGUAGE_USER_PRIV_NONE LanguageType(0xFFEA)  /* 
privateuse "x-none", MS ill-escaped into the wild, primary 0x3ea, sub 0x3f */
 #define LANGUAGE_USER_PRIV_JOKERLanguageType(0xFFEB)  /* 
privateuse "*" (sic! bad! nasty!), primary 0x3eb, sub 0x3f */
 #define LANGUAGE_USER_PRIV_COMMENT  LanguageType(0xFFEC)  /* 
privateuse "x-comment", primary 0x3ec, sub 0x3f */
 #define LANGUAGE_USER_PRIV_DEFAULT  LanguageType(0xFFED)  /* 
privateuse "x-default", primary 0x3ed, sub 0x3f */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: lt_string_value assertion and MS x-none languagetag

2021-07-12 Thread Eike Rathke
Hi,

On Monday, 2021-07-12 15:13:52 +0200, Eike Rathke wrote:

> document contains it in ./word/settings.xml as
> 

There exists even a bug for such
https://bugs.documentfoundation.org/show_bug.cgi?id=123466
in which, even worse, MS uses 'x-none' in ./word/styles.xml

  Eike

-- 
GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A


signature.asc
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


lt_string_value assertion and MS x-none languagetag (was: testVerticallyMergedCellBorder failing on some systems)

2021-07-12 Thread Eike Rathke
Hi,

On Saturday, 2021-07-10 10:00:31 +0300, Ilmari Lauhakangas wrote:

> [CUT] sw_core_layout
> [_RUN_] testVerticallyMergedCellBorder::TestBody
> E: lt_string_value: assertion `string != ((void *)0)' failed
> E: lt_string_value: assertion `string != ((void *)0)' failed
> E: lt_string_value: assertion `string != ((void *)0)' failed
> E: lt_string_value: assertion `string != ((void *)0)' failed

Unrelated to the test failing or not, but I wondered why those
assertions came up and loading the test doc
sw/qa/core/layout/data/vmerge-cell-border.docx
manually yields the same along with

E: lt_string_value: assertion `string != ((void *)0)' failed
warn:i18nlangtag:815276:815276:i18nlangtag/source/languagetag/languagetag.cxx:1587:
 LanguageTag::getLanguageFromLangtag: pLangT==NULL for 'x-none'
warn:i18nlangtag:815276:815276:i18nlangtag/source/languagetag/languagetag.cxx:1645:
 LanguageTag::getRegionFromLangtag: pRegionT==NULL for 'x-none'

We do not have any private language tag 'x-none' in our code base and
also grepping over all workdir/UnpackedTarball didn't reveal any but the
document contains it in ./word/settings.xml as


Breaking in LanguageTag implementation revealed that it's passed to
writerfilter/source/dmapper/ThemeTable.cxx
ThemeTable::setThemeFontLangProperties()
the PropertyValue aPropSeq contains
eastAsia = "x-none"
bidi = "x-none"

So apparently this private use languagetag is not so privately used by
MS-Word and escapes to the outer world. Am I guessing right that it
denotes the absence of Asian and CTL font features? Should we handle it
explicitly as a known languagetag? Does anything rely on a valid
conversion to LCID or lang::Locale and back? (I'd guess so..)

  Eike

-- 
GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A


signature.asc
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2021-07-08 Thread Eike Rathke (via logerrit)
 editeng/source/editeng/editdoc.cxx |2 
 include/svl/nfkeytab.hxx   |2 
 include/svl/zforlist.hxx   |4 -
 include/svl/zformat.hxx|3 -
 svl/source/numbers/zforlist.cxx|  104 ++---
 svl/source/numbers/zformat.cxx |6 +-
 svl/source/numbers/zforscan.cxx|   13 +++-
 svl/source/numbers/zforscan.hxx|2 
 8 files changed, 107 insertions(+), 29 deletions(-)

New commits:
commit b92718fe3e9c873dc7d5a3aee66fb2adb780861a
Author: Eike Rathke 
AuthorDate: Wed Jul 7 20:50:28 2021 +0200
Commit: Caolán McNamara 
CommitDate: Thu Jul 8 11:54:00 2021 +0200

Resolves: tdf#122191 BOOLEAN is a keyword, treat it as such

... to not end up with "BOOL"E"AN" instead, which is a date type
with an era year and literal strings.

This never worked but only was uncovered by

commit ce4fc2fc08be8ea2773194e303ed42d2579e93a0
CommitDate: Fri Mar 2 20:27:45 2018 +0100

Resolves: tdf#115351 convert boolean equivalent format codes to 
proper Boolean

if the format also had to be converted between locales.

Also preserve boolean equivalent formats during Excel export and
try hard to convert back as much as possible if a literal boolean
string format is a Boolean equivalent of the target locale.

Change-Id: I54f65c276cbf7bb99e960b6d7053c5fa95fbccb6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118591
    Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 7a58221f800e215934cbcb2d3907c35b44981611)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118510
Reviewed-by: Caolán McNamara 

diff --git a/include/svl/nfkeytab.hxx b/include/svl/nfkeytab.hxx
index fe1e3bb69ec5..3b8140498128 100644
--- a/include/svl/nfkeytab.hxx
+++ b/include/svl/nfkeytab.hxx
@@ -71,13 +71,13 @@ enum NfKeywordIndex
 NF_KEY_WW,  // week of year, as of version 8, 19.06.98
 NF_KEY_THAI_T,  // Thai T modifier, speciality of Thai Excel, only 
used with Thai locale and converted to [NatNum1]
 NF_KEY_CCC, // currency bank symbol (old version)
+NF_KEY_BOOLEAN, // boolean
 NF_KEY_GENERAL, // General / Standard
 NF_KEY_LASTKEYWORD = NF_KEY_GENERAL,
 
 // Reserved words translated and color names follow:
 NF_KEY_TRUE,// boolean true
 NF_KEY_FALSE,   // boolean false
-NF_KEY_BOOLEAN, // boolean
 NF_KEY_COLOR,   // color
 NF_KEY_FIRSTCOLOR,
 NF_KEY_BLACK = NF_KEY_FIRSTCOLOR,   // you do know colors, don't you?
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index 7a8703873460..c3d82d7b109a 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -473,7 +473,7 @@ public:
 nKey contains the index key of the format.
  */
 bool PutEntry( OUString& rString, sal_Int32& nCheckPos, SvNumFormatType& 
nType, sal_uInt32& nKey,
-   LanguageType eLnge = LANGUAGE_DONTKNOW );
+   LanguageType eLnge = LANGUAGE_DONTKNOW, bool 
bReplaceBooleanEquivalent = true );
 
 /** Same as PutEntry but the format code string is
  considered to be of language/country eLnge and is converted to
@@ -481,7 +481,7 @@ public:
 bool PutandConvertEntry( OUString& rString, sal_Int32& nCheckPos,
  SvNumFormatType& nType, sal_uInt32& nKey,
  LanguageType eLnge, LanguageType eNewLnge,
- bool bConvertDateOrder );
+ bool bConvertDateOrder, bool 
bReplaceBooleanEquivalent = true );
 
 /** Same as PutandConvertEntry but the format code string
  is considered to be of the System language/country eLnge and is
diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index 543c5967804c..976488257218 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -171,7 +171,8 @@ public:
ImpSvNumberformatScan* pSc,
ImpSvNumberInputScan* pISc,
sal_Int32& nCheckPos,
-   LanguageType& eLan );
+   LanguageType& eLan,
+   bool bReplaceBooleanEquivalent = true );
 
 // Copy ctor
 SvNumberformat( SvNumberformat const & rFormat );
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index b1885ad4a94a..0a2f699f81ec 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -569,7 +569,8 @@ bool SvNumberFormatter::PutEntry(OUString& rString,
  sal_Int32& nCheckPos,
  SvNumFormatType& nType,
  sal_uInt32& nKey,  // format key
- LanguageType eLnge)
+ LanguageType eL

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

2021-07-07 Thread Eike Rathke (via logerrit)
 include/svl/nfkeytab.hxx|2 
 include/svl/zforlist.hxx|4 -
 include/svl/zformat.hxx |3 -
 svl/source/numbers/zforlist.cxx |  104 
 svl/source/numbers/zformat.cxx  |6 +-
 svl/source/numbers/zforscan.cxx |   13 +++--
 svl/source/numbers/zforscan.hxx |2 
 7 files changed, 105 insertions(+), 29 deletions(-)

New commits:
commit 7a58221f800e215934cbcb2d3907c35b44981611
Author: Eike Rathke 
AuthorDate: Wed Jul 7 20:50:28 2021 +0200
Commit: Eike Rathke 
CommitDate: Thu Jul 8 00:14:08 2021 +0200

Resolves: tdf#122191 BOOLEAN is a keyword, treat it as such

... to not end up with "BOOL"E"AN" instead, which is a date type
with an era year and literal strings.

This never worked but only was uncovered by

commit ce4fc2fc08be8ea2773194e303ed42d2579e93a0
CommitDate: Fri Mar 2 20:27:45 2018 +0100

Resolves: tdf#115351 convert boolean equivalent format codes to 
proper Boolean

if the format also had to be converted between locales.

Also preserve boolean equivalent formats during Excel export and
try hard to convert back as much as possible if a literal boolean
string format is a Boolean equivalent of the target locale.

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

diff --git a/include/svl/nfkeytab.hxx b/include/svl/nfkeytab.hxx
index fe1e3bb69ec5..3b8140498128 100644
--- a/include/svl/nfkeytab.hxx
+++ b/include/svl/nfkeytab.hxx
@@ -71,13 +71,13 @@ enum NfKeywordIndex
 NF_KEY_WW,  // week of year, as of version 8, 19.06.98
 NF_KEY_THAI_T,  // Thai T modifier, speciality of Thai Excel, only 
used with Thai locale and converted to [NatNum1]
 NF_KEY_CCC, // currency bank symbol (old version)
+NF_KEY_BOOLEAN, // boolean
 NF_KEY_GENERAL, // General / Standard
 NF_KEY_LASTKEYWORD = NF_KEY_GENERAL,
 
 // Reserved words translated and color names follow:
 NF_KEY_TRUE,// boolean true
 NF_KEY_FALSE,   // boolean false
-NF_KEY_BOOLEAN, // boolean
 NF_KEY_COLOR,   // color
 NF_KEY_FIRSTCOLOR,
 NF_KEY_BLACK = NF_KEY_FIRSTCOLOR,   // you do know colors, don't you?
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index 7a8703873460..c3d82d7b109a 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -473,7 +473,7 @@ public:
 nKey contains the index key of the format.
  */
 bool PutEntry( OUString& rString, sal_Int32& nCheckPos, SvNumFormatType& 
nType, sal_uInt32& nKey,
-   LanguageType eLnge = LANGUAGE_DONTKNOW );
+   LanguageType eLnge = LANGUAGE_DONTKNOW, bool 
bReplaceBooleanEquivalent = true );
 
 /** Same as PutEntry but the format code string is
  considered to be of language/country eLnge and is converted to
@@ -481,7 +481,7 @@ public:
 bool PutandConvertEntry( OUString& rString, sal_Int32& nCheckPos,
  SvNumFormatType& nType, sal_uInt32& nKey,
  LanguageType eLnge, LanguageType eNewLnge,
- bool bConvertDateOrder );
+ bool bConvertDateOrder, bool 
bReplaceBooleanEquivalent = true );
 
 /** Same as PutandConvertEntry but the format code string
  is considered to be of the System language/country eLnge and is
diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index 543c5967804c..976488257218 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -171,7 +171,8 @@ public:
ImpSvNumberformatScan* pSc,
ImpSvNumberInputScan* pISc,
sal_Int32& nCheckPos,
-   LanguageType& eLan );
+   LanguageType& eLan,
+   bool bReplaceBooleanEquivalent = true );
 
 // Copy ctor
 SvNumberformat( SvNumberformat const & rFormat );
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index b1885ad4a94a..0a2f699f81ec 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -569,7 +569,8 @@ bool SvNumberFormatter::PutEntry(OUString& rString,
  sal_Int32& nCheckPos,
  SvNumFormatType& nType,
  sal_uInt32& nKey,  // format key
- LanguageType eLnge)
+ LanguageType eLnge,
+ bool bReplaceBooleanEquivalent)
 {
 ::osl::MutexGuard aGuard( GetInstanceMutex() );
 nKey = 0;
@@ -589,7 +590,8 @@ bool SvNumberFormatter::PutEntry(OUString& rStr

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

2021-07-07 Thread Eike Rathke (via logerrit)
 vcl/source/control/field2.cxx |   74 +-
 1 file changed, 3 insertions(+), 71 deletions(-)

New commits:
commit 0d3ffda9615ad48679e61d606004de65154cdbfb
Author: Eike Rathke 
AuthorDate: Wed Jul 7 00:22:15 2021 +0200
Commit: Eike Rathke 
CommitDate: Wed Jul 7 10:38:57 2021 +0200

DateFormatter: use Date::AddDays(), AddMonths(), AddYears()

... that do all the checks and normalize.

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

diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 64cc39dfb276..d73e2d8900c4 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1594,87 +1594,19 @@ OUString DateFormatter::ImplGetDateAsText( const Date& 
rDate ) const
 static void ImplDateIncrementDay( Date& rDate, bool bUp )
 {
 DateFormatter::ExpandCentury( rDate );
-
-if ( bUp )
-{
-if ( (rDate.GetDay() != 31) || (rDate.GetMonth() != 12) || 
(rDate.GetYear() != SAL_MAX_INT16) )
-++rDate;
-}
-else
-{
-if ( (rDate.GetDay() != 1 ) || (rDate.GetMonth() != 1) || 
(rDate.GetYear() != SAL_MIN_INT16) )
---rDate;
-}
+rDate.AddDays( bUp ? 1 : -1 );
 }
 
 static void ImplDateIncrementMonth( Date& rDate, bool bUp )
 {
 DateFormatter::ExpandCentury( rDate );
-
-sal_uInt16 nMonth = rDate.GetMonth();
-sal_Int16 nYear = rDate.GetYear();
-if ( bUp )
-{
-if ( (nMonth == 12) && (nYear < SAL_MAX_INT16) )
-{
-rDate.SetMonth( 1 );
-rDate.SetYear( rDate.GetNextYear() );
-}
-else
-{
-if ( nMonth < 12 )
-rDate.SetMonth( nMonth + 1 );
-}
-}
-else
-{
-if ( (nMonth == 1) && (nYear > SAL_MIN_INT16) )
-{
-rDate.SetMonth( 12 );
-rDate.SetYear( rDate.GetPrevYear() );
-}
-else
-{
-if ( nMonth > 1 )
-rDate.SetMonth( nMonth - 1 );
-}
-}
-
-sal_uInt16 nDaysInMonth = Date::GetDaysInMonth( rDate.GetMonth(), 
rDate.GetYear());
-if ( rDate.GetDay() > nDaysInMonth )
-rDate.SetDay( nDaysInMonth );
+rDate.AddMonths( bUp ? 1 : -1 );
 }
 
 static void ImplDateIncrementYear( Date& rDate, bool bUp )
 {
 DateFormatter::ExpandCentury( rDate );
-
-sal_Int16 nYear = rDate.GetYear();
-sal_uInt16 nMonth = rDate.GetMonth();
-if ( bUp )
-{
-if ( nYear < SAL_MAX_INT16 )
-rDate.SetYear( rDate.GetNextYear() );
-}
-else
-{
-if ( nYear > SAL_MIN_INT16 )
-rDate.SetYear( rDate.GetPrevYear() );
-}
-if (nMonth != 2)
-return;
-
-// Handle February 29 from leap year to non-leap year.
-sal_uInt16 nDay = rDate.GetDay();
-if (nDay > 28)
-{
-// The check would not be necessary if it was guaranteed that the
-// date was valid before and actually was a leap year,
-// de-/incrementing a leap year with 29 always results in 28.
-sal_uInt16 nDaysInMonth = Date::GetDaysInMonth( nMonth, 
rDate.GetYear());
-if (nDay > nDaysInMonth)
-rDate.SetDay( nDaysInMonth);
-}
+rDate.AddYears( bUp ? 1 : -1 );
 }
 
 bool DateFormatter::ImplAllowMalformedInput() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-06 Thread Eike Rathke (via logerrit)
 include/unotools/localedatawrapper.hxx |   14 ++--
 svl/source/numbers/zforfind.cxx|2 -
 unotools/source/i18n/localedatawrapper.cxx |   48 ++---
 vcl/source/control/field2.cxx  |   23 +
 4 files changed, 64 insertions(+), 23 deletions(-)

New commits:
commit f94c004a978a43616266ed43e91d9d129e985da2
Author: Eike Rathke 
AuthorDate: Tue Jul 6 14:05:58 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Jul 6 21:20:41 2021 +0200

Related: tdf#125035 Introduce LongDateOrder and handle YDM in DateFormatter

This fixes also

unotools/source/i18n/localedatawrapper.cxx:1473: 
LocaleDataWrapper::scanDateOrder: no magic applicable
lv-LV requested
lv-LV loaded

that is the only locale with a YDM long date order.

Change-Id: I776b8706bf5bd3ec11cc46d38fd3613c8df7519f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118482
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 5e3bfdeb5ea4878a2546a7e1e16d0f3b6482024e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118520

diff --git a/include/unotools/localedatawrapper.hxx 
b/include/unotools/localedatawrapper.hxx
index 70108f8af86a..0a0832b64a13 100644
--- a/include/unotools/localedatawrapper.hxx
+++ b/include/unotools/localedatawrapper.hxx
@@ -52,6 +52,14 @@ enum class DateOrder {
 YMD,
 };
 
+enum class LongDateOrder {
+Invalid = -1,
+MDY = 0,
+DMY,
+YMD,
+YDM
+};
+
 enum class MeasurementSystem {
 Metric,
 US
@@ -80,7 +88,7 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper
 OUStringaCurrSymbol;
 OUStringaCurrBankSymbol;
 DateOrder   nDateOrder;
-DateOrder   nLongDateOrder;
+LongDateOrder   nLongDateOrder;
 sal_uInt16  nCurrPositiveFormat;
 sal_uInt16  nCurrNegativeFormat;
 sal_uInt16  nCurrDigits;
@@ -100,7 +108,7 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper
 sal_Int32& nBlank, sal_Int32& nSym ) const;
 
 voidloadDateOrders();
-DateOrder   scanDateOrderImpl( const OUString& rCode ) const;
+LongDateOrder   scanDateOrderImpl( const OUString& rCode ) const;
 
 voidImplAddFormatNum( rtl::OUStringBuffer& rBuf,
 sal_Int64 nNumber, sal_uInt16 nDecimals,
@@ -299,7 +307,7 @@ public:
 
 // simple date and time formatting
 DateOrder  getDateOrder() const;
-DateOrder  getLongDateOrder() const;
+LongDateOrder  getLongDateOrder() const;
 /// only numerical values of Gregorian calendar
 OUString   getDate( const Date& rDate ) const;
 OUString   getTime( const tools::Time& rTime, bool bSec = true,
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 4f5fd03ce6be..8b01debbb1d4 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -2728,7 +2728,7 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& 
rString, sal_uInt16 nS
 switch (eScannedType)
 {
 case SvNumFormatType::DATE:
-if (nMonthPos == 1 && pLoc->getLongDateOrder() == DateOrder::MDY)
+if (nMonthPos == 1 && pLoc->getLongDateOrder() == 
LongDateOrder::MDY)
 {
 // #68232# recognize long date separators like ", " in 
"September 5, 1999"
 if (SkipString( pLoc->getLongDateDaySep(), rString, nPos ))
diff --git a/unotools/source/i18n/localedatawrapper.cxx 
b/unotools/source/i18n/localedatawrapper.cxx
index 9765cec1062a..fb70c0657a73 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -691,12 +691,12 @@ DateOrder LocaleDataWrapper::getDateOrder() const
 return nDateOrder;
 }
 
-DateOrder LocaleDataWrapper::getLongDateOrder() const
+LongDateOrder LocaleDataWrapper::getLongDateOrder() const
 {
 return nLongDateOrder;
 }
 
-DateOrder LocaleDataWrapper::scanDateOrderImpl( const OUString& rCode ) const
+LongDateOrder LocaleDataWrapper::scanDateOrderImpl( const OUString& rCode ) 
const
 {
 // Only some european versions were translated, the ones with different
 // keyword combinations are:
@@ -760,18 +760,40 @@ DateOrder LocaleDataWrapper::scanDateOrderImpl( const 
OUString& rCode ) const
 }
 // compare with <= because each position may equal rCode.getLength()
 if ( nDay <= nMonth && nMonth <= nYear )
-return DateOrder::DMY; // also if every position equals 
rCode.getLength()
+return LongDateOrder::DMY; // also if every position equals 
rCode.getLength()
 else if ( nMonth <= nDay && nDay <= nYear )
-return DateOrder::MDY;
+retur

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

2021-07-06 Thread Eike Rathke (via logerrit)
 include/unotools/localedatawrapper.hxx |   11 ---
 unotools/source/i18n/localedatawrapper.cxx |   40 -
 2 files changed, 51 deletions(-)

New commits:
commit fb938255c57bb1951ed44a7518ce29849e4f170a
Author: Eike Rathke 
AuthorDate: Tue Jul 6 12:25:05 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Jul 6 21:20:17 2021 +0200

Remove now unused LocaleDataWrapper::getLongDate()

Change-Id: I8e9614a4d77aa8b0c0e68a248ea57f921e3ed424
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118476
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 6e0b7d2aad6f1a041dd9e0e28aa4bf27eb3fc077)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118519

diff --git a/include/unotools/localedatawrapper.hxx 
b/include/unotools/localedatawrapper.hxx
index 1ec554a38b90..70108f8af86a 100644
--- a/include/unotools/localedatawrapper.hxx
+++ b/include/unotools/localedatawrapper.hxx
@@ -307,17 +307,6 @@ public:
 OUString   getDuration( const tools::Time& rTime,
 bool bSec = true, bool b100Sec = false ) const;
 
-/** The CalendarWrapper already MUST
-have loaded a calendar.
-@param bTwoDigitYear
- := full year
-  := year % 100
- */
-OUString   getLongDate( const Date& rDate,
-CalendarWrapper& rCal,
-bool bTwoDigitYear
-) const;
-
 /** Simple number formatting
 @param nNumber
 value * 10**nDecimals
diff --git a/unotools/source/i18n/localedatawrapper.cxx 
b/unotools/source/i18n/localedatawrapper.cxx
index 2bb6769c51ed..9765cec1062a 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -1160,46 +1160,6 @@ OUString LocaleDataWrapper::getTime( const tools::Time& 
rTime, bool bSec, bool b
 return aBuf.makeStringAndClear();
 }
 
-OUString LocaleDataWrapper::getLongDate( const Date& rDate, CalendarWrapper& 
rCal,
-bool bTwoDigitYear ) const
-{
-OUStringBuffer aBuf(20);
-OUStringBuffer aStr(120); // complete guess
-sal_Int16 nVal;
-rCal.setGregorianDateTime( rDate );
-// day of week
-nVal = rCal.getValue( CalendarFieldIndex::DAY_OF_WEEK );
-aStr.append(rCal.getDisplayName( CalendarDisplayIndex::DAY, nVal, 1 ));
-aStr.append(aLocaleDataItem.LongDateDayOfWeekSeparator);
-// day of month
-nVal = rCal.getValue( CalendarFieldIndex::DAY_OF_MONTH );
-ImplAdd2UNum( aBuf, nVal, false/*bDayOfMonthWithLeadingZero*/ );
-OUString aDay = aBuf.makeStringAndClear();
-// month of year
-nVal = rCal.getValue( CalendarFieldIndex::MONTH );
-OUString aMonth( rCal.getDisplayName( CalendarDisplayIndex::MONTH, nVal, 1 
) );
-// year
-nVal = rCal.getValue( CalendarFieldIndex::YEAR );
-if ( bTwoDigitYear )
-ImplAddUNum( aBuf, nVal % 100, 2 );
-else
-ImplAddUNum( aBuf, nVal );
-OUString aYear = aBuf.makeStringAndClear();
-// concatenate
-switch ( getLongDateOrder() )
-{
-case DateOrder::DMY :
-aStr.append(aDay + aLocaleDataItem.LongDateDaySeparator + aMonth + 
aLocaleDataItem.LongDateMonthSeparator + aYear);
-break;
-case DateOrder::MDY :
-aStr.append(aMonth + aLocaleDataItem.LongDateMonthSeparator + aDay 
+ aLocaleDataItem.LongDateDaySeparator + aYear);
-break;
-default:// YMD
-aStr.append(aYear + aLocaleDataItem.LongDateYearSeparator + aMonth 
+ aLocaleDataItem.LongDateMonthSeparator + aDay);
-}
-return aStr.makeStringAndClear();
-}
-
 OUString LocaleDataWrapper::getDuration( const tools::Time& rTime, bool bSec, 
bool b100Sec ) const
 {
 OUStringBuffer aBuf(128);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


<    3   4   5   6   7   8   9   10   11   12   >