1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  *   Licensed to the Apache Software Foundation (ASF) under one or more
12  *   contributor license agreements. See the NOTICE file distributed
13  *   with this work for additional information regarding copyright
14  *   ownership. The ASF licenses this file to you under the Apache
15  *   License, Version 2.0 (the "License"); you may not use this file
16  *   except in compliance with the License. You may obtain a copy of
17  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <tools/debug.hxx>
21 #include <comphelper/diagnose_ex.hxx>
22 #include <cppuhelper/supportsservice.hxx>
23 #include <svl/itemprop.hxx>
24 #include <toolkit/helper/vclunohelper.hxx>
25 #include <comphelper/processfactory.hxx>
26 #include <com/sun/star/awt/XVclWindowPeer.hpp>
27 #include <com/sun/star/sdbc/ResultSetType.hpp>
28 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
29 #include <com/sun/star/sdbc/SQLException.hpp>
30 #include <com/sun/star/sdb/XColumn.hpp>
31 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
32 #include <com/sun/star/sdbc/XRowSet.hpp>
33 #include <com/sun/star/frame/XFrameLoader.hpp>
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
36 #include <com/sun/star/beans/PropertyAttribute.hpp>
37 #include <com/sun/star/beans/XPropertySet.hpp>
38 #include <com/sun/star/container/XNameAccess.hpp>
39 #include <com/sun/star/text/BibliographyDataField.hpp>
40 #include <com/sun/star/form/XLoadable.hpp>
41 #include <com/sun/star/frame/XLayoutManager.hpp>
42 #include <vcl/window.hxx>
43 #include <vcl/svapp.hxx>
44 
45 #include "bibresid.hxx"
46 #include <strings.hrc>
47 #include "bibcont.hxx"
48 #include "bibbeam.hxx"
49 #include "bibmod.hxx"
50 #include "bibview.hxx"
51 #include "framectr.hxx"
52 #include "datman.hxx"
53 #include "bibconfig.hxx"
54 #include <cppuhelper/implbase.hxx>
55 #include <rtl/ref.hxx>
56 #include <o3tl/string_view.hxx>
57 
58 using namespace ::com::sun::star;
59 using namespace ::com::sun::star::uno;
60 using namespace ::com::sun::star::beans;
61 using namespace ::com::sun::star::lang;
62 using namespace ::com::sun::star::sdb;
63 using namespace ::com::sun::star::sdbc;
64 using namespace ::com::sun::star::form;
65 using namespace ::com::sun::star::container;
66 using namespace ::com::sun::star::frame;
67 
68 namespace {
69 
70 class BibliographyLoader : public cppu::WeakImplHelper
71                             < XServiceInfo, XNameAccess, XPropertySet, XFrameLoader >
72 {
73     HdlBibModul                                     m_pBibMod;
74     rtl::Reference<BibDataManager>                  m_xDatMan;
75     Reference< XNameAccess >                        m_xColumns;
76     Reference< XResultSet >                         m_xCursor;
77 
78 private:
79 
80     void                    loadView(const Reference< XFrame > & aFrame,
81                                 const Reference< XLoadEventListener > & aListener);
82 
83     BibDataManager*         GetDataManager()const;
84     Reference< XNameAccess > const &    GetDataColumns() const;
85     Reference< XResultSet > const &     GetDataCursor() const;
86     Reference< sdb::XColumn >           GetIdentifierColumn() const;
87 
88 public:
89                             BibliographyLoader();
90                             virtual ~BibliographyLoader() override;
91 
92     // XServiceInfo
93     OUString               SAL_CALL getImplementationName() override;
94     sal_Bool               SAL_CALL supportsService(const OUString& ServiceName) override;
95     Sequence< OUString >   SAL_CALL getSupportedServiceNames() override;
96 
97     //XNameAccess
98     virtual Any SAL_CALL getByName(const OUString& aName) override;
99     virtual Sequence< OUString > SAL_CALL getElementNames() override;
100     virtual sal_Bool SAL_CALL hasByName(const OUString& aName) override;
101 
102     //XElementAccess
103     virtual Type  SAL_CALL getElementType() override;
104     virtual sal_Bool SAL_CALL hasElements() override;
105 
106     //XPropertySet
107     virtual Reference< XPropertySetInfo >  SAL_CALL getPropertySetInfo() override;
108     virtual void SAL_CALL setPropertyValue(const OUString& PropertyName, const Any& aValue) override;
109     virtual Any SAL_CALL getPropertyValue(const OUString& PropertyName) override;
110     virtual void SAL_CALL addPropertyChangeListener(const OUString& PropertyName, const Reference< XPropertyChangeListener > & aListener) override;
111     virtual void SAL_CALL removePropertyChangeListener(const OUString& PropertyName, const Reference< XPropertyChangeListener > & aListener) override;
112     virtual void SAL_CALL addVetoableChangeListener(const OUString& PropertyName, const Reference< XVetoableChangeListener > & aListener) override;
113     virtual void SAL_CALL removeVetoableChangeListener(const OUString& PropertyName, const Reference< XVetoableChangeListener > & aListener) override;
114 
115     // XLoader
116     virtual void            SAL_CALL load(const Reference< XFrame > & aFrame, const OUString& aURL,
117                                 const Sequence< PropertyValue >& aArgs,
118                                 const Reference< XLoadEventListener > & aListener) override;
119     virtual void            SAL_CALL cancel() override;
120 };
121 
122 }
123 
BibliographyLoader()124 BibliographyLoader::BibliographyLoader() :
125     m_pBibMod(nullptr)
126 {
127 }
128 
~BibliographyLoader()129 BibliographyLoader::~BibliographyLoader()
130 {
131     Reference< lang::XComponent >  xComp(m_xCursor, UNO_QUERY);
132     if (xComp.is())
133         xComp->dispose();
134     if(m_pBibMod)
135         CloseBibModul(m_pBibMod);
136 }
137 
138 
139 // XServiceInfo
getImplementationName()140 OUString BibliographyLoader::getImplementationName()
141 {
142     return u"com.sun.star.extensions.Bibliography"_ustr;
143 }
144 
145 // XServiceInfo
supportsService(const OUString & ServiceName)146 sal_Bool BibliographyLoader::supportsService(const OUString& ServiceName)
147 {
148     return cppu::supportsService(this, ServiceName);
149 }
150 
151 // XServiceInfo
getSupportedServiceNames()152 Sequence< OUString > BibliographyLoader::getSupportedServiceNames()
153 {
154     return { u"com.sun.star.frame.FrameLoader"_ustr, u"com.sun.star.frame.Bibliography"_ustr };
155 }
156 
157 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
extensions_BibliographyLoader_get_implementation(css::uno::XComponentContext *,css::uno::Sequence<css::uno::Any> const &)158 extensions_BibliographyLoader_get_implementation(
159     css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
160 {
161     return cppu::acquire(new BibliographyLoader());
162 }
163 
cancel()164 void BibliographyLoader::cancel()
165 {
166     //!
167     //!
168 }
169 
load(const Reference<XFrame> & rFrame,const OUString & rURL,const Sequence<PropertyValue> &,const Reference<XLoadEventListener> & rListener)170 void BibliographyLoader::load(const Reference< XFrame > & rFrame, const OUString& rURL,
171         const Sequence< PropertyValue >& /*rArgs*/,
172         const Reference< XLoadEventListener > & rListener)
173 {
174 
175     SolarMutexGuard aGuard;
176 
177     m_pBibMod = OpenBibModul();
178 
179     std::u16string_view aPartName = o3tl::getToken(rURL, 1, '/' );
180     Reference<XPropertySet> xPrSet(rFrame, UNO_QUERY);
181     if(xPrSet.is())
182     {
183         Any aTitle;
184         aTitle <<= BibResId(RID_BIB_STR_FRAME_TITLE);
185         xPrSet->setPropertyValue(u"Title"_ustr, aTitle);
186     }
187     if(aPartName == u"View" || aPartName == u"View1")
188     {
189         loadView(rFrame, rListener);
190     }
191 }
192 
193 
loadView(const Reference<XFrame> & rFrame,const Reference<XLoadEventListener> & rListener)194 void BibliographyLoader::loadView(const Reference< XFrame > & rFrame,
195         const Reference< XLoadEventListener > & rListener)
196 {
197     SolarMutexGuard aGuard;
198     //!
199     if(!m_pBibMod)
200         m_pBibMod = OpenBibModul();
201 
202     m_xDatMan = BibModul::createDataManager();
203     BibDBDescriptor aBibDesc = BibModul::GetConfig()->GetBibliographyURL();
204 
205     if(aBibDesc.sDataSource.isEmpty())
206     {
207         DBChangeDialogConfig_Impl aConfig;
208         const Sequence<OUString> aSources = aConfig.GetDataSourceNames();
209         if(aSources.hasElements())
210             aBibDesc.sDataSource = aSources[0];
211     }
212 
213     m_xDatMan->createDatabaseForm( aBibDesc );
214 
215     Reference<awt::XWindow> aWindow = rFrame->getContainerWindow();
216 
217     VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( aWindow );
218 
219     VclPtrInstance<BibBookContainer> pMyWindow( pParent );
220     pMyWindow->Show();
221 
222     VclPtrInstance< ::bib::BibView> pView( pMyWindow, m_xDatMan.get(), WB_VSCROLL | WB_HSCROLL | WB_3DLOOK );
223     pView->Show();
224     m_xDatMan->SetView( pView );
225 
226     VclPtrInstance< ::bib::BibBeamer> pBeamer( pMyWindow, m_xDatMan.get() );
227     pBeamer->Show();
228     pMyWindow->createTopFrame(pBeamer);
229 
230     pMyWindow->createBottomFrame(pView);
231 
232     Reference< awt::XWindow >  xWin ( pMyWindow->GetComponentInterface(), UNO_QUERY );
233 
234     Reference< XController >  xCtrRef( new BibFrameController_Impl( xWin, m_xDatMan.get() ) );
235 
236     xCtrRef->attachFrame(rFrame);
237     rFrame->setComponent( xWin, xCtrRef);
238     pBeamer->SetXController(xCtrRef);
239 
240     if (aWindow)
241     {
242         // not earlier because SetFocus() is triggered in setVisible()
243         aWindow->setVisible(true);
244     }
245 
246     Reference<XLoadable>(m_xDatMan)->load();
247     m_xDatMan->RegisterInterceptor(pBeamer);
248 
249     if ( rListener.is() )
250         rListener->loadFinished( this );
251 
252     // attach menu bar
253     Reference< XPropertySet > xPropSet( rFrame, UNO_QUERY );
254     Reference< css::frame::XLayoutManager > xLayoutManager;
255     if ( xPropSet.is() )
256     {
257         try
258         {
259             Any a = xPropSet->getPropertyValue(u"LayoutManager"_ustr);
260             a >>= xLayoutManager;
261         }
262         catch ( const uno::Exception& )
263         {
264         }
265     }
266 
267     if ( xLayoutManager.is() )
268         xLayoutManager->createElement( u"private:resource/menubar/menubar"_ustr );
269 }
270 
GetDataManager() const271 BibDataManager* BibliographyLoader::GetDataManager()const
272 {
273     if(!m_xDatMan.is())
274     {
275         if(!m_pBibMod)
276             const_cast< BibliographyLoader* >( this )->m_pBibMod = OpenBibModul();
277         const_cast< BibliographyLoader* >( this )->m_xDatMan = BibModul::createDataManager();
278     }
279     return m_xDatMan.get();
280 }
281 
GetDataColumns() const282 Reference< XNameAccess > const & BibliographyLoader::GetDataColumns() const
283 {
284     if (!m_xColumns.is())
285     {
286         Reference< XMultiServiceFactory >  xMgr = comphelper::getProcessServiceFactory();
287         Reference< XRowSet >  xRowSet(xMgr->createInstance(u"com.sun.star.sdb.RowSet"_ustr), UNO_QUERY);
288         Reference< XPropertySet >  xResultSetProps(xRowSet, UNO_QUERY);
289         DBG_ASSERT(xResultSetProps.is() , "BibliographyLoader::GetDataCursor : invalid row set (no XResultSet or no XPropertySet) !");
290 
291         BibDBDescriptor aBibDesc = BibModul::GetConfig()->GetBibliographyURL();
292 
293         Any aBibUrlAny; aBibUrlAny <<= aBibDesc.sDataSource;
294         xResultSetProps->setPropertyValue(u"DataSourceName"_ustr, aBibUrlAny);
295         Any aCommandType; aCommandType <<= aBibDesc.nCommandType;
296         xResultSetProps->setPropertyValue(u"CommandType"_ustr, aCommandType);
297         Any aTableName; aTableName <<= aBibDesc.sTableOrQuery;
298         xResultSetProps->setPropertyValue(u"Command"_ustr, aTableName);
299         Any aResultSetType; aResultSetType <<= sal_Int32(ResultSetType::SCROLL_INSENSITIVE);
300         xResultSetProps->setPropertyValue(u"ResultSetType"_ustr, aResultSetType);
301         Any aResultSetCurrency; aResultSetCurrency <<= sal_Int32(ResultSetConcurrency::UPDATABLE);
302         xResultSetProps->setPropertyValue(u"ResultSetConcurrency"_ustr, aResultSetCurrency);
303 
304         bool bSuccess = false;
305         try
306         {
307             xRowSet->execute();
308             bSuccess = true;
309         }
310         catch(const SQLException&)
311         {
312             DBG_UNHANDLED_EXCEPTION("extensions.biblio");
313         }
314         catch(const Exception& )
315         {
316             DBG_UNHANDLED_EXCEPTION("extensions.biblio");
317             bSuccess = false;
318         }
319 
320         if (!bSuccess)
321         {
322             Reference< XComponent >  xSetComp(xRowSet, UNO_QUERY);
323             if (xSetComp.is())
324                 xSetComp->dispose();
325             xRowSet = nullptr;
326         }
327         else
328             const_cast<BibliographyLoader*>(this)->m_xCursor = xRowSet.get();
329 
330         Reference< sdbcx::XColumnsSupplier >  xSupplyCols(m_xCursor, UNO_QUERY);
331         if (xSupplyCols.is())
332             const_cast<BibliographyLoader*>(this)->m_xColumns = xSupplyCols->getColumns();
333     }
334 
335     return m_xColumns;
336 }
337 
GetIdentifierColumn() const338 Reference< sdb::XColumn >  BibliographyLoader::GetIdentifierColumn() const
339 {
340     BibDataManager* pDatMan = GetDataManager();
341     Reference< XNameAccess >  xColumns = GetDataColumns();
342     OUString sIdentifierColumnName = pDatMan->GetIdentifierMapping();
343 
344     Reference< sdb::XColumn >  xReturn;
345     if (xColumns.is() && xColumns->hasByName(sIdentifierColumnName))
346     {
347         xReturn.set(xColumns->getByName(sIdentifierColumnName), UNO_QUERY);
348     }
349     return xReturn;
350 }
351 
GetDataCursor() const352 Reference< XResultSet > const &  BibliographyLoader::GetDataCursor() const
353 {
354     if (!m_xCursor.is())
355         GetDataColumns();
356     if (m_xCursor.is())
357         m_xCursor->first();
358     return m_xCursor;
359 }
360 
lcl_AddProperty(const Reference<XNameAccess> & xColumns,const Mapping * pMapping,const OUString & rColumnName)361 static OUString lcl_AddProperty(const Reference< XNameAccess >&  xColumns,
362         const Mapping* pMapping, const OUString& rColumnName)
363 {
364     OUString sColumnName(rColumnName);
365     if(pMapping)
366     {
367         for(const auto & aColumnPair : pMapping->aColumnPairs)
368         {
369             if(aColumnPair.sLogicalColumnName == rColumnName)
370             {
371                 sColumnName = aColumnPair.sRealColumnName;
372                 break;
373             }
374         }
375     }
376     OUString uColumnName(sColumnName);
377     OUString uRet;
378     Reference< sdb::XColumn >  xCol;
379     if (xColumns->hasByName(uColumnName))
380         xCol.set(xColumns->getByName(uColumnName), UNO_QUERY);
381     if (xCol.is())
382         uRet = xCol->getString();
383     return uRet;
384 }
385 
getByName(const OUString & rName)386 Any BibliographyLoader::getByName(const OUString& rName)
387 {
388     Any aRet;
389     try
390     {
391         BibDataManager* pDatMan = GetDataManager();
392         Reference< XResultSet >  xCursor = GetDataCursor();
393         Reference< sdbcx::XColumnsSupplier >  xSupplyCols(xCursor, UNO_QUERY);
394         Reference< XNameAccess >  xColumns;
395         if (!xSupplyCols.is())
396             return aRet;
397         xColumns = xSupplyCols->getColumns();
398         DBG_ASSERT(xSupplyCols.is(), "BibliographyLoader::getByName : invalid columns returned by the data cursor (may be the result set is not alive ?) !");
399         if (!xColumns.is())
400             return aRet;
401 
402         const OUString sIdentifierMapping = pDatMan->GetIdentifierMapping();
403         Reference< sdb::XColumn >  xColumn;
404         if (xColumns->hasByName(sIdentifierMapping))
405             xColumn.set(xColumns->getByName(sIdentifierMapping), UNO_QUERY);
406         if (xColumn.is())
407         {
408             do
409             {
410                 if ((rName == xColumn->getString()) && !xColumn->wasNull())
411                 {
412                     Sequence<PropertyValue> aPropSequ(COLUMN_COUNT);
413                     PropertyValue* pValues = aPropSequ.getArray();
414                     BibConfig* pConfig = BibModul::GetConfig();
415                     BibDBDescriptor aBibDesc = BibModul::GetConfig()->GetBibliographyURL();
416                     const Mapping* pMapping = pConfig->GetMapping(aBibDesc);
417                     for(sal_uInt16 nEntry = 0; nEntry < COLUMN_COUNT; nEntry++)
418                     {
419                         const OUString& sColName = pConfig->GetDefColumnName(
420                                                     nEntry);
421                         pValues[nEntry].Name = sColName;
422                         pValues[nEntry].Value <<= lcl_AddProperty(xColumns, pMapping, sColName);
423                     }
424                     aRet <<= aPropSequ;
425 
426                     break;
427                 }
428             }
429             while(xCursor->next());
430         }
431     }
432     catch(const Exception&)
433     {
434         DBG_UNHANDLED_EXCEPTION("extensions.biblio");
435     }
436     return aRet;
437 }
438 
getElementNames()439 Sequence< OUString > BibliographyLoader::getElementNames()
440 {
441     Sequence< OUString > aRet(10);
442     int nRealNameCount = 0;
443     try
444     {
445         Reference< XResultSet >  xCursor(GetDataCursor());
446         Reference< sdb::XColumn >  xIdColumn(GetIdentifierColumn());
447         if (xIdColumn.is()) // implies xCursor.is()
448         {
449             do
450             {
451                 OUString sTemp = xIdColumn->getString();
452                 if (!sTemp.isEmpty() && !xIdColumn->wasNull())
453                 {
454                     int nLen = aRet.getLength();
455                     if(nLen == nRealNameCount)
456                         aRet.realloc(nLen + 10);
457                     OUString* pArray = aRet.getArray();
458                     pArray[nRealNameCount] = sTemp;
459                     nRealNameCount++;
460                 }
461             }
462             while (xCursor->next());
463         }
464     }
465     catch(const Exception&)
466     {
467         DBG_UNHANDLED_EXCEPTION("extensions.biblio");
468     }
469 
470     aRet.realloc(nRealNameCount);
471     return aRet;
472 }
473 
hasByName(const OUString & rName)474 sal_Bool BibliographyLoader::hasByName(const OUString& rName)
475 {
476     bool bRet = false;
477     try
478     {
479         Reference< XResultSet >  xCursor = GetDataCursor();
480         Reference< sdb::XColumn >  xIdColumn = GetIdentifierColumn();
481 
482         if (xIdColumn.is())     // implies xCursor.is()
483         {
484             do
485             {
486                 OUString sCurrentId = xIdColumn->getString();
487                 if (!xIdColumn->wasNull() && rName.startsWith(sCurrentId))
488                 {
489                     bRet = true;
490                     break;
491                 }
492             }
493             while(xCursor->next());
494         }
495     }
496     catch(const Exception&)
497     {
498         DBG_UNHANDLED_EXCEPTION("extensions.biblio");
499     }
500     return bRet;
501 }
502 
getElementType()503 Type  BibliographyLoader::getElementType()
504 {
505     return cppu::UnoType<Sequence<PropertyValue>>::get();
506 }
507 
hasElements()508 sal_Bool BibliographyLoader::hasElements()
509 {
510     Reference< XNameAccess >  xColumns = GetDataColumns();
511     return xColumns.is() && xColumns->getElementNames().hasElements();
512 }
513 
getPropertySetInfo()514 Reference< XPropertySetInfo >  BibliographyLoader::getPropertySetInfo()
515 {
516     static const SfxItemPropertyMapEntry aBibProps_Impl[] =
517     {
518         { u"BibliographyDataFieldNames"_ustr, 0, cppu::UnoType<Sequence<PropertyValue>>::get(), PropertyAttribute::READONLY, 0},
519     };
520     static Reference< XPropertySetInfo >  xRet =
521         SfxItemPropertySet(aBibProps_Impl).getPropertySetInfo();
522     return xRet;
523 }
524 
setPropertyValue(const OUString &,const Any &)525 void BibliographyLoader::setPropertyValue(const OUString& /*PropertyName*/,
526                                         const Any& /*aValue*/)
527 {
528     throw UnknownPropertyException();
529     //no changeable properties
530 }
531 
getPropertyValue(const OUString & rPropertyName)532 Any BibliographyLoader::getPropertyValue(const OUString& rPropertyName)
533 {
534     Any aRet;
535     static const sal_uInt16 aInternalMapping[] =
536     {
537         IDENTIFIER_POS             , // BibliographyDataField_IDENTIFIER
538         AUTHORITYTYPE_POS          , // BibliographyDataField_BIBILIOGRAPHIC_TYPE
539         ADDRESS_POS                , // BibliographyDataField_ADDRESS
540         ANNOTE_POS                 , // BibliographyDataField_ANNOTE
541         AUTHOR_POS                 , // BibliographyDataField_AUTHOR
542         BOOKTITLE_POS              , // BibliographyDataField_BOOKTITLE
543         CHAPTER_POS                , // BibliographyDataField_CHAPTER
544         EDITION_POS                , // BibliographyDataField_EDITION
545         EDITOR_POS                 , // BibliographyDataField_EDITOR
546         HOWPUBLISHED_POS           , // BibliographyDataField_HOWPUBLISHED
547         INSTITUTION_POS            , // BibliographyDataField_INSTITUTION
548         JOURNAL_POS                , // BibliographyDataField_JOURNAL
549         MONTH_POS                  , // BibliographyDataField_MONTH
550         NOTE_POS                   , // BibliographyDataField_NOTE
551         NUMBER_POS                 , // BibliographyDataField_NUMBER
552         ORGANIZATIONS_POS          , // BibliographyDataField_ORGANIZATIONS
553         PAGES_POS                  , // BibliographyDataField_PAGES
554         PUBLISHER_POS              , // BibliographyDataField_PUBLISHER
555         SCHOOL_POS                 , // BibliographyDataField_SCHOOL
556         SERIES_POS                 , // BibliographyDataField_SERIES
557         TITLE_POS                  , // BibliographyDataField_TITLE
558         REPORTTYPE_POS             , // BibliographyDataField_REPORT_TYPE
559         VOLUME_POS                 , // BibliographyDataField_VOLUME
560         YEAR_POS                   , // BibliographyDataField_YEAR
561         URL_POS                    , // BibliographyDataField_URL
562         CUSTOM1_POS                , // BibliographyDataField_CUSTOM1
563         CUSTOM2_POS                , // BibliographyDataField_CUSTOM2
564         CUSTOM3_POS                , // BibliographyDataField_CUSTOM3
565         CUSTOM4_POS                , // BibliographyDataField_CUSTOM4
566         CUSTOM5_POS                , // BibliographyDataField_CUSTOM5
567         ISBN_POS                   , // BibliographyDataField_ISBN
568         LOCAL_URL_POS                // BibliographyDataField_LOCAL_URL
569     };
570     if(rPropertyName != "BibliographyDataFieldNames")
571         throw UnknownPropertyException(rPropertyName);
572     Sequence<PropertyValue> aSeq(COLUMN_COUNT);
573     PropertyValue* pArray = aSeq.getArray();
574     BibConfig* pConfig = BibModul::GetConfig();
575     for(sal_uInt16 i = 0; i <= text::BibliographyDataField::LOCAL_URL ; i++)
576     {
577         pArray[i].Name = pConfig->GetDefColumnName(aInternalMapping[i]);
578         pArray[i].Value <<= static_cast<sal_Int16>(i);
579     }
580     aRet <<= aSeq;
581     return aRet;
582 }
583 
addPropertyChangeListener(const OUString &,const Reference<XPropertyChangeListener> &)584 void BibliographyLoader::addPropertyChangeListener(
585         const OUString& /*PropertyName*/, const Reference< XPropertyChangeListener > & /*aListener*/)
586 {
587     //no bound properties
588 }
589 
removePropertyChangeListener(const OUString &,const Reference<XPropertyChangeListener> &)590 void BibliographyLoader::removePropertyChangeListener(
591         const OUString& /*PropertyName*/, const Reference< XPropertyChangeListener > & /*aListener*/)
592 {
593     //no bound properties
594 }
595 
addVetoableChangeListener(const OUString &,const Reference<XVetoableChangeListener> &)596 void BibliographyLoader::addVetoableChangeListener(
597     const OUString& /*PropertyName*/, const Reference< XVetoableChangeListener > & /*aListener*/)
598 {
599     //no vetoable properties
600 }
601 
removeVetoableChangeListener(const OUString &,const Reference<XVetoableChangeListener> &)602 void BibliographyLoader::removeVetoableChangeListener(
603     const OUString& /*PropertyName*/, const Reference< XVetoableChangeListener > & /*aListener*/)
604 {
605     //no vetoable properties
606 }
607 
608 
609 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
610