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

Pranav Kant pranavk at collabora.co.uk
Fri Jan 6 09:59:14 UTC 2017


 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

New commits:
commit 6ccd698371a8e88ea06ed0e144171dd1b6236aa7
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Fri Jan 6 14:27:27 2017 +0530

    gtktiledviewer: Override alignment buttons uno commands for calc
    
    Use .uno:HorizontalAlignment instead of .uno:XXXPara for calc
    
    Change-Id: I5af4fe62dc3075af4ba779499d062e6d91f21ecf
    Reviewed-on: https://gerrit.libreoffice.org/32773
    Reviewed-by: pranavk <pranavk at collabora.co.uk>
    Tested-by: pranavk <pranavk at collabora.co.uk>

diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 2f75a65..3382987 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -373,6 +373,25 @@ gboolean TiledRowColumnBar::docConfigureEvent(GtkWidget* pDocView, GdkEventConfi
         gtk_widget_show(rWindow.m_pColumnBar->m_pDrawingArea);
         gtk_widget_queue_draw(rWindow.m_pColumnBar->m_pDrawingArea);
         gtk_widget_show(rWindow.m_pFormulabarEntry);
+
+        // Change horizontal alignment uno commands for spreadsheet
+        const char* unoHorAlignArgs =
+            "{"
+            "\"HorizontalAlignment\":{"
+            "\"type\":\"unsigned short\", "
+            "\"value\":\"%d\""
+            "}"
+            "}";
+
+        char unoHorAlignArgsFormatted[strlen(unoHorAlignArgs)];
+        snprintf(unoHorAlignArgsFormatted, sizeof(unoHorAlignArgsFormatted), unoHorAlignArgs, 1);
+        lcl_registerToolItem(rWindow, rWindow.m_pLeftpara, ".uno:HorizontalAlignment", std::string(unoHorAlignArgsFormatted));
+        snprintf(unoHorAlignArgsFormatted, sizeof(unoHorAlignArgsFormatted), unoHorAlignArgs, 2);
+        lcl_registerToolItem(rWindow, rWindow.m_pCenterpara, ".uno:HorizontalAlignment", std::string(unoHorAlignArgsFormatted));
+        snprintf(unoHorAlignArgsFormatted, sizeof(unoHorAlignArgsFormatted), unoHorAlignArgs, 3);
+        lcl_registerToolItem(rWindow, rWindow.m_pRightpara, ".uno:HorizontalAlignment", std::string(unoHorAlignArgsFormatted));
+        snprintf(unoHorAlignArgsFormatted, sizeof(unoHorAlignArgsFormatted), unoHorAlignArgs, 4);
+        lcl_registerToolItem(rWindow, rWindow.m_pJustifypara, ".uno:HorizontalAlignment", std::string(unoHorAlignArgsFormatted));
     }
 
     return TRUE;


More information about the Libreoffice-commits mailing list