[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - officecfg/registry

2019-11-22 Thread Takeshi Abe (via logerrit)
 officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e9b1955b0d8540968a3796166ddf3694335d
Author: Takeshi Abe 
AuthorDate: Thu Nov 21 19:00:20 2019 +0900
Commit: Xisco Faulí 
CommitDate: Sat Nov 23 08:57:36 2019 +0100

tdf#128892 Give menu "Rename Sheet" an alternative mnemonic H

... to avoid the duplicate R for "Insert Rows".

Change-Id: Ie2e0faf566ba5f85e4b2a72c289a4320e580f7f9
Reviewed-on: https://gerrit.libreoffice.org/83368
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 
(cherry picked from commit 017c6150e94a3a621f6f3e789fe72cac90a7bf11)
Reviewed-on: https://gerrit.libreoffice.org/83510

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index 5fc352c50f8c..099c1f249d21 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -1928,7 +1928,7 @@
   
   
 
-  ~Rename Sheet...
+  Rename S~heet...
 
 
   1
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-22 Thread Takeshi Abe (via logerrit)
 officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 017c6150e94a3a621f6f3e789fe72cac90a7bf11
Author: Takeshi Abe 
AuthorDate: Thu Nov 21 19:00:20 2019 +0900
Commit: Adolfo Jayme Barrientos 
CommitDate: Fri Nov 22 16:04:45 2019 +0100

tdf#128892 Give menu "Rename Sheet" an alternative mnemonic H

... to avoid the duplicate R for "Insert Rows".

Change-Id: Ie2e0faf566ba5f85e4b2a72c289a4320e580f7f9
Reviewed-on: https://gerrit.libreoffice.org/83368
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index 5fc352c50f8c..099c1f249d21 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -1928,7 +1928,7 @@
   
   
 
-  ~Rename Sheet...
+  Rename S~heet...
 
 
   1
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-08 Thread Takeshi Abe (via logerrit)
 sc/inc/conditio.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 86876ff86ef19af20e1c7202e029bbde44051a07
Author: Takeshi Abe 
AuthorDate: Sun Jun 23 19:32:41 2019 +0900
Commit: Tor Lillqvist 
CommitDate: Mon Jul 8 10:03:25 2019 +0200

sc: the type is not Data, but Date

Change-Id: I32105e1f40ddb0c206d62f30f66054b7dbe803d0
Reviewed-on: https://gerrit.libreoffice.org/74594
Reviewed-by: Julien Nabet 
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 49c05fbbb3c7..42448174ca52 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -280,7 +280,7 @@ inline std::basic_ostream & operator 
<<(std::basic_ostream(rType) << ")";
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - extras/source starmath/inc starmath/qa starmath/source starmath/uiconfig

2019-06-18 Thread Takeshi Abe (via logerrit)
 extras/source/truetype/symbol/OpenSymbol.sfd|   25 
 starmath/inc/node.hxx   |2 -
 starmath/inc/strings.hrc|2 +
 starmath/inc/strings.hxx|2 +
 starmath/inc/token.hxx  |4 ++-
 starmath/inc/types.hxx  |1 
 starmath/qa/cppunit/test_nodetotextvisitors.cxx |2 +
 starmath/source/ElementsDockingWindow.cxx   |4 ++-
 starmath/source/mathmlexport.cxx|1 
 starmath/source/mathtype.cxx|2 +
 starmath/source/node.cxx|3 ++
 starmath/source/ooxmlexport.cxx |1 
 starmath/source/ooxmlimport.cxx |3 ++
 starmath/source/parse.cxx   |3 ++
 starmath/source/rtfexport.cxx   |1 
 starmath/uiconfig/smath/popupmenu/edit.xml  |2 +
 16 files changed, 51 insertions(+), 7 deletions(-)

New commits:
commit 528a1e8b1a2b26cf75e714145aea897079c02409
Author: Takeshi Abe 
AuthorDate: Mon May 27 00:12:28 2019 +0900
Commit: Xisco Faulí 
CommitDate: Tue Jun 18 14:07:13 2019 +0200

tdf#120047 Support attribute harpoon/wideharpoon in Math

... for an alternative style of vectors.

They are vec/widevec analogs but with COMBINING RIGHT HARPOON ABOVE
(U+20D1).  The new attribute names are deliberately long in order to
make fewer accidental collisions with variable names in formulae of
exising documents.

This also adds a glyph uni20D1 to OpenSymbol.

Change-Id: I31666e57808aa0e0327500916d3b862549891886
Reviewed-on: https://gerrit.libreoffice.org/72987
Tested-by: Jenkins
Reviewed-by: Takeshi Abe 
(cherry picked from commit 93eeaf0ad902214fb6b4205606b24046a458ee45)
Reviewed-on: https://gerrit.libreoffice.org/74251
Reviewed-by: Xisco Faulí 

diff --git a/extras/source/truetype/symbol/OpenSymbol.sfd 
b/extras/source/truetype/symbol/OpenSymbol.sfd
index 35d4b01328b9..c9e9baad1707 100644
--- a/extras/source/truetype/symbol/OpenSymbol.sfd
+++ b/extras/source/truetype/symbol/OpenSymbol.sfd
@@ -3,8 +3,8 @@ FontName: OpenSymbol
 FullName: OpenSymbol
 FamilyName: OpenSymbol
 Weight: Book
-Copyright: (c) 2009 Sun Microsystems Inc.\nTHERE DOES NOT EXIST (c) 2011 
Julien Nabet\nPRECEDES <-> DOES NOT SUCCEED (c) 2011 Olivier Hallot\nPRIME <-> 
TRIPLE PRIME (c) 2013 Mathias Hasselmann\nphi <-> phi1 (c) 2015 Khaled 
Hosny\n(c) 2016 Mike Kaganski\nzero, one, two, three, four, five, six, seven, 
eight, nine, question, underscore, copyright, registered, uni2215, angle, 
therefore, lozenge (c) 2010 Google Corporation
-Version: 102.10
+Copyright: (c) 2009 Sun Microsystems Inc.\nTHERE DOES NOT EXIST (c) 2011 
Julien Nabet\nPRECEDES <-> DOES NOT SUCCEED (c) 2011 Olivier Hallot\nPRIME <-> 
TRIPLE PRIME (c) 2013 Mathias Hasselmann\nphi <-> phi1 (c) 2015 Khaled 
Hosny\n(c) 2016 Mike Kaganski\nzero, one, two, three, four, five, six, seven, 
eight, nine, question, underscore, copyright, registered, uni2215, angle, 
therefore, lozenge (c) 2010 Google Corporation\nuni20D1 (c) 2019 Takeshi Abe
+Version: 102.11
 ItalicAngle: 0
 UnderlinePosition: -143
 UnderlineWidth: 20
@@ -20,7 +20,7 @@ OS2Version: 0
 OS2_WeightWidthSlopeOnly: 0
 OS2_UseTypoMetrics: 1
 CreationTime: 1144938807
-ModificationTime: 1479754802
+ModificationTime: 1558881510
 PfmFamily: 81
 TTFWeight: 400
 TTFWidth: 5
@@ -784,7 +784,7 @@ FitToEm: 1
 WinInfo: 0 34 12
 BeginPrivate: 0
 EndPrivate
-BeginChars: 1052 1052
+BeginChars: 1053 1053
 
 StartChar: Alpha
 Encoding: 0 913 0
@@ -108707,5 +108707,22 @@ SplineSet
  508 1286 l 1,6,-1
 EndSplineSet
 EndChar
+
+StartChar: uni20D1
+Encoding: 1052 8401 1052
+Width: 1056
+Flags: W
+HStem: 1313 112<98 686>
+LayerCount: 2
+Fore
+SplineSet
+98 1313 m 1,0,-1
+ 98 1425 l 1,1,-1
+ 686 1425 l 1,2,-1
+ 645 1575 l 1,3,-1
+ 1026 1313 l 1,4,-1
+ 98 1313 l 1,0,-1
+EndSplineSet
+EndChar
 EndChars
 EndSplineFont
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index da67e9bdece6..73bfb17132c9 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -1019,7 +1019,7 @@ public:
 /** Attribute node
  *
  * Used to give an attribute to another node. Used for commands such as:
- * UNDERLINE, OVERLINE, OVERSTRIKE, WIDEVEC, WIDEHAT and WIDETILDE.
+ * UNDERLINE, OVERLINE, OVERSTRIKE, WIDEVEC, WIDEHARPOON, WIDEHAT and 
WIDETILDE.
  *
  * Children:
  * 0: Attribute
diff --git a/starmath/inc/strings.hrc b/starmath/inc/strings.hrc
index eec600990ba0..f12677d26eca 100644
--- a/starmath/inc/strings.hrc
+++ b/starmath/inc/strings.hrc
@@ -165,6 +165,7 @@
 #define RID_HATX_HELP   NC_("RID_HATX_HELP", "Circumflex" )
 #define RID_TILDEX_HELP NC_("RID_TILDEX_HELP", "Tilde" )
 #define RID_VECX_HELP   NC_("RID_VECX_HELP", &quo

[Libreoffice-commits] core.git: extras/source starmath/inc starmath/qa starmath/source starmath/uiconfig

2019-06-12 Thread Takeshi Abe (via logerrit)
 extras/source/truetype/symbol/OpenSymbol.sfd|   25 
 starmath/inc/node.hxx   |2 -
 starmath/inc/strings.hrc|2 +
 starmath/inc/strings.hxx|2 +
 starmath/inc/token.hxx  |4 ++-
 starmath/inc/types.hxx  |1 
 starmath/qa/cppunit/test_nodetotextvisitors.cxx |2 +
 starmath/source/ElementsDockingWindow.cxx   |4 ++-
 starmath/source/mathmlexport.cxx|1 
 starmath/source/mathtype.cxx|2 +
 starmath/source/node.cxx|3 ++
 starmath/source/ooxmlexport.cxx |1 
 starmath/source/ooxmlimport.cxx |3 ++
 starmath/source/parse.cxx   |3 ++
 starmath/source/rtfexport.cxx   |1 
 starmath/uiconfig/smath/popupmenu/edit.xml  |2 +
 16 files changed, 51 insertions(+), 7 deletions(-)

New commits:
commit 93eeaf0ad902214fb6b4205606b24046a458ee45
Author: Takeshi Abe 
AuthorDate: Mon May 27 00:12:28 2019 +0900
Commit: Takeshi Abe 
CommitDate: Thu Jun 13 05:11:25 2019 +0200

tdf#120047 Support attribute harpoon/wideharpoon in Math

... for an alternative style of vectors.

They are vec/widevec analogs but with COMBINING RIGHT HARPOON ABOVE
(U+20D1).  The new attribute names are deliberately long in order to
make fewer accidental collisions with variable names in formulae of
exising documents.

This also adds a glyph uni20D1 to OpenSymbol.

Change-Id: I31666e57808aa0e0327500916d3b862549891886
Reviewed-on: https://gerrit.libreoffice.org/72987
Tested-by: Jenkins
Reviewed-by: Takeshi Abe 

diff --git a/extras/source/truetype/symbol/OpenSymbol.sfd 
b/extras/source/truetype/symbol/OpenSymbol.sfd
index 35d4b01328b9..c9e9baad1707 100644
--- a/extras/source/truetype/symbol/OpenSymbol.sfd
+++ b/extras/source/truetype/symbol/OpenSymbol.sfd
@@ -3,8 +3,8 @@ FontName: OpenSymbol
 FullName: OpenSymbol
 FamilyName: OpenSymbol
 Weight: Book
-Copyright: (c) 2009 Sun Microsystems Inc.\nTHERE DOES NOT EXIST (c) 2011 
Julien Nabet\nPRECEDES <-> DOES NOT SUCCEED (c) 2011 Olivier Hallot\nPRIME <-> 
TRIPLE PRIME (c) 2013 Mathias Hasselmann\nphi <-> phi1 (c) 2015 Khaled 
Hosny\n(c) 2016 Mike Kaganski\nzero, one, two, three, four, five, six, seven, 
eight, nine, question, underscore, copyright, registered, uni2215, angle, 
therefore, lozenge (c) 2010 Google Corporation
-Version: 102.10
+Copyright: (c) 2009 Sun Microsystems Inc.\nTHERE DOES NOT EXIST (c) 2011 
Julien Nabet\nPRECEDES <-> DOES NOT SUCCEED (c) 2011 Olivier Hallot\nPRIME <-> 
TRIPLE PRIME (c) 2013 Mathias Hasselmann\nphi <-> phi1 (c) 2015 Khaled 
Hosny\n(c) 2016 Mike Kaganski\nzero, one, two, three, four, five, six, seven, 
eight, nine, question, underscore, copyright, registered, uni2215, angle, 
therefore, lozenge (c) 2010 Google Corporation\nuni20D1 (c) 2019 Takeshi Abe
+Version: 102.11
 ItalicAngle: 0
 UnderlinePosition: -143
 UnderlineWidth: 20
@@ -20,7 +20,7 @@ OS2Version: 0
 OS2_WeightWidthSlopeOnly: 0
 OS2_UseTypoMetrics: 1
 CreationTime: 1144938807
-ModificationTime: 1479754802
+ModificationTime: 1558881510
 PfmFamily: 81
 TTFWeight: 400
 TTFWidth: 5
@@ -784,7 +784,7 @@ FitToEm: 1
 WinInfo: 0 34 12
 BeginPrivate: 0
 EndPrivate
-BeginChars: 1052 1052
+BeginChars: 1053 1053
 
 StartChar: Alpha
 Encoding: 0 913 0
@@ -108707,5 +108707,22 @@ SplineSet
  508 1286 l 1,6,-1
 EndSplineSet
 EndChar
+
+StartChar: uni20D1
+Encoding: 1052 8401 1052
+Width: 1056
+Flags: W
+HStem: 1313 112<98 686>
+LayerCount: 2
+Fore
+SplineSet
+98 1313 m 1,0,-1
+ 98 1425 l 1,1,-1
+ 686 1425 l 1,2,-1
+ 645 1575 l 1,3,-1
+ 1026 1313 l 1,4,-1
+ 98 1313 l 1,0,-1
+EndSplineSet
+EndChar
 EndChars
 EndSplineFont
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index da67e9bdece6..73bfb17132c9 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -1019,7 +1019,7 @@ public:
 /** Attribute node
  *
  * Used to give an attribute to another node. Used for commands such as:
- * UNDERLINE, OVERLINE, OVERSTRIKE, WIDEVEC, WIDEHAT and WIDETILDE.
+ * UNDERLINE, OVERLINE, OVERSTRIKE, WIDEVEC, WIDEHARPOON, WIDEHAT and 
WIDETILDE.
  *
  * Children:
  * 0: Attribute
diff --git a/starmath/inc/strings.hrc b/starmath/inc/strings.hrc
index eec600990ba0..f12677d26eca 100644
--- a/starmath/inc/strings.hrc
+++ b/starmath/inc/strings.hrc
@@ -165,6 +165,7 @@
 #define RID_HATX_HELP   NC_("RID_HATX_HELP", "Circumflex" )
 #define RID_TILDEX_HELP NC_("RID_TILDEX_HELP", "Tilde" )
 #define RID_VECX_HELP   NC_("RID_VECX_HELP", "Vector 
Arrow" )
+#define RID_HARPOONX_HELP   NC_("RID_HARPOONX_HELP", "Harpoon" 
)
 #define RID_U

Re: tdf#120047 Support attribute harpoon/wideharpoon in Math

2019-06-03 Thread Takeshi Abe
Hi Regina,

On Sun, 2 Jun 2019 15:20:21 +0200, Regina Henschel  
wrote:
> With the new font file installed, the two harpoon commands results in 
> correctly
> rendered harpoon symbols in Math formulas now.
Great.

> 
> I have tested the new glyph in ordinary text too. I have looked, how it is
> placed in other fonts. The solutions vary. "STIX Two Text" puts it over the
> character, so that the next character has the same place as if no combined
> character is before. "Segoe UI Symbol" puts it half to the right and the next
> character tight, so that the harpoon goes into the next character. "Arial
> Unicode MS" and "Cambria" puts it entire on the right side and the next
> character after the harpoon. That is the same as I see it in OpenSymbol. So 
> now
> reason to object.
> 
> What is needed, that the new OpenSymbol font is generated during the
> build-process?
If you have FontForge (fontforge in PATH) installed, autogen.sh will find it
given --enable-build-opensymbol option, which has been introduced recently:
<https://gerrit.libreoffice.org/#/c/54938/>, and the .ttf will be built.

> The export to MathML is OK, import from pure MathML works too.
> 
> Tooltips and texts in context menu are OK. But the text in section 
> "Attributes"
> in the help needs to be updated. So in case you do not write it yourself, 
> please
> add the bug to the "depends on" list in Meta-bug 120200, when your commit your
> patch.
Right, I will file an issue once merged.

> 
> So for me it looks usable.
> 
> In the long term, I would prefer to get a general solution for the MathML
> attributes 'accent' and 'stretchy'. But because no one is working on it, I
> support to solve this special request in the way you suggest.
I agree with your preference for a general solution, and admit that my patch
is just a one-more-pile thing.

Thank you very much for your throughly inspection.

Cheers,
-- Takeshi Abe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: tdf#120047 Support attribute harpoon/wideharpoon in Math

2019-06-03 Thread Takeshi Abe
Hi Regina,

(I have sent the following message last sunday, but the mailing list put it down
due to the size limit exceeded with attached files.  Retrying the same but with
links instead.)

Thank you for checking the changeset.

On Sat, 1 Jun 2019 17:53:10 +0200, Regina Henschel  
wrote:
> Hi Takeshi,
> 
> can you please provide the changed OpenSymbol font? For example attach it to 
> the
> bug report?
Uploaded opens___.ttf to bugzilla generated from the modified OpenSymbol.sfd.
I have given --enable-build-opensymbol to configure to build it on macOS.

> 
> Currently the symbol is not only the harpoon, but the placeholder dotted 
> circle
> in addition, see attachment.
I see.  I am not sure why, but I do have observed that combining the harpoon/vec
symbol can produce some awkward layout when using a different font for 
variables,
etc.  Although it is not exactly what you faced, for example, see attached
screenshots [1][2];  they differs only with respect to the font chosen for
variables, however in the bad one the symbols are too close to their underlying
glyphs.

[1] https://www.fixedpoint.jp/libreoffice/20190602/vec-harpoon-good.png
[2] https://www.fixedpoint.jp/libreoffice/20190602/vec-harpoon-bad.png

Cheers,
-- Takeshi Abe

> 
> I would like to test it with your version of the font.
> 
> Kind regards
> Regina
> 
> Takeshi Abe schrieb am 01-Jun-19 um 03:36:
>> Hi,
>> To solve tdf#120047 [1], I am going to add a couple of new attributes
>> harpoon/wideharpoon to the starmath command syntax [2].
>> At the same time the patch introduces a new glyph to OpenSymbol font
>> to make sure that the harpoon symbol (U+20D1) has the consistent width
>> with COMBINING RIGHT ARROW ABOVE (U+20D7), which is the one shown
>> as the arrow for attributes vec/widevec so far.
>> Review and suggestions are highly appreciated.
>> [1] https://bugs.documentfoundation.org/show_bug.cgi?id=120047
>> [2] https://gerrit.libreoffice.org/#/c/72987/
>> Cheers,
>> -- Takeshi Abe
>> ___
>> LibreOffice mailing list
>> LibreOffice@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/libreoffice
>> 
> 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

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

2019-06-01 Thread Takeshi Abe (via logerrit)
 cui/source/dialogs/about.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit df67a9ae9c1e9f3e21b1674deb4036f61eced05c
Author: Takeshi Abe 
AuthorDate: Thu May 30 23:56:25 2019 +0900
Commit: Xisco Faulí 
CommitDate: Sat Jun 1 19:58:36 2019 +0200

tdf#124936 Show "(x86)" in About dialog on the 32-bit version

... installed on Windows.

Change-Id: I2a4d846265b69f0e46e4c711430689ce39d60fcd
Reviewed-on: https://gerrit.libreoffice.org/73211
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 
(cherry picked from commit 932c1bd99f4b99705c3948d0babaa1f4160f37c3)
Reviewed-on: https://gerrit.libreoffice.org/73313
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index a99a814d28e1..2059ac7f10c3 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -304,6 +304,8 @@ OUString AboutDialog::GetVersionString()
 
 #ifdef _WIN64
 sVersion += " (x64)";
+#elif defined(_WIN32)
+sVersion += " (x86)";
 #endif
 
 OUString sBuildId = GetBuildId();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

tdf#120047 Support attribute harpoon/wideharpoon in Math

2019-05-31 Thread Takeshi Abe
Hi,

To solve tdf#120047 [1], I am going to add a couple of new attributes
harpoon/wideharpoon to the starmath command syntax [2].
At the same time the patch introduces a new glyph to OpenSymbol font
to make sure that the harpoon symbol (U+20D1) has the consistent width
with COMBINING RIGHT ARROW ABOVE (U+20D7), which is the one shown
as the arrow for attributes vec/widevec so far.
Review and suggestions are highly appreciated.

[1] https://bugs.documentfoundation.org/show_bug.cgi?id=120047
[2] https://gerrit.libreoffice.org/#/c/72987/

Cheers,
-- Takeshi Abe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

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

2019-05-31 Thread Takeshi Abe (via logerrit)
 cui/source/dialogs/about.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 932c1bd99f4b99705c3948d0babaa1f4160f37c3
Author: Takeshi Abe 
AuthorDate: Thu May 30 23:56:25 2019 +0900
Commit: Michael Stahl 
CommitDate: Fri May 31 11:29:35 2019 +0200

tdf#124936 Show "(x86)" in About dialog on the 32-bit version

... installed on Windows.

Change-Id: I2a4d846265b69f0e46e4c711430689ce39d60fcd
Reviewed-on: https://gerrit.libreoffice.org/73211
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 7d5266682144..cdafad532c2c 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -313,6 +313,8 @@ OUString AboutDialog::GetVersionString()
 
 #ifdef _WIN64
 sVersion += " (x64)";
+#elif defined(_WIN32)
+sVersion += " (x86)";
 #endif
 
 OUString sBuildId = GetBuildId();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-05-15 Thread Takeshi Abe (via logerrit)
 scp2/source/ooo/folderitem_ooo.scp |2 +-
 scp2/source/ooo/folderitem_ooo.ulf |3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 5fbd5c9ba97a7ecacebc6bcc582a36dd1631a5b3
Author: Takeshi Abe 
AuthorDate: Mon May 13 10:32:05 2019 +0900
Commit: Andras Timar 
CommitDate: Wed May 15 12:38:30 2019 +0200

tdf#116431 Make the string "LibreOffice (Safe Mode)" translatable

Change-Id: I29f68f16c228c46841a7a3a50bb6dfe4f703403f
Reviewed-on: https://gerrit.libreoffice.org/72212
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/scp2/source/ooo/folderitem_ooo.scp 
b/scp2/source/ooo/folderitem_ooo.scp
index 2e67a6a6aea0..a9f68ffd3dea 100644
--- a/scp2/source/ooo/folderitem_ooo.scp
+++ b/scp2/source/ooo/folderitem_ooo.scp
@@ -67,7 +67,7 @@ FolderItemProperty gid_Fip_Soffice_Desktop_AppID
 End
 
 FolderItem gid_Folderitem_LibreOffice_SafeMode
-Name = "%PRODUCTNAME (Safe Mode)";
+ALL_LANG(Name, STR_FI_NAME_SAFEMODE);
 ModuleID = gid_Module_Root;
 #ifdef ENABLE_SILENT_MSI
 FolderID = PREDEFINED_STARTMENU;
diff --git a/scp2/source/ooo/folderitem_ooo.ulf 
b/scp2/source/ooo/folderitem_ooo.ulf
index 4295c5a2f0b2..22f8a37f7981 100644
--- a/scp2/source/ooo/folderitem_ooo.ulf
+++ b/scp2/source/ooo/folderitem_ooo.ulf
@@ -22,5 +22,8 @@ en-US = "From Template"
 [STR_FI_NAME_OPENDOCUMENT]
 en-US = "Open Document"
 
+[STR_FI_NAME_SAFEMODE]
+en-US = "%PRODUCTNAME (Safe Mode)"
+
 [STR_FI_TOOLTIP_SOFFICE]
 en-US = "LibreOffice, the office productivity suite provided by The Document 
Foundation. See https://www.documentfoundation.org";
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-13 Thread Takeshi Abe (via logerrit)
 shell/source/backends/desktopbe/desktopbackend.cxx |   21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

New commits:
commit 64381dad01132f74e513c347db87f304d0e704ff
Author: Takeshi Abe 
AuthorDate: Thu Mar 28 19:04:30 2019 +0900
Commit: Caolán McNamara 
CommitDate: Sat Apr 13 21:44:18 2019 +0200

tdf#119890 followup: Forbid HOME to be the default dir

... of user templates

This is kludgy yet better than making innocent users waiting for
the template dialog ~forever as pointed out in the comments in
<https://gerrit.libreoffice.org/#/c/67741/>.

Change-Id: I6dfdc0408effb06cc9175cd976ea6687e52a7136
Reviewed-on: https://gerrit.libreoffice.org/70709
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx 
b/shell/source/backends/desktopbe/desktopbackend.cxx
index 5923c6583fb7..4b1d0c44b182 100644
--- a/shell/source/backends/desktopbe/desktopbackend.cxx
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -127,7 +127,7 @@ void Default::setPropertyValue(OUString const &, 
css::uno::Any const &)
 static_cast< cppu::OWeakObject * >(this), -1);
 }
 
-OUString xdg_user_dir_lookup (const char *type)
+OUString xdg_user_dir_lookup (const char *type, bool bAllowHomeDir)
 {
 size_t nLenType = strlen(type);
 char *config_home;
@@ -218,16 +218,20 @@ OUString xdg_user_dir_lookup (const char *type)
 if (aUserDirBuf.getLength()>0 && !bError)
 {
 aDocumentsDirURL = aUserDirBuf.makeStringAndClear();
-osl::Directory aDocumentsDir( aDocumentsDirURL );
-if( osl::FileBase::E_None == aDocumentsDir.open() )
-return aDocumentsDirURL;
+if ( bAllowHomeDir ||
+ (aDocumentsDirURL != aHomeDirURL && aDocumentsDirURL != 
aHomeDirURL + "/") )
+{
+osl::Directory aDocumentsDir( aDocumentsDirURL );
+if( osl::FileBase::E_None == aDocumentsDir.open() )
+return aDocumentsDirURL;
+}
 }
 /* Use fallbacks historical compatibility if nothing else exists */
 return aHomeDirURL + "/" + OUString::createFromAscii(type);
 }
 
-css::uno::Any xdgDirectoryIfExists(char const * type) {
-auto url = xdg_user_dir_lookup(type);
+css::uno::Any xdgDirectoryIfExists(char const * type, bool bAllowHomeDir) {
+auto url = xdg_user_dir_lookup(type, bAllowHomeDir);
 return css::uno::Any(
 osl::Directory(url).open() == osl::FileBase::E_None
 ? css::beans::Optional(true, css::uno::Any(url))
@@ -238,12 +242,13 @@ css::uno::Any Default::getPropertyValue(OUString const & 
PropertyName)
 {
 if (PropertyName == "TemplatePathVariable")
 {
-return xdgDirectoryIfExists("Templates");
+// Never pick up the HOME directory as the default location of user's 
templates
+return xdgDirectoryIfExists("Templates", false);
 }
 
 if (PropertyName == "WorkPathVariable")
 {
-return xdgDirectoryIfExists("Documents");
+return xdgDirectoryIfExists("Documents", true);
 }
 
 if ( PropertyName == "EnableATToolSupport" ||
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-13 Thread Takeshi Abe (via logerrit)
 shell/source/backends/desktopbe/desktopbackend.cxx |   21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

New commits:
commit 88d46ba32e4a03d848d82210071c42208e0d6eca
Author: Takeshi Abe 
AuthorDate: Thu Mar 28 19:04:30 2019 +0900
Commit: Caolán McNamara 
CommitDate: Sat Apr 13 14:59:48 2019 +0200

tdf#119890 followup: Forbid HOME to be the default dir

... of user templates

This is kludgy yet better than making innocent users waiting for
the template dialog ~forever as pointed out in the comments in
<https://gerrit.libreoffice.org/#/c/67741/>.

Change-Id: I6dfdc0408effb06cc9175cd976ea6687e52a7136
Reviewed-on: https://gerrit.libreoffice.org/69883
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx 
b/shell/source/backends/desktopbe/desktopbackend.cxx
index 4f3c2940869b..14b22b033fb1 100644
--- a/shell/source/backends/desktopbe/desktopbackend.cxx
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -127,7 +127,7 @@ void Default::setPropertyValue(OUString const &, 
css::uno::Any const &)
 static_cast< cppu::OWeakObject * >(this), -1);
 }
 
-OUString xdg_user_dir_lookup (const char *type)
+OUString xdg_user_dir_lookup (const char *type, bool bAllowHomeDir)
 {
 size_t nLenType = strlen(type);
 char *config_home;
@@ -218,16 +218,20 @@ OUString xdg_user_dir_lookup (const char *type)
 if (aUserDirBuf.getLength()>0 && !bError)
 {
 aDocumentsDirURL = aUserDirBuf.makeStringAndClear();
-osl::Directory aDocumentsDir( aDocumentsDirURL );
-if( osl::FileBase::E_None == aDocumentsDir.open() )
-return aDocumentsDirURL;
+if ( bAllowHomeDir ||
+ (aDocumentsDirURL != aHomeDirURL && aDocumentsDirURL != 
aHomeDirURL + "/") )
+{
+osl::Directory aDocumentsDir( aDocumentsDirURL );
+if( osl::FileBase::E_None == aDocumentsDir.open() )
+return aDocumentsDirURL;
+}
 }
 /* Use fallbacks historical compatibility if nothing else exists */
 return aHomeDirURL + "/" + OUString::createFromAscii(type);
 }
 
-css::uno::Any xdgDirectoryIfExists(char const * type) {
-auto url = xdg_user_dir_lookup(type);
+css::uno::Any xdgDirectoryIfExists(char const * type, bool bAllowHomeDir) {
+auto url = xdg_user_dir_lookup(type, bAllowHomeDir);
 return css::uno::Any(
 osl::Directory(url).open() == osl::FileBase::E_None
 ? css::beans::Optional(true, css::uno::Any(url))
@@ -238,12 +242,13 @@ css::uno::Any Default::getPropertyValue(OUString const & 
PropertyName)
 {
 if (PropertyName == "TemplatePathVariable")
 {
-return xdgDirectoryIfExists("Templates");
+// Never pick up the HOME directory as the default location of user's 
templates
+return xdgDirectoryIfExists("Templates", false);
 }
 
 if (PropertyName == "WorkPathVariable")
 {
-return xdgDirectoryIfExists("Documents");
+return xdgDirectoryIfExists("Documents", true);
 }
 
 if ( PropertyName == "EnableATToolSupport" ||
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-12 Thread Takeshi Abe (via logerrit)
 filter/source/msfilter/svdfppt.cxx  |6 +-
 include/filter/msfilter/svdfppt.hxx |3 +--
 2 files changed, 2 insertions(+), 7 deletions(-)

New commits:
commit 03b3562a91c54e0c1b77982e1ca391b1131ac3c2
Author: Takeshi Abe 
AuthorDate: Wed Mar 13 00:10:20 2019 +0900
Commit: Noel Grandin 
CommitDate: Fri Apr 12 10:49:10 2019 +0200

filter: inline PptFontCollection to avoid inheritance of std::vector

Change-Id: Ib431f6f69dc3da958629f54d6d2a1ce76b9d63a5
Reviewed-on: https://gerrit.libreoffice.org/69108
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index 69597b3a8b05..7b4e365cfd69 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -461,10 +461,6 @@ SvStream& ReadPptFontEntityAtom( SvStream& rIn, 
PptFontEntityAtom& rAtom )
 return rIn;
 }
 
-class PptFontCollection : public 
std::vector>
-{
-};
-
 SvStream& ReadPptUserEditAtom( SvStream& rIn, PptUserEditAtom& rAtom )
 {
 sal_Int16 lastViewType = 0;
@@ -2163,7 +2159,7 @@ bool SdrPowerPointImport::ReadFontCollection()
 {
 bRet = true;
 if (!m_pFonts)
-m_pFonts.reset( new PptFontCollection );
+m_pFonts.reset( new 
std::vector> );
 std::unique_ptr pFont(new 
PptFontEntityAtom);
 ReadPptFontEntityAtom( rStCtrl, *pFont );
 
diff --git a/include/filter/msfilter/svdfppt.hxx 
b/include/filter/msfilter/svdfppt.hxx
index f907cc01d40e..66be39501c79 100644
--- a/include/filter/msfilter/svdfppt.hxx
+++ b/include/filter/msfilter/svdfppt.hxx
@@ -281,7 +281,6 @@ struct PptFontEntityAtom
 friend SvStream& ReadPptFontEntityAtom(SvStream& rIn, PptFontEntityAtom& 
rAtom);
 };
 
-class PptFontCollection;
 enum class PptViewTypeEnum : sal_uInt16
 {
 NONE = 0,
@@ -463,7 +462,7 @@ protected:
 
 ::std::vector< PPTOleEntry > aOleObjectList;
 
-std::unique_ptr m_pFonts;
+std::unique_ptr>> m_pFonts;
 
 sal_uInt32  nStreamLen;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-03 Thread Takeshi Abe (via logerrit)
 i18npool/source/calendar/calendar_gregorian.cxx |2 +-
 i18npool/source/localedata/data/ja_JP.xml   |8 +++-
 svl/source/numbers/zformat.cxx  |2 +-
 3 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 970b34a83fcec4feed79418cfb4a9246acb1648a
Author: Takeshi Abe 
AuthorDate: Mon Apr 1 11:44:32 2019 +0900
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Apr 3 16:28:06 2019 +0200

Introduce next Japanese gengou era 'Reiwa'

starting from 2019-05-01, which has been announced officially.

This fills the provisional slot acknowledged at
cacbb0faef77ae8462de9ff5c7307a6a2e28b2bb.

Change-Id: Ifb12e6afaad4c66d455f664b46ec946e80324e87
Reviewed-on: https://gerrit.libreoffice.org/70157
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 70bfc2174cd5ac6678ecd43b0d325398e0320a03)
Reviewed-on: https://gerrit.libreoffice.org/70184
Reviewed-by: Xisco Faulí 
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/i18npool/source/calendar/calendar_gregorian.cxx 
b/i18npool/source/calendar/calendar_gregorian.cxx
index b8f1d15ee66f..cc15c9c40f6e 100644
--- a/i18npool/source/calendar/calendar_gregorian.cxx
+++ b/i18npool/source/calendar/calendar_gregorian.cxx
@@ -209,7 +209,7 @@ static const Era gengou_eraArray[] = {
 {1912,  7, 30, 0},  // Taisho
 {1926, 12, 25, 0},  // Showa
 {1989,  1,  8, 0},  // Heisei
-{2019,  5,  1, 0},  //(Naruhito) (TODO: real era name not known yet 
(2018-07-26))
+{2019,  5,  1, 0},  // Reiwa
 {0, 0, 0, 0}
 };
 Calendar_gengou::Calendar_gengou() : Calendar_gregorian(gengou_eraArray)
diff --git a/i18npool/source/localedata/data/ja_JP.xml 
b/i18npool/source/localedata/data/ja_JP.xml
index fe4c247485f9..c15c665f2eab 100644
--- a/i18npool/source/localedata/data/ja_JP.xml
+++ b/i18npool/source/localedata/data/ja_JP.xml
@@ -481,11 +481,9 @@
   平成
 
 
-  
-  Naruhito
-  Na
-  Naruhito
+  Reiwa
+  令
+  令和
 
   
   
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index bad3b224089c..eb96820c9892 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -3454,7 +3454,7 @@ void SvNumberformat::ImpAppendEraG( OUStringBuffer& 
OutString,
 cEra = 'H';
 break;
 case 5:
-cEra = 'N'; /* TODO: the real one letter era name is not known 
yet (2018-07-26) */
+cEra = 'R';
 break;
 default:
 cEra = '?';
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-03 Thread Takeshi Abe (via logerrit)
 i18npool/source/calendar/calendar_gregorian.cxx |2 +-
 i18npool/source/localedata/data/ja_JP.xml   |8 +++-
 svl/source/numbers/zformat.cxx  |2 +-
 3 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 70bfc2174cd5ac6678ecd43b0d325398e0320a03
Author: Takeshi Abe 
AuthorDate: Mon Apr 1 11:44:32 2019 +0900
Commit: Eike Rathke 
CommitDate: Wed Apr 3 11:19:04 2019 +0200

Introduce next Japanese gengou era 'Reiwa'

starting from 2019-05-01, which has been announced officially.

This fills the provisional slot acknowledged at
cacbb0faef77ae8462de9ff5c7307a6a2e28b2bb.

Change-Id: Ifb12e6afaad4c66d455f664b46ec946e80324e87
Reviewed-on: https://gerrit.libreoffice.org/70157
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/i18npool/source/calendar/calendar_gregorian.cxx 
b/i18npool/source/calendar/calendar_gregorian.cxx
index b8f1d15ee66f..cc15c9c40f6e 100644
--- a/i18npool/source/calendar/calendar_gregorian.cxx
+++ b/i18npool/source/calendar/calendar_gregorian.cxx
@@ -209,7 +209,7 @@ static const Era gengou_eraArray[] = {
 {1912,  7, 30, 0},  // Taisho
 {1926, 12, 25, 0},  // Showa
 {1989,  1,  8, 0},  // Heisei
-{2019,  5,  1, 0},  //(Naruhito) (TODO: real era name not known yet 
(2018-07-26))
+{2019,  5,  1, 0},  // Reiwa
 {0, 0, 0, 0}
 };
 Calendar_gengou::Calendar_gengou() : Calendar_gregorian(gengou_eraArray)
diff --git a/i18npool/source/localedata/data/ja_JP.xml 
b/i18npool/source/localedata/data/ja_JP.xml
index fe4c247485f9..c15c665f2eab 100644
--- a/i18npool/source/localedata/data/ja_JP.xml
+++ b/i18npool/source/localedata/data/ja_JP.xml
@@ -481,11 +481,9 @@
   平成
 
 
-  
-  Naruhito
-  Na
-  Naruhito
+  Reiwa
+  令
+  令和
 
   
   
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index bad3b224089c..eb96820c9892 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -3454,7 +3454,7 @@ void SvNumberformat::ImpAppendEraG( OUStringBuffer& 
OutString,
 cEra = 'H';
 break;
 case 5:
-cEra = 'N'; /* TODO: the real one letter era name is not known 
yet (2018-07-26) */
+cEra = 'R';
 break;
 default:
 cEra = '?';
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-02 Thread Takeshi Abe (via logerrit)
 i18npool/source/calendar/calendar_gregorian.cxx |2 +-
 i18npool/source/localedata/data/ja_JP.xml   |8 +++-
 svl/source/numbers/zformat.cxx  |2 +-
 3 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 597c5d75b8e72d429e096535334eaac7973455ef
Author: Takeshi Abe 
AuthorDate: Mon Apr 1 11:44:32 2019 +0900
Commit: Eike Rathke 
CommitDate: Tue Apr 2 22:54:49 2019 +0200

Introduce next Japanese gengou era 'Reiwa'

starting from 2019-05-01, which has been announced officially.

This fills the provisional slot acknowledged at
cacbb0faef77ae8462de9ff5c7307a6a2e28b2bb.

Change-Id: Ifb12e6afaad4c66d455f664b46ec946e80324e87
Reviewed-on: https://gerrit.libreoffice.org/70028
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/i18npool/source/calendar/calendar_gregorian.cxx 
b/i18npool/source/calendar/calendar_gregorian.cxx
index 4e4a14dc0079..662c84b897c9 100644
--- a/i18npool/source/calendar/calendar_gregorian.cxx
+++ b/i18npool/source/calendar/calendar_gregorian.cxx
@@ -209,7 +209,7 @@ static const Era gengou_eraArray[] = {
 {1912,  7, 30, 0},  // Taisho
 {1926, 12, 25, 0},  // Showa
 {1989,  1,  8, 0},  // Heisei
-{2019,  5,  1, 0},  //(Naruhito) (TODO: real era name not known yet 
(2018-07-26))
+{2019,  5,  1, 0},  // Reiwa
 {0, 0, 0, 0}
 };
 Calendar_gengou::Calendar_gengou() : Calendar_gregorian(gengou_eraArray)
diff --git a/i18npool/source/localedata/data/ja_JP.xml 
b/i18npool/source/localedata/data/ja_JP.xml
index fe4c247485f9..c15c665f2eab 100644
--- a/i18npool/source/localedata/data/ja_JP.xml
+++ b/i18npool/source/localedata/data/ja_JP.xml
@@ -481,11 +481,9 @@
   平成
 
 
-  
-  Naruhito
-  Na
-  Naruhito
+  Reiwa
+  令
+  令和
 
   
   
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index db066e136c06..daa9791dba3c 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -3476,7 +3476,7 @@ void SvNumberformat::ImpAppendEraG( OUStringBuffer& 
OutString,
 cEra = 'H';
 break;
 case 5:
-cEra = 'N'; /* TODO: the real one letter era name is not known 
yet (2018-07-26) */
+cEra = 'R';
 break;
 default:
 cEra = '?';
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Re: Call for suggestion to a patch for tdf#114311

2019-03-29 Thread Takeshi Abe
Hi Andras,

Thanks a lot for your reply.

On Fri, 29 Mar 2019 13:20:27 +0100, Andras Timar  wrote:
> Hi,
(snip)
> I merged your patch to master, thank you. Do not worry about translations,
> the new string will be automatically extracted by l10ntools. It's a normal
> to add new translatable strings to master.
OK, great to know that.

Cheers,
-- Takeshi Abe

> 
> Best regards,
> Andras Timar
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

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

2019-03-29 Thread Takeshi Abe (via logerrit)
 scp2/source/ooo/registryitem_ooo.scp |2 +-
 scp2/source/ooo/registryitem_ooo.ulf |3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 9c607b61f4e66c78b0c36802a1dcc997bf39e307
Author: Takeshi Abe 
AuthorDate: Mon Feb 25 17:25:30 2019 +0900
Commit: Andras Timar 
CommitDate: Fri Mar 29 13:18:03 2019 +0100

tdf#114311 Translate "LibreOffice Extension" file type in Windows

Change-Id: I5e2f222449424d4a6498d8566f13aca7f07c0c51
Reviewed-on: https://gerrit.libreoffice.org/68303
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/scp2/source/ooo/registryitem_ooo.scp 
b/scp2/source/ooo/registryitem_ooo.scp
index ed93d2816100..9a7998ace432 100644
--- a/scp2/source/ooo/registryitem_ooo.scp
+++ b/scp2/source/ooo/registryitem_ooo.scp
@@ -573,7 +573,7 @@ RegistryItem gid_Regitem_Office_Extension_1
 ParentID = PREDEFINED_HKEY_CLASSES_ROOT;
 ModuleID = gid_Module_Root;
 Subkey = "office.Extension.1";
-Value = "%PRODUCTNAME Extension";
+REG_VALUE_LNG(EXTENSION)
 Styles = ();
 End
 
diff --git a/scp2/source/ooo/registryitem_ooo.ulf 
b/scp2/source/ooo/registryitem_ooo.ulf
index 8c073488f0e5..c07b641a0e0b 100644
--- a/scp2/source/ooo/registryitem_ooo.ulf
+++ b/scp2/source/ooo/registryitem_ooo.ulf
@@ -22,5 +22,8 @@ en-US = "&Install"
 [STR_REG_VAL_SO60_CONFIGFILE]
 en-US = "%PRODUCTNAME Configuration File"
 
+[STR_REG_VAL_EXTENSION]
+en-US = "%PRODUCTNAME Extension"
+
 [STR_REG_VAL_APPCAPABILITY_DESCRIPTION_OOO]
 en-US = "LibreOffice"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Call for suggestion to a patch for tdf#114311

2019-03-29 Thread Takeshi Abe
Hi,

Having uploaded a patch [1] for tdf#114311 a month ago, I would like
to ask developers who are familiar with Windows installation to check
it.  At least I have confirmed that it works on a Windows 10.

It would be necessary to tweak the translations submodule simultaneously
to complete the fix, because a newly introduced string is to be translated.
I have little idea about how to proceed with such a case, though.

[1] https://gerrit.libreoffice.org/#/c/68303/

Cheers,
-- Takeshi Abe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: When file truncation happens by Basic's Open statement

2018-12-21 Thread Takeshi Abe
Hi Andrew,

On Fri, 21 Dec 2018 14:51:12 -0500, "Andrew Pitonyak"  
wrote:
> 
> I evaluated the behavior from Basic for all of the different modes based on a 
> specific build on a specific Linux platform. I did not read the code, nor did 
> I test different platforms. I documented all of this in OOME on my web site. 
> Don't remember the direct link, but, it is on http://www.pitonyak.org under 
> my macros page. 
I always admire your OOME book.  It's a precious resource for learning
Basic.
Anyway for resolving tdf#119102 we will need not only information
about observed behavior of Open statement but also its consistent spec.

Cheers,
-- Takeshi Abe

> 
> I also loop at a few other methods for opening files using a service that 
> might be useful to you. 
> 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: When file truncation happens by Basic's Open statement

2018-12-21 Thread Takeshi Abe
Hi Mike,

On Fri, 21 Dec 2018 19:15:40 +, Kaganski Mike  
wrote:
> 
> On 21.12.2018 20:37, Takeshi Abe wrote:
(snip)
>> "X": the runtime deletes the file of given path first if already exists;
>> "-": it does not.
>> (*)  requested in i#18638 <https://bz.apache.org/ooo/show_bug.cgi?id=18638>;
>>   see commit 23b49669ab70cac72d5f6d955e7d2af617e6934e.
>> (**) requested in i#61277 <https://bz.apache.org/ooo/show_bug.cgi?id=61277>;
>>   see commit 42a63dd0e81f13a84a5f551e03ede685e2bf34c7.
(snip)
> Cannot answer the questions; just for completeness, something you could 
> already know:
> 
> the current handling of BINARY opened for write was defined in commit 
> 23b49669ab70cac72d5f6d955e7d2af617e6934e [1] for #i18638 [2].
> 
> [1] 
> https://git.libreoffice.org/core/+/23b49669ab70cac72d5f6d955e7d2af617e6934e%5E%21/
> [2] https://bz.apache.org/ooo/show_bug.cgi?id=18638
Sure, that's exactly remarked as (*) in my message.

Cheers,
-- Takeshi Abe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


When file truncation happens by Basic's Open statement

2018-12-21 Thread Takeshi Abe
Hi,

In order to tell whether the behavior reported in tdf#119102 [1] is a bug
or not, I would like to understand the specification of LibO Basic's Open
statement [2].

The following table summarizes what current (master) LibO does, which I read
from SbiStream::Open() in basic/source/runtime/iosys.cxx.

  ACCESS\FOR  | APPEND | BINARY | INPUT | OUTPUT | RANDOM |
--+++---+++
   default|   -|   -|   -   |   X|   -|
 READ  ("read only")  |   -|   -|   -   |   -|   -|
 WRITE ("write only") |   -|  -(*)  |   X   |   X|  -(**) |
 READ WRITE ("both")  |   -|  -(*)  |   X   |   X|  -(**) |

"X": the runtime deletes the file of given path first if already exists;
"-": it does not.
(*)  requested in i#18638 <https://bz.apache.org/ooo/show_bug.cgi?id=18638>;
 see commit 23b49669ab70cac72d5f6d955e7d2af617e6934e.
(**) requested in i#61277 <https://bz.apache.org/ooo/show_bug.cgi?id=61277>;
 see commit 42a63dd0e81f13a84a5f551e03ede685e2bf34c7.

So here is a couple of questions popping up on a confused soul:

(1) What does the default ACCESS mode mean?
Is it just the same as READ, WRITE, or READ WRITE?
Or does it depends on given FOR mode?

(2) Does 'FOR INPUT + ACCESS WRITE' or 'FOR OUTPUT + ACCESS READ' make
any sense?

Thank you for your attention.

[1] https://bugs.documentfoundation.org/show_bug.cgi?id=119102
[2] https://help.libreoffice.org/Basic/Open_Statement_Runtime

Cheers,
-- Takeshi Abe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2018-07-11 Thread Takeshi Abe
 sc/inc/chgtrack.hxx  |6 +++---
 sc/source/core/tool/chgtrack.cxx |   34 +-
 2 files changed, 16 insertions(+), 24 deletions(-)

New commits:
commit bd71dccb2644257000cf6481c50af1f10f4d63c5
Author: Takeshi Abe 
Date:   Mon Jul 9 21:31:42 2018 +0900

sc: Prefer std::vector to std::deque or std::stack

as the queue is modified only by either appending or clear().

Change-Id: I6866c047eaf7149221c77ff4f1f3759dbf10492e
Reviewed-on: https://gerrit.libreoffice.org/57182
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx
index a23744c53a08..ef7a237645c2 100644
--- a/sc/inc/chgtrack.hxx
+++ b/sc/inc/chgtrack.hxx
@@ -20,11 +20,11 @@
 #ifndef INCLUDED_SC_INC_CHGTRACK_HXX
 #define INCLUDED_SC_INC_CHGTRACK_HXX
 
-#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -827,8 +827,8 @@ struct ScChangeTrackMsgInfo
 };
 
 // MsgQueue for notification via ModifiedLink
-typedef std::deque ScChangeTrackMsgQueue;
-typedef std::stack ScChangeTrackMsgStack;
+typedef std::vector ScChangeTrackMsgQueue;
+typedef std::vector ScChangeTrackMsgStack;
 typedef std::map ScChangeActionMap;
 
 enum ScChangeTrackMergeState
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index 29fffe7561e8..35c1d72dbe64 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -45,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -2163,16 +2164,10 @@ void ScChangeTrack::ClearMsgQueue()
 delete pBlockModifyMsg;
 pBlockModifyMsg = nullptr;
 }
-while ( !aMsgStackTmp.empty() )
-{
-delete aMsgStackTmp.top();
-aMsgStackTmp.pop();
-}
-while ( !aMsgStackFinal.empty() )
-{
-delete aMsgStackFinal.top();
-aMsgStackFinal.pop();
-}
+std::for_each(aMsgStackTmp.rbegin(), aMsgStackTmp.rend(), 
std::default_delete());
+aMsgStackTmp.clear();
+std::for_each(aMsgStackFinal.rbegin(), aMsgStackFinal.rend(), 
std::default_delete());
+aMsgStackFinal.clear();
 
 ScChangeTrackMsgQueue::iterator itQueue;
 for ( itQueue = aMsgQueue.begin(); itQueue != aMsgQueue.end(); ++itQueue)
@@ -2279,7 +2274,7 @@ void ScChangeTrack::StartBlockModify( 
ScChangeTrackMsgType eMsgType,
 if ( aModifiedLink.IsSet() )
 {
 if ( pBlockModifyMsg )
-aMsgStackTmp.push( pBlockModifyMsg ); // Block in Block
+aMsgStackTmp.push_back( pBlockModifyMsg ); // Block in Block
 pBlockModifyMsg = new ScChangeTrackMsgInfo;
 pBlockModifyMsg->eMsgType = eMsgType;
 pBlockModifyMsg->nStartAction = nStartAction;
@@ -2296,7 +2291,7 @@ void ScChangeTrack::EndBlockModify( sal_uLong nEndAction )
 {
 pBlockModifyMsg->nEndAction = nEndAction;
 // Blocks dissolved in Blocks
-aMsgStackFinal.push( pBlockModifyMsg );
+aMsgStackFinal.push_back( pBlockModifyMsg );
 }
 else
 delete pBlockModifyMsg;
@@ -2304,19 +2299,16 @@ void ScChangeTrack::EndBlockModify( sal_uLong 
nEndAction )
 pBlockModifyMsg = nullptr;
 else
 {
-pBlockModifyMsg = aMsgStackTmp.top(); // Maybe Block in Block
-aMsgStackTmp.pop();
+pBlockModifyMsg = aMsgStackTmp.back(); // Maybe Block in Block
+aMsgStackTmp.pop_back();
 }
 }
 if ( !pBlockModifyMsg )
 {
-bool bNew = false;
-while ( !aMsgStackFinal.empty() )
-{
-aMsgQueue.push_back( aMsgStackFinal.top() );
-aMsgStackFinal.pop();
-bNew = true;
-}
+bool bNew = !aMsgStackFinal.empty();
+aMsgQueue.reserve(aMsgQueue.size() + aMsgStackFinal.size());
+aMsgQueue.insert(aMsgQueue.end(), aMsgStackFinal.rbegin(), 
aMsgStackFinal.rend());
+aMsgStackFinal.clear();
 if ( bNew )
 aModifiedLink.Call( *this );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-05 Thread Takeshi Abe
 sc/source/core/data/formulacell.cxx |   17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 7e971b500f164cf07728cc128f63b50d9e56f909
Author: Takeshi Abe 
Date:   Thu Jul 5 18:09:07 2018 +0900

sc: Prefer std::vector to std::deque

There seems no need for choosing deque in the first place
5099046dccb69af04e2a3adafad8e06c0832bd06.

Change-Id: I194e6bee37d8f6f177aee96681b3014119aa11c1
Reviewed-on: https://gerrit.libreoffice.org/56997
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 9d697e2a4e6b..96aabc5ae07c 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -75,6 +75,7 @@
 
 #include 
 #include 
+#include 
 
 using namespace formula;
 
@@ -230,8 +231,6 @@ namespace {
 // Allow for a year's calendar (366).
 const sal_uInt16 MAXRECURSION = 400;
 
-using std::deque;
-
 typedef SCCOLROW(*DimensionSelector)(const ScAddress&, const ScSingleRefData&);
 
 SCCOLROW lcl_GetCol(const ScAddress& rPos, const ScSingleRefData& rData)
@@ -286,11 +285,11 @@ lcl_checkRangeDimensions(
 bool
 lcl_checkRangeDimensions(
 const ScAddress& rPos,
-const deque::const_iterator& rBegin,
-const deque::const_iterator& rEnd,
+const std::vector::const_iterator& rBegin,
+const std::vector::const_iterator& rEnd,
 bool& bCol, bool& bRow, bool& bTab)
 {
-deque::const_iterator aCur(rBegin);
+std::vector::const_iterator aCur(rBegin);
 ++aCur;
 const SingleDoubleRefProvider aRef(**rBegin);
 bool bOk(false);
@@ -351,7 +350,7 @@ public:
 
 bool
 lcl_checkIfAdjacent(
-const ScAddress& rPos, const deque& rReferences, 
const DimensionSelector aWhich)
+const ScAddress& rPos, const std::vector& 
rReferences, const DimensionSelector aWhich)
 {
 auto aBegin(rReferences.cbegin());
 auto aEnd(rReferences.cend());
@@ -363,7 +362,7 @@ lcl_checkIfAdjacent(
 
 void
 lcl_fillRangeFromRefList(
-const ScAddress& aPos, const deque& rReferences, 
ScRange& rRange)
+const ScAddress& aPos, const std::vector& 
rReferences, ScRange& rRange)
 {
 const ScSingleRefData aStart(
 SingleDoubleRefProvider(*rReferences.front()).Ref1);
@@ -375,7 +374,7 @@ lcl_fillRangeFromRefList(
 
 bool
 lcl_refListFormsOneRange(
-const ScAddress& rPos, deque& rReferences,
+const ScAddress& rPos, std::vector& 
rReferences,
 ScRange& rRange)
 {
 if (rReferences.size() == 1)
@@ -2977,7 +2976,7 @@ 
ScFormulaCell::HasRefListExpressibleAsOneReference(ScRange& rRange) const
 {
 // Collect all consecutive references, starting by the one
 // already found
-std::deque aReferences;
+std::vector aReferences;
 aReferences.push_back(pFirstReference);
 FormulaToken* pToken(aIter.NextRPN());
 FormulaToken* pFunction(nullptr);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-03 Thread Takeshi Abe
 sc/source/core/data/bcaslot.cxx |   12 
 1 file changed, 12 deletions(-)

New commits:
commit de7e83969b60ab6d78e501a16a069a786746f022
Author: Takeshi Abe 
Date:   Tue Jul 3 16:18:13 2018 +0900

sc: Eliminate the case of MAXROWCOUNT_DEFINE <= 65536

It is 1024*1024 since b3579d71c6536ab1d03cc47249d582a574fd054a.

Change-Id: I7f523f21229de8f4fa378aa85f124863a67b21c8
Reviewed-on: https://gerrit.libreoffice.org/56843
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index 8ee5a1e6587a..c0d08a3c1deb 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -39,13 +39,8 @@
 // Number of slots per dimension
 // must be integer divisors of MAXCOLCOUNT respectively MAXROWCOUNT
 #define BCA_SLOTS_COL ((MAXCOLCOUNT_DEFINE) / 16)
-#if MAXROWCOUNT_DEFINE == 32000
-#define BCA_SLOTS_ROW 256
-#define BCA_SLICE 125
-#else
 #define BCA_SLICE 128
 #define BCA_SLOTS_ROW ((MAXROWCOUNT_DEFINE) / BCA_SLICE)
-#endif
 #define BCA_SLOT_COLS ((MAXCOLCOUNT_DEFINE) / BCA_SLOTS_COL)
 #define BCA_SLOT_ROWS ((MAXROWCOUNT_DEFINE) / BCA_SLOTS_ROW)
 // multiple?
@@ -74,12 +69,6 @@ struct ScSlotData
 ScSlotData( SCROW r1, SCROW r2, SCSIZE s, SCSIZE c ) : nStartRow(r1), 
nStopRow(r2), nSlice(s), nCumulated(c) {}
 };
 typedef ::std::vector< ScSlotData > ScSlotDistribution;
-#if MAXROWCOUNT_DEFINE <= 65536
-// Linear distribution.
-static ScSlotDistribution aSlotDistribution( ScSlotData( 0, MAXROWCOUNT, 
BCA_SLOT_ROWS, 0));
-static SCSIZE nBcaSlotsRow = BCA_SLOTS_ROW;
-static SCSIZE nBcaSlots = BCA_SLOTS_DEFINE;
-#else
 // Logarithmic or any other distribution.
 // Upper sheet part usually is more populated and referenced and gets fine
 // grained resolution, larger data in larger hunks.
@@ -107,7 +96,6 @@ static ScSlotDistribution aSlotDistribution;
 static SCSIZE nBcaSlotsRow;
 static SCSIZE nBcaSlots = initSlotDistribution( aSlotDistribution, 
nBcaSlotsRow) * BCA_SLOTS_COL;
 // Ensure that all static variables are initialized with this one call.
-#endif
 
 ScBroadcastArea::ScBroadcastArea( const ScRange& rRange ) :
 pUpdateChainNext(nullptr),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-03 Thread Takeshi Abe
 sc/source/core/tool/interpr3.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit e46df81b679cbb44235e891c81e8b30ae50b31d4
Author: Takeshi Abe 
Date:   Mon Jun 11 13:18:31 2018 +0900

sc: A micro optimization of PERCENTILE() for interpolation cases

As the leading std::nth_element() already partitions the vector,
all we have to do is to pick the minimum in its latter part.

Change-Id: I7767edc538819251c8fe9d26441ae57b06b2f865
Reviewed-on: https://gerrit.libreoffice.org/55575
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index d85d1a561073..78756b0810e8 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -3406,8 +3406,7 @@ double ScInterpreter::GetPercentile( vector & 
rArray, double fPercentile
 {
 OSL_ENSURE(nIndex < nSize-1, "GetPercentile: wrong index(2)");
 double fVal = *iter;
-iter = rArray.begin() + nIndex+1;
-::std::nth_element( rArray.begin(), iter, rArray.end());
+iter = ::std::min_element( rArray.begin() + nIndex + 1, 
rArray.end());
 return fVal + fDiff * (*iter - fVal);
 }
 }
@@ -3438,8 +3437,7 @@ double ScInterpreter::GetPercentileExclusive( 
vector & rArray, double fP
 {
 OSL_ENSURE(nIndex < nSize1, "GetPercentile: wrong index(2)");
 double fVal = *iter;
-iter = rArray.begin() + nIndex + 1;
-::std::nth_element( rArray.begin(), iter, rArray.end());
+iter = ::std::min_element( rArray.begin() + nIndex + 1, rArray.end());
 return fVal + fDiff * (*iter - fVal);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-01 Thread Takeshi Abe
 scaddins/source/analysis/analysishelper.hxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 123a4808dca73f99bb80413d3a2eb23d232a9b2e
Author: Takeshi Abe 
Date:   Wed Jun 27 19:13:44 2018 +0900

scaddins: Drop unused stuff

Change-Id: Icdbb297df55ed5984b4008e304a41df89a996334
Reviewed-on: https://gerrit.libreoffice.org/56523
Tested-by: Jenkins
Reviewed-by: Takeshi Abe 

diff --git a/scaddins/source/analysis/analysishelper.hxx 
b/scaddins/source/analysis/analysishelper.hxx
index a5c7270dc9cd..85dc1eb65ccb 100644
--- a/scaddins/source/analysis/analysishelper.hxx
+++ b/scaddins/source/analysis/analysishelper.hxx
@@ -39,13 +39,10 @@
 
 namespace sca { namespace analysis {
 
-class SortedIndividualInt32List;
 class ScaAnyConverter;
 
 
 #define PI  3.1415926535897932
-#define EOL ( ( const sal_Char* ) 1 )
-#define EOE ( ( const sal_Char* ) 2 )
 
 
 inline bool IsLeapYear( sal_uInt16 nYear );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-01 Thread Takeshi Abe
 sc/source/core/tool/interpr2.cxx |7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

New commits:
commit d6aa070267f95fbcc6024ca42b8473ef08df81c7
Author: Takeshi Abe 
Date:   Thu Jun 28 17:44:42 2018 +0900

sc: Replace DblMin() with std::min()

Change-Id: Ic9ca0e9c1a63519026152f9aa1a038f183de1e4d
Reviewed-on: https://gerrit.libreoffice.org/56581
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 7846d0d162b6..682867b8ef18 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -1781,11 +1781,6 @@ double ScInterpreter::ScInterVDB(double fCost, double 
fSalvage, double fLife,
 return fVdb;
 }
 
-inline double DblMin( double a, double b )
-{
-return (a < b) ? a : b;
-}
-
 void ScInterpreter::ScVDB()
 {
 nFuncFmtType = SvNumFormatType::CURRENCY;
@@ -1826,7 +1821,7 @@ void ScInterpreter::ScVDB()
 
 //respect partial period in the Beginning/ End:
 if ( i == nLoopStart+1 )
-fTerm *= ( DblMin( fEnd, fIntStart + 1.0 ) - fStart );
+fTerm *= ( std::min( fEnd, fIntStart + 1.0 ) - fStart 
);
 else if ( i == nLoopEnd )
 fTerm *= ( fEnd + 1.0 - fIntEnd );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-30 Thread Takeshi Abe
 sc/source/ui/app/inputhdl.cxx |   15 ++-
 1 file changed, 2 insertions(+), 13 deletions(-)

New commits:
commit 658ff424b8f4a95a3327ee9081bdfd3664c6a85f
Author: Takeshi Abe 
Date:   Sat Jun 30 21:19:29 2018 +0900

sc: Spare an OUStringBuffer by replacing removeChars()

... with OUString::replace().

Change-Id: I8d6ae6ff1674dafaafb276cb0efc72e01579f9bb
Reviewed-on: https://gerrit.libreoffice.org/56759
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index d8ab78fe524e..742eadf257a6 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -279,17 +279,6 @@ ScTypedCaseStrSet::const_iterator findTextAll(
 return rDataSet.end(); // no matching text found
 }
 
-void removeChars(OUString& rStr, sal_Unicode c)
-{
-OUStringBuffer aBuf(rStr);
-for (sal_Int32 i = 0, n = aBuf.getLength(); i < n; ++i)
-{
-if (aBuf[i] == c)
-aBuf[i] = ' ';
-}
-rStr = aBuf.makeStringAndClear();
-}
-
 }
 
 void ScInputHandler::InitRangeFinder( const OUString& rFormula )
@@ -497,13 +486,13 @@ inline OUString GetEditText(const EditEngine* pEng)
 
 static void lcl_RemoveTabs(OUString& rStr)
 {
-removeChars(rStr, '\t');
+rStr = rStr.replace('\t', ' ');
 }
 
 static void lcl_RemoveLineEnd(OUString& rStr)
 {
 rStr = convertLineEnd(rStr, LINEEND_LF);
-removeChars(rStr, '\n');
+rStr = rStr.replace('\n', ' ');
 }
 
 static sal_Int32 lcl_MatchParenthesis( const OUString& rStr, sal_Int32 nPos )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-23 Thread Takeshi Abe
 sd/source/ui/animations/CustomAnimationPane.cxx |4 ++--
 sd/source/ui/view/viewshel.cxx  |7 +++
 2 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit b42c316fcf36f478c4d4685c5d2294e079310693
Author: Takeshi Abe 
Date:   Sun Jun 24 11:59:51 2018 +0900

sd: Reduce the number of possible intermediate allocations

... by reserving enough space at once.

As the length of these vectors depends/grows on user's input,
this change can be a micro optimization.

Change-Id: I1baa7d1433875491e86403d727f11f676d29a833
Reviewed-on: https://gerrit.libreoffice.org/56346
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx 
b/sd/source/ui/animations/CustomAnimationPane.cxx
index 44987fcaa791..2421d51ec461 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -1778,8 +1778,8 @@ void CustomAnimationPane::onAdd()
 maViewSelection >>= xShapes;
 
 sal_Int32 nCount = xShapes->getCount();
-sal_Int32 nIndex;
-for( nIndex = 0; nIndex < nCount; nIndex++ )
+aTargets.reserve( nCount );
+for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
 {
 Any aTarget( xShapes->getByIndex( nIndex ) );
 aTargets.push_back( aTarget );
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index be1c561a096a..93f3fcc85684 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -1168,7 +1168,7 @@ void ViewShell::ImpGetUndoStrings(SfxItemSet &rSet) const
 {
 // prepare list
 std::vector aStringList;
-
+aStringList.reserve(nCount);
 for (sal_uInt16 a = 0; a < nCount; ++a)
 {
 // generate one String in list per undo step
@@ -1195,9 +1195,8 @@ void ViewShell::ImpGetRedoStrings(SfxItemSet &rSet) const
 {
 // prepare list
 ::std::vector< OUString > aStringList;
-sal_uInt16 a;
-
-for( a = 0; a < nCount; a++)
+aStringList.reserve(nCount);
+for(sal_uInt16 a = 0; a < nCount; a++)
 // generate one String in list per undo step
 aStringList.push_back( pUndoManager->GetRedoActionComment(a) );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-23 Thread Takeshi Abe
 sccomp/source/solver/CoinMPSolver.cxx  |1 +
 sccomp/source/solver/DifferentialEvolution.hxx |1 +
 sccomp/source/solver/LpsolveSolver.cxx |1 +
 sccomp/source/solver/ParticelSwarmOptimization.hxx |1 +
 4 files changed, 4 insertions(+)

New commits:
commit 578e4eca82132ddbb9475409d0b1a982f61da816
Author: Takeshi Abe 
Date:   Sat Jun 23 11:39:47 2018 +0900

sccomp: Reserve enough space at once for micro-optimization

Change-Id: Ib4e178d2a0f09cb44854f1d1aad026d8394a8917
Reviewed-on: https://gerrit.libreoffice.org/56312
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/sccomp/source/solver/CoinMPSolver.cxx 
b/sccomp/source/solver/CoinMPSolver.cxx
index 2b1ddd7227d7..23426e140e42 100644
--- a/sccomp/source/solver/CoinMPSolver.cxx
+++ b/sccomp/source/solver/CoinMPSolver.cxx
@@ -63,6 +63,7 @@ void SAL_CALL CoinMPSolver::solve()
 // collect variables in vector (?)
 
 std::vector aVariableCells;
+aVariableCells.reserve(maVariables.getLength());
 for (sal_Int32 nPos=0; nPos aVariableCells;
+aVariableCells.reserve(maVariables.getLength());
 for (sal_Int32 nPos=0; nPos::lowest();
 
+maSwarm.reserve(mnNumOfParticles);
 for (size_t i = 0; i < mnNumOfParticles; i++)
 {
 maSwarm.emplace_back(mnDimensionality);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-21 Thread Takeshi Abe
 sw/source/core/crsr/viscrs.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 39180f706f0c30771d55e065fca2e36d2c7bb7c7
Author: Takeshi Abe 
Date:   Thu Jun 21 22:20:04 2018 +0900

sw: Allocate enough space at once for micro optimization

Change-Id: Ibcf95f2ddeb7b0a9f08944d760beb40f2d8ae688
Reviewed-on: https://gerrit.libreoffice.org/56237
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index b11db04d393f..f52f96e017ad 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -335,7 +335,7 @@ void SwSelPaintRects::Show(std::vector* 
pSelectionRectangles)
 #if HAVE_FEATURE_DESKTOP
 // get new rects
 std::vector< basegfx::B2DRange > aNewRanges;
-
+aNewRanges.reserve(size());
 for(size_type a = 0; a < size(); ++a)
 {
 const SwRect aNextRect((*this)[a]);
@@ -414,6 +414,7 @@ void SwSelPaintRects::Show(std::vector* 
pSelectionRectangles)
 }
 
 std::vector aRect;
+aRect.reserve(size());
 for (size_type i = 0; i < size(); ++i)
 {
 const SwRect& rRect = (*this)[i];
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-17 Thread Takeshi Abe
 sw/source/core/doc/acmplwrd.cxx |   22 ++
 1 file changed, 6 insertions(+), 16 deletions(-)

New commits:
commit c37b27af9195d4c5861676a3d5d5173e3476d3bc
Author: Takeshi Abe 
Date:   Sun Jun 17 19:20:00 2018 +0900

sw: Avoid unnecessary copy in SwAutoCompleteWord::GetWordsMatching()

Its sole client code in sw/source/uibase/docvw/edtwin.cxx allows the
precondition that its 2nd argument rWords is empty.

This also corrects the @param description of the argument.

Change-Id: Icc12bc36d0d4157ed05ef10fb3c3db325c6bfaf2
Reviewed-on: https://gerrit.libreoffice.org/55943
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index 5ccdc9859398..75f683bec8bf 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 class SwAutoCompleteClient : public SwClient
@@ -346,24 +347,13 @@ void SwAutoCompleteWord::SetMinWordLen( sal_uInt16 n )
 /** Return all words matching a given prefix
  *
  *  @param aMatch the prefix to search for
- *  @param aWords the words to search in
+ *  @param rWords the words found matching
  */
-bool SwAutoCompleteWord::GetWordsMatching(const OUString& aMatch, 
std::vector& aWords) const
+bool SwAutoCompleteWord::GetWordsMatching(const OUString& aMatch, 
std::vector& rWords) const
 {
-std::vector suggestions;
-m_LookupTree.findSuggestions(aMatch, suggestions);
-
-if (suggestions.empty())
-{
-return false;
-}
-
-for (const OUString & suggestion : suggestions)
-{
-aWords.push_back( suggestion );
-}
-
-return true;
+assert(rWords.empty());
+m_LookupTree.findSuggestions(aMatch, rWords);
+return !rWords.empty();
 }
 
 void SwAutoCompleteWord::CheckChangedList(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-15 Thread Takeshi Abe
 sc/source/core/data/formulacell.cxx|2 +-
 sc/source/core/inc/arraysumfunctor.hxx |2 +-
 sc/source/core/tool/formulagroup.cxx   |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 615c269325e476c5994ec46029b5928a8064ed78
Author: Takeshi Abe 
Date:   Thu Jun 14 18:24:26 2018 +0900

sc: These booleans are constant

Change-Id: Ib5098cc38ca9fecfcf2d57e59573253b714f2df4
Reviewed-on: https://gerrit.libreoffice.org/55785
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 40f5cbbd3ba6..4aca388c2f6e 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -4425,7 +4425,7 @@ bool ScFormulaCell::InterpretFormulaGroup()
 return false;
 }
 
-static bool bHyperThreadingActive = tools::cpuid::hasHyperThreading();
+const static bool bHyperThreadingActive = 
tools::cpuid::hasHyperThreading();
 
 // Then do the threaded calculation
 
diff --git a/sc/source/core/inc/arraysumfunctor.hxx 
b/sc/source/core/inc/arraysumfunctor.hxx
index 13f69d9cf62a..86f346f89834 100644
--- a/sc/source/core/inc/arraysumfunctor.hxx
+++ b/sc/source/core/inc/arraysumfunctor.hxx
@@ -43,7 +43,7 @@ public:
 
 double operator() ()
 {
-static bool hasSSE2 = tools::cpuid::hasSSE2();
+const static bool hasSSE2 = tools::cpuid::hasSSE2();
 
 double fSum = 0.0;
 size_t i = 0;
diff --git a/sc/source/core/tool/formulagroup.cxx 
b/sc/source/core/tool/formulagroup.cxx
index b494d25d1146..a000b641d322 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -337,7 +337,7 @@ bool FormulaGroupInterpreterSoftware::interpret(ScDocument& 
rDoc, const ScAddres
 // The caller must ensure that the top position is the start position of
 // the group.
 
-static bool bHyperThreadingActive = tools::cpuid::hasHyperThreading();
+const static bool bHyperThreadingActive = 
tools::cpuid::hasHyperThreading();
 ScAddress aTmpPos = rTopPos;
 std::vector aResults(xGroup->mnLength);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-11 Thread Takeshi Abe
 sc/source/core/tool/interpr3.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit d17e8faa13b1f8d943b602aa6ea754c1b22fdd76
Author: Takeshi Abe 
Date:   Fri Jun 1 12:40:11 2018 +0900

sc: Make ZTEST() raise #DIV/0! when the sample stddev is 0

because it is an actual division-by-zero error and Excel does.

Call for suggestion: I would like to add a test case to
sc/qa/unit/data/functions/statistical/fods/ztest.fods, but
do not know the right manner of adding it cleanly without
messing up other parts such as styles.

Change-Id: I79b99a6b7385177e94d75bb4e00d724332b9b8bf
Reviewed-on: https://gerrit.libreoffice.org/55152
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index a43ec7835193..8c433bab587c 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -2560,6 +2560,11 @@ void ScInterpreter::ScZTest()
 if (nParamCount != 3)
 {
 sigma = (fSumSqr - fSum*fSum/rValCount)/(rValCount-1.0);
+if (sigma == 0.0)
+{
+PushError(FormulaError::DivisionByZero);
+return;
+}
 PushDouble(0.5 - gauss((mue-x)/sqrt(sigma/rValCount)));
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-11 Thread Takeshi Abe
 sc/inc/editutil.hxx  |6 ++
 sc/source/core/tool/editutil.cxx |8 +++-
 sc/source/ui/inc/preview.hxx |3 +--
 sc/source/ui/inc/printfun.hxx|2 +-
 sc/source/ui/view/preview.cxx|   10 +++---
 sc/source/ui/view/printfun.cxx   |7 +++
 6 files changed, 13 insertions(+), 23 deletions(-)

New commits:
commit 9804cc4eff4c5899abdc5309eeb019eb6ec1bf46
Author: Takeshi Abe 
Date:   Wed May 9 18:30:15 2018 +0900

sc: ScHeaderFieldData always stores a datetime

It does not change only the date part nor the time part
separately, thus holding single DateTime is sufficient.

Change-Id: Ic619608ce7a961287c299698b9a004cbf7038702
Reviewed-on: https://gerrit.libreoffice.org/54058
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/sc/inc/editutil.hxx b/sc/inc/editutil.hxx
index 6aac49e77f51..a446b5cb385c 100644
--- a/sc/inc/editutil.hxx
+++ b/sc/inc/editutil.hxx
@@ -25,8 +25,7 @@
 #include "types.hxx"
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -190,8 +189,7 @@ struct ScHeaderFieldData
 OUStringaLongDocName;   // path and file name
 OUStringaShortDocName;  // pure file name
 OUStringaTabName;
-DateaDate;
-tools::Time aTime;
+DateTimeaDateTime;
 longnPageNo;
 longnTotalPages;
 SvxNumType  eNumType;
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index c475411fa371..bdadc8f64693 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -783,9 +783,7 @@ static OUString lcl_GetNumStr(sal_Int32 nNo, SvxNumType 
eType)
 }
 
 ScHeaderFieldData::ScHeaderFieldData()
-:
-aDate( Date::EMPTY ),
-aTime( tools::Time::EMPTY )
+: aDateTime ( DateTime::EMPTY )
 {
 nPageNo = nTotalPages = 0;
 eNumType = SVX_NUM_ARABIC;
@@ -817,7 +815,7 @@ OUString ScHeaderEditEngine::CalcFieldValue( const 
SvxFieldItem& rField,
 case text::textfield::Type::EXTENDED_TIME:
 case text::textfield::Type::TIME:
 // For now, time field in the header / footer is always dynamic.
-aRet = ScGlobal::pLocaleData->getTime(aData.aTime);
+aRet = ScGlobal::pLocaleData->getTime(aData.aDateTime);
 break;
 case text::textfield::Type::DOCINFO_TITLE:
 aRet = aData.aTitle;
@@ -838,7 +836,7 @@ OUString ScHeaderEditEngine::CalcFieldValue( const 
SvxFieldItem& rField,
 aRet = aData.aTabName;
 break;
 case text::textfield::Type::DATE:
-aRet = ScGlobal::pLocaleData->getDate(aData.aDate);
+aRet = ScGlobal::pLocaleData->getDate(aData.aDateTime);
 break;
 default:
 aRet = "?";
diff --git a/sc/source/ui/inc/preview.hxx b/sc/source/ui/inc/preview.hxx
index 54e8d04c4f22..a43002c545ae 100644
--- a/sc/source/ui/inc/preview.hxx
+++ b/sc/source/ui/inc/preview.hxx
@@ -47,8 +47,7 @@ private:
 longnTabPage;   // Page of sheet
 longnTabStart;  // First (real) page of the sheet
 longnDisplayStart;  // same as above, relative to the 
start of counting
-DateaDate;
-tools::Time aTime;
+DateTimeaDateTime;
 longnTotalPages;
 SizeaPageSize;  // for GetOptimalZoom
 ScPrintStateaState;
diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx
index 2df47432c89a..d96fb277b788 100644
--- a/sc/source/ui/inc/printfun.hxx
+++ b/sc/source/ui/inc/printfun.hxx
@@ -303,7 +303,7 @@ public:
 
 voidSetOffset( const Point& rOfs );
 voidSetManualZoom( sal_uInt16 nNewZoom );
-voidSetDateTime( const Date& rDate, const tools::Time& rTime );
+voidSetDateTime( const DateTime& );
 
 voidSetClearFlag( bool bFlag );
 voidSetUseStyleColor( bool bFlag );
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 6f1602da97c7..b709cf1a3d12 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -96,8 +96,7 @@ ScPreview::ScPreview( vcl::Window* pParent, ScDocShell* 
pDocSh, ScPreviewShell*
 nTabPage( 0 ),
 nTabStart( 0 ),
 nDisplayStart( 0 ),
-aDate( Date::SYSTEM ),
-aTime( tools::Time::SYSTEM ),
+aDateTime( DateTime::SYSTEM ),
 nTotalPages( 0 ),
 pLocationData( nullptr ),
 pDrawView( nullptr ),
@@ -401,7 +400,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* 
pFillLocation )
 
 pPrintFunc->SetOffset(aOffset);
 pPrintFunc->SetManualZoom(nZoom);
-pPrintFunc->SetDateTime(aDate,aTime);
+pPrintFunc->SetDateTime(aDateTime);
 pPrintFunc->SetClearFlag(true);
 pPrintFunc->SetUseStyleColor( 
pScMod-

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

2018-06-07 Thread Takeshi Abe
 sc/source/core/tool/interpr3.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit d155f7af035e0fd818340c1affe41d3b6e97b502
Author: Takeshi Abe 
Date:   Wed Jun 6 19:05:01 2018 +0900

sc: A putative micro optimization of MEDIAN() for even-length arrays

As the previous run of std::nth_element() already collects all of
smaller elements than the upper median into the first half of the
vector (which may also contain an equal one to the upper median,
that's OK), we can safely ignore the later half for finding the lower
median.

Change-Id: I64c97ee03b02ea363399077244dd99d0d10defcb
Reviewed-on: https://gerrit.libreoffice.org/55370
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index b52a62fd3d20..a43ec7835193 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -3374,8 +3374,7 @@ double ScInterpreter::GetMedian( vector & rArray )
 {
 double fUp = *iMid;
 // Lower median.
-iMid = rArray.begin() + nMid - 1;
-::std::nth_element( rArray.begin(), iMid, rArray.end());
+iMid = ::std::max_element( rArray.begin(), rArray.begin() + nMid);
 return (fUp + *iMid) / 2;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-05 Thread Takeshi Abe
 sc/source/core/tool/interpr7.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit db042b2a59a713c37f568f7721b9546a353a964f
Author: Takeshi Abe 
Date:   Mon Jun 4 18:33:49 2018 +0900

sc: Stop pushing an extra error

as MustHaveParamCount() already does it when returning false.

Change-Id: Ia4f8998a2f65eea5e6be3fd21b5ca724d13770d0
Reviewed-on: https://gerrit.libreoffice.org/55265
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
index 274bb69e5243..cdd0991978e4 100644
--- a/sc/source/core/tool/interpr7.cxx
+++ b/sc/source/core/tool/interpr7.cxx
@@ -429,10 +429,7 @@ void ScInterpreter::ScDebugVar()
 }
 
 if (!MustHaveParamCount(GetByte(), 1))
-{
-PushIllegalParameter();
 return;
-}
 
 rtl_uString* p = GetString().getDataIgnoreCase();
 if (!p)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-30 Thread Takeshi Abe
 sc/inc/scfuncs.hrc |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f5e804587a2dd0e2f745ebe507a2efb9fc1e8a4e
Author: Takeshi Abe 
Date:   Tue May 29 12:18:00 2018 +0900

sc: Insert a space for consistency

Change-Id: Ifb1429eb3ad6d1093a7b5126ea3d15c4509cf8cc
Reviewed-on: https://gerrit.libreoffice.org/54981
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 
(cherry picked from commit 4534da9dabe162d094bfef204d41b2d43e47c217)
Reviewed-on: https://gerrit.libreoffice.org/55072
Tested-by: Eike Rathke 

diff --git a/sc/inc/scfuncs.hrc b/sc/inc/scfuncs.hrc
index c0cd8abb3a3e..5c750d26c7fd 100644
--- a/sc/inc/scfuncs.hrc
+++ b/sc/inc/scfuncs.hrc
@@ -3007,7 +3007,7 @@ const char* SC_OPCODE_T_TEST_ARY[] =
 NC_("SC_OPCODE_T_TEST", "Data 2"),
 NC_("SC_OPCODE_T_TEST", "The second record array."),
 NC_("SC_OPCODE_T_TEST", "Mode"),
-NC_("SC_OPCODE_T_TEST", "Mode specifies the number of distribution tails 
to return. 1= one-tailed, 2 = two-tailed distribution"),
+NC_("SC_OPCODE_T_TEST", "Mode specifies the number of distribution tails 
to return. 1 = one-tailed, 2 = two-tailed distribution"),
 NC_("SC_OPCODE_T_TEST", "Type"),
 NC_("SC_OPCODE_T_TEST", "The type of the T test.")
 };
@@ -3021,7 +3021,7 @@ const char* SC_OPCODE_T_TEST_MS_ARY[] =
 NC_("SC_OPCODE_T_TEST_MS", "Data 2"),
 NC_("SC_OPCODE_T_TEST_MS", "The second record array."),
 NC_("SC_OPCODE_T_TEST_MS", "Mode"),
-NC_("SC_OPCODE_T_TEST_MS", "Mode specifies the number of distribution 
tails to return. 1= one-tailed, 2 = two-tailed distribution"),
+NC_("SC_OPCODE_T_TEST_MS", "Mode specifies the number of distribution 
tails to return. 1 = one-tailed, 2 = two-tailed distribution"),
 NC_("SC_OPCODE_T_TEST_MS", "Type"),
 NC_("SC_OPCODE_T_TEST_MS", "The type of the T test.")
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-30 Thread Takeshi Abe
 sc/inc/scfuncs.hrc |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4534da9dabe162d094bfef204d41b2d43e47c217
Author: Takeshi Abe 
Date:   Tue May 29 12:18:00 2018 +0900

sc: Insert a space for consistency

Change-Id: Ifb1429eb3ad6d1093a7b5126ea3d15c4509cf8cc
Reviewed-on: https://gerrit.libreoffice.org/54981
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/sc/inc/scfuncs.hrc b/sc/inc/scfuncs.hrc
index c0cd8abb3a3e..5c750d26c7fd 100644
--- a/sc/inc/scfuncs.hrc
+++ b/sc/inc/scfuncs.hrc
@@ -3007,7 +3007,7 @@ const char* SC_OPCODE_T_TEST_ARY[] =
 NC_("SC_OPCODE_T_TEST", "Data 2"),
 NC_("SC_OPCODE_T_TEST", "The second record array."),
 NC_("SC_OPCODE_T_TEST", "Mode"),
-NC_("SC_OPCODE_T_TEST", "Mode specifies the number of distribution tails 
to return. 1= one-tailed, 2 = two-tailed distribution"),
+NC_("SC_OPCODE_T_TEST", "Mode specifies the number of distribution tails 
to return. 1 = one-tailed, 2 = two-tailed distribution"),
 NC_("SC_OPCODE_T_TEST", "Type"),
 NC_("SC_OPCODE_T_TEST", "The type of the T test.")
 };
@@ -3021,7 +3021,7 @@ const char* SC_OPCODE_T_TEST_MS_ARY[] =
 NC_("SC_OPCODE_T_TEST_MS", "Data 2"),
 NC_("SC_OPCODE_T_TEST_MS", "The second record array."),
 NC_("SC_OPCODE_T_TEST_MS", "Mode"),
-NC_("SC_OPCODE_T_TEST_MS", "Mode specifies the number of distribution 
tails to return. 1= one-tailed, 2 = two-tailed distribution"),
+NC_("SC_OPCODE_T_TEST_MS", "Mode specifies the number of distribution 
tails to return. 1 = one-tailed, 2 = two-tailed distribution"),
 NC_("SC_OPCODE_T_TEST_MS", "Type"),
 NC_("SC_OPCODE_T_TEST_MS", "The type of the T test.")
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-28 Thread Takeshi Abe
 basic/source/runtime/methods.cxx |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit f122faeede515093cf9dc450c9b62fdaae603bef
Author: Takeshi Abe 
Date:   Mon May 7 17:31:39 2018 +0900

basic: Avoid looking up system clock twice to get current datetime

Change-Id: I3de322a420bdbbd7906160b97dca531dfe3092a4
Reviewed-on: https://gerrit.libreoffice.org/53929
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 589105ff3935..960219ca81c0 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -2224,13 +2224,12 @@ void SbRtl_Second(StarBASIC *, SbxArray & rPar, bool)
 
 double Now_Impl()
 {
-Date aDate( Date::SYSTEM );
-tools::Time aTime( tools::Time::SYSTEM );
-double aSerial = static_cast(GetDayDiff( aDate ));
-long nSeconds = aTime.GetHour();
+DateTime aDateTime( DateTime::SYSTEM );
+double aSerial = static_cast(GetDayDiff( aDateTime ));
+long nSeconds = aDateTime.GetHour();
 nSeconds *= 3600;
-nSeconds += aTime.GetMin() * 60;
-nSeconds += aTime.GetSec();
+nSeconds += aDateTime.GetMin() * 60;
+nSeconds += aDateTime.GetSec();
 double nDays = static_cast(nSeconds) / (24.0*3600.0);
 aSerial += nDays;
 return aSerial;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-24 Thread Takeshi Abe
 xmlsecurity/inc/xmlsignaturehelper.hxx |5 ++---
 xmlsecurity/source/helper/documentsignaturemanager.cxx |6 ++
 xmlsecurity/source/helper/xmlsignaturehelper.cxx   |6 ++
 3 files changed, 6 insertions(+), 11 deletions(-)

New commits:
commit b4960947db5652382710e817ed1412eeb9132be6
Author: Takeshi Abe 
Date:   Wed May 23 22:10:22 2018 +0900

xmlsecurity: Ask current datetime only once

... and pass it as the sole argument to XMLSignatureHelper::SetDateTime().

Change-Id: I7f3e8dc90bb34ca347a1ad5a79717a338af3bed9
Reviewed-on: https://gerrit.libreoffice.org/54706
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/xmlsecurity/inc/xmlsignaturehelper.hxx 
b/xmlsecurity/inc/xmlsignaturehelper.hxx
index c41179d4805c..02128bb4f6a8 100644
--- a/xmlsecurity/inc/xmlsignaturehelper.hxx
+++ b/xmlsecurity/inc/xmlsignaturehelper.hxx
@@ -37,8 +37,7 @@
 #include 
 #include 
 
-class Date;
-namespace tools { class Time; }
+class DateTime;
 
 namespace com {
 namespace sun {
@@ -128,7 +127,7 @@ public:
 void SetGpgCertificate(sal_Int32 nSecurityId, const OUString& 
ouGpgCertDigest,
 const OUString& ouGpgCert, const OUString& ouGpgOwner);
 
-voidSetDateTime( sal_Int32 nSecurityId, const Date& rDate, const 
tools::Time& rTime );
+voidSetDateTime( sal_Int32 nSecurityId, const DateTime& rDateTime 
);
 void SetDescription(sal_Int32 nSecurityId, const OUString& rDescription);
 void SetSignatureLineId(sal_Int32 nSecurityId, const OUString& 
rSignatureLineId);
 void
diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx 
b/xmlsecurity/source/helper/documentsignaturemanager.cxx
index f302f1a64955..c88c18964b22 100644
--- a/xmlsecurity/source/helper/documentsignaturemanager.cxx
+++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx
@@ -35,8 +35,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 
 #include 
@@ -385,8 +384,7 @@ bool DocumentSignatureManager::add(
 maSignatureHelper.AddForSigning(nSecurityId, aElements[n], 
bBinaryMode, bAdESCompliant);
 }
 
-maSignatureHelper.SetDateTime(nSecurityId, Date(Date::SYSTEM),
-  tools::Time(tools::Time::SYSTEM));
+maSignatureHelper.SetDateTime(nSecurityId, DateTime(DateTime::SYSTEM));
 maSignatureHelper.SetDescription(nSecurityId, rDescription);
 
 if (!rSignatureLineId.isEmpty())
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx 
b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
index e754bb3368f6..40c0f19a8fdf 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
@@ -44,8 +44,6 @@
 #include 
 #include 
 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -139,9 +137,9 @@ void XMLSignatureHelper::SetGpgCertificate(sal_Int32 
nSecurityId,
 ouGpgOwner);
 }
 
-void XMLSignatureHelper::SetDateTime( sal_Int32 nSecurityId, const ::Date& 
rDate, const tools::Time& rTime )
+void XMLSignatureHelper::SetDateTime( sal_Int32 nSecurityId, const ::DateTime& 
rDateTime )
 {
-css::util::DateTime stDateTime = ::DateTime(rDate, rTime).GetUNODateTime();
+css::util::DateTime stDateTime = rDateTime.GetUNODateTime();
 mpXSecController->setDate( nSecurityId, stDateTime );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-21 Thread Takeshi Abe
 vbahelper/source/vbahelper/vbaapplicationbase.cxx |9 -
 xmloff/source/text/txtlists.cxx   |8 
 2 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 1091e786b420a964b899e9c0a9c399d07946536c
Author: Takeshi Abe 
Date:   Tue May 22 13:28:15 2018 +0900

vbahelper, xmloff: Ask current datetime only once

Change-Id: I930983fab11d30f0887965fe30b07c5ac6eef8ef
Reviewed-on: https://gerrit.libreoffice.org/54651
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx 
b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 25e91647694b..2fb92cf5c786 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -78,13 +78,12 @@ public:
 
 static double GetNow()
 {
-Date aDateNow( Date::SYSTEM );
-tools::Time aTimeNow( tools::Time::SYSTEM );
- Date aRefDate( 1,1,1900 );
-long nDiffDays = aDateNow - aRefDate;
+DateTime aNow( DateTime::SYSTEM );
+Date aRefDate( 1,1,1900 );
+long nDiffDays = aNow - aRefDate;
 nDiffDays += 2; // Change VisualBasic: 1.Jan.1900 == 2
 
-long nDiffSeconds = aTimeNow.GetHour() * 3600 + aTimeNow.GetMin() * 60 
+ aTimeNow.GetSec();
+long nDiffSeconds = aNow.GetHour() * 3600 + aNow.GetMin() * 60 + 
aNow.GetSec();
 return static_cast(nDiffDays) + 
static_cast(nDiffSeconds)/double(24*3600);
 }
 
diff --git a/xmloff/source/text/txtlists.cxx b/xmloff/source/text/txtlists.cxx
index ff57fbe0f601..40c85cb63c9c 100644
--- a/xmloff/source/text/txtlists.cxx
+++ b/xmloff/source/text/txtlists.cxx
@@ -23,8 +23,7 @@
 
 #include 
 
-#include 
-#include 
+#include 
 
 #include 
 #include 
@@ -198,8 +197,9 @@ OUString XMLTextListsHelper::GenerateNewListId() const
 else
 {
 // Value of xml:id in element  has to be a valid ID type 
(#i92478#)
-sal_Int64 n = ::tools::Time( ::tools::Time::SYSTEM ).GetTime();
-n += Date( Date::SYSTEM ).GetDateUnsigned();
+DateTime aDateTime( DateTime::SYSTEM );
+sal_Int64 n = aDateTime.GetTime();
+n += aDateTime.GetDateUnsigned();
 n += comphelper::rng::uniform_int_distribution(0, 
std::numeric_limits::max());
 // Value of xml:id in element  has to be a valid ID type 
(#i92478#)
 sTmpStr += OUString::number( n );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-21 Thread Takeshi Abe
 sw/source/core/doc/DocumentFieldsManager.cxx |5 +++--
 sw/source/filter/html/htmlfld.cxx|5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 338d5f14ba3e77286c3447fb0bcbf46b0627a35f
Author: Takeshi Abe 
Date:   Mon May 21 19:01:02 2018 +0900

sw: Ask current datetime only once

Change-Id: I99bed9a09ed1701ce441ddb0a19b5259ab37f135
Reviewed-on: https://gerrit.libreoffice.org/54621
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx 
b/sw/source/core/doc/DocumentFieldsManager.cxx
index b4b3c0b32d80..9d56929ff792 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -1336,8 +1336,9 @@ void DocumentFieldsManager::SetFixFields( const DateTime* 
pNewDateTime )
 }
 else
 {
-nDate = Date( Date::SYSTEM ).GetDate();
-nTime = tools::Time( tools::Time::SYSTEM ).GetTime();
+DateTime aDateTime( DateTime::SYSTEM );
+nDate = aDateTime.GetDate();
+nTime = aDateTime.GetTime();
 }
 
 SwFieldIds const aTypes[] {
diff --git a/sw/source/filter/html/htmlfld.cxx 
b/sw/source/filter/html/htmlfld.cxx
index 568f36576a84..53a7b1b435ab 100644
--- a/sw/source/filter/html/htmlfld.cxx
+++ b/sw/source/filter/html/htmlfld.cxx
@@ -320,8 +320,9 @@ void SwHTMLParser::NewField()
 case SwFieldIds::Time:
 {
 sal_uInt32 nNumFormat = 0;
-sal_Int64 nTime = tools::Time( tools::Time::SYSTEM ).GetTime();
-sal_Int32 nDate = Date( Date::SYSTEM ).GetDate();
+DateTime aDateTime( DateTime::SYSTEM );
+sal_Int64 nTime = aDateTime.GetTime();
+sal_Int32 nDate = aDateTime.GetDate();
 sal_uInt16 nSub = 0;
 bool bValidFormat = false;
 HTMLNumFormatTableEntry * pFormatTable;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-21 Thread Takeshi Abe
 sc/source/core/tool/interpr2.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 622691b89573850c35fe6c4b4f0b2f9bdb4c091d
Author: Takeshi Abe 
Date:   Tue May 8 16:35:49 2018 +0900

sc: Avoid looking up system clock twice to get current datetime

Change-Id: I904067260c15263f8169f095809e642d0738f6bb
Reviewed-on: https://gerrit.libreoffice.org/53957
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index db02e70710eb..7846d0d162b6 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -112,9 +112,8 @@ void ScInterpreter::ScGetActDate()
 void ScInterpreter::ScGetActTime()
 {
 nFuncFmtType = SvNumFormatType::DATETIME;
-Date aActDate( Date::SYSTEM );
-long nDiff = aActDate - pFormatter->GetNullDate();
-tools::Time aActTime( tools::Time::SYSTEM );
+DateTime aActTime( DateTime::SYSTEM );
+long nDiff = aActTime - pFormatter->GetNullDate();
 double fTime = aActTime.GetHour()/ 
static_cast(::tools::Time::hourPerDay)   +
aActTime.GetMin() / 
static_cast(::tools::Time::minutePerDay) +
aActTime.GetSec() / 
static_cast(::tools::Time::secondPerDay) +
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-19 Thread Takeshi Abe
 svx/source/dialog/ctredlin.cxx |   22 ++
 1 file changed, 10 insertions(+), 12 deletions(-)

New commits:
commit 027b5a14830c0013ce79877eab66dcf309366ecc
Author: Takeshi Abe 
Date:   Fri May 18 12:05:54 2018 +0900

svx: Avoid looking up system clock twice for current datetime

Change-Id: I636ddfdaeac211ddc9de6b5dfe36cbdc32c7f7f2
Reviewed-on: https://gerrit.libreoffice.org/54509
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 4d475541fb98..8de682c4933e 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -582,12 +582,11 @@ SvxTPFilter::SvxTPFilter( vcl::Window * pParent)
 RowEnableHdl(m_pCbAction);
 RowEnableHdl(m_pCbComment);
 
-Date aDate( Date::SYSTEM );
-tools::Time aTime( tools::Time::SYSTEM );
-m_pDfDate->SetDate(aDate);
-m_pTfDate->SetTime(aTime);
-m_pDfDate2->SetDate(aDate);
-m_pTfDate2->SetTime(aTime);
+DateTime aDateTime( DateTime::SYSTEM );
+m_pDfDate->SetDate(aDateTime);
+m_pTfDate->SetTime(aDateTime);
+m_pDfDate2->SetDate(aDateTime);
+m_pTfDate2->SetTime(aDateTime);
 HideRange();
 ShowAction();
 bModified=false;
@@ -935,17 +934,16 @@ IMPL_LINK( SvxTPFilter, RowEnableHdl, Button*, pButton, 
void )
 IMPL_LINK( SvxTPFilter, TimeHdl, Button*, pButton, void )
 {
 ImageButton* pIB = static_cast(pButton);
-Date aDate( Date::SYSTEM );
-tools::Time aTime( tools::Time::SYSTEM );
+DateTime aDateTime( DateTime::SYSTEM );
 if (pIB == m_pIbClock)
 {
-m_pDfDate->SetDate(aDate);
-m_pTfDate->SetTime(aTime);
+m_pDfDate->SetDate(aDateTime);
+m_pTfDate->SetTime(aDateTime);
 }
 else if (pIB == m_pIbClock2)
 {
-m_pDfDate2->SetDate(aDate);
-m_pTfDate2->SetTime(aTime);
+m_pDfDate2->SetDate(aDateTime);
+m_pTfDate2->SetTime(aDateTime);
 }
 bModified=true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-19 Thread Takeshi Abe
 sfx2/source/doc/docfile.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 84efa4087b803a39219ccce79ca374d0d09cf6d9
Author: Takeshi Abe 
Date:   Thu May 17 17:54:38 2018 +0900

sfx2: Avoid looking up system clock twice for current datetime

Change-Id: If5d7bbd611321e6eee1c4bd9143af415c8a1671d
Reviewed-on: https://gerrit.libreoffice.org/54472
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 14a5f6aa61f0..1ac4c883d30a 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -333,7 +333,7 @@ SfxMedium_Impl::SfxMedium_Impl() :
 m_pInStream(nullptr),
 m_pOutStream(nullptr),
 pOrigFilter( nullptr ),
-aExpireTime( Date( Date::SYSTEM ) + 10, tools::Time( tools::Time::SYSTEM ) 
),
+aExpireTime( DateTime( DateTime::SYSTEM ) + static_cast(10) ),
 pTempFile( nullptr ),
 nLastStorageError( ERRCODE_NONE ),
 m_nSignatureState( SignatureState::NOSIGNATURES )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-19 Thread Takeshi Abe
 sd/source/ui/app/sdmod2.cxx  |5 ++---
 sd/source/ui/dlg/headerfooterdlg.cxx |5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 1de2b14b3f736c7a81c68aced6dcdef45b62d4b8
Author: Takeshi Abe 
Date:   Tue May 15 12:31:35 2018 +0900

sd: Avoid looking up system clock twice for current datetime

Change-Id: I777210723f4c41ee27e2d6497aa466640924d8b5
Reviewed-on: https://gerrit.libreoffice.org/54348
Reviewed-by: Noel Grandin 
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 5429a9b69e1a..926bca3600f0 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -407,10 +407,9 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, 
pInfo, void)
 }
 else
 {
-Date aDate( Date::SYSTEM );
-tools::Time aTime( tools::Time::SYSTEM );
+DateTime aDateTime( DateTime::SYSTEM );
 LanguageType eLang = 
pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
-aRepresentation = SvxDateTimeField::GetFormatted( 
aDate, aTime,
+aRepresentation = SvxDateTimeField::GetFormatted( 
aDateTime, aDateTime,
   rSettings.meDateFormat, 
rSettings.meTimeFormat, *GetNumberFormatter(), eLang );
 }
 }
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx 
b/sd/source/ui/dlg/headerfooterdlg.cxx
index 97c343c12375..c12440065220 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -481,13 +481,12 @@ void HeaderFooterTabPage::FillFormatList( sal_Int32 
nSelectedPos )
 
 mpCBDateTimeFormat->Clear();
 
-Date aDate( Date::SYSTEM );
-tools::Time aTime( tools::Time::SYSTEM );
+DateTime aDateTime( DateTime::SYSTEM );
 
 for( int nFormat = 0; nFormat < nDateTimeFormatsCount; nFormat++ )
 {
 OUString aStr( SvxDateTimeField::GetFormatted(
-aDate, aTime,
+aDateTime, aDateTime,
 nDateTimeFormats[nFormat].meDateFormat, 
nDateTimeFormats[nFormat].meTimeFormat,
 *(SD_MOD()->GetNumberFormatter()), eLanguage ) );
 const sal_Int32 nEntry = mpCBDateTimeFormat->InsertEntry( aStr );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/tools tools/inc tools/Library_tl.mk tools/source

2018-05-04 Thread Takeshi Abe
 include/tools/datetime.hxx   |2 
 tools/Library_tl.mk  |1 
 tools/inc/systemdatetime.hxx |   26 +++
 tools/source/datetime/datetime.cxx   |   17 
 tools/source/datetime/systemdatetime.cxx |  109 +++
 tools/source/datetime/tdate.cxx  |   35 -
 tools/source/datetime/ttime.cxx  |   85 +---
 7 files changed, 175 insertions(+), 100 deletions(-)

New commits:
commit 5103c6a405e93bb05018ab7c89e7e9446c740aaa
Author: Takeshi Abe 
Date:   Sun Apr 29 05:20:47 2018 +0900

tools: Avoid looking up system clock twice to get DateTime

DateTime::DateTime(DateTimeInitSystem) had initialized Date and
Time separately, which causes a slight possibility that it could
get a wrong datetime with almost 24 hours delay when it went beyond
midnight. E.g., the date part was of the previous day while the
time part was 00:00:00.xxx of the next day.

This also reduces duplicate code by sharing GetSystemDateTime().

Change-Id: I352d90f468f5cbc70e7936a337bed97365baa06c
Reviewed-on: https://gerrit.libreoffice.org/53612
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/include/tools/datetime.hxx b/include/tools/datetime.hxx
index 02729e6a0e1a..7b78b29bdfc5 100644
--- a/include/tools/datetime.hxx
+++ b/include/tools/datetime.hxx
@@ -40,7 +40,7 @@ public:
 };
 
 explicit DateTime( DateTimeInitEmpty ) : Date( Date::EMPTY 
), Time( Time::EMPTY ) {}
-explicit DateTime( DateTimeInitSystem ) : Date( 
Date::SYSTEM ), Time( Time::SYSTEM ) {}
+explicit DateTime( DateTimeInitSystem );
 DateTime( const DateTime& rDateTime ) :
 Date( rDateTime ), Time( rDateTime ) {}
 DateTime( const Date& rDate ) : Date( rDate ), Time(0) {}
diff --git a/tools/Library_tl.mk b/tools/Library_tl.mk
index 2aee438fb2e9..c524a38084aa 100644
--- a/tools/Library_tl.mk
+++ b/tools/Library_tl.mk
@@ -44,6 +44,7 @@ $(eval $(call gb_Library_use_libraries,tl,\
 $(eval $(call gb_Library_add_exception_objects,tl,\
 tools/source/datetime/datetime \
 tools/source/datetime/datetimeutils \
+tools/source/datetime/systemdatetime \
 tools/source/datetime/tdate \
 tools/source/datetime/ttime \
 tools/source/debug/debug \
diff --git a/tools/inc/systemdatetime.hxx b/tools/inc/systemdatetime.hxx
new file mode 100644
index ..cc74eae61340
--- /dev/null
+++ b/tools/inc/systemdatetime.hxx
@@ -0,0 +1,26 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+#ifndef INCLUDED_TOOLS_INC_SYSTEMDATETIME_H
+#define INCLUDED_TOOLS_INC_SYSTEMDATETIME_H
+
+#include 
+
+constexpr sal_Int64 SEC_MASK = SAL_CONST_INT64(10);
+constexpr sal_Int64 MIN_MASK = SAL_CONST_INT64(1000);
+constexpr sal_Int64 HOUR_MASK = SAL_CONST_INT64(10);
+
+/** Get current local timestamp.
+Both pDate and pTime can be null.
+Returns true if succeeded, false otherwse.
+ */
+bool GetSystemDateTime(sal_Int32* pDate, sal_Int64* pTime);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/tools/source/datetime/datetime.cxx 
b/tools/source/datetime/datetime.cxx
index e3faf45fa495..1dc2b79cb990 100644
--- a/tools/source/datetime/datetime.cxx
+++ b/tools/source/datetime/datetime.cxx
@@ -19,6 +19,23 @@
 #include 
 #include 
 
+#include 
+
+DateTime::DateTime(DateTimeInitSystem)
+: Date( Date::EMPTY )
+, Time( Time::EMPTY )
+{
+sal_Int32 nD = 0;
+sal_Int64 nT = 0;
+if ( GetSystemDateTime( &nD, &nT ) )
+{
+Date::operator=( Date( nD ) );
+SetTime( nT );
+}
+else
+Date::operator=( Date( 1, 1, 1900 ) ); // Time::nTime is already 0
+}
+
 DateTime::DateTime( const css::util::DateTime& rDateTime )
   : Date( rDateTime.Day, rDateTime.Month, rDateTime.Year ),
 Time( rDateTime.Hours, rDateTime.Minutes, rDateTime.Seconds, 
rDateTime.NanoSeconds )
diff --git a/tools/source/datetime/systemdatetime.cxx 
b/tools/source/datetime/systemdatetime.cxx
new file mode 100644
index ..40e4edfd05c3
--- /dev/null
+++ b/tools/source/datetime/systemdatetime.cxx
@@ -0,0 +1,109 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http:/

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

2018-04-26 Thread Takeshi Abe
 svx/source/unodraw/unoshap2.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d69a043b5470212fa9d1ef5c17015c7a84d054fb
Author: Takeshi Abe 
Date:   Tue Apr 24 21:24:24 2018 +0900

svx: These arrays are constant

Change-Id: Icda32ea104888afa3e4e1064e25dad6825b83b99
Reviewed-on: https://gerrit.libreoffice.org/53383
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 8b351899d54a..2c4c2999a1cf 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -595,7 +595,7 @@ static struct
 const sal_Char* mpFormName;
 sal_uInt16 mnFormNameLen;
 }
-SvxShapeControlPropertyMapping[] =
+const SvxShapeControlPropertyMapping[] =
 {
 // Warning: The first entry must be FontSlant because the any needs to be 
converted
 { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_CHAR_POSTURE), 
RTL_CONSTASCII_STRINGPARAM("FontSlant")  }, //  const sal_Int16 => 
css::awt::FontSlant
@@ -654,7 +654,7 @@ namespace
 sal_Int16nFormValue;
 };
 
-EnumConversionMap aMapAdjustToAlign[] =
+EnumConversionMap const aMapAdjustToAlign[] =
 {
 // note that order matters:
 // lcl_convertTextAlignmentToParaAdjustment and 
lcl_convertParaAdjustmentToTextAlignment search this map from the _beginning_
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-11 Thread Takeshi Abe
 toolkit/source/controls/controlmodelcontainerbase.cxx |   56 --
 1 file changed, 27 insertions(+), 29 deletions(-)

New commits:
commit 5823ecd54b16974ffe8821a5ae061cd0ecc4cf84
Author: Takeshi Abe 
Date:   Tue Apr 10 22:12:06 2018 +0900

toolkit: Recover missing service names for ControlModelContainerBase

namely:
com.sun.star.awt.UnoControlProgressBarModel
com.sun.star.awt.UnoControlScrollBarModel
com.sun.star.awt.UnoControlFixedLineModel
com.sun.star.awt.UnoControlRoadmapModel

They seems accidentally dropped at 45fe77164c90cf15b78cd8b99adc043e2dd26be1.

Change-Id: Iebd72cadc9eb9bdcb80f9b8c11f6e5e40bdb50a2
Reviewed-on: https://gerrit.libreoffice.org/52673
Reviewed-by: Noel Grandin 
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx 
b/toolkit/source/controls/controlmodelcontainerbase.cxx
index 8f6cf1783f29..767501c91b4d 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -413,35 +413,33 @@ Reference< XInterface > 
ControlModelContainerBase::createInstanceWithArguments(
 
 Sequence< OUString > ControlModelContainerBase::getAvailableServiceNames()
 {
-static Sequence< OUString >* pNamesSeq = nullptr;
-if ( !pNamesSeq )
-{
-pNamesSeq = new Sequence< OUString >( 26 );
-OUString* pNames = pNamesSeq->getArray();
-pNames[0] = "com.sun.star.awt.UnoControlEditModel";
-pNames[1] = "com.sun.star.awt.UnoControlFormattedFieldModel";
-pNames[2] = "com.sun.star.awt.UnoControlFileControlModel";
-pNames[3] = "com.sun.star.awt.UnoControlButtonModel";
-pNames[4] = "com.sun.star.awt.UnoControlImageControlModel";
-pNames[5] = "com.sun.star.awt.UnoControlRadioButtonModel";
-pNames[6] = "com.sun.star.awt.UnoControlCheckBoxModel";
-pNames[7] = "com.sun.star.awt.UnoControlFixedTextModel";
-pNames[8] = "com.sun.star.awt.UnoControlGroupBoxModel";
-pNames[9] = "com.sun.star.awt.UnoControlListBoxModel";
-pNames[10] = "com.sun.star.awt.UnoControlComboBoxModel";
-pNames[11] = "com.sun.star.awt.UnoControlDateFieldModel";
-pNames[12] = "com.sun.star.awt.UnoControlTimeFieldModel";
-pNames[13] = "com.sun.star.awt.UnoControlNumericFieldModel";
-pNames[14] = "com.sun.star.awt.UnoControlCurrencyFieldModel";
-pNames[15] = "com.sun.star.awt.UnoControlPatternFieldModel";
-pNames[16] = "com.sun.star.awt.tree.TreeControlModel";
-pNames[21] = "com.sun.star.awt.grid.UnoControlGridModel";
-pNames[22] = "com.sun.star.awt.tab.UnoControlTabPageContainerModel";
-pNames[23] = "com.sun.star.awt.tab.UnoControlTabPageModel";
-pNames[24] = "com.sun.star.awt.UnoMultiPageModel";
-pNames[25] = "com.sun.star.awt.UnoFrameModel";
-}
-return *pNamesSeq;
+return { "com.sun.star.awt.UnoControlEditModel",
+"com.sun.star.awt.UnoControlFormattedFieldModel",
+"com.sun.star.awt.UnoControlFileControlModel",
+"com.sun.star.awt.UnoControlButtonModel",
+"com.sun.star.awt.UnoControlImageControlModel",
+"com.sun.star.awt.UnoControlRadioButtonModel",
+"com.sun.star.awt.UnoControlCheckBoxModel",
+"com.sun.star.awt.UnoControlFixedTextModel",
+"com.sun.star.awt.UnoControlGroupBoxModel",
+"com.sun.star.awt.UnoControlListBoxModel",
+"com.sun.star.awt.UnoControlComboBoxModel",
+"com.sun.star.awt.UnoControlDateFieldModel",
+"com.sun.star.awt.UnoControlTimeFieldModel",
+"com.sun.star.awt.UnoControlNumericFieldModel",
+"com.sun.star.awt.UnoControlCurrencyFieldModel",
+"com.sun.star.awt.UnoControlPatternFieldModel",
+"com.sun.star.awt.UnoControlProgressBarModel",
+"com.sun.star.awt.UnoControlScrollBarModel",
+"com.sun.star.awt.UnoControlFixedLineModel",
+"com.sun.star.awt.UnoControlRoadmapModel",
+"com.sun.star.awt.tree.TreeControlModel",
+"com.sun.star.awt.grid.UnoControlGridModel",
+"com.sun.star.awt.tab.UnoControlTabPageContainerModel",
+"com.sun.star.awt.tab.UnoControlTabPageModel",
+"com.sun.star.awt.UnoMultiPageModel",
+"com.sun.star.awt.UnoFrameModel"
+};
 }
 
 // XContainer
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-07 Thread Takeshi Abe
 ucb/source/ucp/file/filtask.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 2c63fcb0cf10c7ce580545576f2bd40dbcdb61d0
Author: Takeshi Abe 
Date:   Sat Apr 7 23:10:40 2018 +0900

ucb: Fix overwriting at index 7

It seems a typo at ee2ecbf89b002fa8f60316b4266b96dfca8b4591.
This recovers command "insert".

Change-Id: Id335799ab615c09e025badd9408aeb363200c430
Reviewed-on: https://gerrit.libreoffice.org/52552
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx
index 0bbeb93675d4..85164c30792a 100644
--- a/ucb/source/ucp/file/filtask.cxx
+++ b/ucb/source/ucp/file/filtask.cxx
@@ -347,9 +347,9 @@ TaskManager::TaskManager( const uno::Reference< 
uno::XComponentContext >& rxCont
 m_sCommandInfo[7].Handle = -1;
 m_sCommandInfo[7].ArgType = cppu::UnoType::get();
 
-m_sCommandInfo[7].Name = "createNewContent";
-m_sCommandInfo[7].Handle = -1;
-m_sCommandInfo[7].ArgType = cppu::UnoType::get();
+m_sCommandInfo[8].Name = "createNewContent";
+m_sCommandInfo[8].Handle = -1;
+m_sCommandInfo[8].ArgType = cppu::UnoType::get();
 
 if(m_bWithConfig)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sal/osl

2018-04-05 Thread Takeshi Abe
 sal/osl/unx/socket.cxx |   21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

New commits:
commit ad8961511ad34e6159db092bde052a4fab4375c7
Author: Takeshi Abe 
Date:   Wed Mar 28 23:50:08 2018 +0900

osl: Remember the last error before returning osl_Socket_Error

This prevents from e.g. com.sun.star.bridge.UnoUrlResolver's
emitting confusing messages, when trying to connect to a port
on which no LibreOffice process is listening, like:
> Traceback (most recent call last):
>  File "", line 1, in 
>  __main__.NoConnectException: Connector : couldn't connect to socket 
(Success)

^^^
After applying this patch:
> Traceback (most recent call last):
>  File "", line 1, in 
>  __main__.NoConnectException: Connector : couldn't connect to socket 
(Connection refused)

You can see the above behavior with the following python code:

import uno
x = uno.getComponentContext()
y = x.ServiceManager
z = y.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", x)
url = "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext"
a = z.resolve(url)

... provided that no process is waiting on port 2002.

Change-Id: Id094cf9271fe77d84f2284d91a0e452448de2bc2
Reviewed-on: https://gerrit.libreoffice.org/52018
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx
index 347c3e915686..dcd7b5509aba 100644
--- a/sal/osl/unx/socket.cxx
+++ b/sal/osl/unx/socket.cxx
@@ -1401,7 +1401,6 @@ oslSocketResult SAL_CALL osl_connectSocketTo(oslSocket 
pSocket,
 fd_set   ExcptSet;
 int  ReadyHandles;
 struct timeval  tv;
-oslSocketResult Result= osl_Socket_Ok;
 
 SAL_WARN_IF( !pSocket, "sal.osl", "undefined socket" );
 
@@ -1490,13 +1489,19 @@ oslSocketResult SAL_CALL osl_connectSocketTo(oslSocket 
pSocket,
 nSockOpt = getsockopt ( pSocket->m_Socket, SOL_SOCKET, SO_ERROR,
 &nErrorCode, &nErrorSize );
 if ( (nSockOpt == 0) && (nErrorCode == 0))
-Result = osl_Socket_Ok;
+{
+osl_enableNonBlockingMode(pSocket, false);
+return osl_Socket_Ok;
+}
 else
-Result = osl_Socket_Error;
+{
+pSocket->m_nLastError = (nSockOpt == 0) ? nErrorCode : errno;
+return osl_Socket_Error;
+}
 }
 else
 {
-Result= osl_Socket_Error;
+return osl_Socket_Error;
 }
 }
 else if (ReadyHandles < 0)  /* error */
@@ -1508,17 +1513,13 @@ oslSocketResult SAL_CALL osl_connectSocketTo(oslSocket 
pSocket,
 return osl_Socket_Interrupted;
 }
 pSocket->m_nLastError=errno;
-Result= osl_Socket_Error;
+return osl_Socket_Error;
 }
 else/* timeout */
 {
 pSocket->m_nLastError=errno;
-Result= osl_Socket_TimedOut;
+return osl_Socket_TimedOut;
 }
-
-osl_enableNonBlockingMode(pSocket, false);
-
-return Result;
 }
 
 oslSocket SAL_CALL osl_acceptConnectionOnSocket(oslSocket pSocket,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: idlc/source sal/osl xmlscript/test

2018-04-05 Thread Takeshi Abe
 idlc/source/idlccompile.cxx |3 +--
 sal/osl/unx/backtrace.c |3 ---
 xmlscript/test/imexp.cxx|1 -
 3 files changed, 1 insertion(+), 6 deletions(-)

New commits:
commit 786a1c8ef1d182e63a7ae8cfd526ae101bad232b
Author: Takeshi Abe 
Date:   Thu Apr 5 00:39:05 2018 +0900

fflush() followed by fclose() is redundant

Change-Id: Iacb9332635cb6afa90ec1a72e96388b3b5b7b56c
Reviewed-on: https://gerrit.libreoffice.org/52420
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx
index c7e69362ec8a..ca6a8ebeb10a 100644
--- a/idlc/source/idlccompile.cxx
+++ b/idlc/source/idlccompile.cxx
@@ -202,9 +202,8 @@ bool copyFile(const OString* source, const OString& target)
 if (source != nullptr) {
 fclose(pSource);
 }
-if ( fflush(pTarget) )
+if ( fclose(pTarget) )
 bRet = false;
-fclose(pTarget);
 
 return bRet;
 }
diff --git a/sal/osl/unx/backtrace.c b/sal/osl/unx/backtrace.c
index f70031d0b4a9..a3aeb3dae3f8 100644
--- a/sal/osl/unx/backtrace.c
+++ b/sal/osl/unx/backtrace.c
@@ -129,7 +129,6 @@ void backtrace_symbols_fd( void **buffer, int size, int fd )
 fprintf( fp, "[%p]\n", *pFramePtr );
 }
 
-fflush( fp );
 fclose( fp );
 }
 }
@@ -209,7 +208,6 @@ void backtrace_symbols_fd( void **buffer, int size, int fd )
 }
 fprintf( fp, "[%p]\n", *pFramePtr );
 }
-fflush( fp );
 fclose( fp );
 }
 }
@@ -277,7 +275,6 @@ void backtrace_symbols_fd( void **buffer, int size, int fd )
 fprintf( fp, "[%p]\n", *pFramePtr );
 }
 
-fflush( fp );
 fclose( fp );
 }
 }
diff --git a/xmlscript/test/imexp.cxx b/xmlscript/test/imexp.cxx
index e275179beef1..0e4a80b516d5 100644
--- a/xmlscript/test/imexp.cxx
+++ b/xmlscript/test/imexp.cxx
@@ -131,7 +131,6 @@ void exportToFile(
 
 FILE * f = ::fopen( fname, "w" );
 ::fwrite( bytes.getConstArray(), 1, bytes.getLength(), f );
-::fflush( f );
 ::fclose( f );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-05 Thread Takeshi Abe
 ucb/source/ucp/file/filrset.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 8d6e498a11024ca3cf70864250a757e0d5a7b166
Author: Takeshi Abe 
Date:   Fri Apr 6 10:48:58 2018 +0900

ucb: Shift property "IsRowCountFinal"'s index from 0 to 1

The original 0 seems a typo.
Cf. ucb/source/sorter/sortresult.cxx and
ucb/source/ucp/ftp/ftpresultsetbase.cxx.

Change-Id: I5c2331483aa8186a031bba9fb2fc906ee4a1e535
Reviewed-on: https://gerrit.libreoffice.org/52484
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx
index 1d949a9996dd..21e9acdc72c0 100644
--- a/ucb/source/ucp/file/filrset.cxx
+++ b/ucb/source/ucp/file/filrset.cxx
@@ -631,10 +631,10 @@ XResultSet_impl::getPropertySetInfo()
 seq[0].Type = cppu::UnoType::get();
 seq[0].Attributes = beans::PropertyAttribute::READONLY;
 
-seq[0].Name = "IsRowCountFinal";
-seq[0].Handle = -1;
-seq[0].Type = cppu::UnoType::get();
-seq[0].Attributes = beans::PropertyAttribute::READONLY;
+seq[1].Name = "IsRowCountFinal";
+seq[1].Handle = -1;
+seq[1].Type = cppu::UnoType::get();
+seq[1].Attributes = beans::PropertyAttribute::READONLY;
 
 XPropertySetInfo_impl* p = new XPropertySetInfo_impl( m_pMyShell,
   seq );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-05 Thread Takeshi Abe
 svx/source/accessibility/svxpixelctlaccessiblecontext.cxx |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 4e13bfaf6840d90b7ee0f3b4a8c3a3e8d5d5f3b5
Author: Takeshi Abe 
Date:   Thu Apr 5 23:25:45 2018 +0900

svx: Fix the sequence's length

Change-Id: I8b1798659efb798ca4f4883469118a297f40b83b
Reviewed-on: https://gerrit.libreoffice.org/52466
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx 
b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
index 181db684e748..f0a82d551292 100644
--- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
@@ -285,12 +285,11 @@ sal_Bool SvxPixelCtlAccessible::supportsService( const 
OUString& rServiceName )
 
 uno::Sequence< OUString > SvxPixelCtlAccessible::getSupportedServiceNames(  )
 {
-uno::Sequence< OUString > aRet(2);
-OUString* pArray = aRet.getArray();
-pArray[0] = "Accessible";
-pArray[1] = "AccessibleContext";
-pArray[2] = "AccessibleComponent";
-return aRet;
+return uno::Sequence< OUString >{
+"Accessible",
+"AccessibleContext",
+"AccessibleComponent"
+};
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sal/osl

2018-04-03 Thread Takeshi Abe
 sal/osl/w32/profile.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit eb77037ea1aa8a388be6d14ed744f46638db0202
Author: Takeshi Abe 
Date:   Tue Apr 3 22:31:07 2018 +0900

osl: Fix possible memleak

Change-Id: I162993df6b802bd51e4e079b3dc530476b220e4e
Reviewed-on: https://gerrit.libreoffice.org/52325
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sal/osl/w32/profile.cxx b/sal/osl/w32/profile.cxx
index b9fd1dc6e646..26a11e4d8672 100644
--- a/sal/osl/w32/profile.cxx
+++ b/sal/osl/w32/profile.cxx
@@ -2106,6 +2106,7 @@ static bool lookupProfile(const sal_Unicode *strPath, 
const sal_Unicode *strFile
 {
 if ((nPos = rtl_ustr_lastIndexOfChar(strExecutable->buffer, L':')) == 
-1)
 {
+rtl_uString_release(strExecutable);
 return false;
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-02 Thread Takeshi Abe
 ucb/source/core/ucbcmds.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 52829d9a7a57fa98a0d8f109612352605c54cc47
Author: Takeshi Abe 
Date:   Mon Apr 2 22:59:29 2018 +0900

ucb: The sequence's length is 3, not 2.

This completes 1a9261124eed5baa04b069a1cb1b51f24423ec9b.

Change-Id: I03e6167bca67f8852250d8464b6fde5e4e690f32
Reviewed-on: https://gerrit.libreoffice.org/52261
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx
index edb8347ad928..1fd8f877350b 100644
--- a/ucb/source/core/ucbcmds.cxx
+++ b/ucb/source/core/ucbcmds.cxx
@@ -215,9 +215,8 @@ public:
 
 
 CommandProcessorInfo::CommandProcessorInfo()
+: m_pInfo( new uno::Sequence< ucb::CommandInfo >( 3 ) )
 {
-m_pInfo.reset( new uno::Sequence< ucb::CommandInfo >( 2 ) );
-
 (*m_pInfo)[ 0 ]
 = ucb::CommandInfo(
 GETCOMMANDINFO_NAME, // Name
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-14 Thread Takeshi Abe
 officecfg/registry/data/org/openoffice/VCL.xcu |2 -
 unotools/source/config/fontcfg.cxx |   28 -
 2 files changed, 1 insertion(+), 29 deletions(-)

New commits:
commit bba299d8146a07af6833620784ac5b697b0f7e84
Author: Takeshi Abe 
Date:   Sat Mar 3 09:24:55 2018 +0900

tdf#114751 Update the default UI fonts for Japanese locale

- give priority to IPA P Gothic and Noto Sans CJK JP
- for Windows, try Yu Gothic UI first, then Meiryo UI
- look for Hiragino Kaku Gothic ProN/Pro on macOS

Thanks to Jun Nogata and AWASHIRO Ikuya for their suggestions.
This addresses only part of the issue; another incoming change
will take care of the rest.

Change-Id: I1491ba63e1447d3b9086dfcfdf3981bee6282661
Reviewed-on: https://gerrit.libreoffice.org/50515
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/officecfg/registry/data/org/openoffice/VCL.xcu 
b/officecfg/registry/data/org/openoffice/VCL.xcu
index 91526d120ee2..44af4ffdc891 100644
--- a/officecfg/registry/data/org/openoffice/VCL.xcu
+++ b/officecfg/registry/data/org/openoffice/VCL.xcu
@@ -238,7 +238,7 @@
 HG ゴシックB Sun;HG-GothicB Sun;HG ゴシックB;HG Mincho Light J;MS 
Pゴシック;ヒラギノ角ゴ ProN;ヒラギノ角ゴ Pro;TLPゴシック;LXゴシック;HGPGothicB;IPA 
Pゴシック;東風ゴシック;さざなみゴシック;Kochi Gothic;UmePlus Gothic;Gothic
   
   
-HG PゴシックB Sun;Osaka;ヒラギノ角ゴ ProN;ヒラギノ角ゴ Pro;HG-PGothicB Sun;HG 
PゴシックB;HG-PGothicB;HG-GothicB;UmePlus P Gothic;HG Mincho Light 
J;標準;TLPゴシック;LXゴシック;HGPGothicB;IPA Pゴシック;東風ゴシック;さざなみゴシック;Kochi 
Gothic;Gothic;Gnu-Unifont
+IPA Pゴシック;IPA P Gothic;Noto Sans CJK JP;Yu Gothic UI;Meiryo 
UI;ヒラギノ角ゴ ProN;Hiragino Kaku Gothic ProN;ヒラギノ角ゴ Pro;Hiragino Kaku Gothic 
Pro
   
   
 
hgmincholightj;cumberlandamt;cumberland;couriernew;nimbusmonol;courier;lucidasanstypewriter;lucidatypewriter;monaco;monospaced
diff --git a/unotools/source/config/fontcfg.cxx 
b/unotools/source/config/fontcfg.cxx
index 0ffc882342e7..be09dc493eec 100644
--- a/unotools/source/config/fontcfg.cxx
+++ b/unotools/source/config/fontcfg.cxx
@@ -247,8 +247,6 @@ OUString DefaultFontConfiguration::getUserInterfaceFont( 
const LanguageTag& rLan
 #define FALLBACKFONT_UI_SANS_ARABIC "Tahoma;Traditional Arabic;Simplified 
Arabic;Lucidasans;Lucida Sans;Supplement;Andale Sans UI;clearlyU;Interface 
User;Arial Unicode MS;Lucida Sans Unicode;WarpSans;Geneva;MS Sans 
Serif;Helv;Dialog;Albany;Lucida;Helvetica;Charcoal;Chicago;Arial;Helmet;Interface
 System;Sans Serif"
 #define FALLBACKFONT_UI_SANS_THAI "OONaksit;Tahoma;Lucidasans;Arial 
Unicode MS"
 #define FALLBACKFONT_UI_SANS_KOREAN 
"SunGulim;BaekmukGulim;Gulim;Roundgothic;Arial Unicode MS;Lucida Sans 
Unicode;gnu-unifont;Andale Sans UI"
-#define FALLBACKFONT_UI_SANS_JAPANESE1 "HG-GothicB-Sun;Andale Sans UI;HG 
MhinchoLightJ"
-#define FALLBACKFONT_UI_SANS_JAPANESE2 "Kochi Gothic;Gothic"
 #define FALLBACKFONT_UI_SANS_CHINSIM "Andale Sans UI;Arial Unicode 
MS;ZYSong18030;AR PL SungtiL GB;AR PL KaitiM GB;SimSun;Lucida Sans 
Unicode;Fangsong;Hei;Song;Kai;Ming;gnu-unifont;Interface User;"
 #define FALLBACKFONT_UI_SANS_CHINTRD "Andale Sans UI;Arial Unicode MS;AR 
PL Mingti2L Big5;AR PL KaitiM Big5;Kai;PMingLiU;MingLiU;Ming;Lucida Sans 
Unicode;gnu-unifont;Interface User;"
 
@@ -290,32 +288,6 @@ OUString DefaultFontConfiguration::getUserInterfaceFont( 
const LanguageTag& rLan
 {
 return OUString(FALLBACKFONT_UI_SANS_LATIN2);
 }
-else if ( aLanguage == "ja" )
-{
-// we need localized names for japanese fonts
-const sal_Unicode aMSGothic[] = { 0xFF2D, 0xFF33, ' ', 0x30B4, 0x30B7, 
0x30C3, 0x30AF, 0 };
-const sal_Unicode aMSPGothic[] = { 0xFF2D, 0xFF33, ' ', 0xFF30, 
0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
-const sal_Unicode aTLPGothic[] = { 0x0054, 0x004C, 0x0050, 0x30B4, 
0x30B7, 0x30C3, 0x30AF, 0 };
-const sal_Unicode aLXGothic[] = { 0x004C, 0x0058, 0x30B4, 0x30B7, 
0x30C3, 0x30AF, 0 };
-const sal_Unicode aKochiGothic[] = { 0x6771, 0x98A8, 0x30B4, 0x30B7, 
0x30C3, 0x30AF, 0 };
-
-OUStringBuffer aFallBackJapaneseLocalized;
-aFallBackJapaneseLocalized.append("MS UI Gothic;");
-aFallBackJapaneseLocalized.append(FALLBACKFONT_UI_SANS_JAPANESE1);
-aFallBackJapaneseLocalized.append(aMSPGothic);
-aFallBackJapaneseLocalized.append(';');
-aFallBackJapaneseLocalized.append(aMSGothic);
-aFallBackJapaneseLocalized.append(';');
-aFallBackJapaneseLocalized.append(aTLPGothic);
-aFallBackJapaneseLocalized.append(';');
-aFallBackJapaneseLocalized.append(aLXGothic);
-aFallBackJapaneseLocalized.append(';');
-aFallBackJapaneseLocalized.append(aKochiGothic);
-aFallBackJapaneseLocalized.append(';

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

2018-02-25 Thread Takeshi Abe
 starmath/source/accessibility.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit e1771058ebc4efc58515ffa60250843274990bac
Author: Takeshi Abe 
Date:   Fri Feb 23 18:48:39 2018 +0900

starmath: Adjusting by 0 is the same as doing nothing

Change-Id: I417c67ca8be458befff4ff3151404fe3833e7582
Reviewed-on: https://gerrit.libreoffice.org/50227
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/starmath/source/accessibility.cxx 
b/starmath/source/accessibility.cxx
index 59ab5412c806..22d5af1c38b1 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -482,7 +482,6 @@ awt::Rectangle SAL_CALL 
SmGraphicAccessible::getCharacterBounds( sal_Int32 nInde
 // get appropriate rectangle
 Point aOffset(pNode->GetTopLeft() - pTree->GetTopLeft());
 Point aTLPos (pWin->GetFormulaDrawPos() + aOffset);
-aTLPos.AdjustX( -0 );
 Size  aSize (pNode->GetSize());
 
 long* pXAry = new long[ aNodeText.getLength() ];
@@ -542,7 +541,6 @@ sal_Int32 SAL_CALL SmGraphicAccessible::getIndexAtPoint( 
const awt::Point& aPoin
 // get appropriate rectangle
 Point   aOffset( pNode->GetTopLeft() - pTree->GetTopLeft() );
 Point   aTLPos ( aOffset );
-aTLPos.AdjustX( -0 );
 Size  aSize( pNode->GetSize() );
 
 tools::Rectangle aRect( aTLPos, aSize );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-20 Thread Takeshi Abe
 starmath/source/cfgitem.hxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 32a5ea9d0b96d9956be41fb7f1480139be619aae
Author: Takeshi Abe 
Date:   Mon Feb 19 17:05:31 2018 +0900

starmath: no need to use std::deque here

Change-Id: I735d751bc9a5c3392075b6155d63e10b0da0d33b
Reviewed-on: https://gerrit.libreoffice.org/49968
Reviewed-by: Julien Nabet 
Tested-by: Takeshi Abe 

diff --git a/starmath/source/cfgitem.hxx b/starmath/source/cfgitem.hxx
index fc12cfacc18b..2959f3741f3c 100644
--- a/starmath/source/cfgitem.hxx
+++ b/starmath/source/cfgitem.hxx
@@ -22,7 +22,6 @@
 
 #include 
 
-#include 
 #include 
 
 #include 
@@ -67,7 +66,7 @@ struct SmFntFmtListEntry
 
 class SmFontFormatList
 {
-std::deque aEntries;
+std::vector aEntries;
 boolbModified;
 
 SmFontFormatList(const SmFontFormatList&) = delete;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: starmath/inc

2018-02-18 Thread Takeshi Abe
 starmath/inc/node.hxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 6893d8b193fa809f7cd7cd9c44b1733b6b5607cb
Author: Takeshi Abe 
Date:   Sun Feb 18 16:00:39 2018 +0900

starmath: Spare unnecessary assignments

Change-Id: I8ddc1c04a76475d63a39dc21d36cda7a7aa26b9e
Reviewed-on: https://gerrit.libreoffice.org/49921
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index f4d90b9ada05..7479e3385503 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -266,12 +266,13 @@ public:
 {
 //Resize subnodes array
 maSubNodes.resize(nIndex + 1);
-//Set new slots to NULL
-for (size_t i = size; i < nIndex+1; i++)
+//Set new slots to NULL except at nIndex
+for (size_t i = size; i < nIndex; i++)
 maSubNodes[i] = nullptr;
 }
 maSubNodes[nIndex] = pNode;
-ClaimPaternity();
+if (pNode)
+pNode->SetParent(this);
 }
 
 private:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-15 Thread Takeshi Abe
 starmath/inc/node.hxx|3 ++-
 starmath/source/cursor.cxx   |7 +++
 starmath/source/mathmlimport.cxx |   20 ++--
 starmath/source/node.cxx |9 +++--
 starmath/source/visitors.cxx |2 +-
 5 files changed, 23 insertions(+), 18 deletions(-)

New commits:
commit abcd7825101afb9ef9ff93932f8e1bd7c3bb91bb
Author: Takeshi Abe 
Date:   Wed Feb 14 22:08:37 2018 +0900

starmath: Prefer moving subnodes to copying them

Change-Id: Id92dd0715daf43a63d09529f01a6583c23de7c7d
Reviewed-on: https://gerrit.libreoffice.org/49725
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 01423959652b..f4d90b9ada05 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -235,8 +235,9 @@ public:
 
 using   SmNode::GetSubNode;
 virtual SmNode *GetSubNode(size_t nIndex) override;
+void ClearSubNodes();
 void SetSubNodes(SmNode *pFirst, SmNode *pSecond, SmNode *pThird = 
nullptr);
-void SetSubNodes(const SmNodeArray &rNodeArray);
+void SetSubNodes(SmNodeArray&& rNodeArray);
 
 virtual void  GetAccessibleText( OUStringBuffer &rText ) const override;
 
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index bc6d5227d043..1d0e987e02cc 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -219,7 +219,7 @@ void SmCursor::DeletePrev(OutputDevice* pDev){
 else if(i > nLineOffset)
 lines[i-1] = pLineParent->GetSubNode(i);
 }
-pLineParent->SetSubNodes(lines);
+pLineParent->SetSubNodes(std::move(lines));
 //Rebuild graph
 mpAnchor = nullptr;
 mpPosition = nullptr;
@@ -1147,8 +1147,7 @@ SmNodeList* SmCursor::LineToList(SmStructureNode* pLine, 
SmNodeList* list){
 list->push_back(pChild);
 }
 }
-SmNodeArray emptyArray(0);
-pLine->SetSubNodes(emptyArray);
+pLine->ClearSubNodes();
 delete pLine;
 return list;
 }
@@ -1436,7 +1435,7 @@ SmNode* SmNodeListParser::Expression(){
 
 //Create SmExpressionNode, I hope SmToken() will do :)
 SmStructureNode* pExpr = new SmExpressionNode(SmToken());
-pExpr->SetSubNodes(NodeArray);
+pExpr->SetSubNodes(std::move(NodeArray));
 return pExpr;
 }
 
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 85361823fbf2..bf90545a5e99 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -1168,7 +1168,7 @@ void SmXMLFencedContext_Impl::EndElement()
 
 SmToken aDummy;
 SmStructureNode *pBody = new SmExpressionNode(aDummy);
-pBody->SetSubNodes(aRelationArray);
+pBody->SetSubNodes(std::move(aRelationArray));
 
 
 pSNode->SetSubNodes(pLeft,pBody,pRight);
@@ -1613,7 +1613,7 @@ void SmXMLSubContext_Impl::GenericEndElement(SmTokenType 
eType, SmSubSup eSubSup
 
 aSubNodes[eSubSup+1] = popOrZero(rNodeStack);
 aSubNodes[0] = popOrZero(rNodeStack);
-pNode->SetSubNodes(aSubNodes);
+pNode->SetSubNodes(std::move(aSubNodes));
 rNodeStack.push_front(std::move(pNode));
 }
 
@@ -1672,7 +1672,7 @@ void 
SmXMLSubSupContext_Impl::GenericEndElement(SmTokenType eType,
 aSubNodes[aSup+1] = popOrZero(rNodeStack);
 aSubNodes[aSub+1] = popOrZero(rNodeStack);
 aSubNodes[0] =  popOrZero(rNodeStack);
-pNode->SetSubNodes(aSubNodes);
+pNode->SetSubNodes(std::move(aSubNodes));
 rNodeStack.push_front(std::move(pNode));
 }
 
@@ -2318,7 +2318,7 @@ void SmXMLDocContext_Impl::EndElement()
 LineArray[n - (j + 1)] = pNode.release();
 }
 std::unique_ptr pSNode2(new SmTableNode(aDummy));
-pSNode2->SetSubNodes(LineArray);
+pSNode2->SetSubNodes(std::move(LineArray));
 rNodeStack.push_front(std::move(pSNode2));
 }
 
@@ -2454,7 +2454,7 @@ void SmXMLRowContext_Impl::EndElement()
 SmToken aDummy;
 std::unique_ptr pSNode(new SmBraceNode(aToken));
 SmStructureNode *pBody = new SmExpressionNode(aDummy);
-pBody->SetSubNodes(aRelationArray2);
+pBody->SetSubNodes(std::move(aRelationArray2));
 
 pSNode->SetSubNodes(pLeft,pBody,pRight);
 pSNode->SetScaleMode(SmScaleMode::Height);
@@ -2489,7 +2489,7 @@ void SmXMLRowContext_Impl::EndElement()
 
 SmToken aDummy;
 std::unique_ptr pSNode(new SmExpressionNode(aDummy));
-pSNode->SetSubNodes(aRelationArray);
+pSNode->SetSubNodes(std::move(aRelationArray));
 rNodeStack.push_front(std::move(pSNode));
 }
 
@@ -2635,7 +2635,7 @@ void 
SmXMLMultiScriptsContext_Impl::ProcessSubSupPairs(bool bIsPrescript)
 (!pScriptNode->GetToken().aText.isEmpty(
 aSubNodes[eSup+1] = pScriptNode;
 
-pNode->SetSubNodes(aSubNodes);
+p

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

2018-02-13 Thread Takeshi Abe
 starmath/inc/parse.hxx|2 +-
 starmath/source/parse.cxx |   10 +++---
 starmath/source/view.cxx  |2 +-
 3 files changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 3c913c3844acae8ee0d80ab174133bdc7677efea
Author: Takeshi Abe 
Date:   Tue Feb 13 20:52:57 2018 +0900

starmath: Omit SmParser::GetError()'s argument

as it was always 0.

Change-Id: I59570967deb139f258e7aeaab17619f714bc7bb5
Reviewed-on: https://gerrit.libreoffice.org/49640
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index 6b8e7d8cd85b..c49f0f6ff9cf 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -128,7 +128,7 @@ public:
 voidAddError(SmParseError Type, SmNode *pNode);
 const SmErrorDesc*  NextError();
 const SmErrorDesc*  PrevError();
-const SmErrorDesc*  GetError(size_t i);
+const SmErrorDesc*  GetError();
 static const SmTokenTableEntry* GetTokenTableEntry( const OUString &rName 
);
 const std::set< OUString >&   GetUsedSymbols() const  { return 
m_aUsedSymbols; }
 };
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 6c5414e25d50..9bb4530eae4e 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -2418,14 +2418,10 @@ const SmErrorDesc *SmParser::PrevError()
 }
 
 
-const SmErrorDesc *SmParser::GetError(size_t i)
+const SmErrorDesc *SmParser::GetError()
 {
-if ( i < m_aErrDescList.size() )
-return m_aErrDescList[ i ].get();
-
-if ( static_cast(m_nCurError) < m_aErrDescList.size() )
-return m_aErrDescList[ m_nCurError ].get();
-
+if ( !m_aErrDescList.empty() )
+return m_aErrDescList.front().get();
 return nullptr;
 }
 
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 21e3e619a978..34cff7ebedd3 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1295,7 +1295,7 @@ void SmViewShell::SetStatusText(const OUString& rText)
 void SmViewShell::ShowError(const SmErrorDesc* pErrorDesc)
 {
 assert(GetDoc());
-if (pErrorDesc || nullptr != (pErrorDesc = 
GetDoc()->GetParser().GetError(0)) )
+if (pErrorDesc || nullptr != (pErrorDesc = 
GetDoc()->GetParser().GetError()) )
 {
 SetStatusText( pErrorDesc->m_aText );
 GetEditWindow()->MarkError( Point( pErrorDesc->m_pNode->GetColumn(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-07 Thread Takeshi Abe
 starmath/inc/parse.hxx|   10 +-
 starmath/source/parse.cxx |   42 ++
 2 files changed, 31 insertions(+), 21 deletions(-)

New commits:
commit 609888f3c8d6c0fe72c41ac26de431a12ad3fdd0
Author: Takeshi Abe 
Date:   Wed Feb 7 17:10:44 2018 +0900

starmath: Make SmParser::DoAttribut() etc. return std::unique_ptr

Change-Id: I9693cf15abf202657f5be478bfebd1272dc261dd
Reviewed-on: https://gerrit.libreoffice.org/49339
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index ef51bcc61bdc..6b8e7d8cd85b 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -94,11 +94,11 @@ class SmParser
 std::unique_ptr DoOper();
 SmStructureNode *DoUnOper();
 std::unique_ptr DoAlign(bool bUseExtraSpaces = true);
-SmStructureNode *DoFontAttribut();
-SmAttributNode *DoAttribut();
-SmStructureNode *DoFont();
-SmStructureNode *DoFontSize();
-SmStructureNode *DoColor();
+std::unique_ptr DoFontAttribut();
+std::unique_ptr DoAttribut();
+std::unique_ptr DoFont();
+std::unique_ptr DoFontSize();
+std::unique_ptr DoColor();
 SmStructureNode *DoBrace();
 SmBracebodyNode *DoBracebody(bool bIsLeftRight);
 SmTextNode *DoFunction();
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index a7c1a8a0d6d2..6c5414e25d50 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1500,7 +1500,7 @@ SmNode *SmParser::DoTerm(bool bGroupNumberIdent)
 boolbIsAttr;
 while ( (bIsAttr = TokenInGroup(TG::Attribute))
||  TokenInGroup(TG::FontAttr))
-aStack.push(std::unique_ptr(bIsAttr ? 
DoAttribut() : DoFontAttribut()));
+aStack.push(bIsAttr ? DoAttribut() : DoFontAttribut());
 
 auto xFirstNode = DoPower();
 while (!aStack.empty())
@@ -1730,7 +1730,7 @@ SmStructureNode *SmParser::DoUnOper()
 return xSNode.release();
 }
 
-SmAttributNode *SmParser::DoAttribut()
+std::unique_ptr SmParser::DoAttribut()
 {
 DepthProtect aDepthGuard(m_nParseDepth);
 if (aDepthGuard.TooDeep())
@@ -1766,10 +1766,10 @@ SmAttributNode *SmParser::DoAttribut()
 
 xSNode->SetSubNodes(xAttr.release(), nullptr); // the body will be filled 
later
 xSNode->SetScaleMode(eScaleMode);
-return xSNode.release();
+return std::move(xSNode); // this explicit move can be omitted since C++14
 }
 
-SmStructureNode *SmParser::DoFontAttribut()
+std::unique_ptr SmParser::DoFontAttribut()
 {
 DepthProtect aDepthGuard(m_nParseDepth);
 if (aDepthGuard.TooDeep())
@@ -1787,7 +1787,7 @@ SmStructureNode *SmParser::DoFontAttribut()
 {
 auto pNode = o3tl::make_unique(m_aCurToken);
 NextToken();
-return pNode.release();
+return std::move(pNode); // this explicit move can be omitted 
since C++14
 }
 
 case TSIZE :
@@ -1801,11 +1801,11 @@ SmStructureNode *SmParser::DoFontAttribut()
 
 default :
 assert(false);
-return nullptr;
+return {};
 }
 }
 
-SmStructureNode *SmParser::DoColor()
+std::unique_ptr SmParser::DoColor()
 {
 DepthProtect aDepthGuard(m_nParseDepth);
 if (aDepthGuard.TooDeep())
@@ -1813,6 +1813,7 @@ SmStructureNode *SmParser::DoColor()
 
 assert(m_aCurToken.eType == TCOLOR);
 
+std::unique_ptr xNode;
 // last color rules, get that one
 SmToken  aToken;
 do
@@ -1823,13 +1824,17 @@ SmStructureNode *SmParser::DoColor()
 NextToken();
 }
 else
-return DoError(SmParseError::ColorExpected);
+{
+xNode.reset(DoError(SmParseError::ColorExpected));
+return xNode;
+}
 } while (m_aCurToken.eType == TCOLOR);
 
-return new SmFontNode(aToken);
+xNode.reset(new SmFontNode(aToken));
+return xNode;
 }
 
-SmStructureNode *SmParser::DoFont()
+std::unique_ptr SmParser::DoFont()
 {
 DepthProtect aDepthGuard(m_nParseDepth);
 if (aDepthGuard.TooDeep())
@@ -1837,6 +1842,7 @@ SmStructureNode *SmParser::DoFont()
 
 assert(m_aCurToken.eType == TFONT);
 
+std::unique_ptr xNode;
 // last font rules, get that one
 SmToken  aToken;
 do
@@ -1847,10 +1853,14 @@ SmStructureNode *SmParser::DoFont()
 NextToken();
 }
 else
-return DoError(SmParseError::FontExpected);
+{
+xNode.reset(DoError(SmParseError::FontExpected));
+return xNode;
+}
 } while (m_aCurToken.eType == TFONT);
 
-return new SmFontNode(aToken);
+xNode.reset(new SmFontNode(aToken));
+return xNode;
 }
 
 
@@ -1876,7 +1886,7 @@ static bool lcl_IsNumber(const OUString& rText)
 return true;
 }
 
-SmStructureNode *SmParser::DoFontSize()
+std::unique_ptr SmParser::

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

2018-02-06 Thread Takeshi Abe
 starmath/inc/parse.hxx|   16 -
 starmath/source/parse.cxx |   78 +++---
 2 files changed, 47 insertions(+), 47 deletions(-)

New commits:
commit f0c171a1dd2698f5bec14f5cf00136477032c202
Author: Takeshi Abe 
Date:   Tue Feb 6 17:47:59 2018 +0900

starmath: Make SmParser::DoLine() etc. return std::unique_ptr

Change-Id: Ia85f66d3490471d7e0c2ce8a1947051be129acf9
Reviewed-on: https://gerrit.libreoffice.org/49276
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index e3ec707d8bf4..ef51bcc61bdc 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -79,19 +79,19 @@ class SmParser
 
 // grammar
 std::unique_ptr DoTable();
-SmLineNode *DoLine();
+std::unique_ptr DoLine();
 std::unique_ptr DoExpression(bool bUseExtraSpaces = true);
-SmNode *DoRelation();
-SmNode *DoSum();
-SmNode *DoProduct();
-SmNode *DoSubSup(TG nActiveGroup, SmNode *pGivenNode);
-SmNode *DoOpSubSup();
-SmNode *DoPower();
+std::unique_ptr DoRelation();
+std::unique_ptr DoSum();
+std::unique_ptr DoProduct();
+std::unique_ptr DoSubSup(TG nActiveGroup, SmNode *pGivenNode);
+std::unique_ptr DoOpSubSup();
+std::unique_ptr DoPower();
 SmBlankNode *DoBlank();
 SmNode *DoTerm(bool bGroupNumberIdent);
 SmNode *DoEscape();
 SmOperNode *DoOperator();
-SmNode *DoOper();
+std::unique_ptr DoOper();
 SmStructureNode *DoUnOper();
 std::unique_ptr DoAlign(bool bUseExtraSpaces = true);
 SmStructureNode *DoFontAttribut();
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index e097e87e1b8e..a7c1a8a0d6d2 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -957,11 +957,11 @@ std::unique_ptr SmParser::DoTable()
 throw std::range_error("parser depth limit");
 
 std::vector> aLineArray;
-aLineArray.emplace_back(std::unique_ptr(DoLine()));
+aLineArray.push_back(DoLine());
 while (m_aCurToken.eType == TNEWLINE)
 {
 NextToken();
-aLineArray.emplace_back(std::unique_ptr(DoLine()));
+aLineArray.push_back(DoLine());
 }
 assert(m_aCurToken.eType == TEND);
 std::unique_ptr xSNode(new SmTableNode(m_aCurToken));
@@ -1000,7 +1000,7 @@ std::unique_ptr SmParser::DoAlign(bool 
bUseExtraSpaces)
 }
 
 // Postcondition: m_aCurToken.eType == TEND || m_aCurToken.eType == TNEWLINE
-SmLineNode *SmParser::DoLine()
+std::unique_ptr SmParser::DoLine()
 {
 DepthProtect aDepthGuard(m_nParseDepth);
 if (aDepthGuard.TooDeep())
@@ -1029,7 +1029,7 @@ SmLineNode *SmParser::DoLine()
 
 auto xSNode = o3tl::make_unique(m_aCurToken);
 xSNode->SetSubNodes(buildNodeArray(ExpressionArray));
-return xSNode.release();
+return std::move(xSNode); // this explicit move can be omitted since C++14
 }
 
 std::unique_ptr SmParser::DoExpression(bool bUseExtraSpaces)
@@ -1039,9 +1039,9 @@ std::unique_ptr SmParser::DoExpression(bool 
bUseExtraSpaces)
 throw std::range_error("parser depth limit");
 
 std::vector> RelationArray;
-RelationArray.emplace_back(std::unique_ptr(DoRelation()));
+RelationArray.push_back(DoRelation());
 while (m_aCurToken.nLevel >= 4)
-RelationArray.emplace_back(std::unique_ptr(DoRelation()));
+RelationArray.push_back(DoRelation());
 
 if (RelationArray.size() > 1)
 {
@@ -1059,49 +1059,49 @@ std::unique_ptr SmParser::DoExpression(bool 
bUseExtraSpaces)
 }
 }
 
-SmNode *SmParser::DoRelation()
+std::unique_ptr SmParser::DoRelation()
 {
 DepthProtect aDepthGuard(m_nParseDepth);
 if (aDepthGuard.TooDeep())
 throw std::range_error("parser depth limit");
 
-std::unique_ptr xFirst(DoSum());
+auto xFirst = DoSum();
 while (TokenInGroup(TG::Relation))
 {
 std::unique_ptr xSNode(new SmBinHorNode(m_aCurToken));
-std::unique_ptr xSecond(DoOpSubSup());
-std::unique_ptr xThird(DoSum());
+auto xSecond = DoOpSubSup();
+auto xThird = DoSum();
 xSNode->SetSubNodes(xFirst.release(), xSecond.release(), 
xThird.release());
 xFirst = std::move(xSNode);
 }
-return xFirst.release();
+return xFirst;
 }
 
-SmNode *SmParser::DoSum()
+std::unique_ptr SmParser::DoSum()
 {
 DepthProtect aDepthGuard(m_nParseDepth);
 if (aDepthGuard.TooDeep())
 throw std::range_error("parser depth limit");
 
-std::unique_ptr xFirst(DoProduct());
+auto xFirst = DoProduct();
 while (TokenInGroup(TG::Sum))
 {
 std::unique_ptr xSNode(new SmBinHorNode(m_aCurToken));
-std::unique_ptr xSecond(DoOpSubSup());
-std::unique_ptr xThird(DoProduct());
+auto xSecond = DoOpSubSup();
+auto xThird = DoProduct();
 xSNode->SetSubNodes(xFirst.release(), xSecond.release(), 
xThird.release());
 

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

2018-02-05 Thread Takeshi Abe
 starmath/inc/parse.hxx|2 +-
 starmath/source/parse.cxx |   22 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 715114595e0feec49c4d54cc5eb26f13dccb7968
Author: Takeshi Abe 
Date:   Mon Feb 5 18:01:21 2018 +0900

starmath: Make DoAlign() return std::unique_ptr

to take advantage of copy elision and simplify client code.

Change-Id: I9e08bc2b9743563f483657c7348abca05dd34c85
Reviewed-on: https://gerrit.libreoffice.org/49222
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index a2faa73a3b40..e3ec707d8bf4 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -93,7 +93,7 @@ class SmParser
 SmOperNode *DoOperator();
 SmNode *DoOper();
 SmStructureNode *DoUnOper();
-SmNode *DoAlign(bool bUseExtraSpaces = true);
+std::unique_ptr DoAlign(bool bUseExtraSpaces = true);
 SmStructureNode *DoFontAttribut();
 SmAttributNode *DoAttribut();
 SmStructureNode *DoFont();
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 7e026673a69a..e097e87e1b8e 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -969,7 +969,7 @@ std::unique_ptr SmParser::DoTable()
 return xSNode;
 }
 
-SmNode *SmParser::DoAlign(bool bUseExtraSpaces)
+std::unique_ptr SmParser::DoAlign(bool bUseExtraSpaces)
 // parse alignment info (if any), then go on with rest of expression
 {
 DepthProtect aDepthGuard(m_nParseDepth);
@@ -986,7 +986,7 @@ SmNode *SmParser::DoAlign(bool bUseExtraSpaces)
 
 // allow for just one align statement in 5.0
 if (TokenInGroup(TG::Align))
-return DoError(SmParseError::DoubleAlign);
+return std::unique_ptr(DoError(SmParseError::DoubleAlign));
 }
 
 auto pNode = DoExpression(bUseExtraSpaces);
@@ -994,9 +994,9 @@ SmNode *SmParser::DoAlign(bool bUseExtraSpaces)
 if (xSNode)
 {
 xSNode->SetSubNode(0, pNode.release());
-return xSNode.release();
+return std::move(xSNode); // this explicit move can be omitted since 
C++14
 }
-return pNode.release();
+return pNode;
 }
 
 // Postcondition: m_aCurToken.eType == TEND || m_aCurToken.eType == TNEWLINE
@@ -1012,7 +1012,7 @@ SmLineNode *SmParser::DoLine()
 // (and go on with expressions that must not have alignment
 // statements in 'while' loop below. See also 'Expression()'.)
 if (m_aCurToken.eType != TEND  &&  m_aCurToken.eType != TNEWLINE)
-ExpressionArray.emplace_back(std::unique_ptr(DoAlign()));
+ExpressionArray.push_back(DoAlign());
 
 while (m_aCurToken.eType != TEND  &&  m_aCurToken.eType != TNEWLINE)
 ExpressionArray.push_back(DoExpression());
@@ -1336,7 +1336,7 @@ SmNode *SmParser::DoTerm(bool bGroupNumberIdent)
 return xSNode.release();
 }
 
-std::unique_ptr pNode(DoAlign(!bNoSpace));
+auto pNode = DoAlign(!bNoSpace);
 if (m_aCurToken.eType == TRGROUP) {
 NextToken();
 return pNode.release();
@@ -2051,7 +2051,7 @@ SmBracebodyNode *SmParser::DoBracebody(bool bIsLeftRight)
 }
 else if (m_aCurToken.eType != TRIGHT)
 {
-aNodes.emplace_back(std::unique_ptr(DoAlign()));
+aNodes.push_back(DoAlign());
 if (m_aCurToken.eType != TMLINE  &&  m_aCurToken.eType != 
TRIGHT)
 
aNodes.emplace_back(std::unique_ptr(DoError(SmParseError::RightExpected)));
 }
@@ -2068,7 +2068,7 @@ SmBracebodyNode *SmParser::DoBracebody(bool bIsLeftRight)
 }
 else if (!TokenInGroup(TG::RBrace))
 {
-aNodes.emplace_back(std::unique_ptr(DoAlign()));
+aNodes.push_back(DoAlign());
 if (m_aCurToken.eType != TMLINE  &&  !TokenInGroup(TG::RBrace))
 
aNodes.emplace_back(std::unique_ptr(DoError(SmParseError::RbraceExpected)));
 }
@@ -2153,7 +2153,7 @@ SmStructureNode *SmParser::DoStack()
 do
 {
 NextToken();
-aExprArr.emplace_back(std::unique_ptr(DoAlign()));
+aExprArr.push_back(DoAlign());
 }
 while (m_aCurToken.eType == TPOUND);
 
@@ -2181,7 +2181,7 @@ SmStructureNode *SmParser::DoMatrix()
 do
 {
 NextToken();
-aExprArr.emplace_back(std::unique_ptr(DoAlign()));
+aExprArr.push_back(DoAlign());
 }
 while (m_aCurToken.eType == TPOUND);
 
@@ -2192,7 +2192,7 @@ SmStructureNode *SmParser::DoMatrix()
 NextToken();
 for (size_t i = 0; i < nCol; i++)
 {
-std::unique_ptr xNode(DoAlign());
+auto xNode = DoAlign();
 if (i < (nCol - 1))
 {
 if (m_aCurToken.eType == TPOUND)

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

2018-02-01 Thread Takeshi Abe
 sd/source/ui/inc/unokywds.hxx |   33 -
 1 file changed, 33 deletions(-)

New commits:
commit b52275dd26105524210dfba2f9a7d8bf7961cf8f
Author: Takeshi Abe 
Date:   Fri Jan 12 00:01:08 2018 +0900

sd: Remove unused keywords

Change-Id: I1a180aaca32cabc56a6d5a6a3f0b23680d60aaf3
Reviewed-on: https://gerrit.libreoffice.org/47760
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sd/source/ui/inc/unokywds.hxx b/sd/source/ui/inc/unokywds.hxx
index 60f240fd5d73..9becfc0bd328 100644
--- a/sd/source/ui/inc/unokywds.hxx
+++ b/sd/source/ui/inc/unokywds.hxx
@@ -20,16 +20,7 @@
 #ifndef INCLUDED_SD_SOURCE_UI_INC_UNOKYWDS_HXX
 #define INCLUDED_SD_SOURCE_UI_INC_UNOKYWDS_HXX
 
-// SdXImpressDocument
-const char sUNO_Service_DrawingDocument[] = 
"com.sun.star.drawing.DrawingDocument";
-const char sUNO_Service_PresentationDocument[] = 
"com.sun.star.drawing.PresentationDocument";
-
-// SdUnoStyleFamilies
-const char sUNO_SdUnoStyleFamilies[] = "SdUnoStyleFamilies";
-const char sUNO_Graphic_Style_Family_Name[] = "graphics";
-
 // SdUnoPseudoStyleFamily
-const char sUNO_SdUnoPseudoStyleFamily[] = "SdUnoPseudoStyleFamily";
 const char sUNO_PseudoSheet_Title[] = "title";
 const char sUNO_PseudoSheet_SubTitle[] = "subtitle";
 const char sUNO_PseudoSheet_Background[] = "background";
@@ -45,30 +36,6 @@ const char sUNO_PseudoSheet_Outline7[] = "outline7";
 const char sUNO_PseudoSheet_Outline8[] = "outline8";
 const char sUNO_PseudoSheet_Outline9[] = "outline9";
 
-// SdUnoPseudoStyle
-const char sUNO_SdUnoPseudoStyle[] = "SdUnoPseudoStyle";
-
-// SdUnoGraphicStyleFamily
-const char sUNO_SdUnoGraphicStyleFamily[] = "SdUnoGraphicStyleFamily";
-const char sUNO_StyleName_standard[] = "standard";
-const char sUNO_StyleName_objwitharrow[] = "objectwitharrow";
-const char sUNO_StyleName_objwithshadow[] = "objectwithshadow";
-const char sUNO_StyleName_objwithoutfill[] = "objectwithoutfill";
-const char sUNO_StyleName_text[] = "text";
-const char sUNO_StyleName_textbody[] = "textbody";
-const char sUNO_StyleName_textbodyjust[] = "textbodyjustfied";
-const char sUNO_StyleName_textbodyindent[] = "textbodyindent";
-const char sUNO_StyleName_title[] = "title";
-const char sUNO_StyleName_title1[] = "title1";
-const char sUNO_StyleName_title2[] = "title2";
-const char sUNO_StyleName_headline[] = "headline";
-const char sUNO_StyleName_headline1[] = "headline1";
-const char sUNO_StyleName_headline2[] = "headline2";
-const char sUNO_StyleName_measure[] = "measure";
-
-// SdUnoGraphicStyle
-const char sUNO_SdUnoGraphicStyle[] = "SdUnoGraphicStyle";
-
 // SdLayer
 const char sUNO_LayerName_background[] = "background";
 const char sUNO_LayerName_background_objects[] = "backgroundobjects";
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-31 Thread Takeshi Abe
 starmath/inc/format.hxx |2 -
 starmath/source/cfgitem.cxx |   71 +++-
 starmath/source/format.cxx  |   64 ---
 3 files changed, 70 insertions(+), 67 deletions(-)

New commits:
commit 1056f14525c5f2cf2e73d461b1aa5e7d763cd1d0
Author: Takeshi Abe 
Date:   Thu Feb 1 00:00:06 2018 +0900

starmath: Put GetDefaultFontName() in an unnamed namespace

Change-Id: I877e1c9b33ae240a2e8ac9972a6bc45e0848ee28
Reviewed-on: https://gerrit.libreoffice.org/49027
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/starmath/inc/format.hxx b/starmath/inc/format.hxx
index 362069900414..7b342a41195d 100644
--- a/starmath/inc/format.hxx
+++ b/starmath/inc/format.hxx
@@ -88,8 +88,6 @@ enum class SmHorAlign {
 Right
 };
 
-OUString GetDefaultFontName( LanguageType nLang, sal_uInt16 nIdent );
-
 class SmFormat : public SfxBroadcaster
 {
 SmFace  vFont[FNT_END + 1];
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 170bfe84b796..883f6f6d120b 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include 
 
@@ -24,6 +25,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 
@@ -796,6 +799,72 @@ void SmMathConfig::SaveOther()
 SetOtherModified( false );
 }
 
+namespace {
+
+// Latin default-fonts
+const DefaultFontType aLatinDefFnts[FNT_END] =
+{
+DefaultFontType::SERIF,  // FNT_VARIABLE
+DefaultFontType::SERIF,  // FNT_FUNCTION
+DefaultFontType::SERIF,  // FNT_NUMBER
+DefaultFontType::SERIF,  // FNT_TEXT
+DefaultFontType::SERIF,  // FNT_SERIF
+DefaultFontType::SANS,   // FNT_SANS
+DefaultFontType::FIXED   // FNT_FIXED
+//OpenSymbol,// FNT_MATH
+};
+
+// CJK default-fonts
+//! we use non-asian fonts for variables, functions and numbers since they
+//! look better and even in asia only latin letters will be used for those.
+//! At least that's what I was told...
+const DefaultFontType aCJKDefFnts[FNT_END] =
+{
+DefaultFontType::SERIF,  // FNT_VARIABLE
+DefaultFontType::SERIF,  // FNT_FUNCTION
+DefaultFontType::SERIF,  // FNT_NUMBER
+DefaultFontType::CJK_TEXT,   // FNT_TEXT
+DefaultFontType::CJK_TEXT,   // FNT_SERIF
+DefaultFontType::CJK_DISPLAY,// FNT_SANS
+DefaultFontType::CJK_TEXT// FNT_FIXED
+//OpenSymbol,// FNT_MATH
+};
+
+// CTL default-fonts
+const DefaultFontType aCTLDefFnts[FNT_END] =
+{
+DefaultFontType::CTL_TEXT,// FNT_VARIABLE
+DefaultFontType::CTL_TEXT,// FNT_FUNCTION
+DefaultFontType::CTL_TEXT,// FNT_NUMBER
+DefaultFontType::CTL_TEXT,// FNT_TEXT
+DefaultFontType::CTL_TEXT,// FNT_SERIF
+DefaultFontType::CTL_TEXT,// FNT_SANS
+DefaultFontType::CTL_TEXT // FNT_FIXED
+//OpenSymbol,// FNT_MATH
+};
+
+
+OUString lcl_GetDefaultFontName( LanguageType nLang, sal_uInt16 nIdent )
+{
+assert(nIdent < FNT_END);
+const DefaultFontType *pTable;
+switch ( SvtLanguageOptions::GetScriptTypeOfLanguage( nLang ) )
+{
+case SvtScriptType::LATIN : pTable = aLatinDefFnts; break;
+case SvtScriptType::ASIAN : pTable = aCJKDefFnts; break;
+case SvtScriptType::COMPLEX :   pTable = aCTLDefFnts; break;
+default :
+pTable = aLatinDefFnts;
+SAL_WARN("starmath", "unknown script-type");
+}
+
+return OutputDevice::GetDefaultFont(pTable[ nIdent ], nLang,
+GetDefaultFontFlags::OnlyOne 
).GetFamilyName();
+}
+
+}
+
+
 void SmMathConfig::LoadFormat()
 {
 if (!pFormat)
@@ -863,7 +932,7 @@ void SmMathConfig::LoadFormat()
 if (bUseDefaultFont)
 {
 aFnt = pFormat->GetFont( i );
-aFnt.SetFamilyName( GetDefaultFontName( nLang, i ) );
+aFnt.SetFamilyName( lcl_GetDefaultFontName( nLang, i ) );
 }
 else
 {
diff --git a/starmath/source/format.cxx b/starmath/source/format.cxx
index 0d0713f611dc..a4bf960fd583 100644
--- a/starmath/source/format.cxx
+++ b/starmath/source/format.cxx
@@ -17,71 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
 #include 
-#include 
-
-
-// Latin default-fonts
-static const DefaultFontType aLatinDefFnts[FNT_END] =
-{
-DefaultFontType::SERIF,  // FNT_VARIABLE
-DefaultFontType::SERIF,  // FNT_FUNCTION
-DefaultFontType::SERIF,  // FNT_NUMBER
-DefaultFontType::SERIF,  // FNT_TEXT
-DefaultFontType::SERIF,  // FNT_SERIF
-DefaultFontType::SANS,   // FNT_SANS
-DefaultFontType::FIXED   // FNT_FIXED
-//OpenSymbol,// FNT_MATH
-};
-
-// CJK default-fonts
-//! we use non-asian fonts for v

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

2018-01-23 Thread Takeshi Abe
 sal/qa/rtl/math/test-rtl-math.cxx |   71 ++
 1 file changed, 71 insertions(+)

New commits:
commit f16fdfa559ab62ccde2c2c0cbe1fc9e5ca2f3630
Author: Takeshi Abe 
Date:   Sun Dec 10 01:17:49 2017 +0900

Add unit tests for rtl::math's inverse hyperbolic functions

based on i#97605's test cases.

Change-Id: Id7e57914553ba8801a624f667979badc191108e5
Reviewed-on: https://gerrit.libreoffice.org/46152
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/sal/qa/rtl/math/test-rtl-math.cxx 
b/sal/qa/rtl/math/test-rtl-math.cxx
index 116cc6009fcc..3e718940b097 100644
--- a/sal/qa/rtl/math/test-rtl-math.cxx
+++ b/sal/qa/rtl/math/test-rtl-math.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 CPPUNIT_NS_BEGIN
 
@@ -344,6 +345,73 @@ public:
 CPPUNIT_ASSERT_EQUAL(true,rtl::math::isNan(res));
 }
 
+void test_acosh() {
+double res;
+
+res = rtl::math::acosh(-1.0); // NaN
+CPPUNIT_ASSERT(rtl::math::isNan(res));
+
+res = rtl::math::acosh(0.0); // NaN
+CPPUNIT_ASSERT(rtl::math::isNan(res));
+
+res = rtl::math::acosh(0.5); // NaN
+CPPUNIT_ASSERT(rtl::math::isNan(res));
+
+CPPUNIT_ASSERT_EQUAL(0.0, rtl::math::acosh(1.0));
+
+res = rtl::math::acosh(std::numeric_limits::infinity()); // 
+Inf
+CPPUNIT_ASSERT(!rtl::math::isSignBitSet(res));
+CPPUNIT_ASSERT(rtl::math::isInf(res));
+
+// #i97605
+CPPUNIT_ASSERT_DOUBLES_EQUAL(692.56728736744176, 
rtl::math::acosh(3e+300), 1e-15);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(0.014142017775252324, 
rtl::math::acosh(1.0001), 1e-15);
+}
+
+void test_asinh() {
+double res;
+
+res = rtl::math::asinh(-std::numeric_limits::infinity()); // 
-Inf
+CPPUNIT_ASSERT(rtl::math::isSignBitSet(res));
+CPPUNIT_ASSERT(rtl::math::isInf(res));
+
+CPPUNIT_ASSERT_EQUAL(0.0, rtl::math::asinh(0.0));
+
+res = rtl::math::asinh(std::numeric_limits::infinity()); // 
+Inf
+CPPUNIT_ASSERT(!rtl::math::isSignBitSet(res));
+CPPUNIT_ASSERT(rtl::math::isInf(res));
+
+// #i97605
+CPPUNIT_ASSERT_DOUBLES_EQUAL(691.67568924815798, 
rtl::math::asinh(1.23e+300), 1e-15);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0350378961923076, 
rtl::math::asinh(1.23), 1e-16);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1.23e-300, rtl::math::asinh(1.23e-300), 
1e-303);
+
+// asinh is an odd function
+CPPUNIT_ASSERT_EQUAL(-rtl::math::asinh(1.23e+300), 
rtl::math::asinh(-1.23e+300));
+CPPUNIT_ASSERT_EQUAL(-rtl::math::asinh(1.23), rtl::math::asinh(-1.23));
+CPPUNIT_ASSERT_EQUAL(-rtl::math::asinh(1.23e-300), 
rtl::math::asinh(-1.23e-300));
+}
+
+void test_atanh() {
+double res;
+
+res = rtl::math::atanh(-2.0); // NaN
+CPPUNIT_ASSERT(rtl::math::isNan(res));
+
+res = rtl::math::atanh(-1.0); // -Inf
+CPPUNIT_ASSERT(rtl::math::isSignBitSet(res));
+CPPUNIT_ASSERT(rtl::math::isInf(res));
+
+CPPUNIT_ASSERT_EQUAL(0.0, rtl::math::atanh(0.0));
+
+res = rtl::math::atanh(1.0); // +Inf
+CPPUNIT_ASSERT(!rtl::math::isSignBitSet(res));
+CPPUNIT_ASSERT(rtl::math::isInf(res));
+
+res = rtl::math::atanh(2.0); // NaN
+CPPUNIT_ASSERT(rtl::math::isNan(res));
+}
+
 CPPUNIT_TEST_SUITE(Test);
 CPPUNIT_TEST(test_stringToDouble_good);
 CPPUNIT_TEST(test_stringToDouble_bad);
@@ -354,6 +422,9 @@ public:
 CPPUNIT_TEST(test_expm1);
 CPPUNIT_TEST(test_log1p);
 CPPUNIT_TEST(test_approx);
+CPPUNIT_TEST(test_acosh);
+CPPUNIT_TEST(test_asinh);
+CPPUNIT_TEST(test_atanh);
 CPPUNIT_TEST_SUITE_END();
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-21 Thread Takeshi Abe
 starmath/inc/document.hxx   |6 ++---
 starmath/inc/parse.hxx  |4 +--
 starmath/qa/cppunit/test_cursor.cxx |8 +++
 starmath/qa/cppunit/test_node.cxx   |8 +++
 starmath/qa/cppunit/test_nodetotextvisitors.cxx |   26 +++-
 starmath/qa/cppunit/test_parse.cxx  |4 +--
 starmath/source/document.cxx|   19 +++--
 starmath/source/mathmlexport.cxx|4 +--
 starmath/source/mathmlimport.cxx|4 +--
 starmath/source/node.cxx|2 -
 starmath/source/parse.cxx   |6 ++---
 11 files changed, 39 insertions(+), 52 deletions(-)

New commits:
commit f3d1b2e58c39618d99bf017702ef19f373464b34
Author: Takeshi Abe 
Date:   Thu Jan 18 18:20:12 2018 +0900

starmath: Make SmParser::Parse() return std::unique_ptr

Change-Id: I6c8811f71ab40398043cdcfa3334eee4381b4c7e
Reviewed-on: https://gerrit.libreoffice.org/48098
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index 2d6e63da5f2f..af2ce9475fc3 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -89,7 +89,7 @@ class SM_DLLPUBLIC SmDocShell : public SfxObjectShell, public 
SfxListener
 SmParsermaParser;
 OUStringmaAccText;
 SvtLinguOptions maLinguOptions;
-SmTableNode*mpTree;
+std::unique_ptr mpTree;
 SfxItemPool*mpEditEngineItemPool;
 EditEngine *mpEditEngine;
 VclPtr  mpPrinter;   //q.v. comment to SmPrinter Access!
@@ -177,8 +177,8 @@ public:
 
 voidParse();
 SmParser &  GetParser() { return maParser; }
-const SmTableNode *GetFormulaTree() const  { return mpTree; }
-voidSetFormulaTree(SmTableNode *pTree) { mpTree = pTree; }
+const SmTableNode *GetFormulaTree() const  { return mpTree.get(); }
+voidSetFormulaTree(SmTableNode *pTree) { mpTree.reset(pTree); }
 
 const std::set< OUString > &GetUsedSymbols() const  { return 
maUsedSymbols; }
 
diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index 5c4646e28eb8..a2faa73a3b40 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -78,7 +78,7 @@ class SmParser
 inline bool TokenInGroup( TG nGroup );
 
 // grammar
-SmTableNode *DoTable();
+std::unique_ptr DoTable();
 SmLineNode *DoLine();
 std::unique_ptr DoExpression(bool bUseExtraSpaces = true);
 SmNode *DoRelation();
@@ -114,7 +114,7 @@ public:
  SmParser();
 
 /** Parse rBuffer to formula tree */
-SmTableNode *Parse(const OUString &rBuffer);
+std::unique_ptr Parse(const OUString &rBuffer);
 /** Parse rBuffer to formula subtree that constitutes an expression */
 std::unique_ptr ParseExpression(const OUString &rBuffer);
 
diff --git a/starmath/qa/cppunit/test_cursor.cxx 
b/starmath/qa/cppunit/test_cursor.cxx
index 702777a614f8..403994707d27 100644
--- a/starmath/qa/cppunit/test_cursor.cxx
+++ b/starmath/qa/cppunit/test_cursor.cxx
@@ -68,7 +68,7 @@ void Test::tearDown()
 void Test::testCopyPaste()
 {
 OUString const sInput("a * b + c");
-std::unique_ptr xTree(SmParser().Parse(sInput));
+auto xTree = SmParser().Parse(sInput);
 xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0);
 
 SmCursor aCursor(xTree.get(), xDocShRef.get());
@@ -91,7 +91,7 @@ void Test::testCopyPaste()
 void Test::testCopySelectPaste()
 {
 OUString const sInput("a * b + c");
-std::unique_ptr xTree(SmParser().Parse(sInput));
+auto xTree = SmParser().Parse(sInput);
 xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0);
 
 SmCursor aCursor(xTree.get(), xDocShRef.get());
@@ -118,7 +118,7 @@ void Test::testCopySelectPaste()
 void Test::testCutPaste()
 {
 OUString const sInput("a * b + c");
-std::unique_ptr xTree(SmParser().Parse(sInput));
+auto xTree = SmParser().Parse(sInput);
 xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0);
 
 SmCursor aCursor(xTree.get(), xDocShRef.get());
@@ -141,7 +141,7 @@ void Test::testCutPaste()
 void Test::testCutSelectPaste()
 {
 OUString const sInput("a * b + c");
-std::unique_ptr xTree(SmParser().Parse(sInput));
+auto xTree = SmParser().Parse(sInput);
 xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0);
 
 SmCursor aCursor(xTree.get(), xDocShRef.get());
diff --git a/starmath/qa/cppunit/test_node.cxx 
b/starmath/qa/cppunit/test_node.cxx
index 2a35bdffbe4c..ebf0682f531e 100644
--- a/starmath/qa/cppunit/test_node.cxx
+++ b/starmath/qa/cppunit/test_node.cxx
@@ -64,10 +64,10 @@ void NodeTest::testTdf47813()
 {
 SmParser aParser;
 #define MATRIX "matrix {-2#33##4#-5##6,0#7}"
-std::unique_ptr pNodeA(aParse

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

2018-01-16 Thread Takeshi Abe
 starmath/inc/parse.hxx  |4 +-
 starmath/qa/cppunit/test_nodetotextvisitors.cxx |   33 
 starmath/source/ElementsDockingWindow.cxx   |2 -
 starmath/source/cursor.cxx  |5 ++-
 starmath/source/parse.cxx   |   14 +-
 5 files changed, 25 insertions(+), 33 deletions(-)

New commits:
commit 5306ae7ecd8ffa8bb78c95106b46322ae4ca1157
Author: Takeshi Abe 
Date:   Tue Jan 16 18:40:23 2018 +0900

starmath: Make SmParser::ParseExpression() return std::unique_ptr

Change-Id: Ib8b65dced2af3ac7dca3fe9dd02e70f02c865f79
Reviewed-on: https://gerrit.libreoffice.org/47974
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index d5e014e6717b..5c4646e28eb8 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -80,7 +80,7 @@ class SmParser
 // grammar
 SmTableNode *DoTable();
 SmLineNode *DoLine();
-SmNode *DoExpression(bool bUseExtraSpaces = true);
+std::unique_ptr DoExpression(bool bUseExtraSpaces = true);
 SmNode *DoRelation();
 SmNode *DoSum();
 SmNode *DoProduct();
@@ -116,7 +116,7 @@ public:
 /** Parse rBuffer to formula tree */
 SmTableNode *Parse(const OUString &rBuffer);
 /** Parse rBuffer to formula subtree that constitutes an expression */
-SmNode  *ParseExpression(const OUString &rBuffer);
+std::unique_ptr ParseExpression(const OUString &rBuffer);
 
 const OUString & GetText() const { return m_aBufferString; };
 
diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx 
b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
index 6791e9d6270c..5399e68ec338 100644
--- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx
+++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
@@ -431,18 +431,17 @@ void Test::SimpleSpecialChars()
 void Test::parseandparseagain(const char *formula, const char *test_name)
 {
 OUString output1, output2;
-SmNode *pNode1, *pNode2;
 
 // parse 1
 OUString input = OUString::createFromAscii(formula);
-pNode1 = SmParser().ParseExpression(input);
+auto pNode1 = SmParser().ParseExpression(input);
 pNode1->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0);
-SmNodeToTextVisitor(pNode1, output1);
+SmNodeToTextVisitor(pNode1.get(), output1);
 
 // parse 2
-pNode2 = SmParser().ParseExpression(output1);
+auto pNode2 = SmParser().ParseExpression(output1);
 pNode2->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0);
-SmNodeToTextVisitor(pNode2, output2);
+SmNodeToTextVisitor(pNode2.get(), output2);
 
 // compare
 CPPUNIT_ASSERT_EQUAL_MESSAGE(test_name,
@@ -453,21 +452,17 @@ void Test::parseandparseagain(const char *formula, const 
char *test_name)
 std::unique_ptr mv(new MockVisitor);
 pNode1->Accept(mv.get());
 pNode2->Accept(mv.get());
-
-delete pNode1;
-delete pNode2;
 }
 
 void Test::ParseAndCheck(const char *formula, const char * expected, const 
char *test_name)
 {
 OUString sOutput;
-SmNode *pNode;
 
 // parse
 OUString sInput = OUString::createFromAscii(formula);
-pNode = SmParser().ParseExpression(sInput);
+auto pNode = SmParser().ParseExpression(sInput);
 pNode->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0);
-SmNodeToTextVisitor(pNode, sOutput);
+SmNodeToTextVisitor(pNode.get(), sOutput);
 
 // compare
 OUString sExpected = OUString::createFromAscii(expected);
@@ -478,27 +473,24 @@ void Test::ParseAndCheck(const char *formula, const char 
* expected, const char
 // auxiliary test for Accept()
 std::unique_ptr mv(new MockVisitor);
 pNode->Accept(mv.get());
-
-delete pNode;
 }
 
 // Parse two formula commands and verify that they give the same output
 void Test::ParseAndCompare(const char *formula1, const char *formula2, const 
char *test_name)
 {
 OUString sOutput1, sOutput2;
-SmNode *pNode1, *pNode2;
 
 // parse formula1
 OUString sInput1 = OUString(formula1, strlen(formula1), 
RTL_TEXTENCODING_UTF8);
-pNode1 = SmParser().ParseExpression(sInput1);
+auto pNode1 = SmParser().ParseExpression(sInput1);
 pNode1->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0);
-SmNodeToTextVisitor(pNode1, sOutput1);
+SmNodeToTextVisitor(pNode1.get(), sOutput1);
 
 // parse formula2
 OUString sInput2 = OUString(formula2, strlen(formula2), 
RTL_TEXTENCODING_UTF8);
-pNode2 = SmParser().ParseExpression(sInput2);
+auto pNode2 = SmParser().ParseExpression(sInput2);
 pNode2->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0);
-SmNodeToTextVisitor(pNode2, sOutput2);
+SmNodeToTextVisitor(pNode2.get(), sOutput2);
 
 CPPUNIT_ASSERT_EQUAL_MESSAGE(test_name, sOutput1, sOutput2);
 
@@ -506,9 +498,6 @@ void Test::ParseAndCompare(const char *formula1, const char 
*formula2, const cha
 std::unique_ptr mv(new MockVisit

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

2018-01-11 Thread Takeshi Abe
 starmath/qa/cppunit/test_starmath.cxx |4 ++--
 starmath/source/dialog.cxx|2 +-
 starmath/source/symbol.cxx|   10 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 0f2104cd745329852e6a6d9c93f6af7c5a8c646a
Author: Takeshi Abe 
Date:   Tue Jan 9 18:45:59 2018 +0900

starmath: getLength() > 0 -> !isEmpty()

Change-Id: I72e56e8e8cad77084bf771df8d85cb7d85712437
Reviewed-on: https://gerrit.libreoffice.org/47640
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/starmath/qa/cppunit/test_starmath.cxx 
b/starmath/qa/cppunit/test_starmath.cxx
index e2ee4afeadd9..41fcf3d75f88 100644
--- a/starmath/qa/cppunit/test_starmath.cxx
+++ b/starmath/qa/cppunit/test_starmath.cxx
@@ -363,7 +363,7 @@ void Test::editUndoRedo()
 m_xDocShRef->Execute(aUndo);
 m_xDocShRef->UpdateText();
 OUString sFinalText = m_xDocShRef->GetText();
-CPPUNIT_ASSERT_MESSAGE("Must now be empty", !sFinalText.getLength());
+CPPUNIT_ASSERT_MESSAGE("Must now be empty", sFinalText.isEmpty());
 }
 
 SfxRequest aRedo(SID_REDO, SfxCallMode::SYNCHRON, SmDocShell::GetPool());
@@ -379,7 +379,7 @@ void Test::editUndoRedo()
 m_xDocShRef->UpdateText();
 rEditEngine.ClearModifyFlag();
 OUString sFinalText = m_xDocShRef->GetText();
-CPPUNIT_ASSERT_MESSAGE("Must be empty", !sFinalText.getLength());
+CPPUNIT_ASSERT_MESSAGE("Must be empty", sFinalText.isEmpty());
 }
 
 }
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 3a92349c82f1..ca70ff1626c8 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -1929,7 +1929,7 @@ void SmSymDefineDialog::UpdateButtons()
 OUString aTmpSymbolName(pSymbols->GetText()),
   aTmpSymbolSetName (pSymbolSets->GetText());
 
-if (aTmpSymbolName.getLength() > 0  &&  aTmpSymbolSetName.getLength() > 0)
+if (!aTmpSymbolName.isEmpty() && !aTmpSymbolSetName.isEmpty())
 {
 // are all settings equal?
 //! (Font-, Style- and SymbolSet name comparison is not case sensitive)
diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index 92c799d90411..d989595cc14e 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -137,7 +137,7 @@ bool SmSymbolManager::AddOrReplaceSymbol( const SmSym 
&rSymbol, bool bForceChang
 bool bAdded = false;
 
 const OUString& aSymbolName( rSymbol.GetName() );
-if (aSymbolName.getLength() > 0 && rSymbol.GetSymbolSetName().getLength() 
> 0)
+if (!aSymbolName.isEmpty() && !rSymbol.GetSymbolSetName().isEmpty())
 {
 const SmSym *pFound = GetSymbolByName( aSymbolName );
 const bool bSymbolConflict = pFound && !pFound->IsEqualInUI( rSymbol );
@@ -170,7 +170,7 @@ bool SmSymbolManager::AddOrReplaceSymbol( const SmSym 
&rSymbol, bool bForceChang
 
 void SmSymbolManager::RemoveSymbol( const OUString & rSymbolName )
 {
-if (rSymbolName.getLength() > 0)
+if (!rSymbolName.isEmpty())
 {
 size_t nOldSize = m_aSymbols.size();
 m_aSymbols.erase( rSymbolName );
@@ -192,7 +192,7 @@ std::set< OUString > SmSymbolManager::GetSymbolSetNames() 
const
 const SymbolPtrVec_t SmSymbolManager::GetSymbolSet( const OUString& 
rSymbolSetName )
 {
 SymbolPtrVec_t aRes;
-if (rSymbolSetName.getLength() > 0)
+if (!rSymbolSetName.isEmpty())
 {
 SymbolMap_t::const_iterator aIt( m_aSymbols.begin() );
 for ( ; aIt != m_aSymbols.end(); ++aIt )
@@ -216,8 +216,8 @@ void SmSymbolManager::Load()
 for (size_t i = 0;  i < nSymbolCount;  ++i)
 {
 const SmSym &rSym = aSymbols[i];
-OSL_ENSURE( rSym.GetName().getLength() > 0, "symbol without name!" );
-if (rSym.GetName().getLength() > 0)
+OSL_ENSURE( !rSym.GetName().isEmpty(), "symbol without name!" );
+if (!rSym.GetName().isEmpty())
 AddOrReplaceSymbol( rSym );
 }
 m_bModified = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-08 Thread Takeshi Abe
 starmath/source/cfgitem.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 08de4faa001307a758e182ea981c769357c976bf
Author: Takeshi Abe 
Date:   Sun Jan 7 18:42:35 2018 +0900

starmath: Replace confusing sal_uIntPtr with sal_Int32

Change-Id: If823398b75217f4a5a5bb5c83106d4d9d2e5f6be
Reviewed-on: https://gerrit.libreoffice.org/47527
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 318410638772..170bfe84b796 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -490,11 +490,11 @@ void SmMathConfig::GetSymbols( std::vector< SmSym > 
&rSymbols ) const
 
 void SmMathConfig::SetSymbols( const std::vector< SmSym > &rNewSymbols )
 {
-sal_uIntPtr nCount = rNewSymbols.size();
+auto nCount = sal::static_int_cast(rNewSymbols.size());
 
 Sequence< OUString > aNames = lcl_GetSymbolPropertyNames();
 const OUString *pNames = aNames.getConstArray();
-sal_uIntPtr nSymbolProps = sal::static_int_cast< sal_uInt32 
>(aNames.getLength());
+sal_Int32 nSymbolProps = aNames.getLength();
 
 Sequence< PropertyValue > aValues( nCount * nSymbolProps );
 PropertyValue *pValues = aValues.getArray();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-06 Thread Takeshi Abe
 include/svtools/tabbar.hxx|2 
 svtools/source/control/tabbar.cxx |  109 --
 2 files changed, 46 insertions(+), 65 deletions(-)

New commits:
commit 1a012a90b454604d127bbfb5babd5f92e2231524
Author: Takeshi Abe 
Date:   Sat Jan 6 21:22:24 2018 +0900

svtools: Simplify TabBar_Impl with std::unique_ptr

Change-Id: If477373f6e5a39ccd61332356a821f7c7d38d28d
Reviewed-on: https://gerrit.libreoffice.org/47488
Reviewed-by: Noel Grandin 
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx
index 7c13af5b9cee..8996cb0f60bf 100644
--- a/include/svtools/tabbar.hxx
+++ b/include/svtools/tabbar.hxx
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 
 /*
 
@@ -308,7 +307,6 @@ class TabBarEdit;
 
 struct ImplTabBarItem;
 struct TabBar_Impl;
-typedef std::vector ImplTabBarList;
 
 
 class SVT_DLLPUBLIC TabBar : public vcl::Window
diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index 8fab52d1fcbd..6857bf46cd13 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -33,7 +33,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 namespace
@@ -489,21 +491,10 @@ struct TabBar_Impl
 ScopedVclPtr mpLastButton;
 ScopedVclPtr mpAddButton;
 ScopedVclPtrmpEdit;
-ImplTabBarList  mpItemList;
+std::vector> mpItemList;
 
 svt::AccessibleFactoryAccess  maAccessibleFactory;
 
-TabBar_Impl() {}
-
-~TabBar_Impl()
-{
-for (ImplTabBarItem* i : mpItemList)
-{
-delete i;
-}
-mpItemList.clear();
-}
-
 sal_uInt16 getItemSize()
 {
 return static_cast(mpItemList.size());
@@ -582,7 +573,7 @@ ImplTabBarItem* TabBar::seek( size_t i )
 if ( i < mpImpl->mpItemList.size() )
 {
 maCurrentItemList = i;
-return mpImpl->mpItemList[maCurrentItemList];
+return mpImpl->mpItemList[maCurrentItemList].get();
 }
 return nullptr;
 }
@@ -591,7 +582,7 @@ ImplTabBarItem* TabBar::prev()
 {
 if ( maCurrentItemList > 0 )
 {
-return mpImpl->mpItemList[--maCurrentItemList];
+return mpImpl->mpItemList[--maCurrentItemList].get();
 }
 return nullptr;
 }
@@ -600,7 +591,7 @@ ImplTabBarItem* TabBar::next()
 {
 if ( maCurrentItemList + 1 < mpImpl->mpItemList.size() )
 {
-return mpImpl->mpItemList[++maCurrentItemList];
+return mpImpl->mpItemList[++maCurrentItemList].get();
 }
 return nullptr;
 }
@@ -675,7 +666,7 @@ bool TabBar::ImplCalcWidth()
 }
 
 bool bChanged = false;
-for (ImplTabBarItem* pItem : mpImpl->mpItemList)
+for (auto& pItem : mpImpl->mpItemList)
 {
 long nNewWidth = GetTextWidth(pItem->GetRenderText());
 if (mnCurMaxWidth && (nNewWidth > mnCurMaxWidth))
@@ -713,7 +704,7 @@ void TabBar::ImplFormat()
 
 sal_uInt16 n = 0;
 long x = mnOffX;
-for (ImplTabBarItem* pItem : mpImpl->mpItemList)
+for (auto& pItem : mpImpl->mpItemList)
 {
 // At all non-visible tabs an empty rectangle is set
 if ((n + 1 < mnFirstPos) || (x > mnLastOffX))
@@ -878,7 +869,7 @@ void TabBar::ImplShowPage( sal_uInt16 nPos )
 // calculate width
 long nWidth = GetOutputSizePixel().Width();
 
-ImplTabBarItem* pItem = mpImpl->mpItemList[nPos];
+auto& pItem = mpImpl->mpItemList[nPos];
 if (nPos < mnFirstPos)
 SetFirstPageId( pItem->mnId );
 else if (pItem->maRect.Right() > nWidth)
@@ -1009,7 +1000,7 @@ void TabBar::MouseButtonDown(const MouseEvent& rMEvt)
 n = 0;
 while (n < nCurPos)
 {
-auto pItem = mpImpl->mpItemList[n];
+auto& pItem = mpImpl->mpItemList[n];
 bSelect = n >= nPos;
 
 if (pItem->mbSelect != bSelect)
@@ -1032,7 +1023,7 @@ void TabBar::MouseButtonDown(const MouseEvent& rMEvt)
 n = nCurPos;
 while (n < nCount)
 {
-auto pItem = mpImpl->mpItemList[n];
+auto& pItem = mpImpl->mpItemList[n];
 
 bSelect = n <= nPos;
 
@@ -1085,7 +1076,7 @@ void TabBar::MouseButtonDown(const MouseEvent& rMEvt)
 if (nSelId != mnCurPageId)
 {
 sal_uInt16 nPos = GetPagePos(nSelId);
-auto pItem = mpImpl->mpItemList[nPos];
+auto& pItem = mpImpl->mpItemList[nPos];
 
 if (!pItem->mbSelect)
 {
@@ -1095,14 +1086,13 @@ void TabBar::MouseButtonDown(const MouseEvent& rMEvt)
 bUpdate = true;
 
  

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

2018-01-05 Thread Takeshi Abe
 include/svtools/headbar.hxx|6 -
 svtools/source/control/headbar.cxx |  121 +++--
 2 files changed, 52 insertions(+), 75 deletions(-)

New commits:
commit d25465aed6cc15cf51529d92bdf3475d2b6d551f
Author: Takeshi Abe 
Date:   Fri Jan 5 19:46:22 2018 +0900

svtools: Simplify HeaderBar with std::unique_ptr

Change-Id: I5376616ed1b1a1087dd8bac6830d31212252e4bd
Reviewed-on: https://gerrit.libreoffice.org/47459
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/headbar.hxx b/include/svtools/headbar.hxx
index 077718815656..a575bd7c3fb5 100644
--- a/include/svtools/headbar.hxx
+++ b/include/svtools/headbar.hxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /*
 
@@ -173,8 +174,6 @@ HeaderBarItemBits::CLICKABLE, but 
HeaderBarItemBits::FIXEDPOS.
 class Accelerator;
 class ImplHeadItem;
 
-typedef ::std::vector< ImplHeadItem* > ImplHeadItemList;
-
 #define WB_BOTTOMBORDER ((WinBits)0x0400)
 #define WB_BUTTONSTYLE  ((WinBits)0x0800)
 #define WB_STDHEADERBAR (WB_BUTTONSTYLE | WB_BOTTOMBORDER)
@@ -216,7 +215,7 @@ class VCLXHeaderBar;
 class SVT_DLLPUBLIC HeaderBar : public vcl::Window
 {
 private:
-ImplHeadItemList*   mpItemList;
+std::vector> mvItemList;
 longmnBorderOff1;
 longmnBorderOff2;
 longmnOffset;
@@ -266,7 +265,6 @@ private:
 public:
 HeaderBar( vcl::Window* pParent, WinBits nWinBits );
 virtual ~HeaderBar() override;
-virtual void dispose() override;
 
 virtual voidMouseButtonDown( const MouseEvent& rMEvt ) override;
 virtual voidMouseMove( const MouseEvent& rMEvt ) override;
diff --git a/svtools/source/control/headbar.cxx 
b/svtools/source/control/headbar.cxx
index bd66dbc52c02..42c0f9cd092c 100644
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -56,7 +56,6 @@ public:
 
 void HeaderBar::ImplInit( WinBits nWinStyle )
 {
-mpItemList  = new ImplHeadItemList;
 mnBorderOff1= 0;
 mnBorderOff2= 0;
 mnOffset= 0;
@@ -103,22 +102,7 @@ HeaderBar::HeaderBar( vcl::Window* pParent, WinBits 
nWinStyle ) :
 SetSizePixel( CalcWindowSizePixel() );
 }
 
-HeaderBar::~HeaderBar()
-{
-disposeOnce();
-}
-
-void HeaderBar::dispose()
-{
-if (mpItemList)
-{
-for (ImplHeadItem* i : *mpItemList)
-delete i;
-delete mpItemList;
-mpItemList = nullptr;
-}
-Window::dispose();
-}
+HeaderBar::~HeaderBar() = default;
 
 void HeaderBar::ApplySettings(vcl::RenderContext& rRenderContext)
 {
@@ -153,14 +137,14 @@ long HeaderBar::ImplGetItemPos( sal_uInt16 nPos ) const
 {
 long nX = -mnOffset;
 for ( size_t i = 0; i < nPos; i++ )
-nX += (*mpItemList)[ i ]->mnSize;
+nX += mvItemList[ i ]->mnSize;
 return nX;
 }
 
 tools::Rectangle HeaderBar::ImplGetItemRect( sal_uInt16 nPos ) const
 {
 tools::Rectangle aRect( ImplGetItemPos( nPos ), 0, 0, mnDY-1 );
-aRect.Right() = aRect.Left() + (*mpItemList)[ nPos ]->mnSize - 1;
+aRect.Right() = aRect.Left() + mvItemList[ nPos ]->mnSize - 1;
 // check for overflow on various systems
 if ( aRect.Right() > 16000 )
 aRect.Right() = 16000;
@@ -170,14 +154,13 @@ tools::Rectangle HeaderBar::ImplGetItemRect( sal_uInt16 
nPos ) const
 sal_uInt16 HeaderBar::ImplHitTest( const Point& rPos,
long& nMouseOff, sal_uInt16& nPos ) const
 {
-ImplHeadItem*   pItem;
-size_t  nCount = (sal_uInt16)mpItemList->size();
+size_t  nCount = (sal_uInt16)mvItemList.size();
 boolbLastFixed = true;
 longnX = -mnOffset;
 
 for ( size_t i = 0; i < nCount; i++ )
 {
-pItem = (*mpItemList)[ i ];
+auto& pItem = mvItemList[ i ];
 
 if ( rPos.X() < (nX+pItem->mnSize) )
 {
@@ -215,7 +198,7 @@ sal_uInt16 HeaderBar::ImplHitTest( const Point& rPos,
 
 if ( !bLastFixed )
 {
-pItem = (*mpItemList)[ nCount-1 ];
+auto& pItem = mvItemList[ nCount-1 ];
 if ( (pItem->mnSize < 4)  && (rPos.X() < (nX+HEADERBAR_SPLITOFF)) )
 {
 nPos = nCount-1;
@@ -302,7 +285,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& 
rRenderContext, sal_uInt16 nPos
 return;
 }
 
-ImplHeadItem* pItem  = (*mpItemList)[nPos];
+auto& pItem  = mvItemList[nPos];
 HeaderBarItemBits nBits = pItem->mnBits;
 const StyleSettings& rStyleSettings = 
rRenderContext.GetSettings().GetStyleSettings();
 
@@ -617,7 +600,7 @@ void HeaderBar::ImplUpdate(sal_uInt16 nPos, bool bEnd)
 return;
 
 tools::Rectangle aRect;
-size_t nItemCount = mpItemList->size();
+size_t nItemCoun

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

2017-12-27 Thread Takeshi Abe
 include/svtools/fmtfield.hxx|   11 +++
 svtools/source/control/fmtfield.cxx |   14 +-
 2 files changed, 8 insertions(+), 17 deletions(-)

New commits:
commit d77d0d8e2fabc9dfc9eef3e532c31351632fb7b7
Author: Takeshi Abe 
Date:   Wed Dec 27 14:02:17 2017 +0900

svtools: Simplify DoubleNumericField with std::unique_ptr

Change-Id: I25df3a06afa5e1eb2fa282f2be2ae1ea69aa0ab5
Reviewed-on: https://gerrit.libreoffice.org/47077
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/fmtfield.hxx b/include/svtools/fmtfield.hxx
index e8d794fd76f6..6be6e44c59b0 100644
--- a/include/svtools/fmtfield.hxx
+++ b/include/svtools/fmtfield.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace validation { class NumberValidator; }
 
@@ -255,15 +256,9 @@ protected:
 class SVT_DLLPUBLIC DoubleNumericField final : public FormattedField
 {
 public:
-DoubleNumericField(vcl::Window* pParent, WinBits nStyle)
-:FormattedField(pParent, nStyle)
-,m_pNumberValidator( nullptr )
-{
-ResetConformanceTester();
-}
+DoubleNumericField(vcl::Window* pParent, WinBits nStyle);
 
 virtual ~DoubleNumericField() override;
-virtual void dispose() override;
 
 private:
 virtual bool CheckText(const OUString& sText) const override;
@@ -271,7 +266,7 @@ private:
 virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat) override;
 void ResetConformanceTester();
 
-validation::NumberValidator*m_pNumberValidator;
+std::unique_ptr m_pNumberValidator;
 };
 
 
diff --git a/svtools/source/control/fmtfield.cxx 
b/svtools/source/control/fmtfield.cxx
index 3b47e08c938b..20770f95569b 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -1007,16 +1007,13 @@ void FormattedField::UseInputStringForFormatting()
 }
 
 
-DoubleNumericField::~DoubleNumericField()
+DoubleNumericField::DoubleNumericField(vcl::Window* pParent, WinBits nStyle)
+: FormattedField(pParent, nStyle)
 {
-disposeOnce();
+ResetConformanceTester();
 }
 
-void DoubleNumericField::dispose()
-{
-delete m_pNumberValidator;
-FormattedField::dispose();
-}
+DoubleNumericField::~DoubleNumericField() = default;
 
 void DoubleNumericField::FormatChanged(FORMAT_CHANGE_TYPE nWhat)
 {
@@ -1052,8 +1049,7 @@ void DoubleNumericField::ResetConformanceTester()
 cSeparatorDecimal = sSeparator[0];
 }
 
-delete m_pNumberValidator;
-m_pNumberValidator = new validation::NumberValidator( cSeparatorThousand, 
cSeparatorDecimal );
+m_pNumberValidator.reset(new validation::NumberValidator( 
cSeparatorThousand, cSeparatorDecimal ));
 }
 
 DoubleCurrencyField::DoubleCurrencyField(vcl::Window* pParent, WinBits nStyle)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-25 Thread Takeshi Abe
 include/svtools/ctrlbox.hxx|5 -
 svtools/source/control/ctrlbox.cxx |   98 ++---
 2 files changed, 41 insertions(+), 62 deletions(-)

New commits:
commit c2ae5bc29b7064a599871358e6a4bb7b1dec2b85
Author: Takeshi Abe 
Date:   Sun Dec 24 20:46:53 2017 +0900

svtools: Use std::unique_ptr for LineListBox

This also inlines LineListBox::ImplInit(). Note that m_vLineList
never contains nullptr.

Change-Id: Ia4798943fbb53e1720d51faff7643e46d2cd2585
Reviewed-on: https://gerrit.libreoffice.org/47046
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx
index 6e0358721885..b446b7a0503d 100644
--- a/include/svtools/ctrlbox.hxx
+++ b/include/svtools/ctrlbox.hxx
@@ -31,12 +31,12 @@
 
 #include 
 #include 
+#include 
 
 class FontList;
 class ImpLineListData;
 enum class SvxBorderLineStyle : sal_Int16;
 
-typedef ::std::vector< ImpLineListData*  > ImpLineList;
 typedef ::std::vector< FontMetric > ImplFontList;
 
 /*
@@ -232,7 +232,6 @@ private:
 Color nColor1, Color nColor2, Color 
nColorDist,
 SvxBorderLineStyle nStyle, Bitmap& rBmp );
 using Window::ImplInit;
-SVT_DLLPRIVATE void ImplInit();
 voidUpdatePaintLineColor();   // returns sal_True if 
maPaintCol has changed
 virtual voidDataChanged( const DataChangedEvent& rDCEvt ) override;
 
@@ -247,7 +246,7 @@ private:
 LineListBox( const LineListBox& ) = delete;
 LineListBox&operator =( const LineListBox& ) = delete;
 
-ImpLineList*pLineList;
+std::vector> m_vLineList;
 longm_nWidth;
 OUStringm_sNone;
 ScopedVclPtr   aVirDev;
diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index b7b3ceae461a..16c6fdcb7310 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -470,11 +470,16 @@ void LineListBox::ImpGetLine( long nLine1, long nLine2, 
long nDistance,
 rBmp = aVirDev->GetBitmap( Point(), Size( aSize.Width(), n1+nDist+n2 ) );
 }
 
-void LineListBox::ImplInit()
+LineListBox::LineListBox( vcl::Window* pParent, WinBits nWinStyle ) :
+ListBox( pParent, nWinStyle ),
+m_nWidth( 5 ),
+m_sNone( ),
+aVirDev( VclPtr::Create() ),
+aColor( COL_BLACK ),
+maPaintCol( COL_BLACK )
 {
 aTxtSize.Width()  = GetTextWidth( " " );
 aTxtSize.Height() = GetTextHeight();
-pLineList   = new ImpLineList;
 eSourceUnit = FUNIT_POINT;
 
 aVirDev->SetLineColor();
@@ -483,17 +488,6 @@ void LineListBox::ImplInit()
 UpdatePaintLineColor();
 }
 
-LineListBox::LineListBox( vcl::Window* pParent, WinBits nWinStyle ) :
-ListBox( pParent, nWinStyle ),
-m_nWidth( 5 ),
-m_sNone( ),
-aVirDev( VclPtr::Create() ),
-aColor( COL_BLACK ),
-maPaintCol( COL_BLACK )
-{
-ImplInit();
-}
-
 extern "C" SAL_DLLPUBLIC_EXPORT void makeLineListBox(VclPtr & 
rRet, VclPtr & pParent, VclBuilder::stringmap & rMap)
 {
 bool bDropdown = BuilderUtils::extractDropdown(rMap);
@@ -513,10 +507,7 @@ LineListBox::~LineListBox()
 
 void LineListBox::dispose()
 {
-for (ImpLineListData* p : *pLineList)
-delete p;
-pLineList->clear();
-delete pLineList;
+m_vLineList.clear();
 ListBox::dispose();
 }
 
@@ -528,11 +519,11 @@ sal_Int32 LineListBox::GetStylePos( sal_Int32 nListPos, 
long nWidth )
 
 sal_Int32 n = 0;
 size_t i = 0;
-size_t nCount = pLineList->size();
+size_t nCount = m_vLineList.size();
 while ( nPos == LISTBOX_ENTRY_NOTFOUND && i < nCount )
 {
-ImpLineListData* pData = (*pLineList)[ i ];
-if ( pData && pData->GetMinWidth() <= nWidth )
+auto& pData = m_vLineList[ i ];
+if ( pData->GetMinWidth() <= nWidth )
 {
 if ( nListPos == n )
 nPos = static_cast(i);
@@ -555,26 +546,22 @@ void LineListBox::InsertEntry(
 const BorderWidthImpl& rWidthImpl, SvxBorderLineStyle nStyle, long 
nMinWidth,
 ColorFunc pColor1Fn, ColorFunc pColor2Fn, ColorDistFunc pColorDistFn )
 {
-ImpLineListData* pData = new ImpLineListData(
-rWidthImpl, nStyle, nMinWidth, pColor1Fn, pColor2Fn, pColorDistFn);
-pLineList->push_back( pData );
+m_vLineList.emplace_back(new ImpLineListData(
+rWidthImpl, nStyle, nMinWidth, pColor1Fn, pColor2Fn, pColorDistFn));
 }
 
 sal_Int32 LineListBox::GetEntryPos( SvxBorderLineStyle nStyle ) const
 {
 if(nStyle == SvxBorderLineStyle::NONE && !m_sNone.isEmpty())
 return 0;
-for ( size_t i = 0, n = pLineList->size(); i < n; ++i ) {
-ImpLineListData* pData = (*pLine

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

2017-12-23 Thread Takeshi Abe
 svtools/source/contnr/svimpbox.cxx |   11 +++
 svtools/source/inc/svimpbox.hxx|3 ++-
 2 files changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 40cfea9a5b4854ada381642d502bf8f74c87c00b
Author: Takeshi Abe 
Date:   Sat Dec 23 17:47:29 2017 +0900

svtools: Use std::unique_ptr for SvImpLBox

Change-Id: I4c5917eaa478e76411e9d8bbc5bd59c655693383
Reviewed-on: https://gerrit.libreoffice.org/47012
Reviewed-by: Julien Nabet 
Tested-by: Noel Grandin 

diff --git a/svtools/source/contnr/svimpbox.cxx 
b/svtools/source/contnr/svimpbox.cxx
index acf2e84e216f..8c3f8ed0e093 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -53,7 +53,6 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvTreeList* 
pLBTree, WinBits nWinS
 , aFctSet(this, pLBView)
 , bAreChildrenTransient(true)
 , mbForceMakeVisible (false)
-, m_pStringSorter(nullptr)
 , aVerSBar(VclPtr::Create(pLBView, WB_DRAG | WB_VSCROLL))
 , aOutputSize(0, 0)
 , mbNoAutoCurEntry(false)
@@ -119,7 +118,6 @@ SvImpLBox::~SvImpLBox()
 aEditIdle.Stop();
 StopUserEvent();
 
-delete m_pStringSorter;
 if ( osl_atomic_decrement(&s_nImageRefCount) == 0 )
 {
 DELETEZ(s_pDefCollapsed);
@@ -141,17 +139,14 @@ void SvImpLBox::UpdateStringSorter()
 if( aLocale.Language != rNewLocale.Language ||
 aLocale.Country != rNewLocale.Country ||
 aLocale.Variant != rNewLocale.Variant )
-{
-delete m_pStringSorter;
-m_pStringSorter = nullptr;
-}
+m_pStringSorter.reset();
 }
 
 if( !m_pStringSorter )
 {
-m_pStringSorter = new comphelper::string::NaturalStringSorter(
+m_pStringSorter.reset(new comphelper::string::NaturalStringSorter(
   ::comphelper::getProcessComponentContext(),
-  rNewLocale);
+  rNewLocale));
 }
 }
 
diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx
index 1c56643c11ee..373c715e3577 100644
--- a/svtools/source/inc/svimpbox.hxx
+++ b/svtools/source/inc/svimpbox.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "svtaccessiblefactory.hxx"
 
@@ -142,7 +143,7 @@ private:
 Point   aEditClickPos;
 IdleaEditIdle;
 
-comphelper::string::NaturalStringSorter *m_pStringSorter;
+std::unique_ptr m_pStringSorter;
 
 std::vector< short > aContextBmpWidthVector;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-17 Thread Takeshi Abe
 include/svtools/grfmgr.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d9c8376fccfa133a23c0af8dd50564388d288892
Author: Takeshi Abe 
Date:   Sun Dec 17 23:26:14 2017 +0900

svtools: Delete copy ctor in a standard way

Change-Id: I3d44c7b0ff16897b49f3f3e5a7026dcd1be1301f
Reviewed-on: https://gerrit.libreoffice.org/46645
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index 772d8a823eb7..f5208d7f04f5 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -498,8 +498,8 @@ private:
 sal_uLong   mnUsedSize; // currently used memory footprint of 
all swapped in graphics
 GraphicCache*   mpCache;
 
-GraphicManager( const GraphicManager& ) {}
-GraphicManager& operator=( const GraphicManager& ) { return *this; }
+GraphicManager( const GraphicManager& ) = delete;
+GraphicManager& operator=( const GraphicManager& ) = delete;
 
 bool SVT_DLLPRIVATE ImplDraw(
 OutputDevice* pOut,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-11 Thread Takeshi Abe
 svtools/source/brwbox/brwbox2.cxx |   15 +++
 svtools/source/brwbox/datwin.cxx  |   18 ++
 svtools/source/brwbox/datwin.hxx  |5 ++---
 3 files changed, 15 insertions(+), 23 deletions(-)

New commits:
commit de37c379847afcef8ddf3f03f84cca1b61104851
Author: Takeshi Abe 
Date:   Mon Dec 11 22:28:32 2017 +0900

svtools: Simplify BrowserDataWin with std::unique_ptr

Change-Id: Ib63b60c1f5326cfc1b163164ae5a783ea8ba1919
Reviewed-on: https://gerrit.libreoffice.org/46256
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/svtools/source/brwbox/brwbox2.cxx 
b/svtools/source/brwbox/brwbox2.cxx
index f1030cd9ec31..8ff0f3e860e5 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star::datatransfer;
 
@@ -234,7 +235,7 @@ void BrowseBox::ToggleSelection()
 bNotToggleSel = true;
 
 // accumulate areas of rows to highlight
-RectangleList aHighlightList;
+std::vector aHighlightList;
 long nLastRowInRect = 0; // for the CFront
 
 // don't highlight handle column
@@ -257,20 +258,18 @@ void BrowseBox::ToggleSelection()
 Point( nOfsX, (nRow-nTopRow)*GetDataRowHeight() ),
 Size( pDataWin->GetSizePixel().Width(), GetDataRowHeight() ) );
 if ( aHighlightList.size() && nLastRowInRect == ( nRow - 1 ) )
-aHighlightList[ 0 ]->Union( aAddRect );
+aHighlightList[ 0 ].Union( aAddRect );
 else
-aHighlightList.insert( aHighlightList.begin(), new 
tools::Rectangle( aAddRect ) );
+aHighlightList.emplace( aHighlightList.begin(), aAddRect );
 nLastRowInRect = nRow;
 }
 
 // unhighlight the old selection (if any)
-for ( size_t i = aHighlightList.size(); i > 0; )
+while ( !aHighlightList.empty() )
 {
-tools::Rectangle *pRect = aHighlightList[ --i ];
-pDataWin->Invalidate( *pRect );
-delete pRect;
+pDataWin->Invalidate( aHighlightList.back() );
+aHighlightList.pop_back();
 }
-aHighlightList.clear();
 
 // unhighlight old column selection (if any)
 for ( long nColId = pColSel ? pColSel->FirstSelected() : 
BROWSER_ENDOFSELECTION;
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index 2378e91ed4f5..69d6501a24da 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -214,8 +214,6 @@ void BrowserDataWin::dispose()
 {
 bInDtor = true;
 
-for (tools::Rectangle* i : aInvalidRegion)
-delete i;
 aInvalidRegion.clear();
 pHeaderBar.clear();
 pEventWin.clear();
@@ -283,7 +281,7 @@ void BrowserDataWin::Paint(vcl::RenderContext& 
rRenderContext, const tools::Rect
 {
 if (bInPaint)
 {
-aInvalidRegion.push_back(new tools::Rectangle(rRect));
+aInvalidRegion.emplace_back(rRect);
 return;
 }
 bInPaint = true;
@@ -293,7 +291,7 @@ void BrowserDataWin::Paint(vcl::RenderContext& 
rRenderContext, const tools::Rect
 }
 else
 {
-aInvalidRegion.push_back(new tools::Rectangle(rRect));
+aInvalidRegion.emplace_back(rRect);
 }
 }
 
@@ -637,10 +635,8 @@ void BrowserDataWin::SetUpdateMode( bool bMode )
 
 void BrowserDataWin::DoOutstandingInvalidations()
 {
-for (tools::Rectangle* i : aInvalidRegion) {
-Control::Invalidate( *i );
-delete i;
-}
+for (auto& rRect : aInvalidRegion)
+Control::Invalidate( rRect );
 aInvalidRegion.clear();
 }
 
@@ -649,10 +645,8 @@ void BrowserDataWin::Invalidate( InvalidateFlags nFlags )
 {
 if ( !GetUpdateMode() )
 {
-for (tools::Rectangle* i : aInvalidRegion)
-delete i;
 aInvalidRegion.clear();
-aInvalidRegion.push_back( new tools::Rectangle( Point( 0, 0 ), 
GetOutputSizePixel() ) );
+aInvalidRegion.emplace_back( Point( 0, 0 ), GetOutputSizePixel() );
 }
 else
 Window::Invalidate( nFlags );
@@ -662,7 +656,7 @@ void BrowserDataWin::Invalidate( InvalidateFlags nFlags )
 void BrowserDataWin::Invalidate( const tools::Rectangle& rRect, 
InvalidateFlags nFlags )
 {
 if ( !GetUpdateMode() )
-aInvalidRegion.push_back( new tools::Rectangle( rRect ) );
+aInvalidRegion.emplace_back( rRect );
 else
 Window::Invalidate( rRect, nFlags );
 }
diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx
index 81366e31548e..ab8ba930d193 100644
--- a/svtools/source/brwbox/datwin.hxx
+++ b/svtools/source/brwbox/datwin.hxx
@@ -25,13 +25,12 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 
 #define MIN_COLUMNWIDTH  2
 
-typedef ::std::vector< tools::Rectangle* > RectangleList;
-
 
 class ButtonFrame
 {
@@ -101,7 +100,7 @@ public:
 
 OUStringaRealRow

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

2017-12-09 Thread Takeshi Abe
 include/svtools/imap.hxx  |5 +++--
 svtools/source/misc/imap.cxx  |   38 +-
 svtools/source/misc/imap2.cxx |   22 --
 3 files changed, 28 insertions(+), 37 deletions(-)

New commits:
commit 0fa13a403fed6e729e58963479d34694afa7b8d8
Author: Takeshi Abe 
Date:   Sat Dec 9 23:28:39 2017 +0900

svtools: Simplify ImageMap with std::unique_ptr

Change-Id: I49b3c21ff4d8177fb75197d6641040be0ace6324
Reviewed-on: https://gerrit.libreoffice.org/46149
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/imap.hxx b/include/svtools/imap.hxx
index 427d2768b67d..e60efb9990ed 100644
--- a/include/svtools/imap.hxx
+++ b/include/svtools/imap.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 class Point;
@@ -35,7 +36,7 @@ class SVT_DLLPUBLIC ImageMap final
 {
 private:
 
-::std::vector< IMapObject* > maList;
+std::vector> maList;
 OUString aName;
 
 // binary saving/loading
@@ -81,7 +82,7 @@ public:
 // not be destroyed from outside
 IMapObject* GetIMapObject( size_t nPos ) const
 {
-return ( nPos < maList.size() ) ? maList[ nPos ] : 
nullptr;
+return ( nPos < maList.size() ) ? maList[ nPos 
].get() : nullptr;
 }
 
 // returns the object which was hit first or NULL;
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index 471399fd40bc..b06fd21042db 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -570,15 +570,15 @@ ImageMap::ImageMap( const ImageMap& rImageMap )
 switch( pCopyObj->GetType() )
 {
 case IMAP_OBJ_RECTANGLE:
-maList.push_back( new IMapRectangleObject( 
*static_cast( pCopyObj ) ) );
+maList.emplace_back( new IMapRectangleObject( 
*static_cast( pCopyObj ) ) );
 break;
 
 case IMAP_OBJ_CIRCLE:
-maList.push_back( new IMapCircleObject( 
*static_cast( pCopyObj ) ) );
+maList.emplace_back( new IMapCircleObject( 
*static_cast( pCopyObj ) ) );
 break;
 
 case IMAP_OBJ_POLYGON:
-maList.push_back( new IMapPolygonObject( 
*static_cast( pCopyObj ) ) );
+maList.emplace_back( new IMapPolygonObject( 
*static_cast( pCopyObj ) ) );
 break;
 
 default:
@@ -598,8 +598,6 @@ ImageMap::ImageMap( const ImageMap& rImageMap )
 
 ImageMap::~ImageMap()
 {
-
-ClearImageMap();
 }
 
 
@@ -611,8 +609,6 @@ ImageMap::~ImageMap()
 
 void ImageMap::ClearImageMap()
 {
-for(IMapObject* i : maList)
-delete i;
 maList.clear();
 
 aName.clear();
@@ -638,15 +634,15 @@ ImageMap& ImageMap::operator=( const ImageMap& rImageMap )
 switch( pCopyObj->GetType() )
 {
 case IMAP_OBJ_RECTANGLE:
-maList.push_back( new IMapRectangleObject( 
*static_cast(pCopyObj) ) );
+maList.emplace_back( new IMapRectangleObject( 
*static_cast(pCopyObj) ) );
 break;
 
 case IMAP_OBJ_CIRCLE:
-maList.push_back( new IMapCircleObject( 
*static_cast(pCopyObj) ) );
+maList.emplace_back( new IMapCircleObject( 
*static_cast(pCopyObj) ) );
 break;
 
 case IMAP_OBJ_POLYGON:
-maList.push_back( new IMapPolygonObject( 
*static_cast(pCopyObj) ) );
+maList.emplace_back( new IMapPolygonObject( 
*static_cast(pCopyObj) ) );
 break;
 
 default:
@@ -678,7 +674,7 @@ bool ImageMap::operator==( const ImageMap& rImageMap )
 
 for ( size_t i = 0; ( i < nCount ) && !bDifferent; i++ )
 {
-IMapObject* pObj = maList[ i ];
+IMapObject* pObj = maList[ i ].get();
 IMapObject* pEqObj = rImageMap.GetIMapObject( i );
 
 if ( pObj->GetType() == pEqObj->GetType() )
@@ -745,15 +741,15 @@ void ImageMap::InsertIMapObject( const IMapObject& 
rIMapObject )
 switch( rIMapObject.GetType() )
 {
 case IMAP_OBJ_RECTANGLE:
-maList.push_back( new IMapRectangleObject( static_cast( rIMapObject ) ) );
+maList.emplace_back( new IMapRectangleObject( static_cast( rIMapObject ) ) );
 break;
 
 case IMAP_OBJ_CIRCLE:
-maList.push_back( new IMapCircleObject( static_cast( rIMapObject ) ) );
+maList.emplace_back( new IMapCircleObject( static_cast( rIMapObject ) ) );
 break;
 
 case IMAP_OBJ_POLYGON:
-maList.push_back( new IMapPolygonObject( static_cast( rIMapObject ) ) );
+maList.emplace_back( new IMapPolygonObject( static_cast( rIMapObject ) ) );
 break;
 
 default:
@@ -788,9 +784,9 @@ IMapObject* ImageMap::GetHitIMapObject

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

2017-11-23 Thread Takeshi Abe
 xmloff/source/text/txtprhdl.hxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit e0bd8f36964b84d7649b7705c3df98256d3ce627
Author: Takeshi Abe 
Date:   Thu Nov 23 17:57:04 2017 +0900

xmloff: Drop non-existent XMLTextPropertyHandlerFactory_Impl

Change-Id: I9cef470e0592e1b90d2cc0f2830c60938daf873e
Reviewed-on: https://gerrit.libreoffice.org/45126
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/xmloff/source/text/txtprhdl.hxx b/xmloff/source/text/txtprhdl.hxx
index 8870268eb0a8..6b1703f16eaa 100644
--- a/xmloff/source/text/txtprhdl.hxx
+++ b/xmloff/source/text/txtprhdl.hxx
@@ -21,9 +21,6 @@
 
 
 #include 
-#include 
-
-class XMLTextPropertyHandlerFactory_Impl;
 
 class XMLTextPropertyHandlerFactory : public XMLPropertyHandlerFactory
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-21 Thread Takeshi Abe
 xmloff/source/core/xmluconv.cxx   |2 +-
 xmloff/source/forms/elementexport.cxx |8 
 xmloff/source/style/csmaphdl.cxx  |2 +-
 xmloff/source/text/txtstyli.cxx   |2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 02393281b6964b6657985a453c6f1a43ac77411c
Author: Takeshi Abe 
Date:   Wed Nov 22 09:31:01 2017 +0900

xmloff: These arrays are constant

Change-Id: I834e23610facb8b4b35f0a377e33b744e7725d1f
Reviewed-on: https://gerrit.libreoffice.org/45066
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx
index 0285aa3f7a3f..bd0d53e79567 100644
--- a/xmloff/source/core/xmluconv.cxx
+++ b/xmloff/source/core/xmluconv.cxx
@@ -264,7 +264,7 @@ static int lcl_gethex( int nChar )
 return 0;
 }
 
-static sal_Char aHexTab[] = "0123456789abcdef";
+static const sal_Char aHexTab[] = "0123456789abcdef";
 
 
 /** convert double number to string (using ::rtl::math) */
diff --git a/xmloff/source/forms/elementexport.cxx 
b/xmloff/source/forms/elementexport.cxx
index 8e8b7aaa559f..ba1eb56f5d79 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -599,7 +599,7 @@ namespace xmloff
 // some integer properties
 {
 // now the common handling
-static CCAFlags nIntegerPropertyAttributeIds[] =
+static const CCAFlags nIntegerPropertyAttributeIds[] =
 {   // attribute flags
 CCAFlags::Size, CCAFlags::TabIndex
 };
@@ -998,7 +998,7 @@ namespace xmloff
 
 // the integer properties
 {
-static SCAFlags nIntegerPropertyAttributeIds[] =
+static const SCAFlags nIntegerPropertyAttributeIds[] =
 {   // attribute flags
 SCAFlags::PageStepSize
 };
@@ -1862,11 +1862,11 @@ namespace xmloff
 }
 else
 {
-XMLTokenEnum eXmlImagePositions[] =
+const XMLTokenEnum eXmlImagePositions[] =
 {
 XML_START, XML_END, XML_TOP, XML_BOTTOM
 };
-XMLTokenEnum eXmlImageAligns[] =
+const XMLTokenEnum eXmlImageAligns[] =
 {
 XML_START, XML_CENTER, XML_END
 };
diff --git a/xmloff/source/style/csmaphdl.cxx b/xmloff/source/style/csmaphdl.cxx
index 2e88f798594b..f24b0806f0c5 100644
--- a/xmloff/source/style/csmaphdl.cxx
+++ b/xmloff/source/style/csmaphdl.cxx
@@ -27,7 +27,7 @@
 using namespace ::com::sun::star;
 using namespace ::xmloff::token;
 
-static SvXMLEnumMapEntry pXML_Casemap_Enum[] =
+static const SvXMLEnumMapEntry pXML_Casemap_Enum[] =
 {
 { XML_NONE, style::CaseMap::NONE },
 { XML_CASEMAP_LOWERCASE,style::CaseMap::LOWERCASE },
diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx
index 2d4746a77ad3..128cd618ad35 100644
--- a/xmloff/source/text/txtstyli.cxx
+++ b/xmloff/source/text/txtstyli.cxx
@@ -417,7 +417,7 @@ void XMLTextStyleContext::FillPropertySet(
 };
 
 // the style families associated with the same index modulo 4
-static sal_uInt16 aFamilies[] =
+static const sal_uInt16 aFamilies[] =
 {
 XML_STYLE_FAMILY_SD_GRADIENT_ID,
 XML_STYLE_FAMILY_SD_GRADIENT_ID,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: accessibility/source cui/source extensions/source hwpfilter/source include/svl include/svx sc/source sd/source sfx2/source svl/source sw/source unotest/source

2017-11-20 Thread Takeshi Abe
 accessibility/source/extended/accessibleiconchoicectrlentry.cxx |2 
 accessibility/source/extended/textwindowaccessibility.cxx   |2 
 accessibility/source/standard/vclxaccessibletextcomponent.cxx   |2 
 cui/source/tabpages/numpages.cxx|2 
 extensions/source/propctrlr/standardcontrol.hxx |2 
 extensions/source/propctrlr/taborder.cxx|2 
 hwpfilter/source/grammar.cxx|  120 
+-
 include/svl/cryptosign.hxx  |2 
 include/svx/svdobj.hxx  |2 
 sc/source/filter/xml/XMLTrackedChangesContext.cxx   |2 
 sd/source/core/drawdoc2.cxx |2 
 sd/source/filter/eppt/eppt.cxx  |2 
 sd/source/ui/framework/factories/BasicToolBarFactory.cxx|2 
 sfx2/source/dialog/templdlg.cxx |2 
 svl/source/numbers/numfmuno.cxx |4 
 sw/source/core/access/acccontext.cxx|2 
 sw/source/core/unocore/unosett.cxx  |6 
 sw/source/uibase/uno/unotxdoc.cxx   |2 
 unotest/source/cpp/directories.cxx  |2 
 19 files changed, 81 insertions(+), 81 deletions(-)

New commits:
commit 14f351529e5f6282b1017d28671930d6142f4ce5
Author: Takeshi Abe 
Date:   Sun Nov 19 01:38:22 2017 +0900

cosmetics: Drop duplicate semicolon

Change-Id: I96d2ffb903f9ed15070572552c9564b5089df12f
Reviewed-on: https://gerrit.libreoffice.org/44914
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx 
b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
index b8d07cfd5136..54d1cbcb094f 100644
--- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
@@ -556,7 +556,7 @@ namespace accessibility
 SolarMutexGuard aSolarGuard;
 ::osl::MutexGuard aGuard( m_aMutex );
 EnsureIsAlive();
-return implGetText().getLength();;
+return implGetText().getLength();
 }
 
 OUString SAL_CALL AccessibleIconChoiceCtrlEntry::getSelectedText(  )
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx 
b/accessibility/source/extended/textwindowaccessibility.cxx
index 4a3b61a6bf3f..c33f9baa4a60 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -328,7 +328,7 @@ Paragraph::getCharacterBounds(::sal_Int32 nIndex)
 ::sal_Int32 SAL_CALL Paragraph::getCharacterCount()
 {
 checkDisposed();
-return implGetText().getLength();;
+return implGetText().getLength();
 }
 
 // virtual
diff --git a/accessibility/source/standard/vclxaccessibletextcomponent.cxx 
b/accessibility/source/standard/vclxaccessibletextcomponent.cxx
index 11ceeacae924..7faaecf7a434 100644
--- a/accessibility/source/standard/vclxaccessibletextcomponent.cxx
+++ b/accessibility/source/standard/vclxaccessibletextcomponent.cxx
@@ -255,7 +255,7 @@ sal_Int32 VCLXAccessibleTextComponent::getCharacterCount()
 {
 OExternalLockGuard aGuard( this );
 
-return implGetText().getLength();;
+return implGetText().getLength();
 }
 
 
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 6a6d4e98b009..a6e69c4d023b 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -2086,7 +2086,7 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, BulletHdl_Impl, 
Button*, void)
 if(nActNumLvl & _nMask)
 {
 SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
-aNumFmt.SetBulletFont(&aActBulletFont); ;
+aNumFmt.SetBulletFont(&aActBulletFont);
 aNumFmt.SetBulletChar( (sal_Unicode) pMap->GetChar() );
 pActNum->SetLevel(i, aNumFmt);
 }
diff --git a/extensions/source/propctrlr/standardcontrol.hxx 
b/extensions/source/propctrlr/standardcontrol.hxx
index 1a48386a73b9..d9ec0552e3ed 100644
--- a/extensions/source/propctrlr/standardcontrol.hxx
+++ b/extensions/source/propctrlr/standardcontrol.hxx
@@ -61,7 +61,7 @@ namespace pcr
 TListboxWindow::SetSelectHdl( LINK(this, 
ListLikeControlWithModifyHandler, OnSelect) );
 }
 
-void SetModifyHdl( const Link& _rLink ) { 
aModifyHdl = _rLink;; }
+void SetModifyHdl( const Link& _rLink ) { 
aModifyHdl = _rLink; }
 private:
 DECL_LINK(OnSelect, TListboxWindow&, void);
 Link aModifyHdl;
diff --git a/extensions/source/propctrlr/taborder.cxx 
b/extensions/source/propctrlr/taborder.cxx
index 3b6c071737dc..157e6aaaf0fb 100644
--- a/extensi

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

2017-11-20 Thread Takeshi Abe
 sot/source/sdstor/ucbstorage.cxx |   45 +--
 1 file changed, 16 insertions(+), 29 deletions(-)

New commits:
commit c40c0a2773cee5402801926bc08db92a94527712
Author: Takeshi Abe 
Date:   Tue Nov 14 15:17:28 2017 +0900

sot: Simplify UCBStorageElement_Impl with std::unique_ptr

Change-Id: Ia2de0a990ed8157095e03aabf65c0f7cd9fc4c87
Reviewed-on: https://gerrit.libreoffice.org/44700
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 6568d5c20f56..e60fc2f97a45 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -455,7 +455,7 @@ public:
 typedef tools::SvRef UCBStorageStream_ImplRef;
 
 struct UCBStorageElement_Impl;
-typedef ::std::vector< UCBStorageElement_Impl* > UCBStorageElementList_Impl;
+typedef std::vector> 
UCBStorageElementList_Impl;
 
 class UCBStorage_Impl : public SvRefBase
 {
@@ -1736,7 +1736,7 @@ void UCBStorage_Impl::ReadContent()
 bool bIsFolder( xRow->getBoolean(2) );
 sal_Int64 nSize = xRow->getLong(4);
 UCBStorageElement_Impl* pElement = new UCBStorageElement_Impl( 
aTitle, bIsFolder, (sal_uLong) nSize );
-m_aChildrenList.push_back( pElement );
+m_aChildrenList.emplace_back( pElement );
 
 bool bIsOfficeDocument = m_bIsLinked || ( m_aClassId != 
SvGlobalName() );
 if ( bIsFolder )
@@ -1824,7 +1824,7 @@ void UCBStorage_Impl::SetError( ErrCode nError )
 sal_Int32 UCBStorage_Impl::GetObjectCount()
 {
 sal_Int32 nCount = m_aChildrenList.size();
-for (UCBStorageElement_Impl* pElement : m_aChildrenList)
+for (auto& pElement : m_aChildrenList)
 {
 DBG_ASSERT( !pElement->m_bIsFolder || pElement->m_xStorage.is(), 
"Storage should be open!" );
 if ( pElement->m_bIsFolder && pElement->m_xStorage.is() )
@@ -1880,7 +1880,7 @@ void UCBStorage_Impl::SetProps( const Sequence < Sequence 
< PropertyValue > >& r
 // the "FullPath" of a child always starts without '/'
 aPath.clear();
 
-for (UCBStorageElement_Impl* pElement : m_aChildrenList)
+for (auto& pElement : m_aChildrenList)
 {
 DBG_ASSERT( !pElement->m_bIsFolder || pElement->m_xStorage.is(), 
"Storage should be open!" );
 if ( pElement->m_bIsFolder && pElement->m_xStorage.is() )
@@ -1931,7 +1931,7 @@ void UCBStorage_Impl::GetProps( sal_Int32& nProps, 
Sequence < Sequence < Propert
 aPath.clear();
 
 // now the properties of my elements
-for (UCBStorageElement_Impl* pElement : m_aChildrenList)
+for (auto& pElement : m_aChildrenList)
 {
 DBG_ASSERT( !pElement->m_bIsFolder || pElement->m_xStorage.is(), 
"Storage should be open!" );
 if ( pElement->m_bIsFolder && pElement->m_xStorage.is() )
@@ -1953,9 +1953,6 @@ void UCBStorage_Impl::GetProps( sal_Int32& nProps, 
Sequence < Sequence < Propert
 
 UCBStorage_Impl::~UCBStorage_Impl()
 {
-// first delete elements!
-for (UCBStorageElement_Impl* i : m_aChildrenList)
-delete i;
 m_aChildrenList.clear();
 
 delete m_pContent;
@@ -2037,7 +2034,7 @@ sal_Int16 UCBStorage_Impl::Commit()
 // all errors will be caught in the "catch" statement outside the 
loop
 for ( size_t i = 0; i < m_aChildrenList.size() && nRet; ++i )
 {
-UCBStorageElement_Impl* pElement = m_aChildrenList[ i ];
+auto& pElement = m_aChildrenList[ i ];
 ::ucbhelper::Content* pContent = pElement->GetContent();
 std::unique_ptr< ::ucbhelper::Content > xDeleteContent;
 if ( !pContent && pElement->IsModified() )
@@ -2264,14 +2261,9 @@ sal_Int16 UCBStorage_Impl::Commit()
 // are also removed from the lists
 for ( size_t i = 0; i < m_aChildrenList.size(); )
 {
-UCBStorageElement_Impl* pInnerElement = m_aChildrenList[ i ];
+auto& pInnerElement = m_aChildrenList[ i ];
 if ( pInnerElement->m_bIsRemoved )
-{
-UCBStorageElementList_Impl::iterator it = 
m_aChildrenList.begin();
-::std::advance( it, i );
-delete *it;
-m_aChildrenList.erase( it );
-}
+m_aChildrenList.erase( m_aChildrenList.begin() + i );
 else
 {
 pInnerElement->m_aOriginalName = pInnerElement->m_aName;
@@ -2291,15 +2283,10 @@ bool UCBStorage_Impl::Revert()
 {
 for ( size_t i = 0; i < m_aChildrenList.size(); )
 {
-UCBStorageElement_Impl* pElement = m

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

2017-11-13 Thread Takeshi Abe
 sot/source/base/exchange.cxx |   39 +--
 1 file changed, 13 insertions(+), 26 deletions(-)

New commits:
commit 6dd8b701058fc02e78941270ce0423199e4d2352
Author: Takeshi Abe 
Date:   Mon Nov 13 18:39:20 2017 +0900

sot: Simplify SotData_Impl with std::unique_ptr

Change-Id: I08752c66fd2680aa5f2eb2968d7e23cf797090f9
Reviewed-on: https://gerrit.libreoffice.org/44667
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx
index 1d230a43fccf..37d917730e46 100644
--- a/sot/source/base/exchange.cxx
+++ b/sot/source/base/exchange.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 using namespace::com::sun::star::uno;
@@ -213,25 +214,11 @@ namespace
 const DataFlavorRepresentation, ImplFormatArray_Impl > {};
 
 
-typedef std::vector tDataFlavorList;
+typedef std::vector> 
tDataFlavorList;
 
 struct SotData_Impl
 {
-tDataFlavorList* pDataFlavorList;
-
-SotData_Impl(): pDataFlavorList(nullptr) {}
-~SotData_Impl()
-{
-if (pDataFlavorList)
-{
-for( tDataFlavorList::iterator aI = pDataFlavorList->begin(),
- aEnd = pDataFlavorList->end(); aI != aEnd; ++aI)
-{
-delete *aI;
-}
-delete pDataFlavorList;
-}
-}
+std::unique_ptr pDataFlavorList;
 };
 
 struct ImplData : public rtl::Static {};
@@ -241,7 +228,7 @@ static tDataFlavorList& InitFormats_Impl()
 {
 SotData_Impl *pSotData = &ImplData::get();
 if( !pSotData->pDataFlavorList )
-pSotData->pDataFlavorList = new tDataFlavorList;
+pSotData->pDataFlavorList.reset(new tDataFlavorList);
 return *pSotData->pDataFlavorList;
 }
 
@@ -272,17 +259,17 @@ SotClipboardFormatId SotExchange::RegisterFormatName( 
const OUString& rName )
 tDataFlavorList& rL = InitFormats_Impl();
 for( tDataFlavorList::size_type i = 0; i < rL.size(); i++ )
 {
-DataFlavor* pFlavor = rL[ i ];
+auto const& pFlavor = rL[ i ];
 if( pFlavor && rName == pFlavor->HumanPresentableName )
 return static_cast(i + 
static_cast(SotClipboardFormatId::USER_END) + 1);
 }
 
-DataFlavor* pNewFlavor = new DataFlavor;
+std::unique_ptr pNewFlavor(new DataFlavor);
 pNewFlavor->MimeType = rName;
 pNewFlavor->HumanPresentableName = rName;
 pNewFlavor->DataType = cppu::UnoType::get();
 
-rL.push_back( pNewFlavor );
+rL.push_back( std::move(pNewFlavor) );
 
 return static_cast(static_cast(rL.size()-1) + 
static_cast(SotClipboardFormatId::USER_END) + 1);
 }
@@ -303,17 +290,17 @@ SotClipboardFormatId SotExchange::RegisterFormatMimeType( 
const OUString& rMimeT
 tDataFlavorList& rL = InitFormats_Impl();
 for( tDataFlavorList::size_type i = 0; i < rL.size(); i++ )
 {
-DataFlavor* pFlavor = rL[ i ];
+auto const& pFlavor = rL[ i ];
 if( pFlavor && rMimeType == pFlavor->MimeType )
 return static_cast(i + 
static_cast(SotClipboardFormatId::USER_END) + 1);
 }
 
-DataFlavor* pNewFlavor = new DataFlavor;
+std::unique_ptr pNewFlavor(new DataFlavor);
 pNewFlavor->MimeType = rMimeType;
 pNewFlavor->HumanPresentableName = rMimeType;
 pNewFlavor->DataType = cppu::UnoType::get();
 
-rL.push_back( pNewFlavor );
+rL.push_back( std::move(pNewFlavor) );
 
 return static_cast(static_cast(rL.size()-1) + 
static_cast(SotClipboardFormatId::USER_END) + 1);
 }
@@ -332,7 +319,7 @@ SotClipboardFormatId SotExchange::RegisterFormat( const 
DataFlavor& rFlavor )
 {
 tDataFlavorList& rL = InitFormats_Impl();
 nRet = static_cast(rL.size() + 
static_cast(SotClipboardFormatId::USER_END) + 1);
-rL.push_back( new DataFlavor( rFlavor ) );
+rL.emplace_back( new DataFlavor( rFlavor ) );
 }
 
 return nRet;
@@ -433,7 +420,7 @@ SotClipboardFormatId SotExchange::GetFormatIdFromMimeType( 
const OUString& rMime
 
 for( tDataFlavorList::size_type i = 0; i < rL.size(); i++ )
 {
-DataFlavor* pFlavor = rL[ i ];
+auto const& pFlavor = rL[ i ];
 if( pFlavor && rMimeType == pFlavor->MimeType )
 return static_cast(i + 
static_cast(SotClipboardFormatId::USER_END) + 1);
 }
@@ -470,7 +457,7 @@ SotClipboardFormatId SotExchange::GetFormat( const 
DataFlavor& rFlavor )
 tDataFlavorList& rL = InitFormats_Impl();
 for( tDataFlavorList::size_type i = 0; i < rL.size(); i++ )
 {
-DataFlavor* pFlavor = rL[ i ];
+auto const& pFlavor = rL[ i ];
 if( pFlavor && rMimeType == pFlavor->MimeType )
 return static_cast(i + 
static_cast(SotClipboardFor

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

2017-11-10 Thread Takeshi Abe
 include/sfx2/viewsh.hxx|1 -
 sfx2/source/view/sfxbasecontroller.cxx |2 +-
 sfx2/source/view/viewfrm.cxx   |2 +-
 sfx2/source/view/viewsh.cxx|   21 -
 4 files changed, 2 insertions(+), 24 deletions(-)

New commits:
commit ce470df92913ffc1849de90b9fd6a2a9d69b8e33
Author: Takeshi Abe 
Date:   Wed Nov 8 18:11:48 2017 +0900

sfx2: Replace SfxViewShell::DiscardClients_Impl()

with DisconnectAllClients() because both do the same
ever since 17a91c18edea240a35a12a573933917240e9fb4a.

Change-Id: I17639670d0fb787c69a53e8992f706937665d7b3
Reviewed-on: https://gerrit.libreoffice.org/7
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index d9467fb2aa47..7c9929fbbe9e 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -298,7 +298,6 @@ public:
 SAL_DLLPRIVATE void NewIPClient_Impl( SfxInPlaceClient *pIPClient );
 SAL_DLLPRIVATE void IPClientGone_Impl( SfxInPlaceClient const *pIPClient );
 SAL_DLLPRIVATE void ResetAllClients_Impl( SfxInPlaceClient const *pIP );
-SAL_DLLPRIVATE void DiscardClients_Impl();
 
 SAL_DLLPRIVATE void SetPrinter_Impl( VclPtr& pNewPrinter );
 SAL_DLLPRIVATE bool IsShowView_Impl() const;
diff --git a/sfx2/source/view/sfxbasecontroller.cxx 
b/sfx2/source/view/sfxbasecontroller.cxx
index 8dd2fabe54c3..72ca5708d872 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -958,7 +958,7 @@ void SAL_CALL SfxBaseController::dispose()
 SfxViewFrame* pFrame = m_pData->m_pViewShell->GetViewFrame() ;
 if ( pFrame && pFrame->GetViewShell() == m_pData->m_pViewShell )
 pFrame->GetFrame().SetIsClosing_Impl();
-m_pData->m_pViewShell->DiscardClients_Impl();
+m_pData->m_pViewShell->DisconnectAllClients();
 
 if ( pFrame )
 {
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index de1bee06d486..6c2f5fb37757 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1032,7 +1032,7 @@ bool SfxViewFrame::Close()
 // If no saving have been made up until now, then embedded Objects should
 // not be saved automatically anymore.
 if ( GetViewShell() )
-GetViewShell()->DiscardClients_Impl();
+GetViewShell()->DisconnectAllClients();
 Broadcast( SfxHint( SfxHintId::Dying ) );
 
 if (SfxViewFrame::Current() == this)
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 30efcb52b6b8..1dfbd26db93c 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1028,9 +1028,6 @@ void SfxViewShell::SetWindow
 // Disconnect existing IP-Clients if possible
 DisconnectAllClients();
 
-//TODO: should we have a "ReconnectAllClients" method?
-DiscardClients_Impl();
-
 // Switch View-Port
 bool bHadFocus = pWindow && pWindow->HasChildPathFocus( true );
 pWindow = pViewPort;
@@ -1655,24 +1652,6 @@ void SfxViewShell::CheckIPClient_Impl(
 }
 
 
-void SfxViewShell::DiscardClients_Impl()
-
-/*  [Description]
-
-The purpose of this Method is to prevent the saving of Objects when closing
-the Document, if the user has chosen to close without saving.
-*/
-
-{
-SfxInPlaceClientList *pClients = pImpl->GetIPClientList_Impl(false);
-if ( !pClients )
-return;
-
-for ( size_t n = 0; n < pClients->size(); )
-delete pClients->at( n );
-}
-
-
 SfxObjectShell* SfxViewShell::GetObjectShell()
 {
 return pFrame ? pFrame->GetObjectShell() : nullptr;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-07 Thread Takeshi Abe
 sfx2/source/view/viewimp.hxx |4 +++-
 sfx2/source/view/viewsh.cxx  |   18 --
 2 files changed, 3 insertions(+), 19 deletions(-)

New commits:
commit 2168080905e9dbdc6100a34399a39b1a2df1975f
Author: Takeshi Abe 
Date:   Tue Nov 7 17:10:54 2017 +0900

sfx2: SfxInPlaceClientList is just a std::vector

Change-Id: I6b676d17d9592a0ca998cdafb25b1aa12e11b6d6
Reviewed-on: https://gerrit.libreoffice.org/44384
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx
index 976869ac237e..6752ebaf788e 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -31,13 +31,15 @@
 #include 
 #include 
 #include 
+#include 
 
 class SfxBaseController;
 
 typedef std::vector SfxShellArr_Impl;
 
 class SfxClipboardChangeListener;
-class SfxInPlaceClientList;
+
+using SfxInPlaceClientList = std::vector;
 
 struct SfxViewShell_Impl
 {
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 107a27ba6899..30efcb52b6b8 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -207,24 +207,6 @@ void SAL_CALL SfxClipboardChangeListener::changedContents( 
const datatransfer::c
 Application::PostUserEvent( LINK( nullptr, SfxClipboardChangeListener, 
AsyncExecuteHdl_Impl ), pInfo );
 }
 
-class SfxInPlaceClientList
-{
-typedef std::vector DataType;
-DataType maData;
-
-public:
-typedef DataType::iterator iterator;
-
-SfxInPlaceClient* at( size_t i ) { return maData.at(i); }
-
-iterator begin() { return maData.begin(); }
-iterator end() { return maData.end(); }
-
-void push_back( SfxInPlaceClient* p ) { maData.push_back(p); }
-void erase( const iterator& it ) { maData.erase(it); }
-size_t size() const { return maData.size(); }
-};
-
 sal_uInt32 SfxViewShell_Impl::m_nLastViewShellId = 0;
 
 SfxViewShell_Impl::SfxViewShell_Impl(SfxViewShellFlags const nFlags)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-06 Thread Takeshi Abe
 sfx2/source/dialog/versdlg.cxx |   26 +++---
 1 file changed, 7 insertions(+), 19 deletions(-)

New commits:
commit fe7384f7d6539210d46b31f9bde64129088be32b
Author: Takeshi Abe 
Date:   Mon Nov 6 18:22:36 2017 +0900

sfx2: Simplify SfxVersionTableDtor's code with std::unique_ptr

Change-Id: I8279f7ae14301f485c2678271939fb6ad72d4721
Reviewed-on: https://gerrit.libreoffice.org/44350
Reviewed-by: Noel Grandin 
Tested-by: Jenkins 
Reviewed-by: Takeshi Abe 

diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
index 5f32f12cc6a3..a5864f2cc84c 100644
--- a/sfx2/source/dialog/versdlg.cxx
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -46,12 +46,11 @@
 #include 
 
 #include 
+#include 
 #include 
 
 using namespace com::sun::star;
-using ::std::vector;
 
-// **
 struct SfxVersionInfo
 {
 OUStringaName;
@@ -65,35 +64,31 @@ struct SfxVersionInfo
 class SfxVersionTableDtor
 {
 private:
-std::vector< SfxVersionInfo* >  aTableList;
+std::vector> aTableList;
 public:
 explicitSfxVersionTableDtor( const uno::Sequence < 
util::RevisionTag >& rInfo );
 explicitSfxVersionTableDtor( const uno::Sequence < 
document::CmisVersion > & rInfo );
-~SfxVersionTableDtor()
-{ DelDtor(); }
 SfxVersionTableDtor(const SfxVersionTableDtor&) = 
delete;
 SfxVersionTableDtor&operator=(const SfxVersionTableDtor&) = delete;
 
-voidDelDtor();
-
 size_t  size() const
 { return aTableList.size(); }
 
 SfxVersionInfo* at( size_t i ) const
-{ return aTableList[ i ]; }
+{ return aTableList[ i ].get(); }
 };
 
 SfxVersionTableDtor::SfxVersionTableDtor( const uno::Sequence < 
util::RevisionTag >& rInfo )
 {
 for ( sal_Int32 n=0; n pInfo(new SfxVersionInfo);
 pInfo->aName = rInfo[n].Identifier;
 pInfo->aComment = rInfo[n].Comment;
 pInfo->aAuthor = rInfo[n].Author;
 
 pInfo->aCreationDate = DateTime( rInfo[n].TimeStamp );
-aTableList.push_back( pInfo );
+aTableList.push_back( std::move(pInfo) );
 }
 }
 
@@ -101,23 +96,16 @@ SfxVersionTableDtor::SfxVersionTableDtor( const 
uno::Sequence < document::CmisVe
 {
 for ( sal_Int32 n=0; n pInfo(new SfxVersionInfo);
 pInfo->aName = rInfo[n].Id;
 pInfo->aComment = rInfo[n].Comment;
 pInfo->aAuthor = rInfo[n].Author;
 
 pInfo->aCreationDate = DateTime( rInfo[n].TimeStamp );
-aTableList.push_back( pInfo );
+aTableList.push_back( std::move(pInfo) );
 }
 }
 
-void SfxVersionTableDtor::DelDtor()
-{
-for (SfxVersionInfo* i : aTableList)
-delete i;
-aTableList.clear();
-}
-
 SfxVersionInfo::SfxVersionInfo()
 : aCreationDate( DateTime::EMPTY )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-04 Thread Takeshi Abe
 include/sfx2/frmdescr.hxx |9 -
 1 file changed, 9 deletions(-)

New commits:
commit fce7a0b3606f216f68a0f2e3591182c4358b88ff
Author: Takeshi Abe 
Date:   Sat Nov 4 21:55:58 2017 +0900

sfx2: Drop unused macro & declarations

Change-Id: I249c3dc5158a4aaa161d360378e4c657ffcc8af4
Reviewed-on: https://gerrit.libreoffice.org/44296
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/sfx2/frmdescr.hxx b/include/sfx2/frmdescr.hxx
index cd0184c1f2e4..295ba098dcfb 100644
--- a/include/sfx2/frmdescr.hxx
+++ b/include/sfx2/frmdescr.hxx
@@ -24,16 +24,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
-class SvStream;
-struct SfxFrameDescriptor_Impl;
-class SfxFrameDescriptor;
-class Wallpaper;
-
-
 // The SfxFrame descriptors build a recursive structure, that covers all the
 // required data in-order to display the frame document.
 // Through a SfxFrameSetDescriptor access is given to the whole underlying
@@ -51,11 +44,9 @@ enum class ScrollingMode
 Auto
 };
 
-#define SPACING_NOT_SET -1L
 #define SIZE_NOT_SET-1L
 
 class SfxItemSet;
-struct SfxFrameProperties;
 
 class SFX2_DLLPUBLIC SfxFrameDescriptor
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-03 Thread Takeshi Abe
 include/sfx2/frmdescr.hxx|2 +-
 sfx2/source/doc/frmdescr.cxx |   20 ++--
 2 files changed, 7 insertions(+), 15 deletions(-)

New commits:
commit 8ce49eab696d830d420fbf48b22ac151167bbd62
Author: Takeshi Abe 
Date:   Fri Nov 3 20:48:38 2017 +0900

sfx2: Omit unnecessary indirection of SfxFrameDescriptor_Impl

Change-Id: I43c9df757d78420bd119a06e7f7224e40690b753
Reviewed-on: https://gerrit.libreoffice.org/44255
Reviewed-by: Noel Grandin 
Reviewed-by: Takeshi Abe 
Tested-by: Takeshi Abe 

diff --git a/include/sfx2/frmdescr.hxx b/include/sfx2/frmdescr.hxx
index 8433afa93887..cd0184c1f2e4 100644
--- a/include/sfx2/frmdescr.hxx
+++ b/include/sfx2/frmdescr.hxx
@@ -66,7 +66,7 @@ class SFX2_DLLPUBLIC SfxFrameDescriptor
 ScrollingMode   eScroll;
 boolbHasBorder;
 boolbHasBorderSet;
-std::unique_ptr< SfxFrameDescriptor_Impl > pImpl;
+std::unique_ptr m_pArgs;
 
 public:
 SfxFrameDescriptor();
diff --git a/sfx2/source/doc/frmdescr.cxx b/sfx2/source/doc/frmdescr.cxx
index 143c8742b2f4..2912b57c529e 100644
--- a/sfx2/source/doc/frmdescr.cxx
+++ b/sfx2/source/doc/frmdescr.cxx
@@ -25,19 +25,11 @@
 #include 
 #include 
 
-struct SfxFrameDescriptor_Impl
-{
-std::unique_ptr pArgs;
-
-SfxFrameDescriptor_Impl() {}
-};
-
 SfxFrameDescriptor::SfxFrameDescriptor() :
 aMargin( -1, -1 ),
 eScroll( ScrollingMode::Auto ),
 bHasBorder( true ),
-bHasBorderSet( false ),
-pImpl( new SfxFrameDescriptor_Impl )
+bHasBorderSet( false )
 {
 }
 
@@ -47,9 +39,9 @@ SfxFrameDescriptor::~SfxFrameDescriptor()
 
 SfxItemSet* SfxFrameDescriptor::GetArgs()
 {
-if( !pImpl->pArgs )
-pImpl->pArgs.reset( new SfxAllItemSet( SfxGetpApp()->GetPool() ) );
-return pImpl->pArgs.get();
+if( !m_pArgs )
+m_pArgs.reset( new SfxAllItemSet( SfxGetpApp()->GetPool() ) );
+return m_pArgs.get();
 }
 
 void SfxFrameDescriptor::SetURL( const OUString& rURL )
@@ -61,8 +53,8 @@ void SfxFrameDescriptor::SetURL( const OUString& rURL )
 void SfxFrameDescriptor::SetActualURL( const OUString& rURL )
 {
 aActualURL = INetURLObject(rURL);
-if ( pImpl->pArgs )
-pImpl->pArgs->ClearItem();
+if ( m_pArgs )
+m_pArgs->ClearItem();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-03 Thread Takeshi Abe
 sfx2/source/doc/doctempl.cxx |   36 +---
 1 file changed, 13 insertions(+), 23 deletions(-)

New commits:
commit 501698657afeed006812e071a77a5228e3f7b3d5
Author: Takeshi Abe 
Date:   Thu Nov 2 18:56:46 2017 +0900

sfx2: Simplify SfxDocTemplate_Impl with std::unique_ptr

Change-Id: Ie736bcb6ca636cd5f34f12f7b4fdb234d18f3999
Reviewed-on: https://gerrit.libreoffice.org/44202
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index ce3866b72602..e963a8b7797a 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -95,8 +95,6 @@ using namespace ::ucbhelper;
 #include 
 #include 
 #include 
-using ::std::vector;
-using ::std::advance;
 
 
 #define TITLE   "Title"
@@ -181,8 +179,6 @@ public:
 int Compare( RegionData_Impl const * pCompareWith ) const;
 };
 
-typedef vector< RegionData_Impl* > RegionList_Impl;
-
 
 class SfxDocTemplate_Impl : public SvRefBase
 {
@@ -192,7 +188,7 @@ class SfxDocTemplate_Impl : public SvRefBase
 ::osl::MutexmaMutex;
 OUStringmaRootURL;
 OUStringmaStandardGroup;
-RegionList_Impl maRegions;
+std::vector> maRegions;
 boolmbConstructed;
 
 uno::Reference< XAnyCompareFactory > m_rCompareFactory;
@@ -1328,7 +1324,7 @@ void RegionData_Impl::AddEntry( const OUString& rTitle,
 pEntry->SetHierarchyURL( aLinkURL );
 if ( nPos < maEntries.size() ) {
 auto it = maEntries.begin();
-advance( it, nPos );
+std::advance( it, nPos );
 maEntries.insert( it, std::move(pEntry) );
 }
 else
@@ -1385,7 +1381,7 @@ void RegionData_Impl::DeleteEntry( size_t nIndex )
 if ( nIndex < maEntries.size() )
 {
 auto it = maEntries.begin();
-advance( it, nIndex );
+std::advance( it, nIndex );
 maEntries.erase( it );
 }
 }
@@ -1406,8 +1402,6 @@ SfxDocTemplate_Impl::SfxDocTemplate_Impl()
 
 SfxDocTemplate_Impl::~SfxDocTemplate_Impl()
 {
-Clear();
-
 gpTemplateData = nullptr;
 }
 
@@ -1430,7 +1424,7 @@ void SfxDocTemplate_Impl::DecrementLock()
 RegionData_Impl* SfxDocTemplate_Impl::GetRegion( size_t nIndex ) const
 {
 if ( nIndex < maRegions.size() )
-return maRegions[ nIndex ];
+return maRegions[ nIndex ].get();
 return nullptr;
 }
 
@@ -1438,10 +1432,10 @@ RegionData_Impl* SfxDocTemplate_Impl::GetRegion( size_t 
nIndex ) const
 RegionData_Impl* SfxDocTemplate_Impl::GetRegion( const OUString& rName )
 const
 {
-for (RegionData_Impl* pData : maRegions)
+for (auto& pData : maRegions)
 {
 if( pData->GetTitle() == rName )
-return pData;
+return pData.get();
 }
 return nullptr;
 }
@@ -1451,9 +1445,8 @@ void SfxDocTemplate_Impl::DeleteRegion( size_t nIndex )
 {
 if ( nIndex < maRegions.size() )
 {
-delete maRegions[ nIndex ];
-RegionList_Impl::iterator it = maRegions.begin();
-advance( it, nIndex );
+auto it = maRegions.begin();
+std::advance( it, nIndex );
 maRegions.erase( it );
 }
 }
@@ -1593,7 +1586,7 @@ bool SfxDocTemplate_Impl::InsertRegion( RegionData_Impl 
*pNew, size_t nPos )
 ::osl::MutexGuard   aGuard( maMutex );
 
 // return false (not inserted) if the entry already exists
-for (const RegionData_Impl* pRegion : maRegions)
+for (auto const& pRegion : maRegions)
 if ( pRegion->Compare( pNew ) == 0 )
 return false;
 
@@ -1603,12 +1596,12 @@ bool SfxDocTemplate_Impl::InsertRegion( RegionData_Impl 
*pNew, size_t nPos )
 
 if ( newPos < maRegions.size() )
 {
-RegionList_Impl::iterator it = maRegions.begin();
-advance( it, newPos );
-maRegions.insert( it, pNew );
+auto it = maRegions.begin();
+std::advance( it, newPos );
+maRegions.emplace( it, pNew );
 }
 else
-maRegions.push_back( pNew );
+maRegions.emplace_back( pNew );
 
 return true;
 }
@@ -1687,9 +1680,6 @@ void SfxDocTemplate_Impl::Clear()
 ::osl::MutexGuard   aGuard( maMutex );
 if ( mnLockCounter )
 return;
-
-for (RegionData_Impl* pRegion : maRegions)
-delete pRegion;
 maRegions.clear();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-01 Thread Takeshi Abe
 sfx2/source/doc/doctempl.cxx |   31 +++
 1 file changed, 11 insertions(+), 20 deletions(-)

New commits:
commit 36f8be6ceefa94aa49efe3577cef5b2969ef1950
Author: Takeshi Abe 
Date:   Wed Nov 1 18:01:16 2017 +0900

sfx2: Simplify RegionData_Impl's code with std::unique_ptr

Change-Id: I87dba62abc48e70cfb019ddaa4cc93779ee844b5
Reviewed-on: https://gerrit.libreoffice.org/44155
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index 96588028caf7..ce3866b72602 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -92,7 +92,8 @@ using namespace ::ucbhelper;
 
 #include 
 #include 
-
+#include 
+#include 
 #include 
 using ::std::vector;
 using ::std::advance;
@@ -145,7 +146,7 @@ using namespace ::DocTempl;
 class RegionData_Impl
 {
 const SfxDocTemplate_Impl*  mpParent;
-vector< DocTempl_EntryData_Impl* > maEntries;
+std::vector> maEntries;
 OUStringmaTitle;
 OUStringmaOwnURL;
 OUStringmaTargetURL;
@@ -158,7 +159,6 @@ private:
 public:
 RegionData_Impl( const SfxDocTemplate_Impl* pParent,
  const OUString& rTitle );
-~RegionData_Impl();
 
 voidSetTargetURL( const OUString& rURL ) { maTargetURL = 
rURL; }
 voidSetHierarchyURL( const OUString& rURL) { maOwnURL = 
rURL; }
@@ -1284,21 +1284,13 @@ RegionData_Impl::RegionData_Impl( const 
SfxDocTemplate_Impl* pParent,
 }
 
 
-RegionData_Impl::~RegionData_Impl()
-{
-for (DocTempl_EntryData_Impl* p : maEntries)
-delete p;
-maEntries.clear();
-}
-
-
 size_t RegionData_Impl::GetEntryPos( const OUString& rTitle, bool& rFound ) 
const
 {
 const size_t nCount = maEntries.size();
 
 for ( size_t i=0; iCompare( rTitle ) == 0 )
 {
@@ -1330,17 +1322,17 @@ void RegionData_Impl::AddEntry( const OUString& rTitle,
 if ( pPos )
 nPos = *pPos;
 
-DocTempl_EntryData_Impl* pEntry = new DocTempl_EntryData_Impl(
+auto pEntry = o3tl::make_unique(
 this, rTitle );
 pEntry->SetTargetURL( rTargetURL );
 pEntry->SetHierarchyURL( aLinkURL );
 if ( nPos < maEntries.size() ) {
-vector< DocTempl_EntryData_Impl* >::iterator it = 
maEntries.begin();
+auto it = maEntries.begin();
 advance( it, nPos );
-maEntries.insert( it, pEntry );
+maEntries.insert( it, std::move(pEntry) );
 }
 else
-maEntries.push_back( pEntry );
+maEntries.push_back( std::move(pEntry) );
 }
 }
 
@@ -1375,7 +1367,7 @@ DocTempl_EntryData_Impl* RegionData_Impl::GetEntry( const 
OUString& rName ) cons
 longnPos = GetEntryPos( rName, bFound );
 
 if ( bFound )
-return maEntries[ nPos ];
+return maEntries[ nPos ].get();
 return nullptr;
 }
 
@@ -1383,7 +1375,7 @@ DocTempl_EntryData_Impl* RegionData_Impl::GetEntry( const 
OUString& rName ) cons
 DocTempl_EntryData_Impl* RegionData_Impl::GetEntry( size_t nIndex ) const
 {
 if ( nIndex < maEntries.size() )
-return maEntries[ nIndex ];
+return maEntries[ nIndex ].get();
 return nullptr;
 }
 
@@ -1392,8 +1384,7 @@ void RegionData_Impl::DeleteEntry( size_t nIndex )
 {
 if ( nIndex < maEntries.size() )
 {
-delete maEntries[ nIndex ];
-vector< DocTempl_EntryData_Impl*>::iterator it = maEntries.begin();
+auto it = maEntries.begin();
 advance( it, nIndex );
 maEntries.erase( it );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-10-31 Thread Takeshi Abe
 sfx2/source/doc/doctempl.cxx |   40 
 1 file changed, 40 deletions(-)

New commits:
commit c1316dcae2b30e626b0c0f134120f9522df93744
Author: Takeshi Abe 
Date:   Tue Oct 31 18:37:29 2017 +0900

sfx2: Kill dead code

which has been obsoleted since 387a35cedd74fee295dfeb2ad59a74cd8dabc451.

Change-Id: Icd3f0044ea67b0cecf4491399e875197282ea476
Reviewed-on: https://gerrit.libreoffice.org/44106
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index 1d2315606f97..96588028caf7 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -1294,7 +1294,6 @@ RegionData_Impl::~RegionData_Impl()
 
 size_t RegionData_Impl::GetEntryPos( const OUString& rTitle, bool& rFound ) 
const
 {
-#if 1   // Don't use binary search today
 const size_t nCount = maEntries.size();
 
 for ( size_t i=0; iCompare( rTitle );
-
-if ( nCompVal < 0 ) // pMid < pData
-nStart = nMid + 1;
-else
-nEnd = nMid - 1;
-}
-
-if ( nCompVal == 0 )
-{
-rFound = sal_True;
-}
-else
-{
-if ( nCompVal < 0 ) // pMid < pData
-nMid++;
-}
-
-return nMid;
-#endif
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-10-30 Thread Takeshi Abe
 sfx2/source/control/thumbnailviewacc.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 9d135a7f7d7e2f0585d76f1426edf4a17b6f10c8
Author: Takeshi Abe 
Date:   Mon Oct 30 17:36:43 2017 +0900

sfx2: Kill useless mutex guard

Change-Id: Idcbb1eff983bb82d29b8e53f09c0b7e73a8aab39
Reviewed-on: https://gerrit.libreoffice.org/44046
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/sfx2/source/control/thumbnailviewacc.cxx 
b/sfx2/source/control/thumbnailviewacc.cxx
index d6f977f4bd74..4c03b46b6b11 100644
--- a/sfx2/source/control/thumbnailviewacc.cxx
+++ b/sfx2/source/control/thumbnailviewacc.cxx
@@ -433,7 +433,6 @@ sal_Bool SAL_CALL 
ThumbnailViewAcc::isAccessibleChildSelected( sal_Int32 nChildI
 void SAL_CALL ThumbnailViewAcc::clearAccessibleSelection()
 {
 ThrowIfDisposed();
-const SolarMutexGuard aSolarGuard;
 }
 
 void SAL_CALL ThumbnailViewAcc::selectAllAccessibleChildren()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-10-27 Thread Takeshi Abe
 sfx2/source/appl/appdata.cxx  |2 --
 sfx2/source/appl/childwinimpl.cxx |   35 ---
 sfx2/source/inc/appdata.hxx   |3 +--
 sfx2/source/inc/childwinimpl.hxx  |   21 -
 sfx2/source/view/frame.cxx|   16 
 5 files changed, 9 insertions(+), 68 deletions(-)

New commits:
commit 8b2ec0947c91eb12ae5e0302e2092bdf2ea5147e
Author: Takeshi Abe 
Date:   Fri Oct 27 18:39:52 2017 +0900

sfx2: Drop unnecessary abstraction of SfxFrameArr_Impl

Instead, use plain std::vector.

Change-Id: Ib32e748a0ce744d15cbe48f5d03e28c57b731394
Reviewed-on: https://gerrit.libreoffice.org/43938
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
index aabd7a4463e4..920cbdaaea6c 100644
--- a/sfx2/source/appl/appdata.cxx
+++ b/sfx2/source/appl/appdata.cxx
@@ -87,7 +87,6 @@ SfxAppData_Impl::SfxAppData_Impl()
 , pTriggerTopic(nullptr)
 , pDdeService2(nullptr)
 , pFactArr(nullptr)
-, pTopFrames( new SfxFrameArr_Impl )
 , pMatcher( nullptr )
 , m_pToolsErrorHdl(nullptr)
 , m_pSoErrorHdl(nullptr)
@@ -123,7 +122,6 @@ SfxAppData_Impl::SfxAppData_Impl()
 SfxAppData_Impl::~SfxAppData_Impl()
 {
 DeInitDDE();
-delete pTopFrames;
 delete pBasicManager;
 
 #if HAVE_FEATURE_SCRIPTING
diff --git a/sfx2/source/appl/childwinimpl.cxx 
b/sfx2/source/appl/childwinimpl.cxx
index 93b5fbe6cb09..6299edc88305 100644
--- a/sfx2/source/appl/childwinimpl.cxx
+++ b/sfx2/source/appl/childwinimpl.cxx
@@ -70,39 +70,4 @@ SfxChildWinFactArr_Impl::iterator 
SfxChildWinFactArr_Impl::begin()
 return maData.begin();
 }
 
-SfxFrameArr_Impl::iterator SfxFrameArr_Impl::begin()
-{
-return maData.begin();
-}
-
-SfxFrameArr_Impl::iterator SfxFrameArr_Impl::end()
-{
-return maData.end();
-}
-
-SfxFrame* SfxFrameArr_Impl::front()
-{
-return maData.front();
-}
-
-void SfxFrameArr_Impl::erase( const iterator& it )
-{
-maData.erase(it);
-}
-
-SfxFrame* SfxFrameArr_Impl::operator[] ( size_t i )
-{
-return maData[i];
-}
-
-void SfxFrameArr_Impl::push_back( SfxFrame* p )
-{
-maData.push_back(p);
-}
-
-bool SfxFrameArr_Impl::empty() const
-{
-return maData.empty();
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index 23f9fbf07fdf..334abf539179 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -45,7 +45,6 @@ class SfxStatusDispatcher;
 class SfxDdeTriggerTopic_Impl;
 class SfxDocumentTemplates;
 class SfxFrame;
-class SfxFrameArr_Impl;
 class SvtSaveOptions;
 class SvtHelpOptions;
 class SfxViewFrame;
@@ -78,7 +77,7 @@ public:
 
 // single instance classes
 SfxChildWinFactArr_Impl*pFactArr;
-SfxFrameArr_Impl*   pTopFrames;
+std::vector  vTopFrames;
 
 // application members
 SfxFilterMatcher*   pMatcher;
diff --git a/sfx2/source/inc/childwinimpl.hxx b/sfx2/source/inc/childwinimpl.hxx
index e90a874dcea6..4b5c3ac1576a 100644
--- a/sfx2/source/inc/childwinimpl.hxx
+++ b/sfx2/source/inc/childwinimpl.hxx
@@ -57,27 +57,6 @@ public:
 iterator begin();
 };
 
-class SfxFrameArr_Impl
-{
-typedef std::vector DataType;
-DataType maData;
-
-public:
-typedef DataType::iterator iterator;
-
-iterator begin();
-iterator end();
-
-SfxFrame* front();
-
-void erase( const iterator& it );
-
-SfxFrame* operator[] ( size_t i );
-
-void push_back( SfxFrame* p );
-bool empty() const;
-};
-
 #endif
 
 
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 92abaca424d9..481011ba7d3b 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -38,7 +38,6 @@
 #include 
 #include 
 
-// due to pTopFrames
 #include 
 #include 
 #include 
@@ -62,6 +61,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef DBG_UTIL
 #include 
@@ -69,7 +69,7 @@
 
 using namespace com::sun::star;
 
-static SfxFrameArr_Impl* pFramesArr_Impl=nullptr;
+static std::vector* pFramesArr_Impl=nullptr;
 
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::util;
@@ -86,7 +86,7 @@ void SfxFrame::Construct_Impl()
 {
 pImpl.reset(new SfxFrame_Impl);
 if ( !pFramesArr_Impl )
-pFramesArr_Impl = new SfxFrameArr_Impl;
+pFramesArr_Impl = new std::vector;
 pFramesArr_Impl->push_back( this );
 }
 
@@ -96,7 +96,7 @@ SfxFrame::~SfxFrame()
 RemoveTopFrame_Impl( this );
 pWindow.disposeAndClear();
 
-SfxFrameArr_Impl::iterator it = std::find( pFramesArr_Impl->begin(), 
pFramesArr_Impl->end(), this );
+auto it = std::find( pFramesArr_Impl->begin(), pFramesArr_Impl->end(), 
this );
 if ( it != pFramesArr_Impl->end() )
 pFramesArr_Impl->erase( it );
 
@@ -383,14 +383,14 @@ void SfxFrame::GetDefaultTargetList(TargetList& rList)
 
 v

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

2017-10-26 Thread Takeshi Abe
 svtools/source/control/ruler.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1116d808c71c8429c10e2da36e851ac5a2816874
Author: Takeshi Abe 
Date:   Wed Oct 25 18:51:55 2017 +0900

Use the canonical abbreviation "pc" of pica, instead of "pi"

like as fixed at 8a5b178eb9f680fadcc8faa2e277623e8304b723.
This change affects e.g. the string of the tooltip appearing
when changing document margin in Writer by dragging ruler,
after choosing pica as the unit in context menu.

Change-Id: I55d2cea8b30016e2578c6a112f54e26d62741b44
Reviewed-on: https://gerrit.libreoffice.org/43819
Reviewed-by: Julien Nabet 
    Tested-by: Takeshi Abe 

diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 53922751085e..15e96da47f98 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -118,7 +118,7 @@ static const RulerUnitData 
aImplRulerUnitTab[RULER_UNIT_COUNT] =
 { MapUnit::Map100thInch, 1200,   120.0,   120.0,600.0,   1200.0,  "'"  
}, // FOOT
 { MapUnit::Map10thInch,633600, 63360.0, 63360.0, 316800.0, 633600.0,  " 
miles" }, // MILE
 { MapUnit::MapPoint, 1,12.0,12.0, 12.0, 36.0,  " 
pt"}, // POINT
-{ MapUnit::Map100thMM,423,   423.0,   423.0,423.0,846.0,  " 
pi"}, // PICA
+{ MapUnit::Map100thMM,423,   423.0,   423.0,423.0,846.0,  " 
pc"}, // PICA
 { MapUnit::Map100thMM,371,   371.0,   371.0,371.0,743.0,  " 
ch"}, // CHAR
 { MapUnit::Map100thMM,551,   551.0,   551.0,551.0,   1102.0,  " 
li"}  // LINE
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-10-25 Thread Takeshi Abe
 svtools/source/filter/exportdialog.cxx |7 +++
 svtools/source/filter/exportdialog.hxx |3 ++-
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 4130a5c4b07b5d440d05ab7df0d593373cd76044
Author: Takeshi Abe 
Date:   Thu Oct 26 06:39:42 2017 +0900

Fix memory leak

Change-Id: I2638a8440601264ff00221ead28a71c891abae16
Reviewed-on: https://gerrit.libreoffice.org/43860
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/svtools/source/filter/exportdialog.cxx 
b/svtools/source/filter/exportdialog.cxx
index c1d6138a6ea4..7f6d7652de77 100644
--- a/svtools/source/filter/exportdialog.cxx
+++ b/svtools/source/filter/exportdialog.cxx
@@ -400,8 +400,7 @@ void ExportDialog::GetGraphicStream()
 {
 if ( !IsTempExportAvailable() )
 {
-delete mpTempStream;
-mpTempStream = new SvMemoryStream();
+mpTempStream.reset(new SvMemoryStream());
 maBitmap = Bitmap();
 return;
 }
@@ -419,8 +418,7 @@ void ExportDialog::GetGraphicStream()
 {
 if ( bRecreateOutputStream )
 {
-delete mpTempStream;
-mpTempStream = new SvMemoryStream();
+mpTempStream.reset(new SvMemoryStream());
 maBitmap = Bitmap();
 
 uno::Reference< graphic::XGraphic > xGraphic;
@@ -1012,6 +1010,7 @@ ExportDialog::~ExportDialog()
 
 void ExportDialog::dispose()
 {
+mpTempStream.reset();
 delete mpFilterOptionsItem;
 delete mpOptionsItem;
 mpMfSizeX.clear();
diff --git a/svtools/source/filter/exportdialog.hxx 
b/svtools/source/filter/exportdialog.hxx
index 5c50660cb2e5..b8bf28321f1e 100644
--- a/svtools/source/filter/exportdialog.hxx
+++ b/svtools/source/filter/exportdialog.hxx
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /*
 |*
@@ -118,7 +119,7 @@ private:
 sal_Int16   mnFormat;
 sal_Int32   mnMaxFilesizeForRealtimePreview;
 
-SvMemoryStream* mpTempStream;
+std::unique_ptr mpTempStream;
 Bitmap  maBitmap;
 
 css::awt::Size  maOriginalSize; // the original graphic size in 
1/100mm
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   3   4   5   6   7   8   9   10   >