summaryrefslogtreecommitdiff
path: root/oox/source/helper
diff options
context:
space:
mode:
authorArmin Le Grand (Allotropia) <Armin.Le.Grand@me.com>2022-04-04 16:57:08 +0200
committerArmin Le Grand <Armin.Le.Grand@me.com>2022-04-05 14:20:46 +0200
commitc79fa460fe6220051bbda2d3c0cb67fbf765e2ac (patch)
tree1a3503ed30f8552f8ee1b7d8685433ceeb690ab1 /oox/source/helper
parenta2bcac670ef0254d8b2e8632cfe07bb855b28d1c (diff)
Advanced Diagram support: Move Diagram Text information to svx
In a next step to get the Diagram mechanism/ModelData independent from oox, I moved the Text ModelData to svx, using a TextBody struct. This is a 1st move that covers most of what the algorithms to handle Diagram re-layout and other functionality use. This will potentially have to be extended accordingly when missing data is detected. It is potentially much more simple as the oox TextBody, by purpose. Due to functionality using that data I could now massively move more of it to svx. Change-Id: I6d6e6c572f119aeefa4e91eff56f58f3ceb6a31e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132523 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'oox/source/helper')
-rw-r--r--oox/source/helper/propertymap.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx
index 83495dc879b1..608614441b21 100644
--- a/oox/source/helper/propertymap.cxx
+++ b/oox/source/helper/propertymap.cxx
@@ -224,6 +224,22 @@ const OUString& PropertyMap::getPropertyName( sal_Int32 nPropId )
return GetPropertyNameVector()[ nPropId ];
}
+sal_Int32 PropertyMap::getPropertyId( std::u16string_view sPropName )
+{
+ // This may use a std::map to get faster from String to ID in the
+ // future, inside the [0..PROP_COUNT[ entries. Since it is currently
+ // only used for Diagram re-creation I opted fo less mem usage here
+ if(sPropName.empty())
+ return -1;
+
+ const std::vector<OUString>& rVec(GetPropertyNameVector());
+ for(size_t a(0); a < rVec.size(); a++)
+ if(rVec[a] == sPropName)
+ return a;
+
+ return -1;
+}
+
void PropertyMap::assignAll( const PropertyMap& rPropMap )
{
for (auto const& prop : rPropMap.maProperties)