[Libreoffice-commits] online.git: Branch 'feature/lok_dialog' - 113 commits - bundled/include common/Crypto.cpp common/Crypto.hpp common/Message.hpp common/Seccomp.cpp common/Session.cpp common/Sessio

2019-12-06 Thread Pranav Kant (via logerrit)
Rebased ref, commits from common ancestor:
commit d7c81cf7c807bb4e2624a02bd304cb75a1924e78
Author: Pranav Kant 
AuthorDate: Wed Oct 25 00:10:45 2017 -0700
Commit: Pranav Kant 
CommitDate: Wed Oct 25 00:23:03 2017 -0700

factor out more code

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 34bcb5672..e19f33528 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -223,11 +223,11 @@ bool ClientSession::_handleInput(const char *buffer, int 
length)
 }
 else if (tokens[0] == "dialog")
 {
-return sendDialog(buffer, length, tokens, docBroker);
+return sendDialog(buffer, length, tokens, docBroker, false);
 }
 else if (tokens[0] == "dialogchild")
 {
-return sendDialogChild(buffer, length, tokens, docBroker);
+return sendDialog(buffer, length, tokens, docBroker, true);
 }
 else if (tokens[0] == "tilecombine")
 {
@@ -436,32 +436,20 @@ bool ClientSession::sendTile(const char * /*buffer*/, int 
/*length*/, const std:
 }
 
 bool ClientSession::sendDialog(const char * /*buffer*/, int /*length*/, const 
std::vector& tokens,
-   const std::shared_ptr& 
docBroker)
+   const std::shared_ptr& 
docBroker, bool child)
 {
+const std::string dialogCmd = child ? "dialogchild" : "dialog";
 try
 {
-docBroker->handleDialogRequest(tokens[1], shared_from_this());
-}
-catch (const std::exception& exc)
-{
-LOG_ERR("Failed to process dialog command: " << exc.what());
-return sendTextFrame("error: cmd=dialog kind=invalid");
-}
-
-return true;
-}
-
-bool ClientSession::sendDialogChild(const char * /*buffer*/, int /*length*/, 
const std::vector& tokens,
-const std::shared_ptr& 
docBroker)
-{
-try
-{
-docBroker->handleDialogChildRequest(tokens[1], shared_from_this());
+if (child)
+docBroker->handleDialogRequest(tokens[1], shared_from_this(), 
true);
+else
+docBroker->handleDialogRequest(tokens[1], shared_from_this(), 
false);
 }
 catch (const std::exception& exc)
 {
-LOG_ERR("Failed to process dialogchild command: " << exc.what());
-return sendTextFrame("error: cmd=dialogchild kind=invalid");
+LOG_ERR("Failed to process " + dialogCmd + " command: " << exc.what());
+return sendTextFrame("error: cmd=" + dialogCmd + " kind=invalid");
 }
 
 return true;
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index 48ea303b2..b16fe448b 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -125,9 +125,7 @@ private:
 bool sendTile(const char* buffer, int length, const 
std::vector& tokens,
   const std::shared_ptr& docBroker);
 bool sendDialog(const char* buffer, int length, const 
std::vector& tokens,
-const std::shared_ptr& docBroker);
-bool sendDialogChild(const char* buffer, int length, const 
std::vector& tokens,
- const std::shared_ptr& docBroker);
+const std::shared_ptr& docBroker, bool 
child);
 bool sendCombinedTiles(const char* buffer, int length, const 
std::vector& tokens,
const std::shared_ptr& docBroker);
 
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 56a8c5a49..76255287e 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -1077,11 +1077,11 @@ bool DocumentBroker::handleInput(const 
std::vector& payload)
 }
 else if (command == "dialogpaint:")
 {
-handleDialogPaintResponse(payload);
+handleDialogPaintResponse(payload, false);
 }
 else if (command == "dialogchildpaint:")
 {
-handleDialogChildPaintResponse(payload);
+handleDialogPaintResponse(payload, true);
 }
 else if (command == "errortoall:")
 {
@@ -1175,25 +1175,14 @@ void DocumentBroker::handleTileRequest(TileDesc& tile,
 }
 
 void DocumentBroker::handleDialogRequest(const std::string& dialogId,
- const std::shared_ptr& 
/*session*/)
+ const std::shared_ptr& 
/*session*/,
+ bool child)
 {
 assertCorrectThread();
 std::unique_lock lock(_mutex);
-
-LOG_DBG("Sending dialog render request for dialog " << dialogId);
-const std::string request = "dialog " + dialogId;
-_childProcess->sendTextFrame(request);
-}
-
-void DocumentBroker::handleDialogChildRequest(const std::string& dialogId,
-

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

2018-07-15 Thread Pranav Kant
 wsd/ClientSession.cpp |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 6f8b15dfa81f1146bc144e806e2de5273432ab43
Author: Pranav Kant 
Date:   Mon Jul 16 10:34:24 2018 +0530

wsd: missing include

Change-Id: I561db86b4b46f1cff0d9f0c744c556d9ec74291f

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 353b73263..0cd76c9f8 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -15,6 +15,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-28 Thread Pranav Kant
 loleaflet/src/layer/tile/TileLayer.js |4 +++-
 wsd/LOOLWSD.cpp   |   16 
 2 files changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 8156c2a8f13a61a65f7f9cc017c3a66d33ac7457
Author: Pranav Kant 
Date:   Wed Jun 27 19:53:25 2018 +0530

wsd: in case of multiple query param, handle &attachment= correctly

In case of integration with OC/NC, we have WOPISrc= as query param used
for load balancing. So, the earlier approach failed with integration.

Change-Id: Ib73f4f18eaec870dd53b67886b1b6016416a2e78
Reviewed-on: https://gerrit.libreoffice.org/56531
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 1f0d283ec..1a7cb886f 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -578,7 +578,9 @@ L.TileLayer = L.GridLayer.extend({
// due to a pdf.js issue - 
https://github.com/mozilla/pdf.js/issues/5397
// open the pdf file in a new tab so that that 
user can print it directly in the browser's
// pdf viewer
-   window.open(url + '?attachment=0', '_blank');
+   var param = wopiSrc !== '' ? '&' : '?';
+   param += 'attachment=0';
+   window.open(url + param, '_blank');
}
else {
this._map.fire('filedownloadready', {url: url});
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 25ec59258..b7a954869 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2210,15 +2210,23 @@ private:
 LOG_INF("HTTP request for: " << filePath.toString());
 if (filePath.isAbsolute() && File(filePath).exists())
 {
-int serveAsAttachment = 1;
-if (tokens.count() >= 7)
-getTokenInteger(tokens[6], "attachment", 
serveAsAttachment);
+const Poco::URI postRequestUri(request.getURI());
+const Poco::URI::QueryParameters postRequestQueryParams = 
postRequestUri.getQueryParameters();
+
+bool serveAsAttachment = true;
+const auto attachmentIt = 
std::find_if(postRequestQueryParams.begin(),
+   
postRequestQueryParams.end(),
+   [](const 
std::pair& element) {
+   return 
element.first == "attachment";
+   });
+if (attachmentIt != postRequestQueryParams.end())
+serveAsAttachment = attachmentIt->second != "0";
 
 // Instruct browsers to download the file, not display it
 // with the exception of SVG where we need the browser to
 // actually show it.
 std::string contentType = getContentType(fileName);
-if (serveAsAttachment != 0 && contentType != "image/svg+xml")
+if (serveAsAttachment && contentType != "image/svg+xml")
 response.set("Content-Disposition", "attachment; 
filename=\"" + fileName + "\"");
 
 try
___
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-3' - loleaflet/src wsd/LOOLWSD.cpp

2018-06-28 Thread Pranav Kant
 loleaflet/src/layer/tile/TileLayer.js |4 +++-
 wsd/LOOLWSD.cpp   |   16 
 2 files changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 2faf8f590b2e1d394188d035ab713ac021473da6
Author: Pranav Kant 
Date:   Wed Jun 27 19:53:25 2018 +0530

wsd: in case of multiple query param, handle &attachment= correctly

In case of integration with OC/NC, we have WOPISrc= as query param used
for load balancing. So, the earlier approach failed with integration.

Change-Id: Ib73f4f18eaec870dd53b67886b1b6016416a2e78
Reviewed-on: https://gerrit.libreoffice.org/56533
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 711eb2ef9..35d33fd1d 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -566,7 +566,9 @@ L.TileLayer = L.GridLayer.extend({
// due to a pdf.js issue - 
https://github.com/mozilla/pdf.js/issues/5397
// open the pdf file in a new tab so that that 
user can print it directly in the browser's
// pdf viewer
-   window.open(url + '?attachment=0', '_blank');
+   var param = wopiSrc !== '' ? '&' : '?';
+   param += 'attachment=0';
+   window.open(url + param, '_blank');
}
else {
this._map.fire('filedownloadready', {url: url});
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 48e915ab8..ee4f83b2a 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2163,15 +2163,23 @@ private:
 LOG_INF("HTTP request for: " << filePath.toString());
 if (filePath.isAbsolute() && File(filePath).exists())
 {
-int serveAsAttachment = 1;
-if (tokens.count() >= 7)
-getTokenInteger(tokens[6], "attachment", 
serveAsAttachment);
+const Poco::URI postRequestUri(request.getURI());
+const Poco::URI::QueryParameters postRequestQueryParams = 
postRequestUri.getQueryParameters();
+
+bool serveAsAttachment = true;
+const auto attachmentIt = 
std::find_if(postRequestQueryParams.begin(),
+   
postRequestQueryParams.end(),
+   [](const 
std::pair& element) {
+   return 
element.first == "attachment";
+   });
+if (attachmentIt != postRequestQueryParams.end())
+serveAsAttachment = attachmentIt->second != "0";
 
 // Instruct browsers to download the file, not display it
 // with the exception of SVG where we need the browser to
 // actually show it.
 std::string contentType = getContentType(fileName);
-if (serveAsAttachment != 0 && contentType != "image/svg+xml")
+if (serveAsAttachment && contentType != "image/svg+xml")
 response.set("Content-Disposition", "attachment; 
filename=\"" + fileName + "\"");
 
 try
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-30 Thread Pranav Kant
 loleaflet/src/control/Control.AlertDialog.js |   13 -
 loleaflet/src/layer/tile/TileLayer.js|5 -
 wsd/LOOLWSD.cpp  |6 +-
 3 files changed, 9 insertions(+), 15 deletions(-)

New commits:
commit 2e21cf5dcdf97d81223711ecae34022f5cabbbd5
Author: Pranav Kant 
Date:   Mon May 28 16:33:04 2018 +0530

loleaflet: Open pdf file in new tab instead of asking to download

new parameter to download POST requests, ?attachment=0 to instruct wsd
to not set the Content-Disposition header.

Change-Id: Id7694d940e1b4d616263ad720d29f1474164eb68
Reviewed-on: https://gerrit.libreoffice.org/54918
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.AlertDialog.js 
b/loleaflet/src/control/Control.AlertDialog.js
index 1d9b9e48c..a87b494f3 100644
--- a/loleaflet/src/control/Control.AlertDialog.js
+++ b/loleaflet/src/control/Control.AlertDialog.js
@@ -8,7 +8,6 @@ L.Control.AlertDialog = L.Control.extend({
// TODO: Better distinction between warnings and errors
map.on('error', this._onError, this);
map.on('warn', this._onError, this);
-   map.on('print', this._onPrint, this);
},
 
_onError: function(e) {
@@ -33,18 +32,6 @@ L.Control.AlertDialog = L.Control.extend({
 
// Remember the current dialog ID to close it later.
vex.dialogID = vex.globalID - 1;
-   },
-
-   _onPrint: function (e) {
-   var url = e.url;
-   vex.dialog.confirm({
-   message: _('Download PDF export?'),
-   callback: L.bind(function (value) {
-   if (value) {
-   this._map._fileDownloader.src = url;
-   }
-   }, this)
-   });
}
 });
 
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 4b04d1ebf..39586c155 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -572,7 +572,10 @@ L.TileLayer = L.GridLayer.extend({
if (command.id === 'print') {
if (L.Browser.gecko || L.Browser.edge || 
this._map.options.print === false) {
// the print dialog doesn't work well on firefox
-   this._map.fire('print', {url: url});
+   // due to a pdf.js issue - 
https://github.com/mozilla/pdf.js/issues/5397
+   // open the pdf file in a new tab so that that 
user can print it directly in the browser's
+   // pdf viewer
+   window.open(url + '?attachment=0', '_blank');
}
else {
this._map.fire('filedownloadready', {url: url});
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index d7cb6a473..3bc6d73e6 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2215,11 +2215,15 @@ private:
 LOG_INF("HTTP request for: " << filePath.toString());
 if (filePath.isAbsolute() && File(filePath).exists())
 {
+int serveAsAttachment = 1;
+if (tokens.count() >= 7)
+getTokenInteger(tokens[6], "attachment", 
serveAsAttachment);
+
 // Instruct browsers to download the file, not display it
 // with the exception of SVG where we need the browser to
 // actually show it.
 std::string contentType = getContentType(fileName);
-if (contentType != "image/svg+xml")
+if (serveAsAttachment != 0 && contentType != "image/svg+xml")
 response.set("Content-Disposition", "attachment; 
filename=\"" + fileName + "\"");
 
 try
___
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-3' - loleaflet/src wsd/LOOLWSD.cpp

2018-05-29 Thread Pranav Kant
 loleaflet/src/control/Control.AlertDialog.js |   13 -
 loleaflet/src/layer/tile/TileLayer.js|5 -
 wsd/LOOLWSD.cpp  |6 +-
 3 files changed, 9 insertions(+), 15 deletions(-)

New commits:
commit 309e53cba404301407ef5b1851c52090565fd7f2
Author: Pranav Kant 
Date:   Mon May 28 16:33:04 2018 +0530

loleaflet: Open pdf file in new tab instead of asking to download

new parameter to download POST requests, ?attachment=0 to instruct wsd
to not set the Content-Disposition header.

Change-Id: Id7694d940e1b4d616263ad720d29f1474164eb68
Reviewed-on: https://gerrit.libreoffice.org/54919
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.AlertDialog.js 
b/loleaflet/src/control/Control.AlertDialog.js
index 1d9b9e48c..a87b494f3 100644
--- a/loleaflet/src/control/Control.AlertDialog.js
+++ b/loleaflet/src/control/Control.AlertDialog.js
@@ -8,7 +8,6 @@ L.Control.AlertDialog = L.Control.extend({
// TODO: Better distinction between warnings and errors
map.on('error', this._onError, this);
map.on('warn', this._onError, this);
-   map.on('print', this._onPrint, this);
},
 
_onError: function(e) {
@@ -33,18 +32,6 @@ L.Control.AlertDialog = L.Control.extend({
 
// Remember the current dialog ID to close it later.
vex.dialogID = vex.globalID - 1;
-   },
-
-   _onPrint: function (e) {
-   var url = e.url;
-   vex.dialog.confirm({
-   message: _('Download PDF export?'),
-   callback: L.bind(function (value) {
-   if (value) {
-   this._map._fileDownloader.src = url;
-   }
-   }, this)
-   });
}
 });
 
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 49aa853c6..ebf953302 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -560,7 +560,10 @@ L.TileLayer = L.GridLayer.extend({
if (command.id === 'print') {
if (L.Browser.gecko || L.Browser.edge || 
this._map.options.print === false) {
// the print dialog doesn't work well on firefox
-   this._map.fire('print', {url: url});
+   // due to a pdf.js issue - 
https://github.com/mozilla/pdf.js/issues/5397
+   // open the pdf file in a new tab so that that 
user can print it directly in the browser's
+   // pdf viewer
+   window.open(url + '?attachment=0', '_blank');
}
else {
this._map.fire('filedownloadready', {url: url});
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 4831aea33..3b645fe8f 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2166,11 +2166,15 @@ private:
 LOG_INF("HTTP request for: " << filePath.toString());
 if (filePath.isAbsolute() && File(filePath).exists())
 {
+int serveAsAttachment = 1;
+if (tokens.count() >= 7)
+getTokenInteger(tokens[6], "attachment", 
serveAsAttachment);
+
 // Instruct browsers to download the file, not display it
 // with the exception of SVG where we need the browser to
 // actually show it.
 std::string contentType = getContentType(fileName);
-if (contentType != "image/svg+xml")
+if (serveAsAttachment != 0 && contentType != "image/svg+xml")
 response.set("Content-Disposition", "attachment; 
filename=\"" + fileName + "\"");
 
 try
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: 8 commits - loleaflet/css loleaflet/images loleaflet/js

2018-05-25 Thread Pranav Kant
-predefined-process.svg|6 
 loleaflet/images/lc_flowchartshapes.flowchart-preparation.svg   |6 
 loleaflet/images/lc_flowchartshapes.flowchart-sequential-access.svg |6 
 loleaflet/images/lc_flowchartshapes.flowchart-sort.svg  |6 
 loleaflet/images/lc_flowchartshapes.flowchart-stored-data.svg   |6 
 loleaflet/images/lc_flowchartshapes.flowchart-summing-junction.svg  |6 
 loleaflet/images/lc_flowchartshapes.flowchart-terminator.svg|6 
 loleaflet/images/lc_flowchartshapes.svg |   10 
 loleaflet/images/lc_starshapes.bang.svg |6 
 loleaflet/images/lc_starshapes.concave-star6.svg|6 
 loleaflet/images/lc_starshapes.doorplate.svg|6 
 loleaflet/images/lc_starshapes.horizontal-scroll.svg|6 
 loleaflet/images/lc_starshapes.signet.svg   |6 
 loleaflet/images/lc_starshapes.star12.svg   |6 
 loleaflet/images/lc_starshapes.star24.svg   |6 
 loleaflet/images/lc_starshapes.star4.svg|6 
 loleaflet/images/lc_starshapes.star5.svg|6 
 loleaflet/images/lc_starshapes.star6.svg|6 
 loleaflet/images/lc_starshapes.star8.svg|6 
 loleaflet/images/lc_starshapes.svg  |6 
 loleaflet/images/lc_starshapes.vertical-scroll.svg  |6 
 loleaflet/images/lc_symbolshapes.brace-pair.svg |6 
 loleaflet/images/lc_symbolshapes.bracket-pair.svg   |6 
 loleaflet/images/lc_symbolshapes.cloud.svg  |6 
 loleaflet/images/lc_symbolshapes.diamond-bevel.svg  |   10 
 loleaflet/images/lc_symbolshapes.flower.svg |6 
 loleaflet/images/lc_symbolshapes.forbidden.svg  |6 
 loleaflet/images/lc_symbolshapes.heart.svg  |6 
 loleaflet/images/lc_symbolshapes.left-brace.svg |6 
 loleaflet/images/lc_symbolshapes.left-bracket.svg   |6 
 loleaflet/images/lc_symbolshapes.lightning.svg  |6 
 loleaflet/images/lc_symbolshapes.moon.svg   |6 
 loleaflet/images/lc_symbolshapes.octagon-bevel.svg  |   10 
 loleaflet/images/lc_symbolshapes.puzzle.svg |6 
 loleaflet/images/lc_symbolshapes.quad-bevel.svg |   10 
 loleaflet/images/lc_symbolshapes.right-brace.svg|6 
 loleaflet/images/lc_symbolshapes.right-bracket.svg  |6 
 loleaflet/images/lc_symbolshapes.sun.svg|6 
 loleaflet/images/lc_symbolshapes.svg|6 
 loleaflet/js/toolbar.js |  215 
+++---
 101 files changed, 899 insertions(+), 60 deletions(-)

New commits:
commit 8d98465e76bfa9234ce4d6e67d4778f04b8fafab
Author: Pranav Kant 
Date:   Fri May 25 16:29:30 2018 +0530

loleaflet shapes: increase width of the rows to 10

... so that we can accomodate more shapes without overflowing the height
of the screen.

Change-Id: I82802224e88819df65ea60fb87e70df4f1f06e01

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 6c08d655c..b9fdee9aa 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -444,7 +444,7 @@ var shapes = {
 };
 
 function insertShapes() {
-   var width = 6;
+   var width = 10;
var $grid = $('.insertshape-grid');
 
if ($grid.children().size() > 0)
commit 12eaff0f79016e70438549973fc6634d75e03907
Author: Pranav Kant 
Date:   Fri May 25 16:25:48 2018 +0530

loleaflet: Add flowchart shapes

Couldn't find svg images for 8 flowchart shapes. The command works for
them but no icon is currently shown in the toolbar.

Change-Id: I0a992d51f01064f04b26b90adcdfd29515a77f6a

diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css
index 12fec9937..7eb36e655 100644
--- a/loleaflet/css/toolbar.css
+++ b/loleaflet/css/toolbar.css
@@ -351,6 +351,39 @@ button.leaflet-control-search-next
 .w2ui-icon.calloutshapes_line-callout-2 { background: 
url('images/lc_calloutshapes.line-callout-2.svg') no-repeat center !important; }
 .w2ui-icon.calloutshapes_line-callout-3 { background: 
url('images/lc_calloutshapes.line-callout-3.svg') no-repeat center !important; }
 
+.w2ui-icon.flowchartshapes_flowchart-process { background: 
url('images/lc_flowchartshapes.flowchart-process.svg') no-repeat center 
!important; }
+.w2ui-

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

2018-05-24 Thread Pranav Kant
 loleaflet/src/core/Socket.js |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit e359480dac7e03cda7dee6dc726184d573d93ffd
Author: Pranav Kant 
Date:   Wed May 2 23:19:48 2018 +0530

loleaflet: close previous socket before connecting new one

It's possible otherwise in some scenarios that multiple sockets are
created in one browser tab while there should only be one for one
browser tab.

Change-Id: I242ba62effee24c4ab04367001459448b4ff5817
Reviewed-on: https://gerrit.libreoffice.org/53749
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 
(cherry picked from commit 088658807ac2340344ffdabaec42885b15b8f62b)
Reviewed-on: https://gerrit.libreoffice.org/53780
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 7bd33617a..f24599774 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -34,6 +34,9 @@ L.Socket = L.Class.extend({
 
var websocketURI = map.options.server + '/lool/' + 
encodeURIComponent(map.options.doc + '?' + $.param(map.options.docParams)) + 
'/ws' + wopiSrc;
try {
+   if (this.socket) {
+   this.close();
+   }
this.socket = new WebSocket(websocketURI);
} catch (e) {
this._map.fire('error', {msg: _('Oops, there is a 
problem connecting to LibreOffice Online : ').replace('LibreOffice Online', 
(typeof brandProductName !== 'undefined' ? brandProductName : 'LibreOffice 
Online')) + _('Cannot create websocket, please restart your browser.'), cmd: 
'socket', kind: 'failed', id: 3});
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/css loleaflet/images loleaflet/js

2018-05-22 Thread Pranav Kant
 loleaflet/css/toolbar.css  |   50 
 loleaflet/images/lc_basicshapes.block-arc.svg  |1 
 loleaflet/images/lc_basicshapes.can.svg|1 
 loleaflet/images/lc_basicshapes.circle-pie.svg |1 
 loleaflet/images/lc_basicshapes.circle.svg |1 
 loleaflet/images/lc_basicshapes.cross.svg  |1 
 loleaflet/images/lc_basicshapes.cube.svg   |1 
 loleaflet/images/lc_basicshapes.diamond.svg|1 
 loleaflet/images/lc_basicshapes.ellipse.svg|1 
 loleaflet/images/lc_basicshapes.frame.svg  |1 
 loleaflet/images/lc_basicshapes.hexagon.svg|1 
 loleaflet/images/lc_basicshapes.isosceles-triangle.svg |1 
 loleaflet/images/lc_basicshapes.octagon.svg|1 
 loleaflet/images/lc_basicshapes.paper.svg  |1 
 loleaflet/images/lc_basicshapes.parallelogram.svg  |1 
 loleaflet/images/lc_basicshapes.pentagon.svg   |1 
 loleaflet/images/lc_basicshapes.quadrat.svg|1 
 loleaflet/images/lc_basicshapes.rectangle.svg  |1 
 loleaflet/images/lc_basicshapes.right-triangle.svg |1 
 loleaflet/images/lc_basicshapes.ring.svg   |1 
 loleaflet/images/lc_basicshapes.round-quadrat.svg  |1 
 loleaflet/images/lc_basicshapes.round-rectangle.svg|1 
 loleaflet/images/lc_basicshapes.trapezoid.svg  |1 
 loleaflet/js/toolbar.js|   66 +
 24 files changed, 138 insertions(+)

New commits:
commit 348fbe840bb0ec405009de86a003469226e1ff2b
Author: Pranav Kant 
Date:   Tue May 22 14:09:11 2018 +0530

loleaflet: New shape toolbar popup

Change-Id: Idc61230d26b2933f9ba1b9ec78bada55a0ef2698
Reviewed-on: https://gerrit.libreoffice.org/54659
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css
index cc69a1d94..9dfa8bbb4 100644
--- a/loleaflet/css/toolbar.css
+++ b/loleaflet/css/toolbar.css
@@ -256,6 +256,29 @@ button.leaflet-control-search-next
 border-style: solid;
 }
 
+.w2ui-icon.basicshapes_rectangle { background: 
url('images/lc_basicshapes.rectangle.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_round-rectangle { background: 
url('images/lc_basicshapes.round-rectangle.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_quadrat { background: 
url('images/lc_basicshapes.quadrat.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_round-quadrat { background: 
url('images/lc_basicshapes.round-quadrat.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_circle { background: 
url('images/lc_basicshapes.circle.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_ellipse { background: 
url('images/lc_basicshapes.ellipse.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_circle-pie { background: 
url('images/lc_basicshapes.circle-pie.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_isosceles-triangle { background: 
url('images/lc_basicshapes.isosceles-triangle.svg') no-repeat center 
!important; }
+.w2ui-icon.basicshapes_right-triangle { background: 
url('images/lc_basicshapes.right-triangle.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_trapezoid { background: 
url('images/lc_basicshapes.trapezoid.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_diamond { background: 
url('images/lc_basicshapes.diamond.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_parallelogram { background: 
url('images/lc_basicshapes.parallelogram.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_pentagon { background: 
url('images/lc_basicshapes.pentagon.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_hexagon { background: 
url('images/lc_basicshapes.hexagon.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_octagon { background: 
url('images/lc_basicshapes.octagon.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_cross { background: 
url('images/lc_basicshapes.cross.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_ring { background: 
url('images/lc_basicshapes.ring.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_block-arc { background: 
url('images/lc_basicshapes.block-arc.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_can { background: url('images/lc_basicshapes.can.svg') 
no-repeat center !important; }
+.w2ui-icon.basicshapes_cube { background: 
url('images/lc_basicshapes.cube.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_paper { background: 
url('images/lc_basicshapes.paper.svg') no-repeat center !important; }
+.w2ui-icon.basicshapes_frame { b

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

2018-05-21 Thread Pranav Kant
 loleaflet/css/loleaflet.css|4 
 loleaflet/src/control/Control.LokDialog.js |8 +++-
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 32eff8dd6b15df9f541e2988a596876c95f45e84
Author: Pranav Kant 
Date:   Tue Mar 27 15:13:41 2018 +0200

lokdialog: Don't show the title bar when no title was provided.

Change-Id: If08dc81e88d35a924d10695a38b138f6403e58bd
Reviewed-on: https://gerrit.libreoffice.org/51955
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css
index eae3e4f63..bcaf442f5 100644
--- a/loleaflet/css/loleaflet.css
+++ b/loleaflet/css/loleaflet.css
@@ -347,6 +347,10 @@ body {
text-indent: 1px;
 }
 
+.lokdialog_container.lokdialog_notitle .ui-dialog-titlebar {
+   display: none;
+}
+
 .lokdialog_container.ui-dialog.ui-widget-content {
padding: 0px;
overflow: visible;
diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 19e936970..61c73abbc 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -246,6 +246,10 @@ L.Control.LokDialog = L.Control.extend({
 
L.DomEvent.on(dialogCanvas, 'contextmenu', 
L.DomEvent.preventDefault);
 
+   var dialogClass = 'lokdialog_container';
+   if (!title)
+   dialogClass += ' lokdialog_notitle';
+
var that = this;
$(dialogContainer).dialog({
minWidth: width,
@@ -254,7 +258,7 @@ L.Control.LokDialog = L.Control.extend({
modal: false,
closeOnEscape: true,
resizable: false,
-   dialogClass: 'lokdialog_container',
+   dialogClass: dialogClass,
close: function() {
that._onDialogClose(that._toRawDlgId(strDlgId), 
true);
}
commit a35def2f74c8cef11171c9065960dc3b6fdc2fbe
Author: Pranav Kant 
Date:   Thu Jan 18 12:27:52 2018 +0530

loleaflet: No native contextmenu options on dialog canvas

Dialogs can have their own context menu invoked upon right click. And
they already works (i.e. are tunneled properly); so, let's use them.

Change-Id: I7d504923c272227dca94058995456d89e1079c29
(cherry picked from commit 63e089ec22150524d040f544538f8455e62a1887)
Reviewed-on: https://gerrit.libreoffice.org/48087
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 4dfb1ed4f..19e936970 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -244,6 +244,8 @@ L.Control.LokDialog = L.Control.extend({
dialogCanvas.height = height;
dialogCanvas.id = strDlgId + '-canvas';
 
+   L.DomEvent.on(dialogCanvas, 'contextmenu', 
L.DomEvent.preventDefault);
+
var that = this;
$(dialogContainer).dialog({
minWidth: width,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-02 Thread Pranav Kant
 loleaflet/src/core/Socket.js |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 088658807ac2340344ffdabaec42885b15b8f62b
Author: Pranav Kant 
Date:   Wed May 2 23:19:48 2018 +0530

loleaflet: close previous socket before connecting new one

It's possible otherwise in some scenarios that multiple sockets are
created in one browser tab while there should only be one for one
browser tab.

Change-Id: I242ba62effee24c4ab04367001459448b4ff5817
Reviewed-on: https://gerrit.libreoffice.org/53749
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 4275a3d7c..edb1c2435 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -34,6 +34,9 @@ L.Socket = L.Class.extend({
 
var websocketURI = map.options.server + '/lool/' + 
encodeURIComponent(map.options.doc + '?' + $.param(map.options.docParams)) + 
'/ws' + wopiSrc;
try {
+   if (this.socket) {
+   this.close();
+   }
this.socket = new WebSocket(websocketURI);
} catch (e) {
this._map.fire('error', {msg: _('Oops, there is a 
problem connecting to LibreOffice Online : ').replace('LibreOffice Online', 
(typeof brandProductName !== 'undefined' ? brandProductName : 'LibreOffice 
Online')) + _('Cannot create websocket, please restart your browser.'), cmd: 
'socket', kind: 'failed', id: 3});
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-02 Thread Pranav Kant
 loleaflet/dist/menubar.css   |2 --
 loleaflet/dist/toolbar.css   |7 +++
 loleaflet/src/control/Control.Menubar.js |   12 
 3 files changed, 3 insertions(+), 18 deletions(-)

New commits:
commit 8f6df703334fe98daa2f8bcd4956690e85ccab02
Author: Pranav Kant 
Date:   Wed May 2 23:05:54 2018 +0530

Revert "loleaflet: move document-name-input in menubar"

The overflow: hidden is problematic here as popping out of menus from
the menubar also stops working due to this.

This reverts commit a9c053fba46ce026d8c06bf23ff9a2abcb1222ee.

Change-Id: I5d86a38ff48c7ceced56592ab32a2e554f4b2e4f

diff --git a/loleaflet/dist/menubar.css b/loleaflet/dist/menubar.css
index cfdb8baf1..f192eacbf 100644
--- a/loleaflet/dist/menubar.css
+++ b/loleaflet/dist/menubar.css
@@ -2,8 +2,6 @@
 top: 39px;
 height: 25px;
 padding-left: 125px;
-padding-right: 32px; /* for: the red close button on the right */
-overflow: hidden;
 z-index: 1000;
 outline: none;
 background-color: transparent;
diff --git a/loleaflet/dist/toolbar.css b/loleaflet/dist/toolbar.css
index 0444312a2..d56b809a2 100644
--- a/loleaflet/dist/toolbar.css
+++ b/loleaflet/dist/toolbar.css
@@ -79,14 +79,13 @@ w2ui-toolbar {
 }
 
 #document-name-input {
+position: fixed;
 z-index: 1050;
+right: 35px;
 top: 2px;
 width: 200px;
-font-size: 14px;
+font-size: 16px;
 padding-right: 20px;
-padding-top: 6px;
-padding-bottom: 5px;
-padding-left: 5px;
 border: 1px solid transparent;
 background-color: transparent;
 }
diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 86849ad11..d6ec74ca8 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -503,16 +503,6 @@ L.Control.Menubar = L.Control.extend({
}
},
 
-   _addAfterElements: function() {
-   var elemLi = L.DomUtil.create('li', '', this._menubarCont);
-   L.DomUtil.setStyle(elemLi, 'float', 'right');
-
-   // move document-name-input element to menubar
-   var elem = L.DomUtil.get('document-name-input');
-   L.DomUtil.remove(elem);
-   elemLi.appendChild(elem);
-   },
-
_onDocLayerInit: function() {
// clear initial menu
while (this._menubarCont.hasChildNodes()) {
@@ -529,8 +519,6 @@ L.Control.Menubar = L.Control.extend({
this._initializeMenu(this.options.presentation);
}
 
-   this._addAfterElements();
-
// initialize menubar plugin
$('#main-menu').smartmenus({
hideOnClick: true,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-30 Thread Pranav Kant
 loleaflet/dist/menubar.css   |2 ++
 loleaflet/dist/toolbar.css   |7 ---
 loleaflet/src/control/Control.Menubar.js |   12 
 3 files changed, 18 insertions(+), 3 deletions(-)

New commits:
commit a9c053fba46ce026d8c06bf23ff9a2abcb1222ee
Author: Pranav Kant 
Date:   Mon Apr 30 21:56:09 2018 +0530

loleaflet: move document-name-input in menubar

... so that it doesn't overlap with the menu items when the width of the
screen is reduced.

Change-Id: Ib1b2b18c631ed1c76b8807f6e3103e8eddd88efb
Reviewed-on: https://gerrit.libreoffice.org/53670
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/loleaflet/dist/menubar.css b/loleaflet/dist/menubar.css
index f192eacbf..cfdb8baf1 100644
--- a/loleaflet/dist/menubar.css
+++ b/loleaflet/dist/menubar.css
@@ -2,6 +2,8 @@
 top: 39px;
 height: 25px;
 padding-left: 125px;
+padding-right: 32px; /* for: the red close button on the right */
+overflow: hidden;
 z-index: 1000;
 outline: none;
 background-color: transparent;
diff --git a/loleaflet/dist/toolbar.css b/loleaflet/dist/toolbar.css
index d56b809a2..0444312a2 100644
--- a/loleaflet/dist/toolbar.css
+++ b/loleaflet/dist/toolbar.css
@@ -79,13 +79,14 @@ w2ui-toolbar {
 }
 
 #document-name-input {
-position: fixed;
 z-index: 1050;
-right: 35px;
 top: 2px;
 width: 200px;
-font-size: 16px;
+font-size: 14px;
 padding-right: 20px;
+padding-top: 6px;
+padding-bottom: 5px;
+padding-left: 5px;
 border: 1px solid transparent;
 background-color: transparent;
 }
diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index d6ec74ca8..86849ad11 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -503,6 +503,16 @@ L.Control.Menubar = L.Control.extend({
}
},
 
+   _addAfterElements: function() {
+   var elemLi = L.DomUtil.create('li', '', this._menubarCont);
+   L.DomUtil.setStyle(elemLi, 'float', 'right');
+
+   // move document-name-input element to menubar
+   var elem = L.DomUtil.get('document-name-input');
+   L.DomUtil.remove(elem);
+   elemLi.appendChild(elem);
+   },
+
_onDocLayerInit: function() {
// clear initial menu
while (this._menubarCont.hasChildNodes()) {
@@ -519,6 +529,8 @@ L.Control.Menubar = L.Control.extend({
this._initializeMenu(this.options.presentation);
}
 
+   this._addAfterElements();
+
// initialize menubar plugin
$('#main-menu').smartmenus({
hideOnClick: true,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-30 Thread Pranav Kant
 loleaflet/dist/loleaflet.css |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 642fb34e2f1ec8c7f5ac804eacb4a78aefa517a0
Author: Pranav Kant 
Date:   Mon Apr 30 12:44:27 2018 +0530

loleaflet: Allow resizing on comment input field

Change-Id: I60db186a6535bc6b2b53e8e0d0933bfddea970ba
Reviewed-on: https://gerrit.libreoffice.org/53645
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index 6efbb963c..4a5e86ced 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -207,7 +207,6 @@ body {
font-family: "Segoe UI", Tahoma, Arial, Helvetica, sans-serif 
!important;
font-size: 13px;
border: 1px solid #c8c8c8;
-   resize: none;
background-color: white;
overflow-x: hidden;
height: 50px;
___
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-2-1' - loleaflet/dist

2018-04-18 Thread Pranav Kant
 loleaflet/dist/loleaflet.css |1 +
 1 file changed, 1 insertion(+)

New commits:
commit e7fb7202cba67069b002266a36c29ddc28eeb558
Author: Pranav Kant 
Date:   Sat Feb 24 14:56:51 2018 +0530

loleaflet: Keep the cursor 'default' by default

Change-Id: I88e18f7ce08612837dd99df3f9d08b4561007371
Reviewed-on: https://gerrit.libreoffice.org/50275
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 
(cherry picked from commit fb22b1d97ff14fea4731c37a8e4807b88c7b59ee)
Signed-off-by: Andras Timar 

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index a0604c5f2..ef8b0f5b2 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -28,6 +28,7 @@
left: 0px;
right: 0px;
z-index: 10;
+   cursor: default;
 }
 
 .scroll-container .mCSB_scrollTools.mCSB_1_scrollbar {
___
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-3' - 2 commits - loleaflet/src

2018-04-03 Thread Pranav Kant
 loleaflet/src/core/LOUtil.js |7 +++
 loleaflet/src/core/Socket.js |   34 --
 loleaflet/src/map/Map.js |8 +++-
 3 files changed, 42 insertions(+), 7 deletions(-)

New commits:
commit 300b254db1926ac50cc718c7503f7d89e4a37fa2
Author: Pranav Kant 
Date:   Fri Mar 30 19:26:55 2018 +0530

Ask to save unsaved changes to a new file

... when document is changed externally.

Change-Id: Ieaad5f0ed5cd4ee3bf5385f2a5cd297b7758a43e
Reviewed-on: https://gerrit.libreoffice.org/52156
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/core/LOUtil.js b/loleaflet/src/core/LOUtil.js
index 286f2fa4e..fad8ad527 100644
--- a/loleaflet/src/core/LOUtil.js
+++ b/loleaflet/src/core/LOUtil.js
@@ -78,5 +78,12 @@ L.LOUtil = {
}
}
return rectangles;
+   },
+
+   /// oldFileName = Example.odt, suffix = new
+   /// returns: Example_new.odt
+   generateNewFileName: function(oldFileName, suffix) {
+   var idx = oldFileName.lastIndexOf('.');
+   return oldFileName.substring(0, idx) + suffix + 
oldFileName.substring(idx);
}
 };
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index d75c985ab..ce05a4a6d 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -433,21 +433,41 @@ L.Socket = L.Class.extend({
vex.close(id);
}
 
-   vex.dialog.confirm({
-   message: _('Document has been changed 
in storage. Do you want to discard your changes, and load the document from the 
storage?'),
+   vex.dialog.open({
+   message: _('Document has been changed 
in storage. What would you like to do with your unsaved changes?'),
escapeButtonCloses: false,
overlayClosesOnClick: false,
+   contentCSS: { width: '600px' },
buttons: [
-   $.extend({}, 
vex.dialog.buttons.YES, { text: _('Discard changes') }),
-   $.extend({}, 
vex.dialog.buttons.NO, { text: _('Overwrite document') })
+   $.extend({}, 
vex.dialog.buttons.YES, { text: _('Discard'),
+   
  click: function($vexContent) {
+   
  $vexContent.data().vex.value = 'discard';
+   
  vex.close($vexContent.data().vex.id);
+   
  }}),
+   $.extend({}, 
vex.dialog.buttons.YES, { text: _('Overwrite'),
+   
  click: function($vexContent) {
+   
  $vexContent.data().vex.value = 'overwrite';
+   
  vex.close($vexContent.data().vex.id);
+   
  }}),
+   $.extend({}, 
vex.dialog.buttons.YES, { text: _('Save to new file'),
+   
  click: function($vexContent) {
+   
  $vexContent.data().vex.value = 'saveas';
+   
  vex.close($vexContent.data().vex.id);
+   
  }})
],
callback: L.bind(function(value) {
-   if (value) {
+   if (value === 'discard') {
// They want to refresh 
the page and load document again for all

this.sendMessage('closedocument');
-   } else {
+  

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

2018-03-30 Thread Pranav Kant
 loleaflet/src/core/Socket.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2f620c3a3103248286c8f81d7111a3f3191bb5dd
Author: Pranav Kant 
Date:   Fri Mar 30 19:49:11 2018 +0530

600px is enough

Change-Id: Iff6036a708b2109e79ba57ef2766168e6e8cad57

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 9604131f3..2458fadc7 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -439,7 +439,7 @@ L.Socket = L.Class.extend({
message: _('Document has been changed 
in storage. What would you like to do with your unsaved changes?'),
escapeButtonCloses: false,
overlayClosesOnClick: false,
-   contentCSS: { width: '700px' },
+   contentCSS: { width: '600px' },
buttons: [
$.extend({}, 
vex.dialog.buttons.YES, { text: _('Discard'),

  click: function($vexContent) {
___
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

2018-03-30 Thread Pranav Kant
 loleaflet/src/core/LOUtil.js |7 +++
 loleaflet/src/core/Socket.js |   34 --
 loleaflet/src/map/Map.js |8 +++-
 3 files changed, 42 insertions(+), 7 deletions(-)

New commits:
commit 7b16ab5f94083e688d623c085452727616cd
Author: Pranav Kant 
Date:   Fri Mar 30 19:26:55 2018 +0530

Ask to save unsaved changes to a new file

... when document is changed externally.

Change-Id: Ieaad5f0ed5cd4ee3bf5385f2a5cd297b7758a43e

diff --git a/loleaflet/src/core/LOUtil.js b/loleaflet/src/core/LOUtil.js
index 286f2fa4e..fad8ad527 100644
--- a/loleaflet/src/core/LOUtil.js
+++ b/loleaflet/src/core/LOUtil.js
@@ -78,5 +78,12 @@ L.LOUtil = {
}
}
return rectangles;
+   },
+
+   /// oldFileName = Example.odt, suffix = new
+   /// returns: Example_new.odt
+   generateNewFileName: function(oldFileName, suffix) {
+   var idx = oldFileName.lastIndexOf('.');
+   return oldFileName.substring(0, idx) + suffix + 
oldFileName.substring(idx);
}
 };
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index e45ba55ac..9604131f3 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -435,21 +435,41 @@ L.Socket = L.Class.extend({
vex.close(id);
}
 
-   vex.dialog.confirm({
-   message: _('Document has been changed 
in storage. Do you want to discard your changes, and load the document from the 
storage?'),
+   vex.dialog.open({
+   message: _('Document has been changed 
in storage. What would you like to do with your unsaved changes?'),
escapeButtonCloses: false,
overlayClosesOnClick: false,
+   contentCSS: { width: '700px' },
buttons: [
-   $.extend({}, 
vex.dialog.buttons.YES, { text: _('Discard changes') }),
-   $.extend({}, 
vex.dialog.buttons.NO, { text: _('Overwrite document') })
+   $.extend({}, 
vex.dialog.buttons.YES, { text: _('Discard'),
+   
  click: function($vexContent) {
+   
  $vexContent.data().vex.value = 'discard';
+   
  vex.close($vexContent.data().vex.id);
+   
  }}),
+   $.extend({}, 
vex.dialog.buttons.YES, { text: _('Overwrite'),
+   
  click: function($vexContent) {
+   
  $vexContent.data().vex.value = 'overwrite';
+   
  vex.close($vexContent.data().vex.id);
+   
  }}),
+   $.extend({}, 
vex.dialog.buttons.YES, { text: _('Save to new file'),
+   
  click: function($vexContent) {
+   
  $vexContent.data().vex.value = 'saveas';
+   
  vex.close($vexContent.data().vex.id);
+   
  }})
],
callback: L.bind(function(value) {
-   if (value) {
+   if (value === 'discard') {
// They want to refresh 
the page and load document again for all

this.sendMessage('closedocument');
-   } else {
+   } else if (value === 
'overwrite') {
// They want to 
overwrite
  

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3' - loleaflet/build loleaflet/src

2018-03-30 Thread Pranav Kant
 loleaflet/build/deps.js  |5 +
 loleaflet/src/layer/marker/ClipboardContainer.js |   84 +++
 loleaflet/src/layer/tile/TileLayer.js|   23 ++
 loleaflet/src/map/Map.js |   22 ++
 loleaflet/src/map/handler/Map.Keyboard.js|8 +-
 loleaflet/src/map/handler/Map.Mouse.js   |2 
 6 files changed, 111 insertions(+), 33 deletions(-)

New commits:
commit fc12e995c71b15d324baa32b0cde63c5282dd868
Author: Pranav Kant 
Date:   Fri Mar 23 19:40:53 2018 +0530

New home for hidden input field

Change-Id: I534b8d3dc9ac9ec4f37aa0ec929a9cd6a98558b4
Reviewed-on: https://gerrit.libreoffice.org/52132
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/build/deps.js b/loleaflet/build/deps.js
index 36ac9607f..bac393583 100644
--- a/loleaflet/build/deps.js
+++ b/loleaflet/build/deps.js
@@ -80,6 +80,11 @@ var deps = {
desc: 'Used to display a progress image over rectangular are of 
the map.'
},
 
+   ClipboardContainer: {
+   src: ['layer/marker/ClipboardContainer.js'],
+   desc: 'Container for hidden input field.'
+   },
+
Marker: {
src: ['layer/marker/Icon.js',
  'layer/marker/Icon.Default.js',
diff --git a/loleaflet/src/layer/marker/ClipboardContainer.js 
b/loleaflet/src/layer/marker/ClipboardContainer.js
new file mode 100644
index 0..4dc7792a7
--- /dev/null
+++ b/loleaflet/src/layer/marker/ClipboardContainer.js
@@ -0,0 +1,84 @@
+/*
+ * L.ClipboardContainer is used to overlay the hidden clipbaord container on 
the map
+ */
+
+L.ClipboardContainer = L.Layer.extend({
+
+   initialize: function () {
+   this._initLayout();
+   },
+
+   onAdd: function () {
+   if (this._container) {
+   this.getPane().appendChild(this._container);
+   this.update();
+   }
+
+   L.DomEvent.on(this._textArea, 'copy cut paste ' +
+ 'keydown keypress keyup ' +
+ 'compositionstart compositionupdate 
compositionend textInput',
+ this._map._handleDOMEvent, this._map);
+   },
+
+   onRemove: function () {
+   if (this._container) {
+   this.getPane().removeChild(this._container);
+   }
+
+   L.DomEvent.off(this._textArea, 'copy cut paste ' +
+  'keydown keypress keyup ' +
+  'compositionstart compositionupdate 
compositionend textInput',
+  this._map._handleDOMEvent, this._map);
+   },
+
+   focus: function(focus) {
+   if (focus) {
+   this._textArea.focus();
+   } else {
+   this._textArea.blur();
+   }
+   },
+
+   select: function() {
+   this._textArea.select();
+   },
+
+   getValue: function() {
+   return this._textArea.value;
+   },
+
+   setValue: function(val) {
+   this._textArea.value = val;
+   },
+
+   setLatLng: function (latlng) {
+   this._latlng = L.latLng(latlng);
+   this.update();
+   },
+
+   update: function () {
+   if (this._container && this._map && this._latlng) {
+   var position = 
this._map.latLngToLayerPoint(this._latlng).round();
+   this._setPos(position);
+   }
+   },
+
+   _initLayout: function () {
+   this._container = L.DomUtil.create('div', 
'clipboard-container');
+   this._container.id = 'doc-clipboard-container';
+   this._textArea = L.DomUtil.create('input', 'clipboard', 
this._container);
+   this._textArea.setAttribute('type', 'text');
+   this._textArea.setAttribute('autocorrect', 'off');
+   this._textArea.setAttribute('autocapitalize', 'off');
+   this._textArea.setAttribute('autocomplete', 'off');
+   this._textArea.setAttribute('spellcheck', 'false');
+   },
+
+   _setPos: function (pos) {
+   L.DomUtil.setPosition(this._container, pos);
+   }
+});
+
+L.clipboardContainer = function () {
+   return new L.ClipboardContainer();
+};
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index de9351666..4fdee2095 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -286,8

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

2018-03-30 Thread Pranav Kant
 loleaflet/src/layer/marker/Cursor.js  |   34 +-
 loleaflet/src/layer/tile/TileLayer.js |   28 
 loleaflet/src/map/Map.js  |   16 +---
 3 files changed, 30 insertions(+), 48 deletions(-)

New commits:
commit 1c1880093c7c4bc4de16526c89750d0a6ca2dec8
Author: Pranav Kant 
Date:   Fri Mar 30 00:47:08 2018 +0530

Revert everything related to putting clipboard inside cursor-cont.

Revert "Only create clipboard for one cursor"
This reverts commit 98b53ae956782ce7366a2d4b29e80ce31b748058.

Revert "Fix for incorrect map positioning"
This reverts commit 950b60719abefeca07c65add6dda2f7ae0aeb.

Revert "Move the clipboard-container directly into the cursor."
This reverts commit e293b7faeed12b7a71786ded970bebd4d998c47b.

Change-Id: Ie5ebcc7a645f6ef1cdbc9fd90bcdef22de54df95
Reviewed-on: https://gerrit.libreoffice.org/52131
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/layer/marker/Cursor.js 
b/loleaflet/src/layer/marker/Cursor.js
index c370aa13e..792a13485 100644
--- a/loleaflet/src/layer/marker/Cursor.js
+++ b/loleaflet/src/layer/marker/Cursor.js
@@ -16,24 +16,13 @@ L.Cursor = L.Layer.extend({
this._initLayout();
},
 
-   onAdd: function (map) {
-   this._map = map;
-
+   onAdd: function () {
if (!this._container) {
this._initLayout();
}
 
this.update();
this.getPane().appendChild(this._container);
-
-   if (this._textArea && !this._map._textArea) {
-   this._map._textArea = this._textArea;
-
-   L.DomEvent['off'](this._textArea, 'copy cut paste 
keydown keypress keyup compositionstart compositionupdate compositionend 
textInput', this._map._handleDOMEvent, this._map);
-   L.DomEvent['on'](this._textArea, 'copy cut paste 
keydown keypress keyup compositionstart compositionupdate compositionend 
textInput', this._map._handleDOMEvent, this._map);
-
-   this._textArea.focus();
-   }
},
 
onRemove: function () {
@@ -75,16 +64,6 @@ L.Cursor = L.Layer.extend({
}
},
 
-   show: function() {
-   L.DomUtil.setStyle(this._container, 'visibility', 'visible');
-   if (this._textArea)
-   this._textArea.focus();
-   },
-
-   hide: function() {
-   L.DomUtil.setStyle(this._container, 'visibility', 'hidden');
-   },
-
showCursorHeader: function() {
if (this._cursorHeader) {
L.DomUtil.setStyle(this._cursorHeader, 'visibility', 
'visible');
@@ -121,17 +100,6 @@ L.Cursor = L.Layer.extend({
L.DomEvent
.disableClickPropagation(this._cursor)
.disableScrollPropagation(this._container);
-
-   if (this.options.clipboard) {
-   var textAreaContainer = L.DomUtil.create('div', 
'clipboard-container', this._container);
-   textAreaContainer.id = 'doc-clipboard-container';
-   this._textArea = L.DomUtil.create('input', 'clipboard', 
textAreaContainer);
-   this._textArea.setAttribute('type', 'text');
-   this._textArea.setAttribute('autocorrect', 'off');
-   this._textArea.setAttribute('autocapitalize', 'off');
-   this._textArea.setAttribute('autocomplete', 'off');
-   this._textArea.setAttribute('spellcheck', 'false');
-   }
},
 
_setPos: function (pos) {
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 6b79a6429..de9351666 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -286,6 +286,8 @@ L.TileLayer = L.GridLayer.extend({
for (var key in this._selectionHandles) {
this._selectionHandles[key].on('drag dragend', 
this._onSelectionHandleDrag, this);
}
+   this._textArea = map._textArea;
+   this._textArea.focus();
 
map.setPermission(this.options.permission);
 
@@ -1446,18 +1448,20 @@ L.TileLayer = L.GridLayer.extend({
var cursorPos = this._visibleCursor.getNorthWest();
 
if (!this._cursorMarker) {
-   this._cursorMarker = L.cursor(cursorPos, 
pixBounds.getSiz

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

2018-03-30 Thread Pranav Kant
 loleaflet/build/deps.js  |5 +
 loleaflet/src/layer/marker/ClipboardContainer.js |   84 +++
 loleaflet/src/layer/tile/TileLayer.js|   35 ++---
 loleaflet/src/map/Map.js |   32 +++-
 loleaflet/src/map/handler/Map.Keyboard.js|8 +-
 loleaflet/src/map/handler/Map.Mouse.js   |2 
 6 files changed, 117 insertions(+), 49 deletions(-)

New commits:
commit 2f92e1da9c5681c93dd33848b3afaf0a843e4a81
Author: Pranav Kant 
Date:   Fri Mar 23 19:40:53 2018 +0530

New home for hidden input field

Change-Id: I534b8d3dc9ac9ec4f37aa0ec929a9cd6a98558b4

diff --git a/loleaflet/build/deps.js b/loleaflet/build/deps.js
index 59f4cde34..4b66adeea 100644
--- a/loleaflet/build/deps.js
+++ b/loleaflet/build/deps.js
@@ -80,6 +80,11 @@ var deps = {
desc: 'Used to display a progress image over rectangular are of 
the map.'
},
 
+   ClipboardContainer: {
+   src: ['layer/marker/ClipboardContainer.js'],
+   desc: 'Container for hidden input field.'
+   },
+
Marker: {
src: ['layer/marker/Icon.js',
  'layer/marker/Icon.Default.js',
diff --git a/loleaflet/src/layer/marker/ClipboardContainer.js 
b/loleaflet/src/layer/marker/ClipboardContainer.js
new file mode 100644
index 0..4dc7792a7
--- /dev/null
+++ b/loleaflet/src/layer/marker/ClipboardContainer.js
@@ -0,0 +1,84 @@
+/*
+ * L.ClipboardContainer is used to overlay the hidden clipbaord container on 
the map
+ */
+
+L.ClipboardContainer = L.Layer.extend({
+
+   initialize: function () {
+   this._initLayout();
+   },
+
+   onAdd: function () {
+   if (this._container) {
+   this.getPane().appendChild(this._container);
+   this.update();
+   }
+
+   L.DomEvent.on(this._textArea, 'copy cut paste ' +
+ 'keydown keypress keyup ' +
+ 'compositionstart compositionupdate 
compositionend textInput',
+ this._map._handleDOMEvent, this._map);
+   },
+
+   onRemove: function () {
+   if (this._container) {
+   this.getPane().removeChild(this._container);
+   }
+
+   L.DomEvent.off(this._textArea, 'copy cut paste ' +
+  'keydown keypress keyup ' +
+  'compositionstart compositionupdate 
compositionend textInput',
+  this._map._handleDOMEvent, this._map);
+   },
+
+   focus: function(focus) {
+   if (focus) {
+   this._textArea.focus();
+   } else {
+   this._textArea.blur();
+   }
+   },
+
+   select: function() {
+   this._textArea.select();
+   },
+
+   getValue: function() {
+   return this._textArea.value;
+   },
+
+   setValue: function(val) {
+   this._textArea.value = val;
+   },
+
+   setLatLng: function (latlng) {
+   this._latlng = L.latLng(latlng);
+   this.update();
+   },
+
+   update: function () {
+   if (this._container && this._map && this._latlng) {
+   var position = 
this._map.latLngToLayerPoint(this._latlng).round();
+   this._setPos(position);
+   }
+   },
+
+   _initLayout: function () {
+   this._container = L.DomUtil.create('div', 
'clipboard-container');
+   this._container.id = 'doc-clipboard-container';
+   this._textArea = L.DomUtil.create('input', 'clipboard', 
this._container);
+   this._textArea.setAttribute('type', 'text');
+   this._textArea.setAttribute('autocorrect', 'off');
+   this._textArea.setAttribute('autocapitalize', 'off');
+   this._textArea.setAttribute('autocomplete', 'off');
+   this._textArea.setAttribute('spellcheck', 'false');
+   },
+
+   _setPos: function (pos) {
+   L.DomUtil.setPosition(this._container, pos);
+   }
+});
+
+L.clipboardContainer = function () {
+   return new L.ClipboardContainer();
+};
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index b05658b17..59ce81d2c 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -290,8 +290,7 @@ L.TileLayer = L.GridLayer.extend({
for (var key in this._selectionHandl

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

2018-03-29 Thread Pranav Kant
 loleaflet/src/map/Map.js |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit b7d4e766976e1a5b5fb46fdc4b943da7f0904e5b
Author: Pranav Kant 
Date:   Fri Mar 30 00:10:15 2018 +0530

Ignore 'scroll' event on map container

Cherry-picked from:

commit 558f8c3a065e8fafa2d8912fd9c88625a8c3de97
Author: Iván Sánchez Ortega 
Date:   Mon Mar 30 14:34:39 2015 +0200

Fix # by catching the onScroll event on the map container

from upstream Leaflet.

Thanks a lot to Kendy and Aron for extensive debugging.

Change-Id: I940cdf43b5d7d8f8368b4a01dcfc3417085eb4c7
Reviewed-on: https://gerrit.libreoffice.org/52126
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 6f61d266e..cf1fb7216 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -696,9 +696,15 @@ L.Map = L.Evented.extend({
this._fileDownloader = L.DomUtil.create('iframe', '', 
container);
L.DomUtil.setStyle(this._fileDownloader, 'display', 'none');
 
+   L.DomEvent.addListener(container, 'scroll', this._onScroll, 
this);
container._leaflet = true;
},
 
+   _onScroll: function() {
+   this._container.scrollTop = 0;
+   this._container.scrollLeft = 0;
+   },
+
_initLayout: function () {
var container = this._container;
 
___
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-3' - loleaflet/dist

2018-03-29 Thread Pranav Kant
 loleaflet/dist/loleaflet.css |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 318c23136f6914b259bd8834642d1683f9bff402
Author: Pranav Kant 
Date:   Wed Mar 21 17:19:15 2018 +0530

loleaflet: don't allow scrollbars to popup

Change-Id: Id018a91dac21ea7b81c57a1628b6e3c61f9c1ec4
Reviewed-on: https://gerrit.libreoffice.org/52069
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index 3ffd36737..e8d88a974 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -44,6 +44,7 @@
 
 body {
 margin: 0;
+overflow: hidden;
 }
 
 #presentation-controls-wrapper {
___
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-3-1' - loleaflet/src

2018-03-29 Thread Pranav Kant
 loleaflet/src/layer/marker/Cursor.js  |   31 ++-
 loleaflet/src/layer/tile/TileLayer.js |2 +-
 2 files changed, 19 insertions(+), 14 deletions(-)

New commits:
commit 779909deccd745ca8c447478174f1e5f78393e0d
Author: Pranav Kant 
Date:   Wed Mar 28 22:35:51 2018 +0530

Only create clipboard for one cursor

Change-Id: Ief33fd516d2e1aecc561f32098fdd07a8cd98a20
Reviewed-on: https://gerrit.libreoffice.org/52026
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 
(cherry picked from commit 98b53ae956782ce7366a2d4b29e80ce31b748058)
Reviewed-on: https://gerrit.libreoffice.org/52065

diff --git a/loleaflet/src/layer/marker/Cursor.js 
b/loleaflet/src/layer/marker/Cursor.js
index 1189d9f1a..c370aa13e 100644
--- a/loleaflet/src/layer/marker/Cursor.js
+++ b/loleaflet/src/layer/marker/Cursor.js
@@ -26,12 +26,14 @@ L.Cursor = L.Layer.extend({
this.update();
this.getPane().appendChild(this._container);
 
-   this._map._textArea = this._textArea;
+   if (this._textArea && !this._map._textArea) {
+   this._map._textArea = this._textArea;
 
-   L.DomEvent['off'](this._textArea, 'copy cut paste keydown 
keypress keyup compositionstart compositionupdate compositionend textInput', 
this._map._handleDOMEvent, this._map);
-   L.DomEvent['on'](this._textArea, 'copy cut paste keydown 
keypress keyup compositionstart compositionupdate compositionend textInput', 
this._map._handleDOMEvent, this._map);
+   L.DomEvent['off'](this._textArea, 'copy cut paste 
keydown keypress keyup compositionstart compositionupdate compositionend 
textInput', this._map._handleDOMEvent, this._map);
+   L.DomEvent['on'](this._textArea, 'copy cut paste 
keydown keypress keyup compositionstart compositionupdate compositionend 
textInput', this._map._handleDOMEvent, this._map);
 
-   this._textArea.focus();
+   this._textArea.focus();
+   }
},
 
onRemove: function () {
@@ -75,7 +77,8 @@ L.Cursor = L.Layer.extend({
 
show: function() {
L.DomUtil.setStyle(this._container, 'visibility', 'visible');
-   this._textArea.focus();
+   if (this._textArea)
+   this._textArea.focus();
},
 
hide: function() {
@@ -119,14 +122,16 @@ L.Cursor = L.Layer.extend({
.disableClickPropagation(this._cursor)
.disableScrollPropagation(this._container);
 
-   var textAreaContainer = L.DomUtil.create('div', 
'clipboard-container', this._container);
-   textAreaContainer.id = 'doc-clipboard-container';
-   this._textArea = L.DomUtil.create('input', 'clipboard', 
textAreaContainer);
-   this._textArea.setAttribute('type', 'text');
-   this._textArea.setAttribute('autocorrect', 'off');
-   this._textArea.setAttribute('autocapitalize', 'off');
-   this._textArea.setAttribute('autocomplete', 'off');
-   this._textArea.setAttribute('spellcheck', 'false');
+   if (this.options.clipboard) {
+   var textAreaContainer = L.DomUtil.create('div', 
'clipboard-container', this._container);
+   textAreaContainer.id = 'doc-clipboard-container';
+   this._textArea = L.DomUtil.create('input', 'clipboard', 
textAreaContainer);
+   this._textArea.setAttribute('type', 'text');
+   this._textArea.setAttribute('autocorrect', 'off');
+   this._textArea.setAttribute('autocapitalize', 'off');
+   this._textArea.setAttribute('autocomplete', 'off');
+   this._textArea.setAttribute('spellcheck', 'false');
+   }
},
 
_setPos: function (pos) {
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 53d0420ab..4706ff1df 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1435,7 +1435,7 @@ L.TileLayer = L.GridLayer.extend({
var cursorPos = this._visibleCursor.getNorthWest();
 
if (!this._cursorMarker) {
-   this._cursorMarker = L.cursor(cursorPos, 
pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())), 
{blink: true});
+  

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-1' - loleaflet/src

2018-03-29 Thread Pranav Kant
 loleaflet/src/map/Map.js |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 7389895945e9d662f8b22cedf597dbd2496a1106
Author: Pranav Kant 
Date:   Wed Mar 28 22:31:57 2018 +0530

Fix for incorrect map positioning

Apparently, blurring and focussing the text area again causes incorrect
map positioning.

2 page document
click into last line of second page
scroll to first line of first page and click there
see the incorrect map positioning

Change-Id: Ib26fb67d17b16efebbbe18a2c022b18d592a4868
Reviewed-on: https://gerrit.libreoffice.org/52056
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index a30b2d507..6f61d266e 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -1057,7 +1057,6 @@ L.Map = L.Evented.extend({
// Calling from some other place with no real 'click' event 
doesn't work
if (type === 'click') {
if (this._permission === 'edit') {
-   this._textArea.blur();
this._textArea.focus();
}
 
___
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-3' - loleaflet/src

2018-03-29 Thread Pranav Kant
 loleaflet/src/layer/marker/Cursor.js  |   31 ++-
 loleaflet/src/layer/tile/TileLayer.js |2 +-
 2 files changed, 19 insertions(+), 14 deletions(-)

New commits:
commit 98b53ae956782ce7366a2d4b29e80ce31b748058
Author: Pranav Kant 
Date:   Wed Mar 28 22:35:51 2018 +0530

Only create clipboard for one cursor

Change-Id: Ief33fd516d2e1aecc561f32098fdd07a8cd98a20
Reviewed-on: https://gerrit.libreoffice.org/52026
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/layer/marker/Cursor.js 
b/loleaflet/src/layer/marker/Cursor.js
index 1189d9f1a..c370aa13e 100644
--- a/loleaflet/src/layer/marker/Cursor.js
+++ b/loleaflet/src/layer/marker/Cursor.js
@@ -26,12 +26,14 @@ L.Cursor = L.Layer.extend({
this.update();
this.getPane().appendChild(this._container);
 
-   this._map._textArea = this._textArea;
+   if (this._textArea && !this._map._textArea) {
+   this._map._textArea = this._textArea;
 
-   L.DomEvent['off'](this._textArea, 'copy cut paste keydown 
keypress keyup compositionstart compositionupdate compositionend textInput', 
this._map._handleDOMEvent, this._map);
-   L.DomEvent['on'](this._textArea, 'copy cut paste keydown 
keypress keyup compositionstart compositionupdate compositionend textInput', 
this._map._handleDOMEvent, this._map);
+   L.DomEvent['off'](this._textArea, 'copy cut paste 
keydown keypress keyup compositionstart compositionupdate compositionend 
textInput', this._map._handleDOMEvent, this._map);
+   L.DomEvent['on'](this._textArea, 'copy cut paste 
keydown keypress keyup compositionstart compositionupdate compositionend 
textInput', this._map._handleDOMEvent, this._map);
 
-   this._textArea.focus();
+   this._textArea.focus();
+   }
},
 
onRemove: function () {
@@ -75,7 +77,8 @@ L.Cursor = L.Layer.extend({
 
show: function() {
L.DomUtil.setStyle(this._container, 'visibility', 'visible');
-   this._textArea.focus();
+   if (this._textArea)
+   this._textArea.focus();
},
 
hide: function() {
@@ -119,14 +122,16 @@ L.Cursor = L.Layer.extend({
.disableClickPropagation(this._cursor)
.disableScrollPropagation(this._container);
 
-   var textAreaContainer = L.DomUtil.create('div', 
'clipboard-container', this._container);
-   textAreaContainer.id = 'doc-clipboard-container';
-   this._textArea = L.DomUtil.create('input', 'clipboard', 
textAreaContainer);
-   this._textArea.setAttribute('type', 'text');
-   this._textArea.setAttribute('autocorrect', 'off');
-   this._textArea.setAttribute('autocapitalize', 'off');
-   this._textArea.setAttribute('autocomplete', 'off');
-   this._textArea.setAttribute('spellcheck', 'false');
+   if (this.options.clipboard) {
+   var textAreaContainer = L.DomUtil.create('div', 
'clipboard-container', this._container);
+   textAreaContainer.id = 'doc-clipboard-container';
+   this._textArea = L.DomUtil.create('input', 'clipboard', 
textAreaContainer);
+   this._textArea.setAttribute('type', 'text');
+   this._textArea.setAttribute('autocorrect', 'off');
+   this._textArea.setAttribute('autocapitalize', 'off');
+   this._textArea.setAttribute('autocomplete', 'off');
+   this._textArea.setAttribute('spellcheck', 'false');
+   }
},
 
_setPos: function (pos) {
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index e0286f3cd..6b79a6429 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1446,7 +1446,7 @@ L.TileLayer = L.GridLayer.extend({
var cursorPos = this._visibleCursor.getNorthWest();
 
if (!this._cursorMarker) {
-   this._cursorMarker = L.cursor(cursorPos, 
pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())), 
{blink: true});
+   this._cursorMarker = L.cursor(cursorPos, 
pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())), 
{blink: true, clipboard: true});
this._map.addLayer(this._cursorMarker);
 
this._textArea = this._cursorMarker._textArea;
___
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-3' - loleaflet/src

2018-03-29 Thread Pranav Kant
 loleaflet/src/map/Map.js |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 950b60719abefeca07c650a7add6dda2f7ae0aeb
Author: Pranav Kant 
Date:   Wed Mar 28 22:31:57 2018 +0530

Fix for incorrect map positioning

Apparently, blurring and focussing the text area again causes incorrect
map positioning.

2 page document
click into last line of second page
scroll to first line of first page and click there
see the incorrect map positioning

Change-Id: Ib26fb67d17b16efebbbe18a2c022b18d592a4868
Reviewed-on: https://gerrit.libreoffice.org/52025
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index a30b2d507..6f61d266e 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -1057,7 +1057,6 @@ L.Map = L.Evented.extend({
// Calling from some other place with no real 'click' event 
doesn't work
if (type === 'click') {
if (this._permission === 'edit') {
-   this._textArea.blur();
this._textArea.focus();
}
 
___
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-3' - loleaflet/dist loleaflet/src

2018-03-27 Thread Pranav Kant
 loleaflet/dist/loleaflet.css   |6 +-
 loleaflet/src/control/Control.LokDialog.js |6 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 0a96e51c98e2672b074d59b87fa9470922fe2c08
Author: Pranav Kant 
Date:   Tue Mar 27 15:13:41 2018 +0200

lokdialog: Don't show the title bar when no title was provided.

Change-Id: If08dc81e88d35a924d10695a38b138f6403e58bd
Reviewed-on: https://gerrit.libreoffice.org/51955
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index e6389f06b..3ffd36737 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -339,6 +339,10 @@ body {
text-indent: 1px;
 }
 
+.lokdialog_container.lokdialog_notitle .ui-dialog-titlebar {
+   display: none;
+}
+
 .lokdialog_container.ui-dialog.ui-widget-content {
padding: 0px;
overflow: visible;
@@ -373,4 +377,4 @@ body {
 .vex.vex-theme-bottom-right-corner .vex-content {
bottom: 40px !important;
right: 10px !important;
-}
\ No newline at end of file
+}
diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 930655d2f..4f3e01d05 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -240,6 +240,10 @@ L.Control.LokDialog = L.Control.extend({
 
L.DomEvent.on(dialogCanvas, 'contextmenu', 
L.DomEvent.preventDefault);
 
+   var dialogClass = 'lokdialog_container';
+   if (!title)
+   dialogClass += ' lokdialog_notitle';
+
var that = this;
$(dialogContainer).dialog({
minWidth: width,
@@ -248,7 +252,7 @@ L.Control.LokDialog = L.Control.extend({
modal: false,
closeOnEscape: true,
resizable: false,
-   dialogClass: 'lokdialog_container',
+   dialogClass: dialogClass,
close: function() {
that._onDialogClose(that._toRawDlgId(strDlgId), 
true);
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-27 Thread Pranav Kant
 loleaflet/dist/loleaflet.css  |1 +
 loleaflet/src/control/Ruler.js|4 ++--
 loleaflet/src/layer/tile/TileLayer.js |   20 
 loleaflet/src/map/Map.js  |4 
 4 files changed, 23 insertions(+), 6 deletions(-)

New commits:
commit b2fd459486425524aafd8cc08807af84f3c086a3
Author: Pranav Kant 
Date:   Mon Mar 26 16:29:24 2018 +0530

missing semi-colons

Change-Id: Ic783fde87b8939152b76264626ec9476df81b2ff

diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js
index df702e05d..31de43582 100644
--- a/loleaflet/src/control/Ruler.js
+++ b/loleaflet/src/control/Ruler.js
@@ -129,9 +129,9 @@ L.Control.Ruler = L.Control.extend({
this._rMarginMarker =  L.DomUtil.create('div', 
classMargin + ' ' + rightComp, this._rFace);
 
this._lMarginDrag = L.DomUtil.create('div', 
classDraggable + ' ' + leftComp, this._rMarginWrapper);
-   this._lToolTip = L.DomUtil.create('div', lToolTip, 
this._lMarginDrag)
+   this._lToolTip = L.DomUtil.create('div', lToolTip, 
this._lMarginDrag);
this._rMarginDrag = L.DomUtil.create('div', 
classDraggable + ' ' + rightComp, this._rMarginWrapper);
-   this._rToolTip = L.DomUtil.create('div', rToolTip, 
this._rMarginDrag)
+   this._rToolTip = L.DomUtil.create('div', rToolTip, 
this._rMarginDrag);
this._lMarginDrag.title = leftMarginStr;
this._rMarginDrag.title = rightMarginStr;
}
commit 5437eee548b3406d2d993cd83669c1b90ea46155
Author: Pranav Kant 
Date:   Thu Mar 22 19:18:46 2018 +0530

loleaflet: avoid getting browser scrollbar

while keeping the position of hidden input field to be around the
cursor.

Change-Id: I5539cc5c8e99526b771be0e11336dd6d77e5b02c

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index 36df3e052..8f67261c0 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -44,6 +44,7 @@
 
 body {
 margin: 0;
+overflow: hidden;
 }
 
 #presentation-controls-wrapper {
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 72318ae1d..d6df423db 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1540,10 +1540,7 @@ L.TileLayer = L.GridLayer.extend({
}
this._map.addLayer(this._cursorMarker);
 
-   // move the hidden input field with the cursor
-   var clipContainer = 
L.DomUtil.get('doc-clipboard-container');
-   var pos = 
this._map.latLngToContainerPoint(L.latLng(cursorPos)).round();
-   L.DomUtil.setPosition(clipContainer, pos);
+   this._updateContainerElements();
}
else if (this._cursorMarker) {
this._map.removeLayer(this._cursorMarker);
@@ -1551,6 +1548,21 @@ L.TileLayer = L.GridLayer.extend({
}
},
 
+   _updateContainerElements: function() {
+   var clipContainer = L.DomUtil.get('doc-clipboard-container');
+   if (!this._visibleCursor ||
+   !clipContainer)
+   return;
+
+   var oldPos = L.DomUtil.getPosition(clipContainer);
+   var newPos = 
this._map.latLngToContainerPoint(L.latLng(this._visibleCursor.getNorthWest())).round();
+   if (!oldPos || oldPos.x !== newPos.x || oldPos.y !== newPos.y) {
+   // move the hidden input field with the cursor
+   console.log('_updateContainerElements: ' + newPos);
+   L.DomUtil.setPosition(clipContainer, newPos);
+   }
+   },
+
// Update colored non-blinking view cursor
_onUpdateViewCursor: function (viewId) {
if (typeof this._viewCursors[viewId] !== 'object' ||
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index b8e4f1d37..6790b1cb3 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -794,6 +794,10 @@ L.Map = L.Evented.extend({
 
_rawPanBy: function (offset) {
L.DomUtil.setPosition(this._mapPane, 
this._getMapPanePos().subtract(offset));
+
+   if (this._docLayer) {
+   this._docLayer._updateContainerElements();
+   }
},
 
_getZoomSpan: function () {
___
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' - 16 commits - chart2/source desktop/inc desktop/source editeng/source filter/source include/comphelper include/LibreOfficeKit include/

2018-03-27 Thread Pranav Kant
 chart2/source/controller/main/ChartController_EditData.cxx  |3 
 chart2/source/controller/main/ChartController_Window.cxx|9 
 desktop/inc/app.hxx |2 
 desktop/source/lib/init.cxx |8 
 editeng/source/editeng/editview.cxx |6 
 filter/source/config/cache/constant.hxx |1 
 filter/source/config/cache/filtercache.cxx  |6 
 filter/source/config/fragments/filters/AbiWord.xcu  |2 
 filter/source/config/fragments/filters/MWAW_Bitmap.xcu  |2 
 filter/source/config/fragments/filters/MWAW_Database.xcu|2 
 filter/source/config/fragments/filters/MWAW_Drawing.xcu |2 
 filter/source/config/fragments/filters/MWAW_Presentation.xcu|2 
 filter/source/config/fragments/filters/MWAW_Spreadsheet.xcu |2 
 filter/source/config/fragments/filters/MWAW_Text_Document.xcu   |2 
 filter/source/config/fragments/filters/StarOffice_XML__Base_.xcu|2 
 filter/source/config/fragments/filters/StarOffice_XML__Writer_.xcu  |2 
 filter/source/config/fragments/filters/T602Document.xcu |2 
 filter/source/config/fragments/filters/XPM.xcu  |2 
 filter/source/config/fragments/filters/writer_MIZI_Hwp_97.xcu   |2 
 include/LibreOfficeKit/LibreOfficeKitEnums.h|   11 
 include/comphelper/documentconstants.hxx|4 
 include/sfx2/docfilt.hxx|3 
 include/sfx2/objsh.hxx  |3 
 include/vcl/menu.hxx|9 
 libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx |6 
 libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx |9 
 libreofficekit/source/gtk/lokdocview.cxx|   22 +
 offapi/UnoApi_offapi.mk |1 
 offapi/com/sun/star/document/ExoticFileLoadException.idl|   34 +
 officecfg/registry/schema/org/openoffice/Office/Common.xcs  |   23 +
 sc/qa/unit/tiledrendering/tiledrendering.cxx|   43 ++
 sc/source/ui/app/scmod.cxx  |   32 -
 sc/source/ui/formdlg/formula.cxx|6 
 sc/source/ui/inc/anyrefdg.hxx   |4 
 sc/source/ui/miscdlgs/anyrefdg.cxx  |   32 -
 sd/qa/unit/tiledrendering/tiledrendering.cxx|  210 
+-
 sd/source/ui/func/fuarea.cxx|9 
 sd/source/ui/func/fuline.cxx|8 
 sd/source/ui/func/futransf.cxx  |8 
 sd/source/ui/inc/ViewShell.hxx  |2 
 sd/source/ui/unoidl/unomodel.cxx|   14 
 sd/source/ui/view/drviews2.cxx  |   12 
 sd/source/ui/view/viewshe2.cxx  |   12 
 sfx2/Library_sfx.mk |1 
 sfx2/source/doc/exoticfileloadexception.cxx |   42 ++
 sfx2/source/doc/exoticfileloadexception.hxx |   42 ++
 sfx2/source/doc/objstor.cxx |   37 +
 sfx2/source/view/viewsh.cxx |   16 
 svtools/source/contnr/treelistbox.cxx   |3 
 sw/source/uibase/inc/olmenu.hxx |2 
 sw/source/uibase/uiview/viewling.cxx|   13 
 uui/inc/ids.hrc |2 
 uui/inc/ids.hxx |1 
 uui/source/iahndl.cxx   |   25 +
 vcl/source/window/builder.cxx   |6 
 vcl/source/window/floatwin.cxx  |   14 
 vcl/source/window/menu.cxx  |9 
 vcl/source/window/window2.cxx   |6 
 58 files changed, 587 insertions(+), 208 deletions(-)

New commits:
commit 3b388ea53a73c2c62955338e7d03688c8ed9b26b
Author: Pranav Kant 
Date:   Thu Mar 15 20:09:26 2018 +0530

sd lok: Set the view size to full page size + fix unit tests

... such that during insertion of objects when sd calculates the center
of the view to place the object, it is the center of the whole slide,
not the center of the default rectangle of 800x600.

It's also important to hide r

Re: GSOC

2018-03-25 Thread Pranav Kant
Hi Vaibhav,

On 24/03/18 22:00, VAIBHAV kumar wrote:
> Mr.Pranav Kant,
>  I am interested in your project and want to join you. Please consider me as I
> have knowledge of c++.

For us to be able to consider you, you need to have fixed at least one easy 
hack:

https://wiki.documentfoundation.org/Development/LibreOffice_Online

Please see the Easy Hacks section above. You might find other helpful
information in that page too. As with any project, first step is to build it.
Have you already built Online successfully?

If you have any specific questions, regarding how to build it, or about how to
fix the easy hacks, happy to help.

All the best.

Thanks.

-- 
Regards,
Pranav



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


Re: GSoC project on LibreOffice Online Admin

2018-03-24 Thread Pranav Kant
Hi Kunal,

On 24/03/18 19:56, Kunal Gehlot wrote:
> Hello, 
> I am Kunal Gehlot, from India. I'm a first year Engineering student and am
> relatively new to development and coding. I would like to talk to you about
> developing on Admin console as a GSoC project. 

Your first step should be to build LibreOffice and then its Online component.
And then open a document and being able to see it reflected in the admin
console. There's some information here that might be useful to you, if you
haven't already built and run Online.

https://wiki.documentfoundation.org/Development/LibreOffice_Online

Please don't hesitate to ask further. You can either hang out on
#libreoffice-dev on freenode or ask questions on our mailing list (CCed). Happy
to help you cross that first hurdle :)

> I could not find much information on the plan but I see there's an abandoned
> history view development and admin console needs to be simplified by merging 
> two
> sets of codes. I am thinking of working in that direction and would like to
> learn more on the topic.

I would suggest you to first start looking at some of the easy hacks (look for
the link above) - after buildling Online successfully - to get your hands dirty
with the relevant code. It's also important for us to be able to consider you
for GSoC.

Resurrecting the history view is one of the tasks in the 'Online Admin' project
and it's one of the least prioritized tasks. We would want to make you work on
new features instead. So, all the points above the history view on the wiki page
you saw are the ones that should be on your radar. Please play a little with the
admin console first to be able to get a more clear idea of what exactly those
tasks are. Happy to answer any specific questions thereafter that comes to your
mind :)

-- 
Regards,
Pranav



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


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

2018-03-23 Thread Pranav Kant
 include/vcl/ITiledRenderable.hxx  |3 +++
 sw/source/uibase/uno/unotxdoc.cxx |2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit ed4df95f28d4081c8d244dc013fda53cee5f91b7
Author: Pranav Kant 
Date:   Fri Mar 23 16:24:24 2018 +0530

lok: don't post events on disposed window

Change-Id: I7721380b1bb6e9ec21338a72523326d0cae6729e
Reviewed-on: https://gerrit.libreoffice.org/51777
Tested-by: Jenkins 
Reviewed-by: pranavk 

diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index b95ac6386829..e25cdd67506a 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -101,6 +101,9 @@ public:
 static void LOKPostAsyncEvent(void* pEv, void*)
 {
 LOKAsyncEventData* pLOKEv = static_cast(pEv);
+if (pLOKEv->mpWindow->IsDisposed())
+return;
+
 switch (pLOKEv->mnEvent)
 {
 case VclEventId::WindowKeyInput:
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 4c442911c6eb..614050ba732f 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3487,7 +3487,7 @@ void SwXTextDocument::postKeyEvent(int nType, int 
nCharCode, int nKeyCode)
 SolarMutexGuard aGuard;
 
 VclPtr pWindow = getDocWindow();
-if (!pWindow)
+if (!pWindow || pWindow->IsDisposed())
 return;
 
 LOKAsyncEventData* pLOKEv = new LOKAsyncEventData;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-23 Thread Pranav Kant
 include/vcl/ITiledRenderable.hxx  |3 +++
 sw/source/uibase/uno/unotxdoc.cxx |2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit a7126570b15bfa17ae8fc37ca3a2f17c0c8f5028
Author: Pranav Kant 
Date:   Fri Mar 23 16:24:24 2018 +0530

lok: don't post events on disposed window

Change-Id: I7721380b1bb6e9ec21338a72523326d0cae6729e
Reviewed-on: https://gerrit.libreoffice.org/51778
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index 95775be55913..aa5e0c113e6f 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -101,6 +101,9 @@ public:
 static void LOKPostAsyncEvent(void* pEv, void*)
 {
 LOKAsyncEventData* pLOKEv = static_cast(pEv);
+if (pLOKEv->mpWindow->IsDisposed())
+return;
+
 switch (pLOKEv->mnEvent)
 {
 case VCLEVENT_WINDOW_KEYINPUT:
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index e8dbe796ca5b..f578c5480bb4 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3492,7 +3492,7 @@ void SwXTextDocument::postKeyEvent(int nType, int 
nCharCode, int nKeyCode)
 SolarMutexGuard aGuard;
 
 VclPtr pWindow = getDocWindow();
-if (!pWindow)
+if (!pWindow || pWindow->IsDisposed())
 return;
 
 LOKAsyncEventData* pLOKEv = new LOKAsyncEventData;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-23 Thread Pranav Kant
 wsd/Storage.cpp |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 6bb38614bdc6b37867bdd179eb18eecae4109452
Author: Pranav Kant 
Date:   Fri Mar 23 16:46:18 2018 +0530

Some helpful logging

Change-Id: I75e5e6cbbecf1e1af94a6710ecab4ced5637f14f

diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index 5ff0dc822..f25220894 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -268,7 +268,8 @@ std::string LocalStorage::loadStorageFileToLocal(const 
Authorization& /*auth*/)
 if (!Poco::File(_jailedFilePath).exists() && link(publicFilePath.c_str(), 
_jailedFilePath.c_str()) == -1)
 {
 // Failed
-LOG_WRN("link(\"" << publicFilePath << "\", \"" << _jailedFilePath << 
"\") failed. Will copy.");
+LOG_WRN("link(\"" << publicFilePath << "\", \"" << _jailedFilePath << 
"\") failed. Will copy. "
+"Linking error: " << errno << " " << strerror(errno));
 }
 
 try
@@ -303,7 +304,7 @@ StorageBase::SaveResult 
LocalStorage::saveLocalFileToStorage(const Authorization
 {
 try
 {
-LOG_TRC("Saving local file to local file storage " << _isCopy << " for 
" << _jailedFilePath);
+LOG_TRC("Saving local file to local file storage (isCopy: " << _isCopy 
<< ") for " << _jailedFilePath);
 // Copy the file back.
 if (_isCopy && Poco::File(_jailedFilePath).exists())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-21 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 82ec19069290b05e7980b39ba8d7413802ae61ba
Author: Pranav Kant 
Date:   Tue Mar 20 15:08:59 2018 +0530

Don't bore the map while user is playing with the dialog

Change-Id: I2aa466ec66b71fc7d65218a200638de142e99eea

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index f8de108bf..15dea5e2b 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -236,8 +236,6 @@ L.Control.LokDialog = L.Control.extend({
dialogCanvas.height = height;
dialogCanvas.id = strDlgId + '-canvas';
 
-   L.DomEvent.on(dialogCanvas, 'contextmenu', 
L.DomEvent.preventDefault);
-
var that = this;
$(dialogContainer).dialog({
width: width,
@@ -266,6 +264,10 @@ L.Control.LokDialog = L.Control.extend({
this._createDialogCursor(strDlgId);
var dlgInput = this._createDialogInput(strDlgId);
 
+   L.DomEvent.on(dialogCanvas, 'contextmenu', 
L.DomEvent.preventDefault);
+   L.DomEvent.on(dialogCanvas, 'mousemove', function() {
+   this._map.lastActiveTime = Date.now();
+   }, this);
L.DomEvent.on(dialogCanvas, 'mousedown mouseup', function(e) {
var buttons = 0;
buttons |= e.button === map['mouse'].JSButtons.left ? 
map['mouse'].LOButtons.left : 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-21 Thread Pranav Kant
 bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 8481689f93a1081c5a8d9e3ac8891d601049160d
Author: Pranav Kant 
Date:   Wed Mar 21 21:39:46 2018 +0530

update bundled headers - clipboard_changed

Change-Id: Idad3aef64acb01928f6f70010a0e9d7ed297aede

diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
index b90aa6279..020bbff90 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -568,6 +568,17 @@ typedef enum
  * - "close" - window is closed
  */
 LOK_CALLBACK_WINDOW = 36,
+
+/**
+ * Notification that the clipboard contents have changed.
+ * Typically fired in response to copying to clipboard.
+ *
+ * The payload currently is empty and it's up to the
+ * client to get the contents, if necessary. However,
+ * in the future the contents might be included for
+ * convenience.
+ */
+LOK_CALLBACK_CLIPBOARD_CHANGED = 37,
 }
 LibreOfficeKitCallbackType;
 
___
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-3' - loleaflet/src loleaflet/unocommands.js

2018-03-20 Thread Pranav Kant
 loleaflet/src/control/Control.Menubar.js |3 +++
 loleaflet/unocommands.js |1 +
 2 files changed, 4 insertions(+)

New commits:
commit 30e68822484f9375299183ecf24f1295fe713bf1
Author: Pranav Kant 
Date:   Tue Mar 13 15:30:37 2018 +0530

Insert Charts menu items

(cherry picked from commit 18fa0d7a7853c7131aef4db80376d07fe1862b10)

Change-Id: Iefaf90811f025a5d86249b9b582bf5658254d90a
Reviewed-on: https://gerrit.libreoffice.org/51626
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 81dd25fc5..de5235d0c 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -63,6 +63,7 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:InsertMenu', 'text'), type: 'menu', 
menu: [
{name: _UNO('.uno:InsertGraphic', 'text'), id: 
'insertgraphic', type: 'action'},
{name: _UNO('.uno:InsertAnnotation', 'text'), 
id: 'insertcomment', type: 'action'},
+   {uno: '.uno:InsertObjectChart'},
{type: 'separator'},
{name: _UNO('.uno:InsertField', 'text'), type: 
'menu', menu: [
{uno: '.uno:InsertPageNumberField'},
@@ -252,6 +253,7 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:InsertMenu', 'presentation'), type: 
'menu', menu: [
{name: _UNO('.uno:InsertGraphic', 
'presentation'), id: 'insertgraphic', type: 'action'},
{name: _UNO('.uno:InsertAnnotation', 
'presentation'), id: 'insertcomment', type: 'action'},
+   {uno: '.uno:InsertObjectChart'},
{type: 'separator'},
{uno: '.uno:HyperlinkDialog'},
{type: 'separator'},
@@ -324,6 +326,7 @@ L.Control.Menubar = L.Control.extend({
]},
{name: _UNO('.uno:InsertMenu', 'spreadsheet'), type: 
'menu', menu: [
{name: _UNO('.uno:InsertGraphic', 
'spreadsheet'), id: 'insertgraphic', type: 'action'},
+   {uno: '.uno:InsertObjectChart'},
{name: _UNO('.uno:InsertAnnotation', 
'spreadsheet'), id: 'insertcomment', type: 'action'},
{type: 'separator'},
{uno: '.uno:InsertSymbol'}
diff --git a/loleaflet/unocommands.js b/loleaflet/unocommands.js
index b77574953..d9d0b68eb 100644
--- a/loleaflet/unocommands.js
+++ b/loleaflet/unocommands.js
@@ -104,6 +104,7 @@ var unoCommandsArray = {
InsertMenu:{global:{menu:_('~Insert'),},},
InsertNeutralParagraph:{text:{menu:_('Insert Unnumbered Entry'),},},
InsertNonBreakingSpace:{global:{menu:_('~Non-breaking space'),},},
+   InsertObjectChart:{global:{menu:_('~Chart...')}},
InsertPageCountField:{text:{menu:_('Page ~Count'),},},
InsertPageFooter:{text:{menu:_('Foote~r'),},},
InsertPageHeader:{text:{menu:_('He~ader'),},},
___
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-3' - loleaflet/src

2018-03-20 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 37659326d9d081434c9b22b86849495a1211ceb1
Author: Pranav Kant 
Date:   Tue Mar 20 14:46:19 2018 +0530

lokdialog: Avoid flickering of dialog's child window

Setting canvas's width, height unnecessarily have a bad effect - it
flickers.

Change-Id: Ic00a7ab392b03ee7a66099255e21ebb7c8973314
(cherry picked from commit 2d9d2b585f0bf55fce01f30507932d9faad14397)
Reviewed-on: https://gerrit.libreoffice.org/51627
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 11a18ce78..bb1c0eb9d 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -365,8 +365,10 @@ L.Control.LokDialog = L.Control.extend({
if (!canvas)
return; // no floating window to paint to
 
-   canvas.width = width;
-   canvas.height = height;
+   if (width !== canvas.width)
+   canvas.width = width;
+   if (height !== canvas.height)
+   canvas.height = height;
var ctx = canvas.getContext('2d');
img.onload = function() {
ctx.drawImage(img, 0, 0);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-20 Thread Pranav Kant
 loleaflet/src/control/Control.LokDialog.js |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 2d9d2b585f0bf55fce01f30507932d9faad14397
Author: Pranav Kant 
Date:   Tue Mar 20 14:46:19 2018 +0530

lokdialog: Avoid flickering of dialog's child window

Setting canvas's width, height unnecessarily have a bad effect - it
flickers.

Change-Id: Ic00a7ab392b03ee7a66099255e21ebb7c8973314

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index af50aba02..f8de108bf 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -367,8 +367,10 @@ L.Control.LokDialog = L.Control.extend({
if (!canvas)
return; // no floating window to paint to
 
-   canvas.width = width;
-   canvas.height = height;
+   if (width !== canvas.width)
+   canvas.width = width;
+   if (height !== canvas.height)
+   canvas.height = height;
var ctx = canvas.getContext('2d');
img.onload = function() {
ctx.drawImage(img, 0, 0);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-20 Thread Pranav Kant
 loleaflet/dist/images/lc_drawchart-lc_insertobjectchart.svg |  617 
 loleaflet/dist/toolbar.css  |1 
 loleaflet/dist/toolbar/toolbar.js   |1 
 3 files changed, 619 insertions(+)

New commits:
commit 1457982881fe933a4614a5796e98a49510f953fc
Author: Pranav Kant 
Date:   Tue Mar 13 15:30:37 2018 +0530

Insert Charts option in menubar and toolbar

Change-Id: Ic542210477ab0a401be25b35e91cc9deefec75a9
Reviewed-on: https://gerrit.libreoffice.org/51538
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/loleaflet/dist/images/lc_drawchart-lc_insertobjectchart.svg 
b/loleaflet/dist/images/lc_drawchart-lc_insertobjectchart.svg
new file mode 100644
index 0..312f2c0b0
--- /dev/null
+++ b/loleaflet/dist/images/lc_drawchart-lc_insertobjectchart.svg
@@ -0,0 +1,617 @@
+
+
+
+http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="24"
+   height="24"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.3.1 r9886"
+   sodipodi:docname="lc_drawchart-lc_insertobjectchart.svg"
+   
inkscape:export-filename="/home/alexander/libo/icon-themes/tango_testing/cmd/lc_drawchart.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  
+
+  
+  
+
+
+  
+  
+
+
+
+
+  
+  
+
+
+  
+  
+
+
+
+
+
+
+
+
+
+
+  
+  
+
+  
+  
+
+  
+image/svg+xml
+http://purl.org/dc/dcmitype/StillImage"; />
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+  
+  
+
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+  
+   
+@font-face{font-family:'TrebuchetMS-Bold';src:url(&quot;data:;base64,\
+T1RUTwADACAAAQAQQ0ZGINnFGF0AAADFYUdQT1OwB73vAAAGJGZjbWFwAtwCtwAAADwA\
+AACEAQMMAAQAeBoAEAADAAoAIABDAFAAVQBhAGYAaQBsAG8AcgB0AHn//wAA\
+ACAAQwBQAFUAYQBlAGkAbABuAHIAdAB54f+//7P/r/+k/6H/n/+d/5z/mv+Z/5UAAQAA\
+AQAEAgABAQERVHJlYnVjaGV0TVMtQm9sZAABAQE7+BsMAPgU\
+BPgcDBX7Yvy8HAgUHAfYBR6gAEiCgSX/i4seoABIgoEl/4uLDAf3Pw/3XBD3XhGRHAVbEgACAQE/\
+TENvcHlyaWdodCAoYykgMTk5NiBNaWNyb3NvZnQgQ29ycG9yYXRpb24uIEFsbCByaWdodHMgcmVz\
+ZXJ2ZWQuL0ZTVHlwZSA4IGRlZgABACQAMQA2AEIARgBHAEoATQBPAFAAUwBVAFoPAgAB\
+ABsAHgCXAPEBPgHaAlICmwLlAwgDTQO+A+8ENwRvIPcU9/IV+ZT5lP2UB/0U9xQV+JT4lPyUBg78\
+lg73DhwEghwFaxUg+2sFxVEuqPsVG/sOJ1glPR89JGT7FfsxGvsxr/sQ1C8eL9PrXfcNG/ce9wC8\
+7tkf9w37ZgX7BSH7L1P7YRv7Yfszzvcb+wUf+wX3G1L3S/d9GvdtyvdJ9xL3Jh73JfcR9zXU91gb\
+9zz3GmlG8B8O0vgu+K8V/K/7mBwFuAeS90Hxj6gb93v3PmhE9h/2RMD7A/srGvvk+1r7PPwgbmON\
+kFoe+VAE/GkHhreuiaQb9wvhn7PCH8KypszkGvcs+w7X+4lwcImIch4O95X3KhwFuRX3mP51Bjyj\
+S7taHlq7zXLfG+nUo7zAH7+7pc3fGvpw95j+hAf7K1n7CiY2HjYm+xtg+z0b+z77F7XeLx8u3l33\
+DPcvGg5j+W/2FXRmZGxTdAhzUlB/Thv7BzCoxUkfScRq3fUa9xC67OjRHtHo9xiu9z8bqK6GgbMf\
+9xI7yvszLTx7bEweVfdWBbTh8aD3Cxv3N/cMZkHXH9dAsfsh+2Ma+3kH+yOoMsRmHnZndHVygwiC\
+cm6Hahtna5imbh9upniogaoIc/ghFZRga492G/tZKEr7FSvDW/cD9yrW1vcqHw65+tf4XxX9kQaQ\
+NqhIwVwIXMHUc+Yb9wbiqcbGH+z7UwVEM/sXZ/tDG/s3+xW76ywfLOpb9xr3Pxr3Pb/3HPT0HvTz\
+9xG/9yYb9y/3EV0u6R/pLrr7CvsjGmyEXX1NHv2I91AV+KIG9zF6NNn7MBv7IzM9+zFoHw78Cvlw\
+HAUBFZ1UYZRuG1xjd2JqH2piellQGoKLg4yCHvdy+2L7bv31+4759fsw92L3MQaQ9xey9dTcCNzT\
+6LP3BxvG1H5x4B8O/Jz33xwFzhWzrX1vqB+nbplpYxpjfWlvbx5ubml9YxtjaZmobx9up32tsxqz\
+ma2oqB6np62Zsxv7FRz6MhX59vsd92H4Gv7DBw73RhwFvhX3jscFHPtMB/sYsjzach5CZElmLhv7\
+BVLa9zEfDtn5zBb4/wfmes5otR61aFGgPBtmZIF2Yh9hdmpydGwI/Zr7jvrD90gHuScF28/vs/cZ\
+G/cT8GU/1R/UPrAh+x0a/SUHDqfM+K4V9ze69xnq8h7y6fcQvvcvG/c39xJaKOUf5Si4+xv7Pxr7\
+P137GzAmHiYv+xJZ+zMb+zf7Er7xMR8w8F73G/c9GveYFvuA4PsK9z7ZyarIuR64yKLj9wUa9302\
+9wj7PT1NbE5dHl1OdDX7AhoO+5T5hvnaFaheWppWG1FYcVZeH15WdEs/Gvz2+476w/eOKQfa0eiy\
+9wgb4M1+cbgfDvvT90H5+hX7EPdd9xD3bgb3jucF+8r3uvtd+7r8aQc+l1WjbB5ro7V7xxvHw5us\
+vx/7egd3UTiBIBsgOanIUh9Sx27h9wMaDmX49ftAFXBEUlA0XAhcMyVz+wkb93EH91Xru+zLcO1W\
+9xgf++P50wX3lwb3uP1495v5eAX3lwYO+PAU+v8VAAEKAB4ALAABREZMVAAIAAQA\
+//8AAQFrZXJuAAgBAQAEAAIBAAgAAQAmAAQCAA4AIAAEAAH/2wAF/6AA\
+Bv+gAAv/oAABAAX/wAABAAIAAwAMAAA=&quot;)}
+@font-face{font-family:'Arial-BoldMT';src:url(&quot;data:;base64,\
+T1RUTwADACAAAQAQQ0ZGILKMO8

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - 42 commits - basic/source canvas/source chart2/source comphelper/source cui/source desktop/qa desktop/source include/comphelper inclu

2018-03-19 Thread Pranav Kant
/openuriexternally.cxx  |   15 
 sfx2/source/appl/sfxhelp.cxx|   26 
 sfx2/source/dialog/basedlgs.cxx |   40 -
 sfx2/source/dialog/tabdlg.cxx   |6 
 sfx2/source/view/lokhelper.cxx  |   17 
 sfx2/source/view/viewsh.cxx |1 
 shell/Library_syssh.mk  |1 
 shell/source/unix/exec/shellexec.cxx|7 
 svx/source/dialog/fntctrl.cxx   |   34 -
 svx/source/engine3d/scene3d.cxx |   17 
 svx/source/svdraw/svdobj.cxx|5 
 svx/source/svdraw/svdpage.cxx   |1 
 sw/CppunitTest_sw_uibase_unit.mk|   31 +
 sw/Module_sw.mk |4 
 sw/inc/dbmgr.hxx|   17 
 sw/inc/textboxhelper.hxx|2 
 sw/qa/extras/ooxmlexport/data/parasplit-on-section-border.odt   |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx  |   13 
 sw/qa/extras/rtfexport/data/tdf114333.rtf   |5 
 sw/qa/extras/rtfexport/data/tdf97035.rtf|2 
 sw/qa/extras/rtfexport/rtfexport2.cxx   |4 
 sw/qa/extras/rtfexport/rtfexport3.cxx   |   12 
 sw/qa/extras/rtfimport/rtfimport.cxx|7 
 sw/qa/unit/uibase.cxx   |   44 +
 sw/source/core/doc/doclay.cxx   |5 
 sw/source/core/doc/textboxhelper.cxx|   21 
 sw/source/core/docnode/nodes.cxx|   82 +-
 sw/source/core/draw/dflyobj.cxx |6 
 sw/source/core/frmedt/feshview.cxx  |2 
 sw/source/core/inc/dflyobj.hxx  |2 
 sw/source/core/objectpositioning/anchoredobjectposition.cxx |2 
 sw/source/filter/ww8/rtfattributeoutput.cxx |   21 
 sw/source/filter/ww8/wrtw8nds.cxx   |   26 
 sw/source/uibase/dbui/dbmgr.cxx |   18 
 vcl/source/window/dialog.cxx|4 
 vcl/source/window/floatwin.cxx  |   12 
 vcl/source/window/menu.cxx  |   97 +++
 vcl/source/window/menubarwindow.cxx |   64 ++
 vcl/source/window/menubarwindow.hxx |1 
 vcl/source/window/menufloatingwindow.cxx|4 
 vcl/source/window/menuitemlist.hxx  |3 
 vcl/source/window/window.cxx|   47 -
 writerfilter/source/rtftok/rtfdispatchsymbol.cxx|5 
 writerfilter/source/rtftok/rtfdispatchvalue.cxx |8 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx  |8 
 writerfilter/source/rtftok/rtfdocumentimpl.hxx  |4 
 110 files changed, 1592 insertions(+), 564 deletions(-)

New commits:
commit fb51e433f8991c9a50fcd53e2845538a5710c776
Author: Pranav Kant 
Date:   Thu Dec 21 13:20:26 2017 +0530

lokdocview: Handle INVALIDATE_HEADER cb

With this calc gtktiledviewer or any other lok client shouldn't crash
anymore when a new view is opened.

And while at it, update documentation of callbacks.

(cherry picked from commit 71cd37fad9792038279969c82e0cb209df06f024)

Change-Id: I436c3b424dd4e2e6b8c312b0d3ba43d7006e944b

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index dc5f82d2f1e2..46be3f25fea8 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -540,7 +540,32 @@ typedef enum
  */
 LOK_CALLBACK_RULER_UPDATE = 35,
 /**
- * Dialog invalidation
+ * Window related callbacks are emitted under this category. It includes
+ * external windows like dialogs, autopopups for now.
+ *
+ * The payload format is:
+ *
+ * {
+ *"id": "unique integer id of the dialog",
+ *"action": "",
+ *"type": ""
+ *"rectangle": "x, y, width, height"
+ * }
+ *
+ * "type" tells the type of the window the action is associated with
+ *  - "dialog" - window is a dial

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

2018-03-19 Thread Pranav Kant
 loleaflet/dist/leaflet.css |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b480bcda56ad092c1a485d13a715b9284c927696
Author: Pranav Kant 
Date:   Mon Mar 19 21:56:44 2018 +0530

loleaflet: Keep the hidden input width 1x1 to keep safari happy

It's not possible otherwise to focus the  html element in Safari.
Unfortunately, making the input field 1x1 has the disadvantage that on
IE 11, a very small blinking artifact appears on bigger font size. There
doesn't seem to be any other solution to hide the cursor on IE without
messing up with IME candidate window position.

Without this patch, typing doesn't work on Safari at all which is much
much bigger of an issue than some artifact appearing on IE.

Change-Id: Ib618a96ba2ec3aa621ed448ffbf410113d8975b8
Reviewed-on: https://gerrit.libreoffice.org/51579
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 
(cherry picked from commit a61ddfe9b4dbaa88404a2f346aaaf531d525ca84)
Reviewed-on: https://gerrit.libreoffice.org/51580

diff --git a/loleaflet/dist/leaflet.css b/loleaflet/dist/leaflet.css
index 50f543957..d1a615a50 100644
--- a/loleaflet/dist/leaflet.css
+++ b/loleaflet/dist/leaflet.css
@@ -689,8 +689,8 @@ div.leaflet-cursor-container:hover > .leaflet-cursor-header 
{
}
 
 input.clipboard {
-   width: 0px;
-   height: 0px;
+   width: 1px;
+   height: 1px;
padding: 0px !important; /* w2ui defines "input:not([type=button])" 
rule which sets
the padding to non-zero. Hence, the 
!important. Otherwise,
clipboard cursor apperas in MSIE and MSEdge 
*/
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-19 Thread Pranav Kant
 loleaflet/dist/leaflet.css |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a61ddfe9b4dbaa88404a2f346aaaf531d525ca84
Author: Pranav Kant 
Date:   Mon Mar 19 21:56:44 2018 +0530

loleaflet: Keep the hidden input width 1x1 to keep safari happy

It's not possible otherwise to focus the  html element in Safari.
Unfortunately, making the input field 1x1 has the disadvantage that on
IE 11, a very small blinking artifact appears on bigger font size. There
doesn't seem to be any other solution to hide the cursor on IE without
messing up with IME candidate window position.

Without this patch, typing doesn't work on Safari at all which is much
much bigger of an issue than some artifact appearing on IE.

Change-Id: Ib618a96ba2ec3aa621ed448ffbf410113d8975b8
Reviewed-on: https://gerrit.libreoffice.org/51579
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/loleaflet/dist/leaflet.css b/loleaflet/dist/leaflet.css
index 50f543957..d1a615a50 100644
--- a/loleaflet/dist/leaflet.css
+++ b/loleaflet/dist/leaflet.css
@@ -689,8 +689,8 @@ div.leaflet-cursor-container:hover > .leaflet-cursor-header 
{
}
 
 input.clipboard {
-   width: 0px;
-   height: 0px;
+   width: 1px;
+   height: 1px;
padding: 0px !important; /* w2ui defines "input:not([type=button])" 
rule which sets
the padding to non-zero. Hence, the 
!important. Otherwise,
clipboard cursor apperas in MSIE and MSEdge 
*/
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-19 Thread Pranav Kant
 sd/source/ui/func/fuinsert.cxx |   21 ++---
 sd/source/ui/inc/View.hxx  |2 +-
 sd/source/ui/inc/Window.hxx|1 +
 sd/source/ui/view/sdview2.cxx  |   13 ++---
 sd/source/ui/view/sdwindow.cxx |   14 ++
 5 files changed, 20 insertions(+), 31 deletions(-)

New commits:
commit 34645630a5d730cc075fddf9a1a5cc6fe28c6f41
Author: Pranav Kant 
Date:   Thu Mar 8 21:07:40 2018 +0100

sd lok: Enable mapmode in case of lok to calculate center

This reverts the solution in 9fee132c18b658c9ea9fb1114c1fefa56b57532a.

Also, calculate center using the new function for chart, image, and text
shape insertion.

Reviewed-on: https://gerrit.libreoffice.org/51343
Tested-by: Jenkins 
Reviewed-by: pranavk 
(cherry picked from commit 1990fc47bb561fcb9f98cbdcb7f986b93a54b876)

Change-Id: I3386cf65d28d6537409a9e27e870c195d689ef50
Reviewed-on: https://gerrit.libreoffice.org/51531
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index f91f0663ff81..0b854ba27458 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -67,7 +67,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include "app.hrc"
 #include "sdresid.hxx"
@@ -171,20 +170,7 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq )
 bSelectionReplaced = true;
 }
 
-Point aPos;
-// For LOK, set position to center of the page
-if (comphelper::LibreOfficeKit::isActive())
-aPos = Rectangle(aPos, 
mpView->GetSdrPageView()->GetPage()->GetSize()).Center();
-else
-{
-Rectangle aRect(aPos, mpWindow->GetOutputSizePixel() );
-aPos = aRect.Center();
-bool bMapModeWasEnabled(mpWindow->IsMapModeEnabled());
-mpWindow->EnableMapMode(/*true*/);
-aPos = mpWindow->PixelToLogic(aPos);
-mpWindow->EnableMapMode(bMapModeWasEnabled);
-}
-
+Point aPos = mpWindow->GetVisibleCenter();
 SdrGrafObj* pGrafObj = mpView->InsertGraphic(aGraphic, nAction, 
aPos, pPickObj, nullptr);
 
 if(pGrafObj && bAsLink )
@@ -381,10 +367,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
 aSize = OutputDevice::LogicToLogic(aSize, aUnit, 
MapUnit::Map100thMM);
 }
 
-Point aPos;
-Rectangle aWinRect(aPos, mpWindow->GetOutputSizePixel() );
-aPos = aWinRect.Center();
-aPos = mpWindow->PixelToLogic(aPos);
+Point aPos = mpWindow->GetVisibleCenter();
 aPos.X() -= aSize.Width() / 2;
 aPos.Y() -= aSize.Height() / 2;
 aRect = Rectangle(aPos, aSize);
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index b88c780dfad7..607034ac9952 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -91,7 +91,7 @@ public:
 voidSelectAll();
 voidDoCut(vcl::Window* pWindow=nullptr);
 voidDoCopy(vcl::Window* pWindow=nullptr);
-voidDoPaste(vcl::Window* pWindow=nullptr);
+voidDoPaste(::sd::Window* pWindow=nullptr);
 virtual voidDoConnect(SdrOle2Obj* pOleObj) override;
 virtual boolSetStyleSheet(SfxStyleSheet* pStyleSheet, bool 
bDontRemoveHardAttr = false);
 voidStartDrag( const Point& rStartPos, vcl::Window* 
pWindow );
diff --git a/sd/source/ui/inc/Window.hxx b/sd/source/ui/inc/Window.hxx
index a91a71ea70d3..9031409164a5 100644
--- a/sd/source/ui/inc/Window.hxx
+++ b/sd/source/ui/inc/Window.hxx
@@ -131,6 +131,7 @@ public:
 voidSetVisibleXY(double fX, double fY);
 double  GetVisibleWidth();
 double  GetVisibleHeight();
+Point   GetVisibleCenter();
 double  GetScrlLineWidth();
 double  GetScrlLineHeight();
 double  GetScrlPageWidth();
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index 6b7427f55fad..57f18dcc6881 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -265,7 +265,7 @@ void View::DoCopy (vcl::Window* pWindow)
 }
 }
 
-void View::DoPaste (vcl::Window* pWindow)
+void View::DoPaste (::sd::Window* pWindow)
 {
 TransferableDataHelper aDataHelper( 
TransferableDataHelper::CreateFromSystemClipboard( mpViewSh->GetActiveWindow() 
) );
 if( !aDataHelper.GetTransferable().is() )
@@ -316,17 +316,8 @@ void View::DoPaste (vcl::Window* pWindow)
 }
 else
 {
-Point   aPos;
 sal_Int8nDnDAction = DND_ACTION_COPY;
-
-if( pWindow )
-{
-if (comphelper::LibreOfficeKit::isActiv

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

2018-03-19 Thread Pranav Kant
 loleaflet/dist/images/lc_drawchart-lc_insertobjectchart.svg |  617 
 loleaflet/dist/toolbar.css  |1 
 loleaflet/dist/toolbar/toolbar.js   |1 
 3 files changed, 619 insertions(+)

New commits:
commit 51bf1979546c13fc1b83324aaf71e71ab4b53af1
Author: Pranav Kant 
Date:   Tue Mar 13 15:30:37 2018 +0530

Insert Charts option in menubar and toolbar

Change-Id: Ic542210477ab0a401be25b35e91cc9deefec75a9
Reviewed-on: https://gerrit.libreoffice.org/51429
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/dist/images/lc_drawchart-lc_insertobjectchart.svg 
b/loleaflet/dist/images/lc_drawchart-lc_insertobjectchart.svg
new file mode 100644
index 0..312f2c0b0
--- /dev/null
+++ b/loleaflet/dist/images/lc_drawchart-lc_insertobjectchart.svg
@@ -0,0 +1,617 @@
+
+
+
+http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="24"
+   height="24"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.3.1 r9886"
+   sodipodi:docname="lc_drawchart-lc_insertobjectchart.svg"
+   
inkscape:export-filename="/home/alexander/libo/icon-themes/tango_testing/cmd/lc_drawchart.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  
+
+  
+  
+
+
+  
+  
+
+
+
+
+  
+  
+
+
+  
+  
+
+
+
+
+
+
+
+
+
+
+  
+  
+
+  
+  
+
+  
+image/svg+xml
+http://purl.org/dc/dcmitype/StillImage"; />
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+  
+  
+
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+  
+   
+@font-face{font-family:'TrebuchetMS-Bold';src:url(&quot;data:;base64,\
+T1RUTwADACAAAQAQQ0ZGINnFGF0AAADFYUdQT1OwB73vAAAGJGZjbWFwAtwCtwAAADwA\
+AACEAQMMAAQAeBoAEAADAAoAIABDAFAAVQBhAGYAaQBsAG8AcgB0AHn//wAA\
+ACAAQwBQAFUAYQBlAGkAbABuAHIAdAB54f+//7P/r/+k/6H/n/+d/5z/mv+Z/5UAAQAA\
+AQAEAgABAQERVHJlYnVjaGV0TVMtQm9sZAABAQE7+BsMAPgU\
+BPgcDBX7Yvy8HAgUHAfYBR6gAEiCgSX/i4seoABIgoEl/4uLDAf3Pw/3XBD3XhGRHAVbEgACAQE/\
+TENvcHlyaWdodCAoYykgMTk5NiBNaWNyb3NvZnQgQ29ycG9yYXRpb24uIEFsbCByaWdodHMgcmVz\
+ZXJ2ZWQuL0ZTVHlwZSA4IGRlZgABACQAMQA2AEIARgBHAEoATQBPAFAAUwBVAFoPAgAB\
+ABsAHgCXAPEBPgHaAlICmwLlAwgDTQO+A+8ENwRvIPcU9/IV+ZT5lP2UB/0U9xQV+JT4lPyUBg78\
+lg73DhwEghwFaxUg+2sFxVEuqPsVG/sOJ1glPR89JGT7FfsxGvsxr/sQ1C8eL9PrXfcNG/ce9wC8\
+7tkf9w37ZgX7BSH7L1P7YRv7Yfszzvcb+wUf+wX3G1L3S/d9GvdtyvdJ9xL3Jh73JfcR9zXU91gb\
+9zz3GmlG8B8O0vgu+K8V/K/7mBwFuAeS90Hxj6gb93v3PmhE9h/2RMD7A/srGvvk+1r7PPwgbmON\
+kFoe+VAE/GkHhreuiaQb9wvhn7PCH8KypszkGvcs+w7X+4lwcImIch4O95X3KhwFuRX3mP51Bjyj\
+S7taHlq7zXLfG+nUo7zAH7+7pc3fGvpw95j+hAf7K1n7CiY2HjYm+xtg+z0b+z77F7XeLx8u3l33\
+DPcvGg5j+W/2FXRmZGxTdAhzUlB/Thv7BzCoxUkfScRq3fUa9xC67OjRHtHo9xiu9z8bqK6GgbMf\
+9xI7yvszLTx7bEweVfdWBbTh8aD3Cxv3N/cMZkHXH9dAsfsh+2Ma+3kH+yOoMsRmHnZndHVygwiC\
+cm6Hahtna5imbh9upniogaoIc/ghFZRga492G/tZKEr7FSvDW/cD9yrW1vcqHw65+tf4XxX9kQaQ\
+NqhIwVwIXMHUc+Yb9wbiqcbGH+z7UwVEM/sXZ/tDG/s3+xW76ywfLOpb9xr3Pxr3Pb/3HPT0HvTz\
+9xG/9yYb9y/3EV0u6R/pLrr7CvsjGmyEXX1NHv2I91AV+KIG9zF6NNn7MBv7IzM9+zFoHw78Cvlw\
+HAUBFZ1UYZRuG1xjd2JqH2piellQGoKLg4yCHvdy+2L7bv31+4759fsw92L3MQaQ9xey9dTcCNzT\
+6LP3BxvG1H5x4B8O/Jz33xwFzhWzrX1vqB+nbplpYxpjfWlvbx5ubml9YxtjaZmobx9up32tsxqz\
+ma2oqB6np62Zsxv7FRz6MhX59vsd92H4Gv7DBw73RhwFvhX3jscFHPtMB/sYsjzach5CZElmLhv7\
+BVLa9zEfDtn5zBb4/wfmes5otR61aFGgPBtmZIF2Yh9hdmpydGwI/Zr7jvrD90gHuScF28/vs/cZ\
+G/cT8GU/1R/UPrAh+x0a/SUHDqfM+K4V9ze69xnq8h7y6fcQvvcvG/c39xJaKOUf5Si4+xv7Pxr7\
+P137GzAmHiYv+xJZ+zMb+zf7Er7xMR8w8F73G/c9GveYFvuA4PsK9z7ZyarIuR64yKLj9wUa9302\
+9wj7PT1NbE5dHl1OdDX7AhoO+5T5hvnaFaheWppWG1FYcVZeH15WdEs/Gvz2+476w/eOKQfa0eiy\
+9wgb4M1+cbgfDvvT90H5+hX7EPdd9xD3bgb3jucF+8r3uvtd+7r8aQc+l1WjbB5ro7V7xxvHw5us\
+vx/7egd3UTiBIBsgOanIUh9Sx27h9wMaDmX49ftAFXBEUlA0XAhcMyVz+wkb93EH91Xru+zLcO1W\
+9xgf++P50wX3lwb3uP1495v5eAX3lwYO+PAU+v8VAAEKAB4ALAABREZMVAAIAAQA\
+//8AAQFrZXJuAAgBAQAEAAIBAAgAAQAmAAQCAA4AIAAEAAH/2wAF/6AA\
+Bv+gAAv/oAABAAX/wAABAAIAAwAMAAA=&quot;)}
+@font-face{font-family:'Arial-BoldMT';src:url(&quot;data:;base64,\
+T1RUTwADACAAAQAQQ0ZGILKMO8

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

2018-03-19 Thread Pranav Kant
 sd/source/ui/view/sdwindow.cxx |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit be8883bcb250bdbfbb77a76b244d97a30a97d77a
Author: Pranav Kant 
Date:   Mon Mar 19 11:50:26 2018 +0530

sd: fix incorrect visible center calculation

Don't call PixelToLogic twice. Thanks Ashod for noticing.

Change-Id: Id280dad7e310ceaf8678f900e6e70214848dd925
Reviewed-on: https://gerrit.libreoffice.org/51529
Tested-by: Jenkins 
Reviewed-by: pranavk 

diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 2d17fbe5ec3b..aa7cdc59de09 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -685,14 +685,8 @@ double Window::GetVisibleHeight()
 
 Point Window::GetVisibleCenter()
 {
-Size aWinSize = PixelToLogic(GetOutputSizePixel());
-if ( aWinSize.Height() > maViewSize.Height() )
-aWinSize.setHeight( maViewSize.Height() );
-if ( aWinSize.Width() > maViewSize.Width() )
-aWinSize.setWidth( maViewSize.Width() );
-
 Point aPos;
-aPos = ::tools::Rectangle(aPos, aWinSize).Center();
+aPos = ::tools::Rectangle(aPos, GetOutputSizePixel()).Center();
 
 // For LOK
 bool bMapModeWasEnabled(IsMapModeEnabled());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-18 Thread Pranav Kant
 vcl/source/window/dialog.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 7be3dfa4b4705725be4987beeb79dbe5f6a4edae
Author: Pranav Kant 
Date:   Mon Mar 19 12:04:40 2018 +0530

cid#1430098: mbInSyncExecute is uninitialized

Change-Id: Id5288ce8680b121522c1e35edc52ef24be4ead8b

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 11670c6459b6..16aa5293f9b1 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -372,6 +372,7 @@ void Dialog::ImplInitDialogData()
 {
 mpWindowImpl->mbDialog  = true;
 mbInExecute = false;
+mbInSyncExecute = false;
 mbInClose   = false;
 mbModalMode = false;
 mbPaintComplete = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-16 Thread Pranav Kant
 sd/source/ui/func/fuinsert.cxx |   21 ++---
 sd/source/ui/inc/View.hxx  |2 +-
 sd/source/ui/inc/Window.hxx|1 +
 sd/source/ui/view/sdview2.cxx  |   13 ++---
 sd/source/ui/view/sdwindow.cxx |   20 
 5 files changed, 26 insertions(+), 31 deletions(-)

New commits:
commit 1990fc47bb561fcb9f98cbdcb7f986b93a54b876
Author: Pranav Kant 
Date:   Thu Mar 8 21:07:40 2018 +0100

sd lok: Enable mapmode in case of lok to calculate center

This reverts the solution in 9fee132c18b658c9ea9fb1114c1fefa56b57532a.

Also, calculate center using the new function for chart, image, and text
shape insertion.

Change-Id: Ie893050b7c875760db0194e7a3f0c2cd3068963b
Reviewed-on: https://gerrit.libreoffice.org/51343
Tested-by: Jenkins 
Reviewed-by: pranavk 

diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 7d18f8e6ab4c..397580a029e1 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -69,7 +69,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -170,20 +169,7 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq )
 bSelectionReplaced = true;
 }
 
-Point aPos;
-// For LOK, set position to center of the page
-if (comphelper::LibreOfficeKit::isActive())
-aPos = ::tools::Rectangle(aPos, 
mpView->GetSdrPageView()->GetPage()->GetSize()).Center();
-else
-{
-::tools::Rectangle aRect(aPos, mpWindow->GetOutputSizePixel() 
);
-aPos = aRect.Center();
-bool bMapModeWasEnabled(mpWindow->IsMapModeEnabled());
-mpWindow->EnableMapMode(/*true*/);
-aPos = mpWindow->PixelToLogic(aPos);
-mpWindow->EnableMapMode(bMapModeWasEnabled);
-}
-
+Point aPos = mpWindow->GetVisibleCenter();
 SdrGrafObj* pGrafObj = mpView->InsertGraphic(aGraphic, nAction, 
aPos, pPickObj, nullptr);
 
 if(pGrafObj && bAsLink )
@@ -380,10 +366,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
 aSize = OutputDevice::LogicToLogic(aSize, MapMode(aUnit), 
MapMode(MapUnit::Map100thMM));
 }
 
-Point aPos;
-::tools::Rectangle aWinRect(aPos, 
mpWindow->GetOutputSizePixel() );
-aPos = aWinRect.Center();
-aPos = mpWindow->PixelToLogic(aPos);
+Point aPos = mpWindow->GetVisibleCenter();
 aPos.AdjustX( -(aSize.Width() / 2) );
 aPos.AdjustY( -(aSize.Height() / 2) );
 aRect = ::tools::Rectangle(aPos, aSize);
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index 271a8850f707..962b6d43f56e 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -91,7 +91,7 @@ public:
 voidSelectAll();
 voidDoCut();
 voidDoCopy();
-voidDoPaste(vcl::Window const * pWindow=nullptr);
+voidDoPaste(::sd::Window* pWindow=nullptr);
 virtual voidDoConnect(SdrOle2Obj* pOleObj) override;
 virtual boolSetStyleSheet(SfxStyleSheet* pStyleSheet, bool 
bDontRemoveHardAttr = false);
 voidStartDrag( const Point& rStartPos, vcl::Window* 
pWindow );
diff --git a/sd/source/ui/inc/Window.hxx b/sd/source/ui/inc/Window.hxx
index d1aa74a91602..d03890f6f491 100644
--- a/sd/source/ui/inc/Window.hxx
+++ b/sd/source/ui/inc/Window.hxx
@@ -131,6 +131,7 @@ public:
 voidSetVisibleXY(double fX, double fY);
 double  GetVisibleWidth();
 double  GetVisibleHeight();
+Point   GetVisibleCenter();
 double  GetScrlLineWidth();
 double  GetScrlLineHeight();
 double  GetScrlPageWidth();
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index 81aff44869e2..57db0d9bef2d 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -264,7 +264,7 @@ void View::DoCopy()
 }
 }
 
-void View::DoPaste (vcl::Window const * pWindow)
+void View::DoPaste (::sd::Window* pWindow)
 {
 TransferableDataHelper aDataHelper( 
TransferableDataHelper::CreateFromSystemClipboard( mpViewSh->GetActiveWindow() 
) );
 if( !aDataHelper.GetTransferable().is() )
@@ -315,17 +315,8 @@ void View::DoPaste (vcl::Window const * pWindow)
 }
 else
 {
-Point   aPos;
 sal_Int8nDnDAction = DND_ACTION_COPY;
-
-if( pWindow )
-{
-if (comphelper::LibreOfficeKit::isActive())
-aPos = ::tools::Rectangle(aPos, 
GetSdrPageView()->GetPage()->GetSize()).Center();
-else
-aPos = pWindow->PixelToLogic( ::tools::Rectangle( aPos, 
pWindow->Get

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

2018-03-16 Thread Pranav Kant
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   20 
 sd/source/ui/inc/ViewShell.hxx   |2 ++
 sd/source/ui/unoidl/unomodel.cxx |   14 --
 sd/source/ui/view/viewshe2.cxx   |   12 
 4 files changed, 46 insertions(+), 2 deletions(-)

New commits:
commit 21f56ccbd22ffa347edf931b7ed93c99988fbb8a
Author: Pranav Kant 
Date:   Thu Mar 15 20:09:26 2018 +0530

sd lok: Set the view size to full page size + fix unit tests

... such that during insertion of objects when sd calculates the center
of the view to place the object, it is the center of the whole slide,
not the center of the default rectangle of 800x600.

It's also important to hide rulers, scrollbars so that correct center is
calculated; we don't need them anyways in LOK.

Change-Id: I2d1577bc963d324959b272ed3174571ab197d014
Reviewed-on: https://gerrit.libreoffice.org/51416
Tested-by: Jenkins 
Reviewed-by: pranavk 

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index b0ea2340574a..94f5e1b52e0d 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -339,6 +339,7 @@ xmlDocPtr SdTiledRenderingTest::parseXmlDump()
 
 void SdTiledRenderingTest::testRegisterCallback()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
 
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback,
 this);
@@ -354,6 +355,7 @@ void SdTiledRenderingTest::testRegisterCallback()
 CPPUNIT_ASSERT(!m_aInvalidation.IsEmpty());
 ::tools::Rectangle aTopLeft(0, 0, 256*15, 256*15); // 1 px = 15 twips, 
assuming 96 DPI.
 CPPUNIT_ASSERT(m_aInvalidation.IsOver(aTopLeft));
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testPostKeyEvent()
@@ -423,6 +425,7 @@ void SdTiledRenderingTest::testPostMouseEvent()
 
 void SdTiledRenderingTest::testSetTextSelection()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
 uno::Reference 
xDrawPage(pXImpressDocument->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
 uno::Reference xShape(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
@@ -447,10 +450,12 @@ void SdTiledRenderingTest::testSetTextSelection()
 pXImpressDocument->setTextSelection(LOK_SETTEXTSELECTION_END, aEnd.getX(), 
aEnd.getY());
 // The new selection must include the ending dot, too -- but not the first 
word.
 CPPUNIT_ASSERT_EQUAL(OUString("bbb."), rEditView.GetSelected());
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testGetTextSelection()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
 uno::Reference 
xDrawPage(pXImpressDocument->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
 uno::Reference xShape(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
@@ -471,10 +476,12 @@ void SdTiledRenderingTest::testGetTextSelection()
 
 // Make sure returned RTF is not empty.
 CPPUNIT_ASSERT(!pXImpressDocument->getTextSelection("text/rtf", 
aUsedFormat).isEmpty());
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testSetGraphicSelection()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
 SdPage* pPage = pViewShell->GetActualPage();
@@ -504,10 +511,13 @@ void SdTiledRenderingTest::testSetGraphicSelection()
 // Check that a resize happened, but aspect ratio is not kept.
 CPPUNIT_ASSERT_EQUAL(aShapeBefore.getWidth(), aShapeAfter.getWidth());
 CPPUNIT_ASSERT(aShapeBefore.getHeight() < aShapeAfter.getHeight());
+
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testUndoShells()
 {
+comphelper::LibreOfficeKit::setActive();
 // Load a document and set the page size.
 SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
 uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence(
@@ -525,10 +535,12 @@ void SdTiledRenderingTest::testUndoShells()
 sal_Int32 nView1 = SfxLokHelper::getView();
 // This was -1, SdUndoGroup did not track what view shell created it.
 CPPUNIT_ASSERT_EQUAL(ViewShellId(nView1), 
pUndoManager->GetUndoAction()->GetViewShellId());
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testResetSelection()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDoc

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

2018-03-16 Thread Pranav Kant
 loleaflet/src/control/Control.Menubar.js |3 +++
 loleaflet/unocommands.js |1 +
 2 files changed, 4 insertions(+)

New commits:
commit 18fa0d7a7853c7131aef4db80376d07fe1862b10
Author: Pranav Kant 
Date:   Tue Mar 13 15:30:37 2018 +0530

Insert Charts menu items

Change-Id: Ic542210477ab0a401be25b35e91cc9deefec75a9

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index d72e6f999..90da54a95 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -65,6 +65,7 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:InsertMenu', 'text'), type: 'menu', 
menu: [
{name: _UNO('.uno:InsertGraphic', 'text'), id: 
'insertgraphic', type: 'action'},
{name: _UNO('.uno:InsertAnnotation', 'text'), 
id: 'insertcomment', type: 'action'},
+   {uno: '.uno:InsertObjectChart'},
{type: 'separator'},
{name: _UNO('.uno:InsertField', 'text'), type: 
'menu', menu: [
{uno: '.uno:InsertPageNumberField'},
@@ -256,6 +257,7 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:InsertMenu', 'presentation'), type: 
'menu', menu: [
{name: _UNO('.uno:InsertGraphic', 
'presentation'), id: 'insertgraphic', type: 'action'},
{name: _UNO('.uno:InsertAnnotation', 
'presentation'), id: 'insertcomment', type: 'action'},
+   {uno: '.uno:InsertObjectChart'},
{type: 'separator'},
{uno: '.uno:HyperlinkDialog'},
{type: 'separator'},
@@ -330,6 +332,7 @@ L.Control.Menubar = L.Control.extend({
]},
{name: _UNO('.uno:InsertMenu', 'spreadsheet'), type: 
'menu', menu: [
{name: _UNO('.uno:InsertGraphic', 
'spreadsheet'), id: 'insertgraphic', type: 'action'},
+   {uno: '.uno:InsertObjectChart'},
{name: _UNO('.uno:InsertAnnotation', 
'spreadsheet'), id: 'insertcomment', type: 'action'},
{type: 'separator'},
{uno: '.uno:InsertSymbol'}
diff --git a/loleaflet/unocommands.js b/loleaflet/unocommands.js
index 2a41c046e..65fe8ca00 100644
--- a/loleaflet/unocommands.js
+++ b/loleaflet/unocommands.js
@@ -103,6 +103,7 @@ var unoCommandsArray = {
InsertMenu:{global:{menu:_('~Insert'),},},
InsertNeutralParagraph:{text:{menu:_('Insert Unnumbered Entry'),},},
InsertNonBreakingSpace:{global:{menu:_('~Non-breaking space'),},},
+   InsertObjectChart:{global:{menu:_('~Chart...')}},
InsertPageCountField:{text:{menu:_('Page ~Count'),},},
InsertPageFooter:{text:{menu:_('Foote~r'),},},
InsertPageHeader:{text:{menu:_('He~ader'),},},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-16 Thread Pranav Kant
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit b8f1795a9136b4ab8e5fa6e62d86a2b113699a46
Author: Pranav Kant 
Date:   Fri Mar 16 18:07:52 2018 +0530

sd lok: guard all tests with lok flag

This was also the cause of one of the test failure in sd
after 263790b806794a69d8f13f470e6a1933a9ebe53c

Change-Id: I2a85faf416dad19c8aa8f544b54c7b84e49a8f96
Reviewed-on: https://gerrit.libreoffice.org/51418
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 73e1e2e629bc..2e879f56cf4f 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -326,6 +326,7 @@ xmlDocPtr SdTiledRenderingTest::parseXmlDump()
 
 void SdTiledRenderingTest::testRegisterCallback()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
 
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback,
 this);
@@ -341,6 +342,7 @@ void SdTiledRenderingTest::testRegisterCallback()
 CPPUNIT_ASSERT(!m_aInvalidation.IsEmpty());
 Rectangle aTopLeft(0, 0, 256*15, 256*15); // 1 px = 15 twips, assuming 96 
DPI.
 CPPUNIT_ASSERT(m_aInvalidation.IsOver(aTopLeft));
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testPostKeyEvent()
@@ -410,6 +412,7 @@ void SdTiledRenderingTest::testPostMouseEvent()
 
 void SdTiledRenderingTest::testSetTextSelection()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
 uno::Reference 
xDrawPage(pXImpressDocument->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
 uno::Reference xShape(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
@@ -434,10 +437,12 @@ void SdTiledRenderingTest::testSetTextSelection()
 pXImpressDocument->setTextSelection(LOK_SETTEXTSELECTION_END, aEnd.getX(), 
aEnd.getY());
 // The new selection must include the ending dot, too -- but not the first 
word.
 CPPUNIT_ASSERT_EQUAL(OUString("bbb."), rEditView.GetSelected());
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testGetTextSelection()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
 uno::Reference 
xDrawPage(pXImpressDocument->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
 uno::Reference xShape(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
@@ -458,10 +463,12 @@ void SdTiledRenderingTest::testGetTextSelection()
 
 // Make sure returned RTF is not empty.
 CPPUNIT_ASSERT(!OString(pXImpressDocument->getTextSelection("text/rtf", 
aUsedFormat)).isEmpty());
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testSetGraphicSelection()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
 sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
 SdPage* pPage = pViewShell->GetActualPage();
@@ -491,10 +498,13 @@ void SdTiledRenderingTest::testSetGraphicSelection()
 // Check that a resize happened, but aspect ratio is not kept.
 CPPUNIT_ASSERT_EQUAL(aShapeBefore.getWidth(), aShapeAfter.getWidth());
 CPPUNIT_ASSERT(aShapeBefore.getHeight() < aShapeAfter.getHeight());
+
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testUndoShells()
 {
+comphelper::LibreOfficeKit::setActive();
 // Load a document and set the page size.
 SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
 uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence(
@@ -512,10 +522,12 @@ void SdTiledRenderingTest::testUndoShells()
 sal_Int32 nView1 = SfxLokHelper::getView();
 // This was -1, SdUndoGroup did not track what view shell created it.
 CPPUNIT_ASSERT_EQUAL(nView1, 
pUndoManager->GetUndoAction()->GetViewShellId());
+comphelper::LibreOfficeKit::setActive(false);
 }
 
 void SdTiledRenderingTest::testResetSelection()
 {
+comphelper::LibreOfficeKit::setActive();
 SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
 uno::Reference 
xDrawPage(pXImpressDocument->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
 uno::Reference xShape(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
@@ -536,6 +548,7 @@ void SdTiledRenderingTest::testResetSelection()
 // Now use resetSelection() to reset the selection.
 pXImpressDocument->resetSelection();
 CPPUNIT_ASSERT(!pView->GetTextEditObject());

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

2018-03-16 Thread Pranav Kant
 chart2/source/controller/main/ChartController_Window.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit eb76e16abba16d88acd342779a8216dd64d60955
Author: Pranav Kant 
Date:   Thu Mar 15 16:48:18 2018 +0530

chart2 lok: tunnel context menu of the chart edit view

Change-Id: I0c8b3cfe1666ad81f808871a87e4b0fa64ef593c
Reviewed-on: https://gerrit.libreoffice.org/51345
Tested-by: Jenkins 
Reviewed-by: pranavk 

diff --git a/chart2/source/controller/main/ChartController_Window.cxx 
b/chart2/source/controller/main/ChartController_Window.cxx
index e3df574732de..83dfc4a1a0c0 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -58,15 +58,16 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
 
 #include 
 
+#include 
 #include 
 #include 
-
 #include 
 #include 
 #include 
@@ -1253,6 +1254,12 @@ void ChartController::execute_Command( const 
CommandEvent& rCEvt )
 if ( !xPopupController.is() || !xPopupMenu.is() )
 return;
 
+if (comphelper::LibreOfficeKit::isActive())
+{
+PopupMenu* pPopupMenu = 
static_cast(VCLXMenu::GetImplementation(xPopupMenu)->GetMenu());
+pPopupMenu->SetLOKNotifier(SfxViewShell::Current());
+}
+
 xPopupController->setPopupMenu( xPopupMenu );
 xPopupMenu->execute( css::uno::Reference< css::awt::XWindowPeer >( 
m_xFrame->getContainerWindow(), css::uno::UNO_QUERY ),
  css::awt::Rectangle( aPos.X(), aPos.Y(), 0, 0 ),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-16 Thread Pranav Kant
 chart2/source/controller/main/ChartController_Window.cxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 60edca8d8a9f00d3220255324d30ae41464a4e82
Author: Pranav Kant 
Date:   Thu Mar 15 16:48:18 2018 +0530

chart2 lok: tunnel context menu of the chart edit view

Change-Id: I0c8b3cfe1666ad81f808871a87e4b0fa64ef593c
Reviewed-on: https://gerrit.libreoffice.org/51355
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/chart2/source/controller/main/ChartController_Window.cxx 
b/chart2/source/controller/main/ChartController_Window.cxx
index 2989e32d4faa..58f7206554ec 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -55,14 +55,16 @@
 #include 
 #include 
 #include 
+
+#include 
 #include 
 #include 
 
 #include 
 
+#include 
 #include 
 #include 
-
 #include 
 #include 
 #include 
@@ -1232,6 +1234,12 @@ void ChartController::execute_Command( const 
CommandEvent& rCEvt )
 if ( !xPopupController.is() || !xPopupMenu.is() )
 return;
 
+if (comphelper::LibreOfficeKit::isActive())
+{
+PopupMenu* pPopupMenu = 
static_cast(VCLXMenu::GetImplementation(xPopupMenu)->GetMenu());
+pPopupMenu->SetLOKNotifier(SfxViewShell::Current());
+}
+
 xPopupController->setPopupMenu( xPopupMenu );
 xPopupMenu->execute( css::uno::Reference< css::awt::XWindowPeer >( 
m_xFrame->getContainerWindow(), css::uno::UNO_QUERY ),
  css::awt::Rectangle( aPos.X(), aPos.Y(), 0, 0 ),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-16 Thread Pranav Kant
 sd/source/ui/inc/ViewShell.hxx   |2 ++
 sd/source/ui/unoidl/unomodel.cxx |   14 --
 sd/source/ui/view/viewshe2.cxx   |   12 
 3 files changed, 26 insertions(+), 2 deletions(-)

New commits:
commit 1354bafdc707b87f8db1e89c96382c4f4f460554
Author: Pranav Kant 
Date:   Thu Mar 15 20:09:26 2018 +0530

sd lok: Set the view size to full page size and hide ruler, scrollbars

... such that during insertion of objects when sd calculates the center
of the view to place the object, it is the center of the whole slide,
not the center of the default rectangle of 800x600.

It's also important to hide rulers, scrollbars so that correct center is
calculated; we don't need them anyways in LOK.

Change-Id: I1180541c1b8c8a35f39112ca0a670c9d96d1320b
Reviewed-on: https://gerrit.libreoffice.org/51347
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx
index c3219dd4db52..a3d82ba4f0c6 100644
--- a/sd/source/ui/inc/ViewShell.hxx
+++ b/sd/source/ui/inc/ViewShell.hxx
@@ -197,6 +197,8 @@ public:
 
 bool HasRuler() { return mbHasRulers;}
 void SetRuler(bool bRuler);
+// Hides horizontal, vertical scrollbar as well as scrollbox
+void SetScrollBarsVisible(bool bVisible);
 
 /** Set internal values of all scroll bars that determine thumb size and
 position.  The external values like size and position of the scroll
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 8c8569a1a009..afe7ede9bde5 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2446,11 +2446,21 @@ void 
SdXImpressDocument::initializeForTiledRendering(const css::uno::SequenceGetSdOptions(mpDoc->GetDocumentType());
 
pOptions->SetShowComments(comphelper::LibreOfficeKit::isTiledAnnotations());
 
-// Disable map mode, so that it's possible to send mouse event 
coordinates
-// in logic units.
+pViewShell->SetRuler(false);
+pViewShell->SetScrollBarsVisible(false);
+
 if (sd::Window* pWindow = pViewShell->GetActiveWindow())
 {
+// get the full page size in pixels
+pWindow->EnableMapMode();
+Size 
aSize(pWindow->LogicToPixel(pDrawView->GetSdrPageView()->GetPage()->GetSize()));
+// Disable map mode, so that it's possible to send mouse event
+// coordinates in logic units
 pWindow->EnableMapMode(false);
+
+// arrange UI elements again with new view size
+pViewShell->GetParentWindow()->SetSizePixel(aSize);
+pViewShell->Resize();
 }
 
 // Forces all images to be swapped in synchronously, this
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index 6a2d2eec54e2..aaf69b6775f5 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -939,6 +939,18 @@ void ViewShell::SetRuler(bool bRuler)
 GetViewShell()->InvalidateBorder();
 }
 
+void ViewShell::SetScrollBarsVisible(bool bVisible)
+{
+if (mpVerticalScrollBar.get() != nullptr)
+mpVerticalScrollBar->Show( bVisible );
+
+if (mpHorizontalScrollBar.get() != nullptr)
+mpHorizontalScrollBar->Show( bVisible );
+
+if (mpScrollBarBox.get() != nullptr)
+mpScrollBarBox->Show(bVisible);
+}
+
 sal_Int8 ViewShell::AcceptDrop (
 const AcceptDropEvent& rEvt,
 DropTargetHelper& rTargetHelper,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-16 Thread Pranav Kant
 loleaflet/src/map/handler/Map.Keyboard.js |   20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

New commits:
commit 8a713ec7a56c6dfa176e64177a870a14e7209758
Author: Pranav Kant 
Date:   Mon Mar 12 17:41:36 2018 +0530

loleaflet: firefox emits 'keypress' for shift+insert too

So, we need to ignore the key event in the start of the handler.
Otherwise, in the case of firefox, us ignoring it in 'keydown' gets it
handled in 'keypress' which does double copy/paste.

Change-Id: I93f0e5c7db8817fab42764d0f0d3b12b50d62f81
Reviewed-on: https://gerrit.libreoffice.org/51134
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/loleaflet/src/map/handler/Map.Keyboard.js 
b/loleaflet/src/map/handler/Map.Keyboard.js
index 5f63b4473..aade802a0 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -182,17 +182,16 @@ L.Map.Keyboard = L.Handler.extend({
this._map.off('compositionstart compositionupdate 
compositionend textInput', this._onKeyDown, this);
},
 
-   _handleOnKeyDown: function (keyCode, modifier) {
-   if (modifier & this.keyModifier.shift) {
+   _ignoreKeyEvent: function(e) {
+   var shift = e.originalEvent.shiftKey ? this.keyModifier.shift : 
0;
+   if (shift && (e.originalEvent.keyCode === 45 || 
e.originalEvent.keyCode === 46)) {
// don't handle shift+insert, shift+delete
// These are converted to 'cut', 'paste' events which 
are
// automatically handled by us, so avoid double-handling
-   if (keyCode === 45 || keyCode === 46) {
-   return false;
-   }
+   return true;
}
 
-   return this.handleOnKeyDownKeys[keyCode];
+   return false;
},
 
_setPanOffset: function (pan) {
@@ -336,16 +335,19 @@ L.Map.Keyboard = L.Handler.extend({
if (this._map._permission === 'edit') {
docLayer._resetPreFetching();
 
-   if (e.type === 'keydown') {
+   if (this._ignoreKeyEvent(e)) {
+   // key ignored
+   }
+   else if (e.type === 'keydown') {
this._keyHandled = false;
this._bufferedTextInputEvent = null;
 
-   if (this._handleOnKeyDown(keyCode, 
this.modifier) && charCode === 0) {
+   if (this.handleOnKeyDownKeys[keyCode] && 
charCode === 0) {
keyEventFn('input', charCode, 
unoKeyCode);
}
}
else if ((e.type === 'keypress' || e.type === 
'compositionend') &&
-(!this._handleOnKeyDown(keyCode, 
this.modifier) || charCode !== 0)) {
+(!this.handleOnKeyDownKeys[keyCode] || 
charCode !== 0)) {
if (charCode === keyCode && charCode !== 13) {
// Chrome sets keyCode = charCode for 
printable keys
// while LO requires it to be 0
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-16 Thread Pranav Kant
 vcl/source/window/window2.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit b2428496de5cd579f4cdb0f149e2cebb8b12dd4d
Author: Pranav Kant 
Date:   Wed Mar 14 14:55:05 2018 +0530

lokdialog: Invalidate upon window size change

This problem can be seen with some of the dialogs like chart dialogs
where not all of the area which should be invalidated is invalidated.
The reason being that their container gets resized but not
lok-invalidated.

Change-Id: I12eb68e8644ca67b2666badb7b772b92a145c624
Reviewed-on: https://gerrit.libreoffice.org/51264
Tested-by: Jenkins 
Reviewed-by: pranavk 

diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index af41df0d4a15..937eda35e013 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1392,6 +1392,12 @@ void Window::queue_resize(StateChangedType eReason)
 if (pBorderWindow)
 pBorderWindow->Resize();
 }
+
+if (VclPtr pParent = GetParentWithLOKNotifier())
+{
+if (GetParentDialog())
+LogicInvalidate(nullptr);
+}
 }
 
 namespace
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-15 Thread Pranav Kant
 vcl/source/window/window2.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 1cccf64c10d1ed6bd7c10422e57d2adfa5f9ca26
Author: Pranav Kant 
Date:   Wed Mar 14 14:55:05 2018 +0530

lokdialog: Invalidate upon window size change

This problem can be seen with some of the dialogs like chart dialogs
where not all of the area which should be invalidated is invalidated.
The reason being that their container gets resized but not
lok-invalidated.

Change-Id: I12eb68e8644ca67b2666badb7b772b92a145c624
(cherry picked from commit 73fa910577ec99cf6331123d2fedffa5687b7e6f)
Reviewed-on: https://gerrit.libreoffice.org/51265
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 8e3d2dc0d212..e45fee287fd0 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1396,6 +1396,12 @@ void Window::queue_resize(StateChangedType eReason)
 if (pBorderWindow)
 pBorderWindow->Resize();
 }
+
+if (VclPtr pParent = GetParentWithLOKNotifier())
+{
+if (GetParentDialog())
+LogicInvalidate(nullptr);
+}
 }
 
 namespace
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-15 Thread Pranav Kant
 sd/source/ui/inc/ViewShell.hxx   |2 ++
 sd/source/ui/unoidl/unomodel.cxx |   14 --
 sd/source/ui/view/viewshe2.cxx   |   12 
 3 files changed, 26 insertions(+), 2 deletions(-)

New commits:
commit 263790b806794a69d8f13f470e6a1933a9ebe53c
Author: Pranav Kant 
Date:   Thu Mar 15 20:09:26 2018 +0530

sd lok: Set the view size to full page size and hide ruler, scrollbars

... such that during insertion of objects when sd calculates the center
of the view to place the object, it is the center of the whole slide,
not the center of the default rectangle of 800x600.

It's also important to hide rulers, scrollbars so that correct center is
calculated; we don't need them anyways in LOK.

Change-Id: I1180541c1b8c8a35f39112ca0a670c9d96d1320b
Reviewed-on: https://gerrit.libreoffice.org/51357
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx
index 075cb634389c..a8175fd2d660 100644
--- a/sd/source/ui/inc/ViewShell.hxx
+++ b/sd/source/ui/inc/ViewShell.hxx
@@ -192,6 +192,8 @@ public:
 
 bool HasRuler() { return mbHasRulers;}
 void SetRuler(bool bRuler);
+// Hides horizontal, vertical scrollbar as well as scrollbox
+void SetScrollBarsVisible(bool bVisible);
 
 /** Set internal values of all scroll bars that determine thumb size and
 position.  The external values like size and position of the scroll
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 597787533010..1ef0abf95111 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2476,11 +2476,21 @@ void 
SdXImpressDocument::initializeForTiledRendering(const css::uno::SequenceGetSdOptions(mpDoc->GetDocumentType());
 
pOptions->SetShowComments(comphelper::LibreOfficeKit::isTiledAnnotations());
 
-// Disable map mode, so that it's possible to send mouse event 
coordinates
-// in logic units.
+pViewShell->SetRuler(false);
+pViewShell->SetScrollBarsVisible(false);
+
 if (sd::Window* pWindow = pViewShell->GetActiveWindow())
 {
+// get the full page size in pixels
+pWindow->EnableMapMode();
+Size 
aSize(pWindow->LogicToPixel(pDrawView->GetSdrPageView()->GetPage()->GetSize()));
+// Disable map mode, so that it's possible to send mouse event
+// coordinates in logic units
 pWindow->EnableMapMode(false);
+
+// arrange UI elements again with new view size
+pViewShell->GetParentWindow()->SetSizePixel(aSize);
+pViewShell->Resize();
 }
 
 // Forces all images to be swapped in synchronously, this
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index 82b529e869d3..52f7789dfde5 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -929,6 +929,18 @@ void ViewShell::SetRuler(bool bRuler)
 GetViewShell()->InvalidateBorder();
 }
 
+void ViewShell::SetScrollBarsVisible(bool bVisible)
+{
+if (mpVerticalScrollBar.get() != nullptr)
+mpVerticalScrollBar->Show( bVisible );
+
+if (mpHorizontalScrollBar.get() != nullptr)
+mpHorizontalScrollBar->Show( bVisible );
+
+if (mpScrollBarBox.get() != nullptr)
+mpScrollBarBox->Show(bVisible);
+}
+
 sal_Int8 ViewShell::AcceptDrop (
 const AcceptDropEvent& rEvt,
 DropTargetHelper& rTargetHelper,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-15 Thread Pranav Kant
 chart2/source/controller/main/ChartController_EditData.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 8d7a250c04615f27c14543a9f050cb21648f498d
Author: Pranav Kant 
Date:   Thu Mar 15 16:48:54 2018 +0530

chart2 lok: give parent to data table dialog to tunnel it

Change-Id: Ie82a9a6d9b499e5da34e04f0c2f5fc7c164b098e
(cherry picked from commit cbbff5a2c08a55bfec27b2476fd848e972bfd572)
Reviewed-on: https://gerrit.libreoffice.org/51356
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/chart2/source/controller/main/ChartController_EditData.cxx 
b/chart2/source/controller/main/ChartController_EditData.cxx
index 646a27a35cb1..9d64dd06fcbc 100644
--- a/chart2/source/controller/main/ChartController_EditData.cxx
+++ b/chart2/source/controller/main/ChartController_EditData.cxx
@@ -18,6 +18,7 @@
  */
 
 #include "ChartController.hxx"
+#include "ChartWindow.hxx"
 #include "macros.hxx"
 
 #include "dlg_DataEditor.hxx"
@@ -52,7 +53,7 @@ void ChartController::executeDispatch_EditData()
 UndoLiveUpdateGuardWithData aUndoGuard(
 SCH_RESSTR( STR_ACTION_EDIT_CHART_DATA ),
 m_xUndoManager );
-ScopedVclPtrInstance aDataEditorDialog( nullptr, 
xChartDoc, m_xCC );
+ScopedVclPtrInstance aDataEditorDialog( 
m_pChartWindow.get(), xChartDoc, m_xCC );
 if (aDataEditorDialog->Execute() == RET_OK)
 aDataEditorDialog->ApplyChangesToModel();
 aUndoGuard.commit();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - libreofficekit/qa

2018-03-14 Thread Pranav Kant
 libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit f3b26d2e6871e88e6231d5de0bf408f000a50fab
Author: Pranav Kant 
Date:   Wed Mar 14 14:50:58 2018 +0530

lokdialog: debug red-colored boundary for last painted region

Easier to see what's going on inside the LOK dialog.

Change-Id: I59974200af3d2356b7c27eb3dd4032a59c00dbed
Reviewed-on: https://gerrit.libreoffice.org/51266
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx 
b/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx
index 5770e1349305..3e4d02f48e11 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx
@@ -117,7 +117,13 @@ gtv_lok_dialog_draw(GtkWidget* pDialogDrawingArea, 
cairo_t* pCairo, gpointer)
 cairo_surface_mark_dirty(pSurface);
 
 cairo_set_source_surface(pCairo, pSurface, aRect.x, aRect.y);
+// paint the dialog image
 cairo_paint(pCairo);
+
+// debug red-colored border around the painted region
+cairo_set_source_rgb(pCairo, 1.0, 0, 0);
+cairo_rectangle(pCairo, aRect.x, aRect.y, nWidth, nHeight);
+cairo_stroke(pCairo);
 }
 
 static gboolean
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-14 Thread Pranav Kant
 libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 859b7b09f5b1330b7135744795c578358736ded3
Author: Pranav Kant 
Date:   Wed Mar 14 14:50:58 2018 +0530

lokdialog: debug red-colored boundary for last painted region

Easier to see what's going on inside the LOK dialog.

Change-Id: I59974200af3d2356b7c27eb3dd4032a59c00dbed
Reviewed-on: https://gerrit.libreoffice.org/51263
Tested-by: Jenkins 
Reviewed-by: pranavk 

diff --git a/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx 
b/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx
index 75c4bae71df5..1d7a2482c069 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-lok-dialog.cxx
@@ -117,7 +117,13 @@ gtv_lok_dialog_draw(GtkWidget* pDialogDrawingArea, 
cairo_t* pCairo, gpointer)
 cairo_surface_mark_dirty(pSurface);
 
 cairo_set_source_surface(pCairo, pSurface, aRect.x, aRect.y);
+// paint the dialog image
 cairo_paint(pCairo);
+
+// debug red-colored border around the painted region
+cairo_set_source_rgb(pCairo, 1.0, 0, 0);
+cairo_rectangle(pCairo, aRect.x, aRect.y, nWidth, nHeight);
+cairo_stroke(pCairo);
 }
 
 static gboolean
___
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-3' - loleaflet/src

2018-03-13 Thread Pranav Kant
 loleaflet/src/map/handler/Map.Keyboard.js |   20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

New commits:
commit 2b434d85419a9eeba8e5f504b3cdf2b6b8727813
Author: Pranav Kant 
Date:   Mon Mar 12 17:41:36 2018 +0530

loleaflet: firefox emits 'keypress' for shift+insert too

So, we need to ignore the key event in the start of the handler.
Otherwise, in the case of firefox, us ignoring it in 'keydown' gets it
handled in 'keypress' which does double copy/paste.

Change-Id: I93f0e5c7db8817fab42764d0f0d3b12b50d62f81
Reviewed-on: https://gerrit.libreoffice.org/51133
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/map/handler/Map.Keyboard.js 
b/loleaflet/src/map/handler/Map.Keyboard.js
index 11c9d57b0..cb0d42f40 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -180,17 +180,16 @@ L.Map.Keyboard = L.Handler.extend({
this._map.off('compositionstart compositionupdate 
compositionend textInput', this._onKeyDown, this);
},
 
-   _handleOnKeyDown: function (keyCode, modifier) {
-   if (modifier & this.keyModifier.shift) {
+   _ignoreKeyEvent: function(e) {
+   var shift = e.originalEvent.shiftKey ? this.keyModifier.shift : 
0;
+   if (shift && (e.originalEvent.keyCode === 45 || 
e.originalEvent.keyCode === 46)) {
// don't handle shift+insert, shift+delete
// These are converted to 'cut', 'paste' events which 
are
// automatically handled by us, so avoid double-handling
-   if (keyCode === 45 || keyCode === 46) {
-   return false;
-   }
+   return true;
}
 
-   return this.handleOnKeyDownKeys[keyCode];
+   return false;
},
 
_setPanOffset: function (pan) {
@@ -334,16 +333,19 @@ L.Map.Keyboard = L.Handler.extend({
if (this._map._permission === 'edit') {
docLayer._resetPreFetching();
 
-   if (e.type === 'keydown') {
+   if (this._ignoreKeyEvent(e)) {
+   // key ignored
+   }
+   else if (e.type === 'keydown') {
this._keyHandled = false;
this._bufferedTextInputEvent = null;
 
-   if (this._handleOnKeyDown(keyCode, 
this.modifier) && charCode === 0) {
+   if (this.handleOnKeyDownKeys[keyCode] && 
charCode === 0) {
keyEventFn('input', charCode, 
unoKeyCode);
}
}
else if ((e.type === 'keypress' || e.type === 
'compositionend') &&
-(!this._handleOnKeyDown(keyCode, 
this.modifier) || charCode !== 0)) {
+(!this.handleOnKeyDownKeys[keyCode] || 
charCode !== 0)) {
if (charCode === keyCode && charCode !== 13) {
// Chrome sets keyCode = charCode for 
printable keys
// while LO requires it to be 0
___
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-3' - loleaflet/dist

2018-03-13 Thread Pranav Kant
 loleaflet/dist/toolbar/toolbar.js |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit fab14708c89d471a236967cc10e37965efd0fe79
Author: Pranav Kant 
Date:   Wed Feb 28 18:42:36 2018 +0530

loleaflet: Fix 'Find' ergonomics; don't make 2nd ctrl+f bring findbar

Change-Id: I82164555892324abf6eef2579bf1a99af510d10f
Reviewed-on: https://gerrit.libreoffice.org/50564
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/dist/toolbar/toolbar.js 
b/loleaflet/dist/toolbar/toolbar.js
index fc50d775a..cf8c1f82d 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -703,7 +703,7 @@ $(function () {
onRefresh: function(e) {
$('#tb_toolbar-down_item_userlist 
.w2ui-tb-caption').addClass('loleaflet-font');
$('#search-input').off('input', onSearch).on('input', 
onSearch);
-   $('#search-input').off('keypress', 
onSearchKeyPress).on('keypress', onSearchKeyPress);
+   $('#search-input').off('keydown', 
onSearchKeyDown).on('keydown', onSearchKeyDown);
}
});
 });
@@ -794,15 +794,15 @@ function onSearch(e) {
}
 }
 
-function onSearchKeyPress(e) {
-   if (e.keyCode === 13) { // Enter key
+function onSearchKeyDown(e) {
+   if ((e.keyCode === 71 && e.ctrlKey) || e.keyCode === 114 || e.keyCode 
=== 13) {
if (e.shiftKey) {
-   // search backwards
map.search(L.DomUtil.get('search-input').value, true);
} else {
map.search(L.DomUtil.get('search-input').value);
}
-   } else if (e.keyCode === 27) { // Escape key
+   e.preventDefault();
+   } else if (e.keyCode === 27) {
_cancelSearch();
}
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-13 Thread Pranav Kant
 vcl/source/window/cursor.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 641d763caeb1c6c554569927f245261e0c6c7a06
Author: Pranav Kant 
Date:   Tue Mar 6 19:21:48 2018 +0530

lokdialog: Fix cursor invalidates for some vcl controls

... like TextEdit, etc. The problem was that the code assumed that there
would be a mpData->mpWindow whenever a new cursor position is set. While
that's the case with most views, some controls set the position when
there's no window set.

With this patch, we send the cursor_invalidate just before we make the
cursor visible; by that time, we already have a valid mpWindow set in
the ImplCursorData.

Change-Id: I2cb40ae150e4d7555f17ebbb8e08c04fc05f447b
Reviewed-on: https://gerrit.libreoffice.org/50833
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index 079d039a2f21..228272909e5e 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -189,9 +189,6 @@ void vcl::Cursor::ImplDoShow( bool bDrawDirect, bool 
bRestore )
 mpData->mbCurVisible = false;
 mpData->maTimer.SetTimeoutHdl( LINK( this, Cursor, 
ImplTimerHdl ) );
 mpData->maTimer.SetDebugName( "vcl ImplCursorData maTimer" );
-
-// tell about "initial" coordinates
-LOKNotify( pWindow, "cursor_invalidate" );
 }
 
 mpData->mpWindow= pWindow;
@@ -206,6 +203,7 @@ void vcl::Cursor::ImplDoShow( bool bDrawDirect, bool 
bRestore )
 mpData->maTimer.Start();
 else if ( !mpData->mbCurVisible )
 ImplDraw();
+LOKNotify( pWindow, "cursor_invalidate" );
 LOKNotify( pWindow, "cursor_visible" );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-12 Thread Pranav Kant
 libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx |9 
 libreofficekit/source/gtk/lokdocview.cxx|   22 
++
 2 files changed, 31 insertions(+)

New commits:
commit f495a324921589d731d7d16f4554e36d4230476b
Author: Pranav Kant 
Date:   Mon Mar 12 22:03:05 2018 +0530

lokdocview: new property 'is-initialized'; fix gtktiledviewer for calc

there's no lokdocview property to tell if the doc has been completely
initialized (initializeForRendering() has been called, etc.). This new
property takes care of that which we now use to ignore
configure event fired before document is initialized for rendering.
Configure event handler queries document for row/col header which
asserts because some values hasn't been initialized yet.

Change-Id: I58385b2cb56bf317fe20ecf0570b7095f7260174
Reviewed-on: https://gerrit.libreoffice.org/51156
Tested-by: Jenkins 
Reviewed-by: pranavk 

diff --git 
a/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx 
b/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx
index 5983b7f77e5b..c3ee592a5463 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx
@@ -403,6 +403,15 @@ void LOKDocViewSigHandlers::window(LOKDocView* pDocView, 
gchar* pPayload, gpoint
 gboolean LOKDocViewSigHandlers::configureEvent(GtkWidget* pWidget, 
GdkEventConfigure* /*pEvent*/, gpointer /*pData*/)
 {
 GtvApplicationWindow* window = 
GTV_APPLICATION_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(pWidget)));
+
+gboolean isInit = false;
+g_object_get(G_OBJECT(window->lokdocview), "is-initialized", &isInit, 
nullptr);
+if (!isInit)
+{
+g_info("Ignoring configure event; document not yet ready");
+return false;
+}
+
 LibreOfficeKitDocument* pDocument = 
lok_doc_view_get_document(LOK_DOC_VIEW(window->lokdocview));
 if (pDocument && pDocument->pClass->getDocumentType(pDocument) == 
LOK_DOCTYPE_SPREADSHEET)
 {
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index 87b69ec409af..8a76c78e1151 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -82,6 +82,7 @@ struct LOKDocViewPrivateImpl
 std::string m_aRenderingArguments;
 gdouble m_nLoadProgress;
 gboolean m_bIsLoading;
+gboolean m_bInit; // initializeForRendering() has been called
 gboolean m_bCanZoomIn;
 gboolean m_bCanZoomOut;
 LibreOfficeKit* m_pOffice;
@@ -194,6 +195,7 @@ struct LOKDocViewPrivateImpl
 LOKDocViewPrivateImpl()
 : m_nLoadProgress(0),
 m_bIsLoading(false),
+m_bInit(false),
 m_bCanZoomIn(true),
 m_bCanZoomOut(true),
 m_pOffice(nullptr),
@@ -293,6 +295,7 @@ enum
 PROP_LOAD_PROGRESS,
 PROP_ZOOM,
 PROP_IS_LOADING,
+PROP_IS_INITIALIZED,
 PROP_DOC_WIDTH,
 PROP_DOC_HEIGHT,
 PROP_CAN_ZOOM_IN,
@@ -970,6 +973,9 @@ static gboolean postDocumentLoad(gpointer pData)
 gtk_widget_grab_focus(GTK_WIDGET(pLOKDocView));
 lok_doc_view_set_zoom(pLOKDocView, 1.0);
 
+// we are completely loaded
+priv->m_bInit = TRUE;
+
 return G_SOURCE_REMOVE;
 }
 
@@ -2575,6 +2581,9 @@ static void lok_doc_view_get_property (GObject* object, 
guint propId, GValue *va
 case PROP_IS_LOADING:
 g_value_set_boolean (value, priv->m_bIsLoading);
 break;
+case PROP_IS_INITIALIZED:
+g_value_set_boolean (value, priv->m_bInit);
+break;
 case PROP_DOC_WIDTH:
 g_value_set_long (value, priv->m_nDocumentWidthTwips);
 break;
@@ -2845,6 +2854,19 @@ static void lok_doc_view_class_init (LOKDocViewClass* 
pClass)
   G_PARAM_STATIC_STRINGS));
 
 /**
+ * LOKDocView:is-initialized:
+ *
+ * Whether the requested document has completely loaded or not.
+ */
+properties[PROP_IS_INITIALIZED] =
+g_param_spec_boolean("is-initialized",
+ "Has initialized",
+ "Whether the view has completely initialized",
+ FALSE,
+ static_cast(G_PARAM_READABLE |
+  G_PARAM_STATIC_STRINGS));
+
+/**
  * LOKDocView:doc-width:
  *
  * The width of the currently loaded document in #LOKDocView in twips.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: GSoC Project

2018-03-11 Thread Pranav Kant


On 12/03/18 11:46, Shayantan Pal wrote:
> Hi Pranav,
> 
> Thanks for the heads up .  Is it absolutely necessary that I submit my  GSoC
> application on 18 March itself ? Can I submit it later too ? 

Reading here[1], the student application deadline is 27th March. So, you need to
submit it by 27, not 18th. And yes, it's absolutely necessary that you submit
your proposal by 27th.

[1] https://developers.google.com/open-source/gsoc/timeline


> 
> On 12-Mar-2018 9:15 AM, "Pranav Kant"  <mailto:pran...@collabora.co.uk>> wrote:
> 
> Hi Shayantan,
> 
> On 11/03/18 23:45, Shayantan Pal wrote:
> > Respected sirs,
> >
> > I am interested in the project : 
> >
> >
> >       LibreOffice Online Admin
> >
> >
> > for Google Summer Of Code 2018 and would like to work on it . Kindly
> consider my
> > candidature.
> 
> As a qualification process, we require students to work on at least one 
> Easy
> Hacks (as mentioned here[1]) before you submit your application for GSoC 
> later.
> 
> >
> > I have sond knowledge of CPP and other OOP languages such as Java and 
> also can
> > code in Python , HTML5 and Css3.
> 
> Please look at the list of easy hacks for Online[2]. There are relevant 
> code
> pointers already in all of the easy hacks but if stuck, don't hesitate to 
> ask on
> the bug itself. There is some more helpful information on the same wiki 
> page
> including slides of talks given on LibreOffice Online in previous 
> conferences;
> you might want to go through them to understand the architecture, code
> structure, etc.
> 
> 
> > I have successfully participated in Google Code
> > In 2013,14,15 and wat to extend my repertoire in coding
> 
> That's great to hear.
> 
> 
> [1] 
> https://wiki.documentfoundation.org/Development/LibreOffice_Online#GSoC
> <https://wiki.documentfoundation.org/Development/LibreOffice_Online#GSoC>
> [2]
> 
> https://wiki.documentfoundation.org/Development/LibreOffice_Online#Easy_Hacks 
> <https://wiki.documentfoundation.org/Development/LibreOffice_Online#Easy_Hacks>
> 
> --
> Regards,
> Pranav
> 

-- 
Regards,
Pranav



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


Re: GSoC 2018 Help

2018-03-11 Thread Pranav Kant
Hi Apurva,

(Please keep @libreoffice in CC)

On 11/03/18 19:04, Apurva Pavaskar wrote:
> Hi,
> 
> Needed to ask some more things :
> -the subsequent builds will automatically be incremental right?

Yes, unless you touch some widely used header files.

> -for filing a bug/working on one : do I need to do it through bugzilla or
> gerrit? and how?

If you have found a bug, it's best to file it on bugzilla first and then submit
fixes/patches for it in gerrit (mentioning the bug number in the commit 
message).

Regarding how, you might want to look at these:

https://wiki.documentfoundation.org/Development/gerrit
https://wiki.documentfoundation.org/QA/Bugzilla

> -how do I pull the latest changes before building my build and submitting my 
> patch?

`git pull` should be enough to pull the latest changes and rebase your current
changes on top of that.

> 
> And there is an easy hack on Bugzilla : Bug 55410
> (https://bugs.documentfoundation.org/show_bug.cgi?id=55410)
> 
> I wanted to fix it for KDE rather than windows, how do I file in a new bug
> (gerrit/bugzilla) and how?

Comment 16 reports that it's broken for Linux as well. Also, the bug fields
doesn't mention it to be a Window specific bug; so, no need to file a separate 
bug.

You might want to read the commit that breaks it for Linux. Did you already do
that? If yes, I think it's best to dump your findings on the bug so that others
can help you wherever you are stuck.

-- 
Regards,
Pranav



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


Re: GSoC Project

2018-03-11 Thread Pranav Kant
Hi Shayantan,

On 11/03/18 23:45, Shayantan Pal wrote:
> Respected sirs,
> 
> I am interested in the project : 
> 
> 
>   LibreOffice Online Admin
> 
> 
> for Google Summer Of Code 2018 and would like to work on it . Kindly consider 
> my
> candidature. 

As a qualification process, we require students to work on at least one Easy
Hacks (as mentioned here[1]) before you submit your application for GSoC later.

> 
> I have sond knowledge of CPP and other OOP languages such as Java and also can
> code in Python , HTML5 and Css3. 

Please look at the list of easy hacks for Online[2]. There are relevant code
pointers already in all of the easy hacks but if stuck, don't hesitate to ask on
the bug itself. There is some more helpful information on the same wiki page
including slides of talks given on LibreOffice Online in previous conferences;
you might want to go through them to understand the architecture, code
structure, etc.


> I have successfully participated in Google Code
> In 2013,14,15 and wat to extend my repertoire in coding 

That's great to hear.


[1] https://wiki.documentfoundation.org/Development/LibreOffice_Online#GSoC
[2] 
https://wiki.documentfoundation.org/Development/LibreOffice_Online#Easy_Hacks

-- 
Regards,
Pranav



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


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

2018-03-08 Thread Pranav Kant
 include/vcl/abstdlg.hxx   |3 +
 include/vcl/dialog.hxx|2 -
 include/vcl/weld.hxx  |   34 +
 sw/source/uibase/docvw/edtwin.cxx |5 +-
 vcl/source/app/salvtables.cxx |   23 
 vcl/source/window/dialog.cxx  |3 +
 vcl/unx/gtk3/gtk3gtkinst.cxx  |   72 +++---
 7 files changed, 125 insertions(+), 17 deletions(-)

New commits:
commit 0b573eac85b3100eb8d40dcaf25c510f50cfd62f
Author: Pranav Kant 
Date:   Thu Mar 1 20:15:58 2018 +0530

lokdialog: run async for weld dialogs

Change-Id: Ieb06beada435bc47a39295acb5ea2dcef10ca454
Reviewed-on: https://gerrit.libreoffice.org/50874
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx
index 542930084e37..af676785b295 100644
--- a/include/vcl/abstdlg.hxx
+++ b/include/vcl/abstdlg.hxx
@@ -26,10 +26,12 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace vcl { class Window; }
 class Dialog;
 class Bitmap;
+namespace weld { class DialogController; }
 
 /**
 * Some things multiple-inherit from VclAbstractDialog and OutputDevice,
@@ -45,6 +47,7 @@ public:
 
 struct AsyncContext {
 VclPtr mxOwner;
+std::shared_ptr mxOwnerDialog;
 std::function maEndDialogFn;
 bool isSet() { return !!maEndDialogFn; }
 };
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 243d071b101f..0b98901e32bb 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -149,7 +149,7 @@ private:
 public:
 
 // FIXME: Need to remove old StartExecuteModal in favour of this one.
-/// Returns true of the dialog successfully starts
+/// Returns true if the dialog successfully starts
 bool StartExecuteAsync(const std::function &rEndDialogFn)
 {
 VclAbstractDialog::AsyncContext aCtx;
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index b861b848e84c..ff3a1e8c346e 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -20,6 +20,7 @@
 namespace weld
 {
 class Container;
+class DialogController;
 
 class VCL_DLLPUBLIC Widget
 {
@@ -120,6 +121,12 @@ public:
 
 class VCL_DLLPUBLIC Dialog : virtual public Window
 {
+private:
+friend DialogController;
+virtual bool runAsync(std::shared_ptr,
+  const std::function& func)
+= 0;
+
 public:
 virtual int run() = 0;
 virtual void response(int response) = 0;
@@ -534,8 +541,33 @@ public:
 virtual DrawingArea* weld_drawing_area(const OString& id, bool 
bTakeOwnership = false) = 0;
 virtual ~Builder() {}
 };
-}
 
+class VCL_DLLPUBLIC DialogController
+{
+private:
+virtual Dialog* getDialog() = 0;
+
+public:
+short run() { return getDialog()->run(); }
+static bool runAsync(const std::shared_ptr& rController,
+ const std::function&);
+virtual ~DialogController() {}
+};
+
+class VCL_DLLPUBLIC GenericDialogController : public DialogController
+{
+private:
+virtual Dialog* getDialog() override { return m_xDialog.get(); }
+
+protected:
+std::unique_ptr m_xBuilder;
+std::unique_ptr m_xDialog;
+
+public:
+GenericDialogController(weld::Widget* pParent, const OUString& rUIFile,
+const OString& rDialogId);
+};
+}
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 8c33ce4e5ba3..a6334cd57e60 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2474,9 +2474,8 @@ KEYINPUT_CHECKTABLE_INSDEL:
 }
 else
 {
-std::unique_ptr 
xBuilder(Application::CreateBuilder(GetFrameWeld(), 
"modules/swriter/ui/inforeadonlydialog.ui"));
-std::unique_ptr 
xInfo(xBuilder->weld_message_dialog("InfoReadonlyDialog"));
-xInfo->run();
+auto 
xInfo(std::make_shared(GetFrameWeld(), 
"modules/swriter/ui/inforeadonlydialog.ui", "InfoReadonlyDialog"));
+weld::DialogController::runAsync(xInfo, [](int) {});
 eKeyState = SwKeyState::End;
 }
 break;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index bb304d2dc811..3f95a7589849 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -430,6 +431,14 @@ public:
 {
 }
 
+virtual bool runAsync(std::shared_ptr aOwner, 
const std::function &rEndDialogFn) override
+{
+VclAbstractDialog::AsyncContext aCtx;
+aCtx.mxOwnerDialog = aOwner;
+aCtx.maEndDialogFn = rEndDialogFn;

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

2018-03-06 Thread Pranav Kant
 vcl/source/window/cursor.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 843f8e43e1e79bbd22cadabb54022c615c7a0d64
Author: Pranav Kant 
Date:   Tue Mar 6 19:21:48 2018 +0530

lokdialog: Fix cursor invalidates for some vcl controls

... like TextEdit, etc. The problem was that the code assumed that there
would be a mpData->mpWindow whenever a new cursor position is set. While
that's the case with most views, some controls set the position when
there's no window set.

With this patch, we send the cursor_invalidate just before we make the
cursor visible; by that time, we already have a valid mpWindow set in
the ImplCursorData.

Change-Id: I2cb40ae150e4d7555f17ebbb8e08c04fc05f447b
Reviewed-on: https://gerrit.libreoffice.org/50834
Tested-by: Jenkins 
Reviewed-by: pranavk 

diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index 2da864f9bcd2..0da13be25d16 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -189,9 +189,6 @@ void vcl::Cursor::ImplDoShow( bool bDrawDirect, bool 
bRestore )
 mpData->mbCurVisible = false;
 mpData->maTimer.SetInvokeHandler( LINK( this, Cursor, 
ImplTimerHdl ) );
 mpData->maTimer.SetDebugName( "vcl ImplCursorData maTimer" );
-
-// tell about "initial" coordinates
-LOKNotify( pWindow, "cursor_invalidate" );
 }
 
 mpData->mpWindow= pWindow;
@@ -206,6 +203,7 @@ void vcl::Cursor::ImplDoShow( bool bDrawDirect, bool 
bRestore )
 mpData->maTimer.Start();
 else if ( !mpData->mbCurVisible )
 ImplDraw();
+LOKNotify( pWindow, "cursor_invalidate" );
 LOKNotify( pWindow, "cursor_visible" );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - desktop/qa libreofficekit/qa

2018-03-01 Thread Pranav Kant
 desktop/qa/desktop_lib/test_desktop_lib.cxx |   14 +-
 libreofficekit/qa/unit/tiledrendering.cxx   |1 +
 2 files changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 4906218661273ae5a5502e1c460864f2b1305114
Author: Pranav Kant 
Date:   Tue Feb 27 20:47:55 2018 +0530

Fix tests - combination of the following commits:

Fix build
cherry-picked from 83a8527a00932d9eaf1fd07654d240bd20dc4c21

Fix build, for real this time
cherry-picked from 25ca8af596342ed254eb793ad1b8d47a86be4d40

Note that one of the test is disabled; need to figure out what's going
on there.

Change-Id: I63f287fdc048d5636435047424e8c42842e75c2c
Reviewed-on: https://gerrit.libreoffice.org/50491
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 145bf0928067..55f85ea5efea 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -562,7 +562,7 @@ void DesktopLOKTest::testUndoWriter()
 LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0);
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 't', 0);
-
+Scheduler::ProcessEventsToIdle();
 // Get undo info.
 boost::property_tree::ptree aTree;
 char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, 
".uno:Undo");
@@ -809,6 +809,7 @@ void DesktopLOKTest::testWriterComments()
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 's', 0);
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0);
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 0, 
com::sun::star::awt::Key::ESCAPE);
+Scheduler::ProcessEventsToIdle();
 
 // Test that the typed characters ended up in the right window.
 auto xTextField = xTextPortion->getPropertyValue("TextField").get< 
uno::Reference >();
@@ -917,6 +918,7 @@ void DesktopLOKTest::testSheetSelections()
   LOK_MOUSEEVENT_MOUSEBUTTONUP,
   col5, row5,
   1, 1, 0);
+Scheduler::ProcessEventsToIdle();
 
 // Copy the contents and check if matches expected data
 {
@@ -962,6 +964,7 @@ void DesktopLOKTest::testSheetSelections()
   LOK_MOUSEEVENT_MOUSEBUTTONUP,
   col4, row5,
   1, 1, 0);
+Scheduler::ProcessEventsToIdle();
 
 // Selected text should get deselected and copying should give us
 // content of only one cell, now
@@ -1654,6 +1657,7 @@ void DesktopLOKTest::testRedlineWriter()
 xPropertySet->setPropertyValue("RecordChanges", uno::makeAny(true));
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0);
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 't', 0);
+Scheduler::ProcessEventsToIdle();
 
 // Get redline info.
 boost::property_tree::ptree aTree;
@@ -1683,6 +1687,7 @@ void DesktopLOKTest::testRedlineCalc()
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 't', 0);
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 0, 
KEY_RETURN);
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 0, 
KEY_RETURN);
+Scheduler::ProcessEventsToIdle();
 
 // Get redline info.
 boost::property_tree::ptree aTree;
@@ -1778,6 +1783,7 @@ void DesktopLOKTest::testPaintPartTile()
 pDocument->m_pDocumentClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 
0, awt::Key::TAB);
 pDocument->m_pDocumentClass->postKeyEvent(pDocument, 
LOK_KEYEVENT_KEYINPUT, 'x', 0);
 pDocument->m_pDocumentClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 
'x', 0);
+Scheduler::ProcessEventsToIdle();
 
 // Call paintPartTile() to paint the second part (in whichever view it 
finds suitable for this).
 unsigned char pPixels[256 * 256 * 4];
@@ -1791,9 +1797,8 @@ void DesktopLOKTest::testPaintPartTile()
 Scheduler::ProcessEventsToIdle();
 // This failed: paintPartTile() (as a side-effect) ended the text edit of
 // the first view, so there were no invalidations.
-CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
+//CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
 
-Scheduler::ProcessEventsToIdle();
 mxComponent.clear();
 comphelper::LibreOfficeKit::setActive(false);
 }
@@ -2212,11 +2217,10 @@ void DesktopLOKTest::testABI()
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(38), offsetof(struct 
_LibreOfficeKitDocumentClass, postWi

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

2018-03-01 Thread Pranav Kant
 loleaflet/src/layer/tile/TileLayer.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 27d58d3e2fbfbd95a8a9453c4306d78a8ffba4d4
Author: Pranav Kant 
Date:   Thu Mar 1 19:03:04 2018 +0530

loleaflet: Fix slightly off IME candidate window position

Use LOK cursor's south west point instead of north. Making it north
makes the candidate window appear over the characters being typed

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

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index f32f737d6..140f14993 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1446,7 +1446,7 @@ L.TileLayer = L.GridLayer.extend({
 
// move the hidden input field with the cursor
var clipContainer = 
L.DomUtil.get('doc-clipboard-container');
-   var pos = 
this._map.latLngToContainerPoint(L.latLng(cursorPos)).round();
+   var pos = 
this._map.latLngToContainerPoint(L.latLng(this._visibleCursor.getCenter())).round();
L.DomUtil.setPosition(clipContainer, pos);
}
else if (this._cursorMarker) {
___
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-3-1' - loleaflet/src

2018-03-01 Thread Pranav Kant
 loleaflet/src/layer/tile/TileLayer.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6fd9362ce317e27db62ec3d5c48cf639007de7a7
Author: Pranav Kant 
Date:   Thu Mar 1 19:03:04 2018 +0530

loleaflet: Fix slightly off IME candidate window position

Use LOK cursor's south west point instead of north. Making it north
makes the candidate window appear over the characters being typed

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

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index f32f737d6..140f14993 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1446,7 +1446,7 @@ L.TileLayer = L.GridLayer.extend({
 
// move the hidden input field with the cursor
var clipContainer = 
L.DomUtil.get('doc-clipboard-container');
-   var pos = 
this._map.latLngToContainerPoint(L.latLng(cursorPos)).round();
+   var pos = 
this._map.latLngToContainerPoint(L.latLng(this._visibleCursor.getCenter())).round();
L.DomUtil.setPosition(clipContainer, pos);
}
else if (this._cursorMarker) {
___
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/collabora-online-3'

2018-03-01 Thread Pranav Kant
New branch 'distro/collabora/collabora-online-3' 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: loleaflet/dist

2018-02-28 Thread Pranav Kant
 loleaflet/dist/toolbar/toolbar.js |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 4c07c11cd6648b4c50c4cb74eee8efa8600903a0
Author: Pranav Kant 
Date:   Wed Feb 28 18:42:36 2018 +0530

loleaflet: Fix 'Find' ergonomics; don't make 2nd ctrl+f bring findbar

Change-Id: I82164555892324abf6eef2579bf1a99af510d10f

diff --git a/loleaflet/dist/toolbar/toolbar.js 
b/loleaflet/dist/toolbar/toolbar.js
index 8d803d780..3c6a37bb0 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -724,7 +724,7 @@ $(function () {
onRefresh: function() {
$('#tb_toolbar-down_item_userlist 
.w2ui-tb-caption').addClass('loleaflet-font');
$('#search-input').off('input', onSearch).on('input', 
onSearch);
-   $('#search-input').off('keypress', 
onSearchKeyPress).on('keypress', onSearchKeyPress);
+   $('#search-input').off('keydown', 
onSearchKeyDown).on('keydown', onSearchKeyDown);
}
});
 });
@@ -815,15 +815,15 @@ function onSearch() {
}
 }
 
-function onSearchKeyPress(e) {
-   if (e.keyCode === 13) { // Enter key
+function onSearchKeyDown(e) {
+   if ((e.keyCode === 71 && e.ctrlKey) || e.keyCode === 114 || e.keyCode 
=== 13) {
if (e.shiftKey) {
-   // search backwards
map.search(L.DomUtil.get('search-input').value, true);
} else {
map.search(L.DomUtil.get('search-input').value);
}
-   } else if (e.keyCode === 27) { // Escape key
+   e.preventDefault();
+   } else if (e.keyCode === 27) {
_cancelSearch();
}
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-28 Thread Pranav Kant
 loleaflet/dist/leaflet.css |   17 -
 1 file changed, 12 insertions(+), 5 deletions(-)

New commits:
commit f8929b42d7a10fdc317881a3fceb57f695c459ec
Author: Pranav Kant 
Date:   Tue Feb 27 16:06:12 2018 +0530

loleaflet: Hidden input window shouldn't have any border, padding, etc.

See comments for details.

Change-Id: I1797100b9937f6c9230a12198479d96fca789f66

diff --git a/loleaflet/dist/leaflet.css b/loleaflet/dist/leaflet.css
index b2bf8115d..50f543957 100644
--- a/loleaflet/dist/leaflet.css
+++ b/loleaflet/dist/leaflet.css
@@ -688,11 +688,18 @@ div.leaflet-cursor-container:hover > 
.leaflet-cursor-header {
opacity: 0;
}
 
-.clipboard {
-   width: 1px;
-   height: 1px;
-   padding: 0px;
-   }
+input.clipboard {
+   width: 0px;
+   height: 0px;
+   padding: 0px !important; /* w2ui defines "input:not([type=button])" 
rule which sets
+   the padding to non-zero. Hence, the 
!important. Otherwise,
+   clipboard cursor apperas in MSIE and MSEdge 
*/
+   border: 0px !important;
+}
+
+.clipboard:focus {
+outline: none;
+}
 
 .resize-detector {
 position: absolute;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-27 Thread Pranav Kant
 bundled/include/LibreOfficeKit/LibreOfficeKit.h   |   10 +-
 bundled/include/LibreOfficeKit/LibreOfficeKit.hxx |6 +++---
 kit/ChildSession.cpp  |2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit c73026cdf94de870c1a54758be8197d359397ade
Author: Pranav Kant 
Date:   Wed Feb 21 22:05:18 2018 +0530

postExtTextInputEvent -> postWindowExtTextInputEvent

Change-Id: If5612bffac612ca7f52c8eec242e5ad9984cd669

diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h 
b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
index 7492fcc7..d465d541 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
@@ -300,11 +300,11 @@ struct _LibreOfficeKitDocumentClass
 /// @see lok::Document::setViewLanguage().
 void (*setViewLanguage) (LibreOfficeKitDocument* pThis, int nId, const 
char* language);
 
-/// @see lok::Document::postExtTextInputEvent
-void (*postExtTextInputEvent) (LibreOfficeKitDocument* pThis,
-   unsigned nWindowId,
-   int nType,
-   const char* pText);
+/// @see lok::Document::postWindowExtTextInputEvent
+void (*postWindowExtTextInputEvent) (LibreOfficeKitDocument* pThis,
+ unsigned nWindowId,
+ int nType,
+ const char* pText);
 
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
index 55e29ebd..232eada6 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -538,16 +538,16 @@ public:
 }
 
 /**
- * Post the text input from external input window, like IME
+ * Post the text input from external input window, like IME, to given 
windowId
  *
  * @param nWindowId Specify the window id to post the input event to. If
  * nWindow is 0, the event is posted into the document
  * @param nType see LibreOfficeKitExtTextInputType
  * @param pText Text for LOK_EXT_TEXTINPUT
  */
-void postExtTextInputEvent(unsigned nWindowId, int nType, const char* 
pText)
+void postWindowExtTextInputEvent(unsigned nWindowId, int nType, const 
char* pText)
 {
-mpDoc->pClass->postExtTextInputEvent(mpDoc, nWindowId, nType, pText);
+mpDoc->pClass->postWindowExtTextInputEvent(mpDoc, nWindowId, nType, 
pText);
 }
 
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index f09f5b39..6a10dca8 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -790,7 +790,7 @@ bool ChildSession::extTextInputEvent(const char* 
/*buffer*/, int /*length*/,
 
 std::unique_lock lock(_docManager.getDocumentMutex());
 getLOKitDocument()->setView(_viewId);
-getLOKitDocument()->postExtTextInputEvent(id, type, decodedText.c_str());
+getLOKitDocument()->postWindowExtTextInputEvent(id, type, 
decodedText.c_str());
 
 return true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-27 Thread Pranav Kant
 desktop/qa/desktop_lib/test_desktop_lib.cxx |   11 ---
 libreofficekit/qa/unit/tiledrendering.cxx   |1 +
 sw/qa/extras/uiwriter/uiwriter.cxx  |4 
 3 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 25ca8af596342ed254eb793ad1b8d47a86be4d40
Author: Pranav Kant 
Date:   Tue Feb 27 21:27:53 2018 +0530

Fix build, for real this time

Add a few missing processEventsToIdle()'s in the tests.

Let's disable one of the assertion until I figure out what's going on.

Change-Id: I82cbe443b4013d4402151ddae4b06044dfb394bd

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 493a3ef48bc4..4e4c4ee3f6ba 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -589,7 +589,7 @@ void DesktopLOKTest::testUndoWriter()
 LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0);
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 't', 0);
-
+Scheduler::ProcessEventsToIdle();
 // Get undo info.
 boost::property_tree::ptree aTree;
 char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, 
".uno:Undo");
@@ -852,6 +852,7 @@ void DesktopLOKTest::testWriterComments()
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 's', 0);
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0);
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 0, 
com::sun::star::awt::Key::ESCAPE);
+Scheduler::ProcessEventsToIdle();
 
 // Test that the typed characters ended up in the right window.
 auto xTextField = xTextPortion->getPropertyValue("TextField").get< 
uno::Reference >();
@@ -963,6 +964,7 @@ void DesktopLOKTest::testSheetSelections()
   LOK_MOUSEEVENT_MOUSEBUTTONUP,
   col5, row5,
   1, 1, 0);
+Scheduler::ProcessEventsToIdle();
 
 // Copy the contents and check if matches expected data
 {
@@ -1008,6 +1010,7 @@ void DesktopLOKTest::testSheetSelections()
   LOK_MOUSEEVENT_MOUSEBUTTONUP,
   col4, row5,
   1, 1, 0);
+Scheduler::ProcessEventsToIdle();
 
 // Selected text should get deselected and copying should give us
 // content of only one cell, now
@@ -1716,6 +1719,7 @@ void DesktopLOKTest::testRedlineWriter()
 xPropertySet->setPropertyValue("RecordChanges", uno::makeAny(true));
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0);
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 't', 0);
+Scheduler::ProcessEventsToIdle();
 
 // Get redline info.
 boost::property_tree::ptree aTree;
@@ -1748,6 +1752,7 @@ void DesktopLOKTest::testRedlineCalc()
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 't', 0);
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 0, 
KEY_RETURN);
 pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 0, 
KEY_RETURN);
+Scheduler::ProcessEventsToIdle();
 
 // Get redline info.
 boost::property_tree::ptree aTree;
@@ -1844,6 +1849,7 @@ void DesktopLOKTest::testPaintPartTile()
 pDocument->m_pDocumentClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 
0, awt::Key::TAB);
 pDocument->m_pDocumentClass->postKeyEvent(pDocument, 
LOK_KEYEVENT_KEYINPUT, 'x', 0);
 pDocument->m_pDocumentClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 
'x', 0);
+Scheduler::ProcessEventsToIdle();
 
 // Call paintPartTile() to paint the second part (in whichever view it 
finds suitable for this).
 unsigned char pPixels[256 * 256 * 4];
@@ -1857,9 +1863,8 @@ void DesktopLOKTest::testPaintPartTile()
 Scheduler::ProcessEventsToIdle();
 // This failed: paintPartTile() (as a side-effect) ended the text edit of
 // the first view, so there were no invalidations.
-CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
+//CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
 
-Scheduler::ProcessEventsToIdle();
 mxComponent.clear();
 
 comphelper::LibreOfficeKit::setActive(false);
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx 
b/libreofficekit/qa/unit/tiledrendering.cxx
index db968eda2fba..742481a4e24c 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -143,6 +143,7 @@ void TiledRenderingTest::testDocumentTypes( Office* pOffice 
)
 CPPUNIT_ASSERT_EQUAL(LOK_DOCTYPE_TEXT, 
static_cast(p

[Libreoffice-commits] online.git: Changes to 'refs/tags/3.1-rc3'

2018-02-27 Thread Pranav Kant
Tag '3.1-rc3' created by Andras Timar  at 
2018-02-27 15:28 +

3.1-rc3

Changes since 3.1-rc2-10:
---
 0 files changed
---
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-27 Thread Pranav Kant
 desktop/qa/desktop_lib/test_desktop_lib.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 83a8527a00932d9eaf1fd07654d240bd20dc4c21
Author: Pranav Kant 
Date:   Tue Feb 27 20:47:55 2018 +0530

Fix build

Fallback from 0a1a3a64823c0509c4b5f1edc6ee51ca991d3501

Change-Id: I1a8390fd5c5d40521f7810ee57f5028d91456849

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 4d2d50644b16..493a3ef48bc4 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -2291,7 +2291,7 @@ void DesktopLOKTest::testABI()
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(37), offsetof(struct 
_LibreOfficeKitDocumentClass, postWindowKeyEvent));
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(38), offsetof(struct 
_LibreOfficeKitDocumentClass, postWindowMouseEvent));
 CPPUNIT_ASSERT_EQUAL(documentClassOffset(39), offsetof(struct 
_LibreOfficeKitDocumentClass, setViewLanguage));
-CPPUNIT_ASSERT_EQUAL(documentClassOffset(40), offsetof(struct 
_LibreOfficeKitDocumentClass, postExtTextInputEvent));
+CPPUNIT_ASSERT_EQUAL(documentClassOffset(40), offsetof(struct 
_LibreOfficeKitDocumentClass, postWindowExtTextInputEvent));
 
 // Extending is fine, update this, and add new assert for the offsetof the
 // new method
___
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-3-1' - loleaflet/dist

2018-02-27 Thread Pranav Kant
 loleaflet/dist/leaflet.css |   17 -
 1 file changed, 12 insertions(+), 5 deletions(-)

New commits:
commit d077731b779152da86dae0a00d911dba32da834c
Author: Pranav Kant 
Date:   Tue Feb 27 16:06:12 2018 +0530

loleaflet: Hidden input window shouldn't have any border, padding, etc.

See comments for details.

Change-Id: I1797100b9937f6c9230a12198479d96fca789f66
Reviewed-on: https://gerrit.libreoffice.org/50417
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/dist/leaflet.css b/loleaflet/dist/leaflet.css
index b2bf8115..50f54395 100644
--- a/loleaflet/dist/leaflet.css
+++ b/loleaflet/dist/leaflet.css
@@ -688,11 +688,18 @@ div.leaflet-cursor-container:hover > 
.leaflet-cursor-header {
opacity: 0;
}
 
-.clipboard {
-   width: 1px;
-   height: 1px;
-   padding: 0px;
-   }
+input.clipboard {
+   width: 0px;
+   height: 0px;
+   padding: 0px !important; /* w2ui defines "input:not([type=button])" 
rule which sets
+   the padding to non-zero. Hence, the 
!important. Otherwise,
+   clipboard cursor apperas in MSIE and MSEdge 
*/
+   border: 0px !important;
+}
+
+.clipboard:focus {
+outline: none;
+}
 
 .resize-detector {
 position: absolute;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-27 Thread Pranav Kant
 vcl/inc/window.h |1 +
 vcl/source/window/mouse.cxx  |9 -
 vcl/source/window/window.cxx |3 +++
 3 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 54a8c0e115b24d42f4b4ec6b8194f5b62e08201b
Author: Pranav Kant 
Date:   Tue Feb 27 14:03:34 2018 +0530

lok: mouse pointer events on document windows only

Change-Id: Ie21db52b2dd0d4f55289896caba5174380316e65

diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index a0f158f8d559..648143e96545 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -384,6 +384,7 @@ public:
 
 const vcl::ILibreOfficeKitNotifier* mpLOKNotifier; ///< To emit the LOK 
callbacks eg. for dialog tunneling.
 vcl::LOKWindowId mnLOKWindowId; ///< ID of this specific window.
+bool mbLOKParentNotifier;
 };
 
 /// Sets up the buffer to have settings matching the window, and restores the 
original state in the dtor.
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index f073c9739a65..2804bc1ceb54 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -496,7 +496,14 @@ void Window::SetPointer( const Pointer& rPointer )
 aPointerString = aIt->second;
 }
 
-
pWin->GetLOKNotifier()->libreOfficeKitViewCallback(LOK_CALLBACK_MOUSE_POINTER, 
aPointerString.getStr());
+// issue mouse pointer events only for document windows
+// Doc windows' immediate parent SfxFrameViewWindow_Impl is the one 
with
+// parent notifier set during initialization
+if (GetParent()->ImplGetWindowImpl()->mbLOKParentNotifier &&
+GetParent()->ImplGetWindowImpl()->mnLOKWindowId == 0)
+{
+
pWin->GetLOKNotifier()->libreOfficeKitViewCallback(LOK_CALLBACK_MOUSE_POINTER, 
aPointerString.getStr());
+}
 }
 }
 
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 5571e74a4cea..a7c50c793969 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -741,6 +741,7 @@ WindowImpl::WindowImpl( WindowType nType )
 mbDoubleBufferingRequested = bDoubleBuffer; // when we are not sure, 
assume it cannot do double-buffering via RenderContext
 mpLOKNotifier   = nullptr;
 mnLOKWindowId   = 0;
+mbLOKParentNotifier = false;
 }
 
 WindowImpl::~WindowImpl()
@@ -3221,6 +3222,8 @@ void Window::SetLOKNotifier(const 
vcl::ILibreOfficeKitNotifier* pNotifier, bool
 mpWindowImpl->mnLOKWindowId = sLastLOKWindowId++;
 GetLOKWindowsMap().insert(std::map>::value_type(mpWindowImpl->mnLOKWindowId, this));
 }
+else
+mpWindowImpl->mbLOKParentNotifier = true;
 
 mpWindowImpl->mpLOKNotifier = pNotifier;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 5 commits - desktop/source include/LibreOfficeKit include/vcl sc/qa sc/source sd/qa sd/source sw/qa sw/source vcl/source

2018-02-27 Thread Pranav Kant
 desktop/source/lib/init.cxx|   82 +--
 include/LibreOfficeKit/LibreOfficeKit.h|   10 +-
 include/LibreOfficeKit/LibreOfficeKit.hxx  |6 -
 include/vcl/IDialogRenderable.hxx  |2 
 include/vcl/ITiledRenderable.hxx   |  105 +
 include/vcl/window.hxx |7 +
 sc/qa/unit/tiledrendering/tiledrendering.cxx   |3 
 sc/source/ui/inc/gridwin.hxx   |7 +
 sc/source/ui/unoobj/docuno.cxx |   47 ---
 sc/source/ui/view/gridwin.cxx  |   15 +++
 sd/qa/unit/tiledrendering/tiledrendering.cxx   |7 +
 sd/source/ui/inc/ViewShell.hxx |6 -
 sd/source/ui/inc/Window.hxx|6 +
 sd/source/ui/unoidl/unomodel.cxx   |   38 -
 sd/source/ui/view/sdwindow.cxx |   39 +
 sd/source/ui/view/viewshel.cxx |   39 -
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   44 --
 sw/source/uibase/inc/edtwin.hxx|6 -
 sw/source/uibase/uno/unotxdoc.cxx  |   34 
 vcl/source/window/mouse.cxx|   17 
 20 files changed, 315 insertions(+), 205 deletions(-)

New commits:
commit 3c3e07b51fb09d09cfef54193f93b07304f4ccda
Author: Pranav Kant 
Date:   Sat Feb 24 12:19:57 2018 +0530

lok: All mouse,key events async

custom posting of mouse,key events on main thread

This still bypasses vcl while keeping the processing of events on the
main thread which is what we want.

Change-Id: Ia7a6f5ef1ac546245715abe418d261b49df12d4c
Reviewed-on: https://gerrit.libreoffice.org/50274
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index ab7b4f027a45..9b0e7dbe8e3a 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -14,6 +14,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -88,6 +90,48 @@ protected:
 int mnTilePixelWidth, mnTilePixelHeight;
 int mnTileTwipWidth, mnTileTwipHeight;
 public:
+struct LOKAsyncEventData
+{
+VclPtr mpWindow;
+VclEventId mnEvent;
+MouseEvent maMouseEvent;
+KeyEvent maKeyEvent;
+};
+
+static void LOKPostAsyncEvent(void* pEv, void*)
+{
+LOKAsyncEventData* pLOKEv = static_cast(pEv);
+switch (pLOKEv->mnEvent)
+{
+case VclEventId::WindowKeyInput:
+pLOKEv->mpWindow->KeyInput(pLOKEv->maKeyEvent);
+break;
+case VclEventId::WindowKeyUp:
+pLOKEv->mpWindow->KeyUp(pLOKEv->maKeyEvent);
+break;
+case VclEventId::WindowMouseButtonDown:
+pLOKEv->mpWindow->LogicMouseButtonDown(pLOKEv->maMouseEvent);
+// Invoke the context menu
+if (pLOKEv->maMouseEvent.GetButtons() & MOUSE_RIGHT)
+{
+const CommandEvent aCEvt(pLOKEv->maMouseEvent.GetPosPixel(), 
CommandEventId::ContextMenu, true, nullptr);
+pLOKEv->mpWindow->Command(aCEvt);
+}
+break;
+case VclEventId::WindowMouseButtonUp:
+pLOKEv->mpWindow->LogicMouseButtonUp(pLOKEv->maMouseEvent);
+break;
+case VclEventId::WindowMouseMove:
+pLOKEv->mpWindow->LogicMouseMove(pLOKEv->maMouseEvent);
+break;
+default:
+assert(false);
+break;
+}
+
+delete pLOKEv;
+}
+
 virtual ~ITiledRenderable();
 
 /**
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 9acf3450a391..e6a56466d6e6 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -1229,6 +1229,13 @@ public:
 /// Dialog / window tunneling related methods.
 Size PaintActiveFloatingWindow(VirtualDevice& rDevice) const;
 
+/// Same as MouseButtonDown(), but coordinates are in logic unit. used for 
LOK
+virtual void LogicMouseButtonDown(const MouseEvent&) {};
+/// Same as MouseButtonUp(), but coordinates are in logic unit. used for 
LOK
+virtual void LogicMouseButtonUp(const MouseEvent&) {};
+/// Same as MouseMove(), but coordinates are in logic unit. used for LOK
+virtual void LogicMouseMove(const MouseEvent&) {};
+
 /** @name Accessibility
  */
 ///@{
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index f0cd3c4ce7d3..5190385de016 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -437,6 +437,13 @@ public:
   long nTileHeight);
 void updateLibreOfficeKitCellCursor(const SfxViewShell* pOtherShell) const;
 
+/// Same as MouseButtonDown(), but coordinates are in logic unit.
+virtual voi

[Libreoffice-commits] online.git: Branch 'libreoffice-6-0' - loleaflet/dist

2018-02-27 Thread Pranav Kant
 loleaflet/dist/loleaflet.css |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 4d9ceecaac9549130cff03c82c32d8bc3de44b24
Author: Pranav Kant 
Date:   Sat Feb 24 14:56:51 2018 +0530

loleaflet: Keep the cursor 'default' by default

Change-Id: I88e18f7ce08612837dd99df3f9d08b4561007371
Reviewed-on: https://gerrit.libreoffice.org/50276
Reviewed-by: pranavk 
Tested-by: pranavk 
(cherry picked from commit d7ff0b0bb2a096c024b55a84619879ac6155f9d2)
Reviewed-on: https://gerrit.libreoffice.org/50429
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index a0604c5f..ef8b0f5b 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -28,6 +28,7 @@
left: 0px;
right: 0px;
z-index: 10;
+   cursor: default;
 }
 
 .scroll-container .mCSB_scrollTools.mCSB_1_scrollbar {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'libreoffice-6-0' - loleaflet/dist

2018-02-27 Thread Pranav Kant
 loleaflet/dist/toolbar/toolbar.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 57a6767ad30a81583e9b0ce2689190d19121659f
Author: Pranav Kant 
Date:   Wed Feb 21 20:07:49 2018 +0530

Let's not use any personal names

Change-Id: If25e0e93906008b8e04cfde9b77c9c78247643e1
(cherry picked from commit 12612d459baea72bbe5d356dc38297b0f455151d)
Reviewed-on: https://gerrit.libreoffice.org/50427
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/loleaflet/dist/toolbar/toolbar.js 
b/loleaflet/dist/toolbar/toolbar.js
index 953917c2..f0d14024 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -669,7 +669,7 @@ $(function () {
'Always follow the editor' +
'' +
'' +
-   'Current - Dewan' +
+   '' + _('Current') + ' - 
' +
''
},
{type: 'break', id: 'userlistbreak'},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'libreoffice-6-0' - wsd/Storage.cpp

2018-02-27 Thread Pranav Kant
 wsd/Storage.cpp |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 0d8724e6bcb9b3b2b6fa2997c36801a0a2c6ffbb
Author: Pranav Kant 
Date:   Thu Jan 18 20:50:35 2018 +0530

wsd: Fix incorrect file size reported

Close/flush the file after copying into it so that we can calculate the 
exact
filesize later on.

Change-Id: I30aca9d0ac3702394a4465c30c61954a726eec39
(cherry picked from commit 0547507b671e14b550e2f782cc993ef15010a023)
Reviewed-on: https://gerrit.libreoffice.org/50426
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index 1ebd28e0..1a4948d4 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -638,6 +638,7 @@ std::string WopiStorage::loadStorageFileToLocal(const 
Authorization& auth)
 std::copy(std::istreambuf_iterator(rs),
   std::istreambuf_iterator(),
   std::ostreambuf_iterator(ofs));
+ofs.close();
 LOG_INF("WOPI::GetFile downloaded " << 
getFileSize(_jailedFilePath) << " bytes from [" << uriObject.toString() <<
 "] -> " << _jailedFilePath << " in " << diff.count() << 
"s");
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-27 Thread Pranav Kant
 vcl/inc/window.h |1 +
 vcl/source/window/mouse.cxx  |9 -
 vcl/source/window/window.cxx |3 +++
 3 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 94cb2b0d0c85b8d0aa29d3a02d1d19cb9426d831
Author: Pranav Kant 
Date:   Tue Feb 27 14:03:34 2018 +0530

lok: mouse pointer events on document windows only

We only want to subscribe to the mouse pointer events of the document
window, not anything else.

Change-Id: Ie21db52b2dd0d4f55289896caba5174380316e65
Reviewed-on: https://gerrit.libreoffice.org/50412
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index faf9e5162794..b5a6e5b49e51 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -355,6 +355,7 @@ public:
 
 const vcl::ILibreOfficeKitNotifier* mpLOKNotifier; ///< To emit the LOK 
callbacks eg. for dialog tunneling.
 vcl::LOKWindowId mnLOKWindowId; ///< ID of this specific window.
+bool mbLOKParentNotifier;
 };
 
 /// Sets up the buffer to have settings matching the window, and restores the 
original state in the dtor.
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index 2a9ec9765c29..aca2627c5f19 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -510,7 +510,14 @@ void Window::SetPointer( const Pointer& rPointer )
 aPointerString = aIt->second;
 }
 
-
pWin->GetLOKNotifier()->libreOfficeKitViewCallback(LOK_CALLBACK_MOUSE_POINTER, 
aPointerString.getStr());
+// issue mouse pointer events only for document windows
+// Doc windows' immediate parent SfxFrameViewWindow_Impl is the one 
with
+// parent notifier set during initialization
+if (GetParent()->ImplGetWindowImpl()->mbLOKParentNotifier &&
+GetParent()->ImplGetWindowImpl()->mnLOKWindowId == 0)
+{
+
pWin->GetLOKNotifier()->libreOfficeKitViewCallback(LOK_CALLBACK_MOUSE_POINTER, 
aPointerString.getStr());
+}
 }
 }
 
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 904932623a92..e665b48af9dc 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -750,6 +750,7 @@ WindowImpl::WindowImpl( WindowType nType )
 mbDoubleBufferingRequested = bDoubleBuffer; // when we are not sure, 
assume it cannot do double-buffering via RenderContext
 mpLOKNotifier   = nullptr;
 mnLOKWindowId   = 0;
+mbLOKParentNotifier = false;
 }
 
 WindowImpl::~WindowImpl()
@@ -3254,6 +3255,8 @@ void Window::SetLOKNotifier(const 
vcl::ILibreOfficeKitNotifier* pNotifier, bool
 mpWindowImpl->mnLOKWindowId = sLastLOKWindowId++;
 GetLOKWindowsMap().insert(std::map>::value_type(mpWindowImpl->mnLOKWindowId, this));
 }
+else
+mpWindowImpl->mbLOKParentNotifier = true;
 
 mpWindowImpl->mpLOKNotifier = pNotifier;
 }
___
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-3-1' - loleaflet/dist

2018-02-25 Thread Pranav Kant
 loleaflet/dist/loleaflet.css |1 +
 1 file changed, 1 insertion(+)

New commits:
commit fb22b1d97ff14fea4731c37a8e4807b88c7b59ee
Author: Pranav Kant 
Date:   Sat Feb 24 14:56:51 2018 +0530

loleaflet: Keep the cursor 'default' by default

Change-Id: I88e18f7ce08612837dd99df3f9d08b4561007371
Reviewed-on: https://gerrit.libreoffice.org/50275
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index 98bffaa7..5ac2a725 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -28,6 +28,7 @@
left: 0px;
right: 0px;
z-index: 10;
+   cursor: default;
 }
 
 .scroll-container .mCSB_scrollTools.mCSB_1_scrollbar {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - include/vcl sc/source sd/qa sd/source sw/qa sw/source

2018-02-25 Thread Pranav Kant
 include/vcl/ITiledRenderable.hxx   |   45 +
 include/vcl/window.hxx |7 +++
 sc/source/ui/inc/gridwin.hxx   |7 +++
 sc/source/ui/unoobj/docuno.cxx |   43 +++
 sc/source/ui/view/gridwin.cxx  |   15 
 sd/qa/unit/tiledrendering/tiledrendering.cxx   |7 +++
 sd/source/ui/inc/ViewShell.hxx |6 ---
 sd/source/ui/inc/Window.hxx|6 +++
 sd/source/ui/unoidl/unomodel.cxx   |   39 ++---
 sd/source/ui/view/sdwindow.cxx |   39 +
 sd/source/ui/view/viewshel.cxx |   39 -
 sw/qa/extras/tiledrendering/tiledrendering.cxx |   44 +++-
 sw/source/uibase/inc/edtwin.hxx|6 +--
 sw/source/uibase/uno/unotxdoc.cxx  |   34 ++
 14 files changed, 219 insertions(+), 118 deletions(-)

New commits:
commit 743aee0ad16449ba0ecf506e0a650b45b89628bc
Author: Pranav Kant 
Date:   Sat Feb 24 12:19:57 2018 +0530

lok: All mouse,key events async

custom posting of mouse,key events on main thread

This still bypasses vcl while keeping the processing of events on the
main thread which is what we want.

Change-Id: Ia7a6f5ef1ac546245715abe418d261b49df12d4c
Reviewed-on: https://gerrit.libreoffice.org/50274
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 

diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index b14ee48f341e..cea97828d7ed 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -14,6 +14,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -88,6 +90,48 @@ protected:
 int mnTilePixelWidth, mnTilePixelHeight;
 int mnTileTwipWidth, mnTileTwipHeight;
 public:
+struct LOKAsyncEventData
+{
+VclPtr mpWindow;
+sal_uLong mnEvent;
+MouseEvent maMouseEvent;
+KeyEvent maKeyEvent;
+};
+
+static void LOKPostAsyncEvent(void* pEv, void*)
+{
+LOKAsyncEventData* pLOKEv = static_cast(pEv);
+switch (pLOKEv->mnEvent)
+{
+case VCLEVENT_WINDOW_KEYINPUT:
+pLOKEv->mpWindow->KeyInput(pLOKEv->maKeyEvent);
+break;
+case VCLEVENT_WINDOW_KEYUP:
+pLOKEv->mpWindow->KeyUp(pLOKEv->maKeyEvent);
+break;
+case VCLEVENT_WINDOW_MOUSEBUTTONDOWN:
+pLOKEv->mpWindow->LogicMouseButtonDown(pLOKEv->maMouseEvent);
+// Invoke the context menu
+if (pLOKEv->maMouseEvent.GetButtons() & MOUSE_RIGHT)
+{
+const CommandEvent aCEvt(pLOKEv->maMouseEvent.GetPosPixel(), 
CommandEventId::ContextMenu, true, nullptr);
+pLOKEv->mpWindow->Command(aCEvt);
+}
+break;
+case VCLEVENT_WINDOW_MOUSEBUTTONUP:
+pLOKEv->mpWindow->LogicMouseButtonUp(pLOKEv->maMouseEvent);
+break;
+case VCLEVENT_WINDOW_MOUSEMOVE:
+pLOKEv->mpWindow->LogicMouseMove(pLOKEv->maMouseEvent);
+break;
+default:
+assert(false);
+break;
+}
+
+delete pLOKEv;
+}
+
 virtual ~ITiledRenderable();
 
 /**
@@ -329,6 +373,7 @@ public:
 return OUString();
 }
 
+
 };
 } // namespace vcl
 
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 910ce0344045..cfc9e2c71919 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -1222,6 +1222,13 @@ public:
 /// Dialog / window tunneling related methods.
 Size PaintActiveFloatingWindow(VirtualDevice& rDevice) const;
 
+/// Same as MouseButtonDown(), but coordinates are in logic unit. used for 
LOK
+virtual void LogicMouseButtonDown(const MouseEvent&) {};
+/// Same as MouseButtonUp(), but coordinates are in logic unit. used for 
LOK
+virtual void LogicMouseButtonUp(const MouseEvent&) {};
+/// Same as MouseMove(), but coordinates are in logic unit. used for LOK
+virtual void LogicMouseMove(const MouseEvent&) {};
+
 /** @name Accessibility
  */
 ///@{
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 607f1fbd1697..9830834a4bbd 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -438,6 +438,13 @@ public:
   long nTileHeight);
 void updateLibreOfficeKitCellCursor(SfxViewShell* pOtherShell) const;
 
+/// Same as MouseButtonDown(), but coordinates are in logic unit.
+virtual void LogicMouseButtonDown(const MouseEvent& rMouseEvent) override;
+/// Same as MouseButtonUp(), but coordinates are in logic unit.
+virtual void LogicMouseButtonUp(const MouseEvent& rMouseEvent)

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

2018-02-25 Thread Pranav Kant
 loleaflet/dist/loleaflet.css |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d7ff0b0bb2a096c024b55a84619879ac6155f9d2
Author: Pranav Kant 
Date:   Sat Feb 24 14:56:51 2018 +0530

loleaflet: Keep the cursor 'default' by default

Change-Id: I88e18f7ce08612837dd99df3f9d08b4561007371
Reviewed-on: https://gerrit.libreoffice.org/50276
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index 23a32a87..4db830b8 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -28,6 +28,7 @@
left: 0px;
right: 0px;
z-index: 10;
+   cursor: default;
 }
 
 .scroll-container .mCSB_scrollTools.mCSB_1_scrollbar {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-23 Thread Pranav Kant
 sc/source/ui/unoobj/docuno.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit 86ea687d3f19c04192ee2b7a82736e110c7be334
Author: Pranav Kant 
Date:   Fri Feb 23 21:27:50 2018 +0530

lok sc: This is not needed now

I guess since these events are routed through vcl now.

Change-Id: Ib2a44c82d76a25ac5a3341c060a665c62e3d60a7
Reviewed-on: https://gerrit.libreoffice.org/50254
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index ae635323574e..7a1af69926f3 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -688,12 +688,6 @@ void ScModelObj::postMouseEvent(int nType, int nX, int nY, 
int nCount, int nButt
 break;
 case LOK_MOUSEEVENT_MOUSEBUTTONUP:
 Application::PostMouseEvent(VCLEVENT_WINDOW_MOUSEBUTTONUP, 
pGridWindow, &aEvent);
-
-// sometimes MouseButtonDown captures mouse and starts tracking, and 
VCL
-// will not take care of releasing that with tiled rendering
-if (pGridWindow->IsTracking())
-pGridWindow->EndTracking(TrackingEventFlags::DontCallHdl);
-
 break;
 case LOK_MOUSEEVENT_MOUSEMOVE:
 Application::PostMouseEvent(VCLEVENT_WINDOW_MOUSEMOVE, pGridWindow, 
&aEvent);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - desktop/source include/vcl sc/qa sc/source vcl/source

2018-02-23 Thread Pranav Kant
 desktop/source/lib/init.cxx  |   79 ---
 include/vcl/IDialogRenderable.hxx|2 
 include/vcl/ITiledRenderable.hxx |   61 
 sc/qa/unit/tiledrendering/tiledrendering.cxx |2 
 sc/source/ui/unoobj/docuno.cxx   |6 +-
 vcl/source/window/mouse.cxx  |   17 +
 6 files changed, 85 insertions(+), 82 deletions(-)

New commits:
commit 7e8d9f156fc6650c49c3312f6f7a7a57abf1f285
Author: Pranav Kant 
Date:   Fri Feb 23 21:27:33 2018 +0530

lok sc: Post mouse events to main thread

Change-Id: I1311938d7c01d0e3bfd239743e6cb2148da56cdf
Reviewed-on: https://gerrit.libreoffice.org/50253
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1bf6d00674a8..45cd0a0c18b2 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -211,66 +211,6 @@ static const ExtensionMap aDrawExtensionMap[] =
 { nullptr, nullptr }
 };
 
-/*
- * Map directly to css cursor styles to avoid further mapping in the client.
- * Gtk (via gdk_cursor_new_from_name) also supports the same css cursor styles.
- *
- * This was created partially with help of the mappings in gtkdata.cxx.
- * The list is incomplete as some cursor style simply aren't supported
- * by css, it might turn out to be worth mapping some of these missing cursors
- * to available cursors?
- */
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning( disable : 4592)
-#endif
-static const std::map  aPointerMap {
-{ PointerStyle::Arrow, "default" },
-// PointerStyle::Null ?
-{ PointerStyle::Wait, "wait" },
-{ PointerStyle::Text, "text" },
-{ PointerStyle::Help, "help" },
-{ PointerStyle::Cross, "crosshair" },
-{ PointerStyle::Fill, "fill" },
-{ PointerStyle::Move, "move" },
-{ PointerStyle::NSize, "n-resize" },
-{ PointerStyle::SSize, "s-resize" },
-{ PointerStyle::WSize, "w-resize" },
-{ PointerStyle::ESize, "e-resize" },
-{ PointerStyle::NWSize, "ne-resize" },
-{ PointerStyle::NESize, "ne-resize" },
-{ PointerStyle::SWSize, "sw-resize" },
-{ PointerStyle::SESize, "se-resize" },
-// WindowNSize through WindowSESize
-{ PointerStyle::HSplit, "col-resize" },
-{ PointerStyle::VSplit, "row-resize" },
-{ PointerStyle::HSizeBar, "col-resize" },
-{ PointerStyle::VSizeBar, "row-resize" },
-{ PointerStyle::Hand, "grab" },
-{ PointerStyle::RefHand, "grabbing" },
-// Pen, Magnify, Fill, Rotate
-// HShear, VShear
-// Mirror, Crook, Crop, MovePoint, MoveBezierWeight
-// MoveData
-{ PointerStyle::CopyData, "copy" },
-{ PointerStyle::LinkData, "alias" },
-// MoveDataLink, CopyDataLink
-//MoveFile, CopyFile, LinkFile
-// MoveFileLink, CopyFileLink, MoveFiless, CopyFiles
-{ PointerStyle::NotAllowed, "not-allowed" },
-// DrawLine through DrawCaption
-// Chart, Detective, PivotCol, PivotRow, PivotField, Chain, ChainNotAllowed
-// TimeEventMove, TimeEventSize
-// AutoScrollN through AutoScrollNSWE
-// Airbrush
-{ PointerStyle::TextVertical, "vertical-text" }
-// Pivot Delete, TabSelectS through TabSelectSW
-// PaintBrush, HideWhiteSpace, ShowWhiteSpace
-};
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
 static OUString getUString(const char* pString)
 {
 if (pString == nullptr)
@@ -2511,25 +2451,6 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* 
pThis, int nType, int nX,
 }
 
 pDoc->postMouseEvent(nType, nX, nY, nCount, nButtons, nModifier);
-
-Pointer aPointer = pDoc->getPointer();
-// We don't map all possible pointers hence we need a default
-OString aPointerString = "default";
-auto aIt = aPointerMap.find(aPointer.GetStyle());
-if (aIt != aPointerMap.end())
-{
-aPointerString = aIt->second;
-}
-
-LibLODocument_Impl* pLib = static_cast(pThis);
-int nView = SfxLokHelper::getView();
-if (nView < 0)
-return;
-
-if (pLib->mpCallbackFlushHandlers[nView])
-{
-
pLib->mpCallbackFlushHandlers[nView]->queue(LOK_CALLBACK_MOUSE_POINTER, 
aPointerString.getStr());
-}
 }
 
 static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, 
unsigned nLOKWindowId, int nType, int nX, int nY, int nCount, int nButtons, int 
nModifier)
diff --git a/include/vcl/IDialogRenderable.hxx 
b/include/vcl/IDialogRenderable.hxx
index ef8d42a4a46c..a2c9b8416ccd 100644
--- a/include/vcl/IDialogRenderable.hxx
+++ b/include/vcl/IDialogRenderable.hxx
@@ -34,6 +34,8 @@ public:
 virtual void notifyWindow(vcl::LOKWindowId nLOKWindo

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

2018-02-23 Thread Pranav Kant
 sc/qa/unit/tiledrendering/tiledrendering.cxx |1 +
 sc/source/ui/unoobj/docuno.cxx   |6 --
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 0178d2b7071be32ac2334e0548beae3b4e8dbc7d
Author: Pranav Kant 
Date:   Fri Feb 23 02:58:59 2018 +0530

lokdialog sc: post key events to the main thread

This also fixes the problem when some dialog is executed inside the key
handler.

Change-Id: I831ed4b886c1a5eac13dffd8e881a07045458e44
Reviewed-on: https://gerrit.libreoffice.org/50244
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 74d2d3dc5f0a..11c5179622c6 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1590,6 +1590,7 @@ void ScTiledRenderingTest::testIMESupport()
 // commit the string to the cell
 pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN);
 pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
+Scheduler::ProcessEventsToIdle();
 
 CPPUNIT_ASSERT_EQUAL(aInputs[aInputs.size() - 1], 
pDoc->GetString(ScAddress(0, 0, 0)));
 
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index b6cbc5e46fac..d191d14ba9a5 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -619,14 +619,16 @@ void ScModelObj::postKeyEvent(int nType, int nCharCode, 
int nKeyCode)
 if (!pWindow)
 return;
 
+if (!pWindow->HasFocus())
+pWindow->GrabFocus();
 KeyEvent aEvent(nCharCode, nKeyCode, 0);
 switch (nType)
 {
 case LOK_KEYEVENT_KEYINPUT:
-pWindow->KeyInput(aEvent);
+Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, pWindow, &aEvent);
 break;
 case LOK_KEYEVENT_KEYUP:
-pWindow->KeyUp(aEvent);
+Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, pWindow, &aEvent);
 break;
 default:
 assert(false);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - include/vcl sc/source sd/source sw/source vcl/source

2018-02-22 Thread Pranav Kant
 include/vcl/dialog.hxx|3 +++
 sc/source/ui/unoobj/docuno.cxx|   24 ++--
 sd/source/ui/unoidl/unomodel.cxx  |   20 +++-
 sw/source/uibase/uno/unotxdoc.cxx |   19 +--
 vcl/source/window/dialog.cxx  |   26 +-
 5 files changed, 50 insertions(+), 42 deletions(-)

New commits:
commit 391660de4125da06775f7d94ef352da3926c115f
Author: Pranav Kant 
Date:   Wed Feb 21 13:10:00 2018 +0530

lokdialog: Allow Execute()ing first, silently cancels others

We want to be able to detect which dialogs are important and need to be
converted to async while not completely disallowing them. Allow only
first instance of such dialogs being Execute()d and warn when another
such instance tries to Execute().

Change-Id: I6742784fa95d9e3f9ff87ece294126d390ae9e9e
Reviewed-on: https://gerrit.libreoffice.org/50092
Tested-by: Jenkins 
Reviewed-by: pranavk 

diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index e2ad43bcbf48..24e0dfd7378f 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -48,6 +48,7 @@ private:
 std::unique_ptr mpDialogImpl;
 longmnMousePositioned;
 boolmbInExecute;
+boolmbInSyncExecute;
 boolmbInClose;
 boolmbModalMode;
 boolmbPaintComplete;
@@ -127,6 +128,8 @@ public:
 
 virtual short   Execute();
 boolIsInExecute() const { return mbInExecute; }
+// Return true when dialog is synchronously executed (calling ::Execute())
+boolIsInSyncExecute() const { return mbInSyncExecute; };
 
 virtual FactoryFunction GetUITestFactory() const override;
 
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 9ba5d57da2d4..2da8e08d7ebc 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -803,13 +804,26 @@ bool Dialog::ImplStartExecuteModal()
 return false;
 }
 
+ImplSVData* pSVData = ImplGetSVData();
+
 switch ( Application::GetDialogCancelMode() )
 {
 case Application::DialogCancelMode::Off:
 break;
 case Application::DialogCancelMode::Silent:
 if (GetLOKNotifier())
-break;
+{
+// check if there's already some dialog being ::Execute()d
+const bool bDialogExecuting = 
std::any_of(pSVData->maWinData.mpExecuteDialogs.begin(),
+  
pSVData->maWinData.mpExecuteDialogs.end(),
+  [](const Dialog* 
pDialog) {
+  return 
pDialog->IsInSyncExecute();
+  });
+if (!(bDialogExecuting && IsInSyncExecute()))
+break;
+else
+SAL_WARN("lok.dialog", "Dialog \"" << ImplGetDialogText(this) 
<< "\" is being synchronously executed over an existing synchronously executing 
dialog.");
+}
 
 SAL_INFO(
 "vcl",
@@ -836,9 +850,7 @@ bool Dialog::ImplStartExecuteModal()
 }
 #endif
 
-ImplSVData* pSVData = ImplGetSVData();
-
- // link all dialogs which are being executed
+// link all dialogs which are being executed
 pSVData->maWinData.mpExecuteDialogs.push_back(this);
 
 // stop capturing, in order to have control over the dialog
@@ -950,6 +962,11 @@ short Dialog::Execute()
 #if HAVE_FEATURE_DESKTOP
 VclPtr xWindow = this;
 
+mbInSyncExecute = true;
+comphelper::ScopeGuard aGuard([&]() {
+mbInSyncExecute = false;
+});
+
 if ( !ImplStartExecuteModal() )
 return 0;
 
@@ -959,7 +976,6 @@ short Dialog::Execute()
 Application::Yield();
 
 ImplEndExecuteModal();
-
 #ifdef DBG_UTIL
 assert (!mpDialogParent || !mpDialogParent->IsDisposed());
 #endif
commit 190a44fe052f034368e254d263fca21fc000d6ce
Author: Pranav Kant 
Date:   Tue Feb 20 21:39:15 2018 +0530

lok: Factor out the code for finding vcl::Window of a document

This should also help with IME input on charts

Change-Id: Ie513790a5d0c87397c39301a328a44b59d394a45
Reviewed-on: https://gerrit.libreoffice.org/50091
Tested-by: Jenkins 
Reviewed-by: pranavk 

diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index b64645dfe667..cd56f7c5872e 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -552,10 +552,19 @@ OUString ScModelObj::getPartHash( int nPart )
 VclPtr ScModelObj::getDocWindow()
 {
 SolarMutexGuard aGuard;
+
+// There seems to be no clear way of getting the grid window for this
+// particular do

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

2018-02-22 Thread Pranav Kant
 sc/source/ui/unoobj/docuno.cxx|4 ++--
 sd/source/ui/unoidl/unomodel.cxx  |5 +++--
 sw/source/uibase/uno/unotxdoc.cxx |4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit d5f0b3d725f678c1a7eb4b8b4ab3a2279742260c
Author: Pranav Kant 
Date:   Thu Feb 22 17:40:35 2018 +0530

Revert posting key events on the main thread

This partially reverts commit f2d3192e8a4ae743fcaab27ab6d829d57ae8fb60.

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

diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index f415a7b5cd4c..b6cbc5e46fac 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -623,10 +623,10 @@ void ScModelObj::postKeyEvent(int nType, int nCharCode, 
int nKeyCode)
 switch (nType)
 {
 case LOK_KEYEVENT_KEYINPUT:
-Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, pWindow, &aEvent);
+pWindow->KeyInput(aEvent);
 break;
 case LOK_KEYEVENT_KEYUP:
-Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, pWindow, &aEvent);
+pWindow->KeyUp(aEvent);
 break;
 default:
 assert(false);
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 30971a584e49..d9ea81e4982e 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2507,13 +2507,14 @@ void SdXImpressDocument::postKeyEvent(int nType, int 
nCharCode, int nKeyCode)
 return;
 
 KeyEvent aEvent(nCharCode, nKeyCode, 0);
+
 switch (nType)
 {
 case LOK_KEYEVENT_KEYINPUT:
-Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, pWindow, &aEvent);
+pWindow->KeyInput(aEvent);
 break;
 case LOK_KEYEVENT_KEYUP:
-Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, pWindow, &aEvent);
+pWindow->KeyUp(aEvent);
 break;
 default:
 assert(false);
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 103ae13f9111..0244b3db6a2b 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3499,10 +3499,10 @@ void SwXTextDocument::postKeyEvent(int nType, int 
nCharCode, int nKeyCode)
 switch (nType)
 {
 case LOK_KEYEVENT_KEYINPUT:
-Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, pWindow, &aEvent);
+pWindow->KeyInput(aEvent);
 break;
 case LOK_KEYEVENT_KEYUP:
-Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, pWindow, &aEvent);
+pWindow->KeyUp(aEvent);
 break;
 default:
 assert(false);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - include/vcl vcl/source

2018-02-21 Thread Pranav Kant
 include/vcl/dialog.hxx   |3 +++
 vcl/source/window/dialog.cxx |   24 
 2 files changed, 23 insertions(+), 4 deletions(-)

New commits:
commit fdfc29078f64223148354551c1cb3b2169454350
Author: Pranav Kant 
Date:   Wed Feb 21 13:10:00 2018 +0530

lokdialog: Allow Execute()ing first, silently cancels others

We want to be able to detect which dialogs are important and need to be
converted to async while not completely disallowing them. Allow only
first instance of such dialogs being Execute()d and warn when another
such instance tries to Execute().

Change-Id: I6742784fa95d9e3f9ff87ece294126d390ae9e9e
Reviewed-on: https://gerrit.libreoffice.org/50095
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index f028b7cb57c9..b1bdfcfb1cea 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -42,6 +42,7 @@ private:
 std::unique_ptr mpDialogImpl;
 longmnMousePositioned;
 boolmbInExecute;
+boolmbInSyncExecute;
 boolmbInClose;
 boolmbModalMode;
 boolmbPaintComplete;
@@ -116,6 +117,8 @@ public:
 
 virtual short   Execute();
 boolIsInExecute() const { return mbInExecute; }
+// Return true when dialog is synchronously executed (calling ::Execute())
+boolIsInSyncExecute() const { return mbInSyncExecute; };
 
 virtual FactoryFunction GetUITestFactory() const override;
 
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 79d7f224ab43..c3e22efdeda4 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -820,13 +821,26 @@ bool Dialog::ImplStartExecuteModal()
 return false;
 }
 
+ImplSVData* pSVData = ImplGetSVData();
+
 switch ( Application::GetDialogCancelMode() )
 {
 case Application::DialogCancelMode::Off:
 break;
 case Application::DialogCancelMode::Silent:
 if (GetLOKNotifier())
-break;
+{
+// check if there's already some dialog being ::Execute()d
+Dialog* pExeDlg = pSVData->maWinData.mpLastExecuteDlg;
+while (pExeDlg && !pExeDlg->IsInSyncExecute())
+pExeDlg = pExeDlg->mpPrevExecuteDlg;
+
+const bool bDialogExecuting = pExeDlg ? pExeDlg->IsInSyncExecute() 
: false;
+if (!(bDialogExecuting && IsInSyncExecute()))
+break;
+else
+SAL_WARN("lok.dialog", "Dialog \"" << ImplGetDialogText(this) 
<< "\" is being synchronously executed over an existing synchronously executing 
dialog.");
+}
 
 SAL_INFO(
 "vcl",
@@ -853,8 +867,6 @@ bool Dialog::ImplStartExecuteModal()
 }
 #endif
 
-ImplSVData* pSVData = ImplGetSVData();
-
  // link all dialogs which are being executed
 mpPrevExecuteDlg = pSVData->maWinData.mpLastExecuteDlg;
 if (mpPrevExecuteDlg)
@@ -969,6 +981,10 @@ short Dialog::Execute()
 #if HAVE_FEATURE_DESKTOP
 VclPtr xWindow = this;
 
+mbInSyncExecute = true;
+comphelper::ScopeGuard aGuard([&]() {
+mbInSyncExecute = false;
+});
 if ( !ImplStartExecuteModal() )
 return 0;
 
@@ -977,8 +993,8 @@ short Dialog::Execute()
 while ( !xWindow->IsDisposed() && mbInExecute )
 Application::Yield();
 
+mbInSyncExecute = false;
 ImplEndExecuteModal();
-
 #ifdef DBG_UTIL
 assert (!mpDialogParent || !mpDialogParent->IsDisposed());
 #endif
___
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-3-1' - kit/ChildSession.cpp loleaflet/src

2018-02-21 Thread Pranav Kant
 kit/ChildSession.cpp  |5 -
 loleaflet/src/layer/tile/TileLayer.js |2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 7714ed1ee217f54fe6eb79493b20d366774d4f0a
Author: Pranav Kant 
Date:   Wed Feb 21 21:29:50 2018 +0530

ime: Don't eat space

Encode/decode so that ' ' as payload of compositionupdate event doesn't
get lost.

Change-Id: Ia31abe85f1cf19f8f286c9069097bdc72297e664
(cherry picked from commit fc4d6aeeb9a14b6ff8c2b09cab8c2d358cd0e42d)
Reviewed-on: https://gerrit.libreoffice.org/50117
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index c98bbe48..1613e2b3 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -785,9 +785,12 @@ bool ChildSession::extTextInputEvent(const char* 
/*buffer*/, int /*length*/,
 return false;
 }
 
+std::string decodedText;
+URI::decode(text, decodedText);
+
 std::unique_lock lock(_docManager.getDocumentMutex());
 getLOKitDocument()->setView(_viewId);
-getLOKitDocument()->postExtTextInputEvent(id, type, text.c_str());
+getLOKitDocument()->postExtTextInputEvent(id, type, decodedText.c_str());
 
 return true;
 }
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index a6fe4cba..f32f737d 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1374,7 +1374,7 @@ L.TileLayer = L.GridLayer.extend({
 
// if winId=0, then event is posted on the document
_postCompositionEvent: function(winId, type, text) {
-   this._map._socket.sendMessage('textinput id=' + winId + ' 
type=' + type + ' text=' + text);
+   this._map._socket.sendMessage('textinput id=' + winId + ' 
type=' + type + ' text=' + encodeURIComponent(text));
},
 
_postSelectGraphicEvent: function(type, x, y) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-21 Thread Pranav Kant
 vcl/source/window/window.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit ddbb78caa78085673b07dbea6f53288ec6237764
Author: Pranav Kant 
Date:   Tue Feb 20 15:41:35 2018 +0530

Bin useless code

Change-Id: Id3ffa2333946a9551da9d0f9ecbd2885716b9376
Reviewed-on: https://gerrit.libreoffice.org/50102
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 1b0495f7147e..e33862a45e98 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2087,8 +2087,6 @@ void Window::PostExtTextInputEvent(VclEventId nType, 
const OUString& rText)
 }
 SalExtTextInputEvent aEvent { rText, pAttr.get(), rText.getLength(), 
EXTTEXTINPUT_CURSOR_OVERWRITE };
 ImplWindowFrameProc(this, SalEvent::ExtTextInput, &aEvent);
-SalExtTextInputPosEvent evt;
-ImplWindowFrameProc(this, SalEvent::ExtTextInputPos, &evt);
 }
 break;
 case VclEventId::EndExtTextInput:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-21 Thread Pranav Kant
 kit/ChildSession.cpp  |5 -
 loleaflet/src/layer/tile/TileLayer.js |2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit fc4d6aeeb9a14b6ff8c2b09cab8c2d358cd0e42d
Author: Pranav Kant 
Date:   Wed Feb 21 21:29:50 2018 +0530

ime: Don't eat space

Encode/decode so that ' ' as payload of compositionupdate event doesn't
get lost.

Change-Id: Ia31abe85f1cf19f8f286c9069097bdc72297e664

diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index ef9bfd3d..4b9199f8 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -785,9 +785,12 @@ bool ChildSession::extTextInputEvent(const char* 
/*buffer*/, int /*length*/,
 return false;
 }
 
+std::string decodedText;
+URI::decode(text, decodedText);
+
 std::unique_lock lock(_docManager.getDocumentMutex());
 getLOKitDocument()->setView(_viewId);
-getLOKitDocument()->postExtTextInputEvent(id, type, text.c_str());
+getLOKitDocument()->postExtTextInputEvent(id, type, decodedText.c_str());
 
 return true;
 }
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 8cafab6b..72318ae1 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1470,7 +1470,7 @@ L.TileLayer = L.GridLayer.extend({
 
// if winId=0, then event is posted on the document
_postCompositionEvent: function(winId, type, text) {
-   this._map._socket.sendMessage('textinput id=' + winId + ' 
type=' + type + ' text=' + text);
+   this._map._socket.sendMessage('textinput id=' + winId + ' 
type=' + type + ' text=' + encodeURIComponent(text));
},
 
_postSelectGraphicEvent: function(type, x, y) {
___
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   >