diff options
Diffstat (limited to 'extensions/source/bibliography/bibload.cxx')
-rw-r--r-- | extensions/source/bibliography/bibload.cxx | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index 312c47432f4a..c8d88d8d0160 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -18,11 +18,12 @@ */ #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <cppuhelper/supportsservice.hxx> #include <svl/itemprop.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <comphelper/processfactory.hxx> +#include <com/sun/star/awt/XVclWindowPeer.hpp> #include <com/sun/star/sdbc/ResultSetType.hpp> #include <com/sun/star/sdbc/ResultSetConcurrency.hpp> #include <com/sun/star/sdbc/SQLException.hpp> @@ -38,7 +39,6 @@ #include <com/sun/star/text/BibliographyDataField.hpp> #include <com/sun/star/form/XLoadable.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> -#include <toolkit/awt/vclxwindow.hxx> #include <vcl/window.hxx> #include <vcl/svapp.hxx> @@ -53,6 +53,7 @@ #include "bibconfig.hxx" #include <cppuhelper/implbase.hxx> #include <rtl/ref.hxx> +#include <o3tl/string_view.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -175,7 +176,7 @@ void BibliographyLoader::load(const Reference< XFrame > & rFrame, const OUString m_pBibMod = OpenBibModul(); - OUString aPartName = rURL.getToken( 1, '/' ); + std::u16string_view aPartName = o3tl::getToken(rURL, 1, '/' ); Reference<XPropertySet> xPrSet(rFrame, UNO_QUERY); if(xPrSet.is()) { @@ -183,7 +184,7 @@ void BibliographyLoader::load(const Reference< XFrame > & rFrame, const OUString aTitle <<= BibResId(RID_BIB_STR_FRAME_TITLE); xPrSet->setPropertyValue("Title", aTitle); } - if(aPartName == "View" || aPartName == "View1") + if(aPartName == u"View" || aPartName == u"View1") { loadView(rFrame, rListener); } @@ -211,9 +212,7 @@ void BibliographyLoader::loadView(const Reference< XFrame > & rFrame, m_xDatMan->createDatabaseForm( aBibDesc ); - Reference< awt::XWindow > aWindow = rFrame->getContainerWindow(); - VCLXWindow* pParentComponent = comphelper::getUnoTunnelImplementation<VCLXWindow>(aWindow); - assert(pParentComponent); + Reference<awt::XWindow> aWindow = rFrame->getContainerWindow(); VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( aWindow ); @@ -238,13 +237,13 @@ void BibliographyLoader::loadView(const Reference< XFrame > & rFrame, rFrame->setComponent( xWin, xCtrRef); pBeamer->SetXController(xCtrRef); - if (pParentComponent) + if (aWindow) { // not earlier because SetFocus() is triggered in setVisible() - pParentComponent->setVisible(true); + aWindow->setVisible(true); } - Reference<XLoadable>(m_xDatMan.get())->load(); + Reference<XLoadable>(m_xDatMan)->load(); m_xDatMan->RegisterInterceptor(pBeamer); if ( rListener.is() ) @@ -516,8 +515,7 @@ Reference< XPropertySetInfo > BibliographyLoader::getPropertySetInfo() { static const SfxItemPropertyMapEntry aBibProps_Impl[] = { - { u"BibliographyDataFieldNames", 0, cppu::UnoType<Sequence<PropertyValue>>::get(), PropertyAttribute::READONLY, 0}, - { u"", 0, css::uno::Type(), 0, 0 } + { u"BibliographyDataFieldNames"_ustr, 0, cppu::UnoType<Sequence<PropertyValue>>::get(), PropertyAttribute::READONLY, 0}, }; static Reference< XPropertySetInfo > xRet = SfxItemPropertySet(aBibProps_Impl).getPropertySetInfo(); @@ -566,14 +564,15 @@ Any BibliographyLoader::getPropertyValue(const OUString& rPropertyName) CUSTOM3_POS , // BibliographyDataField_CUSTOM3 CUSTOM4_POS , // BibliographyDataField_CUSTOM4 CUSTOM5_POS , // BibliographyDataField_CUSTOM5 - ISBN_POS //BibliographyDataField_ISBN + ISBN_POS , // BibliographyDataField_ISBN + LOCAL_URL_POS // BibliographyDataField_LOCAL_URL }; if(rPropertyName != "BibliographyDataFieldNames") throw UnknownPropertyException(rPropertyName); Sequence<PropertyValue> aSeq(COLUMN_COUNT); PropertyValue* pArray = aSeq.getArray(); BibConfig* pConfig = BibModul::GetConfig(); - for(sal_uInt16 i = 0; i <= text::BibliographyDataField::ISBN ; i++) + for(sal_uInt16 i = 0; i <= text::BibliographyDataField::LOCAL_URL ; i++) { pArray[i].Name = pConfig->GetDefColumnName(aInternalMapping[i]); pArray[i].Value <<= static_cast<sal_Int16>(i); |