diff options
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx index 33829879b7c7..3c774c1a7fce 100644 --- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx @@ -375,23 +375,17 @@ gboolean TiledRowColumnBar::docConfigureEvent(GtkWidget* pDocView, GdkEventConfi gtk_widget_show(rWindow.m_pFormulabarEntry); // Change horizontal alignment uno commands for spreadsheet - const char* unoHorAlignArgs = + const std::string argsPrefix = "{" "\"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)); + "\"value\":\""; + const std::string argsSuffix = "\"}}"; + + lcl_registerToolItem(rWindow, rWindow.m_pLeftpara, ".uno:HorizontalAlignment", argsPrefix + std::to_string(1) + argsSuffix); + lcl_registerToolItem(rWindow, rWindow.m_pCenterpara, ".uno:HorizontalAlignment", argsPrefix + std::to_string(2) + argsSuffix); + lcl_registerToolItem(rWindow, rWindow.m_pRightpara, ".uno:HorizontalAlignment", argsPrefix + std::to_string(3) + argsSuffix); + lcl_registerToolItem(rWindow, rWindow.m_pJustifypara, ".uno:HorizontalAlignment", argsPrefix + std::to_string(4) + argsSuffix); } return TRUE; |