summaryrefslogtreecommitdiff
path: root/sw/source/core/draw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-10-21 21:33:36 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-10-22 08:44:02 +0200
commit9a29a4df545d7f88cd14bb99ce54f149032eb7f0 (patch)
tree03cdbef6aec0a3b5c9eb0702dbe888e7c4ddd0c8 /sw/source/core/draw
parent5b9b855c19fd8b8fb61f49e9d3d8bbf47521caee (diff)
tdf#127412 sw: fix reported ZOrder of shape+textbox pairs
Writer documents may have shape+textbox pairs, in which case internally they have individual ZOrders, but the textbox ZOrder is always just 1 larger than their shape, and externally this is not visible (UNO API, UI). This is implemented by e.g. SwXDrawPage::getCount(), which ignores those textboxes. This worked in general for SwVirtFlyDrawObj, but in case the textbox is a SwFlyDrawObj, then these were not filtered out. Fix this, so the scenario when the shapes are added to the draw page following ZOrder (0, 1, etc) works (internally producing 0, 1, 2, 3, etc ZOrders). Change-Id: I2a04fb76029d83390d418c764fdfbe7a1ee0f208 Reviewed-on: https://gerrit.libreoffice.org/81277 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source/core/draw')
-rw-r--r--sw/source/core/draw/dflyobj.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index f7ff362b5f15..423b41ed64e9 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -67,6 +67,7 @@
#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <notxtfrm.hxx>
+#include <dcontact.hxx>
using namespace ::com::sun::star;
@@ -144,6 +145,12 @@ sal_uInt16 SwFlyDrawObj::GetObjIdentifier() const
return SwFlyDrawObjIdentifier;
}
+bool SwFlyDrawObj::IsTextBox() const
+{
+ const SwFrameFormat* pFrameFormat = FindFrameFormat(this);
+ return SwTextBoxHelper::isTextBox(pFrameFormat, RES_FLYFRMFMT);
+}
+
// TODO: Need own primitive to get the FlyFrame paint working
namespace drawinglayer
{