[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 1715 commits - accessibility/inc accessibility/README accessibility/README.md accessibility/source android/README android/README.md android/source animations/README animations/README.md animations/source apple_remote/README apple_remote/README.md avmedia/README avmedia/README.md avmedia/source basctl/inc basctl/README basctl/README.md basctl/source basegfx/inc basegfx/Library_basegfx.mk basegfx/README basegfx/README.md basegfx/source basic/CppunitTest_basic_macros.mk basic/inc basic/qa basic/README basic/README.md basic/source bean/com bean/README bean/README.md binaryurp/README binaryurp/README.md binaryurp/source bin/gbuild-to-ide bin/README bin/README.md bin/unpack-sources bin/update_pch bridges/Library_cpp_uno.mk bridges/README bridges/README.md bridges/source canvas/inc canvas/README canvas/README.md canvas/source chart2/inc chart2/qa chart2/README chart2/README.md chart2/source chart2/uiconfig cli_ure/Module_cli_ure.mk cli_ ure/README cli_ure/README.md codemaker/README codemaker/README.md comphelper/inc comphelper/README comphelper/README.md comphelper/source comphelper/util compilerplugins/clang compilerplugins/README compilerplugins/README.md config_host/config_qrcodegen.h.in config_host/config_zxing.h.in config_host.mk.in config_host/README config_host/README.md configmgr/inc configmgr/README configmgr/README.md configmgr/source configure.ac connectivity/inc connectivity/qa connectivity/README connectivity/README.md connectivity/source connectivity/workben cppcanvas/inc cppcanvas/qa cppcanvas/README cppcanvas/README.md cppcanvas/source cppuhelper/inc cppuhelper/README cppuhelper/README.md cppuhelper/source cppu/README cppu/README.md cpputools/README cpputools/README.md cpputools/source cui/inc cui/Library_cui.mk cui/README cui/README.md cui/source cui/uiconfig cui/UIConfig_cui.mk dbaccess/inc dbaccess/qa dbaccess/README dbaccess/README.md dbaccess/source dbaccess/uiconfig dbaccess/util desktop/inc d esktop/qa desktop/README desktop/README.md desktop/source desktop/test distro-configs/LibreOfficeiOS.conf distro-configs/LibreOfficeiOS_Sim.conf distro-configs/LibreOfficeOssFuzz.conf distro-configs/README distro-configs/README.md download.lst drawinglayer/CppunitTest_drawinglayer_border.mk drawinglayer/inc drawinglayer/Library_drawinglayercore.mk drawinglayer/Library_drawinglayer.mk drawinglayer/Module_drawinglayer.mk drawinglayer/qa drawinglayer/README drawinglayer/README.md drawinglayer/source editeng/inc editeng/README editeng/README.md editeng/source embeddedobj/README embeddedobj/README.md embeddedobj/source embedserv/README embedserv/README.md embedserv/source emfio/CppunitTest_emfio_emf.mk emfio/inc emfio/Library_emfio.mk emfio/qa emfio/README emfio/README.md emfio/source eventattacher/README eventattacher/README.md eventattacher/source extensions/inc extensions/README extensions/README.md extensions/source extensions/test extensions/uiconfig extensions/UIConfig_sbibliograph y.mk external/firebird external/icu external/libcdr external/libffi external/libpng external/libvisio external/Module_external.mk external/nss external/openssl external/owncloud-android-lib external/pdfium external/postgresql external/python3 external/qrcodegen external/README external/README.md external/skia external/zxing extras/CustomTarget_tplpresnt.mk extras/Package_tplpresnt.mk extras/README extras/README.md extras/source filter/inc filter/Library_pdffilter.mk filter/Library_svgfilter.mk filter/qa filter/README filter/README.md filter/source forms/inc forms/README forms/README.md forms/source formula/inc formula/README formula/README.md formula/source fpicker/inc fpicker/README fpicker/README.md fpicker/source framework/inc framework/qa framework/README framework/README.md framework/source framework/util g .gitignore helpcontent2 hwpfilter/inc hwpfilter/README hwpfilter/README.md hwpfilter/source i18nlangtag/README i18nlangtag/README.md i18npool/README i18npool/README.md i18np ool/source i18nutil/README i18nutil/README.md icon-themes/breeze icon-themes/breeze_dark icon-themes/breeze_dark_svg icon-themes/breeze_svg icon-themes/colibre icon-themes/colibre_svg icon-themes/elementary icon-themes/elementary_svg icon-themes/karasa_jaga icon-themes/karasa_jaga_svg icon-themes/README icon-themes/README.md icon-themes/sifr icon-themes/sifr_dark icon-themes/sifr_dark_svg icon-themes/sifr_svg icon-themes/sukapura icon-themes/sukapura_svg idlc/README idlc/README.md idl/inc idl/README idl/README.md idl/source include/avmedia include/basegfx include/basic include/comphelper include/connectivity include/cppuhelper include/drawinglayer include/editeng include/filter include/formula include/framework include/o3tl include/oox include/rtl include/sal include/sfx2 include/svl include/svtools include/svx include/systools include/test include/tools include/ucbhelper include/unotest include/unotools include/vcl include/xmloff install_deps.sh instsetoo_native/README instsetoo_na tive/README.md io/README io/README.md ios/CustomTarget_iOS_setup.mk io/source io/test javaunohelper/README javaunohelper/README.md jurt/README jurt/README.md jvmaccess/README jvmaccess/README.md jvmfwk/README jvmfwk/README.md l10ntools/README l10ntools/README.md librelogo/README librelogo/README.md libreofficekit/qa libreofficekit/README libreofficekit/README.md libreofficekit/source lingucomponent/Module_lingucomponent.mk lingucomponent/README lingucomponent/README.md lingucomponent/source linguistic/README linguistic/README.md linguistic/source logerrit lotuswordpro/inc lotuswordpro/qa lotuswordpro/README lotuswordpro/README.md lotuswordpro/source m4/README m4/README.md Makefile.fetch Makefile.in nlpsolver/README nlpsolver/README.md o3tl/qa o3tl/README o3tl/README.md odk/CustomTarget_check.mk odk/Module_odk.mk odk/README odk/README.md offapi/com offapi/README offapi/README.md offapi/UnoApi_offapi.mk officecfg/README officecfg/README.md officecfg/registry onlineupdate/README online update/README.md oovbaapi/README oovbaapi/README.md oox/inc oox/qa oox/README oox/README.md oox/source opencl/README opencl/README.md osx/README osx/README.md package/inc package/README package/README.md package/source pch/README pch/README.md postprocess/Rdb_services.mk postprocess/README postprocess/README.md pyuno/README pyuno/README.md pyuno/source qadevOOo/README qadevOOo/README.md qadevOOo/runner readlicense_oo/license readlicense_oo/README readlicense_oo/README.md registry/README registry/README.md remotebridges/README remotebridges/README.md reportbuilder/README reportbuilder/README.md reportdesign/inc reportdesign/README reportdesign/README.md reportdesign/source RepositoryExternal.mk Repository.mk ridljar/README ridljar/README.md sal/CppunitTest_sal_comtools.mk sal/CppunitTest_sal_retry_if_failed.mk salhelper/README salhelper/README.md sal/inc sal/Module_sal.mk sal/osl sal/qa sal/README sal/README.md sal/rtl sax/qa sax/README sax/README.md sax/README.vars sax/source scaddi ns/inc scaddins/README scaddins/README.md scaddins/source sccomp/inc sccomp/README sccomp/README.md sccomp/source sc/CppunitTest_sc_parallelism.mk sc/CppunitTest_sc_ucalc.mk schema/libreoffice schema/odf1.3 schema/README schema/README.md sc/inc sc/Library_sc.mk scp2/README scp2/README.md sc/qa sc/README sc/README.md scripting/java scripting/README scripting/README.md scripting/source sc/sdi sc/source sc/uiconfig sd/CppunitTest_sd_uimpress.mk sdext/inc sdext/README sdext/README.md sdext/source sd/inc sd/IwyuFilter_sd.yaml sd/Library_sd.mk sd/qa sd/README sd/README.md sd/sdi sd/source sd/uiconfig sd/UIConfig_simpress.mk sd/workben setup_native/scripts setup_native/source sfx2/CppunitTest_sfx2_doc.mk sfx2/inc sfx2/Library_sfx.mk sfx2/qa sfx2/README sfx2/README.md sfx2/source sfx2/uiconfig sfx2/UIConfig_sfx.mk sfx2/util shell/README shell/README.md shell/source slideshow/inc slideshow/README slideshow/README.md slideshow/source smoketest/README smoketest/README.md solenv/bin solenv/clan g-format solenv/CompilerTest_compilerplugins_clang.mk solenv/flatpak-manifest.in solenv/gbuild solenv/README solenv/README.md solenv/sanitizers sot/inc sot/README sot/README.md sot/source starmath/inc starmath/Library_sm.mk starmath/qa starmath/README starmath/README.md starmath/source stoc/README stoc/README.md stoc/source store/README store/README.md svgio/CppunitTest_svgio.mk svgio/inc svgio/Library_svgio.mk svgio/README svgio/README.md svgio/source svl/inc svl/README svl/README.md svl/source svtools/inc svtools/Library_svt.mk svtools/README svtools/README.md svtools/source svtools/uiconfig svtools/UIConfig_svt.mk svtools/util svx/CppunitTest_svx_unit.mk svx/inc svx/Library_svxcore.mk svx/Library_svx.mk svx/qa svx/README svx/README.md svx/sdi svx/source svx/uiconfig svx/UIConfig_svx.mk sw/CppunitTest_sw_core_text.mk sw/CppunitTest_sw_core_tox.mk sw/CppunitTest_sw_odfexport2.mk sw/CppunitTest_sw_odfimport.mk sw/CppunitTest_sw_ooxmlimport2.mk sw/CppunitTest_sw_uwriter.mk sw/Cppunit Test_sw_ww8export.mk swext/mediawiki swext/README swext/README.md sw/inc sw/Library_sw.mk sw/Library_swui.mk sw/Module_sw.mk sw/ooxmlexport_setup.mk sw/qa sw/README sw/README.md sw/sdi sw/source sw/uiconfig sw/UIConfig_swriter.mk sysui/README sysui/README.md test/README test/README.md test/source testtools/README testtools/README.md test/user-template toolkit/inc toolkit/Library_tk.mk toolkit/README toolkit/README.md toolkit/source toolkit/util tools/inc tools/qa tools/README tools/README.md tools/source translations ucbhelper/README ucbhelper/README.md ucbhelper/source ucb/README ucb/README.md ucb/source udkapi/README udkapi/README.md uitest/demo_ui uitest/math_tests uitest/README uitest/README.md uitest/uitest UnoControls/README UnoControls/README.md UnoControls/source unodevtools/inc unodevtools/README unodevtools/README.md unodevtools/source unoidl/README unoidl/README.md unoidl/source unoil/Module_unoil.mk unoil/README unoil/README.md unotest/source unotools/inc unotools/README unotools/README.md unotools/source unotools/util unoxml/inc unoxml/README unoxml/README.md unoxml/source ure/README ure/README.md uui/inc uui/README uui/README.md uui/source vbahelper/inc vbahelper/README vbahelper/README.md vbahelper/source vcl/backendtest vcl/CppunitTest_vcl_bitmap_test.mk vcl/Executable_602fuzzer.mk vcl/Executable_bmpfuzzer.mk vcl/Executable_cgmfuzzer.mk vcl/Executable_diffuzzer.mk vcl/Executable_docxfuzzer.mk vcl/Executable_dxffuzzer.mk vcl/Executable_epsfuzzer.mk vcl/Executable_fodpfuzzer.mk vcl/Executable_fodsfuzzer.mk vcl/Executable_fodtfuzzer.mk vcl/Executable_giffuzzer.mk vcl/Executable_htmlfuzzer.mk vcl/Executable_hwpfuzzer.mk vcl/Executable_jpgfuzzer.mk vcl/Executable_lwpfuzzer.mk vcl/Executable_metfuzzer.mk vcl/Executable_mmlfuzzer.mk vcl/Executable_mtpfuzzer.mk vcl/Executable_olefuzzer.mk vcl/Executable_pcdfuzzer.mk vcl/Executable_pctfuzzer.mk vcl/Executable_pcxfuzzer.mk vcl/Executable_pngfuzzer.mk vcl/Executable_ppmfuzzer.mk vcl/Executable_pptfuzzer.m k vcl/Executable_pptxfuzzer.mk vcl/Executable_psdfuzzer.mk vcl/Executable_qpwfuzzer.mk vcl/Executable_rasfuzzer.mk vcl/Executable_rtffuzzer.mk vcl/Executable_scrtffuzzer.mk vcl/Executable_sftfuzzer.mk vcl/Executable_slkfuzzer.mk vcl/Executable_svmfuzzer.mk vcl/Executable_tgafuzzer.mk vcl/Executable_tiffuzzer.mk vcl/Executable_wksfuzzer.mk vcl/Executable_wmffuzzer.mk vcl/Executable_ww2fuzzer.mk vcl/Executable_ww6fuzzer.mk vcl/Executable_ww8fuzzer.mk vcl/Executable_xbmfuzzer.mk vcl/Executable_xlsfuzzer.mk vcl/Executable_xlsxfuzzer.mk vcl/Executable_xpmfuzzer.mk vcl/headless vcl/inc vcl/ios vcl/jsdialog vcl/Library_vcl.mk vcl/Library_vclplug_gen.mk vcl/Library_vclplug_gtk3_kde5.mk vcl/Library_vclplug_gtk3.mk vcl/Library_vclplug_osx.mk vcl/Library_vclplug_qt5.mk vcl/Library_vclplug_win.mk vcl/osx vcl/Package_tipoftheday.mk vcl/qa vcl/qt5 vcl/quartz vcl/README vcl/README.md vcl/skia vcl/source vcl/uiconfig vcl/UIConfig_vcl.mk vcl/unx vcl/win vcl/workben winaccessibility/inc winaccessibil ity/README winaccessibility/README.md winaccessibility/source wizards/Package_scriptforge.mk wizards/README wizards/README.md wizards/source writerfilter/inc writerfilter/qa writerfilter/README writerfilter/README.md writerfilter/source writerperfect/inc writerperfect/qa writerperfect/README writerperfect/README.md writerperfect/source xmerge/README xmerge/README.md xmlhelp/README xmlhelp/README.md xmlhelp/source xmloff/CppunitTest_xmloff_style.mk xmloff/inc xmloff/Library_xo.mk xmloff/qa xmloff/source xmlreader/README xmlreader/README.md xmlscript/inc xmlscript/README xmlscript/README.md xmlscript/source xmlsecurity/inc xmlsecurity/Module_xmlsecurity.mk xmlsecurity/qa xmlsecurity/README xmlsecurity/README.md xmlsecurity/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Fri Apr 2 07:22:53 UTC 2021
Rebased ref, commits from common ancestor:
commit f52c86ee26ce072bc49d54baa25cfb8521396158
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri Apr 2 16:11:50 2021 +0900
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Fri Apr 2 16:21:29 2021 +0900
drawinglayer: ITextLayouter and use it as a VisitingParameter
Change-Id: I04aa42716c2bde4a2652d10892b6b2392a20fb3b
diff --git a/basegfx/Library_basegfx.mk b/basegfx/Library_basegfx.mk
index 8359969ae80c..957f1b45ac08 100644
--- a/basegfx/Library_basegfx.mk
+++ b/basegfx/Library_basegfx.mk
@@ -80,6 +80,7 @@ $(eval $(call gb_Library_add_exception_objects,basegfx,\
basegfx/source/vector/b2dvector \
basegfx/source/vector/b2ivector \
basegfx/source/vector/b3dvector \
+ basegfx/source/text/UnoTextLayouter \
))
diff --git a/basegfx/source/text/UnoTextLayouter.cxx b/basegfx/source/text/UnoTextLayouter.cxx
new file mode 100644
index 000000000000..e3f48264c624
--- /dev/null
+++ b/basegfx/source/text/UnoTextLayouter.cxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+
+#include <basegfx/text/UnoTextLayouter.hxx>
+#include <cppuhelper/queryinterface.hxx>
+
+using namespace css;
+
+namespace gfx
+{
+// css::lang::XUnoTunnel
+UNO3_GETIMPLEMENTATION_IMPL(UnoTextLayouter);
+
+std::shared_ptr<gfx::ITextLayouter>
+getTextLayouterFromUno(uno::Reference<graphic::XTextLayouter> const& xTextLayouter)
+{
+ gfx::UnoTextLayouter* pUnoTextLayouter
+ = comphelper::getUnoTunnelImplementation<gfx::UnoTextLayouter>(xTextLayouter);
+ if (pUnoTextLayouter)
+ return pUnoTextLayouter->getTextLayouter();
+
+ return std::shared_ptr<gfx::ITextLayouter>();
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/attribute/fontattribute.cxx b/drawinglayer/source/attribute/fontattribute.cxx
index e423b8367f1c..b14397fe9d87 100644
--- a/drawinglayer/source/attribute/fontattribute.cxx
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -112,15 +112,31 @@ FontAttribute::FontAttribute()
{
}
-FontAttribute::FontAttribute(const FontAttribute&) = default;
+FontAttribute::FontAttribute(const FontAttribute& rOther)
+ : mpFontAttribute(rOther.mpFontAttribute)
+{
+}
+
+FontAttribute::FontAttribute(FontAttribute&& rOther) noexcept
+ : mpFontAttribute(std::move(rOther.mpFontAttribute))
+{
+}
-FontAttribute::FontAttribute(FontAttribute&&) = default;
+FontAttribute::~FontAttribute() {}
-FontAttribute::~FontAttribute() = default;
+FontAttribute& FontAttribute::operator=(const FontAttribute& rOther)
+{
+ mpFontAttribute = rOther.mpFontAttribute;
-FontAttribute& FontAttribute::operator=(const FontAttribute&) = default;
+ return *this;
+}
-FontAttribute& FontAttribute::operator=(FontAttribute&&) = default;
+FontAttribute& FontAttribute::operator=(FontAttribute&& rOther) noexcept
+{
+ mpFontAttribute = std::move(rOther.mpFontAttribute);
+
+ return *this;
+}
bool FontAttribute::operator==(const FontAttribute& rCandidate) const
{
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 37fa2a2a477f..b424e1a5be13 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/geometry/RealRectangle2D.hpp>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <converters.hxx>
@@ -107,7 +108,8 @@ namespace drawinglayer::unorenderer
}
const geometry::ViewInformation2D aViewInformation2D(aViewInformationSequence);
- primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ auto pTextLayouter = std::make_shared<drawinglayer::processor2d::TextLayouterDevice>();
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D, pTextLayouter);
const double fFactor100th_mmToInch(1.0 / (2.54 * 1000.0));
const sal_uInt32 nDiscreteWidth(basegfx::fround((fWidth * fFactor100th_mmToInch) * DPI_X));
diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
index b809574116cd..aa1c5fd4808a 100644
--- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
@@ -23,7 +23,10 @@
#include <drawinglayer/primitive2d/Tools.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <basegfx/utils/canvastools.hxx>
+#include <basegfx/text/UnoTextLayouter.hxx>
#include <comphelper/sequence.hxx>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#include <com/sun/star/graphic/XTextLayouter.hpp>
using namespace css;
@@ -85,12 +88,39 @@ void BasePrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& /*rVis
{
}
+namespace
+{
+std::shared_ptr<gfx::ITextLayouter>
+getTextLayouter(const uno::Sequence<beans::PropertyValue>& rProperties)
+{
+ std::shared_ptr<gfx::ITextLayouter> pTextLayouter;
+
+ if (!rProperties.hasElements())
+ return pTextLayouter;
+
+ for (const beans::PropertyValue& rProperty : rProperties)
+ {
+ if (rProperty.Name == "TextLayouter")
+ {
+ uno::Reference<graphic::XTextLayouter> xTextLayouter;
+ rProperty.Value >>= xTextLayouter;
+ if (xTextLayouter.is())
+ pTextLayouter = gfx::getTextLayouterFromUno(xTextLayouter);
+ return pTextLayouter;
+ }
+ }
+ return pTextLayouter;
+}
+
+} // end anonymous namespace
+
css::uno::Sequence<::css::uno::Reference<::css::graphic::XPrimitive2D>> SAL_CALL
BasePrimitive2D::getDecomposition(const uno::Sequence<beans::PropertyValue>& rViewParameters)
{
Primitive2DContainer aContainer;
geometry::ViewInformation2D aViewInformation2D(rViewParameters);
- VisitingParameters aParameters(aViewInformation2D);
+ std::shared_ptr<gfx::ITextLayouter> pTextLayouter = getTextLayouter(rViewParameters);
+ VisitingParameters aParameters(aViewInformation2D, pTextLayouter);
get2DDecomposition(aContainer, aParameters);
return comphelper::containerToSequence(aContainer);
}
@@ -99,7 +129,8 @@ css::geometry::RealRectangle2D SAL_CALL
BasePrimitive2D::getRange(const uno::Sequence<beans::PropertyValue>& rViewParameters)
{
geometry::ViewInformation2D aViewInformation2D(rViewParameters);
- VisitingParameters aParameters(aViewInformation2D);
+ std::shared_ptr<gfx::ITextLayouter> pTextLayouter = getTextLayouter(rViewParameters);
+ VisitingParameters aParameters(aViewInformation2D, pTextLayouter);
return basegfx::unotools::rectangle2DFromB2DRectangle(getB2DRange(aParameters));
}
diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
index 10c893d21a1b..6a286685a39c 100644
--- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
@@ -107,7 +107,7 @@ namespace drawinglayer::primitive2d
const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef };
const geometry::ViewInformation2D aViewInformation2D;
- primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D, rParameters.getTextLayouter());
const BitmapEx aBitmapEx(
convertToBitmapEx(
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index b6bf98314752..128548222f4c 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -111,9 +111,10 @@ void TextSimplePortionPrimitive2D::getTextOutlinesAndTransformation(
const basegfx::B2DVector aFontScale(getCorrectedScaleAndFontScale(aScale));
// prepare textlayoutdevice
- drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
- aTextLayouter.setFontAttribute(getFontAttribute(), aFontScale.getX(), aFontScale.getY(),
- getLocale());
+ std::unique_ptr<gfx::ITextLayouter> pTextLayouter
+ = std::make_unique<drawinglayer::processor2d::TextLayouterDevice>();
+ pTextLayouter->setFontAttribute(getFontAttribute(), aFontScale.getX(), aFontScale.getY(),
+ getLocale());
// When getting outlines from stretched text (aScale.getX() != 1.0) it
// is necessary to inverse-scale the DXArray (if used) to not get the
@@ -129,14 +130,14 @@ void TextSimplePortionPrimitive2D::getTextOutlinesAndTransformation(
}
// get the text outlines
- aTextLayouter.getTextOutlines(rTarget, getText(), getTextPosition(), getTextLength(),
- aScaledDXArray);
+ pTextLayouter->getTextOutlines(rTarget, getText(), getTextPosition(), getTextLength(),
+ aScaledDXArray);
}
else
{
// get the text outlines
- aTextLayouter.getTextOutlines(rTarget, getText(), getTextPosition(), getTextLength(),
- getDXArray());
+ pTextLayouter->getTextOutlines(rTarget, getText(), getTextPosition(), getTextLength(),
+ getDXArray());
}
// create primitives for the outlines
diff --git a/drawinglayer/source/processor2d/contourextractor2d.cxx b/drawinglayer/source/processor2d/contourextractor2d.cxx
index 5b9adf4c0ab1..919c09cfe430 100644
--- a/drawinglayer/source/processor2d/contourextractor2d.cxx
+++ b/drawinglayer/source/processor2d/contourextractor2d.cxx
@@ -131,7 +131,7 @@ namespace drawinglayer::processor2d
getViewInformation2D().getVisualizedPage(),
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D, maVisitingParameters.getTextLayouter());
updateVisitingParameters(aVisitingParameters);
// process content
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index a41037426b09..ffc6c466064f 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -240,7 +240,7 @@ namespace drawinglayer::processor2d
getViewInformation2D().getVisualizedPage(),
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D, maVisitingParameters.getTextLayouter());
updateVisitingParameters(aVisitingParameters);
// process child content recursively
diff --git a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
index cd4593b2a3a9..8a173b21fd01 100644
--- a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
+++ b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
@@ -94,7 +94,7 @@ namespace drawinglayer::processor2d
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D, maVisitingParameters.getTextLayouter());
updateVisitingParameters(aVisitingParameters);
// process content
diff --git a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
index 5eb6c9f9c8ff..bc60998f2d03 100644
--- a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
+++ b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
@@ -185,7 +185,7 @@ namespace drawinglayer::processor2d
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- primitive2d::VisitingParameters aParameters(aViewInformation2D);
+ primitive2d::VisitingParameters aParameters(aViewInformation2D, maVisitingParameters.getTextLayouter());
updateVisitingParameters(aParameters);
// process content
diff --git a/drawinglayer/source/processor2d/textlayoutdevice.cxx b/drawinglayer/source/processor2d/textlayoutdevice.cxx
index 759a5757c8a2..1af699d766ee 100644
--- a/drawinglayer/source/processor2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/processor2d/textlayoutdevice.cxx
@@ -164,6 +164,14 @@ TextLayouterDevice::~TextLayouterDevice() COVERITY_NOEXCEPT_FALSE { releaseGloba
void TextLayouterDevice::setFont(const vcl::Font& rFont) { mrDevice.SetFont(rFont); }
+void TextLayouterDevice::setFontAttribute(const gfx::IFontAttribute& rFontAttribute,
+ double fFontScaleX, double fFontScaleY,
+ const css::lang::Locale& rLocale)
+{
+ auto rFontA = dynamic_cast<attribute::FontAttribute const&>(rFontAttribute);
+ setFontAttribute(rFontA, fFontScaleX, fFontScaleY, rLocale);
+}
+
void TextLayouterDevice::setFontAttribute(const attribute::FontAttribute& rFontAttribute,
double fFontScaleX, double fFontScaleY,
const css::lang::Locale& rLocale)
@@ -342,8 +350,8 @@ std::vector<double> TextLayouterDevice::getCaretPositions(const OUString& rText,
// helper methods for vcl font handling
-vcl::Font getVclFontFromFontAttribute(const attribute::FontAttribute& rFontAttribute,
- double fFontScaleX, double fFontScaleY, double fFontRotation,
+vcl::Font getVclFontFromFontAttribute(const gfx::IFontAttribute& rFontAttribute, double fFontScaleX,
+ double fFontScaleY, double fFontRotation,
const css::lang::Locale& rLocale)
{
// detect FontScaling
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 8bcf0ff4ebdd..bc89fde716e0 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2254,7 +2254,8 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D(
getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- primitive2d::VisitingParameters aVisitingParameters(aViewInfo);
+ primitive2d::VisitingParameters aVisitingParameters(
+ aViewInfo, maVisitingParameters.getTextLayouter());
VclPixelProcessor2D aBufferProcessor(aVisitingParameters, *aBufferDevice);
@@ -2394,7 +2395,8 @@ void VclMetafileProcessor2D::processPrimitive2DOnPixelProcessor(
auto pBufferDevice(CreateBufferDevice(aViewRange, aViewInfo, aRectLogic, aSizePixel));
if (pBufferDevice)
{
- primitive2d::VisitingParameters aVisitingParameters(aViewInfo);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInfo,
+ maVisitingParameters.getTextLayouter());
VclPixelProcessor2D aBufferProcessor(aVisitingParameters, *pBufferDevice,
maBColorModifierStack);
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 8070b3a71045..9bd3761351c1 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -906,7 +906,8 @@ void VclProcessor2D::RenderTransformPrimitive2D(
getViewInformation2D().getViewTransformation(), getViewInformation2D().getViewport(),
getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D,
+ maVisitingParameters.getTextLayouter());
updateVisitingParameters(aVisitingParameters);
// process content
@@ -930,7 +931,8 @@ void VclProcessor2D::RenderPagePreviewPrimitive2D(
getViewInformation2D().getViewTransformation(), getViewInformation2D().getViewport(),
rPagePreviewCandidate.getXDrawPage(), getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D,
+ maVisitingParameters.getTextLayouter());
updateVisitingParameters(aVisitingParameters);
// process decomposed content
diff --git a/drawinglayer/source/tools/primitive2dxmldump.cxx b/drawinglayer/source/tools/primitive2dxmldump.cxx
index dd8d54767157..f12bcda5d6ab 100644
--- a/drawinglayer/source/tools/primitive2dxmldump.cxx
+++ b/drawinglayer/source/tools/primitive2dxmldump.cxx
@@ -33,6 +33,7 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/attribute/lineattribute.hxx>
#include <drawinglayer/attribute/fontattribute.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
@@ -151,7 +152,8 @@ void Primitive2dXmlDump::decomposeAndWrite(
::tools::XmlWriter& rWriter)
{
drawinglayer::geometry::ViewInformation2D aInfo;
- drawinglayer::primitive2d::VisitingParameters aVisitingParameters(aInfo);
+ auto pTextLayouter = std::make_shared<drawinglayer::processor2d::TextLayouterDevice>();
+ drawinglayer::primitive2d::VisitingParameters aVisitingParameters(aInfo, pTextLayouter);
for (size_t i = 0; i < rPrimitive2DSequence.size(); i++)
{
diff --git a/include/basegfx/text/ITextLayouter.hxx b/include/basegfx/text/ITextLayouter.hxx
new file mode 100644
index 000000000000..26ce4697e275
--- /dev/null
+++ b/include/basegfx/text/ITextLayouter.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 <sal/config.h>
+#include <basegfx/basegfxdllapi.h>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+namespace com::sun::star::lang
+{
+struct Locale;
+}
+
+namespace gfx
+{
+class BASEGFX_DLLPUBLIC IFontAttribute
+{
+public:
+ virtual ~IFontAttribute() {}
+
+ virtual const OUString& getFamilyName() const = 0;
+ virtual const OUString& getStyleName() const = 0;
+ virtual sal_uInt16 getWeight() const = 0;
+ virtual bool getSymbol() const = 0;
+ virtual bool getVertical() const = 0;
+ virtual bool getItalic() const = 0;
+ virtual bool getOutline() const = 0;
+ virtual bool getRTL() const = 0;
+ virtual bool getBiDiStrong() const = 0;
+ virtual bool getMonospaced() const = 0;
+};
+
+class BASEGFX_DLLPUBLIC ITextLayouter
+{
+public:
+ virtual ~ITextLayouter() {}
+
+ virtual void setFontAttribute(IFontAttribute const& rFontAttribute, double fFontScaleX,
+ double fFontScaleY, const css::lang::Locale& rLocale)
+ = 0;
+
+ virtual void getTextOutlines(basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector,
+ const OUString& rText, sal_uInt32 nIndex, sal_uInt32 nLength,
+ const std::vector<double>& rDXArray) const = 0;
+};
+
+} // end namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/text/UnoTextLayouter.hxx b/include/basegfx/text/UnoTextLayouter.hxx
new file mode 100644
index 000000000000..f8b0f250edee
--- /dev/null
+++ b/include/basegfx/text/UnoTextLayouter.hxx
@@ -0,0 +1,52 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 <cppuhelper/implbase.hxx>
+#include <cppuhelper/supportsservice.hxx>
+#include <comphelper/servicehelper.hxx>
+
+#include <com/sun/star/graphic/XTextLayouter.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+
+#include <basegfx/text/ITextLayouter.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace gfx
+{
+BASEGFX_DLLPUBLIC std::shared_ptr<gfx::ITextLayouter>
+getTextLayouterFromUno(css::uno::Reference<css::graphic::XTextLayouter> const& xTextLayouter);
+
+class UnoTextLayouter final
+ : public cppu::WeakImplHelper<css::graphic::XTextLayouter, css::lang::XUnoTunnel>
+{
+private:
+ std::shared_ptr<gfx::ITextLayouter> mpTextLayouter;
+
+public:
+ UnoTextLayouter() {}
+
+ UnoTextLayouter(std::shared_ptr<gfx::ITextLayouter> const& rTextLayouter)
+ : mpTextLayouter(rTextLayouter)
+ {
+ }
+
+ std::shared_ptr<gfx::ITextLayouter> const& getTextLayouter() const { return mpTextLayouter; }
+
+ void setTextLayouter(std::shared_ptr<gfx::ITextLayouter> const& rTextLayouter)
+ {
+ mpTextLayouter = rTextLayouter;
+ }
+
+ UNO3_GETIMPLEMENTATION_DECL(UnoTextLayouter)
+};
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/fontattribute.hxx b/include/drawinglayer/attribute/fontattribute.hxx
index 1a7250170b6e..ed0be642f615 100644
--- a/include/drawinglayer/attribute/fontattribute.hxx
+++ b/include/drawinglayer/attribute/fontattribute.hxx
@@ -23,6 +23,8 @@
#include <o3tl/cow_wrapper.hxx>
#include <rtl/ustring.hxx>
+#include <basegfx/text/ITextLayouter.hxx>
+
namespace drawinglayer::attribute
{
class ImpFontAttribute;
@@ -35,7 +37,7 @@ namespace drawinglayer::attribute
This attribute class is able to hold all parameters needed/used
to completely define the parametrisation of a text portion.
*/
-class DRAWINGLAYER_DLLPUBLIC FontAttribute
+class DRAWINGLAYER_DLLPUBLIC FontAttribute : public gfx::IFontAttribute
{
public:
typedef o3tl::cow_wrapper<ImpFontAttribute> ImplType;
@@ -50,26 +52,26 @@ public:
bool bMonospaced = false, bool bOutline = false, bool bRTL = false,
bool bBiDiStrong = false);
FontAttribute();
- FontAttribute(const FontAttribute&);
- FontAttribute(FontAttribute&&);
- FontAttribute& operator=(const FontAttribute&);
- FontAttribute& operator=(FontAttribute&&);
- ~FontAttribute();
+ FontAttribute(const FontAttribute& rOther);
+ FontAttribute(FontAttribute&& rOther) noexcept;
+ FontAttribute& operator=(const FontAttribute& rOther);
+ FontAttribute& operator=(FontAttribute&& rOther) noexcept;
+ virtual ~FontAttribute();
// compare operator
bool operator==(const FontAttribute& rCandidate) const;
/// data read access
- const OUString& getFamilyName() const;
- const OUString& getStyleName() const;
- sal_uInt16 getWeight() const;
- bool getSymbol() const;
- bool getVertical() const;
- bool getItalic() const;
- bool getOutline() const;
- bool getRTL() const;
- bool getBiDiStrong() const;
- bool getMonospaced() const;
+ const OUString& getFamilyName() const override;
+ const OUString& getStyleName() const override;
+ sal_uInt16 getWeight() const override;
+ bool getSymbol() const override;
+ bool getVertical() const override;
+ bool getItalic() const override;
+ bool getOutline() const override;
+ bool getRTL() const override;
+ bool getBiDiStrong() const override;
+ bool getMonospaced() const override;
};
} // end of namespace drawinglayer::attribute
diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
index d46f42144636..58c93c78dcda 100644
--- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -27,6 +27,7 @@
#include <com/sun/star/util/XAccounting.hpp>
#include <cppuhelper/basemutex.hxx>
#include <basegfx/range/b2drange.hxx>
+#include <basegfx/text/ITextLayouter.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
/** defines ImplPrimitive2DIDBlock
@@ -44,10 +45,13 @@ class DRAWINGLAYERCORE_DLLPUBLIC VisitingParameters
{
private:
geometry::ViewInformation2D maViewInformation;
+ std::shared_ptr<gfx::ITextLayouter> mpTextLayouter;
public:
- explicit VisitingParameters(const geometry::ViewInformation2D& rViewInformation)
+ explicit VisitingParameters(geometry::ViewInformation2D const& rViewInformation,
+ std::shared_ptr<gfx::ITextLayouter> const& pTextLayouter)
: maViewInformation(rViewInformation)
+ , mpTextLayouter(pTextLayouter)
{
}
@@ -59,6 +63,8 @@ public:
}
const geometry::ViewInformation2D& getViewInformation() const { return maViewInformation; }
+
+ const std::shared_ptr<gfx::ITextLayouter>& getTextLayouter() const { return mpTextLayouter; }
};
typedef cppu::WeakComponentImplHelper<css::graphic::XPrimitive2D, css::util::XAccounting>
diff --git a/include/drawinglayer/processor2d/baseprocessor2d.hxx b/include/drawinglayer/processor2d/baseprocessor2d.hxx
index 802434fd9009..c723c5c0c619 100644
--- a/include/drawinglayer/processor2d/baseprocessor2d.hxx
+++ b/include/drawinglayer/processor2d/baseprocessor2d.hxx
@@ -24,7 +24,7 @@
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
-
+#include <basegfx/text/ITextLayouter.hxx>
namespace drawinglayer::processor2d
{
diff --git a/include/drawinglayer/processor2d/textlayoutdevice.hxx b/include/drawinglayer/processor2d/textlayoutdevice.hxx
index ddcdf06bc0dd..edcefec190e1 100644
--- a/include/drawinglayer/processor2d/textlayoutdevice.hxx
+++ b/include/drawinglayer/processor2d/textlayoutdevice.hxx
@@ -25,6 +25,7 @@
#include <vector>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <vcl/svapp.hxx>
+#include <basegfx/text/ITextLayouter.hxx>
// predefines
class VirtualDevice;
@@ -58,7 +59,7 @@ namespace drawinglayer::processor2d
When in the future FontHandling may move to an own library independent
from VCL, primitives will be prepared.
*/
-class DRAWINGLAYER_DLLPUBLIC TextLayouterDevice
+class DRAWINGLAYER_DLLPUBLIC TextLayouterDevice : public gfx::ITextLayouter
{
/// internally used VirtualDevice
SolarMutexGuard maSolarGuard;
@@ -71,6 +72,10 @@ public:
/// tooling methods
void setFont(const vcl::Font& rFont);
+
+ void setFontAttribute(const gfx::IFontAttribute& rFontAttribute, double fFontScaleX,
+ double fFontScaleY, const css::lang::Locale& rLocale) override;
+
void setFontAttribute(const attribute::FontAttribute& rFontAttribute, double fFontScaleX,
double fFontScaleY, const css::lang::Locale& rLocale);
@@ -84,7 +89,7 @@ public:
double getTextWidth(const OUString& rText, sal_uInt32 nIndex, sal_uInt32 nLength) const;
void getTextOutlines(basegfx::B2DPolyPolygonVector&, const OUString& rText, sal_uInt32 nIndex,
- sal_uInt32 nLength, const ::std::vector<double>& rDXArray) const;
+ sal_uInt32 nLength, const ::std::vector<double>& rDXArray) const override;
basegfx::B2DRange getTextBoundRect(const OUString& rText, sal_uInt32 nIndex,
sal_uInt32 nLength) const;
@@ -111,7 +116,7 @@ public:
fFontScaleY == fFontScaleX
*/
vcl::Font DRAWINGLAYER_DLLPUBLIC getVclFontFromFontAttribute(
- const attribute::FontAttribute& rFontAttribute, double fFontScaleX, double fFontScaleY,
+ const gfx::IFontAttribute& rFontAttribute, double fFontScaleX, double fFontScaleY,
double fFontRotation, const css::lang::Locale& rLocale);
/** Generate FontAttribute DataSet derived from the given VCL-Font.
diff --git a/offapi/com/sun/star/graphic/XTextLayouter.idl b/offapi/com/sun/star/graphic/XTextLayouter.idl
new file mode 100644
index 000000000000..c518558d49cf
--- /dev/null
+++ b/offapi/com/sun/star/graphic/XTextLayouter.idl
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+
+#ifndef com_sun_star_graphic_XTextLayouter_idl
+#define com_sun_star_graphic_XTextLayouter_idl
+
+#include <com/sun/star/uno/XInterface.idl>
+
+module com { module sun { module star { module graphic
+{
+
+/** Text layouter interface
+*/
+
+interface XTextLayouter : ::com::sun::star::uno::XInterface
+{
+};
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 3034fd0b1c8a950c180d4ebd6081a0ab386ff456
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri Feb 19 17:37:22 2021 +0900
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Fri Apr 2 16:21:26 2021 +0900
drawinglayer: move TextLayouter to processor2d
Change-Id: I87c7fafb51f108dcf58e7ddb97595f6488d884a0
diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk
index 451a9b1e55d3..05f47793daae 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -95,7 +95,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/primitive2d/textdecoratedprimitive2d \
drawinglayer/source/primitive2d/texteffectprimitive2d \
drawinglayer/source/primitive2d/texthierarchyprimitive2d \
- drawinglayer/source/primitive2d/textlayoutdevice \
drawinglayer/source/primitive2d/textlineprimitive2d \
drawinglayer/source/primitive2d/textprimitive2d \
drawinglayer/source/primitive2d/textstrikeoutprimitive2d \
@@ -130,6 +129,7 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/processor2d/objectinfoextractor2d \
drawinglayer/source/processor2d/processorfromoutputdevice \
drawinglayer/source/processor2d/textaspolygonextractor2d \
+ drawinglayer/source/processor2d/textlayoutdevice \
drawinglayer/source/processor2d/vclhelperbufferdevice \
drawinglayer/source/processor2d/vclmetafileprocessor2d \
drawinglayer/source/processor2d/vclpixelprocessor2d \
diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
index 8befcff3a7e3..43db89f68dd0 100644
--- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
@@ -59,7 +59,7 @@ namespace drawinglayer::primitive2d
return;
// common preparations
- TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
// TextLayouterDevice is needed to get metrics for text decorations like
// underline/strikeout/emphasis marks from it. For setup, the font size is needed
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index aa95f0091c30..b6bf98314752 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -18,7 +18,7 @@
*/
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
@@ -111,7 +111,7 @@ void TextSimplePortionPrimitive2D::getTextOutlinesAndTransformation(
const basegfx::B2DVector aFontScale(getCorrectedScaleAndFontScale(aScale));
// prepare textlayoutdevice
- TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
aTextLayouter.setFontAttribute(getFontAttribute(), aFontScale.getX(), aFontScale.getY(),
getLocale());
@@ -271,7 +271,7 @@ TextSimplePortionPrimitive2D::getB2DRange(VisitingParameters const& /*rParameter
const basegfx::B2DVector aFontScale(getCorrectedScaleAndFontScale(aScale));
// prepare textlayoutdevice
- TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
aTextLayouter.setFontAttribute(getFontAttribute(), aFontScale.getX(), aFontScale.getY(),
getLocale());
diff --git a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
index 71818e7861cc..25f4e0a1fa8d 100644
--- a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
@@ -18,7 +18,7 @@
*/
#include <primitive2d/textstrikeoutprimitive2d.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
@@ -68,7 +68,7 @@ namespace drawinglayer::primitive2d
getObjectTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
// prepare TextLayouter
- TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
aTextLayouter.setFontAttribute(
getFontAttribute(),
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/processor2d/textlayoutdevice.cxx
similarity index 99%
rename from drawinglayer/source/primitive2d/textlayoutdevice.cxx
rename to drawinglayer/source/processor2d/textlayoutdevice.cxx
index 933476b2045a..759a5757c8a2 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/processor2d/textlayoutdevice.cxx
@@ -23,7 +23,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <drawinglayer/attribute/fontattribute.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/unique_disposing_ptr.hxx>
#include <osl/diagnose.h>
@@ -36,7 +36,7 @@
#include <i18nlangtag/languagetag.hxx>
#include <vcl/svapp.hxx>
-namespace drawinglayer::primitive2d
+namespace drawinglayer::processor2d
{
namespace
{
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 37f23d98fd79..8070b3a71045 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -52,7 +52,7 @@
// for support of Title/Description in all apps when embedding pictures
#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
// control support
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
@@ -124,7 +124,7 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
&& basegfx::fTools::more(aFontScaling.getY(), 0.0))
{
// Get the VCL font (use FontHeight as FontWidth)
- vcl::Font aFont(primitive2d::getVclFontFromFontAttribute(
+ vcl::Font aFont(processor2d::getVclFontFromFontAttribute(
rTextCandidate.getFontAttribute(), aFontScaling.getX(), aFontScaling.getY(),
fRotate, rTextCandidate.getLocale()));
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index fc370a99d919..9eacd82b38ac 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -39,7 +39,7 @@
#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
#include <primitive2d/wallpaperprimitive2d.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx>
#include <primitive2d/textlineprimitive2d.hxx>
#include <primitive2d/textstrikeoutprimitive2d.hxx>
@@ -1067,7 +1067,7 @@ namespace wmfemfhelper
const vcl::Font& rFont = rProperty.getFont();
basegfx::B2DVector aFontScaling;
- rFontAttribute = drawinglayer::primitive2d::getFontAttributeFromVclFont(
+ rFontAttribute = drawinglayer::processor2d::getFontAttributeFromVclFont(
aFontScaling,
rFont,
bool(rProperty.getLayoutMode() & ComplexTextLayoutFlags::BiDiRtl),
@@ -1079,7 +1079,7 @@ namespace wmfemfhelper
// take text align into account
if(ALIGN_BASELINE != rFont.GetAlignment())
{
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouterDevice;
aTextLayouterDevice.setFont(rFont);
if(ALIGN_TOP == rFont.GetAlignment())
@@ -1231,7 +1231,7 @@ namespace wmfemfhelper
if(pResult && rProperty.getTextFillColorActive())
{
// text background is requested, add and encapsulate both to new primitive
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouterDevice;
aTextLayouterDevice.setFont(rFont);
// get text width
@@ -1341,7 +1341,7 @@ namespace wmfemfhelper
aTextTransform.translate(rAction.GetStartPoint().X(), rAction.GetStartPoint().Y());
// prepare TextLayouter (used in most cases)
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
aTextLayouter.setFont(rProperty.getFont());
if(bOverlineUsed)
@@ -1885,7 +1885,7 @@ namespace wmfemfhelper
if(nTextLength && rPropertyHolders.Current().getTextColorActive())
{
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouterDevice;
aTextLayouterDevice.setFont(rPropertyHolders.Current().getFont());
std::vector< double > aTextArray(
@@ -1947,7 +1947,7 @@ namespace wmfemfhelper
// Since AddTextRectActions is the only way as long as we do not have
// a simple text layouter available, i will try to add it to the
// TextLayouterDevice isolation.
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouterDevice;
aTextLayouterDevice.setFont(rPropertyHolders.Current().getFont());
GDIMetaFile aGDIMetaFile;
diff --git a/include/drawinglayer/primitive2d/textbreakuphelper.hxx b/include/drawinglayer/primitive2d/textbreakuphelper.hxx
index de233da8ea07..afe15f45f711 100644
--- a/include/drawinglayer/primitive2d/textbreakuphelper.hxx
+++ b/include/drawinglayer/primitive2d/textbreakuphelper.hxx
@@ -21,7 +21,7 @@
#include <drawinglayer/drawinglayerdllapi.h>
#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
namespace drawinglayer::primitive2d { class TextSimplePortionPrimitive2D; }
@@ -40,7 +40,7 @@ namespace drawinglayer::primitive2d
private:
const TextSimplePortionPrimitive2D& mrSource;
Primitive2DContainer mxResult;
- TextLayouterDevice maTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice maTextLayouter;
basegfx::utils::B2DHomMatrixBufferedOnDemandDecompose maDecTrans;
bool mbNoDXArray : 1;
@@ -58,7 +58,7 @@ namespace drawinglayer::primitive2d
virtual bool allowChange(sal_uInt32 nCount, basegfx::B2DHomMatrix& rNewTransform, sal_uInt32 nIndex, sal_uInt32 nLength);
/// allow read access to evtl. useful local parts
- const TextLayouterDevice& getTextLayouter() const { return maTextLayouter; }
+ const drawinglayer::processor2d::TextLayouterDevice& getTextLayouter() const { return maTextLayouter; }
const TextSimplePortionPrimitive2D& getSource() const { return mrSource; }
public:
diff --git a/include/drawinglayer/primitive2d/textlayoutdevice.hxx b/include/drawinglayer/processor2d/textlayoutdevice.hxx
similarity index 98%
rename from include/drawinglayer/primitive2d/textlayoutdevice.hxx
rename to include/drawinglayer/processor2d/textlayoutdevice.hxx
index 93587769c449..ddcdf06bc0dd 100644
--- a/include/drawinglayer/primitive2d/textlayoutdevice.hxx
+++ b/include/drawinglayer/processor2d/textlayoutdevice.hxx
@@ -49,7 +49,7 @@ struct Locale;
// access to one global impTimedRefDev incarnation in namespace drawinglayer::primitive
-namespace drawinglayer::primitive2d
+namespace drawinglayer::processor2d
{
/** TextLayouterDevice class
@@ -122,6 +122,6 @@ vcl::Font DRAWINGLAYER_DLLPUBLIC getVclFontFromFontAttribute(
attribute::FontAttribute DRAWINGLAYER_DLLPUBLIC getFontAttributeFromVclFont(
basegfx::B2DVector& o_rSize, const vcl::Font& rFont, bool bRTL, bool bBiDiStrong);
-} // end of namespace drawinglayer::primitive2d
+} // end of namespace drawinglayer::processor2d
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx
index 4dfa976816a4..747cf5d2f642 100644
--- a/sc/source/ui/view/hintwin.cxx
+++ b/sc/source/ui/view/hintwin.cxx
@@ -23,7 +23,7 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -66,7 +66,7 @@ drawinglayer::primitive2d::Primitive2DContainer ScOverlayHint::createOverlaySequ
// Create the text primitive for the title
basegfx::B2DVector aFontSize;
drawinglayer::attribute::FontAttribute aFontAttr =
- drawinglayer::primitive2d::getFontAttributeFromVclFont(aFontSize, aHeadFont, false, false);
+ drawinglayer::processor2d::getFontAttributeFromVclFont(aFontSize, aHeadFont, false, false);
FontMetric aFontMetric = pDefaultDev->GetFontMetric(aHeadFont);
Size aHintMargin = pDefaultDev->PixelToLogic(Size(HINT_MARGIN, HINT_MARGIN), rMapMode);
@@ -100,7 +100,7 @@ drawinglayer::primitive2d::Primitive2DContainer ScOverlayHint::createOverlaySequ
nTextOffsetY = aFontMetric.GetAscent();
sal_Int32 nLineHeight = aFontMetric.GetLineHeight();
- aFontAttr = drawinglayer::primitive2d::getFontAttributeFromVclFont(aFontSize, aTextFont, false, false);
+ aFontAttr = drawinglayer::processor2d::getFontAttributeFromVclFont(aFontSize, aTextFont, false, false);
sal_Int32 nIndex = 0;
Point aLineStart = aTextStart;
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 5a2a0be72ce7..620bf88f6db6 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -67,7 +67,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/color/bcolor.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
#include <svx/sdr/table/tablecontroller.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
@@ -360,7 +360,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewRedirector::createRedirected
aScaledVclFont.SetFontHeight( 500 * nTextSizeFactor );
// get basic geometry and get text size
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
aTextLayouter.setFont(aScaledVclFont);
const sal_Int32 nTextLength(aObjectString.getLength());
@@ -384,7 +384,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewRedirector::createRedirected
aVclFont.SetFontHeight( 500 );
const drawinglayer::attribute::FontAttribute aFontAttribute(
- drawinglayer::primitive2d::getFontAttributeFromVclFont(
+ drawinglayer::processor2d::getFontAttributeFromVclFont(
aTextSizeAttribute,
aVclFont,
false,
diff --git a/sfx2/source/control/emojiviewitem.cxx b/sfx2/source/control/emojiviewitem.cxx
index f9394ea9435c..5878aef883fd 100644
--- a/sfx2/source/control/emojiviewitem.cxx
+++ b/sfx2/source/control/emojiviewitem.cxx
@@ -11,7 +11,7 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/primitive2d/PolyPolygonSelectionPrimitive2D.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <com/sun/star/lang/Locale.hpp>
#include <rtl/ustrbuf.hxx>
@@ -36,7 +36,7 @@ void EmojiViewItem::calculateItemsPosition (const tools::Long /*nThumbnailHeight
const tools::Long /*nPadding*/, sal_uInt32 nMaxTextLength,
const ThumbnailItemAttributes *pAttrs)
{
- drawinglayer::primitive2d::TextLayouterDevice aTextDev;
+ drawinglayer::processor2d::TextLayouterDevice aTextDev;
aTextDev.setFontAttribute(pAttrs->aFontAttr,
pAttrs->aFontSize.getX(), pAttrs->aFontSize.getY(),
css::lang::Locale() );
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 312385dd87d9..4a019498e716 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -18,7 +18,7 @@
#include <comphelper/processfactory.hxx>
#include <drawinglayer/attribute/fontattribute.hxx>
#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
#include <o3tl/safeint.hxx>
@@ -893,7 +893,7 @@ void ThumbnailView::SetDrawingArea(weld::DrawingArea* pDrawingArea)
OutputDevice& rDevice = pDrawingArea->get_ref_device();
weld::SetPointFont(rDevice, pDrawingArea->get_font());
- mpItemAttrs->aFontAttr = getFontAttributeFromVclFont(mpItemAttrs->aFontSize, rDevice.GetFont(), false, true);
+ mpItemAttrs->aFontAttr = drawinglayer::processor2d::getFontAttributeFromVclFont(mpItemAttrs->aFontSize, rDevice.GetFont(), false, true);
SetOutputSizePixel(pDrawingArea->get_preferred_size());
}
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx
index e5ed6e3cb7f4..5f2a45e3aeab 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -27,7 +27,7 @@
#include <drawinglayer/primitive2d/fillgraphicprimitive2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/PolyPolygonSelectionPrimitive2D.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <vcl/graph.hxx>
@@ -120,7 +120,7 @@ void ThumbnailViewItem::calculateItemsPosition (const tools::Long nThumbnailHeig
const tools::Long nPadding, sal_uInt32 nMaxTextLength,
const ThumbnailItemAttributes *pAttrs)
{
- drawinglayer::primitive2d::TextLayouterDevice aTextDev;
+ drawinglayer::processor2d::TextLayouterDevice aTextDev;
aTextDev.setFontAttribute(pAttrs->aFontAttr,
pAttrs->aFontSize.getX(), pAttrs->aFontSize.getY(),
css::lang::Locale() );
@@ -205,7 +205,7 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
void ThumbnailViewItem::addTextPrimitives (const OUString& rText, const ThumbnailItemAttributes *pAttrs, Point aPos, drawinglayer::primitive2d::Primitive2DContainer& rSeq)
{
// adjust text drawing position according to text font
- drawinglayer::primitive2d::TextLayouterDevice aTextDev;
+ drawinglayer::processor2d::TextLayouterDevice aTextDev;
aTextDev.setFontAttribute(
pAttrs->aFontAttr,
pAttrs->aFontSize.getX(),
@@ -218,7 +218,7 @@ void ThumbnailViewItem::addTextPrimitives (const OUString& rText, const Thumbnai
OUString aOrigText(mrParent.isDrawMnemonic() ? OutputDevice::GetNonMnemonicString(rText, nMnemonicPos) : rText);
TextEngine aTextEngine;
- aTextEngine.SetFont(getVclFontFromFontAttribute(pAttrs->aFontAttr,
+ aTextEngine.SetFont(drawinglayer::processor2d::getVclFontFromFontAttribute(pAttrs->aFontAttr,
pAttrs->aFontSize.getX(), pAttrs->aFontSize.getY(), 0,
css::lang::Locale()));
aTextEngine.SetMaxTextWidth(maDrawArea.getWidth());
diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx
index a0ab6d9b08a9..341a0ea540a0 100644
--- a/svgio/source/svgreader/svgcharacternode.cxx
+++ b/svgio/source/svgreader/svgcharacternode.cxx
@@ -21,7 +21,7 @@
#include <svgstyleattributes.hxx>
#include <drawinglayer/attribute/fontattribute.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textbreakuphelper.hxx>
#include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx>
@@ -258,7 +258,7 @@ namespace svgio::svgreader
css::lang::Locale aLocale;
// prepare TextLayouterDevice
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouterDevice;
aTextLayouterDevice.setFontAttribute(aFontAttribute, fFontWidth, fFontHeight, aLocale);
// prepare TextArray
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 9c8c419873e9..a92a306e0cd1 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -51,7 +51,7 @@
#include <drawinglayer/primitive2d/texthierarchyprimitive2d.hxx>
#include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx>
#include <drawinglayer/primitive2d/graphicprimitive2d.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <svx/unoapi.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
@@ -162,7 +162,7 @@ namespace
OUString caseMappedText = rInfo.mrFont.CalcCaseMap( rInfo.maText );
basegfx::B2DVector aFontScaling;
drawinglayer::attribute::FontAttribute aFontAttribute(
- drawinglayer::primitive2d::getFontAttributeFromVclFont(
+ drawinglayer::processor2d::getFontAttributeFromVclFont(
aFontScaling,
rInfo.mrFont,
rInfo.IsRTL(),
@@ -593,7 +593,7 @@ namespace
}
// Start position is inside. Get TextBoundRect and TopLeft next
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouterDevice;
aTextLayouterDevice.setFont(pInfo->mrFont);
const basegfx::B2DRange aTextBoundRect(
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 44f72ec8de07..450183049bce 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -31,7 +31,7 @@
#include <com/sun/star/i18n/BreakIterator.hpp>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <basegfx/color/bcolor.hxx>
@@ -130,7 +130,7 @@ namespace
double getDisplayLength(sal_Int32 nIndex, sal_Int32 nLength) const
{
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
double fRetval(0.0);
if(maFont.IsVertical())
@@ -201,7 +201,7 @@ namespace
static double getParagraphTextLength(const ::std::vector< const impPathTextPortion* >& rTextPortions)
{
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
double fRetval(0.0);
for(const impPathTextPortion* pCandidate : rTextPortions)
@@ -328,13 +328,13 @@ namespace
if(pCandidate && pCandidate->getTextLength())
{
const drawinglayer::attribute::FontAttribute aCandidateFontAttribute(
- drawinglayer::primitive2d::getFontAttributeFromVclFont(
+ drawinglayer::processor2d::getFontAttributeFromVclFont(
aFontScaling,
pCandidate->getFont(),
pCandidate->isRTL(),
false));
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
aTextLayouter.setFont(pCandidate->getFont());
sal_Int32 nUsedTextLength(0);
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 90c5c449734e..200ce88ebe9c 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -92,7 +92,7 @@
#include <drawinglayer/primitive2d/discreteshadowprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
#include <svx/unoapi.hxx>
@@ -3701,7 +3701,7 @@ void SwColumnFrame::PaintBreak( ) const
vcl::Font aFont = pOut->GetSettings().GetStyleSettings().GetToolFont();
aFont.SetFontHeight( 8 * 20 );
pOut->SetFont( aFont );
- drawinglayer::attribute::FontAttribute aFontAttr = drawinglayer::primitive2d::getFontAttributeFromVclFont(
+ drawinglayer::attribute::FontAttribute aFontAttr = drawinglayer::processor2d::getFontAttributeFromVclFont(
aFontSize, aFont, IsRightToLeft(), false );
tools::Rectangle aTextRect;
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 444b99a51804..196e374cb672 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -35,8 +35,8 @@
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <editeng/boxitem.hxx>
#include <svx/hdft.hxx>
#include <sfx2/bindings.hxx>
@@ -305,7 +305,7 @@ void SwHeaderFooterWin::PaintButton()
// Create the text primitive
basegfx::BColor aLineColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
B2DVector aFontSize;
- FontAttribute aFontAttr = drawinglayer::primitive2d::getFontAttributeFromVclFont(aFontSize, m_xVirDev->GetFont(), false, false);
+ FontAttribute aFontAttr = drawinglayer::processor2d::getFontAttributeFromVclFont(aFontSize, m_xVirDev->GetFont(), false, false);
FontMetric aFontMetric = m_xVirDev->GetFontMetric(m_xVirDev->GetFont());
double nTextOffsetY = aFontMetric.GetAscent() + TEXT_PADDING;
diff --git a/sw/source/uibase/docvw/UnfloatTableButton.cxx b/sw/source/uibase/docvw/UnfloatTableButton.cxx
index bfe76c8cb690..af4eb7b26863 100644
--- a/sw/source/uibase/docvw/UnfloatTableButton.cxx
+++ b/sw/source/uibase/docvw/UnfloatTableButton.cxx
@@ -34,7 +34,7 @@
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <drawinglayer/attribute/fontattribute.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
#include <basegfx/vector/b2dvector.hxx>
@@ -208,7 +208,7 @@ void UnfloatTableButton::PaintButton()
basegfx::BColor aLineColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
basegfx::B2DVector aFontSize;
drawinglayer::attribute::FontAttribute aFontAttr
- = drawinglayer::primitive2d::getFontAttributeFromVclFont(aFontSize, m_xVirDev->GetFont(),
+ = drawinglayer::processor2d::getFontAttributeFromVclFont(aFontSize, m_xVirDev->GetFont(),
false, false);
FontMetric aFontMetric = m_xVirDev->GetFontMetric(m_xVirDev->GetFont());
commit 860463d100df44a17357c4419a5c93b95d16765d
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Feb 23 13:23:32 2021 +0900
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Fri Apr 2 16:19:31 2021 +0900
drawinglayer: make VisitingParameters constructor explicit
This discovers a bunch of cases where previously the
ViewInformation was implicitly converted into a VisitingParameter.
Change-Id: Ice233e9d3c9d12c5da284e190281a1d94059f49f
diff --git a/drawinglayer/inc/converters.hxx b/drawinglayer/inc/converters.hxx
index 5e4e8a49bdb5..8093c10db896 100644
--- a/drawinglayer/inc/converters.hxx
+++ b/drawinglayer/inc/converters.hxx
@@ -26,7 +26,7 @@ namespace drawinglayer
{
BitmapEx convertToBitmapEx(
const drawinglayer::primitive2d::Primitive2DContainer& rSeq,
- const geometry::ViewInformation2D& rViewInformation2D,
+ drawinglayer::primitive2d::VisitingParameters const& rParameters,
sal_uInt32 nDiscreteWidth,
sal_uInt32 nDiscreteHeight,
sal_uInt32 nMaxSquarePixels);
diff --git a/drawinglayer/qa/unit/border.cxx b/drawinglayer/qa/unit/border.cxx
index a3f7029b7350..801912f75825 100644
--- a/drawinglayer/qa/unit/border.cxx
+++ b/drawinglayer/qa/unit/border.cxx
@@ -66,9 +66,10 @@ CPPUNIT_TEST_FIXTURE(DrawinglayerBorderTest, testDoubleDecompositionSolid)
aStrokeAttribute));
// Decompose it into polygons.
- drawinglayer::geometry::ViewInformation2D aView;
+ const drawinglayer::geometry::ViewInformation2D aView;
+ const drawinglayer::primitive2d::VisitingParameters aVisitingParameters(aView);
drawinglayer::primitive2d::Primitive2DContainer aContainer;
- aBorder->get2DDecomposition(aContainer, aView);
+ aBorder->get2DDecomposition(aContainer, aVisitingParameters);
// Make sure it results in two borders as it's a double one.
CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(2), aContainer.size());
@@ -91,8 +92,9 @@ CPPUNIT_TEST_FIXTURE(DrawinglayerBorderTest, testDoublePixelProcessing)
// Create a pixel processor.
ScopedVclPtrInstance<VirtualDevice> pDev;
drawinglayer::geometry::ViewInformation2D aView;
- std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
- drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(*pDev, aView));
+ const drawinglayer::primitive2d::VisitingParameters aVisitingParameters(aView);
+ auto pProcessor = drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(
+ *pDev, aVisitingParameters);
CPPUNIT_ASSERT(pProcessor);
GDIMetaFile aMetaFile;
// Start recording after the processor is created, so we can test the pixel processor.
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 66b29591df7e..37fa2a2a477f 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -107,6 +107,8 @@ namespace drawinglayer::unorenderer
}
const geometry::ViewInformation2D aViewInformation2D(aViewInformationSequence);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+
const double fFactor100th_mmToInch(1.0 / (2.54 * 1000.0));
const sal_uInt32 nDiscreteWidth(basegfx::fround((fWidth * fFactor100th_mmToInch) * DPI_X));
const sal_uInt32 nDiscreteHeight(basegfx::fround((fHeight * fFactor100th_mmToInch) * DPI_Y));
@@ -129,7 +131,7 @@ namespace drawinglayer::unorenderer
BitmapEx aBitmapEx(
convertToBitmapEx(
xEmbedSeq,
- aViewInformation2D,
+ aVisitingParameters,
nDiscreteWidth,
nDiscreteHeight,
MaximumQuadraticPixels));
diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
index 91cfdaf1861d..10c893d21a1b 100644
--- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
@@ -100,17 +100,19 @@ namespace drawinglayer::primitive2d
// see if buffering is wanted. If so, create buffered content in given resolution
if(0 != mnDiscreteWidth && 0 != mnDiscreteHeight)
{
- const geometry::ViewInformation2D aViewInformation2D;
const primitive2d::Primitive2DReference xEmbedRef(
new primitive2d::TransformPrimitive2D(
basegfx::utils::createScaleB2DHomMatrix(mnDiscreteWidth, mnDiscreteHeight),
getChildren()));
const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef };
+ const geometry::ViewInformation2D aViewInformation2D;
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+
const BitmapEx aBitmapEx(
convertToBitmapEx(
xEmbedSeq,
- aViewInformation2D,
+ aVisitingParameters,
mnDiscreteWidth,
mnDiscreteHeight,
mnDiscreteWidth * mnDiscreteHeight));
diff --git a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx
index 0e6d2f5b8e96..f499e026dcc8 100644
--- a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx
@@ -84,7 +84,7 @@ namespace drawinglayer::primitive2d
// I will take the last one here. The small overhead of two primitives will only be
// used when UnifiedTransparencePrimitive2D is not handled directly.
- const basegfx::B2DRange aPolygonRange(getChildren().getB2DRange(rParameters.getViewInformation()));
+ const basegfx::B2DRange aPolygonRange(getChildren().getB2DRange(rParameters));
const basegfx::B2DPolygon aPolygon(basegfx::utils::createPolygonFromRect(aPolygonRange));
const basegfx::BColor aGray(getTransparence(), getTransparence(), getTransparence());
Primitive2DContainer aTransparenceContent(2);
diff --git a/drawinglayer/source/processor2d/baseprocessor2d.cxx b/drawinglayer/source/processor2d/baseprocessor2d.cxx
index 9d1671dcf959..39b72feec77f 100644
--- a/drawinglayer/source/processor2d/baseprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/baseprocessor2d.cxx
@@ -30,8 +30,8 @@ namespace drawinglayer::processor2d
{
}
- BaseProcessor2D::BaseProcessor2D(const geometry::ViewInformation2D& rViewInformation)
- : maViewInformation2D(rViewInformation)
+ BaseProcessor2D::BaseProcessor2D(primitive2d::VisitingParameters const & rVisitingParameters)
+ : maVisitingParameters(rVisitingParameters)
{
}
@@ -42,7 +42,7 @@ namespace drawinglayer::processor2d
void BaseProcessor2D::process(const primitive2d::BasePrimitive2D& rCandidate)
{
primitive2d::Primitive2DContainer aContainer;
- rCandidate.get2DDecomposition(aContainer, getViewInformation2D());
+ rCandidate.get2DDecomposition(aContainer, maVisitingParameters);
process(aContainer);
}
@@ -71,7 +71,7 @@ namespace drawinglayer::processor2d
else
{
// unknown implementation, use UNO API call instead and process recursively
- const uno::Sequence< beans::PropertyValue >& rViewParameters(getViewInformation2D().getViewInformationSequence());
+ const uno::Sequence<beans::PropertyValue>& rViewParameters(maVisitingParameters.getUnoProperties());
process(comphelper::sequenceToContainer<primitive2d::Primitive2DContainer>(xReference->getDecomposition(rViewParameters)));
}
}
diff --git a/drawinglayer/source/processor2d/contourextractor2d.cxx b/drawinglayer/source/processor2d/contourextractor2d.cxx
index 8abec2f50f9d..5b9adf4c0ab1 100644
--- a/drawinglayer/source/processor2d/contourextractor2d.cxx
+++ b/drawinglayer/source/processor2d/contourextractor2d.cxx
@@ -36,9 +36,9 @@ using namespace com::sun::star;
namespace drawinglayer::processor2d
{
ContourExtractor2D::ContourExtractor2D(
- const geometry::ViewInformation2D& rViewInformation,
+ primitive2d::VisitingParameters const& rVisitingParameters,
bool bExtractFillOnly)
- : BaseProcessor2D(rViewInformation),
+ : BaseProcessor2D(rVisitingParameters),
maExtractedContour(),
mbExtractFillOnly(bExtractFillOnly)
{
@@ -121,7 +121,7 @@ namespace drawinglayer::processor2d
{
// remember current ViewInformation2D
const primitive2d::TransformPrimitive2D& rTransformCandidate(static_cast< const primitive2d::TransformPrimitive2D& >(rCandidate));
- const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+ primitive2d::VisitingParameters aLastVisitingParameters(maVisitingParameters);
// create new local ViewInformation2D
const geometry::ViewInformation2D aViewInformation2D(
@@ -131,13 +131,14 @@ namespace drawinglayer::processor2d
getViewInformation2D().getVisualizedPage(),
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- updateViewInformation(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ updateVisitingParameters(aVisitingParameters);
// process content
process(rTransformCandidate.getChildren());
// restore transformations
- updateViewInformation(aLastViewInformation2D);
+ updateVisitingParameters(aLastVisitingParameters);
break;
}
@@ -173,7 +174,7 @@ namespace drawinglayer::processor2d
case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D :
{
// primitives who's BoundRect will be added in world coordinates
- basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aRange(rCandidate.getB2DRange(maVisitingParameters));
if (!aRange.isEmpty())
{
aRange.transform(getViewInformation2D().getObjectTransformation());
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 04505489c6f2..a41037426b09 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -37,11 +37,11 @@
namespace drawinglayer::processor2d
{
- HitTestProcessor2D::HitTestProcessor2D(const geometry::ViewInformation2D& rViewInformation,
+ HitTestProcessor2D::HitTestProcessor2D(primitive2d::VisitingParameters const& rVisitingParameters,
const basegfx::B2DPoint& rLogicHitPosition,
double fLogicHitTolerance,
bool bHitTextOnly)
- : BaseProcessor2D(rViewInformation),
+ : BaseProcessor2D(rVisitingParameters),
maDiscreteHitPosition(),
mfDiscreteHitTolerance(0.0),
maHitStack(),
@@ -230,7 +230,7 @@ namespace drawinglayer::processor2d
{
// remember current ViewInformation2D
const primitive2d::TransformPrimitive2D& rTransformCandidate(static_cast< const primitive2d::TransformPrimitive2D& >(rCandidate));
- const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+ primitive2d::VisitingParameters aLastVisitingParameters(maVisitingParameters);
// create new local ViewInformation2D containing transformation
const geometry::ViewInformation2D aViewInformation2D(
@@ -240,13 +240,14 @@ namespace drawinglayer::processor2d
getViewInformation2D().getVisualizedPage(),
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- updateViewInformation(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ updateVisitingParameters(aVisitingParameters);
// process child content recursively
process(rTransformCandidate.getChildren());
// restore transformations
- updateViewInformation(aLastViewInformation2D);
+ updateVisitingParameters(aLastVisitingParameters);
break;
}
@@ -411,7 +412,7 @@ namespace drawinglayer::processor2d
case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D :
{
// for text use the BoundRect of the primitive itself
- const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ const basegfx::B2DRange aRange(rCandidate.getB2DRange(maVisitingParameters));
if(!aRange.isEmpty())
{
@@ -428,7 +429,7 @@ namespace drawinglayer::processor2d
// The recently added BitmapEx::GetTransparency() makes it easy to extend
// the BitmapPrimitive2D HitTest to take the contained BitmapEx and it's
// transparency into account
- const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ const basegfx::B2DRange aRange(rCandidate.getB2DRange(maVisitingParameters));
if(!aRange.isEmpty())
{
@@ -482,7 +483,7 @@ namespace drawinglayer::processor2d
// This may be refined in the future, e.g:
// - For Bitmaps, the mask and/or transparence information may be used
// - For MetaFiles, the MetaFile content may be used
- const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ const basegfx::B2DRange aRange(rCandidate.getB2DRange(maVisitingParameters));
if(!aRange.isEmpty())
{
diff --git a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
index 9262e23e4509..cd4593b2a3a9 100644
--- a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
+++ b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
@@ -29,8 +29,8 @@ using namespace com::sun::star;
namespace drawinglayer::processor2d
{
- LineGeometryExtractor2D::LineGeometryExtractor2D(const geometry::ViewInformation2D& rViewInformation)
- : BaseProcessor2D(rViewInformation),
+ LineGeometryExtractor2D::LineGeometryExtractor2D(primitive2d::VisitingParameters const& rVisitingParameters)
+ : BaseProcessor2D(rVisitingParameters),
maExtractedHairlines(),
maExtractedLineFills(),
mbInLineGeometry(false)
@@ -83,7 +83,7 @@ namespace drawinglayer::processor2d
{
// remember current transformation and ViewInformation
const primitive2d::TransformPrimitive2D& rTransformCandidate(static_cast< const primitive2d::TransformPrimitive2D& >(rCandidate));
- const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+ primitive2d::VisitingParameters aLastVisitingParameters(maVisitingParameters);
// create new transformations for CurrentTransformation and for local ViewInformation2D
const geometry::ViewInformation2D aViewInformation2D(
@@ -93,13 +93,15 @@ namespace drawinglayer::processor2d
getViewInformation2D().getVisualizedPage(),
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- updateViewInformation(aViewInformation2D);
+
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ updateVisitingParameters(aVisitingParameters);
// process content
process(rTransformCandidate.getChildren());
// restore transformations
- updateViewInformation(aLastViewInformation2D);
+ updateVisitingParameters(aLastVisitingParameters);
break;
}
diff --git a/drawinglayer/source/processor2d/objectinfoextractor2d.cxx b/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
index 552406d53f68..4d3eb0188c14 100644
--- a/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
+++ b/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
@@ -62,8 +62,8 @@ namespace drawinglayer::processor2d
}
}
- ObjectInfoPrimitiveExtractor2D::ObjectInfoPrimitiveExtractor2D(const geometry::ViewInformation2D& rViewInformation)
- : BaseProcessor2D(rViewInformation),
+ ObjectInfoPrimitiveExtractor2D::ObjectInfoPrimitiveExtractor2D(primitive2d::VisitingParameters const& rVisitingParameters)
+ : BaseProcessor2D(rVisitingParameters),
mpFound(nullptr)
{
}
diff --git a/drawinglayer/source/processor2d/processor2dtools.cxx b/drawinglayer/source/processor2d/processor2dtools.cxx
index 7bc0f5fa0536..921ec4af81c3 100644
--- a/drawinglayer/source/processor2d/processor2dtools.cxx
+++ b/drawinglayer/source/processor2d/processor2dtools.cxx
@@ -29,15 +29,15 @@ namespace drawinglayer::processor2d
{
std::unique_ptr<BaseProcessor2D> createPixelProcessor2DFromOutputDevice(
OutputDevice& rTargetOutDev,
- const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
+ const drawinglayer::primitive2d::VisitingParameters& rParameters)
{
// create Pixel Vcl-Processor
- return std::make_unique<VclPixelProcessor2D>(rViewInformation2D, rTargetOutDev);
+ return std::make_unique<VclPixelProcessor2D>(rParameters, rTargetOutDev);
}
std::unique_ptr<BaseProcessor2D> createProcessor2DFromOutputDevice(
OutputDevice& rTargetOutDev,
- const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
+ const drawinglayer::primitive2d::VisitingParameters& rParameters)
{
const GDIMetaFile* pMetaFile = rTargetOutDev.GetConnectMetaFile();
const bool bOutputToRecordingMetaFile(pMetaFile && pMetaFile->IsRecord() && !pMetaFile->IsPause());
@@ -45,14 +45,12 @@ namespace drawinglayer::processor2d
if(bOutputToRecordingMetaFile)
{
// create MetaFile Vcl-Processor and process
- return std::make_unique<VclMetafileProcessor2D>(rViewInformation2D, rTargetOutDev);
+ return std::make_unique<VclMetafileProcessor2D>(rParameters, rTargetOutDev);
}
else
{
// create Pixel Vcl-Processor
- return createPixelProcessor2DFromOutputDevice(
- rTargetOutDev,
- rViewInformation2D);
+ return createPixelProcessor2DFromOutputDevice(rTargetOutDev, rParameters);
}
}
diff --git a/drawinglayer/source/processor2d/processorfromoutputdevice.cxx b/drawinglayer/source/processor2d/processorfromoutputdevice.cxx
index c8433753aeff..f16ad46faadb 100644
--- a/drawinglayer/source/processor2d/processorfromoutputdevice.cxx
+++ b/drawinglayer/source/processor2d/processorfromoutputdevice.cxx
@@ -29,7 +29,7 @@ namespace drawinglayer::processor2d
{
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> createBaseProcessor2DFromOutputDevice(
OutputDevice& rTargetOutDev,
- const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
+ drawinglayer::primitive2d::VisitingParameters const& rParameters)
{
const GDIMetaFile* pMetaFile = rTargetOutDev.GetConnectMetaFile();
const bool bOutputToRecordingMetaFile(pMetaFile && pMetaFile->IsRecord() && !pMetaFile->IsPause());
@@ -37,12 +37,12 @@ namespace drawinglayer::processor2d
if(bOutputToRecordingMetaFile)
{
// create MetaFile Vcl-Processor and process
- return std::make_unique<drawinglayer::processor2d::VclMetafileProcessor2D>(rViewInformation2D, rTargetOutDev);
+ return std::make_unique<drawinglayer::processor2d::VclMetafileProcessor2D>(rParameters, rTargetOutDev);
}
else
{
// create Pixel Vcl-Processor
- return std::make_unique<drawinglayer::processor2d::VclPixelProcessor2D>(rViewInformation2D, rTargetOutDev);
+ return std::make_unique<drawinglayer::processor2d::VclPixelProcessor2D>(rParameters, rTargetOutDev);
}
}
} // end of namespace
diff --git a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
index e3a584f86172..5eb6c9f9c8ff 100644
--- a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
+++ b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
@@ -174,7 +174,7 @@ namespace drawinglayer::processor2d
{
// remember current transformation and ViewInformation
const primitive2d::TransformPrimitive2D& rTransformCandidate(static_cast< const primitive2d::TransformPrimitive2D& >(rCandidate));
- const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+ primitive2d::VisitingParameters aLastParameters(maVisitingParameters);
// create new transformations for CurrentTransformation and for local ViewInformation2D
const geometry::ViewInformation2D aViewInformation2D(
@@ -184,13 +184,15 @@ namespace drawinglayer::processor2d
getViewInformation2D().getVisualizedPage(),
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- updateViewInformation(aViewInformation2D);
+
+ primitive2d::VisitingParameters aParameters(aViewInformation2D);
+ updateVisitingParameters(aParameters);
// process content
process(rTransformCandidate.getChildren());
// restore transformations
- updateViewInformation(aLastViewInformation2D);
+ updateVisitingParameters(aLastParameters);
break;
}
@@ -216,8 +218,8 @@ namespace drawinglayer::processor2d
}
}
- TextAsPolygonExtractor2D::TextAsPolygonExtractor2D(const geometry::ViewInformation2D& rViewInformation)
- : BaseProcessor2D(rViewInformation),
+ TextAsPolygonExtractor2D::TextAsPolygonExtractor2D(primitive2d::VisitingParameters const& rVisitingParameters)
+ : BaseProcessor2D(rVisitingParameters),
maTarget(),
maBColorModifierStack(),
mnInText(0)
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 6f690ca55f46..8bcf0ff4ebdd 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -214,7 +214,7 @@ VclMetafileProcessor2D::impDumpToMetaFile(const primitive2d::Primitive2DContaine
// Prepare VDev, MetaFile and connections
OutputDevice* pLastOutputDevice = mpOutputDevice;
GDIMetaFile* pLastMetafile = mpMetaFile;
- basegfx::B2DRange aPrimitiveRange(rContent.getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aPrimitiveRange(rContent.getB2DRange(maVisitingParameters));
// transform primitive range with current transformation (e.g shadow offset)
aPrimitiveRange.transform(maCurrentTransformation);
@@ -547,9 +547,9 @@ void VclMetafileProcessor2D::popList()
// init static break iterator
uno::Reference<css::i18n::XBreakIterator> VclMetafileProcessor2D::mxBreakIterator;
-VclMetafileProcessor2D::VclMetafileProcessor2D(const geometry::ViewInformation2D& rViewInformation,
- OutputDevice& rOutDev)
- : VclProcessor2D(rViewInformation, rOutDev)
+VclMetafileProcessor2D::VclMetafileProcessor2D(
+ drawinglayer::primitive2d::VisitingParameters const& rParameters, OutputDevice& rOutDev)
+ : VclProcessor2D(rParameters, rOutDev)
, mpMetaFile(rOutDev.GetConnectMetaFile())
, mnSvtGraphicFillCount(0)
, mnSvtGraphicStrokeCount(0)
@@ -563,7 +563,7 @@ VclMetafileProcessor2D::VclMetafileProcessor2D(const geometry::ViewInformation2D
"VclMetafileProcessor2D: Used on OutDev which has no MetaFile Target (!)");
// draw to logic coordinates, do not initialize maCurrentTransformation to viewTransformation
// but only to ObjectTransformation. Do not change MapMode of destination.
- maCurrentTransformation = rViewInformation.getObjectTransformation();
+ maCurrentTransformation = rParameters.getViewInformation().getObjectTransformation();
}
VclMetafileProcessor2D::~VclMetafileProcessor2D()
@@ -1122,7 +1122,7 @@ void VclMetafileProcessor2D::processControlPrimitive2D(
{
// still need to fill in the location (is a class Rectangle)
const basegfx::B2DRange aRangeLogic(
- rControlPrimitive.getB2DRange(getViewInformation2D()));
+ rControlPrimitive.getB2DRange(maVisitingParameters));
const tools::Rectangle aRectLogic(static_cast<sal_Int32>(floor(aRangeLogic.getMinX())),
static_cast<sal_Int32>(floor(aRangeLogic.getMinY())),
static_cast<sal_Int32>(ceil(aRangeLogic.getMaxX())),
@@ -1233,7 +1233,7 @@ void VclMetafileProcessor2D::processTextHierarchyFieldPrimitive2D(
// process recursively
primitive2d::Primitive2DContainer rContent;
- rFieldPrimitive.get2DDecomposition(rContent, getViewInformation2D());
+ rFieldPrimitive.get2DDecomposition(rContent, maVisitingParameters);
process(rContent);
// for the end comment the type is not relevant yet, they are all the same. Just add.
@@ -1244,7 +1244,7 @@ void VclMetafileProcessor2D::processTextHierarchyFieldPrimitive2D(
return;
// emulate data handling from ImpEditEngine::Paint
- const basegfx::B2DRange aViewRange(rContent.getB2DRange(getViewInformation2D()));
+ const basegfx::B2DRange aViewRange(rContent.getB2DRange(maVisitingParameters));
const tools::Rectangle aRectLogic(static_cast<sal_Int32>(floor(aViewRange.getMinX())),
static_cast<sal_Int32>(floor(aViewRange.getMinY())),
static_cast<sal_Int32>(ceil(aViewRange.getMaxX())),
@@ -2194,7 +2194,7 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D(
// transparence primitives with non-trivial transparence content) i will for now not
// refine to tiling here.
- basegfx::B2DRange aViewRange(rContent.getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aViewRange(rContent.getB2DRange(maVisitingParameters));
aViewRange.transform(maCurrentTransformation);
const tools::Rectangle aRectLogic(static_cast<sal_Int32>(floor(aViewRange.getMinX())),
static_cast<sal_Int32>(floor(aViewRange.getMinY())),
@@ -2254,7 +2254,9 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D(
getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- VclPixelProcessor2D aBufferProcessor(aViewInfo, *aBufferDevice);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInfo);
+
+ VclPixelProcessor2D aBufferProcessor(aVisitingParameters, *aBufferDevice);
// draw content using pixel renderer
const Point aEmptyPoint;
@@ -2385,14 +2387,16 @@ VclMetafileProcessor2D::CreateBufferDevice(const basegfx::B2DRange& rCandidateRa
void VclMetafileProcessor2D::processPrimitive2DOnPixelProcessor(
const primitive2d::BasePrimitive2D& rCandidate)
{
- basegfx::B2DRange aViewRange(rCandidate.getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aViewRange(rCandidate.getB2DRange(maVisitingParameters));
geometry::ViewInformation2D aViewInfo;
tools::Rectangle aRectLogic;
Size aSizePixel;
auto pBufferDevice(CreateBufferDevice(aViewRange, aViewInfo, aRectLogic, aSizePixel));
if (pBufferDevice)
{
- VclPixelProcessor2D aBufferProcessor(aViewInfo, *pBufferDevice, maBColorModifierStack);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInfo);
+ VclPixelProcessor2D aBufferProcessor(aVisitingParameters, *pBufferDevice,
+ maBColorModifierStack);
// draw content using pixel renderer
primitive2d::Primitive2DReference aRef(
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
index 67a79ca307cc..4e3f812f3a06 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
@@ -203,7 +203,7 @@ protected:
public:
/// constructor/destructor
- VclMetafileProcessor2D(const geometry::ViewInformation2D& rViewInformation,
+ VclMetafileProcessor2D(drawinglayer::primitive2d::VisitingParameters const& rParameters,
OutputDevice& rOutDev);
virtual ~VclMetafileProcessor2D() override;
};
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 143c9351a06a..b74510f5d7be 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -77,14 +77,15 @@ struct VclPixelProcessor2D::Impl
}
};
-VclPixelProcessor2D::VclPixelProcessor2D(const geometry::ViewInformation2D& rViewInformation,
+VclPixelProcessor2D::VclPixelProcessor2D(primitive2d::VisitingParameters const& rVisitingParameters,
OutputDevice& rOutDev,
const basegfx::BColorModifierStack& rInitStack)
- : VclProcessor2D(rViewInformation, rOutDev, rInitStack)
+ : VclProcessor2D(rVisitingParameters, rOutDev, rInitStack)
, m_pImpl(new Impl(rOutDev))
{
// prepare maCurrentTransformation matrix with viewTransformation to target directly to pixels
- maCurrentTransformation = rViewInformation.getObjectToViewTransformation();
+ maCurrentTransformation
+ = rVisitingParameters.getViewInformation().getObjectToViewTransformation();
// prepare output directly to pixels
mpOutputDevice->Push(PushFlags::MAPMODE);
@@ -1023,7 +1024,7 @@ AlphaMask ProcessAndBlurAlphaMask(const Bitmap& rMask, double fErodeDilateRadius
void VclPixelProcessor2D::processGlowPrimitive2D(const primitive2d::GlowPrimitive2D& rCandidate)
{
- basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aRange(rCandidate.getB2DRange(maVisitingParameters));
aRange.transform(maCurrentTransformation);
basegfx::B2DVector aGlowRadiusVector(rCandidate.getGlowRadius(), 0);
// Calculate the pixel size of glow radius in current transformation
@@ -1091,7 +1092,7 @@ void VclPixelProcessor2D::processSoftEdgePrimitive2D(
// borders, where they don't end. Ideally, process the full object once at maximal reasonable
// resolution, and store the resulting alpha mask in primitive's cache; then reuse it later,
// applying the transform.
- basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aRange(rCandidate.getB2DRange(maVisitingParameters));
aRange.transform(maCurrentTransformation);
basegfx::B2DVector aRadiusVector(rCandidate.getRadius(), 0);
// Calculate the pixel size of soft edge radius in current transformation
@@ -1151,7 +1152,7 @@ void VclPixelProcessor2D::processShadowPrimitive2D(const primitive2d::ShadowPrim
return;
}
- basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aRange(rCandidate.getB2DRange(maVisitingParameters));
aRange.transform(maCurrentTransformation);
basegfx::B2DVector aBlurRadiusVector(rCandidate.getShadowBlur(), 0);
aBlurRadiusVector *= maCurrentTransformation;
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
index 480fdcaa6e18..6a1b23db61fe 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
@@ -104,7 +104,8 @@ class VclPixelProcessor2D final : public VclProcessor2D
public:
/// constructor/destructor
- VclPixelProcessor2D(const geometry::ViewInformation2D& rViewInformation, OutputDevice& rOutDev,
+ VclPixelProcessor2D(primitive2d::VisitingParameters const& rVisitingParameters,
+ OutputDevice& rOutDev,
const basegfx::BColorModifierStack& rInitStack
= basegfx::BColorModifierStack());
virtual ~VclPixelProcessor2D() override;
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 5bd7e0194b66..37f23d98fd79 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -827,7 +827,7 @@ void VclProcessor2D::RenderUnifiedTransparencePrimitive2D(
else if (rTransCandidate.getTransparence() > 0.0 && rTransCandidate.getTransparence() < 1.0)
{
// transparence is in visible range
- basegfx::B2DRange aRange(rTransCandidate.getChildren().getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aRange(rTransCandidate.getChildren().getB2DRange(maVisitingParameters));
aRange.transform(maCurrentTransformation);
impBufferDevice aBufferDevice(*mpOutputDevice, aRange);
@@ -856,7 +856,7 @@ void VclProcessor2D::RenderTransparencePrimitive2D(
if (rTransCandidate.getChildren().empty())
return;
- basegfx::B2DRange aRange(rTransCandidate.getChildren().getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aRange(rTransCandidate.getChildren().getB2DRange(maVisitingParameters));
aRange.transform(maCurrentTransformation);
impBufferDevice aBufferDevice(*mpOutputDevice, aRange);
@@ -896,7 +896,7 @@ void VclProcessor2D::RenderTransformPrimitive2D(
{
// remember current transformation and ViewInformation
const basegfx::B2DHomMatrix aLastCurrentTransformation(maCurrentTransformation);
- const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+ primitive2d::VisitingParameters aLastVisitingParameters(maVisitingParameters);
// create new transformations for CurrentTransformation
// and for local ViewInformation2D
@@ -906,14 +906,15 @@ void VclProcessor2D::RenderTransformPrimitive2D(
getViewInformation2D().getViewTransformation(), getViewInformation2D().getViewport(),
getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- updateViewInformation(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ updateVisitingParameters(aVisitingParameters);
// process content
process(rTransformCandidate.getChildren());
// restore transformations
maCurrentTransformation = aLastCurrentTransformation;
- updateViewInformation(aLastViewInformation2D);
+ updateVisitingParameters(aLastVisitingParameters);
}
// new XDrawPage for ViewInformation2D
@@ -921,7 +922,7 @@ void VclProcessor2D::RenderPagePreviewPrimitive2D(
const primitive2d::PagePreviewPrimitive2D& rPagePreviewCandidate)
{
// remember current transformation and ViewInformation
- const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+ primitive2d::VisitingParameters aLastVisitingParameters(maVisitingParameters);
// create new local ViewInformation2D
const geometry::ViewInformation2D aViewInformation2D(
@@ -929,13 +930,14 @@ void VclProcessor2D::RenderPagePreviewPrimitive2D(
getViewInformation2D().getViewTransformation(), getViewInformation2D().getViewport(),
rPagePreviewCandidate.getXDrawPage(), getViewInformation2D().getViewTime(),
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list