diff options
Diffstat (limited to 'extensions/source/bibliography/general.cxx')
-rw-r--r-- | extensions/source/bibliography/general.cxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index a6e6b20beeed..92a4c6843ec1 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -27,8 +27,11 @@ #include <com/sun/star/uri/UriReferenceFactory.hpp> #include <o3tl/safeint.hxx> +#include <o3tl/string_view.hxx> #include <sal/log.hxx> +#include <osl/diagnose.h> #include <cppuhelper/implbase.hxx> +#include <utility> #include <vcl/event.hxx> #include <vcl/mnemonic.hxx> #include "general.hxx" @@ -72,7 +75,7 @@ bool SplitUrlAndPage(const OUString& rText, OUString& rUrl, int& nPageNumber) return false; } - nPageNumber = xUriRef->getFragment().copy(aPagePrefix.getLength()).toInt32(); + nPageNumber = o3tl::toInt32(xUriRef->getFragment().subView(aPagePrefix.getLength())); xUriRef->clearFragment(); rUrl = xUriRef->getUriReference(); return true; @@ -360,9 +363,8 @@ IMPL_LINK_NOARG(BibGeneralPage, BrowseHdl, weld::Button&, void) } else { - SfxObjectShell* pShell = SfxObjectShell::Current(); OUString aBaseURL; - if (pShell) + if (SfxObjectShell* pShell = SfxObjectShell::Current()) { aBaseURL = pShell->getDocumentBaseURL(); } @@ -475,8 +477,8 @@ BibGeneralPage::~BibGeneralPage() class ChangeListener : public cppu::WeakImplHelper<css::beans::XPropertyChangeListener> { public: - explicit ChangeListener(const css::uno::Reference<css::beans::XPropertySet>& rPropSet) - : m_xPropSet(rPropSet) + explicit ChangeListener(css::uno::Reference<css::beans::XPropertySet> xPropSet) + : m_xPropSet(std::move(xPropSet)) , m_bSelfChanging(false) { } @@ -592,7 +594,7 @@ namespace { aText = m_rEntry.get_text(); } - m_xPropSet->setPropertyValue("Text", makeAny(aText)); + m_xPropSet->setPropertyValue("Text", Any(aText)); css::uno::Reference<css::form::XBoundComponent> xBound(m_xPropSet, css::uno::UNO_QUERY); if (xBound.is()) @@ -666,7 +668,7 @@ namespace m_bSelfChanging = true; Sequence<sal_Int16> aSelection{ o3tl::narrowing<sal_Int16>(m_rComboBox.get_active()) }; - m_xPropSet->setPropertyValue("SelectedItems", makeAny(aSelection)); + m_xPropSet->setPropertyValue("SelectedItems", Any(aSelection)); css::uno::Reference<css::form::XBoundComponent> xBound(m_xPropSet, css::uno::UNO_QUERY); if (xBound.is()) @@ -781,7 +783,6 @@ bool BibGeneralPage::AddXControl(const OUString& rName, weld::Entry& rEntry) if( xPropSet.is()) { - uno::Reference< beans::XPropertySetInfo > xPropInfo = xPropSet->getPropertySetInfo(); maChangeListeners.emplace_back(new EntryChangeListener(rEntry, xPropSet, *this)); maChangeListeners.back()->start(); if (&rEntry == m_xLocalURLED.get()) @@ -822,7 +823,7 @@ IMPL_LINK(BibGeneralPage, GainFocusHdl, weld::Widget&, rWidget, void) } template<class Target> void BibGeneralPage::AddControlWithError(const OUString& rColumnName, const OUString& rColumnUIName, - Target& rWidget, OUString& rErrorString, const OString& rHelpId) + Target& rWidget, OUString& rErrorString, const OUString& rHelpId) { rWidget.set_help_id(rHelpId); rWidget.connect_focus_in(LINK(this, BibGeneralPage, GainFocusHdl)); @@ -848,11 +849,9 @@ bool BibGeneralPage::AddXControl(const OUString& rName, weld::ComboBox& rList) if( xPropSet.is()) { - uno::Reference< beans::XPropertySetInfo > xPropInfo = xPropSet->getPropertySetInfo(); - css::uno::Sequence<OUString> aEntries; xPropSet->getPropertyValue("StringItemList") >>= aEntries; - for (const OUString& rString : std::as_const(aEntries)) + for (const OUString& rString : aEntries) rList.append_text(rString); sal_Int16 nSelection = -1; |