Kaydet (Commit) 565a254a authored tarafından Caolán McNamara's avatar Caolán McNamara

weld ScNameDlg

Change-Id: I7a00dd386a1cb52e046d0f57c77fe3fdf8252bb7
Reviewed-on: https://gerrit.libreoffice.org/70548
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 92b25179
......@@ -1435,6 +1435,7 @@ public:
virtual void set_label(const OUString& rText) = 0;
virtual OUString get_label() const = 0;
virtual void set_mnemonic_widget(Widget* pTarget) = 0;
virtual void set_error(bool bShowError) = 0;
};
class VCL_DLLPUBLIC TextView : virtual public Container
......
......@@ -33,28 +33,9 @@ class ScViewData;
class ScDocument;
//logic behind the manage names dialog
class ScNameDlg : public ScAnyRefDlg, public ScRangeManagerTable::InitListener
class ScNameDlg : public ScAnyRefDlgController
{
private:
VclPtr<Edit> m_pEdName;
VclPtr<formula::RefEdit> m_pEdAssign;
VclPtr<formula::RefButton> m_pRbAssign;
VclPtr<ListBox> m_pLbScope;
VclPtr<CheckBox> m_pBtnPrintArea;
VclPtr<CheckBox> m_pBtnColHeader;
VclPtr<CheckBox> m_pBtnCriteria;
VclPtr<CheckBox> m_pBtnRowHeader;
VclPtr<PushButton> m_pBtnAdd;
VclPtr<PushButton> m_pBtnDelete;
VclPtr<PushButton> m_pBtnOk;
VclPtr<PushButton> m_pBtnCancel;
VclPtr<FixedText> m_pFtInfo;
VclPtr<ScRangeManagerTable> m_pRangeManagerTable;
const OUString maGlobalNameStr;
const OUString maErrInvalidNameStr;
const OUString maErrNameInUse;
......@@ -74,6 +55,28 @@ private:
RangeNameContainer m_RangeMap;
std::unique_ptr<weld::Entry> m_xEdName;
std::unique_ptr<weld::Label> m_xFtAssign;
std::unique_ptr<formula::WeldRefEdit> m_xEdAssign;
std::unique_ptr<formula::WeldRefButton> m_xRbAssign;
std::unique_ptr<weld::ComboBox> m_xLbScope;
std::unique_ptr<weld::CheckButton> m_xBtnPrintArea;
std::unique_ptr<weld::CheckButton> m_xBtnColHeader;
std::unique_ptr<weld::CheckButton> m_xBtnCriteria;
std::unique_ptr<weld::CheckButton> m_xBtnRowHeader;
std::unique_ptr<weld::Button> m_xBtnAdd;
std::unique_ptr<weld::Button> m_xBtnDelete;
std::unique_ptr<weld::Button> m_xBtnOk;
std::unique_ptr<weld::Button> m_xBtnCancel;
std::unique_ptr<weld::Label> m_xFtInfo;
std::unique_ptr<weld::Expander> m_xExpander;
std::unique_ptr<RangeManagerTable> m_xRangeManagerTable;
private:
void Init();
void UpdateChecks(const ScRangeData* pData);
......@@ -87,41 +90,38 @@ private:
void AddPushed();
void RemovePushed();
void CancelPushed();
void ScopeChanged();
void NameModified();
void SelectionChanged();
// Handler:
DECL_LINK( OkBtnHdl, Button*, void );
DECL_LINK( CancelBtnHdl, Button*, void );
DECL_LINK( AddBtnHdl, Button*, void );
DECL_LINK( RemoveBtnHdl, Button*, void );
DECL_LINK( EdModifyHdl, Edit&, void );
DECL_LINK( EdModifyCheckBoxHdl, CheckBox&, void );
DECL_LINK( AssignGetFocusHdl, Control&, void );
DECL_LINK( SelectionChangedHdl_Impl, SvTreeListBox*, void );
DECL_LINK( ScopeChangedHdl, ListBox&, void );
DECL_LINK( OkBtnHdl, weld::Button&, void );
DECL_LINK( CancelBtnHdl, weld::Button&, void );
DECL_LINK( AddBtnHdl, weld::Button&, void );
DECL_LINK( RemoveBtnHdl, weld::Button&, void );
DECL_LINK( EdModifyHdl, weld::Entry&, void );
DECL_LINK( RefEdModifyHdl, formula::WeldRefEdit&, void );
DECL_LINK( EdModifyCheckBoxHdl, weld::ToggleButton&, void );
DECL_LINK( AssignGetFocusHdl, formula::WeldRefEdit&, void );
DECL_LINK( SelectionChangedHdl_Impl, weld::TreeView&, void );
DECL_LINK( ScopeChangedHdl, weld::ComboBox&, void );
protected:
virtual void RefInputDone( bool bForced = false ) override;
public:
ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
ScViewData* ptrViewData,
const ScAddress& aCursorPos,
std::map<OUString, std::unique_ptr<ScRangeName>>* pRangeMap = nullptr);
ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
ScViewData* ptrViewData,
const ScAddress& aCursorPos,
std::map<OUString, std::unique_ptr<ScRangeName>>* pRangeMap = nullptr);
virtual ~ScNameDlg() override;
virtual void dispose() override;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) override;
virtual bool IsRefInputMode() const override;
virtual void SetActive() override;
virtual bool Close() override;
virtual void tableInitialized() override;
virtual void Close() override;
void GetRangeNames(std::map<OUString, std::unique_ptr<ScRangeName>>& rRangeMap);
void SetEntry(const OUString& rName, const OUString& rScope);
......
......@@ -106,7 +106,6 @@ private:
void GetLine(ScRangeNameLine& aLine, weld::TreeIter& rEntry);
void Init();
void CheckForFormulaString();
const ScRangeData* findRangeData(const ScRangeNameLine& rLine);
DECL_LINK(SizeAllocHdl, const Size&, void);
......@@ -117,9 +116,19 @@ public:
const std::map<OUString, std::unique_ptr<ScRangeName>>& rTabRangeNames,
const ScAddress& rPos);
void CheckForFormulaString();
int n_children() const { return m_xTreeView->n_children(); }
void connect_changed(const Link<weld::TreeView&, void>& rLink) { m_xTreeView->connect_changed(rLink); }
void set_cursor(int nPos) { m_xTreeView->set_cursor(nPos); }
void addEntry(const ScRangeNameLine& rLine, bool bSetCurEntry);
void DeleteSelectedEntries();
void SetEntry( const ScRangeNameLine& rLine );
void addEntry(const ScRangeNameLine& rLine);
void GetCurrentLine(ScRangeNameLine& rLine);
bool IsMultiSelection();
bool HasSelection();
std::vector<ScRangeNameLine> GetSelectedEntries();
};
......
......@@ -33,7 +33,18 @@
SFX_DECL_CHILDWINDOW_WITHID(Class); \
};
DECL_WRAPPER_WITHID(ScNameDlgWrapper)
#define DECL_WRAPPER_WITHID_CONTROLLER(Class) \
class Class : public SfxChildWindow \
{ \
public: \
Class( vcl::Window*, sal_uInt16, SfxBindings*, const SfxChildWinInfo* ); \
static std::unique_ptr<SfxChildWindow> CreateImpl(vcl::Window *pParent, sal_uInt16 nId, \
SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \
static void RegisterChildWindow (bool bVisible=false, SfxModule *pMod=nullptr, SfxChildWindowFlags nFlags=SfxChildWindowFlags::NONE); \
static sal_uInt16 GetChildWindowId ();\
};
DECL_WRAPPER_WITHID_CONTROLLER(ScNameDlgWrapper)
DECL_WRAPPER_WITHID(ScNameDefDlgWrapper)
DECL_WRAPPER_WITHID(ScSolverDlgWrapper)
DECL_WRAPPER_WITHID(ScOptSolverDlgWrapper)
......
......@@ -379,6 +379,7 @@ public:
// ugly hack to call Define Names from Manage Names
void SwitchBetweenRefDialogs(SfxModelessDialog* pDialog);
void SwitchBetweenRefDialogControllers(SfxModelessDialogController* pDialog);
// #i123629#
bool GetForceFocusOnCurCell() const { return bForceFocusOnCurCell; }
void SetForceFocusOnCurCell(bool bFlag) { bForceFocusOnCurCell=bFlag; }
......
......@@ -134,6 +134,13 @@ void ScRangeManagerTable::GetCurrentLine(ScRangeNameLine& rLine)
GetLine(rLine, pCurrentEntry);
}
void RangeManagerTable::GetCurrentLine(ScRangeNameLine& rLine)
{
std::unique_ptr<weld::TreeIter> xCurrentEntry(m_xTreeView->make_iterator());
if (m_xTreeView->get_cursor(xCurrentEntry.get()))
GetLine(rLine, *xCurrentEntry);
}
void ScRangeManagerTable::GetLine(ScRangeNameLine& rLine, SvTreeListEntry* pEntry)
{
rLine.aName = GetEntryText( pEntry, 0);
......@@ -200,11 +207,24 @@ void ScRangeManagerTable::DeleteSelectedEntries()
RemoveSelection();
}
void RangeManagerTable::DeleteSelectedEntries()
{
std::vector<int> aRows = m_xTreeView->get_selected_rows();
std::sort(aRows.begin(), aRows.end());
for (auto it = aRows.rbegin(); it != aRows.rend(); ++it)
m_xTreeView->remove(*it);
}
bool ScRangeManagerTable::IsMultiSelection()
{
return GetSelectionCount() > 1;
}
bool RangeManagerTable::IsMultiSelection()
{
return m_xTreeView->count_selected_rows() > 1;
}
std::vector<ScRangeNameLine> ScRangeManagerTable::GetSelectedEntries()
{
std::vector<ScRangeNameLine> aSelectedEntries;
......@@ -236,6 +256,18 @@ void ScRangeManagerTable::SetEntry(const ScRangeNameLine& rLine)
}
}
void RangeManagerTable::SetEntry(const ScRangeNameLine& rLine)
{
for (int i = 0, nEntryCount = m_xTreeView->n_children(); i < nEntryCount; ++i)
{
if (rLine.aName == m_xTreeView->get_text(i, 0) &&
rLine.aScope == m_xTreeView->get_text(i, 2))
{
m_xTreeView->set_cursor(i);
}
}
}
namespace {
//ensure that the minimum column size is respected
......@@ -367,7 +399,7 @@ IMPL_LINK_NOARG(RangeManagerTable, SizeAllocHdl, const Size&, void)
CheckForFormulaString();
}
void RangeManagerTable::addEntry(const ScRangeNameLine& rLine)
void RangeManagerTable::addEntry(const ScRangeNameLine& rLine, bool bSetCurEntry)
{
int nRow = m_xTreeView->n_children();
m_xTreeView->append();
......@@ -376,6 +408,8 @@ void RangeManagerTable::addEntry(const ScRangeNameLine& rLine)
m_xTreeView->set_text(nRow, rLine.aScope, 2);
// just unique to track which one has been cached by maCalculatedFormulaEntries
m_xTreeView->set_id(nRow, OUString::number(m_nId++));
if (bSetCurEntry)
m_xTreeView->set_cursor(nRow);
}
void RangeManagerTable::GetLine(ScRangeNameLine& rLine, weld::TreeIter& rEntry)
......@@ -402,7 +436,7 @@ void RangeManagerTable::Init()
if (!rEntry.second->HasType(ScRangeData::Type::Database))
{
aLine.aName = rEntry.second->GetName();
addEntry(aLine);
addEntry(aLine, false);
}
}
}
......
......@@ -32,7 +32,7 @@
#include <scres.hrc>
#include <validate.hxx>
SFX_IMPL_MODELESSDIALOG_WITHID(ScNameDlgWrapper, FID_DEFINE_NAME )
SFX_IMPL_CHILDWINDOW_WITHID(ScNameDlgWrapper, FID_DEFINE_NAME)
SFX_IMPL_MODELESSDIALOG_WITHID(ScNameDefDlgWrapper, FID_ADD_NAME )
SFX_IMPL_MODELESSDIALOG_WITHID(ScSolverDlgWrapper, SID_OPENDLG_SOLVE )
SFX_IMPL_MODELESSDIALOG_WITHID(ScOptSolverDlgWrapper, SID_OPENDLG_OPTSOLVER )
......@@ -97,7 +97,31 @@ namespace
pViewShell->GetViewFrame()->SetChildWindow( nId, false ); \
}
IMPL_CHILD_CTOR( ScNameDlgWrapper, FID_DEFINE_NAME )
#define IMPL_CONTROLLER_CHILD_CTOR(Class,sid) \
Class::Class( vcl::Window* pParentP, \
sal_uInt16 nId, \
SfxBindings* p, \
const SfxChildWinInfo* pInfo ) \
: SfxChildWindow(pParentP, nId) \
{ \
/************************************************************************************/\
/* When a new document is creating, the SfxViewFrame may be ready, */\
/* But the ScTabViewShell may have not been activated yet. In this */\
/* situation, SfxViewShell::Current() does not get the correct shell, */\
/* and we should lcl_GetTabViewShell( p ) instead of SfxViewShell::Current() */\
/************************************************************************************/\
ScTabViewShell* pViewShell = lcl_GetTabViewShell( p ); \
if (!pViewShell) \
pViewShell = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() ); \
OSL_ENSURE( pViewShell, "missing view shell :-(" ); \
SetController( pViewShell ? \
pViewShell->CreateRefDialogController( p, this, pInfo, pParentP->GetFrameWeld(), sid ) : nullptr ); \
if (pViewShell && !GetController()) \
pViewShell->GetViewFrame()->SetChildWindow( nId, false ); \
}
IMPL_CONTROLLER_CHILD_CTOR( ScNameDlgWrapper, FID_DEFINE_NAME )
IMPL_CHILD_CTOR( ScNameDefDlgWrapper, FID_ADD_NAME )
......
......@@ -92,22 +92,27 @@ void ScTabViewShell::SetCurRefDlgId( sal_uInt16 nNew )
void ScTabViewShell::SwitchBetweenRefDialogs(SfxModelessDialog* pDialog)
{
sal_uInt16 nSlotId = SC_MOD()->GetCurRefDlgId();
if (nSlotId == FID_DEFINE_NAME)
if( nSlotId == FID_ADD_NAME )
{
mbInSwitch = true;
static_cast<ScNameDlg*>(pDialog)->GetRangeNames(m_RangeMap);
static_cast<ScNameDlg*>(pDialog)->Close();
sal_uInt16 nId = ScNameDefDlgWrapper::GetChildWindowId();
static_cast<ScNameDefDlg*>(pDialog)->GetNewData(maName, maScope);
static_cast<ScNameDefDlg*>(pDialog)->Close();
sal_uInt16 nId = ScNameDlgWrapper::GetChildWindowId();
SfxViewFrame* pViewFrm = GetViewFrame();
SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
SC_MOD()->SetRefDialog( nId, pWnd == nullptr );
}
else if( nSlotId == FID_ADD_NAME )
}
void ScTabViewShell::SwitchBetweenRefDialogControllers(SfxModelessDialogController* pDialog)
{
sal_uInt16 nSlotId = SC_MOD()->GetCurRefDlgId();
if (nSlotId == FID_DEFINE_NAME)
{
static_cast<ScNameDefDlg*>(pDialog)->GetNewData(maName, maScope);
mbInSwitch = true;
static_cast<ScNameDlg*>(pDialog)->GetRangeNames(m_RangeMap);
static_cast<ScNameDlg*>(pDialog)->Close();
sal_uInt16 nId = ScNameDlgWrapper::GetChildWindowId();
sal_uInt16 nId = ScNameDefDlgWrapper::GetChildWindowId();
SfxViewFrame* pViewFrm = GetViewFrame();
SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
......@@ -144,27 +149,6 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
switch( nSlotId )
{
case FID_DEFINE_NAME:
{
if (!mbInSwitch)
{
pResult = VclPtr<ScNameDlg>::Create( pB, pCW, pParent, &GetViewData(),
ScAddress( GetViewData().GetCurX(),
GetViewData().GetCurY(),
GetViewData().GetTabNo() ) );
}
else
{
pResult = VclPtr<ScNameDlg>::Create( pB, pCW, pParent, &GetViewData(),
ScAddress( GetViewData().GetCurX(),
GetViewData().GetCurY(),
GetViewData().GetTabNo() ), &m_RangeMap);
static_cast<ScNameDlg*>(pResult.get())->SetEntry( maName, maScope);
mbInSwitch = false;
}
}
break;
case FID_ADD_NAME:
{
if (!mbInSwitch)
......@@ -462,70 +446,64 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
switch( nSlotId )
{
case SID_CORRELATION_DIALOG:
{
xResult.reset(new ScCorrelationDialog(pB, pCW, pParent, &GetViewData()));
}
break;
break;
case SID_SAMPLING_DIALOG:
{
xResult.reset(new ScSamplingDialog(pB, pCW, pParent, &GetViewData()));
}
break;
break;
case SID_DESCRIPTIVE_STATISTICS_DIALOG:
{
xResult.reset(new ScDescriptiveStatisticsDialog(pB, pCW, pParent, &GetViewData()));
}
break;
break;
case SID_ANALYSIS_OF_VARIANCE_DIALOG:
{
xResult.reset(new ScAnalysisOfVarianceDialog(pB, pCW, pParent, &GetViewData()));
}
break;
break;
case SID_COVARIANCE_DIALOG:
{
xResult.reset(new ScCovarianceDialog(pB, pCW, pParent, &GetViewData()));
}
break;
break;
case SID_EXPONENTIAL_SMOOTHING_DIALOG:
{
xResult.reset(new ScExponentialSmoothingDialog(pB, pCW, pParent, &GetViewData()));
}
break;
break;
case SID_MOVING_AVERAGE_DIALOG:
{
xResult.reset(new ScMovingAverageDialog(pB, pCW, pParent, &GetViewData()));
}
break;
break;
case SID_REGRESSION_DIALOG:
{
xResult.reset(new ScRegressionDialog(pB, pCW, pParent, &GetViewData()));
}
break;
break;
case SID_FTEST_DIALOG:
{
xResult.reset(new ScFTestDialog(pB, pCW, pParent, &GetViewData()));
}
break;
break;
case SID_TTEST_DIALOG:
{
xResult.reset(new ScTTestDialog(pB, pCW, pParent, &GetViewData()));
}
break;
break;
case SID_ZTEST_DIALOG:
{
xResult.reset(new ScZTestDialog(pB, pCW, pParent, &GetViewData()));
}
break;
break;
case SID_CHI_SQUARE_TEST_DIALOG:
{
xResult.reset(new ScChiSquareTestDialog(pB, pCW, pParent, &GetViewData()));
}
break;
break;
case SID_FOURIER_ANALYSIS_DIALOG:
{
xResult.reset(new ScFourierAnalysisDialog(pB, pCW, pParent, &GetViewData()));
break;
case FID_DEFINE_NAME:
{
if (!mbInSwitch)
{
xResult.reset(new ScNameDlg(pB, pCW, pParent, &GetViewData(),
ScAddress( GetViewData().GetCurX(),
GetViewData().GetCurY(),
GetViewData().GetTabNo() ) ));
}
else
{
xResult.reset(new ScNameDlg( pB, pCW, pParent, &GetViewData(),
ScAddress( GetViewData().GetCurX(),
GetViewData().GetCurY(),
GetViewData().GetTabNo() ), &m_RangeMap));
static_cast<ScNameDlg*>(xResult.get())->SetEntry(maName, maScope);
mbInSwitch = false;
}
break;
}
break;
}
if (xResult)
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
<requires lib="0" version="0.0"/>
<requires lib="LibreOffice" version="1.0"/>
<object class="GtkTreeStore" id="liststore1">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
<!-- column-name text2 -->
<column type="gchararray"/>
<!-- column-name text1 -->
<column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkDialog" id="ManageNamesDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="managenamesdialog|ManageNamesDialog">Manage Names</property>
<property name="resizable">False</property>
<property name="default_width">0</property>
<property name="default_height">0</property>
<property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
......@@ -85,13 +101,65 @@
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="svtlo-SvSimpleTableContainer" id="names">
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="Simple Table Container-selection1"/>
<property name="shadow_type">in</property>
<child>
<object class="GtkTreeView" id="names">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="model">liststore1</property>
<property name="search_column">0</property>
<property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="Macro Library List-selection1"/>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<property name="resizable">True</property>
<property name="spacing">6</property>
<property name="title" translatable="yes" context="managenamesdialog|name">Name</property>
<child>
<object class="GtkCellRendererText" id="cellrenderer1"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn2">
<property name="resizable">True</property>
<property name="spacing">6</property>
<property name="title" translatable="yes" context="managenamesdialog|expression">Range or formula expression</property>
<child>
<object class="GtkCellRendererText" id="cellrenderer2"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn3">
<property name="resizable">True</property>
<property name="spacing">6</property>
<property name="title" translatable="yes" context="managenamesdialog|scope">Scope</property>
<child>
<object class="GtkCellRendererText" id="cellrenderer3"/>
<attributes>
<attribute name="text">2</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
......@@ -174,10 +242,11 @@
<property name="hexpand">True</property>
<property name="spacing">6</property>
<child>
<object class="foruilo-RefEdit" id="range">
<object class="GtkEntry" id="range">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
<property name="width_chars">42</property>
</object>
<packing>
......@@ -187,7 +256,7 @@
</packing>
</child>
<child>
<object class="foruilo-RefButton" id="assign">
<object class="GtkButton" id="assign">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
......@@ -224,6 +293,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -388,11 +458,8 @@
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
<child>
<placeholder/>
</child>
</object>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<object class="GtkTreeViewColumn" id="treeviewcolumn4">
<property name="title" translatable="yes" context="managenamesdialog|treeviewcolumn1">column</property>
</object>
</interface>
......@@ -120,6 +120,7 @@ sc/uiconfig/scalc/ui/managenamesdialog.ui://svtlo-SvSimpleTableContainer[@id='na
sc/uiconfig/scalc/ui/managenamesdialog.ui://GtkLabel[@id='info'] orphan-label
sc/uiconfig/scalc/ui/managenamesdialog.ui://GtkLabel[@id='label2'] orphan-label
sc/uiconfig/scalc/ui/managenamesdialog.ui://GtkEntry[@id='name'] no-labelled-by
sc/uiconfig/scalc/ui/managenamesdialog.ui://GtkButton[@id='assign'] button-no-label
sc/uiconfig/scalc/ui/mergecellsdialog.ui://GtkLabel[@id='label'] orphan-label
sc/uiconfig/scalc/ui/mergecellsdialog.ui://GtkImage[@id='imMergeFirstCell'] no-labelled-by
sc/uiconfig/scalc/ui/mergecellsdialog.ui://GtkImage[@id='imMergeKeepHidden'] no-labelled-by
......
......@@ -3764,6 +3764,14 @@ public:
SalInstanceWidget* pTargetWidget = dynamic_cast<SalInstanceWidget*>(pTarget);
pLabel->set_mnemonic_widget(pTargetWidget ? pTargetWidget->getWidget() : nullptr);
}
virtual void set_error(bool bShowError) override
{
if (bShowError)
m_xLabel->SetControlBackground(m_xLabel->GetSettings().GetStyleSettings().GetHighlightColor());
else
m_xLabel->SetControlBackground();
}
};
class SalInstanceTextView : public SalInstanceContainer, public virtual weld::TextView
......
......@@ -7519,6 +7519,25 @@ public:
GtkInstanceWidget* pTargetWidget = dynamic_cast<GtkInstanceWidget*>(pTarget);
gtk_label_set_mnemonic_widget(m_pLabel, pTargetWidget ? pTargetWidget->getWidget() : nullptr);
}
virtual void set_error(bool bShowError) override
{
if (bShowError)
{
Color aColor(Application::GetSettings().GetStyleSettings().GetHighlightColor());
guint16 nRed = aColor.GetRed() << 8;
guint16 nGreen = aColor.GetRed() << 8;
guint16 nBlue = aColor.GetBlue() << 8;
PangoAttrList* pAttrs = pango_attr_list_new();
pango_attr_list_insert(pAttrs, pango_attr_background_new(nRed, nGreen, nBlue));
gtk_label_set_attributes(m_pLabel, pAttrs);
pango_attr_list_unref(pAttrs);
}
else
gtk_label_set_attributes(m_pLabel, nullptr);
}
};
class GtkInstanceTextView : public GtkInstanceContainer, public virtual weld::TextView
......
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