summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2023-03-29 19:44:18 +0300
committerMiklos Vajna <vmiklos@collabora.com>2023-04-19 12:57:59 +0200
commite87a5b20dd73a3333e1e19cd43198bb7c8ba9ec2 (patch)
treee2451507f31aedfd9d8c8ecef2607f9fe53dd6f4 /svx
parent05ca303a3587a27edeb1602331ba01a9635ef6c5 (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150521 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/inc/cell.hxx3
-rw-r--r--svx/source/svdraw/svdattr.cxx3
-rw-r--r--svx/source/table/cell.cxx21
3 files changed, 27 insertions, 0 deletions
diff --git a/svx/source/inc/cell.hxx b/svx/source/inc/cell.hxx
index 36ce254d1aa7..8682f4de0752 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>
@@ -210,6 +211,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 b71ac9919f4a..e6ae60c877c8 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>
@@ -326,6 +328,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 8aef7510e45a..b4a246b73ea5 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>
@@ -95,6 +96,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,
@@ -1102,6 +1104,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);
@@ -1222,6 +1232,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);