summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2020-05-15 18:17:34 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-06-05 01:12:37 +0200
commitcdcbf109c47d366539b98c6e379874ae08de08e1 (patch)
tree463099e7805d42db616d72ac26ef9962378c84ed /include
parentb52d304969a15e00d82745f4d2f96c04f188eb97 (diff)
tdf#120394: list format string can be empty
We need to distunguish when we have list format string, but it is empty (no level text will be diplayed) or it does not exist at all, so we need to fallback to old prefix-suffix syntax. Change-Id: Ifd4ccd5a676db86c39d2ef48e91d191d92b9b2a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94322 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit d8329149394e4e5758a9e293b0162db050379a4e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95413
Diffstat (limited to 'include')
-rw-r--r--include/editeng/numitem.hxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index 52cb14858c1f..b1fa7c66b039 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -31,6 +31,7 @@
#include <editeng/editengdllapi.h>
#include <o3tl/typed_flags_set.hxx>
#include <memory>
+#include <optional>
#include <algorithm>
class SvxBrushItem;
@@ -102,7 +103,9 @@ public:
private:
OUString sPrefix;
OUString sSuffix;
- OUString sListFormat; // Format string ">%1.%2<" can be used instead of prefix/suffix
+ std::optional<OUString> sListFormat; // Format string ">%1.%2<" can be used instead of prefix/suffix
+ // Right now it is optional value to dostinguish empty list format
+ // and not set list format when we need to fallback to prefix/suffix.
SvxAdjust eNumAdjust;
@@ -168,7 +171,8 @@ public:
void SetSuffix(const OUString& rSet) { sSuffix = rSet;}
const OUString& GetSuffix() const { return sSuffix;}
void SetListFormat(const OUString& rSet) { sListFormat = rSet; }
- const OUString& GetListFormat() const { return sListFormat; }
+ bool HasListFormat() const { return sListFormat.has_value(); }
+ const OUString& GetListFormat() const { return *sListFormat; }
void SetCharFormatName(const OUString& rSet){ sCharStyleName = rSet; }
virtual OUString GetCharFormatName()const;