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

2014-07-02 Thread Eike Rathke
 svl/source/numbers/zforfind.cxx |   31 ++-
 1 file changed, 30 insertions(+), 1 deletion(-)

New commits:
commit 836e504c859a5b67f7ab7ba842785951d41058cd
Author: Eike Rathke 
Date:   Wed Jul 2 22:24:52 2014 +0200

resolved fdo#80166 check input against date acceptance pattern plausibility

... to prevent confusion of #.### input with D.M that then later is
discarded as invalid date input instead of accepted as valid numeric
input.

Change-Id: I178e28b7ef3b26d04eecc73e5e5c61ee41f89e32

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index d63fd56..c2946c3 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1174,6 +1174,8 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( 
sal_uInt16 nStartPatternAt )
 }
 nDatePatternStart = nStartPatternAt; // remember start particle
 
+const sal_Int32 nMonthsInYear = 
pFormatter->GetCalendar()->getNumberOfMonthsInYear();
+
 for (sal_Int32 nPattern=0; nPattern < sDateAcceptancePatterns.getLength(); 
++nPattern)
 {
 sal_uInt16 nNext = nDatePatternStart;
@@ -1183,12 +1185,39 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( 
sal_uInt16 nStartPatternAt )
 sal_Int32 nPat = 0;
 for ( ; nPat < rPat.getLength() && bOk && nNext < nAnzStrings; ++nPat, 
++nNext)
 {
-switch (rPat[nPat])
+const sal_Unicode c = rPat[nPat];
+switch (c)
 {
 case 'Y':
 case 'M':
 case 'D':
 bOk = IsNum[nNext];
+if (bOk && (c == 'M' || c == 'D'))
+{
+// Check the D and M cases for plausibility. This also
+// prevents recognition of date instead of number with a
+// numeric group input if date separator is identical to
+// group separator, for example with D.M as a pattern and
+// #.### as a group.
+sal_Int32 nMaxLen, nMaxVal;
+switch (c)
+{
+case 'M':
+nMaxLen = 2;
+nMaxVal = nMonthsInYear;
+break;
+case 'D':
+nMaxLen = 2;
+nMaxVal = 31;
+break;
+}
+bOk = (sStrArray[nNext].getLength() <= nMaxLen);
+if (bOk)
+{
+sal_Int32 nNum = sStrArray[nNext].toInt32();
+bOk = (1 <= nNum && nNum <= nMaxVal);
+}
+}
 if (bOk)
 ++nDatePatternNumbers;
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-02 Thread Eike Rathke
 svl/source/numbers/zforfind.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 397362d8532d7b0abe38f2024dd2cefe2482d6a3
Author: Eike Rathke 
Date:   Thu Jul 3 00:08:51 2014 +0200

work around nonsense -Werror=maybe-uninitialized, fdo#80166 follow-up

Change-Id: I0f9cf74550e43d174bf6ac75e70c51ab7f51ccf8

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index c2946c3..993b712 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1210,6 +1210,13 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( 
sal_uInt16 nStartPatternAt )
 nMaxLen = 2;
 nMaxVal = 31;
 break;
+default:
+// This merely exists against
+// -Werror=maybe-uninitialized, which is nonsense
+// after the (c == 'M' || c == 'D') check above,
+// but ...
+nMaxLen = 2;
+nMaxVal = 31;
 }
 bOk = (sStrArray[nNext].getLength() <= nMaxLen);
 if (bOk)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - svl/source

2014-07-02 Thread Eike Rathke
 svl/source/numbers/zforfind.cxx |   38 +-
 1 file changed, 37 insertions(+), 1 deletion(-)

New commits:
commit c4eb0e2e0a2c14d53cad999a3c0f1c1048914a4f
Author: Eike Rathke 
Date:   Wed Jul 2 22:24:52 2014 +0200

resolved fdo#80166 check input against date acceptance pattern plausibility

... to prevent confusion of #.### input with D.M that then later is
discarded as invalid date input instead of accepted as valid numeric
input.

(cherry picked from commit 836e504c859a5b67f7ab7ba842785951d41058cd)

work around nonsense -Werror=maybe-uninitialized, fdo#80166 follow-up

(cherry picked from commit 397362d8532d7b0abe38f2024dd2cefe2482d6a3)

0f9cf74550e43d174bf6ac75e70c51ab7f51ccf8

Change-Id: I178e28b7ef3b26d04eecc73e5e5c61ee41f89e32
Reviewed-on: https://gerrit.libreoffice.org/10035
Tested-by: David Tardon 
Reviewed-by: David Tardon 

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index d63fd56..993b712 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1174,6 +1174,8 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( 
sal_uInt16 nStartPatternAt )
 }
 nDatePatternStart = nStartPatternAt; // remember start particle
 
+const sal_Int32 nMonthsInYear = 
pFormatter->GetCalendar()->getNumberOfMonthsInYear();
+
 for (sal_Int32 nPattern=0; nPattern < sDateAcceptancePatterns.getLength(); 
++nPattern)
 {
 sal_uInt16 nNext = nDatePatternStart;
@@ -1183,12 +1185,46 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( 
sal_uInt16 nStartPatternAt )
 sal_Int32 nPat = 0;
 for ( ; nPat < rPat.getLength() && bOk && nNext < nAnzStrings; ++nPat, 
++nNext)
 {
-switch (rPat[nPat])
+const sal_Unicode c = rPat[nPat];
+switch (c)
 {
 case 'Y':
 case 'M':
 case 'D':
 bOk = IsNum[nNext];
+if (bOk && (c == 'M' || c == 'D'))
+{
+// Check the D and M cases for plausibility. This also
+// prevents recognition of date instead of number with a
+// numeric group input if date separator is identical to
+// group separator, for example with D.M as a pattern and
+// #.### as a group.
+sal_Int32 nMaxLen, nMaxVal;
+switch (c)
+{
+case 'M':
+nMaxLen = 2;
+nMaxVal = nMonthsInYear;
+break;
+case 'D':
+nMaxLen = 2;
+nMaxVal = 31;
+break;
+default:
+// This merely exists against
+// -Werror=maybe-uninitialized, which is nonsense
+// after the (c == 'M' || c == 'D') check above,
+// but ...
+nMaxLen = 2;
+nMaxVal = 31;
+}
+bOk = (sStrArray[nNext].getLength() <= nMaxLen);
+if (bOk)
+{
+sal_Int32 nNum = sStrArray[nNext].toInt32();
+bOk = (1 <= nNum && nNum <= nMaxVal);
+}
+}
 if (bOk)
 ++nDatePatternNumbers;
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-02 Thread Eike Rathke
 svl/source/numbers/zforfind.cxx |   38 +-
 1 file changed, 37 insertions(+), 1 deletion(-)

New commits:
commit b2b577b0ea15682b45fa68d9ac9e97e8be4e
Author: Eike Rathke 
Date:   Wed Jul 2 22:24:52 2014 +0200

resolved fdo#80166 check input against date acceptance pattern plausibility

... to prevent confusion of #.### input with D.M that then later is
discarded as invalid date input instead of accepted as valid numeric
input.

(cherry picked from commit 836e504c859a5b67f7ab7ba842785951d41058cd)

work around nonsense -Werror=maybe-uninitialized, fdo#80166 follow-up

(cherry picked from commit 397362d8532d7b0abe38f2024dd2cefe2482d6a3)

0f9cf74550e43d174bf6ac75e70c51ab7f51ccf8

Change-Id: I178e28b7ef3b26d04eecc73e5e5c61ee41f89e32
Reviewed-on: https://gerrit.libreoffice.org/10037
Tested-by: David Tardon 
Reviewed-by: David Tardon 

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 2302540..5aee40d 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1186,6 +1186,8 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( 
sal_uInt16 nStartPatternAt )
 }
 nDatePatternStart = nStartPatternAt; // remember start particle
 
+const sal_Int32 nMonthsInYear = 
pFormatter->GetCalendar()->getNumberOfMonthsInYear();
+
 for (sal_Int32 nPattern=0; nPattern < sDateAcceptancePatterns.getLength(); 
++nPattern)
 {
 sal_uInt16 nNext = nDatePatternStart;
@@ -1195,12 +1197,46 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( 
sal_uInt16 nStartPatternAt )
 sal_Int32 nPat = 0;
 for ( ; nPat < rPat.getLength() && bOk && nNext < nAnzStrings; ++nPat, 
++nNext)
 {
-switch (rPat[nPat])
+const sal_Unicode c = rPat[nPat];
+switch (c)
 {
 case 'Y':
 case 'M':
 case 'D':
 bOk = IsNum[nNext];
+if (bOk && (c == 'M' || c == 'D'))
+{
+// Check the D and M cases for plausibility. This also
+// prevents recognition of date instead of number with a
+// numeric group input if date separator is identical to
+// group separator, for example with D.M as a pattern and
+// #.### as a group.
+sal_Int32 nMaxLen, nMaxVal;
+switch (c)
+{
+case 'M':
+nMaxLen = 2;
+nMaxVal = nMonthsInYear;
+break;
+case 'D':
+nMaxLen = 2;
+nMaxVal = 31;
+break;
+default:
+// This merely exists against
+// -Werror=maybe-uninitialized, which is nonsense
+// after the (c == 'M' || c == 'D') check above,
+// but ...
+nMaxLen = 2;
+nMaxVal = 31;
+}
+bOk = (sStrArray[nNext].getLength() <= nMaxLen);
+if (bOk)
+{
+sal_Int32 nNum = sStrArray[nNext].toInt32();
+bOk = (1 <= nNum && nNum <= nMaxVal);
+}
+}
 if (bOk)
 ++nDatePatternNumbers;
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3-0' - svl/source

2014-07-03 Thread Eike Rathke
 svl/source/numbers/zforfind.cxx |   38 +-
 1 file changed, 37 insertions(+), 1 deletion(-)

New commits:
commit 04bca2bfab406e4e81d758e2b83bf470757fd7d1
Author: Eike Rathke 
Date:   Wed Jul 2 22:24:52 2014 +0200

resolved fdo#80166 check input against date acceptance pattern plausibility

... to prevent confusion of #.### input with D.M that then later is
discarded as invalid date input instead of accepted as valid numeric
input.

(cherry picked from commit 836e504c859a5b67f7ab7ba842785951d41058cd)

work around nonsense -Werror=maybe-uninitialized, fdo#80166 follow-up

(cherry picked from commit 397362d8532d7b0abe38f2024dd2cefe2482d6a3)

0f9cf74550e43d174bf6ac75e70c51ab7f51ccf8

Change-Id: I178e28b7ef3b26d04eecc73e5e5c61ee41f89e32
Reviewed-on: https://gerrit.libreoffice.org/10036
Reviewed-by: David Tardon 
Tested-by: Markus Mohrhard 
Reviewed-by: Markus Mohrhard 

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index d63fd56..993b712 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1174,6 +1174,8 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( 
sal_uInt16 nStartPatternAt )
 }
 nDatePatternStart = nStartPatternAt; // remember start particle
 
+const sal_Int32 nMonthsInYear = 
pFormatter->GetCalendar()->getNumberOfMonthsInYear();
+
 for (sal_Int32 nPattern=0; nPattern < sDateAcceptancePatterns.getLength(); 
++nPattern)
 {
 sal_uInt16 nNext = nDatePatternStart;
@@ -1183,12 +1185,46 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( 
sal_uInt16 nStartPatternAt )
 sal_Int32 nPat = 0;
 for ( ; nPat < rPat.getLength() && bOk && nNext < nAnzStrings; ++nPat, 
++nNext)
 {
-switch (rPat[nPat])
+const sal_Unicode c = rPat[nPat];
+switch (c)
 {
 case 'Y':
 case 'M':
 case 'D':
 bOk = IsNum[nNext];
+if (bOk && (c == 'M' || c == 'D'))
+{
+// Check the D and M cases for plausibility. This also
+// prevents recognition of date instead of number with a
+// numeric group input if date separator is identical to
+// group separator, for example with D.M as a pattern and
+// #.### as a group.
+sal_Int32 nMaxLen, nMaxVal;
+switch (c)
+{
+case 'M':
+nMaxLen = 2;
+nMaxVal = nMonthsInYear;
+break;
+case 'D':
+nMaxLen = 2;
+nMaxVal = 31;
+break;
+default:
+// This merely exists against
+// -Werror=maybe-uninitialized, which is nonsense
+// after the (c == 'M' || c == 'D') check above,
+// but ...
+nMaxLen = 2;
+nMaxVal = 31;
+}
+bOk = (sStrArray[nNext].getLength() <= nMaxLen);
+if (bOk)
+{
+sal_Int32 nNum = sStrArray[nNext].toInt32();
+bOk = (1 <= nNum && nNum <= nMaxVal);
+}
+}
 if (bOk)
 ++nDatePatternNumbers;
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-09 Thread Eike Rathke
 sc/source/filter/xml/xmlcelli.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit fea6f83df8d2183b108695217bc4ff7a93e942c9
Author: Eike Rathke 
Date:   Wed Jul 9 19:16:19 2014 +0200

resolved fdo#62250 absent value cell values are not NaN, set to 0.0

Change-Id: I41459d72adbaa8f6c0c7c22447f6eba5eb8be3e1

diff --git a/sc/source/filter/xml/xmlcelli.cxx 
b/sc/source/filter/xml/xmlcelli.cxx
index 5a2e3aa..e2ac747 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1157,6 +1157,12 @@ void ScXMLTableRowCellContext::PutValueCell( const 
ScAddress& rCurrentPos )
 }
 else  //regular value cell
 {
+// fdo#62250 absent values are not NaN, set to 0.0
+// PutValueCell() is called only for a known cell value type,
+// bIsEmpty==false in all these cases, no sense to check it here.
+if (::rtl::math::isNan( fValue))
+fValue = 0.0;
+
 // #i62435# Initialize the value cell's script type if the default
 // style's number format is latin-only. If the cell uses a different
 // format, the script type will be reset when the style is applied.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-09 Thread Eike Rathke
 sc/source/filter/xml/xmlcelli.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 068a7035bf679ba1b9650777cae327a18d3ee519
Author: Eike Rathke 
Date:   Wed Jul 9 19:16:19 2014 +0200

resolved fdo#62250 absent value cell values are not NaN, set to 0.0

Change-Id: I41459d72adbaa8f6c0c7c22447f6eba5eb8be3e1
(cherry picked from commit fea6f83df8d2183b108695217bc4ff7a93e942c9)
Reviewed-on: https://gerrit.libreoffice.org/10175
Reviewed-by: Kohei Yoshida 
Tested-by: Kohei Yoshida 

diff --git a/sc/source/filter/xml/xmlcelli.cxx 
b/sc/source/filter/xml/xmlcelli.cxx
index 4e4c552..d8d409a 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1157,6 +1157,12 @@ void ScXMLTableRowCellContext::PutValueCell( const 
ScAddress& rCurrentPos )
 }
 else  //regular value cell
 {
+// fdo#62250 absent values are not NaN, set to 0.0
+// PutValueCell() is called only for a known cell value type,
+// bIsEmpty==false in all these cases, no sense to check it here.
+if (::rtl::math::isNan( fValue))
+fValue = 0.0;
+
 // #i62435# Initialize the value cell's script type if the default
 // style's number format is latin-only. If the cell uses a different
 // format, the script type will be reset when the style is applied.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-09 Thread Eike Rathke
 sc/source/filter/xml/xmlcelli.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit cd8acfacdc02dc6dbfc6a73ef64c5bec8eefebf4
Author: Eike Rathke 
Date:   Wed Jul 9 19:16:19 2014 +0200

resolved fdo#62250 absent value cell values are not NaN, set to 0.0

Change-Id: I41459d72adbaa8f6c0c7c22447f6eba5eb8be3e1
(cherry picked from commit fea6f83df8d2183b108695217bc4ff7a93e942c9)
Reviewed-on: https://gerrit.libreoffice.org/10174
Reviewed-by: Kohei Yoshida 
Tested-by: Kohei Yoshida 

diff --git a/sc/source/filter/xml/xmlcelli.cxx 
b/sc/source/filter/xml/xmlcelli.cxx
index 4e4c552..d8d409a 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1157,6 +1157,12 @@ void ScXMLTableRowCellContext::PutValueCell( const 
ScAddress& rCurrentPos )
 }
 else  //regular value cell
 {
+// fdo#62250 absent values are not NaN, set to 0.0
+// PutValueCell() is called only for a known cell value type,
+// bIsEmpty==false in all these cases, no sense to check it here.
+if (::rtl::math::isNan( fValue))
+fValue = 0.0;
+
 // #i62435# Initialize the value cell's script type if the default
 // style's number format is latin-only. If the cell uses a different
 // format, the script type will be reset when the style is applied.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-09 Thread Eike Rathke
 sc/source/filter/xml/xmlcelli.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 4e69127246028f72eee6279e9a810bb865ce654c
Author: Eike Rathke 
Date:   Wed Jul 9 19:16:19 2014 +0200

resolved fdo#62250 absent value cell values are not NaN, set to 0.0

Change-Id: I41459d72adbaa8f6c0c7c22447f6eba5eb8be3e1
(cherry picked from commit fea6f83df8d2183b108695217bc4ff7a93e942c9)
Reviewed-on: https://gerrit.libreoffice.org/10176
Reviewed-by: Kohei Yoshida 
Tested-by: Kohei Yoshida 

diff --git a/sc/source/filter/xml/xmlcelli.cxx 
b/sc/source/filter/xml/xmlcelli.cxx
index 41e6111..a3321c2 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1151,6 +1151,12 @@ void ScXMLTableRowCellContext::PutValueCell( const 
ScAddress& rCurrentPos )
 }
 else  //regular value cell
 {
+// fdo#62250 absent values are not NaN, set to 0.0
+// PutValueCell() is called only for a known cell value type,
+// bIsEmpty==false in all these cases, no sense to check it here.
+if (::rtl::math::isNan( fValue))
+fValue = 0.0;
+
 // #i62435# Initialize the value cell's script type if the default
 // style's number format is latin-only. If the cell uses a different
 // format, the script type will be reset when the style is applied.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-10 Thread Eike Rathke
 sc/source/core/tool/interpr1.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 1093b900b43d819c9a730ef6435fed0f3687a085
Author: Eike Rathke 
Date:   Thu Jul 10 16:13:40 2014 +0200

resolved fdo#80195 act on implicitly propagated error, if any

Change-Id: I1d5a55a14fc3e25edc2cddec5b53ed2afa96bd3e

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index b9e3d12..df65daa 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -253,6 +253,11 @@ void ScInterpreter::ScIfError( bool bNAonly )
 {
 default:
 Pop();
+// Act on implicitly propagated error, if any.
+if (nOldGlobalError)
+nGlobalError = nOldGlobalError;
+if (nGlobalError)
+bError = true;
 break;
 case svError:
 PopError();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: memory release in libreoffice

2014-07-10 Thread Eike Rathke
Hi Mahesh,

On Tuesday, 2014-07-08 07:47:46 -, Mahesh Patil wrote:

> Libreoffice is not releasing memory after converting document to pdf.

How do you measure that?

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key ID: 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack


pgpN1xPG9nN6t.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2014-07-10 Thread Eike Rathke
 sc/source/core/tool/interpr1.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit be91c2086afef99dc9569ac6aa4835c5072bffdf
Author: Eike Rathke 
Date:   Thu Jul 10 16:13:40 2014 +0200

resolved fdo#80195 act on implicitly propagated error, if any

Change-Id: I1d5a55a14fc3e25edc2cddec5b53ed2afa96bd3e
(cherry picked from commit 1093b900b43d819c9a730ef6435fed0f3687a085)
Reviewed-on: https://gerrit.libreoffice.org/10196
Reviewed-by: Muthu Subramanian K 
Reviewed-by: Markus Mohrhard 
Tested-by: Markus Mohrhard 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 8c86e56..493080a 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -255,6 +255,11 @@ void ScInterpreter::ScIfError( bool bNAonly )
 {
 default:
 Pop();
+// Act on implicitly propagated error, if any.
+if (nOldGlobalError)
+nGlobalError = nOldGlobalError;
+if (nGlobalError)
+bError = true;
 break;
 case svError:
 PopError();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-10 Thread Eike Rathke
 sc/source/core/tool/interpr1.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 50b9fe07f9851160e12922feb7d96d6f7ae5b52e
Author: Eike Rathke 
Date:   Thu Jul 10 16:13:40 2014 +0200

resolved fdo#80195 act on implicitly propagated error, if any

Change-Id: I1d5a55a14fc3e25edc2cddec5b53ed2afa96bd3e
(cherry picked from commit 1093b900b43d819c9a730ef6435fed0f3687a085)
Reviewed-on: https://gerrit.libreoffice.org/10198
Reviewed-by: Markus Mohrhard 
Tested-by: Markus Mohrhard 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index a834488..a42dbad 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -255,6 +255,11 @@ void ScInterpreter::ScIfError( bool bNAonly )
 {
 default:
 Pop();
+// Act on implicitly propagated error, if any.
+if (nOldGlobalError)
+nGlobalError = nOldGlobalError;
+if (nGlobalError)
+bError = true;
 break;
 case svError:
 PopError();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-11 Thread Eike Rathke
 sc/source/ui/docshell/docsh8.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 972c92c84e6f95e8fa8818794280a16e681e5edd
Author: Eike Rathke 
Date:   Fri Jul 11 12:25:58 2014 +0200

CID#982304 logically dead code

Change-Id: I8ffc8249a4d1b7530ee208cf84b48af832758a4d

diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 570e0d6..ef8e78b 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -686,11 +686,20 @@ void lcl_GetColumnTypes(
 }
 else
 {
+#if 1
+// Adjust length to predefined precision.
+nLen = nLen + ( nPrecision - nPrec );
+#else
+/* If the above override for (nPrecision < nPrec) was not in place then
+ * nPrecision could be 0 and this would be the code path to correctly
+ * calculate nLen. But as is, nPrecision is never 0 here, see CID#982304 */
+
 // Adjust length to predefined precision.
 if ( nPrecision )
 nLen = nLen + ( nPrecision - nPrec );
 else
 nLen -= nPrec+1;// also remove the decimal 
separator
+#endif
 }
 }
 if (nFieldLen < nLen)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: memory release in libreoffice

2014-07-11 Thread Eike Rathke
Hi Mahesh,

Please keep discussions on the mailing list instead of moving them to
private mail only, I'm Cc'ing the list again.

On Friday, 2014-07-11 12:28:43 -, Mahesh Patil wrote:

> Mac OS Xcode has such tools which tell you memory leaks with exact num of 
> bytes and it's allocation function.
> 
> I found some memory leaks but main problem is that I build static library on 
> mac and ConvertData is duplicate struct and class. So this causes problem 
> ConvertData destructor is not called properrly so I rename one of them in 
> scaddin.One random crash also found but I don't know how to contact mac os 
> developer on libreoffice. I know exact proble I fixed also..

I see struct ConvertData in include/vcl/salctype.hxx and class
ConvertData in scaddins/source/analysis/analysishelper.hxx
Both should be independent from each other, i.e. scaddins does not see
the vcl struct or vice versa. Anyway, renaming the scaddin one helped in
your static library case? (whyever you build a static lib is beyond my
scope...)

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key ID: 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack


pgpqkb8Ov4pGi.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2014-07-11 Thread Eike Rathke
 sc/inc/formulacell.hxx  |2 +-
 sc/source/core/data/formulacell.cxx |4 ++--
 sc/source/core/data/table3.cxx  |3 ++-
 3 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit e463de2a56453a0d2cb0b5b58e96f7639f37cdd1
Author: Eike Rathke 
Date:   Fri Jul 11 18:35:39 2014 +0200

resolved fdo#79441 keep 3D references intact during sort

Change-Id: I9e96d8e7cb99a3c280dd24495eefb9efd6d10888

diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 9e55aec..e13e2bb 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -160,7 +160,7 @@ public:
 virtual ~ScFormulaCell();
 
 ScFormulaCell* Clone() const;
-ScFormulaCell* Clone( const ScAddress& rPos ) const;
+ScFormulaCell* Clone( const ScAddress& rPos, int nCloneFlags ) const;
 
 ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos );
 
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index c1fbfab..44d0807 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -829,9 +829,9 @@ ScFormulaCell* ScFormulaCell::Clone() const
 return new ScFormulaCell(*this, *pDocument, aPos);
 }
 
-ScFormulaCell* ScFormulaCell::Clone( const ScAddress& rPos ) const
+ScFormulaCell* ScFormulaCell::Clone( const ScAddress& rPos, int nCloneFlags ) 
const
 {
-return new ScFormulaCell(*this, *pDocument, rPos);
+return new ScFormulaCell(*this, *pDocument, rPos, nCloneFlags);
 }
 
 size_t ScFormulaCell::GetHash() const
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 959a919..72a066c 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -679,7 +679,8 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, 
ScProgress* pProgress )
 {
 assert(rCell.mpAttr);
 size_t n = rCellStore.size();
-sc::CellStoreType::iterator itBlk = 
rCellStore.push_back(rCell.maCell.mpFormula->Clone(aCellPos));
+sc::CellStoreType::iterator itBlk = rCellStore.push_back( 
rCell.maCell.mpFormula->Clone(
+aCellPos, SC_CLONECELL_DEFAULT | 
SC_CLONECELL_ADJUST3DREL));
 
 // Join the formula cells as we fill the container.
 size_t nOffset = n - itBlk->position;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-11 Thread Eike Rathke
 sc/source/core/tool/token.cxx |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit db0a4c2575ffba1c170d74882b0f5a6229ec072f
Author: Eike Rathke 
Date:   Fri Jul 11 23:15:50 2014 +0200

resolved fdo#77018 keep external references intact during sort

Needs e463de2a56453a0d2cb0b5b58e96f7639f37cdd1 fix for fdo#79441 to
work.

Change-Id: Ide1cbeb4b25b17b5102977ccbdf8e6dbfcadfc60

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 8f8fe84..7394799 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -522,6 +522,9 @@ bool ScToken::Is3DRef() const
 if ( GetSingleRef().IsFlag3D() )
 return true;
 break;
+case svExternalSingleRef:
+case svExternalDoubleRef:
+return true;
 default:
 {
 // added to avoid warnings
@@ -2236,6 +2239,20 @@ void ScTokenArray::ReadjustRelative3DReferences( const 
ScAddress& rOldPos,
 }
 }
 break;
+case svExternalDoubleRef :
+{
+ScSingleRefData& rRef2 = 
static_cast(pCode[j])->GetSingleRef2();
+ScAddress aAbs = rRef2.toAbs(rOldPos);
+rRef2.SetAddress(aAbs, rNewPos);
+}
+//! fallthru
+case svExternalSingleRef :
+{
+ScSingleRefData& rRef1 = 
static_cast(pCode[j])->GetSingleRef();
+ScAddress aAbs = rRef1.toAbs(rOldPos);
+rRef1.SetAddress(aAbs, rNewPos);
+}
+break;
 default:
 {
 // added to avoid warnings
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-14 Thread Eike Rathke
 sc/source/core/tool/interpr1.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 85ad903b57d1d1362f0d9a64ca3de37606645dee
Author: Eike Rathke 
Date:   Thu Jul 10 16:13:40 2014 +0200

resolved fdo#80195 act on implicitly propagated error, if any

Change-Id: I1d5a55a14fc3e25edc2cddec5b53ed2afa96bd3e
(cherry picked from commit 1093b900b43d819c9a730ef6435fed0f3687a085)
Reviewed-on: https://gerrit.libreoffice.org/10195
Reviewed-by: Muthu Subramanian K 
Reviewed-by: Markus Mohrhard 
Reviewed-by: David Tardon 
Tested-by: David Tardon 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 8c86e56..493080a 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -255,6 +255,11 @@ void ScInterpreter::ScIfError( bool bNAonly )
 {
 default:
 Pop();
+// Act on implicitly propagated error, if any.
+if (nOldGlobalError)
+nGlobalError = nOldGlobalError;
+if (nGlobalError)
+bError = true;
 break;
 case svError:
 PopError();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-14 Thread Eike Rathke
 sc/inc/formulacell.hxx  |2 +-
 sc/source/core/data/formulacell.cxx |4 ++--
 sc/source/core/data/table3.cxx  |3 ++-
 3 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit caf35a3ab2fa19134a900dcfd2dcc86936e435a5
Author: Eike Rathke 
Date:   Fri Jul 11 18:35:39 2014 +0200

resolved fdo#79441 keep 3D references intact during sort

Change-Id: I9e96d8e7cb99a3c280dd24495eefb9efd6d10888
(cherry picked from commit e463de2a56453a0d2cb0b5b58e96f7639f37cdd1)
Reviewed-on: https://gerrit.libreoffice.org/10238
Reviewed-by: Kohei Yoshida 
Tested-by: Kohei Yoshida 

diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 11c5cb1..49b20b1 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -160,7 +160,7 @@ public:
 virtual ~ScFormulaCell();
 
 ScFormulaCell* Clone() const;
-ScFormulaCell* Clone( const ScAddress& rPos ) const;
+ScFormulaCell* Clone( const ScAddress& rPos, int nCloneFlags ) const;
 
 ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos );
 
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index af6aed4..2ff6079 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -841,9 +841,9 @@ ScFormulaCell* ScFormulaCell::Clone() const
 return new ScFormulaCell(*this, *pDocument, aPos);
 }
 
-ScFormulaCell* ScFormulaCell::Clone( const ScAddress& rPos ) const
+ScFormulaCell* ScFormulaCell::Clone( const ScAddress& rPos, int nCloneFlags ) 
const
 {
-return new ScFormulaCell(*this, *pDocument, rPos);
+return new ScFormulaCell(*this, *pDocument, rPos, nCloneFlags);
 }
 
 size_t ScFormulaCell::GetHash() const
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index b544711..1b2f86c 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -683,7 +683,8 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, 
ScProgress* pProgress )
 {
 assert(rCell.mpAttr);
 size_t n = rCellStore.size();
-sc::CellStoreType::iterator itBlk = 
rCellStore.push_back(rCell.maCell.mpFormula->Clone(aCellPos));
+sc::CellStoreType::iterator itBlk = rCellStore.push_back( 
rCell.maCell.mpFormula->Clone(
+aCellPos, SC_CLONECELL_DEFAULT | 
SC_CLONECELL_ADJUST3DREL));
 
 // Join the formula cells as we fill the container.
 size_t nOffset = n - itBlk->position;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-14 Thread Eike Rathke
 sc/source/core/tool/token.cxx |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit 7aa2b94ac57b7c99e1e45d5f652a423ee603dd55
Author: Eike Rathke 
Date:   Fri Jul 11 23:15:50 2014 +0200

resolved fdo#77018 keep external references intact during sort

Needs e463de2a56453a0d2cb0b5b58e96f7639f37cdd1 fix for fdo#79441 to
work.

Change-Id: Ide1cbeb4b25b17b5102977ccbdf8e6dbfcadfc60
(cherry picked from commit db0a4c2575ffba1c170d74882b0f5a6229ec072f)
Reviewed-on: https://gerrit.libreoffice.org/10243
Reviewed-by: Kohei Yoshida 
Tested-by: Kohei Yoshida 

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 4ac537f..8738877 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -529,6 +529,9 @@ bool ScToken::Is3DRef() const
 if ( GetSingleRef().IsFlag3D() )
 return true;
 break;
+case svExternalSingleRef:
+case svExternalDoubleRef:
+return true;
 default:
 {
 // added to avoid warnings
@@ -2261,6 +2264,20 @@ void ScTokenArray::ReadjustRelative3DReferences( const 
ScAddress& rOldPos,
 }
 }
 break;
+case svExternalDoubleRef :
+{
+ScSingleRefData& rRef2 = 
static_cast(pCode[j])->GetSingleRef2();
+ScAddress aAbs = rRef2.toAbs(rOldPos);
+rRef2.SetAddress(aAbs, rNewPos);
+}
+//! fallthru
+case svExternalSingleRef :
+{
+ScSingleRefData& rRef1 = 
static_cast(pCode[j])->GetSingleRef();
+ScAddress aAbs = rRef1.toAbs(rOldPos);
+rRef1.SetAddress(aAbs, rNewPos);
+}
+break;
 default:
 {
 // added to avoid warnings
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-14 Thread Eike Rathke
 sc/inc/formulacell.hxx  |2 +-
 sc/source/core/data/formulacell.cxx |4 ++--
 sc/source/core/data/table3.cxx  |3 ++-
 3 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 2d5e4e5a551ac7c2329f21327ff4c4aa8582d154
Author: Eike Rathke 
Date:   Fri Jul 11 18:35:39 2014 +0200

resolved fdo#79441 keep 3D references intact during sort

Change-Id: I9e96d8e7cb99a3c280dd24495eefb9efd6d10888
(cherry picked from commit e463de2a56453a0d2cb0b5b58e96f7639f37cdd1)
Reviewed-on: https://gerrit.libreoffice.org/10240
Reviewed-by: Kohei Yoshida 
Tested-by: Kohei Yoshida 

diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 326c4b8..2d25c9b 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -160,7 +160,7 @@ public:
 ~ScFormulaCell();
 
 ScFormulaCell* Clone() const;
-ScFormulaCell* Clone( const ScAddress& rPos ) const;
+ScFormulaCell* Clone( const ScAddress& rPos, int nCloneFlags ) const;
 
 ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos );
 
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index d4324a3..1397372 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -837,9 +837,9 @@ ScFormulaCell* ScFormulaCell::Clone() const
 return new ScFormulaCell(*this, *pDocument, aPos);
 }
 
-ScFormulaCell* ScFormulaCell::Clone( const ScAddress& rPos ) const
+ScFormulaCell* ScFormulaCell::Clone( const ScAddress& rPos, int nCloneFlags ) 
const
 {
-return new ScFormulaCell(*this, *pDocument, rPos);
+return new ScFormulaCell(*this, *pDocument, rPos, nCloneFlags);
 }
 
 size_t ScFormulaCell::GetHash() const
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 5fceab2..6a169ef 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -682,7 +682,8 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, 
ScProgress* pProgress )
 {
 assert(rCell.mpAttr);
 size_t n = rCellStore.size();
-sc::CellStoreType::iterator itBlk = 
rCellStore.push_back(rCell.maCell.mpFormula->Clone(aCellPos));
+sc::CellStoreType::iterator itBlk = rCellStore.push_back( 
rCell.maCell.mpFormula->Clone(
+aCellPos, SC_CLONECELL_DEFAULT | 
SC_CLONECELL_ADJUST3DREL));
 
 // Join the formula cells as we fill the container.
 size_t nOffset = n - itBlk->position;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-14 Thread Eike Rathke
 sc/source/core/tool/token.cxx |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit 92216be6ce13990b8ea6b6264c656d2bc1746401
Author: Eike Rathke 
Date:   Fri Jul 11 23:15:50 2014 +0200

resolved fdo#77018 keep external references intact during sort

Needs e463de2a56453a0d2cb0b5b58e96f7639f37cdd1 fix for fdo#79441 to
work.

Change-Id: Ide1cbeb4b25b17b5102977ccbdf8e6dbfcadfc60
(cherry picked from commit db0a4c2575ffba1c170d74882b0f5a6229ec072f)
Reviewed-on: https://gerrit.libreoffice.org/10245
Reviewed-by: Kohei Yoshida 
Tested-by: Kohei Yoshida 

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 8f51a72..ab47bee 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -531,6 +531,9 @@ bool ScToken::Is3DRef() const
 if ( GetSingleRef().IsFlag3D() )
 return true;
 break;
+case svExternalSingleRef:
+case svExternalDoubleRef:
+return true;
 default:
 {
 // added to avoid warnings
@@ -2251,6 +2254,20 @@ void ScTokenArray::ReadjustRelative3DReferences( const 
ScAddress& rOldPos,
 }
 }
 break;
+case svExternalDoubleRef :
+{
+ScSingleRefData& rRef2 = 
static_cast(pCode[j])->GetSingleRef2();
+ScAddress aAbs = rRef2.toAbs(rOldPos);
+rRef2.SetAddress(aAbs, rNewPos);
+}
+//! fallthru
+case svExternalSingleRef :
+{
+ScSingleRefData& rRef1 = 
static_cast(pCode[j])->GetSingleRef();
+ScAddress aAbs = rRef1.toAbs(rOldPos);
+rRef1.SetAddress(aAbs, rNewPos);
+}
+break;
 default:
 {
 // added to avoid warnings
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-14 Thread Eike Rathke
 sc/source/core/tool/interpr1.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 874859a8feb8cfadd7f491ebae99ff8aa5fd43c7
Author: Eike Rathke 
Date:   Thu Jul 10 16:13:40 2014 +0200

resolved fdo#80195 act on implicitly propagated error, if any

Change-Id: I1d5a55a14fc3e25edc2cddec5b53ed2afa96bd3e
(cherry picked from commit 1093b900b43d819c9a730ef6435fed0f3687a085)
Reviewed-on: https://gerrit.libreoffice.org/10199
Reviewed-by: Markus Mohrhard 
Reviewed-by: David Tardon 
Tested-by: Kohei Yoshida 
Reviewed-by: Kohei Yoshida 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index a834488..a42dbad 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -255,6 +255,11 @@ void ScInterpreter::ScIfError( bool bNAonly )
 {
 default:
 Pop();
+// Act on implicitly propagated error, if any.
+if (nOldGlobalError)
+nGlobalError = nOldGlobalError;
+if (nGlobalError)
+bError = true;
 break;
 case svError:
 PopError();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-15 Thread Eike Rathke
 sc/source/core/tool/token.cxx |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit 37b97c83aa23d5a7c1687126d93cf1a69ce4a2d0
Author: Eike Rathke 
Date:   Fri Jul 11 23:15:50 2014 +0200

resolved fdo#77018 keep external references intact during sort

Needs e463de2a56453a0d2cb0b5b58e96f7639f37cdd1 fix for fdo#79441 to
work.

Change-Id: Ide1cbeb4b25b17b5102977ccbdf8e6dbfcadfc60
(cherry picked from commit db0a4c2575ffba1c170d74882b0f5a6229ec072f)
Reviewed-on: https://gerrit.libreoffice.org/10244
Reviewed-by: Muthu Subramanian K 
Reviewed-by: Kohei Yoshida 
Reviewed-by: David Tardon 
Tested-by: David Tardon 

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 4ac537f..8738877 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -529,6 +529,9 @@ bool ScToken::Is3DRef() const
 if ( GetSingleRef().IsFlag3D() )
 return true;
 break;
+case svExternalSingleRef:
+case svExternalDoubleRef:
+return true;
 default:
 {
 // added to avoid warnings
@@ -2261,6 +2264,20 @@ void ScTokenArray::ReadjustRelative3DReferences( const 
ScAddress& rOldPos,
 }
 }
 break;
+case svExternalDoubleRef :
+{
+ScSingleRefData& rRef2 = 
static_cast(pCode[j])->GetSingleRef2();
+ScAddress aAbs = rRef2.toAbs(rOldPos);
+rRef2.SetAddress(aAbs, rNewPos);
+}
+//! fallthru
+case svExternalSingleRef :
+{
+ScSingleRefData& rRef1 = 
static_cast(pCode[j])->GetSingleRef();
+ScAddress aAbs = rRef1.toAbs(rOldPos);
+rRef1.SetAddress(aAbs, rNewPos);
+}
+break;
 default:
 {
 // added to avoid warnings
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-15 Thread Eike Rathke
 sc/source/core/data/attarray.cxx |   10 --
 sc/source/core/tool/chgtrack.cxx |4 ++--
 sc/source/core/tool/interpr1.cxx |   12 +---
 sc/source/core/tool/interpr2.cxx |2 +-
 sc/source/core/tool/interpr3.cxx |4 ++--
 sc/source/core/tool/interpr4.cxx |3 +--
 6 files changed, 15 insertions(+), 20 deletions(-)

New commits:
commit b409aaa7d65151106236058d3c478bd7f87dd296
Author: Eike Rathke 
Date:   Tue Jul 15 17:27:16 2014 +0200

CID#703984 Unchecked return value (CHECKED_RETURN)

Change-Id: I5b0c633e25326272aed3bae0bf0847839a45d723

diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index a18d0d3..db032e1 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -2973,8 +2973,8 @@ void ScChangeTrack::Dependencies( ScChangeAction* pAct )
 if ( ScChangeActionContent::GetContentCellType(rCell) == 
SC_CACCT_MATREF )
 {
 ScAddress aOrg;
-rCell.mpFormula->GetMatrixOrigin(aOrg);
-ScChangeActionContent* pContent = SearchContentAt( aOrg, pAct );
+bool bOrgFound = rCell.mpFormula->GetMatrixOrigin(aOrg);
+ScChangeActionContent* pContent = (bOrgFound ? SearchContentAt( 
aOrg, pAct ) : NULL);
 if ( pContent && pContent->IsMatrixOrigin() )
 {
 AddDependentWithNotify( pContent, pAct );
commit 9d929e5682b2dd70c6ede90d117fa3f24fb01f86
Author: Eike Rathke 
Date:   Tue Jul 15 17:23:26 2014 +0200

CID#703986 Unchecked return value (CHECKED_RETURN)

Change-Id: I44149fca38e36be6d4302b2af93e72ae9093796a

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index f1d2227..544f173 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2608,10 +2608,10 @@ void ScInterpreter::ScIsNV()
 case svSingleRef :
 {
 ScAddress aAdr;
-PopDoubleRefOrSingleRef( aAdr );
+bool bOk = PopDoubleRefOrSingleRef( aAdr );
 if ( nGlobalError == NOTAVAILABLE )
 nRes = true;
-else
+else if (bOk)
 {
 ScRefCellValue aCell;
 aCell.assign(*pDok, aAdr);
commit 94b3b4fdf1023396287894c0d985683b48f55099
Author: Eike Rathke 
Date:   Tue Jul 15 17:20:25 2014 +0200

CID#703987 Unchecked return value (CHECKED_RETURN)

Change-Id: I0e5bf12f1b874e3aa5428c92487cb58ef16c9cc3

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index e365966..f1d2227 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2656,8 +2656,8 @@ void ScInterpreter::ScIsErr()
 case svSingleRef :
 {
 ScAddress aAdr;
-PopDoubleRefOrSingleRef( aAdr );
-if ( nGlobalError && nGlobalError != NOTAVAILABLE )
+bool bOk = PopDoubleRefOrSingleRef( aAdr );
+if ( !bOk || (nGlobalError && nGlobalError != NOTAVAILABLE) )
 nRes = true;
 else
 {
commit 6b84beb590417c6e8df024099537ddccb8a984e1
Author: Eike Rathke 
Date:   Tue Jul 15 17:12:58 2014 +0200

pDok can't be NULL, remove superfluous check

Change-Id: I639d6e27dd1a44ff878a2e0188fc42e27993b39f

diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 55b7ccb..c6df5fc 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3746,8 +3746,7 @@ const ScCalcConfig& ScInterpreter::GetGlobalConfig()
 void ScInterpreter::MergeCalcConfig()
 {
 maCalcConfig = maGlobalConfig;
-if (pDok)
-maCalcConfig.MergeDocumentSpecific( pDok->GetCalcConfig());
+maCalcConfig.MergeDocumentSpecific( pDok->GetCalcConfig());
 }
 
 void ScInterpreter::GlobalExit()
commit b057b1f5697477046d731a234489e1d213efc9e6
Author: Eike Rathke 
Date:   Tue Jul 15 17:11:03 2014 +0200

CID#735794 Dereference after null check (FORWARD_NULL)

pDok can't be NULL, remove superfluous check.

Change-Id: Ica1708f1b2c37bffbe388f22e8ac19a81b144f6d

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index df65daa..e365966 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -4357,9 +4357,7 @@ void ScInterpreter::ScMatch()
 }
 if (rItem.meType == ScQueryEntry::ByString)
 {
-bool bIsVBAMode = false;
-if ( pDok )
-bIsVBAMode = pDok->IsInVBAMode();
+bool bIsVBAMode = pDok->IsInVBAMode();
 
 // #TODO handle MSO wildcards
 if ( bIsVBAMode )
commit 945c16c52794b50ce41e813e095e01222991091d
Author: Eike Rathke 
Date:   Tue Jul 15 17:08:03 2014 +0200

CID#1000520 Logically dead code (DEADCODE)

Change-Id: Ib33dcd05dd6a921

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

2014-07-15 Thread Eike Rathke
 sc/inc/formulacell.hxx  |2 +-
 sc/source/core/data/formulacell.cxx |4 ++--
 sc/source/core/data/table3.cxx  |3 ++-
 3 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 8073e91a9f89ab313ae4de86b5909ff3a16594e5
Author: Eike Rathke 
Date:   Fri Jul 11 18:35:39 2014 +0200

resolved fdo#79441 keep 3D references intact during sort

Change-Id: I9e96d8e7cb99a3c280dd24495eefb9efd6d10888
(cherry picked from commit e463de2a56453a0d2cb0b5b58e96f7639f37cdd1)
Reviewed-on: https://gerrit.libreoffice.org/10239
Reviewed-by: Muthu Subramanian K 
Reviewed-by: Kohei Yoshida 
Reviewed-by: Markus Mohrhard 
Tested-by: Markus Mohrhard 

diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 11c5cb1..49b20b1 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -160,7 +160,7 @@ public:
 virtual ~ScFormulaCell();
 
 ScFormulaCell* Clone() const;
-ScFormulaCell* Clone( const ScAddress& rPos ) const;
+ScFormulaCell* Clone( const ScAddress& rPos, int nCloneFlags ) const;
 
 ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos );
 
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index af6aed4..2ff6079 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -841,9 +841,9 @@ ScFormulaCell* ScFormulaCell::Clone() const
 return new ScFormulaCell(*this, *pDocument, aPos);
 }
 
-ScFormulaCell* ScFormulaCell::Clone( const ScAddress& rPos ) const
+ScFormulaCell* ScFormulaCell::Clone( const ScAddress& rPos, int nCloneFlags ) 
const
 {
-return new ScFormulaCell(*this, *pDocument, rPos);
+return new ScFormulaCell(*this, *pDocument, rPos, nCloneFlags);
 }
 
 size_t ScFormulaCell::GetHash() const
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index b544711..1b2f86c 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -683,7 +683,8 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, 
ScProgress* pProgress )
 {
 assert(rCell.mpAttr);
 size_t n = rCellStore.size();
-sc::CellStoreType::iterator itBlk = 
rCellStore.push_back(rCell.maCell.mpFormula->Clone(aCellPos));
+sc::CellStoreType::iterator itBlk = rCellStore.push_back( 
rCell.maCell.mpFormula->Clone(
+aCellPos, SC_CLONECELL_DEFAULT | 
SC_CLONECELL_ADJUST3DREL));
 
 // Join the formula cells as we fill the container.
 size_t nOffset = n - itBlk->position;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-17 Thread Eike Rathke
 sc/source/core/data/table1.cxx |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 4011b74eb7650a0eeb99d3acebb9ef60b0fcaab9
Author: Eike Rathke 
Date:   Fri Jul 18 00:45:44 2014 +0200

resolved fdo#81294 store correct sheet number during range names update

Change-Id: Ic4c858efa6e7c1a65357ac79f01e6c08f464ae3f

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index daaaf8b..88631d5 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1591,6 +1591,12 @@ void ScTable::UpdateGrow( const ScRange& rArea, SCCOL 
nGrowX, SCROW nGrowY )
 
 void ScTable::UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt )
 {
+// Store the old tab number in sc::UpdatedRangeNames for
+// ScTokenArray::AdjustReferenceOnInsertedTab() to check with
+// isNameModified()
+if (mpRangeName)
+mpRangeName->UpdateInsertTab(rCxt, nTab);
+
 if (nTab >= rCxt.mnInsertPos)
 {
 nTab += rCxt.mnSheets;
@@ -1598,9 +1604,6 @@ void ScTable::UpdateInsertTab( 
sc::RefUpdateInsertTabContext& rCxt )
 pDBDataNoName->UpdateMoveTab(nTab - 1 ,nTab);
 }
 
-if (mpRangeName)
-mpRangeName->UpdateInsertTab(rCxt, nTab);
-
 if (mpCondFormatList)
 mpCondFormatList->UpdateInsertTab(rCxt);
 
@@ -1618,6 +1621,12 @@ void ScTable::UpdateInsertTab( 
sc::RefUpdateInsertTabContext& rCxt )
 
 void ScTable::UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt )
 {
+// Store the old tab number in sc::UpdatedRangeNames for
+// ScTokenArray::AdjustReferenceOnDeletedTab() to check with
+// isNameModified()
+if (mpRangeName)
+mpRangeName->UpdateDeleteTab(rCxt, nTab);
+
 if (nTab > rCxt.mnDeletePos)
 {
 nTab -= rCxt.mnSheets;
@@ -1625,9 +1634,6 @@ void ScTable::UpdateDeleteTab( 
sc::RefUpdateDeleteTabContext& rCxt )
 pDBDataNoName->UpdateMoveTab(nTab + 1,nTab);
 }
 
-if (mpRangeName)
-mpRangeName->UpdateDeleteTab(rCxt, nTab);
-
 if (mpCondFormatList)
 mpCondFormatList->UpdateDeleteTab(rCxt);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-17 Thread Eike Rathke
 sc/source/core/data/table1.cxx |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 76a4eee58830b7faf4fa0a89e82df36e352d5b06
Author: Eike Rathke 
Date:   Fri Jul 18 00:45:44 2014 +0200

resolved fdo#81294 store correct sheet number during range names update

Change-Id: Ic4c858efa6e7c1a65357ac79f01e6c08f464ae3f
(cherry picked from commit 4011b74eb7650a0eeb99d3acebb9ef60b0fcaab9)
Reviewed-on: https://gerrit.libreoffice.org/10374
Reviewed-by: Kohei Yoshida 
Tested-by: Kohei Yoshida 

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index b7e020f..94cf672 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1597,6 +1597,12 @@ void ScTable::UpdateGrow( const ScRange& rArea, SCCOL 
nGrowX, SCROW nGrowY )
 
 void ScTable::UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt )
 {
+// Store the old tab number in sc::UpdatedRangeNames for
+// ScTokenArray::AdjustReferenceOnInsertedTab() to check with
+// isNameModified()
+if (mpRangeName)
+mpRangeName->UpdateInsertTab(rCxt, nTab);
+
 if (nTab >= rCxt.mnInsertPos)
 {
 nTab += rCxt.mnSheets;
@@ -1604,9 +1610,6 @@ void ScTable::UpdateInsertTab( 
sc::RefUpdateInsertTabContext& rCxt )
 pDBDataNoName->UpdateMoveTab(nTab - 1 ,nTab);
 }
 
-if (mpRangeName)
-mpRangeName->UpdateInsertTab(rCxt, nTab);
-
 if (mpCondFormatList)
 mpCondFormatList->UpdateInsertTab(rCxt);
 
@@ -1624,6 +1627,12 @@ void ScTable::UpdateInsertTab( 
sc::RefUpdateInsertTabContext& rCxt )
 
 void ScTable::UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt )
 {
+// Store the old tab number in sc::UpdatedRangeNames for
+// ScTokenArray::AdjustReferenceOnDeletedTab() to check with
+// isNameModified()
+if (mpRangeName)
+mpRangeName->UpdateDeleteTab(rCxt, nTab);
+
 if (nTab > rCxt.mnDeletePos)
 {
 nTab -= rCxt.mnSheets;
@@ -1631,9 +1640,6 @@ void ScTable::UpdateDeleteTab( 
sc::RefUpdateDeleteTabContext& rCxt )
 pDBDataNoName->UpdateMoveTab(nTab + 1,nTab);
 }
 
-if (mpRangeName)
-mpRangeName->UpdateDeleteTab(rCxt, nTab);
-
 if (mpCondFormatList)
 mpCondFormatList->UpdateDeleteTab(rCxt);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-17 Thread Eike Rathke
 sc/source/core/data/table1.cxx |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 0e4ec4059371826c1742206e2ff6509df19e2cd1
Author: Eike Rathke 
Date:   Fri Jul 18 00:45:44 2014 +0200

resolved fdo#81294 store correct sheet number during range names update

Change-Id: Ic4c858efa6e7c1a65357ac79f01e6c08f464ae3f
(cherry picked from commit 4011b74eb7650a0eeb99d3acebb9ef60b0fcaab9)
Reviewed-on: https://gerrit.libreoffice.org/10376
Reviewed-by: Kohei Yoshida 
Tested-by: Kohei Yoshida 

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index e0eb3eb..834dfe1 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1603,6 +1603,12 @@ void ScTable::UpdateGrow( const ScRange& rArea, SCCOL 
nGrowX, SCROW nGrowY )
 
 void ScTable::UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt )
 {
+// Store the old tab number in sc::UpdatedRangeNames for
+// ScTokenArray::AdjustReferenceOnInsertedTab() to check with
+// isNameModified()
+if (mpRangeName)
+mpRangeName->UpdateInsertTab(rCxt, nTab);
+
 if (nTab >= rCxt.mnInsertPos)
 {
 nTab += rCxt.mnSheets;
@@ -1610,9 +1616,6 @@ void ScTable::UpdateInsertTab( 
sc::RefUpdateInsertTabContext& rCxt )
 pDBDataNoName->UpdateMoveTab(nTab - 1 ,nTab);
 }
 
-if (mpRangeName)
-mpRangeName->UpdateInsertTab(rCxt, nTab);
-
 if (mpCondFormatList)
 mpCondFormatList->UpdateInsertTab(rCxt);
 
@@ -1624,6 +1627,12 @@ void ScTable::UpdateInsertTab( 
sc::RefUpdateInsertTabContext& rCxt )
 
 void ScTable::UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt )
 {
+// Store the old tab number in sc::UpdatedRangeNames for
+// ScTokenArray::AdjustReferenceOnDeletedTab() to check with
+// isNameModified()
+if (mpRangeName)
+mpRangeName->UpdateDeleteTab(rCxt, nTab);
+
 if (nTab > rCxt.mnDeletePos)
 {
 nTab -= rCxt.mnSheets;
@@ -1631,9 +1640,6 @@ void ScTable::UpdateDeleteTab( 
sc::RefUpdateDeleteTabContext& rCxt )
 pDBDataNoName->UpdateMoveTab(nTab + 1,nTab);
 }
 
-if (mpRangeName)
-mpRangeName->UpdateDeleteTab(rCxt, nTab);
-
 if (mpCondFormatList)
 mpCondFormatList->UpdateDeleteTab(rCxt);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: export of Calc functions to OOXML

2014-07-18 Thread Eike Rathke
Hi Winfried,

On Tuesday, 2014-07-15 12:28:35 +0200, Winfried Donkers wrote:

> The Calc function GAMMADIST has an optional 4th argument (cumulative), 
> whereas this argument is mandatory for Excel.
> When saving a document with function GAMMADIST as xls, this argument is added 
> if necessary (in /sc/source/filter/excel/xeformula.cxx).
> When saving this document as xlsx, this argument is not added.

That's odd, XclExpFmlaCompImpl::AppendTrailingParam() is called in
XclExpFmlaCompImpl::FinishFunction() that should be called also for
OOXML export (or was it?). Best to place a breakpoint there and see
if/when it gets hit.

BUT, I think I might know why it doesn't get called anymore ... the
OOXML formula string is now directly generated from the token array,
which bypasses all mechanisms we had in place for the Excel binary
export and the earlier OOXML export benefitted from. It may be we have
to re-implement that entirely :-(  and end up with an almost duplicated
functionality..

> Is this currently not implemented?
> Where is the code for this argument-adding supposed to be located?
> 
> As I want to use the same principle for F.DIST (see fdo#40835), which also 
> has a 4th argument that is optional in ODFF1.2 and mandatory in Excel, and 
> maybe more functions.

Would make sense to add those similar to the existing ones.

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key ID: 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack


pgpan8mQeLjx5.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: how to cope with Calc functions that have an optional argument, which is mandatory in Excel?

2014-07-18 Thread Eike Rathke
Hi Winfried,

On Friday, 2014-06-27 12:46:46 +0200, Winfried Donkers wrote:

> Anyone familiar with

Sorry for having overlooked this one, see my reply in the other thread
from today.

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key ID: 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack


pgpah5W46d_rC.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2014-07-21 Thread Eike Rathke
 sc/source/core/data/table1.cxx |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 7477e87a1baaddf50f332c152568620e3ce32184
Author: Eike Rathke 
Date:   Fri Jul 18 00:45:44 2014 +0200

resolved fdo#81294 store correct sheet number during range names update

Change-Id: Ic4c858efa6e7c1a65357ac79f01e6c08f464ae3f
(cherry picked from commit 4011b74eb7650a0eeb99d3acebb9ef60b0fcaab9)
Reviewed-on: https://gerrit.libreoffice.org/10377
Reviewed-by: Kohei Yoshida 
Reviewed-by: Markus Mohrhard 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index e0eb3eb..834dfe1 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1603,6 +1603,12 @@ void ScTable::UpdateGrow( const ScRange& rArea, SCCOL 
nGrowX, SCROW nGrowY )
 
 void ScTable::UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt )
 {
+// Store the old tab number in sc::UpdatedRangeNames for
+// ScTokenArray::AdjustReferenceOnInsertedTab() to check with
+// isNameModified()
+if (mpRangeName)
+mpRangeName->UpdateInsertTab(rCxt, nTab);
+
 if (nTab >= rCxt.mnInsertPos)
 {
 nTab += rCxt.mnSheets;
@@ -1610,9 +1616,6 @@ void ScTable::UpdateInsertTab( 
sc::RefUpdateInsertTabContext& rCxt )
 pDBDataNoName->UpdateMoveTab(nTab - 1 ,nTab);
 }
 
-if (mpRangeName)
-mpRangeName->UpdateInsertTab(rCxt, nTab);
-
 if (mpCondFormatList)
 mpCondFormatList->UpdateInsertTab(rCxt);
 
@@ -1624,6 +1627,12 @@ void ScTable::UpdateInsertTab( 
sc::RefUpdateInsertTabContext& rCxt )
 
 void ScTable::UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt )
 {
+// Store the old tab number in sc::UpdatedRangeNames for
+// ScTokenArray::AdjustReferenceOnDeletedTab() to check with
+// isNameModified()
+if (mpRangeName)
+mpRangeName->UpdateDeleteTab(rCxt, nTab);
+
 if (nTab > rCxt.mnDeletePos)
 {
 nTab -= rCxt.mnSheets;
@@ -1631,9 +1640,6 @@ void ScTable::UpdateDeleteTab( 
sc::RefUpdateDeleteTabContext& rCxt )
 pDBDataNoName->UpdateMoveTab(nTab + 1,nTab);
 }
 
-if (mpRangeName)
-mpRangeName->UpdateDeleteTab(rCxt, nTab);
-
 if (mpCondFormatList)
 mpCondFormatList->UpdateDeleteTab(rCxt);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: export of Calc functions to OOXML

2014-07-21 Thread Eike Rathke
Hi Winfried,

On Monday, 2014-07-21 11:39:30 +0200, Winfried Donkers wrote:

> Neither XclExpFmlaCompImpl::AppendTrailingParam(), nor 
> XclExpFmlaCompImpl::FinishFunction() gets hit when set as a breakpoint in gdb.

That confirms my assumption that it is due to the change that formula
expressions are now written using the compiler internals.

> It seems to me that re-implementing the OOXML export functionality is rather 
> a complex business, i.e. not something suitable for me. Shall I create a bug 
> report for this? 

There are already entry points that do something similar for the old
non-ODFF (aka PODF) OOo-XML format, i.e. in
formula/source/core/api/FormulaCompiler.cxx
FormulaCompiler::CreateStringFromTokenArray() and in
formula/source/core/api/token.cxx all functions with *Rewrite*()

The MissingConvention and FormulaMissingContext need to handle also the
OOXML cases, or probably better create a derived MissingConvention for
the OOXML case so there are less explicit comparisons and/or switch
cases to differentiate.

_Maybe_ that and the code in XclExpFmlaCompImpl::AppendTrailingParam()
could even be united in some way to diminish code duplication.

If you want to take a stab at this just tell me, otherwise I'll do.
A bug report might be good so things don't get lost.

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key ID: 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack


pgpR8yaOEZHhx.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: export of Calc functions to OOXML

2014-07-21 Thread Eike Rathke
Hi Kohei,

On Monday, 2014-07-21 09:13:32 -0400, Kohei Yoshida wrote:

> > BUT, I think I might know why it doesn't get called anymore ... the
> > OOXML formula string is now directly generated from the token array,
> > which bypasses all mechanisms we had in place for the Excel binary
> > export and the earlier OOXML export benefitted from.
> 
> The xlsx *export* code always exported formulas this way.  Perhaps you
> are thinking of the xlsx *import* code?

Yeah, likely.. confusing.

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key ID: 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack


pgpNz_gHAp0mM.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2014-07-21 Thread Eike Rathke
 sc/source/filter/xml/xmlexprt.cxx |   12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

New commits:
commit bc3b62e25eb0c3921fa600e80eeb314e45ecaaef
Author: Eike Rathke 
Date:   Mon Jul 21 18:50:31 2014 +0200

use SvXMLExport::GetRelativeReference(), fdo#79305

... instead of a manual approach that missed one extra package level.

Change-Id: I41c76eb84677fcf49eb09830127a419ed23ec643

diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 70243eb..6e59a83 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3084,18 +3084,8 @@ void writeContent(
 {
 // value
 
-Reference< uno::XComponentContext > xContext = 
comphelper::getProcessComponentContext();
-bool bUseRelative = 
officecfg::Office::Common::Save::URL::FileSystem::get( xContext );
 OUString aURL = static_cast(pField)->GetURL();
-if(bUseRelative)
-{
-OUString aBase = rExport.GetOrigFileName();
-INetURLObject aURLObject(aBase);
-aURLObject.removeSegment();
-aURLObject.removeSegment();
-aURL = 
INetURLObject::GetRelURL(aURLObject.GetMainURL(INetURLObject::DECODE_TO_IURI), 
aURL);
-}
-rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, aURL);
+rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, 
rExport.GetRelativeReference(aURL));
 rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, "simple");
 
 OUString aElemName = rExport.GetNamespaceMap().GetQNameByKey(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: [GSoC] Weekly Report #4 - Dialog Widget Conversion

2014-07-21 Thread Eike Rathke
Hi Szymon,

On Saturday, 2014-06-21 20:38:20 +0200, Szymon Kłos wrote:

> Now I'm finishing conversion of RID_SVXDLG_NEWHYPERLINK (4 tabs).

That one introduced radio buttons that didn't exist before (E-mail and
News) and a superfluous Subject edit field for the Document type / tab
page, likely just a copy&paste error from the Mail&News type to
cui/uiconfig/ui/hyperlinkdocpage.ui

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key ID: 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack


pgpFQ5pfsESxD.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2014-07-22 Thread Eike Rathke
 sc/source/filter/xml/xmlexprt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c4ad8f54e39d40b58223bcac99510d9798b7cdda
Author: Eike Rathke 
Date:   Mon Jul 21 19:10:12 2014 +0200

use SvXMLExport::GetRelativeReference(), fdo#79305

Change-Id: I1e92a87034cf31470a9d8809f3b543b154c65126
Reviewed-on: https://gerrit.libreoffice.org/10446
Reviewed-by: Kohei Yoshida 
Reviewed-by: Muthu Subramanian K 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 058e719..2e73236 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3080,7 +3080,7 @@ void writeContent(
 // value
 
 OUString aURL = static_cast(pField)->GetURL();
-rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, aURL);
+rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, 
rExport.GetRelativeReference(aURL));
 rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, "simple");
 
 OUString aElemName = rExport.GetNamespaceMap().GetQNameByKey(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-22 Thread Eike Rathke
 sc/source/core/tool/token.cxx |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit 9e83928e4dd65a1cf570f9cea65f456bd089ea33
Author: Eike Rathke 
Date:   Fri Jul 11 23:15:50 2014 +0200

resolved fdo#77018 keep external references intact during sort

Needs e463de2a56453a0d2cb0b5b58e96f7639f37cdd1 fix for fdo#79441 to
work.

Change-Id: Ide1cbeb4b25b17b5102977ccbdf8e6dbfcadfc60
(cherry picked from commit db0a4c2575ffba1c170d74882b0f5a6229ec072f)
Reviewed-on: https://gerrit.libreoffice.org/10246
Reviewed-by: David Tardon 
Reviewed-by: Kohei Yoshida 
Reviewed-by: Muthu Subramanian K 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 8f51a72..ab47bee 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -531,6 +531,9 @@ bool ScToken::Is3DRef() const
 if ( GetSingleRef().IsFlag3D() )
 return true;
 break;
+case svExternalSingleRef:
+case svExternalDoubleRef:
+return true;
 default:
 {
 // added to avoid warnings
@@ -2251,6 +2254,20 @@ void ScTokenArray::ReadjustRelative3DReferences( const 
ScAddress& rOldPos,
 }
 }
 break;
+case svExternalDoubleRef :
+{
+ScSingleRefData& rRef2 = 
static_cast(pCode[j])->GetSingleRef2();
+ScAddress aAbs = rRef2.toAbs(rOldPos);
+rRef2.SetAddress(aAbs, rNewPos);
+}
+//! fallthru
+case svExternalSingleRef :
+{
+ScSingleRefData& rRef1 = 
static_cast(pCode[j])->GetSingleRef();
+ScAddress aAbs = rRef1.toAbs(rOldPos);
+rRef1.SetAddress(aAbs, rNewPos);
+}
+break;
 default:
 {
 // added to avoid warnings
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-22 Thread Eike Rathke
 sc/inc/formulacell.hxx  |2 +-
 sc/source/core/data/formulacell.cxx |4 ++--
 sc/source/core/data/table3.cxx  |3 ++-
 3 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 8c215cdd57dac801a255c84c41c9fd8be5ff8f19
Author: Eike Rathke 
Date:   Fri Jul 11 18:35:39 2014 +0200

resolved fdo#79441 keep 3D references intact during sort

Change-Id: I9e96d8e7cb99a3c280dd24495eefb9efd6d10888
(cherry picked from commit e463de2a56453a0d2cb0b5b58e96f7639f37cdd1)
Reviewed-on: https://gerrit.libreoffice.org/10241
Reviewed-by: Kohei Yoshida 
Reviewed-by: Muthu Subramanian K 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 326c4b8..2d25c9b 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -160,7 +160,7 @@ public:
 ~ScFormulaCell();
 
 ScFormulaCell* Clone() const;
-ScFormulaCell* Clone( const ScAddress& rPos ) const;
+ScFormulaCell* Clone( const ScAddress& rPos, int nCloneFlags ) const;
 
 ScFormulaCell( ScDocument* pDoc, const ScAddress& rPos );
 
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index d4324a3..1397372 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -837,9 +837,9 @@ ScFormulaCell* ScFormulaCell::Clone() const
 return new ScFormulaCell(*this, *pDocument, aPos);
 }
 
-ScFormulaCell* ScFormulaCell::Clone( const ScAddress& rPos ) const
+ScFormulaCell* ScFormulaCell::Clone( const ScAddress& rPos, int nCloneFlags ) 
const
 {
-return new ScFormulaCell(*this, *pDocument, rPos);
+return new ScFormulaCell(*this, *pDocument, rPos, nCloneFlags);
 }
 
 size_t ScFormulaCell::GetHash() const
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 5fceab2..6a169ef 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -682,7 +682,8 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, 
ScProgress* pProgress )
 {
 assert(rCell.mpAttr);
 size_t n = rCellStore.size();
-sc::CellStoreType::iterator itBlk = 
rCellStore.push_back(rCell.maCell.mpFormula->Clone(aCellPos));
+sc::CellStoreType::iterator itBlk = rCellStore.push_back( 
rCell.maCell.mpFormula->Clone(
+aCellPos, SC_CLONECELL_DEFAULT | 
SC_CLONECELL_ADJUST3DREL));
 
 // Join the formula cells as we fill the container.
 size_t nOffset = n - itBlk->position;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-22 Thread Eike Rathke
 sc/source/filter/xml/xmlexprt.cxx |   12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

New commits:
commit 7633ae819b0c29c2c108158d43d4d3f9c4622e7e
Author: Eike Rathke 
Date:   Mon Jul 21 18:50:31 2014 +0200

use SvXMLExport::GetRelativeReference(), fdo#79305

... instead of a manual approach that missed one extra package level.

Change-Id: I41c76eb84677fcf49eb09830127a419ed23ec643
(cherry picked from commit bc3b62e25eb0c3921fa600e80eeb314e45ecaaef)
Reviewed-on: https://gerrit.libreoffice.org/10444
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 9fb515a..7d00d39 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3090,18 +3090,8 @@ void writeContent(
 {
 // value
 
-Reference< uno::XComponentContext > xContext = 
comphelper::getProcessComponentContext();
-bool bUseRelative = 
officecfg::Office::Common::Save::URL::FileSystem::get( xContext );
 OUString aURL = static_cast(pField)->GetURL();
-if(bUseRelative)
-{
-OUString aBase = rExport.GetOrigFileName();
-INetURLObject aURLObject(aBase);
-aURLObject.removeSegment();
-aURLObject.removeSegment();
-aURL = 
INetURLObject::GetRelURL(aURLObject.GetMainURL(INetURLObject::DECODE_TO_IURI), 
aURL);
-}
-rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, aURL);
+rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, 
rExport.GetRelativeReference(aURL));
 rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, "simple");
 
 OUString aElemName = rExport.GetNamespaceMap().GetQNameByKey(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-22 Thread Eike Rathke
 sc/source/filter/xml/xmlexprt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 23e54b541892c0343e012b51c5722f8e3edc02ef
Author: Eike Rathke 
Date:   Mon Jul 21 19:10:12 2014 +0200

use SvXMLExport::GetRelativeReference(), fdo#79305

Change-Id: I1e92a87034cf31470a9d8809f3b543b154c65126
Reviewed-on: https://gerrit.libreoffice.org/10445
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 058e719..2e73236 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3080,7 +3080,7 @@ void writeContent(
 // value
 
 OUString aURL = static_cast(pField)->GetURL();
-rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, aURL);
+rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, 
rExport.GetRelativeReference(aURL));
 rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, "simple");
 
 OUString aElemName = rExport.GetNamespaceMap().GetQNameByKey(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-07-22 Thread Eike Rathke
 sfx2/source/doc/guisaveas.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 196abcf8f42891a05ec639a7570e5092bafe1b48
Author: Eike Rathke 
Date:   Tue Jul 22 20:02:36 2014 +0200

do not unescape sequence in original name in GetRecommendedName()

Noted with the fix for fdo#81304 the code unescaped an escaped sequence
in the original file name, for example "foo%20bar" became "foo bar".
This change preserves such sequences, though the final result at the
(GTK) file picker is still unescaped, which happens somewhere else.

However, now for the suggested file name "foo%20bar#baz" an InetURLObj
of "foo%2520bar%23baz" is created and results in a recommended name of
"foo%20bar#baz" again.

Change-Id: I620811e33bdb74323ddcb3d732428179bf7181d4

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 2294772..cf18115 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1279,8 +1279,8 @@ OUString ModelData_Impl::GetRecommendedName( const 
OUString& aSuggestedName, con
 uno::UNO_QUERY );
 if ( xTypeDetection.is() )
 {
-INetURLObject aObj( OUString( "file:///c:/" ) );
-aObj.SetName( aRecommendedName );
+INetURLObject aObj( OUString( "c:/" ) + aRecommendedName, 
INET_PROT_FILE,
+INetURLObject::ENCODE_ALL, RTL_TEXTENCODING_UTF8, 
INetURLObject::FSYS_DOS );
 
 uno::Sequence< beans::PropertyValue > aTypeNameProps;
 if ( ( xTypeDetection->getByName( aTypeName ) >>= 
aTypeNameProps ) && aTypeNameProps.getLength() )
@@ -1293,7 +1293,7 @@ OUString ModelData_Impl::GetRecommendedName( const 
OUString& aSuggestedName, con
 aObj.SetExtension( aExtensions[0] );
 }
 
-aRecommendedName = aObj.GetName( 
INetURLObject::DECODE_WITH_CHARSET );
+aRecommendedName = aObj.GetName( 
INetURLObject::DECODE_WITH_CHARSET, RTL_TEXTENCODING_UTF8 );
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: export of Calc functions to OOXML

2014-07-30 Thread Eike Rathke
Hi Winfried,

On Wednesday, 2014-07-30 08:10:06 +0200, Winfried Donkers wrote:

> I note that the PODF-handling is always done when saving, regardless
> of the file type being saved (e.g. ods, xlsx).

What do you mean? It is only done for .ods but not for .xlsx

> The result is that e.g. the formula GAMMADIST(1,2,5) (4th argument is
> optional) is always extended to GAMMADIST(1,2,5,1).

Not for .xlsx

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key ID: 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack


pgpncCx9iusGr.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: ODF Formula Standard & Calc

2014-07-31 Thread Eike Rathke
Hi Olivier,

On Thursday, 2014-07-31 08:43:42 -0300, Olivier Hallot wrote:

> Is there a reference page where each Calc function is listed/mapped as
> conforming or not conforming to ODFF?

AFAIK no, but we have a page that lists the additional functions not
covered by ODFF, see
https://wiki.documentfoundation.org/Development/ODF_Implementer_Notes#List_of_LibreOffice_OpenFormula_extensions

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key ID: 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack


pgpnwMpG3_tea.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Minutes of ESC call: 2014-07-31

2014-07-31 Thread Eike Rathke

* Present:
+ Lionel, Stephan, Christian, Kendy, Eike, Muthu, Kohei, Markus,
  Robinson, Jacobo, Michael S, Miklos

* Completed Action Items
+ RC3 respin / RC4 with spell-checking patch (Cloph)
  + done, released as public final version
+ update + enable the bibisect on Windows (Cloph)
  + currently uploading, 201 builds, 1.8GB, ~9MB per build
+ enable checkin of windows bibisect (Cloph)
  + will be updated by tinderbox builds

* Pending Action Items:
+ ask UX advise wrt. wrench icons (revert or not ?) (Astron)
+ blog about the sad realities of web plugins (Bjoern)
+ setup some VM's that can be created on-demand (Cloph)
+ done for the hackfest, non-public
+ working on creating a public machine
+ open-source newer Synezip tests / speak at the conference (Umesh)
+ Ask for 1-2 more dev-list moderators & re-visit next-week (Michael)
+ contact Michael / the list when students show up (Jan Marek)

* GSOC Update (Cedric)
+ at least 6 students will be at the conference in Bern
+ a student presentation slot has been created:
+ thus students can prepare a 5-6 minute lightning talk on their project

* Release Engineering update (Christian)
+ 4.2.6 status
  + will be released tomorrow (Friday)
+ 4.3.0 retrospective / MABs ...
+ Android Remote
+ 4.3.1 late feature
  + OpenGL context on OSX including 3D models in impress (Markus)
+ all on track (Cloph)

* Windows quick starter reportedly broken in 4.3
  https://bugs.freedesktop.org/show_bug.cgi?id=80466
+ is it worth fixing this or should we just kill the quick starter?
+ do we have real data if it helps at all when turned on? (Kendy)
+ remove for 4.3.1 ? re-enable for 4.3.2 if fix is possible?
+ let's try that for 4.3.1 RC1

* how to deal with 10.5 OSX
+ wouldnt it need a fork anyway, if we introduce C++11 features?
+ maybe, but I at least don't care; has always been communicated
  that 10.5 commits on master are only acceptable as long as
  they don't hinder us going forward (Stephan)
+ create a branch Douglas can work on

* Crashtest update (Markus)
+ 
http://dev-builds.libreoffice.org/crashtest/82127a86dc1d127a3b6caa8279163aab1ccf119a/
+ new results - complete run
+ hopefully new builds next week

* Certification Committee (Stephan/Bjoern/Kendy)
 + waiting until ~September

* Hackfests (Bjoern)
+ Boston Hackfest
* Went well, many thanks to Xamarin for hosting.
  + https://wiki.documentfoundation.org/Events/2014/US_Summer_Hackfest
  + Badly need more easy hacks ...
+ Interest in Portland, OR for hosting a future hackfest.
+ Munich hack-fest (Jan-Marek):
http://www.it-muenchen-blog.de/2014/07/bug-squashing-party-2014/
+ will have a BSP come-together; if someone says they're coming
  just show up etc.
   + November 21st-23rd, 2014
   https://wiki.debian.org/BSP/2014/11/de/Munich
   + we should drop by with 2 or 3 developers, if possible
+ Toulouse Hackfest ...
+ Confirmed for Nov. 15-16th
+ more details: 
https://wiki.documentfoundation.org/Hackfest/Toulouse2014
+ Be great to have -really- easy easy hacks for devs (Bjoern)

* QA (Robinson)
+ Also possible crasher if Quickstarter is enabled
+ https://bugs.freedesktop.org/show_bug.cgi?id=80927
+ other recently "interesting" bugs
+ VIEWING: Bad Font Rendering in KDE
  https://bugs.freedesktop.org/show_bug.cgi?id=59818
+ 4.3.0 looks OK from QA point of view? (Kendy)
+ (other than what I mentioned) yes (Robinson)
+ unconfirmed bug count under 700

* UX Update (?)
+ [ no Astron / Mirek ]

* Bern Conference
  + book hotel if you didn't already, many are full
  + there will be a PGP keysigning party, see
+ https://conference.libreoffice.org/2014/ksp-keysigning-party/
  upload your key as indicated
+ not only to strengthen the web of trust but also fun socializing

* QA stats:
  + https://bugs.freedesktop.org/page.cgi?id=weekly-bug-summary.html
+141-132(+9 overall)
many thanks to the top bug squashers:
Joel Madero 14
Foss 9
ign_christian8
Jorendc  8
tommy27  7
Michael Stahl6
Julien Nabet 5
David Tardon 5
Owen Genat   5
Jean-Baptiste Faure  5
Caolán McNamara  4

* Open 4.4 MAB
  + 3/7 3/7 2/5 1/2 1/1
  + https://bugs.freedesktop.org/showdependencytree.cgi?id=79641&hide_resolved=1

* Open 4.3 MAB
  + 11/47 14/47 14/45 19/43 10/32 6/27 5/24 5/22 3/20 5/16 4/12 2/8 3/7 2/5
 23%   29%   33%   44%   31%   22%  20%  22%  15%
  + https://bugs.freedesktop.org/showdependencytree.cgi?id=75025&hide_resolved=1

* Open 4.2 MAB
  + 84/236 85/235 82/229 81/222 76/215 74/212 74/210 71/20

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

2014-05-08 Thread Eike Rathke
 sc/inc/consoli.hxx  |7 ++---
 sc/source/core/tool/consoli.cxx |   52 ++--
 2 files changed, 22 insertions(+), 37 deletions(-)

New commits:
commit e891afeccba8f20f8bdaeacb20f2215cfcb1abfd
Author: Eike Rathke 
Date:   Fri May 9 00:11:06 2014 +0200

resolve fdo#77509 memory corruption / crash in Consolidate

Regression introduced with c81dec478ab0618f2acd2580654a93d3a7185444
memcpy some sizeof(OUString) is doomed to fail.

Change-Id: I81dc9cc7eaf02607ed05b4d284a7e5e462eeeb0a

diff --git a/sc/inc/consoli.hxx b/sc/inc/consoli.hxx
index ec96a60..8811f5b 100644
--- a/sc/inc/consoli.hxx
+++ b/sc/inc/consoli.hxx
@@ -80,11 +80,10 @@ private:
 double**ppCount;
 double**ppSumSqr;
 ScReferenceList**   ppRefs;
-OUString*   mpColHeaders;
-OUString*   mpRowHeaders;
+::std::vector maColHeaders;
+::std::vector maRowHeaders;
+::std::vector maTitles;
 SCSIZE  nDataCount;
-SCSIZE  nTitleCount;
-OUString*   mpTitles;
 SCSIZE**ppTitlePos;
 boolbCornerUsed;
 OUStringaCornerText;// only for bColByName && 
bRowByName
diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx
index 7c897c0..5a36fba 100644
--- a/sc/source/core/tool/consoli.cxx
+++ b/sc/source/core/tool/consoli.cxx
@@ -71,16 +71,9 @@ void ScReferenceList::AddEntry( SCCOL nCol, SCROW nRow, 
SCTAB nTab )
 }
 
 template< typename T >
-static void lcl_AddString( OUString*& pData, T& nCount, const OUString& 
rInsert )
+static void lcl_AddString( ::std::vector& rData, T& nCount, const 
OUString& rInsert )
 {
-OUString* pOldData = pData;
-pData = new OUString[ nCount+1 ];
-if (pOldData)
-{
-memcpy( pData, pOldData, nCount * sizeof(OUString) );
-delete[] pOldData;
-}
-pData[nCount] = rInsert;
+rData.push_back( rInsert);
 ++nCount;
 }
 
@@ -96,11 +89,7 @@ ScConsData::ScConsData() :
 ppCount(NULL),
 ppSumSqr(NULL),
 ppRefs(NULL),
-mpColHeaders(NULL),
-mpRowHeaders(NULL),
 nDataCount(0),
-nTitleCount(0),
-mpTitles(NULL),
 ppTitlePos(NULL),
 bCornerUsed(false)
 {
@@ -141,16 +130,12 @@ void ScConsData::DeleteData()
 DELETEARR( ppSumSqr,nColCount );
 DELETEARR( ppUsed,  nColCount );// erst nach ppRefs !!!
 DELETEARR( ppTitlePos, nRowCount );
-delete[] mpColHeaders;
-mpColHeaders = NULL;
-delete[] mpRowHeaders;
-mpRowHeaders = NULL;
-delete[] mpTitles;
-mpTitles = NULL;
-nTitleCount = 0;
+::std::vector().swap( maColHeaders);
+::std::vector().swap( maRowHeaders);
+::std::vector().swap( maTitles);
 nDataCount = 0;
 
-if (bColByName) nColCount = 0;  // sonst stimmt 
mpColHeaders nicht
+if (bColByName) nColCount = 0;  // sonst stimmt 
maColHeaders nicht
 if (bRowByName) nRowCount = 0;
 
 bCornerUsed = false;
@@ -254,10 +239,10 @@ void ScConsData::AddFields( ScDocument* pSrcDoc, SCTAB 
nTab,
 {
 bool bFound = false;
 for (SCSIZE i=0; i(i);
 bFound = true;
@@ -547,7 +533,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab,
 {
 bool bFound = false;
 for (SCSIZE i=0; i(i);
 bFound = true;
@@ -656,10 +642,10 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, 
SCCOL nCol, SCROW nRow,
 
 if (bColByName)
 for (SCSIZE i=0; iSetString( sal::static_int_cast(nStartCol+i), 
nRow, nTab, mpColHeaders[i] );
+pDestDoc->SetString( sal::static_int_cast(nStartCol+i), 
nRow, nTab, maColHeaders[i] );
 if (bRowByName)
 for (SCSIZE j=0; jSetString( nCol, 
sal::static_int_cast(nStartRow+j), nTab, mpRowHeaders[j] );
+pDestDoc->SetString( nCol, 
sal::static_int_cast(nStartRow+j), nTab, maRowHeaders[j] );
 
 nCol = nStartCol;
 nRow = nStartRow;
@@ -769,7 +755,7 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, 
SCCOL nCol, SCROW nRow,
 
 //  Zwischentitel
 
-if (ppTitlePos && mpTitles && mpRowHeaders)
+if (ppTitlePos && !maTitles.empty() && !maRowHeaders.empty())
 {
 OUString aDelim( " / " );
 for (SCSIZE nPos=0; nPosSetString( nCol-1, nRow+nArrY+nTPos, 
nTab, aString );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-08 Thread Eike Rathke
 sc/inc/consoli.hxx  |7 ++---
 sc/source/core/tool/consoli.cxx |   52 ++--
 2 files changed, 22 insertions(+), 37 deletions(-)

New commits:
commit 948728a4159a8ba74ecc663373d31f1840fed9ac
Author: Eike Rathke 
Date:   Fri May 9 00:11:06 2014 +0200

resolve fdo#77509 memory corruption / crash in Consolidate

Regression introduced with c81dec478ab0618f2acd2580654a93d3a7185444
memcpy some sizeof(OUString) is doomed to fail.

Change-Id: I81dc9cc7eaf02607ed05b4d284a7e5e462eeeb0a
(cherry picked from commit e891afeccba8f20f8bdaeacb20f2215cfcb1abfd)
Reviewed-on: https://gerrit.libreoffice.org/9282
Reviewed-by: Kohei Yoshida 
Tested-by: Kohei Yoshida 

diff --git a/sc/inc/consoli.hxx b/sc/inc/consoli.hxx
index 9ae5060..e93ea8a 100644
--- a/sc/inc/consoli.hxx
+++ b/sc/inc/consoli.hxx
@@ -80,11 +80,10 @@ private:
 double**ppCount;
 double**ppSumSqr;
 ScReferenceList**   ppRefs;
-OUString*   mpColHeaders;
-OUString*   mpRowHeaders;
+::std::vector maColHeaders;
+::std::vector maRowHeaders;
+::std::vector maTitles;
 SCSIZE  nDataCount;
-SCSIZE  nTitleCount;
-OUString*   mpTitles;
 SCSIZE**ppTitlePos;
 sal_BoolbCornerUsed;
 OUStringaCornerText;// only for bColByName && 
bRowByName
diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx
index 3dbe8f9..c2a5121 100644
--- a/sc/source/core/tool/consoli.cxx
+++ b/sc/source/core/tool/consoli.cxx
@@ -70,16 +70,9 @@ void ScReferenceList::AddEntry( SCCOL nCol, SCROW nRow, 
SCTAB nTab )
 }
 
 template< typename T >
-static void lcl_AddString( OUString*& pData, T& nCount, const OUString& 
rInsert )
+static void lcl_AddString( ::std::vector& rData, T& nCount, const 
OUString& rInsert )
 {
-OUString* pOldData = pData;
-pData = new OUString[ nCount+1 ];
-if (pOldData)
-{
-memcpy( pData, pOldData, nCount * sizeof(OUString) );
-delete[] pOldData;
-}
-pData[nCount] = rInsert;
+rData.push_back( rInsert);
 ++nCount;
 }
 
@@ -95,11 +88,7 @@ ScConsData::ScConsData() :
 ppCount(NULL),
 ppSumSqr(NULL),
 ppRefs(NULL),
-mpColHeaders(NULL),
-mpRowHeaders(NULL),
 nDataCount(0),
-nTitleCount(0),
-mpTitles(NULL),
 ppTitlePos(NULL),
 bCornerUsed(false)
 {
@@ -140,16 +129,12 @@ void ScConsData::DeleteData()
 DELETEARR( ppSumSqr,nColCount );
 DELETEARR( ppUsed,  nColCount );// erst nach ppRefs !!!
 DELETEARR( ppTitlePos, nRowCount );
-delete[] mpColHeaders;
-mpColHeaders = NULL;
-delete[] mpRowHeaders;
-mpRowHeaders = NULL;
-delete[] mpTitles;
-mpTitles = NULL;
-nTitleCount = 0;
+::std::vector().swap( maColHeaders);
+::std::vector().swap( maRowHeaders);
+::std::vector().swap( maTitles);
 nDataCount = 0;
 
-if (bColByName) nColCount = 0;  // sonst stimmt 
mpColHeaders nicht
+if (bColByName) nColCount = 0;  // sonst stimmt 
maColHeaders nicht
 if (bRowByName) nRowCount = 0;
 
 bCornerUsed = false;
@@ -256,10 +241,10 @@ void ScConsData::AddFields( ScDocument* pSrcDoc, SCTAB 
nTab,
 {
 bool bFound = false;
 for (SCSIZE i=0; i(i);
 bFound = true;
@@ -549,7 +535,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab,
 {
 bool bFound = false;
 for (SCSIZE i=0; i(i);
 bFound = true;
@@ -661,10 +647,10 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, 
SCCOL nCol, SCROW nRow,
 
 if (bColByName)
 for (SCSIZE i=0; iSetString( sal::static_int_cast(nStartCol+i), 
nRow, nTab, mpColHeaders[i] );
+pDestDoc->SetString( sal::static_int_cast(nStartCol+i), 
nRow, nTab, maColHeaders[i] );
 if (bRowByName)
 for (SCSIZE j=0; jSetString( nCol, 
sal::static_int_cast(nStartRow+j), nTab, mpRowHeaders[j] );
+pDestDoc->SetString( nCol, 
sal::static_int_cast(nStartRow+j), nTab, maRowHeaders[j] );
 
 nCol = nStartCol;
 nRow = nStartRow;
@@ -774,7 +760,7 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, 
SCCOL nCol, SCROW nRow,
 
 //  Zwischentitel
 
-if (ppTitlePos && mpTitles && mpRowHeaders)
+if (ppTitlePos && !maTitles.empty() && !maRowHeaders.empty())
 {
 OUString aDelim( " / " );
 for (SCSIZE nPos=0; nPosSetString( nCol-1, nRow+nArrY+nTPos, 
nTab, aString );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-09 Thread Eike Rathke
 include/svtools/langtab.hxx |8 
 include/tools/resary.hxx|2 ++
 svtools/source/misc/langtab.cxx |   11 +++
 tools/source/rc/resary.cxx  |6 ++
 4 files changed, 27 insertions(+)

New commits:
commit 07481fd864a1826c29a9e6bdf6c08dac4cc56ba7
Author: Eike Rathke 
Date:   Sat May 10 00:33:00 2014 +0200

add on-the-fly language tags to the language table

Change-Id: I5ca9e212374821de425729863c82f7b4699487a7

diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index d97f382..b8eeec0 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -163,6 +163,12 @@ const OUString SvtLanguageTableImpl::GetString( const 
LanguageType eType, bool b
 << std::hex << eType
 << " with unknown name, so returning lang-tag of: "
 << sLangTag);
+
+// And add it to the table if it is an on-the-fly-id, which it usually is,
+// so it is available in all subsequent language boxes.
+if (LanguageTag::isOnTheFlyID( eType))
+const_cast(this)->AddItem( sLangTag, eType);
+
 return sLangTag;
 }
 
commit 1564b0fe7c00902b076725b0693cc60aec0e0916
Author: Eike Rathke 
Date:   Fri May 9 21:43:55 2014 +0200

added SvtLanguageTable::AddLanguageTag()

Change-Id: Ic8be508bff3767f2f8ab1146447b3fe4b3b3

diff --git a/include/svtools/langtab.hxx b/include/svtools/langtab.hxx
index 14b506b..f8e6363 100644
--- a/include/svtools/langtab.hxx
+++ b/include/svtools/langtab.hxx
@@ -40,6 +40,14 @@ public:
   parameter.
  */
 static OUString GetLanguageString( const LanguageType eType, bool 
bUserInterfaceSelection );
+
+/** Add a language tag to the table.
+
+@param  rString
+UI visible description string. If empty, the rLanguageTag Bcp47
+string is used instead.
+ */
+static sal_uInt32   AddLanguageTag( const LanguageTag& rLanguageTag, const 
OUString& rString );
 };
 
 // Add LRE or RLE embedding characters to the string based on the
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 08d50bd..d97f382 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -227,5 +227,10 @@ LanguageType SvtLanguageTable::GetLanguageTypeAtIndex( 
sal_uInt32 nIndex )
 }
 
 
+sal_uInt32 SvtLanguageTable::AddLanguageTag( const LanguageTag& rLanguageTag, 
const OUString& rString )
+{
+return theLanguageTable::get().AddItem( (rString.isEmpty() ? 
rLanguageTag.getBcp47() : rString),
+rLanguageTag.getLanguageType());
+}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 0b2c8a8b2b7cd41ed8e25d2e184a8e7241abed02
Author: Eike Rathke 
Date:   Fri May 9 20:51:12 2014 +0200

added ResStringArray::AddItem()

Change-Id: I361cd4256c0816a46ea6e37dd9fd2680d3dba9fb

diff --git a/include/tools/resary.hxx b/include/tools/resary.hxx
index b29d67b..21a6625 100644
--- a/include/tools/resary.hxx
+++ b/include/tools/resary.hxx
@@ -53,6 +53,8 @@ public:
 sal_uInt32  Count() const { return sal_uInt32(m_aStrings.size()); }
 
 sal_uInt32  FindIndex( sal_IntPtr nValue ) const;
+
+sal_uInt32  AddItem( const OUString& rString, sal_IntPtr nValue );
 };
 
 #endif
diff --git a/tools/source/rc/resary.cxx b/tools/source/rc/resary.cxx
index 77f3ee7..dac1d94 100644
--- a/tools/source/rc/resary.cxx
+++ b/tools/source/rc/resary.cxx
@@ -60,4 +60,10 @@ sal_uInt32 ResStringArray::FindIndex( sal_IntPtr nValue ) 
const
 return RESARRAY_INDEX_NOTFOUND;
 }
 
+sal_uInt32 ResStringArray::AddItem( const OUString& rString, sal_IntPtr nValue 
)
+{
+m_aStrings.push_back( ImplResStringItem( rString, nValue));
+return m_aStrings.size();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-12 Thread Eike Rathke
 sc/source/ui/app/inputhdl.cxx |   31 +++
 1 file changed, 23 insertions(+), 8 deletions(-)

New commits:
commit ad8a7bf570576186f37d5c30bb41bb119ded1626
Author: Eike Rathke 
Date:   Mon May 12 23:22:22 2014 +0200

include parentheses replacement in functions' formula data, fdo#75264

... to actually make hitting Enter on a function tip work so the
parentheses are added and the cursor is placed in between and the
correct description is displayed.

Change-Id: I2cbe8f9e2b745a8331aeb8744b64d0baa1f0513e

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index da4f5a2..f35ab6a 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -98,6 +98,11 @@ namespace {
 // and the quotation mark (so string constants can be skipped)
 const sal_Char pMinDelimiters[] = " !\"";
 
+// Formula data replacement character for a pair of parentheses at end of
+// function name, to force sorting parentheses before all other characters.
+// Collation may treat parentheses differently.
+const sal_Unicode cParenthesesReplacement = 0x0001;
+
 sal_Unicode lcl_getSheetSeparator(ScDocument* pDoc)
 {
 ScCompiler aComp(pDoc, ScAddress());
@@ -720,6 +725,7 @@ void ScInputHandler::GetFormulaData()
 else
 pFormulaDataPara = new ScTypedCaseStrSet;
 
+const OUString aParenthesesReplacement( cParenthesesReplacement);
 const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
 sal_uLong nListCount = pFuncList->GetCount();
 for(sal_uLong i=0;iGetFunction( i );
 if ( pDesc->pFuncName )
 {
-pFormulaData->insert(ScTypedStrData(*pDesc->pFuncName, 0.0, 
ScTypedStrData::Standard));
 const sal_Unicode* pName = pDesc->pFuncName->getStr();
 const sal_Int32 nLen = pDesc->pFuncName->getLength();
 // fdo#75264 fill maFormulaChar with all characters used in 
formula names
@@ -736,6 +741,8 @@ void ScInputHandler::GetFormulaData()
 sal_Unicode c = pName[ j ];
 maFormulaChar.insert( c );
 }
+OUString aFuncName = *pDesc->pFuncName + 
aParenthesesReplacement;
+pFormulaData->insert(ScTypedStrData(aFuncName, 0.0, 
ScTypedStrData::Standard));
 pDesc->initArgumentInfo();
 OUString aEntry = pDesc->getSignature();
 pFormulaDataPara->insert(ScTypedStrData(aEntry, 0.0, 
ScTypedStrData::Standard));
@@ -830,9 +837,10 @@ void ScInputHandler::ShowTipCursor()
 nArgPos = aHelper.GetArgStart( aSelText, 
nNextFStart, 0 );
 nArgs = 
static_cast(ppFDesc->getParameterCount());
 
+OUString aFuncName = ppFDesc->getFunctionName() + 
"(";
 OUString aNew;
 ScTypedCaseStrSet::const_iterator it =
-findText(*pFormulaDataPara, 
pFormulaDataPara->end(), ppFDesc->getFunctionName(), aNew, false);
+findText(*pFormulaDataPara, 
pFormulaDataPara->end(), aFuncName, aNew, false);
 if (it != pFormulaDataPara->end())
 {
 bool bFlag = false;
@@ -1084,7 +1092,8 @@ void ScInputHandler::UseFormulaData()
 miAutoPosFormula = findText(*pFormulaData, miAutoPosFormula, 
aText, aNew, false);
 if (miAutoPosFormula != pFormulaData->end())
 {
-aNew += "()";
+if (aNew[aNew.getLength()-1] == cParenthesesReplacement)
+aNew = aNew.copy( 0, aNew.getLength()-1) + "()";
 ShowTip( aNew );
 aAutoSearch = aText;
 }
@@ -1227,6 +1236,8 @@ void ScInputHandler::NextFormulaEntry( bool bBack )
 if (itNew != pFormulaData->end())
 {
 miAutoPosFormula = itNew;
+if (aNew[aNew.getLength()-1] == cParenthesesReplacement)
+aNew = aNew.copy( 0, aNew.getLength()-1) + "()";
 ShowTip(aNew); // Display a quick help
 }
 }
@@ -1288,7 +1299,9 @@ void ScInputHandler::PasteFunctionData()
 if (pFormulaData && miAutoPosFormula != pFormulaData->end())
 {
 const ScTypedStrData& rData = *miAutoPosFormula;
-const OUString& aInsert = rData.GetString();
+OUString aInsert = rData.GetString();
+if (aInsert[aInsert.getLength()-1] == cParenthesesReplacement)
+aInsert = aInsert.copy( 0, aInsert.getLength()-1) + "()";
 bool bParInserted = false;
 
 DataChanging(); // Cannot be new
commit ead754112a1ecaa456d8b5d7231ed178

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

2014-05-12 Thread Eike Rathke
 sc/source/ui/app/inputhdl.cxx |  418 ++
 sc/source/ui/inc/inputhdl.hxx |2 
 2 files changed, 146 insertions(+), 274 deletions(-)

New commits:
commit 5a14766061f75e88791dc3134c9ec56e198144e2
Author: Eike Rathke 
Date:   Tue May 13 01:16:24 2014 +0200

distill copypasta

Change-Id: Ibb6e9e6f98041ddc81b3743f57c3335458be2cb0

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index f35ab6a..ec22405 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -792,186 +792,186 @@ void ScInputHandler::HideTipBelow()
 aManualTip = OUString();
 }
 
-void ScInputHandler::ShowTipCursor()
+void ScInputHandler::ShowArgumentsTip( const OUString& rParagraph, OUString& 
rSelText, const ESelection& rSel,
+bool bTryFirstSel )
 {
-HideTip();
-HideTipBelow();
-EditView* pActiveView = pTopView ? pTopView : pTableView;
 ScDocShell* pDocSh = pActiveViewSh->GetViewData()->GetDocShell();
 const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep);
 const sal_Unicode cSheetSep = lcl_getSheetSeparator(pDocSh->GetDocument());
-
-if ( bFormulaMode && pActiveView && pFormulaDataPara && 
pEngine->GetParagraphCount() == 1 )
+FormulaHelper aHelper(ScGlobal::GetStarCalcFunctionMgr());
+bool bFound = false;
+while( !bFound )
 {
-OUString aFormula = pEngine->GetText( 0 );
-ESelection aSel = pActiveView->GetSelection();
-aSel.Adjust();
-if( aSel.nEndPos )
+rSelText += ")";
+sal_Int32 nLeftParentPos = lcl_MatchParenthesis( rSelText, 
rSelText.getLength()-1 );
+if( nLeftParentPos != -1 )
 {
-if ( aFormula.getLength() < aSel.nEndPos )
-return;
-sal_Int32 nPos = aSel.nEndPos;
-OUString  aSelText = aFormula.copy( 0, nPos );
-sal_Int32   nNextFStart = 0;
-sal_Int32  nArgPos = 0;
+sal_Int32 nNextFStart = aHelper.GetFunctionStart( rSelText, 
nLeftParentPos, true);
 const IFunctionDescription* ppFDesc;
 ::std::vector< OUString> aArgs;
-sal_uInt16  nArgs;
-bool bFound = false;
-FormulaHelper aHelper(ScGlobal::GetStarCalcFunctionMgr());
-
-while( !bFound )
+if( aHelper.GetNextFunc( rSelText, false, nNextFStart, NULL, 
&ppFDesc, &aArgs ) )
 {
-aSelText += ")";
-sal_Int32 nLeftParentPos = lcl_MatchParenthesis( aSelText, 
aSelText.getLength()-1 );
-if( nLeftParentPos != -1 )
+if( !ppFDesc->getFunctionName().isEmpty() )
 {
-sal_Unicode c = ( nLeftParentPos > 0 ) ? aSelText[ 
nLeftParentPos-1 ] : 0;
-if( !(comphelper::string::isalphaAscii(c)) )
-continue;
-nNextFStart = aHelper.GetFunctionStart( aSelText, 
nLeftParentPos, true);
-if( aHelper.GetNextFunc( aSelText, false, nNextFStart, 
NULL, &ppFDesc, &aArgs ) )
+sal_Int32 nArgPos = aHelper.GetArgStart( rSelText, 
nNextFStart, 0 );
+sal_uInt16 nArgs = 
static_cast(ppFDesc->getParameterCount());
+OUString aFuncName( ppFDesc->getFunctionName() + "(");
+OUString aNew;
+ScTypedCaseStrSet::const_iterator it =
+findText(*pFormulaDataPara, pFormulaDataPara->end(), 
aFuncName, aNew, false);
+if (it != pFormulaDataPara->end())
 {
-if( !ppFDesc->getFunctionName().isEmpty() )
+bool bFlag = false;
+sal_uInt16 nActive = 0;
+for( sal_uInt16 i=0; i < nArgs; i++ )
+{
+sal_Int32 nLength = aArgs[i].getLength();
+if( nArgPos <= rSelText.getLength()-1 )
+{
+nActive = i+1;
+bFlag = true;
+}
+nArgPos+=nLength+1;
+}
+if( bFlag )
 {
-nArgPos = aHelper.GetArgStart( aSelText, 
nNextFStart, 0 );
-nArgs = 
static_cast(ppFDesc->getParameterCount());
-
-OUString aFuncName = ppFDesc->getFunctionName() + 
"(";
-OUString aNew;
-ScTypedCaseStrSet::const_iterator it =
-findText(*pFormulaDataPara, 
pFormulaDataPara->end(), aFuncName, aNew, false);
-   

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

2014-05-13 Thread Eike Rathke
 i18npool/Library_localedata_others.mk  |1 
 i18npool/source/localedata/data/mos_BF.xml |  370 +
 i18npool/source/localedata/localedata.cxx  |3 
 3 files changed, 373 insertions(+), 1 deletion(-)

New commits:
commit 6e2818a1f8304562ec393f6d84c237596657b54f
Author: Eike Rathke 
Date:   Tue May 13 10:04:37 2014 +0200

add DateAcceptancePattern M/D for [mos-BF], fdo#78647

Change-Id: I79af7fdd7bc6b4c95f4b018a373d8a4685226abd

diff --git a/i18npool/source/localedata/data/mos_BF.xml 
b/i18npool/source/localedata/data/mos_BF.xml
index 4e87f5b..f6ba0ad 100644
--- a/i18npool/source/localedata/data/mos_BF.xml
+++ b/i18npool/source/localedata/data/mos_BF.xml
@@ -43,6 +43,7 @@
 metric
   
   
+M/D
 
   General
 
commit 2e687884e7e48fab4ef319edcfc7579e55546067
Author: Eike Rathke 
Date:   Tue May 13 10:01:29 2014 +0200

add locale data for Moore in Burkina Faso [mos-BF], fdo#78647

Change-Id: If6f3134b74c0ef6ca3caf3c508bbcc163d6196fa

diff --git a/i18npool/Library_localedata_others.mk 
b/i18npool/Library_localedata_others.mk
index 03447dc..59fe317 100644
--- a/i18npool/Library_localedata_others.mk
+++ b/i18npool/Library_localedata_others.mk
@@ -79,6 +79,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,localedata_others,\
CustomTarget/i18npool/localedata/localedata_mkw_CG \
CustomTarget/i18npool/localedata/localedata_ml_IN \
CustomTarget/i18npool/localedata/localedata_mn_Cyrl_MN \
+   CustomTarget/i18npool/localedata/localedata_mos_BF \
CustomTarget/i18npool/localedata/localedata_mr_IN \
CustomTarget/i18npool/localedata/localedata_ms_MY \
CustomTarget/i18npool/localedata/localedata_my_MM \
diff --git a/i18npool/source/localedata/localedata.cxx 
b/i18npool/source/localedata/localedata.cxx
index 7e96519..3573adc 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -288,7 +288,8 @@ static const struct {
 { "ar_KW",  lcl_DATA_OTHERS },
 { "bm_ML",  lcl_DATA_OTHERS },
 { "pui_CO", lcl_DATA_OTHERS },
-{ "lgr_SB", lcl_DATA_OTHERS }
+{ "lgr_SB", lcl_DATA_OTHERS },
+{ "mos_BF", lcl_DATA_OTHERS }
 };
 
 #else
commit 33fcda6de72781dcd11fefcfff5079f4f69998ca
Author: David Delma 
Date:   Tue May 13 09:35:26 2014 +0200

locale data for Moore in Burkina Faso [mos-BF], fdo#78647

Change-Id: Ice37ec78078e078d9b2f530b0ebfe53f12c6aed8

diff --git a/i18npool/source/localedata/data/mos_BF.xml 
b/i18npool/source/localedata/data/mos_BF.xml
new file mode 100644
index 000..4e87f5b
--- /dev/null
+++ b/i18npool/source/localedata/data/mos_BF.xml
@@ -0,0 +1,369 @@
+
+
+
+
+  
+
+  mos
+  Mòoré
+
+
+  BF
+  Burkina Faso
+
+  
+  
+
+  /
+   
+  ,
+  :
+  ,
+  ;
+   
+   
+   
+  , 
+
+
+  '
+  '
+  "
+  "
+
+AM
+PM
+metric
+  
+  
+
+  General
+
+
+  0
+
+
+  0,00
+
+
+  # ##0
+
+
+  # ##0,00
+
+
+  # ###,00
+
+
+  0,00E+00
+
+
+  0,00E+000
+
+
+  0%
+
+
+  0,00%
+
+
+  # ##0 [CURRENCY];-[CURRENCY] # ##0
+
+
+  # ##0,00 [CURRENCY];-[CURRENCY] # ##0,00
+
+
+  # ##0 [CURRENCY];[RED]-[CURRENCY] # ##0
+
+
+  # ##0,00 [CURRENCY];[RED]-[CURRENCY] # ##0,00
+
+
+  # ##0,00 CCC
+
+
+  # ##0,-- [CURRENCY];[RED]-[CURRENCY] # ##0,--
+
+
+  YY/MM/DD
+
+
+  DD  
+
+
+  YY/MM/DD
+
+
+  /MM/DD
+
+
+  D MMM YY
+
+
+  D MMM 
+
+
+  D MMM 
+
+
+  D  
+
+
+  D  
+
+
+  NN DD/MMM/YY
+
+
+  NN D MMM YY
+
+
+  NN D  
+
+
+  D  
+
+
+  MM/DD
+
+
+  YY-MM-DD
+  ISO 8601
+
+
+  -MM-DD
+  ISO 8601
+
+
+  YY/MM
+
+
+  MMM/DD
+
+
+  
+
+
+  QQ, YY
+
+
+  WW
+
+
+  HH:MM
+
+
+  HH:MM:SS
+
+
+  HH:MM AM/PM
+
+
+  HH:MM:SS AM/PM
+
+
+  [HH]:MM:SS
+
+
+  MM:SS,00
+
+
+  [HH]:MM:SS,00
+
+
+  YY/MM/DD HH:MM
+
+
+  /MM/DD HH:MM:SS AM/PM
+
+  
+  
+
+
+  IGNORE_CASE
+
+  
+  
+
+  IGNORE_CASE
+
+  
+  
+A-Z
+0
+1
+2
+4
+7
+TSVN
+TSVN
+  
+  
+
+  
+
+  sun
+  hat
+  hato
+
+
+  mon
+  tẽn
+  tẽne
+
+
+  tue
+  tal
+   

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

2014-05-13 Thread Eike Rathke
 include/svtools/langtab.hxx |7 +++
 svtools/source/misc/langtab.cxx |6 ++
 2 files changed, 13 insertions(+)

New commits:
commit d0787149cf25377bad97ab503f81a5c0793bbad7
Author: Eike Rathke 
Date:   Tue May 13 12:03:53 2014 +0200

remove SvtLanguageTable::AddLanguageTag from this list

... I'm about to use.

Change-Id: I4f665e14d0d2161085760a6b31f642e0a8a8345b

diff --git a/unusedcode.easy b/unusedcode.easy
index ae0ce4b..646cb1e 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -68,7 +68,6 @@ StyleSettings::SetTitleHeight(long)
 StyleSettings::SetUseFlatBorders(bool)
 StyleSettings::SetUseFlatMenus(bool)
 SvpSalInstance::PostedEventsInQueue()
-SvtLanguageTable::AddLanguageTag(LanguageTag const&, rtl::OUString const&)
 SvtListener::IsListening(SvtBroadcaster&) const
 
SvxDummyShapeContainer::SvxDummyShapeContainer(com::sun::star::uno::Reference)
 SvxNumberFormatShell::IsAdded_Impl(unsigned long)
commit 213e429cfb48510650308975d4adca6ab9aee4f4
Author: Eike Rathke 
Date:   Tue May 13 12:02:42 2014 +0200

Revert "remove unused code -SvtLanguageTable::AddLanguageTag"

This reverts commit d812b784313ed85ae5085d54a3ae50aa064c053c.

I added that code in preparation of changes I'm doing.

diff --git a/include/svtools/langtab.hxx b/include/svtools/langtab.hxx
index 4503d38..0034873 100644
--- a/include/svtools/langtab.hxx
+++ b/include/svtools/langtab.hxx
@@ -43,6 +43,13 @@ public:
  */
 static OUString GetLanguageString( const LanguageType eType, bool 
bUserInterfaceSelection );
 
+/** Add a language tag to the table.
+
+@param  rString
+UI visible description string. If empty, the rLanguageTag Bcp47
+string is used instead.
+ */
+static sal_uInt32   AddLanguageTag( const LanguageTag& rLanguageTag, const 
OUString& rString );
 };
 
 // Add LRE or RLE embedding characters to the string based on the
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index f31ea28..b8eeec0 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -233,4 +233,10 @@ LanguageType SvtLanguageTable::GetLanguageTypeAtIndex( 
sal_uInt32 nIndex )
 }
 
 
+sal_uInt32 SvtLanguageTable::AddLanguageTag( const LanguageTag& rLanguageTag, 
const OUString& rString )
+{
+return theLanguageTable::get().AddItem( (rString.isEmpty() ? 
rLanguageTag.getBcp47() : rString),
+rLanguageTag.getLanguageType());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unusedcode.easy b/unusedcode.easy
index 646cb1e..ae0ce4b 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -68,6 +68,7 @@ StyleSettings::SetTitleHeight(long)
 StyleSettings::SetUseFlatBorders(bool)
 StyleSettings::SetUseFlatMenus(bool)
 SvpSalInstance::PostedEventsInQueue()
+SvtLanguageTable::AddLanguageTag(LanguageTag const&, rtl::OUString const&)
 SvtListener::IsListening(SvtBroadcaster&) const
 
SvxDummyShapeContainer::SvxDummyShapeContainer(com::sun::star::uno::Reference)
 SvxNumberFormatShell::IsAdded_Impl(unsigned long)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-13 Thread Eike Rathke
 include/vcl/combobox.hxx|2 +-
 vcl/source/control/combobox.cxx |7 ---
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 9d48e8fdf4e1efed5fc82e2ca00f2252debc94da
Author: Eike Rathke 
Date:   Tue May 13 15:05:40 2014 +0200

sal_Int32 ComboBox::InsertEntryWithImage()

Change-Id: Iaa1ddc931b71fcdf08d571c7e3573a936d378709

diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx
index 51770b2..8af4458 100644
--- a/include/vcl/combobox.hxx
+++ b/include/vcl/combobox.hxx
@@ -130,7 +130,7 @@ public:
 virtual voidSetText( const OUString& rStr, const Selection& 
rNewSelection ) SAL_OVERRIDE;
 
 virtual sal_Int32  InsertEntry(const OUString& rStr, sal_Int32  nPos = 
COMBOBOX_APPEND);
-voidInsertEntryWithImage( const OUString& rStr, const Image& 
rImage, sal_Int32  nPos = COMBOBOX_APPEND );
+sal_Int32   InsertEntryWithImage( const OUString& rStr, const Image& 
rImage, sal_Int32  nPos = COMBOBOX_APPEND );
 
 voidRemoveEntry( const OUString& rStr );
 virtual voidRemoveEntryAt(sal_Int32  nPos);
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 521d13a..cfd2e8e 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -872,11 +872,11 @@ sal_Int32 ComboBox::InsertEntry(const OUString& rStr, 
sal_Int32 const nPos)
 return nRealPos;
 }
 
-void ComboBox::InsertEntryWithImage(
+sal_Int32 ComboBox::InsertEntryWithImage(
 const OUString& rStr, const Image& rImage, sal_Int32 const nPos)
 {
 if (nPos < 0 || COMBOBOX_MAX_ENTRIES <= 
mpImplLB->GetEntryList()->GetEntryCount())
-return;
+return COMBOBOX_ERROR;
 
 sal_Int32 nRealPos;
 if (nPos == COMBOBOX_APPEND)
@@ -885,13 +885,14 @@ void ComboBox::InsertEntryWithImage(
 {
 const sal_Int32 nMRUCount = mpImplLB->GetEntryList()->GetMRUCount();
 if (nPos > COMBOBOX_MAX_ENTRIES - nMRUCount)
-return;
+return COMBOBOX_ERROR;
 nRealPos = nPos + nMRUCount;
 }
 
 nRealPos = mpImplLB->InsertEntry( nRealPos, rStr, rImage );
 nRealPos -= mpImplLB->GetEntryList()->GetMRUCount();
 CallEventListeners( VCLEVENT_COMBOBOX_ITEMADDED, (void*) 
sal_IntPtr(nRealPos) );
+return nRealPos;
 }
 
 void ComboBox::RemoveEntry( const OUString& rStr )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 4 commits - cui/uiconfig include/vcl sc/source vcl/source

2014-05-15 Thread Eike Rathke
 cui/uiconfig/ui/optlanguagespage.ui |4 ++--
 include/vcl/combobox.hxx|3 ++-
 sc/source/ui/app/inputhdl.cxx   |4 
 vcl/source/control/combobox.cxx |8 
 4 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit a4f32eec653596483088c6e5aa37de031278d74c
Author: Eike Rathke 
Date:   Thu May 15 12:29:11 2014 +0200

resolved fdo#78718 break the indefinite loop when entering ="

... introduced with the refactoring of
5a14766061f75e88791dc3134c9ec56e198144e2

Change-Id: Ic322c58cad749d136966cee08ca5a06be59897b7

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index ec22405..8b8d051 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -948,6 +948,10 @@ void ScInputHandler::ShowArgumentsTip( const OUString& 
rParagraph, OUString& rSe
 break;
 }
 }
+else
+{
+break;
+}
 }
 }
 
commit 848ec62b9ec806c18e0ca7ff2d45f39b4b147c0c
Author: Eike Rathke 
Date:   Wed May 14 20:47:07 2014 +0200

userinterface and currencylb are just ListBox, so GtkComboBoxText

... and not the bells and whistles SvxLanguageBox.

Change-Id: Icaeaeead0bd58bc05d2a9af4e9b7265de1647936

diff --git a/cui/uiconfig/ui/optlanguagespage.ui 
b/cui/uiconfig/ui/optlanguagespage.ui
index 83129a0..bad3df0 100644
--- a/cui/uiconfig/ui/optlanguagespage.ui
+++ b/cui/uiconfig/ui/optlanguagespage.ui
@@ -110,7 +110,7 @@
   
 
 
-  
+  
 True
 False
 start
@@ -138,7 +138,7 @@
   
 
 
-  
+  
 True
 False
 start
commit 1d1a28290a87e2db9e01535792aa0ed3dcbd27b7
Author: Eike Rathke 
Date:   Tue May 13 19:19:45 2014 +0200

+sal_Int32 ComboBox::GetEntryPos( const void* pData ) const

Change-Id: I9199da366eb70e818e1d85823cd7cf530f70167d

diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx
index 85ea06f..3ea2f64 100644
--- a/include/vcl/combobox.hxx
+++ b/include/vcl/combobox.hxx
@@ -138,6 +138,7 @@ public:
 voidClear();
 
 sal_Int32   GetEntryPos( const OUString& rStr ) const;
+sal_Int32   GetEntryPos( const void* pData ) const;
 Image   GetEntryImage( sal_Int32  nPos ) const;
 OUStringGetEntry( sal_Int32  nPos ) const;
 sal_Int32   GetEntryCount() const;
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index cfd2e8e..a5810f2 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -931,6 +931,14 @@ sal_Int32 ComboBox::GetEntryPos( const OUString& rStr ) 
const
 return nPos;
 }
 
+sal_Int32 ComboBox::GetEntryPos( const void* pData ) const
+{
+sal_Int32 nPos = mpImplLB->GetEntryList()->FindEntry( pData );
+if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+nPos = nPos - mpImplLB->GetEntryList()->GetMRUCount();
+return nPos;
+}
+
 OUString ComboBox::GetEntry( sal_Int32 nPos ) const
 {
 const sal_Int32 nMRUCount = mpImplLB->GetEntryList()->GetMRUCount();
commit f9a1e9074729d540d29a9ded2b3303373d3a9011
Author: Eike Rathke 
Date:   Tue May 13 17:15:09 2014 +0200

interface with COMBOBOX_... instead of LISTBOX_...

... even if it is the same value.

Change-Id: I62f81d181f25723cba5ca0fbfb395539385a007a

diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx
index 8af4458..85ea06f 100644
--- a/include/vcl/combobox.hxx
+++ b/include/vcl/combobox.hxx
@@ -154,7 +154,7 @@ public:
 voidDrawEntry( const UserDrawEvent& rEvt, bool bDrawImage, 
bool bDrawText, bool bDrawTextAtImagePos = false );
 voidSetBorderStyle( sal_uInt16 nBorderStyle );
 
-voidSetSeparatorPos( sal_Int32  n = LISTBOX_ENTRY_NOTFOUND );
+voidSetSeparatorPos( sal_Int32  n = COMBOBOX_ENTRY_NOTFOUND );
 
 voidEnableAutocomplete( bool bEnable, bool bMatchCase = false 
);
 boolIsAutocompleteEnabled() const;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-16 Thread Eike Rathke
 include/svx/langbox.hxx   |   90 ++---
 svx/source/dialog/langbox.cxx |  280 ++
 2 files changed, 277 insertions(+), 93 deletions(-)

New commits:
commit 5ad020235a8d4dd60752e781622c22f0187b4e45
Author: Eike Rathke 
Date:   Fri May 16 12:50:36 2014 +0200

introduce SvxLanguageBoxBase, SvxLanguageBox, SvxLanguageComboBox

In preparation of having a language box available as ComboBox to be able
to add language tags.

Change-Id: I5af5ea5bb06e558db1fcf9c0668be274d5cec04e

diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx
index d5ca097..7bc28f7 100644
--- a/include/svx/langbox.hxx
+++ b/include/svx/langbox.hxx
@@ -23,6 +23,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 
 #define LANG_LIST_EMPTY 0x
@@ -47,11 +49,27 @@
 // load language strings from resource
 SVX_DLLPUBLIC OUStringGetDicInfoStr( const OUString& rName, const 
sal_uInt16 nLang, bool bNeg );
 
-class SVX_DLLPUBLIC SvxLanguageBox : public ListBox
+class SVX_DLLPUBLIC SvxLanguageBoxBase : boost::noncopyable
 {
 public:
+explicit SvxLanguageBoxBase( bool bCheck );
+virtual ~SvxLanguageBoxBase();
 
-private:
+voidSetLanguageList( sal_Int16 nLangList,
+bool bHasLangNone, bool bLangNoneIsLangAll = false,
+bool bCheckSpellAvail = false );
+
+sal_Int32   InsertLanguage( const LanguageType eLangType, sal_Int32  
nPos = LISTBOX_APPEND );
+sal_Int32   InsertDefaultLanguage( sal_Int16 nType, sal_Int32  nPos = 
LISTBOX_APPEND );
+sal_Int32   InsertSystemLanguage( sal_Int32  nPos = LISTBOX_APPEND );
+sal_Int32   InsertLanguage( const LanguageType eLangType,
+bool bCheckEntry, sal_Int32  nPos = 
LISTBOX_APPEND );
+voidRemoveLanguage( const LanguageType eLangType );
+voidSelectLanguage( const LanguageType eLangType, bool bSelect 
= true );
+LanguageTypeGetSelectLanguage() const;
+boolIsLanguageSelected( const LanguageType eLangType ) const;
+
+protected:
 Image   m_aNotCheckedImage;
 Image   m_aCheckedImage;
 OUStringm_aAllString;
@@ -61,27 +79,63 @@ private:
 boolm_bLangNoneIsLangAll;
 boolm_bWithCheckmark;
 
-SVX_DLLPRIVATE voidInit();
-SVX_DLLPRIVATE sal_Int32   ImplInsertImgEntry( const 
OUString& rEntry, sal_Int32  nPos, bool bChecked );
-SVX_DLLPRIVATE sal_Int32   
ImplInsertLanguage(LanguageType, sal_Int32 nPos, sal_Int16 nType);
+SVX_DLLPRIVATE void ImplLanguageBoxBaseInit();
+SVX_DLLPRIVATE sal_Int32ImplInsertLanguage(LanguageType, 
sal_Int32 nPos, sal_Int16 nType);
+SVX_DLLPRIVATE sal_Int32ImplTypeToPos( LanguageType eType ) 
const;
+
+SVX_DLLPRIVATE virtual sal_Int32ImplInsertImgEntry( const OUString& 
rEntry, sal_Int32  nPos, bool bChecked ) = 0;
+SVX_DLLPRIVATE virtual void ImplRemoveEntryAt( sal_Int32 nPos ) = 
0;
+
+SVX_DLLPRIVATE virtual void ImplClear() = 0;
+SVX_DLLPRIVATE virtual sal_Int32ImplInsertEntry( const OUString& 
rEntry, sal_Int32 nPos ) = 0;
+SVX_DLLPRIVATE virtual void ImplSetEntryData( sal_Int32 nPos, 
void* pData ) = 0;
+SVX_DLLPRIVATE virtual sal_Int32ImplGetSelectEntryPos() const = 0;
+SVX_DLLPRIVATE virtual void*ImplGetEntryData( sal_Int32 nPos ) 
const = 0;
+SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, 
bool bSelect ) = 0;
+SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos 
) const = 0;
+SVX_DLLPRIVATE virtual sal_Int32ImplGetEntryCount() const = 0;
+};
+
 
+class SVX_DLLPUBLIC SvxLanguageBox : public ListBox, public SvxLanguageBoxBase
+{
 public:
-SvxLanguageBox(Window* pParent, WinBits nBits, bool bCheck = false);
+SvxLanguageBox( Window* pParent, WinBits nBits, bool bCheck = false );
 virtual ~SvxLanguageBox();
 
-voidSetLanguageList( sal_Int16 nLangList,
-bool bHasLangNone, bool bLangNoneIsLangAll = false,
-bool bCheckSpellAvail = false );
+private:
+SVX_DLLPRIVATE virtual sal_Int32ImplInsertImgEntry( const OUString& 
rEntry, sal_Int32  nPos, bool bChecked );
+SVX_DLLPRIVATE virtual void ImplRemoveEntryAt( sal_Int32 nPos );
 
-sal_Int32   InsertLanguage( const LanguageType eLangType, 
sal_Int32  nPos = LISTBOX_APPEND );
-sal_Int32   InsertDefaultLanguage( sal_Int16 nType, sal_Int32  
nPos = LISTBOX_APPEND );
-sal_Int32   InsertSystemLanguage( sal_Int32  nPos = LISTBOX_APPEND 
);
-sal_Int32   InsertLanguage( const LanguageType eLangType,
-bool bC

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

2014-05-16 Thread Eike Rathke
 include/svx/langbox.hxx   |   31 +++-
 svx/source/dialog/langbox.cxx |  101 --
 2 files changed, 125 insertions(+), 7 deletions(-)

New commits:
commit 0ab5802eb0e530e930bed6d5dbed1a0317ae323b
Author: Eike Rathke 
Date:   Fri May 16 22:00:15 2014 +0200

more SvxLanguageBoxBase interfacing

Change-Id: Ife9317d40756099ae4d8ecb84cccea91bd75a14c

diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx
index a278fac..dc872d8 100644
--- a/include/svx/langbox.hxx
+++ b/include/svx/langbox.hxx
@@ -69,6 +69,14 @@ public:
 LanguageTypeGetSelectLanguage() const;
 boolIsLanguageSelected( const LanguageType eLangType ) const;
 
+voidSetNoSelectionLBB();
+voidHideLBB();
+voidDisableLBB();
+voidSaveValueLBB();
+sal_Int32   GetSelectEntryPosLBB( sal_Int32 nSelIndex = 0 ) const;
+void*   GetEntryDataLBB( sal_Int32  nPos ) const;
+sal_Int32   GetSavedValueLBB() const;
+
 protected:
 Image   m_aNotCheckedImage;
 Image   m_aCheckedImage;
@@ -89,11 +97,16 @@ protected:
 SVX_DLLPRIVATE virtual void ImplClear() = 0;
 SVX_DLLPRIVATE virtual sal_Int32ImplInsertEntry( const OUString& 
rEntry, sal_Int32 nPos ) = 0;
 SVX_DLLPRIVATE virtual void ImplSetEntryData( sal_Int32 nPos, 
void* pData ) = 0;
-SVX_DLLPRIVATE virtual sal_Int32ImplGetSelectEntryPos() const = 0;
+SVX_DLLPRIVATE virtual sal_Int32ImplGetSelectEntryPos( sal_Int32 
nSelIndex = 0 ) const = 0;
 SVX_DLLPRIVATE virtual void*ImplGetEntryData( sal_Int32 nPos ) 
const = 0;
 SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, 
bool bSelect ) = 0;
 SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos 
) const = 0;
 SVX_DLLPRIVATE virtual sal_Int32ImplGetEntryCount() const = 0;
+SVX_DLLPRIVATE virtual void ImplSetNoSelection() = 0;
+SVX_DLLPRIVATE virtual void ImplHide() = 0;
+SVX_DLLPRIVATE virtual void ImplDisable() = 0;
+SVX_DLLPRIVATE virtual void ImplSaveValue() = 0;
+SVX_DLLPRIVATE virtual sal_Int32ImplGetSavedValue() const = 0;
 };
 
 
@@ -110,11 +123,16 @@ private:
 SVX_DLLPRIVATE virtual void ImplClear() SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual sal_Int32ImplInsertEntry( const OUString& 
rEntry, sal_Int32 nPos ) SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual void ImplSetEntryData( sal_Int32 nPos, 
void* pData ) SAL_OVERRIDE;
-SVX_DLLPRIVATE virtual sal_Int32ImplGetSelectEntryPos() const 
SAL_OVERRIDE;
+SVX_DLLPRIVATE virtual sal_Int32ImplGetSelectEntryPos( sal_Int32 
nSelIndex = 0 ) const SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual void*ImplGetEntryData( sal_Int32 nPos ) 
const SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, 
bool bSelect ) SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos 
) const SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual sal_Int32ImplGetEntryCount() const SAL_OVERRIDE;
+SVX_DLLPRIVATE virtual void ImplSetNoSelection() SAL_OVERRIDE;
+SVX_DLLPRIVATE virtual void ImplHide() SAL_OVERRIDE;
+SVX_DLLPRIVATE virtual void ImplDisable() SAL_OVERRIDE;
+SVX_DLLPRIVATE virtual void ImplSaveValue() SAL_OVERRIDE;
+SVX_DLLPRIVATE virtual sal_Int32ImplGetSavedValue() const SAL_OVERRIDE;
 };
 
 
@@ -125,17 +143,24 @@ public:
 virtual ~SvxLanguageComboBox();
 
 private:
+sal_Int32   mnSavedValuePos;
+
 SVX_DLLPRIVATE virtual sal_Int32ImplInsertImgEntry( const OUString& 
rEntry, sal_Int32  nPos, bool bChecked ) SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual void ImplRemoveEntryAt( sal_Int32 nPos ) 
SAL_OVERRIDE;
 
 SVX_DLLPRIVATE virtual void ImplClear() SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual sal_Int32ImplInsertEntry( const OUString& 
rEntry, sal_Int32 nPos ) SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual void ImplSetEntryData( sal_Int32 nPos, 
void* pData ) SAL_OVERRIDE;
-SVX_DLLPRIVATE virtual sal_Int32ImplGetSelectEntryPos() const 
SAL_OVERRIDE;
+SVX_DLLPRIVATE virtual sal_Int32ImplGetSelectEntryPos( sal_Int32 
nSelIndex = 0 ) const SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual void*ImplGetEntryData( sal_Int32 nPos ) 
const SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, 
bool bSelect ) SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos 
) const SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual sal_Int32ImplGetEntryCount() const SAL_OVERRIDE;
+SVX_DLLPRIVATE virtual void ImplSetNoSelection() SAL_OVERRIDE;
+SVX_DLLPRIVATE virtual void ImplHide() SAL_OVERRIDE;
+SVX_DLLPRIV

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

2014-05-16 Thread Eike Rathke
 cui/source/tabpages/chardlg.cxx |   20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 48a48e4ea4bdd7afb322e6d0b81c29eb7e7a66a0
Author: Eike Rathke 
Date:   Fri May 16 22:12:58 2014 +0200

use SvxLanguageBoxBase* in the general routines

... so we can switch later to an SvxLanguageComboBox for some.

Change-Id: I1a48ee7207a14b2666be09f091c47f09fcbce192

diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index f813c9a..10ff5977 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -440,7 +440,7 @@ namespace
 const FontNameBox* _pFontNameLB,
 const FontStyleBox* _pFontStyleLB,
 const FontSizeBox* _pFontSizeLB,
-const SvxLanguageBox* _pLanguageLB,
+const SvxLanguageBoxBase* _pLanguageLB,
 const FontList* _pFontList,
 sal_uInt16 _nFontWhich,
 sal_uInt16 _nFontHeightWhich)
@@ -623,7 +623,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, 
LanguageGroup eLangGrp
 FixedText* pSizeLabel = NULL;
 FontSizeBox* pSizeBox = NULL;
 FixedText* pLangFT = NULL;
-SvxLanguageBox* pLangBox = NULL;
+SvxLanguageBoxBase* pLangBox = NULL;
 sal_uInt16 nWhich = 0;
 
 switch ( eLangGrp )
@@ -786,20 +786,20 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, 
LanguageGroup eLangGrp
 case Asian : nWhich = GetWhich( SID_ATTR_CHAR_CJK_LANGUAGE ); break;
 case Ctl : nWhich = GetWhich( SID_ATTR_CHAR_CTL_LANGUAGE ); break;
 }
-pLangBox->SetNoSelection();
+pLangBox->SetNoSelectionLBB();
 eState = rSet.GetItemState( nWhich );
 
 switch ( eState )
 {
 case SFX_ITEM_UNKNOWN:
 pLangFT->Hide();
-pLangBox->Hide();
+pLangBox->HideLBB();
 break;
 
 case SFX_ITEM_DISABLED:
 case SFX_ITEM_READONLY:
 pLangFT->Disable();
-pLangBox->Disable();
+pLangBox->DisableLBB();
 break;
 
 case SFX_ITEM_DEFAULT:
@@ -834,7 +834,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, 
LanguageGroup eLangGrp
 pNameBox->SaveValue();
 pStyleBox->SaveValue();
 pSizeBox->SaveValue();
-pLangBox->SaveValue();
+pLangBox->SaveValueLBB();
 }
 
 
@@ -846,7 +846,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, 
LanguageGroup eLangGrp
 FontNameBox* pNameBox = NULL;
 FontStyleBox* pStyleBox = NULL;
 FontSizeBox* pSizeBox = NULL;
-SvxLanguageBox* pLangBox = NULL;
+SvxLanguageBoxBase* pLangBox = NULL;
 sal_uInt16 nWhich = 0;
 sal_uInt16 nSlot = 0;
 
@@ -1086,8 +1086,8 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, 
LanguageGroup eLangGrp
 }
 nWhich = GetWhich( nSlot );
 pOld = GetOldItem( rSet, nSlot );
-sal_Int32 nLangPos = pLangBox->GetSelectEntryPos();
-LanguageType eLangType = (LanguageType)(sal_uLong)pLangBox->GetEntryData( 
nLangPos );
+sal_Int32 nLangPos = pLangBox->GetSelectEntryPosLBB();
+LanguageType eLangType = 
(LanguageType)(sal_uLong)pLangBox->GetEntryDataLBB( nLangPos );
 
 if ( pOld )
 {
@@ -1098,7 +1098,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, 
LanguageGroup eLangGrp
 }
 
 if ( !bChanged )
-bChanged = ( pLangBox->GetSavedValue() == LISTBOX_ENTRY_NOTFOUND );
+bChanged = ( pLangBox->GetSavedValueLBB() == LISTBOX_ENTRY_NOTFOUND );
 
 if ( bChanged && nLangPos != LISTBOX_ENTRY_NOTFOUND )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-16 Thread Eike Rathke
 svl/source/numbers/zforfind.cxx |   59 +---
 svl/source/numbers/zforfind.hxx |7 
 2 files changed, 57 insertions(+), 9 deletions(-)

New commits:
commit 8e71f81f47c20320c4de7a7aadb7d524f0d8ea76
Author: Eike Rathke 
Date:   Sat May 17 02:33:42 2014 +0200

resolved fdo#41166 match month and day name word instead of substring

Change-Id: I897dbcee47de574d91ba3e3b40a39a35b779fef8

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index c77bb0a..0cf62fd 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -439,6 +439,47 @@ bool ImpSvNumberInputScan::StringPtrContainsImpl( const 
OUString& rWhat,
 
 
 /**
+ * Whether rString contains word rWhat at nPos
+ */
+bool ImpSvNumberInputScan::StringContainsWord( const OUString& rWhat,
+   const OUString& rString, 
sal_Int32 nPos )
+{
+if (rWhat.isEmpty() || rString.getLength() < nPos + rWhat.getLength())
+return false;
+
+if (StringPtrContainsImpl( rWhat, rString.getStr(), nPos))
+{
+nPos += rWhat.getLength();
+if (nPos == rString.getLength())
+return true;// word at end of string
+
+/* TODO: we COULD invoke bells and whistles word break iterator to find
+ * the next boundary, but really ... this is called for date input, so
+ * how many languages do not separate the day and month names in some
+ * form? */
+
+sal_Int32 nIndex = nPos;
+sal_uInt32 c = rString.iterateCodePoints( &nIndex);
+if (nPos+1 < nIndex)
+return true;// Surrogate, assume these to be new words.
+(void)c;
+
+const sal_Int32 nType = pFormatter->GetCharClass()->getCharacterType( 
rString, nPos);
+
+if (CharClass::isAlphaNumericType( nType))
+return false;   // Alpha or numeric is not word gap.
+
+if (CharClass::isLetterType( nType))
+return true;// Letter other than alpha is new word. (Is it?)
+
+return true;// Catch all remaining as gap until we know better.
+}
+
+return false;
+}
+
+
+/**
  * Skips the supplied char
  */
 inline bool ImpSvNumberInputScan::SkipChar( sal_Unicode c, const OUString& 
rString,
@@ -577,7 +618,7 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 // if we stopped at the first match.
 for ( sal_Int16 i = 0; i < nMonths; i++ )
 {
-if ( bScanGenitiveMonths && StringContains( 
pUpperGenitiveMonthText[i], rString, nPos ) )
+if ( bScanGenitiveMonths && StringContainsWord( 
pUpperGenitiveMonthText[i], rString, nPos ) )
 {   // genitive full names first
 const int nMonthLen = pUpperGenitiveMonthText[i].getLength();
 if (nMonthLen > nMatchLen)
@@ -586,7 +627,7 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 res = i + 1;
 }
 }
-else if ( bScanGenitiveMonths && StringContains( 
pUpperGenitiveAbbrevMonthText[i], rString, nPos ) )
+else if ( bScanGenitiveMonths && StringContainsWord( 
pUpperGenitiveAbbrevMonthText[i], rString, nPos ) )
 {   // genitive abbreviated
 const int nMonthLen = 
pUpperGenitiveAbbrevMonthText[i].getLength();
 if (nMonthLen > nMatchLen)
@@ -595,7 +636,7 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 res = sal::static_int_cast< short >(-(i+1)); // negative
 }
 }
-else if ( bScanPartitiveMonths && StringContains( 
pUpperPartitiveMonthText[i], rString, nPos ) )
+else if ( bScanPartitiveMonths && StringContainsWord( 
pUpperPartitiveMonthText[i], rString, nPos ) )
 {   // partitive full names
 const int nMonthLen = pUpperPartitiveMonthText[i].getLength();
 if (nMonthLen > nMatchLen)
@@ -604,7 +645,7 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 res = i+1;
 }
 }
-else if ( bScanPartitiveMonths && StringContains( 
pUpperPartitiveAbbrevMonthText[i], rString, nPos ) )
+else if ( bScanPartitiveMonths && StringContainsWord( 
pUpperPartitiveAbbrevMonthText[i], rString, nPos ) )
 {   // partitive abbreviated
 const int nMonthLen = 
pUpperPartitiveAbbrevMonthText[i].getLength();
 if (nMonthLen > nMatchLen)
@@ -613,7 +654,7 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 res = sal::static_int_cast< short >(-(i+1)); /

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

2014-05-16 Thread Eike Rathke
 svl/source/numbers/zforfind.cxx |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 3885b5d4b00ebb31adabc36c507abd642c03d0d4
Author: Eike Rathke 
Date:   Sat May 17 04:05:20 2014 +0200

resolved fdo#41166 match month and day name word instead of substring

Follow-up, check for ASCII first to avoid calls to i18n, and check the
type flags instead of calls to CharClass methods that give unexpected
results with their masks.

Change-Id: I10e685998299dceb2dbcf1d87ae1de09680b8a99

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 0cf62fd..0e10138 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -458,18 +458,23 @@ bool ImpSvNumberInputScan::StringContainsWord( const 
OUString& rWhat,
  * how many languages do not separate the day and month names in some
  * form? */
 
+// Check simple ASCII first before invoking i18n or anything else.
+if (rtl::isAsciiAlphanumeric( rString[nPos] ))
+return false;   // Alpha or numeric is not word gap.
+
 sal_Int32 nIndex = nPos;
-sal_uInt32 c = rString.iterateCodePoints( &nIndex);
+const sal_uInt32 c = rString.iterateCodePoints( &nIndex);
 if (nPos+1 < nIndex)
 return true;// Surrogate, assume these to be new words.
 (void)c;
 
 const sal_Int32 nType = pFormatter->GetCharClass()->getCharacterType( 
rString, nPos);
+using namespace ::com::sun::star::i18n;
 
-if (CharClass::isAlphaNumericType( nType))
+if ((nType & (KCharacterType::UPPER | KCharacterType::LOWER | 
KCharacterType::DIGIT)) != 0)
 return false;   // Alpha or numeric is not word gap.
 
-if (CharClass::isLetterType( nType))
+if ((nType & (KCharacterType::LETTER)) != 0)
 return true;// Letter other than alpha is new word. (Is it?)
 
 return true;// Catch all remaining as gap until we know better.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-16 Thread Eike Rathke
 svl/source/numbers/zforfind.cxx |   69 
 1 file changed, 21 insertions(+), 48 deletions(-)

New commits:
commit e8b2e9163c953048e9e5f7f6cb9392b66be26e01
Author: Eike Rathke 
Date:   Sat May 17 04:26:28 2014 +0200

Back out change for fdo#78119 now that we have StringContainsWord()

This reverts commit 3b3b690c1f0479cfbebcfa68595f75a4994e7a5f.

With the use of StringContainsWord() it is unnecessary to loop all
available names.

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 0e10138..6d6b9d5 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -609,7 +609,6 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 static const OUString aSepShortened("SEP");
 
 short res = 0; // no month found
-int nMatchLen = 0;
 
 if (rString.getLength() > nPos) // only if needed
 {
@@ -618,78 +617,52 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 InitText();
 }
 sal_Int16 nMonths = 
pFormatter->GetCalendar()->getNumberOfMonthsInYear();
-// Find the longest match. This is needed for, e.g., Czech, as 
Červen (June)
-// is fully contained in Červenec (July), so the latter could 
never be found
-// if we stopped at the first match.
 for ( sal_Int16 i = 0; i < nMonths; i++ )
 {
 if ( bScanGenitiveMonths && StringContainsWord( 
pUpperGenitiveMonthText[i], rString, nPos ) )
 {   // genitive full names first
-const int nMonthLen = pUpperGenitiveMonthText[i].getLength();
-if (nMonthLen > nMatchLen)
-{
-nMatchLen = nMonthLen;
-res = i + 1;
-}
+nPos = nPos + pUpperGenitiveMonthText[i].getLength();
+res = i + 1;
+break;  // for
 }
 else if ( bScanGenitiveMonths && StringContainsWord( 
pUpperGenitiveAbbrevMonthText[i], rString, nPos ) )
 {   // genitive abbreviated
-const int nMonthLen = 
pUpperGenitiveAbbrevMonthText[i].getLength();
-if (nMonthLen > nMatchLen)
-{
-nMatchLen = nMonthLen;
-res = sal::static_int_cast< short >(-(i+1)); // negative
-}
+nPos = nPos + pUpperGenitiveAbbrevMonthText[i].getLength();
+res = sal::static_int_cast< short >(-(i+1)); // negative
+break;  // for
 }
 else if ( bScanPartitiveMonths && StringContainsWord( 
pUpperPartitiveMonthText[i], rString, nPos ) )
 {   // partitive full names
-const int nMonthLen = pUpperPartitiveMonthText[i].getLength();
-if (nMonthLen > nMatchLen)
-{
-nMatchLen = nMonthLen;
-res = i+1;
-}
+nPos = nPos + pUpperPartitiveMonthText[i].getLength();
+res = i+1;
+break;  // for
 }
 else if ( bScanPartitiveMonths && StringContainsWord( 
pUpperPartitiveAbbrevMonthText[i], rString, nPos ) )
 {   // partitive abbreviated
-const int nMonthLen = 
pUpperPartitiveAbbrevMonthText[i].getLength();
-if (nMonthLen > nMatchLen)
-{
-nMatchLen = nMonthLen;
-res = sal::static_int_cast< short >(-(i+1)); // negative
-}
+nPos = nPos + pUpperPartitiveAbbrevMonthText[i].getLength();
+res = sal::static_int_cast< short >(-(i+1)); // negative
+break;  // for
 }
 else if ( StringContainsWord( pUpperMonthText[i], rString, nPos ) )
 {   // noun full names
-const int nMonthLen = pUpperMonthText[i].getLength();
-if (nMonthLen > nMatchLen)
-{
-nMatchLen = nMonthLen;
-res = i+1;
-}
+nPos = nPos + pUpperMonthText[i].getLength();
+res = i+1;
+break;  // for
 }
 else if ( StringContainsWord( pUpperAbbrevMonthText[i], rString, 
nPos ) )
 {   // noun abbreviated
-const int nMonthLen = pUpperAbbrevMonthText[i].getLength();
-if (nMonthLen > nMatchLen)
-{
-nMatchLen = nMonthLen;
-res = sal::static_int_cast< short >(-(i+1)); // negative
-}
+nPos = nPos + pUpperAbbrevMonthText[i].getLength();
+res = sal::static_int_cast< short >(

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

2014-05-18 Thread Eike Rathke
 svl/source/numbers/zforfind.cxx |   64 ++--
 svl/source/numbers/zforfind.hxx |7 
 2 files changed, 62 insertions(+), 9 deletions(-)

New commits:
commit 41b9ab0375f455f504c66b4870e817aba0f990d2
Author: Eike Rathke 
Date:   Sat May 17 02:33:42 2014 +0200

resolved fdo#41166 match month and day name word instead of substring

(cherry picked from commit 8e71f81f47c20320c4de7a7aadb7d524f0d8ea76)
(cherry picked from commit 3885b5d4b00ebb31adabc36c507abd642c03d0d4)

Change-Id: I897dbcee47de574d91ba3e3b40a39a35b779fef8
Reviewed-on: https://gerrit.libreoffice.org/9387
Reviewed-by: Kohei Yoshida 
Tested-by: Kohei Yoshida 

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 840af0c..9c8bb1c 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -438,6 +438,52 @@ bool ImpSvNumberInputScan::StringPtrContainsImpl( const 
OUString& rWhat,
 
 
 /**
+ * Whether rString contains word rWhat at nPos
+ */
+bool ImpSvNumberInputScan::StringContainsWord( const OUString& rWhat,
+   const OUString& rString, 
sal_Int32 nPos )
+{
+if (rWhat.isEmpty() || rString.getLength() < nPos + rWhat.getLength())
+return false;
+
+if (StringPtrContainsImpl( rWhat, rString.getStr(), nPos))
+{
+nPos += rWhat.getLength();
+if (nPos == rString.getLength())
+return true;// word at end of string
+
+/* TODO: we COULD invoke bells and whistles word break iterator to find
+ * the next boundary, but really ... this is called for date input, so
+ * how many languages do not separate the day and month names in some
+ * form? */
+
+// Check simple ASCII first before invoking i18n or anything else.
+if (rtl::isAsciiAlphanumeric( rString[nPos] ))
+return false;   // Alpha or numeric is not word gap.
+
+sal_Int32 nIndex = nPos;
+const sal_uInt32 c = rString.iterateCodePoints( &nIndex);
+if (nPos+1 < nIndex)
+return true;// Surrogate, assume these to be new words.
+(void)c;
+
+const sal_Int32 nType = pFormatter->GetCharClass()->getCharacterType( 
rString, nPos);
+using namespace ::com::sun::star::i18n;
+
+if ((nType & (KCharacterType::UPPER | KCharacterType::LOWER | 
KCharacterType::DIGIT)) != 0)
+return false;   // Alpha or numeric is not word gap.
+
+if ((nType & (KCharacterType::LETTER)) != 0)
+return true;// Letter other than alpha is new word. (Is it?)
+
+return true;// Catch all remaining as gap until we know better.
+}
+
+return false;
+}
+
+
+/**
  * Skips the supplied char
  */
 inline bool ImpSvNumberInputScan::SkipChar( sal_Unicode c, const OUString& 
rString,
@@ -575,7 +621,7 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 // if we stopped at the first match.
 for ( sal_Int16 i = 0; i < nMonths; i++ )
 {
-if ( bScanGenitiveMonths && StringContains( 
pUpperGenitiveMonthText[i], rString, nPos ) )
+if ( bScanGenitiveMonths && StringContainsWord( 
pUpperGenitiveMonthText[i], rString, nPos ) )
 {   // genitive full names first
 const int nMonthLen = pUpperGenitiveMonthText[i].getLength();
 if (nMonthLen > nMatchLen)
@@ -584,7 +630,7 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 res = i + 1;
 }
 }
-else if ( bScanGenitiveMonths && StringContains( 
pUpperGenitiveAbbrevMonthText[i], rString, nPos ) )
+else if ( bScanGenitiveMonths && StringContainsWord( 
pUpperGenitiveAbbrevMonthText[i], rString, nPos ) )
 {   // genitive abbreviated
 const int nMonthLen = 
pUpperGenitiveAbbrevMonthText[i].getLength();
 if (nMonthLen > nMatchLen)
@@ -593,7 +639,7 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 res = sal::static_int_cast< short >(-(i+1)); // negative
 }
 }
-else if ( bScanPartitiveMonths && StringContains( 
pUpperPartitiveMonthText[i], rString, nPos ) )
+else if ( bScanPartitiveMonths && StringContainsWord( 
pUpperPartitiveMonthText[i], rString, nPos ) )
 {   // partitive full names
 const int nMonthLen = pUpperPartitiveMonthText[i].getLength();
 if (nMonthLen > nMatchLen)
@@ -602,7 +648,7 @@ short ImpSvNumberInputScan::GetMonth( const OUString& 
rString, sal_Int32& nPos )
 res = i+1;
 }
 }
-else if (

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

2014-05-19 Thread Eike Rathke
 sw/source/filter/ww8/writerwordglue.cxx |  104 
 1 file changed, 92 insertions(+), 12 deletions(-)

New commits:
commit 0d361388060741fe8e2f1ba059fba95707bdc233
Author: Eike Rathke 
Date:   Mon May 19 21:43:06 2014 +0200

resolved fdo#66620 keywords occur in unquoted context only

Change-Id: I4de41e5b66f1a856a786c521ca4ef2eec14c7499

diff --git a/sw/source/filter/ww8/writerwordglue.cxx 
b/sw/source/filter/ww8/writerwordglue.cxx
index 37f50b4..f4817b4 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -745,6 +745,83 @@ namespace sw
 return nDT;
 }
 
+
+/** Find cFind in rParams if not embedded in " double quotes.
+Will NOT find '\\' or '"'.
+ */
+sal_Int32 findUnquoted( const OUString& rParams, sal_Unicode cFind, 
sal_Int32 nFromPos )
+{
+const sal_Int32 nLen = rParams.getLength();
+if (nFromPos < 0 || nLen <= nFromPos)
+return -1;
+for (sal_Int32 nI = nFromPos; nI < nLen; ++nI)
+{
+const sal_Unicode c = rParams[nI];
+if (c == '\\')
+++nI;
+else if (c == '\"')
+{
+++nI;
+// While not at the end and not at an unescaped end quote
+while (nI < nLen)
+{
+if (rParams[nI] == '\"' && rParams[nI-1] != '\\')
+break;
+++nI;
+}
+}
+else //normal unquoted section
+{
+if (c == cFind)
+return nI;
+}
+}
+return -1;
+}
+
+/** Find all rFind in rParams if not embedded in " double quotes and
+replace with rReplace. Will NOT find '\\' or '"'.
+ */
+bool replaceUnquoted( OUString& rParams, const OUString& rFind, const 
OUString& rReplace )
+{
+bool bReplaced = false;
+if (rFind.isEmpty())
+return bReplaced;
+const sal_Unicode cFirst = rFind[0];
+
+sal_Int32 nLen = rParams.getLength();
+for (sal_Int32 nI = 0; nI < nLen; ++nI)
+{
+const sal_Unicode c = rParams[nI];
+if (rParams[nI] == '\\')
+++nI;
+else if (rParams[nI] == '\"')
+{
+++nI;
+// While not at the end and not at an unescaped end quote
+while (nI < nLen)
+{
+if (rParams[nI] == '\"' && rParams[nI-1] != '\\')
+break;
+++nI;
+}
+}
+else //normal unquoted section
+{
+if (c == cFirst && rParams.match( rFind, nI))
+{
+const sal_Int32 nFindLen = rFind.getLength();
+const sal_Int32 nDiff = rReplace.getLength() - 
nFindLen;
+rParams.replaceAt( nI, nFindLen, rReplace);
+nI += nFindLen + nDiff - 1;
+nLen += nDiff;
+bReplaced = true;
+}
+}
+}
+return bReplaced;
+}
+
 sal_uLong MSDateTimeFormatToSwFormat(OUString& rParams,
 SvNumberFormatter *pFormatter, sal_uInt16 &rLang, bool bHijri,
 sal_uInt16 nDocLang)
@@ -756,36 +833,39 @@ namespace sw
 
 SwapQuotesInField(rParams);
 
-// Force to Japanese when finding one of 'geaE'
-bool bForceJapanese = (-1 != rParams.indexOf('g')
-|| -1 != rParams.indexOf('e') || -1 != rParams.indexOf('E') );
-if ( bForceJapanese )
-{
-rParams = rParams.replaceAll( "ee", "" ).replaceAll( "EE", 
"" );
-}
+// Force to Japanese when finding one of 'geE'.
+// XXX This actually may not be correct, all era keywords could be
+// used in other locales as well. I just don't know about Word. But
+// this is how it was for 10 years..
+bool bForceJapanese = (-1 != findUnquoted( rParams, 'g', 0));
+// XXX Why replace? The number formatter does handle them and this
+// effectively changes from Gengou to 

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

2014-05-20 Thread Eike Rathke
 svl/source/numbers/zforfind.cxx |   85 +++-
 1 file changed, 59 insertions(+), 26 deletions(-)

New commits:
commit 43624d9370c4384f71c6b13fed900eaec222cf64
Author: Eike Rathke 
Date:   Tue May 20 10:28:58 2014 +0200

resolved fdo#34724 Jan1 or 1Jan without separating character is not date

Change-Id: I2cf02a26b81fa634c842df455de669f1c60241bc

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 6d6b9d5..fef69c5 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -2054,16 +2054,25 @@ bool ImpSvNumberInputScan::ScanStartString( const 
OUString& rString,
 }
 else
 {
-nMonth = GetMonth(rString, nPos);
-if ( nMonth )// month (Jan 1)?
+const sal_Int32 nMonthStart = nPos;
+short nTempMonth = GetMonth(rString, nPos);
+if ( nTempMonth )// month (Jan 1)?
 {
-eScannedType = NUMBERFORMAT_DATE;   // !!! it IS a date !!!
-nMonthPos = 1;  // month at the beginning
-if ( nMonth < 0 )
+if (nPos < rString.getLength()) // Jan1 without separator 
is not a date
 {
-SkipChar( '.', rString, nPos ); // abbreviated
+eScannedType = NUMBERFORMAT_DATE;   // !!! it IS a date !!!
+nMonth = nTempMonth;
+nMonthPos = 1;  // month at the beginning
+if ( nMonth < 0 )
+{
+SkipChar( '.', rString, nPos ); // abbreviated
+}
+SkipBlanks(rString, nPos);
+}
+else
+{
+nPos = nMonthStart; // rewind month
 }
-SkipBlanks(rString, nPos);
 }
 else
 {
@@ -2089,15 +2098,23 @@ bool ImpSvNumberInputScan::ScanStartString( const 
OUString& rString,
 SkipString( 
pFormatter->GetLocaleData()->getLongDateDayOfWeekSep(), rString, nPos );
 }
 SkipBlanks(rString, nPos);
-nMonth = GetMonth(rString, nPos);
-if ( nMonth ) // month (Jan 1)?
+nTempMonth = GetMonth(rString, nPos);
+if ( nTempMonth ) // month (Jan 1)?
 {
-nMonthPos = 1; // month a the beginning
-if ( nMonth < 0 )
+if (nPos < rString.getLength()) // Jan1 
without separator is not a date
 {
-SkipChar( '.', rString, nPos ); // abbreviated
+nMonth = nTempMonth;
+nMonthPos = 1; // month a the beginning
+if ( nMonth < 0 )
+{
+SkipChar( '.', rString, nPos ); // abbreviated
+}
+SkipBlanks(rString, nPos);
+}
+else
+{
+nPos = nMonthStart; // rewind month
 }
-SkipBlanks(rString, nPos);
 }
 }
 if (!nMonth)
@@ -2282,6 +2299,7 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& 
rString,
 }
 }
 
+const sal_Int32 nMonthStart = nPos;
 short nTempMonth = GetMonth(rString, nPos); // month in the middle (10 
Jan 94)
 if (nTempMonth)
 {
@@ -2294,15 +2312,22 @@ bool ImpSvNumberInputScan::ScanMidString( const 
OUString& rString,
 {
 return MatchedReturn();
 }
-eScannedType = NUMBERFORMAT_DATE;   // !!! it IS a date
-nMonth = nTempMonth;
-nMonthPos = 2;  // month in the middle
-if ( nMonth < 0 )
+if (nMonthStart > 0 && nPos < rString.getLength())  // 10Jan or Jan94 
without separator are not dates
+{
+eScannedType = NUMBERFORMAT_DATE;   // !!! it IS a date
+nMonth = nTempMonth;
+nMonthPos = 2;  // month in the middle
+if ( nMonth < 0 )
+{
+SkipChar( '.', rString, nPos ); // abbreviated
+}
+SkipString( pLoc->getLongDateMonthSep(), rString, nPos );
+SkipBlanks(rString, nPos);
+}
+else
 {
-SkipChar( '.', rString, nPos ); // abbreviated
+nPos = nMonthStart; // rewind month
 }
-SkipString( pLoc->getLongDateMonthSep(), rString, nPos );
-SkipBlan

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

2014-05-20 Thread Eike Rathke
 sc/source/ui/app/inputhdl.cxx |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 23e9f36a21f7daa6175f53fd244677b9c2e2a660
Author: Eike Rathke 
Date:   Tue May 20 11:38:46 2014 +0200

simplify and ensure valid miAutoPosColumn in all cases, fdo#78838 related

Unconditionally set miAutoPosColumn at the end of all operations so it
is also valid in case of pColumnData->clear() and no entries inserted
after pDoc->GetDataEntries().

Change-Id: I689632f696091fd9ce8e93c06d7918e5eaf05ab4

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index af767b9..b9e1b90 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1409,19 +1409,15 @@ void ScInputHandler::GetColData()
 if ( pColumnData )
 pColumnData->clear();
 else
-{
 pColumnData = new ScTypedCaseStrSet;
-miAutoPosColumn = pColumnData->end();
-}
 
 std::vector aEntries;
 pDoc->GetDataEntries(
 aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), true, 
aEntries, true);
 if (!aEntries.empty())
-{
 pColumnData->insert(aEntries.begin(), aEntries.end());
-miAutoPosColumn = pColumnData->end();
-}
+
+miAutoPosColumn = pColumnData->end();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-20 Thread Eike Rathke
 sc/source/ui/app/inputhdl.cxx |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 51a868729b5adfa402095f5c08fa889bddcd1b34
Author: Eike Rathke 
Date:   Tue May 20 11:38:46 2014 +0200

simplify and ensure valid miAutoPosColumn in all cases, fdo#78838 related

Unconditionally set miAutoPosColumn at the end of all operations so it
is also valid in case of pColumnData->clear() and no entries inserted
after pDoc->GetDataEntries().

Change-Id: I689632f696091fd9ce8e93c06d7918e5eaf05ab4
(cherry picked from commit 23e9f36a21f7daa6175f53fd244677b9c2e2a660)
Reviewed-on: https://gerrit.libreoffice.org/9412
Tested-by: Markus Mohrhard 
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index ed5e352..0041f3c 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1527,19 +1527,15 @@ void ScInputHandler::GetColData()
 if ( pColumnData )
 pColumnData->clear();
 else
-{
 pColumnData = new ScTypedCaseStrSet;
-miAutoPosColumn = pColumnData->end();
-}
 
 std::vector aEntries;
 pDoc->GetDataEntries(
 aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), true, 
aEntries, true);
 if (!aEntries.empty())
-{
 pColumnData->insert(aEntries.begin(), aEntries.end());
-miAutoPosColumn = pColumnData->end();
-}
+
+miAutoPosColumn = pColumnData->end();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-20 Thread Eike Rathke
 sw/source/filter/ww8/writerwordglue.cxx |  104 
 1 file changed, 92 insertions(+), 12 deletions(-)

New commits:
commit 300d27b0ae4665001ec30b47af2142f6c253f370
Author: Eike Rathke 
Date:   Mon May 19 21:43:06 2014 +0200

resolved fdo#66620 keywords occur in unquoted context only

Change-Id: I4de41e5b66f1a856a786c521ca4ef2eec14c7499
(cherry picked from commit 0d361388060741fe8e2f1ba059fba95707bdc233)
Reviewed-on: https://gerrit.libreoffice.org/9405
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/source/filter/ww8/writerwordglue.cxx 
b/sw/source/filter/ww8/writerwordglue.cxx
index 7fc6061..056268e 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -745,6 +745,83 @@ namespace sw
 return nDT;
 }
 
+
+/** Find cFind in rParams if not embedded in " double quotes.
+Will NOT find '\\' or '"'.
+ */
+sal_Int32 findUnquoted( const OUString& rParams, sal_Unicode cFind, 
sal_Int32 nFromPos )
+{
+const sal_Int32 nLen = rParams.getLength();
+if (nFromPos < 0 || nLen <= nFromPos)
+return -1;
+for (sal_Int32 nI = nFromPos; nI < nLen; ++nI)
+{
+const sal_Unicode c = rParams[nI];
+if (c == '\\')
+++nI;
+else if (c == '\"')
+{
+++nI;
+// While not at the end and not at an unescaped end quote
+while (nI < nLen)
+{
+if (rParams[nI] == '\"' && rParams[nI-1] != '\\')
+break;
+++nI;
+}
+}
+else //normal unquoted section
+{
+if (c == cFind)
+return nI;
+}
+}
+return -1;
+}
+
+/** Find all rFind in rParams if not embedded in " double quotes and
+replace with rReplace. Will NOT find '\\' or '"'.
+ */
+bool replaceUnquoted( OUString& rParams, const OUString& rFind, const 
OUString& rReplace )
+{
+bool bReplaced = false;
+if (rFind.isEmpty())
+return bReplaced;
+const sal_Unicode cFirst = rFind[0];
+
+sal_Int32 nLen = rParams.getLength();
+for (sal_Int32 nI = 0; nI < nLen; ++nI)
+{
+const sal_Unicode c = rParams[nI];
+if (rParams[nI] == '\\')
+++nI;
+else if (rParams[nI] == '\"')
+{
+++nI;
+// While not at the end and not at an unescaped end quote
+while (nI < nLen)
+{
+if (rParams[nI] == '\"' && rParams[nI-1] != '\\')
+break;
+++nI;
+}
+}
+else //normal unquoted section
+{
+if (c == cFirst && rParams.match( rFind, nI))
+{
+const sal_Int32 nFindLen = rFind.getLength();
+const sal_Int32 nDiff = rReplace.getLength() - 
nFindLen;
+rParams.replaceAt( nI, nFindLen, rReplace);
+nI += nFindLen + nDiff - 1;
+nLen += nDiff;
+bReplaced = true;
+}
+}
+}
+return bReplaced;
+}
+
 sal_uLong MSDateTimeFormatToSwFormat(OUString& rParams,
 SvNumberFormatter *pFormatter, sal_uInt16 &rLang, bool bHijri,
 sal_uInt16 nDocLang)
@@ -756,36 +833,39 @@ namespace sw
 
 SwapQuotesInField(rParams);
 
-// Force to Japanese when finding one of 'geaE'
-bool bForceJapanese = (-1 != rParams.indexOf('g')
-|| -1 != rParams.indexOf('e') || -1 != rParams.indexOf('E') );
-if ( bForceJapanese )
-{
-rParams = rParams.replaceAll( "ee", "" ).replaceAll( "EE", 
"" );
-}
+// Force to Japanese when finding one of 'geE'.
+// XXX This actually may not be correct, all era keywords could be
+// used in other locales as well. I just don't know about Word. But
+// this is how it was for 10 years..
+bool bForceJa

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

2014-05-21 Thread Eike Rathke
 formula/source/core/api/token.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 636581bf87e2a792672845d7c945f1b22a22ffdb
Author: Eike Rathke 
Date:   Wed May 21 12:45:24 2014 +0200

most certainly == was meant

Change-Id: I1b0833daa576cd8603421e1036b8773badc8c775

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 30b0e16..5309a40 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -690,7 +690,7 @@ void FormulaTokenArray::Assign( const FormulaTokenArray& r )
 /// Optimisiation for efficiently creating StringXML placeholders
 void FormulaTokenArray::Assign( sal_uInt16 nCode, FormulaToken **pTokens )
 {
-assert( nLen = 0 );
+assert( nLen == 0 );
 assert( pCode == NULL );
 
 nLen = nCode;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-21 Thread Eike Rathke
 i18nlangtag/qa/cppunit/test_languagetag.cxx|   16 ++
 i18nlangtag/source/languagetag/languagetag.cxx |   40 +
 include/i18nlangtag/languagetag.hxx|   16 ++
 3 files changed, 72 insertions(+)

New commits:
commit b8e8c9c471ba6974886dd624630144ef2edccb2c
Author: Eike Rathke 
Date:   Wed May 21 14:14:56 2014 +0200

add unit test for static isValidBcp47() method

Change-Id: Ib234fb1d14087236d337dfe351aea941945e718c

diff --git a/i18nlangtag/qa/cppunit/test_languagetag.cxx 
b/i18nlangtag/qa/cppunit/test_languagetag.cxx
index 93506fb..b86e263 100644
--- a/i18nlangtag/qa/cppunit/test_languagetag.cxx
+++ b/i18nlangtag/qa/cppunit/test_languagetag.cxx
@@ -586,6 +586,22 @@ void TestLanguageTag::testAllTags()
 CPPUNIT_ASSERT( uab.isIsoLocale() == false );
 CPPUNIT_ASSERT( uab.isIsoODF() == false );
 }
+
+// test static isValidBcp47() method
+{
+OUString aCanonicalized;
+CPPUNIT_ASSERT( LanguageTag::isValidBcp47( "en-US", &aCanonicalized) 
&& aCanonicalized == "en-US" );
+CPPUNIT_ASSERT( LanguageTag::isValidBcp47( "x-foobar", 
&aCanonicalized) && aCanonicalized == "x-foobar" );
+CPPUNIT_ASSERT( !LanguageTag::isValidBcp47( "unreg-and-bad", 
&aCanonicalized) );
+#if USE_LIBLANGTAG
+CPPUNIT_ASSERT( LanguageTag::isValidBcp47( "de-Latn-DE", 
&aCanonicalized) && aCanonicalized == "de-DE" );
+/* TODO: at least some (those we know) grandfathered tags should be
+ * recognized by the replacement code. */
+CPPUNIT_ASSERT( LanguageTag::isValidBcp47( "en-GB-oed", 
&aCanonicalized) && aCanonicalized == "en-GB-oed" );
+#else
+CPPUNIT_ASSERT( LanguageTag::isValidBcp47( "de-Latn-DE", 
&aCanonicalized) && aCanonicalized == "de-Latn-DE" );
+#endif
+}
 }
 
 static bool checkMapping( const OUString& rStr1, const OUString& rStr2 )
commit a6e6cc49bfbf594aa59804ee0d9751d5ff19caba
Author: Eike Rathke 
Date:   Wed May 21 14:13:23 2014 +0200

add static LanguageTag::isValidBcp47()

Change-Id: I2c646b3e2f13a6fccc845ce8eb82fccee154f3c6

diff --git a/i18nlangtag/source/languagetag/languagetag.cxx 
b/i18nlangtag/source/languagetag/languagetag.cxx
index 33816b3..8a96bde 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -2685,4 +2685,44 @@ com::sun::star::lang::Locale 
LanguageTag::convertToLocaleWithFallback( const OUS
 return LanguageTag( rBcp47).makeFallback().getLocale( true);
 }
 
+
+// static
+bool LanguageTag::isValidBcp47( const OUString& rString, OUString* 
o_pCanonicalized )
+{
+struct guard
+{
+lt_tag_t* mpLangtag;
+guard()
+{
+theDataRef::get().incRef();
+mpLangtag = lt_tag_new();
+}
+~guard()
+{
+lt_tag_unref( mpLangtag);
+theDataRef::get().decRef();
+}
+} aVar;
+
+myLtError aError;
+
+if (lt_tag_parse( aVar.mpLangtag, OUStringToOString( rString, 
RTL_TEXTENCODING_UTF8).getStr(), &aError.p))
+{
+char* pTag = lt_tag_canonicalize( aVar.mpLangtag, &aError.p);
+SAL_WARN_IF( !pTag, "i18nlangtag", "LanguageTag:isValidBcp47: could 
not canonicalize '" << rString << "'");
+if (pTag)
+{
+if (o_pCanonicalized)
+*o_pCanonicalized = OUString::createFromAscii( pTag);
+free( pTag);
+return true;
+}
+}
+else
+{
+SAL_INFO( "i18nlangtag", "LanguageTag:isValidBcp47: could not parse '" 
<< rString << "'");
+}
+return false;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/i18nlangtag/languagetag.hxx 
b/include/i18nlangtag/languagetag.hxx
index dcb95c6..0e12235 100644
--- a/include/i18nlangtag/languagetag.hxx
+++ b/include/i18nlangtag/languagetag.hxx
@@ -228,6 +228,8 @@ public:
 /** If this is a valid BCP 47 language tag.
 
 Always resolves an empty tag to the system locale.
+
+@seealsostatic bool isValidBcp47(const OUString&)
  */
 boolisValidBcp47() const;
 
@@ -479,6 +481,20 @@ public:
  */
 static com::sun::star::lang::Locale convertToLocaleWithFallback( const 
OUString& rBcp47 );
 
+/** If rString represents a valid BCP 47 language tag.
+
+Never resolves an empty tag to the system locale, in fact an empty
+string is invalid here. Does not create an instance to be registered
+with a conversion to Locale or LanguageType.
+
+@param  o_pCanonicalized
+If given and rString is a valid BCP 47 language tag, the
+   

[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - 3 commits - formula/source include/formula sc/inc sc/source

2014-05-21 Thread Eike Rathke
 formula/source/core/api/token.cxx |   18 ++
 include/formula/tokenarray.hxx|1 +
 sc/inc/tokenarray.hxx |3 +++
 sc/source/core/data/document.cxx  |   11 ++-
 sc/source/core/tool/token.cxx |   12 
 sc/source/filter/xml/xmlcelli.cxx |   13 +++--
 6 files changed, 51 insertions(+), 7 deletions(-)

New commits:
commit a792b94fc56cb0992162e610bee7e5dbd9bd5cec
Author: Eike Rathke 
Date:   Wed May 21 12:45:24 2014 +0200

most certainly == was meant

Change-Id: I1b0833daa576cd8603421e1036b8773badc8c775

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 30b0e16..5309a40 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -690,7 +690,7 @@ void FormulaTokenArray::Assign( const FormulaTokenArray& r )
 /// Optimisiation for efficiently creating StringXML placeholders
 void FormulaTokenArray::Assign( sal_uInt16 nCode, FormulaToken **pTokens )
 {
-assert( nLen = 0 );
+assert( nLen == 0 );
 assert( pCode == NULL );
 
 nLen = nCode;
commit e1a120b434f42906ac066635d009f765e3eecb4a
Author: Michael Meeks 
Date:   Mon May 19 20:23:07 2014 +0100

ODS load perf: transfer ownership of the ScTokenArray to save cycles.

Add API to wnsure we don't end up allocating 32k bytes of tokens
for each ScFormulaToken, as happens when you Add a token to a new
empty ScTokenArray.

Change-Id: Ib12a3065eb513243a2146ebb009fbaa650385dd9

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index c5d7da7..30b0e16 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -687,6 +687,24 @@ void FormulaTokenArray::Assign( const FormulaTokenArray& r 
)
 }
 }
 
+/// Optimisiation for efficiently creating StringXML placeholders
+void FormulaTokenArray::Assign( sal_uInt16 nCode, FormulaToken **pTokens )
+{
+assert( nLen = 0 );
+assert( pCode == NULL );
+
+nLen = nCode;
+pCode = new FormulaToken*[ nLen ];
+
+for( sal_uInt16 i = 0; i < nLen; i++ )
+{
+FormulaToken *t = pTokens[ i ];
+assert( t->GetOpCode() == ocStringXML );
+pCode[ i ] = t;
+t->IncRef();
+}
+}
+
 FormulaTokenArray& FormulaTokenArray::operator=( const FormulaTokenArray& rArr 
)
 {
 Clear();
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index 5654a31..dcc8dc9 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -82,6 +82,7 @@ protected:
 
 protected:
 voidAssign( const FormulaTokenArray& );
+voidAssign( sal_uInt16 nCode, FormulaToken **pTokens );
 
 /// Also used by the compiler. The token MUST had been allocated with new!
 FormulaToken*   Add( FormulaToken* );
diff --git a/sc/inc/tokenarray.hxx b/sc/inc/tokenarray.hxx
index c2191a8..9538819 100644
--- a/sc/inc/tokenarray.hxx
+++ b/sc/inc/tokenarray.hxx
@@ -110,6 +110,9 @@ public:
 NULL if there is no pCode (which actually would be caller's fault). */
 formula::FormulaToken* MergeRangeReference( const ScAddress & rPos );
 
+/// Assign XML string placeholder to the array
+void AssignXMLString( const OUString &rText, const OUString &rFormulaNmsp 
);
+
 /// Assignment with references to ScToken entries (not copied!)
 ScTokenArray& operator=( const ScTokenArray& );
 
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 4f4cbf6..4ac537f 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2083,6 +2083,18 @@ FormulaToken* ScTokenArray::AddColRowName( const 
ScSingleRefData& rRef )
 return Add( new ScSingleRefToken( rRef, ocColRowName ) );
 }
 
+void ScTokenArray::AssignXMLString( const OUString &rText, const OUString 
&rFormulaNmsp )
+{
+sal_uInt16 nTokens = 1;
+FormulaToken *aTokens[2];
+
+aTokens[0] = new FormulaStringOpToken( ocStringXML, rText );
+if( !rFormulaNmsp.isEmpty() )
+aTokens[ nTokens++ ] = new FormulaStringOpToken( ocStringXML, 
rFormulaNmsp );
+
+Assign( nTokens, aTokens );
+}
+
 bool ScTokenArray::GetAdjacentExtendOfOuterFuncRefs( SCCOLROW& nExtend,
 const ScAddress& rPos, ScDirection eDir )
 {
diff --git a/sc/source/filter/xml/xmlcelli.cxx 
b/sc/source/filter/xml/xmlcelli.cxx
index b09f90c..4e4c552 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1362,7 +1362,6 @@ void ScXMLTableRowCellContext::PutFormulaCell( const 
ScAddress& rCellPos )
 ScDocumentImport& rDoc = rXMLImport.GetDoc();
 
 OUString aText = maFormula->first;
-OUString aFormulaNmsp = maFormula->second;
 
 ::boost::scoped_ptr pExtRefGuard (
 new ScExternalRefManager::ApiGuard(pDoc));
@@ -1372,13 +1371,15 @@ void

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

2014-05-21 Thread Eike Rathke
 include/svx/langbox.hxx   |3 +++
 svx/source/dialog/langbox.cxx |   20 
 2 files changed, 15 insertions(+), 8 deletions(-)

New commits:
commit cf53a5d4938f6f64bd6d3fe70dd9b555c9d30d0f
Author: Eike Rathke 
Date:   Wed May 21 17:53:53 2014 +0200

we have GetEntryPos(), use it

Change-Id: Iebb19951efa81817793a155164862076d1198e6e

diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx
index dc872d8..410b240 100644
--- a/include/svx/langbox.hxx
+++ b/include/svx/langbox.hxx
@@ -101,6 +101,7 @@ protected:
 SVX_DLLPRIVATE virtual void*ImplGetEntryData( sal_Int32 nPos ) 
const = 0;
 SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, 
bool bSelect ) = 0;
 SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos 
) const = 0;
+SVX_DLLPRIVATE virtual sal_Int32ImplGetEntryPos( const void* pData ) 
const = 0;
 SVX_DLLPRIVATE virtual sal_Int32ImplGetEntryCount() const = 0;
 SVX_DLLPRIVATE virtual void ImplSetNoSelection() = 0;
 SVX_DLLPRIVATE virtual void ImplHide() = 0;
@@ -127,6 +128,7 @@ private:
 SVX_DLLPRIVATE virtual void*ImplGetEntryData( sal_Int32 nPos ) 
const SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, 
bool bSelect ) SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos 
) const SAL_OVERRIDE;
+SVX_DLLPRIVATE virtual sal_Int32ImplGetEntryPos( const void* pData ) 
const SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual sal_Int32ImplGetEntryCount() const SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual void ImplSetNoSelection() SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual void ImplHide() SAL_OVERRIDE;
@@ -155,6 +157,7 @@ private:
 SVX_DLLPRIVATE virtual void*ImplGetEntryData( sal_Int32 nPos ) 
const SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, 
bool bSelect ) SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos 
) const SAL_OVERRIDE;
+SVX_DLLPRIVATE virtual sal_Int32ImplGetEntryPos( const void* pData ) 
const SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual sal_Int32ImplGetEntryCount() const SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual void ImplSetNoSelection() SAL_OVERRIDE;
 SVX_DLLPRIVATE virtual void ImplHide() SAL_OVERRIDE;
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 8d93417..92f5cb6 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -448,14 +448,7 @@ bool SvxLanguageBoxBase::IsLanguageSelected( const 
LanguageType eLangType ) cons
 
 sal_Int32 SvxLanguageBoxBase::ImplTypeToPos( LanguageType eType ) const
 {
-sal_Int32 nPos   = LISTBOX_ENTRY_NOTFOUND;
-sal_Int32 nCount = ImplGetEntryCount();
-
-for ( sal_Int32 i=0; nPos == LISTBOX_ENTRY_NOTFOUND && ihttp://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 5 commits - cui/source cui/uiconfig include/svtools include/svx svtools/source svx/source

2014-05-22 Thread Eike Rathke
 cui/source/inc/chardlg.hxx  |2 
 cui/source/tabpages/chardlg.cxx |   24 ++
 cui/uiconfig/ui/charnamepage.ui |4 -
 include/svtools/langtab.hxx |1 
 include/svx/langbox.hxx |   16 ++-
 svtools/source/misc/langtab.cxx |   14 ++
 svx/source/dialog/langbox.cxx   |   90 
 7 files changed, 147 insertions(+), 4 deletions(-)

New commits:
commit fe2b8ef18b11b226fddd1cf3fc7f9133426a1b1a
Author: Eike Rathke 
Date:   Thu May 22 19:23:14 2014 +0200

advance start of edit selection on a matching entry

... to allow continuous typing.

Change-Id: I4717e72e422037a441e582004bc87689ea7bc455

diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 77ec154..028e33d 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -711,7 +711,24 @@ IMPL_LINK( SvxLanguageComboBox, EditModifyHdl, 
SvxLanguageComboBox*, /*pEd*/ )
 {
 const sal_Int32 nPos = GetEntryPos( aStr);
 if (nPos != COMBOBOX_ENTRY_NOTFOUND)
+{
+// Advance start of full selection by one so the next character
+// will already continue the string instead of having to type the
+// same character again to start a new string. The selection
+// includes formatting characters and is reverse when obtained from
+// the Edit control.
+Selection aSel( GetSelection());
+if (aSel.Max() == 1)
+{
+OUString aText( GetText());
+if (aSel.Min() == aText.getLength())
+{
+++aSel.Max();
+SetSelection( aSel);
+}
+}
 meEditedAndValid = EDITED_NO;
+}
 else
 {
 OUString aCanonicalized;
commit dbe8b3b6d4f2d2cc2e8c702b78034e9013f71e8f
Author: Eike Rathke 
Date:   Thu May 22 16:31:09 2014 +0200

finally switch the Western language list box to SvxLanguageComboBox

Change-Id: Ibf0cb4c0fa951adcd0a7f185d7dd45b06913a40d

diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx
index d90c2cb..69b46c8 100644
--- a/cui/source/inc/chardlg.hxx
+++ b/cui/source/inc/chardlg.hxx
@@ -86,7 +86,7 @@ private:
 FixedText*  m_pWestFontSizeFT;
 FontSizeBox*m_pWestFontSizeLB;
 FixedText*  m_pWestFontLanguageFT;
-SvxLanguageBox* m_pWestFontLanguageLB;
+SvxLanguageComboBox* m_pWestFontLanguageLB;
 FixedText*  m_pWestFontTypeFT;
 
 VclContainer*   m_pEastFrame;
diff --git a/cui/uiconfig/ui/charnamepage.ui b/cui/uiconfig/ui/charnamepage.ui
index 25c67f1..6205dfd 100644
--- a/cui/uiconfig/ui/charnamepage.ui
+++ b/cui/uiconfig/ui/charnamepage.ui
@@ -54,7 +54,7 @@
   
 
 
-  
+  
 True
 False
 start
@@ -342,7 +342,7 @@
   
 
 
-  
+  
 True
 False
 True
commit 1aad7628dcd7fd14d48814d00c3d04e4ec0c59d5
Author: Eike Rathke 
Date:   Thu May 22 16:30:11 2014 +0200

handle SvxLanguageComboBox edit

Change-Id: Icc2a4829b8a859756ed194f35df214f8bb55c7ae

diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 1f0e58560..f36ae8e 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1086,6 +1086,30 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& 
rSet, LanguageGroup eLangGrp
 }
 nWhich = GetWhich( nSlot );
 pOld = GetOldItem( rSet, nSlot );
+
+// For language list boxes acting as ComboBox, check for, add and select an
+// edited entry.
+SvxLanguageComboBox* pLangComboBox = 
dynamic_cast(pLangBox);
+if (pLangComboBox)
+{
+switch (pLangComboBox->GetEditedAndValid())
+{
+case SvxLanguageComboBox::EDITED_NO:
+;   // nothing to do
+break;
+case SvxLanguageComboBox::EDITED_VALID:
+{
+const sal_Int32 nPos = pLangComboBox->SaveEditedAsEntry();
+if (nPos != COMBOBOX_ENTRY_NOTFOUND)
+pLangComboBox->SelectEntryPos( nPos);
+}
+break;
+case SvxLanguageComboBox::EDITED_INVALID:
+pLangComboBox->SelectEntryPos( 
pLangComboBox->GetSavedValueLBB());
+break;
+}
+}
+
 sal_Int32 nLangPos = pLangBox->GetSelectEntryPosLBB();
 LanguageType eLangType = 
(LanguageType)(sal_uLong)pLangBox->GetEntryDataLBB( nLangPos );
 
commit 29c024afbe6a46459e37c5ceec510de1cd0ca7c8
Author: Eike Rathke 
Date:   Thu May 22 16:15:37 2014 +0200

+ SvxLanguageComboBox EditModifyHdl(), SaveEditedAsE

Re: minutes of ESC call ...

2014-05-23 Thread Eike Rathke
Hi,

On Thursday, 2014-05-22 16:57:34 +0100, Michael Meeks wrote:

> + Late features ?
> + some changes in language listbox (Eike)
>+ switching to a combo-box, so can enter an arbitrary lang_tag
>   + due today.

https://gerrit.libreoffice.org/9447

Please check and vote +1/+2 :-)

Thanks
  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key ID: 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack


pgp9_Aupn8Csx.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: SAL_NO_VTABLE in formula

2014-05-23 Thread Eike Rathke
Hi Markus,

On Friday, 2014-05-23 03:14:30 +0200, Markus Mohrhard wrote:

> so by going through Lsan reports I noted that we have a few classes in
> formula that are marked with SAL_NO_VTABLE and therefore have no virtual
> protected destructors, This prevents us from deleting some of these
> instances and it looks like people just leaked them in the past.

What actually leaks, given that these classes have no member variables
and only define interfaces as pure abstract base classes one derives
from?

> Is there any reason not to remove the SAL_NO_VTABLE and make the destructor
> virtual and public. I"m talking especially about
> include/formula/IFunctionDescription.hxx where the use of SAL_NO_VTABLE
> looks like premature optimization to me.

This appears to me as exactly what the comment on SAL_NO_VTABLE in
include/sal/types.h talks about.

But no, if we really leak because of SAL_NO_VTABLE (this is on Windows,
isn't it? because it's defined empty for other platforms) then I don't
object to remove it, but then we should also remove the SAL_NO_VTABLE
define.

However, is it a prerequisite to have a non-virtual dtor when using
SAL_NO_VTABLE? Or wouldn't adding a virtual to the dtor already solve
the problem and not make Lsan stumble about?

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key ID: 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack


pgpKN9UBzlugG.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - cui/source cui/uiconfig include/svtools include/svx svtools/source svx/source

2014-05-23 Thread Eike Rathke
 cui/source/inc/chardlg.hxx  |2 
 cui/source/tabpages/chardlg.cxx |   24 ++
 cui/uiconfig/ui/charnamepage.ui |4 -
 include/svtools/langtab.hxx |1 
 include/svx/langbox.hxx |   16 ++-
 svtools/source/misc/langtab.cxx |   14 ++
 svx/source/dialog/langbox.cxx   |   90 
 7 files changed, 147 insertions(+), 4 deletions(-)

New commits:
commit aca222ee87826eb99554dba8fcf22e0cf7c718e0
Author: Eike Rathke 
Date:   Thu May 22 12:28:02 2014 +0200

switch the Western language list box to SvxLanguageComboBox

This allows the user to assign an arbitrary (but valid) BCP 47 language
tag to a portion of text, so that customized spell-checkers or other
language-dependent tools can be used without the need to wait for
LibreOffice to add yet another language to the list in the next release.

+bool SvtLanguageTable::HasLanguageType()

(cherry picked from commit 2a8eff589a53c8dd65e18d7a9d11cdb98a937e68)

+ SvxLanguageComboBox EditModifyHdl(), SaveEditedAsEntry()

(cherry picked from commit 29c024afbe6a46459e37c5ceec510de1cd0ca7c8)

handle SvxLanguageComboBox edit

(cherry picked from commit 1aad7628dcd7fd14d48814d00c3d04e4ec0c59d5)

finally switch the Western language list box to SvxLanguageComboBox

(cherry picked from commit dbe8b3b6d4f2d2cc2e8c702b78034e9013f71e8f)

advance start of edit selection on a matching entry

... to allow continuous typing.

(cherry picked from commit fe2b8ef18b11b226fddd1cf3fc7f9133426a1b1a)

Change-Id: Id57eb51b69e50be78f85d19a7b3623c1acdf6509
Reviewed-on: https://gerrit.libreoffice.org/9447
Reviewed-by: Miklos Vajna 
Reviewed-by: Björn Michaelsen 
Reviewed-by: Kohei Yoshida 
Tested-by: Kohei Yoshida 

diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx
index d90c2cb..69b46c8 100644
--- a/cui/source/inc/chardlg.hxx
+++ b/cui/source/inc/chardlg.hxx
@@ -86,7 +86,7 @@ private:
 FixedText*  m_pWestFontSizeFT;
 FontSizeBox*m_pWestFontSizeLB;
 FixedText*  m_pWestFontLanguageFT;
-SvxLanguageBox* m_pWestFontLanguageLB;
+SvxLanguageComboBox* m_pWestFontLanguageLB;
 FixedText*  m_pWestFontTypeFT;
 
 VclContainer*   m_pEastFrame;
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 1f0e58560..f36ae8e 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1086,6 +1086,30 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& 
rSet, LanguageGroup eLangGrp
 }
 nWhich = GetWhich( nSlot );
 pOld = GetOldItem( rSet, nSlot );
+
+// For language list boxes acting as ComboBox, check for, add and select an
+// edited entry.
+SvxLanguageComboBox* pLangComboBox = 
dynamic_cast(pLangBox);
+if (pLangComboBox)
+{
+switch (pLangComboBox->GetEditedAndValid())
+{
+case SvxLanguageComboBox::EDITED_NO:
+;   // nothing to do
+break;
+case SvxLanguageComboBox::EDITED_VALID:
+{
+const sal_Int32 nPos = pLangComboBox->SaveEditedAsEntry();
+if (nPos != COMBOBOX_ENTRY_NOTFOUND)
+pLangComboBox->SelectEntryPos( nPos);
+}
+break;
+case SvxLanguageComboBox::EDITED_INVALID:
+pLangComboBox->SelectEntryPos( 
pLangComboBox->GetSavedValueLBB());
+break;
+}
+}
+
 sal_Int32 nLangPos = pLangBox->GetSelectEntryPosLBB();
 LanguageType eLangType = 
(LanguageType)(sal_uLong)pLangBox->GetEntryDataLBB( nLangPos );
 
diff --git a/cui/uiconfig/ui/charnamepage.ui b/cui/uiconfig/ui/charnamepage.ui
index 25c67f1..6205dfd 100644
--- a/cui/uiconfig/ui/charnamepage.ui
+++ b/cui/uiconfig/ui/charnamepage.ui
@@ -54,7 +54,7 @@
   
 
 
-  
+  
 True
 False
 start
@@ -342,7 +342,7 @@
   
 
 
-  
+  
 True
 False
 True
diff --git a/include/svtools/langtab.hxx b/include/svtools/langtab.hxx
index 0034873..56d0618 100644
--- a/include/svtools/langtab.hxx
+++ b/include/svtools/langtab.hxx
@@ -29,6 +29,7 @@ class SVT_DLLPUBLIC SvtLanguageTable
 {
 public:
 
+static bool HasLanguageType( const LanguageType eType );
 static OUString GetLanguageString( const LanguageType eType );
 static LanguageType GetLanguageType( const OUString& rStr );
 static sal_uInt32   GetLanguageEntryCount();
diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx
index 410b240..91b788c 100644
--- a/include/svx/langbox.hxx
+++ b/include/svx/

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

2014-05-23 Thread Eike Rathke
 svx/source/dialog/langbox.cxx |   19 +++
 1 file changed, 19 insertions(+)

New commits:
commit 04ccece7299ac1e57488e5ef36af122edeec2aae
Author: Eike Rathke 
Date:   Fri May 23 17:17:18 2014 +0200

feedback color indicator for invalid tags

Change-Id: I235e32587779369c139aedd1961b37d8fcad8f53

diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 4d9b3dd..194a0d8 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -707,6 +707,7 @@ sal_Int32 SvxLanguageComboBox::ImplGetSavedValue() const
 
 IMPL_LINK( SvxLanguageComboBox, EditModifyHdl, SvxLanguageComboBox*, /*pEd*/ )
 {
+EditedAndValid eOldState = meEditedAndValid;
 OUString aStr( vcl::I18nHelper::filterFormattingChars( GetText()));
 if (aStr.isEmpty())
 meEditedAndValid = EDITED_INVALID;
@@ -744,6 +745,24 @@ IMPL_LINK( SvxLanguageComboBox, EditModifyHdl, 
SvxLanguageComboBox*, /*pEd*/ )
 }
 }
 }
+if (eOldState != meEditedAndValid)
+{
+if (meEditedAndValid == EDITED_INVALID)
+{
+#if 0
+//! Gives white on white!?! instead of white on reddish.
+SetControlBackground( ::Color( RGB_COLORDATA( 0xff, 0x65, 0x63)));
+SetControlForeground( ::Color( COL_WHITE));
+#else
+SetControlForeground( ::Color( RGB_COLORDATA( 0xf0, 0, 0)));
+#endif
+}
+else
+{
+SetControlForeground();
+SetControlBackground();
+}
+}
 return 0;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-23 Thread Eike Rathke
 cui/source/options/optgdlg.cxx |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 3d79d4ae3dff4305fa0808c34d3fb14bc0fe1e82
Author: Eike Rathke 
Date:   Fri May 23 17:46:41 2014 +0200

make this a little less confusing

... and change to a friendlier red for invalid patterns.

Change-Id: I19488abd496b144439d7918dc31cfd3f5f4fef92

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index ffa6f7e..81cf5d5 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1762,16 +1762,12 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, Edit*, 
pEd )
 }
 else
 {
-// color to use as background for an invalid pattern
-#define INVALID_PATTERN_BACKGROUND_COLOR ::Color(0xff6563)
 #if 0
-// color to use as foreground for an invalid pattern
-#define INVALID_PATTERN_FOREGROUND_COLOR Color(COL_WHITE)
-//! Gives white on white!?!
-pEd->SetControlBackground( INVALID_PATTERN_BACKGROUND_COLOR);
-pEd->SetControlForeground( INVALID_PATTERN_FOREGROUND_COLOR);
+//! Gives white on white!?! instead of white on reddish.
+pEd->SetControlBackground( ::Color( RGB_COLORDATA( 0xff, 0x65, 0x63)));
+pEd->SetControlForeground( ::Color( COL_WHITE));
 #else
-pEd->SetControlForeground( INVALID_PATTERN_BACKGROUND_COLOR);
+pEd->SetControlForeground( ::Color( RGB_COLORDATA( 0xf0, 0, 0)));
 #endif
 }
 return 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-23 Thread Eike Rathke
 cui/source/options/optgdlg.cxx |   12 
 svx/source/dialog/langbox.cxx  |   19 +++
 2 files changed, 23 insertions(+), 8 deletions(-)

New commits:
commit 524a83a3217bad4dcce96c2cddc9bf9c4b0f2292
Author: Eike Rathke 
Date:   Fri May 23 17:46:41 2014 +0200

make this a little less confusing

... and change to a friendlier red for invalid patterns.

Change-Id: I19488abd496b144439d7918dc31cfd3f5f4fef92
(cherry picked from commit 3d79d4ae3dff4305fa0808c34d3fb14bc0fe1e82)

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index ffa6f7e..81cf5d5 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1762,16 +1762,12 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, Edit*, 
pEd )
 }
 else
 {
-// color to use as background for an invalid pattern
-#define INVALID_PATTERN_BACKGROUND_COLOR ::Color(0xff6563)
 #if 0
-// color to use as foreground for an invalid pattern
-#define INVALID_PATTERN_FOREGROUND_COLOR Color(COL_WHITE)
-//! Gives white on white!?!
-pEd->SetControlBackground( INVALID_PATTERN_BACKGROUND_COLOR);
-pEd->SetControlForeground( INVALID_PATTERN_FOREGROUND_COLOR);
+//! Gives white on white!?! instead of white on reddish.
+pEd->SetControlBackground( ::Color( RGB_COLORDATA( 0xff, 0x65, 0x63)));
+pEd->SetControlForeground( ::Color( COL_WHITE));
 #else
-pEd->SetControlForeground( INVALID_PATTERN_BACKGROUND_COLOR);
+pEd->SetControlForeground( ::Color( RGB_COLORDATA( 0xf0, 0, 0)));
 #endif
 }
 return 0;
commit fcf07f67958672088c346fe0ed5f41130c905721
Author: Eike Rathke 
Date:   Fri May 23 17:17:18 2014 +0200

feedback color indicator for invalid tags

Change-Id: I235e32587779369c139aedd1961b37d8fcad8f53
(cherry picked from commit 04ccece7299ac1e57488e5ef36af122edeec2aae)

diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 028e33d..fc6262c 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -704,6 +704,7 @@ sal_Int32 SvxLanguageComboBox::ImplGetSavedValue() const
 
 IMPL_LINK( SvxLanguageComboBox, EditModifyHdl, SvxLanguageComboBox*, /*pEd*/ )
 {
+EditedAndValid eOldState = meEditedAndValid;
 OUString aStr( vcl::I18nHelper::filterFormattingChars( GetText()));
 if (aStr.isEmpty())
 meEditedAndValid = EDITED_INVALID;
@@ -741,6 +742,24 @@ IMPL_LINK( SvxLanguageComboBox, EditModifyHdl, 
SvxLanguageComboBox*, /*pEd*/ )
 }
 }
 }
+if (eOldState != meEditedAndValid)
+{
+if (meEditedAndValid == EDITED_INVALID)
+{
+#if 0
+//! Gives white on white!?! instead of white on reddish.
+SetControlBackground( ::Color( RGB_COLORDATA( 0xff, 0x65, 0x63)));
+SetControlForeground( ::Color( COL_WHITE));
+#else
+SetControlForeground( ::Color( RGB_COLORDATA( 0xf0, 0, 0)));
+#endif
+}
+else
+{
+SetControlForeground();
+SetControlBackground();
+}
+}
 return 0;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-23 Thread Eike Rathke
 cui/source/options/optgdlg.cxx |6 +-
 cui/source/options/optgdlg.hxx |2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit e0480c81a956751e48f8ef36a41c3062c1bed345
Author: Eike Rathke 
Date:   Fri May 23 18:06:52 2014 +0200

do not store invalid date acceptance patterns in configuration

Change-Id: I78cd8b304db2243fd105d4b13421b6ea0347e042

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 81cf5d5..7b6f947 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1298,7 +1298,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
 
 // Configured date acceptance patterns, for example Y-M-D;M-D or empty for
 // locale default.
-if (m_pDatePatternsED->IsValueChangedFromSaved())
+if (m_bDatePatternsValid && m_pDatePatternsED->IsValueChangedFromSaved())
 pLangConfig->aSysLocaleOptions.SetDatePatternsConfigString( 
m_pDatePatternsED->GetText());
 
 SfxObjectShell* pCurrentDocShell = SfxObjectShell::Current();
@@ -1463,6 +1463,8 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
 const LocaleDataWrapper& rLocaleWrapper( 
Application::GetSettings().GetLocaleDataWrapper() );
 aDatePatternsString = lcl_getDatePatternsConfigString( rLocaleWrapper);
 }
+// Let's assume patterns are valid at this point.
+m_bDatePatternsValid = true;
 m_pDatePatternsED->SetText( aDatePatternsString);
 bReadonly = 
pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_DATEPATTERNS);
 m_pDatePatternsED->Enable(!bReadonly);
@@ -1659,6 +1661,7 @@ IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, 
SvxLanguageBox*, pBox )
 
 // update the date acceptance patterns
 OUString aDatePatternsString = lcl_getDatePatternsConfigString( 
aLocaleWrapper);
+m_bDatePatternsValid = true;
 m_pDatePatternsED->SetText( aDatePatternsString);
 
 return 0;
@@ -1770,6 +1773,7 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, Edit*, 
pEd )
 pEd->SetControlForeground( ::Color( RGB_COLORDATA( 0xf0, 0, 0)));
 #endif
 }
+m_bDatePatternsValid = bValid;
 return 0;
 }
 
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index e015f4c..61b2228 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -157,6 +157,8 @@ class OfaLanguagesTabPage : public SfxTabPage
 OUStringm_sUserLocaleValue;
 OUStringm_sSystemDefaultString;
 
+boolm_bDatePatternsValid;
+
 DECL_LINK(  SupportHdl, CheckBox* ) ;
 DECL_LINK(  LocaleSettingHdl, SvxLanguageBox* ) ;
 DECL_LINK(  DatePatternsHdl, Edit* ) ;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - cui/source

2014-05-23 Thread Eike Rathke
 cui/source/options/optgdlg.cxx |6 +-
 cui/source/options/optgdlg.hxx |2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit d11969189092d35c13cd421c57f71ca655ea3d19
Author: Eike Rathke 
Date:   Fri May 23 18:06:52 2014 +0200

do not store invalid date acceptance patterns in configuration

Change-Id: I78cd8b304db2243fd105d4b13421b6ea0347e042
(cherry picked from commit e0480c81a956751e48f8ef36a41c3062c1bed345)

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 81cf5d5..7b6f947 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1298,7 +1298,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
 
 // Configured date acceptance patterns, for example Y-M-D;M-D or empty for
 // locale default.
-if (m_pDatePatternsED->IsValueChangedFromSaved())
+if (m_bDatePatternsValid && m_pDatePatternsED->IsValueChangedFromSaved())
 pLangConfig->aSysLocaleOptions.SetDatePatternsConfigString( 
m_pDatePatternsED->GetText());
 
 SfxObjectShell* pCurrentDocShell = SfxObjectShell::Current();
@@ -1463,6 +1463,8 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
 const LocaleDataWrapper& rLocaleWrapper( 
Application::GetSettings().GetLocaleDataWrapper() );
 aDatePatternsString = lcl_getDatePatternsConfigString( rLocaleWrapper);
 }
+// Let's assume patterns are valid at this point.
+m_bDatePatternsValid = true;
 m_pDatePatternsED->SetText( aDatePatternsString);
 bReadonly = 
pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_DATEPATTERNS);
 m_pDatePatternsED->Enable(!bReadonly);
@@ -1659,6 +1661,7 @@ IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, 
SvxLanguageBox*, pBox )
 
 // update the date acceptance patterns
 OUString aDatePatternsString = lcl_getDatePatternsConfigString( 
aLocaleWrapper);
+m_bDatePatternsValid = true;
 m_pDatePatternsED->SetText( aDatePatternsString);
 
 return 0;
@@ -1770,6 +1773,7 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, Edit*, 
pEd )
 pEd->SetControlForeground( ::Color( RGB_COLORDATA( 0xf0, 0, 0)));
 #endif
 }
+m_bDatePatternsValid = bValid;
 return 0;
 }
 
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index e015f4c..61b2228 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -157,6 +157,8 @@ class OfaLanguagesTabPage : public SfxTabPage
 OUStringm_sUserLocaleValue;
 OUStringm_sSystemDefaultString;
 
+boolm_bDatePatternsValid;
+
 DECL_LINK(  SupportHdl, CheckBox* ) ;
 DECL_LINK(  LocaleSettingHdl, SvxLanguageBox* ) ;
 DECL_LINK(  DatePatternsHdl, Edit* ) ;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-23 Thread Eike Rathke
 cui/source/options/optgdlg.cxx |6 +-
 cui/source/options/optgdlg.hxx |2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 8de2b492b1344f832fd118be22aaab9947bec865
Author: Eike Rathke 
Date:   Fri May 23 18:06:52 2014 +0200

do not store invalid date acceptance patterns in configuration

(cherry picked from commit e0480c81a956751e48f8ef36a41c3062c1bed345)

Conflicts:
cui/source/options/optgdlg.cxx

Change-Id: I78cd8b304db2243fd105d4b13421b6ea0347e042
Reviewed-on: https://gerrit.libreoffice.org/9453
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 5e826bd30..7fc1fe2 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1310,7 +1310,7 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& 
rSet )
 
 // Configured date acceptance patterns, for example Y-M-D;M-D or empty for
 // locale default.
-if (m_pDatePatternsED->GetText() != m_pDatePatternsED->GetSavedValue())
+if (m_bDatePatternsValid && m_pDatePatternsED->GetText() != 
m_pDatePatternsED->GetSavedValue())
 pLangConfig->aSysLocaleOptions.SetDatePatternsConfigString( 
m_pDatePatternsED->GetText());
 
 SfxObjectShell* pCurrentDocShell = SfxObjectShell::Current();
@@ -1474,6 +1474,8 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet )
 const LocaleDataWrapper& rLocaleWrapper( 
Application::GetSettings().GetLocaleDataWrapper() );
 aDatePatternsString = lcl_getDatePatternsConfigString( rLocaleWrapper);
 }
