summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-12-15 21:12:17 -0500
committerMichael Meeks <michael.meeks@collabora.com>2019-12-16 12:13:05 +0000
commit523a7b6d5f2989703c0dce03986f6676f300a501 (patch)
tree485ce3848477d1ba465d0dc861f959ed90b20293
parentchart2: clear listener parents in dispose (diff)
downloadcore-feature/jssidebar.tar.gz
core-feature/jssidebar.zip
sfx2: sidebar: new .uno commands to show and hide sidebars feature/jssidebar
Change-Id: I9afba5eec855d6de590086736177b543d52d3b20 Reviewed-on: https://gerrit.libreoffice.org/85192 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--desktop/source/lib/init.cxx12
-rw-r--r--include/sfx2/sfxsids.hrc2
-rw-r--r--include/svx/svxids.hrc5
-rw-r--r--sfx2/sdi/frmslots.sdi10
-rw-r--r--sfx2/sdi/sfx.sdi36
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx2
-rw-r--r--sfx2/source/sidebar/SidebarDockingWindow.cxx4
-rw-r--r--sfx2/source/view/viewfrm.cxx19
8 files changed, 77 insertions, 13 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 81c02c2c5d22..ad44965df7dd 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3310,12 +3310,12 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
}
else if (aMap.find("id") != aMap.end())
{
- const OUString sClickAction("CLICK");
- const OUString sSelectAction("SELECT");
- const OUString sClearAction("CLEAR");
- const OUString sTypeAction("TYPE");
- const OUString sUpAction("UP");
- const OUString sDownAction("DOWN");
+ static const OUString sClickAction("CLICK");
+ static const OUString sSelectAction("SELECT");
+ static const OUString sClearAction("CLEAR");
+ static const OUString sTypeAction("TYPE");
+ static const OUString sUpAction("UP");
+ static const OUString sDownAction("DOWN");
try
{
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 9fa90a5f6226..f7d77257350c 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -575,6 +575,8 @@ class SvxSearchItem;
#define SID_TABLE_BORDER_TYPE (SID_SVX_START + 1065)
#define SID_TABLE_BORDER_INDEX (SID_SVX_START + 1066)
#define SID_TABLE_BORDER_OFFSET (SID_SVX_START + 1067)
+#define SID_SHOW_SIDEBAR (SID_SVX_START + 1200)
+#define SID_HIDE_SIDEBAR (SID_SVX_START + 1201)
#define FID_SVX_START (SID_LIB_START + 500)
#define FID_SEARCH_NOW (FID_SVX_START + 2)
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index f12a326d0d2a..09fa766fbb5b 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -999,8 +999,11 @@ class SvxSetItem;
#define SID_ULINE_VAL_DOUBLE (SID_SVX_START + 1197) /* double underline */
#define SID_ULINE_VAL_DOTTED (SID_SVX_START + 1198) /* dotted underline */
+// #define SID_SHOW_SIDEBAR ( SID_SVX_START + 1200 ) -> sfxsids.hrc
+// #define SID_HIDE_SIDEBAR ( SID_SVX_START + 1201 ) -> sfxsids.hrc
+
// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE ( SID_SVX_START + 1198 + 1 )
+#define SID_SVX_FIRSTFREE ( SID_HIDE_SIDEBAR + 1 )
// Overflow check for slot IDs
#if SID_SVX_FIRSTFREE > SID_SVX_END
diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi
index 09aafef95b7d..53a13b479a7c 100644
--- a/sfx2/sdi/frmslots.sdi
+++ b/sfx2/sdi/frmslots.sdi
@@ -43,6 +43,16 @@ interface Window
ExecMethod = ChildWindowExecute ;
StateMethod = ChildWindowState ;
]
+ SID_SHOW_SIDEBAR // status(final|play)
+ [
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
+ SID_HIDE_SIDEBAR // status(final|play)
+ [
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
SID_BROWSER // ole(no) api()
[
ExecMethod = ChildWindowExecute ;
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 624abe196661..f95610d07f5c 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -2594,6 +2594,42 @@ SfxBoolItem Sidebar SID_SIDEBAR
GroupId = SfxGroupId::View;
]
+SfxBoolItem SidebarShow SID_SHOW_SIDEBAR
+[
+ AutoUpdate = TRUE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::View;
+]
+
+SfxBoolItem SidebarHide SID_HIDE_SIDEBAR
+[
+ AutoUpdate = TRUE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::View;
+]
+
SfxBoolItem Menubar SID_MENUBAR
[
AutoUpdate = TRUE,
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index d8950b6276c0..f6930c1a6963 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -1221,7 +1221,7 @@ void SidebarController::RequestCloseDeck()
// Mobile.
std::stringstream aStream;
boost::property_tree::ptree aTree;
- aTree.put("id", mpParentWindow->get_id()); // TODO could be missing - sort out
+ aTree.put("id", mpCurrentDeck->GetLOKWindowId());
aTree.put("type", "dockingwindow");
aTree.put("text", mpParentWindow->GetText());
aTree.put("enabled", false);
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index ad7434195fe2..ca570716aa5c 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -69,7 +69,9 @@ public:
{
// Mobile.
std::stringstream aStream;
- boost::property_tree::write_json(aStream, m_rSidebarDockingWin.DumpAsPropertyTree());
+ boost::property_tree::ptree aTree = m_rSidebarDockingWin.DumpAsPropertyTree();
+ aTree.put("id", m_rSidebarDockingWin.GetLOKWindowId());
+ boost::property_tree::write_json(aStream, aTree);
const std::string message = aStream.str();
if (message != m_LastNotificationMessage)
{
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 81f9d1fd4bdd..a19a89a91b91 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -3217,17 +3217,28 @@ void SfxViewFrame::ChildWindowState( SfxItemSet& rState )
else if ( KnowsChildWindow(nSID) )
rState.Put( SfxBoolItem( nSID, HasChildWindow(nSID) ) );
}
- else if ( nSID == SID_SIDEBAR )
+ else if ( nSID == SID_SIDEBAR || nSID == SID_SHOW_SIDEBAR || nSID == SID_HIDE_SIDEBAR )
{
- if ( !KnowsChildWindow( nSID ) )
+ if ( !KnowsChildWindow( SID_SIDEBAR ) )
{
SAL_WARN("sfx.view", "SID_SIDEBAR state requested, but no task pane child window exists for this ID!");
- rState.DisableItem( nSID );
+ rState.DisableItem( SID_SIDEBAR );
}
- else
+ else if ( nSID == SID_SIDEBAR )
{
+ // Toggle.
rState.Put( SfxBoolItem( nSID, HasChildWindow( nSID ) ) );
}
+ else if ( nSID == SID_SHOW_SIDEBAR )
+ {
+ // Show.
+ rState.Put( SfxBoolItem( nSID, false ) );
+ }
+ else if ( nSID == SID_HIDE_SIDEBAR )
+ {
+ // Hide.
+ rState.Put( SfxBoolItem( nSID, true ) );
+ }
}
else if ( KnowsChildWindow(nSID) )
rState.Put( SfxBoolItem( nSID, HasChildWindow(nSID) ) );