Kaydet (Commit) 6b4ea2d8 authored tarafından Caolán McNamara's avatar Caolán McNamara

tdf#122527 dot symbols in chart menubutton not working

a few problems here

*) each symbol was drawn on top of the previous one instead of clearing it
*) some spurious placeholder text in the menu entry
*) m_nSymbolType not set correctly on activation of a submenu entry
*) under gtk3 adding entries to the submenus didn't inform the
   menubutton of their addition
*) we can drop m_xMenu because set_item_sensitive can be used
   instead, which didn't exist at the initial time of writing

Change-Id: Id339992c4192f3782fddfd56cb3e9b67cfcbe2a2
Reviewed-on: https://gerrit.libreoffice.org/65977
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 79358a75
......@@ -148,7 +148,6 @@ private:
std::unique_ptr<weld::MetricSpinButton> m_xMtrEndWidth;
std::unique_ptr<weld::CheckButton> m_xTsbCenterEnd;
std::unique_ptr<weld::CheckButton> m_xCbxSynchronize;
std::unique_ptr<weld::Menu> m_xMenu;
std::unique_ptr<weld::Menu> m_xGalleryMenu;
std::unique_ptr<weld::Menu> m_xSymbolsMenu;
std::unique_ptr<weld::CustomWeld> m_xCtlPreview;
......
......@@ -108,7 +108,6 @@ SvxLineTabPage::SvxLineTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs
, m_xMtrEndWidth(m_xBuilder->weld_metric_spin_button("MTR_FLD_END_WIDTH", FieldUnit::CM))
, m_xTsbCenterEnd(m_xBuilder->weld_check_button("TSB_CENTER_END"))
, m_xCbxSynchronize(m_xBuilder->weld_check_button("CBX_SYNCHRONIZE"))
, m_xMenu(m_xBuilder->weld_menu("menuSELECT"))
, m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "CTL_PREVIEW", m_aCtlPreview))
, m_xFLEdgeStyle(m_xBuilder->weld_widget("FL_EDGE_STYLE"))
, m_xGridEdgeCaps(m_xBuilder->weld_widget("gridEDGE_CAPS"))
......@@ -1410,7 +1409,7 @@ IMPL_LINK_NOARG(SvxLineTabPage, MenuCreateHdl_Impl, weld::ToggleButton&, void)
aBitmap.Scale(nScale, nScale);
}
pVD->SetOutputSizePixel(aBitmap.GetSizePixel(), false);
pVD->SetOutputSizePixel(aBitmap.GetSizePixel());
pVD->DrawBitmapEx(Point(), aBitmap);
m_xGalleryMenu->append(pInfo->sItemId, *pUIName, *pVD);
}
......@@ -1422,7 +1421,7 @@ IMPL_LINK_NOARG(SvxLineTabPage, MenuCreateHdl_Impl, weld::ToggleButton&, void)
}
if (m_aGrfNames.empty())
m_xMenu->set_sensitive("gallery", false);
m_xSymbolMB->set_item_sensitive("gallery", false);
}
if (!m_xSymbolsMenu && m_pSymbolList)
......@@ -1494,15 +1493,15 @@ IMPL_LINK_NOARG(SvxLineTabPage, MenuCreateHdl_Impl, weld::ToggleButton&, void)
double(MAX_BMP_HEIGHT) / static_cast<double>(aSize.Height());
aBitmapEx.Scale(nScale, nScale);
}
pVD->SetOutputSizePixel(aBitmapEx.GetSizePixel(), false);
pVD->SetOutputSizePixel(aBitmapEx.GetSizePixel());
pVD->DrawBitmapEx(Point(), aBitmapEx);
m_xSymbolsMenu->append(pInfo->sItemId, "foo", *pVD);
m_xSymbolsMenu->append(pInfo->sItemId, "", *pVD);
}
pInvisibleSquare=pPage->RemoveObject(0);
SdrObject::Free(pInvisibleSquare);
if (m_aGrfNames.empty())
m_xMenu->set_sensitive("symbols", false);
m_xSymbolMB->set_item_sensitive("symbols", false);
}
}
}
......@@ -1522,10 +1521,12 @@ IMPL_LINK(SvxLineTabPage, GraphicHdl_Impl, const OString&, rIdent, void)
{
SvxBmpItemInfo* pInfo = m_aGalleryBrushItems[sNumber.toUInt32()].get();
pGraphic = pInfo->pBrushItem->GetGraphic();
m_nSymbolType = SVX_SYMBOLTYPE_BRUSHITEM;
}
else if (rIdent.startsWith("symbol", &sNumber))
{
SvxBmpItemInfo* pInfo = m_aSymbolBrushItems[sNumber.toUInt32()].get();
m_nSymbolType = sNumber.toUInt32();
SvxBmpItemInfo* pInfo = m_aSymbolBrushItems[m_nSymbolType].get();
pGraphic = pInfo->pBrushItem->GetGraphic();
}
else if (rIdent == "automatic")
......@@ -1559,7 +1560,7 @@ IMPL_LINK(SvxLineTabPage, GraphicHdl_Impl, const OString&, rIdent, void)
return;
}
if(pGraphic)
if (pGraphic)
{
Size aSize = SvxNumberFormat::GetGraphicSizeMM100(pGraphic);
aSize = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(m_ePoolUnit));
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment