From 612629f4a81acd7b851b7eccc97aba9a5915d13c Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 24 Oct 2023 09:06:54 +0200 Subject: tdf#155040 sw floattable, RTF: fix table is overlapped by subsequent inline one The document had overlapping text on load since commit 05425f73bfa41d3f7591461e2ad0beb4fafc39b4 (sw floatable: teach the RTF import about SwFormatFlySplit, 2023-04-21). Interestingly the DOCX equivalent was fine, there the inline table is shifted down, below the floating table, so the overlap doesn't happen. Fix the problem by moving the AddVerticalFrameOffsets=true code from the DOCX filter to the shared dmapper, because RTF needs the same. See commit 50223ea6e212b60b7d33839c2753c5601fb50f95 (tdf#98987 sw: add AddVerticalFrameOffsets compat mode, 2016-03-31) for more details about this compat flag. It was already enabled for DOC, too. Change-Id: I948b179c9ec5fa24377014b0e86826568c417b6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158372 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- chart2/source/inc/dumpxmltostring.hxx | 42 --------------------------------- chart2/source/model/main/ChartModel.cxx | 4 ++-- chart2/source/view/main/ChartView.cxx | 4 ++-- 3 files changed, 4 insertions(+), 46 deletions(-) delete mode 100644 chart2/source/inc/dumpxmltostring.hxx (limited to 'chart2/source') diff --git a/chart2/source/inc/dumpxmltostring.hxx b/chart2/source/inc/dumpxmltostring.hxx deleted file mode 100644 index b5cfe5a1fab8..000000000000 --- a/chart2/source/inc/dumpxmltostring.hxx +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#pragma once - -#include - -#include -#include - -#include - -namespace chart -{ -template OUString dumpXmlToString(F f) -{ - auto const buf = xmlBufferCreate(); - if (buf == nullptr) - { - throw std::bad_alloc(); - } - auto const writer = xmlNewTextWriterMemory(buf, 0); - if (writer == nullptr) - { - throw std::bad_alloc(); - } - f(writer); - xmlFreeTextWriter(writer); - std::string_view s(reinterpret_cast(xmlBufferContent(buf)), xmlBufferLength(buf)); - OUString rv = OStringToOUString(s, RTL_TEXTENCODING_ISO_8859_1); //TODO - xmlBufferFree(buf); - return rv; -} -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index 5634f358cce1..19fccff373e9 100644 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include @@ -1287,7 +1287,7 @@ uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > SAL_CALL ChartM OUString SAL_CALL ChartModel::dump(OUString const & kind) { if (kind.isEmpty()) { - return dumpXmlToString([this](auto writer) { return dumpAsXml(writer); }); + return comphelper::dumpXmlToString([this](auto writer) { return dumpAsXml(writer); }); } // kind == "shapes": diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 51132d5a9679..bed80f49b326 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -56,7 +56,7 @@ #include #include #include -#include +#include #include #include #include @@ -1819,7 +1819,7 @@ uno::Sequence< OUString > ChartView::getAvailableServiceNames() OUString ChartView::dump(OUString const & kind) { if (kind.isEmpty()) { - return dumpXmlToString([this](auto writer) { return dumpAsXml(writer); }); + return comphelper::dumpXmlToString([this](auto writer) { return dumpAsXml(writer); }); } // kind == "shapes": -- cgit