[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 517 commits - android/source autogen.sh avmedia/source basctl/source basegfx/source basic/qa basic/source bin/check-elf-dynamic-objects bin/lint-ui.py bridges/inc bridges/source canvas/inc canvas/Library_cairocanvas.mk canvas/Library_canvastools.mk canvas/Library_oglcanvas.mk canvas/Library_vclcanvas.mk canvas/source chart2/qa chart2/source chart2/uiconfig comphelper/CppunitTest_comphelper_threadpool_test.mk comphelper/qa comphelper/source compilerplugins/clang config_host/config_box2d.h.in config_host/config_locales.h.in config_host/config_skia.h.in config_host.mk.in configmgr/source configure.ac connectivity/source cppuhelper/source cui/inc cui/Library_cui.mk cui/source cui/uiconfig cui/UIConfig_cui.mk dbaccess/qa dbaccess/source dbaccess/uiconfig dbaccess/util desktop/source desktop/unx distro-configs/Jenkins distro-configs/LibreOfficeWinArm64.conf drawinglayer/CppunitTest_drawinglayer_border.mk drawinglayer/inc drawinglayer/L ibrary_drawinglayercore.mk drawinglayer/Library_drawinglayer.mk drawinglayer/Module_drawinglayer.mk drawinglayer/source editeng/source embeddedobj/source embeddedobj/util emfio/CppunitTest_emfio_emf.mk emfio/Library_emfio.mk emfio/source eventattacher/source extensions/Executable_twain32shim.mk extensions/source extensions/test extensions/uiconfig external/coinmp external/icu external/liborcus external/libpng external/mariadb-connector-c external/nss external/pdfium external/skia extras/CustomTarget_autocorr.mk extras/Package_autocorr.mk extras/source filter/Library_pdffilter.mk filter/Library_svgfilter.mk filter/source filter/uiconfig forms/source formula/source fpicker/source framework/CppunitTest_framework_loadenv.mk framework/inc framework/Module_framework.mk framework/qa framework/source .git-hooks/pre-commit .gitmodules helpcontent2 i18npool/CustomTarget_collator.mk i18npool/Library_localedata_euro.mk i18npool/source icon-themes/breeze icon-themes/breeze_dark icon-themes/colib re icon-themes/colibre_svg icon-themes/elementary icon-themes/karasa_jaga icon-themes/sifr icon-themes/sifr_dark icon-themes/sukapura idlc/source include/basegfx include/comphelper include/drawinglayer include/editeng include/formula include/LibreOfficeKit include/o3tl include/oox include/registry include/sal include/sfx2 include/svl include/svtools include/svx include/tools include/vcl instsetoo_native/util ios/LibreOfficeLight ios/UnitTest lingucomponent/source linguistic/source lotuswordpro/source o3tl/qa odk/CustomTarget_check.mk odk/Module_odk.mk offapi/com officecfg/registry oox/qa oox/source osx/soffice.xcodeproj package/source postprocess/CustomTarget_registry.mk pyuno/source readlicense_oo/license reportdesign/source RepositoryExternal.mk Repository.mk sal/osl sal/qa sal/rtl scaddins/source sc/CppunitTest_sc_parallelism.mk sc/CppunitTest_sc_ucalc.mk schema/libreoffice sc/inc sc/Library_sc.mk sc/qa scripting/examples scripting/Package_ScriptsPython.mk scripting/source sc/sdi sc/source sc/uiconfig sc/UIConfig_scalc.mk sd/CppunitTest_sd_uimpress.mk sdext/source sd/inc sd/Library_sd.mk sd/qa sd/source sd/uiconfig sfx2/inc sfx2/Library_sfx.mk sfx2/sdi sfx2/source sfx2/uiconfig shell/source slideshow/source smoketest/libtest.cxx solenv/bin solenv/flatpak-manifest.in solenv/gbuild solenv/gcc-wrappers solenv/gdb solenv/sanitizers solenv/wsl starmath/inc starmath/qa starmath/source stoc/source store/source svgio/CppunitTest_svgio.mk svgio/Library_svgio.mk svgio/source svl/qa svl/source svtools/inc svtools/source svx/CppunitTest_svx_unit.mk svx/inc svx/Library_svxcore.mk svx/Library_svx.mk svx/qa svx/sdi svx/source svx/uiconfig sw/CppunitTest_sw_layoutwriter.mk sw/CppunitTest_sw_uibase_uno.mk sw/CppunitTest_sw_uiwriter.mk sw/CppunitTest_sw_uwriter.mk sw/inc sw/Library_sw.mk sw/Library_swui.mk sw/Module_sw.mk sw/qa sw/sdi sw/source sw/uiconfig testtools/source toolkit/source tools/inc tools/source ucbhelper/source ucb/Library_srtrs1.mk ucb/Library_ucphier1.mk uc b/Library_ucptdoc1.mk ucb/source uitest/uitest unoidl/Module_unoidl.mk unotools/source uui/uiconfig vcl/backendtest vcl/CppunitTest_vcl_skia.mk vcl/Executable_visualbackendtest.mk vcl/headless vcl/inc vcl/jsdialog vcl/Library_vcl.mk vcl/Module_vcl.mk vcl/Package_tipoftheday.mk vcl/Package_toolbarmode.mk vcl/qa vcl/qt5 vcl/skia vcl/source vcl/uiconfig vcl/unx vcl/vclplug_win.component vcl/win writerfilter/CppunitTest_writerfilter_rtftok.mk writerfilter/qa writerfilter/source writerperfect/CppunitTest_writerperfect_wpftimport.mk writerperfect/inc writerperfect/source writerperfect/uiconfig xmloff/source xmlsecurity/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Sat Oct 17 17:48:34 UTC 2020
Rebased ref, commits from common ancestor:
commit 00354dfc859a259d288abff5ba94daaf1d8980d4
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Oct 17 19:46:55 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 17 19:46:55 2020 +0200
pragma once for svdobj.hxx
Change-Id: Iceb1c2f0c2e1c488e4bef4fed395dd61a40da8ca
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index a097e26b0f3d..b19dd5278539 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_SVX_SVDOBJ_HXX
-#define INCLUDED_SVX_SVDOBJ_HXX
+#pragma once
#include <memory>
#include <com/sun/star/uno/Any.hxx>
@@ -1082,6 +1081,4 @@ template< typename T > T* SdrObject::CloneHelper(SdrModel& rTargetModel) const
return pObj;
}
-#endif // INCLUDED_SVX_SVDOBJ_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit f455f8456683311807649f90ba35463b3835ced9
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Oct 17 18:31:47 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 17 18:31:47 2020 +0200
svx: organize forward declarations in svdobj.hxx
Change-Id: I256212175f66b5d0599df990675e7344505b7841
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index cb98d67a2891..a097e26b0f3d 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -75,6 +75,7 @@ class SdrLayerIDSet;
class Fraction;
enum class PointerStyle;
class Graphic;
+class SvxShape;
namespace basegfx
{
@@ -83,31 +84,13 @@ namespace basegfx
class B2DHomMatrix;
}
-namespace sdr
-{
- namespace properties
- {
- class BaseProperties;
- }
+namespace sdr { class ObjectUser; }
+namespace sdr::properties { class BaseProperties; }
+namespace sdr::contact { class ViewContact; }
- class ObjectUser;
-}
+namespace svx { class PropertyChangeNotifier; }
-namespace sdr
-{
- namespace contact
- {
- class ViewContact;
- } // end of namespace contact
-}
-
-namespace svx
-{
- class PropertyChangeNotifier;
-}
-class SvxShape;
-class SdrObject;
struct SVXCORE_DLLPUBLIC SdrObjectFreeOp;
// helper for constructing std::unique_ptr for SdrObjects where a
commit 39c31f2a636d173c646c4c42c298dc131f6b11e5
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri Jul 17 15:09:49 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 17 15:07:47 2020 +0200
Revert "hack for gradients split into adjacent polygons (tdf#133016)"
This reverts commit 777ac5456a1f24fea29931ede983b5b8ad9a063d.
diff --git a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
index 7c9eb8441306..9b9d258046cc 100644
--- a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
@@ -30,7 +30,7 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <sal/log.hxx>
#include <cmath>
-#include <vcl/skia/SkiaHelper.hxx>
+
using namespace com::sun::star;
@@ -868,12 +868,6 @@ namespace drawinglayer::primitive2d
// use color distance and discrete lengths to calculate step count
const sal_uInt32 nSteps(calculateStepsForSvgGradient(getColorA(), getColorB(), fDelta, fDiscreteUnit));
- // HACK: Splitting a gradient into adjacent polygons with gradually changing color is silly.
- // If antialiasing is used to draw them, the AA-ed adjacent edges won't line up perfectly
- // because of the AA (see SkiaSalGraphicsImpl::mergePolyPolygonToPrevious()).
- // Make the polygons a bit wider, so they the partial overlap "fixes" this.
- const double fixup = SkiaHelper::isVCLSkiaEnabled() ? fDiscreteUnit / 2 : 0;
-
// tdf#117949 Use a small amount of discrete overlap at the edges. Usually this
// should be exactly 0.0 and 1.0, but there were cases when this gets clipped
// against the mask polygon which got numerically problematic.
@@ -887,7 +881,7 @@ namespace drawinglayer::primitive2d
basegfx::B2DRange(
getOffsetA() - fDiscreteUnit,
-0.0001, // TTTT -> should be 0.0, see comment above
- getOffsetA() + (fDelta / nSteps) + fDiscreteUnit + fixup,
+ getOffsetA() + (fDelta / nSteps) + fDiscreteUnit,
1.0001))); // TTTT -> should be 1.0, see comment above
// prepare loop (inside to outside, [0.0 .. 1.0[)
commit 103dd7b78e385821426a6ffe7ff8e04d895c5994
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Jun 15 19:39:35 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 17 15:07:46 2020 +0200
vcl: add a Bitmap interface to basegfx, BitmapEx implementing it
Change-Id: I758f421d545191883e615f5016e9fc643459556e
diff --git a/include/basegfx/bitmap/Bitmap.hxx b/include/basegfx/bitmap/Bitmap.hxx
new file mode 100644
index 000000000000..b91b702aa212
--- /dev/null
+++ b/include/basegfx/bitmap/Bitmap.hxx
@@ -0,0 +1,23 @@
+/* -*- 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 <basegfx/basegfxdllapi.h>
+
+namespace basegfx
+{
+class BASEGFX_DLLPUBLIC IBitmap
+{
+};
+
+} // end of namespace basegfx
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index 4dac473bb2f5..774afe981d07 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -25,6 +25,8 @@
#include <vcl/Scanline.hxx>
#include <tools/color.hxx>
+#include <basegfx/bitmap/Bitmap.hxx>
+
#include <sal/types.h>
namespace com::sun::star::rendering {
@@ -40,7 +42,7 @@ enum class TransparentType
Bitmap
};
-class SAL_WARN_UNUSED VCL_DLLPUBLIC BitmapEx
+class SAL_WARN_UNUSED VCL_DLLPUBLIC BitmapEx : basegfx::IBitmap
{
public:
commit 75f9471a19f2a76ec10c8796b8a8c83a76aed5a6
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed May 27 12:49:05 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 17 15:07:46 2020 +0200
add o3tl version of hash_combine to not depend on boost for this
Change-Id: I081f8d116ef811baa8aa5de35a6cb51fa4de7d56
diff --git a/include/o3tl/hash_combine.hxx b/include/o3tl/hash_combine.hxx
new file mode 100644
index 000000000000..17419b3e2c0f
--- /dev/null
+++ b/include/o3tl/hash_combine.hxx
@@ -0,0 +1,29 @@
+/* -*- 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
+
+namespace o3tl
+{
+template <typename T, typename N, std::enable_if_t<(sizeof(N) == 4), bool> = false>
+inline void hash_combine(N& nSeed, T const& nValue)
+{
+ static_assert(sizeof(nSeed) == 4);
+ nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B9u + (nSeed << 6) + (nSeed >> 2);
+}
+
+template <typename T, typename N, std::enable_if_t<(sizeof(N) == 8), bool> = false>
+inline void hash_combine(N& nSeed, T const& nValue)
+{
+ static_assert(sizeof(nSeed) == 8);
+ nSeed ^= std::hash<T>{}(nValue) + 0x9E3779B97F4A7C15llu + (nSeed << 12) + (nSeed >> 4);
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/o3tl/qa/test-lru_map.cxx b/o3tl/qa/test-lru_map.cxx
index a03a6bf37200..3ab285c4329a 100644
--- a/o3tl/qa/test-lru_map.cxx
+++ b/o3tl/qa/test-lru_map.cxx
@@ -15,7 +15,7 @@
#include <o3tl/lru_map.hxx>
-#include <boost/functional/hash.hpp>
+#include <o3tl/hash_combine.hxx>
using namespace ::o3tl;
@@ -206,8 +206,8 @@ struct TestClassKeyHashFunction
std::size_t operator()(TestClassKey const& aKey) const
{
std::size_t seed = 0;
- boost::hash_combine(seed, aKey.mA);
- boost::hash_combine(seed, aKey.mB);
+ o3tl::hash_combine(seed, aKey.mA);
+ o3tl::hash_combine(seed, aKey.mB);
return seed;
}
};
commit 35b483f8c7f24bc8ee3308395e7f8aa3f349a487
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue May 26 15:57:38 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 17 15:07:45 2020 +0200
GraphicAttributes: put const. and op. '=' into the header file
Change-Id: I1bc38f89457c3593673b445e7571a4fd82d5960b
diff --git a/include/vcl/GraphicAttributes.hxx b/include/vcl/GraphicAttributes.hxx
index 28b23d324a1d..47aad3b723af 100644
--- a/include/vcl/GraphicAttributes.hxx
+++ b/include/vcl/GraphicAttributes.hxx
@@ -51,9 +51,37 @@ private:
GraphicDrawMode meDrawMode;
public:
- GraphicAttr();
+ GraphicAttr()
+ : mfGamma(1.0)
+ , mnMirrFlags(basegfx::MirrorDirectionFlags::NONE)
+ , mnLeftCrop(0)
+ , mnTopCrop(0)
+ , mnRightCrop(0)
+ , mnBottomCrop(0)
+ , mnRotate10(0)
+ , mnContPercent(0)
+ , mnLumPercent(0)
+ , mnRPercent(0)
+ , mnGPercent(0)
+ , mnBPercent(0)
+ , mbInvert(false)
+ , mcTransparency(0)
+ , meDrawMode(GraphicDrawMode::Standard)
+ {
+ }
+
+ bool operator==(const GraphicAttr& rAttr) const
+ {
+ return mfGamma == rAttr.mfGamma && mnMirrFlags == rAttr.mnMirrFlags
+ && mnLeftCrop == rAttr.mnLeftCrop && mnTopCrop == rAttr.mnTopCrop
+ && mnRightCrop == rAttr.mnRightCrop && mnBottomCrop == rAttr.mnBottomCrop
+ && mnRotate10 == rAttr.mnRotate10 && mnContPercent == rAttr.mnContPercent
+ && mnLumPercent == rAttr.mnLumPercent && mnRPercent == rAttr.mnRPercent
+ && mnGPercent == rAttr.mnGPercent && mnBPercent == rAttr.mnBPercent
+ && mbInvert == rAttr.mbInvert && mcTransparency == rAttr.mcTransparency
+ && meDrawMode == rAttr.meDrawMode;
+ }
- bool operator==(const GraphicAttr& rAttr) const;
bool operator!=(const GraphicAttr& rAttr) const { return !(*this == rAttr); }
void SetDrawMode(GraphicDrawMode eDrawMode) { meDrawMode = eDrawMode; }
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 5d3a1b593850..4b29c2d59a9e 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -328,7 +328,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/graphic/GraphicObject \
vcl/source/graphic/GraphicObject2 \
vcl/source/graphic/GraphicReader \
- vcl/source/graphic/grfattr \
vcl/source/graphic/Manager \
vcl/source/graphic/UnoGraphic \
vcl/source/graphic/UnoGraphicMapper \
diff --git a/vcl/source/graphic/grfattr.cxx b/vcl/source/graphic/grfattr.cxx
deleted file mode 100644
index 36e8605b77de..000000000000
--- a/vcl/source/graphic/grfattr.cxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <vcl/GraphicAttributes.hxx>
-
-GraphicAttr::GraphicAttr() :
- mfGamma ( 1.0 ),
- mnMirrFlags ( basegfx::MirrorDirectionFlags::NONE ),
- mnLeftCrop ( 0 ),
- mnTopCrop ( 0 ),
- mnRightCrop ( 0 ),
- mnBottomCrop ( 0 ),
- mnRotate10 ( 0 ),
- mnContPercent ( 0 ),
- mnLumPercent ( 0 ),
- mnRPercent ( 0 ),
- mnGPercent ( 0 ),
- mnBPercent ( 0 ),
- mbInvert ( false ),
- mcTransparency ( 0 ),
- meDrawMode ( GraphicDrawMode::Standard )
-{
-}
-
-bool GraphicAttr::operator==( const GraphicAttr& rAttr ) const
-{
- return( ( mfGamma == rAttr.mfGamma ) &&
- ( mnMirrFlags == rAttr.mnMirrFlags ) &&
- ( mnLeftCrop == rAttr.mnLeftCrop ) &&
- ( mnTopCrop == rAttr.mnTopCrop ) &&
- ( mnRightCrop == rAttr.mnRightCrop ) &&
- ( mnBottomCrop == rAttr.mnBottomCrop ) &&
- ( mnRotate10 == rAttr.mnRotate10 ) &&
- ( mnContPercent == rAttr.mnContPercent ) &&
- ( mnLumPercent == rAttr.mnLumPercent ) &&
- ( mnRPercent == rAttr.mnRPercent ) &&
- ( mnGPercent == rAttr.mnGPercent ) &&
- ( mnBPercent == rAttr.mnBPercent ) &&
- ( mbInvert == rAttr.mbInvert ) &&
- ( mcTransparency == rAttr.mcTransparency ) &&
- ( meDrawMode == rAttr.meDrawMode ) );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 6428873fa323c73b84c7b36ffca433392ac060a9
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue May 26 13:39:45 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 17 15:07:44 2020 +0200
basegfx::MirrorDirectionFlags as replacement for BmpMirrorFlags
BmpMirrorFlags in Bitmap is an attribute for bitmap manipulation
(mirroring). This change creates a copy of the flags in basegfx
as MirrorDirectionFlags, which will be used in the fututre as a
general repalcement for the BmpMirrorFlags, that will be changed
step by step.
For now we only use the flags in GraphicAttr to make it independent
form vcl, and cast to/from BmpMirrorFLags and MirrorDirectionFlags
where needed.
Change-Id: I01a69a4d241caa22cff61bdbf87944af57684749
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index f86b1585b13f..2f571ed66aa3 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -49,8 +49,10 @@ void GraphicPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer,
if (getGraphicAttr().IsMirrored())
{
// content needs mirroring
- const bool bHMirr(getGraphicAttr().GetMirrorFlags() & BmpMirrorFlags::Horizontal);
- const bool bVMirr(getGraphicAttr().GetMirrorFlags() & BmpMirrorFlags::Vertical);
+ const bool bHMirr(getGraphicAttr().GetMirrorFlags()
+ & basegfx::MirrorDirectionFlags::Horizontal);
+ const bool bVMirr(getGraphicAttr().GetMirrorFlags()
+ & basegfx::MirrorDirectionFlags::Vertical);
// mirror by applying negative scale to the unit primitive and
// applying the object transformation on it.
@@ -69,7 +71,7 @@ void GraphicPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer,
aSuppressGraphicAttr.SetCrop(0, 0, 0, 0);
aSuppressGraphicAttr.SetRotation(0);
- aSuppressGraphicAttr.SetMirrorFlags(BmpMirrorFlags::NONE);
+ aSuppressGraphicAttr.SetMirrorFlags(basegfx::MirrorDirectionFlags::NONE);
aSuppressGraphicAttr.SetTransparency(0);
const GraphicObject& rGraphicObject = getGraphicObject();
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index f9f3f7197f21..a7dca76ae607 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1673,7 +1673,7 @@ bool EscherPropertyContainer::CreateGraphicProperties(const uno::Reference<beans
if(bMirrored)
{
- pGraphicAttr->SetMirrorFlags(BmpMirrorFlags::Horizontal);
+ pGraphicAttr->SetMirrorFlags(basegfx::MirrorDirectionFlags::Horizontal);
}
if(nTransparency)
diff --git a/include/basegfx/bitmap/BitmapAttributes.hxx b/include/basegfx/bitmap/BitmapAttributes.hxx
new file mode 100644
index 000000000000..d918d55faa99
--- /dev/null
+++ b/include/basegfx/bitmap/BitmapAttributes.hxx
@@ -0,0 +1,36 @@
+/* -*- 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 <basegfx/basegfxdllapi.h>
+#include <o3tl/typed_flags_set.hxx>
+
+namespace basegfx
+{
+enum class MirrorDirectionFlags
+{
+ NONE = 0x00,
+ Horizontal = 0x01,
+ Vertical = 0x02,
+};
+
+} // end of namespace basegfx
+
+namespace o3tl
+{
+template <>
+struct typed_flags<basegfx::MirrorDirectionFlags>
+ : is_typed_flags<basegfx::MirrorDirectionFlags, 0x03>
+{
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/GraphicAttributes.hxx b/include/vcl/GraphicAttributes.hxx
index 08b716b3db08..28b23d324a1d 100644
--- a/include/vcl/GraphicAttributes.hxx
+++ b/include/vcl/GraphicAttributes.hxx
@@ -21,6 +21,7 @@
#include <vcl/dllapi.h>
#include <vcl/bitmap.hxx>
+#include <basegfx/bitmap/BitmapAttributes.hxx>
enum class GraphicDrawMode
{
@@ -34,7 +35,7 @@ class VCL_DLLPUBLIC GraphicAttr
{
private:
double mfGamma;
- BmpMirrorFlags mnMirrFlags;
+ basegfx::MirrorDirectionFlags mnMirrFlags;
long mnLeftCrop;
long mnTopCrop;
long mnRightCrop;
@@ -58,8 +59,8 @@ public:
void SetDrawMode(GraphicDrawMode eDrawMode) { meDrawMode = eDrawMode; }
GraphicDrawMode GetDrawMode() const { return meDrawMode; }
- void SetMirrorFlags(BmpMirrorFlags nMirrFlags) { mnMirrFlags = nMirrFlags; }
- BmpMirrorFlags GetMirrorFlags() const { return mnMirrFlags; }
+ void SetMirrorFlags(basegfx::MirrorDirectionFlags nMirrFlags) { mnMirrFlags = nMirrFlags; }
+ basegfx::MirrorDirectionFlags GetMirrorFlags() const { return mnMirrFlags; }
void SetCrop(long nLeft_100TH_MM, long nTop_100TH_MM, long nRight_100TH_MM,
long nBottom_100TH_MM)
@@ -102,7 +103,7 @@ public:
sal_uInt8 GetTransparency() const { return mcTransparency; }
bool IsSpecialDrawMode() const { return (meDrawMode != GraphicDrawMode::Standard); }
- bool IsMirrored() const { return mnMirrFlags != BmpMirrorFlags::NONE; }
+ bool IsMirrored() const { return mnMirrFlags != basegfx::MirrorDirectionFlags::NONE; }
bool IsCropped() const
{
return (mnLeftCrop != 0 || mnTopCrop != 0 || mnRightCrop != 0 || mnBottomCrop != 0);
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index 8fceef864ae2..db24da9a5552 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -336,7 +336,9 @@ namespace sdr::contact
if(bHMirr || bVMirr)
{
- aLocalGrafInfo.SetMirrorFlags((bHMirr ? BmpMirrorFlags::Horizontal : BmpMirrorFlags::NONE)|(bVMirr ? BmpMirrorFlags::Vertical : BmpMirrorFlags::NONE));
+ basegfx::MirrorDirectionFlags eVertical = bVMirr ? basegfx::MirrorDirectionFlags::Vertical : basegfx::MirrorDirectionFlags::NONE;
+ basegfx::MirrorDirectionFlags eHorizontal = bHMirr ? basegfx::MirrorDirectionFlags::Horizontal : basegfx::MirrorDirectionFlags::NONE;
+ aLocalGrafInfo.SetMirrorFlags(eVertical | eHorizontal);
}
// fill object matrix
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 2f2c4886f86d..ed1433256d8e 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -378,7 +378,10 @@ GraphicAttr SdrGrafObj::GetGraphicAttr( SdrGrafObjTransformsAttrs nTransformFlag
bool bHMirr = nMirrorCase == 2 || nMirrorCase == 4;
bool bVMirr = nMirrorCase == 3 || nMirrorCase == 4;
- aActAttr.SetMirrorFlags( ( bHMirr ? BmpMirrorFlags::Horizontal : BmpMirrorFlags::NONE ) | ( bVMirr ? BmpMirrorFlags::Vertical : BmpMirrorFlags::NONE ) );
+ basegfx::MirrorDirectionFlags eVertical = bVMirr ? basegfx::MirrorDirectionFlags::Vertical : basegfx::MirrorDirectionFlags::NONE;
+ basegfx::MirrorDirectionFlags eHorizontal = bHMirr ? basegfx::MirrorDirectionFlags::Horizontal : basegfx::MirrorDirectionFlags::NONE;
+
+ aActAttr.SetMirrorFlags(eVertical | eHorizontal);
}
if( bRotate )
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 5114516c82fc..c030be76b26b 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -728,22 +728,22 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA,
rGA.SetDrawMode( rSet.GetDrawModeGrf().GetValue() );
const SwMirrorGrf & rMirror = rSet.GetMirrorGrf();
- BmpMirrorFlags nMirror = BmpMirrorFlags::NONE;
+ basegfx::MirrorDirectionFlags nMirror = basegfx::MirrorDirectionFlags::NONE;
if( rMirror.IsGrfToggle() && pFrame && !pFrame->FindPageFrame()->OnRightPage() )
{
switch( rMirror.GetValue() )
{
case MirrorGraph::Dont:
- nMirror = BmpMirrorFlags::Horizontal;
+ nMirror = basegfx::MirrorDirectionFlags::Horizontal;
break;
case MirrorGraph::Vertical:
- nMirror = BmpMirrorFlags::NONE;
+ nMirror = basegfx::MirrorDirectionFlags::NONE;
break;
case MirrorGraph::Horizontal:
- nMirror = BmpMirrorFlags::Horizontal|BmpMirrorFlags::Vertical;
+ nMirror = basegfx::MirrorDirectionFlags::Horizontal | basegfx::MirrorDirectionFlags::Vertical;
break;
default:
- nMirror = BmpMirrorFlags::Vertical;
+ nMirror = basegfx::MirrorDirectionFlags::Vertical;
break;
}
}
@@ -751,13 +751,13 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA,
switch( rMirror.GetValue() )
{
case MirrorGraph::Both:
- nMirror = BmpMirrorFlags::Horizontal|BmpMirrorFlags::Vertical;
+ nMirror = basegfx::MirrorDirectionFlags::Horizontal | basegfx::MirrorDirectionFlags::Vertical;
break;
case MirrorGraph::Vertical:
- nMirror = BmpMirrorFlags::Horizontal;
+ nMirror = basegfx::MirrorDirectionFlags::Horizontal;
break;
case MirrorGraph::Horizontal:
- nMirror = BmpMirrorFlags::Vertical;
+ nMirror = basegfx::MirrorDirectionFlags::Vertical;
break;
default: break;
}
diff --git a/vcl/source/graphic/GraphicObject.cxx b/vcl/source/graphic/GraphicObject.cxx
index d44a4bdafe78..db95f4167ef4 100644
--- a/vcl/source/graphic/GraphicObject.cxx
+++ b/vcl/source/graphic/GraphicObject.cxx
@@ -168,7 +168,7 @@ void lclImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, GraphicAdjustmen
if( ( nAdjustmentFlags & GraphicAdjustmentFlags::MIRROR ) && aAttr.IsMirrored() )
{
- rBmpEx.Mirror( aAttr.GetMirrorFlags() );
+ rBmpEx.Mirror(BmpMirrorFlags(aAttr.GetMirrorFlags()) );
}
if( ( nAdjustmentFlags & GraphicAdjustmentFlags::ROTATE ) && aAttr.IsRotated() )
@@ -219,7 +219,7 @@ void lclImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, GraphicAdjustme
if( ( nAdjustmentFlags & GraphicAdjustmentFlags::MIRROR ) && aAttr.IsMirrored() )
{
- rMtf.Mirror( aAttr.GetMirrorFlags() );
+ rMtf.Mirror(BmpMirrorFlags(aAttr.GetMirrorFlags()));
}
if( ( nAdjustmentFlags & GraphicAdjustmentFlags::ROTATE ) && aAttr.IsRotated() )
@@ -270,7 +270,7 @@ void lclImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, GraphicAdju
if( ( nAdjustmentFlags & GraphicAdjustmentFlags::MIRROR ) && aAttr.IsMirrored() )
{
- rAnimation.Mirror( aAttr.GetMirrorFlags() );
+ rAnimation.Mirror(BmpMirrorFlags(aAttr.GetMirrorFlags()));
}
if( ( nAdjustmentFlags & GraphicAdjustmentFlags::ROTATE ) && aAttr.IsRotated() )
@@ -383,7 +383,7 @@ bool GraphicObject::ImplGetCropParams( OutputDevice const * pOut, Point& rPt, Si
if( !aSize100.IsEmpty() && nTotalWidth > 0 && nTotalHeight > 0 )
{
double fScale = static_cast<double>(aSize100.Width()) / nTotalWidth;
- const long nNewLeft = -FRound( ( ( pAttr->GetMirrorFlags() & BmpMirrorFlags::Horizontal ) ? pAttr->GetRightCrop() : pAttr->GetLeftCrop() ) * fScale );
+ const long nNewLeft = -FRound( ( ( BmpMirrorFlags(pAttr->GetMirrorFlags()) & BmpMirrorFlags::Horizontal ) ? pAttr->GetRightCrop() : pAttr->GetLeftCrop() ) * fScale );
const long nNewRight = nNewLeft + FRound( aSize100.Width() * fScale ) - 1;
fScale = static_cast<double>(rSz.Width()) / aSize100.Width();
@@ -391,7 +391,7 @@ bool GraphicObject::ImplGetCropParams( OutputDevice const * pOut, Point& rPt, Si
rSz.setWidth( FRound( ( nNewRight - nNewLeft + 1 ) * fScale ) );
fScale = static_cast<double>(aSize100.Height()) / nTotalHeight;
- const long nNewTop = -FRound( ( ( pAttr->GetMirrorFlags() & BmpMirrorFlags::Vertical ) ? pAttr->GetBottomCrop() : pAttr->GetTopCrop() ) * fScale );
+ const long nNewTop = -FRound( ( ( BmpMirrorFlags(pAttr->GetMirrorFlags()) & BmpMirrorFlags::Vertical ) ? pAttr->GetBottomCrop() : pAttr->GetTopCrop() ) * fScale );
const long nNewBottom = nNewTop + FRound( aSize100.Height() * fScale ) - 1;
fScale = static_cast<double>(rSz.Height()) / aSize100.Height();
@@ -473,7 +473,8 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
{
aPt.AdjustX(aSz.Width() + 1 );
aSz.setWidth( -aSz.Width() );
- aAttr.SetMirrorFlags( aAttr.GetMirrorFlags() ^ BmpMirrorFlags::Horizontal );
+ BmpMirrorFlags eFlags = BmpMirrorFlags(aAttr.GetMirrorFlags()) ^ BmpMirrorFlags::Horizontal;
+ aAttr.SetMirrorFlags(basegfx::MirrorDirectionFlags(eFlags));
}
// mirrored vertically
@@ -481,7 +482,8 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
{
aPt.AdjustY(aSz.Height() + 1 );
aSz.setHeight( -aSz.Height() );
- aAttr.SetMirrorFlags( aAttr.GetMirrorFlags() ^ BmpMirrorFlags::Vertical );
+ BmpMirrorFlags eFlags = BmpMirrorFlags(aAttr.GetMirrorFlags()) ^ BmpMirrorFlags::Vertical;
+ aAttr.SetMirrorFlags(basegfx::MirrorDirectionFlags(eFlags));
}
if( bCropped )
diff --git a/vcl/source/graphic/grfattr.cxx b/vcl/source/graphic/grfattr.cxx
index 35acaf50b841..36e8605b77de 100644
--- a/vcl/source/graphic/grfattr.cxx
+++ b/vcl/source/graphic/grfattr.cxx
@@ -21,7 +21,7 @@
GraphicAttr::GraphicAttr() :
mfGamma ( 1.0 ),
- mnMirrFlags ( BmpMirrorFlags::NONE ),
+ mnMirrFlags ( basegfx::MirrorDirectionFlags::NONE ),
mnLeftCrop ( 0 ),
mnTopCrop ( 0 ),
mnRightCrop ( 0 ),
commit 5a314791247c360b58ffad375fce1c0d92ce9f93
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 22:28:35 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 17 15:07:44 2020 +0200
Move some basic primitives to drawinglayer CORE
Mostly which are easy to move and used in VclProcessor2D
Change-Id: Ie1559e13a2a7cdb5225421def2f9145026ff9121
diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk
index 4896c0ad0759..451a9b1e55d3 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -50,11 +50,6 @@ $(eval $(call gb_Library_use_libraries,drawinglayer,\
$(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/animation/animationtiming \
drawinglayer/source/attribute/fillgraphicattribute \
- drawinglayer/source/attribute/fillgradientattribute \
- drawinglayer/source/attribute/fillhatchattribute \
- drawinglayer/source/attribute/fontattribute \
- drawinglayer/source/attribute/lineattribute \
- drawinglayer/source/attribute/linestartendattribute \
drawinglayer/source/attribute/materialattribute3d \
drawinglayer/source/attribute/sdrallattribute3d \
drawinglayer/source/attribute/sdrfillattribute \
@@ -67,11 +62,9 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/attribute/sdrobjectattribute3d \
drawinglayer/source/attribute/sdrsceneattribute3d \
drawinglayer/source/attribute/sdrshadowattribute \
- drawinglayer/source/attribute/strokeattribute \
drawinglayer/source/geometry/viewinformation3d \
drawinglayer/source/primitive2d/animatedprimitive2d \
drawinglayer/source/primitive2d/backgroundcolorprimitive2d \
- drawinglayer/source/primitive2d/bitmapprimitive2d \
drawinglayer/source/primitive2d/borderlineprimitive2d \
drawinglayer/source/primitive2d/controlprimitive2d \
drawinglayer/source/primitive2d/cropprimitive2d \
@@ -80,54 +73,32 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/primitive2d/embedded3dprimitive2d \
drawinglayer/source/primitive2d/epsprimitive2d \
drawinglayer/source/primitive2d/fillgraphicprimitive2d \
- drawinglayer/source/primitive2d/fillgradientprimitive2d \
- drawinglayer/source/primitive2d/fillhatchprimitive2d \
drawinglayer/source/primitive2d/glowprimitive2d \
drawinglayer/source/primitive2d/graphicprimitivehelper2d \
drawinglayer/source/primitive2d/graphicprimitive2d \
drawinglayer/source/primitive2d/gridprimitive2d \
- drawinglayer/source/primitive2d/groupprimitive2d \
drawinglayer/source/primitive2d/helplineprimitive2d \
drawinglayer/source/primitive2d/hiddengeometryprimitive2d \
drawinglayer/source/primitive2d/invertprimitive2d \
drawinglayer/source/primitive2d/markerarrayprimitive2d \
- drawinglayer/source/primitive2d/maskprimitive2d \
drawinglayer/source/primitive2d/mediaprimitive2d \
drawinglayer/source/primitive2d/metafileprimitive2d \
- drawinglayer/source/primitive2d/modifiedcolorprimitive2d \
- drawinglayer/source/primitive2d/objectinfoprimitive2d \
drawinglayer/source/primitive2d/pagehierarchyprimitive2d \
- drawinglayer/source/primitive2d/pagepreviewprimitive2d \
drawinglayer/source/primitive2d/patternfillprimitive2d \
- drawinglayer/source/primitive2d/pointarrayprimitive2d \
- drawinglayer/source/primitive2d/polygonprimitive2d \
- drawinglayer/source/primitive2d/PolyPolygonHairlinePrimitive2D \
- drawinglayer/source/primitive2d/PolyPolygonMarkerPrimitive2D \
- drawinglayer/source/primitive2d/PolyPolygonStrokePrimitive2D \
- drawinglayer/source/primitive2d/PolyPolygonColorPrimitive2D \
- drawinglayer/source/primitive2d/PolyPolygonGradientPrimitive2D \
- drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D \
drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D \
- drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D \
- drawinglayer/source/primitive2d/primitivetools2d \
drawinglayer/source/primitive2d/sceneprimitive2d \
drawinglayer/source/primitive2d/sdrdecompositiontools2d \
drawinglayer/source/primitive2d/shadowprimitive2d \
drawinglayer/source/primitive2d/softedgeprimitive2d \
drawinglayer/source/primitive2d/structuretagprimitive2d \
- drawinglayer/source/primitive2d/svggradientprimitive2d \
drawinglayer/source/primitive2d/textbreakuphelper \
drawinglayer/source/primitive2d/textdecoratedprimitive2d \
drawinglayer/source/primitive2d/texteffectprimitive2d \
- drawinglayer/source/primitive2d/textenumsprimitive2d \
drawinglayer/source/primitive2d/texthierarchyprimitive2d \
drawinglayer/source/primitive2d/textlayoutdevice \
drawinglayer/source/primitive2d/textlineprimitive2d \
drawinglayer/source/primitive2d/textprimitive2d \
drawinglayer/source/primitive2d/textstrikeoutprimitive2d \
- drawinglayer/source/primitive2d/transformprimitive2d \
- drawinglayer/source/primitive2d/transparenceprimitive2d \
- drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d \
drawinglayer/source/primitive2d/wallpaperprimitive2d \
drawinglayer/source/primitive2d/wrongspellprimitive2d \
drawinglayer/source/primitive3d/baseprimitive3d \
@@ -185,7 +156,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/tools/wmfemfhelper \
drawinglayer/source/tools/primitive2dxmldump \
drawinglayer/source/drawinglayeruno/xprimitive2drenderer \
- drawinglayer/source/texture/texture \
drawinglayer/source/dumper/XShapeDumper \
drawinglayer/source/dumper/EnhancedShapeDumper \
))
diff --git a/drawinglayer/Library_drawinglayercore.mk b/drawinglayer/Library_drawinglayercore.mk
index f1643d27014d..972ac32f5388 100644
--- a/drawinglayer/Library_drawinglayercore.mk
+++ b/drawinglayer/Library_drawinglayercore.mk
@@ -40,10 +40,47 @@ $(eval $(call gb_Library_use_libraries,drawinglayercore,\
))
$(eval $(call gb_Library_add_exception_objects,drawinglayercore,\
+ drawinglayer/source/attribute/lineattribute \
+ drawinglayer/source/attribute/strokeattribute \
+ drawinglayer/source/attribute/linestartendattribute \
+ drawinglayer/source/attribute/fillgradientattribute \
+ drawinglayer/source/attribute/fillhatchattribute \
+ drawinglayer/source/attribute/fontattribute \
+ drawinglayer/source/geometry/viewinformation2d \
+ drawinglayer/source/texture/texture \
drawinglayer/source/primitive2d/baseprimitive2d \
drawinglayer/source/primitive2d/Primitive2DContainer \
drawinglayer/source/primitive2d/Tools \
- drawinglayer/source/geometry/viewinformation2d \
+ drawinglayer/source/primitive2d/polygonprimitive2d \
+ drawinglayer/source/primitive2d/PolyPolygonColorPrimitive2D \
+ drawinglayer/source/primitive2d/PolyPolygonHairlinePrimitive2D \
+ drawinglayer/source/primitive2d/PolyPolygonMarkerPrimitive2D \
+ drawinglayer/source/primitive2d/PolyPolygonStrokePrimitive2D \
+ drawinglayer/source/primitive2d/PolyPolygonGradientPrimitive2D \
+ drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D \
+ drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D \
+ drawinglayer/source/primitive2d/fillgradientprimitive2d \
+ drawinglayer/source/primitive2d/maskprimitive2d \
+ drawinglayer/source/primitive2d/groupprimitive2d \
+ drawinglayer/source/primitive2d/fillhatchprimitive2d \
+ drawinglayer/source/primitive2d/primitivetools2d \
+ drawinglayer/source/primitive2d/pointarrayprimitive2d \
+ drawinglayer/source/primitive2d/modifiedcolorprimitive2d \
+ drawinglayer/source/primitive2d/bitmapprimitive2d \
+ drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d \
+ drawinglayer/source/primitive2d/transparenceprimitive2d \
+ drawinglayer/source/primitive2d/pagepreviewprimitive2d \
+ drawinglayer/source/primitive2d/transformprimitive2d \
+ drawinglayer/source/primitive2d/svggradientprimitive2d \
+ drawinglayer/source/primitive2d/objectinfoprimitive2d \
+ drawinglayer/source/primitive2d/textenumsprimitive2d \
))
+# drawinglayer/source/primitive2d/epsprimitive2d \
+# drawinglayer/source/primitive2d/markerarrayprimitive2d \
+# drawinglayer/source/primitive2d/fillgraphicprimitive2d \
+# drawinglayer/source/primitive2d/textdecoratedprimitive2d \
+# drawinglayer/source/primitive2d/textprimitive2d \
+
+
# vim: set noet sw=4 ts=4:
diff --git a/filter/Library_pdffilter.mk b/filter/Library_pdffilter.mk
index a7cb47a65231..349883578482 100644
--- a/filter/Library_pdffilter.mk
+++ b/filter/Library_pdffilter.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_Library_use_libraries,pdffilter,\
cppuhelper \
cppu \
sal \
+ drawinglayercore \
drawinglayer \
))
commit 8dabb3f7da9c3b91d6ca9aa6af219667c5b05c64
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Thu Aug 13 10:16:35 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 17 15:07:43 2020 +0200
drawinglayer: externalize PolygonWavePrimitive2D class
Change-Id: I20a702c838ec68686b9c7e407be31ae9158cbef6
diff --git a/include/drawinglayer/primitive2d/polygonprimitive2d.hxx b/include/drawinglayer/primitive2d/polygonprimitive2d.hxx
index ac56461e35b0..57a37b60814f 100644
--- a/include/drawinglayer/primitive2d/polygonprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/polygonprimitive2d.hxx
@@ -39,7 +39,7 @@ namespace drawinglayer::primitive2d
This is one of the non-decomposable primitives, so a renderer
should process it.
*/
-class DRAWINGLAYER_DLLPUBLIC PolygonHairlinePrimitive2D final : public BasePrimitive2D
+class DRAWINGLAYERCORE_DLLPUBLIC PolygonHairlinePrimitive2D final : public BasePrimitive2D
{
private:
/// the hairline geometry
@@ -76,7 +76,7 @@ public:
It will be decomposed to the needed PolygonHairlinePrimitive2D if
not handled directly by a renderer.
*/
-class DRAWINGLAYER_DLLPUBLIC PolygonMarkerPrimitive2D final
+class DRAWINGLAYERCORE_DLLPUBLIC PolygonMarkerPrimitive2D final
: public BufferedDecompositionPrimitive2D
{
private:
@@ -131,7 +131,7 @@ public:
and stroke attributes. It will be decomposed dependent on the definition
to the needed primitives, e.g. filled PolyPolygons for fat lines.
*/
-class DRAWINGLAYER_DLLPUBLIC PolygonStrokePrimitive2D : public BufferedDecompositionPrimitive2D
+class DRAWINGLAYERCORE_DLLPUBLIC PolygonStrokePrimitive2D : public BufferedDecompositionPrimitive2D
{
private:
/// the line geometry
@@ -180,7 +180,7 @@ public:
This primitive defines a waveline based on a PolygonStrokePrimitive2D
where the wave is defined by wave width and wave length.
*/
-class PolygonWavePrimitive2D final : public PolygonStrokePrimitive2D
+class DRAWINGLAYERCORE_DLLPUBLIC PolygonWavePrimitive2D final : public PolygonStrokePrimitive2D
{
private:
/// wave definition
@@ -225,7 +225,8 @@ public:
possibly extended by start and end definitions, which are
normally used for arrows.
*/
-class DRAWINGLAYER_DLLPUBLIC PolygonStrokeArrowPrimitive2D final : public PolygonStrokePrimitive2D
+class DRAWINGLAYERCORE_DLLPUBLIC PolygonStrokeArrowPrimitive2D final
+ : public PolygonStrokePrimitive2D
{
private:
/// geometric definitions for line start and end
commit 90306bcb75482b3a5fe1beb850d70290ef41b406
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 20:50:29 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 17 15:07:43 2020 +0200
drawinglayer: externalize PointArrayPrimitive2D class
Change-Id: I8ee993947bf2f4437cf3a429c43a81132fac0947
diff --git a/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx b/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
index 7e516555162a..ba4be8c5dcc4 100644
--- a/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/pointarrayprimitive2d.hxx
@@ -37,7 +37,7 @@ namespace drawinglayer::primitive2d
should process it (Currently it is only used for grid visualisation,
but this may change).
*/
- class PointArrayPrimitive2D final : public BasePrimitive2D
+ class DRAWINGLAYER_DLLPUBLIC PointArrayPrimitive2D final : public BasePrimitive2D
{
private:
/// the array of positions
commit c3aae41e27b4449f3d0dee22bc2e6e275dc6523c
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 20:43:38 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 17 15:07:42 2020 +0200
drawinglayer: externalize classes in texture.hxx
Change-Id: I1e49a6c896733ebebf16db23f3c2f8b06161d659
diff --git a/drawinglayer/inc/texture/texture.hxx b/drawinglayer/inc/texture/texture.hxx
index 24e23a4b241c..b34bde38d1bc 100644
--- a/drawinglayer/inc/texture/texture.hxx
+++ b/drawinglayer/inc/texture/texture.hxx
@@ -30,7 +30,7 @@
namespace drawinglayer::texture
{
- class GeoTexSvx
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvx
{
public:
GeoTexSvx();
@@ -53,7 +53,7 @@ namespace drawinglayer::texture
basegfx::BColor maBColor;
};
- class GeoTexSvxGradient : public GeoTexSvx
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradient : public GeoTexSvx
{
protected:
basegfx::ODFGradientInfo maGradientInfo;
@@ -79,7 +79,7 @@ namespace drawinglayer::texture
basegfx::BColor& rOuterColor) = 0;
};
- class GeoTexSvxGradientLinear final : public GeoTexSvxGradient
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientLinear final : public GeoTexSvxGradient
{
double mfUnitMinX;
double mfUnitWidth;
@@ -102,7 +102,7 @@ namespace drawinglayer::texture
virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
};
- class GeoTexSvxGradientAxial final : public GeoTexSvxGradient
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientAxial final : public GeoTexSvxGradient
{
double mfUnitMinX;
double mfUnitWidth;
@@ -124,7 +124,7 @@ namespace drawinglayer::texture
virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
};
- class GeoTexSvxGradientRadial final : public GeoTexSvxGradient
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientRadial final : public GeoTexSvxGradient
{
public:
GeoTexSvxGradientRadial(
@@ -143,7 +143,7 @@ namespace drawinglayer::texture
virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
};
- class GeoTexSvxGradientElliptical final : public GeoTexSvxGradient
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientElliptical final : public GeoTexSvxGradient
{
public:
GeoTexSvxGradientElliptical(
@@ -163,7 +163,7 @@ namespace drawinglayer::texture
virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
};
- class GeoTexSvxGradientSquare final : public GeoTexSvxGradient
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientSquare final : public GeoTexSvxGradient
{
public:
GeoTexSvxGradientSquare(
@@ -183,7 +183,7 @@ namespace drawinglayer::texture
virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
};
- class GeoTexSvxGradientRect final : public GeoTexSvxGradient
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxGradientRect final : public GeoTexSvxGradient
{
public:
GeoTexSvxGradientRect(
@@ -203,7 +203,7 @@ namespace drawinglayer::texture
virtual void modifyBColor(const basegfx::B2DPoint& rUV, basegfx::BColor& rBColor, double& rfOpacity) const override;
};
- class GeoTexSvxHatch final : public GeoTexSvx
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxHatch final : public GeoTexSvx
{
basegfx::B2DRange maOutputRange;
basegfx::B2DHomMatrix maTextureTransform;
@@ -239,7 +239,7 @@ namespace drawinglayer::texture
// given percentage value (offsetX has to be 0.0 <= offsetX <= 1.0).
// Accordingly to offsetY. If both are given, offsetX is preferred
// and offsetY is ignored.
- class GeoTexSvxTiled final : public GeoTexSvx
+ class DRAWINGLAYER_DLLPUBLIC GeoTexSvxTiled final : public GeoTexSvx
{
basegfx::B2DRange maRange;
double mfOffsetX;
commit cdaefd60136c78cf6f00ddc5de0e81c5c6b676bd
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri May 8 20:40:59 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 17 15:07:41 2020 +0200
drawinglayer: externalize FillHatchPrimitive2D class
Change-Id: I9ad1f179a43bb6c501cb699c0f26523f47307829
diff --git a/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
index 03bc12139fcb..07399ce0e759 100644
--- a/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
@@ -24,9 +24,6 @@
#include <drawinglayer/attribute/fillhatchattribute.hxx>
#include <basegfx/color/bcolor.hxx>
-
-// FillHatchPrimitive2D class
-
namespace drawinglayer::primitive2d
{
/** FillHatchPrimitive2D class
@@ -43,7 +40,7 @@ namespace drawinglayer::primitive2d
The decomposition will deliver the hatch lines.
*/
- class FillHatchPrimitive2D final : public DiscreteMetricDependentPrimitive2D
+ class DRAWINGLAYER_DLLPUBLIC FillHatchPrimitive2D final : public DiscreteMetricDependentPrimitive2D
{
private:
/// the geometrically visible area
commit 4b02d78be87454d800dc21166e6ffa7f84544f08
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Apr 1 13:00:25 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 17 15:07:41 2020 +0200
Add OutputDevice::drawPrimitive2D to OutputDevice
Change-Id: Ifc22eca62df72bddd247ba097054f34756520614
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 18f91b205faf..a48fb1d183a2 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -49,6 +49,8 @@
#include <com/sun/star/drawing/LineCap.hpp>
#include <com/sun/star/uno/Reference.h>
+#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
+
#include <memory>
#include <vector>
@@ -1959,6 +1961,9 @@ public:
///@}
+ bool drawPrimitive2D(drawinglayer::primitive2d::Primitive2DContainer & rPrimitive2D);
+
+
/** @name Native Widget Rendering functions
These all just call through to the private mpGraphics functions of the same name.
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index ee68260fbd50..5d3a1b593850 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -80,6 +80,7 @@ $(eval $(call gb_Library_use_libraries,vcl,\
basegfx \
comphelper \
cppuhelper \
+ drawinglayercore \
i18nlangtag \
i18nutil \
$(if $(filter OPENCL,$(BUILD_TYPE)),opencl) \
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 020a57a6a40c..e0ce70a90911 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -704,4 +704,9 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
return bDrawn;
}
+bool OutputDevice::drawPrimitive2D(drawinglayer::primitive2d::Primitive2DContainer & rPrimitive2D)
+{
+ return false;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 282eec9a90de489e821532672639474e9757aec3
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Mar 7 14:33:43 2020 +0100
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Oct 17 15:07:40 2020 +0200
Separate core drawinglayer func. into drawinglayercore library
This separates the drawinglayer core functionallity into a
separate library, to keep a strict separation what is backend
dependent and what is not. More strict separation can be done
at a later date.
This will make it possible to push part of drawinglayer
(part of processor2d) directly into VCL.
Change-Id: Ibc26580067e50bf20d7cdd37fa0e44eb10200878
diff --git a/Repository.mk b/Repository.mk
index 08061a692087..38ce4df40532 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -351,6 +351,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
$(call gb_Helper_optional,SCRIPTING,dlgprov) \
$(if $(filter WNT,$(OS)),directx9canvas) \
$(if $(ENABLE_OPENGL_CANVAS),oglcanvas) \
+ drawinglayercore \
drawinglayer \
editeng \
$(if $(filter WNT,$(OS)),emser) \
diff --git a/drawinglayer/CppunitTest_drawinglayer_border.mk b/drawinglayer/CppunitTest_drawinglayer_border.mk
index fa2f715590cd..e00006c18dba 100644
--- a/drawinglayer/CppunitTest_drawinglayer_border.mk
+++ b/drawinglayer/CppunitTest_drawinglayer_border.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,drawinglayer_border, \
sal \
salhelper \
drawinglayer \
+ drawinglayercore \
vcl \
test \
tl \
diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk
index 43a42b83b42c..4896c0ad0759 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_Library_use_externals,drawinglayer,\
))
$(eval $(call gb_Library_use_libraries,drawinglayer,\
+ drawinglayercore \
basegfx \
canvastools \
comphelper \
@@ -67,11 +68,9 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/attribute/sdrsceneattribute3d \
drawinglayer/source/attribute/sdrshadowattribute \
drawinglayer/source/attribute/strokeattribute \
- drawinglayer/source/geometry/viewinformation2d \
drawinglayer/source/geometry/viewinformation3d \
drawinglayer/source/primitive2d/animatedprimitive2d \
drawinglayer/source/primitive2d/backgroundcolorprimitive2d \
- drawinglayer/source/primitive2d/baseprimitive2d \
drawinglayer/source/primitive2d/bitmapprimitive2d \
drawinglayer/source/primitive2d/borderlineprimitive2d \
drawinglayer/source/primitive2d/controlprimitive2d \
@@ -111,7 +110,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D \
drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D \
drawinglayer/source/primitive2d/primitivetools2d \
- drawinglayer/source/primitive2d/Primitive2DContainer \
drawinglayer/source/primitive2d/sceneprimitive2d \
drawinglayer/source/primitive2d/sdrdecompositiontools2d \
drawinglayer/source/primitive2d/shadowprimitive2d \
@@ -127,7 +125,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/primitive2d/textlineprimitive2d \
drawinglayer/source/primitive2d/textprimitive2d \
drawinglayer/source/primitive2d/textstrikeoutprimitive2d \
- drawinglayer/source/primitive2d/Tools \
drawinglayer/source/primitive2d/transformprimitive2d \
drawinglayer/source/primitive2d/transparenceprimitive2d \
drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d \
diff --git a/drawinglayer/Library_drawinglayercore.mk b/drawinglayer/Library_drawinglayercore.mk
new file mode 100644
index 000000000000..f1643d27014d
--- /dev/null
+++ b/drawinglayer/Library_drawinglayercore.mk
@@ -0,0 +1,49 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# 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/.
+#
+
+$(eval $(call gb_Library_Library,drawinglayercore))
+
+$(eval $(call gb_Library_set_include,drawinglayercore,\
+ $$(INCLUDE) \
+ -I$(SRCDIR)/drawinglayer/inc \
+))
+
+$(eval $(call gb_Library_add_defs,drawinglayercore,\
+ -DDRAWINGLAYERCORE_DLLIMPLEMENTATION \
+))
+
+$(eval $(call gb_Library_set_precompiled_header,drawinglayercore,drawinglayer/inc/pch/precompiled_drawinglayercore))
+
+$(eval $(call gb_Library_use_sdk_api,drawinglayercore))
+
+$(eval $(call gb_Library_use_externals,drawinglayercore,\
+ boost_headers \
+ libxml2 \
+))
+
+$(eval $(call gb_Library_use_libraries,drawinglayercore,\
+ basegfx \
+ comphelper \
+ cppu \
+ cppuhelper \
+ i18nlangtag \
+ sal \
+ salhelper \
+ svl \
+ tl \
+))
+
+$(eval $(call gb_Library_add_exception_objects,drawinglayercore,\
+ drawinglayer/source/primitive2d/baseprimitive2d \
+ drawinglayer/source/primitive2d/Primitive2DContainer \
+ drawinglayer/source/primitive2d/Tools \
+ drawinglayer/source/geometry/viewinformation2d \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/drawinglayer/Module_drawinglayer.mk b/drawinglayer/Module_drawinglayer.mk
index 6d329e95c60a..687cd9c2671f 100644
--- a/drawinglayer/Module_drawinglayer.mk
+++ b/drawinglayer/Module_drawinglayer.mk
@@ -10,6 +10,7 @@
$(eval $(call gb_Module_Module,drawinglayer))
$(eval $(call gb_Module_add_targets,drawinglayer,\
+ Library_drawinglayercore \
Library_drawinglayer \
))
diff --git a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
index f4a45f1757f2..47fb368aa3d8 100644
--- a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
+++ b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
@@ -91,7 +91,6 @@
#include <basegfx/range/basicrange.hxx>
#include <basegfx/tuple/b2dtuple.hxx>
#include <basegfx/tuple/b3dtuple.hxx>
-#include <basegfx/utils/canvastools.hxx>
#include <basegfx/vector/b2dvector.hxx>
#include <basegfx/vector/b2enums.hxx>
#include <basegfx/vector/b2ivector.hxx>
@@ -103,7 +102,7 @@
#include <com/sun/star/drawing/TextureMode.hpp>
#include <com/sun/star/drawing/TextureProjectionMode.hpp>
#include <com/sun/star/graphic/XPrimitive3D.hpp>
-#include <com/sun/star/util/XAccounting.hpp>
+#include <com/sun/star/uno/Reference.hxx>
#include <comphelper/comphelperdllapi.h>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
@@ -137,7 +136,6 @@
#include <drawinglayer/drawinglayerdllapi.h>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
-#include <drawinglayer/primitive2d/CommonTypes.hxx>
#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonGradientPrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonGraphicPrimitive2D.hxx>
@@ -145,9 +143,6 @@
#include <drawinglayer/primitive2d/PolyPolygonHatchPrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonMarkerPrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonStrokePrimitive2D.hxx>
-#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
-#include <drawinglayer/primitive2d/Primitive2DVisitor.hxx>
-#include <drawinglayer/primitive2d/Tools.hxx>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
diff --git a/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx b/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx
new file mode 100644
index 000000000000..4a8c23ea8e65
--- /dev/null
+++ b/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx
@@ -0,0 +1,12 @@
+/* -*- 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 "precompiled_drawinglayercore.hxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx b/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx
new file mode 100644
index 000000000000..4cc5ca4612c9
--- /dev/null
+++ b/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx
@@ -0,0 +1,46 @@
+/* -*- 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/.
+ */
+
+/*
+ This file has been autogenerated by update_pch.sh. It is possible to edit it
+ manually (such as when an include file has been moved/renamed/removed). All such
+ manual changes will be rewritten by the next run of update_pch.sh (which presumably
+ also fixes all possible problems, so it's usually better to use it).
+
+ Generated on 2020-03-07 12:37:18 using:
+ ./bin/update_pch drawinglayer drawinglayercore --cutoff=4 --exclude:system --exclude:module --exclude:local
+
+ If after updating build fails, use the following command to locate conflicting headers:
+ ./bin/update_pch_bisect ./drawinglayer/inc/pch/precompiled_drawinglayercore.hxx "make drawinglayer.build" --find-conflicts
+*/
+
+#if PCH_LEVEL >= 1
+#include <ostream>
+#include <vector>
+#endif // PCH_LEVEL >= 1
+#if PCH_LEVEL >= 2
+#include <osl/diagnose.h>
+#include <osl/interlck.h>
+#include <sal/config.h>
+#include <sal/types.h>
+#endif // PCH_LEVEL >= 2
+#if PCH_LEVEL >= 3
+#include <basegfx/basegfxdllapi.h>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <basegfx/range/basicrange.hxx>
+#include <basegfx/tuple/b2dtuple.hxx>
+#include <basegfx/utils/canvastools.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#endif // PCH_LEVEL >= 3
+#if PCH_LEVEL >= 4
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#endif // PCH_LEVEL >= 4
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/emfio/CppunitTest_emfio_emf.mk b/emfio/CppunitTest_emfio_emf.mk
index 5b32187b7ea8..e8e90d7dddd4 100644
--- a/emfio/CppunitTest_emfio_emf.mk
+++ b/emfio/CppunitTest_emfio_emf.mk
@@ -23,6 +23,7 @@ $(eval $(call gb_CppunitTest_use_sdk_api,emfio_emf))
$(eval $(call gb_CppunitTest_use_libraries,emfio_emf,\
basegfx \
drawinglayer \
+ drawinglayercore \
cppu \
cppuhelper \
comphelper \
diff --git a/emfio/Library_emfio.mk b/emfio/Library_emfio.mk
index 281f077130f1..f923f2078e35 100644
--- a/emfio/Library_emfio.mk
+++ b/emfio/Library_emfio.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_Library_use_sdk_api,emfio))
$(eval $(call gb_Library_use_libraries,emfio,\
basegfx \
+ drawinglayercore \
drawinglayer \
cppu \
cppuhelper \
diff --git a/filter/Library_svgfilter.mk b/filter/Library_svgfilter.mk
index 21318aa1fd03..1f0caf11758c 100644
--- a/filter/Library_svgfilter.mk
+++ b/filter/Library_svgfilter.mk
@@ -56,6 +56,7 @@ $(eval $(call gb_Library_use_libraries,svgfilter,\
sax \
salhelper \
comphelper \
+ drawinglayercore \
drawinglayer \
basegfx \
cppuhelper \
diff --git a/include/drawinglayer/drawinglayerdllapi.h b/include/drawinglayer/drawinglayerdllapi.h
index 0b3983504919..36a0d8abfea2 100644
--- a/include/drawinglayer/drawinglayerdllapi.h
+++ b/include/drawinglayer/drawinglayerdllapi.h
@@ -19,6 +19,12 @@
#endif
#define DRAWINGLAYER_DLLPRIVATE SAL_DLLPRIVATE
+#if defined(DRAWINGLAYERCORE_DLLIMPLEMENTATION)
+#define DRAWINGLAYERCORE_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define DRAWINGLAYERCORE_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/geometry/viewinformation2d.hxx b/include/drawinglayer/geometry/viewinformation2d.hxx
index 95be29a72bda..06b17248d213 100644
--- a/include/drawinglayer/geometry/viewinformation2d.hxx
+++ b/include/drawinglayer/geometry/viewinformation2d.hxx
@@ -63,7 +63,7 @@ namespace drawinglayer::geometry
It is an implementation to support the sequence of PropertyValues used in a
css::graphic::XPrimitive2D for C++ implementations working with those
*/
-class DRAWINGLAYER_DLLPUBLIC ViewInformation2D
+class DRAWINGLAYERCORE_DLLPUBLIC ViewInformation2D
{
public:
typedef o3tl::cow_wrapper<ImpViewInformation2D, o3tl::ThreadSafeRefCountingPolicy> ImplType;
diff --git a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
index cca3a0a91485..c096e9a8cc2f 100644
--- a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
+++ b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
@@ -34,7 +34,7 @@ class ViewInformation2D;
namespace drawinglayer::primitive2d
{
-class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive2DContainer
+class SAL_WARN_UNUSED DRAWINGLAYERCORE_DLLPUBLIC Primitive2DContainer
: public std::deque<Primitive2DReference>,
public Primitive2DDecompositionVisitor
{
diff --git a/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx b/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx
index dfe04b32a320..e174d1e0878d 100644
--- a/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx
+++ b/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx
@@ -27,7 +27,7 @@ namespace drawinglayer::primitive2d
class Primitive2DContainer;
// Visitor class for walking a tree of Primitive2DReference
-class DRAWINGLAYER_DLLPUBLIC Primitive2DDecompositionVisitor
+class DRAWINGLAYERCORE_DLLPUBLIC Primitive2DDecompositionVisitor
{
public:
virtual void append(const Primitive2DReference&) = 0;
diff --git a/include/drawinglayer/primitive2d/Tools.hxx b/include/drawinglayer/primitive2d/Tools.hxx
index fbb6f5717c01..1c30565c8c1b 100644
--- a/include/drawinglayer/primitive2d/Tools.hxx
+++ b/include/drawinglayer/primitive2d/Tools.hxx
@@ -31,16 +31,16 @@ class ViewInformation2D;
namespace drawinglayer::primitive2d
{
/// get B2DRange from a given Primitive2DReference
-basegfx::B2DRange DRAWINGLAYER_DLLPUBLIC getB2DRangeFromPrimitive2DReference(
+basegfx::B2DRange DRAWINGLAYERCORE_DLLPUBLIC getB2DRangeFromPrimitive2DReference(
const Primitive2DReference& rCandidate, const geometry::ViewInformation2D& aViewInformation);
/** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
and using compare operator
*/
-bool DRAWINGLAYER_DLLPUBLIC arePrimitive2DReferencesEqual(const Primitive2DReference& rA,
- const Primitive2DReference& rB);
+bool DRAWINGLAYERCORE_DLLPUBLIC arePrimitive2DReferencesEqual(const Primitive2DReference& rA,
+ const Primitive2DReference& rB);
-OUString DRAWINGLAYER_DLLPUBLIC idToString(sal_uInt32 nId);
+OUString DRAWINGLAYERCORE_DLLPUBLIC idToString(sal_uInt32 nId);
} // end of namespace drawinglayer::primitive2d
diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
index 45d0e3519c40..5478309846cd 100644
--- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -119,8 +119,8 @@ typedef cppu::WeakComponentImplHelper<css::graphic::XPrimitive2D, css::util::XAc
for view-independent primitives which are defined by not using ViewInformation2D
in their get2DDecomposition/getB2DRange implementations.
*/
-class DRAWINGLAYER_DLLPUBLIC BasePrimitive2D : protected cppu::BaseMutex,
- public BasePrimitive2DImplBase
+class DRAWINGLAYERCORE_DLLPUBLIC BasePrimitive2D : protected cppu::BaseMutex,
+ public BasePrimitive2DImplBase
{
BasePrimitive2D(const BasePrimitive2D&) = delete;
BasePrimitive2D& operator=(const BasePrimitive2D&) = delete;
@@ -198,7 +198,7 @@ public:
to identify if a new decomposition is needed at the next call
(f) return maBuffered2DDecomposition
*/
-class DRAWINGLAYER_DLLPUBLIC BufferedDecompositionPrimitive2D : public BasePrimitive2D
+class DRAWINGLAYERCORE_DLLPUBLIC BufferedDecompositionPrimitive2D : public BasePrimitive2D
{
private:
/// a sequence used for buffering the last create2DDecomposition() result
diff --git a/sc/CppunitTest_sc_parallelism.mk b/sc/CppunitTest_sc_parallelism.mk
index eb7aaa446954..ff2cd6e25953 100644
--- a/sc/CppunitTest_sc_parallelism.mk
+++ b/sc/CppunitTest_sc_parallelism.mk
@@ -40,6 +40,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_parallelism, \
cppuhelper \
dbtools \
drawinglayer \
+ drawinglayercore \
editeng \
for \
forui \
diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index 8943de7ab4c3..60fb6676dab9 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_ucalc, \
cppuhelper \
dbtools \
drawinglayer \
+ drawinglayercore \
editeng \
for \
forui \
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 1b3cead83beb..04589a676eaa 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -70,6 +70,7 @@ $(eval $(call gb_Library_use_libraries,sc,\
cppu \
cppuhelper \
dbtools \
+ drawinglayercore \
drawinglayer \
editeng \
for \
diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk
index 93426dfc3a55..63f143978231 100644
--- a/sd/CppunitTest_sd_uimpress.mk
+++ b/sd/CppunitTest_sd_uimpress.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_uimpress,\
cppu \
cppuhelper \
drawinglayer \
+ drawinglayercore \
editeng \
i18nlangtag \
i18nutil \
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 9d399e8e3f5a..ed9decbc75cc 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -74,6 +74,7 @@ $(eval $(call gb_Library_use_libraries,sd,\
cppcanvas \
cppu \
cppuhelper \
+ drawinglayercore \
drawinglayer \
editeng \
i18nlangtag \
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index cb0b099eb37d..95d1eb704273 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_Library_use_libraries,sfx,\
comphelper \
cppu \
cppuhelper \
+ drawinglayercore \
drawinglayer \
fwk \
i18nlangtag \
diff --git a/svgio/CppunitTest_svgio.mk b/svgio/CppunitTest_svgio.mk
index d690f2383116..e6708c916f34 100644
--- a/svgio/CppunitTest_svgio.mk
+++ b/svgio/CppunitTest_svgio.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_CppunitTest_use_library_objects,svgio,\
$(eval $(call gb_CppunitTest_use_libraries,svgio,\
basegfx \
drawinglayer \
+ drawinglayercore \
cppu \
cppuhelper \
comphelper \
diff --git a/svgio/Library_svgio.mk b/svgio/Library_svgio.mk
index 83a8546bdc1a..d75508e0537e 100644
--- a/svgio/Library_svgio.mk
+++ b/svgio/Library_svgio.mk
@@ -33,6 +33,7 @@ $(eval $(call gb_Library_use_sdk_api,svgio))
$(eval $(call gb_Library_use_libraries,svgio,\
basegfx \
+ drawinglayercore \
drawinglayer \
comphelper \
cppu \
diff --git a/svx/CppunitTest_svx_unit.mk b/svx/CppunitTest_svx_unit.mk
index ac9f3e4531ad..4a51867ec189 100644
--- a/svx/CppunitTest_svx_unit.mk
+++ b/svx/CppunitTest_svx_unit.mk
@@ -36,6 +36,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,svx_unit, \
$(eval $(call gb_CppunitTest_use_libraries,svx_unit, \
basegfx \
drawinglayer \
+ drawinglayercore \
sal \
sfx \
svxcore \
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index 424361233542..77d4541f892e 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -50,6 +50,7 @@ $(eval $(call gb_Library_use_libraries,svx,\
crashreport) \
$(call gb_Helper_optional,DBCONNECTIVITY, \
dbtools) \
+ drawinglayercore \
drawinglayer \
editeng \
fwk \
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index 3d4590d216a1..b31ce6ff5287 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -57,6 +57,7 @@ $(eval $(call gb_Library_use_libraries,svxcore,\
cppu \
$(call gb_Helper_optional,DBCONNECTIVITY, \
dbtools) \
+ drawinglayercore \
drawinglayer \
editeng \
fwk \
diff --git a/sw/CppunitTest_sw_uwriter.mk b/sw/CppunitTest_sw_uwriter.mk
index e6a490c5dff1..a716e51b0d23 100644
--- a/sw/CppunitTest_sw_uwriter.mk
+++ b/sw/CppunitTest_sw_uwriter.mk
@@ -33,6 +33,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_uwriter, \
$(call gb_Helper_optional,DBCONNECTIVITY, \
dbtools) \
drawinglayer \
+ drawinglayercore \
editeng \
i18nlangtag \
i18nutil \
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 65f4154bf12e..cb87858ab8ad 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -58,6 +58,7 @@ $(eval $(call gb_Library_use_libraries,sw,\
cppuhelper \
$(call gb_Helper_optional,DBCONNECTIVITY, \
dbtools) \
+ drawinglayercore \
drawinglayer \
editeng \
i18nlangtag \
diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk
index 99f1dd20ae3d..4c09d1cc4bda 100644
--- a/sw/Library_swui.mk
+++ b/sw/Library_swui.mk
@@ -75,6 +75,7 @@ $(eval $(call gb_Library_use_libraries,swui,\
ucbhelper \
utl \
vcl \
+ drawinglayercore \
drawinglayer \
))
commit dd4670b976b00d643f335516fe5fd0c880d58025
Author: Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Sat Oct 17 10:00:04 2020 +0300
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Sat Oct 17 14:28:52 2020 +0200
tdf#133771: remove encryption data during SaveAs
If document was password protected but during SaveAs it wasn't
selected to use a password we should remove EcnryptionData.
But we should not do this unconditionally: in general case we should
try to keep all encryption metadata.
Change-Id: Id91a88790deccd7377fb5d394b36395d13748c31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104454
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 76e838709b20..479682be31db 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2789,11 +2789,38 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& rFileName, const OUString&
// in "SaveAs" title and password will be cleared ( maybe the new itemset contains new values, otherwise they will be empty )
// #i119366# - As the SID_ENCRYPTIONDATA and SID_PASSWORD are using for setting password together, we need to clear them both.
// Also, ( maybe the new itemset contains new values, otherwise they will be empty )
- if (xMergedParams->HasItem( SID_PASSWORD ))
+ if (xMergedParams->HasItem(SID_ENCRYPTIONDATA))
{
- xMergedParams->ClearItem( SID_PASSWORD );
- xMergedParams->ClearItem( SID_ENCRYPTIONDATA );
+ bool bPasswordProtected = true;
+ const SfxUnoAnyItem* pEncryptionDataItem
+ = xMergedParams->GetItem<SfxUnoAnyItem>(SID_ENCRYPTIONDATA, false);
+ if (pEncryptionDataItem)
+ {
+ uno::Sequence<beans::NamedValue> aEncryptionData;
+ pEncryptionDataItem->GetValue() >>= aEncryptionData;
+ for (const auto& rItem : std::as_const(aEncryptionData))
+ {
+ if (rItem.Name == "CryptoType")
+ {
+ OUString aValue;
+ rItem.Value >>= aValue;
+ if (aValue != "StrongEncryptionDataSpace")
+ {
+ // This is not just a password protected document. Let's keep encryption data as is.
+ bPasswordProtected = false;
+ }
+ break;
+ }
+ }
+ }
+ if (bPasswordProtected)
+ {
+ // For password protected documents remove encryption data during "Save as..."
+ xMergedParams->ClearItem(SID_PASSWORD);
+ xMergedParams->ClearItem(SID_ENCRYPTIONDATA);
+ }
}
+
xMergedParams->ClearItem( SID_DOCINFO_TITLE );
xMergedParams->ClearItem( SID_INPUTSTREAM );
commit 235eb9ec6065f7a0713f222dcf5d6d340b0e18e9
Author: Andrea Gelmini <andrea.gelmini at gelma.net>
AuthorDate: Sat Oct 17 12:13:28 2020 +0200
Commit: Michael Stahl <michael.stahl at cib.de>
CommitDate: Sat Oct 17 14:23:06 2020 +0200
Removed duplicated include
Change-Id: I907e35a8d3fa676d88e03a3269af5d77e9fce14e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104459
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
diff --git a/smoketest/libtest.cxx b/smoketest/libtest.cxx
index 9a95f7faf80a..0d9c34d429e1 100644
--- a/smoketest/libtest.cxx
+++ b/smoketest/libtest.cxx
@@ -38,7 +38,6 @@
#else
#include <sys/time.h>
-#include <sal/types.h>
static long getTimeMS()
{
struct timeval t;
commit d0601cd3812cbcdaa0decf81c81d73d41a6ccb91
Author: Rene Engelhard <rene at debian.org>
AuthorDate: Sat Oct 17 11:24:42 2020 +0200
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Oct 17 14:19:44 2020 +0200
fix build with box2d 2.4.0
Change-Id: I60f25f04e2bfcdabf832f42b44ba3d945f4ec169
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104456
Tested-by: Jenkins
Tested-by: René Engelhard <rene at debian.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/config_host/config_box2d.h.in b/config_host/config_box2d.h.in
new file mode 100644
index 000000000000..cc761536dc04
--- /dev/null
+++ b/config_host/config_box2d.h.in
@@ -0,0 +1,7 @@
+#ifndef CONFIG_BOX2D_H
+#define CONFIG_BOX2D_H
+
+/* Box2D/Box2D.h is 2.3, 2.4 has box2d/box2d.h */
+#define BOX2D_HEADER <Box2D/Box2D.h>
+
+#endif
diff --git a/configure.ac b/configure.ac
index 08c4e39cbe64..894efc1b7eaa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10724,11 +10724,21 @@ if test "$with_system_box2d" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_BOX2D=TRUE
AC_LANG_PUSH([C++])
- AC_CHECK_HEADER(Box2D/Box2D.h, [],
- [AC_MSG_ERROR(box2d headers not found.)], [])
- AC_CHECK_LIB([Box2D], [main], [:],
- [ AC_MSG_ERROR(box2d library not found.) ], [])
- BOX2D_LIBS=-lBox2D
+ AC_CHECK_HEADER(box2d/box2d.h, [BOX2D_H_FOUND='TRUE'],
+ [BOX2D_H_FOUND='FALSE'])
+ if test "$BOX2D_H_FOUND" = "TRUE"; then # 2.4.0+
+ _BOX2D_LIB=box2d
+ AC_DEFINE(BOX2D_HEADER,<box2d/box2d.h>)
+ else
+ # fail this. there's no other alternative to check when we are here.
+ AC_CHECK_HEADER([Box2D/Box2D.h], [],
+ [AC_MSG_ERROR(box2d headers not found.)])
+ _BOX2D_LIB=Box2D
+ AC_DEFINE(BOX2D_HEADER,<Box2D/Box2D.h>)
+ fi
+ AC_CHECK_LIB([$_BOX2D_LIB], [main], [:],
+ [ AC_MSG_ERROR(box2d library not found.) ], [])
+ BOX2D_LIBS=-l$_BOX2D_LIB
AC_LANG_POP([C++])
BOX2D_CFLAGS=$(printf '%s' "$BOX2D_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
FilterLibs "${BOX2D_LIBS}"
@@ -13946,6 +13956,7 @@ AC_CONFIG_FILES([config_host.mk
instsetoo_native/util/openoffice.lst
sysui/desktop/macosx/Info.plist])
AC_CONFIG_HEADERS([config_host/config_buildid.h])
+AC_CONFIG_HEADERS([config_host/config_box2d.h])
AC_CONFIG_HEADERS([config_host/config_clang.h])
AC_CONFIG_HEADERS([config_host/config_dconf.h])
AC_CONFIG_HEADERS([config_host/config_eot.h])
diff --git a/slideshow/source/engine/box2dtools.cxx b/slideshow/source/engine/box2dtools.cxx
index db91ccbb57e7..c822f564a008 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -8,7 +8,8 @@
*/
#include <box2dtools.hxx>
-#include <Box2D/Box2D.h>
+#include <config_box2d.h>
+#include BOX2D_HEADER
#include <shapemanager.hxx>
#include <attributableshape.hxx>
commit 31373fa085b9985f315b10f008eca5e1a15cc6c7
Author: Gleb Popov <6yearold at gmail.com>
AuthorDate: Fri Oct 16 16:27:18 2020 +0400
Commit: Michael Stahl <michael.stahl at cib.de>
CommitDate: Sat Oct 17 12:57:46 2020 +0200
Extend the conditional to *BSD systems to fix linking issue.
While there, use DLOPEN_LIBS variable instead of "-ldl" constant.
Change-Id: I5fb42b216afb6ea2a7b40fb1479c474c89e0706e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104432
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
diff --git a/vcl/Executable_visualbackendtest.mk b/vcl/Executable_visualbackendtest.mk
index 41c641a5ff14..c6c0d237018a 100644
--- a/vcl/Executable_visualbackendtest.mk
+++ b/vcl/Executable_visualbackendtest.mk
@@ -41,10 +41,10 @@ $(eval $(call gb_Executable_use_static_libraries,visualbackendtest,\
vclmain \
))
-ifeq ($(OS),LINUX)
+ifneq (, $(filter LINUX %BSD, $(OS)))
$(eval $(call gb_Executable_add_libs,visualbackendtest,\
-lm \
- -ldl \
+ $(DLOPEN_LIBS) \
-lX11 \
))
commit f25f804b0009f026cfac665bb8ec03b4656d81fb
Author: Bartosz Kosiorek <gang65 at poczta.onet.pl>
AuthorDate: Fri Oct 16 16:46:52 2020 +0200
Commit: Michael Stahl <michael.stahl at cib.de>
CommitDate: Sat Oct 17 12:44:48 2020 +0200
tdf#133377 OOXML Fix storage of date in Custom Properties
During exporting documents into OOXML formats (docx, xlsx, pptx),
if custom properties have Date format, the day and year were switched.
This commit fixes that.
Change-Id: Id497602eb3354de78bfd52bf5ef61d32aafd957d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104450
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index dbc419c28a3e..43f4e573229a 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -826,11 +826,13 @@ writeCustomProperties( XmlFilterBase& rSelf, const Reference< XDocumentPropertie
util::DateTime aDateTime;
if ( rProp.Value >>= num )
{
+ // i4 - 4-byte signed integer
+ // r8 - 8-byte real number
writeElement( pAppProps, FSNS( XML_vt, XML_i4 ), num );
}
else if ( rProp.Value >>= aDate )
{
- aDateTime = util::DateTime( 0, 0 , 0, 0, aDate.Year, aDate.Month, aDate.Day, true );
+ aDateTime = util::DateTime( 0, 0 , 0, 0, aDate.Day, aDate.Month, aDate.Year, true );
writeElement( pAppProps, FSNS( XML_vt, XML_filetime ), aDateTime);
}
else if ( rProp.Value >>= aDuration )
diff --git a/sw/qa/extras/ooxmlexport/data/custom-properties.docx b/sw/qa/extras/ooxmlexport/data/custom-properties.docx
new file mode 100644
index 000000000000..33cce91f7ec4
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/custom-properties.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
index f05f6251ed48..a77d41b64094 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
@@ -85,6 +85,53 @@ DECLARE_OOXMLEXPORT_TEST(testPageGraphicBackground, "page-graphic-background.odt
CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(xPageStyle, "BackColor"));
}
+
+DECLARE_OOXMLEXPORT_TEST(testCustomProperties, "custom-properties.docx")
+{
+ // tdf#133377 FILESAVE XLSX: Make sure the custom/core/application file properties
+ // are stored correctly after roundtrip to .docx
+
+ // Extended file properties - specific to Office package,
+ // eg. docx - Number of Pages, pptx - Number of Slides
+ xmlDocUniquePtr pXmlDoc = parseExport("docProps/app.xml");
+ if (!pXmlDoc)
+ return;
+
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Paragraphs", "1");
+ //assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Lines", "1");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Pages", "1");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Words", "3");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Characters", "21");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:CharactersWithSpaces", "23");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Company", "hhhhkompany");
+
+ // Custom file properties - defined by user
+ xmlDocUniquePtr pCustomXml = parseExport("docProps/custom.xml");
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[12]",
+ "name", "testDateProperty");
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[12]/vt:filetime",
+ "1982-04-19T10:00:00Z");
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[14]",
+ "name", "testNegativeNumberProperty");
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[14]/vt:i4",
+ "-100");
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[17]",
+ "name", "testTextProperty");
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[17]/vt:lpwstr",
+ "testPropertyValue");
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[18]",
+ "name", "testYesNoProperty");
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[18]/vt:bool",
+ "1");
+
+ // Core file properties - common for all packages (eg. creation date, modify date)
+ pXmlDoc = parseExport("docProps/core.xml");
+ assertXPathContent(pXmlDoc, "/cp:coreProperties/dc:creator", "Bartosz Kosiorek");
+ assertXPathContent(pXmlDoc, "/cp:coreProperties/dc:description", "cccckomentarzglowny");
+ assertXPathContent(pXmlDoc, "/cp:coreProperties/cp:lastPrinted", "2020-10-15T07:42:00Z");
+ assertXPathContent(pXmlDoc, "/cp:coreProperties/dcterms:created", "2020-10-14T16:23:00Z");
+}
+
DECLARE_OOXMLEXPORT_TEST(testZoom, "zoom.docx")
{
uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx
index 306e03476cef..b520967b21f4 100644
--- a/sw/qa/unit/swmodeltestbase.cxx
+++ b/sw/qa/unit/swmodeltestbase.cxx
@@ -728,9 +728,19 @@ void SwModelTestBase::registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx)
BAD_CAST("http://schemas.openxmlformats.org/package/2006/content-types"));
xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("lc"),
BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas"));
+ xmlXPathRegisterNs(
+ pXmlXpathCtx, BAD_CAST("cp"),
+ BAD_CAST("http://schemas.openxmlformats.org/package/2006/metadata/core-properties"));
xmlXPathRegisterNs(
pXmlXpathCtx, BAD_CAST("extended-properties"),
BAD_CAST("http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"));
+ xmlXPathRegisterNs(
+ pXmlXpathCtx, BAD_CAST("custom-properties"),
+ BAD_CAST("http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"));
+ xmlXPathRegisterNs(
+ pXmlXpathCtx, BAD_CAST("vt"),
+ BAD_CAST("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("dcterms"), BAD_CAST("http://purl.org/dc/terms/"));
xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("a14"),
BAD_CAST("http://schemas.microsoft.com/office/drawing/2010/main"));
xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("c"),
commit 13331f26106fdf7c9563374d81baad6e293bb542
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Oct 16 19:25:06 2020 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Oct 17 12:20:09 2020 +0200
fix --enable-mergelibs link failure
Change-Id: I094d7cf7d0549344ba132ac07dec42a7e945b041
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104445
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/include/svtools/stringtransfer.hxx b/include/svtools/stringtransfer.hxx
index dd497f170d4e..90a6e28f7b5e 100644
--- a/include/svtools/stringtransfer.hxx
+++ b/include/svtools/stringtransfer.hxx
@@ -28,7 +28,7 @@
namespace svt
{
//= OStringTransferable
- class UNLESS_MERGELIBS(SVT_DLLPUBLIC) OStringTransferable final : public TransferDataContainer
+ class SVT_DLLPUBLIC OStringTransferable final : public TransferDataContainer
{
public:
OStringTransferable(const OUString& rContent);
commit ee3f06ad27b68b6b457d29ed7b2ab8c6d7d4db31
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Oct 10 12:48:54 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Oct 17 12:00:23 2020 +0200
fix fastparser namespace handling when...
dealing with unknown attributes, in
SvXMLLegacyToFastDocHandler::startElement
SvXMLImportPropertyMapper::importXML
which show up with some work I'm doing to make SvXMLImport fastparser-only.
Change-Id: I71197c1659a5f072c2b186892be1f88ca6b2a764
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104140
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 2aeda90fc229..e56448adabd2 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -2261,12 +2261,13 @@ void SAL_CALL SvXMLLegacyToFastDocHandler::startElement( const OUString& rName,
OUString aNamespace;
const OUString& rAttrName = xAttrList->getNameByIndex( i );
const OUString& rAttrValue = xAttrList->getValueByIndex( i );
- sal_uInt16 const nAttrPrefix(mrImport->mpNamespaceMap->GetKeyByAttrName(
- rAttrName, nullptr, &aLocalAttrName, &aNamespace));
+ // don't add unknown namespaces to the map
+ sal_uInt16 const nAttrPrefix = mrImport->mpNamespaceMap->GetKeyByQName(
+ rAttrName, nullptr, &aLocalAttrName, &aNamespace, SvXMLNamespaceMap::QNameMode::AttrValue);
if( XML_NAMESPACE_XMLNS != nAttrPrefix )
{
auto const nToken = SvXMLImport::getTokenFromName(aLocalAttrName);
- if (nToken == xmloff::XML_TOKEN_INVALID)
+ if (XML_NAMESPACE_UNKNOWN == nAttrPrefix || nToken == xmloff::XML_TOKEN_INVALID)
{
mxFastAttributes->addUnknown(aNamespace,
OUStringToOString(rAttrName, RTL_TEXTENCODING_UTF8),
diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx
index a0886b18bd2d..0b327c73e6cc 100644
--- a/xmloff/source/style/xmlimppr.cxx
+++ b/xmloff/source/style/xmlimppr.cxx
@@ -147,7 +147,8 @@ void SvXMLImportPropertyMapper::importXML(
{
// If it's an unknown attribute in a known namespace, ignore it.
OUString aPrefix = rAttribute.Name.copy(0, nSepIndex);
- if (rNamespaceMap.GetKeyByPrefix(aPrefix) != USHRT_MAX)
+ auto nKey = rNamespaceMap.GetKeyByPrefix(aPrefix);
+ if (nKey != USHRT_MAX && !(nKey & XML_NAMESPACE_UNKNOWN_FLAG))
continue;
}
commit d9596a20b8b0664e5570e421184767e6edaa57bb
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Oct 17 10:30:31 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Oct 17 11:32:00 2020 +0200
xmloff: use the fastparser API when possible
part of the process of making SvXMLImport fastparser-only
Change-Id: If80ba22f370d5da6f268d6456ab0c974e6ff4209
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104455
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
index 3255e2e6fdbf..36bb7e4d8e7e 100644
--- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
+++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
@@ -21,6 +21,7 @@
#include <string_view>
+#include <sal/log.hxx>
#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/util/XModifiable2.hpp>
@@ -74,6 +75,7 @@ XMLEmbeddedObjectImportContext_Impl::XMLEmbeddedObjectImportContext_Impl(
SvXMLImportContext( rImport, nPrfx, rLName ),
xHandler( rHandler )
{
+ assert(xHandler);
}
SvXMLImportContextRef XMLEmbeddedObjectImportContext_Impl::CreateChildContext(
@@ -115,15 +117,18 @@ void XMLEmbeddedObjectImportContext::SetComponent( Reference< XComponent > const
Reference< XComponentContext > xContext( GetImport().GetComponentContext() );
- xHandler.set(
- xContext->getServiceManager()->createInstanceWithArgumentsAndContext(sFilterService, aArgs, xContext),
- UNO_QUERY);
-
- if( !xHandler.is() )
+ Reference<XInterface> xFilter =
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(sFilterService, aArgs, xContext);
+ SAL_WARN_IF(!xFilter, "xmloff", "could not create filter " << sFilterService);
+ if( !xFilter.is() )
return;
- if (SvXMLImport *pFastHandler = dynamic_cast<SvXMLImport*>(xHandler.get()))
+ if (SvXMLImport *pFastHandler = dynamic_cast<SvXMLImport*>(xFilter.get()))
xHandler.set( new SvXMLLegacyToFastDocHandler( pFastHandler ) );
+ else
+ xHandler.set(xFilter, UNO_QUERY);
+
+ assert( xHandler );
try
{
commit e7eaa66d4de5d3c634e8a148f8838276d539546c
Author: mariamfahmy <mariamfahmy66 at gmail.com>
AuthorDate: Fri Oct 16 17:22:53 2020 +0200
Commit: Ilmari Lauhakangas <ilmari.lauhakangas at libreoffice.org>
CommitDate: Sat Oct 17 10:41:33 2020 +0200
tdf#124176: Use pragma once instead of include guards
Change-Id: I9d5fe8d61286c2fe167d4733c36e1fc3976d0b43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104446
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas at libreoffice.org>
diff --git a/tools/inc/systemdatetime.hxx b/tools/inc/systemdatetime.hxx
index 29306112a311..1b04e26adee3 100644
--- a/tools/inc/systemdatetime.hxx
+++ b/tools/inc/systemdatetime.hxx
@@ -6,9 +6,7 @@
* 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 INCLUDED_TOOLS_INC_SYSTEMDATETIME_H
-#define INCLUDED_TOOLS_INC_SYSTEMDATETIME_H
-
+#pragma once
#include <sal/types.h>
constexpr sal_Int64 SEC_MASK = SAL_CONST_INT64(1000000000);
@@ -21,6 +19,4 @@ constexpr sal_Int64 HOUR_MASK = SAL_CONST_INT64(10000000000000);
*/
bool GetSystemDateTime(sal_Int32* pDate, sal_Int64* pTime);
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
commit cfe5a5044845a3fc90e3634e996edb4d85808d3c
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Oct 17 08:08:36 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Oct 17 10:28:29 2020 +0200
sfx2: use the fastparser API when possible
part of the process of making SvXMLImport fastparser-only
Change-Id: Ib5acae303483eb86338cb39dd97a357ff90b1870
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104453
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 38ba5b33b472..578322556b60 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -1737,7 +1737,6 @@ SfxDocumentMetaData::loadFromStorage(
// create DOM parser service
css::uno::Reference<css::lang::XMultiComponentFactory> xMsf (
m_xContext->getServiceManager());
- css::uno::Reference<css::xml::sax::XParser> xParser = css::xml::sax::Parser::create(m_xContext);
css::xml::sax::InputSource input;
input.aInputStream = xInStream;
@@ -1761,21 +1760,18 @@ SfxDocumentMetaData::loadFromStorage(
css::uno::Sequence< css::uno::Any > args(1);
args[0] <<= xPropArg;
- css::uno::Reference<css::xml::sax::XDocumentHandler> xDocHandler (
+ // the underlying SvXMLImport implements XFastParser, XImporter, XFastDocumentHandler
+ css::uno::Reference<XInterface> xFilter =
xMsf->createInstanceWithArgumentsAndContext(
- OUString::createFromAscii(pServiceName), args, m_xContext),
- css::uno::UNO_QUERY_THROW);
- css::uno::Reference<css::document::XImporter> xImp (xDocHandler,
- css::uno::UNO_QUERY_THROW);
+ OUString::createFromAscii(pServiceName), args, m_xContext);
+ assert(xFilter);
+ css::uno::Reference<css::xml::sax::XFastParser> xDocHandler(xFilter, css::uno::UNO_QUERY);
+ assert(xDocHandler);
+ css::uno::Reference<css::document::XImporter> xImp(xDocHandler, css::uno::UNO_QUERY);
+ assert(xImp);
xImp->setTargetDocument(css::uno::Reference<css::lang::XComponent>(this));
- xParser->setDocumentHandler(xDocHandler);
- css::uno::Reference< css::xml::sax::XFastParser > xFastParser = dynamic_cast<
- css::xml::sax::XFastParser* >( xDocHandler.get() );
try {
- if( xFastParser.is() )
- xFastParser->parseStream(input);
- else
- xParser->parseStream(input);
+ xDocHandler->parseStream(input);
} catch (const css::xml::sax::SAXException &) {
throw css::io::WrongFormatException(
"SfxDocumentMetaData::loadFromStorage:"
commit 3059f556f6818b66b2fa988c69664f5a98f4c075
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Oct 17 08:07:45 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Oct 17 08:51:41 2020 +0200
sd: use the fastparser API when possible
part of the process of making SvXMLImport fastparser-only
Change-Id: I34b9781ff905094b2231940bb69eb68b18faeb22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104452
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index 7186ef911c24..2425a5fd4de4 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -42,6 +42,7 @@
#include <sdxmlwrp.hxx>
#include <svx/xmleohlp.hxx>
+#include <com/sun/star/xml/sax/Parser.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/xml/sax/XFastParser.hpp>
#include <com/sun/star/document/XFilter.hpp>
@@ -55,7 +56,7 @@
#include <com/sun/star/packages/zip/ZipIOException.hpp>
#include <com/sun/star/xml/sax/InputSource.hpp>
-#include <com/sun/star/xml/sax/Parser.hpp>
+#include <com/sun/star/xml/sax/FastParser.hpp>
#include <com/sun/star/xml/sax/Writer.hpp>
#include <comphelper/genericpropertyset.hxx>
#include <comphelper/propertysetinfo.hxx>
@@ -189,38 +190,44 @@ ErrCode ReadThroughComponent(
aParserInput.sSystemId = rName;
aParserInput.aInputStream = xInputStream;
- // get parser
- Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(rxContext);
- SAL_INFO( "sd.filter", "parser created" );
-
// get filter
OUString aFilterName(OUString::createFromAscii(pFilterName));
- Reference< xml::sax::XDocumentHandler > xFilter(
+ // the underlying SvXMLImport implements XFastParser, XImporter, XFastDocumentHandler
+ Reference< XInterface > xFilter(
rxContext->getServiceManager()->createInstanceWithArgumentsAndContext(aFilterName, rFilterArguments, rxContext),
UNO_QUERY );
SAL_WARN_IF(!xFilter.is(), "sd.filter", "Can't instantiate filter component: " << aFilterName);
if( !xFilter.is() )
return SD_XML_READERROR;
+ Reference< xml::sax::XFastParser > xFastParser(xFilter, UNO_QUERY);
+ Reference< xml::sax::XDocumentHandler > xDocumentHandler;
+ if (!xFastParser)
+ xDocumentHandler.set(xFilter, UNO_QUERY);
+ if (!xFastParser && !xDocumentHandler)
+ {
+ SAL_WARN("sd", "service does not implement XFastParser or XDocumentHandler");
+ assert(false);
+ return SD_XML_READERROR;
+ }
SAL_INFO( "sd.filter", "" << pFilterName << " created" );
- // connect parser and filter
- xParser->setDocumentHandler( xFilter );
-
// connect model and filter
Reference < XImporter > xImporter( xFilter, UNO_QUERY );
xImporter->setTargetDocument( xModelComponent );
- uno::Reference< xml::sax::XFastParser > xFastParser = dynamic_cast<
- xml::sax::XFastParser* >( xFilter.get() );
-
// finally, parser the stream
SAL_INFO( "sd.filter", "parsing stream" );
try
{
- if( xFastParser.is() )
+ if (xFastParser)
xFastParser->parseStream( aParserInput );
else
+ {
+ Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(rxContext);
+ // connect parser and filter
+ xParser->setDocumentHandler( xDocumentHandler );
xParser->parseStream( aParserInput );
+ }
}
catch (const xml::sax::SAXParseException& r)
{
commit 17cbc559be6936777904e5cf8a517cac89045264
Author: Andras Timar <andras.timar at collabora.com>
AuthorDate: Tue Sep 15 12:41:08 2020 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Oct 17 00:51:17 2020 +0200
Angle of the watermark: step by 45°
Change-Id: Ia4ab9a56f346625cf191c1f5a648e1744dad29d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102728
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/sw/qa/uitest/writer_tests/watermark.py b/sw/qa/uitest/writer_tests/watermark.py
index 9fb587aa7479..0d918e92d061 100644
--- a/sw/qa/uitest/writer_tests/watermark.py
+++ b/sw/qa/uitest/writer_tests/watermark.py
@@ -39,7 +39,7 @@ class watermark(UITestCase):
xTransparency = xDialog.getChild("Transparency")
self.assertEqual(get_state_as_dict(xTextInput)["Text"], "Watermark")
- self.assertEqual(get_state_as_dict(xAngle)["Text"], "46°")
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list