summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-09-29 14:06:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-09-30 18:14:25 +0200
commit64d764e02a848ed243409092d3fdcb4775db5153 (patch)
tree0f9167eb3959b9365bc95925c69c99d70cbab6b3 /cui
parent20c6cff919e09bf3a42fa9e26cc3e7568743047d (diff)
weld SvxLineEndDefTabPage
Change-Id: I3e947511bbffae4cd48388b17a8fb9a13d453bab Reviewed-on: https://gerrit.libreoffice.org/61139 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/cfg.cxx4
-rw-r--r--cui/source/inc/cuitabline.hxx36
-rw-r--r--cui/source/tabpages/tplneend.cxx261
-rw-r--r--cui/uiconfig/ui/lineendstabpage.ui76
4 files changed, 184 insertions, 193 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 1bd2d5d970e6..e83774355db8 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1967,7 +1967,7 @@ IMPL_LINK_NOARG(SvxMainMenuOrganizerDialog, ModifyHdl, weld::Entry&, void)
const int nNewMenuPos = m_xMenuListBox->find_id(m_sNewMenuEntryId);
const int nOldSelection = m_xMenuListBox->get_selected_index();
m_xMenuListBox->remove(nNewMenuPos);
- m_xMenuListBox->insert(nNewMenuPos, m_sNewMenuEntryId, pNewEntryData->GetName(), nullptr);
+ m_xMenuListBox->insert(nNewMenuPos, m_sNewMenuEntryId, pNewEntryData->GetName(), nullptr, nullptr);
m_xMenuListBox->select(nOldSelection);
}
@@ -2005,7 +2005,7 @@ IMPL_LINK( SvxMainMenuOrganizerDialog, MoveHdl, weld::Button&, rButton, void )
OUString sId = m_xMenuListBox->get_id(nSourceEntry);
OUString sEntry = m_xMenuListBox->get_text(nSourceEntry);
m_xMenuListBox->remove(nSourceEntry);
- m_xMenuListBox->insert(nTargetEntry, sId, sEntry, nullptr);
+ m_xMenuListBox->insert(nTargetEntry, sId, sEntry, nullptr, nullptr);
m_xMenuListBox->select(nTargetEntry);
UpdateButtonStates();
diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx
index 28cdf1b4be41..c7e2431830e6 100644
--- a/cui/source/inc/cuitabline.hxx
+++ b/cui/source/inc/cuitabline.hxx
@@ -326,15 +326,6 @@ class SvxLineEndDefTabPage : public SfxTabPage
using TabPage::DeactivatePage;
private:
- VclPtr<Edit> m_pEdtName;
- VclPtr<LineEndLB> m_pLbLineEnds;
- VclPtr<PushButton> m_pBtnAdd;
- VclPtr<PushButton> m_pBtnModify;
- VclPtr<PushButton> m_pBtnDelete;
- VclPtr<PushButton> m_pBtnLoad;
- VclPtr<PushButton> m_pBtnSave;
- VclPtr<SvxXLinePreview> m_pCtlPreview;
-
const SfxItemSet& rOutAttrs;
const SdrObject* pPolyObj;
@@ -348,17 +339,28 @@ private:
sal_uInt16 nDlgType;
sal_Int32* pPosLineEndLb;
- DECL_LINK( ClickAddHdl_Impl, Button*, void );
- DECL_LINK( ClickModifyHdl_Impl, Button*, void );
- DECL_LINK( ClickDeleteHdl_Impl, Button*, void );
- DECL_LINK( ClickLoadHdl_Impl, Button*, void );
- DECL_LINK( ClickSaveHdl_Impl, Button*, void );
- DECL_LINK( SelectLineEndHdl_Impl, ListBox&, void );
-
+ XLinePreview m_aCtlPreview;
+ std::unique_ptr<weld::Entry> m_xEdtName;
+ std::unique_ptr<SvxLineEndLB> m_xLbLineEnds;
+ std::unique_ptr<weld::Button> m_xBtnAdd;
+ std::unique_ptr<weld::Button> m_xBtnModify;
+ std::unique_ptr<weld::Button> m_xBtnDelete;
+ std::unique_ptr<weld::Button> m_xBtnLoad;
+ std::unique_ptr<weld::Button> m_xBtnSave;
+ std::unique_ptr<weld::CustomWeld> m_xCtlPreview;
+
+ DECL_LINK(ClickAddHdl_Impl, weld::Button&, void);
+ DECL_LINK(ClickModifyHdl_Impl, weld::Button&, void);
+ DECL_LINK(ClickDeleteHdl_Impl, weld::Button&, void);
+ DECL_LINK(ClickLoadHdl_Impl, weld::Button&, void);
+ DECL_LINK(ClickSaveHdl_Impl, weld::Button&, void);
+ DECL_LINK(SelectLineEndHdl_Impl, weld::ComboBox&, void);
+
+ void SelectLineEndHdl_Impl();
void CheckChanges_Impl();
public:
- SvxLineEndDefTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ SvxLineEndDefTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
virtual ~SvxLineEndDefTabPage() override;
virtual void dispose() override;
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index 4f525e922563..4222266e3656 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -50,55 +50,44 @@
#define XOUT_WIDTH 150
-SvxLineEndDefTabPage::SvxLineEndDefTabPage
-(
- vcl::Window* pParent,
- const SfxItemSet& rInAttrs
-) :
-
- SfxTabPage( pParent
- , "LineEndPage"
- , "cui/ui/lineendstabpage.ui"
- , &rInAttrs ),
- rOutAttrs ( rInAttrs ),
- pPolyObj ( nullptr ),
-
- aXLineAttr ( rInAttrs.GetPool() ),
- rXLSet ( aXLineAttr.GetItemSet() ),
- pnLineEndListState ( nullptr ),
- pPageType ( nullptr ),
- nDlgType ( 0 ),
- pPosLineEndLb ( nullptr )
+SvxLineEndDefTabPage::SvxLineEndDefTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs)
+ : SfxTabPage(pParent , "cui/ui/lineendstabpage.ui", "LineEndPage", &rInAttrs)
+ , rOutAttrs(rInAttrs)
+ , pPolyObj(nullptr)
+ , aXLineAttr(rInAttrs.GetPool())
+ , rXLSet(aXLineAttr.GetItemSet())
+ , pnLineEndListState(nullptr)
+ , pPageType(nullptr)
+ , nDlgType(0)
+ , pPosLineEndLb(nullptr)
+ , m_xEdtName(m_xBuilder->weld_entry("EDT_NAME"))
+ , m_xLbLineEnds(new SvxLineEndLB(m_xBuilder->weld_combo_box("LB_LINEENDS")))
+ , m_xBtnAdd(m_xBuilder->weld_button("BTN_ADD"))
+ , m_xBtnModify(m_xBuilder->weld_button("BTN_MODIFY"))
+ , m_xBtnDelete(m_xBuilder->weld_button("BTN_DELETE"))
+ , m_xBtnLoad(m_xBuilder->weld_button("BTN_LOAD"))
+ , m_xBtnSave(m_xBuilder->weld_button("BTN_SAVE"))
+ , m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "CTL_PREVIEW", m_aCtlPreview))
{
- get(m_pEdtName,"EDT_NAME");
- get(m_pLbLineEnds,"LB_LINEENDS");
- get(m_pBtnAdd,"BTN_ADD");
- get(m_pBtnModify,"BTN_MODIFY");
- get(m_pBtnDelete,"BTN_DELETE");
- get(m_pBtnLoad,"BTN_LOAD");
- get(m_pBtnSave,"BTN_SAVE");
- get(m_pCtlPreview,"CTL_PREVIEW");
-
// this page needs ExchangeSupport
SetExchangeSupport();
rXLSet.Put( XLineStyleItem(css::drawing::LineStyle_SOLID) );
rXLSet.Put( XLineWidthItem(XOUT_WIDTH) );
rXLSet.Put( XLineColorItem( OUString(), COL_BLACK ) );
- rXLSet.Put( XLineStartWidthItem( m_pCtlPreview->GetOutputSize().Height() / 2 ) );
- rXLSet.Put( XLineEndWidthItem( m_pCtlPreview->GetOutputSize().Height() / 2 ) );
+ rXLSet.Put( XLineStartWidthItem( m_aCtlPreview.GetOutputSize().Height() / 2 ) );
+ rXLSet.Put( XLineEndWidthItem( m_aCtlPreview.GetOutputSize().Height() / 2 ) );
// #i34740#
- m_pCtlPreview->SetLineAttributes(aXLineAttr.GetItemSet());
-
- m_pBtnAdd->SetClickHdl( LINK( this, SvxLineEndDefTabPage, ClickAddHdl_Impl ) );
- m_pBtnModify->SetClickHdl( LINK( this, SvxLineEndDefTabPage, ClickModifyHdl_Impl ) );
- m_pBtnDelete->SetClickHdl( LINK( this, SvxLineEndDefTabPage, ClickDeleteHdl_Impl ) );
- m_pBtnLoad->SetClickHdl( LINK( this, SvxLineEndDefTabPage, ClickLoadHdl_Impl ) );
- m_pBtnSave->SetClickHdl( LINK( this, SvxLineEndDefTabPage, ClickSaveHdl_Impl ) );
+ m_aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet());
- m_pLbLineEnds->SetSelectHdl( LINK( this, SvxLineEndDefTabPage, SelectLineEndHdl_Impl ) );
+ m_xBtnAdd->connect_clicked(LINK(this, SvxLineEndDefTabPage, ClickAddHdl_Impl));
+ m_xBtnModify->connect_clicked(LINK( this, SvxLineEndDefTabPage, ClickModifyHdl_Impl));
+ m_xBtnDelete->connect_clicked(LINK( this, SvxLineEndDefTabPage, ClickDeleteHdl_Impl));
+ m_xBtnLoad->connect_clicked(LINK( this, SvxLineEndDefTabPage, ClickLoadHdl_Impl));
+ m_xBtnSave->connect_clicked(LINK( this, SvxLineEndDefTabPage, ClickSaveHdl_Impl));
+ m_xLbLineEnds->connect_changed(LINK(this, SvxLineEndDefTabPage, SelectLineEndHdl_Impl));
}
SvxLineEndDefTabPage::~SvxLineEndDefTabPage()
@@ -108,28 +97,21 @@ SvxLineEndDefTabPage::~SvxLineEndDefTabPage()
void SvxLineEndDefTabPage::dispose()
{
- m_pEdtName.clear();
- m_pLbLineEnds.clear();
- m_pBtnAdd.clear();
- m_pBtnModify.clear();
- m_pBtnDelete.clear();
- m_pBtnLoad.clear();
- m_pBtnSave.clear();
- m_pCtlPreview.clear();
+ m_xCtlPreview.reset();
+ m_xLbLineEnds.reset();
SfxTabPage::dispose();
}
void SvxLineEndDefTabPage::Resize()
{
- rXLSet.Put(XLineStartWidthItem(m_pCtlPreview->GetOutputSize().Height() / 2 ));
- rXLSet.Put(XLineEndWidthItem(m_pCtlPreview->GetOutputSize().Height() / 2 ));
+ rXLSet.Put(XLineStartWidthItem(m_aCtlPreview.GetOutputSize().Height() / 2));
+ rXLSet.Put(XLineEndWidthItem(m_aCtlPreview.GetOutputSize().Height() / 2));
SfxTabPage::Resize();
}
-
void SvxLineEndDefTabPage::Construct()
{
- m_pLbLineEnds->Fill( pLineEndList );
+ m_xLbLineEnds->Fill( pLineEndList );
bool bCreateArrowPossible = true;
@@ -150,10 +132,9 @@ void SvxLineEndDefTabPage::Construct()
}
if( !bCreateArrowPossible )
- m_pBtnAdd->Disable();
+ m_xBtnAdd->set_sensitive(false);
}
-
void SvxLineEndDefTabPage::ActivatePage( const SfxItemSet& )
{
if( nDlgType == 0 ) // area dialog
@@ -161,17 +142,17 @@ void SvxLineEndDefTabPage::ActivatePage( const SfxItemSet& )
// ActivatePage() is called before the dialog receives PageCreated() !!!
if( pLineEndList.is() )
{
- if( *pPosLineEndLb != LISTBOX_ENTRY_NOTFOUND )
+ if( *pPosLineEndLb != -1)
{
- m_pLbLineEnds->SelectEntryPos( *pPosLineEndLb );
- SelectLineEndHdl_Impl( *m_pLbLineEnds );
+ m_xLbLineEnds->set_active(*pPosLineEndLb);
+ SelectLineEndHdl_Impl();
}
INetURLObject aURL( pLineEndList->GetPath() );
aURL.Append( pLineEndList->GetName() );
DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
*pPageType = PageType::Area; // 3
- *pPosLineEndLb = LISTBOX_ENTRY_NOTFOUND;
+ *pPosLineEndLb = -1;
}
}
}
@@ -190,23 +171,23 @@ DeactivateRC SvxLineEndDefTabPage::DeactivatePage( SfxItemSet* _pSet )
void SvxLineEndDefTabPage::CheckChanges_Impl()
{
- sal_Int32 nPos = m_pLbLineEnds->GetSelectedEntryPos();
+ int nPos = m_xLbLineEnds->get_active();
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ if (nPos != -1)
{
- OUString aString = m_pEdtName->GetText();
+ OUString aString = m_xEdtName->get_text();
- if( aString != m_pLbLineEnds->GetSelectedEntry() )
+ if( aString != m_xLbLineEnds->get_active_text() )
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querychangelineenddialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/querychangelineenddialog.ui"));
std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskChangeLineEndDialog"));
if (xQueryBox->run() == RET_YES)
- ClickModifyHdl_Impl( nullptr );
+ ClickModifyHdl_Impl(*m_xBtnModify);
}
}
- nPos = m_pLbLineEnds->GetSelectedEntryPos();
+ nPos = m_xLbLineEnds->get_active();
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ if (nPos != -1)
*pPosLineEndLb = nPos;
}
@@ -219,7 +200,7 @@ bool SvxLineEndDefTabPage::FillItemSet( SfxItemSet* rSet )
{
CheckChanges_Impl();
- long nPos = m_pLbLineEnds->GetSelectedEntryPos();
+ int nPos = m_xLbLineEnds->get_active();
const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nPos);
rSet->Put( XLineStartItem( pEntry->GetName(), pEntry->GetLineEnd() ) );
@@ -229,68 +210,63 @@ bool SvxLineEndDefTabPage::FillItemSet( SfxItemSet* rSet )
return true;
}
-
void SvxLineEndDefTabPage::Reset( const SfxItemSet* )
{
- m_pLbLineEnds->SelectEntryPos( 0 );
+ m_xLbLineEnds->set_active(0);
// Update lineend
if( pLineEndList->Count() > 0 )
{
- int nPos = m_pLbLineEnds->GetSelectedEntryPos();
+ int nPos = m_xLbLineEnds->get_active();
const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nPos);
- m_pEdtName->SetText( m_pLbLineEnds->GetSelectedEntry() );
+ m_xEdtName->set_text(m_xLbLineEnds->get_active_text());
rXLSet.Put( XLineStartItem( OUString(), pEntry->GetLineEnd() ) );
rXLSet.Put( XLineEndItem( OUString(), pEntry->GetLineEnd() ) );
// #i34740#
- m_pCtlPreview->SetLineAttributes(aXLineAttr.GetItemSet());
-
- m_pCtlPreview->Invalidate();
+ m_aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet());
+ m_aCtlPreview.Invalidate();
}
// determine button state
if( pLineEndList->Count() )
{
- m_pBtnModify->Enable();
- m_pBtnDelete->Enable();
- m_pBtnSave->Enable();
+ m_xBtnModify->set_sensitive(true);
+ m_xBtnDelete->set_sensitive(true);
+ m_xBtnSave->set_sensitive(true);
}
else
{
- m_pBtnModify->Disable();
- m_pBtnDelete->Disable();
- m_pBtnSave->Disable();
+ m_xBtnModify->set_sensitive(false);
+ m_xBtnDelete->set_sensitive(false);
+ m_xBtnSave->set_sensitive(false);
}
}
-
-VclPtr<SfxTabPage> SvxLineEndDefTabPage::Create( TabPageParent pWindow, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxLineEndDefTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
{
- return VclPtr<SvxLineEndDefTabPage>::Create( pWindow.pParent, *rSet );
+ return VclPtr<SvxLineEndDefTabPage>::Create(pParent, *rSet );
}
-
-IMPL_LINK_NOARG(SvxLineEndDefTabPage, SelectLineEndHdl_Impl, ListBox&, void)
+void SvxLineEndDefTabPage::SelectLineEndHdl_Impl()
{
if( pLineEndList->Count() > 0 )
{
- int nPos = m_pLbLineEnds->GetSelectedEntryPos();
+ int nPos = m_xLbLineEnds->get_active();
const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nPos);
- m_pEdtName->SetText( m_pLbLineEnds->GetSelectedEntry() );
+ m_xEdtName->set_text(m_xLbLineEnds->get_active_text());
rXLSet.Put( XLineStartItem( OUString(), pEntry->GetLineEnd() ) );
rXLSet.Put( XLineEndItem( OUString(), pEntry->GetLineEnd() ) );
// #i34740#
- m_pCtlPreview->SetLineAttributes(aXLineAttr.GetItemSet());
-
- m_pCtlPreview->Invalidate();
+ m_aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet());
+ m_aCtlPreview.Invalidate();
// Is not set before, in order to only take the new style,
// if there is an entry selected in the ListBox
@@ -298,15 +274,18 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, SelectLineEndHdl_Impl, ListBox&, void)
}
}
-
-IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SvxLineEndDefTabPage, SelectLineEndHdl_Impl, weld::ComboBox&, void)
{
- sal_Int32 nPos = m_pLbLineEnds->GetSelectedEntryPos();
+ SelectLineEndHdl_Impl();
+}
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
+IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl, weld::Button&, void)
+{
+ int nPos = m_xLbLineEnds->get_active();
+ if (nPos != -1)
{
OUString aDesc(CuiResId(RID_SVXSTR_DESC_LINEEND));
- OUString aName( m_pEdtName->GetText() );
+ OUString aName(m_xEdtName->get_text());
long nCount = pLineEndList->Count();
bool bDifferent = true;
@@ -318,12 +297,12 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl, Button*, void)
// if yes, repeat and demand a new name
if ( !bDifferent )
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xWarningBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
xWarningBox->run();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc));
+ ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetDialogFrameWeld(), aName, aDesc));
bool bLoop = true;
while( !bDifferent && bLoop && pDlg->Execute() == RET_OK )
@@ -354,10 +333,10 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl, Button*, void)
// #123497# Need to replace the existing entry with a new one
pLineEndList->Replace(o3tl::make_unique<XLineEndEntry>(pOldEntry->GetLineEnd(), aName), nPos);
- m_pEdtName->SetText( aName );
+ m_xEdtName->set_text(aName);
- m_pLbLineEnds->Modify(*pLineEndList->GetLineEnd(nPos), nPos, pLineEndList->GetUiBitmap(nPos));
- m_pLbLineEnds->SelectEntryPos( nPos );
+ m_xLbLineEnds->Modify(*pLineEndList->GetLineEnd(nPos), nPos, pLineEndList->GetUiBitmap(nPos));
+ m_xLbLineEnds->set_active(nPos);
// set flag for modified
*pnLineEndListState |= ChangeType::MODIFIED;
@@ -372,8 +351,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl, Button*, void)
}
}
-
-IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, weld::Button&, void)
{
if( pPolyObj )
{
@@ -427,7 +405,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, Button*, void)
}
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc ));
+ ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetDialogFrameWeld(), aName, aDesc ));
bool bLoop = true;
while ( bLoop && pDlg->Execute() == RET_OK )
@@ -445,78 +423,76 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, Button*, void)
{
bLoop = false;
- long nLineEndCount = pLineEndList->Count();
+ auto nLineEndCount = pLineEndList->Count();
pLineEndList->Insert(o3tl::make_unique<XLineEndEntry>(aNewPolyPolygon, aName), nLineEndCount);
// add to the ListBox
- m_pLbLineEnds->Append(*pLineEndList->GetLineEnd(nLineEndCount), pLineEndList->GetUiBitmap(nLineEndCount));
- m_pLbLineEnds->SelectEntryPos( m_pLbLineEnds->GetEntryCount() - 1 );
+ m_xLbLineEnds->Append(*pLineEndList->GetLineEnd(nLineEndCount), pLineEndList->GetUiBitmap(nLineEndCount));
+ m_xLbLineEnds->set_active(m_xLbLineEnds->get_count() - 1);
*pnLineEndListState |= ChangeType::MODIFIED;
- SelectLineEndHdl_Impl( *m_pLbLineEnds );
+ SelectLineEndHdl_Impl();
}
else
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xWarningBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
xWarningBox->run();
}
}
}
else
- m_pBtnAdd->Disable();
+ m_xBtnAdd->set_sensitive(false);
// determine button state
if ( pLineEndList->Count() )
{
- m_pBtnModify->Enable();
- m_pBtnDelete->Enable();
- m_pBtnSave->Enable();
+ m_xBtnModify->set_sensitive(true);
+ m_xBtnDelete->set_sensitive(true);
+ m_xBtnSave->set_sensitive(true);
}
}
-
-IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickDeleteHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickDeleteHdl_Impl, weld::Button&, void)
{
- sal_Int32 nPos = m_pLbLineEnds->GetSelectedEntryPos();
+ int nPos = m_xLbLineEnds->get_active();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
+ if (nPos != -1)
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletelineenddialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/querydeletelineenddialog.ui"));
std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelLineEndDialog"));
if (xQueryBox->run() == RET_YES)
{
pLineEndList->Remove(nPos);
- m_pLbLineEnds->RemoveEntry( nPos );
- m_pLbLineEnds->SelectEntryPos( 0 );
+ m_xLbLineEnds->remove(nPos);
+ m_xLbLineEnds->set_active(0);
- SelectLineEndHdl_Impl( *m_pLbLineEnds );
+ SelectLineEndHdl_Impl();
*pPageType = PageType::Area; // LineEnd shall not be taken over
*pnLineEndListState |= ChangeType::MODIFIED;
- m_pCtlPreview->Invalidate();
+ m_aCtlPreview.Invalidate();
}
}
// determine button state
if( !pLineEndList->Count() )
{
- m_pBtnModify->Disable();
- m_pBtnDelete->Disable();
- m_pBtnSave->Disable();
+ m_xBtnModify->set_sensitive(false);
+ m_xBtnDelete->set_sensitive(false);
+ m_xBtnSave->set_sensitive(false);
}
}
-
-IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl, weld::Button&, void)
{
sal_uInt16 nReturn = RET_YES;
if ( *pnLineEndListState & ChangeType::MODIFIED )
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querysavelistdialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/querysavelistdialog.ui"));
std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("AskSaveList"));
nReturn = xBox->run();
@@ -528,7 +504,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl, Button*, void)
if ( nReturn != RET_CANCEL )
{
::sfx2::FileDialogHelper aDlg(css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
- FileDialogFlags::NONE, GetFrameWeld());
+ FileDialogFlags::NONE, GetDialogFrameWeld());
OUString aStrFilterType( "*.soe" );
aDlg.AddFilter( aStrFilterType, aStrFilterType );
@@ -561,8 +537,8 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl, Button*, void)
{
pLineEndList = pLeList;
static_cast<SvxLineTabDialog*>( GetParentDialog() )->SetNewLineEndList( pLineEndList );
- m_pLbLineEnds->Clear();
- m_pLbLineEnds->Fill( pLineEndList );
+ m_xLbLineEnds->clear();
+ m_xLbLineEnds->Fill( pLineEndList );
Reset( &rOutAttrs );
pLineEndList->SetName( aURL.getName() );
@@ -572,7 +548,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl, Button*, void)
}
else
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querynoloadedfiledialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/querynoloadedfiledialog.ui"));
std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("NoLoadedFileDialog"));
xBox->run();
}
@@ -582,22 +558,21 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl, Button*, void)
// determine button state
if ( pLineEndList->Count() )
{
- m_pBtnModify->Enable();
- m_pBtnDelete->Enable();
- m_pBtnSave->Enable();
+ m_xBtnModify->set_sensitive(true);
+ m_xBtnDelete->set_sensitive(true);
+ m_xBtnSave->set_sensitive(true);
}
else
{
- m_pBtnModify->Disable();
- m_pBtnDelete->Disable();
- m_pBtnSave->Disable();
+ m_xBtnModify->set_sensitive(false);
+ m_xBtnDelete->set_sensitive(false);
+ m_xBtnSave->set_sensitive(false);
}
}
-
-IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl, weld::Button&, void)
{
- ::sfx2::FileDialogHelper aDlg(css::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, FileDialogFlags::NONE, GetFrameWeld());
+ ::sfx2::FileDialogHelper aDlg(css::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, FileDialogFlags::NONE, GetDialogFrameWeld());
OUString aStrFilterType( "*.soe" );
aDlg.AddFilter( aStrFilterType, aStrFilterType );
@@ -640,7 +615,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl, Button*, void)
}
else
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querynosavefiledialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/querynosavefiledialog.ui"));
std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("NoSaveFileDialog"));
xBox->run();
}
@@ -653,10 +628,10 @@ void SvxLineEndDefTabPage::DataChanged( const DataChangedEvent& rDCEvt )
if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
{
- sal_Int32 nOldSelect = m_pLbLineEnds->GetSelectedEntryPos();
- m_pLbLineEnds->Clear();
- m_pLbLineEnds->Fill( pLineEndList );
- m_pLbLineEnds->SelectEntryPos( nOldSelect );
+ auto nOldSelect = m_xLbLineEnds->get_active();
+ m_xLbLineEnds->clear();
+ m_xLbLineEnds->Fill(pLineEndList);
+ m_xLbLineEnds->set_active(nOldSelect);
}
}
diff --git a/cui/uiconfig/ui/lineendstabpage.ui b/cui/uiconfig/ui/lineendstabpage.ui
index 3668c1373b2e..81145b0285e3 100644
--- a/cui/uiconfig/ui/lineendstabpage.ui
+++ b/cui/uiconfig/ui/lineendstabpage.ui
@@ -1,7 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
- <!-- interface-requires gtk+ 3.0 -->
- <!-- interface-requires LibreOffice 1.0 -->
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">res/sc05501.png</property>
+ </object>
+ <object class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">res/sc05502.png</property>
+ </object>
+ <object class="GtkListStore" id="liststore4">
+ <columns>
+ <!-- column-name text -->
+ <column type="gchararray"/>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ <!-- column-name image -->
+ <column type="GdkPixbuf"/>
+ </columns>
+ </object>
<object class="GtkFrame" id="LineEndPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -45,31 +65,27 @@
<object class="GtkLabel" id="FT_TITLE">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="lineendstabpage|FT_TITLE">_Title:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">EDT_NAME</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="FT_LINE_END_STYLE">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="lineendstabpage|FT_LINE_END_STYLE">Arrow _style:</property>
<property name="use_underline">True</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -83,21 +99,19 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="svxlo-LineEndLB" id="LB_LINEENDS">
+ <object class="GtkComboBox" id="LB_LINEENDS">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
+ <property name="model">liststore4</property>
+ <property name="id_column">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -106,14 +120,13 @@
<property name="can_focus">False</property>
<property name="valign">end</property>
<property name="vexpand">True</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="lineendstabpage|FI_TIP">Add a selected object to create new arrow styles.</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">2</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -194,8 +207,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -212,8 +223,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -246,9 +255,24 @@
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="svxlo-SvxXLinePreview" id="CTL_PREVIEW">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkDrawingArea" id="CTL_PREVIEW">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -271,22 +295,12 @@
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="lineendstabpage|label1">Organize Arrow Styles</property>
+ <property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
- <object class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">res/sc05501.png</property>
- </object>
- <object class="GtkImage" id="image2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">res/sc05502.png</property>
- </object>
</interface>