summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2019-11-09 18:18:15 +0000
committerMichael Meeks <michael.meeks@collabora.com>2019-11-13 11:15:59 +0100
commitd5786f64fcba4b41e908714312046052bf70a3c9 (patch)
treee92961e85c0bc06207f49d44365fa0f8a276fc51 /libreofficekit
parentc8822da749e3720ad99f21ea9bb7a0b035a4b859 (diff)
lok: calc: switch row / column / grouping data to pixels.
This simplifies lots of logic in the clients, making it trivial to get good row/column header alignment at any zoom. Ultimately TWIPS here are highly misleading print-twips, and in this state are ~impossible to map to pixels accurately unless all data is present back to the origin (which is not the current approach). Change-Id: I6ca30e77865b62e886e23860f7c23350e544c9fc Reviewed-on: https://gerrit.libreoffice.org/82555 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
index 1987bdc909cf..619b2a87b13f 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
@@ -103,7 +103,7 @@ static gboolean gtv_calc_header_bar_draw_impl(GtkWidget* pWidget, cairo_t* pCair
if (priv->m_eType == CalcHeaderType::ROW)
{
aRectangle.x = 0;
- aRectangle.y = nPrevious - 1;
+ aRectangle.y = nPrevious;
aRectangle.width = ROW_HEADER_WIDTH - 1;
aRectangle.height = rHeader.m_nSize - nPrevious;
// Left line.
@@ -118,7 +118,7 @@ static gboolean gtv_calc_header_bar_draw_impl(GtkWidget* pWidget, cairo_t* pCair
}
else if (priv->m_eType == CalcHeaderType::COLUMN)
{
- aRectangle.x = nPrevious - 1;
+ aRectangle.x = nPrevious;
aRectangle.y = 0;
aRectangle.width = rHeader.m_nSize - nPrevious;
aRectangle.height = COLUMN_HEADER_HEIGHT - 1;
@@ -168,7 +168,6 @@ gtv_calc_header_bar_class_init(GtvCalcHeaderBarClass* klass)
void gtv_calc_header_bar_configure(GtvCalcHeaderBar* bar, const boost::property_tree::ptree* values)
{
- GtvApplicationWindow* window = GTV_APPLICATION_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(bar)));
GtvCalcHeaderBarPrivate& priv = getPrivate(bar);
priv->m_aHeaders.clear();
@@ -179,7 +178,7 @@ void gtv_calc_header_bar_configure(GtvCalcHeaderBar* bar, const boost::property_
{
for (boost::property_tree::ptree::value_type& rValue : val)
{
- int nSize = std::round(lok_doc_view_twip_to_pixel(LOK_DOC_VIEW(window->lokdocview), std::atof(rValue.second.get<std::string>("size").c_str())));
+ int nSize = std::round(std::atof(rValue.second.get<std::string>("size").c_str()));
if (nSize >= bar->m_nPositionPixel)
{
const int nScrolledSize = nSize - bar->m_nPositionPixel;