summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/editeng/editdoc.cxx9
-rw-r--r--include/svl/itempool.hxx1
-rw-r--r--svl/source/items/itempool.cxx15
3 files changed, 24 insertions, 1 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 0896b62af791..07a495d2bb1f 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -886,7 +886,14 @@ void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const Map
{
// If possible go through SlotID ...
- sal_uInt16 const nSourceWhich = nWhich;
+ sal_uInt16 nSourceWhich = nWhich;
+ sal_uInt16 nSlot = pDestPool->GetTrueSlotId( nWhich );
+ if ( nSlot )
+ {
+ sal_uInt16 nW = pSourcePool->GetTrueWhich( nSlot );
+ if ( nW )
+ nSourceWhich = nW;
+ }
if ( rSource.GetItemState( nSourceWhich, false ) == SfxItemState::SET )
{
diff --git a/include/svl/itempool.hxx b/include/svl/itempool.hxx
index 5b1d8b9af27c..f4f5d86f3a08 100644
--- a/include/svl/itempool.hxx
+++ b/include/svl/itempool.hxx
@@ -186,6 +186,7 @@ public:
sal_uInt16 GetWhich( sal_uInt16 nSlot, bool bDeep = true ) const;
sal_uInt16 GetSlotId( sal_uInt16 nWhich ) const;
sal_uInt16 GetTrueWhich( sal_uInt16 nSlot, bool bDeep = true ) const;
+ sal_uInt16 GetTrueSlotId( sal_uInt16 nWhich ) const;
static bool IsWhich(sal_uInt16 nId) {
return nId && nId <= SFX_WHICH_MAX; }
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index e82a5ea4a496..4357342dd499 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -939,6 +939,21 @@ sal_uInt16 SfxItemPool::GetTrueWhich( sal_uInt16 nSlotId, bool bDeep ) const
}
+sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich ) const
+{
+ if ( !IsWhich(nWhich) )
+ return 0;
+
+ if ( !IsInRange( nWhich ) )
+ {
+ if ( pImpl->mpSecondary )
+ return pImpl->mpSecondary->GetTrueSlotId(nWhich);
+ assert(false && "unknown WhichId - cannot get slot-id");
+ return 0;
+ }
+ return pItemInfos[nWhich - pImpl->mnStart]._nSID;
+}
+
void SfxItemPool::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("SfxItemPool"));