[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 2 commits - sc/source vcl/source
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Tue Oct 6 14:16:38 UTC 2020
sc/source/ui/drawfunc/drawsh2.cxx | 47 ++++++++++++++++++++++++++++++++++++++
vcl/source/window/window2.cxx | 20 +++++++++++++++-
2 files changed, 66 insertions(+), 1 deletion(-)
New commits:
commit 2f20c1ac4e8fac51f23340f14d2e1a22258a12f1
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Sep 29 11:19:33 2020 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Oct 6 16:16:08 2020 +0200
Set correct color for chart background in sidebar
Change-Id: Id41fba75133e3473dcb834c72ff2ecfb317ecb79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103603
Tested-by: Andras Timar <andras.timar at collabora.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104017
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 772e2936911a..264f81998af9 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -52,6 +52,11 @@
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <svx/xflclit.hxx>
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <sfx2/ipclient.hxx>
+
#include <com/sun/star/drawing/FillStyle.hpp>
using namespace com::sun::star::drawing;
@@ -307,6 +312,45 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // disable functions
svx::FontworkBar::getState( pView, rSet );
}
+static void setupFillColorForChart(SfxViewShell* pShell, SfxItemSet& rSet)
+{
+ if (pShell)
+ {
+ SfxInPlaceClient* pIPClient = pShell->GetIPClient();
+ if (pIPClient)
+ {
+ const css::uno::Reference<::css::embed::XEmbeddedObject>& xEmbObj = pIPClient->GetObject();
+ if( xEmbObj.is() )
+ {
+ ::css::uno::Reference<::css::chart2::XChartDocument> xChart( xEmbObj->getComponent(), uno::UNO_QUERY );
+ if( xChart.is() )
+ {
+ css::uno::Reference<css::beans::XPropertySet> xPropSet(xChart->getPageBackground(), uno::UNO_QUERY);
+ if (xPropSet.is())
+ {
+ css::uno::Reference<css::beans::XPropertySetInfo> xInfo(xPropSet->getPropertySetInfo());
+ if (xInfo.is())
+ {
+ if (xInfo->hasPropertyByName("FillColor"))
+ {
+ sal_uInt32 nFillColor = 0;
+ xPropSet->getPropertyValue("FillColor") >>= nFillColor;
+
+ XFillColorItem aFillColorItem("", Color(nFillColor));
+ rSet.Put(aFillColorItem);
+
+ if (comphelper::LibreOfficeKit::isActive())
+ pShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+ (".uno:FillColor=" + std::to_string(nFillColor)).c_str());
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
// Attributes for Drawing-Objects
void ScDrawShell::GetDrawAttrState( SfxItemSet& rSet )
@@ -369,6 +413,9 @@ void ScDrawShell::GetDrawAttrState( SfxItemSet& rSet )
rSet.Put( SvxSizeItem( SID_ATTR_SIZE, Size( 0, 0 ) ) );
}
}
+
+ // Set correct colors for charts in sidebar
+ setupFillColorForChart(pDrView->GetSfxViewShell(), rSet);
}
}
commit e290cd189e4d3814820ee8509bdbf45a9d01e995
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Sep 30 19:09:32 2020 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Oct 6 16:16:01 2020 +0200
Allow invalidate after queue_resize for lok in sidebar
This is a fix for regression introduced by
61a35560cb412d7ab0e3d0574eec4a790e3b9dfd
Sidebar wasn't properly refreshed in Online eg.
in Impress change 'Background' in sidebar 'Slide' deck
to 'Color' -> resulted in overlapping content
Change-Id: Id64f5d8694908d28cf5fa9787b65e555fb317e35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103724
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104015
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 37e34d91c00a..7a5437dee1d8 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1306,6 +1306,19 @@ void Window::InvalidateSizeCache()
pWindowImpl->mnOptimalHeightCache = -1;
}
+static bool HasParentDockingWindow(const vcl::Window* pWindow)
+{
+ while( pWindow )
+ {
+ if( pWindow->IsDockingWindow() )
+ return true;
+
+ pWindow = pWindow->GetParent();
+ }
+
+ return pWindow && pWindow->IsDockingWindow();
+}
+
void Window::queue_resize(StateChangedType eReason)
{
if (IsDisposed())
@@ -1341,7 +1354,12 @@ void Window::queue_resize(StateChangedType eReason)
if (VclPtr<vcl::Window> pParent = GetParentWithLOKNotifier())
{
Size aSize = GetSizePixel();
- if (aSize.getWidth() > 0 && aSize.getHeight() > 0 && GetParentDialog()
+
+ // Form controls (VCL controls inside document window) was causing
+ // infinite loop of calls, so call it only for widgets having as a parent
+ // dialog or docking window (eg. sidebar)
+ if (aSize.getWidth() > 0 && aSize.getHeight() > 0
+ && (GetParentDialog() || HasParentDockingWindow(this))
&& !pParent->IsInInitShow())
LogicInvalidate(nullptr);
}
More information about the Libreoffice-commits
mailing list