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

2021-04-10 Thread Michael Meeks (via logerrit)
New branch 'feature/docx-commentsex' available with the following commits:
commit b0fc51bd57f0ea67466c272ba3d91adbb183d261
Author: Michael Meeks 
Date:   Sat Apr 10 22:25:41 2021 +0100

First cut at export of comments extended data to docx.

Change-Id: Ie75d45bda47a4d33a1045687045c9a3ca3b82cbe

commit a5fbac223ae42b2a1ad9710546c11913c6f464d7
Author: Michael Meeks 
Date:   Fri Apr 9 22:04:12 2021 +0100

First cut at extended document comment / Resolve state reading.

Change-Id: Ib10ff736a30a8838e46b72d4f34fde45ee668479

commit ed27e44048f3e17a76e77b8567c4827ba1571046
Author: Michael Meeks 
Date:   Fri Mar 26 17:03:49 2021 +

lok: mark strings static after pre-init, not after the fork.

Change-Id: I1fbd4a9ef1e07ec87ca194128ed35de1dc429993

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


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 6 commits - framework/source sc/source sfx2/source

2021-04-05 Thread Michael Meeks (via logerrit)
 framework/source/layoutmanager/helpers.cxx |6 ++
 sc/source/core/data/table2.cxx |   23 ++-
 sc/source/ui/view/viewdata.cxx |7 ++-
 sfx2/source/sidebar/DeckLayouter.cxx   |7 ++-
 sfx2/source/sidebar/SidebarController.cxx  |9 +++--
 sfx2/source/sidebar/TabBar.cxx |5 +
 sfx2/source/view/lokhelper.cxx |3 +++
 7 files changed, 51 insertions(+), 9 deletions(-)

New commits:
commit 129a42fd08850226eb3eed0dce2fb923b4d48697
Author: Michael Meeks 
AuthorDate: Fri Jan 22 21:10:49 2021 +
Commit: Michael Meeks 
CommitDate: Mon Apr 5 20:26:56 2021 +0100

lok: avoid expensive fetching of a property.

--doc_setView
   SfxLokHelper::setView
   SfxViewFrame::MakeActive_Impl
   SfxApplication::SetViewFrame_Impl
   |
--SfxDispatcher::Update_Impl
  |
   --SfxWorkWindow::UpdateObjectBars_Impl
 SfxWorkWindow::UpdateObjectBars_Impl2
 |
  --framework::LayoutManager::requestElement
framework::LayoutManager::createElement
|
--11.97%--framework::implts_isPreviewModel

We re-calculate the calc print-area on every setView via this
code-path; pointlessly expensive.

Change-Id: I36dbdc60a789fac4e2a82825b145725a4a4d6439
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109805
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/framework/source/layoutmanager/helpers.cxx 
b/framework/source/layoutmanager/helpers.cxx
index 7c620b699fcd..f5fe1fc48f44 100644
--- a/framework/source/layoutmanager/helpers.cxx
+++ b/framework/source/layoutmanager/helpers.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -261,6 +262,11 @@ uno::Reference< frame::XModel > impl_getModelFromFrame( 
const uno::Reference< fr
 
 bool implts_isPreviewModel( const uno::Reference< frame::XModel >& xModel )
 {
+// the cost in calc of calling getArgs for this property
+// includes measuring the entire sheet - which is extremely slow.
+if (comphelper::LibreOfficeKit::isActive())
+return false;
+
 if ( xModel.is() )
 {
 utl::MediaDescriptor aDesc( xModel->getArgs() );
commit 2519a7d1392ecec9bd8027117bb02b08fb7bcfa8
Author: Michael Meeks 
AuthorDate: Fri Jan 22 21:17:25 2021 +0000
Commit: Michael Meeks 
CommitDate: Mon Apr 5 20:26:56 2021 +0100

sc: GetRowForHeight performance improvement.

Instead of just skipping hidden rows, either skip or interpolate
into visible ones.

This method, and it's single caller look rather unusual to me. It is
unclear why we would want to return the results we do, and why the
one caller subtracts a row.

Some surprising proportion of tile rendering was exercising this code
path extremely slowly.

--5.94%--ScDocument::GetPrintArea
  |
  |--5.04%--ScDrawLayer::GetPrintArea
  |  ScTable::GetRowForHeight
  |  |
  |   --4.58%--ScFlatBoolRowSegments::getRangeData
  | |
  |  --2.46%--ScFlatSegmentsImpl::getRangeData

Change-Id: I75418d6af59a33b99e8bb0c374139e1a4ee6ef87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109837
Tested-by: Jenkins CollaboraOffice 
    Tested-by: Michael Meeks 
Reviewed-by: Ashod Nakashian 
    Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109848
Tested-by: Jenkins

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 02a9ad19cbaf..33ca0d85128f 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -3998,16 +3998,25 @@ SCROW ScTable::GetRowForHeight(sal_uLong nHeight) const
 break;
 }
 
-nSum += aRowHeightRange.mnValue;
+// find the last common row between hidden & height spans
+SCROW nLastCommon = std::min(aData.mnRow2, aRowHeightRange.mnRow2);
+assert (nLastCommon >= nRow);
+SCROW nCommon = nLastCommon - nRow + 1;
 
-if (nSum > nHeight)
+// how much further to go ?
+sal_uLong nPixelsLeft = nHeight - nSum;
+sal_uLong nCommonPixels = aRowHeightRange.mnValue * nCommon;
+
+// are we in the zone ?
+if (nCommonPixels > nPixelsLeft)
 {
+nRow += (nPixelsLeft + aRowHeightRange.mnValue - 1) / 
aRowHeightRange.mnValue;
+
+// FIXME: finding this next row is far from elegant,
+// we have a single caller, which subtracts one as well(!?)
 if (nRow >= rDocument.MaxRow())
 return rDocument.MaxRow();
 
-// Find the

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

2021-03-26 Thread Michael Meeks (via logerrit)
 desktop/source/lib/init.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit f96004096268f5e71120678e32fc8c74055819aa
Author: Michael Meeks 
AuthorDate: Fri Mar 26 17:03:49 2021 +
Commit: Michael Meeks 
CommitDate: Fri Mar 26 20:42:35 2021 +0100

lok: mark strings static after pre-init, not after the fork.

Change-Id: I1fbd4a9ef1e07ec87ca194128ed35de1dc429993
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113127
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 031bd2625b22..0112f503cc65 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -6135,8 +6135,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 
 if (eStage == PRE_INIT)
 rtl_alloc_preInit(true);
-else if (eStage == SECOND_INIT)
-rtl_alloc_preInit(false);
 
 if (eStage != SECOND_INIT)
 comphelper::LibreOfficeKit::setActive();
@@ -6387,6 +6385,10 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 activateNotebookbar(u"Draw");
 }
 
+// staticize all strings.
+if (eStage == PRE_INIT)
+rtl_alloc_preInit(false);
+
 return bInitialized;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


-> ESC agenda

2021-03-19 Thread Michael Meeks
Hi Lubos, Julian, all,

I'd really like to encourage you not to pre-emptively give up on the
governance that we do have =)

It seems clear that some people object to this change; and it seems
clear that there was not a full discussion that reflected that at the ESC:

On 18/03/2021 18:17, julien2412 wrote:
> No need to come since it's easier for me to write (no schedule 
> constraints for example) and the migration will be done anyway, no 
> need to worry My goal was just to thank a lot Luboš and to
> provide arguments against the migration. Nevertheless, I already knew
> the battle, battle against this censorship (I weigh my words) was
> lost.

Well - if you feel strongly; I'd encourage you to come and make your
point - or for at least someone to speak out.

From my perspective it is -really- important that people can speak up
and say what they think. Ideally in a constructive and as balanced a way
as possible, avoiding overly emotive or simplified constructions - that
makes it easier for everyone to be heard.

I really don't think there is a foregone conclusion.

On 18/03/2021 20:04, Luboš Luňák wrote:
> in order to make the discussion somewhat more constructive, I have
> an alternative proposal on how to resolve the problem.

I'd love you to come and propose that.

I'm also aware that some people are concerned that this turns into a
much wider and more concerning project than it is ie. the slippery slope
argument.

I'm not so convinced about that - but its easy to avoid that by hearing
Thorsten's bigger-picture plan here.

So - thanks for raising this; I'd really like to end the thread here -
and take it to the next ESC meeting.

Miklos - can you put it on the agenda ?

Thanks,

Michael.

-- 
michael.me...@collabora.com <><, GM Collabora Productivity
Hangout: mejme...@gmail.com, Skype: mmeeks
(M) +44 7795 666 147 - timezone usually UK / Europe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: ANN: renaming of master branch to "main" for core repository and submodules (dictionaries, help, translations)

2021-03-18 Thread Michael Meeks


On 18/03/2021 14:19, julien2412 wrote:
> About "master"

So - there are huge tracts that can be written about this from many
perspectives; Dominus Illuminatio Mea =)

The "thin end of the wedge" argument is an interesting one, clearly
there is lots of scope for confrontation, division and aggression around
this sort of thing and hurt feelings. But I think it is worth looking at
this on its own merits.

For my part I support the change - assuming some of the more telling
objections Lubos pointed out - eg. around the default branch that is
checked out when you 'git clone' can be solved elegantly.

I thought:

https://tools.ietf.org/html/draft-knodel-terminology-02

Had a mercifully bounded set of words to replace that doesn't look like
it will grow indefinitely.

> the expressions "MC"/"Master of Ceremony" in music,

I do agree it is possible to carry this far too far. However its easy
to see how things like the unthinking use of eg. 'blacklist' can be seen
as bad - that seems like a slam-dunk to me.

Having said all that - I think it's really important that people can
have their say, and that people's differing views are respected - and
fears of a possible terminological tyranny are laid to rest =) Also,
that we treat each other gently.

Probably we should discuss it at the next ESC - and encourage those who
care about the topic to discuss it there rather than in some straggling
list thread (which tends to polarize).

Hopefully you would be able to come ?

Regards,

Michael.

-- 
michael.me...@collabora.com <><, GM Collabora Productivity
Hangout: mejme...@gmail.com, Skype: mmeeks
(M) +44 7795 666 147 - timezone usually UK / Europe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


breaking yield loops on forced quit.

2021-03-12 Thread Michael Meeks
Hi Noel,

We've recently had problems with dialogs running in Online Kit
processes that are not cleaning up properly when the process is asked
to quit by the core.

The proximate fix is/was to hard kill the remote process =)
but - I'd love to do better if possible.

If you see vcl's:

Dialog::Execute () ...

// Yield util EndDialog is called or dialog gets destroyed
// (the latter should not happen, but better safe than sorry
while ( !xWindow->IsDisposed() && mbInExecute )
Application::Yield();

You see one of these:

while (condition)
Application::Yield();

archetypes. Of which there a dozen+ scattered around the code eg.

sfx2/source/doc/printhelper.cxx-while( m_pPrinter->IsPrinting() 
)
sfx2/source/doc/printhelper.cxx:Application::Yield();

etc. etc.

We really want to forcibly exit these loops when we have our
VCL quit flag set cf.

vcl/headless/svpinst.cxx-// External poll.
vcl/headless/svpinst.cxx-if (pSVData->mpPollClosure != nullptr 
&&
vcl/headless/svpinst.cxx:
pSVData->mpPollCallback(pSVData->mpPollClosure, nTimeoutMicroS) < 0)
vcl/headless/svpinst.cxx-pSVData->maAppData.mbAppQuit = 
true;

Not least because Application:Yield becomes an instant-return when
we're trying to quit. So - we could add a flag:

while (condition && !(new Application::mbAppQuit accessor)) 

to all suspicious looking call-sites.

Perhaps it'd be nicer to have a:

Application::YieldWhile([]{ return m_pPrinter->IsPrinting(); });

or somesuch - so we can add that this just once (?)

Thoughts appreciated =)

Michael.

-- 
michael.me...@collabora.com <><, GM Collabora Productivity
Hangout: mejme...@gmail.com, Skype: mmeeks
(M) +44 7795 666 147 - timezone usually UK / Europe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2021-03-11 Thread Michael Meeks (via logerrit)
 sfx2/source/view/lokhelper.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 40c58f6039fb02cff74e442f6adc5ba38adcff1d
Author: Michael Meeks 
AuthorDate: Sun Jan 24 04:10:41 2021 +
Commit: Michael Meeks 
CommitDate: Thu Mar 11 17:06:14 2021 +0100

lok: avoid a set of invalidations per view on re-size.

Unfortunate to have N^2 invalidations in the number of views on
resize - particularly for calc, when you re-size/wrap-text on a
row during editing.

Change-Id: I93f75c4543ad072684e5575a2cbe0e8abcab0d80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109913
Reviewed-by: Jan Holesovsky 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112094
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 2a5ea882d92d..0da6b9b88682 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -539,7 +539,10 @@ void 
SfxLokHelper::notifyDocumentSizeChangedAllViews(vcl::ITiledRenderable* pDoc
 // Should we then do this for all views of all open documents
 // or not?
 if (pCurrentViewShell == nullptr || pViewShell->GetDocId() == 
pCurrentViewShell-> GetDocId())
+{
 SfxLokHelper::notifyDocumentSizeChanged(pViewShell, "", pDoc, 
bInvalidateAll);
+bInvalidateAll = false; // we direct invalidations to all views 
anyway.
+}
 pViewShell = SfxViewShell::GetNext(*pViewShell);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-02 Thread Michael Meeks (via logerrit)
 sc/source/ui/app/inputwin.cxx  |5 +
 sc/source/ui/unoobj/docuno.cxx |5 -
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit b1a5dd9f302b2ae278aef1a90536796e8c98757a
Author: Michael Meeks 
AuthorDate: Thu Feb 4 14:35:04 2021 +
Commit: Michael Meeks 
CommitDate: Tue Mar 2 11:18:32 2021 +0100

lok: sc - suppress LOK editengine events for the calc input bar.

The calc input uses an EditEngine - but it emits events as if it is
part of the document - as well as emitting events as if it is a dialog
window. This causes horrible jumping artifacts to the top of the
document with word auto-completion and typing in cells a few page down.

Also remove obsolete tweak to turn off autocorrect for LOK, since
it was contradicted by: 1f0943e5e9432f96daff9f3b006388d5bc7415b2

Change-Id: I7352cd3b5ca6d18645cfd9e18959b0e44ec969d7
Signed-off-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110422
Tested-by: Jenkins

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 0429da49731c..8974bbc2cf2c 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1510,6 +1510,11 @@ void ScTextWnd::InitEditEngine()
 
static_cast(m_xEditEngine.get())->SetTextCurrentDefaults(aString);
 // At least the right text then
 
 m_xEditView = std::make_unique(m_xEditEngine.get(), nullptr);
+
+// we get cursor, selection etc. messages from the VCL/window layer
+// otherwise these are injected into the document causing confusion.
+m_xEditView->SuppressLOKMessages(true);
+
 m_xEditView->setEditViewCallbacks(this);
 m_xEditView->SetInsertMode(bIsInsertMode);
 
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 1cfcb23aad8e..5ba795cf5298 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1159,11 +1159,6 @@ void ScModelObj::initializeForTiledRendering(const 
css::uno::SequenceGetAppOptions() );
-aAppOptions.SetAutoComplete(false);
-SC_MOD()->SetAppOptions(aAppOptions);
-
 for (const beans::PropertyValue& rValue : rArguments)
 {
 if (rValue.Name == ".uno:SpellOnline" && rValue.Value.has())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-26 Thread Michael Meeks (via logerrit)
 sc/source/ui/view/tabvwsh3.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit edf8d6ff1049127514e1214e495ec56235924a36
Author: Michael Meeks 
AuthorDate: Thu Feb 25 21:44:40 2021 +
Commit: Michael Meeks 
CommitDate: Fri Feb 26 14:50:51 2021 +0100

lok: mark calc document as modified when adjusting split-panes.

Change-Id: I592ee4dc4317f27fae24141b2052475ef26e9fc4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111582
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index ba53e099f539..06aac0a795db 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -1029,6 +1029,8 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
 rOtherBind.Invalidate( SID_WINDOW_FIX_COL );
 rOtherBind.Invalidate( SID_WINDOW_FIX_ROW );
 });
+if (!GetViewData().GetDocShell()->IsReadOnly())
+GetViewData().GetDocShell()->SetDocumentModified();
 }
 }
 }
___
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-6.4' - sc/source

2021-02-26 Thread Michael Meeks (via logerrit)
 sc/source/ui/view/tabvwsh3.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 6438cf7d2f48d400d0bb95e6e803e3385f763327
Author: Michael Meeks 
AuthorDate: Thu Feb 25 21:44:40 2021 +
Commit: Dennis Francis 
CommitDate: Fri Feb 26 12:12:44 2021 +0100

lok: mark calc document as modified when adjusting split-panes.

Change-Id: I592ee4dc4317f27fae24141b2052475ef26e9fc4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111599
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 0570e0b76385..44bb6adcfb9e 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -973,6 +973,8 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
 rOtherBind.Invalidate( SID_WINDOW_FIX_COL );
 rOtherBind.Invalidate( SID_WINDOW_FIX_ROW );
 });
+if (!GetViewData().GetDocShell()->IsReadOnly())
+GetViewData().GetDocShell()->SetDocumentModified();
 }
 }
 }
___
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-6.4' - sc/source

2021-02-04 Thread Michael Meeks (via logerrit)
 sc/source/ui/app/inputwin.cxx  |4 
 sc/source/ui/unoobj/docuno.cxx |5 -
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 91319ad56887f932b2da334db560d5d0a79a0280
Author: Michael Meeks 
AuthorDate: Thu Feb 4 14:35:04 2021 +
Commit: Henry Castro 
CommitDate: Thu Feb 4 19:35:01 2021 +0100

lok: sc - suppress LOK editengine events for the calc input bar.

The calc input uses an EditEngine - but it emits events as if it is
part of the document - as well as emitting events as if it is a dialog
window. This causes horrible jumping artifacts to the top of the
document with word auto-completion and typing in cells a few page down.

Also remove obsolete tweak to turn off autocorrect for LOK, since
it was contradicted by: 1f0943e5e9432f96daff9f3b006388d5bc7415b2

Change-Id: I7352cd3b5ca6d18645cfd9e18959b0e44ec969d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110419
Tested-by: Jenkins CollaboraOffice 
Tested-by: Henry Castro 
Reviewed-by: Henry Castro 

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 20ef9abf3742..b106a188dbd3 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1518,6 +1518,10 @@ void ScTextWnd::InitEditEngine()
 mpEditEngine->SetText(aString); // At least the right text then
 
 mpEditView = std::make_unique(mpEditEngine.get(), this);
+
+// we get cursor, selection etc. messages from the VCL/window layer
+// otherwise these are injected into the document causing confusion.
+mpEditView->SupressLOKMessages(true);
 mpEditView->SetInsertMode(bIsInsertMode);
 
 if (comphelper::LibreOfficeKit::isActive())
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 9d2539a25bcd..0e74d7dd5cda 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1177,11 +1177,6 @@ void ScModelObj::initializeForTiledRendering(const 
css::uno::SequenceGetAppOptions() );
-aAppOptions.SetAutoComplete(false);
-SC_MOD()->SetAppOptions(aAppOptions);
-
 for (const beans::PropertyValue& rValue : rArguments)
 {
 if (rValue.Name == ".uno:SpellOnline" && rValue.Value.has())
___
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-6.4' - sfx2/source

2021-01-28 Thread Michael Meeks (via logerrit)
 sfx2/source/view/lokhelper.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 4fab953fe24943152cfdbbc88b0d904be73c8514
Author: Michael Meeks 
AuthorDate: Sun Jan 24 04:10:41 2021 +
Commit: Michael Meeks 
CommitDate: Thu Jan 28 15:38:13 2021 +0100

lok: avoid a set of invalidations per view on re-size.

Unfortunate to have N^2 invalidations in the number of views on
resize - particularly for calc, when you re-size/wrap-text on a
row during editing.

Change-Id: I93f75c4543ad072684e5575a2cbe0e8abcab0d80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109913
Reviewed-by: Jan Holesovsky 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 4928dd3102e9..3c1ecd207159 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -530,7 +530,10 @@ void 
SfxLokHelper::notifyDocumentSizeChangedAllViews(vcl::ITiledRenderable* pDoc
 // Should we then do this for all views of all open documents
 // or not?
 if (pCurrentViewShell == nullptr || pViewShell->GetDocId() == 
pCurrentViewShell-> GetDocId())
+{
 SfxLokHelper::notifyDocumentSizeChanged(pViewShell, "", pDoc, 
bInvalidateAll);
+bInvalidateAll = false; // we direct invalidations to all views 
anyway.
+}
 pViewShell = SfxViewShell::GetNext(*pViewShell);
 }
 }
___
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-6.4' - framework/source

2021-01-28 Thread Michael Meeks (via logerrit)
 framework/source/layoutmanager/helpers.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit ba18bb5729a01d3325ebf554263af6cf7a475c28
Author: Michael Meeks 
AuthorDate: Fri Jan 22 21:10:49 2021 +
Commit: Michael Meeks 
CommitDate: Thu Jan 28 15:33:46 2021 +0100

lok: avoid expensive fetching of a property.

--doc_setView
   SfxLokHelper::setView
   SfxViewFrame::MakeActive_Impl
   SfxApplication::SetViewFrame_Impl
   |
--SfxDispatcher::Update_Impl
  |
   --SfxWorkWindow::UpdateObjectBars_Impl
 SfxWorkWindow::UpdateObjectBars_Impl2
 |
  --framework::LayoutManager::requestElement
framework::LayoutManager::createElement
|
--11.97%--framework::implts_isPreviewModel

We re-calculate the calc print-area on every setView via this
code-path; pointlessly expensive.

Change-Id: I36dbdc60a789fac4e2a82825b145725a4a4d6439
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109836
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 
Reviewed-by: Michael Meeks 

diff --git a/framework/source/layoutmanager/helpers.cxx 
b/framework/source/layoutmanager/helpers.cxx
index bb858b33b5e7..c39c22788c70 100644
--- a/framework/source/layoutmanager/helpers.cxx
+++ b/framework/source/layoutmanager/helpers.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -262,6 +263,11 @@ uno::Reference< frame::XModel > impl_getModelFromFrame( 
const uno::Reference< fr
 
 bool implts_isPreviewModel( const uno::Reference< frame::XModel >& xModel )
 {
+// the cost in calc of calling getArgs for this property
+// includes measuring the entire sheet - which is extremely slow.
+if (comphelper::LibreOfficeKit::isActive())
+return false;
+
 if ( xModel.is() )
 {
 utl::MediaDescriptor aDesc( xModel->getArgs() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-23 Thread Michael Meeks (via logerrit)
 sc/source/core/data/table2.cxx |   23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)

New commits:
commit b35f6971561bc095965e82f230e0307f6694228b
Author: Michael Meeks 
AuthorDate: Fri Jan 22 21:17:25 2021 +
Commit: Michael Meeks 
CommitDate: Sun Jan 24 03:01:59 2021 +0100

sc: GetRowForHeight performance improvement.

Instead of just skipping hidden rows, either skip or interpolate
into visible ones.

This method, and it's single caller look rather unusual to me. It is
unclear why we would want to return the results we do, and why the
one caller subtracts a row.

Some surprising proportion of tile rendering was exercising this code
path extremely slowly.

--5.94%--ScDocument::GetPrintArea
  |
  |--5.04%--ScDrawLayer::GetPrintArea
  |  ScTable::GetRowForHeight
  |  |
  |   --4.58%--ScFlatBoolRowSegments::getRangeData
  | |
  |  --2.46%--ScFlatSegmentsImpl::getRangeData

Change-Id: I75418d6af59a33b99e8bb0c374139e1a4ee6ef87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109837
Tested-by: Jenkins CollaboraOffice 
Tested-by: Michael Meeks 
Reviewed-by: Ashod Nakashian 
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109848
Tested-by: Jenkins

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 1ddf2993b170..a980774c7b9d 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -3996,16 +3996,25 @@ SCROW ScTable::GetRowForHeight(sal_uLong nHeight) const
 break;
 }
 
-nSum += aRowHeightRange.mnValue;
+// find the last common row between hidden & height spans
+SCROW nLastCommon = std::min(aData.mnRow2, aRowHeightRange.mnRow2);
+assert (nLastCommon >= nRow);
+SCROW nCommon = nLastCommon - nRow + 1;
 
-if (nSum > nHeight)
+// how much further to go ?
+sal_uLong nPixelsLeft = nHeight - nSum;
+sal_uLong nCommonPixels = aRowHeightRange.mnValue * nCommon;
+
+// are we in the zone ?
+if (nCommonPixels > nPixelsLeft)
 {
+nRow += (nPixelsLeft + aRowHeightRange.mnValue - 1) / 
aRowHeightRange.mnValue;
+
+// FIXME: finding this next row is far from elegant,
+// we have a single caller, which subtracts one as well(!?)
 if (nRow >= rDocument.MaxRow())
 return rDocument.MaxRow();
 
-// Find the next visible row.
-++nRow;
-
 if (!mpHiddenRows->getRangeData(nRow, aData))
 // Failed to fetch the range data for whatever reason.
 break;
@@ -4016,6 +4025,10 @@ SCROW ScTable::GetRowForHeight(sal_uLong nHeight) const
 
 return nRow <= rDocument.MaxRow() ? nRow : rDocument.MaxRow();
 }
+
+// skip the range and keep hunting
+nSum += nCommonPixels;
+nRow = nLastCommon;
 }
 return -1;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-23 Thread Michael Meeks (via logerrit)
 framework/source/layoutmanager/helpers.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 27cec4edf112ba65d8c9d264c00cb39e2415a8cd
Author: Michael Meeks 
AuthorDate: Fri Jan 22 21:10:49 2021 +
Commit: Michael Meeks 
CommitDate: Sun Jan 24 03:01:40 2021 +0100

lok: avoid expensive fetching of a property.

--doc_setView
   SfxLokHelper::setView
   SfxViewFrame::MakeActive_Impl
   SfxApplication::SetViewFrame_Impl
   |
--SfxDispatcher::Update_Impl
  |
   --SfxWorkWindow::UpdateObjectBars_Impl
 SfxWorkWindow::UpdateObjectBars_Impl2
 |
  --framework::LayoutManager::requestElement
framework::LayoutManager::createElement
|
--11.97%--framework::implts_isPreviewModel

We re-calculate the calc print-area on every setView via this
code-path; pointlessly expensive.

Change-Id: I36dbdc60a789fac4e2a82825b145725a4a4d6439
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109805
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/framework/source/layoutmanager/helpers.cxx 
b/framework/source/layoutmanager/helpers.cxx
index 7c620b699fcd..f5fe1fc48f44 100644
--- a/framework/source/layoutmanager/helpers.cxx
+++ b/framework/source/layoutmanager/helpers.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -261,6 +262,11 @@ uno::Reference< frame::XModel > impl_getModelFromFrame( 
const uno::Reference< fr
 
 bool implts_isPreviewModel( const uno::Reference< frame::XModel >& xModel )
 {
+// the cost in calc of calling getArgs for this property
+// includes measuring the entire sheet - which is extremely slow.
+if (comphelper::LibreOfficeKit::isActive())
+return false;
+
 if ( xModel.is() )
 {
 utl::MediaDescriptor aDesc( xModel->getArgs() );
___
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-6.4' - sc/source

2021-01-23 Thread Michael Meeks (via logerrit)
 sc/source/core/data/table2.cxx |   23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)

New commits:
commit d12db838aa9da414af999707f531e5d34784772c
Author: Michael Meeks 
AuthorDate: Fri Jan 22 21:17:25 2021 +
Commit: Michael Meeks 
CommitDate: Sun Jan 24 01:05:52 2021 +0100

sc: GetRowForHeight performance improvement.

Instead of just skipping hidden rows, either skip or interpolate
into visible ones.

This method, and it's single caller look rather unusual to me. It is
unclear why we would want to return the results we do, and why the
one caller subtracts a row.

Some surprising proportion of tile rendering was exercising this code
path extremely slowly.

--5.94%--ScDocument::GetPrintArea
  |
  |--5.04%--ScDrawLayer::GetPrintArea
  |  ScTable::GetRowForHeight
  |  |
  |   --4.58%--ScFlatBoolRowSegments::getRangeData
  | |
  |  --2.46%--ScFlatSegmentsImpl::getRangeData

Change-Id: I75418d6af59a33b99e8bb0c374139e1a4ee6ef87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109837
Tested-by: Jenkins CollaboraOffice 
Tested-by: Michael Meeks 
Reviewed-by: Ashod Nakashian 
Reviewed-by: Michael Meeks 

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 5a12b0bba520..971c8ad7cd31 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -3971,16 +3971,25 @@ SCROW ScTable::GetRowForHeight(sal_uLong nHeight) const
 break;
 }
 
-nSum += aRowHeightRange.mnValue;
+// find the last common row between hidden & height spans
+SCROW nLastCommon = std::min(aData.mnRow2, aRowHeightRange.mnRow2);
+assert (nLastCommon >= nRow);
+SCROW nCommon = nLastCommon - nRow + 1;
 
-if (nSum > nHeight)
+// how much further to go ?
+sal_uLong nPixelsLeft = nHeight - nSum;
+sal_uLong nCommonPixels = aRowHeightRange.mnValue * nCommon;
+
+// are we in the zone ?
+if (nCommonPixels > nPixelsLeft)
 {
+nRow += (nPixelsLeft + aRowHeightRange.mnValue - 1) / 
aRowHeightRange.mnValue;
+
+// FIXME: finding this next row is far from elegant,
+// we have a single caller, which subtracts one as well(!?)
 if (nRow >= pDocument->MaxRow())
 return pDocument->MaxRow();
 
-// Find the next visible row.
-++nRow;
-
 if (!mpHiddenRows->getRangeData(nRow, aData))
 // Failed to fetch the range data for whatever reason.
 break;
@@ -3991,6 +4000,10 @@ SCROW ScTable::GetRowForHeight(sal_uLong nHeight) const
 
 return nRow <= pDocument->MaxRow() ? nRow : pDocument->MaxRow();
 }
+
+// skip the range and keep hunting
+nSum += nCommonPixels;
+nRow = nLastCommon;
 }
 return -1;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: Calc memory consumption

2021-01-21 Thread Michael Meeks


On 20/01/2021 10:29, Daniel A. Rodriguez wrote:
>>> Hi, exists some kind of formula to estimate how much RAM a spreadsheet
>>> could use? For instance 468K rows and columns from A to AG.
>
> Well, trying to do something with such file using an i3 based PC with
> 4Gb freezes the software completely.

Both Tor and Noel are right; but I collect the 'shape' of pathological
spreadsheets as a hobby =)

Can you tell me:

+ what data-type is in each column
+ whether the column is sparse (ie, are
  there 'holes' in the data)
+ what formulae are used - and what their shape is ?
+ hopefully formulae are normally
  non-confidential
+ what file format you're using.

But of course, this really doesn't belong on the dev list, but in a bug
if you have one ?

In case nothing jumps out of the above data, possibly running a
sampling profiler under Linux like 'perf' might show what's being slow,
though I imagine it sounds like a memory issue (perhaps even a transient
memory use) problem.

Thanks ! =)

Michael.

-- 
michael.me...@collabora.com <><, GM Collabora Productivity
Hangout: mejme...@gmail.com, Skype: mmeeks
(M) +44 7795 666 147 - timezone usually UK / Europe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sfx2/source

2021-01-18 Thread Michael Meeks (via logerrit)
 sfx2/source/sidebar/DeckLayouter.cxx  |7 ++-
 sfx2/source/sidebar/SidebarController.cxx |6 +-
 sfx2/source/sidebar/TabBar.cxx|5 +
 3 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit e8b98ef6c2b4e8cbcb83309fdcafb1cb8289dfa6
Author: Michael Meeks 
AuthorDate: Sat Jan 16 17:56:34 2021 +
Commit: Andras Timar 
CommitDate: Mon Jan 18 15:53:31 2021 +0100

sidebar: avoid invalidation thrash with LOK.

Avoids complete sidebar invalidate when entering text into a cell
and hitting enter.

Change-Id: I88ee3792589a1c0a16ae555da77ed7c12ca5f296
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109455
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/sfx2/source/sidebar/DeckLayouter.cxx 
b/sfx2/source/sidebar/DeckLayouter.cxx
index bc1bf6e93986..71d732f48cbc 100644
--- a/sfx2/source/sidebar/DeckLayouter.cxx
+++ b/sfx2/source/sidebar/DeckLayouter.cxx
@@ -613,7 +613,12 @@ void UpdateFiller (
 vcl::Window& rFiller,
 const tools::Rectangle& rBox)
 {
-if (rBox.GetHeight() > 0)
+if (comphelper::LibreOfficeKit::isActive())
+{
+// Not shown on LOK, and causes invalidation thrash
+rFiller.Hide();
+}
+else if (rBox.GetHeight() > 0)
 {
 // Show the filler.
 
rFiller.SetBackground(Theme::GetPaint(Theme::Paint_PanelBackground).GetWallpaper());
diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index d6c1103850e2..bb1592627c94 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -797,7 +797,11 @@ void SidebarController::SwitchToDeck (
 
 msCurrentDeckId = rDeckDescriptor.msId;
 }
-mpTabBar->Invalidate();
+
+// invisible with LOK, so avoid invalidations
+if (!comphelper::LibreOfficeKit::isActive())
+mpTabBar->Invalidate();
+
 mpTabBar->HighlightDeck(msCurrentDeckId);
 
 // Determine the panels to display in the deck.
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index 96b00f54939e..3dd2af4b7874 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -30,6 +30,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -108,6 +109,10 @@ sal_Int32 TabBar::GetDefaultWidth()
 
 void TabBar::SetDecks(const ResourceManager::DeckContextDescriptorContainer& 
rDecks)
 {
+// invisible with LOK, so keep empty to avoid invalidations
+if (comphelper::LibreOfficeKit::isActive())
+return;
+
 // Remove the current buttons.
 {
 for (auto & item : maItems)
___
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-6.4' - sfx2/source

2021-01-18 Thread Michael Meeks (via logerrit)
 sfx2/source/sidebar/Deck.cxx |7 +--
 sfx2/source/sidebar/TitleBar.cxx |   14 ++
 2 files changed, 15 insertions(+), 6 deletions(-)

New commits:
commit 077eb097fd0b0429286c2a61eef923c56ad9685e
Author: Michael Meeks 
AuthorDate: Sat Jan 16 17:56:06 2021 +
Commit: Andras Timar 
CommitDate: Mon Jan 18 15:53:17 2021 +0100

sidebar: only invalidate when things change.

Change-Id: Icc9c5bcde224cc979b834585531b847f1c5f7d0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109454
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index f25d5015fe8f..a2c092157008 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -444,8 +444,11 @@ void 
Deck::ScrollContainerWindow::Paint(vcl::RenderContext& rRenderContext, cons
 
 void Deck::ScrollContainerWindow::SetSeparators (const 
::std::vector& rSeparators)
 {
-maSeparators = rSeparators;
-Invalidate();
+if (rSeparators != maSeparators)
+{
+maSeparators = rSeparators;
+Invalidate();
+}
 }
 
 } } // end of namespace sfx2::sidebar
diff --git a/sfx2/source/sidebar/TitleBar.cxx b/sfx2/source/sidebar/TitleBar.cxx
index 8f45bb751c0c..d8e0aef1a48c 100644
--- a/sfx2/source/sidebar/TitleBar.cxx
+++ b/sfx2/source/sidebar/TitleBar.cxx
@@ -61,14 +61,20 @@ void TitleBar::dispose()
 
 void TitleBar::SetTitle(const OUString& rsTitle)
 {
-msTitle = rsTitle;
-Invalidate();
+if (msTitle != rsTitle)
+{
+msTitle = rsTitle;
+Invalidate();
+}
 }
 
 void TitleBar::SetIcon(const Image& rIcon)
 {
-maIcon = rIcon;
-Invalidate();
+if (maIcon != rIcon)
+{
+maIcon = rIcon;
+Invalidate();
+}
 }
 
 void TitleBar::ApplySettings(vcl::RenderContext& rRenderContext)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-16 Thread Michael Meeks (via logerrit)
 sfx2/source/sidebar/Deck.cxx  |7 +--
 sfx2/source/sidebar/DeckLayouter.cxx  |7 ++-
 sfx2/source/sidebar/SidebarController.cxx |6 +-
 sfx2/source/sidebar/TabBar.cxx|5 +
 4 files changed, 21 insertions(+), 4 deletions(-)

New commits:
commit eecedf21f4869dd52a6498377e35d85d2321ac80
Author: Michael Meeks 
AuthorDate: Sat Jan 16 17:56:34 2021 +
Commit: Michael Meeks 
CommitDate: Sun Jan 17 00:13:56 2021 +0100

sidebar: avoid invalidation thrash with LOK.

Avoids complete sidebar invalidate when entering text into a cell
and hitting enter.

Change-Id: I88ee3792589a1c0a16ae555da77ed7c12ca5f296
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109403
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/sfx2/source/sidebar/DeckLayouter.cxx 
b/sfx2/source/sidebar/DeckLayouter.cxx
index c4c9cd4b9a81..f90ec176b2d0 100644
--- a/sfx2/source/sidebar/DeckLayouter.cxx
+++ b/sfx2/source/sidebar/DeckLayouter.cxx
@@ -613,7 +613,12 @@ void UpdateFiller (
 vcl::Window& rFiller,
 const tools::Rectangle& rBox)
 {
-if (rBox.GetHeight() > 0)
+if (comphelper::LibreOfficeKit::isActive())
+{
+// Not shown on LOK, and causes invalidation thrash
+rFiller.Hide();
+}
+else if (rBox.GetHeight() > 0)
 {
 // Show the filler.
 rFiller.SetBackground(Theme::GetColor(Theme::Color_PanelBackground));
diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index 168719f84d23..60013c9b9274 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -793,7 +793,11 @@ void SidebarController::SwitchToDeck (
 
 msCurrentDeckId = rDeckDescriptor.msId;
 }
-mpTabBar->Invalidate();
+
+// invisible with LOK, so avoid invalidations
+if (!comphelper::LibreOfficeKit::isActive())
+mpTabBar->Invalidate();
+
 mpTabBar->HighlightDeck(msCurrentDeckId);
 
 // Determine the panels to display in the deck.
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index fc6124f79659..b989cb7d0964 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -104,6 +105,10 @@ sal_Int32 TabBar::GetDefaultWidth()
 
 void TabBar::SetDecks(const ResourceManager::DeckContextDescriptorContainer& 
rDecks)
 {
+// invisible with LOK, so keep empty to avoid invalidations
+if (comphelper::LibreOfficeKit::isActive())
+return;
+
 // Remove the current buttons.
 maItems.clear();
 for (auto const& deck : rDecks)
commit 8941f3f65e149c9f53c425c9cc153b32d8cd2482
Author: Michael Meeks 
AuthorDate: Sat Jan 16 17:56:06 2021 +
Commit: Michael Meeks 
CommitDate: Sun Jan 17 00:13:44 2021 +0100

sidebar: only invalidate when things change.

Change-Id: Icc9c5bcde224cc979b834585531b847f1c5f7d0b
    Signed-off-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109457
Tested-by: Jenkins

diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index ac376f571eb7..8578c398e3fa 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -435,8 +435,11 @@ void 
Deck::ScrollContainerWindow::Paint(vcl::RenderContext& rRenderContext, cons
 
 void Deck::ScrollContainerWindow::SetSeparators (const 
::std::vector& rSeparators)
 {
-maSeparators = rSeparators;
-Invalidate();
+if (rSeparators != maSeparators)
+{
+maSeparators = rSeparators;
+Invalidate();
+}
 }
 
 } // end of namespace sfx2::sidebar
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: About preparing migration towards gtk4

2021-01-07 Thread Michael Meeks


On 06/01/2021 17:12, Julien Nabet wrote:
> Thank you Michael for your feedback. I must recognize I just heard about
> SolarMutex, Uno, etc. but even if I read during days the Uno
> code/SolarMutex mechanism, I'll never have the patience to read the
> related code (and above all I'm not smart enough to understand how it
> works).

Ah - I'm convinced you are; but it will require quite some concentrated
work, writing of notes, and exploring the problem space.

I had a brain-wave: perhaps we could have a new hook, something like:

void g_main_context_set_dispatch_func
(GMainContext *context,
   GDispatchFunc func);

to wrap all glib main-loop dispatches with the SolarMutex; and inject a
custom poll to release too. Assuming that since there is now no
gdk-threads protection, that all the gtk+ code pushes events / thread
callbacks to the main thread via the GMainContext - then -perhaps- with
a simple, new hook - we could make this work somehow.

Hmm... interesting.

> What I understand is there's a lot of work to do to be gtk4 compliant so
> I suppose it's not too early at all to think about it considering the
> changes it needs.

Sure - so, if there are easy things we can do to remove obsolete
widgets, and we are targeting APIs that are present in a sensible
version of gtk3 that makes perfect sense to me.

> Hope gtk3 won't be deprecated too soon by Gnome :-)

I imagine it will be around for 5+ years; gtk3.0.0 was released in Feb
2011, and we only just removed gtk2 support.

ATB,

Michael.

-- 
michael.me...@collabora.com <><, GM Collabora Productivity
Hangout: mejme...@gmail.com, Skype: mmeeks
(M) +44 7795 666 147 - timezone usually UK / Europe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: About preparing migration towards gtk4

2021-01-06 Thread Michael Meeks
Hi Julien,

On 18/12/2020 21:46, julien2412 wrote:
> Gtk4 has been released 2 days ago, I know that migration from a version to
> another version is not a 1 month work, but thought it could be interesting
> and it can't hurt the current state of LO to begin to prepare it by

Unfortunately the gtk+ team removed the GDK_THREADS annotation that in
conjunction with the gdk_threads_set_lock_functions method I added back
in 2003 is/was at the core of our ability to use gtk+ safely with
threads and to share the SolarMutex with gtk+'s own mutex.

Checkout:

https://bugzilla.gnome.org/show_bug.cgi?id=793124

Quite possibly there is a better way to do this now; possibly by taking
a SolarMutexGuard in a very large number of places at the perimeter of
all gtk+ and a11y calls we could leave only smaller parts of the gtk+
backend as not thread-safe anymore.

Possibly we could come up with some clever I/O thread that would proxy
the X11 (or wayland?) protocol socket and wrap that with SolarMutex
protection - such that threading would continue to work.

Possibly we could move the things that use gtk4 into some 'appartment'
with some UNO magic - I guess the file-picker in particular. I fear
though that the new welding work assumes that we have a thread-safe gtk3
so we can construct, populate, script etc. UIs from any thread.

This is quite a big engineering problem, that needs very significant
thought, and will create threading problems that give and give.

The up-side for the gtk+ maintainers is only that they don't have ~100
gdk_threads_enter/leave calls that they had to think about in their
code-base.

In any world where the gtk+ authors also wrote large apps, I would hope
that they would not make decisions that so carelessly traded a few
minutes per year of their time for spending man-months of other people's
and whole new classes of bugs for millions of users.

Unrelenting platform churn is one of the supposed benefits of FLOSS
development though ... but the up-stack bit-rot is a pretty serious
thing to fight.

Then again - doing work to use more modern APIs sounds sensible -
assuming that they are not too modern (I guess lots of them tend to get
added when they developed gtk4 which is really very recently for those
who care about APIs >6 months old ;-)

HTH,

Michael.

-- 
michael.me...@collabora.com <><, GM Collabora Productivity
Hangout: mejme...@gmail.com, Skype: mmeeks
(M) +44 7795 666 147 - timezone usually UK / Europe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Dropping X11 VCL backend

2021-01-06 Thread Michael Meeks

On 29/12/2020 16:29, Thorsten Behrens wrote:
>> XRender. Hopefully I’m reading the code right. If I am reading that
>> right, are there any distributions that ship X11 *without* XRender?
>>
> I believe that's the wrong question to ask - there's always going to
> be a fringe use case where Xrender is not (easily) available. Old, or
> remote X11 comes to mind.

It would have to be -very- old not to support Xrender, which is also
available via remote protocol; and is ~20 years old. I would say the
probability is near zero of that being useful.

I'd be well up for killing non-Xrender code-paths if that's easy and
safe - but we should really just go for using statically linked skia's
X11 support and kill that native X11 rendering code in big chunks. Ditto
for the Mac backend, and ultimately for the GDI Windows backend.

Then with a sane alpha API we could switch to in-line alpha and get
some big performance improvement for rendering.

I'd love to see someone looking at that. The S390x thing - I saw
problems there related to Skia GPU acceleration on that, but either the
CPU pixel bashing works there - or we can fix it I guess:

https://bugzilla.mozilla.org/show_bug.cgi?id=1144632

Looks interesting some years ago.

There are huge benefits to having a much more powerful single rendering
backend ~everywhere, that removes the need for lots of fallback code.

So - I'd love to see the existing 'gen' backend switch quietly to using
static skia rendering =)

My 2 cents,

Michael.

-- 
michael.me...@collabora.com <><, GM Collabora Productivity
Hangout: mejme...@gmail.com, Skype: mmeeks
(M) +44 7795 666 147 - timezone usually UK / Europe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Is there any effort or discussion yet about collaborative use of libreoffice applications?

2020-12-15 Thread Michael Meeks
Hi Marc,

A few thoughts on this thread:

On 15/12/2020 11:36, Marc Roos wrote:
>> What I was getting at was a way to make a fat client collaborative. 
> 
> Calc has a share option now not ?

This is a development mailing list; it is great to ask questions around
the code. There are two approaches to Collaboration as you've seen the
COOL approach (poke in #cool-dev on IRC), and the Telepathy approach
that Caolan kindly pointed to below inside LibreOffice.

> Where multiple users should be able to 
> edit the same version. I think that is nice, I prefer to have such a 
> thing more for write, but it is a nice start. I think it is not 100% ok, 
> because I did not get any updated changes of others, or I am not using 
> it correctly.

The telepathy prototype is no longer included - but the patch Caolan
pointed at has an attempt to pull out a set of 'operations' that might
work for spreadsheets, and could be built on. I expect some of the core
re-factoring to make this easier is still present.

This mailing list is a great for developers to discuss resurrecting and
extending that - it's a generally useful feature - although it is really
far from trivial to implement, even with the synchronous event model
that was imagined and integral to the Telepathy attempt.

Personally I'd recommend trying instead to make LOK more deterministic,
and doing this at the LOK user / input event layer: but even that is
rather tricky - consider a sort of some data via a column populated with
=RAND() as a banal example - and needing to synchronize that across
multiple users.

Anyhow - I'm happy to help with any code suggestions / reviews as/when
you have a core build and are ready to go there. I would recommend reading:

https://people.gnome.org/~michael/data/2013-10-09-collaboration.pdf

first for some more background. We chose to go a different route with
Collabora Online - which should be much easier - but like anything
complex in practice is really hard to get right too =)

HTH,

Michael.

> -Original Message-
> From: Caolán McNamara [mailto:caol...@redhat.com] 
> Sent: Sunday, December 13, 2020 9:41 PM
> To: Stu
> Cc: libreoffice
> Subject: Re: Is there any effort or discussion yet about collaborative 
> use of libreoffice applications?
> 
> On Sun, 2020-12-13 at 07:56 -0500, Stu wrote:
>> What I was getting at was a way to make a fat client collaborative.
> 
> For a while we have an experimental --enable-telepathy option, so 
> searching for "telepathy libreoffice" will throw up some old attempts 
> similar to that. e.g.
> https://bugs.documentfoundation.org/show_bug.cgi?id=62722 but eventually 
> effort in that direction was dropped with 
> https://cgit.freedesktop.org/libreoffice/core/commit/?id=b7b159d79c2b4ec53915e0b9c3e28912c289a5ba

-- 
michael.me...@collabora.com <><, GM Collabora Productivity
Hangout: mejme...@gmail.com, Skype: mmeeks
(M) +44 7795 666 147 - timezone usually UK / Europe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2020-12-08 Thread Michael Meeks (via logerrit)
 filter/source/svg/svgexport.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 8932cc857f62be4073a7de69491b1fd8565c44aa
Author: Michael Meeks 
AuthorDate: Thu Nov 19 20:27:13 2020 +
Commit: Michael Meeks 
CommitDate: Tue Dec 8 10:01:51 2020 +0100

Avoid calculating checksums if we can.

We can compare the underlying mxImpGraphic pointers via the
Graphic's uno tunnelling magic easily enough anyway.

Change-Id: I09bd0fd97b662f07378197fce2956ed0776ba458
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106186
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 
(cherry picked from commit a52246d5a45548820dac55395e64dc1ff83ae11f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107375
Tested-by: Jenkins

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 26f17227552e..bcf97a8b0678 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -706,9 +706,10 @@ bool SVGFilter::implExportWriterTextGraphic( const 
Reference< view::XSelectionSu
 if (!xTransformedGraphic.is())
 return false;
 const Graphic aTransformedGraphic(xTransformedGraphic);
-bool bChecksumMatches = aOriginalGraphic.GetChecksum() == 
aTransformedGraphic.GetChecksum();
-const Graphic aGraphic = bChecksumMatches ? aOriginalGraphic : 
aTransformedGraphic;
-uno::Reference xGraphic = bChecksumMatches ? 
xOriginalGraphic : xTransformedGraphic;
+bool bSameGraphic = aTransformedGraphic == aOriginalGraphic ||
+aOriginalGraphic.GetChecksum() == 
aTransformedGraphic.GetChecksum();
+const Graphic aGraphic = bSameGraphic ? aOriginalGraphic : 
aTransformedGraphic;
+uno::Reference xGraphic = bSameGraphic ? 
xOriginalGraphic : xTransformedGraphic;
 
 // Calculate size from Graphic
 Point aPos( 
OutputDevice::LogicToLogic(aGraphic.GetPrefMapMode().GetOrigin(), 
aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)) );
___
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-6.4' - filter/source

2020-12-07 Thread Michael Meeks (via logerrit)
 filter/source/svg/svgexport.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit a52246d5a45548820dac55395e64dc1ff83ae11f
Author: Michael Meeks 
AuthorDate: Thu Nov 19 20:27:13 2020 +
Commit: Ashod Nakashian 
CommitDate: Tue Dec 8 00:52:47 2020 +0100

Avoid calculating checksums if we can.

We can compare the underlying mxImpGraphic pointers via the
Graphic's uno tunnelling magic easily enough anyway.

Change-Id: I09bd0fd97b662f07378197fce2956ed0776ba458
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106186
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 50083f7b1f8d..d30415380207 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -701,9 +701,10 @@ bool SVGFilter::implExportWriterTextGraphic( const 
Reference< view::XSelectionSu
 if (!xTransformedGraphic.is())
 return false;
 const Graphic aTransformedGraphic(xTransformedGraphic);
-bool bChecksumMatches = aOriginalGraphic.GetChecksum() == 
aTransformedGraphic.GetChecksum();
-const Graphic aGraphic = bChecksumMatches ? aOriginalGraphic : 
aTransformedGraphic;
-uno::Reference xGraphic = bChecksumMatches ? 
xOriginalGraphic : xTransformedGraphic;
+bool bSameGraphic = aTransformedGraphic == aOriginalGraphic ||
+aOriginalGraphic.GetChecksum() == 
aTransformedGraphic.GetChecksum();
+const Graphic aGraphic = bSameGraphic ? aOriginalGraphic : 
aTransformedGraphic;
+uno::Reference xGraphic = bSameGraphic ? 
xOriginalGraphic : xTransformedGraphic;
 
 // Calculate size from Graphic
 Point aPos( 
OutputDevice::LogicToLogic(aGraphic.GetPrefMapMode().GetOrigin(), 
aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-29 Thread Michael Meeks (via logerrit)
 sc/inc/spellcheckcontext.hxx|1 +
 sc/source/ui/view/spellcheckcontext.cxx |8 
 sc/source/ui/view/tabview3.cxx  |3 +++
 3 files changed, 12 insertions(+)

New commits:
commit bf715f188a511a49104afec6ceec88771639ad3e
Author: Michael Meeks 
AuthorDate: Mon Oct 26 20:18:28 2020 +
Commit: Noel Grandin 
CommitDate: Thu Oct 29 10:59:17 2020 +0100

calc: clear the spell-checking cache on tab switch.

Change-Id: I187b5ff65c951e088e403f1a7a833bee248229fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104852
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sc/inc/spellcheckcontext.hxx b/sc/inc/spellcheckcontext.hxx
index ac2b19141360..d4a0e0162530 100644
--- a/sc/inc/spellcheckcontext.hxx
+++ b/sc/inc/spellcheckcontext.hxx
@@ -52,6 +52,7 @@ public:
 
 void reset();
 void resetForContentChange();
+void setTabNo(SCTAB nTab);
 
 private:
 void ensureResults(SCCOL nCol, SCROW nRow);
diff --git a/sc/source/ui/view/spellcheckcontext.cxx 
b/sc/source/ui/view/spellcheckcontext.cxx
index 026c0c5a7968..971fa481c04f 100644
--- a/sc/source/ui/view/spellcheckcontext.cxx
+++ b/sc/source/ui/view/spellcheckcontext.cxx
@@ -209,6 +209,14 @@ void SpellCheckContext::dispose()
 pDoc = nullptr;
 }
 
+void SpellCheckContext::setTabNo(SCTAB nTab)
+{
+if (mnTab == nTab)
+return;
+mnTab = nTab;
+reset();
+}
+
 bool SpellCheckContext::isMisspelled(SCCOL nCol, SCROW nRow) const
 {
 const_cast(this)->ensureResults(nCol, nRow);
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index ccc47fb2c06b..f9334be17c2a 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -58,6 +58,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1869,6 +1870,8 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool 
bExtendSelection, bool bSa
 bool bFocus = pGridWin[eOldActive] && pGridWin[eOldActive]->HasFocus();
 
 aViewData.SetTabNo( nTab );
+if (mpSpellCheckCxt)
+mpSpellCheckCxt->setTabNo( nTab );
 // UpdateShow before SetCursor, so that UpdateAutoFillMark finds the 
correct
 // window  (is called from SetCursor)
 UpdateShow();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-28 Thread Michael Meeks (via logerrit)
 sc/inc/spellcheckcontext.hxx|1 +
 sc/source/ui/inc/gridwin.hxx|4 ++--
 sc/source/ui/inc/tabview.hxx|2 ++
 sc/source/ui/view/gridwin.cxx   |7 ++-
 sc/source/ui/view/spellcheckcontext.cxx |7 +++
 sc/source/ui/view/tabview.cxx   |   10 +-
 sc/source/ui/view/tabview5.cxx  |7 ++-
 7 files changed, 29 insertions(+), 9 deletions(-)

New commits:
commit 65f42a4540d495a11d255af63c7ee15397b57bfa
Author: Michael Meeks 
AuthorDate: Thu Oct 22 19:45:16 2020 +0100
Commit: Noel Grandin 
CommitDate: Wed Oct 28 13:08:15 2020 +0100

tdf#136694 - share spelling context across all ScGridWindows.

Adding new ScGridWindows later (as we do for split panes)
didn't call EnableAutoSpell on them; also duplicating the
spell-checking cache looks wasteful, so share it.

Change-Id: Ieb67bb292590a097bb5a59d369416a094c54c954
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104706
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sc/inc/spellcheckcontext.hxx b/sc/inc/spellcheckcontext.hxx
index 684b2ceb9edc..ac2b19141360 100644
--- a/sc/inc/spellcheckcontext.hxx
+++ b/sc/inc/spellcheckcontext.hxx
@@ -43,6 +43,7 @@ class SpellCheckContext
 public:
 SpellCheckContext(ScDocument* pDocument, SCTAB nTab);
 ~SpellCheckContext();
+void dispose();
 
 bool isMisspelled(SCCOL nCol, SCROW nRow) const;
 const std::vector* getMisspellRanges(SCCOL nCol, 
SCROW nRow) const;
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index d9c0606b2dd2..448c33ba6b10 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -145,7 +145,7 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::Window, 
public DropTargetHel
 // zoom levels demanded from a ScGridWindow instance.
 std::vector maLOKLastCursor;
 
-std::unique_ptr mpSpellCheckCxt;
+std::shared_ptr mpSpellCheckCxt;
 
 ScViewData& mrViewData;
 ScSplitPos  eWhich;
@@ -433,7 +433,7 @@ public:
 
 void CursorChanged();
 void DrawLayerCreated();
-void EnableAutoSpell( bool bEnable );
+void SetAutoSpellContext( const std::shared_ptr 
 );
 void ResetAutoSpell();
 void ResetAutoSpellForContentChange();
 void SetAutoSpellData( SCCOL nPosX, SCROW nPosY, const 
std::vector* pRanges );
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index a716763f1d73..17809c51fdc8 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -156,6 +156,8 @@ private:
 VclPtr  aTopButton;
 VclPtraScrollBarBox;
 
+std::shared_ptr mpSpellCheckCxt;
+
 std::unique_ptr mxInputHintOO; // help 
hint for data validation
 
 std::unique_ptr  pPageBreakData;
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 07a4a8317bac..67b815bfc1c1 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5501,12 +5501,9 @@ void ScGridWindow::DrawLayerCreated()
 ImpCreateOverlayObjects();
 }
 
-void ScGridWindow::EnableAutoSpell( bool bEnable )
+void ScGridWindow::SetAutoSpellContext( const 
std::shared_ptr  )
 {
-if (bEnable)
-mpSpellCheckCxt.reset(new 
sc::SpellCheckContext((), mrViewData.GetTabNo()));
-else
-mpSpellCheckCxt.reset();
+mpSpellCheckCxt = ctx;
 }
 
 void ScGridWindow::ResetAutoSpell()
diff --git a/sc/source/ui/view/spellcheckcontext.cxx 
b/sc/source/ui/view/spellcheckcontext.cxx
index 6ff81468c5b1..026c0c5a7968 100644
--- a/sc/source/ui/view/spellcheckcontext.cxx
+++ b/sc/source/ui/view/spellcheckcontext.cxx
@@ -202,6 +202,13 @@ SpellCheckContext::~SpellCheckContext()
 {
 }
 
+void SpellCheckContext::dispose()
+{
+mpEngine.reset();
+mpCache.reset();
+pDoc = nullptr;
+}
+
 bool SpellCheckContext::isMisspelled(SCCOL nCol, SCROW nRow) const
 {
 const_cast(this)->ensureResults(nCol, nRow);
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 2f4a407aca5c..dd7e152f0e93 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2234,12 +2235,19 @@ void ScTabView::EnableRefInput(bool bFlag)
 
 void ScTabView::EnableAutoSpell( bool bEnable )
 {
+if (bEnable)
+mpSpellCheckCxt =
+std::make_shared((),
+  aViewData.GetTabNo());
+else
+mpSpellCheckCxt.reset();
+
 for (VclPtr & pWin : pGridWin)
 {
 if (!pWin)
 continue;
 
-pWin->EnableAutoSpell(bEnable);
+pWin->SetAutoSpellContext(mpSpellCheckCxt);
 }
 }
 
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 73727a0f13d4..c41f08b0aca1 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -46,6 +

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/inc sc/source

2020-10-28 Thread Michael Meeks (via logerrit)
 sc/inc/spellcheckcontext.hxx|2 +-
 sc/source/ui/view/gridwin.cxx   |2 ++
 sc/source/ui/view/spellcheckcontext.cxx |   14 --
 3 files changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 5245723d92e92773d4679b3cd60a70706e3b4782
Author: Michael Meeks 
AuthorDate: Mon Oct 26 19:31:56 2020 +
Commit: Andras Timar 
CommitDate: Wed Oct 28 11:46:33 2020 +0100

Don't let sc's spell-checking EditEngine linger around as long.

Attempted blind fix for problems with stale OutputDevice usage.

Change-Id: Ifa9eb000907aa18e2007cc1020c269d97d182e72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104848
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sc/inc/spellcheckcontext.hxx b/sc/inc/spellcheckcontext.hxx
index 8e2392ef5ff1..d4a0e0162530 100644
--- a/sc/inc/spellcheckcontext.hxx
+++ b/sc/inc/spellcheckcontext.hxx
@@ -57,7 +57,7 @@ public:
 private:
 void ensureResults(SCCOL nCol, SCROW nRow);
 void resetCache(bool bContentChangeOnly = false);
-void resetEngine();
+void setup();
 };
 }
 
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 9dfca179a4ed..3a7c0491133e 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -500,6 +500,8 @@ void ScGridWindow::dispose()
 mpDPFieldPopup.disposeAndClear();
 aComboButton.SetOutputDevice(nullptr);
 
+if (mpSpellCheckCxt)
+mpSpellCheckCxt->reset();
 mpSpellCheckCxt.reset();
 
 vcl::Window::dispose();
diff --git a/sc/source/ui/view/spellcheckcontext.cxx 
b/sc/source/ui/view/spellcheckcontext.cxx
index 8861e91a41e4..d75525d90b4d 100644
--- a/sc/source/ui/view/spellcheckcontext.cxx
+++ b/sc/source/ui/view/spellcheckcontext.cxx
@@ -269,7 +269,8 @@ void SpellCheckContext::reset()
 {
 meLanguage = ScGlobal::GetEditDefaultLanguage();
 resetCache();
-resetEngine();
+mpEngine.reset();
+mpStatus.reset();
 }
 
 void SpellCheckContext::resetForContentChange()
@@ -279,8 +280,12 @@ void SpellCheckContext::resetForContentChange()
 
 void SpellCheckContext::ensureResults(SCCOL nCol, SCROW nRow)
 {
-if (!mpEngine || !mpCache)
+if (!mpEngine || !mpCache ||
+ScGlobal::GetEditDefaultLanguage() != meLanguage)
+{
 reset();
+setup();
+}
 
 // perhaps compute the pivot rangelist once in some pivot-table change 
handler ?
 if (pDoc->HasPivotTable())
@@ -306,8 +311,6 @@ void SpellCheckContext::ensureResults(SCCOL nCol, SCROW 
nRow)
 return;
 }
 
-if (ScGlobal::GetEditDefaultLanguage() != meLanguage)
-reset();
 
 // Cell content is either shared-string or EditTextObject
 
@@ -366,7 +369,6 @@ void SpellCheckContext::ensureResults(SCCOL nCol, SCROW 
nRow)
 
 mpResult->set(nCol, nRow, pRanges.get());
 mpCache->set(nCol, nRow, aCell, std::move(pRanges));
-
 }
 
 void SpellCheckContext::resetCache(bool bContentChangeOnly)
@@ -384,7 +386,7 @@ void SpellCheckContext::resetCache(bool bContentChangeOnly)
 mpCache->clear(meLanguage);
 }
 
-void SpellCheckContext::resetEngine()
+void SpellCheckContext::setup()
 {
 mpEngine.reset(new ScTabEditEngine(pDoc));
 mpStatus.reset(new SpellCheckStatus());
___
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-6.4' - sc/inc sc/source

2020-10-27 Thread Michael Meeks (via logerrit)
 sc/inc/spellcheckcontext.hxx|1 +
 sc/source/ui/view/spellcheckcontext.cxx |8 
 sc/source/ui/view/tabview3.cxx  |4 
 3 files changed, 13 insertions(+)

New commits:
commit c2eb3259894b56e0dc8fe4762c66e05f37d48e40
Author: Michael Meeks 
AuthorDate: Mon Oct 26 20:18:28 2020 +
Commit: Michael Meeks 
CommitDate: Tue Oct 27 13:55:29 2020 +0100

calc: clear the spell-checking cache on tab switch.

Change-Id: I187b5ff65c951e088e403f1a7a833bee248229fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104850
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/sc/inc/spellcheckcontext.hxx b/sc/inc/spellcheckcontext.hxx
index 07cab368443b..8e2392ef5ff1 100644
--- a/sc/inc/spellcheckcontext.hxx
+++ b/sc/inc/spellcheckcontext.hxx
@@ -52,6 +52,7 @@ public:
 
 void reset();
 void resetForContentChange();
+void setTabNo(SCTAB nTab);
 
 private:
 void ensureResults(SCCOL nCol, SCROW nRow);
diff --git a/sc/source/ui/view/spellcheckcontext.cxx 
b/sc/source/ui/view/spellcheckcontext.cxx
index 4b90bdb0c099..8861e91a41e4 100644
--- a/sc/source/ui/view/spellcheckcontext.cxx
+++ b/sc/source/ui/view/spellcheckcontext.cxx
@@ -227,6 +227,14 @@ void SpellCheckContext::dispose()
 pDoc = nullptr;
 }
 
+void SpellCheckContext::setTabNo(SCTAB nTab)
+{
+if (mnTab == nTab)
+return;
+mnTab = nTab;
+reset();
+}
+
 bool SpellCheckContext::isMisspelled(SCCOL nCol, SCROW nRow) const
 {
 const_cast(this)->ensureResults(nCol, nRow);
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 01c363903004..736d47ace777 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -58,6 +58,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1851,6 +1852,9 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool 
bExtendSelection, bool bSa
 bool bFocus = pGridWin[eOldActive] && pGridWin[eOldActive]->HasFocus();
 
 aViewData.SetTabNo( nTab );
+if (mpSpellCheckCxt)
+mpSpellCheckCxt->setTabNo( nTab );
+
 // UpdateShow before SetCursor, so that UpdateAutoFillMark finds the 
correct
 // window  (is called from SetCursor)
 UpdateShow();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-26 Thread Michael Meeks (via logerrit)
 libreofficekit/source/gtk/lokdocview.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 6bcdbb97b99369b20f6f1d2bdbc6eca1ff1f1150
Author: Michael Meeks 
AuthorDate: Thu Oct 22 22:09:33 2020 +0100
Commit: Noel Grandin 
CommitDate: Mon Oct 26 08:51:07 2020 +0100

Allow some spelling dictionaries for gtktiledviewer.

Change-Id: Ie3e646321aff2705d908b25e4beff0768a5936fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104703
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 6af262bb8df2..466a1cc85b0e 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -2779,6 +2779,9 @@ static gboolean lok_doc_view_initable_init (GInitable 
*initable, GCancellable* /
 if (priv->m_bUnipoll)
 g_setenv("SAL_LOK_OPTIONS", "unipoll", FALSE);
 
+static const char testingLangs[] = "de_DE en_GB en_US es_ES fr_FR it nl 
pt_BR pt_PT ru";
+g_setenv("LOK_ALLOWLIST_LANGUAGES", testingLangs, FALSE);
+
 priv->m_pOffice = lok_init_2(priv->m_aLOPath.c_str(), 
priv->m_aUserProfileURL.empty() ? nullptr : priv->m_aUserProfileURL.c_str());
 
 if (priv->m_pOffice == nullptr)
___
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-6.4' - sc/source

2020-10-23 Thread Michael Meeks (via logerrit)
 sc/source/ui/inc/gridwin.hxx   |4 ++--
 sc/source/ui/inc/tabview.hxx   |2 ++
 sc/source/ui/view/gridwin.cxx  |7 ++-
 sc/source/ui/view/tabview.cxx  |   10 +-
 sc/source/ui/view/tabview5.cxx |7 ++-
 5 files changed, 21 insertions(+), 9 deletions(-)

New commits:
commit 1a356dc0262022f8c0880d992f628507fdca408e
Author: Michael Meeks 
AuthorDate: Thu Oct 22 19:45:16 2020 +0100
Commit: Michael Meeks 
CommitDate: Fri Oct 23 11:53:52 2020 +0200

tdf#136694 - share spelling context across all ScGridWindows.

Adding new ScGridWindows later (as we do for split panes)
didn't call EnableAutoSpell on them; also duplicating the
spell-checking cache looks wasteful, so share it.

Change-Id: Ieb67bb292590a097bb5a59d369416a094c54c954
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104704
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 5623a0c92d11..a576375283b9 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -142,7 +142,7 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::Window, 
public DropTargetHel
 // zoom levels demanded from a ScGridWindow instance.
 std::vector maLOKLastCursor;
 
-std::unique_ptr mpSpellCheckCxt;
+std::shared_ptr mpSpellCheckCxt;
 
 ScViewData* pViewData;
 ScSplitPos consteWhich;
@@ -428,7 +428,7 @@ public:
 
 void CursorChanged();
 void DrawLayerCreated();
-void EnableAutoSpell( bool bEnable );
+void SetAutoSpellContext( const std::shared_ptr 
 );
 void ResetAutoSpell();
 void ResetAutoSpellForContentChange();
 void SetAutoSpellData( SCCOL nPosX, SCROW nPosY, const 
std::vector* pRanges );
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 287513af1e00..25185b1ca559 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -163,6 +163,8 @@ private:
 VclPtr  aTopButton;
 VclPtraScrollBarBox;
 
+std::shared_ptr mpSpellCheckCxt;
+
 std::unique_ptr mxInputHintOO; // help 
hint for data validation
 
 std::unique_ptr  pPageBreakData;
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 569395c99d6b..9dfca179a4ed 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5528,12 +5528,9 @@ void ScGridWindow::DrawLayerCreated()
 ImpCreateOverlayObjects();
 }
 
-void ScGridWindow::EnableAutoSpell( bool bEnable )
+void ScGridWindow::SetAutoSpellContext( const 
std::shared_ptr  )
 {
-if (bEnable)
-mpSpellCheckCxt.reset(new 
sc::SpellCheckContext(pViewData->GetDocument(), pViewData->GetTabNo()));
-else
-mpSpellCheckCxt.reset();
+mpSpellCheckCxt = ctx;
 }
 
 void ScGridWindow::ResetAutoSpell()
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 2c6dd86e368d..1f924ddaf8f9 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -45,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2237,12 +2238,19 @@ void ScTabView::EnableRefInput(bool bFlag)
 
 void ScTabView::EnableAutoSpell( bool bEnable )
 {
+if (bEnable)
+mpSpellCheckCxt.reset(
+new sc::SpellCheckContext(aViewData.GetDocument(),
+  aViewData.GetTabNo()));
+else
+mpSpellCheckCxt.reset();
+
 for (VclPtr & pWin : pGridWin)
 {
 if (!pWin)
 continue;
 
-pWin->EnableAutoSpell(bEnable);
+pWin->SetAutoSpellContext(mpSpellCheckCxt);
 }
 }
 
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index e504cf231698..a81772131d12 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -193,6 +194,10 @@ ScTabView::~ScTabView()
 
 pSelEngine.reset();
 
+if (mpSpellCheckCxt)
+mpSpellCheckCxt->dispose();
+mpSpellCheckCxt.reset();
+
 mxInputHintOO.reset();
 for (i=0; i<4; i++)
 pGridWin[i].disposeAndClear();
@@ -269,9 +274,9 @@ void ScTabView::DoAddWin( ScGridWindow* pWin )
 if (pDrawView)
 {
 pDrawView->AddWindowToPaintView(pWin, nullptr);
-
 pWin->DrawLayerCreated();
 }
+pWin->SetAutoSpellContext(mpSpellCheckCxt);
 }
 
 void ScTabView::TabChanged( bool bSameTabButMoved )
___
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-6.4' - libreofficekit/source

2020-10-22 Thread Michael Meeks (via logerrit)
 libreofficekit/source/gtk/lokdocview.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 60dc53b57783248a13757b7ca3dd37c8ef3048bd
Author: Michael Meeks 
AuthorDate: Thu Oct 22 22:09:33 2020 +0100
Commit: Michael Meeks 
CommitDate: Fri Oct 23 02:15:17 2020 +0200

Allow some spelling dictionaries for gtktiledviewer.

Change-Id: Ie3e646321aff2705d908b25e4beff0768a5936fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104702
Tested-by: Jenkins CollaboraOffice 
Tested-by: Michael Meeks 
Reviewed-by: Michael Meeks 

diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 4ebcd6806d19..3eb5a5753085 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -2716,6 +2716,9 @@ static gboolean lok_doc_view_initable_init (GInitable 
*initable, GCancellable* /
 if (priv->m_bUnipoll)
 g_setenv("SAL_LOK_OPTIONS", "unipoll", FALSE);
 
+static const char *testingLangs = "de_DE en_GB en_US es_ES fr_FR it nl 
pt_BR pt_PT ru";
+g_setenv("LOK_WHITELIST_LANGUAGES", testingLangs, FALSE);
+
 priv->m_pOffice = lok_init_2(priv->m_aLOPath.c_str(), 
priv->m_aUserProfileURL.empty() ? nullptr : priv->m_aUserProfileURL.c_str());
 
 if (priv->m_pOffice == nullptr)
___
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-6.4' - sc/source sd/source

2020-10-13 Thread Michael Meeks (via logerrit)
 sc/source/ui/view/tabvwsh2.cxx |1 +
 sd/source/ui/view/drviewse.cxx |2 ++
 2 files changed, 3 insertions(+)

New commits:
commit 1952f042e724f39bf92a52947ef1c59f6e13441b
Author: Michael Meeks 
AuthorDate: Wed Aug 26 16:43:15 2020 +0100
Commit: Andras Timar 
CommitDate: Tue Oct 13 23:15:33 2020 +0200

lok: text box insertion: default to insert directly for lok.

The various bits of positioning functionality are not helpful.

Change-Id: I26a62fc939a1e24a8a811c06c8c1a8da831a73f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101415
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index d2efc23d5559..7b278dab9269 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -260,6 +260,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
 case SID_DRAW_TEXT_VERTICAL:
 case SID_DRAW_TEXT_MARQUEE:
 case SID_DRAW_NOTEEDIT:
+bCreateDirectly = comphelper::LibreOfficeKit::isActive();
 pTabView->SetDrawFuncPtr(new FuText(*this, pWin, pView, pDoc, 
aNewReq));
 break;
 
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 3ae9b37171b0..d4b10e1fe8f9 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -249,6 +249,8 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
 
 rReq.Done();
 
+bCreateDirectly = comphelper::LibreOfficeKit::isActive();
+
 const SfxItemSet* pArgs = rReq.GetArgs();
 if (pArgs && pArgs->HasItem(FN_PARAM_1))
 bCreateDirectly = static_cast(pArgs->Get(FN_PARAM_1)).GetValue();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Calc / spell check cache

2020-10-05 Thread Michael Meeks
Hi Dennis,

Moving this to libreoffice-dev since it's generally interesting, hope
that's ok.

Summary: we have a problem whereby calc spell-checking causes cascades
of invalidations caused by spell-checking idle handlers; it seems when
the view moves, we render, and then do lots of invalidation - which is
generally inefficient even for the PC case I guess; but particularly so
for online. Also - now we have SharedStrings so we can cache spelling
information more easily for the case of large numbers of duplicate
mis-(or correctly) spelled words - for large pivot data source ranges eg.

On 05/10/2020 11:56, Dennis Francis wrote:
> Calc perf: spell-check invalidation
> 
> Status : WIP, works mostly, need to fix the TODO items (below).

Wonderful =)

> * WIP patch for cp-6.4 at 
>https://gerrit.libreoffice.org/c/core/+/103941

Thanks.

> * removed timer based spellcheck related code/members.
> * spellchecks done only when needed (paintTile -> DrawEdit etc.)
>   * results are cached with better cache-invalidation.

Great.

> * spellcheck-results cache has two maps:
>   #1: for shared-string cells, #2: for edit-text-object cells.

Nice.

>   #1 uses raw-pointer to rtl_uString as key.

I guess that would work, we just need to be a bit careful we need to
make sure we clear this cache before we call:

void SharedStringPool::purge()

In ScDocument::~ScDocument - I think.   

>   #2 uses cell-address as key.

Does the EditTextObject hold and cache its own spelling status ?

>   There is a third map for any special cells with a different language> set 
> (ATTR_FONT_LANGUAGE), but it is not used for storing spellcheck
results.

Interesting =)

> (test document used was created from first sheet of go-oox.xlsx without the
> content under "SCRIPT TYPES", refer TODO.)
> 
> * don't see unnecessary tile-invalidations on scrolling the test document.

Wonderful =)

>   Attached the flame-graphs  with and without the fix.

For me - I got 50% CPU use in a loolkit backend scrolling a single view
without the patch; hopefully that starts to be fast and ~free CPU-wise =)

> * TODO for the patch:
> 
>   * There is a crash on loading documents in online with cell contents with
> asian/complex script types. Does not happen with desktop core though.

Interesting; valgrind ?

>   * Get the document's language or whatever online sets as the language as the
> default instead of using  ScGlobal::GetEditDefaultLanguage() (which seems 
> to return the language associated with the default-locale), 
> else the cache becomes inefficient in case document-language != 
> default-locale-language.>>   * enforce cache size limits (for each internal 
> map).

Looks very promising.

Thanks !

Michael.

-- 
michael.me...@collabora.com <><, GM Collabora Productivity
Hangout: mejme...@gmail.com, Skype: mmeeks
(M) +44 7795 666 147 - timezone usually UK / Europe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: LTO on Windows now working

2020-09-26 Thread Michael Meeks


On 26/09/2020 08:24, Rene Engelhard wrote:
> Am 25.09.20 um 12:54 schrieb Michael Meeks:
>>  I wonder if, ABI-wise, we could static link sal with libmerged for the
>> purpose of LTO and get away with it =)
> 
> I disagree.

=)

>>  Since there is no real C++ ABI, and no exported symbols, particuarly
>> exceptions there - that could work across platforms and give a big win.

Its possible the easy wins come from static linking the C / sal library
and LTO'ing it.

>>  Ideally we could get down the chain from the grey (cf. attached
>> picture) to the bottom there: cppuhelper, xmlreader, cppu, salhelper, sal.
> 
> Nope :)

Yep - bit of a packaging nightmare; then again ... I -think- if those
libraries are used by C++ plugins only - and these are always loaded
after the versions included in the core (easy to guarentee if it's all
loaded there). We could continue to install copies of these, but have
all the symbols static linked / merged into a big libmerged without real
problems.

> With the expense of overhauling the whole package, merging all those
> libs into

Yep, would suck.  Of course if it is 2x as fast perhaps worth looking
at but we need numbers.

Thanks for the feedback,

Michael.

-- 
michael.me...@collabora.com <><, GM Collabora Productivity
Hangout: mejme...@gmail.com, Skype: mmeeks
(M) +44 7795 666 147 - timezone usually UK / Europe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-6-4' - loleaflet/src

2020-09-23 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 52ea5b85dd8091626f8b50e2f3ce66729c58c119
Author: Michael Meeks 
AuthorDate: Wed Sep 23 16:08:00 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Wed Sep 23 16:53:44 2020 +0200

Fix re-rendering - the sheet ended up with no content.

Change-Id: I1607c35a66f23ab83a5de46bd30b227a28ed82cb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103197
Tested-by: Andras Timar 
Tested-by: Jan Holesovsky 
Reviewed-by: Andras Timar 
Reviewed-by: Jan Holesovsky 

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 285fa11c3..f4cb1eef9 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -461,7 +461,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
}
canvas.closePath();
};
-   this._painter.clear();
+   this._painter.update();
},
 
hasSplitPanesSupport: function () {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-23 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d529fa418f5dd1d12a9280144731776d1b0d0909
Author: Michael Meeks 
AuthorDate: Wed Sep 23 16:08:00 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Wed Sep 23 16:52:35 2020 +0200

Fix re-rendering - the sheet ended up with no content.

Change-Id: I1607c35a66f23ab83a5de46bd30b227a28ed82cb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103257
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 285fa11c3..f4cb1eef9 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -461,7 +461,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
}
canvas.closePath();
};
-   this._painter.clear();
+   this._painter.update();
},
 
