[ Edit Chart ] -> [ Edit Object ]

This button was introduced in commit 376cd2ceae
  Author Muhammet Kara <muhammet.kara@collabora.com>
  Date   Wed Nov 20 15:30:01 2019 +0300
    Add Edit Chart button for online's mobile view

It is shown for any kind of OLE object, including Math. So make its text
more neutral.

Possibly it could make sense to construct the name from the OLE object's
proper name in a follow-up.

Change-Id: Ied2e9b10db3bcbfab4328a1f65f812cd52f85004
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133426
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski
2022-04-26 09:21:24 +03:00
parent beb462d12d
commit 42eeddb2e6
3 changed files with 14 additions and 14 deletions

View File

@@ -85,7 +85,7 @@ PosSizePropertyPanel::PosSizePropertyPanel(
mxAlignDispatch(new ToolbarUnoDispatcher(*mxAlignTbx, *m_xBuilder, rxFrame)), mxAlignDispatch(new ToolbarUnoDispatcher(*mxAlignTbx, *m_xBuilder, rxFrame)),
mxAlignTbx2(m_xBuilder->weld_toolbar("aligntoolbar2")), mxAlignTbx2(m_xBuilder->weld_toolbar("aligntoolbar2")),
mxAlignDispatch2(new ToolbarUnoDispatcher(*mxAlignTbx2, *m_xBuilder, rxFrame)), mxAlignDispatch2(new ToolbarUnoDispatcher(*mxAlignTbx2, *m_xBuilder, rxFrame)),
mxBtnEditChart(m_xBuilder->weld_button("btnEditChart")), mxBtnEditOLEObject(m_xBuilder->weld_button("btnEditObject")),
mpView(nullptr), mpView(nullptr),
mlOldWidth(1), mlOldWidth(1),
mlOldHeight(1), mlOldHeight(1),
@@ -157,7 +157,7 @@ PosSizePropertyPanel::~PosSizePropertyPanel()
mxArrangeDispatch2.reset(); mxArrangeDispatch2.reset();
mxArrangeTbx.reset(); mxArrangeTbx.reset();
mxArrangeTbx2.reset(); mxArrangeTbx2.reset();
mxBtnEditChart.reset(); mxBtnEditOLEObject.reset();
maTransfPosXControl.dispose(); maTransfPosXControl.dispose();
maTransfPosYControl.dispose(); maTransfPosYControl.dispose();
@@ -226,7 +226,7 @@ void PosSizePropertyPanel::Initialize()
pDrawingArea->set_size_request(aSize.Width(), aSize.Height()); pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
mxCtrlDial->Init(aSize); mxCtrlDial->Init(aSize);
mxBtnEditChart->connect_clicked( LINK( this, PosSizePropertyPanel, ClickChartEditHdl ) ); mxBtnEditOLEObject->connect_clicked( LINK( this, PosSizePropertyPanel, ClickObjectEditHdl ) );
SfxViewShell* pCurSh = SfxViewShell::Current(); SfxViewShell* pCurSh = SfxViewShell::Current();
if ( pCurSh ) if ( pCurSh )
@@ -273,7 +273,7 @@ void PosSizePropertyPanel::HandleContextChange(
bool bShowPosition = false; bool bShowPosition = false;
bool bShowAngle = false; bool bShowAngle = false;
bool bShowFlip = false; bool bShowFlip = false;
bool bShowEditChart = false; bool bShowEditObject = false;
bool bShowArrangeTbx2 = false; bool bShowArrangeTbx2 = false;
switch (maContext.GetCombinedContext_DI()) switch (maContext.GetCombinedContext_DI())
@@ -302,13 +302,13 @@ void PosSizePropertyPanel::HandleContextChange(
break; break;
case CombinedEnumContext(Application::WriterVariants, Context::OLE): case CombinedEnumContext(Application::WriterVariants, Context::OLE):
bShowEditChart = true; bShowEditObject = true;
break; break;
case CombinedEnumContext(Application::Calc, Context::OLE): case CombinedEnumContext(Application::Calc, Context::OLE):
case CombinedEnumContext(Application::DrawImpress, Context::OLE): case CombinedEnumContext(Application::DrawImpress, Context::OLE):
bShowPosition = true; bShowPosition = true;
bShowEditChart = true; bShowEditObject = true;
break; break;
case CombinedEnumContext(Application::Calc, Context::Chart): case CombinedEnumContext(Application::Calc, Context::Chart):
@@ -338,8 +338,8 @@ void PosSizePropertyPanel::HandleContextChange(
mxFtFlip->set_visible(bShowFlip); mxFtFlip->set_visible(bShowFlip);
mxFlipTbx->set_visible(bShowFlip); mxFlipTbx->set_visible(bShowFlip);
// Edit Chart // Edit Object
mxBtnEditChart->set_visible(bShowEditChart); mxBtnEditOLEObject->set_visible(bShowEditObject);
// Arrange tool bar 2 // Arrange tool bar 2
mxArrangeTbx2->set_visible(bShowArrangeTbx2); mxArrangeTbx2->set_visible(bShowArrangeTbx2);
@@ -452,7 +452,7 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, RotationHdl, DialControl&, void )
SfxCallMode::RECORD, { &aAngleItem, &aRotXItem, &aRotYItem }); SfxCallMode::RECORD, { &aAngleItem, &aRotXItem, &aRotYItem });
} }
IMPL_STATIC_LINK_NOARG( PosSizePropertyPanel, ClickChartEditHdl, weld::Button&, void ) IMPL_STATIC_LINK_NOARG( PosSizePropertyPanel, ClickObjectEditHdl, weld::Button&, void )
{ {
SfxViewShell* pCurSh = SfxViewShell::Current(); SfxViewShell* pCurSh = SfxViewShell::Current();
if ( pCurSh) if ( pCurSh)

View File

@@ -114,8 +114,8 @@ private:
std::unique_ptr<weld::Toolbar> mxAlignTbx2; std::unique_ptr<weld::Toolbar> mxAlignTbx2;
std::unique_ptr<ToolbarUnoDispatcher> mxAlignDispatch2; std::unique_ptr<ToolbarUnoDispatcher> mxAlignDispatch2;
//edit charts button for online's mobile view //edit objects button for online's mobile view
std::unique_ptr<weld::Button> mxBtnEditChart; std::unique_ptr<weld::Button> mxBtnEditOLEObject;
// Internal variables // Internal variables
basegfx::B2DRange maRect; basegfx::B2DRange maRect;
@@ -161,7 +161,7 @@ private:
DECL_LINK( ChangeHeightHdl, weld::MetricSpinButton&, void ); DECL_LINK( ChangeHeightHdl, weld::MetricSpinButton&, void );
DECL_LINK( ClickAutoHdl, weld::Toggleable&, void ); DECL_LINK( ClickAutoHdl, weld::Toggleable&, void );
DECL_LINK( RotationHdl, svx::DialControl&, void ); DECL_LINK( RotationHdl, svx::DialControl&, void );
DECL_STATIC_LINK( PosSizePropertyPanel, ClickChartEditHdl, weld::Button&, void ); DECL_STATIC_LINK( PosSizePropertyPanel, ClickObjectEditHdl, weld::Button&, void );
void Initialize(); void Initialize();
void executeSize(); void executeSize();

View File

@@ -445,8 +445,8 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<child> <child>
<object class="GtkButton" id="btnEditChart"> <object class="GtkButton" id="btnEditObject">
<property name="label" translatable="yes" context="sidebarpossize|btnEditChart">Edit Chart</property> <property name="label" translatable="yes" context="sidebarpossize|btnEditObject">Edit Object</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="valign">start</property> <property name="valign">start</property>