[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sc/source sc/uiconfig
Caolán McNamara
caolanm at redhat.com
Thu Apr 20 04:15:58 UTC 2017
sc/source/ui/condformat/condformatdlgentry.cxx | 22 +++++++++++-----------
sc/source/ui/inc/condformatdlgentry.hxx | 2 ++
sc/uiconfig/scalc/ui/conditionalentry.ui | 14 ++++++++++++++
3 files changed, 27 insertions(+), 11 deletions(-)
New commits:
commit 4e40cf62a142813a2ffa0a64148c84c1b4e60be9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 30 10:16:41 2017 +0100
Resolves: tdf#106838 icon set not visible in conditional formatting
Change-Id: Ibafaa487d39a69bc7c5c150361368614c0d9e004
(cherry picked from commit 1c2dd8dc14effe739bd826cf4fe77145d5b751bc)
Reviewed-on: https://gerrit.libreoffice.org/35899
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index f4273992e9f4..6ecfeb7a71df 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -1399,11 +1399,15 @@ ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(vcl::Window* pParent, ScIconSetTy
Size ScIconSetFrmtDataEntry::calculateRequisition() const
{
+ if (!maGrid) //during dispose
+ return Size();
return getLayoutRequisition(*maGrid);
}
void ScIconSetFrmtDataEntry::setAllocation(const Size &rAllocation)
{
+ if (!maGrid) //during dispose
+ return;
setLayoutPosSize(*maGrid, Point(0, 0), rAllocation);
}
@@ -1471,6 +1475,7 @@ ScIconSetFrmtEntry::ScIconSetFrmtEntry(vcl::Window* pParent, ScDocument* pDoc, c
{
get(maLbColorFormat, "colorformat");
get(maLbIconSetType, "iconsettype");
+ get(maIconParent, "iconparent");
Init();
maLbColorFormat->SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) );
@@ -1485,12 +1490,9 @@ ScIconSetFrmtEntry::ScIconSetFrmtEntry(vcl::Window* pParent, ScDocument* pDoc, c
for (size_t i = 0, n = pIconSetFormatData->m_Entries.size();
i < n; ++i)
{
- maEntries.push_back( VclPtr<ScIconSetFrmtDataEntry>::Create(
- this, eType, pDoc, i, pIconSetFormatData->m_Entries[i].get()));
- Size aSize(maEntries[0]->get_preferred_size());
- Point aPos(0, LogicToPixel(Size(0, 35), MapMode(MapUnit::MapAppFont)).getHeight());
- aPos.Y() += aSize.Height() * i * 1.2;
- maEntries[i]->SetPosSizePixel(aPos, aSize);
+ maEntries.push_back(VclPtr<ScIconSetFrmtDataEntry>::Create(
+ maIconParent, eType, pDoc, i, pIconSetFormatData->m_Entries[i].get()));
+ maEntries[i]->set_grid_top_attach(i);
}
maEntries[0]->SetFirstEntry();
}
@@ -1508,6 +1510,7 @@ void ScIconSetFrmtEntry::dispose()
for (auto it = maEntries.begin(); it != maEntries.end(); ++it)
it->disposeAndClear();
maEntries.clear();
+ maIconParent.clear();
maLbColorFormat.clear();
maLbIconSetType.clear();
ScCondFrmtEntry::dispose();
@@ -1535,11 +1538,8 @@ IMPL_LINK_NOARG( ScIconSetFrmtEntry, IconSetTypeHdl, ListBox&, void )
for(size_t i = 0; i < nElements; ++i)
{
- maEntries.push_back( VclPtr<ScIconSetFrmtDataEntry>::Create( this, static_cast<ScIconSetType>(nPos), mpDoc, i ) );
- Size aSize(maEntries[0]->get_preferred_size());
- Point aPos(0, LogicToPixel(Size(0, 35), MapMode(MapUnit::MapAppFont)).getHeight());
- aPos.Y() += aSize.Height() * i * 1.2;
- maEntries[i]->SetPosSizePixel(aPos, aSize);
+ maEntries.push_back(VclPtr<ScIconSetFrmtDataEntry>::Create(maIconParent, static_cast<ScIconSetType>(nPos), mpDoc, i));
+ maEntries[i]->set_grid_top_attach(i);
maEntries[i]->Show();
}
maEntries[0]->SetFirstEntry();
diff --git a/sc/source/ui/inc/condformatdlgentry.hxx b/sc/source/ui/inc/condformatdlgentry.hxx
index f7d446ff474b..642e6ceae019 100644
--- a/sc/source/ui/inc/condformatdlgentry.hxx
+++ b/sc/source/ui/inc/condformatdlgentry.hxx
@@ -297,6 +297,8 @@ class ScIconSetFrmtEntry : public ScCondFrmtEntry
// icon set ui elements
VclPtr<ListBox> maLbIconSetType;
+ VclPtr<VclContainer> maIconParent;
+
typedef std::vector<VclPtr<ScIconSetFrmtDataEntry>> ScIconSetFrmtDataEntriesType;
ScIconSetFrmtDataEntriesType maEntries;
diff --git a/sc/uiconfig/scalc/ui/conditionalentry.ui b/sc/uiconfig/scalc/ui/conditionalentry.ui
index c5803074e635..88ec9b39069a 100644
--- a/sc/uiconfig/scalc/ui/conditionalentry.ui
+++ b/sc/uiconfig/scalc/ui/conditionalentry.ui
@@ -410,6 +410,20 @@
</packing>
</child>
<child>
+ <object class="GtkGrid" id="iconparent">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">7</property>
+ <property name="width">3</property>
+ </packing>
+ </child>
+ <child>
<placeholder/>
</child>
<child>
More information about the Libreoffice-commits
mailing list