[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 9 commits - chart2/source include/svx include/vcl sfx2/source svx/source svx/uiconfig vcl/source vcl/unx
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Thu Apr 8 14:42:55 UTC 2021
chart2/source/controller/inc/ChartController.hxx | 2
chart2/source/controller/main/ChartController.cxx | 18 ++++
chart2/source/controller/main/ChartController_Tools.cxx | 60 ++++++++++++++++
chart2/source/controller/sidebar/ChartColorWrapper.cxx | 14 +++
chart2/source/controller/sidebar/ChartLinePanel.cxx | 21 +++++
chart2/source/controller/sidebar/ChartLinePanel.hxx | 2
include/svx/fontworkgallery.hxx | 7 -
include/svx/sidebar/LinePropertyPanelBase.hxx | 5 -
include/vcl/weld.hxx | 9 ++
sfx2/source/control/unoctitm.cxx | 5 +
svx/source/sidebar/line/LinePropertyPanelBase.cxx | 2
svx/source/tbxctrls/fontworkgallery.cxx | 54 ++++----------
svx/uiconfig/ui/fontworkgallerydialog.ui | 37 ++++++---
vcl/source/app/salvtables.cxx | 46 +++++++++++-
vcl/source/control/button.cxx | 2
vcl/source/control/fmtfield.cxx | 1
vcl/source/window/dialog.cxx | 2
vcl/source/window/window.cxx | 4 -
vcl/unx/gtk3/gtk3gtkinst.cxx | 28 +++++++
19 files changed, 254 insertions(+), 65 deletions(-)
New commits:
commit e8b4f6d0dc5acf41070f9a7d5e858e853647e54f
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Jan 8 09:28:38 2021 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 8 16:42:04 2021 +0200
Fontwork dialog: use iconview
Change-Id: I5bb35407ca83c9b0cda6f6355e6e25c21fecb459
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108960
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109181
Tested-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/include/svx/fontworkgallery.hxx b/include/svx/fontworkgallery.hxx
index 12648ebd6a19..3fa657305ad6 100644
--- a/include/svx/fontworkgallery.hxx
+++ b/include/svx/fontworkgallery.hxx
@@ -52,17 +52,16 @@ class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC FontWorkGalleryDialog final : public wel
SdrObject** mppSdrObject;
SdrModel* mpDestModel;
- std::vector<BitmapEx> maFavoritesHorizontal;
+ std::vector<VclPtr< VirtualDevice >> maFavoritesHorizontal;
- ValueSet maCtlFavorites;
- std::unique_ptr<weld::CustomWeld> mxCtlFavorites;
+ std::unique_ptr<weld::IconView> maCtlFavorites;
std::unique_ptr<weld::Button> mxOKButton;
void initFavorites(sal_uInt16 nThemeId);
void insertSelectedFontwork();
void fillFavorites(sal_uInt16 nThemeId);
- DECL_LINK(DoubleClickFavoriteHdl, ValueSet*, void);
+ DECL_LINK(DoubleClickFavoriteHdl, weld::IconView&, bool);
DECL_LINK(ClickOKHdl, weld::Button&, void );
public:
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 496b6d489e9d..db5ada010fd1 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1243,11 +1243,20 @@ public:
const OUString* pIconName, TreeIter* pRet)
= 0;
+ virtual void insert(int pos, const OUString* pStr, const OUString* pId,
+ const VirtualDevice* pIcon, TreeIter* pRet)
+ = 0;
+
void append(const OUString& rId, const OUString& rStr, const OUString& rImage)
{
insert(-1, &rStr, &rId, &rImage, nullptr);
}
+ void append(const OUString& rId, const OUString& rStr, const VirtualDevice* pImage)
+ {
+ insert(-1, &rStr, &rId, pImage, nullptr);
+ }
+
void connect_selection_changed(const Link<IconView&, void>& rLink)
{
m_aSelectionChangeHdl = rLink;
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index a1b28688f13a..efef6f786e0d 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -48,29 +48,21 @@ using namespace ::com::sun::star::beans;
namespace svx
{
-const int nColCount = 4;
-const int nLineCount = 4;
-
FontWorkGalleryDialog::FontWorkGalleryDialog(weld::Window* pParent, SdrView& rSdrView)
: GenericDialogController(pParent, "svx/ui/fontworkgallerydialog.ui", "FontworkGalleryDialog")
, mnThemeId(0xffff)
, mrSdrView(rSdrView)
, mppSdrObject(nullptr)
, mpDestModel(nullptr)
- , maCtlFavorites(m_xBuilder->weld_scrolled_window("ctlFavoriteswin", true))
- , mxCtlFavorites(new weld::CustomWeld(*m_xBuilder, "ctlFavorites", maCtlFavorites))
+ , maCtlFavorites(m_xBuilder->weld_icon_view("ctlFavoriteswin"))
, mxOKButton(m_xBuilder->weld_button("ok"))
{
- Size aSize(maCtlFavorites.GetDrawingArea()->get_ref_device().LogicToPixel(Size(200, 200), MapMode(MapUnit::MapAppFont)));
- mxCtlFavorites->set_size_request(aSize.Width(), aSize.Height());
+ Size aSize(530, 400);
+ maCtlFavorites->set_size_request(aSize.Width(), aSize.Height());
- maCtlFavorites.SetDoubleClickHdl( LINK( this, FontWorkGalleryDialog, DoubleClickFavoriteHdl ) );
+ maCtlFavorites->connect_item_activated( LINK( this, FontWorkGalleryDialog, DoubleClickFavoriteHdl ) );
mxOKButton->connect_clicked(LINK(this, FontWorkGalleryDialog, ClickOKHdl));
- maCtlFavorites.SetColCount( nColCount );
- maCtlFavorites.SetLineCount( nLineCount );
- maCtlFavorites.SetExtraSpacing( 3 );
-
initFavorites( GALLERY_THEME_FONTWORK );
fillFavorites( GALLERY_THEME_FONTWORK );
}
@@ -96,7 +88,7 @@ void FontWorkGalleryDialog::initFavorites(sal_uInt16 nThemeId)
if (GalleryExplorer::GetSdrObj(nThemeId, nModelPos, pModel, &aThumb) && !!aThumb)
{
- ScopedVclPtrInstance< VirtualDevice > pVDev;
+ VclPtr< VirtualDevice > pVDev = VclPtr<VirtualDevice>::Create();
const Point aNull(0, 0);
if (pVDev->GetDPIScaleFactor() > 1)
@@ -113,7 +105,7 @@ void FontWorkGalleryDialog::initFavorites(sal_uInt16 nThemeId)
pVDev->DrawCheckered(aNull, aSize, nLen, aW, aG);
pVDev->DrawBitmapEx(aNull, aThumb);
- maFavoritesHorizontal.emplace_back(pVDev->GetBitmapEx(aNull, aSize));
+ maFavoritesHorizontal.emplace_back(pVDev);
}
}
@@ -125,33 +117,18 @@ void FontWorkGalleryDialog::fillFavorites(sal_uInt16 nThemeId)
{
mnThemeId = nThemeId;
- Size aThumbSize(maCtlFavorites.GetOutputSizePixel());
- aThumbSize.setWidth( aThumbSize.Width() / nColCount );
- aThumbSize.setHeight( aThumbSize.Height() / nLineCount );
- aThumbSize.AdjustWidth( -12 );
- aThumbSize.AdjustHeight( -12 );
-
auto nFavCount = maFavoritesHorizontal.size();
- // ValueSet favorites
- if( nFavCount > (nColCount * nLineCount) )
- {
- WinBits nWinBits = maCtlFavorites.GetStyle();
- nWinBits |= WB_VSCROLL;
- maCtlFavorites.SetStyle( nWinBits );
- }
-
- maCtlFavorites.Clear();
+ maCtlFavorites->clear();
for( size_t nFavorite = 1; nFavorite <= nFavCount; nFavorite++ )
{
- OUString aStr = SvxResId(RID_SVXFLOAT3D_FAVORITE) + " " + OUString::number(nFavorite);
- Image aThumbImage( maFavoritesHorizontal[nFavorite-1] );
- maCtlFavorites.InsertItem( static_cast<sal_uInt16>(nFavorite), aThumbImage, aStr );
+ OUString sId = OUString::number(static_cast<sal_uInt16>(nFavorite));
+ maCtlFavorites->append(sId, "", maFavoritesHorizontal[nFavorite-1]);
}
- if (maCtlFavorites.GetItemCount())
- maCtlFavorites.SelectItem(1);
+ if (maCtlFavorites->n_children())
+ maCtlFavorites->select(0);
}
void FontWorkGalleryDialog::SetSdrObjectRef( SdrObject** ppSdrObject, SdrModel* pModel )
@@ -162,7 +139,11 @@ void FontWorkGalleryDialog::SetSdrObjectRef( SdrObject** ppSdrObject, SdrModel*
void FontWorkGalleryDialog::insertSelectedFontwork()
{
- sal_uInt16 nItemId = maCtlFavorites.GetSelectedItemId();
+ OUString sItemId = maCtlFavorites->get_selected_id();
+ if (sItemId.isEmpty())
+ return;
+
+ sal_Int32 nItemId = sItemId.toInt32();
if (nItemId == 0)
return;
@@ -244,10 +225,11 @@ IMPL_LINK_NOARG(FontWorkGalleryDialog, ClickOKHdl, weld::Button&, void)
m_xDialog->response(RET_OK);
}
-IMPL_LINK_NOARG(FontWorkGalleryDialog, DoubleClickFavoriteHdl, ValueSet*, void)
+IMPL_LINK_NOARG(FontWorkGalleryDialog, DoubleClickFavoriteHdl, weld::IconView&, bool)
{
insertSelectedFontwork();
m_xDialog->response(RET_OK);
+ return true;
}
namespace {
diff --git a/svx/uiconfig/ui/fontworkgallerydialog.ui b/svx/uiconfig/ui/fontworkgallerydialog.ui
index 683832e39d70..72cbdeff46cf 100644
--- a/svx/uiconfig/ui/fontworkgallerydialog.ui
+++ b/svx/uiconfig/ui/fontworkgallerydialog.ui
@@ -2,6 +2,16 @@
<!-- Generated with glade 3.22.1 -->
<interface domain="svx">
<requires lib="gtk+" version="3.20"/>
+ <object class="GtkTreeStore" id="liststore1">
+ <columns>
+ <!-- column-name expander -->
+ <column type="GdkPixbuf"/>
+ <!-- column-name text -->
+ <column type="gchararray"/>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
<object class="GtkDialog" id="FontworkGalleryDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
@@ -98,25 +108,24 @@
</packing>
</child>
<child>
- <object class="GtkScrolledWindow" id="ctlFavoriteswin">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<property name="hexpand">True</property>
- <property name="hscrollbar_policy">never</property>
- <property name="vscrollbar_policy">never</property>
+ <property name="vexpand">True</property>
<property name="shadow_type">in</property>
<child>
- <object class="GtkViewport">
+ <object class="GtkIconView" id="ctlFavoriteswin">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkDrawingArea" id="ctlFavorites">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
- <property name="hexpand">True</property>
- </object>
- </child>
+ <property name="can_focus">True</property>
+ <property name="margin">6</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="model">liststore1</property>
+ <property name="columns">3</property>
+ <property name="item_width">100</property>
+ <property name="pixbuf-column">0</property>
+ <property name="text-column">1</property>
</object>
</child>
</object>
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 42912823c372..c8e8167c4757 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -5086,6 +5086,47 @@ public:
enable_notify_events();
}
+ virtual void insert(int pos, const OUString* pStr, const OUString* pId,
+ const VirtualDevice* pIcon, weld::TreeIter* pRet) override
+ {
+ disable_notify_events();
+ auto nInsertPos = pos == -1 ? TREELIST_APPEND : pos;
+ void* pUserData;
+ if (pId)
+ {
+ m_aUserData.emplace_back(std::make_unique<OUString>(*pId));
+ pUserData = m_aUserData.back().get();
+ }
+ else
+ pUserData = nullptr;
+
+ SvTreeListEntry* pEntry = new SvTreeListEntry;
+ if (pIcon)
+ {
+ const Point aNull(0, 0);
+ const Size aSize = pIcon->GetOutputSizePixel();
+ Image aImage(pIcon->GetBitmapEx(aNull, aSize));
+ pEntry->AddItem(std::make_unique<SvLBoxContextBmp>(aImage, aImage, false));
+ }
+ else
+ {
+ Image aDummy;
+ pEntry->AddItem(std::make_unique<SvLBoxContextBmp>(aDummy, aDummy, false));
+ }
+ if (pStr)
+ pEntry->AddItem(std::make_unique<SvLBoxString>(*pStr));
+ pEntry->SetUserData(pUserData);
+ m_xIconView->Insert(pEntry, nullptr, nInsertPos);
+
+ if (pRet)
+ {
+ SalInstanceTreeIter* pVclRetIter = static_cast<SalInstanceTreeIter*>(pRet);
+ pVclRetIter->iter = pEntry;
+ }
+
+ enable_notify_events();
+ }
+
virtual OUString get_selected_id() const override
{
assert(m_xIconView->IsUpdateMode() && "don't request selection when frozen");
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 773b20ac5b07..fa6220835b75 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -12381,6 +12381,21 @@ private:
}
}
+ void insert_item(GtkTreeIter& iter, int pos, const OUString* pId, const OUString* pText, const VirtualDevice* pIcon)
+ {
+ gtk_tree_store_insert_with_values(m_pTreeStore, &iter, nullptr, pos,
+ m_nTextCol, !pText ? nullptr : OUStringToOString(*pText, RTL_TEXTENCODING_UTF8).getStr(),
+ m_nIdCol, !pId ? nullptr : OUStringToOString(*pId, RTL_TEXTENCODING_UTF8).getStr(),
+ -1);
+ if (pIcon)
+ {
+ GdkPixbuf* pixbuf = getPixbuf(*pIcon);
+ gtk_tree_store_set(m_pTreeStore, &iter, m_nImageCol, pixbuf, -1);
+ if (pixbuf)
+ g_object_unref(pixbuf);
+ }
+ }
+
OUString get(const GtkTreeIter& iter, int col) const
{
GtkTreeModel *pModel = GTK_TREE_MODEL(m_pTreeStore);
@@ -12441,6 +12456,19 @@ public:
enable_notify_events();
}
+ virtual void insert(int pos, const OUString* pText, const OUString* pId, const VirtualDevice* pIcon, weld::TreeIter* pRet) override
+ {
+ disable_notify_events();
+ GtkTreeIter iter;
+ insert_item(iter, pos, pId, pText, pIcon);
+ if (pRet)
+ {
+ GtkInstanceTreeIter* pGtkRetIter = static_cast<GtkInstanceTreeIter*>(pRet);
+ pGtkRetIter->iter = iter;
+ }
+ enable_notify_events();
+ }
+
virtual OUString get_selected_id() const override
{
assert(gtk_icon_view_get_model(m_pIconView) && "don't request selection when frozen");
commit c00375c68255cbee6b90875d7feff4f0bb2f4758
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Jan 6 11:44:43 2021 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 8 16:42:04 2021 +0200
lok: send chart line width updates
Change-Id: I4c9c4a977df12a1cefb81cfbcac73b61ff26e488
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108843
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/+/108966
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.cxx b/chart2/source/controller/sidebar/ChartLinePanel.cxx
index 3ae57de73739..019b022bd1a3 100644
--- a/chart2/source/controller/sidebar/ChartLinePanel.cxx
+++ b/chart2/source/controller/sidebar/ChartLinePanel.cxx
@@ -24,6 +24,10 @@
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
+#include <comphelper/lok.hxx>
+#include <sfx2/viewsh.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+
namespace chart::sidebar {
namespace {
@@ -189,6 +193,11 @@ void ChartLinePanel::updateData()
XLineTransparenceItem aLineTransparenceItem(nLineTransparence);
updateLineTransparence(false, true, &aLineTransparenceItem);
+ sal_uInt32 nWidth;
+ xPropSet->getPropertyValue("LineWidth") >>= nWidth;
+ XLineWidthItem aWidthItem(nWidth);
+ updateLineWidth(false, true, &aWidthItem);
+
maLineStyleWrapper.updateData();
maLineColorWrapper.updateData();
}
@@ -274,6 +283,18 @@ void ChartLinePanel::setLineWidth(const XLineWidthItem& rItem)
xPropSet->setPropertyValue("LineWidth", css::uno::Any(rItem.GetValue()));
}
+void ChartLinePanel::updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem)
+{
+ LinePropertyPanelBase::updateLineWidth(bDisabled, bSetOrDefault, pItem);
+
+ SfxViewShell* pViewShell = SfxViewShell::Current();
+ if (comphelper::LibreOfficeKit::isActive() && pViewShell)
+ {
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+ (".uno:LineWidth=" + std::to_string(mnWidthCoreValue)).c_str());
+ }
+}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.hxx b/chart2/source/controller/sidebar/ChartLinePanel.hxx
index 2f703839a22c..ef174a5ee3a9 100644
--- a/chart2/source/controller/sidebar/ChartLinePanel.hxx
+++ b/chart2/source/controller/sidebar/ChartLinePanel.hxx
@@ -67,6 +67,8 @@ protected:
virtual void setLineJoint(const XLineJointItem* pItem) override;
virtual void setLineCap(const XLineCapItem* pItem) override;
+ virtual void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem) override;
+
private:
css::uno::Reference<css::frame::XModel> mxModel;
diff --git a/include/svx/sidebar/LinePropertyPanelBase.hxx b/include/svx/sidebar/LinePropertyPanelBase.hxx
index cd924e6b8a8f..52411be57d2c 100644
--- a/include/svx/sidebar/LinePropertyPanelBase.hxx
+++ b/include/svx/sidebar/LinePropertyPanelBase.hxx
@@ -77,7 +77,7 @@ protected:
virtual void setLineCap(const XLineCapItem* pItem) = 0;
void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
- void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
+ virtual void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
void updateLineJoint(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
void updateLineCap(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
@@ -93,6 +93,8 @@ protected:
std::unique_ptr<weld::Toolbar> mxLineStyleTB;
std::unique_ptr<ToolbarUnoDispatcher> mxLineStyleDispatch;
+ sal_Int32 mnWidthCoreValue;
+
private:
//ui controls
std::unique_ptr<weld::Label> mxFTWidth;
@@ -112,7 +114,6 @@ private:
sal_uInt16 mnTrans;
MapUnit meMapUnit;
- sal_Int32 mnWidthCoreValue;
// images from resource
OUString maIMGNone;
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
index f1b49ebde5c1..8d26da31ffa4 100644
--- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
@@ -72,6 +72,7 @@ LinePropertyPanelBase::LinePropertyPanelBase(
mxColorDispatch(new ToolbarUnoDispatcher(*mxTBColor, *m_xBuilder, rxFrame)),
mxLineStyleTB(m_xBuilder->weld_toolbar("linestyle")),
mxLineStyleDispatch(new ToolbarUnoDispatcher(*mxLineStyleTB, *m_xBuilder, rxFrame)),
+ mnWidthCoreValue(0),
mxFTWidth(m_xBuilder->weld_label("widthlabel")),
mxTBWidth(m_xBuilder->weld_toolbar("width")),
mxFTTransparency(m_xBuilder->weld_label("translabel")),
@@ -86,7 +87,6 @@ LinePropertyPanelBase::LinePropertyPanelBase(
mxLineStyleNoneChange(new LineStyleNoneChange(*this)),
mnTrans(0),
meMapUnit(MapUnit::MapMM),
- mnWidthCoreValue(0),
maIMGNone(BMP_NONE_ICON),
mbWidthValuable(true),
mbArrowSupported(true),
commit 7a76382b9f541a3af72f497d024fc1dbe9a39f0f
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Jan 5 18:11:41 2021 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 8 16:42:04 2021 +0200
lok: Apply chart line width
Change-Id: I94a6406eeb929498592ca5430cf7248cfd3e9f77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108815
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/+/108946
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx
index a4cd900ff2f2..e2af7e0afa68 100644
--- a/chart2/source/controller/inc/ChartController.hxx
+++ b/chart2/source/controller/inc/ChartController.hxx
@@ -500,6 +500,7 @@ private:
void executeDispatch_FillColor(sal_uInt32 nColor);
void executeDispatch_FillGradient(OUString sJSONGradient);
void executeDispatch_LineColor(sal_uInt32 nColor);
+ void executeDispatch_LineWidth(sal_uInt32 nWidth);
void sendPopupRequest(OUString const & rCID, tools::Rectangle aRectangle);
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 53e86e23b92e..137396b3e64b 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1121,6 +1121,15 @@ void SAL_CALL ChartController::dispatch(
this->executeDispatch_LineColor(nColor);
}
}
+ else if(aCommand == "LineWidth")
+ {
+ if (rArgs.getLength() > 0)
+ {
+ sal_Int32 nWidth = -1;
+ rArgs[0].Value >>= nWidth;
+ this->executeDispatch_LineWidth(nWidth);
+ }
+ }
else if(aCommand.startsWith("FillGradient"))
{
this->executeDispatch_FillGradient(aCommand.copy(aCommand.indexOf('=') + 1));
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 6eb592da4e08..b194e171dbe9 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -1009,6 +1009,36 @@ void ChartController::executeDispatch_LineColor(sal_uInt32 nColor)
}
}
+void ChartController::executeDispatch_LineWidth(sal_uInt32 nWidth)
+{
+ try
+ {
+ OUString aCID( m_aSelection.getSelectedCID() );
+ const uno::Reference< frame::XModel >& xChartModel = getModel();
+ if( xChartModel.is() )
+ {
+ Reference< beans::XPropertySet > xPropSet(
+ ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ) );
+
+ ObjectType eType = ObjectIdentifier::getObjectType(aCID);
+ if (eType == OBJECTTYPE_DIAGRAM)
+ {
+ css::uno::Reference<css::chart2::XDiagram> xDiagram(
+ xPropSet, css::uno::UNO_QUERY);
+ if (xDiagram.is())
+ xPropSet.set(xDiagram->getWall());
+ }
+
+ if( xPropSet.is() )
+ xPropSet->setPropertyValue( "LineWidth", css::uno::makeAny( nWidth ) );
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION( "chart2" );
+ }
+}
+
void ChartController::executeDispatch_LOKSetTextSelection(int nType, int nX, int nY)
{
if (!m_pDrawViewWrapper)
commit 72eeb19bd68048fe1f84fee0f76659c7f76a895a
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Jan 6 17:19:50 2021 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 8 16:42:04 2021 +0200
lok: send linespacing updates
Change-Id: I2dd123b04a2d6a03eac92aca5db5a4413b386e7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108877
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/+/108945
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 9c78b4c693ce..ddccd885ab15 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1020,7 +1020,10 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra
aEvent.FeatureURL.Path == "FormatPaintbrush" ||
aEvent.FeatureURL.Path == "FreezePanes" ||
aEvent.FeatureURL.Path == "Sidebar" ||
- aEvent.FeatureURL.Path == "SheetRightToLeft")
+ aEvent.FeatureURL.Path == "SheetRightToLeft" ||
+ aEvent.FeatureURL.Path == "SpacePara1" ||
+ aEvent.FeatureURL.Path == "SpacePara15" ||
+ aEvent.FeatureURL.Path == "SpacePara2")
{
bool bTemp = false;
aEvent.State >>= bTemp;
commit 33860463429c6a5b0d7b3731d62c44bcfc5023cc
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Jan 5 10:36:31 2021 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 8 16:42:04 2021 +0200
lok: send chart color updates
Change-Id: I037049fb19ddf4c1450d7d9327c574cb4e37977c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108793
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/+/108927
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.cxx b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
index cbe7e088e313..880170d32730 100644
--- a/chart2/source/controller/sidebar/ChartColorWrapper.cxx
+++ b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
@@ -26,6 +26,10 @@
#include <svx/xlndsit.hxx>
#include <svx/unomid.hxx>
+#include <comphelper/lok.hxx>
+#include <sfx2/viewsh.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+
namespace chart::sidebar {
namespace {
@@ -115,6 +119,16 @@ void ChartColorWrapper::updateData()
aEvent.IsEnabled = true;
aEvent.State = xPropSet->getPropertyValue(maPropertyName);
mpControl->statusChanged(aEvent);
+
+ SfxViewShell* pViewShell = SfxViewShell::Current();
+ if (comphelper::LibreOfficeKit::isActive() && pViewShell && (maPropertyName == aLineColor))
+ {
+ std::string sCommand = OUStringToOString(aUrl.Complete, RTL_TEXTENCODING_ASCII_US).getStr();
+ sal_Int32 nColor = -1;
+ aEvent.State >>= nColor;
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+ (sCommand + "=" + std::to_string(nColor)).c_str());
+ }
}
ChartLineStyleWrapper::ChartLineStyleWrapper(
commit e73f6309a2751c1d29f4a478860be54b57c5b1aa
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Jan 4 13:35:25 2021 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 8 16:42:04 2021 +0200
lok: Apply chart line color
Change-Id: I21b96485f26439844f19278e0d6340b55012d4ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108666
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/+/108926
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx
index aa399f2164b3..a4cd900ff2f2 100644
--- a/chart2/source/controller/inc/ChartController.hxx
+++ b/chart2/source/controller/inc/ChartController.hxx
@@ -499,6 +499,7 @@ private:
void executeDispatch_LOKPieSegmentDragging(int nOffset);
void executeDispatch_FillColor(sal_uInt32 nColor);
void executeDispatch_FillGradient(OUString sJSONGradient);
+ void executeDispatch_LineColor(sal_uInt32 nColor);
void sendPopupRequest(OUString const & rCID, tools::Rectangle aRectangle);
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index defde0487db7..53e86e23b92e 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1112,6 +1112,15 @@ void SAL_CALL ChartController::dispatch(
this->executeDispatch_FillColor(nColor);
}
}
+ else if(aCommand == "XLineColor")
+ {
+ if (rArgs.getLength() > 0)
+ {
+ sal_Int32 nColor = -1;
+ rArgs[0].Value >>= nColor;
+ this->executeDispatch_LineColor(nColor);
+ }
+ }
else if(aCommand.startsWith("FillGradient"))
{
this->executeDispatch_FillGradient(aCommand.copy(aCommand.indexOf('=') + 1));
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index ed0776d94c79..6eb592da4e08 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -979,6 +979,36 @@ void ChartController::executeDispatch_FillGradient(OUString sJSONGradient)
}
}
+void ChartController::executeDispatch_LineColor(sal_uInt32 nColor)
+{
+ try
+ {
+ OUString aCID( m_aSelection.getSelectedCID() );
+ const uno::Reference< frame::XModel >& xChartModel = getModel();
+ if( xChartModel.is() )
+ {
+ Reference< beans::XPropertySet > xPropSet(
+ ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ) );
+
+ ObjectType eType = ObjectIdentifier::getObjectType(aCID);
+ if (eType == OBJECTTYPE_DIAGRAM)
+ {
+ css::uno::Reference<css::chart2::XDiagram> xDiagram(
+ xPropSet, css::uno::UNO_QUERY);
+ if (xDiagram.is())
+ xPropSet.set(xDiagram->getWall());
+ }
+
+ if( xPropSet.is() )
+ xPropSet->setPropertyValue( "LineColor", css::uno::makeAny( Color(nColor) ) );
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION( "chart2" );
+ }
+}
+
void ChartController::executeDispatch_LOKSetTextSelection(int nType, int nX, int nY)
{
if (!m_pDrawViewWrapper)
commit 61707d7b758a6555f9fec1eb8ccc928dd15cfd07
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 17 14:44:51 2020 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 8 16:42:03 2021 +0200
lok: don't use focus window to request help
Use clicked button instead - what leads to the correct window.
If only focused window was taken into account sometimes
it caused incorrect help link to be used.
Change-Id: I645dc1ffa6a6d6d363ea5f9874fa830c441516c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107882
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108429
Tested-by: Jenkins
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 4b7ccce0153c..42912823c372 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -76,8 +76,7 @@
#include <window.h>
#include <wizdlg.hxx>
#include <salvtables.hxx>
-
-#include <boost/property_tree/ptree.hpp>
+#include <comphelper/lok.hxx>
SalFrame::SalFrame()
: m_pWindow(nullptr)
@@ -6850,7 +6849,7 @@ void SalInstanceWindow::help()
{
//show help for widget with keyboard focus
vcl::Window* pWidget = ImplGetSVData()->mpWinData->mpFocusWin;
- if (!pWidget)
+ if (!pWidget || comphelper::LibreOfficeKit::isActive())
pWidget = m_xWindow;
OString sHelpId = pWidget->GetHelpId();
while (sHelpId.isEmpty())
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 91a4aa4543a3..b2a7dc7cfdc2 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1753,7 +1753,7 @@ void HelpButton::Click()
if ( !GetClickHdl() )
{
vcl::Window* pFocusWin = Application::GetFocusWindow();
- if ( !pFocusWin )
+ if ( !pFocusWin || comphelper::LibreOfficeKit::isActive() )
pFocusWin = this;
HelpEvent aEvt( pFocusWin->GetPointerPosPixel(), HelpEventMode::CONTEXT );
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index e502c33caeb1..92528597e476 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1398,7 +1398,7 @@ IMPL_LINK(Dialog, ResponseHdl, Button*, pButton, void)
if (nResponse == RET_HELP)
{
vcl::Window* pFocusWin = Application::GetFocusWindow();
- if (!pFocusWin)
+ if (!pFocusWin || comphelper::LibreOfficeKit::isActive())
pFocusWin = pButton;
HelpEvent aEvt(pFocusWin->GetPointerPosPixel(), HelpEventMode::CONTEXT);
pFocusWin->RequestHelp(aEvt);
commit aac96250cfbae2a596438ec32a47c724e4a428ef
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 17 15:07:49 2020 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 8 16:42:03 2021 +0200
jsdialog: step for spinfields
Change-Id: I35336dfcd9913a984b0a8894622d0785d4007bc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107884
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108419
Tested-by: Jenkins
diff --git a/vcl/source/control/fmtfield.cxx b/vcl/source/control/fmtfield.cxx
index 48a82370b325..20ad995de48d 100644
--- a/vcl/source/control/fmtfield.cxx
+++ b/vcl/source/control/fmtfield.cxx
@@ -1358,6 +1358,7 @@ void FormattedField::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
rJsonWriter.put("min", rFormatter.GetMinValue());
rJsonWriter.put("max", rFormatter.GetMaxValue());
rJsonWriter.put("value", rFormatter.GetValue());
+ rJsonWriter.put("step", rFormatter.GetSpinSize());
}
FactoryFunction FormattedField::GetUITestFactory() const
commit 368d6ada674c425fdaa88b1c21e83281e318b0af
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Nov 8 09:15:25 2020 -0500
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 8 16:42:03 2021 +0200
vcl: lok: don't use window impl after destroy
When destroying floating windows, accessing the GetLOKNotifier
can segfault. The following is the stack-trace from such
a case.
/usr/bin/loolforkit(_ZN7SigUtil13dumpBacktraceEv+0x5e)[0x55cbf9da62fe]
/usr/bin/loolforkit(+0x1d0af5)[0x55cbf9da6af5]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x128a0)[0x7fe0a125f8a0]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZNK3vcl6Window14GetLOKNotifierEv+0x7)[0x7fe09e67b827]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZN3vcl6Window24GetParentWithLOKNotifierEv+0x2b)[0x7fe09e67b86b]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZN14FloatingWindow12StateChangedE16StateChangedType+0x43)[0x7fe09e609a13]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZN3vcl6Window4ShowEb9ShowFlags+0x2ba)[0x7fe09e67cd5a]
/opt/collaboraoffice6.4/program/libmergedlo.so(_Z21ImplDestroyHelpWindowR14ImplSVHelpDatab+0xe3)[0x7fe09e90c193]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZN9Scheduler21ProcessTaskSchedulingEv+0x8ea)[0x7fe09e93817a]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZN14SvpSalInstance12CheckTimeoutEb+0x107)[0x7fe09ea06807]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZN14SvpSalInstance7DoYieldEbb+0x85)[0x7fe09ea06905]
/opt/collaboraoffice6.4/program/libmergedlo.so(+0x2f5d6fb)[0x7fe09e94f6fb]
/opt/collaboraoffice6.4/program/libmergedlo.so(_ZN11Application7ExecuteEv+0x45)[0x7fe09e950295]
/opt/collaboraoffice6.4/program/libmergedlo.so(+0x1f6d545)[0x7fe09d95f545]
/opt/collaboraoffice6.4/program/libmergedlo.so(_Z10ImplSVMainv+0x51)[0x7fe09e957321]
/opt/collaboraoffice6.4/program/libmergedlo.so(soffice_main+0x98)[0x7fe09d980b88]
/opt/collaboraoffice6.4/program/libmergedlo.so(+0x1f9e7c1)[0x7fe09d9907c1]
/usr/bin/loolforkit(_Z10lokit_mainRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_S6_S6_S6_bbbbm+0x2562)[0x55cbf9d4c792]
/usr/bin/loolforkit(+0x15fc77)[0x55cbf9d35c77]
/usr/bin/loolforkit(_Z18forkLibreOfficeKitRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_S6_S6_i+0xb44)[0x55cbf9d36b24]
/usr/bin/loolforkit(main+0x18a7)[0x55cbf9d00e17]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7fe0a0e7db97]
/usr/bin/loolforkit(_start+0x2a)[0x55cbf9d07efa]
Change-Id: Ia467d51896d1ac657bde5ae2803fcb2557ebd3fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105366
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ash at collabora.com>
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 9b8ae89b7433..5e6d92b47ef9 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3216,12 +3216,12 @@ ILibreOfficeKitNotifier::~ILibreOfficeKitNotifier()
const vcl::ILibreOfficeKitNotifier* Window::GetLOKNotifier() const
{
- return mpWindowImpl->mpLOKNotifier;
+ return mpWindowImpl ? mpWindowImpl->mpLOKNotifier : nullptr;
}
vcl::LOKWindowId Window::GetLOKWindowId() const
{
- return mpWindowImpl->mnLOKWindowId;
+ return mpWindowImpl ? mpWindowImpl->mnLOKWindowId : 0;
}
VclPtr<vcl::Window> Window::GetParentWithLOKNotifier()
More information about the Libreoffice-commits
mailing list