diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-01-06 14:27:27 +0530 |
---|---|---|
committer | pranavk <pranavk@collabora.co.uk> | 2017-01-06 09:58:48 +0000 |
commit | 6ccd698371a8e88ea06ed0e144171dd1b6236aa7 (patch) | |
tree | 46f8b85566029bfabf1bdbe9254cc4c0d367cd04 /libreofficekit | |
parent | 3ab6e2783bf7142729924cb95ca730404d0c54e1 (diff) |
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>
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; |