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

2017-01-22 Thread Noel Grandin
 svx/source/form/fmexch.cxx  |   21 +
 svx/source/form/fmmodel.cxx |   40 +---
 svx/source/inc/filtnav.hxx  |2 +-
 svx/source/inc/fmexch.hxx   |   17 +
 4 files changed, 36 insertions(+), 44 deletions(-)

New commits:
commit 10d0c60947da520779040af25b0c558564b71aff
Author: Noel Grandin 
Date:   Mon Jan 23 08:48:02 2017 +0200

use rtl::Reference in FmFormModelImplData

instead of manual acquire/release

Change-Id: I925b45bcc2f09e09330ae8c79f3f40b81ae120ed

diff --git a/svx/source/form/fmmodel.cxx b/svx/source/form/fmmodel.cxx
index 3c7b1b4..22c9e20 100644
--- a/svx/source/form/fmmodel.cxx
+++ b/svx/source/form/fmmodel.cxx
@@ -37,15 +37,14 @@ using namespace svxform;
 
 struct FmFormModelImplData
 {
-FmXUndoEnvironment* pUndoEnv;
+rtl::Reference  mxUndoEnv;
 boolbOpenInDesignIsDefaulted;
 boolbMovingPage;
 ::boost::optional< sal_Bool >
 aControlsUseRefDevice;
 
 FmFormModelImplData()
-:pUndoEnv( nullptr )
-,bOpenInDesignIsDefaulted( true )
+:bOpenInDesignIsDefaulted( true )
 ,bMovingPage( false )
 ,aControlsUseRefDevice()
 {
@@ -60,8 +59,7 @@ FmFormModel::FmFormModel(SfxItemPool* pPool, SfxObjectShell* 
pPers)
 , m_bAutoControlFocus(false)
 {
 m_pImpl.reset( new FmFormModelImplData );
-m_pImpl->pUndoEnv = new FmXUndoEnvironment(*this);
-m_pImpl->pUndoEnv->acquire();
+m_pImpl->mxUndoEnv = new FmXUndoEnvironment(*this);
 }
 
 FmFormModel::FmFormModel(const OUString& rPath, SfxItemPool* pPool, 
SfxObjectShell* pPers)
@@ -72,8 +70,7 @@ FmFormModel::FmFormModel(const OUString& rPath, SfxItemPool* 
pPool, SfxObjectShe
 , m_bAutoControlFocus(false)
 {
 m_pImpl.reset( new FmFormModelImplData );
-m_pImpl->pUndoEnv = new FmXUndoEnvironment(*this);
-m_pImpl->pUndoEnv->acquire();
+m_pImpl->mxUndoEnv = new FmXUndoEnvironment(*this);
 }
 
 FmFormModel::FmFormModel(const OUString& rPath, SfxItemPool* pPool, 
SfxObjectShell* pPers,
@@ -85,20 +82,17 @@ FmFormModel::FmFormModel(const OUString& rPath, 
SfxItemPool* pPool, SfxObjectShe
 , m_bAutoControlFocus(false)
 {
 m_pImpl.reset( new FmFormModelImplData );
-m_pImpl->pUndoEnv = new FmXUndoEnvironment(*this);
-m_pImpl->pUndoEnv->acquire();
+m_pImpl->mxUndoEnv = new FmXUndoEnvironment(*this);
 }
 
 FmFormModel::~FmFormModel()
 {
-if (m_pObjShell && m_pImpl->pUndoEnv->IsListening(*m_pObjShell))
+if (m_pObjShell && m_pImpl->mxUndoEnv->IsListening(*m_pObjShell))
 SetObjectShell(nullptr);
 
 ClearUndoBuffer();
 // minimale grenze fuer undos
 SetMaxUndoActionCount(1);
-
-m_pImpl->pUndoEnv->release();
 }
 
 SdrPage* FmFormModel::AllocPage(bool bMasterPage)
@@ -109,7 +103,7 @@ SdrPage* FmFormModel::AllocPage(bool bMasterPage)
 void FmFormModel::InsertPage(SdrPage* pPage, sal_uInt16 nPos)
 {
 // hack solange Methode intern
-if (m_pObjShell && !m_pImpl->pUndoEnv->IsListening( *m_pObjShell ))
+if (m_pObjShell && !m_pImpl->mxUndoEnv->IsListening( *m_pObjShell ))
 SetObjectShell(m_pObjShell);
 
 SdrModel::InsertPage( pPage, nPos );
@@ -134,7 +128,7 @@ SdrPage* FmFormModel::RemovePage(sal_uInt16 nPgNum)
 {
 Reference< XNameContainer > xForms( pToBeRemovedPage->GetForms( false 
), css::uno::UNO_QUERY );
 if ( xForms.is() )
-m_pImpl->pUndoEnv->RemoveForms( xForms );
+m_pImpl->mxUndoEnv->RemoveForms( xForms );
 }
 
 FmFormPage* pRemovedPage = 
static_cast(SdrModel::RemovePage(nPgNum));
@@ -145,7 +139,7 @@ SdrPage* FmFormModel::RemovePage(sal_uInt16 nPgNum)
 void FmFormModel::InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos)
 {
 // hack solange Methode intern
-if (m_pObjShell && !m_pImpl->pUndoEnv->IsListening( *m_pObjShell ))
+if (m_pObjShell && !m_pImpl->mxUndoEnv->IsListening( *m_pObjShell ))
 SetObjectShell(m_pObjShell);
 
 SdrModel::InsertMasterPage(pPage, nPos);
@@ -159,7 +153,7 @@ SdrPage* FmFormModel::RemoveMasterPage(sal_uInt16 nPgNum)
 {
 Reference< XNameContainer > xForms( pPage->GetForms( false ), 
css::uno::UNO_QUERY );
 if ( xForms.is() )
-m_pImpl->pUndoEnv->RemoveForms( xForms );
+m_pImpl->mxUndoEnv->RemoveForms( xForms );
 }
 
 return pPage;
@@ -222,27 +216,27 @@ void FmFormModel::SetObjectShell( SfxObjectShell* pShell )
 
 if (m_pObjShell)
 {
-m_pImpl->pUndoEnv->EndListening( *this );
-m_pImpl->pUndoEnv->EndListening( *m_pObjShell );
+m_pImpl->mxUndoEnv->EndListening( *this );
+m_pImpl->mxUndoEnv->EndListening( *m_pObjShell );
 }
 
 m_pObjShell = pShell;
 
 if (m_pObjShell)
 {
-m_pImpl->pUndoEnv->SetReadOnly( m_pObjShell->IsReadOnly() || 
m_pObjShell->IsReadOnlyUI(), FmXUndoEnvironment::Accessor() );
+   

Re: Brendan Ward license statement

2017-01-22 Thread Jan Iversen
WELCOME
Thanks for your license statement.

We suggest you add yourself to our wiki (remark this is not a demand)
https://wiki.documentfoundation.org/Development/Developers

If you want help to get started or have any questions, then please contact me. 
I am here to help you (and others) in getting their first patch submitted.

LibreOffice is a very big program and getting it built, setting up gerrit, and 
getting the first patch right can be a bit challenging, therefore do not 
hesitate to email me if you want help.

We have made a step by step guide to help you get started:
https://wiki.documentfoundation.org/Development/GetInvolved

rgds
Jan Iversen.___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-bugs] [Bug 75471] Newly opened LibO document frames stay in background ( i. e. LibO does not get focus)

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=75471

Samuel Mehrbrodt (CIB)  changed:

   What|Removed |Added

 CC||je...@softcatala.org

--- Comment #57 from Samuel Mehrbrodt (CIB)  ---
(In reply to eBatch from comment #52)
> Seems to work fine. Begs the question as to how long this fix has been
> around but not publicised (or am I missing something?)?
> 
> Also why isn't ForceFocusAndToFront set as true by default (or will it be in
> 5.4)?

I found it when I tried to track this bug down. Someone changed [1] it (in
LibreOffice code instead of his own settings) in 2013 to fit his personal
preference, and it seems nobody really noticed.

It is now true by default after the fix.

[1]
https://cgit.freedesktop.org/libreoffice/core/commit/?id=fa52e16b3fb1b8b051f8f64a52c126ba3cbf4d54

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


Re: Zohar Tal license statement

2017-01-22 Thread Jan Iversen
WELCOME
Thanks for your license statement.

We suggest you add yourself to our wiki (remark this is not a demand)
https://wiki.documentfoundation.org/Development/Developers

If you want help to get started or have any questions, then please contact me. 
I am here to help you (and others) in getting their first patch submitted.

LibreOffice is a very big program and getting it built, setting up gerrit, and 
getting the first patch right can be a bit challenging, therefore do not 
hesitate to email me if you want help.

We have made a step by step guide to help you get started:
https://wiki.documentfoundation.org/Development/GetInvolved

rgds
Jan Iversen.___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Weslley Ramos license statemen

2017-01-22 Thread Jan Iversen
WELCOME
Thanks for your license statement.

We suggest you add yourself to our wiki (remark this is not a demand)
https://wiki.documentfoundation.org/Development/Developers

If you want help to get started or have any questions, then please contact me. 
I am here to help you (and others) in getting their first patch submitted.

LibreOffice is a very big program and getting it built, setting up gerrit, and 
getting the first patch right can be a bit challenging, therefore do not 
hesitate to email me if you want help.

We have made a step by step guide to help you get started:
https://wiki.documentfoundation.org/Development/GetInvolved

rgds
Jan Iversen.___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-0' - loleaflet/dist

2017-01-22 Thread Pranav Kant
 loleaflet/dist/toolbar/toolbar.js |   30 +++---
 1 file changed, 23 insertions(+), 7 deletions(-)

New commits:
commit 35757a2f1802d2a6295f23e8ea9bb29d7ead80dd
Author: Pranav Kant 
Date:   Sat Jan 21 17:24:16 2017 +0530

loleaflet: Make things simpler - use separate cell alignment commands

... instead of using HorizontalAlignment command with different
parameters to do a cell alignment. The state change events for
that would add further complexity here. Lets keep using separate
UNO commands for alignment.

Additonally, change a typo, 'alignblock' -> 'justifypara' when
hiding the toolbar buttons on 'doclayerinit' event - we don't
want to show justify alignment button for spreadsheets.

Change-Id: Iaf7406af9e3172b3fa9d41b3dac6d1e2677f0db8
(cherry picked from commit 40307955841b070483736117d41b9dff88013cfb)

diff --git a/loleaflet/dist/toolbar/toolbar.js 
b/loleaflet/dist/toolbar/toolbar.js
index 22f74a2..371623f 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -473,10 +473,10 @@ $(function () {
{type: 'html',  id: 'backcolor-html', html: ''},
{type: 'button',  id: 'backcolor', img: 'backcolor', 
hint: _('Highlighting')},
{type: 'break'},
-   {type: 'button',  id: 'leftpara',  img: 'alignleft', 
hint: _('Align left'), uno: 'LeftPara', unosheet: 'HorizontalAlignment 
{"HorizontalAlignment":{"type":"unsigned short", "value":"1"}}'},
-   {type: 'button',  id: 'centerpara',  img: 
'alignhorizontal', hint: _('Center horizontally'), uno: 'CenterPara', unosheet: 
'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", 
"value":"2"}}'},
-   {type: 'button',  id: 'rightpara',  img: 'alignright', 
hint: _('Align right'), uno: 'RightPara', unosheet: 'HorizontalAlignment 
{"HorizontalAlignment":{"type":"unsigned short", "value":"3"}}'},
-   {type: 'button',  id: 'justifypara',  img: 
'alignblock', hint: _('Justified'), uno: 'JustifyPara', unosheet: 
'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", 
"value":"4"}}'},
+   {type: 'button',  id: 'leftpara',  img: 'alignleft', 
hint: _('Align left'), uno: 'LeftPara', unosheet: 'AlignLeft'},
+   {type: 'button',  id: 'centerpara',  img: 
'alignhorizontal', hint: _('Center horizontally'), uno: 'CenterPara', unosheet: 
'AlignHorizontalCenter'},
+   {type: 'button',  id: 'rightpara',  img: 'alignright', 
hint: _('Align right'), uno: 'RightPara', unosheet: 'AlignRight'},
+   {type: 'button',  id: 'justifypara',  img: 
'alignblock', hint: _('Justified'), uno: 'JustifyPara', unosheet: ''},
{type: 'break',  id: 'wraptextseparator'},
{type: 'button',  id: 'wraptext',  img: 'wraptext', 
hint: _('Wrap Text'), uno: 'WrapText'},
{type: 'button',  id: 'togglemergecells',  img: 
'togglemergecells', hint: _('Merge and Center Cells'), uno: 'ToggleMergeCells'},
@@ -742,7 +742,23 @@ function toLocalePattern (pattern, regex, text, sub1, 
sub2) {
 
 function unoCmdToToolbarId(commandname)
 {
-   return commandname.toLowerCase().substr(5);
+   var id = commandname.toLowerCase().substr(5);
+   if (map.getDocType() === 'spreadsheet') {
+   switch (id) {
+   case 'alignleft':
+   id = 'leftpara';
+   break;
+   case 'alignhorizontalcenter':
+   id = 'centerpara';
+   break;
+   case 'alignright':
+   id = 'rightpara';
+   break;
+   default:
+   id = null;
+   }
+   }
+   return id;
 }
 
 function selectItem(item, func)
@@ -958,8 +974,8 @@ map.on('doclayerinit', function () {
 
switch (docType) {
case 'spreadsheet':
-   toolbarUp.remove('inserttable', 'styles', 'alignblock', 
'defaultbullet', 'defaultnumbering', 'break-numbering');
-   toolbarUpMore.remove('inserttable', 'styles', 'alignblock', 
'defaultbullet', 'defaultnumbering', 'break-numbering');
+   toolbarUp.remove('inserttable', 'styles', 'justifypara', 
'defaultbullet', 'defaultnumbering', 'break-numbering');
+   toolbarUpMore.remove('inserttable', 'styles', 'justifypara', 
'defaultbullet', 'defaultnumbering', 'break-numbering');
statusbar.disable('zoomreset', 'zoomout', 'zoomin', 
'zoomlevel');
statusbar.insert('left', [
{type: 'break', id:'break1'},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

Re: Aleix Pol license statement

2017-01-22 Thread Jan Iversen
WELCOME
Thanks for your license statement.

We suggest you add yourself to our wiki (remark this is not a demand)
https://wiki.documentfoundation.org/Development/Developers

If you want help to get started or have any questions, then please contact me. 
I am here to help you (and others) in getting their first patch submitted.

LibreOffice is a very big program and getting it built, setting up gerrit, and 
getting the first patch right can be a bit challenging, therefore do not 
hesitate to email me if you want help.

We have made a step by step guide to help you get started:
https://wiki.documentfoundation.org/Development/GetInvolved

rgds
Jan Iversen.___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] online.git: 2 commits - common/Log.hpp loleaflet/dist

2017-01-22 Thread Pranav Kant
 common/Log.hpp|2 +-
 loleaflet/dist/toolbar/toolbar.js |   30 +++---
 2 files changed, 24 insertions(+), 8 deletions(-)

New commits:
commit 40307955841b070483736117d41b9dff88013cfb
Author: Pranav Kant 
Date:   Sat Jan 21 17:24:16 2017 +0530

loleaflet: Make things simpler - use separate cell alignment commands

... instead of using HorizontalAlignment command with different
parameters to do a cell alignment. The state change events for
that would add further complexity here. Lets keep using separate
UNO commands for alignment.

Additonally, change a typo, 'alignblock' -> 'justifypara' when
hiding the toolbar buttons on 'doclayerinit' event - we don't
want to show justify alignment button for spreadsheets.

Change-Id: Iaf7406af9e3172b3fa9d41b3dac6d1e2677f0db8

diff --git a/loleaflet/dist/toolbar/toolbar.js 
b/loleaflet/dist/toolbar/toolbar.js
index d3bde74..733dda9 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -489,10 +489,10 @@ $(function () {
{type: 'html',  id: 'backcolor-html', html: ''},
{type: 'button',  id: 'backcolor', img: 'backcolor', 
hint: _('Highlighting')},
{type: 'break'},
-   {type: 'button',  id: 'leftpara',  img: 'alignleft', 
hint: _('Align left'), uno: 'LeftPara', unosheet: 'HorizontalAlignment 
{"HorizontalAlignment":{"type":"unsigned short", "value":"1"}}'},
-   {type: 'button',  id: 'centerpara',  img: 
'alignhorizontal', hint: _('Center horizontally'), uno: 'CenterPara', unosheet: 
'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", 
"value":"2"}}'},
-   {type: 'button',  id: 'rightpara',  img: 'alignright', 
hint: _('Align right'), uno: 'RightPara', unosheet: 'HorizontalAlignment 
{"HorizontalAlignment":{"type":"unsigned short", "value":"3"}}'},
-   {type: 'button',  id: 'justifypara',  img: 
'alignblock', hint: _('Justified'), uno: 'JustifyPara', unosheet: 
'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", 
"value":"4"}}'},
+   {type: 'button',  id: 'leftpara',  img: 'alignleft', 
hint: _('Align left'), uno: 'LeftPara', unosheet: 'AlignLeft'},
+   {type: 'button',  id: 'centerpara',  img: 
'alignhorizontal', hint: _('Center horizontally'), uno: 'CenterPara', unosheet: 
'AlignHorizontalCenter'},
+   {type: 'button',  id: 'rightpara',  img: 'alignright', 
hint: _('Align right'), uno: 'RightPara', unosheet: 'AlignRight'},
+   {type: 'button',  id: 'justifypara',  img: 
'alignblock', hint: _('Justified'), uno: 'JustifyPara', unosheet: ''},
{type: 'break',  id: 'wraptextseparator'},
{type: 'button',  id: 'wraptext',  img: 'wraptext', 
hint: _('Wrap Text'), uno: 'WrapText'},
{type: 'button',  id: 'togglemergecells',  img: 
'togglemergecells', hint: _('Merge and Center Cells'), uno: 'ToggleMergeCells'},
@@ -717,7 +717,23 @@ function toLocalePattern (pattern, regex, text, sub1, 
sub2) {
 
 function unoCmdToToolbarId(commandname)
 {
-   return commandname.toLowerCase().substr(5);
+   var id = commandname.toLowerCase().substr(5);
+   if (map.getDocType() === 'spreadsheet') {
+   switch (id) {
+   case 'alignleft':
+   id = 'leftpara';
+   break;
+   case 'alignhorizontalcenter':
+   id = 'centerpara';
+   break;
+   case 'alignright':
+   id = 'rightpara';
+   break;
+   default:
+   id = null;
+   }
+   }
+   return id;
 }
 
 function selectItem(item, func)
@@ -931,8 +947,8 @@ map.on('doclayerinit', function () {
 
switch (docType) {
case 'spreadsheet':
-   toolbarUp.remove('inserttable', 'styles', 'alignblock', 
'defaultbullet', 'defaultnumbering', 'break-numbering');
-   toolbarUpMore.remove('inserttable', 'styles', 'alignblock', 
'defaultbullet', 'defaultnumbering', 'break-numbering');
+   toolbarUp.remove('inserttable', 'styles', 'justifypara', 
'defaultbullet', 'defaultnumbering', 'break-numbering');
+   toolbarUpMore.remove('inserttable', 'styles', 'justifypara', 
'defaultbullet', 'defaultnumbering', 'break-numbering');
statusbar.disable('zoomreset', 'zoomout', 'zoomin', 
'zoomlevel');
statusbar.insert('left', [
{type: 'break', id:'break1'},
commit 8c5028de052b108992077752592bcf1198bb3b5f
Author: Pranav Kant 
Date:   Mon Jan 23 13:03:03 2017 +0530

fix build for poco 1.7.5

Change-Id: 

Re: Saurav Sachidanand license statement

2017-01-22 Thread Jan Iversen
WELCOME
Thanks for your license statement.

We suggest you add yourself to our wiki (remark this is not a demand)
https://wiki.documentfoundation.org/Development/Developers

If you want help to get started or have any questions, then please contact me. 
I am here to help you (and others) in getting their first patch submitted.

LibreOffice is a very big program and getting it built, setting up gerrit, and 
getting the first patch right can be a bit challenging, therefore do not 
hesitate to email me if you want help.

We have made a step by step guide to help you get started:
https://wiki.documentfoundation.org/Development/GetInvolved

rgds
Jan Iversen.___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Paulo de Souza Lima - License statement

2017-01-22 Thread Jan Iversen
WELCOME
Thanks for your license statement.

We suggest you add yourself to our wiki (remark this is not a demand)
https://wiki.documentfoundation.org/Development/Developers

If you want help to get started or have any questions, then please contact me. 
I am here to help you (and others) in getting their first patch submitted.

LibreOffice is a very big program and getting it built, setting up gerrit, and 
getting the first patch right can be a bit challenging, therefore do not 
hesitate to email me if you want help.

We have made a step by step guide to help you get started:
https://wiki.documentfoundation.org/Development/GetInvolved

rgds
Jan Iversen.___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Alekhya Velllanki license statement

2017-01-22 Thread Jan Iversen
WELCOME
Thanks for your license statement.

We suggest you add yourself to our wiki (remark this is not a demand)
https://wiki.documentfoundation.org/Development/Developers

If you want help to get started or have any questions, then please contact me. 
I am here to help you (and others) in getting their first patch submitted.

LibreOffice is a very big program and getting it built, setting up gerrit, and 
getting the first patch right can be a bit challenging, therefore do not 
hesitate to email me if you want help.

We have made a step by step guide to help you get started:
https://wiki.documentfoundation.org/Development/GetInvolved

rgds
Jan Iversen.___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2017-01-22 Thread Noel Grandin
 include/sfx2/ipclient.hxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit c3199d1d58957a421d68ffbf6a63666aac755a51
Author: Noel Grandin 
Date:   Mon Jan 23 09:28:26 2017 +0200

fix windows build

Change-Id: Ie32847e22965950d4b2a0e53ccab625a00a6589c

diff --git a/include/sfx2/ipclient.hxx b/include/sfx2/ipclient.hxx
index 23ec5e4..1ab9f4d 100644
--- a/include/sfx2/ipclient.hxx
+++ b/include/sfx2/ipclient.hxx
@@ -59,8 +59,11 @@ public:
 SfxInPlaceClient( SfxViewShell* pViewShell, 
vcl::Window* pDraw, sal_Int64 nAspect );
 virtual ~SfxInPlaceClient();
 
+SfxInPlaceClient(const SfxInPlaceClient &) = delete;
+SfxInPlaceClient& operator=(const SfxInPlaceClient &) = delete;
+
 SfxViewShell*   GetViewShell() const { return m_pViewSh; }
-vcl::Window* GetEditWin() const { return m_pEditWin; }
+vcl::Window*GetEditWin() const { return m_pEditWin; }
 const css::uno::Reference < css::embed::XEmbeddedObject >& GetObject() 
const;
 voidSetObject( const css::uno::Reference < 
css::embed::XEmbeddedObject >& rObject );
 voidSetObjectState( sal_Int32 );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-01-22 Thread Jochen Nitschke
 editeng/source/editeng/editobj.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit dd891ec422fb35eada219ca7adddbd60d69f1fb7
Author: Jochen Nitschke 
Date:   Sun Jan 22 13:23:57 2017 +0100

cppcheck: memleak (false positive)

but manage ownership from start

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

diff --git a/editeng/source/editeng/editobj.cxx 
b/editeng/source/editeng/editobj.cxx
index 3f1f70f..3e3e8b7 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -1404,11 +1404,11 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream 
)
 aNewFontItem.SetFamilyName( GetFontToSubsFontName( hConv ) 
);
 
 // Replace the existing attribute with a new one.
-XEditAttribute* pNewAttr = CreateAttrib(aNewFontItem, 
rAttr.GetStart(), rAttr.GetEnd());
-
+pC->maCharAttribs[nAttr] =
+
std::unique_ptr(CreateAttrib(aNewFontItem, rAttr.GetStart(), 
rAttr.GetEnd()));
 pPool->Remove(*rAttr.GetItem());
-pC->maCharAttribs[nAttr] = 
std::unique_ptr(pNewAttr);
 
+XEditAttribute* pNewAttr = pC->maCharAttribs[nAttr].get();
 for ( sal_uInt16 nChar = pNewAttr->GetStart(); nChar < 
pNewAttr->GetEnd(); nChar++ )
 {
 sal_Unicode cOld = pC->GetText()[ nChar ];
___
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' - 3 commits - desktop/source libreofficekit/qa sfx2/source

2017-01-22 Thread Pranav Kant
 desktop/source/lib/init.cxx |3 +++
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |6 ++
 sfx2/source/control/unoctitm.cxx|5 -
 3 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit dc0f5b50bd73d1afce156e84311d2bd2f4035fae
Author: Pranav Kant 
Date:   Sat Jan 21 01:03:34 2017 +0530

lok: Listen for state change events for cell alignment commands

We used to use HorizontalAlignment uno command for cell alignment
both in online and gtktiledviewer. To make things simpler, lets
use separate cell alignment uno commands for spreadsheets like we
have in writer and impres.

Change-Id: I2a959d1892f6b02db7a9ce51d55309216e4b3c6c
Reviewed-on: https://gerrit.libreoffice.org/33444
Reviewed-by: pranavk 
Tested-by: pranavk 
(cherry picked from commit a27e09079596eeae81cced01eaeabf94d6675085)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 62d8d34..66608a6 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1241,6 +1241,9 @@ static void doc_iniUnoCommands ()
 
 OUString sUnoCommands[] =
 {
+OUString(".uno:AlignLeft"),
+OUString(".uno:AlignHorizontalCenter"),
+OUString(".uno:AlignRight"),
 OUString(".uno:BackColor"),
 OUString(".uno:BackgroundColor"),
 OUString(".uno:Bold"),
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx 
b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 28da6c5..2f1ce85 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -365,18 +365,11 @@ gboolean TiledRowColumnBar::docConfigureEvent(GtkWidget* 
pDocView, GdkEventConfi
 gtk_widget_queue_draw(rWindow.m_pColumnBar->m_pDrawingArea);
 gtk_widget_show(rWindow.m_pFormulabarEntry);
 
-// Change horizontal alignment uno commands for spreadsheet
-const std::string argsPrefix =
-"{"
-"\"HorizontalAlignment\":{"
-"\"type\":\"unsigned short\", "
-"\"value\":\"";
-const std::string argsSuffix = "\"}}";
-
-lcl_registerToolItem(rWindow, rWindow.m_pLeftpara, 
".uno:HorizontalAlignment", argsPrefix + std::to_string(1) + argsSuffix);
-lcl_registerToolItem(rWindow, rWindow.m_pCenterpara, 
".uno:HorizontalAlignment", argsPrefix + std::to_string(2) + argsSuffix);
-lcl_registerToolItem(rWindow, rWindow.m_pRightpara, 
".uno:HorizontalAlignment", argsPrefix + std::to_string(3) + argsSuffix);
-lcl_registerToolItem(rWindow, rWindow.m_pJustifypara, 
".uno:HorizontalAlignment", argsPrefix + std::to_string(4) + argsSuffix);
+// Change cell alignment uno commands for spreadsheet
+lcl_registerToolItem(rWindow, rWindow.m_pLeftpara, ".uno:AlignLeft");
+lcl_registerToolItem(rWindow, rWindow.m_pCenterpara, 
".uno:AlignHorizontalCenter");
+lcl_registerToolItem(rWindow, rWindow.m_pRightpara, ".uno:AlignRight");
+gtk_widget_hide(GTK_WIDGET(rWindow.m_pJustifypara));
 }
 
 return TRUE;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 063f808..2e4d18f 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1120,7 +1120,10 @@ static void InterceptLOKStateChangeEvent(const 
SfxViewFrame* pViewFrame, const c
 aEvent.FeatureURL.Path == "Underline" ||
 aEvent.FeatureURL.Path == "ModifiedStatus" ||
 aEvent.FeatureURL.Path == "TrackChanges" ||
-aEvent.FeatureURL.Path == "AcceptTrackedChange")
+aEvent.FeatureURL.Path == "AcceptTrackedChange" ||
+aEvent.FeatureURL.Path == "AlignLeft" ||
+aEvent.FeatureURL.Path == "AlignHorizontalCenter" ||
+aEvent.FeatureURL.Path == "AlignRight")
 {
 bool bTemp = false;
 aEvent.State >>= bTemp;
commit 3eb2ed31565c8431fab30f153ccc243353e77975
Author: Pranav Kant 
Date:   Fri Jan 6 15:57:43 2017 +0530

gtktiledviewer: Lets avoid using manual buffer sizes

Change-Id: I76e70ccb5b1f40193a1eda1cbca19b3444168dae
(cherry picked from commit 29f697711e06b88fb8387518e7f8440cf49f0933)

diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx 
b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 756ff17..28da6c5 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -366,23 +366,17 @@ gboolean TiledRowColumnBar::docConfigureEvent(GtkWidget* 
pDocView, GdkEventConfi
 gtk_widget_show(rWindow.m_pFormulabarEntry);
 
 // Change horizontal alignment uno commands for spreadsheet
-const char* unoHorAlignArgs =
+const std::string argsPrefix =
 "{"
 "\"HorizontalAlignment\":{"

[Libreoffice-commits] core.git: bin/gbuild-to-ide

2017-01-22 Thread Noel Grandin
 bin/gbuild-to-ide |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 38f9082771b7842d056a04965bffd57cb655a558
Author: Noel Grandin 
Date:   Mon Jan 23 09:12:38 2017 +0200

didn't mean to commit that part

Change-Id: Ica8384b374e0d680704cba17a9d4c9f30ae08bf5

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index d4a32b2..90d2064 100644
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1,4 +1,4 @@
-#! /usr/local/bin/python3
+#! /usr/bin/env python3
 # -*- Mode: python; tab-width: 4; indent-tabs-mode: t -*-
 #
 # This file is part of the LibreOffice project.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-bugs] [Bug 98707] Calc crashes when attempting to reformat a cell

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=98707

--- Comment #18 from Buovjaga  ---
Ok, the builds are finally up again:
http://dev-builds.libreoffice.org/daily/master/Win-x86@39/current/

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


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

2017-01-22 Thread Pranav Kant
 libreofficekit/source/gtk/lokdocview.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 5128e503ba8f602d1fda47c89e5b6ee4be6b7029
Author: Pranav Kant 
Date:   Thu Jan 19 14:13:54 2017 +0530

lokdocview: Handle keypad enter

Change-Id: Ia892c346d4a3c0a5439c7977963cc502d287e6f7
Reviewed-on: https://gerrit.libreoffice.org/33445
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 0b8fa7d..19080fd 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -723,6 +723,7 @@ signalKey (GtkWidget* pWidget, GdkEventKey* pEvent)
 nKeyCode = com::sun::star::awt::Key::DELETE;
 break;
 case GDK_KEY_Return:
+case GDK_KEY_KP_Enter:
 nKeyCode = com::sun::star::awt::Key::RETURN;
 break;
 case GDK_KEY_Escape:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: compilerplugins/clang hwpfilter/source include/basegfx sw/source

2017-01-22 Thread Noel Grandin
 compilerplugins/clang/useuniqueptr.cxx   |  137 +++
 hwpfilter/source/hwpreader.cxx   |3 
 hwpfilter/source/hwpreader.hxx   |4 
 include/basegfx/raster/bpixelraster.hxx  |5 -
 include/basegfx/raster/bzpixelraster.hxx |5 -
 sw/source/filter/ww8/wrtw8sty.cxx|3 
 sw/source/filter/ww8/wrtww8.cxx  |   12 +-
 sw/source/filter/ww8/wrtww8.hxx  |6 -
 sw/source/filter/ww8/ww8scan.cxx |   14 +--
 sw/source/filter/ww8/ww8scan.hxx |9 +-
 sw/source/filter/ww8/ww8toolbar.cxx  |6 -
 sw/source/filter/ww8/ww8toolbar.hxx  |5 -
 sw/source/ui/index/swuiidxmrk.cxx|4 
 sw/source/uibase/inc/swuiidxmrk.hxx  |4 
 14 files changed, 173 insertions(+), 44 deletions(-)

New commits:
commit 98e4013c22c4ce63090a575e698cc2af82925e6b
Author: Noel Grandin 
Date:   Wed Jan 11 14:19:47 2017 +0200

new loplugin useuniqueptr

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

diff --git a/compilerplugins/clang/useuniqueptr.cxx 
b/compilerplugins/clang/useuniqueptr.cxx
new file mode 100644
index 000..82d95e5
--- /dev/null
+++ b/compilerplugins/clang/useuniqueptr.cxx
@@ -0,0 +1,137 @@
+/* -*- 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/.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "plugin.hxx"
+
+/**
+  Find destructors that only contain a single call to delete of a field. In 
which
+  case that field should really be managed by unique_ptr.
+*/
+
+namespace {
+
+class UseUniquePtr:
+public RecursiveASTVisitor, public loplugin::Plugin
+{
+public:
+explicit UseUniquePtr(InstantiationData const & data): Plugin(data) {}
+
+virtual void run() override
+{
+TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
+}
+
+bool VisitCXXDestructorDecl(const CXXDestructorDecl* );
+};
+
+bool UseUniquePtr::VisitCXXDestructorDecl(const CXXDestructorDecl* 
destructorDecl)
+{
+if (ignoreLocation(destructorDecl))
+return true;
+if (isInUnoIncludeFile(destructorDecl))
+return true;
+
+/*
+StringRef aFileName = 
compiler.getSourceManager().getFilename(compiler.getSourceManager().getSpellingLoc(destructorDecl->getLocStart()));
+// weird stuff, passing pointers to internal members of struct
+if (aFileName.startswith(SRCDIR "/include/jvmfwk/framework.hxx"))
+return true;
+*/
+if (destructorDecl->getBody() == nullptr)
+return true;
+const CompoundStmt* compoundStmt = dyn_cast< CompoundStmt >( 
destructorDecl->getBody() );
+if (compoundStmt == nullptr) {
+return true;
+}
+if (compoundStmt->size() != 1) {
+return true;
+}
+const CXXDeleteExpr* deleteExpr = 
dyn_cast(compoundStmt->body_front());
+if (deleteExpr == nullptr) {
+return true;
+}
+
+const ImplicitCastExpr* pCastExpr = 
dyn_cast(deleteExpr->getArgument());
+if (!pCastExpr)
+return true;
+const MemberExpr* pMemberExpr = 
dyn_cast(pCastExpr->getSubExpr());
+if (!pMemberExpr)
+return true;
+
+// ignore union games
+const FieldDecl* pFieldDecl = 
dyn_cast(pMemberExpr->getMemberDecl());
+if (!pFieldDecl)
+return true;
+TagDecl const * td = dyn_cast(pFieldDecl->getDeclContext());
+if (td->isUnion())
+return true;
+
+// ignore calling delete on someone else's field
+if (pFieldDecl->getParent() != destructorDecl->getParent() )
+return true;
+
+if (ignoreLocation(pFieldDecl))
+return true;
+// to ignore things like the CPPUNIT macros
+StringRef aFileName = 
compiler.getSourceManager().getFilename(compiler.getSourceManager().getSpellingLoc(pFieldDecl->getLocStart()));
+if (aFileName.startswith(WORKDIR))
+return true;
+// weird stuff, passing pointers to internal members of struct
+if (aFileName.startswith(SRCDIR "/include/jvmfwk/framework.hxx"))
+return true;
+if (aFileName.startswith(SRCDIR "/jvmfwk/"))
+return true;
+// passes and stores pointers to member fields
+if (aFileName.startswith(SRCDIR "/sot/source/sdstor/stgdir.hxx"))
+return true;
+// passes and stores pointers to member fields
+if (aFileName.startswith(SRCDIR 
"/desktop/source/migration/services/jvmfwk.cxx"))
+return true;
+// something platform-specific
+if (aFileName.startswith(SRCDIR "/hwpfilter/source/htags.h"))
+return true;
+// 

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

2017-01-22 Thread Noel Grandin
 sw/inc/docufld.hxx|8 
 sw/source/core/fields/docufld.cxx |   19 ---
 2 files changed, 12 insertions(+), 15 deletions(-)

New commits:
commit 2d1cecf02b34d855c8d64e3271bffbcbf9bf4138
Author: Noel Grandin 
Date:   Fri Jan 20 12:20:06 2017 +0200

Revert "Revert "use rtl::Reference in SwPostItField""

This reverts commit 4b429851e54ccc42e5f9acebce67139bc3d5e244

and implements sberg's advice and removing copy operator

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

diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 98e20ea..636abaa8 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -21,7 +21,7 @@
 
 #include 
 #include 
-
+#include 
 #include 
 
 #include "fldbas.hxx"
@@ -443,7 +443,7 @@ class SW_DLLPUBLIC SwPostItField : public SwField
 OUString sName; ///< Name of the comment.
 DateTimeaDateTime;
 OutlinerParaObject* mpText;
-SwTextAPIObject* m_pTextObject;
+rtl::Reference m_xTextObject;
 
 public:
 SwPostItField( SwPostItFieldType*,
@@ -453,8 +453,8 @@ public:
const OUString& rName,
const DateTime& rDate);
 
-SwPostItField(const SwPostItField&) = delete; // fix for MSVC2013
-SwPostItField(SwPostItField&&) = delete; // fix for MSVC2013
+SwPostItField(const SwPostItField&) = delete;
+SwPostItField* operator=(const SwPostItField&) = delete;
 
 virtual ~SwPostItField() override;
 
diff --git a/sw/source/core/fields/docufld.cxx 
b/sw/source/core/fields/docufld.cxx
index e820553..e9ab623 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1648,16 +1648,14 @@ SwPostItField::SwPostItField( SwPostItFieldType* pT,
 , sName( rName )
 , aDateTime( rDateTime )
 , mpText( nullptr )
-, m_pTextObject( nullptr )
 {
 }
 
 SwPostItField::~SwPostItField()
 {
-if ( m_pTextObject != nullptr )
+if ( m_xTextObject.is() )
 {
-m_pTextObject->DisposeEditSource();
-m_pTextObject->release();
+m_xTextObject->DisposeEditSource();
 }
 
 delete mpText;
@@ -1680,7 +1678,7 @@ SwField* SwPostItField::Copy() const
 if (mpText)
 pRet->SetTextObject( new OutlinerParaObject(*mpText) );
 
-// Note: member  not copied.
+// Note: member  not copied.
 
 return pRet;
 }
@@ -1747,21 +1745,20 @@ bool SwPostItField::QueryValue( uno::Any& rAny, 
sal_uInt16 nWhichId ) const
 break;
 case FIELD_PROP_TEXT:
 {
-if ( !m_pTextObject )
+if ( !m_xTextObject.is() )
 {
 SwPostItFieldType* pGetType = 
static_cast(GetTyp());
 SwDoc* pDoc = pGetType->GetDoc();
 SwTextAPIEditSource* pObj = new SwTextAPIEditSource( pDoc );
-const_cast  (this)->m_pTextObject = new 
SwTextAPIObject( pObj );
-m_pTextObject->acquire();
+const_cast  (this)->m_xTextObject = new 
SwTextAPIObject( pObj );
 }
 
 if ( mpText )
-m_pTextObject->SetText( *mpText );
+m_xTextObject->SetText( *mpText );
 else
-m_pTextObject->SetString( sText );
+m_xTextObject->SetString( sText );
 
-uno::Reference < text::XText > xText( m_pTextObject );
+uno::Reference < text::XText > xText( m_xTextObject.get() );
 rAny <<= xText;
 break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-01-22 Thread Pranav Kant
 desktop/source/lib/init.cxx |3 +++
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |   17 +
 sfx2/source/control/unoctitm.cxx|5 -
 3 files changed, 12 insertions(+), 13 deletions(-)

New commits:
commit a27e09079596eeae81cced01eaeabf94d6675085
Author: Pranav Kant 
Date:   Sat Jan 21 01:03:34 2017 +0530

lok: Listen for state change events for cell alignment commands

We used to use HorizontalAlignment uno command for cell alignment
both in online and gtktiledviewer. To make things simpler, lets
use separate cell alignment uno commands for spreadsheets like we
have in writer and impres.

Change-Id: I2a959d1892f6b02db7a9ce51d55309216e4b3c6c
Reviewed-on: https://gerrit.libreoffice.org/33444
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 3df7b2e..3aef796 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1344,6 +1344,9 @@ static void doc_iniUnoCommands ()
 
 OUString sUnoCommands[] =
 {
+OUString(".uno:AlignLeft"),
+OUString(".uno:AlignHorizontalCenter"),
+OUString(".uno:AlignRight"),
 OUString(".uno:BackColor"),
 OUString(".uno:BackgroundColor"),
 OUString(".uno:Bold"),
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx 
b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 3c774c1..b53789b 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -374,18 +374,11 @@ gboolean TiledRowColumnBar::docConfigureEvent(GtkWidget* 
pDocView, GdkEventConfi
 gtk_widget_queue_draw(rWindow.m_pColumnBar->m_pDrawingArea);
 gtk_widget_show(rWindow.m_pFormulabarEntry);
 
-// Change horizontal alignment uno commands for spreadsheet
-const std::string argsPrefix =
-"{"
-"\"HorizontalAlignment\":{"
-"\"type\":\"unsigned short\", "
-"\"value\":\"";
-const std::string argsSuffix = "\"}}";
-
-lcl_registerToolItem(rWindow, rWindow.m_pLeftpara, 
".uno:HorizontalAlignment", argsPrefix + std::to_string(1) + argsSuffix);
-lcl_registerToolItem(rWindow, rWindow.m_pCenterpara, 
".uno:HorizontalAlignment", argsPrefix + std::to_string(2) + argsSuffix);
-lcl_registerToolItem(rWindow, rWindow.m_pRightpara, 
".uno:HorizontalAlignment", argsPrefix + std::to_string(3) + argsSuffix);
-lcl_registerToolItem(rWindow, rWindow.m_pJustifypara, 
".uno:HorizontalAlignment", argsPrefix + std::to_string(4) + argsSuffix);
+// Change cell alignment uno commands for spreadsheet
+lcl_registerToolItem(rWindow, rWindow.m_pLeftpara, ".uno:AlignLeft");
+lcl_registerToolItem(rWindow, rWindow.m_pCenterpara, 
".uno:AlignHorizontalCenter");
+lcl_registerToolItem(rWindow, rWindow.m_pRightpara, ".uno:AlignRight");
+gtk_widget_hide(GTK_WIDGET(rWindow.m_pJustifypara));
 }
 
 return TRUE;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 03f7637..33d5314 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -996,7 +996,10 @@ static void InterceptLOKStateChangeEvent(const 
SfxViewFrame* pViewFrame, const c
 aEvent.FeatureURL.Path == "Underline" ||
 aEvent.FeatureURL.Path == "ModifiedStatus" ||
 aEvent.FeatureURL.Path == "TrackChanges" ||
-aEvent.FeatureURL.Path == "AcceptTrackedChange")
+aEvent.FeatureURL.Path == "AcceptTrackedChange" ||
+aEvent.FeatureURL.Path == "AlignLeft" ||
+aEvent.FeatureURL.Path == "AlignHorizontalCenter" ||
+aEvent.FeatureURL.Path == "AlignRight")
 {
 bool bTemp = false;
 aEvent.State >>= bTemp;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: bin/gbuild-to-ide Makefile.in

2017-01-22 Thread Noel Grandin
 Makefile.in   |1 
 bin/gbuild-to-ide |   68 +-
 2 files changed, 68 insertions(+), 1 deletion(-)

New commits:
commit 115797f070888cbad93656dda8fa01ec6c98a3f5
Author: Noel Grandin 
Date:   Thu Jan 19 20:25:10 2017 +0200

beginning of support for CodeLite in gbuild-to-ide

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

diff --git a/Makefile.in b/Makefile.in
index 454755e..d01cbf4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -415,6 +415,7 @@ $(1)-ide-integration: gbuildtojson $(if $(filter 
MACOSX,$(OS_FOR_BUILD)),python3
 endef
 
 $(foreach ide,\
+   codelite \
debug \
kdevelop \
vs2013 \
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
old mode 100755
new mode 100644
index 22a08cd..d4a32b2
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -1,4 +1,4 @@
-#! /usr/bin/env python3
+#! /usr/local/bin/python3
 # -*- Mode: python; tab-width: 4; indent-tabs-mode: t -*-
 #
 # This file is part of the LibreOffice project.
@@ -1624,6 +1624,71 @@ DEFINES += %(defines)s
 SUBDIRS = %(subdirs)s
 """
 
+class CodeliteIntegrationGenerator(IdeIntegrationGenerator):
+
+def __init__(self, gbuildparser, ide):
+IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
+self.target_by_location = {}
+for target in set(self.gbuildparser.libs) | 
set(self.gbuildparser.exes):
+if target.location not in self.target_by_location:
+self.target_by_location[target.location] = set()
+self.target_by_location[target.location] |= set([target])
+
+
+def emit(self):
+# create main workspace file
+codelite_workspace_file = 'lo.workspace1'
+with open(codelite_workspace_file, 'w+') as f:
+f.write(self.generate_workspace_content())
+
+def generate_workspace_content(self):
+projects1 = ''
+projects2 = ''
+projects3 = ''
+for module in self.gbuildparser.modulenamelist:
+projects1 += 
CodeliteIntegrationGenerator.codelite_projects1_template.format(
+name = module
+)
+projects2 += 
CodeliteIntegrationGenerator.codelite_projects2_template.format(
+name = module,
+config = 'Debug'
+)
+projects3 += 
CodeliteIntegrationGenerator.codelite_projects2_template.format(
+name = module,
+config = 'Release'
+)
+xml = CodeliteIntegrationGenerator.codelite_workspace_template.format(
+projects1,
+projects2,
+projects3
+)
+return xml
+
+
+codelite_workspace_template = """
+
+  
+  
+
+  
+{0}
+  
+
+  
+  {1}
+
+
+  
+  {2}
+
+  
+
+"""
+codelite_projects1_template = """
+"""
+
+codelite_projects2_template = """
+"""
 
 def get_options():
 parser = argparse.ArgumentParser(
@@ -1659,6 +1724,7 @@ if __name__ == '__main__':
 'vs2015': VisualStudioIntegrationGenerator,
 'vim': VimIntegrationGenerator,
 'qtcreator': QtCreatorIntegrationGenerator,
+'codelite'  : CodeliteIntegrationGenerator,
 }
 
 if args.ide not in generators.keys():
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-01-22 Thread Gabor Kelemen
 sw/source/ui/envelp/mailmrge.cxx|2 +-
 sw/uiconfig/swriter/ui/mailmerge.ui |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0c004bca03b7756f3e5e09dc345072bb87a0f555
Author: Gabor Kelemen 
Date:   Mon Jan 23 00:00:08 2017 +0100

Typo: idividual in .ui element name

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

diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index e6e35e67..5703310 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -151,7 +151,7 @@ SwMailMergeDlg::SwMailMergeDlg(vcl::Window* pParent, 
SwWrtShell& rShell,
 
 get(m_pSaveMergedDocumentFT, "savemergeddoclabel");
 get(m_pSaveSingleDocRB, "singledocument");
-get(m_pSaveIndividualRB, "idividualdocuments");
+get(m_pSaveIndividualRB, "individualdocuments");
 get(m_pGenerateFromDataBaseCB, "generate");
 
 get(m_pColumnFT, "fieldlabel");
diff --git a/sw/uiconfig/swriter/ui/mailmerge.ui 
b/sw/uiconfig/swriter/ui/mailmerge.ui
index 9ce2cbf..05fce81 100644
--- a/sw/uiconfig/swriter/ui/mailmerge.ui
+++ b/sw/uiconfig/swriter/ui/mailmerge.ui
@@ -694,7 +694,7 @@
   
 
 
-  
+  
 Sa_ve as individual documents
 False
 True
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-01-22 Thread Gabor Kelemen
 officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu |
8 
 1 file changed, 8 deletions(-)

New commits:
commit 02a08a24826c5ac4625c444946c30acf419e2f90
Author: Gabor Kelemen 
Date:   Mon Jan 23 00:01:37 2017 +0100

.uno:DiaSpeed seems to be unimplemented & unused

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

diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index 3299520..02374ca 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -871,14 +871,6 @@
   1
 
   
-  
-
-  Transition Speed
-
-
-  1
-
-  
   
 
   AutoTransition
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Brendan Ward license statement

2017-01-22 Thread Brendan Ward
All of my past and future contributions to LibreOffice may be licensed under 
the MPLv2/LGPLv3+ dual license.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] online.git: wsd/ClientSession.cpp wsd/ClientSession.hpp

2017-01-22 Thread Ashod Nakashian
 wsd/ClientSession.cpp |   29 -
 wsd/ClientSession.hpp |   11 +++
 2 files changed, 15 insertions(+), 25 deletions(-)

New commits:
commit 664f602555dac15a6333943b8f9a0d21f29f659d
Author: Ashod Nakashian 
Date:   Sat Jan 21 22:32:00 2017 -0500

wsd: cleanup ClientSession

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

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 87bc072..12b8fb8 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -37,8 +37,6 @@ ClientSession::ClientSession(const std::string& id,
 _uriPublic(uriPublic),
 _isReadOnly(readOnly),
 _isDocumentOwner(false),
-_loadPart(-1),
-_isLoadRequested(false),
 _stop(false)
 {
 LOG_INF("ClientSession ctor [" << getName() << "].");
@@ -57,11 +55,6 @@ ClientSession::~ClientSession()
 }
 }
 
-bool ClientSession::isLoaded() const
-{
-return _isLoadRequested && gotStatus();
-}
-
 bool ClientSession::_handleInput(const char *buffer, int length)
 {
 LOG_TRC(getName() << ": handling [" << getAbbreviatedMessage(buffer, 
length) << "].");
@@ -239,7 +232,8 @@ bool ClientSession::loadDocument(const char* /*buffer*/, 
int /*length*/,
 try
 {
 std::string timestamp;
-parseDocOptions(tokens, _loadPart, timestamp);
+int loadPart = -1;
+parseDocOptions(tokens, loadPart, timestamp);
 
 std::ostringstream oss;
 oss << "load";
@@ -257,21 +251,22 @@ bool ClientSession::loadDocument(const char* /*buffer*/, 
int /*length*/,
 oss << " author=" + encodedUserName;
 }
 
-if (_loadPart >= 0)
-oss << " part=" + std::to_string(_loadPart);
+if (loadPart >= 0)
+{
+oss << " part=" << loadPart;
+}
 
 if (_haveDocPassword)
+{
 oss << " password=" << _docPassword;
+}
 
 if (!_docOptions.empty())
-oss << " options=" << _docOptions;
-
-const auto loadRequest = oss.str();
-if (forwardToChild(loadRequest, docBroker))
 {
-_isLoadRequested = true;
-return true;
+oss << " options=" << _docOptions;
 }
+
+return forwardToChild(oss.str(), docBroker);
 }
 catch (const Poco::SyntaxException&)
 {
@@ -607,7 +602,7 @@ bool ClientSession::handleKitToClientMessage(const char* 
buffer, const int lengt
 }
 else if (tokens[0] == "status:")
 {
-_gotStatus = true;
+_isLoaded = true;
 docBroker->setLoaded();
 
 // Forward the status response to the client.
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index 96fd0f7..706fae1 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -34,10 +34,8 @@ public:
 void setReadOnly();
 bool isReadOnly() const { return _isReadOnly; }
 
-/// Returns true if we've got status message.
-bool gotStatus() const { return _gotStatus; }
-
-bool isLoaded() const;
+/// Returns true if a document is loaded (i.e. we got status message).
+bool isLoaded() const { return _isLoaded; }
 
 const std::string getUserId() const { return _userId; }
 void setUserId(const std::string& userId) { _userId = userId; }
@@ -165,10 +163,7 @@ private:
 /// Store URLs of completed 'save as' documents.
 MessageQueue _saveAsQueue;
 
-int _loadPart;
-
-bool _isLoadRequested;
-bool _gotStatus;
+bool _isLoaded;
 
 /// Wopi FileInfo object
 std::unique_ptr _wopiFileInfo;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 18 commits - comphelper/source connectivity/source dbaccess/source embeddedobj/source extensions/source forms/source fpicker/source include/comphelper include/sfx2 incl

2017-01-22 Thread Noel Grandin
 comphelper/source/property/propmultiplex.cxx   |   25 --
 connectivity/source/drivers/mork/MResultSet.cxx|   25 --
 connectivity/source/drivers/mork/MResultSet.hxx|3 
 dbaccess/source/ui/browser/sbagrid.cxx |   37 +--
 dbaccess/source/ui/inc/sbagrid.hxx |3 
 embeddedobj/source/commonembedding/embedobj.cxx|   34 +--
 embeddedobj/source/commonembedding/inplaceobj.cxx  |2 
 embeddedobj/source/commonembedding/miscobj.cxx |   40 +--
 embeddedobj/source/commonembedding/persistence.cxx |   53 ++---
 embeddedobj/source/commonembedding/specialobject.cxx   |2 
 embeddedobj/source/commonembedding/visobj.cxx  |   12 -
 embeddedobj/source/general/docholder.cxx   |   19 -
 embeddedobj/source/inc/commonembobj.hxx|3 
 embeddedobj/source/inc/docholder.hxx   |3 
 extensions/source/bibliography/loadlisteneradapter.cxx |   25 --
 extensions/source/bibliography/loadlisteneradapter.hxx |8 
 extensions/source/propctrlr/submissionhandler.cxx  |   13 -
 extensions/source/propctrlr/submissionhandler.hxx  |5 
 forms/source/component/DatabaseForm.cxx|   20 -
 forms/source/component/DatabaseForm.hxx|3 
 fpicker/source/office/fpsmartcontent.cxx   |   20 -
 fpicker/source/office/fpsmartcontent.hxx   |4 
 include/comphelper/propmultiplex.hxx   |5 
 include/sfx2/ipclient.hxx  |3 
 include/svtools/ruler.hxx  |3 
 include/svx/svdotext.hxx   |3 
 sc/source/ui/app/seltrans.cxx  |   42 +---
 sc/source/ui/inc/cellsh.hxx|   10 
 sc/source/ui/inc/seltrans.hxx  |9 
 sc/source/ui/view/cellsh.cxx   |   15 -
 sc/source/ui/view/cellsh1.cxx  |5 
 sfx2/source/appl/appdata.cxx   |2 
 sfx2/source/appl/appinit.cxx   |7 
 sfx2/source/inc/appdata.hxx|2 
 sfx2/source/view/ipclient.cxx  |  174 -
 stoc/source/corereflection/base.hxx|   11 -
 stoc/source/corereflection/crbase.cxx  |   11 -
 svtools/source/control/ruler.cxx   |   14 -
 svtools/source/misc/transfer.cxx   |   19 -
 svtools/source/uno/unoimap.cxx |   65 ++
 svx/source/svdraw/svdotxln.cxx |2 
 41 files changed, 330 insertions(+), 431 deletions(-)

New commits:
commit 8777c3482dd1baf6ab0d79adbb524c32d1e0e349
Author: Noel Grandin 
Date:   Fri Jan 20 15:09:18 2017 +0200

use rtl::Reference in SvUnoImageMap

instead of manual acquire/release

Change-Id: Ia17a1cca542ef0008fe32f2dbfcfce1ecd3161a2

diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index 691df2d..c8cf5248 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -513,7 +514,6 @@ class SvUnoImageMap : public WeakImplHelper< 
XIndexContainer, XServiceInfo, XUno
 public:
 explicit SvUnoImageMap( const SvEventDescription* pSupportedMacroItems );
 SvUnoImageMap( const ImageMap& rMap, const SvEventDescription* 
pSupportedMacroItems );
-virtual ~SvUnoImageMap() override;
 
 bool fillImageMap( ImageMap& rMap ) const;
 /// @throws IllegalArgumentException
@@ -544,7 +544,7 @@ public:
 private:
 OUString maName;
 
-std::list< SvUnoImageMapObject* > maObjectList;
+std::list< rtl::Reference > maObjectList;
 };
 
 UNO3_GETIMPLEMENTATION_IMPL( SvUnoImageMap );
@@ -561,19 +561,8 @@ SvUnoImageMap::SvUnoImageMap( const ImageMap& rMap, const 
SvEventDescription* pS
 for( std::size_t nPos = 0; nPos < nCount; nPos++ )
 {
 IMapObject* pMapObject = rMap.GetIMapObject( nPos );
-SvUnoImageMapObject* pUnoObj = new SvUnoImageMapObject( *pMapObject, 
pSupportedMacroItems );
-pUnoObj->acquire();
-maObjectList.push_back( pUnoObj );
-}
-}
-
-SvUnoImageMap::~SvUnoImageMap()
-{
-std::list< SvUnoImageMapObject* >::iterator aIter = maObjectList.begin();
-const std::list< SvUnoImageMapObject* >::iterator aEnd = 
maObjectList.end();
-while( aIter != aEnd )
-{
-(*aIter++)->release();
+rtl::Reference xUnoObj = new SvUnoImageMapObject( 
*pMapObject, pSupportedMacroItems );
+maObjectList.push_back( xUnoObj );
 }
 }
 
@@ -591,24 +580,20 @@ SvUnoImageMapObject* SvUnoImageMap::getObject( const Any& 
aElement )
 }
 
 // XIndexContainer
-void SAL_CALL SvUnoImageMap::insertByIndex( sal_Int32 Index, const Any& 
Element )
+void SAL_CALL 

[Libreoffice-commits] online.git: Makefile.am wsd/ClientSession.cpp wsd/ClientSession.hpp wsd/DocumentBroker.cpp wsd/LOOLWSD.cpp wsd/PrisonerSession.cpp wsd/PrisonerSession.hpp

2017-01-22 Thread Ashod Nakashian
 Makefile.am |2 
 wsd/ClientSession.cpp   |1 
 wsd/ClientSession.hpp   |1 
 wsd/DocumentBroker.cpp  |1 
 wsd/LOOLWSD.cpp |1 
 wsd/PrisonerSession.cpp |  285 
 wsd/PrisonerSession.hpp |   47 ---
 7 files changed, 338 deletions(-)

New commits:
commit c789fe901ba86f9794eb255dfba210f5b3c87659
Author: Ashod Nakashian 
Date:   Sat Jan 21 21:41:05 2017 -0500

wsd: kill PrisonerSession

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

diff --git a/Makefile.am b/Makefile.am
index 79120bc..0ddcc7b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -52,7 +52,6 @@ loolwsd_SOURCES = wsd/Admin.cpp \
   wsd/LOOLWSD.cpp \
   wsd/ClientSession.cpp \
   wsd/FileServer.cpp \
-  wsd/PrisonerSession.cpp \
   wsd/Storage.cpp \
   wsd/TileCache.cpp \
   $(shared_sources)
@@ -100,7 +99,6 @@ wsd_headers = wsd/Admin.hpp \
   wsd/FileServer.hpp \
   wsd/LOOLWebSocket.hpp \
   wsd/LOOLWSD.hpp \
-  wsd/PrisonerSession.hpp \
   wsd/QueueHandler.hpp \
   wsd/SenderQueue.hpp \
   wsd/Storage.hpp \
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index d36705c..87bc072 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -18,7 +18,6 @@
 #include "DocumentBroker.hpp"
 #include "LOOLWSD.hpp"
 #include "Log.hpp"
-#include "PrisonerSession.hpp"
 #include "Protocol.hpp"
 #include "Session.hpp"
 #include "Util.hpp"
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index e53a414..96fd0f7 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -18,7 +18,6 @@
 #include 
 
 class DocumentBroker;
-class PrisonerSession;
 
 /// Represents a session to a LOOL client, in the WSD process.
 class ClientSession final : public Session, public 
std::enable_shared_from_this
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 38d13c1..fb19ca4 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -29,7 +29,6 @@
 #include "Protocol.hpp"
 #include "LOOLWSD.hpp"
 #include "Log.hpp"
-#include "PrisonerSession.hpp"
 #include "Storage.hpp"
 #include "TileCache.hpp"
 #include "SenderQueue.hpp"
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 10bc54d..72dc826 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -105,7 +105,6 @@
 #include "FileServer.hpp"
 #include "IoUtil.hpp"
 #include "Log.hpp"
-#include "PrisonerSession.hpp"
 #include "Protocol.hpp"
 #include "QueueHandler.hpp"
 #include "Session.hpp"
diff --git a/wsd/PrisonerSession.cpp b/wsd/PrisonerSession.cpp
deleted file mode 100644
index c4188d9..000
--- a/wsd/PrisonerSession.cpp
+++ /dev/null
@@ -1,285 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include "PrisonerSession.hpp"
-#include "config.h"
-
-#include 
-#include 
-
-#include "Common.hpp"
-#include "DocumentBroker.hpp"
-#include "Protocol.hpp"
-#include "Session.hpp"
-#include "LOOLWSD.hpp"
-#include "Log.hpp"
-#include "ClientSession.hpp"
-#include "Rectangle.hpp"
-#include "SenderQueue.hpp"
-#include "Storage.hpp"
-#include "TileCache.hpp"
-#include "IoUtil.hpp"
-#include "Util.hpp"
-
-using namespace LOOLProtocol;
-
-using Poco::Path;
-using Poco::StringTokenizer;
-
-PrisonerSession::PrisonerSession(ClientSession& clientSession,
- std::shared_ptr docBroker) :
-Session("ToPrisoner-" + clientSession.getId(), clientSession.getId(), 
nullptr),
-_docBroker(std::move(docBroker)),
-_peer(clientSession),
-_curPart(0),
-_gotStatus(false)
-{
-LOG_INF("PrisonerSession ctor [" << getName() << "].");
-}
-
-PrisonerSession::~PrisonerSession()
-{
-LOG_INF("~PrisonerSession dtor [" << getName() << "].");
-}
-
-bool PrisonerSession::_handleInput(const char *buffer, int 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);
-
-LOOLWSD::dumpOutgoingTrace(_docBroker->getJailId(), getId(), firstLine);
-
-if (tokens[0] == "unocommandresult:")
-{
-const std::string stringMsg(buffer, length);
-LOG_INF(getName() << ": Command: " << stringMsg);
-const auto index = 

[Libreoffice-commits] online.git: 2 commits - wsd/ClientSession.cpp wsd/ClientSession.hpp wsd/PrisonerSession.cpp

2017-01-22 Thread Ashod Nakashian
 wsd/ClientSession.cpp   |  244 +++-
 wsd/ClientSession.hpp   |   22 +++-
 wsd/PrisonerSession.cpp |7 -
 3 files changed, 257 insertions(+), 16 deletions(-)

New commits:
commit e584a514434e733fac1edc16a5d64842d5a61683
Author: Ashod Nakashian 
Date:   Sat Jan 21 21:38:11 2017 -0500

wsd: merge PrisonerSession into ClientSession

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

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 63ca129..d36705c 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -25,6 +25,7 @@
 
 using namespace LOOLProtocol;
 
+using Poco::Path;
 using Poco::StringTokenizer;
 
 ClientSession::ClientSession(const std::string& id,
@@ -43,7 +44,6 @@ ClientSession::ClientSession(const std::string& id,
 {
 LOG_INF("ClientSession ctor [" << getName() << "].");
 
-_peer = std::make_shared(*this, docBroker);
 _senderThread = std::thread([this]{ senderThread(); });
 }
 
@@ -60,7 +60,7 @@ ClientSession::~ClientSession()
 
 bool ClientSession::isLoaded() const
 {
-return _isLoadRequested && _peer && _peer->gotStatus();
+return _isLoadRequested && gotStatus();
 }
 
 bool ClientSession::_handleInput(const char *buffer, int length)
@@ -481,9 +481,245 @@ void ClientSession::senderThread()
 LOG_DBG(getName() << " SenderThread finished");
 }
 
-bool ClientSession::handleKitToClientMessage(const char* data, const int size)
+bool ClientSession::handleKitToClientMessage(const char* buffer, const int 
length)
 {
-return _peer->handleInput(data, size);
+LOG_TRC(getName() + ": handling [" << getAbbreviatedMessage(buffer, 
length) << "].");
+const std::string firstLine = getFirstLine(buffer, length);
+StringTokenizer tokens(firstLine, " ", StringTokenizer::TOK_IGNORE_EMPTY | 
StringTokenizer::TOK_TRIM);
+
+const auto docBroker = _docBroker.lock();
+if (!docBroker)
+{
+LOG_ERR("No DocBroker to handle kit-to-client message: " << firstLine);
+return false;
+}
+
+LOOLWSD::dumpOutgoingTrace(docBroker->getJailId(), getId(), firstLine);
+
+if (tokens[0] == "unocommandresult:")
+{
+const std::string stringMsg(buffer, length);
+LOG_INF(getName() << ": Command: " << stringMsg);
+const auto index = stringMsg.find_first_of('{');
+if (index != std::string::npos)
+{
+const std::string stringJSON = stringMsg.substr(index);
+Poco::JSON::Parser parser;
+const auto parsedJSON = parser.parse(stringJSON);
+const auto& object = parsedJSON.extract();
+if (object->get("commandName").toString() == ".uno:Save")
+{
+bool success = object->get("success").toString() == "true";
+std::string result;
+if (object->has("result"))
+{
+const auto parsedResultJSON = object->get("result");
+const auto& resultObj = 
parsedResultJSON.extract();
+if (resultObj->get("type").toString() == "string")
+result = resultObj->get("value").toString();
+}
+
+// Save to Storage and log result.
+docBroker->save(getId(), success, result);
+return true;
+}
+}
+else
+{
+LOG_WRN("Expected json unocommandresult. Ignoring: " << stringMsg);
+}
+}
+else if (tokens[0] == "error:")
+{
+std::string errorCommand;
+std::string errorKind;
+if (getTokenString(tokens[1], "cmd", errorCommand) &&
+getTokenString(tokens[2], "kind", errorKind) )
+{
+if (errorCommand == "load")
+{
+if (errorKind == "passwordrequired:to-view" ||
+errorKind == "passwordrequired:to-modify" ||
+errorKind == "wrongpassword")
+{
+const auto payload = std::make_shared(buffer, 
length,
+   
Message::Dir::Out,
+   
Message::Type::Text);
+forwardToClient(payload);
+LOG_WRN("Document load failed: " << errorKind);
+return false;
+}
+}
+}
+}
+else if (tokens[0] == "curpart:" && tokens.count() == 2)
+{
+//TODO: Should forward to client?
+int curPart;
+return getTokenInteger(tokens[1], "part", curPart);
+}
+else if (tokens.count() == 2 && tokens[0] == "saveas:")
+{
+std::string url;
+if (!getTokenString(tokens[1], "url", url))

[Libreoffice-commits] online.git: wsd/ClientSession.cpp wsd/ClientSession.hpp wsd/DocumentBroker.cpp wsd/PrisonerSession.cpp wsd/PrisonerSession.hpp

2017-01-22 Thread Ashod Nakashian
 wsd/ClientSession.cpp   |   21 ++---
 wsd/ClientSession.hpp   |7 +++
 wsd/DocumentBroker.cpp  |   13 +
 wsd/PrisonerSession.cpp |   31 ---
 wsd/PrisonerSession.hpp |   10 --
 5 files changed, 26 insertions(+), 56 deletions(-)

New commits:
commit 1f3d9ee457148fcc9eff3fbd3da66002010eb8bb
Author: Ashod Nakashian 
Date:   Sat Jan 21 20:31:22 2017 -0500

wsd: ClientSession now encapsulates PrisonerSession

No need to expose PrisonerSession via ClientSession
when the marshalling of messages can be done by
ClientSession directly.

PrisonerSession can now be removed altogether.

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

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 3bc76de..63ca129 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -43,6 +43,7 @@ ClientSession::ClientSession(const std::string& id,
 {
 LOG_INF("ClientSession ctor [" << getName() << "].");
 
+_peer = std::make_shared(*this, docBroker);
 _senderThread = std::thread([this]{ senderThread(); });
 }
 
@@ -62,21 +63,6 @@ bool ClientSession::isLoaded() const
 return _isLoadRequested && _peer && _peer->gotStatus();
 }
 
-void ClientSession::bridgePrisonerSession()
-{
-auto docBroker = getDocumentBroker();
-if (docBroker)
-{
-_peer = std::make_shared(shared_from_this(), 
docBroker);
-}
-else
-{
-const std::string msg = "No valid DocBroker while bridging Prisoner 
Session for " + getName();
-LOG_ERR(msg);
-throw std::runtime_error(msg);
-}
-}
-
 bool ClientSession::_handleInput(const char *buffer, int length)
 {
 LOG_TRC(getName() << ": handling [" << getAbbreviatedMessage(buffer, 
length) << "].");
@@ -495,4 +481,9 @@ void ClientSession::senderThread()
 LOG_DBG(getName() << " SenderThread finished");
 }
 
+bool ClientSession::handleKitToClientMessage(const char* data, const int size)
+{
+return _peer->handleInput(data, size);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index 5d97d70..b6211a7 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -37,16 +37,15 @@ public:
 
 bool isLoaded() const;
 
-/// Create and connect Prisoner Session between DocumentBroker and us.
-void bridgePrisonerSession();
-std::shared_ptr getPeer() const { return _peer; }
-
 const std::string getUserId() const { return _userId; }
 void setUserId(const std::string& userId) { _userId = userId; }
 void setUserName(const std::string& userName) { _userName = userName; }
 void setDocumentOwner(const bool documentOwner) { _isDocumentOwner = 
documentOwner; }
 bool isDocumentOwner() const { return _isDocumentOwner; }
 
+/// Handle kit-to-client message.
+bool handleKitToClientMessage(const char* data, const int size);
+
 using Session::sendTextFrame;
 
 bool sendBinaryFrame(const char* buffer, int length) override
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 1d699a2..38d13c1 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -651,9 +651,6 @@ size_t 
DocumentBroker::addSession(std::shared_ptr& session)
 const std::string aMessage = "session " + id + ' ' + _docKey;
 _childProcess->sendTextFrame(aMessage);
 
-// Now we are ready to bridge between the kit and client.
-session->bridgePrisonerSession();
-
 // Tell the admin console about this new doc
 Admin::instance().addDoc(_docKey, getPid(), getFilename(), id);
 
@@ -1032,15 +1029,7 @@ bool DocumentBroker::forwardToClient(const std::string& 
prefix, const std::vecto
 const auto it = _sessions.find(sid);
 if (it != _sessions.end())
 {
-const auto peer = it->second->getPeer();
-if (peer)
-{
-return peer->handleInput(data, size);
-}
-else
-{
-LOG_WRN("Client session [" << sid << "] has no peer to forward 
message: " << message);
-}
+return it->second->handleKitToClientMessage(data, size);
 }
 else
 {
diff --git a/wsd/PrisonerSession.cpp b/wsd/PrisonerSession.cpp
index d05a9a6..9a2b0cf 100644
--- a/wsd/PrisonerSession.cpp
+++ b/wsd/PrisonerSession.cpp
@@ -32,9 +32,9 @@ using namespace LOOLProtocol;
 using Poco::Path;
 using Poco::StringTokenizer;
 
-PrisonerSession::PrisonerSession(std::shared_ptr clientSession,
+PrisonerSession::PrisonerSession(ClientSession& clientSession,
  std::shared_ptr docBroker) :
-Session("ToPrisoner-" + clientSession->getId(), clientSession->getId(), 
nullptr),
+

[Libreoffice-commits] online.git: wsd/PrisonerSession.cpp wsd/PrisonerSession.hpp

2017-01-22 Thread Ashod Nakashian
 wsd/PrisonerSession.cpp |   32 +++-
 wsd/PrisonerSession.hpp |2 +-
 2 files changed, 20 insertions(+), 14 deletions(-)

New commits:
commit 8c34244285731fa7554479694aed0beaaca2ac6e
Author: Ashod Nakashian 
Date:   Sat Jan 21 20:13:09 2017 -0500

wsd: forwardToPeer now takes pre-constructed Message

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

diff --git a/wsd/PrisonerSession.cpp b/wsd/PrisonerSession.cpp
index 55db938..d05a9a6 100644
--- a/wsd/PrisonerSession.cpp
+++ b/wsd/PrisonerSession.cpp
@@ -108,7 +108,10 @@ bool PrisonerSession::_handleInput(const char *buffer, int 
length)
 errorKind == "passwordrequired:to-modify" ||
 errorKind == "wrongpassword")
 {
-forwardToPeer(peer, buffer, length, false);
+const auto payload = std::make_shared(buffer, 
length,
+   
Message::Dir::Out,
+   
Message::Type::Text);
+forwardToPeer(peer, payload);
 LOG_WRN("Document load failed: " << errorKind);
 return false;
 }
@@ -175,7 +178,10 @@ bool PrisonerSession::_handleInput(const char *buffer, int 
length)
 _docBroker->setLoaded();
 
 // Forward the status response to the client.
-return forwardToPeer(peer, buffer, length, false);
+const auto payload = std::make_shared(buffer, length,
+   Message::Dir::Out,
+   
Message::Type::Text);
+return forwardToPeer(peer, payload);
 }
 else if (tokens[0] == "commandvalues:")
 {
@@ -242,8 +248,10 @@ bool PrisonerSession::_handleInput(const char *buffer, int 
length)
 getTokenString(tokens[2], "char", text);
 assert(firstLine.size() < 
static_cast(length));
 _docBroker->tileCache().saveRendering(font+text, "font", buffer + 
firstLine.size() + 1, length - firstLine.size() - 1);
-forwardToPeer(peer, buffer, length, true);
-return true;
+const auto payload = std::make_shared(buffer, length,
+   Message::Dir::Out,
+   
Message::Type::Binary);
+return forwardToPeer(peer, payload);
 }
 }
 else
@@ -257,14 +265,17 @@ bool PrisonerSession::_handleInput(const char *buffer, 
int length)
 const bool isBinary = buffer[length - 1] != '}' && firstLine.find('{') == 
std::string::npos;
 
 // Forward everything else.
-forwardToPeer(peer, buffer, length, isBinary);
-return true;
+const auto payload = std::make_shared(buffer, length,
+   Message::Dir::Out,
+   isBinary ? 
Message::Type::Binary
+: 
Message::Type::Text);
+return forwardToPeer(peer, payload);
 }
 
 bool PrisonerSession::forwardToPeer(const std::shared_ptr& 
clientSession,
-const char* buffer, int length, const bool 
binary)
+const std::shared_ptr& payload)
 {
-const auto message = LOOLProtocol::getAbbreviatedMessage(buffer, length);
+const auto& message = payload->abbr();
 
 if (clientSession->isCloseFrame())
 {
@@ -280,11 +291,6 @@ bool PrisonerSession::forwardToPeer(const 
std::shared_ptr& client
 }
 
 LOG_TRC(getName() << " -> " << clientSession->getName() << ": " << 
message);
-
-auto payload = std::make_shared(buffer, length,
-Message::Dir::Out,
-binary ? 
Message::Type::Binary
-   : 
Message::Type::Text);
 clientSession->enqueueSendMessage(payload);
 
 return true;
diff --git a/wsd/PrisonerSession.hpp b/wsd/PrisonerSession.hpp
index 5a333a2..12d607c 100644
--- a/wsd/PrisonerSession.hpp
+++ b/wsd/PrisonerSession.hpp
@@ -35,7 +35,7 @@ private:
 virtual bool _handleInput(const char* buffer, int length) override;
 
 bool forwardToPeer(const std::shared_ptr& clientSession,
-   const char* buffer, int length, const bool binary);
+   const std::shared_ptr& payload);
 
 private:
 std::shared_ptr _docBroker;
___
Libreoffice-commits mailing list

[Libreoffice-commits] online.git: common/Message.hpp wsd/ClientSession.hpp

2017-01-22 Thread Ashod Nakashian
 common/Message.hpp|   12 +++-
 wsd/ClientSession.hpp |2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit bb4733b6d679a7170b530bd51a4a9536e8e22231
Author: Ashod Nakashian 
Date:   Sat Jan 21 20:12:17 2017 -0500

wsd: Message::abbrevation -> abbr

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

diff --git a/common/Message.hpp b/common/Message.hpp
index 0ca667a..cc7063e 100644
--- a/common/Message.hpp
+++ b/common/Message.hpp
@@ -33,7 +33,7 @@ public:
 _tokens(LOOLProtocol::tokenize(_data.data(), _data.size())),
 _id(makeId(dir)),
 _firstLine(LOOLProtocol::getFirstLine(_data.data(), _data.size())),
-_abbreviation(_id + ' ' + 
LOOLProtocol::getAbbreviatedMessage(_data.data(), _data.size())),
+_abbr(_id + ' ' + LOOLProtocol::getAbbreviatedMessage(_data.data(), 
_data.size())),
 _type(type)
 {
 }
@@ -49,7 +49,7 @@ public:
 _tokens(LOOLProtocol::tokenize(message)),
 _id(makeId(dir)),
 _firstLine(LOOLProtocol::getFirstLine(message)),
-_abbreviation(_id + ' ' + 
LOOLProtocol::getAbbreviatedMessage(message)),
+_abbr(_id + ' ' + LOOLProtocol::getAbbreviatedMessage(message)),
 _type(type)
 {
 _data.resize(message.size());
@@ -66,7 +66,7 @@ public:
 _tokens(LOOLProtocol::tokenize(_data.data(), _data.size())),
 _id(makeId(dir)),
 _firstLine(LOOLProtocol::getFirstLine(_data.data(), _data.size())),
-_abbreviation(_id + ' ' + 
LOOLProtocol::getAbbreviatedMessage(_data.data(), _data.size())),
+_abbr(_id + ' ' + LOOLProtocol::getAbbreviatedMessage(_data.data(), 
_data.size())),
 _type(type)
 {
 }
@@ -77,7 +77,9 @@ public:
 const std::vector& tokens() const { return _tokens; }
 const std::string& firstToken() const { return _tokens[0]; }
 const std::string& firstLine() const { return _firstLine; }
-const std::string& abbreviation() const { return _abbreviation; }
+
+/// Return the abbreviated message for logging purposes.
+const std::string& abbr() const { return _abbr; }
 const std::string& id() const { return _id; }
 
 /// Returns the json part of the message, if any.
@@ -117,7 +119,7 @@ private:
 const std::vector _tokens;
 const std::string _id;
 const std::string _firstLine;
-const std::string _abbreviation;
+const std::string _abbr;
 const Type _type;
 };
 
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index cd5c4dc..5d97d70 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -69,7 +69,7 @@ public:
 
 void enqueueSendMessage(const std::shared_ptr& data)
 {
-LOG_TRC(getName() << " enqueueing client message: " << 
data->abbreviation());
+LOG_TRC(getName() << " enqueueing client message: " << data->abbr());
 _senderQueue.enqueue(data);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: common/Message.hpp test/TileQueueTests.cpp wsd/ClientSession.cpp wsd/ClientSession.hpp wsd/DocumentBroker.cpp wsd/PrisonerSession.cpp wsd/SenderQueue.hpp wsd/TileCach

2017-01-22 Thread Ashod Nakashian
 common/Message.hpp  |   28 +++-
 test/TileQueueTests.cpp |   22 +++---
 wsd/ClientSession.cpp   |2 +-
 wsd/ClientSession.hpp   |   16 
 wsd/DocumentBroker.cpp  |2 +-
 wsd/PrisonerSession.cpp |8 
 wsd/SenderQueue.hpp |2 +-
 wsd/TileCache.cpp   |   12 ++--
 8 files changed, 47 insertions(+), 45 deletions(-)

New commits:
commit f1de0d0481ab6505e05e8705d36b49424876674c
Author: Ashod Nakashian 
Date:   Sat Jan 21 19:51:02 2017 -0500

wsd: MessagePayload -> Message

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

diff --git a/common/Message.hpp b/common/Message.hpp
index 42e8833..0ca667a 100644
--- a/common/Message.hpp
+++ b/common/Message.hpp
@@ -14,8 +14,10 @@
 #include 
 #include 
 
+#include "Protocol.hpp"
+
 /// The payload type used to send/receive data.
-class MessagePayload
+class Message
 {
 public:
 
@@ -24,9 +26,9 @@ public:
 
 /// Construct a text message.
 /// message must include the full first-line.
-MessagePayload(const std::string& message,
-   const enum Dir dir,
-   const enum Type type = Type::Text) :
+Message(const std::string& message,
+const enum Dir dir,
+const enum Type type = Type::Text) :
 _data(message.data(), message.data() + message.size()),
 _tokens(LOOLProtocol::tokenize(_data.data(), _data.size())),
 _id(makeId(dir)),
@@ -39,10 +41,10 @@ public:
 /// Construct a message from a string with type and
 /// reserve extra space (total, including message).
 /// message must include the full first-line.
-MessagePayload(const std::string& message,
-   const enum Dir dir,
-   const enum Type type,
-   const size_t reserve) :
+Message(const std::string& message,
+const enum Dir dir,
+const enum Type type,
+const size_t reserve) :
 _data(std::max(reserve, message.size())),
 _tokens(LOOLProtocol::tokenize(message)),
 _id(makeId(dir)),
@@ -55,11 +57,11 @@ public:
 }
 
 /// Construct a message from a character array with type.
-/// data must be include the full first-line.
-MessagePayload(const char* p,
-   const size_t len,
-   const enum Dir dir,
-   const enum Type type) :
+/// Note: p must include the full first-line.
+Message(const char* p,
+const size_t len,
+const enum Dir dir,
+const enum Type type) :
 _data(p, p + len),
 _tokens(LOOLProtocol::tokenize(_data.data(), _data.size())),
 _id(makeId(dir)),
diff --git a/test/TileQueueTests.cpp b/test/TileQueueTests.cpp
index 3c50e61..2c33c08 100644
--- a/test/TileQueueTests.cpp
+++ b/test/TileQueueTests.cpp
@@ -269,9 +269,9 @@ void TileQueueTests::testPreviewsDeprioritization()
 
 void TileQueueTests::testSenderQueue()
 {
-SenderQueue queue;
+SenderQueue queue;
 
-std::shared_ptr item;
+std::shared_ptr item;
 
 // Empty queue
 CPPUNIT_ASSERT_EQUAL(false, queue.waitDequeue(item, 10));
@@ -286,7 +286,7 @@ void TileQueueTests::testSenderQueue()
 
 for (const auto& msg : messages)
 {
-queue.enqueue(std::make_shared(msg, 
MessagePayload::Dir::Out));
+queue.enqueue(std::make_shared(msg, Message::Dir::Out));
 }
 
 CPPUNIT_ASSERT_EQUAL(3UL, queue.size());
@@ -308,9 +308,9 @@ void TileQueueTests::testSenderQueue()
 
 void TileQueueTests::testSenderQueueTileDeduplication()
 {
-SenderQueue queue;
+SenderQueue queue;
 
-std::shared_ptr item;
+std::shared_ptr item;
 
 // Empty queue
 CPPUNIT_ASSERT_EQUAL(false, queue.waitDequeue(item, 10));
@@ -325,7 +325,7 @@ void TileQueueTests::testSenderQueueTileDeduplication()
 
 for (const auto& msg : part_messages)
 {
-queue.enqueue(std::make_shared(msg, 
MessagePayload::Dir::Out));
+queue.enqueue(std::make_shared(msg, Message::Dir::Out));
 }
 
 CPPUNIT_ASSERT_EQUAL(3UL, queue.size());
@@ -344,7 +344,7 @@ void TileQueueTests::testSenderQueueTileDeduplication()
 
 for (const auto& msg : dup_messages)
 {
-queue.enqueue(std::make_shared(msg, 
MessagePayload::Dir::Out));
+queue.enqueue(std::make_shared(msg, Message::Dir::Out));
 }
 
 CPPUNIT_ASSERT_EQUAL(1UL, queue.size());
@@ -358,9 +358,9 @@ void TileQueueTests::testSenderQueueTileDeduplication()
 
 void TileQueueTests::testInvalidateViewCursorDeduplication()
 {
-SenderQueue queue;
+SenderQueue queue;
 
-std::shared_ptr item;
+std::shared_ptr item;
 
  

[Libreoffice-commits] online.git: common/Message.hpp common/Session.hpp test/TileQueueTests.cpp wsd/SenderQueue.hpp

2017-01-22 Thread Ashod Nakashian
 common/Message.hpp  |  124 
 common/Session.hpp  |1 
 test/TileQueueTests.cpp |1 
 wsd/SenderQueue.hpp |  105 
 4 files changed, 126 insertions(+), 105 deletions(-)

New commits:
commit 6b17f963182d534e11e64c10d4f14047aea0b4f5
Author: Ashod Nakashian 
Date:   Sat Jan 21 19:47:49 2017 -0500

wsd: refactor MessagePayload into own file

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

diff --git a/common/Message.hpp b/common/Message.hpp
new file mode 100644
index 000..42e8833
--- /dev/null
+++ b/common/Message.hpp
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_MESSAGE_HPP
+#define INCLUDED_MESSAGE_HPP
+
+#include 
+#include 
+#include 
+
+/// The payload type used to send/receive data.
+class MessagePayload
+{
+public:
+
+enum class Type { Text, JSON, Binary };
+enum class Dir { In, Out };
+
+/// Construct a text message.
+/// message must include the full first-line.
+MessagePayload(const std::string& message,
+   const enum Dir dir,
+   const enum Type type = Type::Text) :
+_data(message.data(), message.data() + message.size()),
+_tokens(LOOLProtocol::tokenize(_data.data(), _data.size())),
+_id(makeId(dir)),
+_firstLine(LOOLProtocol::getFirstLine(_data.data(), _data.size())),
+_abbreviation(_id + ' ' + 
LOOLProtocol::getAbbreviatedMessage(_data.data(), _data.size())),
+_type(type)
+{
+}
+
+/// Construct a message from a string with type and
+/// reserve extra space (total, including message).
+/// message must include the full first-line.
+MessagePayload(const std::string& message,
+   const enum Dir dir,
+   const enum Type type,
+   const size_t reserve) :
+_data(std::max(reserve, message.size())),
+_tokens(LOOLProtocol::tokenize(message)),
+_id(makeId(dir)),
+_firstLine(LOOLProtocol::getFirstLine(message)),
+_abbreviation(_id + ' ' + 
LOOLProtocol::getAbbreviatedMessage(message)),
+_type(type)
+{
+_data.resize(message.size());
+std::memcpy(_data.data(), message.data(), message.size());
+}
+
+/// Construct a message from a character array with type.
+/// data must be include the full first-line.
+MessagePayload(const char* p,
+   const size_t len,
+   const enum Dir dir,
+   const enum Type type) :
+_data(p, p + len),
+_tokens(LOOLProtocol::tokenize(_data.data(), _data.size())),
+_id(makeId(dir)),
+_firstLine(LOOLProtocol::getFirstLine(_data.data(), _data.size())),
+_abbreviation(_id + ' ' + 
LOOLProtocol::getAbbreviatedMessage(_data.data(), _data.size())),
+_type(type)
+{
+}
+
+size_t size() const { return _data.size(); }
+const std::vector& data() const { return _data; }
+
+const std::vector& tokens() const { return _tokens; }
+const std::string& firstToken() const { return _tokens[0]; }
+const std::string& firstLine() const { return _firstLine; }
+const std::string& abbreviation() const { return _abbreviation; }
+const std::string& id() const { return _id; }
+
+/// Returns the json part of the message, if any.
+std::string jsonString() const
+{
+if (_tokens.size() > 1 && _tokens[1] == "{")
+{
+const auto firstTokenSize = _tokens[0].size();
+return std::string(_data.data() + firstTokenSize, _data.size() - 
firstTokenSize);
+}
+
+return std::string();
+}
+
+/// Append more data to the message.
+void append(const char* p, const size_t len)
+{
+const auto curSize = _data.size();
+_data.resize(curSize + len);
+std::memcpy(_data.data() + curSize, p, len);
+}
+
+/// Returns true if and only if the payload is considered Binary.
+bool isBinary() const { return _type == Type::Binary; }
+
+private:
+
+/// Constructs a unique ID.
+static std::string makeId(const enum Dir dir)
+{
+static std::atomic Counter;
+return (dir == Dir::In ? 'i' : 'o') + std::to_string(++Counter);
+}
+
+private:
+std::vector _data;
+const std::vector _tokens;
+const std::string _id;
+const std::string _firstLine;
+

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

2017-01-22 Thread Ashod Nakashian
 wsd/DocumentBroker.cpp |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 11d7d8c595b719c2dd330c4459de2bec77b62cc9
Author: Ashod Nakashian 
Date:   Sun Jan 22 23:12:51 2017 -0500

wsd: log the fingerprint of WOPI files

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

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 9c3742e..d5fb25a 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -18,11 +18,14 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #include "Admin.hpp"
 #include "ClientSession.hpp"
 #include "Exceptions.hpp"
+#include "Message.hpp"
 #include "Protocol.hpp"
 #include "LOOLWSD.hpp"
 #include "Log.hpp"
@@ -345,6 +348,14 @@ bool DocumentBroker::load(std::shared_ptr& 
session, const std::st
 if (!_storage->isLoaded())
 {
 const auto localPath = _storage->loadStorageFileToLocal();
+
+std::ifstream istr(localPath, std::ios::binary);
+Poco::SHA1Engine sha1;
+Poco::DigestOutputStream dos(sha1);
+Poco::StreamCopier::copyStream(istr, dos);
+dos.close();
+LOG_INF("SHA1 of [" << localPath << "]: " << 
Poco::DigestEngine::digestToHex(sha1.digest()));
+
 _uriJailed = Poco::URI(Poco::URI("file://"), localPath);
 _filename = fileInfo._filename;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: test/TileQueueTests.cpp wsd/ClientSession.hpp wsd/DocumentBroker.cpp wsd/PrisonerSession.cpp wsd/SenderQueue.hpp wsd/TileCache.cpp

2017-01-22 Thread Ashod Nakashian
 test/TileQueueTests.cpp |   10 +-
 wsd/ClientSession.hpp   |8 ++--
 wsd/DocumentBroker.cpp  |2 +-
 wsd/PrisonerSession.cpp |1 +
 wsd/SenderQueue.hpp |   24 +---
 wsd/TileCache.cpp   |2 ++
 6 files changed, 36 insertions(+), 11 deletions(-)

New commits:
commit 16eb1968206811a214e6f8e045313c0ec5f667cf
Author: Ashod Nakashian 
Date:   Sat Jan 21 16:14:36 2017 -0500

wsd: each Message object now has a unique ID for logging purposes

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

diff --git a/test/TileQueueTests.cpp b/test/TileQueueTests.cpp
index 747686c..8149d1c 100644
--- a/test/TileQueueTests.cpp
+++ b/test/TileQueueTests.cpp
@@ -285,7 +285,7 @@ void TileQueueTests::testSenderQueue()
 
 for (const auto& msg : messages)
 {
-queue.enqueue(std::make_shared(msg));
+queue.enqueue(std::make_shared(msg, 
MessagePayload::Dir::Out));
 }
 
 CPPUNIT_ASSERT_EQUAL(3UL, queue.size());
@@ -324,7 +324,7 @@ void TileQueueTests::testSenderQueueTileDeduplication()
 
 for (const auto& msg : part_messages)
 {
-queue.enqueue(std::make_shared(msg));
+queue.enqueue(std::make_shared(msg, 
MessagePayload::Dir::Out));
 }
 
 CPPUNIT_ASSERT_EQUAL(3UL, queue.size());
@@ -343,7 +343,7 @@ void TileQueueTests::testSenderQueueTileDeduplication()
 
 for (const auto& msg : dup_messages)
 {
-queue.enqueue(std::make_shared(msg));
+queue.enqueue(std::make_shared(msg, 
MessagePayload::Dir::Out));
 }
 
 CPPUNIT_ASSERT_EQUAL(1UL, queue.size());
@@ -374,7 +374,7 @@ void TileQueueTests::testInvalidateViewCursorDeduplication()
 
 for (const auto& msg : view_messages)
 {
-queue.enqueue(std::make_shared(msg));
+queue.enqueue(std::make_shared(msg, 
MessagePayload::Dir::Out));
 }
 
 CPPUNIT_ASSERT_EQUAL(3UL, queue.size());
@@ -402,7 +402,7 @@ void TileQueueTests::testInvalidateViewCursorDeduplication()
 
 for (const auto& msg : dup_messages)
 {
-queue.enqueue(std::make_shared(msg));
+queue.enqueue(std::make_shared(msg, 
MessagePayload::Dir::Out));
 }
 
 CPPUNIT_ASSERT_EQUAL(1UL, queue.size());
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index 57345bb..17904be 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -51,14 +51,18 @@ public:
 
 bool sendBinaryFrame(const char* buffer, int length) override
 {
-auto payload = std::make_shared(buffer, length, 
MessagePayload::Type::Binary);
+auto payload = std::make_shared(buffer, length,
+
MessagePayload::Dir::Out,
+
MessagePayload::Type::Binary);
 enqueueSendMessage(payload);
 return true;
 }
 
 bool sendTextFrame(const char* buffer, const int length) override
 {
-auto payload = std::make_shared(buffer, length, 
MessagePayload::Type::Text);
+auto payload = std::make_shared(buffer, length,
+
MessagePayload::Dir::Out,
+
MessagePayload::Type::Text);
 enqueueSendMessage(payload);
 return true;
 }
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index e532fb5..0b049a5 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -693,7 +693,7 @@ void DocumentBroker::alertAllUsers(const std::string& msg)
 {
 Util::assertIsLocked(_mutex);
 
-auto payload = std::make_shared(msg);
+auto payload = std::make_shared(msg, 
MessagePayload::Dir::Out);
 
 LOG_DBG("Alerting all users of [" << _docKey << "]: " << msg);
 for (auto& it : _sessions)
diff --git a/wsd/PrisonerSession.cpp b/wsd/PrisonerSession.cpp
index 16cb760..2a78950 100644
--- a/wsd/PrisonerSession.cpp
+++ b/wsd/PrisonerSession.cpp
@@ -282,6 +282,7 @@ bool PrisonerSession::forwardToPeer(const 
std::shared_ptr& client
 LOG_TRC(getName() << " -> " << clientSession->getName() << ": " << 
message);
 
 auto payload = std::make_shared(buffer, length,
+MessagePayload::Dir::Out,
 binary ? 
MessagePayload::Type::Binary
: 
MessagePayload::Type::Text);
 clientSession->enqueueSendMessage(payload);
diff --git a/wsd/SenderQueue.hpp b/wsd/SenderQueue.hpp
index 900dd94..c8e87a1 100644
--- a/wsd/SenderQueue.hpp
+++ b/wsd/SenderQueue.hpp
@@ -32,15 +32,18 @@ class MessagePayload
 public:
 
 enum class Type { Text, JSON, Binary };
+enum class Dir { In, Out };
 
 /// Construct a text message.
 /// 

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

2017-01-22 Thread Ashod Nakashian
 wsd/DocumentBroker.cpp |   37 +
 1 file changed, 21 insertions(+), 16 deletions(-)

New commits:
commit cb052c98c797920ecc44327a4d23312528a5a539
Author: Ashod Nakashian 
Date:   Sat Jan 21 22:43:12 2017 -0500

wsd: DocumentBroker cleanup

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

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 0b049a5..9c3742e 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -124,8 +124,8 @@ Poco::URI DocumentBroker::sanitizeURI(const std::string& 
uri)
 param.second = decodedToken;
 }
 }
-uriPublic.setQueryParameters(queryParams);
 
+uriPublic.setQueryParameters(queryParams);
 return uriPublic;
 }
 
@@ -229,9 +229,8 @@ bool DocumentBroker::load(std::shared_ptr& 
session, const std::st
 bool firstInstance = false;
 if (_storage == nullptr)
 {
-// 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.)
+// Pass the public URI to storage as it needs to load using the token
+// and other storage-specific data provided in the URI.
 LOG_DBG("Creating new storage instance for URI [" << 
uriPublic.toString() << "].");
 _storage = StorageBase::create(uriPublic, jailRoot, 
jailPath.toString());
 if (_storage == nullptr)
@@ -248,9 +247,11 @@ bool DocumentBroker::load(std::shared_ptr& 
session, const std::st
 // Call the storage specific fileinfo functions
 std::string userid, username;
 std::chrono::duration getInfoCallDuration(0);
-if (dynamic_cast(_storage.get()) != nullptr)
+WopiStorage* wopiStorage = dynamic_cast(_storage.get());
+if (wopiStorage != nullptr)
 {
-std::unique_ptr wopifileinfo = 
static_cast(_storage.get())->getWOPIFileInfo(uriPublic);
+std::unique_ptr wopifileinfo =
+ wopiStorage->getWOPIFileInfo(uriPublic);
 userid = wopifileinfo->_userid;
 username = wopifileinfo->_username;
 
@@ -296,11 +297,16 @@ bool DocumentBroker::load(std::shared_ptr& 
session, const std::st
 // Pass the ownership to client session
 session->setWopiFileInfo(wopifileinfo);
 }
-else if (dynamic_cast(_storage.get()) != nullptr)
+else
 {
-std::unique_ptr localfileinfo = 
static_cast(_storage.get())->getLocalFileInfo(uriPublic);
-userid = localfileinfo->_userid;
-username = localfileinfo->_username;
+LocalStorage* localStorage = 
dynamic_cast(_storage.get());
+if (localStorage != nullptr)
+{
+std::unique_ptr localfileinfo =
+  
localStorage->getLocalFileInfo(uriPublic);
+userid = localfileinfo->_userid;
+username = localfileinfo->_username;
+}
 }
 
 LOG_DBG("Setting username [" << username << "] and userId [" << userid << 
"] for session [" << sessionId << "]");
@@ -335,9 +341,8 @@ bool DocumentBroker::load(std::shared_ptr& 
session, const std::st
 }
 }
 
-// Lets load the document now
-const bool loaded = _storage->isLoaded();
-if (!loaded)
+// Let's load the document now, if not loaded.
+if (!_storage->isLoaded())
 {
 const auto localPath = _storage->loadStorageFileToLocal();
 _uriJailed = Poco::URI(Poco::URI("file://"), localPath);
@@ -345,14 +350,14 @@ bool DocumentBroker::load(std::shared_ptr& 
session, const std::st
 
 // Use the local temp file's timestamp.
 _lastFileModifiedTime = 
Poco::File(_storage->getLocalRootPath()).getLastModified();
-_tileCache.reset(new TileCache(_uriPublic.toString(), 
_lastFileModifiedTime, _cacheRoot));
+_tileCache.reset(new TileCache(uriPublic.toString(), 
_lastFileModifiedTime, _cacheRoot));
 }
 
 // Since document has been loaded, send the stats if its WOPI
-if (dynamic_cast(_storage.get()) != nullptr)
+if (wopiStorage != nullptr)
 {
 // Get the time taken to load the file from storage
-auto callDuration = 
static_cast(_storage.get())->getWopiLoadDuration();
+auto callDuration = wopiStorage->getWopiLoadDuration();
 // Add the time taken to check file info
 callDuration += getInfoCallDuration;
 const std::string msg = "stats: wopiloadduration " + 
std::to_string(callDuration.count());
___
Libreoffice-commits mailing list

[Libreoffice-commits] online.git: test/helpers.hpp test/httpwstest.cpp

2017-01-22 Thread Ashod Nakashian
 test/helpers.hpp|2 +-
 test/httpwstest.cpp |   19 ++-
 2 files changed, 15 insertions(+), 6 deletions(-)

New commits:
commit 0f73bd9bf2afba5f6a24aa5d0127be553ee55c02
Author: Ashod Nakashian 
Date:   Fri Jan 20 16:34:44 2017 -0500

wsd: improved testConnectNoLoad

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

diff --git a/test/helpers.hpp b/test/helpers.hpp
index 4dd8f86..cc8205e 100644
--- a/test/helpers.hpp
+++ b/test/helpers.hpp
@@ -176,7 +176,7 @@ int getErrorCode(LOOLWebSocket& ws, std::string& message, 
const std::string& tes
 bytes = ws.receiveFrame(buffer.begin(), READ_BUFFER_SIZE, flags);
 std::cerr << testname << "Got " << 
LOOLProtocol::getAbbreviatedFrameDump(buffer.begin(), bytes, flags) << 
std::endl;
 }
-while (bytes > 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != 
Poco::Net::WebSocket::FRAME_OP_CLOSE);
+while (bytes != 0 && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != 
Poco::Net::WebSocket::FRAME_OP_CLOSE);
 
 if (bytes > 0)
 {
diff --git a/test/httpwstest.cpp b/test/httpwstest.cpp
index 32635d1..ff48454 100644
--- a/test/httpwstest.cpp
+++ b/test/httpwstest.cpp
@@ -360,26 +360,35 @@ void HTTPWSTest::loadDoc(const std::string& documentURL, 
const std::string& test
 
 void HTTPWSTest::testConnectNoLoad()
 {
+const auto testname1 = "connectNoLoad-1 ";
+const auto testname2 = "connectNoLoad-2 ";
+const auto testname3 = "connectNoLoad-3 ";
+
 std::string documentPath, documentURL;
 getDocumentPathAndURL("hello.odt", documentPath, documentURL);
 
 Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, 
documentURL);
-auto socket = connectLOKit(_uri, request, _response);
+std::cerr << testname1 << "Connecting." << std::endl;
+auto socket = connectLOKit(_uri, request, _response, testname1);
 CPPUNIT_ASSERT_MESSAGE("Failed to connect.", socket);
+std::cerr << testname1 << "Disconnecting." << std::endl;
 socket.reset();
 
 // Connect and load first view.
-auto socket1 = connectLOKit(_uri, request, _response);
+std::cerr << testname2 << "Connecting." << std::endl;
+auto socket1 = connectLOKit(_uri, request, _response, testname2);
 CPPUNIT_ASSERT_MESSAGE("Failed to connect.", socket1);
-sendTextFrame(socket1, "load url=" + documentURL);
+sendTextFrame(socket1, "load url=" + documentURL, testname2);
 CPPUNIT_ASSERT_MESSAGE("cannot load the document " + documentURL, 
isDocumentLoaded(socket1));
 
 // Connect but don't load second view.
-auto socket2 = connectLOKit(_uri, request, _response);
+std::cerr << testname3 << "Connecting." << std::endl;
+auto socket2 = connectLOKit(_uri, request, _response, testname3);
 CPPUNIT_ASSERT_MESSAGE("Failed to connect.", socket2);
+std::cerr << testname3 << "Disconnecting." << std::endl;
 socket2.reset();
 
-sendTextFrame(socket1, "status");
+sendTextFrame(socket1, "status", testname2);
 assertResponseString(socket1, "status:");
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: wsd/LOOLWebSocket.hpp wsd/LOOLWSD.cpp

2017-01-22 Thread Ashod Nakashian
 wsd/LOOLWSD.cpp   |1 +
 wsd/LOOLWebSocket.hpp |   10 ++
 2 files changed, 11 insertions(+)

New commits:
commit b497fcfac54d10ca67c0906f59a6b69f0940310e
Author: Ashod Nakashian 
Date:   Fri Jan 20 16:34:10 2017 -0500

wsd: close the socket when shutting down fails

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

diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index f41cb70..10bc54d 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -194,6 +194,7 @@ namespace
 inline void shutdownLimitReached(LOOLWebSocket& ws)
 {
 const std::string error = Poco::format(PAYLOAD_UNAVAILABLE_LIMIT_REACHED, 
MAX_DOCUMENTS, MAX_CONNECTIONS);
+LOG_INF("Sending client limit-reached message: " << error);
 
 /* loleaflet sends loolclient, load and partrectangles message immediately
after web socket handshake, so closing web socket fails loading page in
diff --git a/wsd/LOOLWebSocket.hpp b/wsd/LOOLWebSocket.hpp
index dc2c805..b1acd35 100644
--- a/wsd/LOOLWebSocket.hpp
+++ b/wsd/LOOLWebSocket.hpp
@@ -223,6 +223,16 @@ public:
 {
 LOG_WRN("LOOLWebSocket::shutdown: Exception: " << 
exc.displayText() <<
 (exc.nested() ? " (" + exc.nested()->displayText() + ")" : 
""));
+
+// Just close it.
+try
+{
+Poco::Net::WebSocket::close();
+}
+catch (const std::exception&)
+{
+// Nothing we can do.
+}
 }
 }
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: kit/Kit.cpp

2017-01-22 Thread Ashod Nakashian
 kit/Kit.cpp |   47 ---
 1 file changed, 40 insertions(+), 7 deletions(-)

New commits:
commit 0fe580d9ab3abe198e3143d30c83f1cffb589832
Author: Ashod Nakashian 
Date:   Fri Jan 20 00:14:29 2017 -0500

wsd: cap batches by duration

Batched loKit calls are now capped by time
to limit the maximum latency.

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

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index dbe25a1..3f14c19 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1379,22 +1379,50 @@ private:
 
 LOG_DBG("Thread started.");
 
+static const unsigned MaxBatchDurationMs = 125;
 size_t batched = 0;
+std::chrono::steady_clock::time_point timeBeginBatch;
 try
 {
 while (!_stop && !TerminationFlag)
 {
-// End if we have no more.
+unsigned timeoutMs = 0;
 if (batched)
 {
-LOG_TRC("Ending batch of " << batched << " messages.");
-std::unique_lock lock(_documentMutex);
-batched = 0;
-getLOKitDocument()->endBatch();
+// Cap the wait so we eventually process the batch.
+const auto duration = std::chrono::steady_clock::now() - 
timeBeginBatch;
+const auto durationMs = 
std::chrono::duration_cast(duration).count();
+if (durationMs >= MaxBatchDurationMs)
+{
+LOG_TRC("Ending batch of " << batched << " messages.");
+std::unique_lock lock(_documentMutex);
+batched = 0;
+getLOKitDocument()->endBatch();
+timeoutMs = 0;
+}
+else
+{
+timeoutMs = MaxBatchDurationMs - durationMs;
+}
 }
 
-const TileQueue::Payload input = _tileQueue->get();
-LOG_TRC("Kit Recv " << 
LOOLProtocol::getAbbreviatedMessage(input));
+LOG_TRC("Kit dequeue with max timeout of " << timeoutMs << " 
ms. Batched: " << batched);
+const TileQueue::Payload input = _tileQueue->get(timeoutMs);
+LOG_TRC("Kit dequeued " << 
LOOLProtocol::getAbbreviatedMessage(input));
+if (input.empty())
+{
+// End if we have no more.
+if (batched)
+{
+LOG_TRC("Ending batch of " << batched << " messages.");
+std::unique_lock lock(_documentMutex);
+batched = 0;
+getLOKitDocument()->endBatch();
+}
+
+// Nothing to process.
+continue;
+}
 
 if (_stop || TerminationFlag)
 {
@@ -1430,6 +1458,11 @@ private:
 else if (LOOLProtocol::getFirstToken(tokens[0], '-') == 
"child")
 {
 batched = forwardToChild(tokens[0], input, batched);
+if (batched == 1)
+{
+// New batch started.
+timeBeginBatch = std::chrono::steady_clock::now();
+}
 }
 else if (tokens[0] == "callback")
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Zohar Tal license statement

2017-01-22 Thread Zohar Tal
All of my past & future contributions to LibreOffice may be licensed under
the MPLv2/LGPLv3+ dual license.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] online.git: common/Protocol.hpp kit/Kit.cpp

2017-01-22 Thread Ashod Nakashian
 common/Protocol.hpp |2 -
 kit/Kit.cpp |   61 +++-
 2 files changed, 57 insertions(+), 6 deletions(-)

New commits:
commit 27e1428088905e0a48b59038f52f3469c1a8da6e
Author: Ashod Nakashian 
Date:   Thu Jan 19 23:25:51 2017 -0500

wsd: batched user-input processing

User input is batched together to reduce
overheads. This initial implementation
will batch all input of the same type
together.

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

diff --git a/common/Protocol.hpp b/common/Protocol.hpp
index c075339..8188ca0 100644
--- a/common/Protocol.hpp
+++ b/common/Protocol.hpp
@@ -156,7 +156,7 @@ namespace LOOLProtocol
 
 /// Returns the first token of a message.
 inline
-std::string getFirstToken(const char *message, const int length, const 
char delim)
+std::string getFirstToken(const char *message, const int length, const 
char delim = ' ')
 {
 return getDelimitedInitialSubstring(message, length, delim);
 }
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 4d862de..dbe25a1 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1239,7 +1239,7 @@ private:
 return _loKitDocument;
 }
 
-bool forwardToChild(const std::string& prefix, const std::vector& 
payload)
+size_t forwardToChild(const std::string& prefix, const std::vector& 
payload, size_t batched)
 {
 assert(payload.size() > prefix.size());
 
@@ -1281,14 +1281,46 @@ private:
 // No longer needed, and allow session dtor to take it.
 lock.unlock();
 session.reset();
-return true;
+return batched;
 }
 
 // No longer needed, and allow the handler to take it.
 lock.unlock();
 if (session)
 {
-return session->handleInput(data, size);
+static std::string last;
+
+const auto current = LOOLProtocol::getFirstToken(data, 
size);
+if (batched)
+{
+if (current != last)
+{
+LOG_TRC("Ending batch of " << batched << " 
messages.");
+std::unique_lock 
lockDocument(_documentMutex);
+batched = 0;
+getLOKitDocument()->endBatch();
+}
+}
+
+if (!batched)
+{
+std::unique_lock 
lockDocument(_documentMutex);
+if (_loKitDocument)
+{
+++batched;
+last = current;
+LOG_TRC("Beginning batch [" << last<< "].");
+getLOKitDocument()->beginBatch();
+}
+}
+else
+{
+++batched;
+LOG_TRC("Processing batch item #" << batched << " [" 
<< current << "].");
+}
+
+session->handleInput(data, size);
+return batched;
 }
 }
 
@@ -1300,7 +1332,7 @@ private:
 LOG_ERR("Failed to parse prefix of forward-to-child message: " << 
prefix);
 }
 
-return false;
+return batched;
 }
 
 std::string makeRenderParams(const std::string& userName)
@@ -1347,10 +1379,20 @@ private:
 
 LOG_DBG("Thread started.");
 
+size_t batched = 0;
 try
 {
 while (!_stop && !TerminationFlag)
 {
+// End if we have no more.
+if (batched)
+{
+LOG_TRC("Ending batch of " << batched << " messages.");
+std::unique_lock lock(_documentMutex);
+batched = 0;
+getLOKitDocument()->endBatch();
+}
+
 const TileQueue::Payload input = _tileQueue->get();
 LOG_TRC("Kit Recv " << 
LOOLProtocol::getAbbreviatedMessage(input));
 
@@ -1368,6 +1410,15 @@ private:
 break;
 }
 
+// Stop batching if not a child message.
+if (batched && tokens[0].compare(0, 5, "child"))
+{
+LOG_TRC("Ending batch of " << batched << " messages.");
+std::unique_lock lock(_documentMutex);
+batched = 0;
+getLOKitDocument()->endBatch();
+}
+
 if (tokens[0] == "tile")
   

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

2017-01-22 Thread Ashod Nakashian
 desktop/qa/desktop_lib/test_desktop_lib.cxx |   45 
 1 file changed, 45 insertions(+)

New commits:
commit f6c0e851eff8c22c0ab427245c5eb78e9f396b62
Author: Ashod Nakashian 
Date:   Fri Jan 20 19:11:47 2017 -0500

Lok: unittest batch API

Change-Id: I33bc59756f46b51a69efd91b89813ba17eca6218
Reviewed-on: https://gerrit.libreoffice.org/33403
Tested-by: Jenkins 
Reviewed-by: Ashod Nakashian 

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 59bf620..666deb4 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -95,6 +95,7 @@ public:
 void testContextMenuImpress();
 void testNotificationCompression();
 void testTileInvalidationCompression();
+void testBatching();
 void testPartInInvalidation();
 void testRedlineWriter();
 void testTrackChanges();
@@ -129,6 +130,7 @@ public:
 CPPUNIT_TEST(testContextMenuImpress);
 CPPUNIT_TEST(testNotificationCompression);
 CPPUNIT_TEST(testTileInvalidationCompression);
+CPPUNIT_TEST(testBatching);
 CPPUNIT_TEST(testPartInInvalidation);
 CPPUNIT_TEST(testRedlineWriter);
 CPPUNIT_TEST(testTrackChanges);
@@ -1580,6 +1582,49 @@ void DesktopLOKTest::testPartInInvalidation()
 }
 }
 
+void DesktopLOKTest::testBatching()
+{
+LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
+
+comphelper::LibreOfficeKit::setPartInInvalidation(true);
+comphelper::ScopeGuard aGuard([]()
+{
+comphelper::LibreOfficeKit::setPartInInvalidation(false);
+});
+
+std::vector> notifs;
+std::unique_ptr handler(new 
CallbackFlushHandler(pDocument, callbackCompressionTest, ));
+
+// Enable Batch mode.
+handler->setEventLatch(true);
+
+handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, 239, 239, 0");
+handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "EMPTY, 0");
+
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT_EQUAL(static_cast(0), notifs.size());
+
+handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, 239, 240, 0");
+handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "-121, -121, 300, 300, 0");
+handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, -32767, -32767, 0");
+
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT_EQUAL(static_cast(0), notifs.size());
+
+// Disable Batch mode.
+handler->setEventLatch(false);
+
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT_EQUAL(static_cast(1), notifs.size());
+
+size_t i = 0;
+CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_INVALIDATE_TILES, 
(int)std::get<0>(notifs[i]));
+CPPUNIT_ASSERT_EQUAL(std::string("0, 0, 10, 10, 0"), 
std::get<1>(notifs[i++]));
+}
+
 void DesktopLOKTest::testRedlineWriter()
 {
 // Load a Writer document, enable change recording and press a key.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-bugs] [Bug 105482] When opening a table, the table record selector is not initially visible always

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105482

--- Comment #5 from frofa  ---
This annoying bug has been present for nearly 1 year, and has been bibisected,
but no one seems to be interested in fixing it (sadly).

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 97731] Record summary footer is not visible when table listing is first opened

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=97731

frofa  changed:

   What|Removed |Added

 CC||BridgeportContractor@gmail.
   ||com

--- Comment #31 from frofa  ---
*** Bug 105482 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 105482] When opening a table, the table record selector is not initially visible always

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105482

frofa  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #4 from frofa  ---


*** This bug has been marked as a duplicate of bug 97731 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 105471] FILESAVE: cannot save writer document

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105471

--- Comment #4 from Elmar  ---
Created attachment 130624
  --> https://bugs.documentfoundation.org/attachment.cgi?id=130624=edit
the example saved by lo v5.2.5

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 105471] FILESAVE: cannot save writer document

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105471

--- Comment #3 from Elmar  ---
Created attachment 130623
  --> https://bugs.documentfoundation.org/attachment.cgi?id=130623=edit
example in ms word 2010 format

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 105471] FILESAVE: cannot save writer document

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105471

Elmar  changed:

   What|Removed |Added

 Status|NEEDINFO|UNCONFIRMED
 Ever confirmed|1   |0

--- Comment #2 from Elmar  ---
Please help me: how do I attach an example if I cannot save the file?

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 104520] [META] DOCX (OOXML) bug tracker

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=104520
Bug 104520 depends on bug 104061, which changed state.

Bug 104061 Summary: FILESAVE: columns saved in different pages after RT
https://bugs.documentfoundation.org/show_bug.cgi?id=104061

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 104734] FIREBIRD: Add those field types that are not available with FB while they are available with Hsqldb

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=104734

--- Comment #3 from Drew Jensen  ---
Using 5.4 Alpha0 downloaded yesterday under Linux

With embedded Firebird, using the GUI table designer the following dataypes are
_not_ available:
 Image, Binary, Binary fix, Memo, OTHER

A new datatype is available:
 BLOB 



I wasn't sure if those were expected in this build, I kind of thought not
reading a couple of comments but thought I'd mention it.

For the other data types I was able to for create a table using all of them,
with default scaling information where applicable.

In a few cases the display of column information in the table editor was not
what I expected when the table design was opened for editing.
i.e.

FLOAT creating the column UI defaults to Length 7, Decimal places 1; open for
editing design displays Length 0, Decimal places 1, which seems to be a display
issue, not a change to the column in the database.

DOUBLE creating the column UI defaults to Length 10, Decimal places 1; open for
editing design displays Length 0, Decimal places 1, which seems to be a display
issue, not a change to the column in the database.

DECIMAL creating the column UI defaults to Length 15, Decimal places 1; but is
displayed later as Length 8, Decimal places 1. Here the column in the table was
created as scale (8,1) apparently.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


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

2017-01-22 Thread Justin Luth
 sw/qa/extras/ooxmlexport/data/tdf104061_tableSectionColumns.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx|5 +
 sw/source/filter/ww8/wrtw8nds.cxx|6 ++
 3 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 0c3f61fb616ce73d1e651013c455410b987d3e12
Author: Justin Luth 
Date:   Tue Jan 10 12:04:00 2017 +0300

tdf#104061 MSWordExportBase: tables shouldn't prevent sectionbreak

This also reverts temporary commit ba2c31da9723182d2087e27a1ea0f95d9617f343
which was done to look for more pro or con proof documents.  None found.

This section of code has been essentially unmodified since the initial
import in 2000, so apparently the necessity for preventing the processing
of a section if the table item contains pageBreak info is no longer valid.

My guess is that tables were excluded to fudge round-tripping better. Recent
use of dummy paragraphs during import fixes many import problems, and thus
export of the section node no longer should be avoided.

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

diff --git a/sw/qa/extras/ooxmlexport/data/tdf104061_tableSectionColumns.docx 
b/sw/qa/extras/ooxmlexport/data/tdf104061_tableSectionColumns.docx
new file mode 100755
index 000..b5d2a4f
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf104061_tableSectionColumns.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 89bc9d9..d7cbdf7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -67,6 +67,11 @@ DECLARE_OOXMLEXPORT_TEST(testTdf41542_borderlessPadding, 
"tdf41542_borderlessPad
 CPPUNIT_ASSERT_EQUAL( 3, getPages() );
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf104061_tableSectionColumns,"tdf104061_tableSectionColumns.docx")
+{
+CPPUNIT_ASSERT_MESSAGE("There should be two or three pages", getPages() <= 
3 );
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf46940_dontEquallyDistributeColumns, 
"tdf46940_dontEquallyDistributeColumns.docx")
 {
 uno::Reference 
xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index f12d5c7..e4d4a24 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2885,9 +2885,7 @@ void MSWordExportBase::OutputSectionNode( const 
SwSectionNode& rSectionNode )
 // here the section break
 sal_uLong nRstLnNum = 0;
 const SfxItemSet* pSet;
-if ( rNd.IsTableNode() )
-pSet = 
()->GetTable().GetFrameFormat()->GetAttrSet();
-else if ( rNd.IsContentNode() )
+if ( rNd.IsContentNode() )
 {
 pSet = ()->GetSwAttrSet();
 nRstLnNum = static_cast(pSet->Get(
@@ -2899,7 +2897,7 @@ void MSWordExportBase::OutputSectionNode( const 
SwSectionNode& rSectionNode )
 if ( pSet && NoPageBreakSection( pSet ) )
 pSet = nullptr;
 
-if ( !pSet || rNd.IsTableNode() )
+if ( !pSet )
 {
 // new Section with no own PageDesc/-Break
 //  -> write follow section break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sw/qa writerfilter/source

2017-01-22 Thread Justin Luth
 sw/qa/extras/ooxmlimport/data/tdf48658_transparentOLEheader.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx |7 +++
 writerfilter/source/dmapper/OLEHandler.cxx   |8 
+++-
 3 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 9f0b05a64733fcaac39127db5e5f2fa3ad80a1b9
Author: Justin Luth 
Date:   Mon Jan 16 09:44:32 2017 +0300

tdf#48658 writerfilter: only set THROUGH wraps as transparent

commit 15c3a08b8b1e8060f9659c7bc98480a39d1802c5 set transparency
before the wrap type was known (which is good in case wrap type is
never defined, and the default wrap type IS through, so that fits)
but transparency was never re-evaluated once the wrap type was known.

In MSWord, the header is at a lower zOrder than the body,
so objects that are OVER the header text are still UNDER
the body text. Writer emulates this by insisting that ALL
through-wrapped header objects are UNDER the header text.
(This ought to only apply to objects that spill into the
body text area, but that’s pretty hard to calculate, so
transparency was applied to any object anchored in the header.)

Change-Id: Ie3916c6b7f3fa80caf5994fd910ba4d4d89ec702
Reviewed-on: https://gerrit.libreoffice.org/33152
Reviewed-by: Justin Luth 
Tested-by: Justin Luth 
Reviewed-by: Miklos Vajna 
(cherry picked from commit c0688e8bf047bb123680806317fe040ba2cde407)
Reviewed-on: https://gerrit.libreoffice.org/33360
Tested-by: Jenkins 

diff --git a/sw/qa/extras/ooxmlimport/data/tdf48658_transparentOLEheader.docx 
b/sw/qa/extras/ooxmlimport/data/tdf48658_transparentOLEheader.docx
new file mode 100755
index 000..5b6649c
Binary files /dev/null and 
b/sw/qa/extras/ooxmlimport/data/tdf48658_transparentOLEheader.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index f002fa7..65ca902 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -817,6 +817,13 @@ DECLARE_OOXMLIMPORT_TEST(testOleAnchor, "ole-anchor.docx")
 CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGHT, 
getProperty(getShape(1), "Surround"));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf48658_transparentOLEheader, 
"tdf48658_transparentOLEheader.docx")
+{
+// The problem was that the shape in the header was hidden in the 
background.
+// The round-tripped document was always fine (even before the fix) but 
the shape numbers change, so import-only test.
+CPPUNIT_ASSERT_EQUAL(true, bool(getProperty(getShape(1), "Opaque")));
+}
+
 DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeParaAdjust, 
"dml-groupshape-paraadjust.docx")
 {
 // Paragraph adjustment inside a group shape was not imported
diff --git a/writerfilter/source/dmapper/OLEHandler.cxx 
b/writerfilter/source/dmapper/OLEHandler.cxx
index 26f12c1..194d1d3 100644
--- a/writerfilter/source/dmapper/OLEHandler.cxx
+++ b/writerfilter/source/dmapper/OLEHandler.cxx
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 namespace writerfilter {
@@ -111,7 +112,7 @@ void OLEHandler::lcl_attribute(Id rName, Value & rVal)
 
 try
 {
-// Shapes in the header or footer should be in the 
background.
+// Shapes in the header or footer should be in the 
background, since the default is WrapTextMode_THROUGH.
 if (m_rDomainMapper.IsInHeaderFooter())
 xShapeProps->setPropertyValue("Opaque", 
uno::makeAny(false));
 
@@ -165,6 +166,11 @@ void OLEHandler::lcl_sprm(Sprm & rSprm)
 xShapeProps->setPropertyValue(
 getPropertyName( PROP_SURROUND ),
 uno::makeAny( m_nWrapMode ) );
+
+// Through shapes in the header or footer(that spill into 
the body) should be in the background.
+// It is just assumed that all shapes will spill into the 
body.
+if( m_rDomainMapper.IsInHeaderFooter() )
+xShapeProps->setPropertyValue("Opaque", 
uno::makeAny(m_nWrapMode != text::WrapTextMode_THROUGHT));
 }
 catch( const uno::Exception& e )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-bugs] [Bug 105483] New: Default value of GreekCharStyle should be '2'.

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105483

Bug ID: 105483
   Summary: Default value of GreekCharStyle should be '2'.
   Product: LibreOffice
   Version: 5.2.4.2 release
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: normal
  Priority: medium
 Component: Formula Editor
  Assignee: libreoffice-bugs@lists.freedesktop.org
  Reporter: j...@curioussymbols.com

Description:
Referring to bug 52225, a change was made some years ago which misguidedly
changed the default format of Greek letters in equations from italic to roman
script. Recently, an 'expert configuration' setting change was made which
implements a customisation that allows the correct  behaviour to be restored.
However the default behave remains the wrong one -- a new installation of
LibreOffice continues to provide non-italic Greek letters in all formulae.

The default value of GreekCharStyle should be changed to 2 -- italics for lower
case greek letters, non-italic for upper case.

This correct behaviour would then be consistent with Word 2010+, Latex and
Wikipedia, and is the conventional formatting of most mathematics, science and
engineering publications (textbooks, journal papers, etc).

I am not sure where this default value is set... perhaps it is implicit that
the default value is zero. Tried searching the code but didn't see anything
obvious.
https://github.com/LibreOffice/core/blob/e87071ac57a7711078715d9165c264ec3db180ab/starmath/source/node.cxx

Steps to Reproduce:
Install LibreOffice, try the formula '%rho'

Actual Results:  
Greek letter rho will be shown in non-italics.

Expected Results:
Should be in italics.


Reproducible: Always

User Profile Reset: Tried on various systems.

Additional Info:


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101
Firefox/50.0

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-commits] online.git: common/MessageQueue.hpp wsd/ClientSession.cpp wsd/ClientSession.hpp

2017-01-22 Thread Ashod Nakashian
 common/MessageQueue.hpp |   13 +
 wsd/ClientSession.cpp   |3 ---
 wsd/ClientSession.hpp   |5 +
 3 files changed, 14 insertions(+), 7 deletions(-)

New commits:
commit f3a85a7bf04bf8c0b215304a140dcffde645aefa
Author: Ashod Nakashian 
Date:   Thu Jan 19 23:24:23 2017 -0500

wsd: MessageQueueBase support no empty items

Throw when empty payload is enqueued
and return empty payload on get timeout
(instead of throwing).

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

diff --git a/common/MessageQueue.hpp b/common/MessageQueue.hpp
index 0ae4658..34cbe8a 100644
--- a/common/MessageQueue.hpp
+++ b/common/MessageQueue.hpp
@@ -39,6 +39,11 @@ public:
 /// Thread safe insert the message.
 void put(const Payload& value)
 {
+if (value.empty())
+{
+throw std::runtime_error("Cannot queue empty item.");
+}
+
 std::unique_lock lock(_mutex);
 put_impl(value);
 lock.unlock();
@@ -52,6 +57,7 @@ public:
 
 /// Thread safe obtaining of the message.
 /// timeoutMs can be 0 to signify infinity.
+/// Returns an empty payload on timeout.
 Payload get(const unsigned timeoutMs = 0)
 {
 std::unique_lock lock(_mutex);
@@ -59,9 +65,9 @@ public:
 if (timeoutMs > 0)
 {
 if (!_cv.wait_for(lock, std::chrono::milliseconds(timeoutMs),
-[this] { return wait_impl(); }))
+  [this] { return wait_impl(); }))
 {
-throw std::runtime_error("Timed out waiting to get queue 
item.");
+return Payload();
 }
 }
 else
@@ -72,7 +78,6 @@ public:
 return get_impl();
 }
 
-
 /// Thread safe removal of all the pending messages.
 void clear()
 {
@@ -118,7 +123,7 @@ protected:
 std::vector _queue;
 
 private:
-std::mutex _mutex;
+mutable std::mutex _mutex;
 std::condition_variable _cv;
 
 };
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 4ed0b29..e32d53b 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -50,9 +50,6 @@ ClientSession::~ClientSession()
 {
 LOG_INF("~ClientSession dtor [" << getName() << "].");
 
-// Release the save-as queue.
-_saveAsQueue.put("");
-
 stop();
 if (_senderThread.joinable())
 {
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index ed78a44..57345bb 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -83,6 +83,11 @@ public:
 std::string getSaveAsUrl(const unsigned timeoutMs)
 {
 const auto payload = _saveAsQueue.get(timeoutMs);
+if (payload.empty())
+{
+throw std::runtime_error("Timed-out while getting save-as URL.");
+}
+
 return std::string(payload.data(), payload.size());
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: bundled/include

2017-01-22 Thread Ashod Nakashian
 bundled/include/LibreOfficeKit/LibreOfficeKit.h  |   11 ++-
 bundled/include/LibreOfficeKit/LibreOfficeKit.hxx|   10 ++
 bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |   64 +--
 3 files changed, 52 insertions(+), 33 deletions(-)

New commits:
commit 494cdca018a62e805ba733739330c3d8ef4495bf
Author: Ashod Nakashian 
Date:   Thu Jan 19 23:23:06 2017 -0500

wsd: update LO Kit headers

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

diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h 
b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
index 0b9535a..55cff72 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
@@ -61,7 +61,6 @@ struct _LibreOfficeKitClass
 void (*freeError) (char* pFree);
 
 #if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
-/// @see lok::Office::registerCallback().
 void (*registerCallback) (LibreOfficeKit* pThis,
   LibreOfficeKitCallback pCallback,
   void* pData);
@@ -251,6 +250,16 @@ struct _LibreOfficeKitDocumentClass
int* pArray,
size_t nSize);
 
+/// Starts a batch of operations.
+/// Events are emmitted only after ending the batch.
+/// @see lok::Document::endBatch();
+void (*beginBatch) (LibreOfficeKitDocument* pThis);
+
+/// Ends a batch of operations.
+/// @see lok::Document::beginBatch();
+void (*endBatch) (LibreOfficeKitDocument* pThis);
+
+
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
 
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
index 447f44b..46ecb5f 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -452,6 +452,16 @@ public:
 return mpDoc->pClass->getViewIds(mpDoc, pArray, nSize);
 }
 
+inline void beginBatch()
+{
+mpDoc->pClass->beginBatch(mpDoc);
+}
+
+inline void endBatch()
+{
+mpDoc->pClass->endBatch(mpDoc);
+}
+
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
 
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 187fa98..d2ccc0f 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -93,13 +93,13 @@ typedef enum
  *
  * @see LOK_FEATURE_PART_IN_INVALIDATION_CALLBACK.
  */
-LOK_CALLBACK_INVALIDATE_TILES,
+LOK_CALLBACK_INVALIDATE_TILES = 0,
 /**
  * The size and/or the position of the visible cursor changed.
  *
  * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
  */
-LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR,
+LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR = 1,
 /**
  * The list of rectangles representing the current text selection changed.
  *
@@ -108,7 +108,7 @@ typedef enum
  * LOK_CALLBACK_INVALIDATE_TILES. When there is no selection, an empty
  * string is provided.
  */
-LOK_CALLBACK_TEXT_SELECTION,
+LOK_CALLBACK_TEXT_SELECTION = 2,
 /**
  * The position and size of the cursor rectangle at the text
  * selection start. It is used to draw the selection handles.
@@ -118,7 +118,7 @@ typedef enum
  *
  * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
  */
-LOK_CALLBACK_TEXT_SELECTION_START,
+LOK_CALLBACK_TEXT_SELECTION_START = 3,
 /**
  * The position and size of the cursor rectangle at the text
  * selection end. It is used to draw the selection handles.
@@ -128,7 +128,7 @@ typedef enum
  *
  * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
  */
-LOK_CALLBACK_TEXT_SELECTION_END,
+LOK_CALLBACK_TEXT_SELECTION_END = 4,
 /**
  * The blinking text cursor is now visible or not.
  *
@@ -137,26 +137,26 @@ typedef enum
  * LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR once it becomes false. Payload is
  * either the "true" or the "false" string.
  */
-LOK_CALLBACK_CURSOR_VISIBLE,
+LOK_CALLBACK_CURSOR_VISIBLE = 5,
 /**
  * The size and/or the position of the graphic selection changed.
  *
  * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
  */
-LOK_CALLBACK_GRAPHIC_SELECTION,
+LOK_CALLBACK_GRAPHIC_SELECTION = 6,
 
 /**
  * User clicked on an hyperlink that should be handled by other
  * applications accordingly.
  */
-LOK_CALLBACK_HYPERLINK_CLICKED,
+LOK_CALLBACK_HYPERLINK_CLICKED = 7,
 
 /**
  * Emit state update to the client.
  * For 

[Libreoffice-commits] online.git: kit/Kit.cpp

2017-01-22 Thread Ashod Nakashian
 kit/Kit.cpp |   61 +---
 1 file changed, 34 insertions(+), 27 deletions(-)

New commits:
commit 7f8ffcfab5a774d0a480b58f594bf5e9fe698e6d
Author: Ashod Nakashian 
Date:   Thu Jan 19 20:50:19 2017 -0500

wsd: check for malformed callback messages

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

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index fa04207..4d862de 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1382,42 +1382,49 @@ private:
 }
 else if (tokens[0] == "callback")
 {
-int viewId = std::stoi(tokens[1]); // -1 means broadcast
-int type = std::stoi(tokens[2]);
+if (tokens.size() >= 3)
+{
+int viewId = std::stoi(tokens[1]); // -1 means 
broadcast
+int type = std::stoi(tokens[2]);
 
-// payload is the rest of the message
-const auto offset = tokens[0].length() + 
tokens[1].length() + tokens[2].length() + 3; // + delims
-const std::string payload(input.data() + offset, 
input.size() - offset);
+// payload is the rest of the message
+const auto offset = tokens[0].length() + 
tokens[1].length() + tokens[2].length() + 3; // + delims
+const std::string payload(input.data() + offset, 
input.size() - offset);
 
-// Forward the callback to the same view, demultiplexing 
is done by the LibreOffice core.
-// TODO: replace with a map to be faster.
-bool isFound = false;
-for (auto& it : _sessions)
-{
-auto session = it.second;
-if (session && ((session->getViewId() == viewId) || 
(viewId == -1)))
+// Forward the callback to the same view, 
demultiplexing is done by the LibreOffice core.
+// TODO: replace with a map to be faster.
+bool isFound = false;
+for (auto& it : _sessions)
 {
-if (!it.second->isCloseFrame())
-{
-isFound = true;
-session->loKitCallback(type, payload);
-}
-else
+auto session = it.second;
+if (session && ((session->getViewId() == viewId) 
|| (viewId == -1)))
 {
-LOG_ERR("Session-thread of session [" << 
session->getId() << "] for view [" <<
-viewId << "] is not running. Dropping 
[" << LOKitHelper::kitCallbackTypeToString(type) <<
-"] payload [" << payload << "].");
+if (!it.second->isCloseFrame())
+{
+isFound = true;
+session->loKitCallback(type, payload);
+}
+else
+{
+LOG_ERR("Session-thread of session [" << 
session->getId() << "] for view [" <<
+viewId << "] is not running. 
Dropping [" << LOKitHelper::kitCallbackTypeToString(type) <<
+"] payload [" << payload << "].");
+}
+
+break;
 }
+}
 
-break;
+if (!isFound)
+{
+LOG_WRN("Document::ViewCallback. Session [" << 
viewId <<
+"] is no longer active to process [" << 
LOKitHelper::kitCallbackTypeToString(type) <<
+"] [" << payload << "] message to Master 
Session.");
 }
 }
-
-if (!isFound)
+else
 {
-LOG_WRN("Document::ViewCallback. Session [" << viewId 
<<
-"] is no longer active to process [" << 
LOKitHelper::kitCallbackTypeToString(type) <<
-"] [" << payload << "] message to Master 
Session.");
+LOG_ERR("Invalid callback message: [" << 
LOOLProtocol::getAbbreviatedMessage(input) << "].");
  

[Libreoffice-commits] online.git: common/Protocol.hpp common/Session.cpp common/Session.hpp kit/ChildSession.cpp kit/ChildSession.hpp kit/Kit.cpp wsd/ClientSession.cpp wsd/ClientSession.hpp wsd/TileDe

2017-01-22 Thread Ashod Nakashian
 common/Protocol.hpp   |   14 +++
 common/Session.cpp|   10 ++---
 common/Session.hpp|2 -
 kit/ChildSession.cpp  |   88 +-
 kit/ChildSession.hpp  |   36 ++--
 kit/Kit.cpp   |   12 +++---
 wsd/ClientSession.cpp |   19 +-
 wsd/ClientSession.hpp |   10 ++---
 wsd/TileDesc.hpp  |   19 --
 9 files changed, 111 insertions(+), 99 deletions(-)

New commits:
commit 25be7f0ab6205cb66cf3b8952b95a6ac20274eb3
Author: Ashod Nakashian 
Date:   Thu Jan 19 20:44:39 2017 -0500

wsd: use own tokenizer

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

diff --git a/common/Protocol.hpp b/common/Protocol.hpp
index 6d4e5cb..c075339 100644
--- a/common/Protocol.hpp
+++ b/common/Protocol.hpp
@@ -73,6 +73,20 @@ namespace LOOLProtocol
 bool getTokenInteger(const Poco::StringTokenizer& tokens, const 
std::string& name, int& value);
 bool getTokenString(const Poco::StringTokenizer& tokens, const 
std::string& name, std::string& value);
 bool getTokenKeyword(const Poco::StringTokenizer& tokens, const 
std::string& name, const std::map& map, int& value);
+inline bool getTokenString(const std::vector& tokens,
+   const std::string& name,
+   std::string& value)
+{
+for (const auto& token : tokens)
+{
+if (getTokenString(token, name, value))
+{
+return true;
+}
+}
+
+return false;
+}
 
 bool getTokenIntegerFromMessage(const std::string& message, const 
std::string& name, int& value);
 bool getTokenStringFromMessage(const std::string& message, const 
std::string& name, std::string& value);
diff --git a/common/Session.cpp b/common/Session.cpp
index 03df779..b320522 100644
--- a/common/Session.cpp
+++ b/common/Session.cpp
@@ -116,17 +116,17 @@ bool Session::sendBinaryFrame(const char *buffer, int 
length)
 return false;
 }
 
-void Session::parseDocOptions(const StringTokenizer& tokens, int& part, 
std::string& timestamp)
+void Session::parseDocOptions(const std::vector& tokens, int& 
part, std::string& timestamp)
 {
 // First token is the "load" command itself.
 size_t offset = 1;
-if (tokens.count() > 2 && tokens[1].find("part=") == 0)
+if (tokens.size() > 2 && tokens[1].find("part=") == 0)
 {
 getTokenInteger(tokens[1], "part", part);
 ++offset;
 }
 
-for (size_t i = offset; i < tokens.count(); ++i)
+for (size_t i = offset; i < tokens.size(); ++i)
 {
 if (tokens[i].find("url=") == 0)
 {
@@ -163,11 +163,11 @@ void Session::parseDocOptions(const StringTokenizer& 
tokens, int& part, std::str
 }
 }
 
-if (tokens.count() > offset)
+if (tokens.size() > offset)
 {
 if (getTokenString(tokens[offset], "options", _docOptions))
 {
-if (tokens.count() > offset + 1)
+if (tokens.size() > offset + 1)
 _docOptions += Poco::cat(std::string(" "), tokens.begin() + 
offset + 1, tokens.end());
 }
 }
diff --git a/common/Session.hpp b/common/Session.hpp
index d5fe524..c2642d9 100644
--- a/common/Session.hpp
+++ b/common/Session.hpp
@@ -74,7 +74,7 @@ protected:
 virtual ~Session();
 
 /// Parses the options of the "load" command, shared between 
MasterProcessSession::loadDocument() and ChildProcessSession::loadDocument().
-void parseDocOptions(const Poco::StringTokenizer& tokens, int& part, 
std::string& timestamp);
+void parseDocOptions(const std::vector& tokens, int& part, 
std::string& timestamp);
 
 void updateLastActivityTime()
 {
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index a216456..0489bd9 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -76,7 +76,7 @@ bool ChildSession::_handleInput(const char *buffer, int 
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);
+const auto tokens = LOOLProtocol::tokenize(firstLine.data(), 
firstLine.size());
 
 if (LOOLProtocol::tokenIndicatesUserInteraction(tokens[0]))
 {
@@ -84,7 +84,7 @@ bool ChildSession::_handleInput(const char *buffer, int 
length)
 updateLastActivityTime();
 }
 
-if (tokens.count() > 0 && tokens[0] == "useractive" && getLOKitDocument() 
!= nullptr)
+if (tokens.size() > 0 && tokens[0] == "useractive" && getLOKitDocument() 
!= nullptr)
 {
 LOG_DBG("Handling message after inactivity of " << getInactivityMS() 
<< "ms.");

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

2017-01-22 Thread Ashod Nakashian
 common/Log.cpp |   49 -
 common/Log.hpp |   41 +++--
 2 files changed, 43 insertions(+), 47 deletions(-)

New commits:
commit ffe092f5ce4fc1fb15cbaca3ee5f1930dd74affd
Author: Ashod Nakashian 
Date:   Thu Jan 19 19:26:57 2017 -0500

wsd: log cleanup

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

diff --git a/common/Log.cpp b/common/Log.cpp
index e201dbf..5defd6b 100644
--- a/common/Log.cpp
+++ b/common/Log.cpp
@@ -8,6 +8,8 @@
  */
 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -16,9 +18,6 @@
 #include 
 #include 
 
-#include 
-#include 
-
 #include 
 #include 
 #include 
@@ -76,36 +75,28 @@ namespace Log
 }
 }
 
-static void getPrefix(char *buffer, const char* level)
+char* prefix(char* buffer, const char* level, const long osTid)
 {
-char procName[32]; // we really need only 16
+char procName[32];
 if (prctl(PR_GET_NAME, reinterpret_cast(procName), 0, 
0, 0) != 0)
 {
 strncpy(procName, "", sizeof(procName) - 1);
 }
 
-const char* appName = (Source.inited ? Source.id.c_str() : 
"");
-assert(strlen(appName) + 32 + 28 < 1024 - 1);
-
 Poco::DateTime time;
-snprintf(buffer, 1023, "%s-%.04lu %.2u:%.2u:%.2u.%.6u [ %s ] %s  ", 
appName,
- syscall(SYS_gettid),
- time.hour(), time.minute(), time.second(),
- time.millisecond() * 1000 + time.microsecond(),
- procName, level);
-}
-
-std::string prefix(const char* level)
-{
-char buffer[1024];
-getPrefix(buffer, level);
-return std::string(buffer);
+snprintf(buffer, 1023, "%s-%.04lu %.2u:%.2u:%.2u.%.6u [ %s ] %s  ",
+(Source.inited ? Source.id.c_str() : ""),
+osTid,
+time.hour(), time.minute(), time.second(),
+time.millisecond() * 1000 + time.microsecond(),
+procName, level);
+return buffer;
 }
 
 void signalLogPrefix()
 {
 char buffer[1024];
-getPrefix(buffer, "SIG");
+prefix(buffer, "SIG", syscall(SYS_gettid));
 signalLog(buffer);
 }
 
@@ -167,42 +158,42 @@ namespace Log
 
 void trace(const std::string& msg)
 {
-logger().trace(prefix("TRC") + msg);
+LOG_TRC(msg);
 }
 
 void debug(const std::string& msg)
 {
-logger().debug(prefix("DBG") + msg);
+LOG_DBG(msg);
 }
 
 void info(const std::string& msg)
 {
-logger().information(prefix("INF") + msg);
+LOG_INF(msg);
 }
 
 void warn(const std::string& msg)
 {
-logger().warning(prefix("WRN") + msg);
+LOG_WRN(msg);
 }
 
 void error(const std::string& msg)
 {
-logger().error(prefix("ERR") + msg);
+LOG_ERR(msg);
 }
 
 void syserror(const std::string& msg)
 {
-logger().error(prefix("ERR") + msg + " (errno: " + 
std::string(std::strerror(errno)) + ")");
+LOG_SYS(msg);
 }
 
 void fatal(const std::string& msg)
 {
-logger().fatal(prefix("FTL") + msg);
+LOG_FTL(msg);
 }
 
 void sysfatal(const std::string& msg)
 {
-logger().fatal(prefix("FTL") + msg + " (errno: " + 
std::string(std::strerror(errno)) + ")");
+LOG_SFL(msg);
 }
 }
 
diff --git a/common/Log.hpp b/common/Log.hpp
index b4d42c7..d8788a2 100644
--- a/common/Log.hpp
+++ b/common/Log.hpp
@@ -10,6 +10,9 @@
 #ifndef INCLUDED_LOG_HPP
 #define INCLUDED_LOG_HPP
 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -24,7 +27,8 @@ namespace Log
 const bool logToFile,
 std::map config);
 Poco::Logger& logger();
-std::string prefix(const char* level);
+
+char* prefix(char* buffer, const char* level, const long osTid);
 
 void trace(const std::string& msg);
 void debug(const std::string& msg);
@@ -35,12 +39,12 @@ namespace Log
 void fatal(const std::string& msg);
 void sysfatal(const std::string& msg);
 
-inline bool traceEnabled() { return logger().getLevel() >= 
Poco::Message::PRIO_TRACE; }
-inline bool debugEnabled() { return logger().getLevel() >= 
Poco::Message::PRIO_DEBUG; }
-inline bool infoEnabled() { return logger().getLevel() >= 
Poco::Message::PRIO_INFORMATION; }
-inline bool warnEnabled() { return logger().getLevel() >= 
Poco::Message::PRIO_WARNING; }
-inline bool errorEnabled() { return logger().getLevel() >= 
Poco::Message::PRIO_ERROR; }
-inline bool fatalEnabled() { return logger().getLevel() >= 
Poco::Message::PRIO_FATAL; }
+inline bool traceEnabled() { 

[Libreoffice-commits] online.git: common/Log.cpp

2017-01-22 Thread Ashod Nakashian
 common/Log.cpp |   16 
 1 file changed, 4 insertions(+), 12 deletions(-)

New commits:
commit b9c900d4599a4cb5073738884c32f700ce681e21
Author: Ashod Nakashian 
Date:   Tue Jan 17 18:30:58 2017 -0500

wsd: format the time directly in the log prefix

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

diff --git a/common/Log.cpp b/common/Log.cpp
index 8d020fb..e201dbf 100644
--- a/common/Log.cpp
+++ b/common/Log.cpp
@@ -78,11 +78,6 @@ namespace Log
 
 static void getPrefix(char *buffer, const char* level)
 {
-// FIXME: If running under systemd it is redundant to output 
timestamps, as those will be
-// attached to messages that the systemd journalling mechanism picks 
up anyway, won't they?
-
-std::string time = DateTimeFormatter::format(Poco::Timestamp(), 
"%H:%M:%s");
-
 char procName[32]; // we really need only 16
 if (prctl(PR_GET_NAME, reinterpret_cast(procName), 0, 
0, 0) != 0)
 {
@@ -92,9 +87,11 @@ namespace Log
 const char* appName = (Source.inited ? Source.id.c_str() : 
"");
 assert(strlen(appName) + 32 + 28 < 1024 - 1);
 
-snprintf(buffer, 4095, "%s-%.04lu %s [ %s ] %s  ", appName,
+Poco::DateTime time;
+snprintf(buffer, 1023, "%s-%.04lu %.2u:%.2u:%.2u.%.6u [ %s ] %s  ", 
appName,
  syscall(SYS_gettid),
- time.c_str(),
+ time.hour(), time.minute(), time.second(),
+ time.millisecond() * 1000 + time.microsecond(),
  procName, level);
 }
 
@@ -159,11 +156,6 @@ namespace Log
 oss << " Local time: " << buf << ".";
 }
 
-if (strftime(buf, sizeof(buf), "%a %F %T%z", std::gmtime()) > 0)
-{
-oss << " UTC time: " << buf << ".";
-}
-
 oss <<  " Log level is [" << logger.getLevel() << "].";
 info(oss.str());
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-bugs] [Bug 104403] Support multi-colored fonts using COLR/CPAL tables

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=104403

--- Comment #2 from Volga  ---
We can also explore how Firefox implemented.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


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

2017-01-22 Thread Ashod Nakashian
 desktop/inc/lib/init.hxx  |4 
 desktop/source/lib/init.cxx   |   26 ++
 include/LibreOfficeKit/LibreOfficeKit.h   |   10 ++
 include/LibreOfficeKit/LibreOfficeKit.hxx |   10 ++
 4 files changed, 50 insertions(+)

New commits:
commit 1c27286b9d5331634c073cd3e327bd941e61bbb6
Author: Ashod Nakashian 
Date:   Fri Jan 6 10:48:18 2017 -0500

Lok: support for batch API calls

Mouse and keyboard operations typically
come in batches, and often each results in
tile invalidations and/or layout modifications.

Processing each input event on its own, then processing
the resulting output event is very costly and unecessary
when we know there is more of the same.

The new API adds support for batching such related
input events by disabling the output events generated
by Core until the batch is done. The client can
then process the resulting events, which will
be compressed and deduplicated.

Change-Id: Id381dab807186d010021a8778ee440074a739920
Reviewed-on: https://gerrit.libreoffice.org/33402
Tested-by: Jenkins 
Reviewed-by: Ashod Nakashian 

diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx
index 302f54d..bfe9954 100644
--- a/desktop/inc/lib/init.hxx
+++ b/desktop/inc/lib/init.hxx
@@ -41,6 +41,10 @@ namespace desktop {
 void setEventLatch(const bool bEventLatch)
 {
 m_bEventLatch = bEventLatch;
+if (!IsActive())
+{
+Start();
+}
 }
 
 bool isEventLatchOn() const { return m_bEventLatch; }
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d29a695..3df7b2e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -537,6 +537,8 @@ static unsigned char* 
doc_renderFont(LibreOfficeKitDocument* pThis,
   int* pFontWidth,
   int* pFontHeight);
 static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart);
+static void doc_beginBatch(LibreOfficeKitDocument* pThis);
+static void doc_endBatch(LibreOfficeKitDocument* pThis);
 
 LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
 )
 : mxComponent(xComponent)
@@ -583,6 +585,8 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
renderFont = doc_renderFont;
 m_pDocumentClass->getPartHash = doc_getPartHash;
+m_pDocumentClass->beginBatch = doc_beginBatch;
+m_pDocumentClass->endBatch = doc_endBatch;
 
 gDocumentClass = m_pDocumentClass;
 }
@@ -2707,6 +2711,28 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* 
/*pThis*/,
 return nullptr;
 }
 
+static void doc_beginBatch(LibreOfficeKitDocument* pThis)
+{
+SolarMutexGuard aGuard;
+
+LibLODocument_Impl* pDocument = static_cast(pThis);
+for (const auto& pair : pDocument->mpCallbackFlushHandlers)
+{
+pair.second->setEventLatch(true);
+}
+}
+
+static void doc_endBatch(LibreOfficeKitDocument* pThis)
+{
+SolarMutexGuard aGuard;
+
+LibLODocument_Impl* pDocument = static_cast(pThis);
+for (const auto& pair : pDocument->mpCallbackFlushHandlers)
+{
+pair.second->setEventLatch(false);
+}
+}
+
 static char* lo_getError (LibreOfficeKit *pThis)
 {
 SolarMutexGuard aGuard;
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index c7a2130..55cff72 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -250,6 +250,16 @@ struct _LibreOfficeKitDocumentClass
int* pArray,
size_t nSize);
 
+/// Starts a batch of operations.
+/// Events are emmitted only after ending the batch.
+/// @see lok::Document::endBatch();
+void (*beginBatch) (LibreOfficeKitDocument* pThis);
+
+/// Ends a batch of operations.
+/// @see lok::Document::beginBatch();
+void (*endBatch) (LibreOfficeKitDocument* pThis);
+
+
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
 
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 447f44b..46ecb5f 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -452,6 +452,16 @@ public:
 return mpDoc->pClass->getViewIds(mpDoc, pArray, nSize);
 }
 
+inline void beginBatch()
+{
+mpDoc->pClass->beginBatch(mpDoc);
+}
+
+inline void endBatch()
+{
+mpDoc->pClass->endBatch(mpDoc);
+}
+
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-bugs] [Bug 104238] [META] Impress image bugs and enhancements

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=104238

Volga  changed:

   What|Removed |Added

 Depends on||104878


Referenced Bugs:

https://bugs.documentfoundation.org/show_bug.cgi?id=104878
[Bug 104878] Impress works very slow with large sized GIF
-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 104878] Impress works very slow with large sized GIF

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=104878

Volga  changed:

   What|Removed |Added

 Blocks||104238


Referenced Bugs:

https://bugs.documentfoundation.org/show_bug.cgi?id=104238
[Bug 104238] [META] Impress image bugs and enhancements
-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 104878] Impress works very slow with large sized GIF

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=104878

Volga  changed:

   What|Removed |Added

 Blocks|104238  |

--- Comment #7 from Volga  ---
I tested again with another GIF get from
https://en.wikipedia.org/wiki/File:Quitman_TX_oil_well_with_Lufkin_pumping_unit.gif
, then Impress is nearly no responce. To avoid that, LibreOffice should make
use of hardware acceleration for animated images.

Version: 5.3.0.2 (x64)
Build ID: 5ad7b2889021c491af62f7930a4b1cb631392f16
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; 布局引擎:新; 
Locale: zh-CN (zh_CN); Calc: group


Referenced Bugs:

https://bugs.documentfoundation.org/show_bug.cgi?id=104238
[Bug 104238] [META] Impress image bugs and enhancements
-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 104238] [META] Impress image bugs and enhancements

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=104238

Volga  changed:

   What|Removed |Added

 Depends on|104878  |


Referenced Bugs:

https://bugs.documentfoundation.org/show_bug.cgi?id=104878
[Bug 104878] Impress works very slow with large sized GIF
-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 104878] Impress works very slow with large sized GIF

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=104878

Volga  changed:

   What|Removed |Added

 Blocks||104238


Referenced Bugs:

https://bugs.documentfoundation.org/show_bug.cgi?id=104238
[Bug 104238] [META] Impress image bugs and enhancements
-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 104238] [META] Impress image bugs and enhancements

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=104238

Volga  changed:

   What|Removed |Added

 Depends on||104878


Referenced Bugs:

https://bugs.documentfoundation.org/show_bug.cgi?id=104878
[Bug 104878] Impress works very slow with large sized GIF
-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 45820] insanely slow wmf import (complex clipping and basegfx::tools: :findCuts)

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=45820

--- Comment #15 from Volga  ---
Is it possible to backport to 5.3.0?

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 100151] Crash at the end of slideshow or previews in Impress ( in remote desktop session, for workaround see comment 25)

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=100151

--- Comment #42 from Aron Budea  ---
The difference in execution comes from DXRenderModule failing to find DirectX
capabilities, most likely DirectX is not working in remote desktop session.

The following lines cause DXRenderModule::verifyDevice( ... ) exiting early,
and DX canvas failing to be created:
if(FAILED(mpDirect3D9->GetDeviceCaps(nAdapter,D3DDEVTYPE_HAL,)))
return false;
http://opengrok.libreoffice.org/xref/core/canvas/source/directx/dx_9rm.cxx#653

The problem seems to be that in DXRenderModule::create( ... ) the child window
has already been created, but apparently later isn't cleaned up properly.

Proposed a patch to move Direct3D9-related code in the beginning of the
function, and exit without creating the window at all in that case:
https://gerrit.libreoffice.org/#/c/33413/

With the patch I'm getting no crash at the end of slideshow, or when previewing
slide transitions/animations.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 105482] When opening a table, the table record selector is not initially visible always

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105482

--- Comment #3 from Howard Johnson  ---
Comment on attachment 130619
  --> https://bugs.documentfoundation.org/attachment.cgi?id=130619
after resiging the window just slightly

typo: I meant "after resizing .." not resigning.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 105482] When opening a table, the table record selector is not initially visible always

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105482

--- Comment #2 from Howard Johnson  ---
Created attachment 130620
  --> https://bugs.documentfoundation.org/attachment.cgi?id=130620=edit
Sample database file used by the ask.libreoffice.org question about this

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 105482] When opening a table, the table record selector is not initially visible always

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105482

--- Comment #1 from Howard Johnson  ---
Created attachment 130619
  --> https://bugs.documentfoundation.org/attachment.cgi?id=130619=edit
after resiging the window just slightly

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 105482] New: When opening a table, the table record selector is not initially visible always

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105482

Bug ID: 105482
   Summary: When opening a table, the table record selector is not
initially visible always
   Product: LibreOffice
   Version: 5.2.3.3 release
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: normal
  Priority: medium
 Component: Base
  Assignee: libreoffice-bugs@lists.freedesktop.org
  Reporter: bridgeportcontrac...@gmail.com

Created attachment 130618
  --> https://bugs.documentfoundation.org/attachment.cgi?id=130618=edit
Initially with white box in lower left corner

Described and confirmed here:

https://ask.libreoffice.org/en/question/85904/base-when-opening-a-table-why-is-the-table-record-selector-is-not-visible-initially/

Recap:

What's going on with the empty white record selector box in the lower left
corner under Table Data View?

1) Initially upon opening a table (both w/ embedded data base & with JDBC
connected db)

2) After resizing the window just slightly

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 34002] EDITING - Add Reveal Codes feature like there is in WordPerfect.

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=34002

--- Comment #13 from TJ  ---
(In reply to bertramc from comment #5)

Couldn’t have said it better myself!

My firm edits a lot of different documents, Word docs, pdfs, scanned/OCR, etc.,
many of which need to be perfect for professional printing. For me and my team,
programs without a reveal codes feature are dead in the water. There is no way
to edit and produce quality documents without it. Period.

And for those that believe it isn’t necessary, don’t use it, but the feature
should be available to those of us that depend on it and know its value.

I would love to switch to LO from WordPerfect, but until we have the ability to
view, search, and edit style codes, we’ll have to stay with WordPerfect.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


Re: regarding help

2017-01-22 Thread Thorsten Behrens
Hi Saurabh Gajbhiye,

you wrote:
> i am interested in contributing to libreoffice, but i need some help
> to begin with, mostly the sort of help that i need is in the form of
> a mentor.
> 
Great, welcome to the LibreOffice community!

Please checkout our development onboarding page at
https://wiki.documentfoundation.org/Development/GetInvolved for a lot
of information and pointers. We generally expect new contributors to
work through that material & look for answers there before asking
additional questions.

> i hope you can provide me someone whom i can ask a few things to get
> started.
> 
We generally don't do 1:1 mentoring, for lack of bandwidth. In Cc is
our public mailing list, were we're happily answering further
questions. Please also checkout our #libreoffice-dev irc channel for
more interactive help.

All the best & have fun hacking on LibreOffice,

-- Thorsten


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


[Libreoffice-bugs] [Bug 75471] Newly opened LibO document frames stay in background ( i. e. LibO does not get focus)

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=75471

--- Comment #56 from Aron Budea  ---
(In reply to eBatch from comment #52)
> Seems to work fine. Begs the question as to how long this fix has been
> around but not publicised (or am I missing something?)?

Apparently:
https://bz.apache.org/ooo/show_bug.cgi?id=99971

Somewhat related stuff:
https://bugs.documentfoundation.org/show_bug.cgi?id=35091#c9

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 105481] Formula disappears after file save and re-open

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105481

j...@curioussymbols.com changed:

   What|Removed |Added

 CC||j...@curioussymbols.com

--- Comment #1 from j...@curioussymbols.com ---
Also wanted to add that the problem occurs on both Windows and Linux.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 105481] Formula disappears after file save and re-open

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105481

j...@curioussymbols.com changed:

   What|Removed |Added

Version|5.2.3.2 rc  |5.2.4.2 release

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 105481] New: Formula disappears after file save and re-open

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105481

Bug ID: 105481
   Summary: Formula disappears after file save and re-open
   Product: LibreOffice
   Version: 5.2.3.2 rc
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: normal
  Priority: medium
 Component: Writer
  Assignee: libreoffice-bugs@lists.freedesktop.org
  Reporter: j...@curioussymbols.com

This bug occurs with both 5.0.6.3 as well as 5.2.4.2.

I have a .odt document containing an academic paper. The figures in this paper
are in flames, positioned relative to the page. The first figure caption
contains two equations. These are the first equations to appear in the
document. The document also makes use of JabRef for the bibliography.

Every time I save my document, then close it, then re-open in, the first *two*
equations in the document disappear. They are replaced by a white box of the
same size as the equation, but the box is just white and no longer behaves like
a formula.

If I re-enter the first equation by deleting the white box and re-typing the
first equation, then coincidently, the second equation also re-appears all by
itself.

Clearly this document has become corrupted in some way. I don't know how I can
uncorrupt it. I don't want to post the whole file here as it is a paper in
press, but I will be happy to send it to anyone able to look into this issue
for me -- my email address is john@anu.edu.au.

Would really appreciate this, I think this relates to another bug I filed about
frames in LO, I think there are some serious bugs in this area relating to
behaviour of (indexing of?) objects in frames, so I hope this can be addressed.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 67774] IMPORT XLS/XLSX: Alignment shift is incorrect - should use font's space size

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=67774

Bartosz  changed:

   What|Removed |Added

   Assignee|libreoffice-b...@lists.free |gan...@poczta.onet.pl
   |desktop.org |

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 75471] Newly opened LibO document frames stay in background ( i. e. LibO does not get focus)

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=75471

--- Comment #55 from Luca  ---
(In reply to eBatch from comment #52)
> Have tested this in 5.1.5.2 and 5.2.4.2 (using
> Tools->Options->Advanced->Expert Configuration; search for
> 'ForceFocusAndToFront' and double click to change it to 'true').
> 
> Seems to work fine. Begs the question as to how long this fix has been
> around but not publicised (or am I missing something?)?

I did that in 5.3.0.2 (Italian version) and it works.

I can't believe that! This problem has been haunting me since 2013.

> Also why isn't ForceFocusAndToFront set as true by default (or will it be in
> 5.4)?

I second that, of course. Why not? Why was it ever modified in the first place?
There was no such a problem before 2013, AFAIR.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 105479] Changes data on csv

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105479

Bouss  changed:

   What|Removed |Added

 Status|NEEDINFO|UNCONFIRMED
   Assignee|libreoffice-b...@lists.free |bou...@yahoo.com
   |desktop.org |
 Ever confirmed|1   |0

--- Comment #2 from Bouss  ---
Created attachment 130615
  --> https://bugs.documentfoundation.org/attachment.cgi?id=130615=edit
Spreadsheet as read by LibreOffice

Check cell C61345 for example, which should be 30.505 instead, as correctly
read by Microsoft's Excel or Apple's Numbers. Notice that in other cases
numbers are correctly read, though in the screenshot attached every number
without decimals is read wrong.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 75471] Newly opened LibO document frames stay in background ( i. e. LibO does not get focus)

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=75471

Xisco Faulí  changed:

   What|Removed |Added

 Status|RESOLVED|VERIFIED

--- Comment #54 from Xisco Faulí  ---
Closing as VERIFIED FIXED as per comment 52

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 75471] Newly opened LibO document frames stay in background ( i. e. LibO does not get focus)

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=75471

Xisco Faulí  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #53 from Xisco Faulí  ---
Closing as RESOLVED VERIFIED as per comment 52

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 105479] Changes data on csv

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105479

Xisco Faulí  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEEDINFO
 CC||xiscofa...@libreoffice.org
 Ever confirmed|0   |1

--- Comment #1 from Xisco Faulí  ---
Hello Bouss,

Thank you for reporting the bug. Please attach a sample document, as this makes
it easier for us to verify the bug. 
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' once the requested document is provided.
(Please note that the attachment will be public, remove any sensitive
information before attaching it. 
See
https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F
for help on how to do so.)

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


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

2017-01-22 Thread Maxim Monastirsky
 sw/inc/iodetect.hxx  |2 +-
 sw/source/filter/basflt/iodetect.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit d9cfbabc7fe13752daf02e2a8cfa38c72a30fb29
Author: Maxim Monastirsky 
Date:   Sun Jan 22 20:15:31 2017 +0200

bEncodedFilter is always false

Change-Id: I1b959ce8f46f45a789bb7d493c371677ba775f3b

diff --git a/sw/inc/iodetect.hxx b/sw/inc/iodetect.hxx
index cce9b32..e49c803 100644
--- a/sw/inc/iodetect.hxx
+++ b/sw/inc/iodetect.hxx
@@ -96,7 +96,7 @@ public:
 static bool IsValidStgFilter( const css::uno::Reference < 
css::embed::XStorage >& rStg, const SfxFilter& rFilter);
 
 static bool IsDetectableText( const sal_Char* pBuf, sal_uLong ,
-rtl_TextEncoding *pCharSet, bool *pSwap, LineEnd 
*pLineEnd=nullptr, bool bEncodedFilter = false );
+rtl_TextEncoding *pCharSet, bool *pSwap, LineEnd *pLineEnd=nullptr 
);
 
 static const OUString GetSubStorageName( const SfxFilter& rFltr );
 };
diff --git a/sw/source/filter/basflt/iodetect.cxx 
b/sw/source/filter/basflt/iodetect.cxx
index 4fc0635..1ab3626 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -234,7 +234,7 @@ std::shared_ptr 
SwIoSystem::GetFileFilter(const OUString& rFile
 }
 
 bool SwIoSystem::IsDetectableText(const sal_Char* pBuf, sal_uLong ,
-rtl_TextEncoding *pCharSet, bool *pSwap, LineEnd *pLineEnd, bool 
bEncodedFilter)
+rtl_TextEncoding *pCharSet, bool *pSwap, LineEnd *pLineEnd)
 {
 bool bSwap = false;
 rtl_TextEncoding eCharSet = RTL_TEXTENCODING_DONTKNOW;
@@ -369,7 +369,7 @@ bool SwIoSystem::IsDetectableText(const sal_Char* pBuf, 
sal_uLong ,
 if (pLineEnd)
 *pLineEnd = eLineEnd;
 
-return bEncodedFilter || (!bIsBareUnicode && eSysLE == eLineEnd);
+return !bIsBareUnicode && eSysLE == eLineEnd;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-bugs] [Bug 92959] PDF exported text boxes have weird border spacing

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=92959

--- Comment #18 from JC Cardot  ---
By the way I traced this to the following commit:
commit a921db6cce1298ad286cb778e5138d6a4ddc4508
Author: Jens-Heiner Rechtien 
Date:   Wed Sep 8 15:21:42 2004 +
which contains loads of changes, but might be related to "2004/05/18 13:57:02
pl 1.62.32.18: begin to implement PDF widgets", so I'd say that it has "always"
been there; this was Ooo 1.1.2 or 1.1.3...
(some newer commits did change this code a little, but not its behaviour, there
are only changes of names of parameters or method names).

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


Weslley Ramos license statemen

2017-01-22 Thread Weslley Ramos
All of my past & future contributions to LibreOffice may be licensed under the 
MPLv2/LGPLv3+ dual license.

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-bugs] [Bug 92959] PDF exported text boxes have weird border spacing

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=92959

JC Cardot  changed:

   What|Removed |Added

 CC||libreoff...@cardot.net

--- Comment #17 from JC Cardot  ---
Created attachment 130614
  --> https://bugs.documentfoundation.org/attachment.cgi?id=130614=edit
Text box with a patch removing the cell padding

The bug is in core/vcl/source/gdi/pdfwriter_impl.cxx
around line 4218, it reads:
if( rWidget.Border )
{
// adjust edit area accounting for border
sal_Int32 nDelta = aFont.GetFontHeight()/4;
if( nDelta < 1 )
nDelta = 1;
rIntern.m_aRect.Left()  += nDelta;
rIntern.m_aRect.Top()   += nDelta;
rIntern.m_aRect.Right() -= nDelta;
rIntern.m_aRect.Bottom()-= nDelta;
}
Commenting all of this in order no to apply anymore the nDelta leads to the
attachment, which if I understand correctly is what Florian wants.
Note that the attachment has been created using the form_test.odt attachment
provided here.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


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

2017-01-22 Thread Caolán McNamara
 vcl/source/filter/sgfbram.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit e59b69010c9eca5b7c1dd3102141d9a23ab1c5a5
Author: Caolán McNamara 
Date:   Sun Jan 22 21:57:38 2017 +

coverity#1399045 Untrusted value as argument

Change-Id: Icac88c7b439036434cbf2352ac50e954139db4ce

diff --git a/vcl/source/filter/sgfbram.cxx b/vcl/source/filter/sgfbram.cxx
index bfd7012..e25d01f 100644
--- a/vcl/source/filter/sgfbram.cxx
+++ b/vcl/source/filter/sgfbram.cxx
@@ -290,6 +290,14 @@ bool SgfFilterBMap(SvStream& rInp, SvStream& rOut, 
SgfHeader& rHead, SgfEntry&)
 rOut.WriteBytes(pBuf.get(), nWdtOut);
 }
 } else if (nColors==256) {
+
+//we're going to loop Ysize * XSize on GetByte, max compression for 
GetByte is a run of 63
+//if we're less than that (and add a generous amount of wriggle room) 
then its not going
+//to fly
+const sal_uInt64 nMinBytesPossiblyNeeded = rHead.Xsize * rHead.Ysize / 
128;
+if (rInp.remainingSize() < nMinBytesPossiblyNeeded)
+return false;
+
 cRGB[3]=0;  // fourth palette entry for BMP
 for (sal_uInt16 i=0;i<256;i++) {   // copy palette
 rInp.ReadBytes(cRGB, 3);
@@ -325,6 +333,7 @@ bool SgfBMapFilter(SvStream& rInp, SvStream& rOut)
 ReadSgfHeader( rInp, aHead );
 if (!rInp.good())
 return false;
+
 if (aHead.ChkMagic() && (aHead.Typ==SgfBitImag0 || aHead.Typ==SgfBitImag1 
||
  aHead.Typ==SgfBitImag2 || aHead.Typ==SgfBitImgMo))
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-01-22 Thread Caolán McNamara
 vcl/source/filter/sgfbram.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f42a57528f3c2a07ad302b0d6b22946ee58b77c3
Author: Caolán McNamara 
Date:   Sun Jan 22 21:55:08 2017 +

wrong stream

Change-Id: I4e890ab80ed4ddb24b0fd41dae12264c99fb1477

diff --git a/vcl/source/filter/sgfbram.cxx b/vcl/source/filter/sgfbram.cxx
index ed2a961..bfd7012 100644
--- a/vcl/source/filter/sgfbram.cxx
+++ b/vcl/source/filter/sgfbram.cxx
@@ -323,7 +323,7 @@ bool SgfBMapFilter(SvStream& rInp, SvStream& rOut)
 
 nFileStart=rInp.Tell();
 ReadSgfHeader( rInp, aHead );
-if (!rIStream.good())
+if (!rInp.good())
 return false;
 if (aHead.ChkMagic() && (aHead.Typ==SgfBitImag0 || aHead.Typ==SgfBitImag1 
||
  aHead.Typ==SgfBitImag2 || aHead.Typ==SgfBitImgMo))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-bugs] [Bug 105480] New: toolbar icons are incomplete/ unreadable and Writing program crashes when menu is used.

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105480

Bug ID: 105480
   Summary: toolbar icons are incomplete/unreadable and Writing
program crashes when menu is used.
   Product: LibreOffice
   Version: 5.2.4.2 release
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: normal
  Priority: medium
 Component: Installation
  Assignee: libreoffice-bugs@lists.freedesktop.org
  Reporter: gd...@csufresno.edu

Description:
Writing crashes with any menu use.  Can't read the toolbar icons. LibreOffice
5.2.4 just installed on new iMac. Wish I had tried this out before I donated to
them.


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12) AppleWebKit/602.1.50
(KHTML, like Gecko) Version/10.0 Safari/602.1.50

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


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

2017-01-22 Thread Caolán McNamara
 vcl/source/filter/sgfbram.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit d608a304ecd3be4481632dbad091279abcf07a02
Author: Caolán McNamara 
Date:   Sun Jan 22 21:46:47 2017 +

return early on not good

Change-Id: I4aca6cb1c3dae652595b93ff7507db713a668d5f

diff --git a/vcl/source/filter/sgfbram.cxx b/vcl/source/filter/sgfbram.cxx
index 20afdf0..ed2a961 100644
--- a/vcl/source/filter/sgfbram.cxx
+++ b/vcl/source/filter/sgfbram.cxx
@@ -323,6 +323,8 @@ bool SgfBMapFilter(SvStream& rInp, SvStream& rOut)
 
 nFileStart=rInp.Tell();
 ReadSgfHeader( rInp, aHead );
+if (!rIStream.good())
+return false;
 if (aHead.ChkMagic() && (aHead.Typ==SgfBitImag0 || aHead.Typ==SgfBitImag1 
||
  aHead.Typ==SgfBitImag2 || aHead.Typ==SgfBitImgMo))
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-01-22 Thread Caolán McNamara
 vcl/source/filter/sgfbram.cxx |   29 ++---
 1 file changed, 14 insertions(+), 15 deletions(-)

New commits:
commit 35c602a5f47d6bd0e9538b4ffd8216ecccd27e02
Author: Caolán McNamara 
Date:   Sun Jan 22 21:42:58 2017 +

move loop variables to loops

Change-Id: I914206bad88fb3c405a335c2926fb51e39b7857e

diff --git a/vcl/source/filter/sgfbram.cxx b/vcl/source/filter/sgfbram.cxx
index 468c18c..20afdf0 100644
--- a/vcl/source/filter/sgfbram.cxx
+++ b/vcl/source/filter/sgfbram.cxx
@@ -193,7 +193,6 @@ bool SgfFilterBMap(SvStream& rInp, SvStream& rOut, 
SgfHeader& rHead, SgfEntry&)
 sal_uInt16 nWdtOut;// width of output bitmap in bytes
 sal_uInt16 nColors;// color count (1, 16, 256)
 sal_uInt16 nColBits;   // number of bits per pixel (2, 4, 
8)
-sal_uInt16 i,j,k;  // column/row/plane counter
 sal_uInt16 a,b;// helper variables
 sal_uInt8   pl1 = 0;// masks for the planes
 std::unique_ptr pBuf;   // buffer for a pixel row
@@ -232,13 +231,13 @@ bool SgfFilterBMap(SvStream& rInp, SvStream& rOut, 
SgfHeader& rHead, SgfEntry&)
 WriteRGBQuad( rOut, RGBQuad(0x00,0x00,0x00) ); // black
 WriteRGBQuad( rOut, RGBQuad(0xFF,0xFF,0xFF) ); // white
 nOfs=rOut.Tell();
-for (j=0;j

[Libreoffice-bugs] [Bug 105466] Crash when changing condition in conditional formatting

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105466

MM  changed:

   What|Removed |Added

Version|5.4.0.0.alpha0+ Master  |5.3.0.2 rc

--- Comment #3 from MM  ---
Crash also happens with Version: 5.3.0.2
Build ID: 5ad7b2889021c491af62f7930a4b1cb631392f16
CPU Threads: 2; OS Version: Linux 4.4; UI Render: default; VCL: gtk2; Layout
Engine: new; 
Locale: en-US (en_US.UTF-8); Calc: single

Changing some other options under 'Conditional Formatting' also might crash.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


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

2017-01-22 Thread Caolán McNamara
 sd/source/ui/table/TableDesignPane.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit e2e2775f3bbd120ae81f3cfb476f78247ace93fd
Author: Caolán McNamara 
Date:   Sun Jan 22 21:31:01 2017 +

align comment

Change-Id: I50a728e785589e3ec2d9128679f3e69451c5102a

diff --git a/sd/source/ui/table/TableDesignPane.cxx 
b/sd/source/ui/table/TableDesignPane.cxx
index 0536822..09ed839 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -607,13 +607,13 @@ const Bitmap CreateDesignPreview( const Reference< 
XIndexAccess >& xTableStyle,
 CellInfoMatrix aMatrix;
 FillCellInfoMatrix( aCellInfoVector, rSettings, aMatrix );
 
-//  w = 12 pixel
-// bccb h = 7 pixel
-// bccb b = border color
-// bccb c = cell color
-// bccb t = text color
-// bccb
-// 
+//  w = 12 pixel
+// bccb h = 7 pixel
+// bccb b = border color
+// bccb c = cell color
+// bccb t = text color
+// bccb
+// 
 
 Bitmap aPreviewBmp( Size( nBitmapWidth, nBitmapHeight), 24, nullptr );
 Bitmap::ScopedWriteAccess pAccess(aPreviewBmp);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-01-22 Thread Caolán McNamara
 sal/rtl/alloc_arena.cxx |5 +++--
 sal/rtl/alloc_cache.cxx |6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 49889a296e9e15077b36917329538e154789dd9f
Author: Caolán McNamara 
Date:   Sun Jan 22 21:26:45 2017 +

coverity#1399029 silence Out-of-bounds read

Change-Id: I025e416a6a162316d82cfbde9fbfcb0a45e888d5

diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx
index 19bc424..68dd298 100644
--- a/sal/rtl/alloc_arena.cxx
+++ b/sal/rtl/alloc_arena.cxx
@@ -217,8 +217,9 @@ rtl_arena_freelist_insert (
 )
 {
 rtl_arena_segment_type * head;
-
-head = &(arena->m_freelist_head[highbit(segment->m_size) - 1]);
+const auto bit = highbit(segment->m_size);
+assert(bit > 0);
+head = &(arena->m_freelist_head[bit - 1]);
 QUEUE_INSERT_TAIL_NAMED(head, segment, f);
 
 arena->m_freelist_bitmap |= head->m_size;
diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx
index 29d2008..fd8a8c0 100644
--- a/sal/rtl/alloc_cache.cxx
+++ b/sal/rtl/alloc_cache.cxx
@@ -140,7 +140,6 @@ rtl_cache_hash_rescale (
 rtl_cache_bufctl_type  * next = curr->m_next;
 rtl_cache_bufctl_type ** head;
 
-// coverity[negative_shift]
 head = &(cache->m_hash_table[RTL_CACHE_HASH_INDEX(cache, 
curr->m_addr)]);
 curr->m_next = (*head);
 (*head) = curr;
@@ -212,8 +211,9 @@ rtl_cache_hash_remove (
 if (!(cache->m_features & RTL_CACHE_FEATURE_RESCALE))
 {
 sal_Size ave = nbuf >> cache->m_hash_shift;
-// coverity[negative_shift]
-sal_Size new_size = cache->m_hash_size << (highbit(ave) - 1);
+const auto bit = highbit(ave);
+assert(bit > 0);
+sal_Size new_size = cache->m_hash_size << (bit - 1);
 
 cache->m_features |= RTL_CACHE_FEATURE_RESCALE;
 RTL_MEMORY_LOCK_RELEASE(&(cache->m_slab_lock));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-bugs] [Bug 105311] Windows Installer: C-Runtime DLLs installed in wrong directory

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=105311

DavidO  changed:

   What|Removed |Added

 QA Contact||d.ostrov...@gmx.de

--- Comment #3 from DavidO  ---
CHANGE_UNDER_REVIEW: https://gerrit.libreoffice.org/33366

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 97160] Selecting OpenGL causes applications to crash on launch

2017-01-22 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=97160

Aron Budea  changed:

   What|Removed |Added

 Status|NEEDINFO|NEW
 CC||ba...@caesar.elte.hu
   Severity|normal  |major

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-commits] core.git: Branch 'refs/notes/commits' - ab/ac52c9920988f2f169436de74ba62805a57fd8

2017-01-22 Thread Caolán McNamara
 ab/ac52c9920988f2f169436de74ba62805a57fd8 |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 52783eb3bd61ace90b4969bf0a2ac36d53b16092
Author: Caolán McNamara 
Date:   Sun Jan 22 21:09:39 2017 +

Notes added by 'git notes add'

diff --git a/ab/ac52c9920988f2f169436de74ba62805a57fd8 
b/ab/ac52c9920988f2f169436de74ba62805a57fd8
new file mode 100644
index 000..8ebbe55
--- /dev/null
+++ b/ab/ac52c9920988f2f169436de74ba62805a57fd8
@@ -0,0 +1 @@
+ignore: obsolete
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   3   >