summaryrefslogtreecommitdiff
path: root/sw/source/core/frmedt/fews.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-10-27 14:37:03 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-10-27 14:37:03 +0100
commitfeedd45ba2dd308af2d3a1b2f64681b9467535b6 (patch)
treee513616af72c8b0effd4b57eb1b1744828153d78 /sw/source/core/frmedt/fews.cxx
parentf6ff0c237bde50d1fab6b19d87000038b6f3f042 (diff)
in msword the hard-break between image and caption has a width
while for us it doesn't, make it invisible to give it zero width in both implementations to head off interoperability misery Change-Id: I0944006817944b20ef35502c8588357e7ee54810
Diffstat (limited to 'sw/source/core/frmedt/fews.cxx')
-rw-r--r--sw/source/core/frmedt/fews.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 9d206c1dac60..58d0c904f837 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -19,6 +19,7 @@
#include <svx/svdobj.hxx>
#include <comphelper/lok.hxx>
+#include <editeng/charhiddenitem.hxx>
#include <init.hxx>
#include <fesh.hxx>
#include <pagefrm.hxx>
@@ -502,8 +503,15 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const OUString &rText, con
}
//put a hard-break after the graphic to keep it separated
//from the caption text if the outer frame is resized
- SwIndex aIdx(pTextNode, bBefore ? nInsertPos : 1);
+ const sal_Int32 nIndex = bBefore ? nInsertPos : 1;
+ SwIndex aIdx(pTextNode, nIndex);
pTextNode->InsertText("\n", aIdx);
+ //set the hard-break to be hidden, otherwise it has
+ //non-zero width in word and so hard-break flows on
+ //the next line, pushing the caption text out of
+ //the frame making the caption apparently disappear
+ SvxCharHiddenItem aHidden(true, RES_CHRATR_HIDDEN);
+ pTextNode->InsertItem(aHidden, nIndex, nIndex + 1);
}
}