summaryrefslogtreecommitdiff
path: root/sw/inc/fmtftn.hxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <jan-marek.glogowski@extern.cib.de>2019-10-22 12:24:43 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2019-10-28 14:48:51 +0100
commita991ad93dcd6807d0eacd11a50c2ae43a2cfb882 (patch)
treee2ca253f2106438fd18606e188c5a1e28a6bc3d2 /sw/inc/fmtftn.hxx
parente70ccc06094bec12d1947328b98ea040b46d08fc (diff)
tdf#121441 improve DOCX footnote import
ODF represents footnotes by using a fixed string for the label (text:note-citation) and a flexible body (text:note-body) for the representation in the footnote area. The only formatting of the footnote reference is done by changing the character class assigned to the anchor (which is the text range of the label in the text). For most of the setting, the footnote area label just follows the footnote body character formatting. OTOH MS Word has no such "restrictions". It handles the label just as concated, formated text runs with the same style. On top of it, DOCX completely splits the reference from the footnote area part, including its own label, which can easily result in completely different labels for the footnote and the reference, as I happened to repoduce for my test documents. At this point it's quite obvious that for any complex footnotes, LibreOffice won't be able to represent them. IMHO ODF should offer the same flexibility for the label and the body and allow all the normal formatting in the label. I'm not sure that getting footnote area and reference label out of sync is a good idea. So this patch tries to improve the situation in the current constraints set by ODF. 1. It imports all runs of the whole custom DOCX footnote label. 2. If any run contains a symbol, switches the font of the whole label to the referenced symbol font. 3. Completely ignores the label of the footnote area and overrides the font of the footnote area label with the font of the reference. Other problems I found while testing this code: 1. LO edit field correctly gets the font and character set, but displays empty glyphs. So no real way to edit the label. 2. Normally the font of the footnote area label would follow the footnote font. This doesn't work anymore when the font is overridden for the label. Setting the whole font of the label to Symbol doesn't seem like a good solution either. 3. You can't mix multiple fonts, or even symbols and letters, as you can just select one font for the label. 4. You can't change the footnote are label font at all and since it doesn't follow the footnote area anymore, there is basically no way to change it. Change-Id: Iafa16936be81e1866c610ebf0f71ab15e74dd059 Reviewed-on: https://gerrit.libreoffice.org/81370 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'sw/inc/fmtftn.hxx')
-rw-r--r--sw/inc/fmtftn.hxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/sw/inc/fmtftn.hxx b/sw/inc/fmtftn.hxx
index 44ccc9556c46..247a6c5342b7 100644
--- a/sw/inc/fmtftn.hxx
+++ b/sw/inc/fmtftn.hxx
@@ -26,9 +26,10 @@
#include "swdllapi.h"
#include "calbck.hxx"
-namespace com { namespace sun { namespace star {
- namespace text { class XFootnote; }
-} } }
+namespace com { namespace sun { namespace star { namespace text {
+ class XFootnote;
+ class XTextRange;
+} } } }
class SwDoc;
class SwTextFootnote;
@@ -91,6 +92,8 @@ public:
OUString GetViewNumStr(const SwDoc& rDoc, SwRootFrame const* pLayout,
bool bInclStrings = false) const;
+ css::uno::Reference<css::text::XTextRange> getAnchor(SwDoc& rDoc) const;
+
css::uno::WeakReference<css::text::XFootnote> const& GetXFootnote() const
{ return m_wXFootnote; }
void SetXFootnote(css::uno::Reference<css::text::XFootnote> const& xNote)