diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-01-06 14:27:27 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-02-17 16:47:41 +0100 |
commit | a0763acce4ed93a8cc79e3b0a9853142f2381dfe (patch) | |
tree | 5546ac9c2acec3ec81769cd1c14fa4ae7b18f87b /libreofficekit | |
parent | gtktiledviewer: Support for posting arguments to uno commands (diff) | |
download | core-a0763acce4ed93a8cc79e3b0a9853142f2381dfe.tar.gz core-a0763acce4ed93a8cc79e3b0a9853142f2381dfe.zip |
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@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
(cherry picked from commit 6ccd698371a8e88ea06ed0e144171dd1b6236aa7)
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx index 2f75a650e7a2..33829879b7c7 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; |