Resolves: tdf#106838 icon set not visible in conditional formatting
Change-Id: Ibafaa487d39a69bc7c5c150361368614c0d9e004
This commit is contained in:
@@ -1389,11 +1389,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);
|
||||
}
|
||||
|
||||
@@ -1461,6 +1465,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 ) );
|
||||
@@ -1475,12 +1480,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();
|
||||
}
|
||||
@@ -1498,6 +1500,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();
|
||||
@@ -1525,11 +1528,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();
|
||||
|
@@ -296,6 +296,8 @@ class ScIconSetFrmtEntry : public ScCondFrmtEntry
|
||||
// icon set ui elements
|
||||
VclPtr<ListBox> maLbIconSetType;
|
||||
|
||||
VclPtr<VclContainer> maIconParent;
|
||||
|
||||
typedef std::vector<VclPtr<ScIconSetFrmtDataEntry>> ScIconSetFrmtDataEntriesType;
|
||||
ScIconSetFrmtDataEntriesType maEntries;
|
||||
|
||||
|
@@ -409,6 +409,20 @@
|
||||
<property name="width">2</property>
|
||||
</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>
|
||||
|
Reference in New Issue
Block a user