Kaydet (Commit) a27e0907 authored tarafından Pranav Kant's avatar Pranav Kant Kaydeden (comit) pranavk

lok: Listen for state change events for cell alignment commands

We used to use HorizontalAlignment uno command for cell alignment
both in online and gtktiledviewer. To make things simpler, lets
use separate cell alignment uno commands for spreadsheets like we
have in writer and impres.

Change-Id: I2a959d1892f6b02db7a9ce51d55309216e4b3c6c
Reviewed-on: https://gerrit.libreoffice.org/33444Reviewed-by: 's avatarpranavk <pranavk@collabora.co.uk>
Tested-by: 's avatarpranavk <pranavk@collabora.co.uk>
üst 115797f0
......@@ -1344,6 +1344,9 @@ static void doc_iniUnoCommands ()
OUString sUnoCommands[] =
{
OUString(".uno:AlignLeft"),
OUString(".uno:AlignHorizontalCenter"),
OUString(".uno:AlignRight"),
OUString(".uno:BackColor"),
OUString(".uno:BackgroundColor"),
OUString(".uno:Bold"),
......
......@@ -374,18 +374,11 @@ gboolean TiledRowColumnBar::docConfigureEvent(GtkWidget* pDocView, GdkEventConfi
gtk_widget_queue_draw(rWindow.m_pColumnBar->m_pDrawingArea);
gtk_widget_show(rWindow.m_pFormulabarEntry);
// Change horizontal alignment uno commands for spreadsheet
const std::string argsPrefix =
"{"
"\"HorizontalAlignment\":{"
"\"type\":\"unsigned short\", "
"\"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);
// Change cell alignment uno commands for spreadsheet
lcl_registerToolItem(rWindow, rWindow.m_pLeftpara, ".uno:AlignLeft");
lcl_registerToolItem(rWindow, rWindow.m_pCenterpara, ".uno:AlignHorizontalCenter");
lcl_registerToolItem(rWindow, rWindow.m_pRightpara, ".uno:AlignRight");
gtk_widget_hide(GTK_WIDGET(rWindow.m_pJustifypara));
}
return TRUE;
......
......@@ -996,7 +996,10 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c
aEvent.FeatureURL.Path == "Underline" ||
aEvent.FeatureURL.Path == "ModifiedStatus" ||
aEvent.FeatureURL.Path == "TrackChanges" ||
aEvent.FeatureURL.Path == "AcceptTrackedChange")
aEvent.FeatureURL.Path == "AcceptTrackedChange" ||
aEvent.FeatureURL.Path == "AlignLeft" ||
aEvent.FeatureURL.Path == "AlignHorizontalCenter" ||
aEvent.FeatureURL.Path == "AlignRight")
{
bool bTemp = false;
aEvent.State >>= bTemp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment