[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - chart2/source sw/source
chart2/source/tools/ResourceManager.cxx |7 --- sw/source/uibase/app/swmodule.cxx |8 2 files changed, 8 insertions(+), 7 deletions(-) New commits: commit eac3d5cb7ec2369bd5409e79ce4b96552651dbaf Author: Michael MeeksDate: Tue May 22 15:52:50 2018 +0100 Use vcl::DeleteOnDeinit for resource managers. Change-Id: I305c2dfd407f2606331a5950a3b36ee58e1d74d6 Reviewed-on: https://gerrit.libreoffice.org/54676 Reviewed-by: Aron Budea Tested-by: Aron Budea diff --git a/chart2/source/tools/ResourceManager.cxx b/chart2/source/tools/ResourceManager.cxx index ee842e701d48..77ed2232df95 100644 --- a/chart2/source/tools/ResourceManager.cxx +++ b/chart2/source/tools/ResourceManager.cxx @@ -20,6 +20,7 @@ #include "ResourceManager.hxx" #include +#include #include namespace chart @@ -28,11 +29,11 @@ namespace chart ResMgr & ResourceManager::getResourceManager() { // not threadsafe -static std::unique_ptr pResourceManager; +static vcl::DeleteOnDeinit pResourceManager(nullptr); const LanguageTag& rLocale = Application::GetSettings().GetUILanguageTag(); -if( ! pResourceManager || pResourceManager->GetLocale() != rLocale ) +if( ! pResourceManager.get() || pResourceManager.get()->GetLocale() != rLocale ) pResourceManager.reset( ResMgr::CreateResMgr("chartcontroller", rLocale) ); -OSL_ASSERT( pResourceManager ); +OSL_ASSERT( pResourceManager.get() ); return *pResourceManager.get(); } diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index 2edfc5bd25ed..ff703050bf85 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -128,7 +128,7 @@ bool g_bNoInterrupt = false; #include - +#include #include #include @@ -140,11 +140,11 @@ using namespace com::sun::star; ResMgr & GetSwResMgr() { // not threadsafe -static std::unique_ptr pResourceManager; +static vcl::DeleteOnDeinit pResourceManager(nullptr); const LanguageTag& rLocale = Application::GetSettings().GetUILanguageTag(); -if( ! pResourceManager || pResourceManager->GetLocale() != rLocale ) +if( ! pResourceManager.get() || pResourceManager.get()->GetLocale() != rLocale ) pResourceManager.reset( ResMgr::CreateResMgr("sw", rLocale) ); -OSL_ASSERT( pResourceManager ); +OSL_ASSERT( pResourceManager.get() ); return *pResourceManager.get(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - chart2/source
chart2/source/tools/ResourceManager.cxx | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) New commits: commit 23109bc47daf037b76b3188c3ac3030873cb8529 Author: Michael MeeksDate: Thu Apr 26 21:25:43 2018 +0100 Localize chart strings properly. Change-Id: I982c95a50c1b4cd9f03f45b0203e06aca3711969 Reviewed-on: https://gerrit.libreoffice.org/53544 Reviewed-by: Aron Budea Tested-by: Aron Budea diff --git a/chart2/source/tools/ResourceManager.cxx b/chart2/source/tools/ResourceManager.cxx index 3f3fb615697a..ee842e701d48 100644 --- a/chart2/source/tools/ResourceManager.cxx +++ b/chart2/source/tools/ResourceManager.cxx @@ -19,6 +19,7 @@ #include "ResourceManager.hxx" +#include #include namespace chart @@ -27,11 +28,12 @@ namespace chart ResMgr & ResourceManager::getResourceManager() { // not threadsafe -static ResMgr * pResourceManager = nullptr; -if( ! pResourceManager ) -pResourceManager = ResMgr::CreateResMgr("chartcontroller"); +static std::unique_ptr pResourceManager; +const LanguageTag& rLocale = Application::GetSettings().GetUILanguageTag(); +if( ! pResourceManager || pResourceManager->GetLocale() != rLocale ) +pResourceManager.reset( ResMgr::CreateResMgr("chartcontroller", rLocale) ); OSL_ASSERT( pResourceManager ); -return *pResourceManager; +return *pResourceManager.get(); } } // namespace chart ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - chart2/source vcl/source
chart2/source/controller/main/ChartController_Window.cxx | 14 ++ vcl/source/window/floatwin.cxx | 11 +++ 2 files changed, 21 insertions(+), 4 deletions(-) New commits: commit fc409bae21ff400736278294ab6a82a5f3cedfa7 Author: Marco CecchettiDate: Wed Apr 18 18:31:00 2018 +0200 lok: charts context menu was misplaced + wrong LogicToLogic conversion Chart context menu was misplaced since the context menu expects a position related to the document window not to the chart window. Moreover map mode is not enabled for chart window, that leads to use the LogicToLogic routine which unfortunately provides a wrong pixel to twips conversion. In fact we gets a 20 twips per pixel conversion since LogicToLogic uses a fixed 72 dpi value, instead of a correctly computed output device real dpi or at least the most commonly used 96 dpi value. Change-Id: Idb4220d03fddd4b6d643c1c0fb52754bafed7e36 Reviewed-on: https://gerrit.libreoffice.org/53118 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index 58f7206554ec..6bf0446cc24c 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -63,6 +63,7 @@ #include #include +#include #include #include #include @@ -1238,6 +1239,19 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) { PopupMenu* pPopupMenu = static_cast (VCLXMenu::GetImplementation(xPopupMenu)->GetMenu()); pPopupMenu->SetLOKNotifier(SfxViewShell::Current()); + +// the context menu expects a position related to the document window, +// not to the chart window +SfxInPlaceClient* pIPClient = SfxViewShell::Current()->GetIPClient(); +if (pIPClient) +{ +vcl::Window* pRootWin = pIPClient->GetEditWin(); +if (pRootWin) +{ +Point aOffset = m_pChartWindow->GetOffsetPixelFrom(*pRootWin); +aPos += aOffset; +} +} } xPopupController->setPopupMenu( xPopupMenu ); diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 2a9b7aab26cf..302703bf4e8a 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -445,10 +445,13 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow, if (bLOKActive && pLOKTwipsPos) { -if (pW->IsMapModeEnabled()) -*pLOKTwipsPos = pW->PixelToLogic(aPos, MapMode(MapUnit::MapTwip)); -else -*pLOKTwipsPos = pW->LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)); +// if we use pW->LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)), +// when map mode is not enabled, we gets a 20 twips per pixel conversion +// since LogicToLogic uses a fixed 72 dpi value, instead of a correctly +// computed output device dpi or at least the most commonly used 96 dpi +// value; and anyway the following is what we already do in +// ScGridWindow::LogicInvalidate when map mode is not enabled. +*pLOKTwipsPos = pW->PixelToLogic(aPos, MapMode(MapUnit::MapTwip)); } // caller expects coordinates relative to top-level win ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - chart2/source
chart2/source/controller/main/ChartController_Window.cxx | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) New commits: commit 60edca8d8a9f00d3220255324d30ae41464a4e82 Author: Pranav KantDate: Thu Mar 15 16:48:18 2018 +0530 chart2 lok: tunnel context menu of the chart edit view Change-Id: I0c8b3cfe1666ad81f808871a87e4b0fa64ef593c Reviewed-on: https://gerrit.libreoffice.org/51355 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index 2989e32d4faa..58f7206554ec 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -55,14 +55,16 @@ #include #include #include + +#include #include #include #include +#include #include #include - #include #include #include @@ -1232,6 +1234,12 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) if ( !xPopupController.is() || !xPopupMenu.is() ) return; +if (comphelper::LibreOfficeKit::isActive()) +{ +PopupMenu* pPopupMenu = static_cast (VCLXMenu::GetImplementation(xPopupMenu)->GetMenu()); +pPopupMenu->SetLOKNotifier(SfxViewShell::Current()); +} + xPopupController->setPopupMenu( xPopupMenu ); xPopupMenu->execute( css::uno::Reference< css::awt::XWindowPeer >( m_xFrame->getContainerWindow(), css::uno::UNO_QUERY ), css::awt::Rectangle( aPos.X(), aPos.Y(), 0, 0 ), ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - chart2/source
chart2/source/controller/main/ChartController_EditData.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 8d7a250c04615f27c14543a9f050cb21648f498d Author: Pranav KantDate: Thu Mar 15 16:48:54 2018 +0530 chart2 lok: give parent to data table dialog to tunnel it Change-Id: Ie82a9a6d9b499e5da34e04f0c2f5fc7c164b098e (cherry picked from commit cbbff5a2c08a55bfec27b2476fd848e972bfd572) Reviewed-on: https://gerrit.libreoffice.org/51356 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/chart2/source/controller/main/ChartController_EditData.cxx b/chart2/source/controller/main/ChartController_EditData.cxx index 646a27a35cb1..9d64dd06fcbc 100644 --- a/chart2/source/controller/main/ChartController_EditData.cxx +++ b/chart2/source/controller/main/ChartController_EditData.cxx @@ -18,6 +18,7 @@ */ #include "ChartController.hxx" +#include "ChartWindow.hxx" #include "macros.hxx" #include "dlg_DataEditor.hxx" @@ -52,7 +53,7 @@ void ChartController::executeDispatch_EditData() UndoLiveUpdateGuardWithData aUndoGuard( SCH_RESSTR( STR_ACTION_EDIT_CHART_DATA ), m_xUndoManager ); -ScopedVclPtrInstance aDataEditorDialog( nullptr, xChartDoc, m_xCC ); +ScopedVclPtrInstance aDataEditorDialog( m_pChartWindow.get(), xChartDoc, m_xCC ); if (aDataEditorDialog->Execute() == RET_OK) aDataEditorDialog->ApplyChangesToModel(); aUndoGuard.commit(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - chart2/source
chart2/source/controller/main/ChartWindow.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit bbe5291ace311b9f0f311dbda7c19b82708ee227 Author: Jan-Marek GlogowskiDate: Thu Aug 3 15:31:02 2017 +0200 Fix JunitTest chart2 unoapi Change-Id: I41b8df11778570888cd6943d25d72ca33661c305 Reviewed-on: https://gerrit.libreoffice.org/40723 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski (cherry picked from commit 3d8846a51acc509118a0af6ac16539c19109ff8d) Reviewed-on: https://gerrit.libreoffice.org/41171 Reviewed-by: Aron Budea Tested-by: Aron Budea diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx index d50a741cd001..58d6c291cb74 100644 --- a/chart2/source/controller/main/ChartWindow.cxx +++ b/chart2/source/controller/main/ChartWindow.cxx @@ -322,6 +322,9 @@ void ChartWindow::Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags void ChartWindow::LogicInvalidate(const Rectangle* pRectangle) { +SfxViewShell* pCurrentShell = SfxViewShell::Current(); +if ( nullptr == pCurrentShell ) +return; OString sRectangle; if (!pRectangle) { @@ -366,7 +369,6 @@ void ChartWindow::LogicInvalidate(const Rectangle* pRectangle) sRectangle = aRectangle.toString(); } -SfxViewShell* pCurrentShell = SfxViewShell::Current(); SfxLokHelper::notifyInvalidation(pCurrentShell, sRectangle); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - chart2/source
chart2/source/view/charttypes/PieChart.cxx | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) New commits: commit 01a892dcba8b4869f8a6c8e5aaf4b5ed09e81bd7 Author: Marco CecchettiDate: Tue Aug 8 13:04:02 2017 +0200 bug fix: tdf#73 Mostly based on a patch by Julien Nabet: http://bugs.documentfoundation.org/attachment.cgi?id=135107 Thanks Julien! Change-Id: I02440be7dfa5881e5bf63710a9d3c4f261d00533 Reviewed-on: https://gerrit.libreoffice.org/40878 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx index d91e5a10d3fd..f3b854ee8707 100644 --- a/chart2/source/view/charttypes/PieChart.cxx +++ b/chart2/source/view/charttypes/PieChart.cxx @@ -362,8 +362,13 @@ void PieChart::createTextLabelShape( ///a new `PieLabelInfo` instance is initialized with all the info related to ///the current label in order to simplify later label position rearrangement; uno::Reference< container::XChild > xChild( aPieLabelInfo.xTextShape, uno::UNO_QUERY ); -if( xChild.is() ) -aPieLabelInfo.xLabelGroupShape.set( xChild->getParent(), uno::UNO_QUERY ); + +///text shape could be empty; in that case there is no need to add label info +if( !xChild.is() ) +return; + +aPieLabelInfo.xLabelGroupShape.set( xChild->getParent(), uno::UNO_QUERY ); + aPieLabelInfo.fValue = nVal; aPieLabelInfo.bMovementAllowed = bMovementAllowed; aPieLabelInfo.bMoved= false; @@ -374,9 +379,7 @@ void PieChart::createTextLabelShape( performLabelBestFit(rParam, aPieLabelInfo); } - m_aLabelInfoList.push_back(aPieLabelInfo); - } void PieChart::addSeries( VDataSeries* pSeries, sal_Int32 /* zSlot */, sal_Int32 /* xSlot */, sal_Int32 /* ySlot */ ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - chart2/source editeng/source include/editeng include/sfx2 include/vcl sc/source sd/source sfx2/Library_sfx.mk sfx2/source svx/source
chart2/source/controller/inc/ChartController.hxx |2 chart2/source/controller/inc/ChartWindow.hxx |9 chart2/source/controller/main/ChartController.cxx| 15 chart2/source/controller/main/ChartController_Tools.cxx | 35 + chart2/source/controller/main/ChartController_Window.cxx |5 chart2/source/controller/main/ChartWindow.cxx| 110 editeng/source/editeng/impedit.cxx | 26 - include/editeng/outliner.hxx |1 include/sfx2/lokcharthelper.hxx | 60 ++ include/sfx2/viewsh.hxx |3 include/vcl/window.hxx |4 sc/source/ui/unoobj/docuno.cxx | 55 +- sd/source/ui/unoidl/unomodel.cxx | 60 ++ sfx2/Library_sfx.mk |1 sfx2/source/view/ipclient.cxx| 56 ++ sfx2/source/view/lokcharthelper.cxx | 373 +++ sfx2/source/view/viewsh.cxx | 15 svx/source/svdraw/svdmrkv.cxx| 37 + svx/source/svdraw/svdpntv.cxx|9 sw/inc/unotxdoc.hxx |2 sw/source/core/view/viewsh.cxx | 29 + sw/source/uibase/uno/unotxdoc.cxx| 89 +++ vcl/source/window/stacking.cxx |5 vcl/source/window/window2.cxx|5 24 files changed, 977 insertions(+), 29 deletions(-) New commits: commit 0d3a367b5623639e7fdc9ce1ccc277e2597694a0 Author: Marco CecchettiDate: Tue Jun 27 23:35:08 2017 +0200 lok - add support for in place chart editing This commit add a minimal support for editing chart embedded in a spreadsheet or a text document or a presentation. Graphic object can be moved and resized, text object can be edited. Change-Id: I8e637dabf328a94bd6bb0e309a245302cff421d8 Reviewed-on: https://gerrit.libreoffice.org/40681 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index 3b3449170eec..7b5b7882e99b 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -546,6 +546,8 @@ private: void executeDispatch_ToggleGridHorizontal(); void executeDispatch_ToggleGridVertical(); +void executeDispatch_LOKSetTextSelection(int nType, int nX, int nY); + void impl_ShapeControllerDispatch( const css::util::URL& rURL, const css::uno::Sequence< css::beans::PropertyValue >& rArgs ); diff --git a/chart2/source/controller/inc/ChartWindow.hxx b/chart2/source/controller/inc/ChartWindow.hxx index 6b0feaf440da..7883794a02bf 100644 --- a/chart2/source/controller/inc/ChartWindow.hxx +++ b/chart2/source/controller/inc/ChartWindow.hxx @@ -62,6 +62,7 @@ public: virtual void Invalidate( InvalidateFlags nFlags = InvalidateFlags::NONE ) override; virtual void Invalidate( const Rectangle& rRect, InvalidateFlags nFlags = InvalidateFlags::NONE ) override; virtual void Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags = InvalidateFlags::NONE ) override; +virtual void LogicInvalidate( const Rectangle* pRectangle ) override; virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; @@ -69,9 +70,17 @@ public: ChartController* GetController(); +virtual bool IsChart() const override { return true; } +vcl::Window* GetParentEditWin(); + +private: +// returns the chart bounding box in twips +Rectangle GetBoundingBox(); + private: ChartController* m_pWindowController; bool m_bInPaint; +VclPtr m_pViewShellWindow; VclPtr m_pOpenGLWindow; void adjustHighContrastMode(); diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index d40782f48920..ee622de47b69 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1137,7 +1137,20 @@ void SAL_CALL ChartController::dispatch( { OUString aCommand = rURL.Path; -if(aCommand == "Paste") +if(aCommand == "LOKSetTextSelection") +{ +if (rArgs.getLength() == 3) +{ +sal_Int32 nType = -1; +rArgs[0].Value >>= nType; +sal_Int32 nX = 0; +rArgs[1].Value >>= nX; +sal_Int32 nY = 0; +rArgs[2].Value >>= nY; +executeDispatch_LOKSetTextSelection(nType, nX, nY); +} +} +else if(aCommand == "Paste") this->executeDispatch_Paste();