summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2023-04-07 13:32:49 +0300
committerAndras Timar <andras.timar@collabora.com>2023-04-27 23:16:45 +0200
commit925525d65466ae7be23d3d600bc379781b8905a5 (patch)
treeec26fe2226b409e2d6960aa15361bee829a63617 /xmloff
parentbd87b6a1b784c26d39a36ff54336c9caf08aec7c (diff)
xmloff: ODF import/export for style:overflow-behavior "clip"
Adds initial support for style:overflow-behavior According to OpenDocument-v1.3-part3 style:overflow-behavior can take values of: - "clip" - "auto-create-new-frame" This patch doesn't properly implement support "auto-create-new-frame", only "clip". If "clip" is set, TextClipVerticalOverflow is set to true, causing the vertical overflowing text to be clipped. "auto-create-new-frame" is treated the same as omitting the style:overflow-behavior attribute, setting TextClipVerticalOverflow to false. Change-Id: Iea298f41fbf0cf18dc07f41788ba0b665515db8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150122 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/xmlprop.hxx1
-rw-r--r--xmloff/source/core/xmltoken.cxx2
-rw-r--r--xmloff/source/draw/sdpropls.cxx1
-rw-r--r--xmloff/source/style/prhdlfac.cxx5
-rw-r--r--xmloff/source/token/tokens.txt2
5 files changed, 11 insertions, 0 deletions
diff --git a/xmloff/inc/xmlprop.hxx b/xmloff/inc/xmlprop.hxx
index 3b2cd86816bc..b93bf926e569 100644
--- a/xmloff/inc/xmlprop.hxx
+++ b/xmloff/inc/xmlprop.hxx
@@ -611,6 +611,7 @@ inline constexpr OUStringLiteral PROP_TextAutoGrowWidth = u"TextAutoGrowWidth";
inline constexpr OUStringLiteral PROP_TextBreak = u"TextBreak";
inline constexpr OUStringLiteral PROP_TextCanOverlap = u"TextCanOverlap";
inline constexpr OUStringLiteral PROP_TextChainNextName = u"TextChainNextName";
+inline constexpr OUStringLiteral PROP_TextClipVerticalOverflow = u"TextClipVerticalOverflow";
inline constexpr OUStringLiteral PROP_TextColor = u"TextColor";
inline constexpr OUStringLiteral PROP_TextColumns = u"TextColumns";
inline constexpr OUStringLiteral PROP_TextContourFrame = u"TextContourFrame";
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index ebfaaef97dee..75dc00177665 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -299,6 +299,7 @@ namespace xmloff::token {
TOKEN( "author-name", XML_AUTHOR_NAME ),
TOKEN( "auto", XML_AUTO ),
TOKEN( "auto-complete", XML_AUTO_COMPLETE ),
+ TOKEN( "auto-create-new-frame", XML_AUTO_CREATE_NEW_FRAME ),
TOKEN( "auto-grow-height", XML_AUTO_GROW_HEIGHT ),
TOKEN( "auto-grow-width", XML_AUTO_GROW_WIDTH ),
TOKEN( "auto-reload", XML_AUTO_RELOAD ),
@@ -1468,6 +1469,7 @@ namespace xmloff::token {
TOKEN( "outline-style", XML_OUTLINE_STYLE ),
TOKEN( "outset", XML_OUTSET ),
TOKEN( "outside", XML_OUTSIDE ),
+ TOKEN( "overflow-behavior", XML_OVERFLOW_BEHAVIOR ),
TOKEN( "overlap", XML_OVERLAP ),
TOKEN( "overlay", XML_OVERLAY ),
TOKEN( "p", XML_P ),
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index 278e0c2bc179..6d0553173c7a 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -150,6 +150,7 @@ const XMLPropertyMapEntry aXMLSDProperties[] =
GMAP( PROP_NumberingRules, XML_NAMESPACE_TEXT, XML_LIST_STYLE_NAME, XML_TYPE_STRING, CTF_SD_NUMBERINGRULES_NAME ),
GMAP( PROP_TextWordWrap, XML_NAMESPACE_FO, XML_WRAP_OPTION, XML_TYPE_WRAP_OPTION, 0 ),
GMAP( PROP_TextChainNextName, XML_NAMESPACE_DRAW, XML_CHAIN_NEXT_NAME, XML_TYPE_STRING, 0 ),
+ GMAP( PROP_TextClipVerticalOverflow, XML_NAMESPACE_STYLE, XML_OVERFLOW_BEHAVIOR, XML_TYPE_TEXT_OVERFLOW_BEHAVIOR, 0 ),
GMAP( PROP_TextColumns, XML_NAMESPACE_STYLE, XML_COLUMNS, XML_TYPE_TEXT_COLUMNS|MID_FLAG_ELEMENT_ITEM, CTF_TEXTCOLUMNS ),
diff --git a/xmloff/source/style/prhdlfac.cxx b/xmloff/source/style/prhdlfac.cxx
index 3b8cbe371000..5ff7172834e4 100644
--- a/xmloff/source/style/prhdlfac.cxx
+++ b/xmloff/source/style/prhdlfac.cxx
@@ -469,6 +469,11 @@ std::unique_ptr<XMLPropertyHandler> XMLPropertyHandlerFactory::CreatePropertyHan
case XML_TYPE_TEXT_VERTICAL_POS:
pPropHdl.reset(new XMLConstantsPropertyHandler( pXML_VertPos_Enum, XML_TOKEN_INVALID ));
break;
+ case XML_TYPE_TEXT_OVERFLOW_BEHAVIOR:
+ // auto-create-new-frame isn't properly implemented yet. It just means don't clip.
+ pPropHdl.reset(new XMLNamedBoolPropertyHdl(GetXMLToken(XML_CLIP),
+ GetXMLToken(XML_AUTO_CREATE_NEW_FRAME)));
+ break;
}
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index f4b46572e748..1657466dfe80 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -204,6 +204,7 @@ author-initials
author-name
auto
auto-complete
+auto-create-new-frame
auto-grow-height
auto-grow-width
auto-reload
@@ -1368,6 +1369,7 @@ outline-level-style
outline-style
outset
outside
+overflow-behavior
overlap
overlay
p