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

2020-04-07 Thread Mert Tumer (via logerrit)
 sd/source/ui/view/drviews5.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 3bd5dcc02b84da14286af4492f28bc776d765146
Author: Mert Tumer 
AuthorDate: Tue Apr 7 15:36:34 2020 +0300
Commit: Andras Timar 
CommitDate: Tue Apr 7 19:27:49 2020 +0200

fix ODP roundtripped in online opens with huge zoom in desktop

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

diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx
index 2266c7981d06..dea2c58d795f 100644
--- a/sd/source/ui/view/drviews5.cxx
+++ b/sd/source/ui/view/drviews5.cxx
@@ -61,6 +61,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace sd {
 
@@ -343,6 +344,12 @@ void DrawViewShell::WriteFrameViewData()
 
 Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
 ::tools::Rectangle aVisArea = GetActiveWindow()->PixelToLogic( 
::tools::Rectangle( Point(0,0), aVisSizePixel) );
+if (comphelper::LibreOfficeKit::isActive())
+{
+// aVisArea is nonsensical in the LOK case, use the slide size
+aVisArea = ::tools::Rectangle(Point(), getCurrentPage()->GetSize());
+}
+
 mpFrameView->SetVisArea(aVisArea);
 
 if( mePageKind == PageKind::Handout )
___
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.2' - vcl/source

2020-04-06 Thread Mert Tumer (via logerrit)
 vcl/source/uitest/uiobject.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit e4f28d0642e4663d558a55e99ec1cc2ea9ad27ed
Author: Mert Tumer 
AuthorDate: Fri Apr 3 15:34:37 2020 +0300
Commit: Andras Timar 
CommitDate: Mon Apr 6 21:43:55 2020 +0200

mobile: cannot change linestyle on impress

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

diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index 899fbb97d75c..af3f486569d8 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -21,6 +21,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -936,7 +937,11 @@ ListBoxUIObject::~ListBoxUIObject()
 void ListBoxUIObject::execute(const OUString& rAction,
 const StringMap& rParameters)
 {
-if (!mxListBox->IsEnabled() || !mxListBox->IsReallyVisible())
+if (!mxListBox->IsEnabled())
+return;
+
+bool isTiledRendering = comphelper::LibreOfficeKit::isActive();
+if (!isTiledRendering && !mxListBox->IsReallyVisible())
 return;
 
 if (rAction == "SELECT")
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-31 Thread Mert Tumer (via logerrit)
 svx/uiconfig/ui/sidebartextpanel.ui |   29 +++--
 1 file changed, 27 insertions(+), 2 deletions(-)

New commits:
commit f905411741170e524c4a8741a600142585a4d8d8
Author: Mert Tumer 
AuthorDate: Tue Mar 31 15:04:38 2020 +0300
Commit: Andras Timar 
CommitDate: Tue Mar 31 22:04:21 2020 +0200

added Clear Direct Formatting button to sidebar

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

diff --git a/svx/uiconfig/ui/sidebartextpanel.ui 
b/svx/uiconfig/ui/sidebartextpanel.ui
index 65443d789f31..af220dcc0b25 100644
--- a/svx/uiconfig/ui/sidebartextpanel.ui
+++ b/svx/uiconfig/ui/sidebartextpanel.ui
@@ -1,5 +1,5 @@
 
-
+
 
   
   
@@ -273,7 +273,7 @@
   
 True
 True
- 
+
   
 True
 False
@@ -293,6 +293,31 @@
 2
   
 
+
+  
+True
+False
+False
+
+  
+True
+False
+True
+.uno:ResetAttributes
+True
+  
+  
+False
+True
+  
+
+  
+  
+False
+True
+3
+  
+
 
   
 True
___
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.2' - svx/uiconfig

2020-03-31 Thread Mert Tumer (via logerrit)
 svx/uiconfig/ui/sidebartextpanel.ui |   29 +++--
 1 file changed, 27 insertions(+), 2 deletions(-)

New commits:
commit 68d7fff82e5f72e37ca9a4e5e18367c172cdecd3
Author: Mert Tumer 
AuthorDate: Tue Mar 31 15:04:38 2020 +0300
Commit: Andras Timar 
CommitDate: Tue Mar 31 16:30:34 2020 +0200

added Clear Direct Formatting button to sidebar

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

diff --git a/svx/uiconfig/ui/sidebartextpanel.ui 
b/svx/uiconfig/ui/sidebartextpanel.ui
index c2c995490525..64b19a115db2 100644
--- a/svx/uiconfig/ui/sidebartextpanel.ui
+++ b/svx/uiconfig/ui/sidebartextpanel.ui
@@ -1,5 +1,5 @@
 
-
+
 
   
   
@@ -273,7 +273,7 @@
   
 True
 True
- 
+
   
 True
 False
@@ -293,6 +293,31 @@
 2
   
 
+
+  
+True
+False
+False
+
+  
+True
+False
+True
+.uno:ResetAttributes
+True
+  
+  
+False
+True
+  
+
+  
+  
+False
+True
+3
+  
+
 
   
 True
___
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.2' - sd/source

2020-03-18 Thread Mert Tumer (via logerrit)
 sd/source/ui/func/fusel.cxx |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 18ac91043d2e90b89ac56e3230d687fffeeb25a9
Author: Mert Tumer 
AuthorDate: Wed Mar 18 13:17:32 2020 +0300
Commit: Andras Timar 
CommitDate: Wed Mar 18 11:59:54 2020 +0100

mobile: fix hyperlinks are not clickable on impress

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

diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx
index 81988e00a351..b5e49ef8112f 100644
--- a/sd/source/ui/func/fusel.cxx
+++ b/sd/source/ui/func/fusel.cxx
@@ -269,6 +269,14 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
  {
 mpWindow->ReleaseMouse();
 
+// If tiled rendering, let client handles URL execution and 
early returns.
+if (comphelper::LibreOfficeKit::isActive())
+{
+SfxViewShell& rSfxViewShell = 
mpViewShell->GetViewShellBase();
+
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, 
aVEvt.pURLField->GetURL().toUtf8().getStr());
+return true;
+}
+
 SvtSecurityOptions aSecOpt;
 if (!rMEvt.IsMod1() && 
aSecOpt.IsOptionSet(SvtSecurityOptions::EOption::CtrlClickHyperlink))
 return true;
@@ -281,14 +289,6 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
 SfxViewFrame* pFrame = mpViewShell->GetViewFrame();
 mpWindow->ReleaseMouse();
 
-// If tiled rendering, let client handles URL execution and 
early returns.
-if (comphelper::LibreOfficeKit::isActive())
-{
-SfxViewShell& rSfxViewShell = 
mpViewShell->GetViewShellBase();
-
rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, 
aVEvt.pURLField->GetURL().toUtf8().getStr());
-return true;
-}
-
 if (rMEvt.IsMod1())
 {
 // Open in new frame
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-04 Thread Mert Tumer (via logerrit)
 sc/source/ui/view/gridwin.cxx |   10 +++---
 sw/source/uibase/docvw/edtwin.cxx |6 ++
 2 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 9323307d675b71c501534ee98872a2f00b465bc2
Author: Mert Tumer 
AuthorDate: Wed Feb 26 18:48:46 2020 +0300
Commit: Andras Timar 
CommitDate: Wed Mar 4 21:19:58 2020 +0100

fix ToC links give unhelpful url popups

core expects ctrl+click for internal links too and
it should not expect it if it is tiled rendering

Change-Id: Id841f0e9729e46f00988ea0b4eb29bd65098a740
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89559
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
(cherry picked from commit 3fe9dfca2d44d9e41ee329883f199359c673f382)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89919
Tested-by: Jenkins

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 5ca54bae2a93..d690b59fccc6 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2202,14 +2202,18 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& 
rMEvt )
 if ( GetEditUrl( rMEvt.GetPosPixel(), , ,  ) )
 {
 nMouseStatus = SC_GM_NONE;  // Ignore double-click
-
+bool isTiledRendering = comphelper::LibreOfficeKit::isActive();
 // ScGlobal::OpenURL() only understands Calc A1 style syntax.
 // Convert it to Calc A1 before calling OpenURL().
 if (pDoc->GetAddressConvention() == 
formula::FormulaGrammar::CONV_OOO)
 {
+if (aUrl.startsWith("#")) {
+ScGlobal::OpenURL(aUrl, aTarget, isTiledRendering);
+return;
+}
 // in mobile view there is no ctrl+click and for hyperlink 
popup
 // the cell coordinates must be sent along with click position 
for elegance
-if (comphelper::LibreOfficeKit::isActive() &&
+if (isTiledRendering &&
  
comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
 {
 ScTabViewShell* pViewShell = pViewData->GetViewShell();
@@ -2260,7 +2264,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt 
)
 aBuf.append('#');
 OUString 
aUrlCalcA1(aTempAddr.Format(ScRefFlags::ADDR_ABS_3D, pDoc, 
formula::FormulaGrammar::CONV_OOO));
 aBuf.append(aUrlCalcA1);
-ScGlobal::OpenURL(aBuf.makeStringAndClear(), aTarget);
+ScGlobal::OpenURL(aBuf.makeStringAndClear(), aTarget, 
isTiledRendering);
 }
 }
 
diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index a1e1a6f26db2..d60b347c6bb0 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -4650,6 +4650,12 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
 }
 else if ( IsAttrAtPos::InetAttr == 
aContentAtPos.eContentAtPos )
 {
+if (comphelper::LibreOfficeKit::isActive())
+{
+OUString val((*static_cast(aContentAtPos.aFnd.pAttr)).GetValue());
+if (val.startsWith("#"))
+bExecHyperlinks = true;
+}
 if ( bExecHyperlinks && 
aContentAtPos.aFnd.pAttr )
 rSh.ClickToINetAttr( *static_cast(aContentAtPos.aFnd.pAttr), nFilter );
 }
___
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.2' - sc/source sw/source

2020-03-02 Thread Mert Tumer (via logerrit)
 sc/source/ui/view/gridwin.cxx |   10 +++---
 sw/source/uibase/docvw/edtwin.cxx |6 ++
 2 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 3fe9dfca2d44d9e41ee329883f199359c673f382
Author: Mert Tumer 
AuthorDate: Wed Feb 26 18:48:46 2020 +0300
Commit: Andras Timar 
CommitDate: Mon Mar 2 23:42:13 2020 +0100

fix ToC links give unhelpful url popups

core expects ctrl+click for internal links too and
it should not expect it if it is tiled rendering

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

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index a5ca02b06aec..2a751f77ac99 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2185,14 +2185,18 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& 
rMEvt )
 if ( GetEditUrl( rMEvt.GetPosPixel(), , ,  ) )
 {
 nMouseStatus = SC_GM_NONE;  // Ignore double-click
-
+bool isTiledRendering = comphelper::LibreOfficeKit::isActive();
 // ScGlobal::OpenURL() only understands Calc A1 style syntax.
 // Convert it to Calc A1 before calling OpenURL().
 if (pDoc->GetAddressConvention() == 
formula::FormulaGrammar::CONV_OOO)
 {
+if (aUrl.startsWith("#")) {
+ScGlobal::OpenURL(aUrl, aTarget, isTiledRendering);
+return;
+}
 // in mobile view there is no ctrl+click and for hyperlink 
popup
 // the cell coordinates must be sent along with click position 
for elegance
-if (comphelper::LibreOfficeKit::isActive() &&
+if (isTiledRendering &&
  
comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
 {
 ScTabViewShell* pViewShell = pViewData->GetViewShell();
@@ -2243,7 +2247,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt 
)
 aBuf.append('#');
 OUString 
aUrlCalcA1(aTempAddr.Format(ScRefFlags::ADDR_ABS_3D, pDoc, 
formula::FormulaGrammar::CONV_OOO));
 aBuf.append(aUrlCalcA1);
-ScGlobal::OpenURL(aBuf.makeStringAndClear(), aTarget);
+ScGlobal::OpenURL(aBuf.makeStringAndClear(), aTarget, 
isTiledRendering);
 }
 }
 
diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index d48a5a4199c0..06d98b1c6dac 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -4650,6 +4650,12 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
 }
 else if ( IsAttrAtPos::InetAttr == 
aContentAtPos.eContentAtPos )
 {
+if (comphelper::LibreOfficeKit::isActive())
+{
+OUString val((*static_cast(aContentAtPos.aFnd.pAttr)).GetValue());
+if (val.startsWith("#"))
+bExecHyperlinks = true;
+}
 if ( bExecHyperlinks && 
aContentAtPos.aFnd.pAttr )
 rSh.ClickToINetAttr( *static_cast(aContentAtPos.aFnd.pAttr), nFilter );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-29 Thread Mert Tumer (via logerrit)
 sc/source/ui/view/gridwin.cxx |   21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 91228affd8996d9690b0abfa9544a18701ee3ec3
Author: Mert Tumer 
AuthorDate: Thu Feb 20 18:33:04 2020 +0300
Commit: Andras Timar 
CommitDate: Sat Feb 29 19:38:03 2020 +0100

send hyperlinkclicked callback on calc mobile

for opening links ctrl+click must be pressed
but in mobile this cant be done
This patch allows it to send the callback and also
cell coordinates for hyperlink popup

Change-Id: I8c0fac167627ef449d9cf20a36a7a5a77978ae0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89121
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 
(cherry picked from commit 9bfa939f87f28cdaed2a24c3dc5f9a21004b19da)

Blind build fix for Android

After 9bfa939f87f28cdaed2a24c3dc5f9a21004b19da

Also, replace chained OStringBuffer::append() with operator+

Change-Id: I7012667b3c4173cc0193720e0197992e5942bc7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89164
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89693
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index ef07ea912115..5ca54bae2a93 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2206,7 +2206,26 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& 
rMEvt )
 // ScGlobal::OpenURL() only understands Calc A1 style syntax.
 // Convert it to Calc A1 before calling OpenURL().
 if (pDoc->GetAddressConvention() == 
formula::FormulaGrammar::CONV_OOO)
-ScGlobal::OpenURL(aUrl, aTarget);
+{
+// in mobile view there is no ctrl+click and for hyperlink 
popup
+// the cell coordinates must be sent along with click position 
for elegance
+if (comphelper::LibreOfficeKit::isActive() &&
+ 
comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+{
+ScTabViewShell* pViewShell = pViewData->GetViewShell();
+Point aPos = rMEvt.GetPosPixel();
+SCCOL nPosX;
+SCROW nPosY;
+pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, 
nPosX, nPosY );
+auto pForTabView = dynamic_cast(pViewShell);
+OString aCursor = 
pForTabView->GetViewData().describeCellCursorAt(nPosX, nPosY);
+double fPPTX = pForTabView->GetViewData().GetPPTX();
+int mouseX = aPos.X() / fPPTX;
+OString aMsg(aUrl.toUtf8() + " coordinates: " + aCursor + 
", " + OString::number(mouseX));
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, 
aMsg.getStr());
+} else
+ScGlobal::OpenURL(aUrl, aTarget);
+}
 else
 {
 ScAddress aTempAddr;
___
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.2' - sc/source

2020-02-20 Thread Mert Tumer (via logerrit)
 sc/source/ui/view/gridwin.cxx |   26 +-
 1 file changed, 25 insertions(+), 1 deletion(-)

New commits:
commit 9bfa939f87f28cdaed2a24c3dc5f9a21004b19da
Author: Mert Tumer 
AuthorDate: Thu Feb 20 18:33:04 2020 +0300
Commit: Michael Meeks 
CommitDate: Thu Feb 20 16:47:37 2020 +0100

send hyperlinkclicked callback on calc mobile

for opening links ctrl+click must be pressed
but in mobile this cant be done
This patch allows it to send the callback and also
cell coordinates for hyperlink popup

Change-Id: I8c0fac167627ef449d9cf20a36a7a5a77978ae0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89121
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index d416607a379e..1232a8fa3626 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2189,7 +2189,31 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& 
rMEvt )
 // ScGlobal::OpenURL() only understands Calc A1 style syntax.
 // Convert it to Calc A1 before calling OpenURL().
 if (pDoc->GetAddressConvention() == 
formula::FormulaGrammar::CONV_OOO)
-ScGlobal::OpenURL(aUrl, aTarget);
+{
+// in mobile view there is no ctrl+click and for hyperlink 
popup
+// the cell coordinates must be sent along with click position 
for elegance
+if (comphelper::LibreOfficeKit::isActive() &&
+ 
comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+{
+ScTabViewShell* pViewShell = pViewData->GetViewShell();
+Point aPos = rMEvt.GetPosPixel();
+SCCOL nPosX;
+SCROW nPosY;
+pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, 
nPosX, nPosY );
+auto pForTabView = dynamic_cast(pViewShell);
+OString aCursor = 
pForTabView->GetViewData().describeCellCursorAt(nPosX, nPosY);
+double fPPTX = pForTabView->GetViewData().GetPPTX();
+int mouseX = aPos.X() / fPPTX;
+OStringBuffer aBuf;
+aBuf.append(aUrl.toUtf8().getStr());
+aBuf.append(" coordinates: ");
+aBuf.append(aCursor);
+aBuf.append(", ");
+aBuf.append(mouseX);
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, 
aBuf.makeStringAndClear().getStr());
+} else
+ScGlobal::OpenURL(aUrl, aTarget);
+}
 else
 {
 ScAddress aTempAddr;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-11 Thread Mert Tumer (via logerrit)
 sc/source/ui/view/formatsh.cxx |   26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

New commits:
commit 62e077c3e58b965f0587995667d45a0a26f3672e
Author: Mert Tumer 
AuthorDate: Mon Jan 13 13:17:09 2020 +0300
Commit: Andras Timar 
CommitDate: Tue Feb 11 22:29:26 2020 +0100

Fix FontColor does not change selected cells on calc

Change-Id: Iae2f72bff4fd6986fc8cc07ba09996b1af4eb140
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86670
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
(cherry picked from commit 23e8e4521366aaf5831a3c1feaffdc41658ce7e7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88398
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 379761bfcaf0..3ed5a2a48208 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1784,10 +1784,32 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
 break;
 case SID_ATTR_CHAR_COLOR:
 case SID_SCATTR_PROTECTION :
-pTabViewShell->ApplyAttr( pNewAttrs->Get( 
pNewAttrs->GetPool()->GetWhich( nSlot) ), false);
+{
+const SfxPoolItem* pColorStringItem = nullptr;
+if ( SfxItemState::SET == pNewAttrs->GetItemState( 
SID_ATTR_COLOR_STR, false,  ) )
+{
+Color aColor;
+OUString sColor = static_cast(pColorStringItem)->GetValue();
+if ( sColor == "transparent" )
+aColor = COL_TRANSPARENT;
+else
+aColor = Color( sColor.toInt32( 16 ) );
+
+SvxColorItem 
aColorItem(pTabViewShell->GetSelectionPattern()->
+GetItem( ATTR_FONT_COLOR ) );
+aColorItem.SetValue(aColor);
+pTabViewShell->ApplyAttr(aColorItem, false);
+}
+else
+{
+pTabViewShell->ApplyAttr( pNewAttrs->Get( 
pNewAttrs->GetPool()->GetWhich( nSlot) ), false);
+}
+
 rBindings.Invalidate( nSlot );
 rBindings.Update( nSlot );
-break;
+}
+
+break;
 
 case SID_ATTR_CHAR_FONT:
 case SID_ATTR_CHAR_FONTHEIGHT:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-11 Thread Mert Tumer (via logerrit)
 sc/source/ui/view/viewfun5.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 1cec037fb349c8535cd1e09f00c0eb08e45fd957
Author: Mert Tumer 
AuthorDate: Mon Jan 20 22:08:40 2020 +0300
Commit: Andras Timar 
CommitDate: Tue Feb 11 16:35:58 2020 +0100

Fix csv dialog pops up on mobile when copy/paste

Change-Id: I9e4b154090ad9da0d10a368656f6f63fe335cecf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87132
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit f99605b6df506d51411d22d377eafd722685edbd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88397
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index a682420fb071..c0a108c1045d 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -336,7 +337,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId 
nFormatId,
 {
 // Do CSV dialog if more than one line. But not if invoked 
from Automation.
 sal_Int32 nDelim = pStrBuffer->indexOf('\n');
-if (!comphelper::Automation::AutomationInvokedZone::isActive()
+if 
(!comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()) && 
!comphelper::Automation::AutomationInvokedZone::isActive()
 && nDelim >= 0 && nDelim != pStrBuffer->getLength () - 1)
 {
 vcl::Window* pParent = GetActiveWin();
___
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.2' - sc/source

2020-01-21 Thread Mert Tumer (via logerrit)
 sc/source/ui/view/viewfun5.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit f99605b6df506d51411d22d377eafd722685edbd
Author: Mert Tumer 
AuthorDate: Mon Jan 20 22:08:40 2020 +0300
Commit: Michael Meeks 
CommitDate: Tue Jan 21 16:36:38 2020 +0100

Fix csv dialog pops up on mobile when copy/paste

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

diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 3c293013f0af..de6cfd7e137a 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -337,7 +338,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId 
nFormatId,
 {
 // Do CSV dialog if more than one line. But not if invoked 
from Automation.
 sal_Int32 nDelim = pStrBuffer->indexOf('\n');
-if (!comphelper::Automation::AutomationInvokedZone::isActive()
+if 
(!comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()) && 
!comphelper::Automation::AutomationInvokedZone::isActive()
 && nDelim >= 0 && nDelim != pStrBuffer->getLength () - 1)
 {
 vcl::Window* pParent = GetActiveWin();
___
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.2' - sc/source

2020-01-13 Thread Mert Tumer (via logerrit)
 sc/source/ui/view/formatsh.cxx |   26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

New commits:
commit 23e8e4521366aaf5831a3c1feaffdc41658ce7e7
Author: Mert Tumer 
AuthorDate: Mon Jan 13 13:17:09 2020 +0300
Commit: Michael Meeks 
CommitDate: Mon Jan 13 18:45:57 2020 +0100

Fix FontColor does not change selected cells on calc

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

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 2d49fe1bb9c4..f6808252314a 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1784,10 +1784,32 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
 break;
 case SID_ATTR_CHAR_COLOR:
 case SID_SCATTR_PROTECTION :
-pTabViewShell->ApplyAttr( pNewAttrs->Get( 
pNewAttrs->GetPool()->GetWhich( nSlot) ), false);
+{
+const SfxPoolItem* pColorStringItem = nullptr;
+if ( SfxItemState::SET == pNewAttrs->GetItemState( 
SID_ATTR_COLOR_STR, false,  ) )
+{
+Color aColor;
+OUString sColor = static_cast(pColorStringItem)->GetValue();
+if ( sColor == "transparent" )
+aColor = Color( COL_TRANSPARENT );
+else
+aColor = Color( sColor.toInt32( 16 ) );
+
+SvxColorItem 
aColorItem(pTabViewShell->GetSelectionPattern()->
+GetItem( ATTR_FONT_COLOR ) );
+aColorItem.SetValue(aColor);
+pTabViewShell->ApplyAttr(aColorItem, false);
+}
+else
+{
+pTabViewShell->ApplyAttr( pNewAttrs->Get( 
pNewAttrs->GetPool()->GetWhich( nSlot) ), false);
+}
+
 rBindings.Invalidate( nSlot );
 rBindings.Update( nSlot );
-break;
+}
+
+break;
 
 case SID_ATTR_CHAR_FONT:
 case SID_ATTR_CHAR_FONTHEIGHT:
___
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.0-29' - desktop/qa desktop/source filter/source include/LibreOfficeKit

2019-11-27 Thread Mert Tumer (via logerrit)
 desktop/qa/desktop_lib/test_desktop_lib.cxx |7 -
 desktop/source/lib/init.cxx |   33 +
 filter/source/pdf/pdfexport.cxx |   36 
 include/LibreOfficeKit/LibreOfficeKit.h |8 ++
 include/LibreOfficeKit/LibreOfficeKit.hxx   |8 --
 5 files changed, 59 insertions(+), 33 deletions(-)

New commits:
commit b7e6a06a34f601dfb619e7c83800738643d14e96
Author: Mert Tumer 
AuthorDate: Thu Oct 24 12:11:21 2019 +0300
Commit: Andras Timar 
CommitDate: Wed Nov 27 21:13:44 2019 +0100

Added Orientation argument to LOKIT renderFont

method for rendering watermarks with angle

Reviewed-on: https://gerrit.libreoffice.org/82404
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 1dd66357752b01fbf3f1aee9966a55d4a16038e4)

Change-Id: Id422ed62e4f78390661e4e1efa45101af9ecfc23
Reviewed-on: https://gerrit.libreoffice.org/83937
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 46b2dcb431fc..cb42ab2d75b4 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -70,6 +70,7 @@ public:
 virtual void setUp() override
 {
 UnoApiTest::setUp();
+
 
mxDesktop.set(frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory(;
 SfxApplication::GetOrCreate();
 };
@@ -77,6 +78,7 @@ public:
 virtual void tearDown() override
 {
 closeDoc();
+
 UnoApiTest::tearDown();
 };
 
@@ -2769,9 +2771,12 @@ void DesktopLOKTest::testABI()
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(48), offsetof(struct 
_LibreOfficeKitDocumentClass, postWindowGestureEvent));
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(49), offsetof(struct 
_LibreOfficeKitDocumentClass, selectPart));
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(50), offsetof(struct 
_LibreOfficeKitDocumentClass, moveSelectedParts));
+CPPUNIT_ASSERT_EQUAL(documentClassOffset(51), offsetof(struct 
_LibreOfficeKitDocumentClass, renderFontOrientation));
+]
+
 // Extending is fine, update this, and add new assert for the offsetof the
 // new method
-CPPUNIT_ASSERT_EQUAL(documentClassOffset(51), sizeof(struct 
_LibreOfficeKitDocumentClass));
+CPPUNIT_ASSERT_EQUAL(documentClassOffset(52), sizeof(struct 
_LibreOfficeKitDocumentClass));
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 33b699d78c1b..f9bb73a1d0a0 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -795,6 +795,12 @@ static int doc_getView(LibreOfficeKitDocument* pThis);
 static int doc_getViewsCount(LibreOfficeKitDocument* pThis);
 static bool doc_getViewIds(LibreOfficeKitDocument* pThis, int* pArray, size_t 
nSize);
 static void doc_setViewLanguage(LibreOfficeKitDocument* pThis, int nId, const 
char* language);
+static unsigned char* doc_renderFontOrientation(LibreOfficeKitDocument* pThis,
+  const char *pFontName,
+  const char *pChar,
+  int* pFontWidth,
+  int* pFontHeight,
+  int pOrientation);
 static unsigned char* doc_renderFont(LibreOfficeKitDocument* pThis,
   const char *pFontName,
   const char *pChar,
@@ -811,7 +817,8 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* 
pThis, unsigned nLOKWindo
const int nWidth, const int nHeight,
const double fDPIScale);
 
-static void doc_postWindow(LibreOfficeKitDocument* pThis, unsigned 
nLOKWindowId, int nAction, const char* pData);
+static void doc_postWindow(LibreOfficeKitDocument* pThis, unsigned
+ nLOKWindowId, int nAction, const char* pData);
 
 static char* doc_getPartInfo(LibreOfficeKitDocument* pThis, int nPart);
 
@@ -879,6 +886,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
getViewIds = doc_getViewIds;
 
 m_pDocumentClass->renderFont = doc_renderFont;
+m_pDocumentClass->renderFontOrientation = doc_renderFontOrientation;
 m_pDocumentClass->getPartHash = doc_getPartHash;
 
 m_pDocumentClass->paintWindow = doc_paintWindow;
@@ -4013,12 +4021,24 @@ static void doc_setViewLanguage(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* /*p
 SfxLokHelper::setViewLanguage(nId, OStringToOUString(language, 
RTL_TEXTENCODING_UTF8));
 }
 
-unsigned char* doc_renderFont(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* 
/*pThis*/,
+
+
+unsigned char* doc_renderFont(LibreOfficeKitDocument* pThis,
   const char* pFontName,
   const char* pChar,
  

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

2019-11-10 Thread Mert Tumer (via logerrit)
 desktop/qa/desktop_lib/test_desktop_lib.cxx |4 +--
 desktop/source/lib/init.cxx |   33 +++-
 filter/source/pdf/pdfexport.cxx |   23 +--
 include/LibreOfficeKit/LibreOfficeKit.h |8 ++
 include/LibreOfficeKit/LibreOfficeKit.hxx   |8 +-
 5 files changed, 50 insertions(+), 26 deletions(-)

New commits:
commit 7c8450abac77a2e41f1068fb11d19c1c0c93783f
Author: Mert Tumer 
AuthorDate: Thu Oct 24 12:11:21 2019 +0300
Commit: Ashod Nakashian 
CommitDate: Sun Nov 10 22:39:55 2019 +0100

Added Orientation argument to LOKIT renderFont

method for rendering watermarks with angle

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

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 8200c7e1c859..e6207b2cf98a 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -2743,11 +2743,11 @@ void DesktopLOKTest::testABI()
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(54), offsetof(struct 
_LibreOfficeKitDocumentClass, getSelectionType));
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(55), offsetof(struct 
_LibreOfficeKitDocumentClass, removeTextContext));
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(56), offsetof(struct 
_LibreOfficeKitDocumentClass, sendDialogEvent));
-
+CPPUNIT_ASSERT_EQUAL(documentClassOffset(57), offsetof(struct 
_LibreOfficeKitDocumentClass, renderFontOrientation));
 
 // Extending is fine, update this, and add new assert for the offsetof the
 // new method
-CPPUNIT_ASSERT_EQUAL(documentClassOffset(57), sizeof(struct 
_LibreOfficeKitDocumentClass));
+CPPUNIT_ASSERT_EQUAL(documentClassOffset(58), sizeof(struct 
_LibreOfficeKitDocumentClass));
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5b5b301cdee9..bc0fd62eb78a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -879,6 +879,12 @@ static int doc_getView(LibreOfficeKitDocument* pThis);
 static int doc_getViewsCount(LibreOfficeKitDocument* pThis);
 static bool doc_getViewIds(LibreOfficeKitDocument* pThis, int* pArray, size_t 
nSize);
 static void doc_setViewLanguage(LibreOfficeKitDocument* pThis, int nId, const 
char* language);
+static unsigned char* doc_renderFontOrientation(LibreOfficeKitDocument* pThis,
+  const char *pFontName,
+  const char *pChar,
+  int* pFontWidth,
+  int* pFontHeight,
+  int pOrientation);
 static unsigned char* doc_renderFont(LibreOfficeKitDocument* pThis,
   const char *pFontName,
   const char *pChar,
@@ -895,7 +901,8 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* 
pThis, unsigned nLOKWindo
const int nWidth, const int nHeight,
const double fDPIScale);
 
-static void doc_postWindow(LibreOfficeKitDocument* pThis, unsigned 
nLOKWindowId, int nAction, const char* pData);
+static void doc_postWindow(LibreOfficeKitDocument* pThis, unsigned
+ nLOKWindowId, int nAction, const char* pData);
 
 static char* doc_getPartInfo(LibreOfficeKitDocument* pThis, int nPart);
 
@@ -1001,6 +1008,7 @@ LibLODocument_Impl::LibLODocument_Impl(const 
uno::Reference getViewIds = doc_getViewIds;
 
 m_pDocumentClass->renderFont = doc_renderFont;
+m_pDocumentClass->renderFontOrientation = doc_renderFontOrientation;
 m_pDocumentClass->getPartHash = doc_getPartHash;
 
 m_pDocumentClass->paintWindow = doc_paintWindow;
@@ -4671,12 +4679,24 @@ static void doc_setViewLanguage(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* /*p
 SfxLokHelper::setViewLanguage(nId, OStringToOUString(language, 
RTL_TEXTENCODING_UTF8));
 }
 
-unsigned char* doc_renderFont(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* 
/*pThis*/,
+
+
+unsigned char* doc_renderFont(LibreOfficeKitDocument* pThis,
   const char* pFontName,
   const char* pChar,
   int* pFontWidth,
   int* pFontHeight)
 {
+return doc_renderFontOrientation(pThis, pFontName, pChar, pFontWidth, 
pFontHeight, 0);
+}
+
+unsigned char* doc_renderFontOrientation(SAL_UNUSED_PARAMETER 
LibreOfficeKitDocument* /*pThis*/,
+  const char* pFontName,
+  const char* pChar,
+  int* pFontWidth,
+  int* pFontHeight,
+  int pOrientation)
+{
 comphelper::ProfileZone aZone("doc_renderFont");
 
 SolarMutexGuard aGuard;
@@ -4708,6 +4728,7 @@ 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4-0' - test/TileCacheTests.cpp wsd/ClientSession.cpp wsd/DocumentBroker.cpp wsd/DocumentBroker.hpp wsd/TileCache.cpp wsd/Til

2019-10-19 Thread Mert Tumer (via logerrit)
 test/TileCacheTests.cpp |2 +-
 wsd/ClientSession.cpp   |2 +-
 wsd/DocumentBroker.cpp  |4 ++--
 wsd/DocumentBroker.hpp  |2 +-
 wsd/TileCache.cpp   |   23 +--
 wsd/TileCache.hpp   |8 
 6 files changed, 22 insertions(+), 19 deletions(-)

New commits:
commit ed4d93df1bfddfd73719af74cfafbbeefef90e02
Author: Mert Tumer 
AuthorDate: Wed Oct 16 16:50:09 2019 +0300
Commit: Andras Timar 
CommitDate: Sat Oct 19 20:14:31 2019 +0200

Include normalizedViewId to TileCache

Change-Id: Ibabc38a796cd99fb9d0efbf0ef14bf3d82c87b47
Reviewed-on: https://gerrit.libreoffice.org/81048
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/test/TileCacheTests.cpp b/test/TileCacheTests.cpp
index b6dda807f..fd453d995 100644
--- a/test/TileCacheTests.cpp
+++ b/test/TileCacheTests.cpp
@@ -211,7 +211,7 @@ void TileCacheTests::testSimple()
 CPPUNIT_ASSERT_MESSAGE("cached tile corrupted", data == tileData);
 
 // Invalidate Tiles
-tc.invalidateTiles("invalidatetiles: EMPTY");
+tc.invalidateTiles("invalidatetiles: EMPTY", nviewid);
 
 // No Cache
 file = tc.lookupTile(tile);
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 86a79754e..112eb511e 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -1299,7 +1299,7 @@ void ClientSession::dumpState(std::ostream& os)
 void ClientSession::handleTileInvalidation(const std::string& message,
 const std::shared_ptr& docBroker)
 {
-docBroker->invalidateTiles(message);
+docBroker->invalidateTiles(message, getHash());
 
 // Skip requesting new tiles if we don't have client visible area data yet.
 if(!_clientVisibleArea.hasSurface() ||
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 3119a14c1..fd4120611 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -1363,10 +1363,10 @@ bool DocumentBroker::handleInput(const 
std::vector& payload)
 return true;
 }
 
-void DocumentBroker::invalidateTiles(const std::string& tiles)
+void DocumentBroker::invalidateTiles(const std::string& tiles, int 
normalizedViewId)
 {
 // Remove from cache.
-_tileCache->invalidateTiles(tiles);
+_tileCache->invalidateTiles(tiles, normalizedViewId);
 }
 
 void DocumentBroker::handleTileRequest(TileDesc& tile,
diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 24a5e1ac9..858e80658 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -305,7 +305,7 @@ public:
 _cursorHeight = h;
 }
 
-void invalidateTiles(const std::string& tiles);
+void invalidateTiles(const std::string& tiles, int normalizedViewId);
 void handleTileRequest(TileDesc& tile,
const std::shared_ptr& session);
 void handleDialogRequest(const std::string& dialogCmd);
diff --git a/wsd/TileCache.cpp b/wsd/TileCache.cpp
index b46d16044..e38fdad57 100644
--- a/wsd/TileCache.cpp
+++ b/wsd/TileCache.cpp
@@ -353,7 +353,7 @@ std::unique_ptr 
TileCache::lookupCachedFile(const std::string& nam
 return nullptr;
 }
 
-void TileCache::invalidateTiles(int part, int x, int y, int width, int height)
+void TileCache::invalidateTiles(int part, int x, int y, int width, int height, 
int nViewId)
 {
 LOG_TRC("Removing invalidated tiles: part: " << part <<
 ", x: " << x << ", y: " << y <<
@@ -369,7 +369,7 @@ void TileCache::invalidateTiles(int part, int x, int y, int 
width, int height)
 for (auto tileIterator = DirectoryIterator(dir); tileIterator != 
DirectoryIterator(); ++tileIterator)
 {
 const std::string fileName = tileIterator.path().getFileName();
-if (intersectsTile(fileName, part, x, y, width, height))
+if (intersectsTile(fileName, part, x, y, width, height, nViewId))
 {
 LOG_DBG("Removing tile: " << tileIterator.path().toString());
 FileUtil::removeFile(tileIterator.path());
@@ -378,11 +378,11 @@ void TileCache::invalidateTiles(int part, int x, int y, 
int width, int height)
 }
 }
 
-void TileCache::invalidateTiles(const std::string& tiles)
+void TileCache::invalidateTiles(const std::string& tiles, int normalizedViewId)
 {
 std::pair result = 
TileCache::parseInvalidateMsg(tiles);
 Util::Rectangle& invalidateRect = result.second;
-invalidateTiles(result.first, invalidateRect.getLeft(), 
invalidateRect.getTop(), invalidateRect.getWidth(), invalidateRect.getHeight());
+invalidateTiles(result.first, invalidateRect.getLeft(), 
invalidateRect.getTop(), invalidateRect.getWidth(), invalidateRect.getHeight(), 
normalizedViewId);
 }
 
 std::pair TileCache::parseInvalidateMsg(const 
std::string& tiles)
@@ -433,25 +433,28 @@ void TileCache::removeFile(const std::string& fileName)
 std::string TileCache::cacheFileName(const TileDesc& tile)
 {
 std::ostringstream oss;
-oss << tile.getPart() << '_' << tile.getWidth() << 'x' << tile.getHeight() 
<< '.'
+  

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4-0' - common/Session.cpp common/Session.hpp kit/ChildSession.hpp kit/Kit.cpp kit/Watermark.hpp loleaflet/src Makefile.am ws

2019-10-19 Thread Mert Tumer (via logerrit)
 Makefile.am   |3 
 common/Session.cpp|   16 ++
 common/Session.hpp|   12 +
 kit/ChildSession.hpp  |2 
 kit/Kit.cpp   |  224 ++
 kit/Watermark.hpp |  178 +++
 loleaflet/src/core/Socket.js  |3 
 loleaflet/src/layer/tile/TileLayer.js |2 
 wsd/ClientSession.cpp |7 -
 wsd/DocumentBroker.cpp|4 
 10 files changed, 264 insertions(+), 187 deletions(-)

New commits:
commit ed5d304a6e17d98569a75fa9b73639ee07dbdee6
Author: Mert Tumer 
AuthorDate: Wed Oct 16 14:00:16 2019 +0300
Commit: Andras Timar 
CommitDate: Sat Oct 19 20:14:08 2019 +0200

Moved class Watermark to a seperate file

Added hash method for watermarktext and
find it from normalizedviewid for rendering
watermarks on the correct tiles

Change-Id: I4b22ae1493d2957afb93028d1ece967cf766268f
Reviewed-on: https://gerrit.libreoffice.org/81047
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/Makefile.am b/Makefile.am
index 14d64158a..dea71963d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -220,7 +220,8 @@ kit_headers = kit/ChildSession.hpp \
   kit/Delta.hpp \
   kit/DummyLibreOfficeKit.hpp \
   kit/Kit.hpp \
-  kit/KitHelper.hpp
+  kit/KitHelper.hpp \
+  kit/Watermark.hpp
 
 noinst_HEADERS = $(wsd_headers) $(shared_headers) $(kit_headers) \
  bundled/include/LibreOfficeKit/LibreOfficeKit.h \
diff --git a/common/Session.cpp b/common/Session.cpp
index f7ed7f33f..040bbc25e 100644
--- a/common/Session.cpp
+++ b/common/Session.cpp
@@ -250,6 +250,22 @@ void Session::getIOStats(uint64_t , uint64_t )
 }
 }
 
+ void Session::setHash(const std::string& text)
+ {
+ int hash = 0x811C9DC5;
+ int prime = 0x1000193;
+
+ if (!text.empty())
+ {
+for (unsigned int i = 0; i < text.length(); ++i)
+{
+hash += hash ^ text[i];
+hash *= prime;
+}
+ }
+ _hash = abs(hash);
+ }
+
 void Session::dumpState(std::ostream& os)
 {
 WebSocketHandler::dumpState(os);
diff --git a/common/Session.hpp b/common/Session.hpp
index 49f48b2e9..1934c9465 100644
--- a/common/Session.hpp
+++ b/common/Session.hpp
@@ -122,6 +122,13 @@ public:
 
 const std::string& getJailedFilePathAnonym() const { return 
_jailedFilePathAnonym; }
 
+int getHash() { return _hash; }
+
+void setHash(const std::string& text);
+
+void setHash(const int hash) { _hash = hash; };
+
+
 protected:
 Session(const std::string& name, const std::string& id, bool readonly);
 virtual ~Session();
@@ -212,6 +219,11 @@ private:
 
 /// Language for the document based on what the user has in the UI.
 std::string _lang;
+
+/// Hash for normalizedViewId which is basically an identity for the tile 
to
+/// choose what to render on and send it to its subscribers
+/// it is the close-to-unique integer representation of a string like 
Watermarks etc.
+int _hash;
 };
 
 #endif
diff --git a/kit/ChildSession.hpp b/kit/ChildSession.hpp
index f6bcf60a7..bbcc2c773 100644
--- a/kit/ChildSession.hpp
+++ b/kit/ChildSession.hpp
@@ -24,6 +24,7 @@
 #include "Kit.hpp"
 #include "Session.hpp"
 
+class Watermark;
 class ChildSession;
 
 enum class LokEventTargetEnum
@@ -238,6 +239,7 @@ public:
 }
 
 using Session::sendTextFrame;
+std::shared_ptr _docWatermark;
 
 private:
 bool loadDocument(const char* buffer, int length, const 
std::vector& tokens);
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index ad0df946e..3adb5347e 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -67,6 +67,7 @@
 #include 
 #include 
 #include "Delta.hpp"
+#include "Watermark.hpp"
 
 #ifndef MOBILEAPP
 #include 
@@ -629,171 +630,6 @@ public:
 }
 };
 
-class Watermark
-{
-public:
-Watermark(const std::shared_ptr& loKitDoc, const 
std::string& text,
-const std::shared_ptr & session)
-: _loKitDoc(loKitDoc)
-, _text(text)
-, _font("Liberation Sans")
-, _width(0)
-, _height(0)
-, _alphaLevel(session->getWatermarkOpacity())
-{
-}
-
-~Watermark()
-{
-}
-
-void blending(unsigned char* tilePixmap,
-   int offsetX, int offsetY,
-   int tilesPixmapWidth, int tilesPixmapHeight,
-   int tileWidth, int tileHeight,
-   LibreOfficeKitTileMode /*mode*/)
-{
-// set requested watermark size a little bit smaller than tile size
-int width = tileWidth * 0.9;
-int height = tileHeight * 0.9;
-
-const std::vector* pixmap = getPixmap(width, height);
-
-if (pixmap && tilePixmap)
-{
-// center watermark
-const int maxX = std::min(tileWidth, _width);
-const int maxY = 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4-0' - loleaflet/src test/httpwstest.cpp test/TileCacheTests.cpp test/TileQueueTests.cpp test/WhiteBoxTests.cpp wsd/ClientSe

2019-10-19 Thread Mert Tumer (via logerrit)
 loleaflet/src/control/Parts.js|2 
 loleaflet/src/layer/tile/GridLayer.js |2 
 test/TileCacheTests.cpp   |   85 +-
 test/TileQueueTests.cpp   |   58 +++
 test/WhiteBoxTests.cpp|   21 
 test/httpwstest.cpp   |6 +-
 wsd/ClientSession.cpp |3 -
 wsd/TileDesc.hpp  |   40 
 8 files changed, 123 insertions(+), 94 deletions(-)

New commits:
commit f2e4e260c2abb121e206b5b75f910c130751f3bd
Author: Mert Tumer 
AuthorDate: Mon Oct 14 01:11:19 2019 +0300
Commit: Andras Timar 
CommitDate: Sat Oct 19 20:13:39 2019 +0200

Extend TileDesc with normalizedViewId

Change-Id: I138dc9547c90eb44f86ca99b192af67fa9422b4b

Include nviewid to the tests with tile messages

Change-Id: I0b59e65648a402ccd136d13e5f00b52a1466f41c
Reviewed-on: https://gerrit.libreoffice.org/81049
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/loleaflet/src/control/Parts.js b/loleaflet/src/control/Parts.js
index c428408e7..3602962da 100644
--- a/loleaflet/src/control/Parts.js
+++ b/loleaflet/src/control/Parts.js
@@ -123,6 +123,7 @@ L.Map.include({
}
 
this._socket.sendMessage('tile ' +
+   'nviewid=0' + ' ' +
'part=' + part + ' ' +
'width=' + maxWidth * 
dpiscale + ' ' +
'height=' + maxHeight * 
dpiscale + ' ' +
@@ -147,6 +148,7 @@ L.Map.include({
var dpiscale = L.getDpiScaleFactor();
 
this._socket.sendMessage('tile ' +
+   'nviewid=0' + ' ' +
'part=' + part + ' ' +
'width=' + width * 
dpiscale + ' ' +
'height=' + height * 
dpiscale + ' ' +
diff --git a/loleaflet/src/layer/tile/GridLayer.js 
b/loleaflet/src/layer/tile/GridLayer.js
index 3fcbbbac5..55cb0263e 100644
--- a/loleaflet/src/layer/tile/GridLayer.js
+++ b/loleaflet/src/layer/tile/GridLayer.js
@@ -688,6 +688,7 @@ L.GridLayer = L.Layer.extend({
 
if (tilePositionsX !== '' && tilePositionsY !== '') {
var message = 'tilecombine ' +
+   'nviewid=0' + ' ' +
'part=' + this._selectedPart + ' ' +
'width=' + this._tileWidthPx + ' ' +
'height=' + this._tileHeightPx + ' ' +
@@ -1022,6 +1023,7 @@ L.GridLayer = L.Layer.extend({
 
twips = this._coordsToTwips(coords);
msg = 'tilecombine ' +
+   'nviewid=0' + ' ' +
'part=' + coords.part + ' ' +
'width=' + this._tileWidthPx + ' ' +
'height=' + this._tileHeightPx + ' ' +
diff --git a/test/TileCacheTests.cpp b/test/TileCacheTests.cpp
index 2b319c300..b6dda807f 100644
--- a/test/TileCacheTests.cpp
+++ b/test/TileCacheTests.cpp
@@ -185,6 +185,7 @@ void TileCacheTests::testSimple()
 // now, so it discards the cached data.
 TileCache tc("doc.ods", Poco::Timestamp(), "/tmp/tile_cache_tests", true);
 
+int nviewid = 0;
 int part = 0;
 int width = 256;
 int height = 256;
@@ -192,7 +193,7 @@ void TileCacheTests::testSimple()
 int tilePosY = 0;
 int tileWidth = 3840;
 int tileHeight = 3840;
-TileDesc tile(part, width, height, tilePosX, tilePosY, tileWidth, 
tileHeight, -1, 0, -1, false);
+TileDesc tile(nviewid, part, width, height, tilePosX, tilePosY, tileWidth, 
tileHeight, -1, 0, -1, false);
 
 // No Cache
 std::unique_ptr file = tc.lookupTile(tile);
@@ -226,13 +227,13 @@ void TileCacheTests::testSimpleCombine()
 // First.
 std::shared_ptr socket1 = loadDocAndGetSocket(_uri, 
documentURL, "simpleCombine-1 ");
 
-sendTextFrame(socket1, "tilecombine part=0 width=256 height=256 
tileposx=0,3840 tileposy=0,0 tilewidth=3840 tileheight=3840");
+sendTextFrame(socket1, "tilecombine nviewid=0 part=0 width=256 height=256 
tileposx=0,3840 tileposy=0,0 tilewidth=3840 tileheight=3840");
 
 std::vector tile1a = getResponseMessage(socket1, "tile:", testname);
 CPPUNIT_ASSERT_MESSAGE("did not receive a tile: message as expected", 
!tile1a.empty());
 std::vector tile1b = getResponseMessage(socket1, "tile:", testname);
 CPPUNIT_ASSERT_MESSAGE("did not receive a tile: message as expected", 
!tile1b.empty());
-sendTextFrame(socket1, "tilecombine part=0 width=256 height=256 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - 4 commits - common/Session.cpp common/Session.hpp kit/ChildSession.hpp kit/Kit.cpp kit/Watermark.hpp loleaflet/src test

2019-10-14 Thread Mert Tumer (via logerrit)
 common/Session.cpp|   16 ++
 common/Session.hpp|   11 +
 kit/ChildSession.hpp  |2 
 kit/Kit.cpp   |  204 --
 kit/Watermark.hpp |  180 ++
 loleaflet/src/control/Parts.js|2 
 loleaflet/src/core/Socket.js  |3 
 loleaflet/src/layer/tile/GridLayer.js |2 
 loleaflet/src/layer/tile/TileLayer.js |2 
 test/TileCacheTests.cpp   |   85 +++---
 test/TileQueueTests.cpp   |   58 -
 test/WhiteBoxTests.cpp|   21 +--
 test/httpwstest.cpp   |6 -
 wsd/ClientSession.cpp |   12 +-
 wsd/DocumentBroker.cpp|   13 +-
 wsd/DocumentBroker.hpp|2 
 wsd/TileCache.cpp |   25 ++--
 wsd/TileCache.hpp |8 -
 wsd/TileDesc.hpp  |   41 +-
 19 files changed, 398 insertions(+), 295 deletions(-)

New commits:
commit eb6064816b2f31e1bbc83f47162ae7ff632e53ca
Author: Mert Tumer 
AuthorDate: Mon Oct 14 00:45:59 2019 +0300
Commit: Mert Tumer 
CommitDate: Mon Oct 14 12:12:56 2019 +0300

Include nviewid to tests with tile messages

Change-Id: I8af803bd57cc0e3d0af510dcf6013c1658658678

diff --git a/test/TileCacheTests.cpp b/test/TileCacheTests.cpp
index b4ec0fa8d..7e2e6c9dd 100644
--- a/test/TileCacheTests.cpp
+++ b/test/TileCacheTests.cpp
@@ -185,6 +185,7 @@ void TileCacheTests::testSimple()
 // now, so it discards the cached data.
 TileCache tc("doc.ods", Poco::Timestamp());
 
+int nviewid=0;
 int part = 0;
 int width = 256;
 int height = 256;
@@ -192,7 +193,7 @@ void TileCacheTests::testSimple()
 int tilePosY = 0;
 int tileWidth = 3840;
 int tileHeight = 3840;
-TileDesc tile(part, width, height, tilePosX, tilePosY, tileWidth, 
tileHeight, -1, 0, -1, false);
+TileDesc tile(nviewid, part, width, height, tilePosX, tilePosY, tileWidth, 
tileHeight, -1, 0, -1, false);
 
 // No Cache
 TileCache::Tile tileData = tc.lookupTile(tile);
@@ -209,7 +210,7 @@ void TileCacheTests::testSimple()
 CPPUNIT_ASSERT_MESSAGE("cached tile corrupted", data == *tileData);
 
 // Invalidate Tiles
-tc.invalidateTiles("invalidatetiles: EMPTY");
+tc.invalidateTiles("invalidatetiles: EMPTY", nviewid);
 
 // No Cache
 tileData = tc.lookupTile(tile);
@@ -225,13 +226,13 @@ void TileCacheTests::testSimpleCombine()
 // First.
 std::shared_ptr socket1 = loadDocAndGetSocket(_uri, 
documentURL, "simpleCombine-1 ");
 
-sendTextFrame(socket1, "tilecombine part=0 width=256 height=256 
tileposx=0,3840 tileposy=0,0 tilewidth=3840 tileheight=3840");
+sendTextFrame(socket1, "tilecombine nviewid=0 part=0 width=256 height=256 
tileposx=0,3840 tileposy=0,0 tilewidth=3840 tileheight=3840");
 
 std::vector tile1a = getResponseMessage(socket1, "tile:", testname);
 CPPUNIT_ASSERT_MESSAGE("did not receive a tile: message as expected", 
!tile1a.empty());
 std::vector tile1b = getResponseMessage(socket1, "tile:", testname);
 CPPUNIT_ASSERT_MESSAGE("did not receive a tile: message as expected", 
!tile1b.empty());
-sendTextFrame(socket1, "tilecombine part=0 width=256 height=256 
tileposx=0,3840 tileposy=0,0 tilewidth=3840 tileheight=3840");
+sendTextFrame(socket1, "tilecombine nviewid=0 part=0 width=256 height=256 
tileposx=0,3840 tileposy=0,0 tilewidth=3840 tileheight=3840");
 
 tile1a = getResponseMessage(socket1, "tile:", testname);
 CPPUNIT_ASSERT_MESSAGE("did not receive a tile: message as expected", 
!tile1a.empty());
@@ -242,7 +243,7 @@ void TileCacheTests::testSimpleCombine()
 std::cerr << "Connecting second client." << std::endl;
 std::shared_ptr socket2 = loadDocAndGetSocket(_uri, 
documentURL, "simpleCombine-2 ", true);
 
-sendTextFrame(socket2, "tilecombine part=0 width=256 height=256 
tileposx=0,3840 tileposy=0,0 tilewidth=3840 tileheight=3840");
+sendTextFrame(socket2, "tilecombine nviewid=0 part=0 width=256 height=256 
tileposx=0,3840 tileposy=0,0 tilewidth=3840 tileheight=3840");
 
 std::vector tile2a = getResponseMessage(socket2, "tile:", testname);
 CPPUNIT_ASSERT_MESSAGE("did not receive a tile: message as expected", 
!tile2a.empty());
@@ -267,7 +268,7 @@ void TileCacheTests::testCancelTiles()
 std::shared_ptr socket = 
loadDocAndGetSocket("setclientpart.ods", _uri, testName);
 
 // Request a huge tile, and cancel immediately.
-sendTextFrame(socket, "tilecombine part=0 width=2560 height=2560 
tileposx=0 tileposy=0 tilewidth=38400 tileheight=38400");
+sendTextFrame(socket, "tilecombine nviewid=0 part=0 width=2560 
height=2560 tileposx=0 tileposy=0 tilewidth=38400 tileheight=38400");
 sendTextFrame(socket, "canceltiles");
 
 const auto res = getResponseString(socket, "tile:", testName, 1000);

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

2019-09-07 Thread Mert Tumer (via logerrit)
 sw/source/uibase/dialog/watermarkdialog.cxx |2 +-
 sw/source/uibase/inc/watermarkdialog.hxx|3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 4a439151f3b21b3381060d7c7e616f469e5f090f
Author: Mert Tumer 
AuthorDate: Fri Jan 18 00:52:23 2019 +0300
Commit: Aron Budea 
CommitDate: Sat Sep 7 08:14:52 2019 +0200

lok: Make the welded Watermark dialog work with dialog tunneling.

Change-Id: Ib5acd6fe4838aa09b74333c46cf38b9e0a926682
Signed-off-by: Mert Tumer 
Reviewed-on: https://gerrit.libreoffice.org/66555
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
(cherry picked from commit 2a1ea372daa12c0041d2c080a8fab33a6a87950d)
Reviewed-on: https://gerrit.libreoffice.org/78738
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/sw/source/uibase/dialog/watermarkdialog.cxx 
b/sw/source/uibase/dialog/watermarkdialog.cxx
index 378f20e2b9cb..a40977792873 100644
--- a/sw/source/uibase/dialog/watermarkdialog.cxx
+++ b/sw/source/uibase/dialog/watermarkdialog.cxx
@@ -20,7 +20,7 @@
 #include 
 
 SwWatermarkDialog::SwWatermarkDialog(weld::Window* pParent, SfxBindings& 
rBindings)
-: GenericDialogController(pParent, 
"modules/swriter/ui/watermarkdialog.ui", "WatermarkDialog")
+: SfxDialogController(pParent, "modules/swriter/ui/watermarkdialog.ui", 
"WatermarkDialog")
 , m_rBindings(rBindings)
 , m_xTextInput(m_xBuilder->weld_entry("TextInput"))
 , m_xOKButton(m_xBuilder->weld_button("ok"))
diff --git a/sw/source/uibase/inc/watermarkdialog.hxx 
b/sw/source/uibase/inc/watermarkdialog.hxx
index 65801fcba3a9..dff87a792a57 100644
--- a/sw/source/uibase/inc/watermarkdialog.hxx
+++ b/sw/source/uibase/inc/watermarkdialog.hxx
@@ -12,8 +12,9 @@
 #include 
 #include 
 #include 
+#include 
 
-class SwWatermarkDialog : public weld::GenericDialogController
+class SwWatermarkDialog : public SfxDialogController
 {
 public:
 SwWatermarkDialog(weld::Window* pParent, SfxBindings& rBindings);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

<    1   2