hasSplitPanesSupport: function () {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-21 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |   37 ++--
 1 file changed, 24 insertions(+), 13 deletions(-)

New commits:
commit 224526c9678be37b4ac4258b1f01c7df473c50bc
Author: Michael Meeks 
AuthorDate: Sat Sep 19 21:47:34 2020 +0100
Commit: Michael Meeks 
CommitDate: Mon Sep 21 09:57:16 2020 +0200

calc grid: render during canvas 'clear' if we can.

Also re-render as soon as we have grid positions.

Change-Id: I57095683e662991badcb3a58832c81ebb3bc460d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103043
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 15d813939..285fa11c3 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -130,12 +130,22 @@ L.CanvasTilePainter = L.Class.extend({
}
},
 
-   clear: function () {
-   if (this._layer._debug)
-   this._canvasCtx.fillStyle = 'rgba(255, 0, 0, 0.5)';
+   clear: function (ctx) {
+   // First render the background / sheet grid if we can
+   if (this.renderBackground)
+   {
+   if (!ctx)
+   ctx = this._paintContext();
+   this.renderBackground(this._canvasCtx, ctx);
+   }
else
-   this._canvasCtx.fillStyle = 'white';
-   this._canvasCtx.fillRect(0, 0, this._pixWidth, this._pixHeight);
+   {
+   if (this._layer._debug)
+   this._canvasCtx.fillStyle = 'rgba(255, 0, 0, 
0.5)';
+   else
+   this._canvasCtx.fillStyle = 'white';
+   this._canvasCtx.fillRect(0, 0, this._pixWidth, 
this._pixHeight);
+   }
},
 
// Details of tile areas to render
@@ -265,11 +275,13 @@ L.CanvasTilePainter = L.Class.extend({
if (skipUpdate)
return;
 
+   var ctx;
if (resizeCanvas || scaleChanged) {
this._setCanvasSize(newSize.x, newSize.y);
}
else if (mapSizeChanged && topLeftChanged) {
-   this.clear();
+   ctx = this._paintContext();
+   this.clear(ctx);
}
 
if (mapSizeChanged)
@@ -282,24 +294,22 @@ L.CanvasTilePainter = L.Class.extend({
this._lastPart = part;
 
this._topLeft = newTopLeft;
-   this._paintWholeCanvas();
+   this._paintWholeCanvas(ctx);
 
if (this._layer._debug)
this._drawSplits();
},
 
-   _paintWholeCanvas: function () {
+   _paintWholeCanvas: function(ctx) {
 
var zoom = this._lastZoom || Math.round(this._map.getZoom());
var part = this._lastPart || this._layer._selectedPart;
 
// Calculate all this here intead of doing it per tile.
-   var ctx = this._paintContext();
-
-   // First render the background / sheet grid if we can
-   if (this.renderBackground)
-   this.renderBackground(this._canvasCtx, ctx);
+   if (!ctx)
+   ctx = this._paintContext();
 
+   this.clear(ctx);
var tileRanges = 
ctx.paneBoundsList.map(this._layer._pxBoundsToTileRange, this._layer);
 
for (var rangeIdx = 0; rangeIdx < tileRanges.length; 
++rangeIdx) {
@@ -451,6 +461,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
}
canvas.closePath();
};
+   this._painter.clear();
},
 
hasSplitPanesSupport: function () {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-17 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |   24 ++--
 1 file changed, 18 insertions(+), 6 deletions(-)

New commits:
commit 058835d0dcd71fc6aca066e7c6e9facedde83f61
Author: Michael Meeks 
AuthorDate: Wed Sep 16 16:58:57 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Thu Sep 17 21:35:00 2020 +0200

tilecombine: should pass back oldwid to save bandwidth.

Don't re-send un-changed tiles that we can detect easily.
Also avoids some PNG compression / CPU overhead server-side.

Change-Id: Ieca05680d9194e0bfc177b8db338010e5ffafe75
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102954
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 435525793..15d813939 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -902,6 +902,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
 
var tilePositionsX = '';
var tilePositionsY = '';
+   var tileWids = '';
 
for (i = 0; i < queue.length; i++) {
coords = queue[i];
@@ -946,6 +947,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
}
}
 
+   // FIXME console.debug('Crass code duplication here in 
_updateOnChangePart');
if (tilePositionsX !== '' && tilePositionsY !== '') {
var message = 'tilecombine ' +
'nviewid=0 ' +
@@ -954,8 +956,9 @@ L.CanvasTileLayer = L.TileLayer.extend({
'height=' + this._tileHeightPx + ' ' +
'tileposx=' + tilePositionsX + ' ' +
'tileposy=' + tilePositionsY + ' ' +
+   'wid=' + tileWids + ' ' +
'tilewidth=' + this._tileWidthTwips + ' 
' +
-   'tileheight=' + this._tileHeightTwips;
+   'tileheight=' + this._tileHeightTwips;
 
this._map._socket.sendMessage(message, '');
}
@@ -1039,6 +1042,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
// save tile in cache
this._tiles[key] = {
el: tile,
+   wid: 0,
coords: coords,
current: true
};
@@ -1130,19 +1134,25 @@ L.CanvasTileLayer = L.TileLayer.extend({
rectQueue = rectangles[r];
var tilePositionsX = '';
var tilePositionsY = '';
+   var tileWids = '';
for (i = 0; i < rectQueue.length; i++) {
coords = rectQueue[i];
+   key = this._tileCoordsToKey(coords);
+
twips = this._coordsToTwips(coords);
 
-   if (tilePositionsX !== '') {
+   if (tilePositionsX !== '')
tilePositionsX += ',';
-   }
tilePositionsX += twips.x;
 
-   if (tilePositionsY !== '') {
+   if (tilePositionsY !== '')
tilePositionsY += ',';
-   }
tilePositionsY += twips.y;
+
+   tile = 
this._tiles[this._tileCoordsToKey(coords)];
+   if (tileWids !== '')
+   tileWids += ',';
+   tileWids += tile && tile.wireId !== undefined ? 
tile.wireId : 0;
}
 
twips = this._coordsToTwips(coords);
@@ -1153,6 +1163,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
'height=' + this._tileHeightPx + ' ' +
'tileposx=' + tilePositionsX + ' ' +
'tileposy=' + tilePositionsY + ' ' +
+   'oldwid=' + tileWids + ' ' +
'tilewidth=' + this._tileWidthTwips + ' ' +
'tileheight=' + this._tileHeightTwips;
this._map._socket.sendMessage(msg, '');
@@ -1363,6 +1374,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
 

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

2020-09-17 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js   |6 --
 loleaflet/src/layer/tile/CanvasTileLayer.js |1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit a5f44dfad8fb90e90d3c67fac0dec23537c10dc8
Author: Michael Meeks 
AuthorDate: Tue Sep 15 19:53:16 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Thu Sep 17 21:34:43 2020 +0200

calc grid: re-render the canvas when we get grid details.

Change-Id: I3d1d1485e561d8c807daa0dfe0a9f2cb5651d31b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102952
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 4b0123ba2..b9700987c 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -375,6 +375,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
}
this._map.on('resize zoomend', this._painter.update, 
this._painter);
this._map.on('splitposchanged', this._painter.update, 
this._painter);
+   this._map.on('sheetgeometrychanged', this._painter.update, 
this._painter);
this._map.on('move', this._syncTilePanePos, this);
 
this._map.on('viewrowcolumnheaders', 
this._updateRenderBackground, this);
commit b70d9f6c1052ed5a86f309032ed818861027b676
Author: Michael Meeks 
AuthorDate: Tue Sep 15 11:02:54 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Thu Sep 17 21:34:35 2020 +0200

calc grid: fix this interleaving.

When the span starts in the middle of the view don't render backwards.

Change-Id: Icc97fef88a65c0ca83167ddb72c03bece9a8e047
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102951
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 439f0d8cd..ed7ab0d5d 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -1782,8 +1782,10 @@ L.SheetDimension = L.Class.extend({
(spanData.data.sizecore * (spanData.end - 
spanData.start + 1));
if (spanFirstCorePx < endPix && spanData.data.poscorepx 
> startPix)
{
-   var firstCorePx = startPix + 
spanData.data.sizecore -
-   ((startPix - spanFirstCorePx) % 
spanData.data.sizecore);
+   var firstCorePx = Math.max(
+   spanFirstCorePx,
+   startPix + spanData.data.sizecore -
+   ((startPix - spanFirstCorePx) % 
spanData.data.sizecore));
var lastCorePx = Math.min(endPix, 
spanData.data.poscorepx);
 
for (var pos = firstCorePx; pos <= lastCorePx; 
pos += spanData.data.sizecore) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-17 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js   |  101 ++--
 loleaflet/src/layer/tile/CanvasTileLayer.js |   23 +++---
 2 files changed, 109 insertions(+), 15 deletions(-)

New commits:
commit 8093b8941a30ebff087f5563a1115e3438de3dc3
Author: Michael Meeks 
AuthorDate: Wed Sep 9 10:05:44 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Thu Sep 17 21:33:22 2020 +0200

calc canvas: start of direct grid rendering.

Change-Id: If471fc4ff94b3cb8e2897ac76e712aa3958fc7d2
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102950
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 66e264817..54abd8731 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -739,6 +739,67 @@ L.CalcTileLayer = BaseTileLayer.extend({
converter: this._twipsToPixels,
context: this
});
+   var that = this;
+   this._painter.renderBackground = function(canvas, ctx)
+   {
+   if (this._layer._debug)
+   this._canvasCtx.fillStyle = 'rgba(255, 0, 0, 
0.5)';
+   else
+   this._canvasCtx.fillStyle = 'white'; // FIXME: 
sheet bg color
+   this._canvasCtx.fillRect(0, 0, ctx.canvasSize.x, 
ctx.canvasSize.y);
+
+   if (that._debug)
+   canvas.strokeStyle = 'blue';
+   else // now fr some grid-lines ...
+   canvas.strokeStyle = '#c0c0c0';
+   canvas.lineWidth = 1.0;
+
+   canvas.beginPath();
+   for (var i = 0; i < ctx.paneBoundsList.length; ++i) {
+   // FIXME: de-duplicate before firing myself:
+
+   // co-ordinates of this pane in core document 
pixels
+   var paneBounds = 
that._cssBoundsToCore(ctx.paneBoundsList[i]);
+   // co-ordinates of the main-(bottom right) pane 
in core document pixels
+   var viewBounds = 
that._cssBoundsToCore(ctx.viewBounds);
+   // into real pixel-land ...
+   paneBounds.round();
+   viewBounds.round();
+
+   var paneOffset = paneBounds.getTopLeft(); // 
allocates
+   // Cute way to detect the in-canvas pixel 
offset of each pane
+   paneOffset.x = Math.min(paneOffset.x, 
viewBounds.min.x);
+   paneOffset.y = Math.min(paneOffset.y, 
viewBounds.min.y);
+
+   // when using the pinch to zoom, set additional 
translation based */
+   // on the pinch movement
+   if (that._map._animatingZoom) {
+   var centerOffset = 
this._map._getCenterOffset(this._map._animateToCenter);
+   paneOffset.x += 
Math.round(centerOffset.x);
+   paneOffset.y += 
Math.round(centerOffset.y);
+   }
+
+   // URGH -> zooming etc. (!?) ...
+   if (that.sheetGeometry._columns)
+   
that.sheetGeometry._columns.forEachInCorePixelRange(
+   paneBounds.min.x, 
paneBounds.max.x,
+   function(pos) {
+   canvas.moveTo(pos - 
paneOffset.x - 0.5, paneBounds.min.y - paneOffset.y - 0.5);
+   canvas.lineTo(pos - 
paneOffset.x - 0.5, paneBounds.max.y - paneOffset.y - 0.5);
+   canvas.stroke();
+   });
+
+   if (that.sheetGeometry._rows)
+   
that.sheetGeometry._rows.forEachInCorePixelRange(
+   paneBounds.min.y, 
paneBounds.max.y,
+   function(pos) {
+   
canvas.moveTo(paneBounds.min.x - paneOffset.x - 0.5, pos - paneOffset.y - 0.5);
+   
canvas.lineTo(paneBounds.max.x - paneOffset.x - 0.5, pos - paneOffset.y - 0.5);
+   canvas.stroke();
+   });
+   }
+   canvas.clo

[Libreoffice-commits] online.git: Branch 'feature/calc-canvas2' - loleaflet/src

2020-09-16 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |   22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

New commits:
commit 5992dd776f7510912d290763786ca552dd791ac0
Author: Michael Meeks 
AuthorDate: Wed Sep 16 16:58:57 2020 +0100
Commit: Michael Meeks 
CommitDate: Wed Sep 16 16:58:57 2020 +0100

tilecombine: should pass back oldwid to save bandwidth.

Don't re-send un-changed tiles that we can detect easily.
Also avoids some PNG compression / CPU overhead server-side.

Change-Id: Ieca05680d9194e0bfc177b8db338010e5ffafe75

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index e814acaec..aa4222562 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -834,6 +834,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
 
var tilePositionsX = '';
var tilePositionsY = '';
+   var tileWids = '';
 
for (i = 0; i < queue.length; i++) {
coords = queue[i];
@@ -878,6 +879,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
}
}
 
+   console.debug('Crass code duplication here in 
_updateOnChangePart'); // FIXME.
if (tilePositionsX !== '' && tilePositionsY !== '') {
var message = 'tilecombine ' +
'nviewid=0 ' +
@@ -886,8 +888,9 @@ L.CanvasTileLayer = L.TileLayer.extend({
'height=' + this._tileHeightPx + ' ' +
'tileposx=' + tilePositionsX + ' ' +
'tileposy=' + tilePositionsY + ' ' +
+   'wid=' + tileWids + ' ' +
'tilewidth=' + this._tileWidthTwips + ' 
' +
-   'tileheight=' + this._tileHeightTwips;
+   'tileheight=' + this._tileHeightTwips;
 
this._map._socket.sendMessage(message, '');
}
@@ -971,6 +974,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
// save tile in cache
this._tiles[key] = {
el: tile,
+   wid: 0,
coords: coords,
current: true
};
@@ -1062,19 +1066,25 @@ L.CanvasTileLayer = L.TileLayer.extend({
rectQueue = rectangles[r];
var tilePositionsX = '';
var tilePositionsY = '';
+   var tileWids = '';
for (i = 0; i < rectQueue.length; i++) {
coords = rectQueue[i];
+   key = this._tileCoordsToKey(coords);
+
twips = this._coordsToTwips(coords);
 
-   if (tilePositionsX !== '') {
+   if (tilePositionsX !== '')
tilePositionsX += ',';
-   }
tilePositionsX += twips.x;
 
-   if (tilePositionsY !== '') {
+   if (tilePositionsY !== '')
tilePositionsY += ',';
-   }
tilePositionsY += twips.y;
+
+   tile = 
this._tiles[this._tileCoordsToKey(coords)];
+   if (tileWids !== '')
+   tileWids += ',';
+   tileWids += tile && tile.wireId !== undefined ? 
tile.wireId : 0;
}
 
twips = this._coordsToTwips(coords);
@@ -1085,6 +1095,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
'height=' + this._tileHeightPx + ' ' +
'tileposx=' + tilePositionsX + ' ' +
'tileposy=' + tilePositionsY + ' ' +
+   'oldwid=' + tileWids + ' ' +
'tilewidth=' + this._tileWidthTwips + ' ' +
'tileheight=' + this._tileHeightTwips;
this._map._socket.sendMessage(msg, '');
@@ -1295,6 +1306,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
this._tiles[key]._invalidCount -= 1;
}
tile.el.src = img;
+   tile.wire

[Libreoffice-commits] online.git: Branch 'feature/calc-canvas2' - loleaflet/src

2020-09-16 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3bd84922ecf9ab86179b23168866e214baa240da
Author: Michael Meeks 
AuthorDate: Wed Sep 16 15:40:49 2020 +0100
Commit: Michael Meeks 
CommitDate: Wed Sep 16 15:40:49 2020 +0100

calc canvas: use the right canvas size in core pixels to clear.

Change-Id: I058cabd4daa51eb7da1f1ee33e59464692f00331

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index bbc4c3cfc..e814acaec 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -135,7 +135,7 @@ L.CanvasTilePainter = L.Class.extend({
this._canvasCtx.fillStyle = 'rgba(255, 0, 0, 0.5)';
else
this._canvasCtx.fillStyle = 'white';
-   this._canvasCtx.fillRect(0, 0, this._width, this._height);
+   this._canvasCtx.fillRect(0, 0, this._pixWidth, this._pixHeight);
},
 
// Details of tile areas to render
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'feature/calc-canvas2' - 3 commits - loleaflet/src

2020-09-16 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js   |  103 ++--
 loleaflet/src/layer/tile/CanvasTileLayer.js |   24 --
 2 files changed, 112 insertions(+), 15 deletions(-)

New commits:
commit a31dd80975f0613651d4b753432e74fafb0564cf
Author: Michael Meeks 
AuthorDate: Tue Sep 15 19:53:16 2020 +0100
Commit: Michael Meeks 
CommitDate: Wed Sep 16 10:03:06 2020 +0100

calc grid: re-render the canvas when we get grid details.

Change-Id: I3d1d1485e561d8c807daa0dfe0a9f2cb5651d31b

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 9eabee6fe..bbc4c3cfc 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -375,6 +375,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
}
this._map.on('resize zoomend', this._painter.update, 
this._painter);
this._map.on('splitposchanged', this._painter.update, 
this._painter);
+   this._map.on('sheetgeometrychanged', this._painter.update, 
this._painter);
this._map.on('move', this._syncTilePanePos, this);
},
 
commit 6eeff3ac8e3717712635a015db4290e5673c23c0
Author: Michael Meeks 
AuthorDate: Tue Sep 15 11:02:54 2020 +0100
Commit: Michael Meeks 
CommitDate: Wed Sep 16 10:00:55 2020 +0100

calc grid: fix this interleaving.

When the span starts in the middle of the view don't render backwards.

Change-Id: Icc97fef88a65c0ca83167ddb72c03bece9a8e047

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 8a94e0799..8b9b3c4d9 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -1845,8 +1845,10 @@ L.SheetDimension = L.Class.extend({
(spanData.data.sizecore * (spanData.end - 
spanData.start + 1));
if (spanFirstCorePx < endPix && spanData.data.poscorepx 
> startPix)
{
-   var firstCorePx = startPix + 
spanData.data.sizecore -
-   ((startPix - spanFirstCorePx) % 
spanData.data.sizecore);
+   var firstCorePx = Math.max(
+   spanFirstCorePx,
+   startPix + spanData.data.sizecore -
+   ((startPix - spanFirstCorePx) % 
spanData.data.sizecore));
var lastCorePx = Math.min(endPix, 
spanData.data.poscorepx);
 
for (var pos = firstCorePx; pos <= lastCorePx; 
pos += spanData.data.sizecore) {
commit 622e470d855d664ab72c546766ac3ec250754d61
Author: Michael Meeks 
AuthorDate: Wed Sep 9 10:05:44 2020 +0100
Commit: Michael Meeks 
CommitDate: Wed Sep 16 09:43:30 2020 +0100

calc canvas: start of direct grid rendering.

Change-Id: If471fc4ff94b3cb8e2897ac76e712aa3958fc7d2

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 98238c598..8a94e0799 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -741,6 +741,67 @@ L.CalcTileLayer = BaseTileLayer.extend({
converter: this._twipsToPixels,
context: this
});
+   var that = this;
+   this._painter.renderBackground = function(canvas, ctx)
+   {
+   if (this._layer._debug)
+   this._canvasCtx.fillStyle = 'rgba(255, 0, 0, 
0.5)';
+   else
+   this._canvasCtx.fillStyle = 'white'; // FIXME: 
sheet bg color
+   this._canvasCtx.fillRect(0, 0, ctx.canvasSize.x, 
ctx.canvasSize.y);
+
+   if (that._debug)
+   canvas.strokeStyle = 'blue';
+   else // now fr some grid-lines ...
+   canvas.strokeStyle = '#c0c0c0';
+   canvas.lineWidth = 1.0;
+
+   canvas.beginPath();
+   for (var i = 0; i < ctx.paneBoundsList.length; ++i) {
+   // FIXME: de-duplicate before firing myself:
+
+   // co-ordinates of this pane in core document 
pixels
+   var paneBounds = 
that._cssBoundsToCore(ctx.paneBoundsList[i]);
+   // co-ordinates of the main-(bottom right) pane 
in core document pixels
+   var viewBounds = 
that._cssBoundsToCore(ctx.viewBounds);
+   // into real pixel-land ...
+   paneBounds.round();
+   viewBounds.round();
+
+ 

[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - loleaflet/src

2020-09-15 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 8ac9c59e39520cd0898431b6f74ce4180c812252
Author: Michael Meeks 
AuthorDate: Tue Sep 15 19:53:16 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Sep 15 19:53:16 2020 +0100

calc grid: re-render the canvas when we get grid details.

Change-Id: I3d1d1485e561d8c807daa0dfe0a9f2cb5651d31b

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 5ab4b7ff2..075791d78 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -395,6 +395,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
}
this._map.on('resize zoomend', this._painter.update, 
this._painter);
this._map.on('splitposchanged', this._painter.update, 
this._painter);
+   this._map.on('sheetgeometrychanged', this._painter.update, 
this._painter);
this._map.on('move', this._syncTilePanePos, this);
},
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - loleaflet/src

2020-09-15 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 9a558124440ccd0a51e964647150d79a2c03525b
Author: Michael Meeks 
AuthorDate: Tue Sep 15 11:02:54 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Sep 15 11:02:54 2020 +0100

calc grid: fix this interleaving.

When the span starts in the middle of the view don't render backwards.

Change-Id: Icc97fef88a65c0ca83167ddb72c03bece9a8e047

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 7cf1318a7..2c08e2faa 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -1839,8 +1839,10 @@ L.SheetDimension = L.Class.extend({
(spanData.data.sizecore * (spanData.end - 
spanData.start + 1));
if (spanFirstCorePx < endPix && spanData.data.poscorepx 
> startPix)
{
-   var firstCorePx = startPix + 
spanData.data.sizecore -
-   ((startPix - spanFirstCorePx) % 
spanData.data.sizecore);
+   var firstCorePx = Math.max(
+   spanFirstCorePx,
+   startPix + spanData.data.sizecore -
+   ((startPix - spanFirstCorePx) % 
spanData.data.sizecore));
var lastCorePx = Math.min(endPix, 
spanData.data.poscorepx);
 
for (var pos = firstCorePx; pos <= lastCorePx; 
pos += spanData.data.sizecore) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: CODE/LOOL macro execution

2020-09-10 Thread Michael Meeks
Hi Jakub,

On 10/09/2020 09:13, Jakub Kościelak wrote:
> How can I enable Macros ?

Good question =)

> I tried adding the appropriate lines to the
> |/etc/loolwsd/loolkitconfig.xcu, with no luck.|

Ah - ook.

> | oor:nillable="false">*0*

I would expect something like:

true

In your loolkitconfig.xcu - ie. with a full path to that setting.

The best way to find those paths is to load desktop LibreOffice, change
the setting and look in registerymodification.xcu to see what that did =)

> |Is this good way ?|

HTH,

Michael.

-- 
michael.me...@collabora.com <><, GM Collabora Productivity
Hangout: mejme...@gmail.com, Skype: mmeeks
(M) +44 7795 666 147 - timezone usually UK / Europe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - loleaflet/src

2020-09-10 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 693c60eebf1cc285e5b9ff8941207efedd898c3c
Author: Michael Meeks 
AuthorDate: Thu Sep 10 15:35:27 2020 +0100
Commit: Michael Meeks 
CommitDate: Thu Sep 10 15:35:27 2020 +0100

calc canvas: get the right core px size of the canvas across.

Change-Id: Ib079097b9d5caf707bd95b286d675791b5df9255

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index d035f6ee9..5ab4b7ff2 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -97,16 +97,16 @@ L.CanvasTilePainter = L.Class.extend({
},
 
_setCanvasSize: function (widthCSSPx, heightCSSPx) {
-   var pixWidth = Math.floor(widthCSSPx * this._dpiScale);
-   var pixHeight = Math.floor(heightCSSPx * this._dpiScale);
+   this._pixWidth = Math.floor(widthCSSPx * this._dpiScale);
+   this._pixHeight = Math.floor(heightCSSPx * this._dpiScale);
 
// real pixels have to be integral
-   this._canvas.width = pixWidth;
-   this._canvas.height = pixHeight;
+   this._canvas.width = this._pixWidth;
+   this._canvas.height = this._pixHeight;
 
// CSS pixels can be fractional, but need to round to the same 
real pixels
-   var cssWidth = pixWidth / this._dpiScale; // NB. beware
-   var cssHeight = pixHeight / this._dpiScale;
+   var cssWidth = this._pixWidth / this._dpiScale; // NB. beware
+   var cssHeight = this._pixHeight / this._dpiScale;
this._canvas.style.width = cssWidth.toFixed(4) + 'px';
this._canvas.style.height = cssHeight.toFixed(4) + 'px';
 
@@ -148,8 +148,9 @@ L.CanvasTilePainter = L.Class.extend({
var paneBoundsList = splitPanesContext ?
splitPanesContext.getPxBoundList(viewBounds) :
[viewBounds];
+   var canvasCorePx = new L.Point(this._pixWidth, this._pixHeight);
 
-   return { canvasSize: this._lastSize,
+   return { canvasSize: canvasCorePx,
 tileSize: tileSize,
 viewBounds: viewBounds,
 paneBoundsList: paneBoundsList };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - 2 commits - loleaflet/Makefile.am loleaflet/src

2020-09-09 Thread Michael Meeks (via logerrit)
 loleaflet/Makefile.am   |1 
 loleaflet/src/core/Socket.js|7 -
 loleaflet/src/layer/CalcGridLines.js|  112 
 loleaflet/src/layer/tile/CalcTileLayer.js   |  101 +++--
 loleaflet/src/layer/tile/CanvasTileLayer.js |   26 --
 loleaflet/src/map/Map.js|1 
 6 files changed, 111 insertions(+), 137 deletions(-)

New commits:
commit 6c1d69e248e36c2afc9499bcacbf5750d47e19c6
Author: Michael Meeks 
AuthorDate: Wed Sep 9 22:47:14 2020 +0100
Commit: Michael Meeks 
CommitDate: Wed Sep 9 22:47:14 2020 +0100

calc canvas: remove svg grid-line background layer.

occluded by opaque canvas above it anyway.

Change-Id: I954da92c43ae680e6041cbff6092f9a2ac71ebe2

diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index 44c4886fa..62036d993 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -221,7 +221,6 @@ LOLEAFLET_JS =\
src/layer/marker/Marker.Popup.js \
src/layer/LayerGroup.js \
src/layer/FeatureGroup.js \
-   src/layer/CalcGridLines.js \
src/layer/vector/Renderer.js \
src/layer/vector/Path.js \
src/layer/vector/Path.Popup.js \
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index fa78bf1a3..473c85ce5 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -994,13 +994,6 @@ L.Socket = L.Class.extend({
tileHeightTwips: tileHeightTwips,
docType: command.type
});
-
-   this._map.options.backgroundLayerEnabled = 
!(docLayer instanceof L.CanvasTileLayer);
-
-   if (this._map.options.backgroundLayerEnabled) {
-   docLayer.backgroundLayer = new 
L.CalcBackground().addTo(this._map);
-   (new 
L.CalcGridLines()).addTo(this._map);
-   }
}
else {
if (command.type === 'presentation' &&
diff --git a/loleaflet/src/layer/CalcGridLines.js 
b/loleaflet/src/layer/CalcGridLines.js
deleted file mode 100644
index fce802101..0
--- a/loleaflet/src/layer/CalcGridLines.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * A Leaflet layer that draws grid lines for spreadsheet row/column separators.
- */
-
-L.CalcGridLines = L.LayerGroup.extend({
-   // Options given to L.CalcGridLines will be propagated into the spawned
-   // L.PolyLines. Default is thin grey lines.
-   options: {
-   color: '#c0c0c0',
-   weight: 1,
-   interactive: false
-   },
-
-
-   initialize: function(options) {
-   L.LayerGroup.prototype.initialize.call(this, options);
-   this._rowLines = L.layerGroup();
-   this._colLines = L.layerGroup();
-   },
-
-   onAdd: function(map) {
-
-   // The SVG renderer needs some specific customizations
-   if (!this.options.renderer) {
-   map.createPane('calc-background');
-
-   this.options.renderer = new L.SVG({
-   pane: 'calc-background'
-   });
-
-   // Hack the _updatePoly private method so it offsets 
all SVG path coordinates
-   // to 0.5. This makes the rendered lines align to the 
screen pixel grid
-   // nicely (at least in non-HPI screens)
-   this.options.renderer._updatePoly = function(layer, 
closed) {
-   var str = '', i, j, len, len2, points, p, rings 
= layer._parts;
-
-   for (i = 0, len = rings.length; i < len; i++) {
-   points = rings[i];
-
-   for (j = 0, len2 = points.length; j < 
len2; j++) {
-   p = points[j];
-   str += (j ? 'L' : 'M') + 
(Math.ceil(p.x) - 0.5) + ' ' + (Math.ceil(p.y) - 0.5);
-   }
-
-   // closes the ring for polygons; "x" is 
VML syntax
-   str += closed ? (L.Browser.svg ? 'z' : 
'x') : '';
-   }
-
-   // SVG complains about empty path strings
-   if (str === '') {
-   str = 'M0 0';
-   }
-
-   this._setPath(layer, str, closed);
-   }.bind(this.options.renderer);
-   }
-
-   this._map.on('viewrowcolum

[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - loleaflet/src

2020-09-09 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |   17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 64a860340886498be592c3ee09d8f1fc6022ef31
Author: Michael Meeks 
AuthorDate: Wed Sep 9 12:02:50 2020 +0100
Commit: Michael Meeks 
CommitDate: Wed Sep 9 12:06:06 2020 +0100

calc tiles: clarify some magic.

Change-Id: I2d95dd09b5640a5216e72366493ddf77541c8b73

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index aee0f9b60..dd198966b 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -162,7 +162,9 @@ L.CanvasTilePainter = L.Class.extend({
var tileBounds = new L.Bounds(tileTopLeft, 
tileTopLeft.add(ctx.tileSize));
 
for (var i = 0; i < ctx.paneBoundsList.length; ++i) {
+   // co-ordinates of this pane in core document pixels
var paneBounds = 
this._layer._cssBoundsToCore(ctx.paneBoundsList[i]);
+   // co-ordinates of the main-(bottom right) pane in core 
document pixels
var viewBounds = 
this._layer._cssBoundsToCore(ctx.viewBounds);
 
// into real pixel-land ...
@@ -172,16 +174,17 @@ L.CanvasTilePainter = L.Class.extend({
if (!paneBounds.intersects(tileBounds))
continue;
 
-   var offset = paneBounds.getTopLeft(); // allocates
-   offset.x = Math.min(offset.x, viewBounds.min.x);
-   offset.y = Math.min(offset.y, viewBounds.min.y);
+   var paneOffset = paneBounds.getTopLeft(); // allocates
+   // Cute way to detect the in-canvas pixel offset of 
each pane
+   paneOffset.x = Math.min(paneOffset.x, viewBounds.min.x);
+   paneOffset.y = Math.min(paneOffset.y, viewBounds.min.y);
 
// when using the pinch to zoom, set additional 
translation based */
// on the pinch movement
if (this._map._animatingZoom) {
var centerOffset = 
this._map._getCenterOffset(this._map._animateToCenter);
-   offset.x += Math.round(centerOffset.x);
-   offset.y += Math.round(centerOffset.y);
+   paneOffset.x += Math.round(centerOffset.x);
+   paneOffset.y += Math.round(centerOffset.y);
}
 
// intersect - to avoid state thrash through clipping
@@ -198,8 +201,8 @@ L.CanvasTilePainter = L.Class.extend({
  crop.min.x - tileBounds.min.x,
  crop.min.y - tileBounds.min.y,
  cropWidth, cropHeight,
- crop.min.x - offset.x,
- crop.min.y - offset.y,
+ crop.min.x - paneOffset.x,
+ crop.min.y - paneOffset.y,
  cropWidth, cropHeight);
if (this._layer._debug)
{
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - loleaflet/src

2020-09-08 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |   22 +-
 1 file changed, 9 insertions(+), 13 deletions(-)

New commits:
commit 19a5000a69654e181abd5c67a5a9c32ee60fb91d
Author: Michael Meeks 
AuthorDate: Tue Sep 8 16:18:31 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Sep 8 16:18:31 2020 +0100

calc canvas: avoid repeated setTransform; build the right offset.

Change-Id: Iab153b25fa38f27742a052ad0892e3d55c2c04cc

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index c44e2ae47..aee0f9b60 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -94,6 +94,7 @@ L.CanvasTilePainter = L.Class.extend({
this._lastSize = mapSize;
this._lastMapSize = mapSize;
this._setCanvasSize(mapSize.x, mapSize.y);
+   this._canvasCtx.setTransform(1,0,0,1,0,0);
},
 
_setCanvasSize: function (widthCSSPx, heightCSSPx) {
@@ -130,7 +131,6 @@ L.CanvasTilePainter = L.Class.extend({
},
 
clear: function () {
-   this._canvasCtx.setTransform(1,0,0,1,0,0);
if (this._layer._debug)
this._canvasCtx.fillStyle = 'rgba(255, 0, 0, 0.5)';
else
@@ -172,20 +172,16 @@ L.CanvasTilePainter = L.Class.extend({
if (!paneBounds.intersects(tileBounds))
continue;
 
-   var topLeft = paneBounds.getTopLeft();
-   if (topLeft.x)
-   topLeft.x = viewBounds.min.x;
-   if (topLeft.y)
-   topLeft.y = viewBounds.min.y;
+   var offset = paneBounds.getTopLeft(); // allocates
+   offset.x = Math.min(offset.x, viewBounds.min.x);
+   offset.y = Math.min(offset.y, viewBounds.min.y);
 
-   this._canvasCtx.setTransform(1,0,
-0,1,
--topLeft.x, -topLeft.y);
-   // when using the pinch to zoom, set additional 
translation based
+   // when using the pinch to zoom, set additional 
translation based */
// on the pinch movement
if (this._map._animatingZoom) {
var centerOffset = 
this._map._getCenterOffset(this._map._animateToCenter);
-   
this._canvasCtx.translate(-Math.round(centerOffset.x), 
-Math.round(centerOffset.y));
+   offset.x += Math.round(centerOffset.x);
+   offset.y += Math.round(centerOffset.y);
}
 
// intersect - to avoid state thrash through clipping
@@ -202,7 +198,8 @@ L.CanvasTilePainter = L.Class.extend({
  crop.min.x - tileBounds.min.x,
  crop.min.y - tileBounds.min.y,
  cropWidth, cropHeight,
- crop.min.x, crop.min.y,
+ crop.min.x - offset.x,
+ crop.min.y - offset.y,
  cropWidth, cropHeight);
if (this._layer._debug)
{
@@ -218,7 +215,6 @@ L.CanvasTilePainter = L.Class.extend({
return;
}
var splitPos = 
this._layer._cssPixelsToCore(splitPanesContext.getSplitPos());
-   this._canvasCtx.setTransform(1,0,0,1,0,0);
this._canvasCtx.strokeStyle = 'red';
this._canvasCtx.strokeRect(0, 0, splitPos.x, splitPos.y);
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - 2 commits - loleaflet/src

2020-09-08 Thread Michael Meeks (via logerrit)
 loleaflet/src/geometry/Bounds.js|7 ++
 loleaflet/src/layer/tile/CanvasTileLayer.js |   31 
 2 files changed, 30 insertions(+), 8 deletions(-)

New commits:
commit 02ff5aba43627e28b1ebf3726a370305edf97780
Author: Michael Meeks 
AuthorDate: Tue Sep 8 16:03:34 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Sep 8 16:04:06 2020 +0100

calc canvas: use sub image blitting instead of clipping.

Avoids thrashing the canvas rendering context / clip state.

Change-Id: I547ce22a171874cd7be3a0fac50b4afc56faf084

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 9f6f4c42b..c44e2ae47 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -178,7 +178,9 @@ L.CanvasTilePainter = L.Class.extend({
if (topLeft.y)
topLeft.y = viewBounds.min.y;
 
-   this._canvasCtx.setTransform(1,0,0,1,-topLeft.x, 
-topLeft.y);
+   this._canvasCtx.setTransform(1,0,
+0,1,
+-topLeft.x, -topLeft.y);
// when using the pinch to zoom, set additional 
translation based
// on the pinch movement
if (this._map._animatingZoom) {
@@ -186,13 +188,22 @@ L.CanvasTilePainter = L.Class.extend({

this._canvasCtx.translate(-Math.round(centerOffset.x), 
-Math.round(centerOffset.y));
}
 
-   // create a clip for the pane/view.
-   this._canvasCtx.beginPath();
-   var paneSize = paneBounds.getSize();
-   this._canvasCtx.rect(paneBounds.min.x, 
paneBounds.min.y, paneSize.x + 1, paneSize.y + 1);
-   this._canvasCtx.clip();
-
-   this._canvasCtx.drawImage(tile.el, tile.coords.x, 
tile.coords.y);
+   // intersect - to avoid state thrash through clipping
+   var crop = new L.Bounds(tileBounds.min, tileBounds.max);
+   crop.min.x = Math.max(paneBounds.min.x, 
tileBounds.min.x);
+   crop.min.y = Math.max(paneBounds.min.y, 
tileBounds.min.y);
+   crop.max.x = Math.min(paneBounds.max.x, 
tileBounds.max.x);
+   crop.max.y = Math.min(paneBounds.max.y, 
tileBounds.max.y);
+
+   var cropWidth = crop.max.x - crop.min.x;
+   var cropHeight = crop.max.y - crop.min.y;
+
+   this._canvasCtx.drawImage(tile.el,
+ crop.min.x - tileBounds.min.x,
+ crop.min.y - tileBounds.min.y,
+ cropWidth, cropHeight,
+ crop.min.x, crop.min.y,
+ cropWidth, cropHeight);
if (this._layer._debug)
{
this._canvasCtx.strokeStyle = 'rgba(255, 0, 0, 
0.5)';
commit 53f3ef5bfb21d5a2ff0c61dd6500ca4c850a821a
Author: Michael Meeks 
AuthorDate: Tue Sep 8 16:03:15 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Sep 8 16:04:06 2020 +0100

calc canvas: round view co-ordinates to the real pixels we need.

Change-Id: I768cd9015da1f1301f3ddad242130d4eddb426d1

diff --git a/loleaflet/src/geometry/Bounds.js b/loleaflet/src/geometry/Bounds.js
index 8dacdc832..e9ac075e8 100644
--- a/loleaflet/src/geometry/Bounds.js
+++ b/loleaflet/src/geometry/Bounds.js
@@ -83,6 +83,13 @@ L.Bounds.prototype = {
(this.min.y + this.max.y) / 2, round);
},
 
+   round: function() {
+   this.min.x = Math.round(this.min.x);
+   this.min.y = Math.round(this.min.y);
+   this.max.x = Math.round(this.max.x);
+   this.max.y = Math.round(this.max.y);
+   },
+
getBottomLeft: function () { // -> Point
return new L.Point(this.min.x, this.max.y);
},
diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 5a030050a..9f6f4c42b 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -165,6 +165,10 @@ L.CanvasTilePainter = L.Class.extend({
var paneBounds = 
this._layer._cssBoundsToCore(ctx.paneBoundsList[i]);
var viewBounds = 
this._layer._cssBoundsToCore(ctx.viewBounds);
 
+   // into real pixel-land ...
+   paneBounds.round();
+   viewBounds.ro

[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - loleaflet/src

2020-09-08 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |   14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

New commits:
commit c1c1ae1a395abc54d279487560e4fa5fac5c5af6
Author: Michael Meeks 
AuthorDate: Tue Sep 8 15:25:09 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Sep 8 15:25:09 2020 +0100

calc canvas: avoid lots of canvas context save/restores.

Change-Id: Ib813686ef7d495e660ad8fa3b545391180b9e019

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 4a35b4939..5a030050a 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -130,14 +130,12 @@ L.CanvasTilePainter = L.Class.extend({
},
 
clear: function () {
-   this._canvasCtx.save();
-   this._canvasCtx.scale(1, 1);
+   this._canvasCtx.setTransform(1,0,0,1,0,0);
if (this._layer._debug)
this._canvasCtx.fillStyle = 'rgba(255, 0, 0, 0.5)';
else
this._canvasCtx.fillStyle = 'white';
this._canvasCtx.fillRect(0, 0, this._width, this._height);
-   this._canvasCtx.restore();
},
 
// Details of tile areas to render
@@ -176,10 +174,7 @@ L.CanvasTilePainter = L.Class.extend({
if (topLeft.y)
topLeft.y = viewBounds.min.y;
 
-   this._canvasCtx.save();
-   this._canvasCtx.scale(1, 1);
-   this._canvasCtx.translate(-topLeft.x, -topLeft.y);
-
+   this._canvasCtx.setTransform(1,0,0,1,-topLeft.x, 
-topLeft.y);
// when using the pinch to zoom, set additional 
translation based
// on the pinch movement
if (this._map._animatingZoom) {
@@ -199,7 +194,6 @@ L.CanvasTilePainter = L.Class.extend({
this._canvasCtx.strokeStyle = 'rgba(255, 0, 0, 
0.5)';
this._canvasCtx.strokeRect(tile.coords.x, 
tile.coords.y, 256, 256);
}
-   this._canvasCtx.restore();
}
},
 
@@ -209,11 +203,9 @@ L.CanvasTilePainter = L.Class.extend({
return;
}
var splitPos = 
this._layer._cssPixelsToCore(splitPanesContext.getSplitPos());
-   this._canvasCtx.save();
-   this._canvasCtx.scale(1, 1);
+   this._canvasCtx.setTransform(1,0,0,1,0,0);
this._canvasCtx.strokeStyle = 'red';
this._canvasCtx.strokeRect(0, 0, splitPos.x, splitPos.y);
-   this._canvasCtx.restore();
},
 
_updateWithRAF: function () {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: CODE/LOOL macro execution

2020-09-07 Thread Michael Meeks
Hi Jakub,

On 02/09/2020 20:56, Jakub Kościelak wrote:
> I know this is a developers list, but it's the best place to ask ;-)
> 
> Can I execute macros in documents in CODE/LOOL ?

Yes; but its disabled by default.

Its not entirely clear that the APIs we have are suited for
collaborative editing - particularly these long running dialog 'Execute'
methods that pile up stack frames.

So - depends on your macro really.

HTH,

Michael.

-- 
michael.me...@collabora.com <><, GM Collabora Productivity
Hangout: mejme...@gmail.com, Skype: mmeeks
(M) +44 7795 666 147 - timezone usually UK / Europe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - 44 commits - common/Authorization.cpp common/Util.cpp common/Util.hpp cypress_test/integration_tests cypress_test/Makefile.am cypress_t

2020-09-02 Thread Michael Meeks (via logerrit)
Rebased ref, commits from common ancestor:
commit f59a9cf7fca78c1d8095a8d020862a6203c03b33
Author: Michael Meeks 
AuthorDate: Tue Sep 1 21:35:35 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Sep 2 14:57:34 2020 +0200

calc canvas: paint invalid tiles until their replacement arrives.

This avoids display corruption when panning, whereby stale/old
canvas content would continue to be rendered in the 'holes'
where invalid tiles were not rendered.

Change-Id: Ic886c0924c5a930116b1437c8e0cf35726ab76a5

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 8643f8bf7..6d6aacecd 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -253,7 +253,7 @@ L.CanvasTilePainter = L.Class.extend({
!splitPosChanged &&
!scaleChanged);
 
-   console.debug('Tile size: ' + this._layer._getTileSize());
+// console.debug('Tile size: ' + this._layer._getTileSize());
 
if (skipUpdate)
return;
@@ -306,10 +306,14 @@ L.CanvasTilePainter = L.Class.extend({
 
var key = coords.key();
var tile = this._layer._tiles[key];
-   var invalid = tile && 
tile._invalidCount && tile._invalidCount > 0;
-   if (tile && tile.loaded && !invalid) {
+// var invalid = tile && 
tile._invalidCount && tile._invalidCount > 0;
+   if (tile && tile.loaded) {
this.paint(tile, ctx);
}
+/* else
+   console.log('missing tile at ' 
+ i + ', ' + j + ' ' +
+   tile + ' ' + (tile 
&& tile.loaded) + ' ' +
+   (tile ? 
tile._invalidCount : -42) + ' ' + invalid); */
}
}
        }
commit db0f5292b3af7e94cd8d2676add83f0f03c72824
Author: Michael Meeks 
AuthorDate: Tue Sep 1 16:53:02 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Sep 2 14:57:34 2020 +0200

calc tiles: don't send un-necessary zoom / visible area changes.

Lots of redundant zoom messages seem unhelpful.

Change-Id: I944a3202739adfc89aab81902b467a4e34977202

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 8ef3cb886..8643f8bf7 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -697,9 +697,8 @@ L.CanvasTileLayer = L.TileLayer.extend({
}
}
 
-   this._sendClientVisibleArea(true);
-
-   this._sendClientZoom(true);
+   this._sendClientVisibleArea();
+   this._sendClientZoom();
 
if (queue.length !== 0) {
if (cancelTiles) {
commit 91d6a485382494f618f970cb31be4be570ca9643
Author: Michael Meeks 
AuthorDate: Tue Sep 1 16:52:35 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Sep 2 14:57:34 2020 +0200

calc tiles: use canvas rendering for mobile too.

This way the row/column headers line up - and it's the future.

Change-Id: I56b2c2527dcc751ed06fc3b30aff22544ec4c269

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index eedf8966a..fc96f0546 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -4,8 +4,7 @@
  */
 
 /* global */
-var BaseTileLayer = L.Browser.mobile ? L.TileLayer : L.CanvasTileLayer;
-L.CalcTileLayer = BaseTileLayer.extend({
+L.CalcTileLayer = L.CanvasTileLayer.extend({
options: {
// TODO: sync these automatically from SAL_LOK_OPTIONS
sheetGeometryDataEnabled: true,
@@ -82,7 +81,7 @@ L.CalcTileLayer = BaseTileLayer.extend({
map.addControl(L.control.tabs());
map.addControl(L.control.columnHeader());
map.addControl(L.control.rowHeader());
-   BaseTileLayer.prototype.onAdd.call(this, map);
+   L.CanvasTileLayer.prototype.onAdd.call(this, map);
 
map.on('resize', function () {
if (this.isCursorVisible()) {
commit 322fcef3e7b7630c5707068d8d43fb8588332331
Author: Michael Meeks 
AuthorDate: Tue Sep 1 16:24:18 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Wed Sep 2 14:57:34 2020 +0200

calc canvas: ensure that the fraction width rounds to the pixel

[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - loleaflet/src

2020-09-01 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 071824e9a8c50c4159abbdc865bae19f41741930
Author: Michael Meeks 
AuthorDate: Tue Sep 1 21:35:35 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Sep 1 21:35:35 2020 +0100

calc canvas: paint invalid tiles until their replacement arrives.

This avoids display corruption when panning, whereby stale/old
canvas content would continue to be rendered in the 'holes'
where invalid tiles were not rendered.

Change-Id: Ic886c0924c5a930116b1437c8e0cf35726ab76a5

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 8643f8bf7..6d6aacecd 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -253,7 +253,7 @@ L.CanvasTilePainter = L.Class.extend({
!splitPosChanged &&
!scaleChanged);
 
-   console.debug('Tile size: ' + this._layer._getTileSize());
+// console.debug('Tile size: ' + this._layer._getTileSize());
 
if (skipUpdate)
return;
@@ -306,10 +306,14 @@ L.CanvasTilePainter = L.Class.extend({
 
var key = coords.key();
var tile = this._layer._tiles[key];
-   var invalid = tile && 
tile._invalidCount && tile._invalidCount > 0;
-   if (tile && tile.loaded && !invalid) {
+// var invalid = tile && 
tile._invalidCount && tile._invalidCount > 0;
+   if (tile && tile.loaded) {
this.paint(tile, ctx);
}
+/* else
+   console.log('missing tile at ' 
+ i + ', ' + j + ' ' +
+   tile + ' ' + (tile 
&& tile.loaded) + ' ' +
+   (tile ? 
tile._invalidCount : -42) + ' ' + invalid); */
}
}
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - 3 commits - loleaflet/src

2020-09-01 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js   |5 ++---
 loleaflet/src/layer/tile/CanvasTileLayer.js |   22 +++---
 2 files changed, 17 insertions(+), 10 deletions(-)

New commits:
commit cd1f1293d9a33f77e37397ac7d69a9cb0b765fea
Author: Michael Meeks 
AuthorDate: Tue Sep 1 16:53:02 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Sep 1 16:53:02 2020 +0100

calc tiles: don't send un-necessary zoom / visible area changes.

Lots of redundant zoom messages seem unhelpful.

Change-Id: I944a3202739adfc89aab81902b467a4e34977202

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 8ef3cb886..8643f8bf7 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -697,9 +697,8 @@ L.CanvasTileLayer = L.TileLayer.extend({
}
}
 
-   this._sendClientVisibleArea(true);
-
-   this._sendClientZoom(true);
+   this._sendClientVisibleArea();
+   this._sendClientZoom();
 
if (queue.length !== 0) {
if (cancelTiles) {
commit ebacd1a031e41dfe873128a35f1ab6cb1c51b101
Author: Michael Meeks 
AuthorDate: Tue Sep 1 16:52:35 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Sep 1 16:52:35 2020 +0100

calc tiles: use canvas rendering for mobile too.

This way the row/column headers line up - and it's the future.

Change-Id: I56b2c2527dcc751ed06fc3b30aff22544ec4c269

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 403f2e27e..7bc11901e 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -4,8 +4,7 @@
  */
 
 /* global */
-var BaseTileLayer = L.Browser.mobile ? L.TileLayer : L.CanvasTileLayer;
-L.CalcTileLayer = BaseTileLayer.extend({
+L.CalcTileLayer = L.CanvasTileLayer.extend({
options: {
// TODO: sync these automatically from SAL_LOK_OPTIONS
sheetGeometryDataEnabled: true,
@@ -82,7 +81,7 @@ L.CalcTileLayer = BaseTileLayer.extend({
map.addControl(L.control.tabs());
map.addControl(L.control.columnHeader());
map.addControl(L.control.rowHeader());
-   BaseTileLayer.prototype.onAdd.call(this, map);
+   L.CanvasTileLayer.prototype.onAdd.call(this, map);
 
map.on('resize', function () {
if (this.isCursorVisible()) {
commit ee15411f94a9bd90c84facd4cb9b09057fa6a768
Author: Michael Meeks 
AuthorDate: Tue Sep 1 16:24:18 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Sep 1 16:24:18 2020 +0100

calc canvas: ensure that the fraction width rounds to the pixel width.

Slave CSS geometry from integral canvas pixels, don't attempt the
reverse.

Change-Id: I369ed1bea3c4a5a199192aa1e84bb4e03dcb2e94

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 4983fef2a..8ef3cb886 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -96,11 +96,20 @@ L.CanvasTilePainter = L.Class.extend({
},
 
_setCanvasSize: function (widthCSSPx, heightCSSPx) {
-   this._canvas.style.width = widthCSSPx + 'px';
-   this._canvas.style.height = heightCSSPx + 'px';
-   this._canvas.width = Math.floor(widthCSSPx * this._dpiScale);
-   this._canvas.height = Math.floor(heightCSSPx * this._dpiScale);
+   var pixWidth = Math.floor(widthCSSPx * this._dpiScale);
+   var pixHeight = Math.floor(heightCSSPx * this._dpiScale);
 
+   // real pixels have to be integral
+   this._canvas.width = pixWidth;
+   this._canvas.height = pixHeight;
+
+   // CSS pixels can be fractional, but need to round to the same 
real pixels
+   var cssWidth = pixWidth / this._dpiScale; // NB. beware
+   var cssHeight = pixHeight / this._dpiScale;
+   this._canvas.style.width = cssWidth.toFixed(4) + 'px';
+   this._canvas.style.height = cssHeight.toFixed(4) + 'px';
+
+   // FIXME: is this a good idea ? :
this._width = parseInt(this._canvas.style.width);
this._height = parseInt(this._canvas.style.height);
this.clear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - loleaflet/src

2020-08-31 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |   16 ++--
 1 file changed, 6 insertions(+), 10 deletions(-)

New commits:
commit 5977df94df89b253cd587a9153f43f8ae9750bfc
Author: Michael Meeks 
AuthorDate: Fri Aug 28 16:05:04 2020 +0100
Commit: Michael Meeks 
CommitDate: Mon Aug 31 16:29:10 2020 +0100

calc tiles: connect debug to global setting.

Change-Id: I0db008ac40020c9173d37969aa6c23b3a1696f79

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 35f23437a..4983fef2a 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -36,10 +36,6 @@ L.TileCoordData.parseKey = function (keyString) {
 
 L.CanvasTilePainter = L.Class.extend({
 
-   options: {
-   debug: true,
-   },
-
initialize: function (layer) {
this._layer = layer;
this._canvas = this._layer._canvas;
@@ -126,8 +122,8 @@ L.CanvasTilePainter = L.Class.extend({
clear: function () {
this._canvasCtx.save();
this._canvasCtx.scale(1, 1);
-   if (this.options.debug)
-   this._canvasCtx.fillStyle = 'red';
+   if (this._layer._debug)
+   this._canvasCtx.fillStyle = 'rgba(255, 0, 0, 0.5)';
else
this._canvasCtx.fillStyle = 'white';
this._canvasCtx.fillRect(0, 0, this._width, this._height);
@@ -181,9 +177,9 @@ L.CanvasTilePainter = L.Class.extend({
this._canvasCtx.clip();
 
this._canvasCtx.drawImage(tile.el, tile.coords.x, 
tile.coords.y);
-   if (this.options.debug)
+   if (this._layer._debug)
{
-   this._canvasCtx.strokeStyle = 'red';
+   this._canvasCtx.strokeStyle = 'rgba(255, 0, 0, 
0.5)';
this._canvasCtx.strokeRect(tile.coords.x, 
tile.coords.y, 256, 256);
}
this._canvasCtx.restore();
@@ -273,13 +269,13 @@ L.CanvasTilePainter = L.Class.extend({
this._topLeft = newTopLeft;
this._paintWholeCanvas();
 
-   if (this.options.debug)
+   if (this._layer._debug)
this._drawSplits();
},
 
_paintWholeCanvas: function () {
 
-   if (this.options.debug)
+   if (this._layer._debug)
this.clear();
 
var zoom = this._lastZoom || Math.round(this._map.getZoom());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - 2 commits - loleaflet/src

2020-08-21 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |   51 +---
 1 file changed, 24 insertions(+), 27 deletions(-)

New commits:
commit 1f51dc50f43a70edd30d54d67e0856d56170f3d9
Author: Michael Meeks 
AuthorDate: Fri Aug 21 20:43:47 2020 +0100
Commit: Michael Meeks 
CommitDate: Fri Aug 21 20:43:47 2020 +0100

Don't merge - grim hack try to get 1:1 pixels in canvas.

Change-Id: I8ff3f157112295e0c6ef6743de3c878329b98adb

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 9f3b6e02f..94937e047 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -40,22 +40,15 @@ L.CanvasTilePainter = L.Class.extend({
debug: true,
},
 
-   initialize: function (layer, enableImageSmoothing) {
+   initialize: function (layer) {
this._layer = layer;
this._canvas = this._layer._canvas;
 
var dpiScale = L.getDpiScaleFactor();
-   if (dpiScale === 1 || dpiScale === 2) {
-   enableImageSmoothing = (enableImageSmoothing === true);
-   }
-   else {
-   enableImageSmoothing = (enableImageSmoothing === 
undefined || enableImageSmoothing);
-   }
-
this._dpiScale = dpiScale;
 
this._map = this._layer._map;
-   this._setupCanvas(enableImageSmoothing);
+   this._setupCanvas();
 
this._topLeft = undefined;
this._lastZoom = undefined;
@@ -95,15 +88,11 @@ L.CanvasTilePainter = L.Class.extend({
this.stopUpdates();
},
 
-   setImageSmoothing: function (enable) {
-   this._canvasCtx.imageSmoothingEnabled = enable;
-   this._canvasCtx.msImageSmoothingEnabled = enable;
-   },
-
-   _setupCanvas: function (enableImageSmoothing) {
+   _setupCanvas: function () {
console.assert(this._canvas, 'no canvas element');
this._canvasCtx = this._canvas.getContext('2d', { alpha: false 
});
-   this.setImageSmoothing(enableImageSmoothing);
+   this._canvasCtx.imageSmoothingEnabled = false;
+   this._canvasCtx.msImageSmoothingEnabled = false;
var mapSize = this._map.getPixelBounds().getSize();
this._lastSize = mapSize;
this._lastMapSize = mapSize;
@@ -132,7 +121,7 @@ L.CanvasTilePainter = L.Class.extend({
 
clear: function () {
this._canvasCtx.save();
-   this._canvasCtx.scale(this._dpiScale, this._dpiScale);
+   this._canvasCtx.scale(1, 1);
if (this.options.debug)
this._canvasCtx.fillStyle = 'red';
else
@@ -177,7 +166,7 @@ L.CanvasTilePainter = L.Class.extend({
topLeft.y = ctx.viewBounds.min.y;
 
this._canvasCtx.save();
-   this._canvasCtx.scale(this._dpiScale, this._dpiScale);
+   this._canvasCtx.scale(1, 1);
this._canvasCtx.translate(-topLeft.x, -topLeft.y);
 
// create a clip for the pane/view.
@@ -186,12 +175,11 @@ L.CanvasTilePainter = L.Class.extend({
this._canvasCtx.rect(paneBounds.min.x, 
paneBounds.min.y, paneSize.x + 1, paneSize.y + 1);
this._canvasCtx.clip();
 
-   if (this._dpiScale !== 1) {
-   // FIXME: avoid this scaling when possible 
(dpiScale = 2).
-   this._canvasCtx.drawImage(tile.el, 
tile.coords.x, tile.coords.y, ctx.tileSize.x, ctx.tileSize.y);
-   }
-   else {
-   this._canvasCtx.drawImage(tile.el, 
tile.coords.x, tile.coords.y);
+   this._canvasCtx.drawImage(tile.el, tile.coords.x, 
tile.coords.y);
+   if (this.options.debug)
+   {
+   this._canvasCtx.strokeStyle = 'red';
+   this._canvasCtx.strokeRect(tile.coords.x, 
tile.coords.y, 256, 256);
}
this._canvasCtx.restore();
}
@@ -204,7 +192,7 @@ L.CanvasTilePainter = L.Class.extend({
}
var splitPos = splitPanesContext.getSplitPos();
this._canvasCtx.save();
-   this._canvasCtx.scale(this._dpiScale, this._dpiScale);
+   this._canvasCtx.scale(1, 1);
this._canvasCtx.strokeStyle = 'red';
this._canvasCtx.strokeRect(0, 0, splitPos.x, splitPos.y);
this._canvasCtx.restore();
@@ -249,6 +237,8 @@ L.CanvasTilePainter = L.Class.extend({
!splitPosChanged

[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - loleaflet/src

2020-08-21 Thread Michael Meeks (via logerrit)
Rebased ref, commits from common ancestor:
commit 2a8d58eba975e833802c625a4a9a48a476795b21
Author: Michael Meeks 
AuthorDate: Fri Aug 21 15:54:50 2020 +0100
Commit: Michael Meeks 
CommitDate: Fri Aug 21 16:17:17 2020 +0100

calc tiles: share code for building bounds and panes.

Avoid duplication between tileReady and paint.

Change-Id: Ic3d1c22a1dbeffe1abfffd35ea0d7fbcfd5c1ccc

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 5881803c8..5829239fa 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -63,8 +63,6 @@ L.CanvasTilePainter = L.Class.extend({
var splitPanesContext = this._layer.getSplitPanesContext();
this._splitPos = splitPanesContext ?
splitPanesContext.getSplitPos() : new L.Point(0, 0);
-
-   this._tileSizeCSSPx = undefined;
this._updatesRunning = false;
},
 
@@ -140,38 +138,40 @@ L.CanvasTilePainter = L.Class.extend({
this._canvasCtx.restore();
},
 
-   paint: function (tile, viewBounds, paneBoundsList) {
+   // Details of tile areas to render
+   _paintContext: function() {
+   var tileSize = new L.Point(this._layer._getTileSize(), 
this._layer._getTileSize());
 
-   if (this._tileSizeCSSPx === undefined) {
-   this._tileSizeCSSPx = this._layer._getTileSize();
-   }
+   var viewBounds = this._map.getPixelBounds();
+   var splitPanesContext = this._layer.getSplitPanesContext();
+   var paneBoundsList = splitPanesContext ?
+   splitPanesContext.getPxBoundList(viewBounds) :
+   [viewBounds];
+
+   return { tileSize: tileSize,
+viewBounds: viewBounds,
+paneBoundsList: paneBoundsList };
+   },
+
+   paint: function (tile, ctx) {
+
+   if (!ctx)
+   ctx = this._paintContext();
 
var tileTopLeft = tile.coords.getPos();
-   var tileSize = new L.Point(this._tileSizeCSSPx, 
this._tileSizeCSSPx);
-   var tileBounds = new L.Bounds(tileTopLeft, 
tileTopLeft.add(tileSize));
+   var tileBounds = new L.Bounds(tileTopLeft, 
tileTopLeft.add(ctx.tileSize));
 
-   viewBounds = viewBounds || this._map.getPixelBounds();
-   var splitPanesContext = this._layer.getSplitPanesContext();
-   paneBoundsList = paneBoundsList || (
-   splitPanesContext ?
-   splitPanesContext.getPxBoundList(viewBounds) :
-   [viewBounds]
-   );
+   for (var i = 0; i < ctx.paneBoundsList.length; ++i) {
+   var paneBounds = ctx.paneBoundsList[i];
 
-   for (var i = 0; i < paneBoundsList.length; ++i) {
-   var paneBounds = paneBoundsList[i];
-   if (!paneBounds.intersects(tileBounds)) {
+   if (!paneBounds.intersects(tileBounds))
continue;
-   }
 
var topLeft = paneBounds.getTopLeft();
-   if (topLeft.x) {
-   topLeft.x = viewBounds.min.x;
-   }
-
-   if (topLeft.y) {
-   topLeft.y = viewBounds.min.y;
-   }
+   if (topLeft.x)
+   topLeft.x = ctx.viewBounds.min.x;
+   if (topLeft.y)
+   topLeft.y = ctx.viewBounds.min.y;
 
this._canvasCtx.save();
this._canvasCtx.scale(this._dpiScale, this._dpiScale);
@@ -185,7 +185,7 @@ L.CanvasTilePainter = L.Class.extend({
 
if (this._dpiScale !== 1) {
// FIXME: avoid this scaling when possible 
(dpiScale = 2).
-   this._canvasCtx.drawImage(tile.el, 
tile.coords.x, tile.coords.y, this._tileSizeCSSPx, this._tileSizeCSSPx);
+   this._canvasCtx.drawImage(tile.el, 
tile.coords.x, tile.coords.y, ctx.tileSize.x, ctx.tileSize.y);
}
else {
this._canvasCtx.drawImage(tile.el, 
tile.coords.x, tile.coords.y);
@@ -280,24 +280,17 @@ L.CanvasTilePainter = L.Class.extend({
var zoom = this._lastZoom || Math.round(this._map.getZoom());
var part = this._lastPart || this._layer._selectedPart;
 
-   var viewSize = new L.Point(this._width, this._height);
-   var viewBounds = new L.Bounds(this._topLeft, 
this._topLeft.add(viewSize));
-
-   var splitPanesC

[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - loleaflet/src

2020-08-21 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |   68 +---
 1 file changed, 33 insertions(+), 35 deletions(-)

New commits:
commit a486bd5bfd98c33f093567edbbe6a88160a38050
Author: Michael Meeks 
AuthorDate: Fri Aug 21 15:54:50 2020 +0100
Commit: Michael Meeks 
CommitDate: Fri Aug 21 16:06:18 2020 +0100

calc tiles: share code for building bounds and panes.

Avoid duplication between tileReady and paint.

Change-Id: Ic3d1c22a1dbeffe1abfffd35ea0d7fbcfd5c1ccc

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 5881803c8..244dfe1d4 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -140,38 +140,43 @@ L.CanvasTilePainter = L.Class.extend({
this._canvasCtx.restore();
},
 
-   paint: function (tile, viewBounds, paneBoundsList) {
+   // Details of tile areas to render
+   _paintContext: function() {
+   var tileSize = new L.Point(this._tileSizeCSSPx, 
this._tileSizeCSSPx);
+
+   var viewBounds = this._map.getPixelBounds();
+   var splitPanesContext = this._layer.getSplitPanesContext();
+   var paneBoundsList = splitPanesContext ?
+   splitPanesContext.getPxBoundList(viewBounds) :
+   [viewBounds];
+
+   return { tileSize: tileSize,
+viewBounds: viewBounds,
+paneBoundsList: paneBoundsList };
+   },
+
+   paint: function (tile, ctx) {
 
-   if (this._tileSizeCSSPx === undefined) {
+   if (this._tileSizeCSSPx === undefined)
this._tileSizeCSSPx = this._layer._getTileSize();
-   }
+
+   if (!ctx)
+   ctx = this._paintContext();
 
var tileTopLeft = tile.coords.getPos();
-   var tileSize = new L.Point(this._tileSizeCSSPx, 
this._tileSizeCSSPx);
-   var tileBounds = new L.Bounds(tileTopLeft, 
tileTopLeft.add(tileSize));
+   var tileBounds = new L.Bounds(tileTopLeft, 
tileTopLeft.add(ctx.tileSize));
 
-   viewBounds = viewBounds || this._map.getPixelBounds();
-   var splitPanesContext = this._layer.getSplitPanesContext();
-   paneBoundsList = paneBoundsList || (
-   splitPanesContext ?
-   splitPanesContext.getPxBoundList(viewBounds) :
-   [viewBounds]
-   );
+   for (var i = 0; i < ctx.paneBoundsList.length; ++i) {
+   var paneBounds = ctx.paneBoundsList[i];
 
-   for (var i = 0; i < paneBoundsList.length; ++i) {
-   var paneBounds = paneBoundsList[i];
-   if (!paneBounds.intersects(tileBounds)) {
+   if (!paneBounds.intersects(tileBounds))
continue;
-   }
 
var topLeft = paneBounds.getTopLeft();
-   if (topLeft.x) {
-   topLeft.x = viewBounds.min.x;
-   }
-
-   if (topLeft.y) {
-   topLeft.y = viewBounds.min.y;
-   }
+   if (topLeft.x)
+   topLeft.x = ctx.viewBounds.min.x;
+   if (topLeft.y)
+   topLeft.y = ctx.viewBounds.min.y;
 
this._canvasCtx.save();
this._canvasCtx.scale(this._dpiScale, this._dpiScale);
@@ -280,24 +285,17 @@ L.CanvasTilePainter = L.Class.extend({
var zoom = this._lastZoom || Math.round(this._map.getZoom());
var part = this._lastPart || this._layer._selectedPart;
 
-   var viewSize = new L.Point(this._width, this._height);
-   var viewBounds = new L.Bounds(this._topLeft, 
this._topLeft.add(viewSize));
-
-   var splitPanesContext = this._layer.getSplitPanesContext();
// Calculate all this here intead of doing it per tile.
-   var paneBoundsList = splitPanesContext ?
-   splitPanesContext.getPxBoundList(viewBounds) : 
[viewBounds];
-   var tileRanges = 
paneBoundsList.map(this._layer._pxBoundsToTileRange, this._layer);
-
-   var tileSize = this._tileSizeCSSPx || 
this._layer._getTileSize();
+   var ctx = this._paintContext();
+   var tileRanges = 
ctx.paneBoundsList.map(this._layer._pxBoundsToTileRange, this._layer);
 
for (var rangeIdx = 0; rangeIdx < tileRanges.length; 
++rangeIdx) {
var tileRange = tileRanges[rangeIdx];
for (var j = tileRange.min.y; j <= tileRange.max.y; 
++j) {
  

[Libreoffice-commits] online.git: Branch 'feature/calc-canvas' - loleaflet/src

2020-08-21 Thread Michael Meeks (via logerrit)
Rebased ref, commits from common ancestor:
commit 3804c5387e3302837d0616e86e262d99d5c32b5c
Author: Michael Meeks 
AuthorDate: Fri Aug 21 15:47:58 2020 +0100
Commit: Michael Meeks 
CommitDate: Fri Aug 21 15:47:58 2020 +0100

calc tiles: remove partial re-rendering for now.

Drops _shiftAndPaint and _paintRects, blits are fast.

Change-Id: I64779f1037784f4efbe74cdf564b5f09e13b3316

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index f6c29d57a..5881803c8 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -236,7 +236,6 @@ L.CanvasTilePainter = L.Class.extend({
var resizeCanvas = !newSize.equals(this._lastSize);
 
var topLeftChanged = this._topLeft === undefined || 
!newTopLeft.equals(this._topLeft);
-
var splitPosChanged = !newSplitPos.equals(this._splitPos);
 
var skipUpdate = (
@@ -247,9 +246,9 @@ L.CanvasTilePainter = L.Class.extend({
!splitPosChanged &&
!scaleChanged);
 
-   if (skipUpdate) {
+   if (skipUpdate)
return;
-   }
+
if (scaleChanged)
this._dpiScale = L.getDpiScaleFactor();
 
@@ -261,130 +260,20 @@ L.CanvasTilePainter = L.Class.extend({
this.clear();
}
 
-   if (mapSizeChanged) {
+   if (mapSizeChanged)
this._lastMapSize = newMapSize;
-   }
 
-   if (splitPosChanged) {
+   if (splitPosChanged)
this._splitPos = newSplitPos;
-   }
-
-   // TODO: fix _shiftAndPaint for high DPI.
-   var shiftPaintDisabled = true;
-   var fullRepaintNeeded = zoomChanged || partChanged || 
resizeCanvas ||
-   shiftPaintDisabled || scaleChanged;
 
this._lastZoom = zoom;
this._lastPart = part;
 
-   if (fullRepaintNeeded) {
-
-   this._topLeft = newTopLeft;
-   this._paintWholeCanvas();
-
-   if (this.options.debug) {
-   this._drawSplits();
-   }
-
-   return;
-   }
-
-   this._shiftAndPaint(newTopLeft);
-   },
-
-   _shiftAndPaint: function (newTopLeft) {
-
-   console.assert(!this._layer.getSplitPanesContext(), 
'_shiftAndPaint is broken for split-panes.');
-   var offset = new L.Point(this._width - 1, this._height - 1);
-
-   var dx = newTopLeft.x - this._topLeft.x;
-   var dy = newTopLeft.y - this._topLeft.y;
-   if (!dx && !dy) {
-   return;
-   }
-
-   // Determine the area that needs to be painted as max. two 
disjoint rectangles.
-   var rectsToPaint = [];
-   this._inMove = true;
-   var oldTopLeft = this._topLeft;
-   var oldBottomRight = oldTopLeft.add(offset);
-   var newBottomRight = newTopLeft.add(offset);
-
-   if (Math.abs(dx) < this._width && Math.abs(dy) < this._height) {
-
-   this._canvasCtx.save();
-   this._canvasCtx.scale(this._dpiScale, this._dpiScale);
-   this._canvasCtx.globalCompositeOperation = 'copy';
-   this._canvasCtx.drawImage(this._canvas, -dx, -dy);
-   this._canvasCtx.globalCompositeOperation = 
'source-over';
-   this._canvasCtx.restore();
-
-   var xstart = newTopLeft.x, xend = newBottomRight.x;
-   var ystart = newTopLeft.y, yend = newBottomRight.y;
-   if (dx) {
-   xstart = dx > 0 ? oldBottomRight.x + 1 : 
newTopLeft.x;
-   xend   = xstart + Math.abs(dx) - 1;
-   }
-
-   if (dy) {
-   ystart = dy > 0 ? oldBottomRight.y + 1 : 
newTopLeft.y;
-   yend   = ystart + Math.abs(dy) - 1;
-   }
-
-   // rectangle including the x-range that needs painting 
with full y-range.
-   // This will take care of simultaneous non-zero dx and 
dy.
-   if (dx) {
-   rectsToPaint.push(new L.Bounds(
-   new L.Point(xstart, newTopLeft.y),
-   new L.Point(xend,   newBottomRight.y)
-   ));
-   }
-
-   // rectangle excluding the x-range t

[Libreoffice-commits] online.git: Changes to 'feature/calc-canvas'

2020-08-21 Thread Michael Meeks (via logerrit)
New branch 'feature/calc-canvas' available with the following commits:
commit 7f387d4130dfce48568f1bad74282fd48895cd3e
Author: Michael Meeks 
Date:   Wed Aug 19 18:27:14 2020 +0100

Render at 1:1 whatever the browser zoom ;-)

Change-Id: I3984cbb859e5f29fa819b242501cd2191528bca3

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


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - wsd/ProofKey.cpp wsd/ProofKey.hpp

2020-08-20 Thread Michael Meeks (via logerrit)
 wsd/ProofKey.cpp |3 ++-
 wsd/ProofKey.hpp |5 +
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 417dfd7df14a83358ca0523443d2adcfa81b5d60
Author: Michael Meeks 
AuthorDate: Thu Aug 20 16:46:05 2020 +0100
Commit: Mike Kaganski 
CommitDate: Thu Aug 20 23:03:28 2020 +0200

Avoid contention on RSA Digest engine.

Change-Id: If9068371c7ab18083d432f8bc582d85c2f85e80e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101081
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
(cherry picked from commit cd98388653d9038e8918f1a1431a4c836b1adcb9)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101062
Reviewed-by: Mike Kaganski 

diff --git a/wsd/ProofKey.cpp b/wsd/ProofKey.cpp
index c7df1afe1..1fdfc5eca 100644
--- a/wsd/ProofKey.cpp
+++ b/wsd/ProofKey.cpp
@@ -252,7 +252,8 @@ std::vector Proof::GetProof(const 
std::string& access_token, cons
 std::string Proof::SignProof(const std::vector& proof) const
 {
 assert(m_pKey);
-static Poco::Crypto::RSADigestEngine digestEngine(*m_pKey, "SHA256");
+// One per DocumentBroker that uses this via WopiStorage
+static thread_local Poco::Crypto::RSADigestEngine digestEngine(*m_pKey, 
"SHA256");
 digestEngine.reset();
 digestEngine.update(proof.data(), proof.size());
 return BytesToBase64(digestEngine.signature());
diff --git a/wsd/ProofKey.hpp b/wsd/ProofKey.hpp
index 34dd98e12..5efc79aeb 100644
--- a/wsd/ProofKey.hpp
+++ b/wsd/ProofKey.hpp
@@ -27,6 +27,11 @@ namespace Poco {
 
 class WopiProofTests;
 
+/**
+ * Global singleton - with one-time loaded key data
+ * loaded at startup, and then un-modified & shared
+ * across threads.
+ */
 class Proof {
 friend class WopiProofTests;
 void initialize();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-20 Thread Michael Meeks (via logerrit)
 wsd/ProofKey.cpp |3 ++-
 wsd/ProofKey.hpp |5 +
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit cd98388653d9038e8918f1a1431a4c836b1adcb9
Author: Michael Meeks 
AuthorDate: Thu Aug 20 16:46:05 2020 +0100
Commit: Michael Meeks 
CommitDate: Thu Aug 20 18:11:12 2020 +0200

Avoid contention on RSA Digest engine.

Change-Id: If9068371c7ab18083d432f8bc582d85c2f85e80e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101081
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/wsd/ProofKey.cpp b/wsd/ProofKey.cpp
index c7df1afe1..1fdfc5eca 100644
--- a/wsd/ProofKey.cpp
+++ b/wsd/ProofKey.cpp
@@ -252,7 +252,8 @@ std::vector Proof::GetProof(const 
std::string& access_token, cons
 std::string Proof::SignProof(const std::vector& proof) const
 {
 assert(m_pKey);
-static Poco::Crypto::RSADigestEngine digestEngine(*m_pKey, "SHA256");
+// One per DocumentBroker that uses this via WopiStorage
+static thread_local Poco::Crypto::RSADigestEngine digestEngine(*m_pKey, 
"SHA256");
 digestEngine.reset();
 digestEngine.update(proof.data(), proof.size());
 return BytesToBase64(digestEngine.signature());
diff --git a/wsd/ProofKey.hpp b/wsd/ProofKey.hpp
index 34dd98e12..5efc79aeb 100644
--- a/wsd/ProofKey.hpp
+++ b/wsd/ProofKey.hpp
@@ -27,6 +27,11 @@ namespace Poco {
 
 class WopiProofTests;
 
+/**
+ * Global singleton - with one-time loaded key data
+ * loaded at startup, and then un-modified & shared
+ * across threads.
+ */
 class Proof {
 friend class WopiProofTests;
 void initialize();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src

2020-08-20 Thread Michael Meeks (via logerrit)
 loleaflet/src/control/Control.LokDialog.js |7 ---
 1 file changed, 7 deletions(-)

New commits:
commit fbead0febeef17092286f8252ee2241fee8172ee
Author: Michael Meeks 
AuthorDate: Tue Aug 18 19:54:41 2020 +0100
Commit: Michael Meeks 
CommitDate: Thu Aug 20 14:41:54 2020 +0200

We no longer need to mess with focus during sidebar paint.

TextInput.js sends keyboard events to the right dialog window now
by referring to Map.js - rather than needing several different places
that can be focused.

Change-Id: I044bc858a80379b68838d64d1987a1dbd9007195
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100981
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 117ae0873..b46fa91c4 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -1629,13 +1629,6 @@ L.Control.LokDialog = L.Control.extend({
 
this._resizeCalcInputBar(deckOffset);
this._adjustTabsBar(width);
-   // If we didn't have the focus, don't steal it form the editor.
-   if ($('#' + this._currentDeck.strId + '-cursor').css('display') 
=== 'none') {
-   if (this._map.editorHasFocus()) {
-   this._map.fire('editorgotfocus');
-   this._map.focus();
-   }
-   }
},
 
_resizeCalcInputBar: function(offset) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-20 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CanvasTileLayer.js |   19 +--
 1 file changed, 13 insertions(+), 6 deletions(-)

New commits:
commit 701e78a6aef7013622c95c75c2a37f9e6e870a2b
Author: Michael Meeks 
AuthorDate: Wed Aug 19 18:21:00 2020 +0100
Commit: Michael Meeks 
CommitDate: Thu Aug 20 11:23:06 2020 +0200

Detect dpi scale factor change and re-render.

Change-Id: I4c09ade1efdfee67bc5d9224c50cf1825b6657fb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101016
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js 
b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 06911991c..f6c29d57a 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -40,10 +40,11 @@ L.CanvasTilePainter = L.Class.extend({
debug: false,
},
 
-   initialize: function (layer, dpiScale, enableImageSmoothing) {
+   initialize: function (layer, enableImageSmoothing) {
this._layer = layer;
this._canvas = this._layer._canvas;
 
+   var dpiScale = L.getDpiScaleFactor();
if (dpiScale === 1 || dpiScale === 2) {
enableImageSmoothing = (enableImageSmoothing === true);
}
@@ -221,10 +222,12 @@ L.CanvasTilePainter = L.Class.extend({
var newTopLeft = pixelBounds.getTopLeft();
var part = this._layer._selectedPart;
var newSplitPos = splitPanesContext ?
-   splitPanesContext.getSplitPos(): this._splitPos;
+   splitPanesContext.getSplitPos(): this._splitPos;
+   var newDpiScale = L.getDpiScaleFactor();
 
var zoomChanged = (zoom !== this._lastZoom);
var partChanged = (part !== this._lastPart);
+   var scaleChanged = this._dpiScale != newDpiScale;
 
var mapSizeChanged = !newMapSize.equals(this._lastMapSize);
// To avoid flicker, only resize the canvas element if width or 
height of the map increases.
@@ -241,13 +244,16 @@ L.CanvasTilePainter = L.Class.extend({
!zoomChanged &&
!partChanged &&
!resizeCanvas &&
-   !splitPosChanged);
+   !splitPosChanged &&
+   !scaleChanged);
 
if (skipUpdate) {
return;
}
+   if (scaleChanged)
+   this._dpiScale = L.getDpiScaleFactor();
 
-   if (resizeCanvas) {
+   if (resizeCanvas || scaleChanged) {
this._setCanvasSize(newSize.x, newSize.y);
this._lastSize = newSize;
}
@@ -265,7 +271,8 @@ L.CanvasTilePainter = L.Class.extend({
 
// TODO: fix _shiftAndPaint for high DPI.
var shiftPaintDisabled = true;
-   var fullRepaintNeeded = zoomChanged || partChanged || 
resizeCanvas || shiftPaintDisabled;
+   var fullRepaintNeeded = zoomChanged || partChanged || 
resizeCanvas ||
+   shiftPaintDisabled || scaleChanged;
 
this._lastZoom = zoom;
this._lastPart = part;
@@ -439,7 +446,7 @@ L.CanvasTileLayer = L.TileLayer.extend({
}
 
this._canvas = L.DomUtil.create('canvas', '', 
this._canvasContainer);
-   this._painter = new L.CanvasTilePainter(this, 
L.getDpiScaleFactor());
+   this._painter = new L.CanvasTilePainter(this);
this._container.style.position = 'absolute';
 
if (L.Browser.cypressTest) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: cypress_test/integration_tests

2020-08-19 Thread Michael Meeks (via logerrit)
 cypress_test/integration_tests/desktop/writer/focus_spec.js |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit ab0538bf30a47df5c57658c21b692de101e0220b
Author: Michael Meeks 
AuthorDate: Tue Aug 18 19:54:41 2020 +0100
Commit: Michael Meeks 
CommitDate: Wed Aug 19 14:24:19 2020 +0200

Enable cypress search / focus test.

Change-Id: I9f6482d80fac4dae677dcb471deff3b3575dbbfd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100986
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/cypress_test/integration_tests/desktop/writer/focus_spec.js 
b/cypress_test/integration_tests/desktop/writer/focus_spec.js
index ab830e34a..780ee0619 100644
--- a/cypress_test/integration_tests/desktop/writer/focus_spec.js
+++ b/cypress_test/integration_tests/desktop/writer/focus_spec.js
@@ -70,10 +70,10 @@ describe('Focus tests', function() {
 
// Search field still has the focus.
// We have a focus issue here.
-   //cy.document().its('activeElement.id')
-   //  .should('be.eq', 'search-input');
+   cy.document().its('activeElement.id')
+   .should('be.eq', 'search-input');
 
-   //cy.get('#search-input')
-   //  .should('have.prop', 'value', text);
+   cy.get('#search-input')
+   .should('have.prop', 'value', text);
});
 });
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: vcl/headless vcl/inc

2020-08-19 Thread Michael Meeks (via logerrit)
 vcl/headless/svpinst.cxx |   28 +++-
 vcl/inc/headless/svpinst.hxx |2 ++
 2 files changed, 25 insertions(+), 5 deletions(-)

New commits:
commit e8be3ec4d27d11e9583f39fa06e6ad785bea102c
Author: Michael Meeks 
AuthorDate: Mon Aug 17 19:57:58 2020 +0100
Commit: Michael Meeks 
CommitDate: Wed Aug 19 14:23:38 2020 +0200

headless: don't allow the system to set subpixel rendering eg.

Change-Id: Id62c03938c88d70dabda6111b8a7cca3b175e31f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100875
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
(cherry picked from commit 985922fe1a5dfd9ce02f7d24c4083d9d69544951)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100805
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 0e16d832659d..4893b8ddd44b 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -44,11 +44,12 @@
 #include 
 #include 
 #ifdef IOS
-#include 
-#include 
-#include 
+#  include 
+#  include 
+#  include 
 #else
-#include 
+#  include 
+#  include 
 #endif
 #include 
 
@@ -267,6 +268,24 @@ cairo_surface_t* get_underlying_cairo_surface(const 
VirtualDevice& rDevice)
 return 
static_cast(rDevice.mpVirDev.get())->GetSurface();
 }
 
+const cairo_font_options_t* SvpSalInstance::GetCairoFontOptions()
+{
+static cairo_font_options_t *gOptions = nullptr;
+if (!gOptions)
+{
+gOptions = cairo_font_options_create();
+cairo_font_options_set_antialias(gOptions, CAIRO_ANTIALIAS_GRAY);
+}
+return gOptions;
+}
+
+#else // IOS
+
+const cairo_font_options_t* SvpSalInstance::GetCairoFontOptions()
+{
+return nullptr;
+}
+
 #endif
 
 SalTimer* SvpSalInstance::CreateSalTimer()
@@ -610,7 +629,6 @@ OpenGLContext* SvpSalInstance::CreateOpenGLContext()
 return nullptr;
 }
 
-
 #endif
 
 SvpSalTimer::~SvpSalTimer()
diff --git a/vcl/inc/headless/svpinst.hxx b/vcl/inc/headless/svpinst.hxx
index ef20f0cab1b1..ae1290729b4c 100644
--- a/vcl/inc/headless/svpinst.hxx
+++ b/vcl/inc/headless/svpinst.hxx
@@ -176,6 +176,8 @@ public:
 virtual voidAddToRecentDocumentList(const OUString& rFileUrl, 
const OUString& rMimeType, const OUString& rDocumentService) override;
 
 virtual std::unique_ptr CreatePrintGraphics() override;
+
+virtual const cairo_font_options_t* GetCairoFontOptions() override;
 };
 
 inline void SvpSalInstance::registerFrame( SalFrame* pFrame )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-19 Thread Michael Meeks (via logerrit)
 loleaflet/src/control/Control.LokDialog.js |8 
 1 file changed, 8 deletions(-)

New commits:
commit 8657bd21cebac35aa3f09a564e3000a37c94a6c8
Author: Michael Meeks 
AuthorDate: Tue Aug 18 19:54:41 2020 +0100
Commit: Michael Meeks 
CommitDate: Wed Aug 19 11:29:42 2020 +0200

We no longer need to mess with focus during sidebar paint.

TextInput.js sends keyboard events to the right dialog window now
by referring to Map.js - rather than needing several different places
that can be focuses.

Change-Id: I044bc858a80379b68838d64d1987a1dbd9007195
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100955
Reviewed-by: Ashod Nakashian 
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Tested-by: Ashod Nakashian 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index e9440b15f..337acfa5d 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -1610,14 +1610,6 @@ L.Control.LokDialog = L.Control.extend({
spreadsheetRowColumnFrame.style.right = 
width.toString() + 'px';
 
this._resizeCalcInputBar(deckOffset);
-
-   // If we didn't have the focus, don't steal it form the editor.
-   if ($('#' + this._currentDeck.strId + '-cursor').css('display') 
=== 'none') {
-   if (this._map.editorHasFocus()) {
-   this._map.fire('editorgotfocus');
-   this._map.focus();
-   }
-   }
},
 
_resizeCalcInputBar: function(offset) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src

2020-08-19 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 2195dea8819c7b47c90862e448cc8300cb17fd3b
Author: Michael Meeks 
AuthorDate: Tue Aug 18 10:39:05 2020 +0100
Commit: Andras Timar 
CommitDate: Wed Aug 19 09:25:24 2020 +0200

Fix annoying exception on calc close with annotations.

Change-Id: Ic9fbdd443419365470137858dac2e5b3de71c9b7
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100906
Tested-by: Jenkins
Reviewed-by: Michael Meeks 
(cherry picked from commit 6c161540a9ba5942ba052e6c2b8aebed7ec5ef1b)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100806
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 4bf197b85..8960ddaf5 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -55,9 +55,11 @@ L.CalcTileLayer = L.TileLayer.extend({
},
 
clearAnnotations: function () {
-   for (var tab in this._annotations) {
-   this.hideAnnotations(tab);
-   }
+   if (this._map) {
+   for (var tab in this._annotations) {
+   this.hideAnnotations(tab);
+   }
+   } // else during shutdown.
this._annotations = {};
},
 
___
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-6.4' - vcl/headless vcl/inc

2020-08-18 Thread Michael Meeks (via logerrit)
 vcl/headless/svpinst.cxx |   23 ++-
 vcl/inc/headless/svpinst.hxx |2 ++
 2 files changed, 20 insertions(+), 5 deletions(-)

New commits:
commit 985922fe1a5dfd9ce02f7d24c4083d9d69544951
Author: Michael Meeks 
AuthorDate: Mon Aug 17 19:57:58 2020 +0100
Commit: Miklos Vajna 
CommitDate: Tue Aug 18 18:07:29 2020 +0200

headless: don't allow the system to set subpixel rendering eg.

Change-Id: Id62c03938c88d70dabda6111b8a7cca3b175e31f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100875
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 3b921af90c26..6ff536926829 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -44,11 +44,12 @@
 #include 
 #include 
 #ifdef IOS
-#include 
-#include 
-#include 
+#  include 
+#  include 
+#  include 
 #else
-#include 
+#  include 
+#  include 
 #endif
 #include 
 
@@ -267,6 +268,19 @@ cairo_surface_t* get_underlying_cairo_surface(const 
VirtualDevice& rDevice)
 return 
static_cast(rDevice.mpVirDev.get())->GetSurface();
 }
 
+const cairo_font_options_t* SvpSalInstance::GetCairoFontOptions()
+{
+static cairo_font_options_t *gOptions = nullptr;
+#ifndef IOS
+if (!gOptions)
+{
+gOptions = cairo_font_options_create();
+cairo_font_options_set_antialias(gOptions, CAIRO_ANTIALIAS_GRAY);
+}
+#endif
+return gOptions;
+}
+
 #endif
 
 SalTimer* SvpSalInstance::CreateSalTimer()
@@ -604,7 +618,6 @@ OpenGLContext* SvpSalInstance::CreateOpenGLContext()
 return nullptr;
 }
 
-
 #endif
 
 SvpSalTimer::~SvpSalTimer()
diff --git a/vcl/inc/headless/svpinst.hxx b/vcl/inc/headless/svpinst.hxx
index 04e4de84cad7..a9d630a735ee 100644
--- a/vcl/inc/headless/svpinst.hxx
+++ b/vcl/inc/headless/svpinst.hxx
@@ -177,6 +177,8 @@ public:
 virtual voidAddToRecentDocumentList(const OUString& rFileUrl, 
const OUString& rMimeType, const OUString& rDocumentService) override;
 
 virtual std::unique_ptr CreatePrintGraphics() override;
+
+virtual const cairo_font_options_t* GetCairoFontOptions() override;
 };
 
 inline void SvpSalInstance::registerFrame( SalFrame* pFrame )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-18 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/CalcTileLayer.js |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 6c161540a9ba5942ba052e6c2b8aebed7ec5ef1b
Author: Michael Meeks 
AuthorDate: Tue Aug 18 10:39:05 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Aug 18 11:57:37 2020 +0200

Fix annoying exception on calc close with annotations.

Change-Id: Ic9fbdd443419365470137858dac2e5b3de71c9b7
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100906
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index 337ba0f68..917b08b1d 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -63,9 +63,11 @@ L.CalcTileLayer = (L.Browser.mobile ? L.TileLayer : 
L.CanvasTileLayer).extend({
},
 
clearAnnotations: function () {
-   for (var tab in this._annotations) {
-   this.hideAnnotations(tab);
-   }
+   if (this._map) {
+   for (var tab in this._annotations) {
+   this.hideAnnotations(tab);
+   }
+   } // else during shutdown.
this._annotations = {};
},
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - kit/ChildSession.cpp loleaflet/src

2020-08-17 Thread Michael Meeks (via logerrit)
 kit/ChildSession.cpp|   32 
 loleaflet/src/layer/marker/TextInput.js |4 +---
 2 files changed, 25 insertions(+), 11 deletions(-)

New commits:
commit bda31ada6962147984f39f2c37c1c7fb4933058e
Author: Michael Meeks 
AuthorDate: Wed Aug 5 17:16:08 2020 +0100
Commit: Andras Timar 
CommitDate: Mon Aug 17 20:20:59 2020 +0200

textinput: use a single input message per key on the wire.

Change-Id: Ibd0f7afb98c8ed278751c4b5b46d7ce2467cd71f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100184
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100663
Reviewed-by: Andras Timar 

diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 8d1fef6fb..7f6dbaa8b 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -1245,15 +1245,25 @@ bool ChildSession::insertFile(const char* /*buffer*/, 
int /*length*/, const Stri
 bool ChildSession::extTextInputEvent(const char* /*buffer*/, int /*length*/,
  const StringVector& tokens)
 {
-int id, type;
+int id = -1, type = -1;
 std::string text;
-if (tokens.size() < 4 ||
-!getTokenInteger(tokens[1], "id", id) || id < 0 ||
-!getTokenKeyword(tokens[2], "type",
-{{"input", LOK_EXT_TEXTINPUT}, {"end", 
LOK_EXT_TEXTINPUT_END}},
- type) ||
-!getTokenString(tokens[3], "text", text))
+bool error = false;
+
+if (tokens.size() < 3)
+error = true;
+else if (!getTokenInteger(tokens[1], "id", id) || id < 0)
+error = true;
+else {
+// back-compat 'type'
+if (getTokenKeyword(tokens[2], "type",
+{{"input", LOK_EXT_TEXTINPUT}, {"end", 
LOK_EXT_TEXTINPUT_END}},
+type))
+error = !getTokenString(tokens[3], "text", text);
+else // normal path:
+error = !getTokenString(tokens[2], "text", text);
+}
 
+if (error)
 {
 sendTextFrameAndLogError("error: cmd=" + std::string(tokens[0]) + " 
kind=syntax");
 return false;
@@ -1263,7 +1273,13 @@ bool ChildSession::extTextInputEvent(const char* 
/*buffer*/, int /*length*/,
 URI::decode(text, decodedText);
 
 getLOKitDocument()->setView(_viewId);
-getLOKitDocument()->postWindowExtTextInputEvent(id, type, 
decodedText.c_str());
+if (type >= 0)
+getLOKitDocument()->postWindowExtTextInputEvent(id, type, 
decodedText.c_str());
+else
+{
+getLOKitDocument()->postWindowExtTextInputEvent(id, LOK_EXT_TEXTINPUT, 
decodedText.c_str());
+getLOKitDocument()->postWindowExtTextInputEvent(id, 
LOK_EXT_TEXTINPUT_END, decodedText.c_str());
+}
 
 return true;
 }
diff --git a/loleaflet/src/layer/marker/TextInput.js 
b/loleaflet/src/layer/marker/TextInput.js
index 801c9d368..9fe093ce7 100644
--- a/loleaflet/src/layer/marker/TextInput.js
+++ b/loleaflet/src/layer/marker/TextInput.js
@@ -740,9 +740,7 @@ L.TextInput = L.Layer.extend({
var encodedText = encodeURIComponent(text);
var winId = this._map.getWinId();
this._map._socket.sendMessage(
-   'textinput id=' + winId + ' type=input text=' + 
encodedText);
-   this._map._socket.sendMessage(
-   'textinput id=' + winId + ' type=end text=' + 
encodedText);
+   'textinput id=' + winId + ' text=' + 
encodedText);
}
},
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-17 Thread Michael Meeks (via logerrit)
 sd/source/ui/view/drviewse.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 4a31ceba3bf80d9e050cde3266d49e83df372a8a
Author: Michael Meeks 
AuthorDate: Sat Aug 15 22:55:55 2020 +0100
Commit: Michael Meeks 
CommitDate: Mon Aug 17 15:58:02 2020 +0200

Remove redundant Invalidate()

Probable merge error in CWS impressfunctions dc5479dcc39.

Change-Id: Ifa8dc9dbeeecf2dd6da44909060b72a20a7042a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100783
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index bb305423ce08..ad18b8b5ffea 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -158,8 +158,6 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
 
 Invalidate();
 
-Invalidate();
-
 // evtl. feed characters to activated textedit
 if(SID_ATTR_CHAR == nSId && GetView() && GetView()->IsTextEdit())
 ImpAddPrintableCharactersToTextEdit(rReq, GetView());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-15 Thread Michael Meeks (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 73227645c0d62d69c59aa0bb552ccdc906064b82
Author: Michael Meeks 
AuthorDate: Fri Aug 14 17:54:08 2020 +0100
Commit: Michael Meeks 
CommitDate: Sat Aug 15 10:59:14 2020 +0200

Remove parameters from uno commands when creating image names.

Change-Id: I26b4a6793e03b178382c04c91bd07b29182176ac
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100760
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index d9fd75926..895af0561 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1606,6 +1606,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
var prefixLength = '.uno:'.length;
if (name.substr(0, prefixLength) == '.uno:')
cleanName = name.substr(prefixLength);
+   cleanName = cleanName.replace(/\?.*$/,''); // remove potential 
parameters
cleanName = encodeURIComponent(cleanName).replace(/\%/g, '');
return L.LOUtil.getImageURL('lc_' + cleanName.toLowerCase() + 
'.svg');
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - kit/Kit.cpp wsd/DocumentBroker.cpp wsd/TileCache.cpp

2020-08-11 Thread Michael Meeks (via logerrit)
 kit/Kit.cpp|   12 +---
 wsd/DocumentBroker.cpp |2 +-
 wsd/TileCache.cpp  |   24 +---
 3 files changed, 23 insertions(+), 15 deletions(-)

New commits:
commit cfbb8d56272c9834dc2c416221b00d139b5406ad
Author: Michael Meeks 
AuthorDate: Fri Aug 7 18:37:53 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Tue Aug 11 19:03:46 2020 +0200

Notify WSD of tiles which we didn't need to render.

When we get a wid match, this helps WSD to cleanup its tile
subscriber list effectively.

Change-Id: I6517039fb3d8c9ad8f53aef549b8adbb79961ce1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100348
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100507
Reviewed-by: Jan Holesovsky 

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 09b003efc..1eb0ab03f 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1094,6 +1094,9 @@ public:
 // The tile content is identical to what the client already 
has, so skip it
 LOG_TRC("Match for tile #" << tileIndex << " at (" << 
positionX << ',' <<
 positionY << ") oldhash==hash (" << hash << "), 
wireId: " << wireId << " skipping");
+// Push a zero byte image to inform WSD we didn't need that.
+// This allows WSD side TileCache to free up waiting 
subscribers.
+pushRendered(renderedTiles, tiles[tileIndex], wireId, 0);
 tileIndex++;
 continue;
 }
@@ -1165,13 +1168,16 @@ public:
 tileIndex++;
 }
 
+// empty ones come first
+size_t zeroCheckStart = renderedTiles.size();
+
 _pngPool.run();
 
-for (auto  : renderedTiles)
+for (size_t i = zeroCheckStart; i < renderedTiles.size(); ++i)
 {
-if (i.getImgSize() == 0)
+if (renderedTiles[i].getImgSize() == 0)
 {
-LOG_ERR("Encoded 0-sized tile!");
+LOG_TRC("Encoded 0-sized tile in slot !" << i);
 assert(!"0-sized tile enocded!");
 }
 }
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 03f23c08a..05bd288f8 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -1992,7 +1992,7 @@ void DocumentBroker::handleTileCombinedResponse(const 
std::vector& payload
 try
 {
 const size_t length = payload.size();
-if (firstLine.size() < static_cast(length) - 1)
+if (firstLine.size() <= static_cast(length) - 
1)
 {
 const TileCombined tileCombined = TileCombined::parse(firstLine);
 const char* buffer = payload.data();
diff --git a/wsd/TileCache.cpp b/wsd/TileCache.cpp
index e1cdefe8d..982cd985b 100644
--- a/wsd/TileCache.cpp
+++ b/wsd/TileCache.cpp
@@ -175,19 +175,24 @@ void TileCache::saveTileAndNotify(const TileDesc& tile, 
const char *data, const
 {
 assertCorrectThread();
 
-// Save to disk.
+if (size > 0)
+{
+// Save to in-memory cache.
 
-// Ignore if we can't save the tile, things will work anyway, but slower.
-// An error indication is supposed to be sent to all users in that case.
-saveDataToCache(tile, data, size);
-LOG_TRC("Saved cache tile: " << cacheFileName(tile) << " of size " << size 
<< " bytes");
+// Ignore if we can't save the tile, things will work anyway, but 
slower.
+// An error indication is supposed to be sent to all users in that 
case.
+saveDataToCache(tile, data, size);
+LOG_TRC("Saved cache tile: " << cacheFileName(tile) << " of size " << 
size << " bytes");
+}
+else
+LOG_TRC("Zero sized cache tile: " << cacheFileName(tile));
 
 // Notify subscribers, if any.
 std::shared_ptr tileBeingRendered = 
findTileBeingRendered(tile);
 if (tileBeingRendered)
 {
 const size_t subscriberCount = 
tileBeingRendered->getSubscribers().size();
-if (subscriberCount > 0)
+if (size > 0 && subscriberCount > 0)
 {
 std::string response = tile.serialize("tile:");
 LOG_DBG("Sending tile message to " << subscriberCount << " 
subscribers: " << response);
@@ -229,10 +234,9 @@ void TileCache::saveTileAndNotify(const TileDesc& tile, 
const char *data, const
 }
 }
 }
-else
-{
+else if (subscriberCount == 0)
 LOG_DBG("No subscribers for: " << cacheFileName(tile));
-}
+  

[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - wsd/ClientSession.cpp wsd/DocumentBroker.cpp wsd/TileCache.cpp wsd/TileCache.hpp wsd/TileDesc.hpp

2020-08-11 Thread Michael Meeks (via logerrit)
 wsd/ClientSession.cpp  |5 +---
 wsd/DocumentBroker.cpp |   14 +++
 wsd/TileCache.cpp  |   61 +++--
 wsd/TileCache.hpp  |   13 --
 wsd/TileDesc.hpp   |8 ++
 5 files changed, 59 insertions(+), 42 deletions(-)

New commits:
commit f56fd1838895cb9d2db29c80bcf700795dda1e0a
Author: Michael Meeks 
AuthorDate: Fri Aug 7 17:36:56 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Tue Aug 11 19:00:57 2020 +0200

TileCache: cleanup debug, propagate now more helpfully & fix staleness.

Stale tiles were still being counted, unhelpfully. Avoid doing lots
of ::now() calls, and yet detect this.

Change-Id: Ib1e4b2f1968c1994849bb23ec54e28f6706230ee
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100347
Tested-by: Jenkins
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100506
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 3173154d1..b24f9b655 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -1573,9 +1573,8 @@ bool ClientSession::forwardToClient(const 
std::shared_ptr& payload)
 void ClientSession::enqueueSendMessage(const std::shared_ptr& data)
 {
 const std::shared_ptr docBroker = _docBroker.lock();
-// If in the correct thread - no need for wakeups.
-if (docBroker)
-docBroker->assertCorrectThread();
+LOG_CHECK_RET(docBroker && "Null DocumentBroker instance", );
+docBroker->assertCorrectThread();
 
 const std::string command = data->firstToken();
 std::unique_ptr tile;
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 15003be34..03f23c08a 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -1658,6 +1658,7 @@ size_t DocumentBroker::getMemorySize() const
 _sessions.size() * sizeof(ClientSession);
 }
 
+// Expected to be legacy, ~all new requests are tilecombinedRequests
 void DocumentBroker::handleTileRequest(TileDesc& tile,
const std::shared_ptr& 
session)
 {
@@ -1676,17 +1677,18 @@ void DocumentBroker::handleTileRequest(TileDesc& tile,
 return;
 }
 
+auto now = std::chrono::steady_clock::now();
 if (tile.getBroadcast())
 {
 for (auto& it: _sessions)
 {
 if (!it.second->inWaitDisconnected())
-tileCache().subscribeToTileRendering(tile, it.second);
+tileCache().subscribeToTileRendering(tile, it.second, now);
 }
 }
 else
 {
-tileCache().subscribeToTileRendering(tile, session);
+tileCache().subscribeToTileRendering(tile, session, now);
 }
 
 // Forward to child to render.
@@ -1865,6 +1867,8 @@ void DocumentBroker::sendRequestedTiles(const 
std::shared_ptr& se
 // Drop tiles which we are waiting for too long
 session->removeOutdatedTilesOnFly();
 
+auto now = std::chrono::steady_clock::now();
+
 // All tiles were processed on client side that we sent last time, so we 
can send
 // a new batch of tiles which was invalidated / requested in the meantime
 std::deque& requestedTiles = session->getRequestedTiles();
@@ -1872,7 +1876,7 @@ void DocumentBroker::sendRequestedTiles(const 
std::shared_ptr& se
 {
 size_t delayedTiles = 0;
 std::vector tilesNeedsRendering;
-size_t beingRendered = 
_tileCache->countTilesBeingRenderedForSession(session);
+size_t beingRendered = 
_tileCache->countTilesBeingRenderedForSession(session, now);
 while (session->getTilesOnFlyCount() + beingRendered < 
tilesOnFlyUpperLimit &&
   !requestedTiles.empty() &&
   // If we delayed all tiles we don't send any tile (we will when 
next tileprocessed message arrives)
@@ -1902,14 +1906,14 @@ void DocumentBroker::sendRequestedTiles(const 
std::shared_ptr& se
 else
 {
 // Not cached, needs rendering.
-if (!tileCache().hasTileBeingRendered(tile) || // There is no 
in progress rendering of the given tile
+if (!tileCache().hasTileBeingRendered(tile, ) || // There 
is no in progress rendering of the given tile
 tileCache().getTileBeingRenderedVersion(tile) < 
tile.getVersion()) // We need a newer version
 {
 tile.setVersion(++_tileVersion);
 tilesNeedsRendering.push_back(tile);
 _debugRenderedTileCount++;
 }
-tileCache().subscribeToTileRendering(tile, session);
+tileCache().subscribeToTileRendering(tile, session, now);
 beingRendered++;
 }
 requestedTiles.pop_front();
diff --git a/wsd/TileCache.cpp b/wsd/T

[Libreoffice-commits] online.git: test/UnitSession.cpp wsd/LOOLWSD.cpp

2020-08-11 Thread Michael Meeks (via logerrit)
 test/UnitSession.cpp |3 ++-
 wsd/LOOLWSD.cpp  |9 +
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 5544f5669b9f19ef53bd2b6a661737f58acf3867
Author: Michael Meeks 
AuthorDate: Tue Aug 11 15:17:20 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Aug 11 18:13:06 2020 +0200

iOS likes to do extra escaping of an iframe's .src

This yields a relevant Post request of:

slideshow.svg%3FWOPISrc=https:%252F%252Fshare
slideshow.svg?WOPISrc=https%3A%2F%2Fshare

Which ends up trying to serve a file with a ?WOPISRC= suffix.
Since we don't want anything 'odd' being served from the file-system
anyway; get a bit more paranoid and clean that up.

Change-Id: I39993e4629b0d01f34098391a0fa448ef8a9984e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100509
Tested-by: Michael Meeks 
Reviewed-by: Michael Meeks 

diff --git a/test/UnitSession.cpp b/test/UnitSession.cpp
index b81bd7cd3..ec8d1f9bf 100644
--- a/test/UnitSession.cpp
+++ b/test/UnitSession.cpp
@@ -200,7 +200,8 @@ UnitBase::TestResult UnitSession::testSlideShow()
 
 std::string encodedDoc;
 Poco::URI::encode(documentPath, ":/?", encodedDoc);
-const std::string path = "/lool/" + encodedDoc + '/' + jail + '/' + 
dir + '/' + name;
+const std::string ignoredSuffix = "%3FWOPISRC=madness"; // cf. iPhone.
+const std::string path = "/lool/" + encodedDoc + '/' + jail + '/' + 
dir + '/' + name + ignoredSuffix;
 std::unique_ptr session(
 helpers::createSession(Poco::URI(helpers::getTestServerURI(;
 Poco::Net::HTTPRequest requestSVG(Poco::Net::HTTPRequest::HTTP_GET, 
path);
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index b8c75e5b5..3756db0fb 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -3013,6 +3013,15 @@ private:
 
 std::string fileName;
 URI::decode(requestDetails[4], fileName);
+// sanitize if we can
+auto it = fileName.find_first_of("?&%#!");
+if (it != std::string::npos)
+{
+std::string cleanedName = fileName.substr(0, it);
+LOG_DBG("Cleaned unexpected parameters from filename: '" << 
fileName << "' to '" << cleanedName << "'");
+fileName = cleanedName;
+}
+
 const Path filePath(LOOLWSD::ChildRoot + requestDetails[2]
 + JAILED_DOCUMENT_ROOT + requestDetails[3] + 
'/' + fileName);
 const std::string filePathAnonym = 
LOOLWSD::anonymizeUrl(filePath.toString());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - test/UnitSession.cpp wsd/LOOLWSD.cpp

2020-08-11 Thread Michael Meeks (via logerrit)
 test/UnitSession.cpp |3 ++-
 wsd/LOOLWSD.cpp  |9 +
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit a557028affe2686815b46e6c59afcde4b4f4b57b
Author: Michael Meeks 
AuthorDate: Tue Aug 11 15:17:20 2020 +0100
Commit: Jan Holesovsky 
CommitDate: Tue Aug 11 18:11:45 2020 +0200

iOS likes to do extra escaping of an iframe's .src

This yields a relevant Post request of:

slideshow.svg%3FWOPISrc=https:%252F%252Fshare
slideshow.svg?WOPISrc=https%3A%2F%2Fshare

Which ends up trying to serve a file with a ?WOPISRC= suffix.
Since we don't want anything 'odd' being served from the file-system
anyway; get a bit more paranoid and clean that up.

Change-Id: I39993e4629b0d01f34098391a0fa448ef8a9984e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100514
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/test/UnitSession.cpp b/test/UnitSession.cpp
index b81bd7cd3..ec8d1f9bf 100644
--- a/test/UnitSession.cpp
+++ b/test/UnitSession.cpp
@@ -200,7 +200,8 @@ UnitBase::TestResult UnitSession::testSlideShow()
 
 std::string encodedDoc;
 Poco::URI::encode(documentPath, ":/?", encodedDoc);
-const std::string path = "/lool/" + encodedDoc + '/' + jail + '/' + 
dir + '/' + name;
+const std::string ignoredSuffix = "%3FWOPISRC=madness"; // cf. iPhone.
+const std::string path = "/lool/" + encodedDoc + '/' + jail + '/' + 
dir + '/' + name + ignoredSuffix;
 std::unique_ptr session(
 helpers::createSession(Poco::URI(helpers::getTestServerURI(;
 Poco::Net::HTTPRequest requestSVG(Poco::Net::HTTPRequest::HTTP_GET, 
path);
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 9a701f262..afc2b9c58 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2892,6 +2892,15 @@ private:
 
 std::string fileName;
 URI::decode(requestDetails[4], fileName);
+// sanitize if we can
+auto it = fileName.find_first_of("?&%#!");
+if (it != std::string::npos)
+{
+std::string cleanedName = fileName.substr(0, it);
+LOG_DBG("Cleaned unexpected parameters from filename: '" << 
fileName << "' to '" << cleanedName << "'");
+fileName = cleanedName;
+}
+
 const Path filePath(LOOLWSD::ChildRoot + requestDetails[2]
 + JAILED_DOCUMENT_ROOT + requestDetails[3] + 
'/' + fileName);
 const std::string filePathAnonym = 
LOOLWSD::anonymizeUrl(filePath.toString());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/html

2020-08-11 Thread Michael Meeks (via logerrit)
 loleaflet/html/loleaflet.html.m4 |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e550b3578df996cc4a4a6881e3192915a33d50bd
Author: Michael Meeks 
AuthorDate: Tue Aug 11 11:35:00 2020 +0100
Commit: Aron Budea 
CommitDate: Tue Aug 11 16:58:33 2020 +0200

Constrain image insertion to select just images.

Change-Id: Ife7a655ca540ddc854f1bdeaacf256a58ebcc02d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100475
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
(cherry picked from commit d28278fa7e8ce3a81d5906b175cf4af41187951c)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100368
Reviewed-by: Aron Budea 

diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4
index f84271e62..8724b4394 100644
--- a/loleaflet/html/loleaflet.html.m4
+++ b/loleaflet/html/loleaflet.html.m4
@@ -171,8 +171,8 @@ m4_ifelse(MOBILEAPP,[true],
   window.documentSigningURL = '%DOCUMENT_SIGNING_URL%';
 
 
-
-
+
+
 
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-11 Thread Michael Meeks (via logerrit)
 loleaflet/html/loleaflet.html.m4 |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d28278fa7e8ce3a81d5906b175cf4af41187951c
Author: Michael Meeks 
AuthorDate: Tue Aug 11 11:35:00 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Aug 11 14:21:37 2020 +0200

Constrain image insertion to select just images.

Change-Id: Ife7a655ca540ddc854f1bdeaacf256a58ebcc02d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100475
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4
index 6aebc2321..c1273e439 100644
--- a/loleaflet/html/loleaflet.html.m4
+++ b/loleaflet/html/loleaflet.html.m4
@@ -172,8 +172,8 @@ m4_ifelse(MOBILEAPP,[true],
   window.documentSigningURL = '%DOCUMENT_SIGNING_URL%';
 
 
-
-
+
+
 
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: 2 commits - common/RenderTiles.hpp wsd/ClientSession.cpp wsd/DocumentBroker.cpp wsd/TileCache.cpp wsd/TileCache.hpp wsd/TileDesc.hpp

2020-08-07 Thread Michael Meeks (via logerrit)
 common/RenderTiles.hpp |   12 +-
 wsd/ClientSession.cpp  |5 +-
 wsd/DocumentBroker.cpp |   16 +
 wsd/TileCache.cpp  |   85 +++--
 wsd/TileCache.hpp  |   13 +++
 wsd/TileDesc.hpp   |8 
 6 files changed, 82 insertions(+), 57 deletions(-)

New commits:
commit 4c6ba6d85096a223b5c6672ee2f4b51c12ca41c3
Author: Michael Meeks 
AuthorDate: Fri Aug 7 18:37:53 2020 +0100
Commit: Michael Meeks 
CommitDate: Fri Aug 7 20:01:40 2020 +0200

Notify WSD of tiles which we didn't need to render.

When we get a wid match, this helps WSD to cleanup its tile
subscriber list effectively.

Change-Id: I6517039fb3d8c9ad8f53aef549b8adbb79961ce1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100348
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/common/RenderTiles.hpp b/common/RenderTiles.hpp
index 011503f12..c5bc9d03e 100644
--- a/common/RenderTiles.hpp
+++ b/common/RenderTiles.hpp
@@ -638,6 +638,9 @@ namespace RenderTiles
 // The tile content is identical to what the client already 
has, so skip it
 LOG_TRC("Match for tile #" << tileIndex << " at (" << 
positionX << ',' <<
 positionY << ") oldhash==hash (" << hash << "), 
wireId: " << wireId << " skipping");
+// Push a zero byte image to inform WSD we didn't need that.
+// This allows WSD side TileCache to free up waiting 
subscribers.
+pushRendered(renderedTiles, tiles[tileIndex], wireId, 0);
 tileIndex++;
 continue;
 }
@@ -701,13 +704,16 @@ namespace RenderTiles
 tileIndex++;
 }
 
+// empty ones come first
+size_t zeroCheckStart = renderedTiles.size();
+
 pngPool.run();
 
-for (auto  : renderedTiles)
+for (size_t i = zeroCheckStart; i < renderedTiles.size(); ++i)
 {
-if (i.getImgSize() == 0)
+if (renderedTiles[i].getImgSize() == 0)
 {
-LOG_ERR("Encoded 0-sized tile!");
+LOG_TRC("Encoded 0-sized tile in slot !" << i);
 assert(!"0-sized tile enocded!");
 }
 }
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 5120bb099..a5e62fcc4 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -2034,7 +2034,7 @@ void DocumentBroker::handleTileCombinedResponse(const 
std::vector& payload
 try
 {
 const size_t length = payload.size();
-if (firstLine.size() < static_cast(length) - 1)
+if (firstLine.size() <= static_cast(length) - 
1)
 {
 const TileCombined tileCombined = TileCombined::parse(firstLine);
 const char* buffer = payload.data();
diff --git a/wsd/TileCache.cpp b/wsd/TileCache.cpp
index e1cdefe8d..982cd985b 100644
--- a/wsd/TileCache.cpp
+++ b/wsd/TileCache.cpp
@@ -175,19 +175,24 @@ void TileCache::saveTileAndNotify(const TileDesc& tile, 
const char *data, const
 {
 assertCorrectThread();
 
-// Save to disk.
+if (size > 0)
+{
+// Save to in-memory cache.
 
-// Ignore if we can't save the tile, things will work anyway, but slower.
-// An error indication is supposed to be sent to all users in that case.
-saveDataToCache(tile, data, size);
-LOG_TRC("Saved cache tile: " << cacheFileName(tile) << " of size " << size 
<< " bytes");
+// Ignore if we can't save the tile, things will work anyway, but 
slower.
+// An error indication is supposed to be sent to all users in that 
case.
+saveDataToCache(tile, data, size);
+LOG_TRC("Saved cache tile: " << cacheFileName(tile) << " of size " << 
size << " bytes");
+}
+else
+LOG_TRC("Zero sized cache tile: " << cacheFileName(tile));
 
 // Notify subscribers, if any.
 std::shared_ptr tileBeingRendered = 
findTileBeingRendered(tile);
 if (tileBeingRendered)
 {
 const size_t subscriberCount = 
tileBeingRendered->getSubscribers().size();
-if (subscriberCount > 0)
+if (size > 0 && subscriberCount > 0)
 {
 std::string response = tile.serialize("tile:");
 LOG_DBG("Sending tile message to " << subscriberCount << " 
subscribers: " << response);
@@ -229,10 +234,9 @@ void TileCache::saveTileAndNotify(const TileDesc& tile, 
const char *data, const
 }
 }
 }
-else
-{
+else if (subscriberCount == 0)
 

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

2020-08-05 Thread Michael Meeks (via logerrit)
 kit/ChildSession.cpp|   32 
 loleaflet/src/layer/marker/TextInput.js |4 +---
 2 files changed, 25 insertions(+), 11 deletions(-)

New commits:
commit 9142828282c1147244a4df700ee52d28cf27a37d
Author: Michael Meeks 
AuthorDate: Wed Aug 5 17:16:08 2020 +0100
Commit: Michael Meeks 
CommitDate: Wed Aug 5 18:44:10 2020 +0200

textinput: use a single input message per key on the wire.

Change-Id: Ibd0f7afb98c8ed278751c4b5b46d7ce2467cd71f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100184
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index dc0e9ec3d..281360654 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -1242,15 +1242,25 @@ bool ChildSession::insertFile(const char* /*buffer*/, 
int /*length*/, const Stri
 bool ChildSession::extTextInputEvent(const char* /*buffer*/, int /*length*/,
  const StringVector& tokens)
 {
-int id, type;
+int id, type = -1;
 std::string text;
-if (tokens.size() < 4 ||
-!getTokenInteger(tokens[1], "id", id) || id < 0 ||
-!getTokenKeyword(tokens[2], "type",
-{{"input", LOK_EXT_TEXTINPUT}, {"end", 
LOK_EXT_TEXTINPUT_END}},
- type) ||
-!getTokenString(tokens[3], "text", text))
+bool error = false;
+
+if (tokens.size() < 3)
+error = true;
+else if (!getTokenInteger(tokens[1], "id", id) || id < 0)
+error = true;
+else {
+// back-compat 'type'
+if (getTokenKeyword(tokens[2], "type",
+{{"input", LOK_EXT_TEXTINPUT}, {"end", 
LOK_EXT_TEXTINPUT_END}},
+type))
+error = !getTokenString(tokens[3], "text", text);
+else // normal path:
+error = !getTokenString(tokens[2], "text", text);
+}
 
+if (error)
 {
 sendTextFrameAndLogError("error: cmd=" + std::string(tokens[0]) + " 
kind=syntax");
 return false;
@@ -1260,7 +1270,13 @@ bool ChildSession::extTextInputEvent(const char* 
/*buffer*/, int /*length*/,
 URI::decode(text, decodedText);
 
 getLOKitDocument()->setView(_viewId);
-getLOKitDocument()->postWindowExtTextInputEvent(id, type, 
decodedText.c_str());
+if (type >= 0)
+getLOKitDocument()->postWindowExtTextInputEvent(id, type, 
decodedText.c_str());
+else
+{
+getLOKitDocument()->postWindowExtTextInputEvent(id, LOK_EXT_TEXTINPUT, 
decodedText.c_str());
+getLOKitDocument()->postWindowExtTextInputEvent(id, 
LOK_EXT_TEXTINPUT_END, decodedText.c_str());
+}
 
 return true;
 }
diff --git a/loleaflet/src/layer/marker/TextInput.js 
b/loleaflet/src/layer/marker/TextInput.js
index 8e7196e96..1910d93d0 100644
--- a/loleaflet/src/layer/marker/TextInput.js
+++ b/loleaflet/src/layer/marker/TextInput.js
@@ -706,9 +706,7 @@ L.TextInput = L.Layer.extend({
var encodedText = encodeURIComponent(text);
var winId = this._map.getWinId();
this._map._socket.sendMessage(
-   'textinput id=' + winId + ' type=input text=' + 
encodedText);
-   this._map._socket.sendMessage(
-   'textinput id=' + winId + ' type=end text=' + 
encodedText);
+   'textinput id=' + winId + ' text=' + 
encodedText);
}
},
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Changes to 'distro/collabora/co-4-2-7'

2020-08-05 Thread Michael Meeks (via logerrit)
New branch 'distro/collabora/co-4-2-7' available with the following commits:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loolwsd.service

2020-08-05 Thread Michael Meeks (via logerrit)
 loolwsd.service |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 852135fa8515eff349983a3f387ec44c1173ab0a
Author: Michael Meeks 
AuthorDate: Tue Aug 4 19:30:20 2020 +0100
Commit: Andras Timar 
CommitDate: Wed Aug 5 10:36:02 2020 +0200

Remove default file descriptor limit.

Change-Id: I1b811bd2fbabaa7c23861b215dc254832d200324
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100063
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loolwsd.service b/loolwsd.service
index 93e98fd67..4f25a69f8 100644
--- a/loolwsd.service
+++ b/loolwsd.service
@@ -10,6 +10,7 @@ TimeoutStopSec=120
 User=lool
 KillMode=control-group
 Restart=always
+LimitNOFILE=infinity:infinity
 
 [Install]
 WantedBy=multi-user.target
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4-0' - loolwsd.service

2020-08-05 Thread Michael Meeks (via logerrit)
 loolwsd.service |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d8f3783864e46f8ae056e408027c79f42b07a017
Author: Michael Meeks 
AuthorDate: Tue Aug 4 19:30:20 2020 +0100
Commit: Andras Timar 
CommitDate: Wed Aug 5 10:32:47 2020 +0200

Remove default file descriptor limit.

Change-Id: I1b811bd2fbabaa7c23861b215dc254832d200324
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100064
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loolwsd.service b/loolwsd.service
index 93e98fd67..4f25a69f8 100644
--- a/loolwsd.service
+++ b/loolwsd.service
@@ -10,6 +10,7 @@ TimeoutStopSec=120
 User=lool
 KillMode=control-group
 Restart=always
+LimitNOFILE=infinity:infinity
 
 [Install]
 WantedBy=multi-user.target
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loolwsd.service

2020-08-04 Thread Michael Meeks (via logerrit)
 loolwsd.service |1 +
 1 file changed, 1 insertion(+)

New commits:
commit b38909bfa4a4f0ce8bd10364b8dfe13fff12ec07
Author: Michael Meeks 
AuthorDate: Tue Aug 4 19:30:20 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Aug 4 20:43:03 2020 +0200

Remove default file descriptor limit.

Change-Id: I1b811bd2fbabaa7c23861b215dc254832d200324
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100134
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/loolwsd.service b/loolwsd.service
index 2204bb736..7d64887d6 100644
--- a/loolwsd.service
+++ b/loolwsd.service
@@ -10,6 +10,7 @@ TimeoutStopSec=120
 User=lool
 KillMode=control-group
 Restart=always
+LimitNOFILE=infinity:infinity
 
 ProtectSystem=strict
 ReadWritePaths=/opt/lool
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - kit/Kit.cpp

2020-07-29 Thread Michael Meeks (via logerrit)
 kit/Kit.cpp |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 2d39e461200eae060e0bb7220d21972dd8076ea6
Author: Michael Meeks 
AuthorDate: Thu Jul 16 19:10:05 2020 +0100
Commit: Andras Timar 
CommitDate: Wed Jul 29 10:18:28 2020 +0200

Process any pending tileQueue items first.

Change-Id: I078bc1f52ba7647ca1715ea3222d695936dd657f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98928
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
(cherry picked from commit 0084c3b275bbbad7f3ee2d36f86afc10fbc5400c)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98956
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 4d20d27b4..09b003efc 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1928,11 +1928,16 @@ private:
 }
 
 public:
+bool hasQueueItems() const
+{
+return _tileQueue && !_tileQueue->isEmpty();
+}
+
 void drainQueue(const std::chrono::steady_clock::time_point &/*now*/)
 {
 try
 {
-while (!_tileQueue->isEmpty())
+while (hasQueueItems())
 {
 if (_stop || SigUtil::getTerminationFlag())
 {
@@ -2201,7 +2206,10 @@ public:
 _pollEnd = std::chrono::steady_clock::now() + 
std::chrono::microseconds(timeoutMicroS);
 do
 {
-if (poll(timeoutMicroS) <= 0)
+int realTimeout = timeoutMicroS;
+if (_document && _document->hasQueueItems())
+realTimeout = 0;
+if (poll(realTimeout) <= 0)
 break;
 
 const auto now = std::chrono::steady_clock::now();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src wsd/DocumentBroker.cpp wsd/Storage.cpp wsd/Storage.hpp

2020-07-21 Thread Michael Meeks (via logerrit)
 loleaflet/src/control/Control.DocumentNameInput.js |7 +++
 loleaflet/src/map/handler/Map.WOPI.js  |4 
 wsd/DocumentBroker.cpp |2 ++
 wsd/Storage.cpp|4 +++-
 wsd/Storage.hpp|6 ++
 5 files changed, 18 insertions(+), 5 deletions(-)

New commits:
commit be15790e24d628ccaf5dc722d432c1829d6767ba
Author: Michael Meeks 
AuthorDate: Tue Jun 9 17:43:58 2020 +0100
Commit: Andras Timar 
CommitDate: Tue Jul 21 20:47:43 2020 +0200

Add support for BreadcrumbDocName.

Change-Id: I06c56e92dd3acf9269140ecefb0c8bc731191260
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95960
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98193
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.DocumentNameInput.js 
b/loleaflet/src/control/Control.DocumentNameInput.js
index 28db57f41..cfc4e5998 100644
--- a/loleaflet/src/control/Control.DocumentNameInput.js
+++ b/loleaflet/src/control/Control.DocumentNameInput.js
@@ -40,7 +40,7 @@ L.Control.DocumentNameInput = L.Control.extend({
},
 
documentNameCancel: function() {
-   $('#document-name-input').val(this.map['wopi'].BaseFileName);
+   
$('#document-name-input').val(this.map['wopi'].BreadcrumbDocName);
this.map._onGotFocus();
},
 
@@ -97,10 +97,9 @@ L.Control.DocumentNameInput = L.Control.extend({
},
 
onWopiProps: function(e) {
-   if (e.BaseFileName !== null) {
+   if (e.BaseFileName !== null)
// set the document name into the name field
-   $('#document-name-input').val(e.BaseFileName);
-   }
+   $('#document-name-input').val(e.BreadcrumbDocName !== 
undefined ? e.BreadcrumbDocName : e.BaseFileName);
 
if (e.UserCanNotWriteRelative === false) {
// Save As allowed
diff --git a/loleaflet/src/map/handler/Map.WOPI.js 
b/loleaflet/src/map/handler/Map.WOPI.js
index da79219e8..3e41b7fae 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -10,6 +10,7 @@ L.Map.WOPI = L.Handler.extend({
// wouldn't be possible otherwise.
PostMessageOrigin: '*',
BaseFileName: '',
+   BreadcrumbDocName: '',
DocumentLoadedTime: false,
HidePrintOption: false,
HideSaveOption: false,
@@ -76,6 +77,9 @@ L.Map.WOPI = L.Handler.extend({
}
 
this.BaseFileName = wopiInfo['BaseFileName'];
+   this.BreadcrumbDocName = wopiInfo['BreadcrumbDocName'];
+   if (this.BreadcrumbDocName === undefined)
+   this.BreadcrumbDocName = this.BaseFileName;
this.HidePrintOption = !!wopiInfo['HidePrintOption'];
this.HideSaveOption = !!wopiInfo['HideSaveOption'];
this.HideExportOption = !!wopiInfo['HideExportOption'];
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 2c0ec41c2..086ad1699 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -663,6 +663,8 @@ bool DocumentBroker::load(const 
std::shared_ptr& session, const s
 wopifileinfo->setHideExportOption(true);
 
 wopiInfo->set("BaseFileName", 
wopiStorage->getFileInfo().getFilename());
+if (wopifileinfo->getBreadcrumbDocName().size())
+wopiInfo->set("BreadcrumbDocName", 
wopifileinfo->getBreadcrumbDocName());
 
 if (!wopifileinfo->getTemplateSaveAs().empty())
 wopiInfo->set("TemplateSaveAs", wopifileinfo->getTemplateSaveAs());
diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index a27240bf1..3acbccbc4 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -613,6 +613,7 @@ std::unique_ptr 
WopiStorage::getWOPIFileInfo(const Au
 std::string watermarkText;
 std::string templateSaveAs;
 std::string templateSource;
+std::string breadcrumbDocName;
 bool canWrite = false;
 bool enableOwnerTermination = false;
 std::string postMessageOrigin;
@@ -719,6 +720,7 @@ std::unique_ptr 
WopiStorage::getWOPIFileInfo(const Au
 JsonUtil::findJSONValue(object, "SupportsLocks", supportsLocks);
 JsonUtil::findJSONValue(object, "SupportsRename", supportsRename);
 JsonUtil::findJSONValue(object, "UserCanRename", userCanRename);
+JsonUtil::findJSONValue(object, "BreadcrumbDocName", 
breadcrumbDocName);
 bool booleanFlag = false;
 if (JsonUtil::findJSONValue(object, "DisableChangeTrackingRecord", 
booleanFlag))
 disableChangeTrackingRecord = (booleanFlag ? 
WOPIFileInfo::TriState::Tr

[Libreoffice-commits] online.git: common/Session.hpp kit/ChildSession.hpp kit/ForKit.cpp kit/Kit.cpp

2020-07-18 Thread Michael Meeks (via logerrit)
 common/Session.hpp   |9 +-
 kit/ChildSession.hpp |7 
 kit/ForKit.cpp   |2 -
 kit/Kit.cpp  |   75 ++-
 4 files changed, 89 insertions(+), 4 deletions(-)

New commits:
commit ca5d5943e45b2a23a634d6825a220026b4fb5495
Author: Michael Meeks 
AuthorDate: Tue Jul 14 15:20:05 2020 +0100
Commit: Michael Meeks 
CommitDate: Sat Jul 18 18:21:14 2020 +0200

Kit: add initial state dumping on USR1.

Change-Id: I8225f686e8678c08e505490df056904fc813d2fe
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98927
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/common/Session.hpp b/common/Session.hpp
index 02a11fa23..64e5e1502 100644
--- a/common/Session.hpp
+++ b/common/Session.hpp
@@ -53,12 +53,19 @@ public:
 }
 std::shared_ptr findByCanonicalId(int id)
 {
-for (auto  : *this) {
+for (const auto  : *this) {
 if (it.second->getCanonicalViewId() == id)
 return it.second;
 }
 return std::shared_ptr();
 }
+void dumpState(std::ostream& oss)
+{
+for (const auto  : *this) {
+oss << "\tsession '" << it.first << "'\n";
+it.second->dumpState(oss);
+}
+}
 };
 
 /// Base class of a WebSocket session.
diff --git a/kit/ChildSession.hpp b/kit/ChildSession.hpp
index 48edf98b2..3b6226d8f 100644
--- a/kit/ChildSession.hpp
+++ b/kit/ChildSession.hpp
@@ -315,6 +315,13 @@ private:
 return ret;
 }
 
+public:
+void dumpState(std::ostream& oss) override
+{
+Session::dumpState(oss);
+// TODO: the rest ...
+}
+
 private:
 const std::string _jailId;
 DocumentManagerInterface* _docManager;
diff --git a/kit/ForKit.cpp b/kit/ForKit.cpp
index 9daa93576..9afa62b4e 100644
--- a/kit/ForKit.cpp
+++ b/kit/ForKit.cpp
@@ -69,7 +69,6 @@ std::string MasterLocation;
 
 extern "C" { void dump_forkit_state(void); /* easy for gdb */ }
 
-#if !MOBILEAPP
 void dump_forkit_state()
 {
 std::ostringstream oss;
@@ -92,7 +91,6 @@ void dump_forkit_state()
 fprintf(stderr, "%s", msg.c_str());
 LOG_TRC(msg);
 }
-#endif
 
 class ServerWSHandler;
 
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 37016d420..7c8f426d0 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -105,6 +105,8 @@ using Poco::Path;
 using namespace LOOLProtocol;
 using std::size_t;
 
+extern "C" { void dump_kit_state(void); /* easy for gdb */ }
+
 // We only host a single document in our lifetime.
 class Document;
 #ifndef BUILDING_TESTS
@@ -1549,6 +1551,43 @@ private:
 sendTextFrame(msg);
 }
 
+public:
+void dumpState(std::ostream& oss)
+{
+oss << "Kit Document:\n"
+<< "\n\tstop: " << _stop
+<< "\n\tisLoading: " << _stop
+<< "\n\tjailId: " << _jailId
+<< "\n\tdocKey: " << _docKey
+<< "\n\tdocId: " << _docId
+<< "\n\turl: " << _url
+<< "\n\tobfuscatedFileId: " << _obfuscatedFileId
+<< "\n\tjailedUrl: " << _jailedUrl
+<< "\n\trenderOpts: " << _renderOpts
+<< "\n\thaveDocPassword: " << _haveDocPassword // not the pwd 
itself
+<< "\n\tisDocPasswordProtected: " << _isDocPasswordProtected
+<< "\n\tdocPasswordType: " << (int)_docPasswordType
+<< "\n\teditorId: " << _editorId
+<< "\n\teditorChangeWarning: " << _editorChangeWarning
+<< "\n";
+
+// dumpState:
+// TODO: _websocketHandler - but this is an odd one.
+// TODO: std::shared_ptr _tileQueue;
+// TODO: PngCache _pngCache;
+// TODO: std::map> 
_viewIdToCallbackDescr;
+// ThreadPool _pngPool;
+
+_sessions.dumpState(oss);
+
+// TODO: std::map 
_lastUpdatedAt;
+// TODO: std::map _speedCount;
+
+/// For showing disconnected user info in the doc repair dialog.
+// TODO: std::map _sessionUserInfo;
+// TODO: std::chrono::steady_clock::time_point _lastMemStatsTime;
+}
+
 private:
 std::shared_ptr _loKit;
 const std::string _jailId;
@@ -1619,24 +1658,45 @@ class KitSocketPoll final : public SocketPoll
 std::chrono::steady_clock::time_point _pollEnd;
 std::shared_ptr _document;
 
+static KitSocketPoll *mainPoll;
+
 KitSocketPoll() :
 SocketPoll("kit")
 {
 #ifdef IOS
 terminationFlag = false;
 #endif
+mainPoll = this;
 }

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

2020-07-17 Thread Michael Meeks (via logerrit)
 kit/Kit.cpp |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 0084c3b275bbbad7f3ee2d36f86afc10fbc5400c
Author: Michael Meeks 
AuthorDate: Thu Jul 16 19:10:05 2020 +0100
Commit: Michael Meeks 
CommitDate: Fri Jul 17 12:29:54 2020 +0200

Process any pending tileQueue items first.

Change-Id: I078bc1f52ba7647ca1715ea3222d695936dd657f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98928
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 123a87e66..37016d420 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1386,11 +1386,16 @@ private:
 }
 
 public:
+bool hasQueueItems() const
+{
+return _tileQueue && !_tileQueue->isEmpty();
+}
+
 void drainQueue(const std::chrono::steady_clock::time_point &/*now*/)
 {
 try
 {
-while (!_tileQueue->isEmpty())
+while (hasQueueItems())
 {
 if (_stop || SigUtil::getTerminationFlag())
 {
@@ -1679,7 +1684,10 @@ public:
 _pollEnd = std::chrono::steady_clock::now() + 
std::chrono::microseconds(timeoutMicroS);
 do
 {
-if (poll(timeoutMicroS) <= 0)
+int realTimeout = timeoutMicroS;
+if (_document && _document->hasQueueItems())
+realTimeout = 0;
+if (poll(realTimeout) <= 0)
 break;
 
 const auto now = std::chrono::steady_clock::now();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: common/SigUtil.cpp common/SigUtil.hpp kit/ForKit.cpp wsd/LOOLWSD.cpp

2020-07-14 Thread Michael Meeks (via logerrit)
 common/SigUtil.cpp |   17 +
 common/SigUtil.hpp |9 -
 kit/ForKit.cpp |   31 +++
 wsd/LOOLWSD.cpp|8 +---
 4 files changed, 45 insertions(+), 20 deletions(-)

New commits:
commit 6ca6a7649eff18e3e48bfe97c3cafcf41fb16363
Author: Michael Meeks 
AuthorDate: Tue Jul 14 15:20:05 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Jul 14 17:28:32 2020 +0200

Forkit: add dump_forkit_state and re-factor state checks to simplify.

Change-Id: Ic65bbd0894f26f69e1b55c769ac47013f9aaf163
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98746
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/common/SigUtil.cpp b/common/SigUtil.cpp
index 2bc3d5aa7..f768005c6 100644
--- a/common/SigUtil.cpp
+++ b/common/SigUtil.cpp
@@ -66,17 +66,18 @@ namespace SigUtil
 }
 #endif
 
-#if !MOBILEAPP
-bool getDumpGlobalState()
+void checkDumpGlobalState(GlobalDumpStateFn dumpState)
 {
-return DumpGlobalState;
-}
-
-void resetDumpGlobalState()
-{
-DumpGlobalState = false;
+#if !MOBILEAPP
+if (DumpGlobalState)
+{
+dumpState();
+DumpGlobalState = false;
+}
+#endif
 }
 
+#if !MOBILEAPP
 /// This traps the signal-handler so we don't _Exit
 /// while dumping stack trace. It's re-entrant.
 /// Used to safely increment and decrement the signal-handler trap.
diff --git a/common/SigUtil.hpp b/common/SigUtil.hpp
index 9cc5b69d4..9f8296426 100644
--- a/common/SigUtil.hpp
+++ b/common/SigUtil.hpp
@@ -46,12 +46,11 @@ namespace SigUtil
 }
 #endif
 
-#if !MOBILEAPP
-/// Get the flag to dump internal state.
-bool getDumpGlobalState();
-/// Reset the flag to dump internal state.
-void resetDumpGlobalState();
+extern "C" { typedef void (*GlobalDumpStateFn)(void); }
+
+void checkDumpGlobalState(GlobalDumpStateFn dumpState);
 
+#if !MOBILEAPP
 /// Wait for the signal handler, if any,
 /// and prevent _Exit while collecting backtrace.
 void waitSigHandlerTrap();
diff --git a/kit/ForKit.cpp b/kit/ForKit.cpp
index 721670bd1..9daa93576 100644
--- a/kit/ForKit.cpp
+++ b/kit/ForKit.cpp
@@ -67,6 +67,33 @@ int ClientPortNumber = DEFAULT_CLIENT_PORT_NUMBER;
 std::string MasterLocation;
 #endif
 
+extern "C" { void dump_forkit_state(void); /* easy for gdb */ }
+
+#if !MOBILEAPP
+void dump_forkit_state()
+{
+std::ostringstream oss;
+
+oss << "Forkit: " << ForkCounter << " forks\n"
+<< "  loglevel: " << LogLevel << "\n"
+<< "  unit test: " << UnitTestLibrary << "\n"
+#ifndef KIT_IN_PROCESS
+<< "  NoCapsForKit: " << NoCapsForKit << "\n"
+<< "  NoSeccomp: " << NoSeccomp << "\n"
+#  if ENABLE_DEBUG
+<< "  SingleKit: " << SingleKit << "\n"
+#  endif
+#endif
+<< "  ClientPortNumber: " << ClientPortNumber << "\n"
+<< "  MasterLocation: " << MasterLocation
+<< "\n";
+
+const std::string msg = oss.str();
+fprintf(stderr, "%s", msg.c_str());
+LOG_TRC(msg);
+}
+#endif
+
 class ServerWSHandler;
 
 // We have a single thread and a single connection so we won't bother with
@@ -627,6 +654,8 @@ int main(int argc, char** argv)
 mainPoll.insertNewUnixSocket(MasterLocation, FORKIT_URI, WSHandler);
 #endif
 
+SigUtil::setUserSignals();
+
 LOG_INF("ForKit process is ready.");
 
 while (!SigUtil::getTerminationFlag())
@@ -635,6 +664,8 @@ int main(int argc, char** argv)
 
 mainPoll.poll(POLL_TIMEOUT_MICRO_S);
 
+SigUtil::checkDumpGlobalState(dump_forkit_state);
+
 #if ENABLE_DEBUG
 if (!SingleKit)
 #endif
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 9815e4158..cef10cc11 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -3599,13 +3599,7 @@ private:
 
 void wakeupHook() override
 {
-#if !MOBILEAPP
-if (SigUtil::getDumpGlobalState())
-{
-dump_state();
-SigUtil::resetDumpGlobalState();
-}
-#endif
+SigUtil::checkDumpGlobalState(dump_state);
 }
 };
 /// This thread & poll accepts incoming connections.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: net/WebSocketHandler.hpp

2020-07-14 Thread Michael Meeks (via logerrit)
 net/WebSocketHandler.hpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7336133319881161907cbba2fcbfebf09b95c6a8
Author: Michael Meeks 
AuthorDate: Tue Jul 14 10:44:21 2020 +0100
Commit: Michael Meeks 
CommitDate: Tue Jul 14 16:59:51 2020 +0200

Handle multiple queued fragments in WebSocket _inBuffer without timeout.

Change-Id: I488a1311404a94f64e145db99f76782e171965ba
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98714
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/net/WebSocketHandler.hpp b/net/WebSocketHandler.hpp
index 4aca03e38..66620a1d0 100644
--- a/net/WebSocketHandler.hpp
+++ b/net/WebSocketHandler.hpp
@@ -389,7 +389,7 @@ public:
 {
 _inFragmentBlock = true;
 // If is not final fragment then wait for next fragment.
-return false;
+return true;
 }
 #else
 handleMessage(_wsPayload);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/l10n

2020-07-08 Thread Michael Meeks (via logerrit)
 loleaflet/l10n/admin-localizations.json  |2 ++
 loleaflet/l10n/help-localizations.json   |2 ++
 loleaflet/l10n/localizations.json|2 ++
 loleaflet/l10n/locore-localizations.json |2 ++
 loleaflet/l10n/uno-localizations.json|2 ++
 5 files changed, 10 insertions(+)

New commits:
commit 2196a4497851ddbf71a1e4b374d1e455c23cfbd1
Author: Michael Meeks 
AuthorDate: Wed Jul 8 21:18:55 2020 +0100
Commit: Aron Budea 
CommitDate: Wed Jul 8 23:43:19 2020 +0200

Adapt l10n for latest Android locale goodness.

cf. https://gist.github.com/amake/0ac7724681ac1c178c6f95a5b09f03ce

Change-Id: Ie0cc7f210a800fd835356d246ec661757e9ab89f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98391
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
(cherry picked from commit 83557cbb881f22e0a70c808076176560af5513b9)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98337
Reviewed-by: Aron Budea 

diff --git a/loleaflet/l10n/admin-localizations.json 
b/loleaflet/l10n/admin-localizations.json
index a42f0de97..9ac48be94 100644
--- a/loleaflet/l10n/admin-localizations.json
+++ b/loleaflet/l10n/admin-localizations.json
@@ -122,7 +122,9 @@
 "xh": "../l10n/ui-xh.json",
 "zh-cn": "../l10n/ui-zh_CN.json",
 "zh-CN": "../l10n/ui-zh_CN.json",
+"zh-Hans": "../l10n/ui-zh_CN.json",
 "zh-tw": "../l10n/ui-zh_TW.json",
 "zh-TW": "../l10n/ui-zh_TW.json",
+"zh-Hant": "../l10n/ui-zh_TW.json",
 "zu": "../l10n/ui-zu.json"
 }
diff --git a/loleaflet/l10n/help-localizations.json 
b/loleaflet/l10n/help-localizations.json
index 6dc5456be..559ac795e 100644
--- a/loleaflet/l10n/help-localizations.json
+++ b/loleaflet/l10n/help-localizations.json
@@ -123,7 +123,9 @@
 "xh": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-xh.json",
 "zh-cn": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-zh_CN.json",
 "zh-CN": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-zh_CN.json",
+"zh-Hans": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-zh_CN.json",
 "zh-tw": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-zh_TW.json",
 "zh-TW": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-zh_TW.json",
+"zh-Hant": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-zh_TW.json",
 "zu": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-zu.json"
 }
diff --git a/loleaflet/l10n/localizations.json 
b/loleaflet/l10n/localizations.json
index 2c988e5ba..b68c97ad6 100644
--- a/loleaflet/l10n/localizations.json
+++ b/loleaflet/l10n/localizations.json
@@ -123,7 +123,9 @@
 "xh": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-xh.json",
 "zh-cn": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-zh_CN.json",
 "zh-CN": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-zh_CN.json",
+"zh-Hans": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-zh_CN.json",
 "zh-tw": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-zh_TW.json",
 "zh-TW": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-zh_TW.json",
+"zh-Hant": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-zh_TW.json",
 "zu": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-zu.json"
 }
diff --git a/loleaflet/l10n/locore-localizations.json 
b/loleaflet/l10n/locore-localizations.json
index e99e1e85e..c828f7ffb 100644
--- a/loleaflet/l10n/locore-localizations.json
+++ b/loleaflet/l10n/locore-localizations.json
@@ -128,7 +128,9 @@
 "xh": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/xh.json",
 "zh-cn": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/zh-CN.json",
 "zh-CN": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/zh-CN.json",
+"zh-Hans": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/zh-CN.json",
 "zh-tw": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/zh-TW.json",
 "zh-TW": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/zh-TW.json",
+"zh-Hant": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/zh-TW.json",
 "zu": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/zu.json"
 }
diff --git a/loleaflet/l10n/uno-localizations.json 
b/loleaflet/l10n/uno-localizations.json
index 6ed799720..bf1566305 100644
--- a/loleaflet/l10n/uno-localizations.json
+++ b/loleaflet/l10n/uno-localizations.json
@@ -128,7 +128,9 @@
 "xh": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/xh.json",
 "zh-cn": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/zh-CN.json",
 "zh-CN": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/zh-CN.json",
+"zh-Hans": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/zh-CN.json",
 "zh-tw": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/zh-TW.json",
 "zh-TW": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/zh-TW.json",
+"zh-Hant": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/zh-TW.json",
 "zu": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/zu.json"
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-08 Thread Michael Meeks (via logerrit)
 loleaflet/l10n/admin-localizations.json  |2 ++
 loleaflet/l10n/help-localizations.json   |2 ++
 loleaflet/l10n/localizations.json|2 ++
 loleaflet/l10n/locore-localizations.json |2 ++
 loleaflet/l10n/uno-localizations.json|2 ++
 5 files changed, 10 insertions(+)

New commits:
commit 83557cbb881f22e0a70c808076176560af5513b9
Author: Michael Meeks 
AuthorDate: Wed Jul 8 21:18:55 2020 +0100
Commit: Michael Meeks 
CommitDate: Wed Jul 8 23:11:26 2020 +0200

Adapt l10n for latest Android locale goodness.

cf. https://gist.github.com/amake/0ac7724681ac1c178c6f95a5b09f03ce

Change-Id: Ie0cc7f210a800fd835356d246ec661757e9ab89f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98391
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/l10n/admin-localizations.json 
b/loleaflet/l10n/admin-localizations.json
index a42f0de97..9ac48be94 100644
--- a/loleaflet/l10n/admin-localizations.json
+++ b/loleaflet/l10n/admin-localizations.json
@@ -122,7 +122,9 @@
 "xh": "../l10n/ui-xh.json",
 "zh-cn": "../l10n/ui-zh_CN.json",
 "zh-CN": "../l10n/ui-zh_CN.json",
+"zh-Hans": "../l10n/ui-zh_CN.json",
 "zh-tw": "../l10n/ui-zh_TW.json",
 "zh-TW": "../l10n/ui-zh_TW.json",
+"zh-Hant": "../l10n/ui-zh_TW.json",
 "zu": "../l10n/ui-zu.json"
 }
diff --git a/loleaflet/l10n/help-localizations.json 
b/loleaflet/l10n/help-localizations.json
index 6dc5456be..559ac795e 100644
--- a/loleaflet/l10n/help-localizations.json
+++ b/loleaflet/l10n/help-localizations.json
@@ -123,7 +123,9 @@
 "xh": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-xh.json",
 "zh-cn": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-zh_CN.json",
 "zh-CN": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-zh_CN.json",
+"zh-Hans": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-zh_CN.json",
 "zh-tw": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-zh_TW.json",
 "zh-TW": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-zh_TW.json",
+"zh-Hant": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-zh_TW.json",
 "zu": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/help-zu.json"
 }
diff --git a/loleaflet/l10n/localizations.json 
b/loleaflet/l10n/localizations.json
index 2c988e5ba..b68c97ad6 100644
--- a/loleaflet/l10n/localizations.json
+++ b/loleaflet/l10n/localizations.json
@@ -123,7 +123,9 @@
 "xh": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-xh.json",
 "zh-cn": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-zh_CN.json",
 "zh-CN": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-zh_CN.json",
+"zh-Hans": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-zh_CN.json",
 "zh-tw": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-zh_TW.json",
 "zh-TW": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-zh_TW.json",
+"zh-Hant": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-zh_TW.json",
 "zu": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/ui-zu.json"
 }
diff --git a/loleaflet/l10n/locore-localizations.json 
b/loleaflet/l10n/locore-localizations.json
index e99e1e85e..c828f7ffb 100644
--- a/loleaflet/l10n/locore-localizations.json
+++ b/loleaflet/l10n/locore-localizations.json
@@ -128,7 +128,9 @@
 "xh": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/xh.json",
 "zh-cn": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/zh-CN.json",
 "zh-CN": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/zh-CN.json",
+"zh-Hans": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/zh-CN.json",
 "zh-tw": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/zh-TW.json",
 "zh-TW": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/zh-TW.json",
+"zh-Hant": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/zh-TW.json",
 "zu": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/locore/zu.json"
 }
diff --git a/loleaflet/l10n/uno-localizations.json 
b/loleaflet/l10n/uno-localizations.json
index 6ed799720..bf1566305 100644
--- a/loleaflet/l10n/uno-localizations.json
+++ b/loleaflet/l10n/uno-localizations.json
@@ -128,7 +128,9 @@
 "xh": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/xh.json",
 "zh-cn": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/zh-CN.json",
 "zh-CN": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/zh-CN.json",
+"zh-Hans": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/zh-CN.json",
 "zh-tw": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/zh-TW.json",
 "zh-TW": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/zh-TW.json",
+"zh-Hant": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/zh-TW.json",
 "zu": "%SERVICE_ROOT%/loleaflet/%VERSION%/l10n/uno/zu.json"
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-01 Thread Michael Meeks (via logerrit)
 framework/source/fwe/helper/titlehelper.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6ddd8673f9985afd48b3212444a942ebe37197f6
Author: Michael Meeks 
AuthorDate: Wed Jul 1 17:59:35 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Thu Jul 2 00:32:02 2020 +0200

Disable flavour in title bar for Linux.

Tweaks c5404831344 after discussion with Rene.

Change-Id: I7820643f79e673a90055f74770bffaf8ad7a077f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97646
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/framework/source/fwe/helper/titlehelper.cxx 
b/framework/source/fwe/helper/titlehelper.cxx
index d02287da16b4..e1a9738267d0 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -518,10 +518,10 @@ void TitleHelper::impl_updateTitleForFrame (const 
css::uno::Reference< css::fram
 // document name (from the above "component title").
 impl_appendProductName  (sTitle);
 
+#if defined(WNT) || defined(MACOSX)
 if (!std::string_view(PRODUCTFLAVOR).empty())
-{
 sTitle.append(" " PRODUCTFLAVOR);
-}
+#endif
 
 impl_appendModuleName   (sTitle);
 impl_appendDebugVersion (sTitle);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-01 Thread Michael Meeks (via logerrit)
 framework/source/fwe/helper/titlehelper.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5a782225adc069a9b39986f7ced37eb78e542ae3
Author: Michael Meeks 
AuthorDate: Wed Jul 1 17:59:35 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Thu Jul 2 00:32:21 2020 +0200

Disable flavour in title bar for Linux.

Tweaks c5404831344 after discussion with Rene.

Change-Id: I7820643f79e673a90055f74770bffaf8ad7a077f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97587
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/framework/source/fwe/helper/titlehelper.cxx 
b/framework/source/fwe/helper/titlehelper.cxx
index d02287da16b4..e1a9738267d0 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -518,10 +518,10 @@ void TitleHelper::impl_updateTitleForFrame (const 
css::uno::Reference< css::fram
 // document name (from the above "component title").
 impl_appendProductName  (sTitle);
 
+#if defined(WNT) || defined(MACOSX)
 if (!std::string_view(PRODUCTFLAVOR).empty())
-{
 sTitle.append(" " PRODUCTFLAVOR);
-}
+#endif
 
 impl_appendModuleName   (sTitle);
 impl_appendDebugVersion (sTitle);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Changes to 'private/tml/ios-gen2'

2020-07-01 Thread Michael Meeks (via logerrit)
New branch 'private/tml/ios-gen2' available with the following commits:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   3   4   5   6   7   8   9   10   >