Kaydet (Commit) da22fb66 authored tarafından Miklos Vajna's avatar Miklos Vajna

SwTextBoxHelper::syncProperty: handle FN_TEXT_RANGE

The TextRange property of a shape is its anchor position: if that's
adjusted, then also set the textbox's RES_ANCHOR to the new position.

Without this, e.g. shapes anchored in headers have their textboxes
anchored in the body text, CppunitTest_sw_ooxmlexport's testfdo78420 is
a reproducer.

Change-Id: I83ed09875c3f0360c581c331507ad2b9d05ffb3a
üst 02f2d886
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <textboxhelper.hxx> #include <textboxhelper.hxx>
#include <frmfmt.hxx> #include <frmfmt.hxx>
#include <fmtcntnt.hxx> #include <fmtcntnt.hxx>
#include <fmtanchr.hxx>
#include <doc.hxx> #include <doc.hxx>
#include <docsh.hxx> #include <docsh.hxx>
#include <docary.hxx> #include <docary.hxx>
...@@ -19,6 +20,7 @@ ...@@ -19,6 +20,7 @@
#include <unotextbodyhf.hxx> #include <unotextbodyhf.hxx>
#include <unotextrange.hxx> #include <unotextrange.hxx>
#include <unomid.h> #include <unomid.h>
#include <cmdid.h>
#include <unoprnms.hxx> #include <unoprnms.hxx>
#include <dflyobj.hxx> #include <dflyobj.hxx>
#include <mvsave.hxx> #include <mvsave.hxx>
...@@ -336,6 +338,19 @@ void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8 ...@@ -336,6 +338,19 @@ void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8
break; break;
} }
break; break;
case FN_TEXT_RANGE:
{
uno::Reference<text::XTextRange> xRange;
rValue >>= xRange;
SwUnoInternalPaM aInternalPaM(*pFmt->GetDoc());
if (sw::XTextRangeToSwPaM(aInternalPaM, xRange))
{
SwFmtAnchor aAnchor(pFmt->GetAnchor());
aAnchor.SetAnchor(aInternalPaM.Start());
pFmt->SetFmtAttr(aAnchor);
}
}
break;
} }
if (!aPropertyName.isEmpty()) if (!aPropertyName.isEmpty())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment