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

2016-11-06 Thread Arnaud Versini
 basic/source/sbx/sbxbyte.cxx |6 --
 basic/source/sbx/sbxchar.cxx |8 +---
 basic/source/sbx/sbxconv.hxx |3 +--
 basic/source/sbx/sbxint.cxx  |   17 +++--
 basic/source/sbx/sbxlng.cxx  |8 +---
 5 files changed, 22 insertions(+), 20 deletions(-)

New commits:
commit 3db1e9ed4d0d11457684dd3d2c8cacf97d7e
Author: Arnaud Versini 
Date:   Tue Nov 1 13:50:03 2016 +0100

BASIC : remove ImpRound and use std::(l)lround instead

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

diff --git a/basic/source/sbx/sbxbyte.cxx b/basic/source/sbx/sbxbyte.cxx
index 5527a56..562979b 100644
--- a/basic/source/sbx/sbxbyte.cxx
+++ b/basic/source/sbx/sbxbyte.cxx
@@ -21,6 +21,8 @@
 #include 
 #include "sbxconv.hxx"
 
+#include 
+
 sal_uInt8 ImpGetByte( const SbxValues* p )
 {
 SbxValues aTmp;
@@ -121,7 +123,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 0;
 }
 else
-nRes = (sal_uInt8) ImpRound( p->nSingle );
+nRes = (sal_uInt8) std::lround( p->nSingle );
 break;
 case SbxDATE:
 case SbxDOUBLE:
@@ -147,7 +149,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 0;
 }
 else
-nRes = (sal_uInt8) ImpRound( dVal );
+nRes = (sal_uInt8) std::lround( dVal );
 break;
 }
 case SbxBYREF | SbxSTRING:
diff --git a/basic/source/sbx/sbxchar.cxx b/basic/source/sbx/sbxchar.cxx
index d03bcb9..81d195c 100644
--- a/basic/source/sbx/sbxchar.cxx
+++ b/basic/source/sbx/sbxchar.cxx
@@ -21,6 +21,8 @@
 #include 
 #include "sbxconv.hxx"
 
+#include 
+
 sal_Unicode ImpGetChar( const SbxValues* p )
 {
 SbxValues aTmp;
@@ -109,7 +111,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINCHAR;
 }
 else
-nRes = (sal_Unicode) ImpRound( p->nSingle );
+nRes = (sal_Unicode) std::lround( p->nSingle );
 break;
 case SbxDATE:
 case SbxDOUBLE:
@@ -135,7 +137,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINCHAR;
 }
 else
-nRes = (sal_uInt8) ImpRound( dVal );
+nRes = (sal_uInt8) std::lround( dVal );
 break;
 }
 case SbxBYREF | SbxSTRING:
@@ -156,7 +158,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 
SbxMINCHAR;
 }
 else
-nRes = (sal_Unicode) ImpRound( d );
+nRes = (sal_Unicode) std::lround( d );
 }
 break;
 case SbxOBJECT:
diff --git a/basic/source/sbx/sbxconv.hxx b/basic/source/sbx/sbxconv.hxx
index c14a3ac..08fa296 100644
--- a/basic/source/sbx/sbxconv.hxx
+++ b/basic/source/sbx/sbxconv.hxx
@@ -37,8 +37,7 @@ void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& 
rcThousandSep );
 
 // SBXINT.CXX
 
-double  ImpRound( double );
-sal_Int16   ImpGetInteger( const SbxValues* );
+sal_Int16   ImpGetInteger( const SbxValues* );
 voidImpPutInteger( SbxValues*, sal_Int16 );
 
 sal_Int64   ImpGetInt64( const SbxValues* );
diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx
index c2d6fbe..b3d4cd3 100644
--- a/basic/source/sbx/sbxint.cxx
+++ b/basic/source/sbx/sbxint.cxx
@@ -21,10 +21,7 @@
 #include 
 #include "sbxconv.hxx"
 
-double ImpRound( double d )
-{
-return d + ( d < 0 ? -0.5 : 0.5 );
-}
+#include 
 
 sal_Int16 ImpGetInteger( const SbxValues* p )
 {
@@ -84,7 +81,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMININT;
 }
 else
-nRes = (sal_Int16) ImpRound( p->nSingle );
+nRes = (sal_Int16) std::lround( p->nSingle );
 break;
 case SbxCURRENCY:
 {
@@ -145,7 +142,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMININT;
 }
 else
-nRes = (sal_Int16) ImpRound( dVal );
+nRes = (sal_Int16) std::lround( dVal );
 break;
 }
 case SbxLPSTR:
@@ -168,7 +165,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 
SbxMININT;
 }
 else
-nRes = (sal_Int16) ImpRound( d );
+nRes = (sal_Int16) std::lround( d );
 }
 break;
 case SbxOBJECT:
@@ -350,7 +347,7 @@ sal_Int64 ImpDoubleToSalInt64( double d )
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINSALINT64;
 }
 else
-nRes = (sal_Int64) ImpRound( d );
+nRes = (sal_Int64) std::llround( d );
 return nRes;
 }
 
@@ -366,7 +363,

[Libreoffice-commits] core.git: 2 commits - helpcontent2 nlpsolver/help

2016-11-06 Thread Stanislav Horacek
 helpcontent2 |2 +-
 nlpsolver/help/en/com.sun.star.comp.Calc.NLPSolver/Usage.xhp |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2536bd8b267156691f65c535f20b365857f13a96
Author: Stanislav Horacek 
Date:   Fri Nov 4 20:36:23 2016 +0100

tdf#103622 do not use arrow as separator of menu commands

Change-Id: I15f1cb699107dc7e24d6ebef2e8f4d8f38dcd596
Reviewed-on: https://gerrit.libreoffice.org/30573
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/nlpsolver/help/en/com.sun.star.comp.Calc.NLPSolver/Usage.xhp 
b/nlpsolver/help/en/com.sun.star.comp.Calc.NLPSolver/Usage.xhp
index 27b308e..1820269 100644
--- a/nlpsolver/help/en/com.sun.star.comp.Calc.NLPSolver/Usage.xhp
+++ b/nlpsolver/help/en/com.sun.star.comp.Calc.NLPSolver/Usage.xhp
@@ -41,7 +41,7 @@
 Solver for Nonlinear 
Problems;Usage
 
 Usage
-  Regardless whether you use DEPS or SCO, you start by going to Tools 
→ Solver and set the Cell to be optimized, the direction to go (minimization, 
maximization) and the cells to be modified to reach the goal. Then you go to 
the Options and specify the solver to be used and if necessary adjust the 
according parameters.
+  Regardless whether you use DEPS or SCO, you start by going to 
Tools - Solver and set the Cell to be optimized, the direction to go 
(minimization, maximization) and the cells to be modified to reach the goal. 
Then you go to the Options and specify the solver to be used and if necessary 
adjust the according parameters.
   There is also a list of constraints you can use to restrict the 
possible range of solutions or to penalize certain conditions. However, in case 
of the evolutionary solvers DEPS and SCO, these constraints are also used to 
specify bounds on the variables of the problem. Due to the random nature of the 
algorithms, it is highly recommended to do so and give upper (and 
in case "Assume Non-Negative Variables" is turned off also lower) bounds for 
all variables. They don't have to be near the actual solution (which is 
probably unknown) but should give a rough indication of the expected size (0 
≤ var ≤ 1 or maybe -100 ≤ var ≤ 100).
   Bounds are specified by selecting one or more variables (as range) 
on the left side and entering a numerical value (not a cell or a formula) on 
the right side. That way you can also choose one or more variables to be 
Integer or Binary only.

commit 388fa3a2476ad4b6ee3a33dc2f94f5946e29e2b6
Author: Stanislav Horacek 
Date:   Fri Nov 4 20:16:56 2016 +0100

Updated core
Project: help  8494b1d545c68fd4eeb75d78c692a3ce71ed3caf

tdf#103622 do not use arrow as separator of menu commands

Change-Id: I761c3845939ee95fb151a196587b359c3b6d965d
Reviewed-on: https://gerrit.libreoffice.org/30572
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/helpcontent2 b/helpcontent2
index 98d298e..8494b1d 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 98d298e4ef2bc9ad9f4e2d2bb83c3183e3ee0977
+Subproject commit 8494b1d545c68fd4eeb75d78c692a3ce71ed3caf
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-11-06 Thread Stanislav Horacek
 source/text/shared/01/notebook_bar.xhp   |6 +++---
 source/text/shared/guide/cmis-remote-files-setup.xhp |2 +-
 source/text/shared/guide/cmis-remote-files.xhp   |   16 
 3 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 8494b1d545c68fd4eeb75d78c692a3ce71ed3caf
Author: Stanislav Horacek 
Date:   Fri Nov 4 20:16:56 2016 +0100

tdf#103622 do not use arrow as separator of menu commands

Change-Id: I761c3845939ee95fb151a196587b359c3b6d965d
Reviewed-on: https://gerrit.libreoffice.org/30572
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/source/text/shared/01/notebook_bar.xhp 
b/source/text/shared/01/notebook_bar.xhp
index d5ac76a..4be27cd 100644
--- a/source/text/shared/01/notebook_bar.xhp
+++ b/source/text/shared/01/notebook_bar.xhp
@@ -53,7 +53,7 @@
 The 
notebook bar is available in Writer, Calc and Impress. The user interface has 
now several available layouts. Two entries in the View menu controls the notebook bar: Toolbar Layout and Notebook 
bar.
 
 
-Choose menu View → Toolbar layout → 
Notebook bar
+Choose menu View - Toolbar layout - 
Notebook bar
 
 
 User interface layouts
@@ -70,7 +70,7 @@
 Sidebar – The sidebar is fully opened and only 
one toolbar is showed – formatting toolbar.
   
   
-Notebook bar – all toolbar and sidebar are 
hidden and the notebook bar is placed on the top. The menu entry: View → Notebook bar is active only in this mode and user can 
then choose the notebook bar layout. 
+Notebook bar – all toolbar and sidebar are 
hidden and the notebook bar is placed on the top. The menu entry: View - Notebook bar is active only in this mode and user can 
then choose the notebook bar layout.
   
 When user activates additional toolbars, they will be saved in 
the user profile. Therefore, on returning to the notebook bar mode, all 
toolbars set visible before will show again.
 
@@ -89,7 +89,7 @@
   
 Contextual single toolbar – Displays a single 
centered toolbar with context dependent contents.
   
-The 
notebook bar icon size is adjustable in Tools → Options 
→ LibreOffice → View → Notebook bar listbox.
+The 
notebook bar icon size is adjustable in Tools - Options - 
LibreOffice - View - Notebook bar listbox.
 The 
notebook bar cannot be customized.
 The 
current implementation (%PRODUCTNAME %PRODUCTVERSION) of the notebook bar is 
common to Writer, Calc and Impress modules. A change in the notebook bar in one 
module will affect the notebook bar of the other modules.
 
diff --git a/source/text/shared/guide/cmis-remote-files-setup.xhp 
b/source/text/shared/guide/cmis-remote-files-setup.xhp
index adc5f7a..36c28f0 100644
--- a/source/text/shared/guide/cmis-remote-files-setup.xhp
+++ b/source/text/shared/guide/cmis-remote-files-setup.xhp
@@ -100,7 +100,7 @@
 User, Password: the username and password of the 
FTP service.
   
   
-Remember password: 
Check to store the password in %PRODUCTNAME user profile. The password will be 
secured by the master password in Tools → Options → 
LibreOffice → Security → Internet passwords.
+Remember password: 
Check to store the password in %PRODUCTNAME user profile. The password will be 
secured by the master password in Tools - Options - 
LibreOffice - Security - Internet passwords.
   
   
 
diff --git a/source/text/shared/guide/cmis-remote-files.xhp 
b/source/text/shared/guide/cmis-remote-files.xhp
index 6b256e4..0880648 100644
--- a/source/text/shared/guide/cmis-remote-files.xhp
+++ b/source/text/shared/guide/cmis-remote-files.xhp
@@ -45,7 +45,7 @@
 
 
   
-Choose File → Open remote file 
in any %PRODUCTNAME module
+Choose File - Open remote file in 
any %PRODUCTNAME module
   
   
 Click the Remote Files button the Start 
Center
@@ -75,10 +75,10 @@
 Check Out and Check In services control updates to document 
and prevent unwanted overwrites in a CMIS remote service.
 Checking out a document locks it, preventing other users 
writing changes to it. Only one user can have a particular document checked out 
(locked) at any time. Checking in a document or canceling the check out unlocks 
the document.
 There 
are no check controls for remote files in Windows Shares, WebDAV, FTP and SSH 
services.
-When a file is open from a CMIS remote file service, 
%PRODUCTNAME display a Check-out button on the top message area. 
Click the Check-out button to lock the file in the server to 
prevent edition by another user. Alternatively choose File → Check-out .
+When a file is open from a CMIS remote file service, 
%PRODUCTNAME display a Check-out button on the top message area. 
Click the Check-out button to lock the file in the server to 
prevent edition by another user. Alternatively choose File - Check-out.
 %PRODUCTNAME creates a working copy of the file in the server 
(and inserts the string (Working Copy) in the file 
name) when a file is checked-out. Every edi

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

2016-11-06 Thread Julien Nabet
 basic/source/sbx/sbxconv.hxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 703d00e335bf0d38b3019ec2ba095b27a5fdba2d
Author: Julien Nabet 
Date:   Sun Nov 6 10:31:07 2016 +0100

Fix Android build (basic)

by retrieving the content of former function ImpRound

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

diff --git a/basic/source/sbx/sbxconv.hxx b/basic/source/sbx/sbxconv.hxx
index 08fa296..39db080 100644
--- a/basic/source/sbx/sbxconv.hxx
+++ b/basic/source/sbx/sbxconv.hxx
@@ -21,6 +21,15 @@
 #define INCLUDED_BASIC_SOURCE_SBX_SBXCONV_HXX
 
 #include "sbxdec.hxx"
+#if defined(ANDROID)
+namespace std
+{
+double lround(double d)
+{
+return d + ( d < 0 ? -0.5 : 0.5 );
+}
+}
+#endif
 
 class SbxArray;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/externallink' - 0 commits -

2016-11-06 Thread Unknown
Rebased ref, commits from common ancestor:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'feature/dataprovider'

2016-11-06 Thread Julien Nabet
New branch 'feature/dataprovider' available with the following commits:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-11-06 Thread Julien Nabet
 basic/source/sbx/sbxconv.hxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 62d7d5b8cff59eb554ce90342be923b4815d18fa
Author: Julien Nabet 
Date:   Sun Nov 6 12:47:54 2016 +0100

Fix Android build (llround)

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

diff --git a/basic/source/sbx/sbxconv.hxx b/basic/source/sbx/sbxconv.hxx
index 39db080..34a9ba3 100644
--- a/basic/source/sbx/sbxconv.hxx
+++ b/basic/source/sbx/sbxconv.hxx
@@ -28,6 +28,10 @@ double lround(double d)
 {
 return d + ( d < 0 ? -0.5 : 0.5 );
 }
+double llround(double d)
+{
+return d + ( d < 0 ? -0.5 : 0.5 );
+}
 }
 #endif
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/Library_OGLTrans.mk

2016-11-06 Thread David Tardon
 slideshow/Library_OGLTrans.mk |4 
 1 file changed, 4 insertions(+)

New commits:
commit afe235a0abf9ef91a353a4d0dccf56961abd2fbf
Author: David Tardon 
Date:   Sun Nov 6 14:00:50 2016 +0100

tdf#103696 ensure glm always uses radians

This is set just locally for OGLTrans, because I have no idea what the
other places that use glm expect...

Change-Id: I83675ef2463ab945cb3d6885f803dcbae60a5558

diff --git a/slideshow/Library_OGLTrans.mk b/slideshow/Library_OGLTrans.mk
index 3dce634..b908a0b 100644
--- a/slideshow/Library_OGLTrans.mk
+++ b/slideshow/Library_OGLTrans.mk
@@ -15,6 +15,10 @@ $(eval $(call gb_Library_add_defs,OGLTrans,\
 ))
 endif
 
+$(eval $(call gb_Library_add_defs,OGLTrans,\
+-DGLM_FORCE_RADIANS \
+))
+
 $(eval $(call gb_Library_use_sdk_api,OGLTrans))
 
 $(eval $(call gb_Library_use_libraries,OGLTrans,\
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Advise needed for fixing tdf#41253

2016-11-06 Thread Korrawit Pruegsanusak
Hello everyone,

I just have some times to look at tdf#41253.
(https://bugs.documentfoundation.org/41253) But I don't promise I
could finish it, so I still didn't assign myself into a bug. Anyway,
let me explain (and ask) about it:

The bug is about importing pptx file which has shadowed text (one of
the text effects apart from bold, italic, underlined), but LibO can't
import "shadowing text".

The problem is, in OOXML structure, shadowing is declared in
 element, which is a child of . For more
info, please see http://www.datypic.com/sc/ooxml/e-a_effectLst-1.html

This is the OOXML sample comparing shadowed and non-shadowed text
(cropped from slide1.xml of an extracted pptx file):
---cut---









Text with shadow





 Text without shadow



---cut---

And the code parsing  is still unsupported, see:
http://opengrok.libreoffice.org/xref/core/oox/source/drawingml/textcharacterpropertiescontext.cxx#101

This is my patch (also attached to this email). It compiled
successfully, but the shadowing still didn't work:

---cut---
diff --git a/oox/inc/drawingml/textcharacterproperties.hxx
b/oox/inc/drawingml/textcharacterproperties.hxx
index 055e58f..2dca075 100644
--- a/oox/inc/drawingml/textcharacterproperties.hxx
+++ b/oox/inc/drawingml/textcharacterproperties.hxx
@@ -56,6 +56,7 @@ struct TextCharacterProperties
 OptValue< bool >moUnderlineLineFollowText;
 OptValue< bool >moUnderlineFillFollowText;
 FillProperties  maFillProperties;
+OptValue< bool >moCharShadowed;

 std::vector maTextEffectsProperties;

diff --git a/oox/source/drawingml/textcharacterproperties.cxx
b/oox/source/drawingml/textcharacterproperties.cxx
index 48803de..c5e1253 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -151,6 +151,10 @@ void TextCharacterProperties::pushToPropMap(
PropertyMap& rPropMap, const XmlFil
 rPropMap.setProperty( PROP_CharUnderlineHasColor, true);
 rPropMap.setProperty( PROP_CharUnderlineColor,
maUnderlineColor.getColor( rFilter.getGraphicHelper() ));
 }
+
+bool bCharShadowed = moCharShadowed.get(false);
+SAL_DEBUG(bCharShadowed);
+rPropMap.setProperty( PROP_CharShadowed, /*true */bCharShadowed);
 }

 void pushToGrabBag( PropertySet& rPropSet, const
std::vector& aVectorOfProperyValues )
---cut---

In textcharacterproperties.cxx, it is where the shadowing process
done. If I change the argument to "true", like this:
rPropMap.setProperty( PROP_CharShadowed, true);
Then all texts will got shadowed. The problem is, bCharShadowed is
never "true" in current patch, and I couldn't get it to be "true".

---cut---
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx
b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index 1c62c1d..ef24ab1 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -217,6 +223,10 @@ ContextHandlerRef
TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl
 return new TextEffectsContext( *this, aElementToken,
mrTextCharacterProperties.maTextEffectsProperties );
 }
 break;
+case A_TOKEN(outerShdw):
+SAL_DEBUG("A_TOKEN now True");
+mrTextCharacterProperties.moCharShadowed = true;
+break;
 default:
 SAL_WARN("oox",
"TextCharacterPropertiesContext::onCreateContext: unhandled element: "
<< getBaseToken(aElementToken));
 break;
---cut---

I don't know why bCharShadowed is never "true". But I think this
approach is likely inappropriate because we already have these:

---cut---
// EG_EffectProperties
case A_TOKEN( effectDag ):  // CT_EffectContainer 5.1.10.25
case A_TOKEN( effectLst ):  // CT_EffectList 5.1.10.26
break;
---cut---

in textcharacterpropertiescontext.cxx line 99-102, which I think it's
more correct to start from these codes.

So, should I start over from the line:
case A_TOKEN( effectLst ):  // CT_EffectList 5.1.10.26
or any advise about my patch would be much appreciated.


Thank you very much.
Best Regards,
-- 
Korrawit Pruegsanusak
diff --git a/oox/inc/drawingml/textcharacterproperties.hxx 
b/oox/inc/drawingml/textcharacterproperties.hxx
index 055e58f..2dca075 100644
--- a/oox/inc/drawingml/textcharacterproperties.hxx
+++ b/oox/inc/drawingml/textcharacterproperties.hxx
@@ -56,6 +56,7 @@ struct TextCharacterProperties
 OptValue< bool >moUnderlineLineFollowText;
 OptValue< bool >moUnderlineFillFollowText;
 FillProperties  maFillProperties;
+OptValue< bool >moCharShadowed;
 
 std::vector maTextEffectsProperties;
 
diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
i

Toye, Peter licence statement

2016-11-06 Thread Peter Toye
To whom it may concern:

All of my past & future contributions to LibreOffice may be licensed under the 
MPLv2/LGPLv3+ dual license.

My wiki user name is ptoye.

My email addresses vary. For general LO issues it is l...@ptoye.com, for Git 
issues it is g...@ptoye.com, for Gerrit it is ger...@ptoye.com. I hope this 
isn't too confusing to you. It sometimes is to me.

 
Regards,

Peter Toye
mailto:g...@ptoye.com
www.ptoye.com___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'aoo/trunk' - dbaccess/source

2016-11-06 Thread Damjan Jovanovic
 dbaccess/source/ui/app/app.src |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8df1c30b7f5e79c2757e7224677f9a487b1bed0a
Author: Damjan Jovanovic 
Date:   Sun Nov 6 16:42:58 2016 +

#i119892# Missing "by" in description

Fixes spelling errors in some Base messages.

Reported by: Dwayne Henderson
Patch by: me

diff --git a/dbaccess/source/ui/app/app.src b/dbaccess/source/ui/app/app.src
index 05f3524..5f67dea 100644
--- a/dbaccess/source/ui/app/app.src
+++ b/dbaccess/source/ui/app/app.src
@@ -306,11 +306,11 @@ String RID_STR_FORMS_HELP_TEXT_WIZARD
 };
 String RID_STR_QUERIES_HELP_TEXT
 {
-Text [ en-US ] = "Create a query by specifying the filters, input tables, 
field names,  and  properties for sorting or grouping." ;
+Text [ en-US ] = "Create a query by specifying the filters, input tables, 
field names, and properties for sorting or grouping." ;
 };
 String RID_STR_QUERIES_HELP_TEXT_SQL
 {
-Text [ en-US ] = "Create a query  entering an SQL statement directly." ;
+Text [ en-US ] = "Create a query by entering an SQL statement directly." ;
 };
 String RID_STR_QUERIES_HELP_TEXT_WIZARD
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-11-06 Thread Maxim Monastirsky
 framework/inc/uielement/newmenucontroller.hxx|2 
 framework/source/uielement/newmenucontroller.cxx |   82 ---
 include/svtools/popupmenucontrollerbase.hxx  |2 
 svtools/source/uno/popupmenucontrollerbase.cxx   |6 +
 4 files changed, 20 insertions(+), 72 deletions(-)

New commits:
commit cea3b8762bfb7f0da19bab8a3d468bcbf987eb0f
Author: Maxim Monastirsky 
Date:   Sun Nov 6 21:31:15 2016 +0200

NewMenuController: Fix template manager icon

The current logic is swapped. MenuAttributes::aImageId can be
only handled by SvFileInformationManager, while the menu item
command is what might be (in case of .uno command) handled
by CommandInfoProvider.

This gone wrong in tdf#96059 which wrongly assumed that
GetImageFromURL is equivalent to what's provided by
CommandInfoProvider (so other places should be checked too).

Change-Id: Ia487c602753dde3fb0d0462ef4b3d63209398b36

diff --git a/framework/source/uielement/newmenucontroller.cxx 
b/framework/source/uielement/newmenucontroller.cxx
index 09ca33e..e8963fd 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -72,7 +72,6 @@ DEFINE_INIT_SERVICE (   
NewMenuController, {} )
 void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, bool bSetImages )
 {
 sal_uInt16 nItemCount = pPopupMenu->GetItemCount();
-Image   aImage;
 Reference< XFrame > xFrame( m_xFrame );
 
 for ( sal_uInt16 i = 0; i < nItemCount; i++ )
@@ -82,39 +81,23 @@ void NewMenuController::setMenuImages( PopupMenu* 
pPopupMenu, bool bSetImages )
 {
 if ( bSetImages )
 {
-boolbImageSet( false );
 OUString aImageId;
-
+OUString aCmd( pPopupMenu->GetItemCommand( nItemId ) );
 sal_uLong nAttributePtr = 
pPopupMenu->GetUserValue(sal::static_int_cast(i));
 MenuAttributes* pAttributes = reinterpret_cast(nAttributePtr);
 if (pAttributes)
 aImageId = pAttributes->aImageId;
 
-if ( !aImageId.isEmpty() )
-{
-aImage = 
vcl::CommandInfoProvider::Instance().GetImageForCommand(aImageId, xFrame);
-if ( !!aImage )
-{
-bImageSet = true;
-pPopupMenu->SetItemImage( nItemId, aImage );
-}
-}
-
-if ( !bImageSet )
-{
-OUString aCmd( pPopupMenu->GetItemCommand( nItemId ) );
-if ( !aCmd.isEmpty() )
-{
-INetURLObject aURLObj( aCmd );
-aImage = SvFileInformationManager::GetImageNoDefault( 
aURLObj );
-}
+INetURLObject aURLObj( aImageId.isEmpty() ? aCmd : aImageId );
+Image aImage = SvFileInformationManager::GetImageNoDefault( 
aURLObj );
+if ( !aImage )
+aImage = 
vcl::CommandInfoProvider::Instance().GetImageForCommand(aCmd, xFrame);
 
-if ( !!aImage )
-pPopupMenu->SetItemImage( nItemId, aImage );
-}
+if ( !!aImage )
+pPopupMenu->SetItemImage( nItemId, aImage );
 }
 else
-pPopupMenu->SetItemImage( nItemId, aImage );
+pPopupMenu->SetItemImage( nItemId, Image() );
 }
 }
 }
commit 5bd6b61a7cad81d8385e5bc4ea0e6546b1eb7314
Author: Maxim Monastirsky 
Date:   Sun Nov 6 20:46:04 2016 +0200

NewMenuController: Remove duplicate async dispatch handling

Change-Id: I881e6781c5ba82b0b998891532f8b7c281567b73

diff --git a/framework/inc/uielement/newmenucontroller.hxx 
b/framework/inc/uielement/newmenucontroller.hxx
index 869650e..8b52dbb 100644
--- a/framework/inc/uielement/newmenucontroller.hxx
+++ b/framework/inc/uielement/newmenucontroller.hxx
@@ -77,8 +77,6 @@ namespace framework
 // XEventListener
 virtual void SAL_CALL disposing( const css::lang::EventObject& 
Source ) throw ( css::uno::RuntimeException, std::exception ) override;
 
-DECL_STATIC_LINK( NewMenuController, ExecuteHdl_Impl, void*, void 
);
-
 private:
 virtual void impl_setPopupMenu() override;
 
diff --git a/framework/source/uielement/newmenucontroller.cxx 
b/framework/source/uielement/newmenucontroller.cxx
index 971e5f5..09ca33e 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -407,58 +407,38 @@ void SAL_CALL NewMenuController::statusChanged( const 
FeatureStateEvent& ) throw
 void SAL_CALL NewMenuController::itemSelected( const css::awt::MenuEvent& 
rEvent ) throw (RuntimeException, std::exception)
 {
 Reference< css::awt::

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

2016-11-06 Thread Maxim Monastirsky
 framework/inc/uielement/newmenucontroller.hxx |7 ---
 1 file changed, 7 deletions(-)

New commits:
commit ba28100d8103e08832cf646f674eaf6afd480512
Author: Maxim Monastirsky 
Date:   Sun Nov 6 22:04:45 2016 +0200

NewDocument is now unused

Change-Id: Ifce80cec8935b960b14716d09080f76351633c0b

diff --git a/framework/inc/uielement/newmenucontroller.hxx 
b/framework/inc/uielement/newmenucontroller.hxx
index 8b52dbb..94e1849 100644
--- a/framework/inc/uielement/newmenucontroller.hxx
+++ b/framework/inc/uielement/newmenucontroller.hxx
@@ -46,13 +46,6 @@
 
 namespace framework
 {
-struct NewDocument
-{
-css::util::URLaTargetURL;
-css::uno::Sequence< css::beans::PropertyValue >   aArgSeq;
-css::uno::Reference< css::frame::XDispatch >  xDispatch;
-};
-
 class NewMenuController :  public svt::PopupMenuControllerBase
 {
 using svt::PopupMenuControllerBase::disposing;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - configure.ac distro-configs/CPLinux.conf download.lst external/Module_external.mk external/noto_font Makefile.fetch scp2/source setup

2016-11-06 Thread Andras Timar
 Makefile.fetch   |3 
 configure.ac |   20 ++
 distro-configs/CPLinux.conf  |1 
 download.lst |2 
 external/Module_external.mk  |1 
 external/noto_font/ExternalPackage_noto.mk   |  230 +++
 external/noto_font/Makefile  |7 
 external/noto_font/Module_noto_font.mk   |   17 +
 external/noto_font/README|1 
 external/noto_font/UnpackedTarball_noto.mk   |   14 +
 scp2/source/ooo/file_font_ooo.scp|5 
 scp2/source/ooo/module_hidden_ooo.scp|   13 +
 setup_native/source/packinfo/package_names.txt   |1 
 setup_native/source/packinfo/packinfo_office.txt |   15 +
 14 files changed, 330 insertions(+)

New commits:
commit 1b6ec3bddf80775fe939875c188c61cd4241441e
Author: Andras Timar 
Date:   Sun Nov 6 21:03:40 2016 +0100

Bundle Google Noto fonts

Change-Id: Ic39ef335a5829d7472090d253af7d6c74393c05a

diff --git a/Makefile.fetch b/Makefile.fetch
index 3c634f5..742aa06 100644
--- a/Makefile.fetch
+++ b/Makefile.fetch
@@ -235,6 +235,9 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk 
$(SRCDIR)/download.lst $(SRCDIR)
,$(call 
fetch_Download_item,http://ooo.itc.hu/oxygenoffice/download/libreoffice,$(item)))
$(if $(call fetch_Optional,LIBGLTF,LIBGLTF_TARBALL) \
, $(call 
fetch_Download_item,http://dev-www.libreoffice.org/src/libgltf,$(call 
fetch_Optional,LIBGLTF,LIBGLTF_TARBALL)))
+   $(foreach item, \
+   $(call fetch_Optional,NOTO_FONT,FONT_NOTO_TARBALL) \
+   ,$(call 
fetch_Download_item,https://noto-website-2.storage.googleapis.com/pkgs,$(item)))
@mkdir -p $(dir $@) && touch $@
 
 # vim: set noet sw=4 ts=4:
diff --git a/configure.ac b/configure.ac
index cdcd7cb..aaf06a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1572,6 +1572,11 @@ AC_ARG_WITH(fonts,
  known to be available on the system then you should use this 
option.]),
 ,)
 
+AC_ARG_ENABLE(noto-font,
+AS_HELP_STRING([--enable-noto-font],
+[Add Google Noto font.]),
+,)
+
 AC_ARG_WITH(epm,
 AS_HELP_STRING([--with-epm],
 [Decides which epm to use. Default is to use the one from the system if
@@ -11559,6 +11564,21 @@ AC_SUBST(WITH_FONTS)
 AC_DEFINE_UNQUOTED([TEST_FONTS_MISSING], $TEST_FONTS_MISSING)
 
 dnl ===
+dnl Test whether to include Google Noto fonts
+dnl ===
+AC_MSG_CHECKING([whether to include Google Noto fonts])
+if test "$enable_noto_font" = "" -o "$enable_noto_font" = "no" -o 
"$with_fonts" = "no"; then
+AC_MSG_RESULT([no])
+WITH_NOTO_FONT=
+else
+AC_MSG_RESULT([yes])
+WITH_NOTO_FONT=TRUE
+BUILD_TYPE="$BUILD_TYPE NOTO_FONT"
+SCPDEFS="$SCPDEFS -DWITH_NOTO_FONT"
+fi
+AC_SUBST(WITH_NOTO_FONT)
+
+dnl ===
 dnl Test whether to include extra galleries
 dnl ===
 AC_MSG_CHECKING([whether to include extra galleries])
diff --git a/distro-configs/CPLinux.conf b/distro-configs/CPLinux.conf
index cc163fe..bd14184 100644
--- a/distro-configs/CPLinux.conf
+++ b/distro-configs/CPLinux.conf
@@ -15,6 +15,7 @@
 --without-helppack-integration
 --with-linker-hash-style=both
 --with-fonts
+--enable-noto-font
 --with-external-thes-dir=/usr/share/mythes
 --with-external-hyph-dir=/usr/share/hyphen
 --with-external-dict-dir=/usr/share/hunspell
diff --git a/download.lst b/download.lst
index bd68989..4e49ab2 100755
--- a/download.lst
+++ b/download.lst
@@ -45,6 +45,8 @@ export FONT_KARLA_TARBALL := 
506757f768adb2331881d5186f7286bd-karla.zip
 export FONT_LIBERATION_NARROW_TARBALL := 
134d8262145fc793c6af494dcace3e71-liberation-fonts-ttf-1.07.4.tar.gz
 export FONT_LIBERATION_TARBALL := 
5c781723a0d9ed6188960defba8e91cf-liberation-fonts-ttf-2.00.1.tar.gz
 export FONT_LINLIBERTINEG_TARBALL := 
e7a384790b13c29113e22e596ade9687-LinLibertineG-20120116.zip
+export FONT_NOTO_TARBALL := Noto-hinted.zip
+export FONT_NOTO_MD5SUM := 5489f1765afd34a2adfdc04d014762e7
 export FONT_OPENSANS_TARBALL := 
7a15edea7d415ac5150ea403e27401fd-open-sans-font-ttf-1.10.tar.gz
 export FONT_PTSERIF_TARBALL := 
c3c1a8ba7452950636e871d25020ce0d-pt-serif-font-1.W.tar.gz
 export FONT_SOURCECODE_TARBALL := 
0279a21fab6f245e85a6f85fea54f511-source-code-font-1.009.tar.gz
diff --git a/external/Module_external.mk b/external/Module_external.mk
index 7c78c7d..438618a 100644
--- a/external/Module_external.mk
+++ b/external/Module_external.mk
@@ -75,6 +75,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,MYSQLCPPCONN,mysqlcppconn) \
$(call gb_Helper_optional,MYTHES,mythes) \
$(call gb_Helper_optional,NEON,neon) \
+   

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

2016-11-06 Thread Khaled Hosny
 sw/source/core/text/porlay.cxx |   19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)

New commits:
commit 7fdb418aea11a4e1f09a04c02d125880925272aa
Author: Khaled Hosny 
Date:   Sun Nov 6 22:30:32 2016 +0200

tdf#65344: Don’t put Kashida before any final char

If we didn’t find any known good position, not inserting Kashida at all
is better than inserting it randomly.

Change-Id: I075f8414b7f0a0aeb4d27d372c7eae51f4b5c37b

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 1edf156..7bd6706 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1056,10 +1056,7 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& 
rNode, bool bRTL )
 {
 // remaining right joiners
 // Reh, Zain, Thal,
-if ( isRehChar ( cCh ) ||   // Reh Zain (right joining)
-// final form may appear 
in the middle of word
- ( 0x60C <= cCh && 0x6FE >= cCh // all others
-  && nIdx == nWordLen - 1))   // only at end of 
word
+if ( isRehChar ( cCh ) )   // Reh Zain (right joining)
 {
 SAL_WARN_IF( 0 == cPrevCh, "sw.core", "No previous 
character" );
 // check if character is connectable to previous 
character,
commit 6723fd9d185c8911d83e6b1fd06476e7c5cefce2
Author: Khaled Hosny 
Date:   Sun Nov 6 22:16:07 2016 +0200

Follow Unicode character names for better or worse

To avoid confusing transliteration.

Change-Id: I0ac1692b469f6f974fe3e5b0cc12a40d6f3a7018

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 30b3cbc..1edf156 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -62,7 +62,7 @@ using namespace i18n::ScriptType;
 #define IS_JOINING_GROUP(c, g) ( u_getIntPropertyValue( (c), 
UCHAR_JOINING_GROUP ) == U_JG_##g )
 #define isAinChar(c)IS_JOINING_GROUP((c), AIN)
 #define isAlefChar(c)   IS_JOINING_GROUP((c), ALEF)
-#define isBaaChar(c)IS_JOINING_GROUP((c), BEH)
+#define isBehChar(c)IS_JOINING_GROUP((c), BEH)
 #define isDalChar(c)IS_JOINING_GROUP((c), DAL)
 #define isFehChar(c)IS_JOINING_GROUP((c), FEH)
 #define isGafChar(c)IS_JOINING_GROUP((c), GAF)
@@ -1010,10 +1010,10 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& 
rNode, bool bRTL )
 }
 
 // 5. Priority:
-// before media Bah
+// before medial Beh
 if ( nPriorityLevel >= 4 && nIdx > 0 && nIdx < nWordLen - 
1 )
 {
-if ( isBaaChar ( cCh )) // Bah
+if ( isBehChar ( cCh )) // Beh
 {
 // check if next character is Reh, Yeh or Alef 
Maksura
 sal_Unicode cNextCh = rWord[ nIdx + 1 ];
@@ -1031,7 +1031,7 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& 
rNode, bool bRTL )
 }
 
 // 6. Priority:
-// before the final form of Waw, Ain, Qaf and Fa
+// before the final form of Waw, Ain, Qaf and Feh
 if ( nPriorityLevel >= 5 && nIdx > 0 )
 {
 if ( isWawChar ( cCh )   || // Wav (right joining)
commit 4920ee168fd210483c7f404cc2b41a00a265139f
Author: Khaled Hosny 
Date:   Sun Nov 6 22:06:44 2016 +0200

Insert Kasida before final Heh not Hah

This code seems to follow the algorithm described in:
https://www.microsoft.com/middleeast/msdn/JustifyingText-CSS.aspx

But there seem to be a confusion due to the transliteration used there,
Haa can be the standard Arabic name for U+0647 ARABIC LETTER HEH or
U+062D ARABIC LETTER HAH. The code is using the later, but I’m pretty
sure it is the former given that the other character in this priority is
Teh Marbuta, which is a Heh-like character. Also before final Hah is a
bad place for kashida.

Change-Id: I9ad3fc432ac58f0e45c562a6b44ac5cbe751c3bf

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 7850763..30b3cbc 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -66,7 +66,7 @@ using namespace i18n::ScriptType;
 #define isDalChar(c)IS_JOINING_GROUP((c), DAL)
 #define isFehChar(c)IS_JOINING_GROUP((c), FEH)
 #define isGafChar(c)IS_JOINING_GROUP((c), GAF)
-#define isHahChar(c)IS_JOINING_GROUP((c), HAH)
+#define isHehChar(c)IS_JOINING_GROUP((c), HEH)
 #define isKafChar(c)IS_JOINING_GROUP((c), KAF)
 #define isLamChar(c)IS_JOINING_GROUP((c), LAM)
 #define isQafC

[Libreoffice-commits] core.git: helpcontent2

2016-11-06 Thread Olivier Hallot
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d9f4c9a62b443d06509b2885ddc890c80ba1570e
Author: Olivier Hallot 
Date:   Sun Nov 6 18:29:59 2016 -0200

Updated core
Project: help  1678d9035beaf714860804462f03501393291c56

Honor width and height in images for help3

Modern browsers renders width and height expressed in inches and
centimeters, as well as pixels.

Change-Id: I337de791e7e894b0c84f1bd9848e15edc861707f
Reviewed-on: https://gerrit.libreoffice.org/30616
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index 8494b1d..1678d90 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 8494b1d545c68fd4eeb75d78c692a3ce71ed3caf
+Subproject commit 1678d9035beaf714860804462f03501393291c56
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: help3xsl/online_transform.xsl

2016-11-06 Thread Olivier Hallot
 help3xsl/online_transform.xsl |   15 ---
 1 file changed, 4 insertions(+), 11 deletions(-)

New commits:
commit 1678d9035beaf714860804462f03501393291c56
Author: Olivier Hallot 
Date:   Sun Nov 6 18:29:59 2016 -0200

Honor width and height in images for help3

Modern browsers renders width and height expressed in inches and
centimeters, as well as pixels.

Change-Id: I337de791e7e894b0c84f1bd9848e15edc861707f
Reviewed-on: https://gerrit.libreoffice.org/30616
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index fd53aad..3d8de82 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -44,12 +44,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 -->
 
-http://www.w3.org/1999/XSL/Transform";
-xmlns:math="http://www.w3.org/1998/Math/MathML";>
+http://www.w3.org/1999/XSL/Transform";>
 
-
+
 
 

-
-   
-   
-   
-   
-   
+
+   
 
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-11-06 Thread Khaled Hosny
 sw/source/core/text/porlay.cxx |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 6a087ef7d4f67f52ab688d0dc84b39b5bd36d931
Author: Khaled Hosny 
Date:   Sun Nov 6 22:44:15 2016 +0200

Update comments

Change-Id: Ia63e2f16eb70c4a0cc20fc73f0f2694f1381dac5

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 7bd6706..ff2f4b8 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1054,9 +1054,8 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& 
rNode, bool bRTL )
 // other connecting possibilities
 if ( nPriorityLevel >= 6 && nIdx > 0 )
 {
-// remaining right joiners
-// Reh, Zain, Thal,
-if ( isRehChar ( cCh ) )   // Reh Zain (right joining)
+// Reh, Zain
+if ( isRehChar ( cCh ) )
 {
 SAL_WARN_IF( 0 == cPrevCh, "sw.core", "No previous 
character" );
 // check if character is connectable to previous 
character,
@@ -1068,9 +1067,8 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& 
rNode, bool bRTL )
 }
 }
 
-// Do not consider Fathatan, Dammatan, Kasratan, Fatha,
-// Damma, Kasra, Shadda and Sukun when checking if
-// a character can be connected to previous character.
+// Do not consider vowel marks when checking if a character
+// can be connected to previous character.
 if ( !isTransparentChar ( cCh) )
 cPrevCh = cCh;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/nativealpha' - 4372 commits - accessibility/inc accessibility/source android/mobile-config.py android/source animations/source apple_remote/source avmed

2016-11-06 Thread Tomaž Vajngerl
Rebased ref, commits from common ancestor:
commit 8bf696e5689280528ae625c80d8c8844d40264e8
Author: Tomaž Vajngerl 
Date:   Sun Jul 24 22:14:27 2016 +0900

vcl: use same bitdepth when performing super scaling

Change-Id: I379c4aa9aa83470961fa972eec8cdb67261f749c

diff --git a/vcl/source/bitmap/bitmapscalesuper.cxx 
b/vcl/source/bitmap/bitmapscalesuper.cxx
index ff01aae..ddb3a85 100644
--- a/vcl/source/bitmap/bitmapscalesuper.cxx
+++ b/vcl/source/bitmap/bitmapscalesuper.cxx
@@ -937,7 +937,7 @@ bool BitmapScaleSuper::filter(Bitmap& rBitmap)
 
 Bitmap::ScopedReadAccess pReadAccess(rBitmap);
 
-Bitmap aOutBmp(Size(nDstW, nDstH), 24);
+Bitmap aOutBmp(Size(nDstW, nDstH), rBitmap.GetBitCount());
 Bitmap::ScopedWriteAccess pWriteAccess(aOutBmp);
 
 const long nStartY = 0;
commit 59c7e1287a2ba3efe66ce8fa692840552b2a6ed5
Author: Tomaž Vajngerl 
Date:   Tue Jun 28 16:39:57 2016 +0800

BitmapProcessor: support 32-bit bitmap in createLightImage

Change-Id: If28c715f9737f34b9d71c1342cae88fcc69231dd

diff --git a/vcl/source/bitmap/BitmapProcessor.cxx 
b/vcl/source/bitmap/BitmapProcessor.cxx
index 1a89da5..e64fd2a 100644
--- a/vcl/source/bitmap/BitmapProcessor.cxx
+++ b/vcl/source/bitmap/BitmapProcessor.cxx
@@ -17,7 +17,9 @@ BitmapEx BitmapProcessor::createLightImage(const BitmapEx& 
rBitmapEx)
 const Size aSize(rBitmapEx.GetSizePixel());
 
 Bitmap aBitmap(rBitmapEx.GetBitmap());
-Bitmap aDarkBitmap(aSize, 24);
+int nBitcount = aBitmap.GetBitCount() == 32 ? 32 : 24;
+
+Bitmap aDarkBitmap(aSize, nBitcount);
 
 BitmapReadAccess* pRead(aBitmap.AcquireReadAccess());
 BitmapWriteAccess* pWrite(aDarkBitmap.AcquireWriteAccess());
commit 006f9fa1eb1b90481468d8f5460d74843ba26dc9
Author: Tomaž Vajngerl 
Date:   Sun Jun 26 11:31:07 2016 +0800

vcl: Test for PngReader - reading of various PNG formats

Change-Id: I2469751806e03c791c1882a32c31c090d7dac39f

diff --git a/vcl/CppunitTest_vcl_png_test.mk b/vcl/CppunitTest_vcl_png_test.mk
new file mode 100644
index 000..1f88209
--- /dev/null
+++ b/vcl/CppunitTest_vcl_png_test.mk
@@ -0,0 +1,52 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# 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/.
+#
+
+$(eval $(call gb_CppunitTest_CppunitTest,vcl_png_test))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,vcl_png_test, \
+vcl/qa/cppunit/png/PngFilterTest \
+))
+
+$(eval $(call gb_CppunitTest_set_include,vcl_png_test,\
+$$(INCLUDE) \
+-I$(SRCDIR)/vcl/inc \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,vcl_png_test, \
+   comphelper \
+   cppu \
+   cppuhelper \
+   sal \
+svt \
+   test \
+   tl \
+   unotest \
+   vcl \
+   utl \
+   $(gb_UWINAPI) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,vcl_png_test,\
+udkapi \
+offapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,vcl_png_test))
+$(eval $(call gb_CppunitTest_use_vcl,vcl_png_test))
+
+$(eval $(call gb_CppunitTest_use_components,vcl_png_test,\
+configmgr/source/configmgr \
+i18npool/util/i18npool \
+ucb/source/core/ucb1 \
+unotools/util/utl \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,vcl_png_test))
+
+# vim: set noet sw=4 ts=4:
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index 97e20f0..3bc4f64 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -109,6 +109,7 @@ $(eval $(call gb_Module_add_check_targets,vcl,\
CppunitTest_vcl_app_test \
$(if $(MERGELIBS),,CppunitTest_vcl_wmf_test) \
CppunitTest_vcl_jpeg_read_write_test \
+   CppunitTest_vcl_png_test \
 ))
 
 
diff --git a/vcl/qa/cppunit/png/PngFilterTest.cxx 
b/vcl/qa/cppunit/png/PngFilterTest.cxx
new file mode 100644
index 000..14e32a6
--- /dev/null
+++ b/vcl/qa/cppunit/png/PngFilterTest.cxx
@@ -0,0 +1,136 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include 
+#include 
+#include

[Libreoffice-commits] core.git: Branch 'feature/nativealpha' - vcl/TODO.nativealpha

2016-11-06 Thread Tomaž Vajngerl
 vcl/TODO.nativealpha |   15 +++
 1 file changed, 15 insertions(+)

New commits:
commit b0419b48158f29a05905d55501d5bd07a22b209a
Author: Tomaž Vajngerl 
Date:   Sun Nov 6 23:26:04 2016 +0100

TODO for native alpha

Change-Id: Iff57d71c296daef7e41055c1a69686a2d4783d30

diff --git a/vcl/TODO.nativealpha b/vcl/TODO.nativealpha
new file mode 100644
index 000..76aa880
--- /dev/null
+++ b/vcl/TODO.nativealpha
@@ -0,0 +1,15 @@
+KNOWN GLITCHES
+- Writer - Anchor alpha is not correctly loaded
+- Sidebar - left bar leaves traces
+
+TODO:
+- Check printing, PDF output
+- Metafile
+
+- Windows backend
+- OSX backend
+- X11 backend
+- OpenGL backend
+
+TODO TESTS:
+Erase - check the VirtualDevice is erased to transparent color, input color 
after
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: helpcontent2

2016-11-06 Thread Stanislav Horacek
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 11cab8aba359c655a75791ddbc0f2ffeae8ce206
Author: Stanislav Horacek 
Date:   Sun Nov 6 20:33:21 2016 +0100

Updated core
Project: help  63fa2d5d4e0b4136516bd8204109271bf85c91ae

tdf#103244 adjust menu path to Tools - Protect Sheet/Spreadsheet

Change-Id: I5993052af55e681c19b15f8e08f22b36d15e1e65
Reviewed-on: https://gerrit.libreoffice.org/30614
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/helpcontent2 b/helpcontent2
index 1678d90..63fa2d5 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 1678d9035beaf714860804462f03501393291c56
+Subproject commit 63fa2d5d4e0b4136516bd8204109271bf85c91ae
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-11-06 Thread Stanislav Horacek
 source/text/scalc/00/0406.xhp  |8 ++--
 source/text/scalc/01/05020600.xhp  |2 +-
 source/text/scalc/01/0606.xhp  |5 +++--
 source/text/scalc/01/06060100.xhp  |   15 +++
 source/text/scalc/01/06060200.xhp  |9 -
 source/text/scalc/guide/cell_protect.xhp   |4 ++--
 source/text/scalc/guide/cell_unprotect.xhp |2 +-
 7 files changed, 20 insertions(+), 25 deletions(-)

New commits:
commit 63fa2d5d4e0b4136516bd8204109271bf85c91ae
Author: Stanislav Horacek 
Date:   Sun Nov 6 20:33:21 2016 +0100

tdf#103244 adjust menu path to Tools - Protect Sheet/Spreadsheet

Change-Id: I5993052af55e681c19b15f8e08f22b36d15e1e65
Reviewed-on: https://gerrit.libreoffice.org/30614
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/source/text/scalc/00/0406.xhp 
b/source/text/scalc/00/0406.xhp
index 90ba134..e2c0436 100644
--- a/source/text/scalc/00/0406.xhp
+++ b/source/text/scalc/00/0406.xhp
@@ -68,12 +68,8 @@
 
 Choose Tools - Scenarios
 
-Choose Tools - Protect Document
-
-Choose Tools - Protect Document - 
Sheet
-
-Choose Tools - Protect Document - 
Document
-
+Choose Tools - Protect 
Sheet
+Choose Tools - Protect 
Spreadsheet
 Choose Tools - Cell Contents
 
 
diff --git a/source/text/scalc/01/05020600.xhp 
b/source/text/scalc/01/05020600.xhp
index 840938e..cc9617a 100644
--- a/source/text/scalc/01/05020600.xhp
+++ b/source/text/scalc/01/05020600.xhp
@@ -45,7 +45,7 @@
 
 Protected
 Prevents the selected 
cells from being modified.
-This cell protection only takes effect if you also protect the 
sheet (Tools - Protect Document - Sheet).
+This cell 
protection only takes effect if you also protect the sheet (Tools - 
Protect Sheet).
 
 Hide formula
 Hides formulas in 
the selected cells.
diff --git a/source/text/scalc/01/0606.xhp 
b/source/text/scalc/01/0606.xhp
index 9f666f7..dae16b6 100644
--- a/source/text/scalc/01/0606.xhp
+++ b/source/text/scalc/01/0606.xhp
@@ -32,10 +32,11 @@
 
 
 Protect Document
-The Protect Document command prevents changes from 
being made to cells in the sheets or to sheets in a document. As an option, you 
can define a password. If a password is defined, removal of the protection is 
only possible if the user enters the correct password.
+The 
Protect Sheet or Protect Spreadsheet commands prevent 
changes from being made to cells in the sheets or to sheets in a document. As 
an option, you can define a password. If a password is defined, removal of the 
protection is only possible if the user enters the correct password.
 
 
-  
+  
+  
 
 Sheets
 
diff --git a/source/text/scalc/01/06060100.xhp 
b/source/text/scalc/01/06060100.xhp
index 64aab2f..3faac0a 100644
--- a/source/text/scalc/01/06060100.xhp
+++ b/source/text/scalc/01/06060100.xhp
@@ -30,23 +30,22 @@
 
 
 Protecting Sheet
-Protects the 
cells in the current sheet from being modified.
- Choose Tools - Protect Document - Sheet to open the 
Protect Sheet dialog in which you then specify sheet protection 
with or without a password.
+Protects the cells in the current 
sheet from being modified. Choose Tools - Protect 
Sheet to open the Protect Sheet dialog in which you then 
specify sheet protection with or without a password.
 
-  
+  
 
 To protect cells from further editing, the Protected 
check box must be checked on the Format - Cells - Cell 
Protection tab page or on the Format Cells context 
menu.
-Unprotected cells or cell ranges can be set up on a protected sheet 
by using the Tools - Protect Document - Sheet and Format - 
Cells - Cell Protection menus: 
+Unprotected cells or 
cell ranges can be set up on a protected sheet by using the Tools - 
Protect Sheet and Format - Cells - Cell Protection menus: 

 Select the cells that will be unprotected
 Select Format - Cells - Cell Protection. Unmark the 
Protected box and click OK.
-On the Tools - Protect Document - Sheet menu, activate 
protection for the sheet. Effective immediately, only the cell range you 
selected in step 1 can be edited.
-To later change an unprotected area to a protected area, select the 
range. Next, on the Format - Cells - Cell Protection tab page, 
check the Protected box. Finally, choose the Tools - Protect 
Document - Sheet menu. The previously editable range is now 
protected.
+On the Tools - 
Protect Sheet menu, activate protection for the sheet. Effective 
immediately, only the cell range you selected in step 1 can be 
edited.
+To later change an 
unprotected area to a protected area, select the range. Next, on the 
Format - Cells - Cell Protection tab page, check the 
Protected box. Finally, choose the Tools - Protect 
Sheet menu. The previously editable range is now protected.
 Sheet protection also affects the context menu of the sheet tabs at 
the bottom of the screen. The Delete and Rename 
commands cannot be selected.
 If a sheet is protected, you will not be able to modify

[Libreoffice-commits] core.git: icon-themes/breeze icon-themes/breeze_dark icon-themes/breeze_svg

2016-11-06 Thread andreas_k
 icon-themes/breeze/cmd/lc_mergedialog.png  |binary
 icon-themes/breeze/cmd/sc_mergedialog.png  |binary
 icon-themes/breeze/sd/res/objects.png  |binary
 icon-themes/breeze/sd/res/pageobjs.png |binary
 icon-themes/breeze/sd/res/pipette.png  |binary
 icon-themes/breeze_dark/cmd/lc_mergedialog.png |binary
 icon-themes/breeze_dark/cmd/sc_mergedialog.png |binary
 icon-themes/breeze_dark/sd/res/objects.png |binary
 icon-themes/breeze_dark/sd/res/pageobjs.png|binary
 icon-themes/breeze_dark/sd/res/pipette.png |binary
 icon-themes/breeze_dark/svx/res/fr01.png   |binary
 icon-themes/breeze_dark/svx/res/fr010.png  |binary
 icon-themes/breeze_dark/svx/res/fr011.png  |binary
 icon-themes/breeze_dark/svx/res/fr012.png  |binary
 icon-themes/breeze_dark/svx/res/fr02.png   |binary
 icon-themes/breeze_dark/svx/res/fr03.png   |binary
 icon-themes/breeze_dark/svx/res/fr04.png   |binary
 icon-themes/breeze_dark/svx/res/fr05.png   |binary
 icon-themes/breeze_dark/svx/res/fr06.png   |binary
 icon-themes/breeze_dark/svx/res/fr08.png   |binary
 icon-themes/breeze_dark/svx/res/fr09.png   |binary
 icon-themes/breeze_dark/svx/res/pr01.png   |binary
 icon-themes/breeze_dark/svx/res/pr010.png  |binary
 icon-themes/breeze_dark/svx/res/pr011.png  |binary
 icon-themes/breeze_dark/svx/res/pr012.png  |binary
 icon-themes/breeze_dark/svx/res/pr013.png  |binary
 icon-themes/breeze_dark/svx/res/pr014.png  |binary
 icon-themes/breeze_dark/svx/res/pr015.png  |binary
 icon-themes/breeze_dark/svx/res/pr016.png  |binary
 icon-themes/breeze_dark/svx/res/pr017.png  |binary
 icon-themes/breeze_dark/svx/res/pr018.png  |binary
 icon-themes/breeze_dark/svx/res/pr019.png  |binary
 icon-themes/breeze_dark/svx/res/pr02.png   |binary
 icon-themes/breeze_dark/svx/res/pr020.png  |binary
 icon-themes/breeze_dark/svx/res/pr021.png  |binary
 icon-themes/breeze_dark/svx/res/pr03.png   |binary
 icon-themes/breeze_dark/svx/res/pr04.png   |binary
 icon-themes/breeze_dark/svx/res/pr05.png   |binary
 icon-themes/breeze_dark/svx/res/pr06.png   |binary
 icon-themes/breeze_dark/svx/res/pr07.png   |binary
 icon-themes/breeze_dark/svx/res/pr08.png   |binary
 icon-themes/breeze_dark/svx/res/pr09.png   |binary
 icon-themes/breeze_dark/svx/res/sh01.png   |binary
 icon-themes/breeze_dark/svx/res/sh02.png   |binary
 icon-themes/breeze_dark/svx/res/sh03.png   |binary
 icon-themes/breeze_dark/svx/res/sh04.png   |binary
 icon-themes/breeze_dark/svx/res/sh05.png   |binary
 icon-themes/breeze_svg/cmd/lc_mergedialog.svg  |  117 +
 icon-themes/breeze_svg/cmd/sc_mergedialog.svg  |   78 +++
 icon-themes/breeze_svg/sd/res/objects.svg  |  169 +
 icon-themes/breeze_svg/sd/res/pageobjs.svg |  152 ++
 icon-themes/breeze_svg/sd/res/pipette.svg  |   13 +
 icon-themes/breeze_svg/svx/res/fr01.svg|   57 +---
 icon-themes/breeze_svg/svx/res/fr010.svg   |   56 +---
 icon-themes/breeze_svg/svx/res/fr011.svg   |   60 ++--
 icon-themes/breeze_svg/svx/res/fr012.svg   |   60 ++--
 icon-themes/breeze_svg/svx/res/fr02.svg|   50 +--
 icon-themes/breeze_svg/svx/res/fr03.svg|   68 ++
 icon-themes/breeze_svg/svx/res/fr04.svg|   76 +++
 icon-themes/breeze_svg/svx/res/fr05.svg|   67 ++---
 icon-themes/breeze_svg/svx/res/fr06.svg|   68 ++
 icon-themes/breeze_svg/svx/res/fr07.svg|   44 +-
 icon-themes/breeze_svg/svx/res/fr08.svg|   32 +---
 icon-themes/breeze_svg/svx/res/fr09.svg|   76 +--
 icon-themes/breeze_svg/svx/res/pr010.svg   |   10 -
 icon-themes/breeze_svg/svx/res/pr011.svg   |   20 +-
 icon-themes/breeze_svg/svx/res/pr013.svg   |8 -
 icon-themes/breeze_svg/svx/res/pr014.svg   |   49 ++-
 icon-themes/breeze_svg/svx/res/pr015.svg   |   10 -
 icon-themes/breeze_svg/svx/res/pr016.svg   |   20 +-
 icon-themes/breeze_svg/svx/res/pr018.svg   |8 -
 icon-themes/breeze_svg/svx/res/pr019.svg   |   10 -
 icon-themes/breeze_svg/svx/res/pr02.svg|8 -
 icon-themes/breeze_svg/svx/res/pr020.svg   |   12 -
 icon-themes/breeze_svg/svx/res/pr021.svg   |   12 -
 icon-themes/breeze_svg/svx/res/pr03.svg|4 
 icon-themes/breeze_svg/svx/res/pr04.svg|4 
 icon-themes/breeze_svg/svx/res/pr05.svg|2 
 icon-themes/breeze_svg/svx/res/pr06.svg|4 
 icon-themes/breeze_svg/svx/res/pr08.svg|8 -
 icon-themes/breeze_svg/svx/res/pr09.svg|  102 +++
 icon-themes/breeze_svg/svx/res/sh01.svg|   28 +---
 icon-themes/breeze_svg/svx/res/sh02.svg|   41 ++
 icon-themes/breeze_svg/svx/res/sh03.svg|   35 ++---
 icon-themes/breeze_svg/svx/res/sh04.svg|   35 ++---
 icon-th

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

2016-11-06 Thread Khaled Hosny
 sw/source/core/text/porlay.cxx |   64 -
 1 file changed, 50 insertions(+), 14 deletions(-)

New commits:
commit 0b9298bf50eb104b684207e10987144c058421ea
Author: Khaled Hosny 
Date:   Mon Nov 7 00:41:44 2016 +0200

Extend joining groups with new Unicode additions

Change-Id: I14d65d59794fdf9ed4dce05a8f734d9400f85927

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 62b8024f..61e9226 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -62,25 +62,59 @@ using namespace i18n::ScriptType;
 #define IS_JOINING_GROUP(c, g) ( u_getIntPropertyValue( (c), 
UCHAR_JOINING_GROUP ) == U_JG_##g )
 #define isAinChar(c)IS_JOINING_GROUP((c), AIN)
 #define isAlefChar(c)   IS_JOINING_GROUP((c), ALEF)
-#define isBehChar(c)IS_JOINING_GROUP((c), BEH)
 #define isDalChar(c)IS_JOINING_GROUP((c), DAL)
-#define isFehChar(c)IS_JOINING_GROUP((c), FEH)
+#define isFehChar(c)   (IS_JOINING_GROUP((c), FEH) || 
IS_JOINING_GROUP((c), AFRICAN_FEH))
 #define isGafChar(c)IS_JOINING_GROUP((c), GAF)
 #define isHehChar(c)IS_JOINING_GROUP((c), HEH)
 #define isKafChar(c)IS_JOINING_GROUP((c), KAF)
 #define isLamChar(c)IS_JOINING_GROUP((c), LAM)
