summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-06-17 17:35:36 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-06-18 10:01:13 +0200
commitc34f8c317e351859daba00a3e2150126636f8aa7 (patch)
tree17eceafef75e2a46c6cd725cfc41813d2309657b /sfx2/source
parentaf395336cc11439deaf85656c4e331244c480a66 (diff)
weld SfxManageStyleSheetPage
Change-Id: I3769d294e5a5458d3172c330360f7e6207c3d1b1 Reviewed-on: https://gerrit.libreoffice.org/55966 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/dialog/mgetempl.cxx260
1 files changed, 119 insertions, 141 deletions
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 2b29c7e335d1..1d5275935896 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -45,8 +45,8 @@
*
* initializes the list box with the templates
*/
-SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const SfxItemSet& rAttrSet)
- : SfxTabPage(pParent, "ManageStylePage", "sfx/ui/managestylepage.ui", &rAttrSet)
+SfxManageStyleSheetPage::SfxManageStyleSheetPage(TabPageParent pParent, const SfxItemSet& rAttrSet)
+ : SfxTabPage(pParent, "sfx/ui/managestylepage.ui", "ManageStylePage", &rAttrSet)
, pStyle(&static_cast<SfxStyleDialog*>(GetParentDialog())->GetStyleSheet())
, pItem(nullptr)
, bModified(false)
@@ -54,43 +54,44 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
, aFollow(pStyle->GetFollow())
, aParent(pStyle->GetParent())
, nFlags(pStyle->GetMask())
+ , m_xNameRo(m_xBuilder->weld_text_view("namero"))
+ , m_xNameRw(m_xBuilder->weld_entry("namerw"))
+ , m_xAutoCB(m_xBuilder->weld_check_button("autoupdate"))
+ , m_xFollowFt(m_xBuilder->weld_label("nextstyleft"))
+ , m_xFollowLb(m_xBuilder->weld_combo_box_text("nextstyle"))
+ , m_xEditStyleBtn(m_xBuilder->weld_button("editstyle"))
+ , m_xBaseFt(m_xBuilder->weld_label("linkedwithft"))
+ , m_xBaseLb(m_xBuilder->weld_combo_box_text("linkedwith"))
+ , m_xEditLinkStyleBtn(m_xBuilder->weld_button("editlinkstyle"))
+ , m_xFilterFt(m_xBuilder->weld_label("categoryft"))
+ , m_xFilterLb(m_xBuilder->weld_combo_box_text("category"))
+ , m_xDescFt(m_xBuilder->weld_label("desc"))
+ , m_xNameFt(m_xBuilder->weld_label("nameft"))
{
- get(m_pNameRo, "namero");
- get(m_pNameRw, "namerw");
- m_pNameRo->set_width_request(m_pNameRw->get_preferred_size().Width());
- get(m_pAutoCB, "autoupdate");
- get(m_pFollowFt, "nextstyleft");
- get(m_pFollowLb, "nextstyle");
- m_pFollowLb->SetStyle(m_pFollowLb->GetStyle() | WB_SORT);
- const sal_Int32 nMaxWidth(62);
- m_pFollowLb->setMaxWidthChars(nMaxWidth);
- get(m_pEditStyleBtn, "editstyle");
- get(m_pBaseFt, "linkedwithft");
- get(m_pBaseLb, "linkedwith");
- get(m_pEditLinkStyleBtn, "editlinkstyle");
- m_pBaseLb->SetStyle(m_pBaseLb->GetStyle() | WB_SORT);
- m_pBaseLb->setMaxWidthChars(nMaxWidth);
- get(m_pFilterFt, "categoryft");
- get(m_pFilterLb, "category");
+ m_xNameRo->set_size_request(m_xNameRw->get_preferred_size().Width(), -1);
+ m_xFollowLb->make_sorted();
+ const int nMaxWidth(m_xFollowLb->get_approximate_digit_width() * 50);
+ m_xFollowLb->set_size_request(nMaxWidth , -1);
+ m_xBaseLb->make_sorted();
+ m_xBaseLb->set_size_request(nMaxWidth , -1);
//note that the code depends on categories not being lexically
//sorted, so if its changed to sorted, the code needs to
//be adapted to be position unaware
- m_pFilterLb->setMaxWidthChars(nMaxWidth);
- get(m_pDescFt, "desc");
+ m_xFilterLb->set_size_request(nMaxWidth , -1);
// this Page needs ExchangeSupport
SetExchangeSupport();
if ( aFollow == aName )
- m_pEditStyleBtn->Disable();
+ m_xEditStyleBtn->set_sensitive(false);
else
- m_pEditStyleBtn->Enable();
+ m_xEditStyleBtn->set_sensitive(true);
- sal_Int32 linkSelectPos = m_pBaseLb->GetSelectedEntryPos();
+ int linkSelectPos = m_xBaseLb->get_active();
if ( linkSelectPos == 0 )
- m_pEditLinkStyleBtn->Disable();
+ m_xEditLinkStyleBtn->set_sensitive(false);
else
- m_pEditLinkStyleBtn->Enable();
+ m_xEditLinkStyleBtn->set_sensitive(true);
pFamilies.reset(SfxApplication::GetModule_Impl()->CreateStyleFamilies());
@@ -116,17 +117,16 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
aFollow = pStyle->GetFollow();
aParent = pStyle->GetParent();
}
- m_pNameRw->SetText(pStyle->GetName());
+ m_xNameRw->set_text(pStyle->GetName());
// Set the field read-only if it is NOT an user-defined style
// but allow selecting and copying
if (!pStyle->IsUserDefined())
{
- m_pNameRo->SetText(m_pNameRw->GetText());
- m_pNameRw->Hide();
- m_pNameRo->Show();
- FixedText *pLabel = get<FixedText>("nameft");
- pLabel->set_mnemonic_widget(m_pNameRo);
+ m_xNameRo->set_text(m_xNameRw->get_text());
+ m_xNameRw->hide();
+ m_xNameRo->show();
+ m_xNameFt->set_mnemonic_widget(m_xNameRo.get());
}
if ( pStyle->HasFollowSupport() && pPool )
@@ -135,25 +135,25 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
while ( pPoolStyle )
{
- m_pFollowLb->InsertEntry( pPoolStyle->GetName() );
+ m_xFollowLb->append_text(pPoolStyle->GetName());
pPoolStyle = pPool->Next();
}
// A new Template is not yet in the Pool
- if ( LISTBOX_ENTRY_NOTFOUND == m_pFollowLb->GetEntryPos( pStyle->GetName() ) )
- m_pFollowLb->InsertEntry( pStyle->GetName() );
+ if (m_xFollowLb->find_text(pStyle->GetName()) == -1)
+ m_xFollowLb->append_text(pStyle->GetName());
}
else
{
- m_pFollowFt->Hide();
- m_pFollowLb->Hide();
+ m_xFollowFt->hide();
+ m_xFollowLb->hide();
}
if ( pStyle->HasParentSupport() && pPool )
{
if ( pStyle->HasClearParentSupport() )
// the base template can be set to NULL
- m_pBaseLb->InsertEntry( SfxResId(STR_NONE) );
+ m_xBaseLb->append_text(SfxResId(STR_NONE));
SfxStyleSheetBase* pPoolStyle = pPool->First();
@@ -162,14 +162,14 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
const OUString aStr( pPoolStyle->GetName() );
// own name as base template
if ( aStr != aName )
- m_pBaseLb->InsertEntry( aStr );
+ m_xBaseLb->append_text(aStr);
pPoolStyle = pPool->Next();
}
}
else
{
- m_pBaseFt->Disable();
- m_pBaseLb->Disable();
+ m_xBaseFt->set_sensitive(false);
+ m_xBaseLb->set_sensitive(false);
}
size_t nCount = pFamilies->size();
@@ -203,9 +203,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
rTupel.nFlags != SfxStyleSearchBits::AllVisible &&
rTupel.nFlags != SfxStyleSearchBits::All )
{
- m_pFilterLb->InsertEntry( rTupel.aName, nIdx );
- m_pFilterLb->SetEntryData(nIdx, reinterpret_cast<void*>(i));
-
+ m_xFilterLb->insert(nIdx, OUString::number(i), rTupel.aName);
if ( ( rTupel.nFlags & nMask ) == nMask )
nStyleFilterIdx = nIdx;
++nIdx;
@@ -213,36 +211,35 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
}
if ( nStyleFilterIdx != 0xFFFF )
- m_pFilterLb->SelectEntryPos( nStyleFilterIdx );
+ m_xFilterLb->set_active(nStyleFilterIdx);
}
- if ( !m_pFilterLb->GetEntryCount() || !pStyle->IsUserDefined() )
+ if ( !m_xFilterLb->get_count() || !pStyle->IsUserDefined() )
{
pItem = nullptr;
- m_pFilterFt->Disable();
- m_pFilterLb->Disable();
+ m_xFilterFt->set_sensitive(false);
+ m_xFilterLb->set_sensitive(false);
}
else
- m_pFilterLb->SaveValue();
+ m_xFilterLb->save_value();
SetDescriptionText_Impl();
- if ( m_pFollowLb->IsEnabled() || m_pBaseLb->IsEnabled() )
+ if (m_xFollowLb->get_sensitive() || m_xBaseLb->get_sensitive())
{
- m_pNameRw->SetGetFocusHdl(
+ m_xNameRw->connect_focus_in(
LINK( this, SfxManageStyleSheetPage, GetFocusHdl ) );
- m_pNameRw->SetLoseFocusHdl(
+ m_xNameRw->connect_focus_out(
LINK( this, SfxManageStyleSheetPage, LoseFocusHdl ) );
}
// It is a style with auto update? (SW only)
if(SfxItemState::SET == rAttrSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE))
- m_pAutoCB->Show();
- m_pFollowLb->SetSelectHdl( LINK( this, SfxManageStyleSheetPage, EditStyleSelectHdl_Impl ) );
- m_pBaseLb->SetSelectHdl( LINK( this, SfxManageStyleSheetPage, EditLinkStyleSelectHdl_Impl ) );
- m_pEditStyleBtn->SetClickHdl( LINK( this, SfxManageStyleSheetPage, EditStyleHdl_Impl ) );
- m_pEditLinkStyleBtn->SetClickHdl( LINK( this, SfxManageStyleSheetPage, EditLinkStyleHdl_Impl ) );
+ m_xAutoCB->show();
+ m_xFollowLb->connect_changed(LINK(this, SfxManageStyleSheetPage, EditStyleSelectHdl_Impl));
+ m_xBaseLb->connect_changed(LINK(this, SfxManageStyleSheetPage, EditLinkStyleSelectHdl_Impl));
+ m_xEditStyleBtn->connect_clicked(LINK(this, SfxManageStyleSheetPage, EditStyleHdl_Impl));
+ m_xEditLinkStyleBtn->connect_clicked(LINK(this, SfxManageStyleSheetPage, EditLinkStyleHdl_Impl));
}
-
SfxManageStyleSheetPage::~SfxManageStyleSheetPage()
{
disposeOnce();
@@ -250,28 +247,13 @@ SfxManageStyleSheetPage::~SfxManageStyleSheetPage()
void SfxManageStyleSheetPage::dispose()
{
- m_pNameRw->SetGetFocusHdl( Link<Control&,void>() );
- m_pNameRw->SetLoseFocusHdl( Link<Control&,void>() );
pFamilies.reset();
pItem = nullptr;
pStyle = nullptr;
- m_pNameRo.clear();
- m_pNameRw.clear();
- m_pAutoCB.clear();
- m_pFollowFt.clear();
- m_pFollowLb.clear();
- m_pEditStyleBtn.clear();
- m_pBaseFt.clear();
- m_pBaseLb.clear();
- m_pEditLinkStyleBtn.clear();
- m_pFilterFt.clear();
- m_pFilterLb.clear();
- m_pDescFt.clear();
SfxTabPage::dispose();
}
-
-void SfxManageStyleSheetPage::UpdateName_Impl( ListBox* pBox,
+void SfxManageStyleSheetPage::UpdateName_Impl( weld::ComboBoxText* pBox,
const OUString& rNew )
/* [Description]
@@ -285,19 +267,18 @@ void SfxManageStyleSheetPage::UpdateName_Impl( ListBox* pBox,
*/
{
- if ( pBox->IsEnabled() )
+ if (pBox->get_sensitive())
{
// it is the current entry, which name was modified
- const bool bSelect = pBox->GetSelectedEntry() == aBuf;
- pBox->RemoveEntry( aBuf );
- pBox->InsertEntry( rNew );
+ const bool bSelect = pBox->get_active_text() == aBuf;
+ pBox->remove_text(aBuf);
+ pBox->append_text(rNew);
- if ( bSelect )
- pBox->SelectEntry( rNew );
+ if (bSelect)
+ pBox->set_active_text(rNew);
}
}
-
void SfxManageStyleSheetPage::SetDescriptionText_Impl()
/* [Description]
@@ -331,37 +312,37 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl()
default:
OSL_FAIL( "non supported field unit" );
}
- m_pDescFt->SetText( pStyle->GetDescription( eUnit ) );
+ m_xDescFt->set_label(pStyle->GetDescription(eUnit));
}
-IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditStyleSelectHdl_Impl, ListBox&, void )
+IMPL_LINK_NOARG(SfxManageStyleSheetPage, EditStyleSelectHdl_Impl, weld::ComboBoxText&, void)
{
- OUString aTemplName(m_pFollowLb->GetSelectedEntry());
- OUString aEditTemplName(m_pNameRo->GetText());
+ OUString aTemplName(m_xFollowLb->get_active_text());
+ OUString aEditTemplName(m_xNameRo->get_text());
if (!( aTemplName == aEditTemplName))
- m_pEditStyleBtn->Enable();
+ m_xEditStyleBtn->set_sensitive(true);
else
- m_pEditStyleBtn->Disable();
+ m_xEditStyleBtn->set_sensitive(false);
}
-IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditStyleHdl_Impl, Button*, void )
+IMPL_LINK_NOARG(SfxManageStyleSheetPage, EditStyleHdl_Impl, weld::Button&, void)
{
- OUString aTemplName(m_pFollowLb->GetSelectedEntry());
+ OUString aTemplName(m_xFollowLb->get_active_text());
Execute_Impl(SID_STYLE_EDIT, aTemplName, static_cast<sal_uInt16>(pStyle->GetFamily()));
}
-IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditLinkStyleSelectHdl_Impl, ListBox&, void )
+IMPL_LINK_NOARG(SfxManageStyleSheetPage, EditLinkStyleSelectHdl_Impl, weld::ComboBoxText&, void)
{
- sal_Int32 linkSelectPos = m_pBaseLb->GetSelectedEntryPos();
+ int linkSelectPos = m_xBaseLb->get_active();
if ( linkSelectPos == 0 )
- m_pEditLinkStyleBtn->Disable();
+ m_xEditLinkStyleBtn->set_sensitive(false);
else
- m_pEditLinkStyleBtn->Enable();
+ m_xEditLinkStyleBtn->set_sensitive(true);
}
-IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditLinkStyleHdl_Impl, Button*, void )
+IMPL_LINK_NOARG(SfxManageStyleSheetPage, EditLinkStyleHdl_Impl, weld::Button&, void)
{
- OUString aTemplName(m_pBaseLb->GetSelectedEntry());
+ OUString aTemplName(m_xBaseLb->get_active_text());
if (aTemplName != SfxResId(STR_NONE))
Execute_Impl( SID_STYLE_EDIT, aTemplName, static_cast<sal_uInt16>(pStyle->GetFamily()) );
}
@@ -390,7 +371,7 @@ bool SfxManageStyleSheetPage::Execute_Impl(
}
-IMPL_LINK( SfxManageStyleSheetPage, GetFocusHdl, Control&, rControl, void )
+IMPL_LINK(SfxManageStyleSheetPage, GetFocusHdl, weld::Widget&, rControl, void)
/* [Description]
@@ -398,11 +379,11 @@ IMPL_LINK( SfxManageStyleSheetPage, GetFocusHdl, Control&, rControl, void )
*/
{
- Edit* pEdit = static_cast<Edit*>(&rControl);
- aBuf = comphelper::string::stripStart(pEdit->GetText(), ' ');
+ weld::Entry& rEdit = dynamic_cast<weld::Entry&>(rControl);
+ aBuf = comphelper::string::stripStart(rEdit.get_text(), ' ');
}
-IMPL_LINK( SfxManageStyleSheetPage, LoseFocusHdl, Control&, rControl, void )
+IMPL_LINK(SfxManageStyleSheetPage, LoseFocusHdl, weld::Widget&, rControl, void)
/* [Description]
@@ -412,12 +393,12 @@ IMPL_LINK( SfxManageStyleSheetPage, LoseFocusHdl, Control&, rControl, void )
*/
{
- Edit* pEdit = static_cast<Edit*>(&rControl);
- const OUString aStr(comphelper::string::stripStart(pEdit->GetText(), ' '));
- pEdit->SetText( aStr );
+ weld::Entry& rEdit = dynamic_cast<weld::Entry&>(rControl);
+ const OUString aStr(comphelper::string::stripStart(rEdit.get_text(), ' '));
+ rEdit.set_text(aStr);
// Update the Listbox of the base template if possible
if ( aStr != aBuf )
- UpdateName_Impl(m_pFollowLb, aStr);
+ UpdateName_Impl(m_xFollowLb.get(), aStr);
}
bool SfxManageStyleSheetPage::FillItemSet( SfxItemSet* rSet )
@@ -442,24 +423,23 @@ bool SfxManageStyleSheetPage::FillItemSet( SfxItemSet* rSet )
*/
{
- const sal_Int32 nFilterIdx = m_pFilterLb->GetSelectedEntryPos();
+ const int nFilterIdx = m_xFilterLb->get_active();
// Set Filter
- if ( LISTBOX_ENTRY_NOTFOUND != nFilterIdx &&
- m_pFilterLb->IsValueChangedFromSaved() &&
- m_pFilterLb->IsEnabled() )
+ if ( nFilterIdx != -1 &&
+ m_xFilterLb->get_value_changed_from_saved() &&
+ m_xFilterLb->get_sensitive() )
{
bModified = true;
OSL_ENSURE( pItem, "No Item" );
// is only possibly for user templates
- SfxStyleSearchBits nMask = pItem->GetFilterList()[ reinterpret_cast<size_t>(m_pFilterLb->GetEntryData( nFilterIdx )) ].nFlags | SfxStyleSearchBits::UserDefined;
+ SfxStyleSearchBits nMask = pItem->GetFilterList()[m_xFilterLb->get_id(nFilterIdx).toInt32()].nFlags | SfxStyleSearchBits::UserDefined;
pStyle->SetMask( nMask );
}
- if(m_pAutoCB->IsVisible() &&
- m_pAutoCB->IsValueChangedFromSaved())
+ if (m_xAutoCB->get_visible() && m_xAutoCB->get_state_changed_from_saved())
{
- rSet->Put(SfxBoolItem(SID_ATTR_AUTO_STYLE_UPDATE, m_pAutoCB->IsChecked()));
+ rSet->Put(SfxBoolItem(SID_ATTR_AUTO_STYLE_UPDATE, m_xAutoCB->get_active()));
}
return bModified;
@@ -487,10 +467,10 @@ void SfxManageStyleSheetPage::Reset( const SfxItemSet* /*rAttrSet*/ )
if ( sCmp != aName )
pStyle->SetName( aName );
- m_pNameRw->SetText( aName );
- m_pNameRw->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
+ m_xNameRw->set_text( aName );
+ m_xNameRw->select_region(0, -1);
- if ( m_pFollowLb->IsEnabled() )
+ if ( m_xFollowLb->get_sensitive() )
{
sCmp = pStyle->GetFollow();
@@ -498,12 +478,12 @@ void SfxManageStyleSheetPage::Reset( const SfxItemSet* /*rAttrSet*/ )
pStyle->SetFollow( aFollow );
if ( aFollow.isEmpty() )
- m_pFollowLb->SelectEntry( aName );
+ m_xFollowLb->set_active_text( aName );
else
- m_pFollowLb->SelectEntry( aFollow );
+ m_xFollowLb->set_active_text( aFollow );
}
- if ( m_pBaseLb->IsEnabled() )
+ if (m_xBaseLb->get_sensitive())
{
sCmp = pStyle->GetParent();
@@ -511,36 +491,34 @@ void SfxManageStyleSheetPage::Reset( const SfxItemSet* /*rAttrSet*/ )
pStyle->SetParent( aParent );
if ( aParent.isEmpty() )
- m_pBaseLb->SelectEntry( SfxResId(STR_NONE) );
+ m_xBaseLb->set_active_text( SfxResId(STR_NONE) );
else
- m_pBaseLb->SelectEntry( aParent );
+ m_xBaseLb->set_active_text( aParent );
if ( SfxResId(STR_STANDARD) == aName )
{
// the default template can not be linked
- m_pBaseFt->Disable();
- m_pBaseLb->Disable();
+ m_xBaseFt->set_sensitive(false);
+ m_xBaseLb->set_sensitive(false);
}
}
- if ( m_pFilterLb->IsEnabled() )
+ if (m_xFilterLb->get_sensitive())
{
SfxStyleSearchBits nCmp = pStyle->GetMask();
if ( nCmp != nFlags )
pStyle->SetMask( nFlags );
- m_pFilterLb->SelectEntryPos( m_pFilterLb->GetSavedValue() );
+ m_xFilterLb->set_active_text(m_xFilterLb->get_saved_value());
}
}
-
VclPtr<SfxTabPage> SfxManageStyleSheetPage::Create( TabPageParent pParent,
const SfxItemSet *rAttrSet )
{
- return VclPtr<SfxManageStyleSheetPage>::Create( pParent.pParent, *rAttrSet );
+ return VclPtr<SfxManageStyleSheetPage>::Create(pParent, *rAttrSet);
}
-
void SfxManageStyleSheetPage::ActivatePage( const SfxItemSet& rSet)
/* [Description]
@@ -566,11 +544,11 @@ void SfxManageStyleSheetPage::ActivatePage( const SfxItemSet& rSet)
if ( SfxItemState::SET ==
rSet.GetItemState( SID_ATTR_AUTO_STYLE_UPDATE, false, &pPoolItem ) )
- m_pAutoCB->Check( static_cast<const SfxBoolItem*>(pPoolItem)->GetValue() );
- m_pAutoCB->SaveValue();
+ m_xAutoCB->set_active(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue());
+ m_xAutoCB->save_state();
+ m_xNameRw->save_value();
}
-
DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
/* [Description]
@@ -590,28 +568,28 @@ DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
{
DeactivateRC nRet = DeactivateRC::LeavePage;
- if ( m_pNameRw->IsModified() )
+ if (m_xNameRw->get_value_changed_from_saved())
{
// By pressing <Enter> LoseFocus() is not trigged through StarView
- if ( m_pNameRw->HasFocus() )
- LoseFocusHdl( *m_pNameRw );
+ if (m_xNameRw->has_focus())
+ LoseFocusHdl( *m_xNameRw );
- if (!pStyle->SetName(comphelper::string::stripStart(m_pNameRw->GetText(), ' ')))
+ if (!pStyle->SetName(comphelper::string::stripStart(m_xNameRw->get_text(), ' ')))
{
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
SfxResId(STR_TABPAGE_INVALIDNAME)));
xBox->run();
- m_pNameRw->GrabFocus();
- m_pNameRw->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
+ m_xNameRw->grab_focus();
+ m_xNameRw->select_region(0, -1);
return DeactivateRC::KeepPage;
}
bModified = true;
}
- if ( pStyle->HasFollowSupport() && m_pFollowLb->IsEnabled() )
+ if (pStyle->HasFollowSupport() && m_xFollowLb->get_sensitive())
{
- const OUString aFollowEntry( m_pFollowLb->GetSelectedEntry() );
+ const OUString aFollowEntry( m_xFollowLb->get_active_text() );
if ( pStyle->GetFollow() != aFollowEntry )
{
@@ -621,16 +599,16 @@ DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
VclMessageType::Info, VclButtonsType::Ok,
SfxResId(STR_TABPAGE_INVALIDSTYLE)));
xBox->run();
- m_pFollowLb->GrabFocus();
+ m_xFollowLb->grab_focus();
return DeactivateRC::KeepPage;
}
bModified = true;
}
}
- if ( m_pBaseLb->IsEnabled() )
+ if (m_xBaseLb->get_sensitive())
{
- OUString aParentEntry( m_pBaseLb->GetSelectedEntry() );
+ OUString aParentEntry( m_xBaseLb->get_active_text() );
if ( SfxResId(STR_NONE) == aParentEntry || aParentEntry == pStyle->GetName() )
aParentEntry.clear();
@@ -643,7 +621,7 @@ DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
VclMessageType::Info, VclButtonsType::Ok,
SfxResId(STR_TABPAGE_INVALIDPARENT)));
xBox->run();
- m_pBaseLb->GrabFocus();
+ m_xBaseLb->grab_focus();
return DeactivateRC::KeepPage;
}
bModified = true;