summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdedxv.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/svdraw/svdedxv.cxx')
-rw-r--r--svx/source/svdraw/svdedxv.cxx27
1 files changed, 25 insertions, 2 deletions
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index cad1a1529bc9..512bc347af18 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2202,8 +2202,9 @@ static const sal_uInt16* GetFormatRangeImpl( bool bTextOnly )
SDRATTR_TABLE_FIRST, SDRATTR_TABLE_LAST,
XATTR_LINE_FIRST, XATTR_LINE_LAST,
XATTR_FILL_FIRST, XATTRSET_FILL,
- EE_PARA_START, EE_PARA_END,
+ EE_PARA_START, EE_PARA_END, // text-only from here on
EE_CHAR_START, EE_CHAR_END,
+ SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, // table cell formats
0,0
};
return &gRanges[ bTextOnly ? 10 : 0];
@@ -2229,6 +2230,17 @@ void SdrObjEditView::TakeFormatPaintBrush( std::shared_ptr< SfxItemSet >& rForma
const bool bOnlyHardAttr = false;
rFormatSet->Put( GetAttrFromMarked(bOnlyHardAttr) );
}
+
+ // check for cloning from table cell, in which case we need to copy cell-specific formatting attributes
+ const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ if( pObj && (pObj->GetObjInventor() == SdrInventor::Default ) && (pObj->GetObjIdentifier() == OBJ_TABLE) )
+ {
+ auto pTable = static_cast<const sdr::table::SdrTableObj*>(pObj);
+ if (pTable->getActiveCell().is()) {
+ SfxItemSet const & rSet = pTable->GetActiveCellItemSet();
+ rFormatSet->Put(rSet);
+ }
+ }
}
}
@@ -2300,9 +2312,9 @@ void SdrObjEditView::ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoChar
}
OutlinerView* pOLV = GetTextEditOutlinerView();
+ const SdrMarkList& rMarkList = GetMarkedObjectList();
if( !pOLV )
{
- const SdrMarkList& rMarkList = GetMarkedObjectList();
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
const SfxItemSet& rShapeSet = pObj->GetMergedItemSet();
@@ -2367,6 +2379,17 @@ void SdrObjEditView::ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoChar
pOLV->SetAttribs( aPaintSet );
}
}
+
+
+ // check for cloning to table cell, in which case we need to copy cell-specific formatting attributes
+ SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ if( pObj && (pObj->GetObjInventor() == SdrInventor::Default) && (pObj->GetObjIdentifier() == OBJ_TABLE) )
+ {
+ auto pTable = static_cast<sdr::table::SdrTableObj*>(pObj);
+ if (pTable->getActiveCell().is()) {
+ pTable->SetMergedItemSetAndBroadcastOnActiveCell(rFormatSet, false/*bClearAllItems*/);
+ }
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */