forms/source/component/DatabaseForm.cxx |   20 ++++++++++----------
 forms/source/inc/frm_strings.hxx        |    2 +-
 forms/source/misc/property.cxx          |    2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 43c15054a33fdd7d543f26dc9a46a6ba93d3271b
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Jul 24 14:06:26 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Jul 24 17:43:53 2024 +0200

    tdf#161865 Base Table Design View not editable
    
    we had an ODR violation with a constant named PROPERTY_DATASOURCE which
    is also defined inside dbaccess
    
    regression from
    commit bacb92275c0c474d09146c0409cb547aef6551cf
    "add dbu to --enable-mergelibs=more"
    
    Change-Id: I315ba82e0bccc49e01bd6a438b7e671b971410dc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170939
    Tested-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit ab704c00fd7a80e412b00cce9a8fb64e8937cc15)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170948

diff --git a/forms/source/component/DatabaseForm.cxx 
b/forms/source/component/DatabaseForm.cxx
index 868b6bd19f11..118054615aa4 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -1277,7 +1277,7 @@ void ODatabaseForm::describeFixedAndAggregateProperties(
 
     // we remove and re-declare the DataSourceName property, 'cause we want it 
to be constrained, and the
     // original property of our aggregate isn't
-    RemoveProperty( _rAggregateProps, PROPERTY_DATASOURCE );
+    RemoveProperty( _rAggregateProps, PROPERTY_DATASOURCENAME );
 
     // for connection sharing, we need to override the ActiveConnection 
property, too
     RemoveProperty( _rAggregateProps, PROPERTY_ACTIVE_CONNECTION );
@@ -1297,7 +1297,7 @@ void ODatabaseForm::describeFixedAndAggregateProperties(
     *pProperties++ = css::beans::Property(PROPERTY_NAME, PROPERTY_ID_NAME, 
cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND);
     *pProperties++ = css::beans::Property(PROPERTY_MASTERFIELDS, 
PROPERTY_ID_MASTERFIELDS, cppu::UnoType<Sequence< OUString >>::get(), 
css::beans::PropertyAttribute::BOUND);
     *pProperties++ = css::beans::Property(PROPERTY_DETAILFIELDS, 
PROPERTY_ID_DETAILFIELDS, cppu::UnoType<Sequence< OUString >>::get(), 
css::beans::PropertyAttribute::BOUND);
-    *pProperties++ = css::beans::Property(PROPERTY_DATASOURCE, 
PROPERTY_ID_DATASOURCE, cppu::UnoType<OUString>::get(), 
css::beans::PropertyAttribute::BOUND | 
css::beans::PropertyAttribute::CONSTRAINED);
+    *pProperties++ = css::beans::Property(PROPERTY_DATASOURCENAME, 
PROPERTY_ID_DATASOURCE, cppu::UnoType<OUString>::get(), 
css::beans::PropertyAttribute::BOUND | 
css::beans::PropertyAttribute::CONSTRAINED);
     *pProperties++ = css::beans::Property(PROPERTY_CYCLE, PROPERTY_ID_CYCLE, 
cppu::UnoType<TabulatorCycle>::get(), css::beans::PropertyAttribute::BOUND | 
css::beans::PropertyAttribute::MAYBEVOID | 
css::beans::PropertyAttribute::MAYBEDEFAULT);
     *pProperties++ = css::beans::Property(PROPERTY_FILTER, PROPERTY_ID_FILTER, 
cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND | 
css::beans::PropertyAttribute::MAYBEDEFAULT);
     *pProperties++ = css::beans::Property(PROPERTY_HAVINGCLAUSE, 
PROPERTY_ID_HAVINGCLAUSE, cppu::UnoType<OUString>::get(), 
css::beans::PropertyAttribute::BOUND | 
css::beans::PropertyAttribute::MAYBEDEFAULT);
@@ -1455,7 +1455,7 @@ void ODatabaseForm::getFastPropertyValue( Any& rValue, 
sal_Int32 nHandle ) const
             break;
 
         case PROPERTY_ID_DATASOURCE:
-            rValue = m_xAggregateSet->getPropertyValue( PROPERTY_DATASOURCE );
+            rValue = m_xAggregateSet->getPropertyValue( 
PROPERTY_DATASOURCENAME );
             break;
 
         case PROPERTY_ID_TARGET_URL:
@@ -1649,7 +1649,7 @@ void ODatabaseForm::setFastPropertyValue_NoBroadcast( 
sal_Int32 nHandle, const A
 
             try
             {
-                m_xAggregateSet->setPropertyValue(PROPERTY_DATASOURCE, rValue);
+                m_xAggregateSet->setPropertyValue(PROPERTY_DATASOURCENAME, 
rValue);
             }
             catch(const Exception&)
             {
@@ -2363,7 +2363,7 @@ void SAL_CALL ODatabaseForm::setParent(const 
css::uno::Reference<css::uno::XInte
     bool bIsEmbedded = ::dbtools::isEmbeddedInDatabase( Parent, 
xOuterConnection );
 
     if ( bIsEmbedded )
-        xAggregateProperties->setPropertyValue( PROPERTY_DATASOURCE, Any( 
OUString() ) );
+        xAggregateProperties->setPropertyValue( PROPERTY_DATASOURCENAME, Any( 
OUString() ) );
 }
 
 
@@ -2609,14 +2609,14 @@ bool ODatabaseForm::canShareConnection( const 
Reference< XPropertySet >& _rxPare
 {
     // our own data source
     OUString sOwnDatasource;
-    m_xAggregateSet->getPropertyValue( PROPERTY_DATASOURCE ) >>= 
sOwnDatasource;
+    m_xAggregateSet->getPropertyValue( PROPERTY_DATASOURCENAME ) >>= 
sOwnDatasource;
 
     // our parents data source
     OUString sParentDataSource;
-    OSL_ENSURE( _rxParentProps.is() && 
_rxParentProps->getPropertySetInfo().is() && 
_rxParentProps->getPropertySetInfo()->hasPropertyByName( PROPERTY_DATASOURCE ),
+    OSL_ENSURE( _rxParentProps.is() && 
_rxParentProps->getPropertySetInfo().is() && 
_rxParentProps->getPropertySetInfo()->hasPropertyByName( 
PROPERTY_DATASOURCENAME ),
         "ODatabaseForm::doShareConnection: invalid parent form!" );
     if ( _rxParentProps.is() )
-        _rxParentProps->getPropertyValue( PROPERTY_DATASOURCE ) >>= 
sParentDataSource;
+        _rxParentProps->getPropertyValue( PROPERTY_DATASOURCENAME ) >>= 
sParentDataSource;
 
     bool bCanShareConnection = false;
 
@@ -3759,7 +3759,7 @@ void SAL_CALL ODatabaseForm::write(const 
Reference<XObjectOutputStream>& _rxOutS
 
     OUString sDataSource;
     if (m_xAggregateSet.is())
-        m_xAggregateSet->getPropertyValue(PROPERTY_DATASOURCE) >>= sDataSource;
+        m_xAggregateSet->getPropertyValue(PROPERTY_DATASOURCENAME) >>= 
sDataSource;
     _rxOutStream << sDataSource;
 
     // former CursorSource
@@ -3879,7 +3879,7 @@ void SAL_CALL ODatabaseForm::read(const 
Reference<XObjectInputStream>& _rxInStre
     OUString sAggregateProp;
     _rxInStream >> sAggregateProp;
     if (m_xAggregateSet.is())
-        m_xAggregateSet->setPropertyValue(PROPERTY_DATASOURCE, 
Any(sAggregateProp));
+        m_xAggregateSet->setPropertyValue(PROPERTY_DATASOURCENAME, 
Any(sAggregateProp));
     _rxInStream >> sAggregateProp;
     if (m_xAggregateSet.is())
         m_xAggregateSet->setPropertyValue(PROPERTY_COMMAND, 
Any(sAggregateProp));
diff --git a/forms/source/inc/frm_strings.hxx b/forms/source/inc/frm_strings.hxx
index 709f3529db9d..81b0b917fdd8 100644
--- a/forms/source/inc/frm_strings.hxx
+++ b/forms/source/inc/frm_strings.hxx
@@ -190,7 +190,7 @@ inline constexpr OUString PROPERTY_TITLE = u"Title"_ustr;
 inline constexpr OUString PROPERTY_ACTIVE_CONNECTION = 
u"ActiveConnection"_ustr;
 inline constexpr OUString PROPERTY_SCALE = u"Scale"_ustr;
 inline constexpr OUString PROPERTY_SORT = u"Order"_ustr;
-inline constexpr OUString PROPERTY_DATASOURCE = u"DataSourceName"_ustr;
+inline constexpr OUString PROPERTY_DATASOURCENAME = u"DataSourceName"_ustr;
 inline constexpr OUString PROPERTY_DETAILFIELDS = u"DetailFields"_ustr;
 
 inline constexpr OUString PROPERTY_COLUMNSERVICENAME = 
u"ColumnServiceName"_ustr;
diff --git a/forms/source/misc/property.cxx b/forms/source/misc/property.cxx
index 6200b343865d..fb6ea915a908 100644
--- a/forms/source/misc/property.cxx
+++ b/forms/source/misc/property.cxx
@@ -116,7 +116,7 @@ void PropertyInfoService::initialize()
         { PROPERTY_DECIMALS, PROPERTY_ID_DECIMALS },
         { PROPERTY_REFVALUE, PROPERTY_ID_REFVALUE },
         { PROPERTY_STRICTFORMAT, PROPERTY_ID_STRICTFORMAT },
-        { PROPERTY_DATASOURCE, PROPERTY_ID_DATASOURCE },
+        { PROPERTY_DATASOURCENAME, PROPERTY_ID_DATASOURCE },
         { PROPERTY_ALLOWADDITIONS, PROPERTY_ID_ALLOWADDITIONS },
         { PROPERTY_ALLOWEDITS, PROPERTY_ID_ALLOWEDITS },
         { PROPERTY_ALLOWDELETIONS, PROPERTY_ID_ALLOWDELETIONS },

Reply via email to