summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdattr.cxx8
-rw-r--r--svx/source/svdraw/svdedxv.cxx27
-rw-r--r--svx/source/table/svdotable.cxx4
3 files changed, 37 insertions, 2 deletions
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 1100b0e3156d..196a344b6111 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -100,6 +100,7 @@
#include <svx/xflclit.hxx>
#include <svx/xlineit0.hxx>
#include <svx/xtable.hxx>
+#include <libxml/xmlwriter.h>
using namespace ::com::sun::star;
@@ -1110,6 +1111,13 @@ bool SdrTextVertAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberI
return true;
}
+void SdrTextVertAdjustItem::dumpAsXml(struct _xmlTextWriter* pWriter) const
+{
+ xmlTextWriterStartElement(pWriter, BAD_CAST("SdrTextVertAdjustItem"));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr()));
+ xmlTextWriterEndElement(pWriter);
+}
SfxPoolItem* SdrTextHorzAdjustItem::Clone(SfxItemPool* /*pPool*/) const { return new SdrTextHorzAdjustItem(*this); }
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: */
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index eadd5a9a818a..0f448535b777 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -1171,6 +1171,10 @@ const SfxItemSet& SdrTableObj::GetActiveCellItemSet() const
return getActiveCell()->GetItemSet();
}
+void SdrTableObj::SetMergedItemSetAndBroadcastOnActiveCell(const SfxItemSet& rSet, bool bClearAllItems)
+{
+ return getActiveCell()->SetMergedItemSetAndBroadcast(rSet, bClearAllItems);
+}
void SdrTableObj::setTableStyle( const Reference< XIndexAccess >& xTableStyle )
{