+// Let's assume patterns are valid at this point.
+m_bDatePatternsValid = true;
 m_pDatePatternsED->SetText( aDatePatternsString);
 bReadonly = 
pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_DATEPATTERNS);
 m_pDatePatternsED->Enable(!bReadonly);
@@ -1670,6 +1672,7 @@ IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, 
SvxLanguageBox*, pBox )
 
 // update the date acceptance patterns
 OUString aDatePatternsString = lcl_getDatePatternsConfigString( 
aLocaleWrapper);
+m_bDatePatternsValid = true;
 m_pDatePatternsED->SetText( aDatePatternsString);
 
 return 0;
@@ -1750,6 +1753,7 @@ IMPL_LINK( OfaLanguagesTabPage, DatePatternsHdl, Edit*, 
pEd )
 pEd->SetControlForeground( INVALID_PATTERN_BACKGROUND_COLOR);
 #endif
 }
+m_bDatePatternsValid = bValid;
 return 0;
 }
 
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 3b5799f..2f649d4 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -155,6 +155,8 @@ class OfaLanguagesTabPage : public SfxTabPage
 OUStringm_sUserLocaleValue;
 OUStringm_sSystemDefaultString;
 
+boolm_bDatePatternsValid;
+
 DECL_LINK(  SupportHdl, CheckBox* ) ;
 DECL_LINK(  LocaleSettingHdl, SvxLanguageBox* ) ;
 DECL_LINK(  DatePatternsHdl, Edit* ) ;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-26 Thread Eike Rathke
 sc/uiconfig/scalc/ui/formulacalculationoptions.ui |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 69d2fe6e57dd77b735234d139343b3a3faee165d
Author: Eike Rathke 
Date:   Mon May 26 11:55:39 2014 +0200

improve descriptive text of "Treat empty string as zero" option

... as per discussion on the libreoffice-l10n mailing list.

Change-Id: Ia4e7014df69e313ee02e6c9acd6c0ebac6f627f3

diff --git a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui 
b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
index b0442c2..a83d9f2 100644
--- a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
+++ b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
@@ -284,7 +284,7 @@
   
 False
 True
-This option 
determines whether an empty string is to be treated as having a value of zero 
when used in arithmetic or generates an error. It is disabled if conversion 
from text to number is set to always generate an error or always treat text as 
zero and then follows that value.
+This option 
determines how an empty string is treated when used in arithmetic operations. 
If you have set "Conversion from text to number" to either "Generate #VALUE! 
error" or "Treat as zero", you cannot choose (here) if conversion of an empty 
string to a number will generate an error or if it will treat empty strings as 
zero. Otherwise this option determines how empty strings are treated.
 True
 56
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sc/uiconfig

2014-05-26 Thread Eike Rathke
 sc/uiconfig/scalc/ui/formulacalculationoptions.ui |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0f000f4a835a770d72dd3dc73690363801367008
Author: Eike Rathke 
Date:   Mon May 26 11:55:39 2014 +0200

improve descriptive text of "Treat empty string as zero" option

... as per discussion on the libreoffice-l10n mailing list.

Change-Id: Ia4e7014df69e313ee02e6c9acd6c0ebac6f627f3
(cherry picked from commit 69d2fe6e57dd77b735234d139343b3a3faee165d)

diff --git a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui 
b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
index b0442c2..a83d9f2 100644
--- a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
+++ b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui
@@ -284,7 +284,7 @@
   
 False
 True
-This option 
determines whether an empty string is to be treated as having a value of zero 
when used in arithmetic or generates an error. It is disabled if conversion 
from text to number is set to always generate an error or always treat text as 
zero and then follows that value.
+This option 
determines how an empty string is treated when used in arithmetic operations. 
If you have set "Conversion from text to number" to either "Generate #VALUE! 
error" or "Treat as zero", you cannot choose (here) if conversion of an empty 
string to a number will generate an error or if it will treat empty strings as 
zero. Otherwise this option determines how empty strings are treated.
 True
 56
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-26 Thread Eike Rathke
 sc/inc/attarray.hxx |   21 ++
 sc/inc/column.hxx   |2 -
 sc/source/core/data/column2.cxx |   45 +---
 sc/source/core/data/table1.cxx  |4 +--
 4 files changed, 62 insertions(+), 10 deletions(-)

New commits:
commit a1dedadbf0d87a1db24e9b336257678e059882f0
Author: Eike Rathke 
Date:   Tue May 27 01:34:37 2014 +0200

resolved fdo#79228 resync ScPatternAttr if changed in GetNeededSize()

Change-Id: Ida47df6223a20939ad5971dc00b8f3462a92dd3e

diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx
index 08e3c5a..9b6464b 100644
--- a/sc/inc/attarray.hxx
+++ b/sc/inc/attarray.hxx
@@ -206,6 +206,7 @@ class ScAttrIterator
 public:
 inline  ScAttrIterator( const ScAttrArray* pNewArray, SCROW 
nStart, SCROW nEnd );
 inline const ScPatternAttr* Next( SCROW& rTop, SCROW& rBottom );
+inline const ScPatternAttr* Resync( SCROW nRow, SCROW& rTop, SCROW& 
rBottom );
 SCROW   GetNextRow() const { return nRow; }
 };
 
@@ -236,6 +237,26 @@ inline const ScPatternAttr* ScAttrIterator::Next( SCROW& 
rTop, SCROW& rBottom )
 return pRet;
 }
 
+inline const ScPatternAttr* ScAttrIterator::Resync( SCROW nRowP, SCROW& rTop, 
SCROW& rBottom )
+{
+nRow = nRowP;
+// Chances are high that the pattern changed on nRowP introduced a span
+// starting right there. Assume that Next() was called so nPos already
+// advanced. Another high chance is that the change extended a previous or
+// next pattern. In all these cases we don't need to search.
+if (3 <= nPos && nPos <= pArray->nCount && pArray->pData[nPos-3].nRow < 
nRowP &&
+nRowP <= pArray->pData[nPos-2].nRow)
+nPos -= 2;
+else if (2 <= nPos && nPos <= pArray->nCount && pArray->pData[nPos-2].nRow 
< nRowP &&
+nRowP <= pArray->pData[nPos-1].nRow)
+--nPos;
+else if (pArray->nCount > 0 && nRowP <= pArray->pData[0].nRow)
+nPos = 0;
+else
+pArray->Search( nRowP, nPos );
+return Next( rTop, rBottom);
+}
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 4212056..547fd14 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -445,7 +445,7 @@ public:
 long GetNeededSize(
 SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY,
 const Fraction& rZoomX, const Fraction& rZoomY,
-bool bWidth, const ScNeededSizeOptions& rOptions) const;
+bool bWidth, const ScNeededSizeOptions& rOptions, const 
ScPatternAttr** pPatternChange ) const;
 
 sal_uInt16 GetOptimalColWidth(
 OutputDevice* pDev, double nPPTX, double nPPTY,
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 7e5a4a6..763e658 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -86,7 +86,8 @@ inline bool IsAmbiguousScript( sal_uInt8 nScript )
 long ScColumn::GetNeededSize(
 SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY,
 const Fraction& rZoomX, const Fraction& rZoomY,
-bool bWidth, const ScNeededSizeOptions& rOptions ) const
+bool bWidth, const ScNeededSizeOptions& rOptions,
+const ScPatternAttr** ppPatternChange ) const
 {
 std::pair aPos = 
maCells.position(nRow);
 sc::CellStoreType::const_iterator it = aPos.first;
@@ -148,9 +149,32 @@ long ScColumn::GetNeededSize(
 SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
 sal_uLong nFormat = pPattern->GetNumberFormat( pFormatter, pCondSet );
 // #i111387# disable automatic line breaks only for "General" number format
-if (bBreak && aCell.hasNumeric() && ( nFormat % SV_COUNTRY_LANGUAGE_OFFSET 
) == 0 )
+if (bBreak && ( nFormat % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 )
 {
-bBreak = false;
+// If a formula cell needs to be interpreted during aCell.hasNumeric()
+// to determine the type, the pattern may get invalidated because the
+// result may set a number format. In which case there's also the
+// General format not set anymore..
+bool bMayInvalidatePattern = (aCell.meType == CELLTYPE_FORMULA);
+const ScPatternAttr* pOldPattern = pPattern;
+bool bNumeric = aCell.hasNumeric();
+if (bMayInvalidatePattern)
+{
+pPattern = pAttrArray->GetPattern( nRow );
+if (ppPatternChange)
+*ppPatternChange = pPattern;// XXX caller may have to 
check for change!
+}
+if (bNumeric)
+{
+if (!bMayInvalidatePattern || pPattern == pOldPattern)
+bBreak = false;
+else
+{
+nFormat = pPattern->GetN

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

2014-05-26 Thread Eike Rathke
 sc/inc/attarray.hxx |   21 ++
 sc/inc/column.hxx   |2 -
 sc/source/core/data/column2.cxx |   45 +---
 sc/source/core/data/table1.cxx  |4 +--
 4 files changed, 62 insertions(+), 10 deletions(-)

New commits:
commit 1baac7f17b024b15d79bbb9e89e68b2863c150e9
Author: Eike Rathke 
Date:   Tue May 27 01:34:37 2014 +0200

resolved fdo#79228 resync ScPatternAttr if changed in GetNeededSize()

Change-Id: Ida47df6223a20939ad5971dc00b8f3462a92dd3e
(cherry picked from commit a1dedadbf0d87a1db24e9b336257678e059882f0)

diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx
index 08e3c5a..9b6464b 100644
--- a/sc/inc/attarray.hxx
+++ b/sc/inc/attarray.hxx
@@ -206,6 +206,7 @@ class ScAttrIterator
 public:
 inline  ScAttrIterator( const ScAttrArray* pNewArray, SCROW 
nStart, SCROW nEnd );
 inline const ScPatternAttr* Next( SCROW& rTop, SCROW& rBottom );
+inline const ScPatternAttr* Resync( SCROW nRow, SCROW& rTop, SCROW& 
rBottom );
 SCROW   GetNextRow() const { return nRow; }
 };
 
@@ -236,6 +237,26 @@ inline const ScPatternAttr* ScAttrIterator::Next( SCROW& 
rTop, SCROW& rBottom )
 return pRet;
 }
 
+inline const ScPatternAttr* ScAttrIterator::Resync( SCROW nRowP, SCROW& rTop, 
SCROW& rBottom )
+{
+nRow = nRowP;
+// Chances are high that the pattern changed on nRowP introduced a span
+// starting right there. Assume that Next() was called so nPos already
+// advanced. Another high chance is that the change extended a previous or
+// next pattern. In all these cases we don't need to search.
+if (3 <= nPos && nPos <= pArray->nCount && pArray->pData[nPos-3].nRow < 
nRowP &&
+nRowP <= pArray->pData[nPos-2].nRow)
+nPos -= 2;
+else if (2 <= nPos && nPos <= pArray->nCount && pArray->pData[nPos-2].nRow 
< nRowP &&
+nRowP <= pArray->pData[nPos-1].nRow)
+--nPos;
+else if (pArray->nCount > 0 && nRowP <= pArray->pData[0].nRow)
+nPos = 0;
+else
+pArray->Search( nRowP, nPos );
+return Next( rTop, rBottom);
+}
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 4212056..547fd14 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -445,7 +445,7 @@ public:
 long GetNeededSize(
 SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY,
 const Fraction& rZoomX, const Fraction& rZoomY,
-bool bWidth, const ScNeededSizeOptions& rOptions) const;
+bool bWidth, const ScNeededSizeOptions& rOptions, const 
ScPatternAttr** pPatternChange ) const;
 
 sal_uInt16 GetOptimalColWidth(
 OutputDevice* pDev, double nPPTX, double nPPTY,
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 7e5a4a6..763e658 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -86,7 +86,8 @@ inline bool IsAmbiguousScript( sal_uInt8 nScript )
 long ScColumn::GetNeededSize(
 SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY,
 const Fraction& rZoomX, const Fraction& rZoomY,
-bool bWidth, const ScNeededSizeOptions& rOptions ) const
+bool bWidth, const ScNeededSizeOptions& rOptions,
+const ScPatternAttr** ppPatternChange ) const
 {
 std::pair aPos = 
maCells.position(nRow);
 sc::CellStoreType::const_iterator it = aPos.first;
@@ -148,9 +149,32 @@ long ScColumn::GetNeededSize(
 SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
 sal_uLong nFormat = pPattern->GetNumberFormat( pFormatter, pCondSet );
 // #i111387# disable automatic line breaks only for "General" number format
-if (bBreak && aCell.hasNumeric() && ( nFormat % SV_COUNTRY_LANGUAGE_OFFSET 
) == 0 )
+if (bBreak && ( nFormat % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 )
 {
-bBreak = false;
+// If a formula cell needs to be interpreted during aCell.hasNumeric()
+// to determine the type, the pattern may get invalidated because the
+// result may set a number format. In which case there's also the
+// General format not set anymore..
+bool bMayInvalidatePattern = (aCell.meType == CELLTYPE_FORMULA);
+const ScPatternAttr* pOldPattern = pPattern;
+bool bNumeric = aCell.hasNumeric();
+if (bMayInvalidatePattern)
+{
+pPattern = pAttrArray->GetPattern( nRow );
+if (ppPatternChange)
+*ppPatternChange = pPattern;// XXX caller may have to 
check for change!
+}
+if (bNumeric)
+{
+if (!bMayInvalidatePattern || pPattern == pOldPattern)
+  

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

2014-05-27 Thread Eike Rathke
 sc/source/core/data/document.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 17979abf4fde202cae231be19a218be3fe27d04c
Author: Eike Rathke 
Date:   Tue May 27 12:31:30 2014 +0200

resolved rhbz#1101224 do not attempt to obtain names for NULL tabs

This happened when the HTML export via clipboard tried to resolve
conditional formats, where we have a temporary instance of a document
containing only the sheet to be exported.

Change-Id: Ic7498a1cab3eabede74773868287a2cc3edef052

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 32b6ba4..87451de 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -268,9 +268,14 @@ std::vector ScDocument::GetAllTableNames() const
 TableContainer::const_iterator it = maTabs.begin(), itEnd = maTabs.end();
 for (; it != itEnd; ++it)
 {
+// Positions need to be preserved for ScCompiler and address convention
+// context, so still push an empty string for NULL tabs.
 OUString aName;
-const ScTable& rTab = **it;
-rTab.GetName(aName);
+if (*it)
+{
+const ScTable& rTab = **it;
+rTab.GetName(aName);
+}
 aNames.push_back(aName);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-27 Thread Eike Rathke
 sc/source/core/data/document.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 1c567ffed15e2223e91e4e4855ee0a425eea9df6
Author: Eike Rathke 
Date:   Tue May 27 12:31:30 2014 +0200

resolved rhbz#1101224 do not attempt to obtain names for NULL tabs

This happened when the HTML export via clipboard tried to resolve
conditional formats, where we have a temporary instance of a document
containing only the sheet to be exported.

Change-Id: Ic7498a1cab3eabede74773868287a2cc3edef052
(cherry picked from commit 17979abf4fde202cae231be19a218be3fe27d04c)

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 97c10ca..95894d2 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -268,9 +268,14 @@ std::vector ScDocument::GetAllTableNames() const
 TableContainer::const_iterator it = maTabs.begin(), itEnd = maTabs.end();
 for (; it != itEnd; ++it)
 {
+// Positions need to be preserved for ScCompiler and address convention
+// context, so still push an empty string for NULL tabs.
 OUString aName;
-const ScTable& rTab = **it;
-rTab.GetName(aName);
+if (*it)
+{
+const ScTable& rTab = **it;
+rTab.GetName(aName);
+}
 aNames.push_back(aName);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - extras/source

2014-05-27 Thread Eike Rathke
 extras/source/glade/libreoffice-catalog.xml.in |4 
 1 file changed, 4 insertions(+)

New commits:
commit 7396f2486eb6be22951d36448f12fcf24d785fc1
Author: Eike Rathke 
Date:   Tue May 27 17:21:13 2014 +0200

add SvxLanguageComboBox

Change-Id: Idd97331669ff204efb568ef1c17ba7444db4abf4
(cherry picked from commit 13975eb35917c0152eab9ce05c4e7a9c9657b6a3)

diff --git a/extras/source/glade/libreoffice-catalog.xml.in 
b/extras/source/glade/libreoffice-catalog.xml.in
index fb120fa..861dd56b 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -582,6 +582,10 @@
 generic-name="LanguageBox" parent="VclComboBoxText"
 icon-name="widget-gtk-combobox"/>
 
+
+
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-27 Thread Eike Rathke
 extras/source/glade/libreoffice-catalog.xml.in |4 
 1 file changed, 4 insertions(+)

New commits:
commit 13975eb35917c0152eab9ce05c4e7a9c9657b6a3
Author: Eike Rathke 
Date:   Tue May 27 17:21:13 2014 +0200

add SvxLanguageComboBox

Change-Id: Idd97331669ff204efb568ef1c17ba7444db4abf4

diff --git a/extras/source/glade/libreoffice-catalog.xml.in 
b/extras/source/glade/libreoffice-catalog.xml.in
index fb120fa..861dd56b 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -582,6 +582,10 @@
 generic-name="LanguageBox" parent="VclComboBoxText"
 icon-name="widget-gtk-combobox"/>
 
+
+
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-27 Thread Eike Rathke
 download.lst |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit cb0d44a05b62c8f3a27aa82fce8d558d302538d9
Author: Eike Rathke 
Date:   Tue May 27 17:48:45 2014 +0200

update language-subtag-registry as of 2014-04-10

Change-Id: I99deaf80f559e28de106b639663b262544cdf60c

diff --git a/download.lst b/download.lst
index f9ce689..80f4ca8 100644
--- a/download.lst
+++ b/download.lst
@@ -77,8 +77,8 @@ export JFREEREPORT_LIBXML_TARBALL := 
ace6ab49184e329db254e454a010f56d-libxml-1.1
 export JFREEREPORT_SAC_TARBALL := 
39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip
 export JPEG_MD5SUM := 3353992aecaee1805ef4109aadd433e7
 export JPEG_TARBALL := jpegsrc.v9a.tar.gz
-export LANGTAGREG_MD5SUM := 504af523f5d1a5590bbeb6a4b55e8a97
-export LANGTAGREG_TARBALL := language-subtag-registry-2014-03-27.tar.bz2
+export LANGTAGREG_MD5SUM := 49c94710f7858b1969d74ff72e6aac84
+export LANGTAGREG_TARBALL := language-subtag-registry-2014-04-10.tar.bz2
 export LANGUAGETOOL_TARBALL := 
b63e6340a02ff1cacfeadb2c42286161-JLanguageTool-1.7.0.tar.bz2
 export LCMS2_MD5SUM := f4c08d38ceade4a664ebff7228910a33
 export LCMS2_TARBALL := lcms2-2.6.tar.gz
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - download.lst

2014-05-27 Thread Eike Rathke
 download.lst |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 85e07666a64165610630b71b866c5f96709d7480
Author: Eike Rathke 
Date:   Tue May 27 17:48:45 2014 +0200

update language-subtag-registry as of 2014-04-10

Change-Id: I99deaf80f559e28de106b639663b262544cdf60c
(cherry picked from commit cb0d44a05b62c8f3a27aa82fce8d558d302538d9)

diff --git a/download.lst b/download.lst
index 02268c2..3e2893c 100644
--- a/download.lst
+++ b/download.lst
@@ -78,8 +78,8 @@ export JFREEREPORT_LIBXML_TARBALL := 
ace6ab49184e329db254e454a010f56d-libxml-1.1
 export JFREEREPORT_SAC_TARBALL := 
39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip
 export JPEG_MD5SUM := 3353992aecaee1805ef4109aadd433e7
 export JPEG_TARBALL := jpegsrc.v9a.tar.gz
-export LANGTAGREG_MD5SUM := 504af523f5d1a5590bbeb6a4b55e8a97
-export LANGTAGREG_TARBALL := language-subtag-registry-2014-03-27.tar.bz2
+export LANGTAGREG_MD5SUM := 49c94710f7858b1969d74ff72e6aac84
+export LANGTAGREG_TARBALL := language-subtag-registry-2014-04-10.tar.bz2
 export LANGUAGETOOL_TARBALL := 
b63e6340a02ff1cacfeadb2c42286161-JLanguageTool-1.7.0.tar.bz2
 export LCMS2_MD5SUM := f4c08d38ceade4a664ebff7228910a33
 export LCMS2_TARBALL := lcms2-2.6.tar.gz
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-27 Thread Eike Rathke
 sc/source/core/data/formulacell.cxx |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit f68eed1518fe689fe8a535bebc8d2b6c9f257b9c
Author: Eike Rathke 
Date:   Tue May 27 19:28:36 2014 +0200

do not replace a General format with a General format

Found when investigating fdo#79228 which was caused by the ScPatternAttr
change due to the number format being applied.

Change-Id: Ieada557f5e194401a9ce255f26d71d36e0704f35

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index dedba62..afa969d 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1682,10 +1682,21 @@ void ScFormulaCell::InterpretTail( 
ScInterpretTailParameter eTailParam )
 nFormatIndex = 
ScGlobal::GetStandardFormat(*pDocument->GetFormatTable(),
 nFormatIndex, nFormatType);
 
-// set number format explicitly
-pDocument->SetNumberFormat( aPos, nFormatIndex );
+// Do not replace a General format (which was the reason why
+// mbNeedsNumberFormat was set) with a General format.
+// 1. setting a format has quite some overhead in the
+// ScPatternAttr/ScAttrArray handling, even if identical.
+// 2. the General formats may be of different locales.
+// XXX if mbNeedsNumberFormat was set even if the current format
+// was not General then we'd have to obtain the current format here
+// and check at least the types.
+if ((nFormatIndex % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
+{
+// set number format explicitly
+pDocument->SetNumberFormat( aPos, nFormatIndex );
+bChanged = true;
+}
 
-bChanged = true;
 mbNeedsNumberFormat = false;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-27 Thread Eike Rathke
 sc/source/core/data/formulacell.cxx |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 5ec34ef8f76cd5a790946c245d712de2f70ffa7c
Author: Eike Rathke 
Date:   Tue May 27 19:28:36 2014 +0200

do not replace a General format with a General format

Found when investigating fdo#79228 which was caused by the ScPatternAttr
change due to the number format being applied.

Change-Id: Ieada557f5e194401a9ce255f26d71d36e0704f35
(cherry picked from commit f68eed1518fe689fe8a535bebc8d2b6c9f257b9c)

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index ec07bde..af6aed4 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1682,10 +1682,21 @@ void ScFormulaCell::InterpretTail( 
ScInterpretTailParameter eTailParam )
 nFormatIndex = 
ScGlobal::GetStandardFormat(*pDocument->GetFormatTable(),
 nFormatIndex, nFormatType);
 
-// set number format explicitly
-pDocument->SetNumberFormat( aPos, nFormatIndex );
+// Do not replace a General format (which was the reason why
+// mbNeedsNumberFormat was set) with a General format.
+// 1. setting a format has quite some overhead in the
+// ScPatternAttr/ScAttrArray handling, even if identical.
+// 2. the General formats may be of different locales.
+// XXX if mbNeedsNumberFormat was set even if the current format
+// was not General then we'd have to obtain the current format here
+// and check at least the types.
+if ((nFormatIndex % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
+{
+// set number format explicitly
+pDocument->SetNumberFormat( aPos, nFormatIndex );
+bChanged = true;
+}
 
-bChanged = true;
 mbNeedsNumberFormat = false;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-27 Thread Eike Rathke
 sc/source/core/tool/address.cxx |   21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

New commits:
commit ac8532ce26e79453b3a969b956ebb7823c455131
Author: Eike Rathke 
Date:   Tue May 27 23:19:36 2014 +0200

resolved fdo#70455 B1:SOMENAME is not a valid singleton reference

Change-Id: Iac80d74a9ec6382a232fdc2f4b798e57dc643ad3

diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 55a12d2..ef3baad 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -873,6 +873,14 @@ static inline const sal_Unicode* lcl_a1_get_row( const 
sal_Unicode* p,
 return pEnd;
 }
 
+/// B:B or 2:2, but not B:2 or 2:B or B2:B or B:B2 or ...
+static bool isValidSingleton( sal_uInt16 nFlags, sal_uInt16 nFlags2 )
+{
+bool bCols = (nFlags & SCA_VALID_COL) && ((nFlags & SCA_VALID_COL2) || 
(nFlags2 & SCA_VALID_COL));
+bool bRows = (nFlags & SCA_VALID_ROW) && ((nFlags & SCA_VALID_ROW2) || 
(nFlags2 & SCA_VALID_ROW));
+return (bCols && !bRows) || (!bCols && bRows);
+}
+
 static sal_uInt16 lcl_ScRange_Parse_XL_A1( ScRange& r,
const sal_Unicode* p,
ScDocument* pDoc,
@@ -978,7 +986,7 @@ static sal_uInt16 lcl_ScRange_Parse_XL_A1( ScRange& r,
 }
 
 p = tmp2;
-p = lcl_eatWhiteSpace( p+1 );
+p = lcl_eatWhiteSpace( p+1 );   // after ':'
 tmp1 = lcl_a1_get_col( p, &r.aEnd, &nFlags2 );
 if( !tmp1 && aEndTabName.isEmpty() ) // Probably the aEndTabName was 
specified after the first range
 {
@@ -991,16 +999,17 @@ static sal_uInt16 lcl_ScRange_Parse_XL_A1( ScRange& r,
 r.aEnd.SetTab( nTab );
 nFlags |= SCA_VALID_TAB2 | SCA_TAB2_3D | SCA_TAB2_ABSOLUTE;
 }
-p = lcl_eatWhiteSpace( p+1 );
+if (*p == '!' || *p == ':')
+p = lcl_eatWhiteSpace( p+1 );
 tmp1 = lcl_a1_get_col( p, &r.aEnd, &nFlags2 );
 }
 }
-if( !tmp1 ) // strange, but valid singleton
-return nFlags;
+if( !tmp1 ) // strange, but maybe valid singleton
+return isValidSingleton( nFlags, nFlags2) ? nFlags : (nFlags & 
~SCA_VALID);
 
 tmp2 = lcl_a1_get_row( tmp1, &r.aEnd, &nFlags2 );
-if( !tmp2 ) // strange, but valid singleton
-return nFlags;
+if( !tmp2 ) // strange, but maybe valid singleton
+return isValidSingleton( nFlags, nFlags2) ? nFlags : (nFlags & 
~SCA_VALID);
 
 if ( *tmp2 != 0 )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-27 Thread Eike Rathke
 sc/source/core/tool/address.cxx |   21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

New commits:
commit 2217cb71b762ffbc32ac6c4e5d613fd32f4fa05c
Author: Eike Rathke 
Date:   Tue May 27 23:19:36 2014 +0200

resolved fdo#70455 B1:SOMENAME is not a valid singleton reference

Change-Id: Iac80d74a9ec6382a232fdc2f4b798e57dc643ad3
(cherry picked from commit ac8532ce26e79453b3a969b956ebb7823c455131)

diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 55a12d2..ef3baad 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -873,6 +873,14 @@ static inline const sal_Unicode* lcl_a1_get_row( const 
sal_Unicode* p,
 return pEnd;
 }
 
+/// B:B or 2:2, but not B:2 or 2:B or B2:B or B:B2 or ...
+static bool isValidSingleton( sal_uInt16 nFlags, sal_uInt16 nFlags2 )
+{
+bool bCols = (nFlags & SCA_VALID_COL) && ((nFlags & SCA_VALID_COL2) || 
(nFlags2 & SCA_VALID_COL));
+bool bRows = (nFlags & SCA_VALID_ROW) && ((nFlags & SCA_VALID_ROW2) || 
(nFlags2 & SCA_VALID_ROW));
+return (bCols && !bRows) || (!bCols && bRows);
+}
+
 static sal_uInt16 lcl_ScRange_Parse_XL_A1( ScRange& r,
const sal_Unicode* p,
ScDocument* pDoc,
@@ -978,7 +986,7 @@ static sal_uInt16 lcl_ScRange_Parse_XL_A1( ScRange& r,
 }
 
 p = tmp2;
-p = lcl_eatWhiteSpace( p+1 );
+p = lcl_eatWhiteSpace( p+1 );   // after ':'
 tmp1 = lcl_a1_get_col( p, &r.aEnd, &nFlags2 );
 if( !tmp1 && aEndTabName.isEmpty() ) // Probably the aEndTabName was 
specified after the first range
 {
@@ -991,16 +999,17 @@ static sal_uInt16 lcl_ScRange_Parse_XL_A1( ScRange& r,
 r.aEnd.SetTab( nTab );
 nFlags |= SCA_VALID_TAB2 | SCA_TAB2_3D | SCA_TAB2_ABSOLUTE;
 }
-p = lcl_eatWhiteSpace( p+1 );
+if (*p == '!' || *p == ':')
+p = lcl_eatWhiteSpace( p+1 );
 tmp1 = lcl_a1_get_col( p, &r.aEnd, &nFlags2 );
 }
 }
-if( !tmp1 ) // strange, but valid singleton
-return nFlags;
+if( !tmp1 ) // strange, but maybe valid singleton
+return isValidSingleton( nFlags, nFlags2) ? nFlags : (nFlags & 
~SCA_VALID);
 
 tmp2 = lcl_a1_get_row( tmp1, &r.aEnd, &nFlags2 );
-if( !tmp2 ) // strange, but valid singleton
-return nFlags;
+if( !tmp2 ) // strange, but maybe valid singleton
+return isValidSingleton( nFlags, nFlags2) ? nFlags : (nFlags & 
~SCA_VALID);
 
 if ( *tmp2 != 0 )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: helpcontent2

2014-05-28 Thread Eike Rathke
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e0ae1e0d96e0f046f68e7166ae9146e411bc7d50
Author: Eike Rathke 
Date:   Wed May 28 15:01:35 2014 +0200

Updated core
Project: help  10178deb770a99a29e299e0f3e553e25f1d3ad36

diff --git a/helpcontent2 b/helpcontent2
index 5916c2b..10178deb 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 5916c2b39f6aa68c6d47f266be84085a84d9a8c7
+Subproject commit 10178deb770a99a29e299e0f3e553e25f1d3ad36
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-28 Thread Eike Rathke
 source/text/shared/01/05020100.xhp |   14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 10178deb770a99a29e299e0f3e553e25f1d3ad36
Author: Eike Rathke 
Date:   Wed May 28 15:01:35 2014 +0200

document language list combo box

Change-Id: I77097ca9e91233222108043cbe1ca9c12a326d74

diff --git a/source/text/shared/01/05020100.xhp 
b/source/text/shared/01/05020100.xhp
index ec7eb0f..89f7f8c 100644
--- a/source/text/shared/01/05020100.xhp
+++ b/source/text/shared/01/05020100.xhp
@@ -101,6 +101,8 @@
 
 Language
 Sets the language that 
the spellchecker uses for the selected text or the text that you type. 
Available language modules have a check mark in front of 
them.
+If the language list consists of an editable combo box, you can 
enter a valid BCP 47 language tag if the language you want to 
assign is not available from the selectable list.
+For language tag details please see the http://langtag.net/";>For users section on the langtag.net 
web site.
 
 
 You can also change the locale setting for cells (choose 
Format - Cells – Numbers).
commit a51fbffad0cbada07d335470ee042152f94bdbd7
Author: Eike Rathke 
Date:   Wed May 28 14:45:11 2014 +0200

copy-pasted sizelb is langlb instead

Change-Id: I0671f827c1e8fe8f6b7a17b466457a615361b4ac

diff --git a/source/text/shared/01/05020100.xhp 
b/source/text/shared/01/05020100.xhp
index 93eb3a4..ec7eb0f 100644
--- a/source/text/shared/01/05020100.xhp
+++ b/source/text/shared/01/05020100.xhp
@@ -95,12 +95,12 @@
 If you are creating a Style that is based on another Style, you can 
enter a percentage value or a point value (for example, -2pt or 
+5pt).
 
 
-
-
-
-
+
+
+
+
 Language
-Sets the language that 
the spellchecker uses for the selected text or the text that you type. 
Available language modules have a check mark in front of 
them.
+Sets the language that 
the spellchecker uses for the selected text or the text that you type. 
Available language modules have a check mark in front of 
them.
 
 
 You can also change the locale setting for cells (choose 
Format - Cells – Numbers).
commit 92a81c214a5fa872d11c1037f1082abe02975ab0
Author: Eike Rathke 
Date:   Wed May 28 13:56:13 2014 +0200

bring some sense into this sentence

Change-Id: Iafbe1af1ced97e73f2b7171656f8ab3627440a66

diff --git a/source/text/shared/01/05020100.xhp 
b/source/text/shared/01/05020100.xhp
index c4e15c8..93eb3a4 100644
--- a/source/text/shared/01/05020100.xhp
+++ b/source/text/shared/01/05020100.xhp
@@ -103,7 +103,7 @@
 Sets the language that 
the spellchecker uses for the selected text or the text that you type. 
Available language modules have a check mark in front of 
them.
 
 
-You can only change the language setting for cells (choose 
Format - Cells – Numbers).
+You can also change the locale setting for cells (choose 
Format - Cells – Numbers).
 
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - helpcontent2

2014-05-28 Thread Eike Rathke
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cefb13f7a452ef5fe4f2f295fa3fa00167070416
Author: Eike Rathke 
Date:   Wed May 28 15:01:35 2014 +0200

Updated core
Project: help  e0cc4109616c522d7477b3f8c37d1d77824e4012

diff --git a/helpcontent2 b/helpcontent2
index ef5075a..e0cc410 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit ef5075ab122ec70c686b4127038a7ea0adf70f69
+Subproject commit e0cc4109616c522d7477b3f8c37d1d77824e4012
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: Branch 'libreoffice-4-3' - 3 commits - source/text

2014-05-28 Thread Eike Rathke
 source/text/shared/01/05020100.xhp |   14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit e0cc4109616c522d7477b3f8c37d1d77824e4012
Author: Eike Rathke 
Date:   Wed May 28 15:01:35 2014 +0200

document language list combo box

Change-Id: I77097ca9e91233222108043cbe1ca9c12a326d74
(cherry picked from commit 10178deb770a99a29e299e0f3e553e25f1d3ad36)

diff --git a/source/text/shared/01/05020100.xhp 
b/source/text/shared/01/05020100.xhp
index ec7eb0f..89f7f8c 100644
--- a/source/text/shared/01/05020100.xhp
+++ b/source/text/shared/01/05020100.xhp
@@ -101,6 +101,8 @@
 
 Language
 Sets the language that 
the spellchecker uses for the selected text or the text that you type. 
Available language modules have a check mark in front of 
them.
+If the language list consists of an editable combo box, you can 
enter a valid BCP 47 language tag if the language you want to 
assign is not available from the selectable list.
+For language tag details please see the http://langtag.net/";>For users section on the langtag.net 
web site.
 
 
 You can also change the locale setting for cells (choose 
Format - Cells – Numbers).
commit 51d0f2dce5c99a57b0c2268411cabfe884c91756
Author: Eike Rathke 
Date:   Wed May 28 14:45:11 2014 +0200

copy-pasted sizelb is langlb instead

Change-Id: I0671f827c1e8fe8f6b7a17b466457a615361b4ac
(cherry picked from commit a51fbffad0cbada07d335470ee042152f94bdbd7)

diff --git a/source/text/shared/01/05020100.xhp 
b/source/text/shared/01/05020100.xhp
index 93eb3a4..ec7eb0f 100644
--- a/source/text/shared/01/05020100.xhp
+++ b/source/text/shared/01/05020100.xhp
@@ -95,12 +95,12 @@
 If you are creating a Style that is based on another Style, you can 
enter a percentage value or a point value (for example, -2pt or 
+5pt).
 
 
-
-
-
-
+
+
+
+
 Language
-Sets the language that 
the spellchecker uses for the selected text or the text that you type. 
Available language modules have a check mark in front of 
them.
+Sets the language that 
the spellchecker uses for the selected text or the text that you type. 
Available language modules have a check mark in front of 
them.
 
 
 You can also change the locale setting for cells (choose 
Format - Cells – Numbers).
commit 86ecb677b97acbb02c5b79158094a0e70a427eef
Author: Eike Rathke 
Date:   Wed May 28 13:56:13 2014 +0200

bring some sense into this sentence

Change-Id: Iafbe1af1ced97e73f2b7171656f8ab3627440a66
(cherry picked from commit 92a81c214a5fa872d11c1037f1082abe02975ab0)

diff --git a/source/text/shared/01/05020100.xhp 
b/source/text/shared/01/05020100.xhp
index c4e15c8..93eb3a4 100644
--- a/source/text/shared/01/05020100.xhp
+++ b/source/text/shared/01/05020100.xhp
@@ -103,7 +103,7 @@
 Sets the language that 
the spellchecker uses for the selected text or the text that you type. 
Available language modules have a check mark in front of 
them.
 
 
-You can only change the language setting for cells (choose 
Format - Cells – Numbers).
+You can also change the locale setting for cells (choose 
Format - Cells – Numbers).
 
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-28 Thread Eike Rathke
 sc/source/core/data/document.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit b256135f1fe5a31735352ec2795e580b5a12fb09
Author: Eike Rathke 
Date:   Tue May 27 12:31:30 2014 +0200

resolved rhbz#1101224 do not attempt to obtain names for NULL tabs

This happened when the HTML export via clipboard tried to resolve
conditional formats, where we have a temporary instance of a document
containing only the sheet to be exported.

Change-Id: Ic7498a1cab3eabede74773868287a2cc3edef052
(cherry picked from commit 17979abf4fde202cae231be19a218be3fe27d04c)
Reviewed-on: https://gerrit.libreoffice.org/9506
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 47164be..2ec7d68 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -259,9 +259,14 @@ std::vector ScDocument::GetAllTableNames() const
 TableContainer::const_iterator it = maTabs.begin(), itEnd = maTabs.end();
 for (; it != itEnd; ++it)
 {
+// Positions need to be preserved for ScCompiler and address convention
+// context, so still push an empty string for NULL tabs.
 OUString aName;
-const ScTable& rTab = **it;
-rTab.GetName(aName);
+if (*it)
+{
+const ScTable& rTab = **it;
+rTab.GetName(aName);
+}
 aNames.push_back(aName);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-05-29 Thread Eike Rathke
 sc/source/core/data/formulacell.cxx |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 68be0e5efb59946edc9a537ef0283f9b720b7cdd
Author: Eike Rathke 
Date:   Tue May 27 19:28:36 2014 +0200

do not replace a General format with a General format

Found when investigating fdo#79228 which was caused by the ScPatternAttr
change due to the number format being applied.

Change-Id: Ieada557f5e194401a9ce255f26d71d36e0704f35
(cherry picked from commit f68eed1518fe689fe8a535bebc8d2b6c9f257b9c)
Reviewed-on: https://gerrit.libreoffice.org/9511
Tested-by: Kohei Yoshida 
Reviewed-by: Kohei Yoshida 

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 3f3b18b..d4324a3 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1672,10 +1672,21 @@ void ScFormulaCell::InterpretTail( 
ScInterpretTailParameter eTailParam )
 nFormatIndex = 
ScGlobal::GetStandardFormat(*pDocument->GetFormatTable(),
 nFormatIndex, nFormatType);
 
-// set number format explicitly
-pDocument->SetNumberFormat( aPos, nFormatIndex );
+// Do not replace a General format (which was the reason why
+// mbNeedsNumberFormat was set) with a General format.
+// 1. setting a format has quite some overhead in the
+// ScPatternAttr/ScAttrArray handling, even if identical.
+// 2. the General formats may be of different locales.
+// XXX if mbNeedsNumberFormat was set even if the current format
+// was not General then we'd have to obtain the current format here
+// and check at least the types.
+if ((nFormatIndex % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
+{
+// set number format explicitly
+pDocument->SetNumberFormat( aPos, nFormatIndex );
+bChanged = true;
+}
 
-bChanged = true;
 mbNeedsNumberFormat = false;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   3   4   5   6   7   8   9   10   >