summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2020-01-25 04:10:38 +0300
committerAndras Timar <andras.timar@collabora.com>2020-02-12 11:43:35 +0100
commit97988a0705b95b6bf6d32f38c66e954d3012ec38 (patch)
tree3ec1e7122033166da5a4e8a28a6e4b1d95c4547a
parentbe10debe0ec7873bdc56977d0b9934c6eb165b9e (diff)
lok: Add LOK_CALLBACK_STATE_CHANGED for uno:Orientation
Change-Id: Iab3aaf742bdb9fc4b9c5875fee7d769fa0581eeb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87370 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Aron Budea <aron.budea@collabora.com> Tested-by: Aron Budea <aron.budea@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88451 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--desktop/source/lib/init.cxx3
-rw-r--r--sw/source/uibase/uiview/viewstat.cxx14
2 files changed, 16 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ed3bc77c2667..90989c45df96 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2654,7 +2654,8 @@ static void doc_iniUnoCommands ()
OUString(".uno:OnlineAutoFormat"),
OUString(".uno:InsertSymbol"),
OUString(".uno:EditRegion"),
- OUString(".uno:ThesaurusDialog")
+ OUString(".uno:ThesaurusDialog"),
+ OUString(".uno:Orientation")
};
util::URL aCommandURL;
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index ca90d62f1528..caa3bd34a6a2 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -187,6 +187,20 @@ void SwView::GetState(SfxItemSet &rSet)
}
::PageDescToItemSet( rDesc, rSet);
+
+ if (nWhich == SID_ATTR_PAGE_ORIENTATION && comphelper::LibreOfficeKit::isActive())
+ {
+ OString aPayload = ".uno:Orientation=";
+ if (rDesc.GetLandscape())
+ {
+ aPayload += "IsLandscape";
+ }
+ else
+ {
+ aPayload += "IsPortrait";
+ }
+ libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr());
+ }
}
break;
case RES_BACKGROUND: