diff options
author | Tobias Lippert <drtl@fastmail.fm> | 2014-08-07 22:30:58 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-09-19 21:53:55 +0000 |
commit | 5013ac55090ab7a64b9549df67196aa5c7479542 (patch) | |
tree | b8305cc98935855ae69413b6afd1f1805591df41 /include | |
parent | 234b5de79fd10bd99b75d7b968581af7b6ffe44b (diff) |
fdo#84061 Fix setting text style sheet listeners in SdrTextObj
The code in SdrTextObj::ImpSetTextStyleSheetListeners is obviously not
working correctly.
The families of the stylesheets are appended to the name of the family
for further usage.
An encoded string looks like "STYLE_NAME|3 "
The family is then extracted by copying the first (length-6) bytes,
e.g., "STYLE_NAME" in this example. Then another copy starting a
position 1 is created, e.g., "TYLE_NAME". This string is cast to an
Int32. Since this is not possible, 0 is returned, and the originally
stored family is lost.
This patch corrects this behavior, and adds a unit test.
Change-Id: I60c0add6e4b670acbbc264cc77672452f282f737
Reviewed-on: https://gerrit.libreoffice.org/10818
Reviewed-by: Matúš Kukan <matus.kukan@collabora.com>
Tested-by: Matúš Kukan <matus.kukan@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/svdotext.hxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 9922e5e17ce8..a2b7b1f3e21c 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -25,6 +25,7 @@ #include <svx/svdoattr.hxx> #include <svx/svdtrans.hxx> #include <tools/datetime.hxx> +#include <rsc/rscsfx.hxx> #include <svx/xtextit0.hxx> #include <svx/svdtext.hxx> #include <vector> @@ -40,6 +41,7 @@ class OutlinerParaObject; class SdrOutliner; class SdrTextObj; +class SdrTextObjTest; class SvxFieldItem; class ImpSdrObjTextLink; class EditStatus; @@ -271,6 +273,12 @@ private: SVX_DLLPRIVATE ImpSdrObjTextLinkUserData* GetLinkUserData() const; // void ImpCheckItemSetChanges(const SfxItemSet& rAttr); + /** Appends the style family to a provided style name */ + static void AppendFamilyToStyleName(OUString& styleName, SfxStyleFamily family); + + /** Reads the style family from a style name to which the family has been appended. */ + static SfxStyleFamily ReadFamilyFromStyleName(const OUString& styleName); + protected: bool ImpCanConvTextToCurve() const; SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier, bool bNoSetAttr = false) const; @@ -591,6 +599,8 @@ public: Also checks for one empty paragraph. */ static bool HasTextImpl( SdrOutliner* pOutliner ); + + friend class ::SdrTextObjTest; }; |