summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-11-03 15:05:37 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-11-03 15:39:55 +0100
commit75303695eb4bfe6c8fdea2cad0d3ed3f912f95c9 (patch)
tree4cac531cdbd4c7f01870f3d62e3636c9616a743c /libreofficekit
parentcce7d78baa91ab348e85407ada8387c9c89176cb (diff)
sc lok: allow requesting row headers only for a logic area
So that for large documents it's not needed to query all of them on load, but (similar to tiled rendering itself) it's possible to query the data that affects the visible area. One catch is that the row sizes are relative, so there is a placeholder row in case the visible area is not the top left corner, and constructing its size needs special care. Normally the handed out twip values have to be floored after twip->px conversion, but this one is already rounded (as the total is a sum of px values, again becase of the previous floor rule), so need to play the +0.5 trick to allow clients always just flooring the logic conversion result they get. Change-Id: I64a155582acdee7b2acc741d77a2c462409b91a8
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index e67db9f02460..fb054776f59d 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -256,8 +256,16 @@ gboolean TiledRowColumnBar::docConfigureEvent(GtkWidget* pDocView, GdkEventConfi
LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(LOK_DOC_VIEW(pDocView));
if (pDocument && pDocument->pClass->getDocumentType(pDocument) == LOK_DOCTYPE_SPREADSHEET)
{
- g_info("lok::Document::getCommandValues(.uno:ViewRowColumnHeaders)");
- char* pValues = pDocument->pClass->getCommandValues(pDocument, ".uno:ViewRowColumnHeaders");
+ std::stringstream aCommand;
+ aCommand << ".uno:ViewRowColumnHeaders";
+ aCommand << "?x=" << int(lok_doc_view_pixel_to_twip(LOK_DOC_VIEW(pDocView), rWindow.m_pColumnBar->m_nPositionPixel));
+ aCommand << "&width=" << int(lok_doc_view_pixel_to_twip(LOK_DOC_VIEW(pDocView), rWindow.m_pColumnBar->m_nSizePixel));
+ aCommand << "&y=" << int(lok_doc_view_pixel_to_twip(LOK_DOC_VIEW(pDocView), rWindow.m_pRowBar->m_nPositionPixel));
+ aCommand << "&height=" << int(lok_doc_view_pixel_to_twip(LOK_DOC_VIEW(pDocView), rWindow.m_pRowBar->m_nSizePixel));
+ std::stringstream ss;
+ ss << "lok::Document::getCommandValues(" << aCommand.str() << ")";
+ g_info(ss.str().c_str());
+ char* pValues = pDocument->pClass->getCommandValues(pDocument, aCommand.str().c_str());
std::stringstream aStream(pValues);
free(pValues);
assert(!aStream.str().empty());