diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appuno.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/view/frmload.cxx | 4 |
3 files changed, 26 insertions, 1 deletions
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index bfbe90dc896b..ff3fdfe91b6e 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -174,6 +174,7 @@ static char const sLockExport[] = "LockExport"; static char const sLockPrint[] = "LockPrint"; static char const sLockSave[] = "LockSave"; static char const sLockEditDoc[] = "LockEditDoc"; +static char const sReplaceable[] = "Replaceable"; static bool isMediaDescriptor( sal_uInt16 nSlotId ) { @@ -888,6 +889,14 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert if (bOK) rSet.Put( SfxBoolItem( SID_LOCK_EDITDOC, bVal ) ); } + else if (aName == sReplaceable) + { + bool bVal = false; + bool bOK = (rProp.Value >>= bVal); + DBG_ASSERT(bOK, "invalid type for Replaceable"); + if (bOK) + rSet.Put(SfxBoolItem(SID_REPLACEABLE, bVal)); + } #ifdef DBG_UTIL else --nFoundArgs; @@ -1115,6 +1124,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b nAdditional++; if ( rSet.GetItemState( SID_LOCK_EDITDOC ) == SfxItemState::SET ) nAdditional++; + if (rSet.GetItemState(SID_REPLACEABLE) == SfxItemState::SET) + nAdditional++; // consider additional arguments nProps += nAdditional; @@ -1282,6 +1293,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b continue; if ( nId == SID_LOCK_EDITDOC ) continue; + if (nId == SID_REPLACEABLE) + continue; } OString aDbg = "Unknown item detected: " + OString::number(static_cast<sal_Int32>(nId)); @@ -1699,6 +1712,11 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b pValue[nActProp].Name = sLockEditDoc; pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); } + if (rSet.GetItemState(SID_REPLACEABLE, false, &pItem) == SfxItemState::SET) + { + pValue[nActProp].Name = sReplaceable; + pValue[nActProp++].Value <<= static_cast<const SfxBoolItem*>(pItem)->GetValue(); + } } rArgs = aSequ; diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 394475c40129..a136f74f2886 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1099,6 +1099,11 @@ void SAL_CALL SfxBaseModel::setArgs(const Sequence<beans::PropertyValue>& aArgs) rArg.Value >>= bValue; pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_EDITDOC, bValue)); } + else if (rArg.Name == "Replaceable") + { + rArg.Value >>= bValue; + pMedium->GetItemSet()->Put(SfxBoolItem(SID_REPLACEABLE, bValue)); + } else { throw lang::IllegalArgumentException("Setting property not supported: " + rArg.Name, diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index d098ac5c00e2..b16d9b471048 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -624,7 +624,9 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA const OUString sURL = aDescriptor.getOrDefault( "URL", OUString() ); const bool bIsFactoryURL = sURL.startsWith( "private:factory/" ); bool bInitNewModel = bIsFactoryURL; - if ( bIsFactoryURL && !bExternalModel ) + const bool bIsDefault = bIsFactoryURL && !bExternalModel; + aDescriptor.put("Replaceable", bIsDefault); + if (bIsDefault) { const OUString sFactory = sURL.copy( sizeof( "private:factory/" ) -1 ); // special handling for some weird factory URLs a la private:factory/swriter?slot=21053 |