-#define isQafChar(c)IS_JOINING_GROUP((c), QAF)
+#define isQafChar(c)   (IS_JOINING_GROUP((c), QAF) || 
IS_JOINING_GROUP((c), AFRICAN_QAF))
 #define isRehChar(c)IS_JOINING_GROUP((c), REH)
 #define isTahChar(c)IS_JOINING_GROUP((c), TAH)
 #define isTehMarbutaChar(c) IS_JOINING_GROUP((c), TEH_MARBUTA)
 #define isWawChar(c)IS_JOINING_GROUP((c), WAW)
-#if (U_ICU_VERSION_MAJOR_NUM > 4) || (U_ICU_VERSION_MAJOR_NUM == 4 && 
U_ICU_VERSION_MINOR_NUM >= 4)
-#define isYehChar(c)(IS_JOINING_GROUP((c), YEH) || 
IS_JOINING_GROUP((c), FARSI_YEH))
-#else
-#define isYehChar(c)IS_JOINING_GROUP((c), YEH)
-#endif
 #define isSeenOrSadChar(c)  (IS_JOINING_GROUP((c), SAD) || 
IS_JOINING_GROUP((c), SEEN))
 
+// Beh and charters that behave like Beh in medial form.
+bool isBehChar(sal_Unicode cCh)
+{
+bool bRet = false;
+switch (u_getIntPropertyValue(cCh, UCHAR_JOINING_GROUP))
+{
+case U_JG_BEH:
+case U_JG_NOON:
+case U_JG_AFRICAN_NOON:
+case U_JG_NYA:
+case U_JG_YEH:
+case U_JG_FARSI_YEH:
+case U_JG_BURUSHASKI_YEH_BARREE:
+bRet = true;
+default:
+bRet = false;
+}
+
+return bRet;
+}
+
+// Yeh and charters that behave like Yeh in final form.
+bool isYehChar(sal_Unicode cCh)
+{
+bool bRet = false;
+switch (u_getIntPropertyValue(cCh, UCHAR_JOINING_GROUP))
+{
+case U_JG_YEH:
+case U_JG_FARSI_YEH:
+case U_JG_YEH_BARREE:
+case U_JG_BURUSHASKI_YEH_BARREE:
+case U_JG_YEH_WITH_TAIL:
+bRet = true;
+default:
+bRet = false;
+}
+
+return bRet;
+}
+
 bool isTransparentChar ( sal_Unicode cCh )
 {
 return u_getIntPropertyValue( cCh, UCHAR_JOINING_TYPE ) == 
U_JT_TRANSPARENT;
@@ -1012,12 +1046,12 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& 
rNode, bool bRTL )
 }
 
 // 5. Priority:
