30 : GenericDialogController(pParent,
"modules/spropctrlr/ui/datatypedialog.ui",
"DataTypeDialog")
31 , m_aProhibitedNames( _rProhibitedNames.
begin(), _rProhibitedNames.
end() )
32 , m_xName(m_xBuilder->weld_entry(
"entry"))
33 , m_xOK(m_xBuilder->weld_button(
"ok"))
39 sal_Int32 nStripUntil = _rNameBase.size();
40 while ( nStripUntil > 0 )
43 if ( ( nChar <
'0' ) || ( nChar >
'9' ) )
51 OUString sNameBase = OUString::Concat(_rNameBase.substr( 0, nStripUntil ? nStripUntil + 1 : 0 )) +
" ";
52 OUString sInitialName;
53 sal_Int32 nPostfixNumber = 1;
56 sInitialName = sNameBase + OUString::number(nPostfixNumber++);
60 m_xName->set_text(sInitialName);
70 OUString sCurrentName =
GetName();
71 bool bNameIsOK = ( !sCurrentName.isEmpty() )
72 && ( m_aProhibitedNames.find( sCurrentName ) == m_aProhibitedNames.end() );
74 m_xOK->set_sensitive(bNameIsOK);
virtual ~NewDataTypeDialog() override
NewDataTypeDialog(weld::Window *_pParent, std::u16string_view _rNameBase, const std::vector< OUString > &_rProhibitedNames)
std::set< OUString > m_aProhibitedNames
std::unique_ptr< weld::Entry > m_xName
virtual OUString GetName() const override
#define LINK(Instance, Class, Member)
enumrange< T >::Iterator begin(enumrange< T >)
a property handler for any virtual string properties
IMPL_LINK_NOARG(OBrowserLine, OnButtonFocus, weld::Widget &, void)