namespace
{ using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::container::XNameAccess; using ::com::sun::star::beans::PropertyValue; using ::com::sun::star::ui::theModuleUIConfigurationManagerSupplier; using ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier; using ::com::sun::star::ui::XUIConfigurationManager; using ::com::sun::star::ui::XImageManager; using ::com::sun::star::graphic::XGraphic;
OpenDocumentButton::OpenDocumentButton(std::unique_ptr<weld::Button> xControl, constOUString& _rAsciiModuleName)
: m_xControl(std::move(xControl))
{ // our label should equal the UI text of the "Open" command auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(u".uno:Open"_ustr, _rAsciiModuleName);
OUString sLabel(vcl::CommandInfoProvider::GetLabelForCommand(aProperties));
m_xControl->set_label(" " + sLabel.replaceAll("~", ""));
// Place icon left of text and both centered in the button.
m_xControl->set_image(GetCommandIcon(u".uno:Open"_ustr, _rAsciiModuleName));
}
// OpenDocumentListBox
OpenDocumentListBox::OpenDocumentListBox(std::unique_ptr<weld::ComboBox> xControl, constchar* _pAsciiModuleName )
: m_xControl(std::move(xControl))
{ // we need to limit the max auto width feature of the filter box int nWidth = m_xControl->get_approximate_digit_width() * 50;
m_xControl->set_size_request(nWidth, -1);
for ( const SvtHistoryOptions::HistoryItem& rHistoryItem : aHistory )
{ try
{ // Get the current history item's properties.
OUString sURL = rHistoryItem.sURL;
OUString sFilter = rHistoryItem.sFilter;
OUString sTitle = rHistoryItem.sTitle;
// If the entry is a Base file then insert it into the // history list and the list box.
Sequence< PropertyValue > aProps;
xFilterFactory->getByName( sFilter ) >>= aProps;
::comphelper::SequenceAsHashMap aFilterProperties( aProps );
OUString sDocumentService = aFilterProperties.getUnpackedValueOrDefault(
u"DocumentService"_ustr, OUString() ); if ( sDocumentService.equalsAscii( _pAsciiModuleName ) )
{ // yes, it's a Base document
INetURLObject aURL;
aURL.SetSmartURL( sURL );
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.