summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/baseprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive2d/bitmapprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive2d/groupprimitive2d.cxx15
-rw-r--r--drawinglayer/source/primitive2d/patternfillprimitive2d.cxx15
4 files changed, 42 insertions, 0 deletions
diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
index 6f89cf3b9358..84833c36966a 100644
--- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
@@ -71,6 +71,12 @@ namespace drawinglayer
const geometry::ViewInformation2D aViewInformation(rViewParameters);
return basegfx::unotools::rectangle2DFromB2DRectangle(getB2DRange(aViewInformation));
}
+
+ sal_Int64 SAL_CALL BasePrimitive2D::estimateUsage()
+ throw (css::uno::RuntimeException)
+ {
+ return 0; // for now ignore the objects themselves
+ }
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx
index 30d3cde3db63..db75ba5dc911 100644
--- a/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/bitmapprimitive2d.cxx
@@ -58,6 +58,12 @@ namespace drawinglayer
return aRetval;
}
+ sal_Int64 SAL_CALL BitmapPrimitive2D::estimateUsage()
+ throw (css::uno::RuntimeException)
+ {
+ return getBitmapEx().GetSizeBytes();
+ }
+
// provide unique ID
ImplPrimitive2DIDBlock(BitmapPrimitive2D, PRIMITIVE2D_ID_BITMAPPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/groupprimitive2d.cxx b/drawinglayer/source/primitive2d/groupprimitive2d.cxx
index d35f5b1a47f7..b5582a0a3e08 100644
--- a/drawinglayer/source/primitive2d/groupprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/groupprimitive2d.cxx
@@ -56,6 +56,21 @@ namespace drawinglayer
return getChildren();
}
+ sal_Int64 SAL_CALL GroupPrimitive2D::estimateUsage()
+ throw (css::uno::RuntimeException)
+ {
+ size_t nRet(0);
+ for (auto& it : getChildren())
+ {
+ uno::Reference<util::XAccounting> const xAcc(it, uno::UNO_QUERY);
+ if (xAcc.is())
+ {
+ nRet += xAcc->estimateUsage();
+ }
+ }
+ return nRet;
+ }
+
// provide unique ID
ImplPrimitive2DIDBlock(GroupPrimitive2D, PRIMITIVE2D_ID_GROUPPRIMITIVE2D)
diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
index 5d1eec1ca93b..82d397d2c293 100644
--- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
@@ -314,6 +314,21 @@ namespace drawinglayer
return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
}
+ sal_Int64 SAL_CALL PatternFillPrimitive2D::estimateUsage()
+ throw (css::uno::RuntimeException)
+ {
+ size_t nRet(0);
+ for (auto& it : getChildren())
+ {
+ uno::Reference<util::XAccounting> const xAcc(it, uno::UNO_QUERY);
+ if (xAcc.is())
+ {
+ nRet += xAcc->estimateUsage();
+ }
+ }
+ return nRet;
+ }
+
// provide unique ID
ImplPrimitive2DIDBlock(PatternFillPrimitive2D, PRIMITIVE2D_ID_PATTERNFILLPRIMITIVE2D)