-// before medial Beh
+// before medial Beh-like
 if ( nPriorityLevel >= 4 && nIdx > 0 && nIdx < nWordLen - 
1 )
 {
-if ( isBehChar ( cCh )) // Beh
+if ( isBehChar ( cCh ) )
 {
-// check if next character is Reh, Yeh or Alef 
Maksura
+// check if next character is Reh or Yeh-like
 sal_Unicode cNextCh = rWord[ nIdx + 1 ];
 if ( isRehChar ( cNextCh ) || isYehChar ( cNextCh 
))
{
commit 979029ee6532791e39adea3b7078ab88386f0ecf
Author: Khaled Hosny 
Date:   Sun Nov 6 23:07:31 2016 +0200

Insert Kashida before final Tah

Looks like it was missing from the original code, though described here:
https://www.microsoft.com/middleeast/msdn/JustifyingText-CSS.aspx

Change-Id: Iab283cd8e9cc5aee37836ddb06d5e9b8ce8c18e4

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index ff2f4b8..62b8024f 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -71,6 +71,7 @@ using namespace i18n::ScriptType;
 #define isLamChar(c)IS_JOINING_GROUP((c), LAM)
 #define isQafChar(c)IS_JOINING_GROUP((c), QAF)
 #define isRehChar(c)IS_JOINING_GROUP((c), REH)
+#define isTahChar(c)IS_JOINING_GROUP((c), TAH)
 #define isTehMarbutaChar(c) IS_JOINING_GROUP((c), TEH_MARBUTA)
 #define isWawChar(c)IS_JOINING_GROUP((c), WAW)
 #if (U_ICU_VERSION_MAJOR_NUM > 4) || (U_ICU_VERSION_MAJOR_NUM == 4 && 
U_ICU_VERSION_MINOR_NUM >= 4)
@@ -990,12 +991,13 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& 
r

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

2016-11-06 Thread Maxim Monastirsky
 sw/source/uibase/fldui/fldwrap.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cef72944370015af03b92055d8f86cbf646a52f5
Author: Maxim Monastirsky 
Date:   Mon Nov 7 01:45:19 2016 +0200

Make the insert fields dialog not crash

Change-Id: I6cd802f4ab07a647dcc3e8af49e578b041517006

diff --git a/sw/source/uibase/fldui/fldwrap.cxx 
b/sw/source/uibase/fldui/fldwrap.cxx
index f2fee6e..153f15a 100644
--- a/sw/source/uibase/fldui/fldwrap.cxx
+++ b/sw/source/uibase/fldui/fldwrap.cxx
@@ -81,7 +81,7 @@ SwFieldDlgWrapper::SwFieldDlgWrapper( vcl::Window* _pParent, 
sal_uInt16 nId,
 {
 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
 assert(pFact && "SwAbstractDialogFactory fail!");
-AbstractSwFieldDlg* pDlg = pFact->CreateSwFieldDlg(pB, this, _pParent);
+VclPtr pDlg = pFact->CreateSwFieldDlg(pB, this, 
_pParent);
 assert(pDlg && "Dialog creation failed!");
 pDlgInterface = pDlg;
 SetWindow( pDlg->GetWindow() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: help3xsl/online_transform.xsl

2016-11-06 Thread Olivier Hallot
 help3xsl/online_transform.xsl |   31 ---
 1 file changed, 28 insertions(+), 3 deletions(-)

New commits:
commit bf3db717e483f7d0f5b3fa8529d830dfd135d711
Author: Olivier Hallot 
Date:   Sun Nov 6 23:51:24 2016 -0200

Correction to width and height pixel calculation

Change-Id: I6b4eb642e7e45785a7377fc79c6f7c90f8aea9ec
Reviewed-on: https://gerrit.libreoffice.org/30617
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index 3d8de82..1d78223 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -851,9 +851,34 @@
   
   Image: 

-   
-
-   
+  
+  
+
+  
+  
+
+  
+  
+
+
+
+
+
+
+
+ 
+
+
+ 
+
+
+ 
+
+
+ measure_conversion.xsl: Find no conversion 
for  to 'px'!
+ 
+
+   
 
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: helpcontent2

2016-11-06 Thread Olivier Hallot
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 63bd9cf4ad268d83677baf99ec509ef67b5de08a
Author: Olivier Hallot 
Date:   Sun Nov 6 23:51:24 2016 -0200

Updated core
Project: help  bf3db717e483f7d0f5b3fa8529d830dfd135d711

Correction to width and height pixel calculation

Change-Id: I6b4eb642e7e45785a7377fc79c6f7c90f8aea9ec
Reviewed-on: https://gerrit.libreoffice.org/30617
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index 63fa2d5..bf3db71 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 63fa2d5d4e0b4136516bd8204109271bf85c91ae
+Subproject commit bf3db717e483f7d0f5b3fa8529d830dfd135d711
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: help3xsl/online_transform.xsl

2016-11-06 Thread Olivier Hallot
 help3xsl/online_transform.xsl |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 0383ee3b35b04281e98e6495ec20e5023ed887ce
Author: Olivier Hallot 
Date:   Mon Nov 7 00:33:48 2016 -0200

Another correction to online_transform.xsl

Change-Id: I4c59259fd3034d5c84ecade84d5908fc125e656a
Reviewed-on: https://gerrit.libreoffice.org/30618
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index 1d78223..2d18765 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -858,7 +858,8 @@
   
 
   
-  
+  
+  
 
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: helpcontent2

2016-11-06 Thread Olivier Hallot
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bc6017d66fcf37db1f632a3ce667f4c3bf9d1d02
Author: Olivier Hallot 
Date:   Mon Nov 7 00:33:48 2016 -0200

Updated core
Project: help  0383ee3b35b04281e98e6495ec20e5023ed887ce

Another correction to online_transform.xsl

Change-Id: I4c59259fd3034d5c84ecade84d5908fc125e656a
Reviewed-on: https://gerrit.libreoffice.org/30618
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index bf3db71..0383ee3 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit bf3db717e483f7d0f5b3fa8529d830dfd135d711
+Subproject commit 0383ee3b35b04281e98e6495ec20e5023ed887ce
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-11-06 Thread Justin Luth
 sw/qa/extras/ooxmlexport/data/tdf41542_imagePadding.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx   |   13 
 sw/qa/extras/ww8export/data/tdf41542_imagePadding.odt   |binary
 sw/qa/extras/ww8export/ww8export.cxx|   33 ---
 sw/source/filter/ww8/docxattributeoutput.cxx|   35 
 sw/source/filter/ww8/docxattributeoutput.hxx|2 
 sw/source/filter/ww8/escher.hxx |2 
 sw/source/filter/ww8/wrtw8esh.cxx   |   45 +++-
 8 files changed, 95 insertions(+), 35 deletions(-)

New commits:
commit 8eff1decd91cbfb10094c25d4cf1d2b434a4da72
Author: Justin Luth 
Date:   Fri Nov 4 21:32:38 2016 +0300

tdf#41542 MSWordExport: accommodate image's borderless padding

Honor the padding value even if the border is not visible.
Previously the padding information was just thrown out, and
the image scaled to fill the entire image size.

The unit test for tdf#77454 needed to be tweaked because surprisingly
it has border padding of 1 - which this patch turns into a negative crop.

Change-Id: I866d26e00f27221239d3291404f70fb57ac0896d
Reviewed-on: https://gerrit.libreoffice.org/30578
Tested-by: Jenkins 
Reviewed-by: Justin Luth 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf41542_imagePadding.odt 
b/sw/qa/extras/ooxmlexport/data/tdf41542_imagePadding.odt
new file mode 100755
index 000..019e19f
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf41542_imagePadding.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 4d73a7f..f93ace6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -771,6 +771,19 @@ DECLARE_OOXMLEXPORT_TEST(testPNGImageCrop, 
"test_PNG_ImageCrop.docx")
 #endif
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf41542_imagePadding, 
"tdf41542_imagePadding.odt")
+{
+// borderlessImage - image WITHOUT BORDERS : simulate padding with -crop
+text::GraphicCrop crop = getProperty(getShape(2), 
"GraphicCrop");
+CPPUNIT_ASSERT( crop.Left != 0 && crop.Right != 0 );
+CPPUNIT_ASSERT( crop.Left == crop.Top && crop.Right == crop.Bottom && 
crop.Left == crop.Right);
+
+// borderedImage - image WITH BORDERS : simulate padding with -crop
+crop = getProperty(getShape(3), "GraphicCrop");
+CPPUNIT_ASSERT( crop.Left != 0 && crop.Right != 0 );
+CPPUNIT_ASSERT( crop.Left == crop.Top && crop.Right == crop.Bottom && 
crop.Left == crop.Right);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testFootnoteParagraphTag, "testFootnote.docx")
 {
 /* In footnotes.xml, the paragraph tag inside  was 
getting written into document.xml.
diff --git a/sw/qa/extras/ww8export/data/tdf41542_imagePadding.odt 
b/sw/qa/extras/ww8export/data/tdf41542_imagePadding.odt
new file mode 100755
index 000..019e19f
Binary files /dev/null and 
b/sw/qa/extras/ww8export/data/tdf41542_imagePadding.odt differ
diff --git a/sw/qa/extras/ww8export/ww8export.cxx 
b/sw/qa/extras/ww8export/ww8export.cxx
index 88a703d..d3d8733 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -831,26 +831,39 @@ DECLARE_WW8EXPORT_TEST(testCharacterBorder, 
"charborder.odt")
 }
 }
 
+DECLARE_WW8EXPORT_TEST(testTdf41542_imagePadding, "tdf41542_imagePadding.odt")
+{
+// borderlessImage - image WITHOUT BORDERS : simulate padding with -crop
+text::GraphicCrop crop = getProperty(getShape(2), 
"GraphicCrop");
+CPPUNIT_ASSERT( crop.Left != 0 && crop.Right != 0 );
+CPPUNIT_ASSERT( crop.Left == crop.Top && crop.Right == crop.Bottom && 
crop.Left == crop.Right );
+
+// borderedImage - image WITH BORDERS : simulate padding with -crop
+crop = getProperty(getShape(3), "GraphicCrop");
+CPPUNIT_ASSERT( crop.Left != 0 && crop.Right != 0 );
+CPPUNIT_ASSERT( crop.Left == crop.Top && crop.Right == crop.Bottom && 
crop.Left == crop.Right );
+}
+
 DECLARE_WW8EXPORT_TEST(testFdo77454, "fdo77454.doc")
 {
 {
-// check negative crops round-trip
+// check negative crops round-trip  (with border/padding of 1)
 text::GraphicCrop const crop =
 getProperty(getShape(1), "GraphicCrop");
-CPPUNIT_ASSERT_EQUAL(sal_Int32( -439), crop.Left);
-CPPUNIT_ASSERT_EQUAL(sal_Int32(-7040), crop.Right);
-CPPUNIT_ASSERT_EQUAL(sal_Int32( -220), crop.Top);
-CPPUNIT_ASSERT_EQUAL(sal_Int32(-7040), crop.Bottom);
+CPPUNIT_ASSERT(abs(sal_Int32( -439) - crop.Left)   <= 2);
+CPPUNIT_ASSERT(abs(sal_Int32(-7040) - crop.Right)  <= 2);
+CPPUNIT_ASSERT(abs(sal_Int32( -220) - crop.Top)<= 2);
+CPPUNIT_ASSERT(abs(sal_Int32(-7040) - crop.Bottom) <= 2);
 }
 
 {
-// check positive crops round-trip
+// check positive crops round-trip (with padding of 1)
 text::GraphicCrop const crop =
 getProperty(getShap

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

2016-11-06 Thread Khaled Hosny
 sw/source/core/text/porlay.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 639735edaffd35dfe99e527789402e030d95ab45
Author: Khaled Hosny 
Date:   Mon Nov 7 06:53:38 2016 +0200

Fix thinkos in my previous commit

Change-Id: I8f912f5a02933bdfb318dc4f946d4ad7471eb261

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 61e9226..64b6723 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -89,8 +89,10 @@ bool isBehChar(sal_Unicode cCh)
 case U_JG_FARSI_YEH:
 case U_JG_BURUSHASKI_YEH_BARREE:
 bRet = true;
+break;
 default:
 bRet = false;
+break;
 }
 
 return bRet;
@@ -108,8 +110,10 @@ bool isYehChar(sal_Unicode cCh)
 case U_JG_BURUSHASKI_YEH_BARREE:
 case U_JG_YEH_WITH_TAIL:
 bRet = true;
+break;
 default:
 bRet = false;
+break;
 }
 
 return bRet;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2016-11-06 Thread Pranav Kant
 loleaflet/src/map/Map.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 216d1b6a521cbf5de86b8cdc10f9a5da1e7a76a0
Author: Pranav Kant 
Date:   Thu Oct 27 17:12:30 2016 +0530

Undefined variable

Change-Id: I0c5a07fa383523053ca7de319fcc9d1acdca63cd

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 0181cc6..be634aa 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -185,7 +185,7 @@ L.Map = L.Evented.extend({
},
 
WOPIPostMessage: function(msgId, values) {
-   if (this.options.storageType === 'wopi' && 
this._wopiPostMessageOrigin !== '') {
+   if (this.options.storageType === 'wopi' && 
!!this._wopi['PostMessageOrigin']) {
if (window.top !== window.self) {
var msg = {
'MessageId': msgId,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - configure.ac vcl/quartz

2016-11-06 Thread Khaled Hosny
 configure.ac   |   15 ---
 vcl/quartz/ctfonts.cxx |9 +
 2 files changed, 17 insertions(+), 7 deletions(-)

New commits:
commit 8285af5e56cbc9d3871f75454781ce0f5386ec08
Author: Khaled Hosny 
Date:   Mon Nov 7 07:59:49 2016 +0200

Disable VCL_FLOAT_DEVICE_PIXEL on macOS for now

Causes subtle and surprising differences, and it was only needed for the
Core Text-based layout engine, which is not the default now. We want to
use floats for our text layout everywhere at some point, though, so lets
keep the code around.

Change-Id: Iac4d0f58992646b9357a9f32c5eea8ff2729a5c0

diff --git a/configure.ac b/configure.ac
index 0d6329e..66fdc0d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10175,13 +10175,14 @@ dnl 
===
 dnl Set vcl option: coordinate device in double or sal_Int32
 dnl ===
 
-AC_MSG_CHECKING([Type to use for Device Pixel coordinates])
-if test "$_os" = "Darwin" -o  $_os = iOS ; then
-AC_DEFINE(VCL_FLOAT_DEVICE_PIXEL)
-AC_MSG_RESULT([double])
-else
-AC_MSG_RESULT([sal_Int32])
-fi
+dnl disabled for now, we don't want subtle differences between OSs
+dnl AC_MSG_CHECKING([Type to use for Device Pixel coordinates])
+dnl if test "$_os" = "Darwin" -o  $_os = iOS ; then
+dnl AC_DEFINE(VCL_FLOAT_DEVICE_PIXEL)
+dnl AC_MSG_RESULT([double])
+dnl else
+dnl AC_MSG_RESULT([sal_Int32])
+dnl fi
 
 dnl ===
 dnl Test which vclplugs have to be built.
commit bd2ff931428a7007ef639004ea6a65a2fa417cb1
Author: Khaled Hosny 
Date:   Mon Nov 7 07:52:21 2016 +0200

Set Kashida width also on macOS

Otherwise we might not get any Kashida justification at all.

Change-Id: I6521d5a267392314d5d0da84b93fcd80c7b7cc57

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 11905c2..735a30b 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -143,6 +143,15 @@ void CoreTextStyle::GetFontMetric( ImplFontMetricDataRef& 
rxFontMetric ) const
 rxFontMetric->SetScalableFlag( true );
 rxFontMetric->SetTrueTypeFlag( true ); // Not sure, but this field is used 
only for Windows so far
 rxFontMetric->SetKernableFlag( true );
+
+UniChar nKashidaCh = 0x0640;
+CGGlyph nKashidaGid = 0;
+if (CTFontGetGlyphsForCharacters(aCTFontRef, &nKashidaCh, &nKashidaGid, 1))
+{
+double nKashidaAdv = CTFontGetAdvancesForGlyphs(aCTFontRef,
+kCTFontHorizontalOrientation, &nKashidaGid, nullptr, 1);
+rxFontMetric->SetMinKashida(lrint(nKashidaAdv));
+}
 }
 
 bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect 
) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: 2 commits - loolwsd/DocumentBroker.cpp loolwsd/LOOLKit.cpp loolwsd/test

2016-11-06 Thread Ashod Nakashian
 loolwsd/DocumentBroker.cpp  |8 
 loolwsd/LOOLKit.cpp |   31 +++
 loolwsd/test/TileCacheTests.cpp |   14 --
 loolwsd/test/helpers.hpp|   14 ++
 4 files changed, 41 insertions(+), 26 deletions(-)

New commits:
commit f4d72d66e3676249581b7f69e89c01eecd6ce922
Author: Ashod Nakashian 
Date:   Sat Nov 5 17:25:39 2016 -0400

loolwsd: move genRandomData to helpers

Change-Id: I1edafb41fefc07e64fa8625d2b88617079a327fa
Reviewed-on: https://gerrit.libreoffice.org/30622
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/test/TileCacheTests.cpp b/loolwsd/test/TileCacheTests.cpp
index 3618f19..ade2ae0 100644
--- a/loolwsd/test/TileCacheTests.cpp
+++ b/loolwsd/test/TileCacheTests.cpp
@@ -112,20 +112,6 @@ class TileCacheTests : public CPPUNIT_NS::TestFixture
 
 void checkBlackTile(std::stringstream& tile);
 
-static
-std::vector genRandomData(const size_t size)
-{
-std::vector v(size);
-v.resize(size);
-auto data = v.data();
-for (size_t i = 0; i < size; ++i)
-{
-data[i] = static_cast(Util::rng::getNext());
-}
-
-return v;
-}
-
 public:
 TileCacheTests()
 : _uri(helpers::getTestServerURI())
diff --git a/loolwsd/test/helpers.hpp b/loolwsd/test/helpers.hpp
index 1a386ba..ace1f32 100644
--- a/loolwsd/test/helpers.hpp
+++ b/loolwsd/test/helpers.hpp
@@ -55,6 +55,20 @@
 namespace helpers
 {
 inline
+std::vector genRandomData(const size_t size)
+{
+std::vector v(size);
+v.resize(size);
+auto data = v.data();
+for (size_t i = 0; i < size; ++i)
+{
+data[i] = static_cast(Util::rng::getNext());
+}
+
+return v;
+}
+
+inline
 std::vector readDataFromFile(const std::string& filename)
 {
 std::ifstream ifs(Poco::Path(TDOC, filename).toString(), std::ios::binary);
commit 0305cf4819abd6681cc40cbb6f74f8a0c1e9
Author: Ashod Nakashian 
Date:   Sat Nov 5 16:22:07 2016 -0400

loolwsd: more efficient child message forwarding

Change-Id: I60ab308b2f7d108ee9e4f2892fe3dda68f7f3201
Reviewed-on: https://gerrit.libreoffice.org/30621
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 754b836..5d187b8 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -868,7 +868,7 @@ bool DocumentBroker::forwardToClient(const std::string& 
prefix, const std::vecto
 auto data = payload.data() + index;
 auto size = payload.size() - index;
 const auto message = getAbbreviatedMessage(data, size);
-Log::trace("Forwarding payload to " + prefix + ' ' + message);
+LOG_TRC("Forwarding payload to " << prefix << ' ' << message);
 
 std::string name;
 std::string sid;
@@ -884,17 +884,17 @@ bool DocumentBroker::forwardToClient(const std::string& 
prefix, const std::vecto
 }
 else
 {
-Log::warn() << "Client session [" << sid << "] has no peer to 
forward message: " << message << Log::end;
+LOG_WRN("Client session [" << sid << "] has no peer to forward 
message: " << message);
 }
 }
 else
 {
-Log::warn() << "Client session [" << sid << "] not found to 
forward message: " << message << Log::end;
+LOG_WRN("Client session [" << sid << "] not found to forward 
message: " << message);
 }
 }
 else
 {
-Log::error("Failed to parse prefix of forward-to-client message: " + 
message);
+LOG_ERR("Failed to parse prefix of forward-to-client message: " << 
prefix);
 }
 
 return false;
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index acdc2e5..75f2f87 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -1117,9 +1117,22 @@ private:
 
 bool forwardToChild(const std::string& prefix, const std::vector& 
payload)
 {
-std::string message(payload.data() + prefix.size(), payload.size() - 
prefix.size());
-Util::ltrim(message);
-Log::trace("Forwarding payload to " + prefix + ' ' + message);
+assert(payload.size() > prefix.size());
+
+// Remove the prefix and trim.
+size_t index = prefix.size();
+for ( ; index < payload.size(); ++index)
+{
+if (payload[index] != ' ')
+{
+break;
+}
+}
+
+auto data = payload.data() + index;
+auto size = payload.size() - index;
+const auto abbrMessage = getAbbreviatedMessage(data, size);
+LOG_TRC("Forwarding payload to " << prefix << ' ' << abbrMessage);
 
 std::string name;
 std::string sessionId;
@@ -1128,9 +1141,11 @@ private:
 const auto it = _sessions.find(sessionId);
 if (it != _sessions.end())
 {
-if (message == "dis

[Libreoffice-commits] online.git: loolwsd/Log.hpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/Log.hpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fd8b426860ce218d61d978363880090da4ef1708
Author: Ashod Nakashian 
Date:   Sun Nov 6 22:10:32 2016 -0500

loolwsd: use correct log level and not typo

Change-Id: I71a04714c1ad406d454c3312ffa72930293a94c1
Reviewed-on: https://gerrit.libreoffice.org/30620
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/Log.hpp b/loolwsd/Log.hpp
index f52973a..5435644 100644
--- a/loolwsd/Log.hpp
+++ b/loolwsd/Log.hpp
@@ -170,7 +170,7 @@ namespace Log
 }
 }
 
-#define LOG_BODY(LVL, X) std::ostringstream oss_; oss_ << Log::prefix("TRC") 
<< X << "| " << __FILE__ << ':' << __LINE__
+#define LOG_BODY(LVL, X) std::ostringstream oss_; oss_ << Log::prefix(LVL) << 
X << "| " << __FILE__ << ':' << __LINE__
 #define LOG_TRC(X) if (Log::traceEnabled()) { LOG_BODY("TRC", X); 
Log::logger().trace(oss_.str()); }
 #define LOG_DBG(X) if (Log::debugEnabled()) { LOG_BODY("DBG", X); 
Log::logger().debug(oss_.str()); }
 #define LOG_INF(X) if (Log::infoEnabled()) { LOG_BODY("INF", X); 
Log::logger().information(oss_.str()); }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: 2 commits - loolwsd/ChildSession.cpp loolwsd/test

2016-11-06 Thread Ashod Nakashian
 loolwsd/ChildSession.cpp|   40 
 loolwsd/test/helpers.hpp|   13 +
 loolwsd/test/httpwstest.cpp |9 ++---
 3 files changed, 39 insertions(+), 23 deletions(-)

New commits:
commit f63fbef5604f18f536c4d045bebbf281bda1aaa0
Author: Ashod Nakashian 
Date:   Sat Nov 5 17:29:38 2016 -0400

loolwsd: ChildSession logs updated

Change-Id: I5675c5b79fc96ab34605b68b0fe05c5fe90e92db
Reviewed-on: https://gerrit.libreoffice.org/30624
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/ChildSession.cpp b/loolwsd/ChildSession.cpp
index 7cfb7ee..d27c91e 100644
--- a/loolwsd/ChildSession.cpp
+++ b/loolwsd/ChildSession.cpp
@@ -42,12 +42,12 @@ ChildSession::ChildSession(const std::string& id,
 _viewId(-1),
 _isDocLoaded(false)
 {
-Log::info("ChildSession ctor [" + getName() + "].");
+LOG_INF("ChildSession ctor [" << getName() << "].");
 }
 
 ChildSession::~ChildSession()
 {
-Log::info("~ChildSession dtor [" + getName() + "].");
+LOG_INF("~ChildSession dtor [" << getName() << "].");
 
 disconnect();
 }
@@ -64,7 +64,7 @@ void ChildSession::disconnect()
 }
 else
 {
-Log::warn("Skipping unload on incomplete view.");
+LOG_WRN("Skipping unload on incomplete view.");
 }
 
 LOOLSession::disconnect();
@@ -84,7 +84,7 @@ bool ChildSession::_handleInput(const char *buffer, int 
length)
 
 if (tokens.count() > 0 && tokens[0] == "useractive" && _loKitDocument != 
nullptr)
 {
-Log::debug("Handling message after inactivity of " + 
std::to_string(getInactivityMS()) + "ms.");
+LOG_DBG("Handling message after inactivity of " << getInactivityMS() 
<< "ms.");
 setIsActive(true);
 
 // Client is getting active again.
@@ -123,7 +123,7 @@ bool ChildSession::_handleInput(const char *buffer, int 
length)
 loKitCallback(LOK_CALLBACK_STATE_CHANGED, pair.second);
 }
 
-Log::debug("Finished replaying messages.");
+LOG_TRC("Finished replaying messages.");
 }
 
 if (tokens[0] == "dummymsg")
@@ -313,12 +313,12 @@ bool ChildSession::loadDocument(const char * /*buffer*/, 
int /*length*/, StringT
 _loKitDocument = _docManager.onLoad(getId(), _jailedFilePath, _userName, 
_docPassword, renderOpts, _haveDocPassword);
 if (!_loKitDocument || _viewId < 0)
 {
-Log::error("Failed to get LoKitDocument instance.");
+LOG_ERR("Failed to get LoKitDocument instance.");
 return false;
 }
 
-Log::info() << "Created new view with viewid: [" << _viewId << + "] for 
username: [" << _userName
-<< "] in session: [" << getId() << "]." << Log::end;
+LOG_INF("Created new view with viewid: [" << _viewId << + "] for username: 
[" <<
+_userName << "] in session: [" << getId() << "].");
 
 auto lockLokDoc(_loKitDocument->getLock());
 
@@ -331,11 +331,11 @@ bool ChildSession::loadDocument(const char * /*buffer*/, 
int /*length*/, StringT
 }
 
 // Respond by the document status
-Log::debug("Sending status after loading view " + std::to_string(_viewId) 
+ ".");
+LOG_DBG("Sending status after loading view " << _viewId << ".");
 const auto status = LOKitHelper::documentStatus(_loKitDocument->get());
 if (status.empty() || !sendTextFrame("status: " + status))
 {
-Log::error("Failed to get/forward document status [" + status + "].");
+LOG_ERR("Failed to get/forward document status [" << status << "].");
 return false;
 }
 
@@ -349,7 +349,7 @@ bool ChildSession::loadDocument(const char * /*buffer*/, 
int /*length*/, StringT
 // Inform everyone (including this one) about updated view info
 _docManager.notifyViewInfo(viewIds);
 
-Log::info("Loaded session " + getId());
+LOG_INF("Loaded session " << getId());
 return true;
 }
 
@@ -383,7 +383,7 @@ bool ChildSession::sendFontRendering(const char* 
/*buffer*/, int /*length*/, Str
 ptrFont = _loKitDocument->renderFont(decodedFont.c_str(), &width, 
&height);
 }
 
-Log::trace("renderFont [" + font + "] rendered in " + 
std::to_string(timestamp.elapsed()/1000.) + "ms");
+LOG_TRC("renderFont [" << font << "] rendered in " << 
(timestamp.elapsed()/1000.) << "ms");
 
 if (!ptrFont ||
 !png::encodeBufferToPNG(ptrFont, width, height, output, 
LOK_TILEMODE_RGBA))
@@ -409,7 +409,7 @@ bool ChildSession::getStatus(const char* /*buffer*/, int 
/*length*/)
 
 if (status.empty())
 {
-Log::error("Failed to get document status.");
+LOG_ERR("Failed to get document status.");
 return false;
 }
 
@@ -945,17 +945,17 @@ bool ChildSession::setPage(const char* /*buffer*/, int 
/*length*/, StringTokeniz
 void ChildSession::loKitCallback(const int nType, const std::string& rPayload)
 {
 const auto typeName = LOKitHelper::kitCallbackTypeToString(nType);
-Log::tr

[Libreoffice-commits] online.git: 2 commits - loolwsd/LOOLWSD.cpp loolwsd/PrisonerSession.cpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/LOOLWSD.cpp |6 +++---
 loolwsd/PrisonerSession.cpp |   24 ++--
 2 files changed, 17 insertions(+), 13 deletions(-)

New commits:
commit 52b8a11554498190d68c741e1ca66bc9bf5eeff8
Author: Ashod Nakashian 
Date:   Sat Nov 5 18:00:44 2016 -0400

loolwsd: lock -> docBrokersLock

Change-Id: Ia1e1e65003967edf092508211be5f3953239e0f6
Reviewed-on: https://gerrit.libreoffice.org/30627
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index d67a5a0..9b91e1c 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -503,7 +503,7 @@ private:
 
 // This lock could become a bottleneck.
 // In that case, we can use a pool and index by publicPath.
-std::unique_lock lock(DocBrokersMutex);
+std::unique_lock 
docBrokersLock(DocBrokersMutex);
 
 cleanupDocBrokers();
 
@@ -518,7 +518,7 @@ private:
 auto sessionsCount = docBroker->addSession(session);
 LOG_TRC(docKey << ", ws_sessions++: " << sessionsCount);
 
-lock.unlock();
+docBrokersLock.unlock();
 
 std::string encodedFrom;
 URI::encode(docBroker->getPublicUri().getPath(), "", 
encodedFrom);
@@ -557,7 +557,7 @@ private:
 LOG_ERR("Failed to get save-as url: " << ex.what());
 }
 
-lock.lock();
+docBrokersLock.lock();
 sessionsCount = docBroker->removeSession(id);
 if (sessionsCount == 0)
 {
commit 0dec678b16c9fb31f7be1e0795c54d6799a438a6
Author: Ashod Nakashian 
Date:   Sat Nov 5 17:48:36 2016 -0400

loolwsd: PrisonerSession logs updated

Change-Id: I3cae4d77be1c556abef64e0ced05747ef41ddb23
Reviewed-on: https://gerrit.libreoffice.org/30626
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/PrisonerSession.cpp b/loolwsd/PrisonerSession.cpp
index 06bd90e..76e074c 100644
--- a/loolwsd/PrisonerSession.cpp
+++ b/loolwsd/PrisonerSession.cpp
@@ -39,17 +39,17 @@ PrisonerSession::PrisonerSession(const std::string& id,
 _docBroker(std::move(docBroker)),
 _curPart(0)
 {
-Log::info("PrisonerSession ctor [" + getName() + "].");
+LOG_INF("PrisonerSession ctor [" << getName() << "].");
 }
 
 PrisonerSession::~PrisonerSession()
 {
-Log::info("~PrisonerSession dtor [" + getName() + "].");
+LOG_INF("~PrisonerSession dtor [" << getName() << "].");
 }
 
 bool PrisonerSession::_handleInput(const char *buffer, int length)
 {
-Log::trace(getName() + ": handling [" + getAbbreviatedMessage(buffer, 
length)+ "].");
+LOG_TRC(getName() + ": handling [" << getAbbreviatedMessage(buffer, 
length) << "].");
 const std::string firstLine = getFirstLine(buffer, length);
 StringTokenizer tokens(firstLine, " ", StringTokenizer::TOK_IGNORE_EMPTY | 
StringTokenizer::TOK_TRIM);
 
@@ -65,7 +65,7 @@ bool PrisonerSession::_handleInput(const char *buffer, int 
length)
 if (tokens[0] == "unocommandresult:")
 {
 const std::string stringMsg(buffer, length);
-Log::info(getName() + ": Command: " + stringMsg);
+LOG_INF(getName() << ": Command: " << stringMsg);
 const auto index = stringMsg.find_first_of('{');
 if (index != std::string::npos)
 {
@@ -90,6 +90,10 @@ bool PrisonerSession::_handleInput(const char *buffer, int 
length)
 return true;
 }
 }
+else
+{
+LOG_WRN("Expected json unocommandresult. Ignoring: " << stringMsg);
+}
 }
 else if (tokens[0] == "error:")
 {
@@ -105,7 +109,7 @@ bool PrisonerSession::_handleInput(const char *buffer, int 
length)
 errorKind == "wrongpassword")
 {
 forwardToPeer(_peer, buffer, length, isBinary);
-Log::warn("Document load failed: " + errorKind);
+LOG_WRN("Document load failed: " << errorKind);
 return false;
 }
 }
@@ -122,7 +126,7 @@ bool PrisonerSession::_handleInput(const char *buffer, int 
length)
 std::string url;
 if (!getTokenString(tokens[1], "url", url))
 {
-Log::error("Bad syntax for: " + firstLine);
+LOG_ERR("Bad syntax for: " << firstLine);
 return false;
 }
 
@@ -139,7 +143,7 @@ bool PrisonerSession::_handleInput(const char *buffer, int 
length)
 else
 {
 // Blank for failure.
-Log::debug("SaveAs produced no output, producing blank url.");
+LOG_DBG("SaveAs produced no output, producing blank url.");
 url.clear();
 }
 }
@@ -221,7 +225,7 @@ bool Pr

[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/DocumentBroker.cpp |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 8b9372d51728b373512c9c05b8b77481581c4d47
Author: Ashod Nakashian 
Date:   Sat Nov 5 17:48:15 2016 -0400

loolwsd: improved ChildProcess message handling logs

Change-Id: I28a1de58f4c886d7c6f8c9f723a84e2a8726edc2
Reviewed-on: https://gerrit.libreoffice.org/30625
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 5d187b8..97e21b4 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -37,6 +37,10 @@ void ChildProcess::socketProcessor()
 IoUtil::SocketProcessor(_ws,
 [this](const std::vector& payload)
 {
+const auto message = LOOLProtocol::getAbbreviatedMessage(payload);
+LOG_WRN("Recv from child " << this->_pid <<
+": [" << message << "].");
+
 if (UnitWSD::get().filterChildMessage(payload))
 {
 return true;
@@ -48,14 +52,14 @@ void ChildProcess::socketProcessor()
 return docBroker->handleInput(payload);
 }
 
-Log::warn() << "Child " << this->_pid << " has no DocumentBroker 
to handle message: ["
-<< LOOLProtocol::getAbbreviatedMessage(payload) << 
"]." << Log::end;
+LOG_WRN("Child " << this->_pid <<
+" has no DocumentBroker to handle message: [" << message 
<< "].");
 return true;
 },
 []() { },
 [this]() { return TerminationFlag || this->_stop; });
 
-Log::debug() << "Child [" << getPid() << "] WS terminated. Notifying 
DocBroker." << Log::end;
+LOG_DBG("Child [" << getPid() << "] WS terminated. Notifying DocBroker.");
 
 
 // Notify the broker that we're done.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp loolwsd/DocumentBroker.hpp loolwsd/LOOLWSD.cpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/DocumentBroker.cpp |9 +-
 loolwsd/DocumentBroker.hpp |6 +
 loolwsd/LOOLWSD.cpp|  147 ++---
 3 files changed, 81 insertions(+), 81 deletions(-)

New commits:
commit 3993757ee806d7bdde2408852f6227b8f848f1d8
Author: Ashod Nakashian 
Date:   Sat Nov 5 22:15:44 2016 -0400

loolwsd: fix race while creating new documents

This fixes the race rather than trying to patch it.
It still minimizes the locking necessary to a minimum
to maximize parallelism.

The approach is to have at least the DocBrokers lock
or the DocumentBroker lock (if we already have a doc)
while creating new document views.

Change-Id: I96b4f17b3be3d03cd5e6f4d17d39e2165fe008a7
Reviewed-on: https://gerrit.libreoffice.org/30628
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 97e21b4..19dbb97 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -358,9 +358,10 @@ bool DocumentBroker::save(const std::string& sessionId, 
bool success, const std:
 return false;
 }
 
-bool DocumentBroker::autoSave(const bool force, const size_t waitTimeoutMs)
+bool DocumentBroker::autoSave(const bool force, const size_t waitTimeoutMs, 
std::unique_lock& lock)
 {
-std::unique_lock lock(_mutex);
+Util::assertIsLocked(lock);
+
 if (_sessions.empty() || _storage == nullptr || !_isLoaded ||
 !_childProcess->isAlive() || (!_isModified && !force))
 {
@@ -549,7 +550,7 @@ bool 
DocumentBroker::connectPeers(std::shared_ptr& session)
 
 size_t DocumentBroker::removeSession(const std::string& id)
 {
-std::lock_guard lock(_mutex);
+Util::assertIsLocked(_mutex);
 
 auto it = _sessions.find(id);
 if (it != _sessions.end())
@@ -804,7 +805,7 @@ void DocumentBroker::handleTileCombinedResponse(const 
std::vector& payload
 
 bool DocumentBroker::startDestroy(const std::string& id)
 {
-std::unique_lock lock(_mutex);
+Util::assertIsLocked(_mutex);
 
 const auto currentSession = _sessions.find(id);
 assert(currentSession != _sessions.end());
diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index 17de968..e58b642 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -195,7 +195,7 @@ public:
 /// complete before returning, or timeout.
 /// @return true if attempts to save or it also waits
 /// and receives save notification. Otherwise, false.
-bool autoSave(const bool force, const size_t waitTimeoutMs);
+bool autoSave(const bool force, const size_t waitTimeoutMs, 
std::unique_lock& lock);
 
 Poco::URI getPublicUri() const { return _uriPublic; }
 Poco::URI getJailedUri() const { return _uriJailed; }
@@ -206,7 +206,7 @@ public:
 bool isAlive() const { return _childProcess && _childProcess->isAlive(); }
 size_t getSessionsCount() const
 {
-std::lock_guard lock(_mutex);
+Util::assertIsLocked(_mutex);
 return _sessions.size();
 }
 
@@ -273,6 +273,8 @@ public:
 /// Get the PID of the associated child process
 Poco::Process::PID getPid() const { return _childProcess->getPid(); }
 
+std::unique_lock getLock() { return 
std::unique_lock(_mutex); }
+
 private:
 /// Sends the .uno:Save command to LoKit.
 bool sendUnoSave(const bool dontSaveIfUnmodified);
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 9b91e1c..7ec35a1 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -271,6 +271,8 @@ static void forkChildren(const int number)
 /// Returns true if removed at least one.
 static bool cleanupChildren()
 {
+Util::assertIsLocked(NewChildrenMutex);
+
 bool removed = false;
 for (int i = NewChildren.size() - 1; i >= 0; --i)
 {
@@ -558,6 +560,7 @@ private:
 }
 
 docBrokersLock.lock();
+auto docLock = docBroker->getLock();
 sessionsCount = docBroker->removeSession(id);
 if (sessionsCount == 0)
 {
@@ -723,93 +726,92 @@ private:
 cleanupDocBrokers();
 
 // Lookup this document.
-auto it = DocBrokers.find(docKey);
-if (it != DocBrokers.end())
+auto it = DocBrokers.lower_bound(docKey);
+if (it != DocBrokers.end() && it->first == docKey)
 {
 // Get the DocumentBroker from the Cache.
 Log::debug("Found DocumentBroker for docKey [" + docKey + "].");
 docBroker = it->second;
 assert(docBroker);
-}
-else
-{
-// New Document.
-#if MAX_DOCUMENTS > 0
-if (DocBrokers.size() + 1 > MAX_DOCUMENTS)
-{
-Log::error() << "Limit on maximum number of open documents of "
- << MAX_DOCUMENTS << " reached." << Log::end;
-shutdownLimitReached(*ws);
-   

[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp loolwsd/DocumentBroker.hpp loolwsd/LOOLWSD.cpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/DocumentBroker.cpp |   23 +++
 loolwsd/DocumentBroker.hpp |7 +++
 loolwsd/LOOLWSD.cpp|   25 ++---
 3 files changed, 48 insertions(+), 7 deletions(-)

New commits:
commit 800e711321e19b02f5e15f496525d42edcba4376
Author: Ashod Nakashian 
Date:   Sat Nov 5 23:00:16 2016 -0400

loolwsd: proper ChildProcess cleanup

Change-Id: If9be827aa50471b7d1d922402414d028ccdcff8b
Reviewed-on: https://gerrit.libreoffice.org/30629
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 19dbb97..507362c 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -180,6 +180,10 @@ DocumentBroker::~DocumentBroker()
 {
 LOG_WRN("DocumentBroker still has unremoved sessions.");
 }
+
+// Need to first make sure the child exited, socket closed,
+// and thread finished before we are destroyed.
+_childProcess.reset();
 }
 
 bool DocumentBroker::load(const std::string& sessionId, const std::string& 
jailId)
@@ -922,4 +926,23 @@ void DocumentBroker::childSocketTerminated()
 }
 }
 
+void DocumentBroker::terminateChild(std::unique_lock& lock)
+{
+Util::assertIsLocked(_mutex);
+Util::assertIsLocked(lock);
+
+Log::info() << "Terminating child [" << getPid() << "] of doc [" << 
_docKey << "]." << Log::end;
+
+assert(_sessions.empty() && "DocumentBroker still has unremoved 
sessions!");
+
+// First flag to stop as it might be waiting on our lock
+// to process some incoming message.
+_childProcess->stop();
+
+// Release the lock and wait for the thread to finish.
+lock.unlock();
+
+_childProcess->close(false);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index e58b642..0075fb6 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -270,6 +270,13 @@ public:
 /// or upon failing to process an incoming message.
 void childSocketTerminated();
 
+/// This gracefully terminates the connection
+/// with the child and cleans up ChildProcess etc.
+/// We must be called under lock and it must be
+/// passed to us so we unlock before waiting on
+/// the ChildProcess thread, which can take our lock.
+void terminateChild(std::unique_lock& lock);
+
 /// Get the PID of the associated child process
 Poco::Process::PID getPid() const { return _childProcess->getPid(); }
 
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 7ec35a1..ed5810a 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -565,11 +565,9 @@ private:
 if (sessionsCount == 0)
 {
 // At this point we're done.
-// We can't save if we hadn't, just kill.
-Log::debug("Closing child for docKey [" + docKey + 
"].");
-child->close(true);
-Log::debug("Removing DocumentBroker for docKey [" + 
docKey + "].");
+LOG_DBG("Removing DocumentBroker for docKey [" << 
docKey << "].");
 DocBrokers.erase(docKey);
+docBroker->terminateChild(docLock);
 }
 else
 {
@@ -928,9 +926,22 @@ private:
 
 if (sessionsCount == 0)
 {
-std::unique_lock DocBrokersLock(DocBrokersMutex);
-Log::debug("Removing DocumentBroker for docKey [" + docKey + 
"].");
-DocBrokers.erase(docKey);
+// We've supposedly destroyed the last session and can do away 
with
+// DocBroker. But first we need to take both locks in the 
correct
+// order and check again. We can't take the DocBrokersMutex 
while
+// holding the docBroker lock as that can deadlock with 
autoSave below.
+std::unique_lock docBrokersLock2(DocBrokersMutex);
+it = DocBrokers.find(docKey);
+if (it != DocBrokers.end() && it->second)
+{
+auto lock = it->second->getLock();
+if (it->second->getSessionsCount() == 0)
+{
+Log::info("Removing DocumentBroker for docKey [" + 
docKey + "].");
+DocBrokers.erase(docKey);
+docBroker->terminateChild(lock);
+}
+}
 }
 
 LOOLWSD::dumpEventTrace(docBroker->getJailId(), id, "EndSession: " 
+ uri);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/Util.cpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/Util.cpp |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit f3d5b73c4e4e3879b036e8202a3486cb9658ef51
Author: Ashod Nakashian 
Date:   Sun Nov 6 10:50:43 2016 -0500

loolwsd: sleep more with LOOL_DEBUG after dumping stacktrace

Change-Id: I52d764634af3faa0b08d7c4ff7483e0dcc1db312
Reviewed-on: https://gerrit.libreoffice.org/30630
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/Util.cpp b/loolwsd/Util.cpp
index ffcbf03..1b9a63c 100644
--- a/loolwsd/Util.cpp
+++ b/loolwsd/Util.cpp
@@ -404,6 +404,7 @@ namespace Util
 if (std::getenv("LOOL_DEBUG"))
 {
 Log::signalLog(FatalGdbString);
+LOG_ERR("Sleeping 30s to allow debugging.");
 sleep(30);
 }
 
@@ -444,6 +445,12 @@ namespace Util
 }
 }
 
+if (std::getenv("LOOL_DEBUG"))
+{
+LOG_ERR("Sleeping 30s to allow debugging.");
+sleep(30);
+}
+
 // let default handler process the signal
 kill(Poco::Process::id(), signal);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp loolwsd/DocumentBroker.hpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/DocumentBroker.cpp |  127 +
 loolwsd/DocumentBroker.hpp |   16 ++---
 2 files changed, 58 insertions(+), 85 deletions(-)

New commits:
commit 9bb6d73fdad7b16382a4cf03d6c826e1810cff19
Author: Ashod Nakashian 
Date:   Sun Nov 6 11:59:59 2016 -0500

loolwsd: DocumentBroker logs updated

Change-Id: I64bd10c05a24f1b6716241cf1048af157282fa18
Reviewed-on: https://gerrit.libreoffice.org/30632
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 507362c..cf66a4a 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -115,29 +115,6 @@ std::string DocumentBroker::getDocKey(const Poco::URI& uri)
 return docKey;
 }
 
-DocumentBroker::DocumentBroker() :
-_uriPublic(),
-_docKey(),
-_childRoot(),
-_cacheRoot(),
-_childProcess(),
-_lastSaveTime(std::chrono::steady_clock::now()),
-_markToDestroy(true),
-_lastEditableSession(true),
-_isLoaded(false),
-_isModified(false),
-_cursorPosX(0),
-_cursorPosY(0),
-_cursorWidth(0),
-_cursorHeight(0),
-_mutex(),
-_saveMutex(),
-_tileVersion(0),
-_debugRenderedTileCount(0)
-{
-Log::info("Empty DocumentBroker (marked to destroy) created.");
-}
-
 DocumentBroker::DocumentBroker(const Poco::URI& uriPublic,
const std::string& docKey,
const std::string& childRoot,
@@ -164,8 +141,7 @@ DocumentBroker::DocumentBroker(const Poco::URI& uriPublic,
 assert(!_docKey.empty());
 assert(!_childRoot.empty());
 
-LOG_INF("DocumentBroker [" << _uriPublic.toString() <<
-"] created. DocKey: [" << _docKey << "]");
+LOG_INF("DocumentBroker [" << _uriPublic.toString() << "] created. DocKey: 
[" << _docKey << "]");
 }
 
 DocumentBroker::~DocumentBroker()
@@ -173,8 +149,7 @@ DocumentBroker::~DocumentBroker()
 Admin::instance().rmDoc(_docKey);
 
 LOG_INF("~DocumentBroker [" << _uriPublic.toString() <<
-"] destroyed with " << _sessions.size() <<
-" sessions left.");
+"] destroyed with " << _sessions.size() << " sessions left.");
 
 if (!_sessions.empty())
 {
@@ -203,12 +178,12 @@ bool DocumentBroker::load(const std::string& sessionId, 
const std::string& jailI
 auto it = _sessions.find(sessionId);
 if (it == _sessions.end())
 {
-Log::error("Session with sessionId [" + sessionId + "] not found while 
loading");
+LOG_ERR("Session with sessionId [" << sessionId << "] not found while 
loading");
 return false;
 }
 
 const Poco::URI& uriPublic = it->second->getPublicUri();
-Log::debug("Loading from URI: " + uriPublic.toString());
+LOG_DBG("Loading from URI: " << uriPublic.toString());
 
 _jailId = jailId;
 
@@ -219,7 +194,7 @@ bool DocumentBroker::load(const std::string& sessionId, 
const std::string& jailI
 const auto jailPath = Poco::Path(JAILED_DOCUMENT_ROOT, jailId);
 std::string jailRoot = getJailRoot();
 
-Log::info("jailPath: " + jailPath.toString() + ", jailRoot: " + jailRoot);
+LOG_INF("jailPath: " << jailPath.toString() << ", jailRoot: " << jailRoot);
 
 if (LOOLWSD::NoCapsForKit)
 jailRoot = jailPath.toString() + "/" + getJailRoot();
@@ -229,7 +204,7 @@ bool DocumentBroker::load(const std::string& sessionId, 
const std::string& jailI
 // TODO: Maybe better to pass docKey to storage here instead of 
uriPublic here because
 // uriPublic would be different for each view of the document (due to
 // different query params like access token etc.)
-Log::debug("Creating new storage instance for URI [" + 
uriPublic.toString() + "].");
+LOG_DBG("Creating new storage instance for URI [" << 
uriPublic.toString() << "].");
 _storage = StorageBase::create(uriPublic, jailRoot, 
jailPath.toString());
 }
 
@@ -246,7 +221,7 @@ bool DocumentBroker::load(const std::string& sessionId, 
const std::string& jailI
 
 if (!wopifileinfo._userCanWrite)
 {
-Log::debug("Setting the session as readonly");
+LOG_DBG("Setting the session as readonly");
 it->second->setReadOnly();
 }
 
@@ -264,7 +239,7 @@ bool DocumentBroker::load(const std::string& sessionId, 
const std::string& jailI
 username = localfileinfo._username;
 }
 
-Log::debug("Setting username [" + username + "] and userId [" + userid 
+ "] for session [" + sessionId + "]");
+LOG_DBG("Setting username [" << username << "] and userId [" << userid 
<< "] for session [" << sessionId << "]");
 it->second->setUserId(userid);
 it->second->setUserName(username);
 
@@ -272,7 +247,7 @@ bool DocumentBroker::load(const std::string& sessionId, 
const std::string& jailI
 const auto fileInfo = _storage->getFileInfo();
 

[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/LOOLWSD.cpp |  200 
 1 file changed, 93 insertions(+), 107 deletions(-)

New commits:
commit f4c7d67d26186022d6b78dbc68ecd2412b15a877
Author: Ashod Nakashian 
Date:   Sun Nov 6 11:39:19 2016 -0500

loolwsd: LOOLWSD logs updated

Change-Id: I0a139ed4f27be4949c15949a10d461784aa510e0
Reviewed-on: https://gerrit.libreoffice.org/30631
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index ed5810a..30dc2b3 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -346,8 +346,7 @@ static size_t addNewChild(const 
std::shared_ptr& child)
 --OutstandingForks;
 NewChildren.emplace_back(child);
 const auto count = NewChildren.size();
-LOG_INF("Have " << count << " " <<
-(count == 1 ? "child." : "children."));
+LOG_INF("Have " << count << " " << (count == 1 ? "child." : "children."));
 
 NewChildrenCV.notify_one();
 return count;
@@ -681,16 +680,15 @@ private:
 }
 catch (const Exception& exc)
 {
-Log::error() << "Error sending file to client: " << 
exc.displayText()
- << (exc.nested() ? " (" + 
exc.nested()->displayText() + ")" : "")
- << Log::end;
+LOG_ERR("Error sending file to client: " << 
exc.displayText() <<
+(exc.nested() ? " (" + exc.nested()->displayText() 
+ ")" : ""));
 }
 
 Util::removeFile(File(filePath.parent()).path(), true);
 }
 else
 {
-Log::error("Download file [" + filePath.toString() + "] not 
found.");
+LOG_ERR("Download file [" << filePath.toString() << "] not 
found.");
 }
 
 return responded;
@@ -717,7 +715,7 @@ private:
 
 if (TerminationFlag)
 {
-Log::error("Termination flag set. No loading new session [" + id + 
"]");
+LOG_ERR("Termination flag set. No loading new session [" << id << 
"]");
 return;
 }
 
@@ -728,7 +726,7 @@ private:
 if (it != DocBrokers.end() && it->first == docKey)
 {
 // Get the DocumentBroker from the Cache.
-Log::debug("Found DocumentBroker for docKey [" + docKey + "].");
+LOG_DBG("Found DocumentBroker for docKey [" << docKey << "].");
 docBroker = it->second;
 assert(docBroker);
 
@@ -738,7 +736,7 @@ private:
 docBrokersLock.unlock();
 
 // If this document is going out, wait.
-Log::debug("Document [" + docKey + "] is marked to destroy, 
waiting to reload.");
+LOG_DBG("Document [" << docKey << "] is marked to destroy, 
waiting to reload.");
 
 bool timedOut = true;
 for (size_t i = 0; i < COMMAND_TIMEOUT_MS / POLL_TIMEOUT_MS; 
++i)
@@ -767,7 +765,7 @@ private:
 docBrokersLock.unlock();
 if (TerminationFlag)
 {
-Log::error("Termination flag set. Not loading new 
session [" + id + "]");
+LOG_ERR("Termination flag set. Not loading new session 
[" << id << "]");
 return;
 }
 }
@@ -775,7 +773,7 @@ private:
 if (timedOut)
 {
 // Still here, but marked to destroy. Proceed and hope to 
recover.
-Log::error("Timed out while waiting for document to unload 
before loading.");
+LOG_ERR("Timed out while waiting for document to unload 
before loading.");
 }
 
 // Retake the lock and recheck if another thread created the 
DocBroker.
@@ -784,7 +782,7 @@ private:
 if (it != DocBrokers.end() && it->first == docKey)
 {
 // Get the DocumentBroker from the Cache.
-Log::debug("Found DocumentBroker for docKey [" + docKey + 
"].");
+LOG_DBG("Found DocumentBroker for docKey [" << docKey << 
"].");
 docBroker = it->second;
 assert(docBroker);
 }
@@ -795,7 +793,7 @@ private:
 
 if (TerminationFlag)
 {
-Log::error("Termination flag set. No loading new session [" + id + 
"]");
+LOG_ERR("Termination flag set. No loading new session [" << id << 
"]");
 return;
 }
 
@@ -804,7 +802,7 @@ private:
 #if MAX_DOCUMENTS > 0
 if (DocBrokers.size() + 1 > MAX_DOCUMENTS)
 {
-Log::error("Maximum number of open documents reached.");
+LOG_ERR("Maximum number of open documents reached.");
 shutdownLimitReached(*ws);
 retur

[Libreoffice-commits] online.git: 2 commits - loolwsd/test loolwsd/Unit.cpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/Unit.cpp |6 +++---
 loolwsd/test/UnitPrefork.cpp |   17 +
 2 files changed, 12 insertions(+), 11 deletions(-)

New commits:
commit 10659d970befb63df2583d2627beb6c5ab9fb98e
Author: Ashod Nakashian 
Date:   Sun Nov 6 12:10:43 2016 -0500

loolwsd: UnitPrefork logs updated

Change-Id: I7cc37295459aceac6ba38af4fb274c39f55885a4
Reviewed-on: https://gerrit.libreoffice.org/30634
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/test/UnitPrefork.cpp b/loolwsd/test/UnitPrefork.cpp
index 3407e6b..e6837f5 100644
--- a/loolwsd/test/UnitPrefork.cpp
+++ b/loolwsd/test/UnitPrefork.cpp
@@ -69,7 +69,7 @@ public:
 }
 else
 {
-Log::info("Got memory stats [" + memory + "].");
+LOG_INF("Got memory stats [" << memory << "].");
 assert(tokens.count() == 2);
 _childPSS = atoi(tokens[0].c_str());
 _childDirty = atoi(tokens[1].c_str());
@@ -86,20 +86,21 @@ public:
 std::unique_lock lock(_mutex);
 
 _childSockets.push_back(socket);
+LOG_INF("Unit-prefork: got new child, have " << _childSockets.size() 
<< " of " << NumToPrefork);
+
 if (_childSockets.size() >= NumToPrefork)
 {
 Poco::Timestamp::TimeDiff elapsed = _startTime.elapsed();
 
 const auto totalTime = (1000. * 
elapsed)/Poco::Timestamp::resolution();
-Log::info() << "Launched " << _childSockets.size() << " in "
-<< totalTime << Log::end;
+LOG_INF("Launched " << _childSockets.size() << " in " << 
totalTime);
 size_t totalPSSKb = 0;
 size_t totalDirtyKb = 0;
 
 // Skip the last one as it's not completely initialized yet.
 for (size_t i = 0; i < _childSockets.size() - 1; ++i)
 {
-Log::info() << "Getting memory of child #" << i + 1 << " of " 
<< _childSockets.size() << Log::end;
+LOG_INF("Getting memory of child #" << i + 1 << " of " << 
_childSockets.size());
 
 _childSockets[i]->sendFrame("unit-memdump: \n", 
sizeof("unit-memdump: \n"));
 if (_cv.wait_for(lock, std::chrono::milliseconds(5 * 1000)) == 
std::cv_status::timeout)
@@ -181,10 +182,10 @@ namespace
 std::ostringstream oss;
 oss << numPSSKb << " " << numDirtyKb;
 const auto res = oss.str();
-Log::info("readMemorySize: [" + res + "].");
+LOG_INF("readMemorySize: [" << res << "].");
 if (res.empty())
 {
-Log::error("Failed to read memory stats.");
+LOG_ERR("Failed to read memory stats.");
 throw std::runtime_error("Failed to read memory stats.");
 }
 
@@ -239,7 +240,7 @@ public:
 assert(lend_name << " -> " << buffer << 
Log::end;
+LOG_INF("fd:" << ent->d_name << " -> " << buffer);
 if (!strncmp(buffer, "/dev/", sizeof ("/dev/") -1))
 deviceCount++;
 else if (extDot && !strcmp(extDot, ".res"))
@@ -305,7 +306,7 @@ public:
 memory = _failure;
 else
 memory = readMemorySizes(_procSMaps);
-Log::info("filterKitMessage sending back: [" + memory + "].");
+LOG_INF("filterKitMessage sending back: [" << memory << "].");
 ws->sendFrame(memory.c_str(), memory.length());
 return true;
 }
commit ca17fc74c753fd24447545da824ca29757609005
Author: Ashod Nakashian 
Date:   Sun Nov 6 12:06:21 2016 -0500

loolwsd: Unit logs updated

Change-Id: Ic60e59f21bdb426997808d14a4e0375e38362161
Reviewed-on: https://gerrit.libreoffice.org/30633
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/Unit.cpp b/loolwsd/Unit.cpp
index 43c9e9a..f269fc7 100644
--- a/loolwsd/Unit.cpp
+++ b/loolwsd/Unit.cpp
@@ -31,7 +31,7 @@ UnitBase *UnitBase::linkAndCreateUnit(UnitType type, const 
std::string &unitLibP
 void *dlHandle = dlopen(unitLibPath.c_str(), RTLD_GLOBAL|RTLD_NOW);
 if (!dlHandle)
 {
-Log::error("Failed to load " + unitLibPath + ": " + 
std::string(dlerror()));
+LOG_ERR("Failed to load " << unitLibPath << ": " << dlerror());
 return NULL;
 }
 
@@ -49,7 +49,7 @@ UnitBase *UnitBase::linkAndCreateUnit(UnitType type, const 
std::string &unitLibP
 createHooks = reinterpret_cast(dlsym(dlHandle, 
symbol));
 if (!createHooks)
 {
-Log::error("No " + std::string(symbol) + " symbol in " + unitLibPath);
+LOG_ERR("No " << symbol << " symbol in " << unitLibPath);
 return NULL;
 }
 UnitBase *pHooks = createHooks();
@@ -72,7 +72,7 @@ bool UnitBase::init(UnitType type, const std::string 
&unitLibPath)
 TimeoutThread.trySleep(Global->_timeoutMilliSeconds);
 if (!Global->_timeoutShutdown)
 {
-

[Libreoffice-commits] online.git: 2 commits - loolwsd/LOOLKit.cpp loolwsd/test

2016-11-06 Thread Ashod Nakashian
 loolwsd/LOOLKit.cpp  |  200 ---
 loolwsd/test/UnitStorage.cpp |3 
 2 files changed, 99 insertions(+), 104 deletions(-)

New commits:
commit a5f1597e0f0bb421a13252d55379ca6a73e5b0c4
Author: Ashod Nakashian 
Date:   Sun Nov 6 13:35:03 2016 -0500

loolwsd: LOOLKit logs updated

Change-Id: I003d060ac2fd5673d57f7c175837ac3daf335f17
Reviewed-on: https://gerrit.libreoffice.org/30636
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 75f2f87..2fc199d 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -158,7 +158,7 @@ namespace
 }
 if (!shouldCopyDir(relativeOldPath))
 {
-Log::trace("skip redundant paths " + 
std::string(relativeOldPath));
+LOG_TRC("skip redundant paths " << relativeOldPath);
 return FTW_SKIP_SUBTREE;
 }
 File(newPath).createDirectories();
@@ -173,13 +173,13 @@ namespace
 }
 break;
 case FTW_DNR:
-Log::error("Cannot read directory '" + std::string(fpath) + "'");
+LOG_ERR("Cannot read directory '" << fpath << "'");
 return 1;
 case FTW_NS:
-Log::error("nftw: stat failed for '" + std::string(fpath) + "'");
+LOG_ERR("nftw: stat failed for '" << fpath << "'");
 return 1;
 default:
-Log::fatal("nftw: unexpected type: '" + std::to_string(typeflag));
+LOG_FTL("nftw: unexpected type: '" << typeflag);
 assert(false);
 break;
 }
@@ -196,7 +196,7 @@ namespace
 sourceForLinkOrCopy.pop_back();
 destinationForLinkOrCopy = destination;
 if (nftw(source.c_str(), linkOrCopyFunction, 10, FTW_ACTIONRETVAL) == 
-1)
-Log::error("linkOrCopy: nftw() failed for '" + source + "'");
+LOG_ERR("linkOrCopy: nftw() failed for '" << source << "'");
 }
 
 void dropCapability(cap_value_t capability)
@@ -212,7 +212,7 @@ namespace
 }
 
 char *capText = cap_to_text(caps, nullptr);
-Log::trace("Capabilities first: " + std::string(capText));
+LOG_TRC("Capabilities first: " << capText);
 cap_free(capText);
 
 if (cap_set_flag(caps, CAP_EFFECTIVE, 
sizeof(cap_list)/sizeof(cap_list[0]), cap_list, CAP_CLEAR) == -1 ||
@@ -229,7 +229,7 @@ namespace
 }
 
 capText = cap_to_text(caps, nullptr);
-Log::trace("Capabilities now: " + std::string(capText));
+LOG_TRC("Capabilities now: " << capText);
 cap_free(capText);
 
 cap_free(caps);
@@ -246,7 +246,7 @@ namespace
 symlinkTarget += "../";
 symlinkTarget += loSubPath;
 
-Log::debug("symlink(\"" + symlinkTarget + "\",\"" + 
symlinkSource.toString() + "\")");
+LOG_DBG("symlink(\"" << symlinkTarget << "\",\"" << 
symlinkSource.toString() << "\")");
 if (symlink(symlinkTarget.c_str(), symlinkSource.toString().c_str()) 
== -1)
 {
 Log::syserror("symlink(\"" + symlinkTarget + "\",\"" + 
symlinkSource.toString() + "\") failed");
@@ -292,7 +292,7 @@ public:
 _mutex(),
 _isLoading(0)
 {
-Log::info("Document ctor for url [" + _url + "] on child [" + _jailId 
+ "].");
+LOG_INF("Document ctor for url [" << _url << "] on child [" << _jailId 
<< "].");
 assert(_loKit && _loKit->get());
 
 _callbackThread.start(*this);
@@ -301,7 +301,7 @@ public:
 ~Document()
 {
 LOG_INF("~Document dtor for url [" << _url << "] on child [" << 
_jailId <<
-  "]. There are " << _sessions.size() << " views.");
+"]. There are " << _sessions.size() << " views.");
 
 // Wait for the callback worker to finish.
 _stop = true;
@@ -389,7 +389,7 @@ public:
 
 if (numRunning == 0)
 {
-Log::info("No more sessions, exiting bluntly");
+LOG_INF("No more sessions, exiting bluntly");
 std::_Exit(Application::EXIT_OK);
 }
 
@@ -421,9 +421,9 @@ public:
 /// Set Document password for given URL
 void setDocumentPassword(int nPasswordType)
 {
-Log::info() << "setDocumentPassword: passwordProtected=" << 
_isDocPasswordProtected
-<< " passwordProvided=" << _haveDocPassword
-<< " password='" << _docPassword <<  "'" << Log::end;
+LOG_INF("setDocumentPassword: passwordProtected=" << 
_isDocPasswordProtected <<
+" passwordProvided=" << _haveDocPassword <<
+" password='" << _docPassword <<  "'");
 
 if (_isDocPasswordProtected && _haveDocPassword)
 {
@@ -439,12 +439,12 @@ public:
 else if (nPasswordType == LOK_CALLBACK_DOCUMENT_PASSWORD_TO_MODIFY)
 _docPasswordType = Passwo

[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/DocumentBroker.cpp |  131 +++--
 1 file changed, 69 insertions(+), 62 deletions(-)

New commits:
commit 4e13f1b37c94a4e39197ec45d1db30acdae904fa
Author: Ashod Nakashian 
Date:   Sun Nov 6 13:54:00 2016 -0500

loolwsd: cleanup document and storage loading in WSD

Change-Id: I4d6bdda131efb6270fbd5864034ac619cf86ef3d
Reviewed-on: https://gerrit.libreoffice.org/30637
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index cf66a4a..1462d3c 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -163,6 +163,8 @@ DocumentBroker::~DocumentBroker()
 
 bool DocumentBroker::load(const std::string& sessionId, const std::string& 
jailId)
 {
+LOG_INF("Loading [" << _docKey << "] for session [" << sessionId << "] and 
jail [" << jailId << "].");
+
 {
 bool result;
 if (UnitWSD::get().filterLoad(sessionId, jailId, result))
@@ -172,6 +174,7 @@ bool DocumentBroker::load(const std::string& sessionId, 
const std::string& jailI
 if (_markToDestroy)
 {
 // Tearing down.
+LOG_WRN("Will not load document marked to destroy. DocKey: [" << 
_docKey << "].");
 return false;
 }
 
@@ -193,11 +196,12 @@ bool DocumentBroker::load(const std::string& sessionId, 
const std::string& jailI
 // user/doc/jailId
 const auto jailPath = Poco::Path(JAILED_DOCUMENT_ROOT, jailId);
 std::string jailRoot = getJailRoot();
-
-LOG_INF("jailPath: " << jailPath.toString() << ", jailRoot: " << jailRoot);
-
 if (LOOLWSD::NoCapsForKit)
+{
 jailRoot = jailPath.toString() + "/" + getJailRoot();
+}
+
+LOG_INF("jailPath: " << jailPath.toString() << ", jailRoot: " << jailRoot);
 
 if (_storage == nullptr)
 {
@@ -206,80 +210,83 @@ bool DocumentBroker::load(const std::string& sessionId, 
const std::string& jailI
 // different query params like access token etc.)
 LOG_DBG("Creating new storage instance for URI [" << 
uriPublic.toString() << "].");
 _storage = StorageBase::create(uriPublic, jailRoot, 
jailPath.toString());
-}
-
-if (_storage)
-{
-// Call the storage specific file info functions
-std::string userid, username;
-std::chrono::duration getInfoCallDuration;
-if (dynamic_cast(_storage.get()) != nullptr)
+if (_storage == nullptr)
 {
-const WopiStorage::WOPIFileInfo wopifileinfo = 
static_cast(_storage.get())->getWOPIFileInfo(uriPublic);
-userid = wopifileinfo._userid;
-username = wopifileinfo._username;
+// We should get an exception, not null.
+LOG_ERR("Failed to create Storage instance for [" << _docKey << "] 
in " << jailPath.toString());
+return false;
+}
+}
 
-if (!wopifileinfo._userCanWrite)
-{
-LOG_DBG("Setting the session as readonly");
-it->second->setReadOnly();
-}
+assert(_storage != nullptr);
 
-if (!wopifileinfo._postMessageOrigin.empty())
-{
-it->second->sendTextFrame("wopi: postmessageorigin " + 
wopifileinfo._postMessageOrigin);
-}
+// Call the storage specific file info functions
+std::string userid, username;
+std::chrono::duration getInfoCallDuration;
+if (dynamic_cast(_storage.get()) != nullptr)
+{
+const WopiStorage::WOPIFileInfo wopifileinfo = 
static_cast(_storage.get())->getWOPIFileInfo(uriPublic);
+userid = wopifileinfo._userid;
+username = wopifileinfo._username;
 
-getInfoCallDuration = wopifileinfo._callDuration;
-}
-else if (dynamic_cast(_storage.get()) != nullptr)
+if (!wopifileinfo._userCanWrite)
 {
-const LocalStorage::LocalFileInfo localfileinfo = 
static_cast(_storage.get())->getLocalFileInfo(uriPublic);
-userid = localfileinfo._userid;
-username = localfileinfo._username;
+LOG_DBG("Setting the session as readonly");
+it->second->setReadOnly();
 }
 
-LOG_DBG("Setting username [" << username << "] and userId [" << userid 
<< "] for session [" << sessionId << "]");
-it->second->setUserId(userid);
-it->second->setUserName(username);
-
-// Get basic file information from the storage
-const auto fileInfo = _storage->getFileInfo();
-if (!fileInfo.isValid())
+if (!wopifileinfo._postMessageOrigin.empty())
 {
-LOG_ERR("Invalid fileinfo for URI [" << uriPublic.toString() << 
"].");
-return false;
+it->second->sendTextFrame("wopi: postmessageorigin " + 
wopifileinfo._postMessageOrigin);
 }
 
-// Lets load the document now
-const bool loaded = _storage->isLoaded();
-if (!loaded)
-{
- 

[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp loolwsd/DocumentBroker.hpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/DocumentBroker.cpp |   21 ++---
 loolwsd/DocumentBroker.hpp |2 --
 2 files changed, 2 insertions(+), 21 deletions(-)

New commits:
commit 11a0d016cabf13b990f975af8d06b44ca15cd8bf
Author: Ashod Nakashian 
Date:   Sun Nov 6 21:55:37 2016 -0500

loolwsd: inline and simplify connectPeers

Change-Id: I64fbeefa59573eb9e467dc18ecbf75ebd72b3be4
Reviewed-on: https://gerrit.libreoffice.org/30638
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 1462d3c..cbc710c 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -509,29 +509,12 @@ size_t 
DocumentBroker::addSession(std::shared_ptr& session)
 auto prisonerSession = std::make_shared(id, 
shared_from_this());
 
 // Connect the prison session to the client.
-if (!connectPeers(prisonerSession))
-{
-LOG_WRN("Failed to connect " << session->getName() << " to its peer.");
-}
+session->setPeer(prisonerSession);
+prisonerSession->setPeer(session);
 
 return _sessions.size();
 }
 
-bool DocumentBroker::connectPeers(std::shared_ptr& session)
-{
-const auto id = session->getId();
-
-auto it = _sessions.find(id);
-if (it != _sessions.end())
-{
-it->second->setPeer(session);
-session->setPeer(it->second);
-return true;
-}
-
-return false;
-}
-
 size_t DocumentBroker::removeSession(const std::string& id)
 {
 Util::assertIsLocked(_mutex);
diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index 73b1697..fdb7fac 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -221,8 +221,6 @@ public:
 
 /// Add a new session. Returns the new number of sessions.
 size_t addSession(std::shared_ptr& session);
-/// Connect a prison session to its client peer.
-bool connectPeers(std::shared_ptr& session);
 /// Removes a session by ID. Returns the new number of sessions.
 size_t removeSession(const std::string& id);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/DocumentBroker.cpp |   17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 71f2f4921d4edd344d7742ee3b737faf4d3f46e7
Author: Ashod Nakashian 
Date:   Sun Nov 6 22:11:35 2016 -0500

loolwsd: better use named variable than it->second

Change-Id: Ia336b9001911dfd2cf1c19c1536f52bed7684a2a
Reviewed-on: https://gerrit.libreoffice.org/30639
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index cbc710c..1613aec 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -38,7 +38,7 @@ void ChildProcess::socketProcessor()
 [this](const std::vector& payload)
 {
 const auto message = LOOLProtocol::getAbbreviatedMessage(payload);
-LOG_WRN("Recv from child " << this->_pid <<
+LOG_TRC("Recv from child " << this->_pid <<
 ": [" << message << "].");
 
 if (UnitWSD::get().filterChildMessage(payload))
@@ -179,13 +179,14 @@ bool DocumentBroker::load(const std::string& sessionId, 
const std::string& jailI
 }
 
 auto it = _sessions.find(sessionId);
-if (it == _sessions.end())
+if (it == _sessions.end() || !it->second)
 {
 LOG_ERR("Session with sessionId [" << sessionId << "] not found while 
loading");
 return false;
 }
 
-const Poco::URI& uriPublic = it->second->getPublicUri();
+auto session = it->second;
+const Poco::URI& uriPublic = session->getPublicUri();
 LOG_DBG("Loading from URI: " << uriPublic.toString());
 
 _jailId = jailId;
@@ -232,12 +233,12 @@ bool DocumentBroker::load(const std::string& sessionId, 
const std::string& jailI
 if (!wopifileinfo._userCanWrite)
 {
 LOG_DBG("Setting the session as readonly");
-it->second->setReadOnly();
+session->setReadOnly();
 }
 
 if (!wopifileinfo._postMessageOrigin.empty())
 {
-it->second->sendTextFrame("wopi: postmessageorigin " + 
wopifileinfo._postMessageOrigin);
+session->sendTextFrame("wopi: postmessageorigin " + 
wopifileinfo._postMessageOrigin);
 }
 
 getInfoCallDuration = wopifileinfo._callDuration;
@@ -250,8 +251,8 @@ bool DocumentBroker::load(const std::string& sessionId, 
const std::string& jailI
 }
 
 LOG_DBG("Setting username [" << username << "] and userId [" << userid << 
"] for session [" << sessionId << "]");
-it->second->setUserId(userid);
-it->second->setUserName(username);
+session->setUserId(userid);
+session->setUserName(username);
 
 // Get basic file information from the storage
 const auto fileInfo = _storage->getFileInfo();
@@ -283,7 +284,7 @@ bool DocumentBroker::load(const std::string& sessionId, 
const std::string& jailI
 callDuration += getInfoCallDuration;
 const std::string msg = "stats: wopiloadduration " + 
std::to_string(callDuration.count());
 LOG_TRC("Sending to Client [" << msg << "].");
-it->second->sendTextFrame(msg);
+session->sendTextFrame(msg);
 }
 
 return true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/DocumentBroker.cpp |   52 -
 1 file changed, 28 insertions(+), 24 deletions(-)

New commits:
commit f1f1ff7057871e27be98b3fe6a92ad4d8a72608d
Author: Ashod Nakashian 
Date:   Sun Nov 6 22:11:59 2016 -0500

loolwsd: correct document loading and error handling

Change-Id: I7529c8584356f5eea3c91b5d5ffdd6a956710241
Reviewed-on: https://gerrit.libreoffice.org/30640
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 1613aec..f18b049 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -462,33 +462,21 @@ size_t 
DocumentBroker::addSession(std::shared_ptr& session)
 const auto id = session->getId();
 const std::string aMessage = "session " + id + " " + _docKey;
 
-try
-{
-std::lock_guard lock(_mutex);
-
-// Request a new session from the child kit.
-_childProcess->sendTextFrame(aMessage);
+std::lock_guard lock(_mutex);
 
-auto ret = _sessions.emplace(id, session);
-if (!ret.second)
-{
-LOG_WRN("DocumentBroker: Trying to add already existing session.");
-}
+auto ret = _sessions.emplace(id, session);
+if (!ret.second)
+{
+LOG_WRN("DocumentBroker: Trying to add already existing session.");
+}
 
-if (session->isReadOnly())
+try
+{
+// First load the document, since this can fail.
+if (!load(id, std::to_string(_childProcess->getPid(
 {
-LOG_DBG("Adding a readonly session [" << id << "]");
-}
+_sessions.erase(id);
 
-// Below values are recalculated when startDestroy() is called (before 
destroying the
-// document). It is safe to reset their values to their defaults 
whenever a new session is added.
-_lastEditableSession = false;
-_markToDestroy = false;
-
-bool loaded;
-loaded = load(id, std::to_string(_childProcess->getPid()));
-if (!loaded)
-{
 const auto msg = "Failed to load document with URI [" + 
session->getPublicUri().toString() + "].";
 LOG_ERR(msg);
 throw std::runtime_error(msg);
@@ -496,6 +484,9 @@ size_t 
DocumentBroker::addSession(std::shared_ptr& session)
 }
 catch (const StorageSpaceLowException&)
 {
+LOG_ERR("Out of storage while loading document with URI [" << 
session->getPublicUri().toString() << "].");
+_sessions.erase(id);
+
 // We use the same message as is sent when some of lool's own 
locations are full,
 // even if in this case it might be a totally different location (file 
system, or
 // some other type of storage somewhere). This message is not sent to 
all clients,
@@ -504,6 +495,19 @@ size_t 
DocumentBroker::addSession(std::shared_ptr& session)
 throw;
 }
 
+// Below values are recalculated when startDestroy() is called (before 
destroying the
+// document). It is safe to reset their values to their defaults whenever 
a new session is added.
+_lastEditableSession = false;
+_markToDestroy = false;
+
+// Request a new session from the child kit.
+_childProcess->sendTextFrame(aMessage);
+
+if (session->isReadOnly())
+{
+LOG_DBG("Adding a readonly session [" << id << "]");
+}
+
 // Tell the admin console about this new doc
 Admin::instance().addDoc(_docKey, getPid(), getFilename(), id);
 
@@ -538,7 +542,7 @@ size_t DocumentBroker::removeSession(const std::string& id)
 
 void DocumentBroker::alertAllUsersOfDocument(const std::string& cmd, const 
std::string& kind)
 {
-std::lock_guard lock(_mutex);
+Util::assertIsLocked(_mutex);
 
 std::stringstream ss;
 ss << "error: cmd=" << cmd << " kind=" << kind;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-11-06 Thread Takeshi Abe
 sc/source/ui/vba/vbaworksheet.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 12ca2d6d32d750abe0d452387c0b51bcedf54f58
Author: Takeshi Abe 
Date:   Mon Nov 7 14:10:49 2016 +0900

Avoid crash when calling a Worksheet's ShowDataForm()

in VBA, e.g.:
Option VBASupport 1
Sub Main
Worksheets(1).ShowDataForm()
End Sub

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

diff --git a/sc/source/ui/vba/vbaworksheet.cxx 
b/sc/source/ui/vba/vbaworksheet.cxx
index 8ac9cc6..28c9573 100644
--- a/sc/source/ui/vba/vbaworksheet.cxx
+++ b/sc/source/ui/vba/vbaworksheet.cxx
@@ -900,8 +900,8 @@ ScVbaWorksheet::ShowDataForm( ) throw 
(uno::RuntimeException, std::exception)
 ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
 OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
 
-AbstractScDataFormDlg* pDlg = 
pFact->CreateScDataFormDlg(pTabViewShell->GetDialogParent(),
-pTabViewShell);
+ScopedVclPtr 
pDlg(pFact->CreateScDataFormDlg(pTabViewShell->GetDialogParent(),
+
pTabViewShell));
 OSL_ENSURE(pDlg, "Dialog create fail!");
 
 pDlg->Execute();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/DocumentBroker.hpp loolwsd/LOOLKit.cpp loolwsd/protocol.txt

2016-11-06 Thread Ashod Nakashian
 loolwsd/DocumentBroker.hpp |   37 -
 loolwsd/LOOLKit.cpp|5 +
 loolwsd/protocol.txt   |4 
 3 files changed, 37 insertions(+), 9 deletions(-)

New commits:
commit 8cd8ca27a642c3049476a575948f63e34ebb8df8
Author: Ashod Nakashian 
Date:   Sun Nov 6 21:16:11 2016 -0500

loolwsd: new 'exit' command to request child process termination

Change-Id: Id3f9bc67096b422630e04f59ed4ccbca012ddd4a
Reviewed-on: https://gerrit.libreoffice.org/30641
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index fdb7fac..60a7099 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -69,6 +69,18 @@ public:
 {
 LOG_DBG("Stopping ChildProcess [" << _pid << "]");
 _stop = true;
+
+try
+{
+if (_pid != -1 && _ws)
+{
+sendTextFrame("exit");
+}
+}
+catch (const std::exception&)
+{
+LOG_ERR("Failed to send 'exit' command to child [" << _pid << 
"].");
+}
 }
 
 void close(const bool rude)
@@ -84,16 +96,19 @@ public:
 }
 
 _ws.reset();
-if (_pid != -1)
+if (_pid != -1 && kill(_pid, 0) != 0)
 {
-LOG_INF("Closing child [" << _pid << "].");
-if (rude && kill(_pid, SIGINT) != 0 && kill(_pid, 0) != 0)
+if (rude)
 {
-Log::syserror("Cannot terminate lokit [" + 
std::to_string(_pid) + "]. Abandoning.");
+LOG_INF("Killing child [" << _pid << "].");
+if (kill(_pid, SIGINT) != 0 && kill(_pid, 0) != 0)
+{
+Log::syserror("Cannot terminate lokit [" + 
std::to_string(_pid) + "]. Abandoning.");
+}
 }
-
-_pid = -1;
 }
+
+_pid = -1;
 }
 catch (const std::exception& ex)
 {
@@ -108,9 +123,12 @@ public:
 {
 try
 {
-LOG_TRC("DocBroker to Child: " << data);
-_ws->sendFrame(data.data(), data.size());
-return true;
+if (_ws)
+{
+LOG_TRC("DocBroker to Child: " << data);
+_ws->sendFrame(data.data(), data.size());
+return true;
+}
 }
 catch (const std::exception& exc)
 {
@@ -119,6 +137,7 @@ public:
 throw;
 }
 
+LOG_WRN("No socket between DocBroker and child to send [" << data << 
"]");
 return false;
 }
 
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 2fc199d..a89ba53 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -1521,6 +1521,11 @@ void lokit_main(const std::string& childRoot,
 LOG_DBG("CreateSession failed.");
 }
 }
+else if (tokens[0] == "exit")
+{
+LOG_TRC("Setting TerminationFlag due to 'exit' command 
from parent.");
+TerminationFlag = true;
+}
 else if (tokens[0] == "tile" || tokens[0] == "tilecombine" 
|| tokens[0] == "canceltiles" ||
  LOOLProtocol::getFirstToken(tokens[0], '-') == 
"child")
 {
diff --git a/loolwsd/protocol.txt b/loolwsd/protocol.txt
index 560208f..f6035b9 100644
--- a/loolwsd/protocol.txt
+++ b/loolwsd/protocol.txt
@@ -395,6 +395,10 @@ disconnect
 Signals to the child that the client for the respective connection
 has disconnected.
 
+exit
+
+Signals to the child that the process must end and exit.
+
 Admin console
 ===
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-11-06 Thread Noel Grandin
 framework/inc/helper/mischelper.hxx   |4 
 framework/source/fwe/helper/configimporter.cxx|8 
 framework/source/fwe/xml/menudocumenthandler.cxx  |9 -
 framework/source/jobs/jobdata.cxx |3 
 framework/source/jobs/jobexecutor.cxx |   12 -
 framework/source/jobs/shelljob.cxx|   25 --
 framework/source/layoutmanager/layoutmanager.cxx  |3 
 framework/source/loadenv/loadenv.cxx  |   10 -
 framework/source/uiconfiguration/globalsettings.cxx   |   17 --
 framework/source/uiconfiguration/imagemanagerimpl.cxx |4 
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |5 
 framework/source/uiconfiguration/uicategorydescription.cxx|   14 -
 framework/source/uielement/addonstoolbarmanager.cxx   |4 
 framework/source/uielement/recentfilesmenucontroller.cxx  |9 -
 framework/source/uielement/statusbarmanager.cxx   |   20 --
 framework/source/uielement/statusbarmerger.cxx|   39 +---
 framework/source/uielement/toolbarmanager.cxx |   23 --
 framework/source/uielement/toolbarsmenucontroller.cxx |   24 --
 framework/source/uielement/uicommanddescription.cxx   |   52 +-
 sc/inc/attarray.hxx   |1 
 sc/inc/cellsuno.hxx   |3 
 sc/inc/chgtrack.hxx   |   10 -
 sc/inc/column.hxx |1 
 sc/inc/dociter.hxx|1 
 sc/inc/document.hxx   |4 
 sc/inc/dptabsrc.hxx   |4 
 sc/inc/edittextiterator.hxx   |4 
 sc/inc/filtopt.hxx|2 
 sc/source/core/data/attarray.cxx  |   10 -
 sc/source/core/data/column.cxx|   23 --
 sc/source/core/data/column2.cxx   |5 
 sc/source/core/data/dociter.cxx   |7 
 sc/source/core/data/documen2.cxx  |5 
 sc/source/core/data/documen3.cxx  |7 
 sc/source/core/data/documen9.cxx  |   34 +---
 sc/source/core/data/dptabsrc.cxx  |   28 ---
 sc/source/core/data/edittextiterator.cxx  |   17 --
 sc/source/core/data/poolhelp.cxx  |   10 -
 sc/source/core/inc/poolhelp.hxx   |2 
 sc/source/core/tool/chgtrack.cxx  |   23 --
 sc/source/core/tool/filtopt.cxx   |   11 -
 sc/source/filter/excel/excimp8.cxx|   27 ---
 sc/source/filter/excel/xepivot.cxx|7 
 sc/source/filter/excel/xestyle.cxx|   12 -
 sc/source/filter/excel/xichart.cxx|   12 -
 sc/source/filter/excel/xihelper.cxx   |7 
 sc/source/filter/excel/xipivot.cxx|   23 --
 sc/source/filter/excel/xistream.cxx   |9 -
 sc/source/filter/excel/xistring.cxx   |2 
 sc/source/filter/excel/xistyle.cxx|7 
 sc/source/filter/html/htmlimp.cxx |2 
 sc/source/filter/inc/XclImpChangeTrack.hxx|   12 -
 sc/source/filter/inc/excimp8.hxx  |4 
 sc/source/filter/inc/htmlimp.hxx  |1 
 sc/source/filter/inc/sheetdatabuffer.hxx  |4 
 sc/source/filter/inc/viewsettings.hxx |2 
 sc/source/filter/inc/xepivot.hxx  |3 
 sc/source/filter/inc/xestyle.hxx  |   11 -
 sc/source/filter/inc/xichart.hxx  |   10 -
 sc/source/filter/inc/xihelper.hxx |2 
 sc/source/filter/inc/xipivot.hxx  |4 
 sc/source/filter/inc/xistream.hxx |6 
 sc/source/filter/inc/xistring.hxx |2 
 sc/source/filter/inc/xistyle.hxx  |2 
 sc/source/filter/oox/pagesettings.cxx |9 -
 sc/source/filter/oox/sheetdatabuffer.cxx  |  

[Libreoffice-commits] online.git: loolwsd/LibreOfficeKit.hpp loolwsd/LOOLKit.cpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/LOOLKit.cpp|7 ++-
 loolwsd/LibreOfficeKit.hpp |9 -
 2 files changed, 14 insertions(+), 2 deletions(-)

New commits:
commit 86fb4dc03bcefe198688cee00cd375112594dad7
Author: Ashod Nakashian 
Date:   Sun Nov 6 21:16:54 2016 -0500

loolwsd: extend the lifetime of lokit to avoid destroying

Lokit's destroy is prone to throw (at least in dbgutil).

This exception brings the binary down with a core-dump.

To avoid this, we extend the lifetime of lokit to the end
of the process, where we invoke std::_Exit to promptly
kill the process and exit.

For reference, the exception is thrown as follows:
 #0  0x7f0ba5a43bcd in __cxa_throw () from 
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
 #1  0x7f0b76303248 in (anonymous namespace)::ModuleManager::identify 
(this=0x7f0b5328e6d0, xModule=empty uno::Reference) at 
/home/ash/prjx/cp51/framework/source/services/modulemanager.cxx:198
 #2  0x7f0b762606dc in (anonymous namespace)::JobExecutor::notifyEvent 
(this=0x7f0b77176b30, aEvent=...) at 
/home/ash/prjx/cp51/framework/source/jobs/jobexecutor.cxx:274
 #3  0x7f0ba13ea455 in (anonymous 
namespace)::SfxGlobalEvents_Impl::implts_notifyJobExecution 
(this=0x7f0b77176a30, aEvent=...) at 
/home/ash/prjx/cp51/sfx2/source/notify/globalevents.cxx:397
 #4  0x7f0ba13e9346 in (anonymous 
namespace)::SfxGlobalEvents_Impl::documentEventOccured (this=0x7f0b77176a30, 
_Event=...) at /home/ash/prjx/cp51/sfx2/source/notify/globalevents.cxx:241
 #5  0x7f0ba0fe5717 in SfxTerminateListener_Impl::notifyTermination 
(this=0x7f0b772462c8, aEvent=...) at 
/home/ash/prjx/cp51/sfx2/source/appl/appinit.cxx:125
 #6  0x7f0b762ebc39 in framework::Desktop::terminate 
(this=0x7f0b7721d530) at 
/home/ash/prjx/cp51/framework/source/services/desktop.cxx:330
 #7  0x7f0ba47940ce in lo_destroy (pThis=0x154de60) at 
/home/ash/prjx/cp51/desktop/source/lib/init.cxx:2926
 #8  0x00429681 in lok::Office::~Office (this=, 
__in_chrg=) at LibreOfficeKit.hpp:516
 #9  __gnu_cxx::new_allocator::destroy 
(this=, __p=) at 
/usr/include/c++/5/ext/new_allocator.h:124
 #10 std::allocator_traits 
>::_S_destroy (__p=, __a=...) at 
/usr/include/c++/5/bits/alloc_traits.h:285
 #11 std::allocator_traits 
>::destroy (__a=..., __p=) at 
/usr/include/c++/5/bits/alloc_traits.h:414
 #12 std::_Sp_counted_ptr_inplace, 
(__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0xb04f40) at 
/usr/include/c++/5/bits/shared_ptr_base.h:531
 #13 0x0042dfb6 in 
std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0xb04f40) 
at /usr/include/c++/5/bits/shared_ptr_base.h:150
 #14 0x00425797 in 
std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count 
(this=0x7ffce7430468, __in_chrg=) at 
/usr/include/c++/5/bits/shared_ptr_base.h:659
 #15 std::__shared_ptr::~__shared_ptr (this=0x7ffce7430460, 
__in_chrg=) at /usr/include/c++/5/bits/shared_ptr_base.h:925
 #16 std::shared_ptr::~shared_ptr (this=0x7ffce7430460, 
__in_chrg=) at /usr/include/c++/5/bits/shared_ptr.h:93
 #17 lokit_main 
(childRoot="/home/ash/prj/lo/online/loolwsd/test/../jails/", 
sysTemplate="/home/ash/prj/lo/online/loolwsd/test/../systemplate", 
loTemplate="/home/ash/prj/lo/instdir", loSubPath="lo", 
noCapabilities=, queryVersion=queryVersion@entry=true, 
displayVersion=false) at LOOLKit.cpp:1441
 #18 0x0041df41 in createLibreOfficeKit 
(childRoot="/home/ash/prj/lo/online/loolwsd/test/../jails/", 
sysTemplate="/home/ash/prj/lo/online/loolwsd/test/../systemplate", 
loTemplate="/home/ash/prj/lo/instdir", loSubPath="lo", 
queryVersion=queryVersion@entry=true) at LOOLForKit.cpp:228
 #19 0x0041aea4 in main (argc=7, argv=0x7ffce7431ec8) at 
LOOLForKit.cpp:389

194 {
195 throw css::lang::IllegalArgumentException(
196 OUString("Given module is not a frame nor a window, 
controller or model."),
197 static_cast< ::cppu::OWeakObject* >(this),
198 1);
199 }

Change-Id: Idaef5e0a28021a73f4c03ee3bee80968d9c57bd5
Reviewed-on: https://gerrit.libreoffice.org/30642
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index a89ba53..50b6196 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -1333,6 +1333,10 @@ void lokit_main(const std::string& childRoot,
 std::string userdir_url;
 std::string instdir_path;
 
+// lokit's destroy typically throws from
+// framework/source/services/modulemanager.cxx:198
+// So we insure it lives until std::_Exit is called.
+std::shared_ptr loKit;
 Path jailPath;
 bool bRunInsideJail = !noCapabilities;
 try
@@ -1438,7 +1442,6 @@ void lokit_main(const std::string& childRoot,
 instdir_path = "/" + loTemplate + "/program";
 }
 
-   

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

2016-11-06 Thread Noel Grandin
 sc/source/filter/xml/XMLCalculationSettingsContext.cxx |6 
 sc/source/filter/xml/XMLCalculationSettingsContext.hxx |   13 --
 sc/source/filter/xml/XMLCellRangeSourceContext.cxx |2 
 sc/source/filter/xml/XMLCellRangeSourceContext.hxx |   15 --
 sc/source/filter/xml/XMLConsolidationContext.cxx   |2 
 sc/source/filter/xml/XMLConsolidationContext.hxx   |   15 --
 sc/source/filter/xml/XMLDDELinksContext.cxx|   14 +-
 sc/source/filter/xml/XMLDDELinksContext.hxx|   29 +---
 sc/source/filter/xml/XMLDetectiveContext.cxx   |6 
 sc/source/filter/xml/XMLDetectiveContext.hxx   |   16 --
 sc/source/filter/xml/XMLEmptyContext.cxx   |2 
 sc/source/filter/xml/XMLEmptyContext.hxx   |7 -
 sc/source/filter/xml/XMLTableShapesContext.cxx |2 
 sc/source/filter/xml/XMLTableShapesContext.hxx |5 
 sc/source/filter/xml/XMLTableSourceContext.cxx |2 
 sc/source/filter/xml/XMLTableSourceContext.hxx |5 
 sc/source/filter/xml/XMLTrackedChangesContext.cxx  |  110 +
 sc/source/filter/xml/XMLTrackedChangesContext.hxx  |6 
 sc/source/filter/xml/importcontext.cxx |2 
 sc/source/filter/xml/importcontext.hxx |2 
 sc/source/filter/xml/xmlannoi.cxx  |2 
 sc/source/filter/xml/xmlannoi.hxx  |6 
 sc/source/filter/xml/xmlbodyi.cxx  |2 
 sc/source/filter/xml/xmlbodyi.hxx  |5 
 sc/source/filter/xml/xmlcoli.cxx   |4 
 sc/source/filter/xml/xmlcoli.hxx   |   12 -
 sc/source/filter/xml/xmlcondformat.cxx |   18 +-
 sc/source/filter/xml/xmlcondformat.hxx |   40 +-
 sc/source/filter/xml/xmlconti.cxx  |2 
 sc/source/filter/xml/xmlconti.hxx  |6 
 sc/source/filter/xml/xmlcvali.cxx  |   28 +---
 sc/source/filter/xml/xmlcvali.hxx  |6 
 sc/source/filter/xml/xmldpimp.cxx  |   47 +++
 sc/source/filter/xml/xmldpimp.hxx  |  109 +++-
 sc/source/filter/xml/xmldrani.cxx  |   20 +--
 sc/source/filter/xml/xmldrani.hxx  |   51 +--
 sc/source/filter/xml/xmlfilti.cxx  |   28 +---
 sc/source/filter/xml/xmlfilti.hxx  |   47 +--
 sc/source/filter/xml/xmlimprt.cxx  |9 -
 sc/source/filter/xml/xmllabri.cxx  |4 
 sc/source/filter/xml/xmllabri.hxx  |   16 --
 sc/source/filter/xml/xmlnexpi.cxx  |6 
 sc/source/filter/xml/xmlnexpi.hxx  |   16 --
 sc/source/filter/xml/xmlrowi.cxx   |4 
 sc/source/filter/xml/xmlrowi.hxx   |   11 -
 sc/source/filter/xml/xmlsceni.cxx  |2 
 sc/source/filter/xml/xmlsceni.hxx  |6 
 sc/source/filter/xml/xmlsorti.cxx  |4 
 sc/source/filter/xml/xmlsorti.hxx  |   11 -
 sc/source/filter/xml/xmltabi.cxx   |9 -
 sc/source/filter/xml/xmltabi.hxx   |   10 -
 51 files changed, 255 insertions(+), 547 deletions(-)

New commits:
commit 496c0de160dd405c9f089679fc5f590bfe15e49e
Author: Noel Grandin 
Date:   Fri Nov 4 15:07:36 2016 +0200

inherit from ScXMLImportContext

and drop a bunch of redundant code

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

diff --git a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx 
b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
index b99b58e..6aeed40 100644
--- a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
+++ b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
@@ -36,7 +36,7 @@ 
ScXMLCalculationSettingsContext::ScXMLCalculationSettingsContext( ScXMLImport& r
   sal_uInt16 nPrfx,
   const OUString& rLName,
   const css::uno::Reference< 
css::xml::sax::XAttributeList>& xAttrList) :
-SvXMLImportContext( rImport, nPrfx, rLName ),
+ScXMLImportContext( rImport, nPrfx, rLName ),
 fIterationEpsilon(0.001),
 nIterationCount(100),
 nYear2000(1930),
@@ -161,7 +161,7 @@ ScXMLNullDateContext::ScXMLNullDateContext( ScXMLImport& 
rImport,
   const OUString& rLName,
   const css::uno::Reference< 
css::xml::sax::XAttributeList>& xAttrList,
   ScXMLCalculationSettingsContext* 
pCalcSet) :
-SvXMLImportContext( rImport, nPrfx, rLName )
+ScXMLImportCont

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

2016-11-06 Thread Noel Grandin
 include/svx/sdr/animation/scheduler.hxx |   49 +---
 svx/source/sdr/animation/scheduler.cxx  |  182 +++-
 2 files changed, 47 insertions(+), 184 deletions(-)

New commits:
commit c0c69ccd2aac45e4cca0de7d4deaa6d02ec27f4d
Author: Noel Grandin 
Date:   Fri Nov 4 15:08:14 2016 +0200

convert sdr::animation::EventList to o3tl::sorted_vector

instead of home-grown linked list

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

diff --git a/include/svx/sdr/animation/scheduler.hxx 
b/include/svx/sdr/animation/scheduler.hxx
index 1d1c16a..15eaa34 100644
--- a/include/svx/sdr/animation/scheduler.hxx
+++ b/include/svx/sdr/animation/scheduler.hxx
@@ -23,31 +23,24 @@
 #include 
 #include 
 #include 
+#include 
 
 
-// event class
-
 namespace sdr
 {
 namespace animation
 {
+
 class SVX_DLLPUBLIC Event
 {
 // time of event in ms
 sal_uInt32  mnTime;
 
-// pointer for linked list sorted by mnTime
-Event*  mpNext;
-
 public:
 // constructor/destructor
 SAL_DLLPRIVATE explicit Event();
 virtual ~Event();
 
-// access to mpNext
-SAL_DLLPRIVATE Event* GetNext() const {  return mpNext; }
-SAL_DLLPRIVATE void SetNext(Event* pNew);
-
 // get/set time
 SAL_DLLPRIVATE sal_uInt32 GetTime() const {  return mnTime; }
 void SetTime(sal_uInt32 nNew);
@@ -55,43 +48,12 @@ namespace sdr
 // execute event
 virtual void Trigger(sal_uInt32 nTime) = 0;
 };
-} // end of namespace animation
-} // end of namespace sdr
-
 
-// eventlist class
-
-namespace sdr
-{
-namespace animation
-{
-class SVX_DLLPUBLIC EventList
+struct CompareEvent
 {
-// pointer to first entry
-Event*  mpHead;
-
-public:
-// constructor/destructor
-SAL_DLLPRIVATE EventList();
-virtual ~EventList();
-
-// insert/remove time dependent
-SAL_DLLPRIVATE void Insert(Event* pNew);
-SAL_DLLPRIVATE void Remove(Event* pOld);
-
-// get first
-SAL_DLLPRIVATE Event* GetFirst() {  return mpHead; }
+bool operator()(Event* const& lhs, Event* const& rhs) const;
 };
-} // end of namespace animation
-} // end of namespace sdr
-
 
-// scheduler class
-
-namespace sdr
-{
-namespace animation
-{
 class SVX_DLLPUBLIC Scheduler : public Timer
 {
 // time in ms
@@ -101,7 +63,7 @@ namespace sdr
 sal_uInt32  mnDeltaTime;
 
 // list of events
-EventList   maList;
+o3tl::sorted_vector   maList;
 
 // Flag which remembers if this timer is paused. Default
 // is false.
@@ -135,6 +97,7 @@ namespace sdr
 SAL_DLLPRIVATE bool IsPaused() const { return mbIsPaused; }
 SAL_DLLPRIVATE void SetPaused(bool bNew);
 };
+
 } // end of namespace animation
 } // end of namespace sdr
 
diff --git a/svx/source/sdr/animation/scheduler.cxx 
b/svx/source/sdr/animation/scheduler.cxx
index 3841272..ea6bb83 100644
--- a/svx/source/sdr/animation/scheduler.cxx
+++ b/svx/source/sdr/animation/scheduler.cxx
@@ -28,9 +28,7 @@ namespace sdr
 {
 namespace animation
 {
-Event::Event()
-:   mnTime(0),
-mpNext(nullptr)
+Event::Event() : mnTime(0)
 {
 }
 
@@ -39,15 +37,6 @@ namespace sdr
 }
 
 
-void Event::SetNext(Event* pNew)
-{
-if(pNew != mpNext)
-{
-mpNext = pNew;
-}
-}
-
-
 void Event::SetTime(sal_uInt32 nNew)
 {
 if(mnTime != nNew)
@@ -55,93 +44,13 @@ namespace sdr
 mnTime = nNew;
 }
 }
-} // end of namespace animation
-} // end of namespace sdr
-
-
-// eventlist class
 
-namespace sdr
-{
-namespace animation
-{
-EventList::EventList()
-:   mpHead(nullptr)
+bool CompareEvent::operator()(Event* const& lhs, Event* const& rhs) 
const
 {
+return lhs->GetTime() < rhs->GetTime();
 }
 
-EventList::~EventList()
-{
-while(mpHead)
-{
-Event* pNext = mpHead->GetNext();
-mpHead->SetNext(nullptr);
-mpHead = pNext;
-}
-}
-
-void EventList::Insert(Event* pNew)
-{
-if(pNew)
-{
-Event* pCurrent = mpHead;
-Event* 

[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/LOOLWSD.cpp |   44 
 1 file changed, 24 insertions(+), 20 deletions(-)

New commits:
commit a1d846b4311c0a36dda3301dcb1ce423cd0ec23e
Author: Ashod Nakashian 
Date:   Sun Nov 6 21:26:37 2016 -0500

loolwsd: correct wsd initialization and preconditions

For unit-tests at least listening to the public port before
having forked forkit, let alone having a single child process
ready, means we could starve and fail tests randomly.

Here we first correct the order of initialization, such that
the public port listening happens last. Second, we wait until
we have at least one child successfully connected and ready.

Change-Id: I7a31ad1ca4b30746f3cbf9c6b315670207cb7716
Reviewed-on: https://gerrit.libreoffice.org/30643
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 30dc2b3..425b20f 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -294,9 +294,13 @@ static void preForkChildren()
 
 int numPreSpawn = LOOLWSD::NumPreSpawnedChildren;
 UnitWSD::get().preSpawnCount(numPreSpawn);
---numPreSpawn; // ForKit always spawns one child at startup.
 
+--numPreSpawn; // ForKit always spawns one child at startup.
 forkChildren(numPreSpawn);
+
+// Wait until we have at least one child.
+const auto timeout = std::chrono::milliseconds(CHILD_TIMEOUT_MS);
+NewChildrenCV.wait_for(lock, timeout, []() { return !NewChildren.empty(); 
});
 }
 
 /// Proatively spawn children processes
@@ -829,9 +833,8 @@ private:
 // Validate the broker.
 if (!docBroker || !docBroker->isAlive())
 {
-// Cleanup later.
 LOG_ERR("DocBroker is invalid or premature termination of child "
-   "process. Service Unavailable.");
+"process. Service Unavailable.");
 DocBrokers.erase(docKey);
 
 throw 
WebSocketErrorMessageException(SERVICE_UNAVAILABLE_INTERNAL_ERROR);
@@ -1905,21 +1908,9 @@ int LOOLWSD::main(const std::vector& 
/*args*/)
 auto params2 = new HTTPServerParams();
 params2->setMaxThreads(MAX_SESSIONS);
 
-// Start a server listening on the port for clients
-
-std::unique_ptr psvs(
-UnitWSD::isUnitTesting() ?
-findFreeServerPort(ClientPortNumber) :
-getServerSocket(ClientPortNumber, true));
-if (!psvs)
-return Application::EXIT_SOFTWARE;
-
 ThreadPool threadPool(NumPreSpawnedChildren * 6, MAX_SESSIONS * 2);
-HTTPServer srv(new ClientRequestHandlerFactory(), threadPool, *psvs, 
params1);
-LOG_INF("Starting master server listening on " << ClientPortNumber);
-srv.start();
 
-// And one on the port for child processes
+// Start internal server for child processes.
 SocketAddress addr2("127.0.0.1", MasterPortNumber);
 std::unique_ptr psvs2(
 UnitWSD::isUnitTesting() ?
@@ -1927,11 +1918,12 @@ int LOOLWSD::main(const std::vector& 
/*args*/)
 getMasterSocket(MasterPortNumber));
 if (!psvs2)
 return Application::EXIT_SOFTWARE;
+
 HTTPServer srv2(new PrisonerRequestHandlerFactory(), threadPool, *psvs2, 
params2);
 LOG_INF("Starting prisoner server listening on " << MasterPortNumber);
 srv2.start();
 
-// Fire the ForKit process; we are ready.
+// Fire the ForKit process; we are ready to get child connections.
 const Process::PID forKitPid = createForKit();
 if (forKitPid < 0)
 {
@@ -1945,12 +1937,23 @@ int LOOLWSD::main(const std::vector& 
/*args*/)
 // Spawn some children, if necessary.
 preForkChildren();
 
-time_t last30SecCheck = time(NULL);
+// Now we can serve clients; Start listening on the public port.
+std::unique_ptr psvs(
+UnitWSD::isUnitTesting() ?
+findFreeServerPort(ClientPortNumber) :
+getServerSocket(ClientPortNumber, true));
+if (!psvs)
+return Application::EXIT_SOFTWARE;
+
+HTTPServer srv(new ClientRequestHandlerFactory(), threadPool, *psvs, 
params1);
+LOG_INF("Starting master server listening on " << ClientPortNumber);
+srv.start();
 
 #if ENABLE_DEBUG
-time_t startTimeSpan = last30SecCheck;
+time_t startTimeSpan = time(nullptr);
 #endif
 
+time_t last30SecCheck = time(nullptr);
 int status = 0;
 while (!TerminationFlag)
 {
@@ -2036,6 +2039,7 @@ int LOOLWSD::main(const std::vector& 
/*args*/)
 // Make sure we have sufficient reserves.
 prespawnChildren();
 }
+
 #if ENABLE_DEBUG
 if (careerSpanSeconds > 0 && time(nullptr) > startTimeSpan + 
careerSpanSeconds)
 {
@@ -2053,7 +2057,7 @@ int LOOLWSD::main(const std::vector& 
/*args*/)
 threadPool.joinAll();
 
 // Terminate child processes
-LOG_INF("Requesting child process " << forKitPid << " to terminate");
+LOG_INF("Requesting child process " << forKitPid << 

[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/DocumentBroker.cpp |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit f6698918925b3a8a934329fabbdc8bfad003cf87
Author: Ashod Nakashian 
Date:   Sun Nov 6 22:29:19 2016 -0500

loolwsd: name the child socket thread

Change-Id: I079d821522b016cbd70a958b6a3e908a32b61f37
Reviewed-on: https://gerrit.libreoffice.org/30644
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index f18b049..7e250e4 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -34,12 +34,13 @@ using Poco::StringTokenizer;
 
 void ChildProcess::socketProcessor()
 {
+Util::setThreadName("child_ws_" + std::to_string(_pid));
+
 IoUtil::SocketProcessor(_ws,
 [this](const std::vector& payload)
 {
 const auto message = LOOLProtocol::getAbbreviatedMessage(payload);
-LOG_TRC("Recv from child " << this->_pid <<
-": [" << message << "].");
+LOG_TRC("Recv from child [" << message << "].");
 
 if (UnitWSD::get().filterChildMessage(payload))
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/DocumentBroker.cpp |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit f3ffd5986039058a1dda24cb0ce3d8ca3fd331a2
Author: Ashod Nakashian 
Date:   Sun Nov 6 23:01:29 2016 -0500

loolwsd: assert ChildProcess doesn't destroy DocumentBroker

Change-Id: Iff20323f809f27e05652ba08f7688b823fe1
Reviewed-on: https://gerrit.libreoffice.org/30645
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 7e250e4..50208ba 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -50,6 +50,9 @@ void ChildProcess::socketProcessor()
 auto docBroker = this->_docBroker.lock();
 if (docBroker)
 {
+// We should never destroy the broker, since
+// it owns us and will wait on this thread.
+assert(docBroker.use_count() > 1);
 return docBroker->handleInput(payload);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp loolwsd/DocumentBroker.hpp

2016-11-06 Thread Ashod Nakashian
 loolwsd/DocumentBroker.cpp |   47 +
 loolwsd/DocumentBroker.hpp |2 -
 2 files changed, 23 insertions(+), 26 deletions(-)

New commits:
commit 2507f7f89cbdc6787c6fa806b7b7fe7970dc68cd
Author: Ashod Nakashian 
Date:   Sun Nov 6 23:14:23 2016 -0500

loolwsd: refactor DocumentBroker load and addSession

Change-Id: I01db44561f79280f152bdf802efcbc064b22ab89
Reviewed-on: https://gerrit.libreoffice.org/30646
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 50208ba..723b73b 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -165,8 +165,12 @@ DocumentBroker::~DocumentBroker()
 _childProcess.reset();
 }
 
-bool DocumentBroker::load(const std::string& sessionId, const std::string& 
jailId)
+bool DocumentBroker::load(std::shared_ptr& session, const 
std::string& jailId)
 {
+Util::assertIsLocked(_mutex);
+
+const std::string sessionId = session->getId();
+
 LOG_INF("Loading [" << _docKey << "] for session [" << sessionId << "] and 
jail [" << jailId << "].");
 
 {
@@ -182,14 +186,6 @@ bool DocumentBroker::load(const std::string& sessionId, 
const std::string& jailI
 return false;
 }
 
-auto it = _sessions.find(sessionId);
-if (it == _sessions.end() || !it->second)
-{
-LOG_ERR("Session with sessionId [" << sessionId << "] not found while 
loading");
-return false;
-}
-
-auto session = it->second;
 const Poco::URI& uriPublic = session->getPublicUri();
 LOG_DBG("Loading from URI: " << uriPublic.toString());
 
@@ -466,21 +462,13 @@ size_t 
DocumentBroker::addSession(std::shared_ptr& session)
 const auto id = session->getId();
 const std::string aMessage = "session " + id + " " + _docKey;
 
-std::lock_guard lock(_mutex);
-
-auto ret = _sessions.emplace(id, session);
-if (!ret.second)
-{
-LOG_WRN("DocumentBroker: Trying to add already existing session.");
-}
+std::unique_lock lock(_mutex);
 
 try
 {
 // First load the document, since this can fail.
-if (!load(id, std::to_string(_childProcess->getPid(
+if (!load(session, std::to_string(_childProcess->getPid(
 {
-_sessions.erase(id);
-
 const auto msg = "Failed to load document with URI [" + 
session->getPublicUri().toString() + "].";
 LOG_ERR(msg);
 throw std::runtime_error(msg);
@@ -489,7 +477,6 @@ size_t 
DocumentBroker::addSession(std::shared_ptr& session)
 catch (const StorageSpaceLowException&)
 {
 LOG_ERR("Out of storage while loading document with URI [" << 
session->getPublicUri().toString() << "].");
-_sessions.erase(id);
 
 // We use the same message as is sent when some of lool's own 
locations are full,
 // even if in this case it might be a totally different location (file 
system, or
@@ -504,14 +491,23 @@ size_t 
DocumentBroker::addSession(std::shared_ptr& session)
 _lastEditableSession = false;
 _markToDestroy = false;
 
-// Request a new session from the child kit.
-_childProcess->sendTextFrame(aMessage);
-
 if (session->isReadOnly())
 {
 LOG_DBG("Adding a readonly session [" << id << "]");
 }
 
+if (!_sessions.emplace(id, session).second)
+{
+LOG_WRN("DocumentBroker: Trying to add already existing session.");
+}
+
+const auto count = _sessions.size();
+
+lock.unlock();
+
+// Request a new session from the child kit.
+_childProcess->sendTextFrame(aMessage);
+
 // Tell the admin console about this new doc
 Admin::instance().addDoc(_docKey, getPid(), getFilename(), id);
 
@@ -521,7 +517,7 @@ size_t 
DocumentBroker::addSession(std::shared_ptr& session)
 session->setPeer(prisonerSession);
 prisonerSession->setPeer(session);
 
-return _sessions.size();
+return count;
 }
 
 size_t DocumentBroker::removeSession(const std::string& id)
@@ -550,9 +546,10 @@ void DocumentBroker::alertAllUsersOfDocument(const 
std::string& cmd, const std::
 
 std::stringstream ss;
 ss << "error: cmd=" << cmd << " kind=" << kind;
+const auto msg = ss.str();
 for (auto& it : _sessions)
 {
-it.second->sendTextFrame(ss.str());
+it.second->sendTextFrame(msg);
 }
 }
 
diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index 60a7099..34195c9 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -198,7 +198,7 @@ public:
 ~DocumentBroker();
 
 /// Loads a document from the public URI into the jail.
-bool load(const std::string& sessionId, const std::string& jailId);
+bool load(std::shared_ptr& session, const std::string& 
jailId);
 bool isLoaded() const { return _isLoaded; }
 void setLoaded() { _isLoaded = true; }
 
___
Libreoffice-

[Libreoffice-commits] online.git: loolwsd/test

2016-11-06 Thread Ashod Nakashian
 loolwsd/test/run_unit.sh.in |5 +
 1 file changed, 5 insertions(+)

New commits:
commit ea0e5e93447341a7324e344085a5874b027a12c7
Author: Ashod Nakashian 
Date:   Sun Nov 6 23:44:11 2016 -0500

loolwsd: echo the unit-test command-line before running

Change-Id: Ib061732bccd18112c5d3842c01e8d20d441816c0
Reviewed-on: https://gerrit.libreoffice.org/30647
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/loolwsd/test/run_unit.sh.in b/loolwsd/test/run_unit.sh.in
index 652340f..06ee8a9 100755
--- a/loolwsd/test/run_unit.sh.in
+++ b/loolwsd/test/run_unit.sh.in
@@ -3,6 +3,11 @@
 # DO NOT EDIT - this file is generated from run_unit.sh.in.
 #
 
+echo
+echo "Running unit-test:"
+echo $0 $@
+echo
+
 # substituted variables in one place:
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 abs_top_builddir="${DIR}/.."
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-11-06 Thread Miklos Vajna
 basic/source/sbx/sbxbyte.cxx |6 +++---
 basic/source/sbx/sbxchar.cxx |8 
 basic/source/sbx/sbxconv.hxx |   13 -
 basic/source/sbx/sbxint.cxx  |   14 +++---
 basic/source/sbx/sbxlng.cxx  |8 
 5 files changed, 18 insertions(+), 31 deletions(-)

New commits:
commit f996a5a153e1b7ff81d9343eedee244e585ecab9
Author: Miklos Vajna 
Date:   Mon Nov 7 08:03:01 2016 +0100

basic: fix Android build

rtl::math::round() is fine here, I guess.

Change-Id: I4d92bc191182ff531e11d20ef87c69dc99da2b32

diff --git a/basic/source/sbx/sbxbyte.cxx b/basic/source/sbx/sbxbyte.cxx
index 562979b..9d52eeb 100644
--- a/basic/source/sbx/sbxbyte.cxx
+++ b/basic/source/sbx/sbxbyte.cxx
@@ -21,7 +21,7 @@
 #include 
 #include "sbxconv.hxx"
 
-#include 
+#include 
 
 sal_uInt8 ImpGetByte( const SbxValues* p )
 {
@@ -123,7 +123,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 0;
 }
 else
-nRes = (sal_uInt8) std::lround( p->nSingle );
+nRes = (sal_uInt8) rtl::math::round( p->nSingle );
 break;
 case SbxDATE:
 case SbxDOUBLE:
@@ -149,7 +149,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 0;
 }
 else
-nRes = (sal_uInt8) std::lround( dVal );
+nRes = (sal_uInt8) rtl::math::round( dVal );
 break;
 }
 case SbxBYREF | SbxSTRING:
diff --git a/basic/source/sbx/sbxchar.cxx b/basic/source/sbx/sbxchar.cxx
index 81d195c..478a9d5 100644
--- a/basic/source/sbx/sbxchar.cxx
+++ b/basic/source/sbx/sbxchar.cxx
@@ -21,7 +21,7 @@
 #include 
 #include "sbxconv.hxx"
 
-#include 
+#include 
 
 sal_Unicode ImpGetChar( const SbxValues* p )
 {
@@ -111,7 +111,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINCHAR;
 }
 else
-nRes = (sal_Unicode) std::lround( p->nSingle );
+nRes = (sal_Unicode) rtl::math::round( p->nSingle );
 break;
 case SbxDATE:
 case SbxDOUBLE:
@@ -137,7 +137,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINCHAR;
 }
 else
-nRes = (sal_uInt8) std::lround( dVal );
+nRes = (sal_uInt8) rtl::math::round( dVal );
 break;
 }
 case SbxBYREF | SbxSTRING:
@@ -158,7 +158,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 
SbxMINCHAR;
 }
 else
-nRes = (sal_Unicode) std::lround( d );
+nRes = (sal_Unicode) rtl::math::round( d );
 }
 break;
 case SbxOBJECT:
diff --git a/basic/source/sbx/sbxconv.hxx b/basic/source/sbx/sbxconv.hxx
index 34a9ba3..08fa296 100644
--- a/basic/source/sbx/sbxconv.hxx
+++ b/basic/source/sbx/sbxconv.hxx
@@ -21,19 +21,6 @@
 #define INCLUDED_BASIC_SOURCE_SBX_SBXCONV_HXX
 
 #include "sbxdec.hxx"
-#if defined(ANDROID)
-namespace std
-{
-double lround(double d)
-{
-return d + ( d < 0 ? -0.5 : 0.5 );
-}
-double llround(double d)
-{
-return d + ( d < 0 ? -0.5 : 0.5 );
-}
-}
-#endif
 
 class SbxArray;
 
diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx
index b3d4cd3..41886a6 100644
--- a/basic/source/sbx/sbxint.cxx
+++ b/basic/source/sbx/sbxint.cxx
@@ -21,7 +21,7 @@
 #include 
 #include "sbxconv.hxx"
 
-#include 
+#include 
 
 sal_Int16 ImpGetInteger( const SbxValues* p )
 {
@@ -81,7 +81,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMININT;
 }
 else
-nRes = (sal_Int16) std::lround( p->nSingle );
+nRes = (sal_Int16) rtl::math::round( p->nSingle );
 break;
 case SbxCURRENCY:
 {
@@ -142,7 +142,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMININT;
 }
 else
-nRes = (sal_Int16) std::lround( dVal );
+nRes = (sal_Int16) rtl::math::round( dVal );
 break;
 }
 case SbxLPSTR:
@@ -165,7 +165,7 @@ start:
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 
SbxMININT;
 }
 else
-nRes = (sal_Int16) std::lround( d );
+nRes = (sal_Int16) rtl::math::round( d );
 }
 break;
 case SbxOBJECT:
@@ -347,7 +347,7 @@ sal_Int64 ImpDoubleToSalInt64( double d )
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINSALINT64;
 }
 else
-nRes = (sal_Int64) std::llround( d );
+nRes = (sal_Int64) rtl::math::round( d );
 return nRes;
 }
 
@@ -363,7 +363,7 @@ sal_uInt64 ImpDoubleToSalUInt64( double d )
 SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 0;
 }
 else
-nRes

[Libreoffice-commits] online.git: loolwsd/AdminModel.cpp loolwsd/LOOLKit.cpp

2016-11-06 Thread Miklos Vajna
 loolwsd/AdminModel.cpp |2 --
 loolwsd/LOOLKit.cpp|   13 -
 2 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 121a47120386d03b250c3668ffeb93fff94b2388
Author: Miklos Vajna 
Date:   Mon Nov 7 08:27:19 2016 +0100

loolwsd: clean up unused using declarations

Change-Id: Ib7fc0d2dbc10cbccacde327b29fe70f255d58a05

diff --git a/loolwsd/AdminModel.cpp b/loolwsd/AdminModel.cpp
index 24c9384..5142df0 100644
--- a/loolwsd/AdminModel.cpp
+++ b/loolwsd/AdminModel.cpp
@@ -25,8 +25,6 @@
 #include "Unit.hpp"
 #include "Util.hpp"
 
-using Poco::StringTokenizer;
-
 void Document::addView(const std::string& sessionId)
 {
 const auto ret = _views.emplace(sessionId, View(sessionId));
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 50b6196..c97f247 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -74,13 +74,8 @@ using Poco::File;
 using Poco::JSON::Array;
 using Poco::JSON::Object;
 using Poco::JSON::Parser;
-using Poco::Net::HTTPClientSession;
-using Poco::Net::HTTPRequest;
-using Poco::Net::HTTPResponse;
 using Poco::Net::Socket;
 using Poco::Net::WebSocket;
-using Poco::Path;
-using Poco::Process;
 using Poco::Runnable;
 using Poco::StringTokenizer;
 using Poco::Thread;
@@ -88,6 +83,14 @@ using Poco::Timestamp;
 using Poco::URI;
 using Poco::Util::Application;
 
+#ifndef BUILDING_TESTS
+using Poco::Net::HTTPClientSession;
+using Poco::Net::HTTPRequest;
+using Poco::Net::HTTPResponse;
+using Poco::Path;
+using Poco::Process;
+#endif
+
 using namespace LOOLProtocol;
 
 // We only host a single document in our lifetime.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 3 commits - bridges/source

2016-11-06 Thread Stephan Bergmann
 bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.cxx |   57 
+-
 bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.hxx |3 
 bridges/source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx   |3 
 3 files changed, 32 insertions(+), 31 deletions(-)

New commits:
commit 9ec4c4ab052c66e9e25c9893bba33b8dee258484
Author: Stephan Bergmann 
Date:   Fri Nov 4 23:06:45 2016 +0100

Don't rely on __builtin_alloca when creating a call stack

same as 3f7c8ce1dca7eacb511def7799691be2e3d9a4a6 for gcc_linux_x86-64 (see 
there
for a more detailed commit message; plus trivial follow-up
5e04886917abad0541eb3ef6d51cd5dc0395af21 "Remove spurious vertical 
whitespace").
Except use labels 'Lpush', 'Lpushed' not starting with a dot ('.Lpush',
'.Lpushed'), as otherwise at least macOS 10.12.1 linker (ld64-274.1), when
building libgcc3_uno.dylib's __TEXT,__unwind_info section, would use
callvirtualmethod.o's __LD,__compact_unwind entry---covering the complete
callVirtualMethod function---only for the first part of the function up to 
the
.Lpush label, and would mark the remainder as having no unwind information 
(a
compact_unwind_encoding_t value of 0; see the inline comments in the
libunwind-35.3 source code,
).  So if an
exception shall pass through that latter part it would lead to 
std::terminate.

Change-Id: Ib1e8a5e4534b11ebe96c3ce774f8e5e8d45476cf

diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.cxx 
b/bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.cxx
index d4d5160..47f383a 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.cxx
@@ -54,6 +54,8 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
 // than available" error:
 struct Data {
 sal_uInt64 pMethod;
+sal_uInt64 * pStack;
+sal_uInt32 nStack;
 sal_uInt64 * pGPR;
 double * pFPR;
 // Return values:
@@ -62,6 +64,8 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
 double xmm0;
 double xmm1;
 } data;
+data.pStack = pStack;
+data.nStack = nStack;
 data.pGPR = pGPR;
 data.pFPR = pFPR;
 
@@ -70,19 +74,25 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
 pMethod += 8 * nVtableIndex;
 data.pMethod = *reinterpret_cast(pMethod);
 
-// Load parameters to stack, if necessary
-if ( nStack )
-{
-// 16-bytes aligned
-sal_uInt32 nStackBytes = ( ( nStack + 1 ) >> 1 ) * 16;
-sal_uInt64 *pCallStack = static_cast(__builtin_alloca( 
nStackBytes ));
-std::memcpy( pCallStack, pStack, nStackBytes );
-}
-
 asm volatile (
+// Push arguments to stack
+"movq %%rsp, %%r12\n\t"
+"movl 16%0, %%ecx\n\t"
+"jrcxz Lpushed\n\t"
+"xor %%rax, %%rax\n\t"
+"leaq (%%rax, %%rcx, 8), %%rax\n\t"
+"subq %%rax, %%rsp\n\t"
+"andq $-9, %%rsp\n\t" // 16-bytes aligned
+"movq 8%0, %%rsi\n\t"
+"\nLpush:\n\t"
+"decq %%rcx\n\t"
+"movq (%%rsi, %%rcx, 8), %%rax\n\t"
+"movq %%rax, (%%rsp, %%rcx, 8)\n\t"
+"jnz Lpush\n\t"
+"\nLpushed:\n\t"
 
 // Fill the xmm registers
-"movq 16%0, %%rax\n\t"
+"movq 32%0, %%rax\n\t"
 
 "movsd   (%%rax), %%xmm0\n\t"
 "movsd  8(%%rax), %%xmm1\n\t"
@@ -94,7 +104,7 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
 "movsd 56(%%rax), %%xmm7\n\t"
 
 // Fill the general purpose registers
-"movq 8%0, %%rax\n\t"
+"movq 24%0, %%rax\n\t"
 
 "movq(%%rax), %%rdi\n\t"
 "movq   8(%%rax), %%rsi\n\t"
@@ -108,12 +118,15 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
 "call *%%r11\n\t"
 
 // Fill the return values
-"movq   %%rax, 24%0\n\t"
-"movq   %%rdx, 32%0\n\t"
-"movsd %%xmm0, 40%0\n\t"
-"movsd %%xmm1, 48%0\n\t"
+"movq   %%rax, 40%0\n\t"
+"movq   %%rdx, 48%0\n\t"
+"movsd %%xmm0, 56%0\n\t"
+"movsd %%xmm1, 64%0\n\t"
+
+// Reset %rsp
+"movq %%r12, %%rsp\n\t"
 :: "o" (data)
-: "rax", "rdi", "rsi", "rdx", "rcx", "r8", "r9", "r10", "r11",
+: "rax", "rdi", "rsi", "rdx", "rcx", "r8", "r9", "r10", "r11", "r12",
   "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
   "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15",
   "memory"
commit c01e02425e3ce7a14f06cfc505cf375a82a7c980
Author: Stephan Bergmann 
Date:   Wed Nov 2 21:44:30 2016 +0100

Drop unnecessary nFPR parameter

same as 8a85f9f29f13805af449943990af8af8399ab7b5 for gcc_linux_x86-64 (see 
there
for a more detailed commit message)

Change-Id: Ic2765c21834aabf8f7690c0bdab4d6efe6d34585

diff --git a/bridges/source/cpp

[Libreoffice-commits] core.git: jurt/Library_jpipe.mk jurt/source

2016-11-06 Thread Stephan Bergmann
 jurt/Library_jpipe.mk  |6 ++
 jurt/source/pipe/staticsalhack.cxx |   19 +++
 2 files changed, 25 insertions(+)

New commits:
commit 4e3e87e88d2d450c87680b31f12906bc41da79f1
Author: Stephan Bergmann 
Date:   Mon Nov 7 08:57:33 2016 +0100

Adapt jurt staticsalhack to MACOSX

Change-Id: I0525b68cdb097edd3241809ae0dc9c22e1ad9814

diff --git a/jurt/Library_jpipe.mk b/jurt/Library_jpipe.mk
index 3ddac8c..dbe0b89 100644
--- a/jurt/Library_jpipe.mk
+++ b/jurt/Library_jpipe.mk
@@ -72,6 +72,12 @@ $(eval $(call gb_Library_use_externals,jpipe, \
 boost_headers \
 ))
 
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_Library_use_system_darwin_frameworks,jpipe, \
+CoreFoundation \
+))
+endif
+
 $(eval $(call gb_Library_add_libs,jpipe, \
 $(if $(filter-out $(OS),ANDROID),-lpthread) \
 ))
diff --git a/jurt/source/pipe/staticsalhack.cxx 
b/jurt/source/pipe/staticsalhack.cxx
index 23afde1..a527d09 100644
--- a/jurt/source/pipe/staticsalhack.cxx
+++ b/jurt/source/pipe/staticsalhack.cxx
@@ -13,6 +13,10 @@
 #undef SAL_LOG_INFO
 #undef SAL_LOG_WARN
 
+#include 
+
+#include 
+
 #include 
 #include 
 
@@ -57,4 +61,19 @@
 #include 
 #include 
 
+#if defined MACOSX
+#include 
+#include 
+#endif
+
+// Called from FullTextEncodingData::get in sal/textenc/textenc.cxx, but only
+// defined for ANDROID (in ANDROID-specific sal/textenc/tables.cxx); would even
+// work to leave it undefined for LINUX due to no '-z defs' under -fsanitize=*
+// (solenv/gbuild/platform/linux.mk), but not for MACOSX:
+extern "C" ImplTextEncodingData const * sal_getFullTextEncodingData(
+rtl_TextEncoding)
+{
+std::abort();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits