[Libreoffice-commits] core.git: Branch 'feature/chart-sidebar' - 489 commits - accessibility/inc accessibility/source android/Bootstrap animations/source avmedia/source basctl/inc basctl/source basebmp/source basebmp/test basegfx/inc basegfx/qa basegfx/source basic/source bean/com binaryurp/source bin/includebloat.awk bridges/inc bridges/Library_cpp_uno.mk bridges/source bridges/test canvas/source chart2/Library_chartcontroller.mk chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk chart2/workbench cli_ure/source comphelper/source compilerplugins/clang config_host/config_dconf.h.in config_host.mk.in configmgr/CppunitTest_configmgr_unit.mk configmgr/Library_configmgr.mk configmgr/qa configmgr/source configure.ac connectivity/source cppcanvas/inc cppcanvas/source cppuhelper/source cppu/source cui/source dbaccess/CppunitTest_dbaccess_RowSetClones.mk dbaccess/source desktop/inc desktop/source desktop/test dictionaries distro-configs/LibreOfficeLinux.conf download.lst drawinglayer/source dtrans/so urce editeng/source embeddedobj/source embedserv/Library_emser.mk extensions/Library_oleautobridge.mk extensions/Library_so_activex.mk extensions/Library_so_activex_x64.mk extensions/source extensions/test extensions/uiconfig external/curl external/glew external/icu external/lcms2 external/libcmis external/liborcus external/libxml2 external/libxslt external/Module_external.mk external/nss external/redland filter/source forms/qa forms/source formula/Library_for.mk formula/source fpicker/source framework/inc framework/qa framework/source helpcompiler/source helpcontent2 hwpfilter/source i18nlangtag/qa i18nlangtag/source i18npool/inc i18npool/source icon-themes/breeze icon-themes/galaxy icon-themes/sifr icon-themes/tango idlc/test idl/inc idl/source include/basebmp include/basegfx include/basic include/canvas include/com include/comphelper include/connectivity include/drawinglayer include/editeng include/formula include/framework include/i18nlangtag include/jvmfwk include/o3tl include/ oox include/osl include/package include/registry include/rtl include/sal include/sfx2 include/sot include/svl include/svtools include/svx include/toolkit include/tools include/typelib include/ucbhelper include/unotools include/vbahelper include/vcl include/xmloff instsetoo_native/CustomTarget_setup.mk io/source jurt/com jvmfwk/inc jvmfwk/plugins librelogo/source libreofficekit/source linguistic/source lotuswordpro/source Makefile.fetch nlpsolver/ThirdParty odk/config odk/docs odk/examples offapi/com offapi/type_reference officecfg/registry onlineupdate/Executable_updater.mk onlineupdate/README onlineupdate/source oox/inc oox/source package/inc package/source pyuno/inc pyuno/source qadevOOo/runner qadevOOo/tests readlicense_oo/license registry/Executable_regview.mk registry/inc registry/Library_reg.mk registry/source registry/tools reportbuilder/java reportdesign/inc reportdesign/source RepositoryExternal.mk sal/android sal/osl sal/qa sal/rtl sax/inc sax/source scaddins/Library_analy sis.mk scaddins/source sc/inc scp2/source sc/qa scripting/source sc/sdi sc/source sc/uiconfig sd/CppunitTest_sd_export_tests.mk sdext/README sdext/source sd/inc sd/qa sd/sdi sd/source sd/uiconfig setup_native/source sfx2/qa sfx2/source sfx2/uiconfig shell/inc shell/source slideshow/qa slideshow/source solenv/bin solenv/gbuild soltools/cpp sot/source starmath/inc starmath/sdi starmath/source starmath/uiconfig stoc/source store/source svgio/inc svgio/qa svl/source svtools/source svx/inc svx/Library_svx.mk svx/sdi svx/source svx/uiconfig svx/UIConfig_svx.mk sw/inc sw/qa sw/sdi sw/source sw/uiconfig testtools/com testtools/source toolkit/source tools/CppunitTest_tools_test.mk tools/qa tools/source translations ucb/qa ucb/source udkapi/com UnoControls/source unotools/source unoxml/source uui/source vbahelper/source vcl/CppunitTest_vcl_lifecycle.mk vcl/generic vcl/headless vcl/inc vcl/opengl vcl/osx vcl/qa vcl/quartz vcl/source vcl/unx vcl/win winaccessibility/inc winaccessibility/Library _uacccom.mk winaccessibility/source wizards/com wizards/source writerfilter/source xmerge/source xmlhelp/Library_ucpchelp1.mk xmlhelp/source xmloff/dtd xmloff/inc xmloff/source xmlscript/source xmlsecurity/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Wed Jul 15 04:05:19 PDT 2015
Rebased ref, commits from common ancestor:
commit 41e0589fe9df173b74a02848406900b2133cecff
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 15 13:03:02 2015 +0200
wire title and legend checkboxes
Change-Id: I4c6d5e213f44588cf2d53d9c12ed8033307fd863
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index cd59e34..c6ac57b 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -32,12 +32,58 @@
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
+#include "LegendHelper.hxx"
+#include "TitleHelper.hxx"
+
+#include "ChartModel.hxx"
+
using namespace css;
using namespace css::uno;
using ::sfx2::sidebar::Theme;
namespace chart { namespace sidebar {
+namespace {
+
+ChartModel* getChartModel(css::uno::Reference<css::frame::XModel> xModel)
+{
+ ChartModel* pModel = dynamic_cast<ChartModel*>(xModel.get());
+
+ return pModel;
+}
+
+bool isLegendVisible(css::uno::Reference<css::frame::XModel> xModel)
+{
+ ChartModel* pModel = getChartModel(xModel);
+ if (!pModel)
+ return false;
+
+ Reference< beans::XPropertySet > xLegendProp( LegendHelper::getLegend(*pModel), uno::UNO_QUERY );
+ if( xLegendProp.is())
+ {
+ try
+ {
+ bool bShow = false;
+ if( xLegendProp->getPropertyValue( "Show") >>= bShow )
+ {
+ return bShow;
+ }
+ }
+ catch( const uno::Exception & ex )
+ {
+ }
+ }
+
+ return false;
+}
+
+bool isTitleVisisble(css::uno::Reference<css::frame::XModel> xModel, TitleHelper::eTitleType eTitle)
+{
+ return TitleHelper::getTitle(eTitle, xModel).is();
+}
+
+}
+
ChartElementsPanel::ChartElementsPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
@@ -134,6 +180,7 @@ VclPtr<vcl::Window> ChartElementsPanel::Create (
void ChartElementsPanel::DataChanged(
const DataChangedEvent& )
{
+ updateData();
}
void ChartElementsPanel::HandleContextChange(
@@ -146,6 +193,7 @@ void ChartElementsPanel::HandleContextChange(
}
maContext = rContext;
+ updateData();
}
void ChartElementsPanel::NotifyItemUpdate(
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
index be53c75..399b0f9 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
@@ -96,6 +96,7 @@ private:
css::uno::Reference<css::frame::XModel> mxModel;
void Initialize();
+ void updateData();
};
} } // end of namespace ::chart::sidebar
commit 20641befab24755dab0116c80cbee0365eeadb4c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 15 13:01:40 2015 +0200
we need access to the chart model in the chart sidebar
Change-Id: I607b5ada047f84cd7a229640772a332702f93f1e
diff --git a/chart2/source/controller/main/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx
similarity index 100%
rename from chart2/source/controller/main/ChartController.hxx
rename to chart2/source/controller/inc/ChartController.hxx
diff --git a/chart2/source/controller/main/CommandDispatchContainer.hxx b/chart2/source/controller/inc/CommandDispatchContainer.hxx
similarity index 100%
rename from chart2/source/controller/main/CommandDispatchContainer.hxx
rename to chart2/source/controller/inc/CommandDispatchContainer.hxx
diff --git a/chart2/source/controller/main/SelectionHelper.hxx b/chart2/source/controller/inc/SelectionHelper.hxx
similarity index 100%
rename from chart2/source/controller/main/SelectionHelper.hxx
rename to chart2/source/controller/inc/SelectionHelper.hxx
diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
index 3d89b61..1ec38ab 100644
--- a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
+++ b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
@@ -30,8 +30,8 @@
#include <cppuhelper/supportsservice.hxx>
#include "ChartElementsPanel.hxx"
+#include "ChartController.hxx"
-using namespace css;
using namespace css::uno;
using ::rtl::OUString;
@@ -46,23 +46,24 @@ ChartPanelFactory::~ChartPanelFactory()
{
}
-Reference<ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
+Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
const ::rtl::OUString& rsResourceURL,
const ::css::uno::Sequence<css::beans::PropertyValue>& rArguments)
throw(
- container::NoSuchElementException,
- lang::IllegalArgumentException,
+ css::container::NoSuchElementException,
+ css::lang::IllegalArgumentException,
RuntimeException, std::exception)
{
- Reference<ui::XUIElement> xElement;
+ Reference<css::ui::XUIElement> xElement;
try
{
const ::comphelper::NamedValueCollection aArguments (rArguments);
- Reference<frame::XFrame> xFrame (aArguments.getOrDefault("Frame", Reference<frame::XFrame>()));
- Reference<awt::XWindow> xParentWindow (aArguments.getOrDefault("ParentWindow", Reference<awt::XWindow>()));
+ Reference<css::frame::XFrame> xFrame (aArguments.getOrDefault("Frame", Reference<css::frame::XFrame>()));
+ Reference<css::awt::XWindow> xParentWindow (aArguments.getOrDefault("ParentWindow", Reference<css::awt::XWindow>()));
const sal_uInt64 nBindingsValue (aArguments.getOrDefault("SfxBindings", sal_uInt64(0)));
SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue);
+ Reference<css::frame::XController> xController (aArguments.getOrDefault("Controller", Reference<css::frame::XController>()));
vcl::Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow);
if ( ! xParentWindow.is() || pParentWindow==NULL)
@@ -77,11 +78,21 @@ Reference<ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
throw RuntimeException(
"PanelFactory::createUIElement called without SfxBindings",
NULL);
+ if (!xController.is())
+ throw RuntimeException(
+ "ChartPanelFactory::createUIElement called without Controller",
+ NULL);
+
+ ChartController* pController = dynamic_cast<ChartController*>(xController.get());
+ if (!pController)
+ throw RuntimeException(
+ "ChartPanelFactory::createUIElement called without valid ChartController",
+ NULL);
sal_Int32 nMinimumSize = -1;
VclPtr<vcl::Window> pPanel;
if (rsResourceURL.endsWith("/ElementsPanel"))
- pPanel = ChartElementsPanel::Create( pParentWindow, xFrame, pBindings );
+ pPanel = ChartElementsPanel::Create( pParentWindow, xFrame, pBindings, pController );
/*
else if (rsResourceURL.endsWith("/CellAppearancePropertyPanel"))
pPanel = CellAppearancePropertyPanel::Create( pParentWindow, xFrame, pBindings );
@@ -104,17 +115,17 @@ Reference<ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
rsResourceURL,
xFrame,
pPanel,
- ui::LayoutSize(nMinimumSize,-1,-1));
+ css::ui::LayoutSize(nMinimumSize,-1,-1));
}
- catch (const uno::RuntimeException &)
+ catch (const css::uno::RuntimeException &)
{
throw;
}
- catch (const uno::Exception& e)
+ catch (const css::uno::Exception& e)
{
- throw lang::WrappedTargetRuntimeException(
+ throw css::lang::WrappedTargetRuntimeException(
OUString("ChartPanelFactory::createUIElement exception"),
- 0, uno::makeAny(e));
+ 0, css::uno::makeAny(e));
}
return xElement;
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 6775659..cd59e34 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -21,6 +21,7 @@
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sidebar/ControlFactory.hxx>
#include "ChartElementsPanel.hxx"
+#include "ChartController.hxx"
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/imagemgr.hxx>
@@ -40,11 +41,13 @@ namespace chart { namespace sidebar {
ChartElementsPanel::ChartElementsPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings)
+ SfxBindings* pBindings,
+ ChartController* pController)
: PanelLayout(pParent, "ChartElementsPanel", "modules/schart/ui/sidebarelements.ui", rxFrame),
mxFrame(rxFrame),
maContext(),
- mpBindings(pBindings)
+ mpBindings(pBindings),
+ mxModel(pController->getModel())
{
get(mpCBTitle, "checkbutton_title");
get(mpCBSubtitle, "checkbutton_subtitle");
@@ -97,12 +100,25 @@ void ChartElementsPanel::dispose()
void ChartElementsPanel::Initialize()
{
+ updateData();
+}
+
+void ChartElementsPanel::updateData()
+{
+ mpCBLegend->Check(isLegendVisible(mxModel));
+ mpCBTitle->Check(isTitleVisisble(mxModel, TitleHelper::MAIN_TITLE));
+ mpCBSubtitle->Check(isTitleVisisble(mxModel, TitleHelper::SUB_TITLE));
+ mpCBXAxisTitle->Check(isTitleVisisble(mxModel, TitleHelper::X_AXIS_TITLE));
+ mpCBYAxisTitle->Check(isTitleVisisble(mxModel, TitleHelper::Y_AXIS_TITLE));
+ mpCBZAxisTitle->Check(isTitleVisisble(mxModel, TitleHelper::Z_AXIS_TITLE));
+ mpCB2ndXAxisTitle->Check(isTitleVisisble(mxModel, TitleHelper::SECONDARY_X_AXIS_TITLE));
+ mpCB2ndYAxisTitle->Check(isTitleVisisble(mxModel, TitleHelper::SECONDARY_Y_AXIS_TITLE));
}
VclPtr<vcl::Window> ChartElementsPanel::Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings)
+ SfxBindings* pBindings, ChartController* pController)
{
if (pParent == NULL)
throw lang::IllegalArgumentException("no parent Window given to ChartElementsPanel::Create", NULL, 0);
@@ -112,7 +128,7 @@ VclPtr<vcl::Window> ChartElementsPanel::Create (
throw lang::IllegalArgumentException("no SfxBindings given to ChartElementsPanel::Create", NULL, 2);
return VclPtr<ChartElementsPanel>::Create(
- pParent, rxFrame, pBindings);
+ pParent, rxFrame, pBindings, pController);
}
void ChartElementsPanel::DataChanged(
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
index f07ab66..be53c75 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
@@ -28,7 +28,11 @@ class FixedText;
class ListBox;
class NumericField;
-namespace chart { namespace sidebar {
+namespace chart {
+
+class ChartController;
+
+namespace sidebar {
class ChartElementsPanel : public PanelLayout,
public ::sfx2::sidebar::IContextChangeReceiver,
@@ -38,7 +42,7 @@ public:
static VclPtr<vcl::Window> Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
+ SfxBindings* pBindings, ChartController* pController);
virtual void DataChanged(
const DataChangedEvent& rEvent) SAL_OVERRIDE;
@@ -58,7 +62,7 @@ public:
ChartElementsPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
+ SfxBindings* pBindings, ChartController* pController);
virtual ~ChartElementsPanel();
virtual void dispose() SAL_OVERRIDE;
private:
@@ -89,6 +93,8 @@ private:
::sfx2::sidebar::EnumContext maContext;
SfxBindings* mpBindings;
+ css::uno::Reference<css::frame::XModel> mxModel;
+
void Initialize();
};
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 403a40b..ae47b4f 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -809,6 +809,7 @@ Reference<ui::XUIElement> SidebarController::CreateUIElement (
{
aCreationArguments.put("Module", makeAny(aModule));
}
+ aCreationArguments.put("Controller", makeAny(mxCurrentController));
}
aCreationArguments.put("ApplicationName", makeAny(rContext.msApplication));
commit 1d3c108a761771185756739b5a4ce4a3e3eebe5f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Jul 14 15:07:29 2015 +0200
for now show chart sidebar
This is a hack that needs to be cleaned up later.
Change-Id: I2772fe6ff8a4792d746a29653635d3eca4088e68
diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx
index ca993ff..f8437c2 100644
--- a/embeddedobj/source/general/docholder.cxx
+++ b/embeddedobj/source/general/docholder.cxx
@@ -714,8 +714,9 @@ bool DocumentHolder::ShowUI( const uno::Reference< ::com::sun::star::frame::XLay
xContainerLM->setDockingAreaAcceptor( uno::Reference < ui::XDockingAreaAcceptor >() );
// prevent further changes at this LM
- xContainerLM->setVisible( sal_False );
- xContainerLM->lock();
+ // TODO: moggi: why is this necessary?
+ // xContainerLM->setVisible( sal_False );
+ // xContainerLM->lock();
bUnlock = true;
// by unlocking the LM each layout change will now resize the containers window; pending layouts will be processed now
commit be940487e12900f481276829f66014a1710cd3a3
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Jul 14 15:07:10 2015 +0200
fix indentation
Change-Id: I4bceb79ed4adda085727dfcee1ba3573811e53b3
diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx
index 7fb23f8..ca993ff 100644
--- a/embeddedobj/source/general/docholder.cxx
+++ b/embeddedobj/source/general/docholder.cxx
@@ -684,8 +684,8 @@ bool DocumentHolder::ShowUI( const uno::Reference< ::com::sun::star::frame::XLay
if ( xContainerLM.is() )
{
// the LM of the embedded frame and its current DockingAreaAcceptor
- uno::Reference< ::com::sun::star::frame::XLayoutManager > xOwnLM;
- uno::Reference< ::com::sun::star::ui::XDockingAreaAcceptor > xDocAreaAcc;
+ uno::Reference< ::com::sun::star::frame::XLayoutManager > xOwnLM;
+ uno::Reference< ::com::sun::star::ui::XDockingAreaAcceptor > xDocAreaAcc;
try
{
@@ -727,7 +727,7 @@ bool DocumentHolder::ShowUI( const uno::Reference< ::com::sun::star::frame::XLay
xOwnLM->unlock();
bLock = true;
- bResult = true;
+ bResult = true;
// TODO/LATER: The following action should be done only if the window is not hidden
// otherwise the activation must fail, unfortunately currently it is not possible
commit fa56a9be275f31517f6d9381f799c97da963f63b
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Mon Jul 13 16:27:26 2015 +0300
chart2: Fix .ui widget names
warn:vcl.layout:13283:1:include/vcl/builder.hxx:413:
widget "checkbutton_x_axis_title" not found in .ui
warn:vcl.layout:14352:1:include/vcl/builder.hxx:413:
widget "checkbutton_y_axis_title" not found in .ui
Change-Id: I5a6e29b24706df0925038e869be94b0f6a8d232f
diff --git a/chart2/uiconfig/ui/sidebarelements.ui b/chart2/uiconfig/ui/sidebarelements.ui
index 0f92814..2432c6e2 100644
--- a/chart2/uiconfig/ui/sidebarelements.ui
+++ b/chart2/uiconfig/ui/sidebarelements.ui
@@ -90,7 +90,7 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="checkbuttonx_axis_title">
+ <object class="GtkCheckButton" id="checkbutton_x_axis_title">
<property name="label" translatable="yes">X-axis title</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -131,7 +131,7 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="checkbuttony_y_axis_title">
+ <object class="GtkCheckButton" id="checkbutton_y_axis_title">
<property name="label" translatable="yes">Y-axis title</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
commit c9765693fbac9eff0942f14674411e5aa7166372
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Jul 14 14:22:03 2015 +0200
fix indentation
Change-Id: Ifda010d2a8f51c6981cac889bfaa1edaacd22df2
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx
index 4be6cc9..74e1196 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -370,13 +370,13 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState )
bool bOk = false;
if ( xContainerLM.is() )
- bOk = m_pDocHolder->HideUI( xContainerLM );
+ bOk = m_pDocHolder->HideUI( xContainerLM );
if ( bOk )
{
m_nObjectState = nNextState;
m_pDocHolder->ResizeHatchWindow();
- xInplaceClient->deactivatedUI();
+ xInplaceClient->deactivatedUI();
}
else
throw embed::WrongStateException(); //TODO: can't activate UI
commit 5a0017f890b84fdc90db2bb95cb157fdf9eb9923
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Jul 12 18:54:33 2015 +0200
avoid crash in unit test due to global objects
The lifecycle of the XFrame and the XController are both correct but
getCurrentController has already been reset when the
SidebarController::dispose is called.
This avoids then calling the XController destructor during exit when
taking a SolarMutex is a problem.
Change-Id: I54470f091e506fb397e2424d2d3c4ac051cae924
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index c67447f..403a40b 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -221,16 +221,11 @@ void SAL_CALL SidebarController::disposing()
aDeck.disposeAndClear();
}
- SidebarControllerContainer::iterator iEntry (maSidebarControllerContainer.find(mxFrame->getController()));
- if (iEntry != maSidebarControllerContainer.end())
- maSidebarControllerContainer.erase(iEntry);
+ uno::Reference<css::frame::XController> xController = mxFrame->getController();
+ if (!xController.is())
+ xController = mxCurrentController;
- css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer (
- css::ui::ContextChangeEventMultiplexer::get(
- ::comphelper::getProcessComponentContext()));
- if (xMultiplexer.is())
- xMultiplexer->removeAllContextChangeEventListeners(
- static_cast<css::ui::XContextChangeEventListener*>(this));
+ unregisterSidebarForFrame(this, xController);
if (mxReadOnlyModeDispatch.is())
mxReadOnlyModeDispatch->removeStatusListener(this, Tools::GetURL(gsReadOnlyCommandName));
commit 5d5667062c228f83db0c2a7c5967619f012c809b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Jul 10 02:25:58 2015 +0200
add ChartElements panel
Change-Id: I935a0d637a9ea3a1716d6e839e65c4e565a2c840
diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk
index be73e1e..884404e 100644
--- a/chart2/Library_chartcontroller.mk
+++ b/chart2/Library_chartcontroller.mk
@@ -189,6 +189,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/main/UndoCommandDispatch \
chart2/source/controller/main/UndoGuard \
chart2/source/controller/sidebar/Chart2PanelFactory \
+ chart2/source/controller/sidebar/ChartElementsPanel \
))
# Runtime dependency for unit-tests
diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk
index d59c29e..ab8ce34 100644
--- a/chart2/UIConfig_chart2.mk
+++ b/chart2/UIConfig_chart2.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\
chart2/uiconfig/ui/insertgriddlg \
chart2/uiconfig/ui/inserttitledlg \
chart2/uiconfig/ui/paradialog \
+ chart2/uiconfig/ui/sidebarelements \
chart2/uiconfig/ui/smoothlinesdlg \
chart2/uiconfig/ui/steppedlinesdlg \
chart2/uiconfig/ui/titlerotationtabpage \
diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
index 13df31f..3d89b61 100644
--- a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
+++ b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
@@ -29,6 +29,8 @@
#include <comphelper/namedvaluecollection.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include "ChartElementsPanel.hxx"
+
using namespace css;
using namespace css::uno;
using ::rtl::OUString;
@@ -78,9 +80,9 @@ Reference<ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
sal_Int32 nMinimumSize = -1;
VclPtr<vcl::Window> pPanel;
+ if (rsResourceURL.endsWith("/ElementsPanel"))
+ pPanel = ChartElementsPanel::Create( pParentWindow, xFrame, pBindings );
/*
- if (rsResourceURL.endsWith("/AlignmentPropertyPanel"))
- pPanel = AlignmentPropertyPanel::Create( pParentWindow, xFrame, pBindings );
else if (rsResourceURL.endsWith("/CellAppearancePropertyPanel"))
pPanel = CellAppearancePropertyPanel::Create( pParentWindow, xFrame, pBindings );
else if (rsResourceURL.endsWith("/NumberFormatPropertyPanel"))
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
new file mode 100644
index 0000000..6775659
--- /dev/null
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -0,0 +1,150 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <sfx2/sidebar/ResourceDefinitions.hrc>
+#include <sfx2/sidebar/Theme.hxx>
+#include <sfx2/sidebar/ControlFactory.hxx>
+#include "ChartElementsPanel.hxx"
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/imagemgr.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/field.hxx>
+#include <vcl/toolbox.hxx>
+#include <svl/intitem.hxx>
+#include <svl/stritem.hxx>
+
+using namespace css;
+using namespace css::uno;
+using ::sfx2::sidebar::Theme;
+
+namespace chart { namespace sidebar {
+
+ChartElementsPanel::ChartElementsPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings)
+ : PanelLayout(pParent, "ChartElementsPanel", "modules/schart/ui/sidebarelements.ui", rxFrame),
+ mxFrame(rxFrame),
+ maContext(),
+ mpBindings(pBindings)
+{
+ get(mpCBTitle, "checkbutton_title");
+ get(mpCBSubtitle, "checkbutton_subtitle");
+ get(mpCBXAxis, "checkbutton_x_axis");
+ get(mpCBXAxisTitle, "checkbutton_x_axis_title");
+ get(mpCBYAxis, "checkbutton_y_axis");
+ get(mpCBYAxisTitle, "checkbutton_y_axis_title");
+ get(mpCBZAxis, "checkbutton_z_axis");
+ get(mpCBZAxisTitle, "checkbutton_z_axis_title");
+ get(mpCB2ndXAxis, "checkbutton_2nd_x_axis");
+ get(mpCB2ndXAxisTitle, "checkbutton_2nd_x_axis_title");
+ get(mpCB2ndYAxis, "checkbutton_2nd_y_axis");
+ get(mpCB2ndYAxisTitle, "checkbutton_2nd_y_axis_title");
+ get(mpCBLegend, "checkbutton_legend");
+ get(mpCBGridVertical, "checkbutton_gridline_vertical");
+ get(mpCBGridHorizontal, "checkbutton_gridline_horizontal");
+ get(mpCBShowLabel, "checkbutton_label");
+ get(mpCBTrendline, "checkbutton_trendline");
+
+ Initialize();
+}
+
+ChartElementsPanel::~ChartElementsPanel()
+{
+ disposeOnce();
+}
+
+void ChartElementsPanel::dispose()
+{
+ mpCBTitle.clear();
+ mpCBSubtitle.clear();
+ mpCBXAxis.clear();
+ mpCBXAxisTitle.clear();
+ mpCBYAxis.clear();
+ mpCBYAxisTitle.clear();
+ mpCBZAxis.clear();
+ mpCBZAxisTitle.clear();
+ mpCB2ndXAxis.clear();
+ mpCB2ndXAxisTitle.clear();
+ mpCB2ndYAxis.clear();
+ mpCB2ndYAxisTitle.clear();
+ mpCBLegend.clear();
+ mpCBGridVertical.clear();
+ mpCBGridHorizontal.clear();
+ mpCBShowLabel.clear();
+ mpCBTrendline.clear();
+
+ PanelLayout::dispose();
+}
+
+void ChartElementsPanel::Initialize()
+{
+}
+
+VclPtr<vcl::Window> ChartElementsPanel::Create (
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings)
+{
+ if (pParent == NULL)
+ throw lang::IllegalArgumentException("no parent Window given to ChartElementsPanel::Create", NULL, 0);
+ if ( ! rxFrame.is())
+ throw lang::IllegalArgumentException("no XFrame given to ChartElementsPanel::Create", NULL, 1);
+ if (pBindings == NULL)
+ throw lang::IllegalArgumentException("no SfxBindings given to ChartElementsPanel::Create", NULL, 2);
+
+ return VclPtr<ChartElementsPanel>::Create(
+ pParent, rxFrame, pBindings);
+}
+
+void ChartElementsPanel::DataChanged(
+ const DataChangedEvent& )
+{
+}
+
+void ChartElementsPanel::HandleContextChange(
+ const ::sfx2::sidebar::EnumContext& rContext)
+{
+ if(maContext == rContext)
+ {
+ // Nothing to do.
+ return;
+ }
+
+ maContext = rContext;
+}
+
+void ChartElementsPanel::NotifyItemUpdate(
+ sal_uInt16 nSID,
+ SfxItemState /*eState*/,
+ const SfxPoolItem* /*pState*/,
+ const bool )
+{
+ switch(nSID)
+ {
+ default:
+ ;
+ }
+}
+
+}} // end of namespace ::chart::sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
new file mode 100644
index 0000000..f07ab66
--- /dev/null
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
@@ -0,0 +1,99 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_SIDEBAR_CHARTELEMENTSPANEL_HXX
+#define INCLUDED_CHART2_SOURCE_CONTROLLER_SIDEBAR_CHARTELEMENTSPANEL_HXX
+
+#include <sfx2/sidebar/ControllerItem.hxx>
+#include <sfx2/sidebar/IContextChangeReceiver.hxx>
+#include <svx/sidebar/PanelLayout.hxx>
+#include <boost/scoped_ptr.hpp>
+
+class FixedText;
+class ListBox;
+class NumericField;
+
+namespace chart { namespace sidebar {
+
+class ChartElementsPanel : public PanelLayout,
+ public ::sfx2::sidebar::IContextChangeReceiver,
+ public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
+{
+public:
+ static VclPtr<vcl::Window> Create(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
+
+ virtual void DataChanged(
+ const DataChangedEvent& rEvent) SAL_OVERRIDE;
+
+ virtual void HandleContextChange(
+ const ::sfx2::sidebar::EnumContext& rContext) SAL_OVERRIDE;
+
+ virtual void NotifyItemUpdate(
+ const sal_uInt16 nSId,
+ const SfxItemState eState,
+ const SfxPoolItem* pState,
+ const bool bIsEnabled) SAL_OVERRIDE;
+
+ SfxBindings* GetBindings() { return mpBindings;}
+
+ // constructor/destuctor
+ ChartElementsPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
+ virtual ~ChartElementsPanel();
+ virtual void dispose() SAL_OVERRIDE;
+private:
+ //ui controls
+ VclPtr<ListBox> mpLbCategory;
+ VclPtr<ToolBox> mpTBCategory;
+ VclPtr<NumericField> mpEdDecimals;
+ VclPtr<NumericField> mpEdLeadZeroes;
+ VclPtr<CheckBox> mpCBTitle;
+ VclPtr<CheckBox> mpCBSubtitle;
+ VclPtr<CheckBox> mpCBXAxis;
+ VclPtr<CheckBox> mpCBXAxisTitle;
+ VclPtr<CheckBox> mpCBYAxis;
+ VclPtr<CheckBox> mpCBYAxisTitle;
+ VclPtr<CheckBox> mpCBZAxis;
+ VclPtr<CheckBox> mpCBZAxisTitle;
+ VclPtr<CheckBox> mpCB2ndXAxis;
+ VclPtr<CheckBox> mpCB2ndXAxisTitle;
+ VclPtr<CheckBox> mpCB2ndYAxis;
+ VclPtr<CheckBox> mpCB2ndYAxisTitle;
+ VclPtr<CheckBox> mpCBLegend;
+ VclPtr<CheckBox> mpCBGridVertical;
+ VclPtr<CheckBox> mpCBGridHorizontal;
+ VclPtr<CheckBox> mpCBShowLabel;
+ VclPtr<CheckBox> mpCBTrendline;
+
+ css::uno::Reference<css::frame::XFrame> mxFrame;
+ ::sfx2::sidebar::EnumContext maContext;
+ SfxBindings* mpBindings;
+
+ void Initialize();
+};
+
+} } // end of namespace ::chart::sidebar
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/uiconfig/ui/sidebarelements.ui b/chart2/uiconfig/ui/sidebarelements.ui
new file mode 100644
index 0000000..0f92814
--- /dev/null
+++ b/chart2/uiconfig/ui/sidebarelements.ui
@@ -0,0 +1,525 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkGrid" id="ChartElementsPanel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_homogeneous">True</property>
+ <property name="column_homogeneous">True</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label_title">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Title</property>
+ <property name="justify">right</property>
+ <property name="ellipsize">end</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_title">
+ <property name="label" translatable="yes">Title</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_subtitle">
+ <property name="label" translatable="yes">Subtitle</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_axes">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Axes</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_x_axis">
+ <property name="label" translatable="yes">X-Axis</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbuttonx_axis_title">
+ <property name="label" translatable="yes">X-axis title</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_y_axis">
+ <property name="label" translatable="yes">Y-Axis</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbuttony_y_axis_title">
+ <property name="label" translatable="yes">Y-axis title</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_z_axis">
+ <property name="label" translatable="yes">Z-Axis</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.47999998927116394</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_z_axis_title">
+ <property name="label" translatable="yes">Z-axis title</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_2nd_x_axis">
+ <property name="label" translatable="yes">2nd X-Axis</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_2nd_x_axis_title">
+ <property name="label" translatable="yes">2nd X-axis title</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_2nd_y_axis">
+ <property name="label" translatable="yes">2nd Y-Axis</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.54000002145767212</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_2nd_y_axis_title">
+ <property name="label" translatable="yes">2nd Y-axis title</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">8</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_legend">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Legend</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">9</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_legend">
+ <property name="label" translatable="yes">Show</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboboxtext1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <items>
+ <item translatable="yes">bottom left</item>
+ </items>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">10</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_grid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Gridlines
+</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">11</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_gridline_vertical">
+ <property name="label" translatable="yes">Vertical</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboboxtext2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <items>
+ <item translatable="yes">major</item>
+ </items>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">12</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_gridline_horizontal">
+ <property name="label" translatable="yes">Horizontal</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.56000000238418579</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboboxtext3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <items>
+ <item translatable="yes">major</item>
+ </items>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">13</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_data">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Data</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">14</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_label">
+ <property name="label" translatable="yes">Show label</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboboxtext4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <items>
+ <item translatable="yes">above</item>
+ </items>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">15</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box11">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_trendline">
+ <property name="label" translatable="yes">Trendline</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboboxtext5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <items>
+ <item translatable="yes">linear</item>
+ </items>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">16</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+</interface>
commit b33b2afe6a8b4224450da7c686beb81dbf5cd24a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Thu Jul 9 20:39:06 2015 +0200
big step towards real chart sidebar
Change-Id: I9b7d1f963746f7689b02099fbae77c9c943bad58
diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk
index f77ef70..be73e1e 100644
--- a/chart2/Library_chartcontroller.mk
+++ b/chart2/Library_chartcontroller.mk
@@ -188,6 +188,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/main/UndoActions \
chart2/source/controller/main/UndoCommandDispatch \
chart2/source/controller/main/UndoGuard \
+ chart2/source/controller/sidebar/Chart2PanelFactory \
))
# Runtime dependency for unit-tests
diff --git a/chart2/source/controller/chartcontroller.component b/chart2/source/controller/chartcontroller.component
index 396656d..045d61f 100644
--- a/chart2/source/controller/chartcontroller.component
+++ b/chart2/source/controller/chartcontroller.component
@@ -51,4 +51,8 @@
constructor="com_sun_star_comp_chart2_WizardDialog_get_implementation">
<service name="com.sun.star.chart2.WizardDialog"/>
</implementation>
+ <implementation name="org.libreoffice.comp.chart2.sidebar.ChartPanelFactory"
+ constructor="org_libreoffice_comp_chart2_sidebar_ChartPanelFactory">
+ <service name="com.sun.star.ui.UIElementFactory"/>
+ </implementation>
</component>
diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
new file mode 100644
index 0000000..13df31f
--- /dev/null
+++ b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
@@ -0,0 +1,149 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "Chart2PanelFactory.hxx"
+
+#include <sfx2/sidebar/SidebarPanelBase.hxx>
+#include <sfx2/sfxbasecontroller.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <vcl/window.hxx>
+#include <rtl/ref.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
+#include <comphelper/namedvaluecollection.hxx>
+#include <cppuhelper/supportsservice.hxx>
+
+using namespace css;
+using namespace css::uno;
+using ::rtl::OUString;
+
+namespace chart { namespace sidebar {
+
+ChartPanelFactory::ChartPanelFactory()
+ : PanelFactoryInterfaceBase(m_aMutex)
+{
+}
+
+ChartPanelFactory::~ChartPanelFactory()
+{
+}
+
+Reference<ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
+ const ::rtl::OUString& rsResourceURL,
+ const ::css::uno::Sequence<css::beans::PropertyValue>& rArguments)
+ throw(
+ container::NoSuchElementException,
+ lang::IllegalArgumentException,
+ RuntimeException, std::exception)
+{
+ Reference<ui::XUIElement> xElement;
+
+ try
+ {
+ const ::comphelper::NamedValueCollection aArguments (rArguments);
+ Reference<frame::XFrame> xFrame (aArguments.getOrDefault("Frame", Reference<frame::XFrame>()));
+ Reference<awt::XWindow> xParentWindow (aArguments.getOrDefault("ParentWindow", Reference<awt::XWindow>()));
+ const sal_uInt64 nBindingsValue (aArguments.getOrDefault("SfxBindings", sal_uInt64(0)));
+ SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue);
+
+ vcl::Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow);
+ if ( ! xParentWindow.is() || pParentWindow==NULL)
+ throw RuntimeException(
+ "PanelFactory::createUIElement called without ParentWindow",
+ NULL);
+ if ( ! xFrame.is())
+ throw RuntimeException(
+ "PanelFactory::createUIElement called without Frame",
+ NULL);
+ if (pBindings == NULL)
+ throw RuntimeException(
+ "PanelFactory::createUIElement called without SfxBindings",
+ NULL);
+
+ sal_Int32 nMinimumSize = -1;
+ VclPtr<vcl::Window> pPanel;
+ /*
+ if (rsResourceURL.endsWith("/AlignmentPropertyPanel"))
+ pPanel = AlignmentPropertyPanel::Create( pParentWindow, xFrame, pBindings );
+ else if (rsResourceURL.endsWith("/CellAppearancePropertyPanel"))
+ pPanel = CellAppearancePropertyPanel::Create( pParentWindow, xFrame, pBindings );
+ else if (rsResourceURL.endsWith("/NumberFormatPropertyPanel"))
+ pPanel = NumberFormatPropertyPanel::Create( pParentWindow, xFrame, pBindings );
+ else if (rsResourceURL.endsWith("/NavigatorPanel"))
+ {
+ pPanel = VclPtr<ScNavigatorDlg>::Create(pBindings, nullptr, pParentWindow, false);
+ nMinimumSize = 0;
+ }
+ else if (rsResourceURL.endsWith("/FunctionsPanel"))
+ {
+ pPanel = VclPtr<ScFunctionDockWin>::Create(pBindings, nullptr, pParentWindow, ScResId(FID_FUNCTION_BOX));
+ nMinimumSize = 0;
+ }
+ */
+
+ if (pPanel)
+ xElement = sfx2::sidebar::SidebarPanelBase::Create(
+ rsResourceURL,
+ xFrame,
+ pPanel,
+ ui::LayoutSize(nMinimumSize,-1,-1));
+ }
+ catch (const uno::RuntimeException &)
+ {
+ throw;
+ }
+ catch (const uno::Exception& e)
+ {
+ throw lang::WrappedTargetRuntimeException(
+ OUString("ChartPanelFactory::createUIElement exception"),
+ 0, uno::makeAny(e));
+ }
+
+ return xElement;
+}
+
+OUString ChartPanelFactory::getImplementationName()
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return OUString("org.libreoffice.comp.chart2.sidebar.ChartPanelFactory");
+}
+
+sal_Bool ChartPanelFactory::supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return cppu::supportsService(this, ServiceName);
+}
+
+css::uno::Sequence<OUString> ChartPanelFactory::getSupportedServiceNames()
+ throw (css::uno::RuntimeException, std::exception)
+{
+ css::uno::Sequence<OUString> aServiceNames(1);
+ aServiceNames[0] = "com.sun.star.ui.UIElementFactory";
+ return aServiceNames;
+}
+
+} } // end of namespace chart::sidebar
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
+org_libreoffice_comp_chart2_sidebar_ChartPanelFactory(css::uno::XComponentContext*, css::uno::Sequence<css::uno::Any> const &)
+{
+ return cppu::acquire(new chart::sidebar::ChartPanelFactory());
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.hxx b/chart2/source/controller/sidebar/Chart2PanelFactory.hxx
new file mode 100644
index 0000000..c96813c
--- /dev/null
+++ b/chart2/source/controller/sidebar/Chart2PanelFactory.hxx
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_SC_INC_SCPANELFACTORY_HXX
+#define INCLUDED_SC_INC_SCPANELFACTORY_HXX
+
+#include <cppuhelper/compbase.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/ui/XUIElementFactory.hpp>
+#include <boost/noncopyable.hpp>
+
+
+namespace chart { namespace sidebar {
+
+namespace
+{
+ typedef ::cppu::WeakComponentImplHelper <
+ css::ui::XUIElementFactory, css::lang::XServiceInfo
+ > PanelFactoryInterfaceBase;
+}
+
+class ChartPanelFactory
+ : private ::boost::noncopyable,
+ private ::cppu::BaseMutex,
+ public PanelFactoryInterfaceBase
+{
+public:
+ ChartPanelFactory();
+ virtual ~ChartPanelFactory();
+
+ // XUIElementFactory
+ virtual css::uno::Reference<css::ui::XUIElement> SAL_CALL createUIElement(
+ const ::rtl::OUString& rsResourceURL,
+ const ::css::uno::Sequence<css::beans::PropertyValue>& rArguments)
+ throw(
+ css::container::NoSuchElementException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+
+ virtual OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+ throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+};
+
+} } // end of namespace sc::sidebar
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Factories.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Factories.xcu
index 15c0a04..c26b96e 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Factories.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Factories.xcu
@@ -132,6 +132,20 @@
<value>org.apache.openoffice.comp.sw.sidebar.SwPanelFactory</value>
</prop>
</node>
+ <node oor:name="ChartPanelFactory" oor:op="replace">
+ <prop oor:name="Type">
+ <value>toolpanel</value>
+ </prop>
+ <prop oor:name="Name">
+ <value>ChartPanelFactory</value>
+ </prop>
+ <prop oor:name="Module">
+ <value></value>
+ </prop>
+ <prop oor:name="FactoryImplementation">
+ <value>org.libreoffice.comp.chart2.sidebar.ChartPanelFactory</value>
+ </prop>
+ </node>
</node>
</node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index e20b1b0..a6ce71c 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -231,6 +231,26 @@
</prop>
</node>
+ <node oor:name="ChartDeck" oor:op="replace">
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml:lang="en-US">Chart</value>
+ </prop>
+ <prop oor:name="Id" oor:type="xs:string">
+ <value>ChartDeck</value>
+ </prop>
+ <prop oor:name="IconURL" oor:type="xs:string">
+ <value>private:graphicrepository/sfx2/res/symphony/sidebar-style-large.png</value>
+ </prop>
+ <prop oor:name="ContextList">
+ <value oor:separator=";">
+ Chart, any, visible ;
+ </value>
+ </prop>
+ <prop oor:name="OrderIndex" oor:type="xs:int">
+ <value>10</value>
+ </prop>
+ </node>
+
</node>
<node oor:name="PanelList">
@@ -1118,6 +1138,122 @@
<value>true</value>
</prop>
</node>
+
+ <node oor:name="ChartElementsPanel" oor:op="replace">
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml:lang="en-US">Elements</value>
+ </prop>
+ <prop oor:name="Id" oor:type="xs:string">
+ <value>ChartElementsPanel</value>
+ </prop>
+ <prop oor:name="DeckId" oor:type="xs:string">
+ <value>ChartDeck</value>
+ </prop>
+ <prop oor:name="ContextList">
+ <value oor:separator=";">
+ Chart, any, visible ;
+ </value>
+ </prop>
+ <prop oor:name="ImplementationURL" oor:type="xs:string">
+ <value>private:resource/toolpanel/ChartPanelFactory/ElementsPanel</value>
+ </prop>
+ <prop oor:name="OrderIndex" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+
+ <node oor:name="ChartAreaPanel" oor:op="replace">
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml:lang="en-US">Area</value>
+ </prop>
+ <prop oor:name="Id" oor:type="xs:string">
+ <value>ChartAreaPanel</value>
+ </prop>
+ <prop oor:name="DeckId" oor:type="xs:string">
+ <value>ChartDeck</value>
+ </prop>
+ <prop oor:name="ContextList">
+ <value oor:separator=";">
+ Chart, any, visible ;
+ </value>
+ </prop>
+ <prop oor:name="ImplementationURL" oor:type="xs:string">
+ <value>private:resource/toolpanel/ChartPanelFactory/AreaPanel</value>
+ </prop>
+ <prop oor:name="OrderIndex" oor:type="xs:int">
+ <value>2</value>
+ </prop>
+ </node>
+
+ <node oor:name="ChartLinePanel" oor:op="replace">
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml:lang="en-US">Line</value>
+ </prop>
+ <prop oor:name="Id" oor:type="xs:string">
+ <value>ChartLinePanel</value>
+ </prop>
+ <prop oor:name="DeckId" oor:type="xs:string">
+ <value>ChartDeck</value>
+ </prop>
+ <prop oor:name="ContextList">
+ <value oor:separator=";">
+ Chart, any, visible ;
+ </value>
+ </prop>
+ <prop oor:name="ImplementationURL" oor:type="xs:string">
+ <value>private:resource/toolpanel/ChartPanelFactory/LinePanel</value>
+ </prop>
+ <prop oor:name="OrderIndex" oor:type="xs:int">
+ <value>3</value>
+ </prop>
+ </node>
+
+ <node oor:name="ChartCharacterPanel" oor:op="replace">
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml:lang="en-US">Character</value>
+ </prop>
+ <prop oor:name="Id" oor:type="xs:string">
+ <value>ChartCharacterPanel</value>
+ </prop>
+ <prop oor:name="DeckId" oor:type="xs:string">
+ <value>ChartDeck</value>
+ </prop>
+ <prop oor:name="ContextList">
+ <value oor:separator=";">
+ Chart, any, visible ;
+ </value>
+ </prop>
+ <prop oor:name="ImplementationURL" oor:type="xs:string">
+ <value>private:resource/toolpanel/ChartPanelFactory/CharacterPanel</value>
+ </prop>
+ <prop oor:name="OrderIndex" oor:type="xs:int">
+ <value>4</value>
+ </prop>
+ </node>
+
+ <node oor:name="ChartAxisPanel" oor:op="replace">
+ <prop oor:name="Title" oor:type="xs:string">
+ <value xml:lang="en-US">Axis</value>
+ </prop>
+ <prop oor:name="Id" oor:type="xs:string">
+ <value>ChartAxisPanel</value>
+ </prop>
+ <prop oor:name="DeckId" oor:type="xs:string">
+ <value>ChartDeck</value>
+ </prop>
+ <prop oor:name="ContextList">
+ <value oor:separator=";">
+ Chart, any, visible ;
+ </value>
+ </prop>
+ <prop oor:name="ImplementationURL" oor:type="xs:string">
+ <value>private:resource/toolpanel/ChartPanelFactory/AxisPanel</value>
+ </prop>
+ <prop oor:name="OrderIndex" oor:type="xs:int">
+ <value>5</value>
+ </prop>
+ </node>
+
</node>
</node>
</oor:component-data>
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs b/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs
index d5b90e0..1e6234a 100644
--- a/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs
@@ -86,12 +86,14 @@
com.sun.star.sheet.SpreadsheetDocument
com.sun.star.presentation.PresentationDocument
com.sun.star.drawing.DrawingDocument
+ com.sun.star.chart2.ChartDocument
Recognized shortcuts:
Writer
Calc
Impress
Draw
+ Chart
Shortcuts for multiple applications:
DrawImpress
diff --git a/sfx2/source/sidebar/Context.cxx b/sfx2/source/sidebar/Context.cxx
index 3a7ce01..9baf30b 100644
--- a/sfx2/source/sidebar/Context.cxx
+++ b/sfx2/source/sidebar/Context.cxx
@@ -46,7 +46,14 @@ Context::Context (
sal_Int32 Context::EvaluateMatch (
const Context& rOther) const
{
- const bool bApplicationNameIsAny (rOther.msApplication == AnyApplicationName);
+ bool bApplicationNameIsAny (rOther.msApplication == AnyApplicationName);
+
+ // special case for charts which use a whole own set of decks
+ if (msApplication == "com.sun.star.chart2.ChartDocument")
+ {
+ bApplicationNameIsAny = false;
+ }
+
if (rOther.msApplication.equals(msApplication) || bApplicationNameIsAny)
{
// Application name matches.
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index 93a1b89..bce5bbc 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -416,6 +416,8 @@ void ResourceManager::ReadContextList (
aApplications.push_back(EnumContext::Application_Draw);
else if (sApplicationName == "Impress")
aApplications.push_back(EnumContext::Application_Impress);
+ else if (sApplicationName == "Chart")
+ aApplications.push_back(EnumContext::Application_Chart);
else if (sApplicationName == "DrawImpress")
{
// A special case among the special names: it is
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 027c886..c67447f 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -548,7 +548,6 @@ void SidebarController::CreateDeck(const ::rtl::OUString& rDeckId)
::boost::bind(&SidebarController::RequestCloseDeck, this));
mpResourceManager->SetDeckToDescriptor(rDeckId, aDeck);
-
}
}
commit 5a72bbd483ddf6c7cc949a8708d1697654cc9ce2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Thu Jul 9 20:37:31 2015 +0200
allow also to use non-frame modules for sidebar
One more step away from using the frame as key and moving to the
controller.
Change-Id: I438b7eea2161d49a6f2cbf649bf01b8a2e233ebd
diff --git a/framework/source/uifactory/uielementfactorymanager.cxx b/framework/source/uifactory/uielementfactorymanager.cxx
index d2b6645..39483ee 100644
--- a/framework/source/uifactory/uielementfactorymanager.cxx
+++ b/framework/source/uifactory/uielementfactorymanager.cxx
@@ -427,6 +427,7 @@ Reference< XUIElement > SAL_CALL UIElementFactoryManager::createUIElement(
throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception )
{
Reference< XFrame > xFrame;
+ OUString aModuleId;
{ // SAFE
osl::MutexGuard g(rBHelper.rMutex);
@@ -443,6 +444,8 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l
{
if ( Args[i].Name == "Frame")
Args[i].Value >>= xFrame;
+ if (Args[i].Name == "Module")
+ Args[i].Value >>= aModuleId;
}
} // SAFE
@@ -451,8 +454,7 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l
// Determine the module identifier
try
{
- OUString aModuleId;
- if ( xFrame.is() && xManager.is() )
+ if ( aModuleId.isEmpty() && xFrame.is() && xManager.is() )
aModuleId = xManager->identify( Reference<XInterface>( xFrame, UNO_QUERY ) );
Reference< XUIElementFactory > xUIElementFactory = getFactory( ResourceURL, aModuleId );
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index a2b0060..027c886 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -807,6 +807,16 @@ Reference<ui::XUIElement> SidebarController::CreateUIElement (
Reference<rendering::XSpriteCanvas> xCanvas (VCLUnoHelper::GetWindow(rxWindow)->GetSpriteCanvas());
aCreationArguments.put("Canvas", makeAny(xCanvas));
}
+
+ if (mxCurrentController.is())
+ {
+ OUString aModule = Tools::GetModuleName(mxCurrentController);
+ if (!aModule.isEmpty())
+ {
+ aCreationArguments.put("Module", makeAny(aModule));
+ }
+ }
+
aCreationArguments.put("ApplicationName", makeAny(rContext.msApplication));
aCreationArguments.put("ContextName", makeAny(rContext.msContext));
commit d976efde8c6398ceb234a3b50541ceba21959aa7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Thu Jul 9 16:21:39 2015 +0200
use correct controller for sidebar
As we now allow non-frame controllers we need to use them as well in
this place.
Change-Id: I0d86cdf73f8c044816def0aaafb874e75985aae5
diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx
index bdc1dc4..063a156 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -173,6 +173,7 @@ private:
css::uno::Reference<css::frame::XFrame> mxFrame;
Context maCurrentContext;
Context maRequestedContext;
+ css::uno::Reference<css::frame::XController> mxCurrentController;
/// Use a combination of SwitchFlag_* as value.
sal_Int32 mnRequestedForceFlags;
::rtl::OUString msCurrentDeckId;
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index d73a0d9..a2b0060 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -266,6 +266,7 @@ void SAL_CALL SidebarController::notifyContextChangeEvent (const css::ui::Contex
rEvent.ContextName);
if (maRequestedContext != maCurrentContext)
{
+ mxCurrentController = css::uno::Reference<css::frame::XController>(rEvent.Source, css::uno::UNO_QUERY);
maAsynchronousDeckSwitch.CancelRequest();
maContextChangeUpdate.RequestCall();
// TODO: this call is redundant but mandatory for unit test to update context on document loading
@@ -436,11 +437,13 @@ void SidebarController::UpdateConfigurations()
// Find the set of decks that could be displayed for the new context.
ResourceManager::DeckContextDescriptorContainer aDecks;
+ css::uno::Reference<css::frame::XController> xController = mxCurrentController.is() ? mxCurrentController : mxFrame->getController();
+
mpResourceManager->GetMatchingDecks (
aDecks,
maCurrentContext,
mbIsDocumentReadOnly,
- mxFrame->getController());
+ xController);
// Notify the tab bar about the updated set of decks.
mpTabBar->SetDecks(aDecks);
@@ -575,11 +578,13 @@ void SidebarController::SwitchToDeck (
// Determine the panels to display in the deck.
ResourceManager::PanelContextDescriptorContainer aPanelContextDescriptors;
+ css::uno::Reference<css::frame::XController> xController = mxCurrentController.is() ? mxCurrentController : mxFrame->getController();
+
mpResourceManager->GetMatchingPanels(
aPanelContextDescriptors,
rContext,
rDeckDescriptor.msId,
- mxFrame->getController());
+ xController);
if (aPanelContextDescriptors.empty())
{
commit 24c174d7d190580a338b2352ea79e216be50f787
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 8 22:15:38 2015 +0200
no need for handling unused arguments like that
Change-Id: I04fa1b854e41a4cbeea0586bc583c58298d96306
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index b5865c4..d73a0d9 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -273,19 +273,15 @@ void SAL_CALL SidebarController::notifyContextChangeEvent (const css::ui::Contex
}
}
-void SAL_CALL SidebarController::disposing (const css::lang::EventObject& rEventObject)
+void SAL_CALL SidebarController::disposing (const css::lang::EventObject& )
throw(css::uno::RuntimeException, std::exception)
{
- (void)rEventObject;
-
dispose();
}
-void SAL_CALL SidebarController::propertyChange (const css::beans::PropertyChangeEvent& rEvent)
+void SAL_CALL SidebarController::propertyChange (const css::beans::PropertyChangeEvent& )
throw(css::uno::RuntimeException, std::exception)
{
- (void)rEvent;
-
maPropertyChangeForwarder.RequestCall();
}
commit bde2fde07a00c89a27c13cd7f5e6fe666ea73030
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 8 21:10:23 2015 +0200
fix indentation
Change-Id: I90426772f59db1bdc695bb9a411eaaee19655ce7
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 61492ce..b5865c4 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -205,21 +205,21 @@ void SAL_CALL SidebarController::disposing()
// clear decks
ResourceManager::DeckContextDescriptorContainer aDecks;
- mpResourceManager->GetMatchingDecks (
+ mpResourceManager->GetMatchingDecks (
aDecks,
GetCurrentContext(),
IsDocumentReadOnly(),
mxFrame->getController());
- for (ResourceManager::DeckContextDescriptorContainer::const_iterator
+ for (ResourceManager::DeckContextDescriptorContainer::const_iterator
iDeck(aDecks.begin()), iEnd(aDecks.end());
iDeck!=iEnd; ++iDeck)
- {
- const DeckDescriptor* deckDesc = mpResourceManager->GetDeckDescriptor(iDeck->msId);
- VclPtr<Deck> aDeck = deckDesc->mpDeck;
- if (aDeck)
- aDeck.disposeAndClear();
- }
+ {
+ const DeckDescriptor* deckDesc = mpResourceManager->GetDeckDescriptor(iDeck->msId);
+ VclPtr<Deck> aDeck = deckDesc->mpDeck;
+ if (aDeck)
+ aDeck.disposeAndClear();
+ }
SidebarControllerContainer::iterator iEntry (maSidebarControllerContainer.find(mxFrame->getController()));
if (iEntry != maSidebarControllerContainer.end())
commit efd13b27a4d5108645307b54d150c7d3fec87dcc
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 8 20:45:37 2015 +0200
finally manage to register chart2 in the ChartController
We need to do some jumps through pink hoops to connect the chart
controller with the host sidebar.
Would we use the chart window as parent for our sidebar the sidebar
would be directlz beside the chart and not at the border of the host
window.
Change-Id: Ica44ae370518882ef367999f57251b1256907016
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 4156c9d..3175eea 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -51,6 +51,7 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/frame/XLoadable.hpp>
+#include <com/sun/star/frame/XController2.hpp>
#include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/embed/XEmbeddedClient.hpp>
#include <com/sun/star/util/XModeChangeBroadcaster.hpp>
@@ -58,6 +59,7 @@
#include <com/sun/star/frame/LayoutManagerEvents.hpp>
#include <com/sun/star/document/XUndoManagerSupplier.hpp>
#include <com/sun/star/document/XUndoAction.hpp>
+#include <com/sun/star/ui/XSidebar.hpp>
#include <svx/sidebar/SelectionChangeHandler.hxx>
#include <vcl/msgbox.hxx>
@@ -66,6 +68,8 @@
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
+#include <sfx2/sidebar/SidebarController.hxx>
+
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
@@ -346,6 +350,21 @@ uno::Sequence< OUString > ChartController::getSupportedServiceNames_Static()
return aSNS;
}
+namespace {
+
+uno::Reference<ui::XSidebar> getSidebarFromModel(uno::Reference<frame::XModel> xModel)
+{
+ uno::Reference<container::XChild> xChild(xModel, uno::UNO_QUERY);
+ uno::Reference<frame::XModel> xParent (xChild->getParent(), uno::UNO_QUERY_THROW);
+ uno::Reference<frame::XController2> xController(xParent->getCurrentController(), uno::UNO_QUERY);
+ uno::Reference<ui::XSidebarProvider> xSidebarProvider (xController->getSidebar(), uno::UNO_QUERY);
+ uno::Reference<ui::XSidebar> xSidebar(xSidebarProvider->getSidebar(), uno::UNO_QUERY);
+
+ return xSidebar;
+}
+
+}
+
// XController
void SAL_CALL ChartController::attachFrame(
@@ -359,6 +378,10 @@ void SAL_CALL ChartController::attachFrame(
mpSelectionChangeHandler->Connect();
+ uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getModel());
+ sfx2::sidebar::SidebarController* pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get());
+ sfx2::sidebar::SidebarController::registerSidebarForFrame(pSidebar, this);
+
if(m_xFrame.is()) //what happens, if we do have a Frame already??
{
//@todo? throw exception?
@@ -725,6 +748,14 @@ void SAL_CALL ChartController::dispose()
throw(uno::RuntimeException, std::exception)
{
mpSelectionChangeHandler->Disconnect();
+
+ if (getModel().is())
+ {
+ uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getModel());
+ sfx2::sidebar::SidebarController* pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get());
+ sfx2::sidebar::SidebarController::unregisterSidebarForFrame(pSidebar, this);
+ }
+
try
{
//This object should release all resources and references in the
diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx
index 6d88767..bdc1dc4 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -69,7 +69,7 @@ class SidebarDockingWindow;
class TabBar;
class TabBarConfiguration;
-class SidebarController
+class SFX2_DLLPUBLIC SidebarController
: private ::boost::noncopyable,
private ::cppu::BaseMutex,
public SidebarControllerInterfaceBase
commit 7cad6b12c801a21b2401958c60625a50320fb5c7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 8 20:35:21 2015 +0200
[API CHANGE] add way to get XSidebar from XSidebarProvider
Change-Id: I9fcf1cffa70eac6fec228ca4a9d4d32783295f21
diff --git a/include/sfx2/sidebar/UnoSidebar.hxx b/include/sfx2/sidebar/UnoSidebar.hxx
index 6c154c0..9cbb4e1 100644
--- a/include/sfx2/sidebar/UnoSidebar.hxx
+++ b/include/sfx2/sidebar/UnoSidebar.hxx
@@ -14,6 +14,7 @@
#include <sfx2/dllapi.h>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/ui/XSidebarProvider.hpp>
+#include <com/sun/star/ui/XSidebar.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
@@ -56,6 +57,9 @@ public:
virtual css::uno::Reference<css::ui::XDecks> SAL_CALL getDecks()
throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual css::uno::Reference<css::ui::XSidebar> SAL_CALL getSidebar()
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
};
#endif
diff --git a/offapi/com/sun/star/ui/XSidebarProvider.idl b/offapi/com/sun/star/ui/XSidebarProvider.idl
index 370925e..5786550 100644
--- a/offapi/com/sun/star/ui/XSidebarProvider.idl
+++ b/offapi/com/sun/star/ui/XSidebarProvider.idl
@@ -14,6 +14,7 @@
#include <com/sun/star/frame/XFrame.idl>
#include <com/sun/star/awt/XWindow2.idl>
+#include <com/sun/star/ui/XSidebar.idl>
#include <com/sun/star/ui/XDecks.idl>
@@ -52,6 +53,11 @@ interface XSidebarProvider: com::sun::star::uno::XInterface
</ul>
*/
void showDecks([in] boolean bVisible);
+
+ /**
+ * Returns the sidebar object
+ */
+ com::sun::star::ui::XSidebar getSidebar();
} ;
} ; } ; } ; } ;
diff --git a/sfx2/source/sidebar/UnoSidebar.cxx b/sfx2/source/sidebar/UnoSidebar.cxx
index 28de260..cfaebbf 100644
--- a/sfx2/source/sidebar/UnoSidebar.cxx
+++ b/sfx2/source/sidebar/UnoSidebar.cxx
@@ -98,5 +98,11 @@ uno::Reference<ui::XDecks> SAL_CALL SfxUnoSidebar::getDecks()
return decks;
}
+uno::Reference<ui::XSidebar> SAL_CALL SfxUnoSidebar::getSidebar()
+ throw (uno::RuntimeException, std::exception)
+{
+ return getSidebarController();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 498e03c2a32ec0250fa2e7cb07f7fc3425212e58
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 8 00:46:59 2015 +0200
fix crash
Change-Id: Ic1bc31b68c4a2aafb1e40ebff84fbf052df7041f
diff --git a/chart2/source/controller/main/ChartController.hxx b/chart2/source/controller/main/ChartController.hxx
index d3882aa..00d297b 100644
--- a/chart2/source/controller/main/ChartController.hxx
+++ b/chart2/source/controller/main/ChartController.hxx
@@ -544,7 +544,7 @@ private:
ChartDrawMode m_eDrawMode;
- boost::scoped_ptr<svx::sidebar::SelectionChangeHandler> mpSelectionChangeHandler;
+ rtl::Reference<svx::sidebar::SelectionChangeHandler> mpSelectionChangeHandler;
private:
//private methods
commit be6c884feb389ec6931e1853aa421d5bccd69f12
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Jul 8 00:46:26 2015 +0200
add methods to add random controllers to sidebar
Change-Id: Ia3e80cc63491f1edd49eaf86cc8c25d67e4a8b28
diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx
index 78a0478..6d88767 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -89,6 +89,10 @@ public:
static SidebarController* GetSidebarControllerForFrame (
const css::uno::Reference<css::frame::XFrame>& rxFrame);
+ static void registerSidebarForFrame(SidebarController* pController, css::uno::Reference<css::frame::XController> xFrame);
+
+ static void unregisterSidebarForFrame(SidebarController* pController, css::uno::Reference<css::frame::XController> xFrame);
+
// ui::XContextChangeEventListener
virtual void SAL_CALL notifyContextChangeEvent (const css::ui::ContextChangeEventObject& rEvent)
throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index d98a5b5..61492ce 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -124,15 +124,7 @@ SidebarController::SidebarController (
// Decks and panel collections for this sidebar
mpResourceManager = std::unique_ptr<ResourceManager>(new ResourceManager());
- // Listen for context change events.
- css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer (
- css::ui::ContextChangeEventMultiplexer::get(
- ::comphelper::getProcessComponentContext()));
- if (xMultiplexer.is())
- xMultiplexer->addContextChangeEventListener(
- static_cast<css::ui::XContextChangeEventListener*>(this),
- mxFrame->getController());
-
+ registerSidebarForFrame(this, mxFrame->getController());
// Listen for window events.
mpParentWindow->AddEventListener(LINK(this, SidebarController, WindowEventHandler));
@@ -149,12 +141,6 @@ SidebarController::SidebarController (
mxReadOnlyModeDispatch->addStatusListener(this, aURL);
SwitchToDeck(gsDefaultDeckId);
-
- WeakReference<SidebarController> xWeakController (this);
- maSidebarControllerContainer.insert(
- SidebarControllerContainer::value_type(
- rxFrame->getController(),
- xWeakController));
}
SidebarController::~SidebarController()
@@ -175,6 +161,39 @@ SidebarController* SidebarController::GetSidebarControllerForFrame (
return dynamic_cast<SidebarController*>(xController.get());
}
+void SidebarController::registerSidebarForFrame(SidebarController* pController, css::uno::Reference<css::frame::XController> xController)
+{
+ // Listen for context change events.
+ css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer (
+ css::ui::ContextChangeEventMultiplexer::get(
+ ::comphelper::getProcessComponentContext()));
+ if (xMultiplexer.is())
+ xMultiplexer->addContextChangeEventListener(
+ static_cast<css::ui::XContextChangeEventListener*>(pController),
+ xController);
+
+ WeakReference<SidebarController> xWeakController (pController);
+ maSidebarControllerContainer.insert(
+ SidebarControllerContainer::value_type(
+ xController,
+ xWeakController));
+}
+
+void SidebarController::unregisterSidebarForFrame(SidebarController* pController, css::uno::Reference<css::frame::XController> xController)
+{
+ SidebarControllerContainer::iterator iEntry (maSidebarControllerContainer.find(xController));
+ if (iEntry != maSidebarControllerContainer.end())
+ maSidebarControllerContainer.erase(iEntry);
+
+ css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer (
+ css::ui::ContextChangeEventMultiplexer::get(
+ ::comphelper::getProcessComponentContext()));
+ if (xMultiplexer.is())
+ xMultiplexer->removeContextChangeEventListener(
+ static_cast<css::ui::XContextChangeEventListener*>(pController),
+ xController);
+}
+
void SAL_CALL SidebarController::disposing()
{
mpCloseIndicator.disposeAndClear();
commit 4e6a1615d1a4c81c490cfb479d5e30f4e98adc47
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Jul 7 18:46:43 2015 +0200
use XController instead of XFrame where it makes sense
Change-Id: I22990c861c0dd9d9dab3fbdbc35fdb2b51e82005
diff --git a/include/sfx2/sidebar/ResourceManager.hxx b/include/sfx2/sidebar/ResourceManager.hxx
index 5768db0..568b7f8 100644
--- a/include/sfx2/sidebar/ResourceManager.hxx
+++ b/include/sfx2/sidebar/ResourceManager.hxx
@@ -23,7 +23,7 @@
#include "PanelDescriptor.hxx"
#include <sfx2/sidebar/Context.hxx>
#include <unotools/confignode.hxx>
-#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XController.hpp>
#include <set>
#include <boost/shared_ptr.hpp>
#include <svtools/miscopt.hxx>
@@ -89,13 +89,13 @@ public:
DeckContextDescriptorContainer& rDeckDescriptors,
const Context& rContext,
const bool bIsDocumentReadOnly,
- const css::uno::Reference<css::frame::XFrame>& rxFrame);
+ const css::uno::Reference<css::frame::XController>& rxController);
const PanelContextDescriptorContainer& GetMatchingPanels(
PanelContextDescriptorContainer& rPanelDescriptors,
const Context& rContext,
const OUString& rsDeckId,
- const css::uno::Reference<css::frame::XFrame>& rxFrame);
+ const css::uno::Reference<css::frame::XController>& rxController);
/** Remember the expansions state per panel and context.
This is not persistent past application end.
@@ -121,13 +121,13 @@ private:
static void ReadContextList(const utl::OConfigurationNode& rNode,
ContextList& rContextList,
const OUString& rsDefaultMenuCommand);
- void ReadLegacyAddons(const css::uno::Reference<css::frame::XFrame>& rxFrame);
+ void ReadLegacyAddons(const css::uno::Reference<css::frame::XController>& rxController);
static utl::OConfigurationTreeRoot GetLegacyAddonRootNode(const OUString& rsModuleName);
static void GetToolPanelNodeNames(std::vector<OUString>& rMatchingNames,
const utl::OConfigurationTreeRoot& aRoot);
static bool IsDeckEnabled(const OUString& rsDeckId,
const Context& rContext,
- const css::uno::Reference<css::frame::XFrame>& rxFrame);
+ const css::uno::Reference<css::frame::XController>& rxController);
};
} } // end of namespace sfx2::sidebar
diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx
index 29c7d43..78a0478 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -158,7 +158,7 @@ public:
private:
typedef ::std::map<
- const css::uno::Reference<css::frame::XFrame>,
+ const css::uno::Reference<css::frame::XController>,
css::uno::WeakReference<SidebarController>
> SidebarControllerContainer;
static SidebarControllerContainer maSidebarControllerContainer;
diff --git a/include/sfx2/sidebar/Tools.hxx b/include/sfx2/sidebar/Tools.hxx
index 3aff9ea..c6b7909 100644
--- a/include/sfx2/sidebar/Tools.hxx
+++ b/include/sfx2/sidebar/Tools.hxx
@@ -54,7 +54,7 @@ public:
const css::util::URL& rURL);
static ::rtl::OUString GetModuleName (
- const css::uno::Reference<css::frame::XFrame>& rxFrame);
+ const css::uno::Reference<css::frame::XController>& rxFrame);
};
diff --git a/sfx2/source/sidebar/ControllerFactory.cxx b/sfx2/source/sidebar/ControllerFactory.cxx
index c635751..ff457c2 100644
--- a/sfx2/source/sidebar/ControllerFactory.cxx
+++ b/sfx2/source/sidebar/ControllerFactory.cxx
@@ -143,7 +143,7 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBarController(
{
Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
Reference<frame::XUIControllerFactory> xFactory = frame::theToolbarControllerFactory::get( xContext );
- OUString sModuleName (Tools::GetModuleName(rxFrame));
+ OUString sModuleName (Tools::GetModuleName(rxFrame->getController()));
if (xFactory.is() && xFactory->hasController(rsCommandName, sModuleName))
{
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index 21a6f8b..93a1b89 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -179,9 +179,9 @@ const ResourceManager::DeckContextDescriptorContainer& ResourceManager::GetMatch
DeckContextDescriptorContainer& rDecks,
const Context& rContext,
const bool bIsDocumentReadOnly,
- const Reference<frame::XFrame>& rxFrame)
+ const Reference<frame::XController>& rxController)
{
- ReadLegacyAddons(rxFrame);
+ ReadLegacyAddons(rxController);
std::multimap<sal_Int32,DeckContextDescriptor> aOrderedIds;
DeckContainer::const_iterator iDeck;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list