a TextBox *can* be inside a group shape
Lionel Elie Mamane
lionel at mamane.lu
Thu Jan 15 07:32:45 PST 2015
Hi,
I'm a bit worried by the reasoning behind your commit
commit 6227d2fc60564f847a2ffd0b5f5d0fbf8ab49f5b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Dec 19 19:41:52 2014 +0100
fdo#86963 SwXShape: don't ask SwTextBoxHelper for ZOrder of child
shapes
(...) Given that TextBoxes are only possible at the highest level
(and not inside group shapes) (...)
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index b4e0b0b..9b09764 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1764,8 +1764,17 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName)
const SdrObject* pObj = pFmt->FindRealSdrObject();
if (pObj)
{
+ bool bConvert = true;
+ if (SvxShape* pSvxShape = GetSvxShape())
+ // In case of group shapes, pSvxShape points to the child shape, while pObj points to the outermost group shape.
+ if (pSvxShape->GetSdrObject() != pObj)
+ // Textboxes are not expected inside group shapes, so no conversion is necessary there.
+ bConvert = false;
+ if (bConvert)
+ {
std::set<const SwFrmFmt*> aTextBoxes = SwTextBoxHelper::findTextBoxes(pFmt->GetDoc());
aRet <<= SwTextBoxHelper::getOrdNum(pObj, aTextBoxes);
+ }
}
As far as I understand, TextBox (form) controls *are* possible within
group shapes. I've uploaded an example to
http://people.freedesktop.org/~lmamane/tst.odt
You will notice that each control is grouped with a label control.
That kind of structure is common (an idiom) with Base forms; it is
what the wizard creates. Base forms are writer documents embedded into
the .odb file (subdocuments).
Since I *did* have, with some past master & libreoffice-4-4 snapshots
difficulties with ZOrder not being an enumeration in the result of the
wizard (in memory), and thus the created form not being saved
correctly (missing controls, style not applied, ... see
https://gerrit.libreoffice.org/13554 ), could you please check /
rethink your commit in the light of text boxes that *are* inside a
group shape?
Thank you very much,
--
Lionel
More information about the LibreOffice
mailing list