summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-12-29 10:42:17 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-01-19 06:42:16 +0100
commit97dfcf4d7d5bf9249926a05d9e69720921159f43 (patch)
tree8b32fd94dc76ddb43f6e359f02de62820e40ad42
parente49dbc6c7ebae0162b6e1d7c5d0bdf3152c1814e (diff)
vcl: remove or rename too long methods names in VectorGraphicData
Change-Id: I8a64d27927b608afdc7996e0b0bbc59a58fde90f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108443 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--emfio/source/reader/emfreader.cxx2
-rw-r--r--filter/source/svg/svgfilter.cxx2
-rw-r--r--include/vcl/vectorgraphicdata.hxx18
-rw-r--r--sd/qa/unit/SdrPdfImportTest.cxx6
-rw-r--r--sd/qa/unit/tiledrendering/LOKitSearchTest.cxx27
-rw-r--r--sd/source/ui/view/Outliner.cxx2
-rw-r--r--svx/source/core/graphichelper.cxx4
-rw-r--r--svx/source/svdraw/svdedtv2.cxx2
-rw-r--r--svx/source/svdraw/svdograf.cxx6
-rw-r--r--svx/source/xoutdev/_xoutbmp.cxx10
-rw-r--r--vcl/qa/cppunit/GraphicTest.cxx35
-rw-r--r--vcl/qa/cppunit/PDFiumLibraryTest.cxx18
-rw-r--r--vcl/source/filter/graphicfilter.cxx13
-rw-r--r--vcl/source/gdi/TypeSerializer.cxx2
-rw-r--r--vcl/source/gdi/impgraph.cxx8
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx6
-rw-r--r--vcl/source/gdi/vectorgraphicdata.cxx14
-rw-r--r--vcl/source/graphic/GraphicID.cxx2
-rw-r--r--vcl/source/graphic/VectorGraphicSearch.cxx2
19 files changed, 78 insertions, 101 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index ae00508380e1..c2240ed612e5 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -517,7 +517,7 @@ namespace emfio
return;
}
- if (pVectorGraphicData->getVectorGraphicDataType() != VectorGraphicDataType::Pdf)
+ if (pVectorGraphicData->getType() != VectorGraphicDataType::Pdf)
{
return;
}
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 473ff510adc3..e4d61b7de1ee 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -256,7 +256,7 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< PropertyValue >& rDescripto
auto const & rVectorGraphicData(aGraphic.getVectorGraphicData());
bool bContainsNoGeometry(false);
- if(bool(rVectorGraphicData) && VectorGraphicDataType::Svg == rVectorGraphicData->getVectorGraphicDataType())
+ if(bool(rVectorGraphicData) && VectorGraphicDataType::Svg == rVectorGraphicData->getType())
{
const drawinglayer::primitive2d::Primitive2DContainer aContainer(rVectorGraphicData->getPrimitive2DSequence());
diff --git a/include/vcl/vectorgraphicdata.hxx b/include/vcl/vectorgraphicdata.hxx
index 2d51bb61c228..90b92411dfab 100644
--- a/include/vcl/vectorgraphicdata.hxx
+++ b/include/vcl/vectorgraphicdata.hxx
@@ -64,12 +64,12 @@ private:
std::deque< css::uno::Reference< css::graphic::XPrimitive2D > > maSequence;
BitmapEx maReplacement;
size_t mNestedBitmapSize;
- VectorGraphicDataType meVectorGraphicDataType;
+ VectorGraphicDataType meType;
// extra:
std::unique_ptr<WmfExternal> mpExternalHeader;
- // If the vector format has more pages this denotes which page to render
+ /// If the vector format has more pages this denotes which page to render
sal_Int32 mnPageIndex;
/// Useful for PDF, which is vector-based, but still rendered to a bitmap.
@@ -105,23 +105,21 @@ public:
return maDataContainer;
}
- sal_uInt32 getVectorGraphicDataArrayLength() const
- {
- return maDataContainer.getSize();
- }
-
enum class State { UNPARSED, PARSED };
std::pair<State, size_t> getSizeBytes() const;
- const VectorGraphicDataType& getVectorGraphicDataType() const { return meVectorGraphicDataType; }
+ const VectorGraphicDataType& getType() const { return meType; }
/// data read and evtl. on demand creation
const basegfx::B2DRange& getRange() const;
- const std::deque< css::uno::Reference< css::graphic::XPrimitive2D > >& getPrimitive2DSequence() const;
+ const std::deque<css::uno::Reference<css::graphic::XPrimitive2D>>& getPrimitive2DSequence() const;
const BitmapEx& getReplacement() const;
BitmapChecksum GetChecksum() const;
- sal_Int32 getPageIndex() const { return std::max(sal_Int32(0), mnPageIndex); }
+ sal_Int32 getPageIndex() const
+ {
+ return std::max(sal_Int32(0), mnPageIndex);
+ }
void setPageIndex(sal_Int32 nPageIndex)
{
diff --git a/sd/qa/unit/SdrPdfImportTest.cxx b/sd/qa/unit/SdrPdfImportTest.cxx
index ea5f2aee477f..abf68b8f8676 100644
--- a/sd/qa/unit/SdrPdfImportTest.cxx
+++ b/sd/qa/unit/SdrPdfImportTest.cxx
@@ -107,8 +107,7 @@ CPPUNIT_TEST_FIXTURE(SdrPdfImportTest, testImportSimpleText)
Graphic aGraphic = pGraphicObject->GetGraphic();
auto const& pVectorGraphicData = aGraphic.getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
// Mark the object
SdrView* pView = pViewShell->GetView();
@@ -197,8 +196,7 @@ CPPUNIT_TEST_FIXTURE(SdrPdfImportTest, testAnnotationsImportExport)
Graphic aGraphic = pGraphicObject->GetGraphic();
auto const& pVectorGraphicData = aGraphic.getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
// Write the PDF
aContainer = pVectorGraphicData->getBinaryDataContainer();
diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 6397f8c25acc..9b898119a47c 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -303,8 +303,7 @@ void LOKitSearchTest::testSearchInPDFNonExisting()
Graphic aGraphic = pGraphicObject->GetGraphic();
auto const& pVectorGraphicData = aGraphic.getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
lcl_search("NonExisting");
@@ -332,8 +331,7 @@ void LOKitSearchTest::testSearchInPDF()
Graphic aGraphic = pGraphicObject->GetGraphic();
auto const& pVectorGraphicData = aGraphic.getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
// Search
lcl_search("ABC");
@@ -381,8 +379,7 @@ void LOKitSearchTest::testSearchInPDFOnePDFObject()
Graphic aGraphic = pGraphicObject->GetGraphic();
auto const& pVectorGraphicData = aGraphic.getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
// Search down
lcl_search("ABC", false, false);
@@ -419,8 +416,7 @@ void LOKitSearchTest::testSearchInPDFInMultiplePages()
Graphic aGraphic = pGraphicObject->GetGraphic();
auto const& pVectorGraphicData = aGraphic.getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
}
// Search for "him"
@@ -511,8 +507,7 @@ void LOKitSearchTest::testSearchInPDFInMultiplePagesBackwards()
Graphic aGraphic = pGraphicObject->GetGraphic();
auto const& pVectorGraphicData = aGraphic.getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
}
// Expected for backwards search is:
@@ -633,8 +628,7 @@ void LOKitSearchTest::testSearchIn2MixedObjects()
auto const& pVectorGraphicData = aGraphic.getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
}
// Let's try to search now
@@ -716,8 +710,7 @@ void LOKitSearchTest::testSearchIn6MixedObjects()
CPPUNIT_ASSERT(pGraphicObject);
auto const& pVectorGraphicData = pGraphicObject->GetGraphic().getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
}
// Check Object 3
@@ -743,8 +736,7 @@ void LOKitSearchTest::testSearchIn6MixedObjects()
CPPUNIT_ASSERT(pGraphicObject);
auto const& pVectorGraphicData = pGraphicObject->GetGraphic().getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Svg,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Svg, pVectorGraphicData->getType());
}
// Check Object 6
@@ -756,8 +748,7 @@ void LOKitSearchTest::testSearchIn6MixedObjects()
CPPUNIT_ASSERT(pGraphicObject);
auto const& pVectorGraphicData = pGraphicObject->GetGraphic().getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
}
// Search "ABC" which is in all objects (2 times in Object 3)
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 59e740b4bda1..1e58117cdb81 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1154,7 +1154,7 @@ bool isValidVectorGraphicObject(const sd::outliner::IteratorPosition& rPosition)
if (pGraphicObject)
{
auto const& pVectorGraphicData = pGraphicObject->GetGraphic().getVectorGraphicData();
- if (pVectorGraphicData && VectorGraphicDataType::Pdf == pVectorGraphicData->getVectorGraphicDataType())
+ if (pVectorGraphicData && VectorGraphicDataType::Pdf == pVectorGraphicData->getType())
{
return true;
}
diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx
index 8485b0e0df3b..2c97da419c98 100644
--- a/svx/source/core/graphichelper.cxx
+++ b/svx/source/core/graphichelper.cxx
@@ -69,9 +69,9 @@ void GraphicHelper::GetPreferredExtension( OUString& rExtension, const Graphic&
OUString aExtension = "png";
auto const & rVectorGraphicDataPtr(rGraphic.getVectorGraphicData());
- if (rVectorGraphicDataPtr && rVectorGraphicDataPtr->getVectorGraphicDataArrayLength())
+ if (rVectorGraphicDataPtr && !rVectorGraphicDataPtr->getBinaryDataContainer().isEmpty())
{
- switch (rVectorGraphicDataPtr->getVectorGraphicDataType())
+ switch (rVectorGraphicDataPtr->getType())
{
case VectorGraphicDataType::Wmf:
aExtension = "wmf";
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index f688c32df82b..9dd795bb632b 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -2103,7 +2103,7 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo)
Graphic aGraphic = pGraf->GetGraphic();
auto const & pVectorGraphicData = aGraphic.getVectorGraphicData();
- if (pVectorGraphicData && pVectorGraphicData->getVectorGraphicDataType() == VectorGraphicDataType::Pdf)
+ if (pVectorGraphicData && pVectorGraphicData->getType() == VectorGraphicDataType::Pdf)
{
#if HAVE_FEATURE_PDFIUM
aLogicRect = pGraf->GetLogicRect();
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 925b714cb5ff..f56bad94ab71 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -142,7 +142,7 @@ void SdrGrafObj::onGraphicChanged()
// Skip for PDF as it is only a bitmap primitive in a sequence and
// doesn't contain metadata. However getting the primitive sequence
// will also trigger a premature rendering of the PDF.
- if (rVectorGraphicDataPtr->getVectorGraphicDataType() == VectorGraphicDataType::Pdf)
+ if (rVectorGraphicDataPtr->getType() == VectorGraphicDataType::Pdf)
return;
const drawinglayer::primitive2d::Primitive2DContainer aSequence(rVectorGraphicDataPtr->getPrimitive2DSequence());
@@ -557,7 +557,7 @@ OUString SdrGrafObj::TakeObjNameSingul() const
if (rVectorGraphicDataPtr)
{
- switch (rVectorGraphicDataPtr->getVectorGraphicDataType())
+ switch (rVectorGraphicDataPtr->getType())
{
case VectorGraphicDataType::Svg:
{
@@ -632,7 +632,7 @@ OUString SdrGrafObj::TakeObjNamePlural() const
if (rVectorGraphicDataPtr)
{
- switch (rVectorGraphicDataPtr->getVectorGraphicDataType())
+ switch (rVectorGraphicDataPtr->getType())
{
case VectorGraphicDataType::Svg:
{
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 6dba9e722a7d..9f53d9c22d41 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -129,12 +129,12 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName,
// #i121128# use shortcut to write Vector Graphic Data data in original form (if possible)
auto const & rVectorGraphicDataPtr(rGraphic.getVectorGraphicData());
- if (rVectorGraphicDataPtr && rVectorGraphicDataPtr->getVectorGraphicDataArrayLength())
+ if (rVectorGraphicDataPtr && rVectorGraphicDataPtr->getBinaryDataContainer().getSize())
{
- const bool bIsSvg(rFilterName.equalsIgnoreAsciiCase("svg") && VectorGraphicDataType::Svg == rVectorGraphicDataPtr->getVectorGraphicDataType());
- const bool bIsWmf(rFilterName.equalsIgnoreAsciiCase("wmf") && VectorGraphicDataType::Wmf == rVectorGraphicDataPtr->getVectorGraphicDataType());
- const bool bIsEmf(rFilterName.equalsIgnoreAsciiCase("emf") && VectorGraphicDataType::Emf == rVectorGraphicDataPtr->getVectorGraphicDataType());
- const bool bIsPdf(rFilterName.equalsIgnoreAsciiCase("pdf") && VectorGraphicDataType::Pdf == rVectorGraphicDataPtr->getVectorGraphicDataType());
+ const bool bIsSvg(rFilterName.equalsIgnoreAsciiCase("svg") && VectorGraphicDataType::Svg == rVectorGraphicDataPtr->getType());
+ const bool bIsWmf(rFilterName.equalsIgnoreAsciiCase("wmf") && VectorGraphicDataType::Wmf == rVectorGraphicDataPtr->getType());
+ const bool bIsEmf(rFilterName.equalsIgnoreAsciiCase("emf") && VectorGraphicDataType::Emf == rVectorGraphicDataPtr->getType());
+ const bool bIsPdf(rFilterName.equalsIgnoreAsciiCase("pdf") && VectorGraphicDataType::Pdf == rVectorGraphicDataPtr->getType());
if (bIsSvg || bIsWmf || bIsEmf || bIsPdf)
{
diff --git a/vcl/qa/cppunit/GraphicTest.cxx b/vcl/qa/cppunit/GraphicTest.cxx
index 0f3562388d97..2c64ce856692 100644
--- a/vcl/qa/cppunit/GraphicTest.cxx
+++ b/vcl/qa/cppunit/GraphicTest.cxx
@@ -377,8 +377,7 @@ void GraphicTest::testEmfToWmfConversion()
sal_uInt16 nFormat = aGraphicFilter.GetImportFormatNumberForShortName(u"WMF");
CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE,
aGraphicFilter.ImportGraphic(aGraphic, OUString(), aStream, nFormat));
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Wmf,
- aGraphic.getVectorGraphicData()->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Wmf, aGraphic.getVectorGraphicData()->getType());
// Save as WMF.
sal_uInt16 nFilterType = aGraphicFilter.GetExportFormatNumberForShortName(u"WMF");
@@ -661,7 +660,7 @@ void GraphicTest::testSwappingVectorGraphic_SVG_WithGfxLink()
CPPUNIT_ASSERT_EQUAL(true, bool(pVectorData));
CPPUNIT_ASSERT_EQUAL(true, aGraphic.isAvailable());
- CPPUNIT_ASSERT_EQUAL(sal_uInt32(223), pVectorData->getVectorGraphicDataArrayLength());
+ CPPUNIT_ASSERT_EQUAL(size_t(223), pVectorData->getBinaryDataContainer().getSize());
CPPUNIT_ASSERT_EQUAL(true, aGraphic.IsGfxLink());
CPPUNIT_ASSERT_EQUAL(sal_uInt32(223), aGraphic.GetGfxLink().GetDataSize());
@@ -711,8 +710,8 @@ void GraphicTest::testSwappingVectorGraphic_SVG_WithoutGfxLink()
GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
Graphic aInputGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream);
- CPPUNIT_ASSERT_EQUAL(sal_uInt32(223),
- aInputGraphic.getVectorGraphicData()->getVectorGraphicDataArrayLength());
+ CPPUNIT_ASSERT_EQUAL(size_t(223),
+ aInputGraphic.getVectorGraphicData()->getBinaryDataContainer().getSize());
// Create graphic
Graphic aGraphic(aInputGraphic.getVectorGraphicData());
@@ -721,8 +720,8 @@ void GraphicTest::testSwappingVectorGraphic_SVG_WithoutGfxLink()
CPPUNIT_ASSERT_EQUAL(true, bool(aGraphic.getVectorGraphicData()));
CPPUNIT_ASSERT_EQUAL(true, aGraphic.isAvailable());
- CPPUNIT_ASSERT_EQUAL(sal_uInt32(223),
- aGraphic.getVectorGraphicData()->getVectorGraphicDataArrayLength());
+ CPPUNIT_ASSERT_EQUAL(size_t(223),
+ aGraphic.getVectorGraphicData()->getBinaryDataContainer().getSize());
CPPUNIT_ASSERT_EQUAL(false, aGraphic.IsGfxLink());
@@ -775,8 +774,8 @@ void GraphicTest::testSwappingVectorGraphic_SVG_WithoutGfxLink()
CPPUNIT_ASSERT_EQUAL(GraphicType::Bitmap, aGraphic.GetType());
CPPUNIT_ASSERT_EQUAL(true, bool(aGraphic.getVectorGraphicData()));
- sal_uInt32 nVectorByteSize = aGraphic.getVectorGraphicData()->getVectorGraphicDataArrayLength();
- CPPUNIT_ASSERT_EQUAL(sal_uInt32(223), nVectorByteSize);
+ size_t nVectorByteSize = aGraphic.getVectorGraphicData()->getBinaryDataContainer().getSize();
+ CPPUNIT_ASSERT_EQUAL(size_t(223), nVectorByteSize);
CPPUNIT_ASSERT_EQUAL(false, aGraphic.IsGfxLink());
@@ -863,8 +862,8 @@ void GraphicTest::testSwappingGraphicProperties_SVG_WithoutGfxLink()
GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
Graphic aInputGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream);
- CPPUNIT_ASSERT_EQUAL(sal_uInt32(223),
- aInputGraphic.getVectorGraphicData()->getVectorGraphicDataArrayLength());
+ CPPUNIT_ASSERT_EQUAL(size_t(223),
+ aInputGraphic.getVectorGraphicData()->getBinaryDataContainer().getSize());
// Create graphic
Graphic aGraphic(aInputGraphic.getVectorGraphicData());
@@ -934,10 +933,9 @@ void GraphicTest::testSwappingVectorGraphic_PDF_WithGfxLink()
// Set the page index
aGraphic.getVectorGraphicData()->setPageIndex(1);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- aGraphic.getVectorGraphicData()->getVectorGraphicDataType());
- CPPUNIT_ASSERT_EQUAL(sal_uInt32(17693),
- aGraphic.getVectorGraphicData()->getVectorGraphicDataArrayLength());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, aGraphic.getVectorGraphicData()->getType());
+ CPPUNIT_ASSERT_EQUAL(size_t(17693),
+ aGraphic.getVectorGraphicData()->getBinaryDataContainer().getSize());
CPPUNIT_ASSERT_EQUAL(true, aGraphic.isAvailable());
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aGraphic.getVectorGraphicData()->getPageIndex());
@@ -975,10 +973,9 @@ void GraphicTest::testSwappingVectorGraphic_PDF_WithoutGfxLink()
// Set the page index
aGraphic.getVectorGraphicData()->setPageIndex(1);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- aGraphic.getVectorGraphicData()->getVectorGraphicDataType());
- CPPUNIT_ASSERT_EQUAL(sal_uInt32(17693),
- aGraphic.getVectorGraphicData()->getVectorGraphicDataArrayLength());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, aGraphic.getVectorGraphicData()->getType());
+ CPPUNIT_ASSERT_EQUAL(size_t(17693),
+ aGraphic.getVectorGraphicData()->getBinaryDataContainer().getSize());
CPPUNIT_ASSERT_EQUAL(true, aGraphic.isAvailable());
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aGraphic.getVectorGraphicData()->getPageIndex());
diff --git a/vcl/qa/cppunit/PDFiumLibraryTest.cxx b/vcl/qa/cppunit/PDFiumLibraryTest.cxx
index fce6537bcac1..635bf6304f20 100644
--- a/vcl/qa/cppunit/PDFiumLibraryTest.cxx
+++ b/vcl/qa/cppunit/PDFiumLibraryTest.cxx
@@ -64,8 +64,7 @@ void PDFiumLibraryTest::testDocument()
auto pVectorGraphicData = aGraphic.getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
auto& rDataContainer = pVectorGraphicData->getBinaryDataContainer();
@@ -91,8 +90,7 @@ void PDFiumLibraryTest::testPages()
auto pVectorGraphicData = aGraphic.getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
auto& rDataContainer = pVectorGraphicData->getBinaryDataContainer();
@@ -116,8 +114,7 @@ void PDFiumLibraryTest::testPageObjects()
auto pVectorGraphicData = aGraphic.getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
auto& rDataContainer = pVectorGraphicData->getBinaryDataContainer();
@@ -165,8 +162,7 @@ void PDFiumLibraryTest::testAnnotationsMadeInEvince()
auto pVectorGraphicData = aGraphic.getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
auto& rDataContainer = pVectorGraphicData->getBinaryDataContainer();
@@ -221,8 +217,7 @@ void PDFiumLibraryTest::testAnnotationsMadeInAcrobat()
auto pVectorGraphicData = aGraphic.getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
auto& rDataContainer = pVectorGraphicData->getBinaryDataContainer();
@@ -298,8 +293,7 @@ void PDFiumLibraryTest::testAnnotationsDifferentTypes()
auto pVectorGraphicData = aGraphic.getVectorGraphicData();
CPPUNIT_ASSERT(pVectorGraphicData);
- CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf,
- pVectorGraphicData->getVectorGraphicDataType());
+ CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Pdf, pVectorGraphicData->getType());
auto& rDataContainer = pVectorGraphicData->getBinaryDataContainer();
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 7f7af5239cad..51ba7859f7ac 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -2002,9 +2002,8 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
// VectorGraphicDataType::Wmf means WMF or EMF, allow direct write in the WMF case
// only.
if (rVectorGraphicDataPtr
- && rVectorGraphicDataPtr->getVectorGraphicDataArrayLength()
- && VectorGraphicDataType::Wmf
- == rVectorGraphicDataPtr->getVectorGraphicDataType()
+ && rVectorGraphicDataPtr->getType() == VectorGraphicDataType::Wmf
+ && !rVectorGraphicDataPtr->getBinaryDataContainer().isEmpty()
&& !bIsEMF)
{
auto & aDataContainer = rVectorGraphicDataPtr->getBinaryDataContainer();
@@ -2038,8 +2037,8 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
auto const & rVectorGraphicDataPtr(rGraphic.getVectorGraphicData());
if (rVectorGraphicDataPtr
- && rVectorGraphicDataPtr->getVectorGraphicDataArrayLength()
- && VectorGraphicDataType::Emf == rVectorGraphicDataPtr->getVectorGraphicDataType())
+ && rVectorGraphicDataPtr->getType() == VectorGraphicDataType::Emf
+ && !rVectorGraphicDataPtr->getBinaryDataContainer().isEmpty())
{
auto & aDataContainer = rVectorGraphicDataPtr->getBinaryDataContainer();
rOStm.WriteBytes(aDataContainer.getData(), aDataContainer.getSize());
@@ -2133,8 +2132,8 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
auto const & rVectorGraphicDataPtr(rGraphic.getVectorGraphicData());
if (rVectorGraphicDataPtr
- && rVectorGraphicDataPtr->getVectorGraphicDataArrayLength()
- && VectorGraphicDataType::Svg == rVectorGraphicDataPtr->getVectorGraphicDataType())
+ && rVectorGraphicDataPtr->getType() == VectorGraphicDataType::Svg
+ && !rVectorGraphicDataPtr->getBinaryDataContainer().isEmpty())
{
auto & aDataContainer = rVectorGraphicDataPtr->getBinaryDataContainer();
rOStm.WriteBytes(aDataContainer.getData(), aDataContainer.getSize());
diff --git a/vcl/source/gdi/TypeSerializer.cxx b/vcl/source/gdi/TypeSerializer.cxx
index 5a360f15675a..fb354d7f3dd0 100644
--- a/vcl/source/gdi/TypeSerializer.cxx
+++ b/vcl/source/gdi/TypeSerializer.cxx
@@ -362,7 +362,7 @@ void TypeSerializer::writeGraphic(const Graphic& rGraphic)
// this is used e.g. in swapping out graphic data and in transporting it over UNO API
// as sequence of bytes, but AFAIK not written anywhere to any kind of file, so it should be
// no problem to extend it; only used at runtime
- switch (pVectorGraphicData->getVectorGraphicDataType())
+ switch (pVectorGraphicData->getType())
{
case VectorGraphicDataType::Wmf:
{
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 07f0df76acb0..fe296fc510cf 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -672,8 +672,8 @@ const GDIMetaFile& ImpGraphic::ImplGetGDIMetaFile() const
ensureAvailable();
if (!maMetaFile.GetActionSize()
&& maVectorGraphicData
- && (VectorGraphicDataType::Emf == maVectorGraphicData->getVectorGraphicDataType()
- || VectorGraphicDataType::Wmf == maVectorGraphicData->getVectorGraphicDataType()))
+ && (VectorGraphicDataType::Emf == maVectorGraphicData->getType()
+ || VectorGraphicDataType::Wmf == maVectorGraphicData->getType()))
{
// If we have a Emf/Wmf VectorGraphic object, we
// need a way to get the Metafile data out of the primitive
@@ -1180,7 +1180,7 @@ bool ImpGraphic::swapOutGraphic(SvStream& rStream)
// this is used e.g. in swapping out graphic data and in transporting it over UNO API
// as sequence of bytes, but AFAIK not written anywhere to any kind of file, so it should be
// no problem to extend it; only used at runtime
- switch (maVectorGraphicData->getVectorGraphicDataType())
+ switch (maVectorGraphicData->getType())
{
case VectorGraphicDataType::Wmf:
{
@@ -1204,7 +1204,7 @@ bool ImpGraphic::swapOutGraphic(SvStream& rStream)
}
}
- rStream.WriteUInt32(maVectorGraphicData->getVectorGraphicDataArrayLength());
+ rStream.WriteUInt32(maVectorGraphicData->getBinaryDataContainer().getSize());
rStream.WriteBytes(
maVectorGraphicData->getBinaryDataContainer().getData(),
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 7339c4cbeb19..405965cbacbd 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -9000,7 +9000,7 @@ void PDFWriterImpl::createEmbeddedFile(const Graphic& rGraphic, ReferenceXObject
// no pdf data.
rEmit.m_nBitmapObject = nBitmapObject;
- if (!rGraphic.getVectorGraphicData() || rGraphic.getVectorGraphicData()->getVectorGraphicDataType() != VectorGraphicDataType::Pdf)
+ if (!rGraphic.getVectorGraphicData() || rGraphic.getVectorGraphicData()->getType() != VectorGraphicDataType::Pdf)
return;
BinaryDataContainer const & rDataContainer = rGraphic.getVectorGraphicData()->getBinaryDataContainer();
@@ -9073,7 +9073,7 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const
{
m_aJPGs.emplace( m_aJPGs.begin() );
JPGEmit& rEmit = m_aJPGs.front();
- if (!rGraphic.getVectorGraphicData() || rGraphic.getVectorGraphicData()->getVectorGraphicDataType() != VectorGraphicDataType::Pdf || m_aContext.UseReferenceXObject)
+ if (!rGraphic.getVectorGraphicData() || rGraphic.getVectorGraphicData()->getType() != VectorGraphicDataType::Pdf || m_aContext.UseReferenceXObject)
rEmit.m_nObject = createObject();
rEmit.m_aID = aID;
rEmit.m_pStream = std::move( pStream );
@@ -9177,7 +9177,7 @@ const BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx& i_rBitmap, co
m_aBitmaps.push_front( BitmapEmit() );
m_aBitmaps.front().m_aID = aID;
m_aBitmaps.front().m_aBitmap = aBitmap;
- if (!rGraphic.getVectorGraphicData() || rGraphic.getVectorGraphicData()->getVectorGraphicDataType() != VectorGraphicDataType::Pdf || m_aContext.UseReferenceXObject)
+ if (!rGraphic.getVectorGraphicData() || rGraphic.getVectorGraphicData()->getType() != VectorGraphicDataType::Pdf || m_aContext.UseReferenceXObject)
m_aBitmaps.front().m_nObject = createObject();
createEmbeddedFile(rGraphic, m_aBitmaps.front().m_aReferenceXObject, m_aBitmaps.front().m_nObject);
it = m_aBitmaps.begin();
diff --git a/vcl/source/gdi/vectorgraphicdata.cxx b/vcl/source/gdi/vectorgraphicdata.cxx
index 5e027e0bcd34..2afe12e97fbd 100644
--- a/vcl/source/gdi/vectorgraphicdata.cxx
+++ b/vcl/source/gdi/vectorgraphicdata.cxx
@@ -113,9 +113,9 @@ static size_t estimateSize(
bool VectorGraphicData::operator==(const VectorGraphicData& rCandidate) const
{
- if (getVectorGraphicDataType() == rCandidate.getVectorGraphicDataType())
+ if (getType() == rCandidate.getType())
{
- if (getVectorGraphicDataArrayLength() == rCandidate.getVectorGraphicDataArrayLength())
+ if (maDataContainer.getSize() == rCandidate.maDataContainer.getSize())
{
if (0 == memcmp(
maDataContainer.getData(),
@@ -142,7 +142,7 @@ void VectorGraphicData::setWmfExternalHeader(const WmfExternal& aExtHeader)
void VectorGraphicData::ensurePdfReplacement()
{
- assert(getVectorGraphicDataType() == VectorGraphicDataType::Pdf);
+ assert(getType() == VectorGraphicDataType::Pdf);
if (!maReplacement.IsEmpty())
return; // nothing to do
@@ -166,7 +166,7 @@ void VectorGraphicData::ensureReplacement()
// shortcut for PDF - PDFium can generate the replacement bitmap for us
// directly
- if (getVectorGraphicDataType() == VectorGraphicDataType::Pdf)
+ if (getType() == VectorGraphicDataType::Pdf)
{
ensurePdfReplacement();
return;
@@ -191,7 +191,7 @@ void VectorGraphicData::ensureSequenceAndRange()
// create Vector Graphic Data interpreter
uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext());
- switch (getVectorGraphicDataType())
+ switch (getType())
{
case VectorGraphicDataType::Svg:
{
@@ -309,7 +309,7 @@ VectorGraphicData::VectorGraphicData(
maSequence(),
maReplacement(),
mNestedBitmapSize(0),
- meVectorGraphicDataType(eVectorDataType),
+ meType(eVectorDataType),
mnPageIndex(nPageIndex)
{
}
@@ -322,7 +322,7 @@ VectorGraphicData::VectorGraphicData(
maSequence(),
maReplacement(),
mNestedBitmapSize(0),
- meVectorGraphicDataType(eVectorDataType),
+ meType(eVectorDataType),
mnPageIndex(-1)
{
SvFileStream rIStm(rPath, StreamMode::STD_READ);
diff --git a/vcl/source/graphic/GraphicID.cxx b/vcl/source/graphic/GraphicID.cxx
index cfd2d751d246..f2a9afa60dbe 100644
--- a/vcl/source/graphic/GraphicID.cxx
+++ b/vcl/source/graphic/GraphicID.cxx
@@ -36,7 +36,7 @@ GraphicID::GraphicID(ImpGraphic const& rGraphic)
{
const basegfx::B2DRange& rRange = rVectorGraphicDataPtr->getRange();
- mnID1 |= rVectorGraphicDataPtr->getVectorGraphicDataArrayLength();
+ mnID1 |= rVectorGraphicDataPtr->getBinaryDataContainer().getSize();
mnID2 = basegfx::fround(rRange.getWidth());
mnID3 = basegfx::fround(rRange.getHeight());
mnID4 = vcl_get_checksum(0, rVectorGraphicDataPtr->getBinaryDataContainer().getData(),
diff --git a/vcl/source/graphic/VectorGraphicSearch.cxx b/vcl/source/graphic/VectorGraphicSearch.cxx
index 3c1003d29654..c5e04060bc1b 100644
--- a/vcl/source/graphic/VectorGraphicSearch.cxx
+++ b/vcl/source/graphic/VectorGraphicSearch.cxx
@@ -237,7 +237,7 @@ bool VectorGraphicSearch::search(OUString const& rSearchString,
{
auto pData = maGraphic.getVectorGraphicData();
- if (pData && pData->getVectorGraphicDataType() == VectorGraphicDataType::Pdf)
+ if (pData && pData->getType() == VectorGraphicDataType::Pdf)
{
if (searchPDF(pData))
{