diff options
author | Sarper Akdemir <sarper.akdemir@collabora.com> | 2023-03-29 19:44:18 +0300 |
---|---|---|
committer | Sarper Akdemir <sarper.akdemir@collabora.com> | 2023-04-17 16:21:06 +0200 |
commit | 178832ef7139b9279a3ae0056eb11be9c476800e (patch) | |
tree | 28c49618beca5101f445a16dc1a9b131254d14df /svx/source | |
parent | 77655fc3dca05d4bb2366e67ccea228e3886bfe2 (diff) |
oox: tcPr vert roundtrip, introduce interopability grab bag for table cell
To properly roundtrip all possible values of <a:tcPr vert="...">
+ Introduce grab bag for table cell
+ on import: Store the unsupported values in the grab bag:
+ (e.g. wordArtVert, mongolianVert, wordArtVertRtl)
+ on export: if nothing is being exported from the doc
model, export the value from the grabbag
Also adds a unit test covering this behavior.
Change-Id: I791ed2d992b0a554ef6da37200f027cffd8c5f2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149737
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir <sarper.akdemir@collabora.com>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/inc/cell.hxx | 3 | ||||
-rw-r--r-- | svx/source/svdraw/svdattr.cxx | 3 | ||||
-rw-r--r-- | svx/source/table/cell.cxx | 21 |
3 files changed, 27 insertions, 0 deletions
diff --git a/svx/source/inc/cell.hxx b/svx/source/inc/cell.hxx index 331465f4eaa3..34ae09223ce5 100644 --- a/svx/source/inc/cell.hxx +++ b/svx/source/inc/cell.hxx @@ -27,6 +27,7 @@ #include <rtl/ref.hxx> #include <svl/style.hxx> +#include <svl/grabbagitem.hxx> #include <svx/sdtaitm.hxx> #include "tablemodel.hxx" #include <editeng/unotext.hxx> @@ -209,6 +210,8 @@ private: tools::Rectangle maCellRect; css::uno::Reference< css::table::XTable > mxTable; + + std::unique_ptr<SfxGrabBagItem> mpGrabBagItem = {}; }; diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 5af9956fc45d..1898f13140ae 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -43,6 +43,8 @@ #include <vcl/svapp.hxx> #include <vcl/settings.hxx> +#include <svl/grabbagitem.hxx> + #include <svx/strings.hrc> #include <svx/dialmgr.hxx> #include <svx/sdgcpitm.hxx> @@ -327,6 +329,7 @@ SdrItemPool::SdrItemPool( rPoolDefaults[ SDRATTR_TABLE_BORDER_TLBR - SDRATTR_START ] = new SvxLineItem( SDRATTR_TABLE_BORDER_TLBR ); rPoolDefaults[ SDRATTR_TABLE_BORDER_BLTR - SDRATTR_START ] = new SvxLineItem( SDRATTR_TABLE_BORDER_BLTR ); rPoolDefaults[ SDRATTR_TABLE_TEXT_ROTATION - SDRATTR_START ] = new SvxTextRotateItem(0_deg10, SDRATTR_TABLE_TEXT_ROTATION); + rPoolDefaults[ SDRATTR_TABLE_GRABBAG - SDRATTR_START ] = new SfxGrabBagItem(SDRATTR_TABLE_GRABBAG); rPoolDefaults[ SDRATTR_GLOW_RADIUS - SDRATTR_START ] = new SdrMetricItem(SDRATTR_GLOW_RADIUS, 0); rPoolDefaults[ SDRATTR_GLOW_COLOR - SDRATTR_START ] = new XColorItem(SDRATTR_GLOW_COLOR, aNullCol); diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 97490977a50e..d1dbd0f8088f 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -27,6 +27,7 @@ #include <comphelper/sequence.hxx> #include <o3tl/any.hxx> +#include <svl/grabbagitem.hxx> #include <svl/style.hxx> #include <svl/itemset.hxx> @@ -96,6 +97,7 @@ static const SvxItemPropertySet* ImplGetSvxCellPropertySet() { u"LeftBorder", SDRATTR_TABLE_BORDER, cppu::UnoType<BorderLine>::get(), 0, LEFT_BORDER }, { u"RightBorder", SDRATTR_TABLE_BORDER, cppu::UnoType<BorderLine>::get(), 0, RIGHT_BORDER }, { u"RotateAngle", SDRATTR_TABLE_TEXT_ROTATION, cppu::UnoType<sal_Int32>::get(), 0, 0 }, + { u"CellInteropGrabBag", SDRATTR_TABLE_GRABBAG, cppu::UnoType<css::uno::Sequence<css::beans::PropertyValue>>::get(), 0, 0}, SVX_UNOEDIT_OUTLINER_PROPERTIES, SVX_UNOEDIT_CHAR_PROPERTIES, @@ -1105,6 +1107,14 @@ void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any& mpProperties->SetObjectItem(SvxTextRotateItem(Degree10(nRotVal/10), SDRATTR_TABLE_TEXT_ROTATION)); return; } + case SDRATTR_TABLE_GRABBAG: + { + if (mpGrabBagItem == nullptr) + mpGrabBagItem.reset(new SfxGrabBagItem); + + mpGrabBagItem->PutValue(rValue, 0); + return; + } default: { SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID); @@ -1225,6 +1235,17 @@ Any SAL_CALL Cell::getPropertyValue( const OUString& PropertyName ) const SvxTextRotateItem& rTextRotate = mpProperties->GetItem(SDRATTR_TABLE_TEXT_ROTATION); return Any(sal_Int32(to<Degree100>(rTextRotate.GetValue()))); } + case SDRATTR_TABLE_GRABBAG: + { + if (mpGrabBagItem != nullptr) + { + Any aGrabBagSequence; + mpGrabBagItem->QueryValue(aGrabBagSequence); + return aGrabBagSequence; + } + else + return Any{css::uno::Sequence<css::beans::PropertyValue>()}; + } default: { SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID); |