[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore2' - 3 commits - drawinglayer/source include/drawinglayer include/svx sc/source svx/source sw/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Sat Jul 31 01:17:48 UTC 2021
Rebased ref, commits from common ancestor:
commit 41f181585835b6e697a7bccd9d0cb92b7f739298
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri Jul 23 16:31:02 2021 +0900
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Jul 31 10:16:49 2021 +0900
drawinglayer: extract Prop. Value conversion from ViewInformation2D
ViewInformation2D doesn't need to know anything about the Sequence
of PropertyValue that is used for parameters when constructing it
through UNO API. This can be done outside of ViewInfromation2D and
it doesn't need to be responsible for that internally inside the
ViewInformation2D. With this we get ViewInformation2D, which is much
simpler and isn't prone to YAGNI.
Change-Id: I3836237a1d26e38145b52136c3204931ae7c6b79
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 63b4ffd6986d..98ca81433f12 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -117,7 +117,7 @@ namespace drawinglayer::unorenderer
MaximumQuadraticPixels = 500000;
}
- const geometry::ViewInformation2D aViewInformation2D(aViewInformationSequence);
+ const auto aViewInformation2D = geometry::createViewInformation2D(aViewInformationSequence);
const sal_uInt32 nDiscreteWidth(basegfx::fround(o3tl::convert(fWidth, eRangeUnit, o3tl::Length::in) * DPI_X));
const sal_uInt32 nDiscreteHeight(basegfx::fround(o3tl::convert(fHeight, eRangeUnit, o3tl::Length::in) * DPI_Y));
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx
index 5b276cf52a59..6698f3b38b1f 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -84,162 +84,24 @@ protected:
// Viewport, VisualizedPage or ViewTime
uno::Sequence<beans::PropertyValue> mxExtendedInformation;
- void impInterpretPropertyValues(const uno::Sequence<beans::PropertyValue>& rViewParameters)
- {
- if (!rViewParameters.hasElements())
- return;
-
- const sal_Int32 nCount(rViewParameters.getLength());
- sal_Int32 nExtendedInsert(0);
-
- // prepare extended information for filtering. Maximum size is nCount
- mxExtendedInformation.realloc(nCount);
-
- for (sal_Int32 a(0); a < nCount; a++)
- {
- const beans::PropertyValue& rProp = rViewParameters[a];
-
- if (rProp.Name == g_PropertyName_ReducedDisplayQuality)
- {
- // extra information; add to filtered information
- mxExtendedInformation[nExtendedInsert++] = rProp;
-
- // for performance reasons, also cache content locally
- bool bSalBool(false);
- rProp.Value >>= bSalBool;
- mbReducedDisplayQuality = bSalBool;
- }
- else if (rProp.Name == g_PropertyName_ObjectTransformation)
- {
- css::geometry::AffineMatrix2D aAffineMatrix2D;
- rProp.Value >>= aAffineMatrix2D;
- basegfx::unotools::homMatrixFromAffineMatrix(maObjectTransformation,
- aAffineMatrix2D);
- }
- else if (rProp.Name == g_PropertyName_ViewTransformation)
- {
- css::geometry::AffineMatrix2D aAffineMatrix2D;
- rProp.Value >>= aAffineMatrix2D;
- basegfx::unotools::homMatrixFromAffineMatrix(maViewTransformation, aAffineMatrix2D);
- }
- else if (rProp.Name == g_PropertyName_Viewport)
- {
- css::geometry::RealRectangle2D aViewport;
- rProp.Value >>= aViewport;
- maViewport = basegfx::unotools::b2DRectangleFromRealRectangle2D(aViewport);
- }
- else if (rProp.Name == g_PropertyName_Time)
- {
- rProp.Value >>= mfViewTime;
- }
- else if (rProp.Name == g_PropertyName_VisualizedPage)
- {
- rProp.Value >>= mxVisualizedPage;
- }
- else
- {
- // extra information; add to filtered information
- mxExtendedInformation[nExtendedInsert++] = rProp;
- }
- }
-
- // extra information size is now known; realloc to final size
- mxExtendedInformation.realloc(nExtendedInsert);
- }
-
- void impFillViewInformationFromContent()
- {
- const bool bObjectTransformationUsed(!maObjectTransformation.isIdentity());
- const bool bViewTransformationUsed(!maViewTransformation.isIdentity());
- const bool bViewportUsed(!maViewport.isEmpty());
- const bool bTimeUsed(0.0 < mfViewTime);
- const bool bVisualizedPageUsed(mxVisualizedPage.is());
- const bool bReducedDisplayQualityUsed(mbReducedDisplayQuality);
- const bool bExtraInformation(mxExtendedInformation.hasElements());
- sal_uInt32 nIndex(0);
- const sal_uInt32 nCount((bObjectTransformationUsed ? 1 : 0)
- + (bViewTransformationUsed ? 1 : 0) + (bViewportUsed ? 1 : 0)
- + (bTimeUsed ? 1 : 0) + (bVisualizedPageUsed ? 1 : 0)
- + (bReducedDisplayQualityUsed ? 1 : 0)
- + (bExtraInformation ? mxExtendedInformation.getLength() : 0));
-
- mxViewInformation.realloc(nCount);
-
- if (bObjectTransformationUsed)
- {
- css::geometry::AffineMatrix2D aAffineMatrix2D;
- basegfx::unotools::affineMatrixFromHomMatrix(aAffineMatrix2D, maObjectTransformation);
- mxViewInformation[nIndex].Name = g_PropertyName_ObjectTransformation;
- mxViewInformation[nIndex].Value <<= aAffineMatrix2D;
- nIndex++;
- }
-
- if (bViewTransformationUsed)
- {
- css::geometry::AffineMatrix2D aAffineMatrix2D;
- basegfx::unotools::affineMatrixFromHomMatrix(aAffineMatrix2D, maViewTransformation);
- mxViewInformation[nIndex].Name = g_PropertyName_ViewTransformation;
- mxViewInformation[nIndex].Value <<= aAffineMatrix2D;
- nIndex++;
- }
-
- if (bViewportUsed)
- {
- const css::geometry::RealRectangle2D aViewport(
- basegfx::unotools::rectangle2DFromB2DRectangle(maViewport));
- mxViewInformation[nIndex].Name = g_PropertyName_Viewport;
- mxViewInformation[nIndex].Value <<= aViewport;
- nIndex++;
- }
-
- if (bTimeUsed)
- {
- mxViewInformation[nIndex].Name = g_PropertyName_Time;
- mxViewInformation[nIndex].Value <<= mfViewTime;
- nIndex++;
- }
-
- if (bVisualizedPageUsed)
- {
- mxViewInformation[nIndex].Name = g_PropertyName_VisualizedPage;
- mxViewInformation[nIndex].Value <<= mxVisualizedPage;
- nIndex++;
- }
-
- if (bExtraInformation)
- {
- const sal_Int32 nExtra(mxExtendedInformation.getLength());
-
- for (sal_Int32 a(0); a < nExtra; a++)
- {
- mxViewInformation[nIndex++] = mxExtendedInformation[a];
- }
- }
- }
-
public:
ImpViewInformation2D(const basegfx::B2DHomMatrix& rObjectTransformation,
const basegfx::B2DHomMatrix& rViewTransformation,
const basegfx::B2DRange& rViewport,
- const uno::Reference<drawing::XDrawPage>& rxDrawPage, double fViewTime)
+ const uno::Reference<drawing::XDrawPage>& rxDrawPage, double fViewTime,
+ bool bReducedDisplayQuality)
: maObjectTransformation(rObjectTransformation)
, maViewTransformation(rViewTransformation)
, maViewport(rViewport)
, mxVisualizedPage(rxDrawPage)
, mfViewTime(fViewTime)
- , mbReducedDisplayQuality(false)
+ , mbReducedDisplayQuality(bReducedDisplayQuality)
{
}
- explicit ImpViewInformation2D(const uno::Sequence<beans::PropertyValue>& rViewParameters)
- : mbReducedDisplayQuality(false)
- , mxViewInformation(rViewParameters)
- {
- impInterpretPropertyValues(rViewParameters);
- }
-
ImpViewInformation2D()
- : mbReducedDisplayQuality(false)
+ : mfViewTime(0.0)
+ , mbReducedDisplayQuality(false)
{
}
@@ -294,16 +156,6 @@ public:
bool getReducedDisplayQuality() const { return mbReducedDisplayQuality; }
- const uno::Sequence<beans::PropertyValue>& getViewInformationSequence() const
- {
- if (!mxViewInformation.hasElements())
- {
- const_cast<ImpViewInformation2D*>(this)->impFillViewInformationFromContent();
- }
-
- return mxViewInformation;
- }
-
bool operator==(const ImpViewInformation2D& rCandidate) const
{
return (maObjectTransformation == rCandidate.maObjectTransformation
@@ -325,14 +177,10 @@ ViewInformation2D::ViewInformation2D(const basegfx::B2DHomMatrix& rObjectTransfo
const basegfx::B2DHomMatrix& rViewTransformation,
const basegfx::B2DRange& rViewport,
const uno::Reference<drawing::XDrawPage>& rxDrawPage,
- double fViewTime)
+ double fViewTime, bool bReducedDisplayQuality)
: mpViewInformation2D(ImpViewInformation2D(rObjectTransformation, rViewTransformation,
- rViewport, rxDrawPage, fViewTime))
-{
-}
-
-ViewInformation2D::ViewInformation2D(const uno::Sequence<beans::PropertyValue>& rViewParameters)
- : mpViewInformation2D(ImpViewInformation2D(rViewParameters))
+ rViewport, rxDrawPage, fViewTime,
+ bReducedDisplayQuality))
{
}
@@ -398,9 +246,119 @@ bool ViewInformation2D::getReducedDisplayQuality() const
return mpViewInformation2D->getReducedDisplayQuality();
}
-const uno::Sequence<beans::PropertyValue>& ViewInformation2D::getViewInformationSequence() const
+ViewInformation2D
+createViewInformation2D(const css::uno::Sequence<css::beans::PropertyValue>& rViewParameters)
{
- return mpViewInformation2D->getViewInformationSequence();
+ if (!rViewParameters.hasElements())
+ return ViewInformation2D();
+
+ bool bReducedDisplayQuality = false;
+ basegfx::B2DHomMatrix aObjectTransformation;
+ basegfx::B2DHomMatrix aViewTransformation;
+ basegfx::B2DRange aViewport;
+ double fViewTime = 0.0;
+ uno::Reference<drawing::XDrawPage> xVisualizedPage;
+
+ for (auto const& rPropertyValue : rViewParameters)
+ {
+ if (rPropertyValue.Name == g_PropertyName_ReducedDisplayQuality)
+ {
+ rPropertyValue.Value >>= bReducedDisplayQuality;
+ }
+ else if (rPropertyValue.Name == g_PropertyName_ObjectTransformation)
+ {
+ css::geometry::AffineMatrix2D aAffineMatrix2D;
+ rPropertyValue.Value >>= aAffineMatrix2D;
+ basegfx::unotools::homMatrixFromAffineMatrix(aObjectTransformation, aAffineMatrix2D);
+ }
+ else if (rPropertyValue.Name == g_PropertyName_ViewTransformation)
+ {
+ css::geometry::AffineMatrix2D aAffineMatrix2D;
+ rPropertyValue.Value >>= aAffineMatrix2D;
+ basegfx::unotools::homMatrixFromAffineMatrix(aViewTransformation, aAffineMatrix2D);
+ }
+ else if (rPropertyValue.Name == g_PropertyName_Viewport)
+ {
+ css::geometry::RealRectangle2D aUnoViewport;
+ rPropertyValue.Value >>= aUnoViewport;
+ aViewport = basegfx::unotools::b2DRectangleFromRealRectangle2D(aUnoViewport);
+ }
+ else if (rPropertyValue.Name == g_PropertyName_Time)
+ {
+ rPropertyValue.Value >>= fViewTime;
+ }
+ else if (rPropertyValue.Name == g_PropertyName_VisualizedPage)
+ {
+ rPropertyValue.Value >>= xVisualizedPage;
+ }
+ }
+
+ return ViewInformation2D(aObjectTransformation, aViewTransformation, aViewport, xVisualizedPage,
+ fViewTime, bReducedDisplayQuality);
+}
+
+uno::Sequence<beans::PropertyValue>
+createPropertyValues(const ViewInformation2D& rViewInformation2D)
+{
+ const bool bObjectTransformationUsed(
+ !rViewInformation2D.getObjectTransformation().isIdentity());
+ const bool bViewTransformationUsed(!rViewInformation2D.getViewTransformation().isIdentity());
+ const bool bViewportUsed(!rViewInformation2D.getViewport().isEmpty());
+ const bool bTimeUsed(0.0 < rViewInformation2D.getViewTime());
+ const bool bVisualizedPageUsed(rViewInformation2D.getVisualizedPage().is());
+ const bool bReducedDisplayQualityUsed(rViewInformation2D.getReducedDisplayQuality());
+ uno::Sequence<beans::PropertyValue> aPropertyValues;
+
+ sal_uInt32 nIndex = 0;
+
+ const sal_uInt32 nCount((bObjectTransformationUsed ? 1 : 0) + (bViewTransformationUsed ? 1 : 0)
+ + (bViewportUsed ? 1 : 0) + (bTimeUsed ? 1 : 0)
+ + (bVisualizedPageUsed ? 1 : 0) + (bReducedDisplayQualityUsed ? 1 : 0));
+
+ aPropertyValues.realloc(nCount);
+
+ if (bObjectTransformationUsed)
+ {
+ css::geometry::AffineMatrix2D aAffineMatrix2D;
+ basegfx::unotools::affineMatrixFromHomMatrix(aAffineMatrix2D,
+ rViewInformation2D.getObjectTransformation());
+ aPropertyValues[nIndex].Name = g_PropertyName_ObjectTransformation;
+ aPropertyValues[nIndex].Value <<= aAffineMatrix2D;
+ nIndex++;
+ }
+
+ if (bViewTransformationUsed)
+ {
+ css::geometry::AffineMatrix2D aAffineMatrix2D;
+ basegfx::unotools::affineMatrixFromHomMatrix(aAffineMatrix2D,
+ rViewInformation2D.getViewTransformation());
+ aPropertyValues[nIndex].Name = g_PropertyName_ViewTransformation;
+ aPropertyValues[nIndex].Value <<= aAffineMatrix2D;
+ nIndex++;
+ }
+
+ if (bViewportUsed)
+ {
+ const css::geometry::RealRectangle2D aViewport(
+ basegfx::unotools::rectangle2DFromB2DRectangle(rViewInformation2D.getViewport()));
+ aPropertyValues[nIndex].Name = g_PropertyName_Viewport;
+ aPropertyValues[nIndex].Value <<= aViewport;
+ nIndex++;
+ }
+
+ if (bTimeUsed)
+ {
+ aPropertyValues[nIndex].Name = g_PropertyName_Time;
+ aPropertyValues[nIndex].Value <<= rViewInformation2D.getViewTime();
+ nIndex++;
+ }
+
+ if (bVisualizedPageUsed)
+ {
+ aPropertyValues[nIndex].Name = g_PropertyName_VisualizedPage;
+ aPropertyValues[nIndex].Value <<= rViewInformation2D.getVisualizedPage();
+ nIndex++;
+ }
}
} // end of namespace drawinglayer::geometry
diff --git a/drawinglayer/source/primitive2d/Tools.cxx b/drawinglayer/source/primitive2d/Tools.cxx
index 7db3a94c8d04..a6321cac1a89 100644
--- a/drawinglayer/source/primitive2d/Tools.cxx
+++ b/drawinglayer/source/primitive2d/Tools.cxx
@@ -47,10 +47,10 @@ getB2DRangeFromPrimitive2DReference(const Primitive2DReference& rCandidate,
else
{
// use UNO API call instead
- const uno::Sequence<beans::PropertyValue>& rViewParameters(
- aViewInformation.getViewInformationSequence());
+ auto aViewParameters = geometry::createPropertyValues(aViewInformation);
+
aRetval.expand(basegfx::unotools::b2DRectangleFromRealRectangle2D(
- rCandidate->getRange(rViewParameters)));
+ rCandidate->getRange(aViewParameters)));
}
}
diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
index c0f879ec2f78..61cd0923ad3d 100644
--- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
@@ -86,7 +86,7 @@ void BasePrimitive2D::get2DDecomposition(
css::uno::Sequence<::css::uno::Reference<::css::graphic::XPrimitive2D>> SAL_CALL
BasePrimitive2D::getDecomposition(const uno::Sequence<beans::PropertyValue>& rViewParameters)
{
- const geometry::ViewInformation2D aViewInformation(rViewParameters);
+ const auto aViewInformation = geometry::createViewInformation2D(rViewParameters);
Primitive2DContainer aContainer;
get2DDecomposition(aContainer, aViewInformation);
return comphelper::containerToSequence(aContainer);
@@ -95,7 +95,7 @@ BasePrimitive2D::getDecomposition(const uno::Sequence<beans::PropertyValue>& rVi
css::geometry::RealRectangle2D SAL_CALL
BasePrimitive2D::getRange(const uno::Sequence<beans::PropertyValue>& rViewParameters)
{
- const geometry::ViewInformation2D aViewInformation(rViewParameters);
+ const auto aViewInformation = geometry::createViewInformation2D(rViewParameters);
return basegfx::unotools::rectangle2DFromB2DRectangle(getB2DRange(aViewInformation));
}
diff --git a/drawinglayer/source/processor2d/baseprocessor2d.cxx b/drawinglayer/source/processor2d/baseprocessor2d.cxx
index 9d1671dcf959..a7b079016747 100644
--- a/drawinglayer/source/processor2d/baseprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/baseprocessor2d.cxx
@@ -71,8 +71,8 @@ namespace drawinglayer::processor2d
else
{
// unknown implementation, use UNO API call instead and process recursively
- const uno::Sequence< beans::PropertyValue >& rViewParameters(getViewInformation2D().getViewInformationSequence());
- process(comphelper::sequenceToContainer<primitive2d::Primitive2DContainer>(xReference->getDecomposition(rViewParameters)));
+ auto aViewParameters = geometry::createPropertyValues(getViewInformation2D());
+ process(comphelper::sequenceToContainer<primitive2d::Primitive2DContainer>(xReference->getDecomposition(aViewParameters)));
}
}
}
diff --git a/include/drawinglayer/geometry/viewinformation2d.hxx b/include/drawinglayer/geometry/viewinformation2d.hxx
index 20ef7c4de453..6903c628fe20 100644
--- a/include/drawinglayer/geometry/viewinformation2d.hxx
+++ b/include/drawinglayer/geometry/viewinformation2d.hxx
@@ -94,28 +94,13 @@ public:
The time the view is defined for. Default is 0.0. This parameter is used e.g. for
animated objects
- @param rExtendedParameters
- A sequence of property values which allows holding various other parameters besides
- the obvious and needed ones above. For this constructor none of the other parameters
- should be added as data. The constructor will parse the given parameters and if
- data for the other parameters is given, the value in rExtendedParameters will
- be preferred and overwrite the given parameter
+ @param rReducedDisplayQuality
*/
ViewInformation2D(const basegfx::B2DHomMatrix& rObjectTransformation,
const basegfx::B2DHomMatrix& rViewTransformation,
const basegfx::B2DRange& rViewport,
const css::uno::Reference<css::drawing::XDrawPage>& rxDrawPage,
- double fViewTime);
-
- /** Constructor: Create a ViewInformation2D
-
- @param rViewParameters
- A sequence of property values which allows holding any combination of local and various
- other parameters. This constructor is fed completely with a sequence of PropertyValues
- which will be parsed to be able to offer the most used ones in a convenient way.
- */
- explicit ViewInformation2D(
- const css::uno::Sequence<css::beans::PropertyValue>& rViewParameters);
+ double fViewTime, bool bReducedDisplayQuality = false);
/// default (empty) constructor
ViewInformation2D();
@@ -156,17 +141,13 @@ public:
implementations of the primitives
*/
bool getReducedDisplayQuality() const;
-
- /** Get the uno::Sequence< beans::PropertyValue > which contains all ViewInformation
-
- Use this call if You need to extract all contained ViewInformation. The ones
- directly supported for convenience will be added to the ones only available
- as PropertyValues. This set completely describes this ViewInformation2D and
- can be used for complete information transport over UNO API.
- */
- const css::uno::Sequence<css::beans::PropertyValue>& getViewInformationSequence() const;
};
+DRAWINGLAYER_DLLPUBLIC ViewInformation2D
+createViewInformation2D(const css::uno::Sequence<css::beans::PropertyValue>& rViewParameters);
+DRAWINGLAYER_DLLPUBLIC css::uno::Sequence<css::beans::PropertyValue>
+createPropertyValues(const ViewInformation2D& rViewInformation2D);
+
} // end of namespace drawinglayer::geometry
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/contact/objectcontact.cxx b/svx/source/sdr/contact/objectcontact.cxx
index ee623c062590..0754af17ba86 100644
--- a/svx/source/sdr/contact/objectcontact.cxx
+++ b/svx/source/sdr/contact/objectcontact.cxx
@@ -50,7 +50,7 @@ ObjectContact::ObjectContact()
: maViewObjectContactVector(),
maPrimitiveAnimator(),
mpViewObjectContactRedirector(nullptr),
- maViewInformation2D(uno::Sequence< beans::PropertyValue >()),
+ maViewInformation2D(),
mbIsPreviewRenderer(false)
{
}
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index 5d145687b3e0..7a8e1a62bd2e 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -127,7 +127,7 @@ namespace sdr::overlay
uno::Sequence< beans::PropertyValue > xProperties(1);
xProperties[0].Name = "ReducedDisplayQuality";
xProperties[0].Value <<= true;
- maViewInformation2D = drawinglayer::geometry::ViewInformation2D(xProperties);
+ maViewInformation2D = drawinglayer::geometry::createViewInformation2D(xProperties);
}
rtl::Reference<OverlayManager> OverlayManager::create(OutputDevice& rOutputDevice)
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 9d19dd35def3..e75ad0a3c6a5 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -446,8 +446,7 @@ basegfx::B2DRange getTextAnchorRange(const attribute::SdrTextAttribute& rText,
// create neutral geometry::ViewInformation2D for local range and decompose calls. This is okay
// since the decompose is view-independent
- const uno::Sequence< beans::PropertyValue > xViewParameters;
- geometry::ViewInformation2D aViewInformation2D(xViewParameters);
+ geometry::ViewInformation2D aViewInformation2D;
// get range
const basegfx::B2DRange aScaledRange(pNew->getB2DRange(aViewInformation2D));
commit b71e9b88ccfce45fee2cc2920235e4ef2e820cee
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Thu Jul 22 18:06:30 2021 +0900
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Jul 31 10:16:48 2021 +0900
drawinglayer: remove extendedInformation from ViewInformation2D
We actually never use extended information when normally using
the ViewInformation2D. The exception here is when we construct it
from property values, where the unknown property values are then
stored into the extended information sequence and then later
reconstructed when we convert it back to a sequence of property
values. Just for that case we don't neeed to expose the extended
information to the outside and create it, as that is then a
implementation detail for the UNO use case.
I am also not convinced we need it when creating ViewInformation2D
with the sequence of property values - it certantly not expected
that we need to preserve the property values at all, but that is
something that needs to be checked.
Change-Id: I3b8d533cd412aac8b89ca2921738d6487be5cf45
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx
index 5067a33f2f75..5b276cf52a59 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -221,51 +221,25 @@ public:
ImpViewInformation2D(const basegfx::B2DHomMatrix& rObjectTransformation,
const basegfx::B2DHomMatrix& rViewTransformation,
const basegfx::B2DRange& rViewport,
- const uno::Reference<drawing::XDrawPage>& rxDrawPage, double fViewTime,
- const uno::Sequence<beans::PropertyValue>& rExtendedParameters)
+ const uno::Reference<drawing::XDrawPage>& rxDrawPage, double fViewTime)
: maObjectTransformation(rObjectTransformation)
, maViewTransformation(rViewTransformation)
- , maObjectToViewTransformation()
- , maInverseObjectToViewTransformation()
, maViewport(rViewport)
- , maDiscreteViewport()
, mxVisualizedPage(rxDrawPage)
, mfViewTime(fViewTime)
, mbReducedDisplayQuality(false)
- , mxViewInformation()
- , mxExtendedInformation()
{
- impInterpretPropertyValues(rExtendedParameters);
}
explicit ImpViewInformation2D(const uno::Sequence<beans::PropertyValue>& rViewParameters)
- : maObjectTransformation()
- , maViewTransformation()
- , maObjectToViewTransformation()
- , maInverseObjectToViewTransformation()
- , maViewport()
- , maDiscreteViewport()
- , mxVisualizedPage()
- , mfViewTime()
- , mbReducedDisplayQuality(false)
+ : mbReducedDisplayQuality(false)
, mxViewInformation(rViewParameters)
- , mxExtendedInformation()
{
impInterpretPropertyValues(rViewParameters);
}
ImpViewInformation2D()
- : maObjectTransformation()
- , maViewTransformation()
- , maObjectToViewTransformation()
- , maInverseObjectToViewTransformation()
- , maViewport()
- , maDiscreteViewport()
- , mxVisualizedPage()
- , mfViewTime()
- , mbReducedDisplayQuality(false)
- , mxViewInformation()
- , mxExtendedInformation()
+ : mbReducedDisplayQuality(false)
{
}
@@ -330,19 +304,13 @@ public:
return mxViewInformation;
}
- const uno::Sequence<beans::PropertyValue>& getExtendedInformationSequence() const
- {
- return mxExtendedInformation;
- }
-
bool operator==(const ImpViewInformation2D& rCandidate) const
{
return (maObjectTransformation == rCandidate.maObjectTransformation
&& maViewTransformation == rCandidate.maViewTransformation
&& maViewport == rCandidate.maViewport
&& mxVisualizedPage == rCandidate.mxVisualizedPage
- && mfViewTime == rCandidate.mfViewTime
- && mxExtendedInformation == rCandidate.mxExtendedInformation);
+ && mfViewTime == rCandidate.mfViewTime);
}
};
@@ -357,11 +325,9 @@ ViewInformation2D::ViewInformation2D(const basegfx::B2DHomMatrix& rObjectTransfo
const basegfx::B2DHomMatrix& rViewTransformation,
const basegfx::B2DRange& rViewport,
const uno::Reference<drawing::XDrawPage>& rxDrawPage,
- double fViewTime,
- const uno::Sequence<beans::PropertyValue>& rExtendedParameters)
+ double fViewTime)
: mpViewInformation2D(ImpViewInformation2D(rObjectTransformation, rViewTransformation,
- rViewport, rxDrawPage, fViewTime,
- rExtendedParameters))
+ rViewport, rxDrawPage, fViewTime))
{
}
@@ -437,11 +403,6 @@ const uno::Sequence<beans::PropertyValue>& ViewInformation2D::getViewInformation
return mpViewInformation2D->getViewInformationSequence();
}
-const uno::Sequence<beans::PropertyValue>& ViewInformation2D::getExtendedInformationSequence() const
-{
- return mpViewInformation2D->getExtendedInformationSequence();
-}
-
} // end of namespace drawinglayer::geometry
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/processor2d/contourextractor2d.cxx b/drawinglayer/source/processor2d/contourextractor2d.cxx
index 8abec2f50f9d..96250f59fa17 100644
--- a/drawinglayer/source/processor2d/contourextractor2d.cxx
+++ b/drawinglayer/source/processor2d/contourextractor2d.cxx
@@ -129,8 +129,7 @@ namespace drawinglayer::processor2d
getViewInformation2D().getViewTransformation(),
getViewInformation2D().getViewport(),
getViewInformation2D().getVisualizedPage(),
- getViewInformation2D().getViewTime(),
- getViewInformation2D().getExtendedInformationSequence());
+ getViewInformation2D().getViewTime());
updateViewInformation(aViewInformation2D);
// process content
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 04505489c6f2..8e5dc31242e4 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -238,8 +238,7 @@ namespace drawinglayer::processor2d
getViewInformation2D().getViewTransformation(),
getViewInformation2D().getViewport(),
getViewInformation2D().getVisualizedPage(),
- getViewInformation2D().getViewTime(),
- getViewInformation2D().getExtendedInformationSequence());
+ getViewInformation2D().getViewTime());
updateViewInformation(aViewInformation2D);
// process child content recursively
diff --git a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
index 9262e23e4509..9b7c9b62e90a 100644
--- a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
+++ b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
@@ -91,8 +91,7 @@ namespace drawinglayer::processor2d
getViewInformation2D().getViewTransformation(),
getViewInformation2D().getViewport(),
getViewInformation2D().getVisualizedPage(),
- getViewInformation2D().getViewTime(),
- getViewInformation2D().getExtendedInformationSequence());
+ getViewInformation2D().getViewTime());
updateViewInformation(aViewInformation2D);
// process content
diff --git a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
index e3a584f86172..82bc044e36f9 100644
--- a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
+++ b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
@@ -182,8 +182,7 @@ namespace drawinglayer::processor2d
getViewInformation2D().getViewTransformation(),
getViewInformation2D().getViewport(),
getViewInformation2D().getVisualizedPage(),
- getViewInformation2D().getViewTime(),
- getViewInformation2D().getExtendedInformationSequence());
+ getViewInformation2D().getViewTime());
updateViewInformation(aViewInformation2D);
// process content
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index f08d17f2f002..d60616d5be2c 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2308,8 +2308,7 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D(
// except new transformation and range
const geometry::ViewInformation2D aViewInfo(
getViewInformation2D().getObjectTransformation(), aViewTransform, aViewRange,
- getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime(),
- getViewInformation2D().getExtendedInformationSequence());
+ getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime());
VclPixelProcessor2D aBufferProcessor(aViewInfo, *aBufferDevice);
@@ -2426,8 +2425,7 @@ VclMetafileProcessor2D::CreateBufferDevice(const basegfx::B2DRange& rCandidateRa
// except new transformation and range
rViewInfo = geometry::ViewInformation2D(
getViewInformation2D().getObjectTransformation(), aViewTransform, aViewRange,
- getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime(),
- getViewInformation2D().getExtendedInformationSequence());
+ getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime());
}
else
pBufferDevice.disposeAndClear();
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index bd6af1b27221..ed40fdb4ee23 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -905,8 +905,7 @@ void VclProcessor2D::RenderTransformPrimitive2D(
const geometry::ViewInformation2D aViewInformation2D(
getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation(),
getViewInformation2D().getViewTransformation(), getViewInformation2D().getViewport(),
- getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime(),
- getViewInformation2D().getExtendedInformationSequence());
+ getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime());
updateViewInformation(aViewInformation2D);
// process content
@@ -928,8 +927,7 @@ void VclProcessor2D::RenderPagePreviewPrimitive2D(
const geometry::ViewInformation2D aViewInformation2D(
getViewInformation2D().getObjectTransformation(),
getViewInformation2D().getViewTransformation(), getViewInformation2D().getViewport(),
- rPagePreviewCandidate.getXDrawPage(), getViewInformation2D().getViewTime(),
- getViewInformation2D().getExtendedInformationSequence());
+ rPagePreviewCandidate.getXDrawPage(), getViewInformation2D().getViewTime());
updateViewInformation(aViewInformation2D);
// process decomposed content
diff --git a/include/drawinglayer/geometry/viewinformation2d.hxx b/include/drawinglayer/geometry/viewinformation2d.hxx
index 95be29a72bda..20ef7c4de453 100644
--- a/include/drawinglayer/geometry/viewinformation2d.hxx
+++ b/include/drawinglayer/geometry/viewinformation2d.hxx
@@ -105,8 +105,7 @@ public:
const basegfx::B2DHomMatrix& rViewTransformation,
const basegfx::B2DRange& rViewport,
const css::uno::Reference<css::drawing::XDrawPage>& rxDrawPage,
- double fViewTime,
- const css::uno::Sequence<css::beans::PropertyValue>& rExtendedParameters);
+ double fViewTime);
/** Constructor: Create a ViewInformation2D
@@ -166,16 +165,6 @@ public:
can be used for complete information transport over UNO API.
*/
const css::uno::Sequence<css::beans::PropertyValue>& getViewInformationSequence() const;
-
- /** Get the uno::Sequence< beans::PropertyValue > which contains only ViewInformation
- not offered directly
-
- Use this call if You only need ViewInformation which is not offered conveniently,
- but only exists as PropertyValue. This is e.g. used to create partially updated
- incarnations of ViewInformation2D without losing the only with PropertyValues
- defined data. It does not contain a complete description.
- */
- const css::uno::Sequence<css::beans::PropertyValue>& getExtendedInformationSequence() const;
};
} // end of namespace drawinglayer::geometry
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 93b542b2c851..e02fde75aede 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1721,8 +1721,7 @@ std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> ScOutputData::Create
mpDev->GetViewTransformation(),
aViewRange,
GetXDrawPageForSdrPage( pDrawPage ),
- 0.0,
- uno::Sequence< beans::PropertyValue >() );
+ 0.0);
return drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(
*mpDev, aNewViewInfos );
diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx
index 1fb9d0ae1464..028491bbbf78 100644
--- a/svx/source/dialog/pagectrl.cxx
+++ b/svx/source/dialog/pagectrl.cxx
@@ -358,8 +358,7 @@ void SvxPageWindow::drawFillAttributes(vcl::RenderContext& rRenderContext,
return;
const drawinglayer::geometry::ViewInformation2D aViewInformation2D(
- basegfx::B2DHomMatrix(), rRenderContext.GetViewTransformation(), aPaintRange, nullptr,
- 0.0, css::uno::Sequence<css::beans::PropertyValue >());
+ basegfx::B2DHomMatrix(), rRenderContext.GetViewTransformation(), aPaintRange, nullptr, 0.0);
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
drawinglayer::processor2d::createProcessor2DFromOutputDevice(rRenderContext, aViewInformation2D));
diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx
index 7059ada36320..0e31a3780e3e 100644
--- a/svx/source/dialog/weldeditview.cxx
+++ b/svx/source/dialog/weldeditview.cxx
@@ -236,8 +236,7 @@ void WeldEditView::DoPaint(vcl::RenderContext& rRenderContext, const tools::Rect
const drawinglayer::geometry::ViewInformation2D aViewInformation2D(
basegfx::B2DHomMatrix(), rRenderContext.GetViewTransformation(),
- vcl::unotools::b2DRectangleFromRectangle(rRect), nullptr, 0.0,
- css::uno::Sequence<css::beans::PropertyValue>());
+ vcl::unotools::b2DRectangleFromRectangle(rRect), nullptr, 0.0);
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> xProcessor(
drawinglayer::processor2d::createProcessor2DFromOutputDevice(rRenderContext,
diff --git a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
index 608a97ebd698..d59d320acb34 100644
--- a/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
+++ b/svx/source/sdr/contact/objectcontactofobjlistpainter.cxx
@@ -102,8 +102,7 @@ void ObjectContactOfObjListPainter::ProcessDisplay(DisplayInfo& rDisplayInfo)
pTargetDevice->GetViewTransformation(),
aViewRange,
GetXDrawPageForSdrPage(const_cast< SdrPage* >(mpProcessedPage)),
- 0.0,
- css::uno::Sequence<css::beans::PropertyValue>());
+ 0.0);
updateViewInformation2D(aNewViewInformation2D);
// collect primitive data in a sequence; this will already use the updated ViewInformation2D
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 3a3c28b972f8..150735030ea5 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -213,8 +213,7 @@ namespace sdr::contact
rTargetOutDev.GetViewTransformation(),
aViewRange,
GetXDrawPageForSdrPage(GetSdrPage()),
- fCurrentTime,
- uno::Sequence<beans::PropertyValue>());
+ fCurrentTime);
updateViewInformation2D(aNewViewInformation2D);
drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence;
diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
index ad1d0bf87a9e..9e19982b7824 100644
--- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
@@ -137,8 +137,7 @@ drawinglayer::primitive2d::Primitive2DContainer PagePrimitiveExtractor::createPr
basegfx::B2DRange(),
GetXDrawPageForSdrPage(pStartPage),
- 0.0, // no time; page previews are not animated
- rOriginalViewInformation.getExtendedInformationSequence());
+ 0.0); // no time; page previews are not animated
updateViewInformation2D(aNewViewInformation2D);
// create copy of DisplayInfo to set PagePainting
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index 6965b6a775a0..5d145687b3e0 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -162,8 +162,7 @@ namespace sdr::overlay
maViewTransformation,
aViewRange,
maViewInformation2D.getVisualizedPage(),
- maViewInformation2D.getViewTime(),
- maViewInformation2D.getExtendedInformationSequence());
+ maViewInformation2D.getViewTime());
pThis->mfDiscreteOne = 0.0;
}
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 2d19c61972f9..d95314b19961 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -900,8 +900,7 @@ static bool paintUsingPrimitivesHelper(
rOutputDevice.GetViewTransformation(),
rTargetRange,
nullptr,
- 0.0,
- uno::Sequence< beans::PropertyValue >());
+ 0.0);
// get a primitive processor for rendering
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 0cf9c7fc7b26..0eead63a35f0 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1794,8 +1794,7 @@ bool DrawFillAttributes(
rOut.GetViewTransformation(),
aPaintRange,
nullptr,
- 0.0,
- uno::Sequence< beans::PropertyValue >());
+ 0.0);
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(drawinglayer::processor2d::createProcessor2DFromOutputDevice(
rOut,
aViewInformation2D) );
@@ -5129,8 +5128,7 @@ std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> SwFrame::CreateProce
getRootFrame()->GetCurrShell()->GetOut()->GetViewTransformation(),
aViewRange,
GetXDrawPageForSdrPage( pDrawPage ),
- 0.0,
- uno::Sequence< beans::PropertyValue >() );
+ 0.0);
return drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(
*getRootFrame()->GetCurrShell()->GetOut(),
commit 4df6270efc355fe62a218d6e6244217a261511ff
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Jul 20 21:39:02 2021 +0900
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Jul 31 10:16:48 2021 +0900
svx: cleanup some forward decls, unneeded pragma once, whitespace
Change-Id: I26cd723e0ffe907a7aa8cb4f73ba6bfbd6db5fbc
diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx
index bf7e329d5442..69ce11533caa 100644
--- a/include/svx/svdograf.hxx
+++ b/include/svx/svdograf.hxx
@@ -29,17 +29,8 @@
#include <o3tl/typed_flags_set.hxx>
#include <memory>
-namespace sdr
-{
- namespace properties
- {
- class GraphicProperties;
- } // end of namespace properties
- namespace contact
- {
- class ViewObjectContactOfGraphic;
- } // end of namespace contact
-} // end of namespace sdr
+namespace sdr::properties { class GraphicProperties; }
+namespace sdr::contact { class ViewObjectContactOfGraphic; }
/**
* Options for GetTransformedGraphic()
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index d5552a7c72a4..fc6936a95282 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -64,7 +64,7 @@ private:
SdrObjList(const SdrObjList& rSrcList) = delete;
SdrObjList &operator=(const SdrObjList& rSrcList) = delete;
- ::std::vector<SdrObject*> maList;
+ std::vector<SdrObject*> maList;
tools::Rectangle maSdrObjListOutRect;
tools::Rectangle maSdrObjListSnapRect;
diff --git a/include/svx/svdpagv.hxx b/include/svx/svdpagv.hxx
index ab9bfa5625ae..3aceb48d1d4b 100644
--- a/include/svx/svdpagv.hxx
+++ b/include/svx/svdpagv.hxx
@@ -42,20 +42,16 @@ class SdrView;
class SdrPageObj;
class SdrPageView;
-namespace sdr
+namespace sdr::contact
{
- namespace contact
- {
- class ViewObjectContactRedirector;
- class DisplayInfo;
- class ViewObjectContactRedirector;
- } // end of namespace contact
-} // end of namespace sdr
+ class ViewObjectContactRedirector;
+ class DisplayInfo;
+ class ViewObjectContactRedirector;
+}
// typedefs for a list of SdrPageWindow
class SdrPageWindow;
-
class SVXCORE_DLLPUBLIC SdrPageView
{
private:
@@ -255,6 +251,4 @@ public:
const Color& GetApplicationDocumentColor() const { return maDocumentColor;}
};
-#pragma once
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list