summaryrefslogtreecommitdiff
path: root/vcl/source/filter
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-04-15 22:05:33 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-04-26 07:34:40 +0200
commit082b8718dfc70a7994990215f1dc51a69046788b (patch)
tree7b12df058f2196664268bfc09d6359d16757f59a /vcl/source/filter
parent6e89344e19715caa39a1f78cf4ba71c67af9f2e4 (diff)
remove GraphicNative{Metadata,Transform} from clang-f. blacklist
Change-Id: Ib60485e5d35e9d3ec2b0028d38fb8d5eaa72421c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92905 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/source/filter')
-rw-r--r--vcl/source/filter/GraphicNativeMetadata.cxx15
-rw-r--r--vcl/source/filter/GraphicNativeTransform.cxx55
2 files changed, 34 insertions, 36 deletions
diff --git a/vcl/source/filter/GraphicNativeMetadata.cxx b/vcl/source/filter/GraphicNativeMetadata.cxx
index e42669d3c4aa..132a51a52391 100644
--- a/vcl/source/filter/GraphicNativeMetadata.cxx
+++ b/vcl/source/filter/GraphicNativeMetadata.cxx
@@ -25,18 +25,17 @@
#include "jpeg/Exif.hxx"
#include <memory>
-GraphicNativeMetadata::GraphicNativeMetadata() :
- mRotation(0)
-{}
-
-GraphicNativeMetadata::~GraphicNativeMetadata()
-{}
+GraphicNativeMetadata::GraphicNativeMetadata()
+ : mRotation(0)
+{
+}
+GraphicNativeMetadata::~GraphicNativeMetadata() {}
-bool GraphicNativeMetadata::read(Graphic const & rGraphic)
+bool GraphicNativeMetadata::read(Graphic const& rGraphic)
{
GfxLink aLink = rGraphic.GetGfxLink();
- if ( aLink.GetType() != GfxLinkType::NativeJpg )
+ if (aLink.GetType() != GfxLinkType::NativeJpg)
return false;
sal_uInt32 aDataSize = aLink.GetDataSize();
diff --git a/vcl/source/filter/GraphicNativeTransform.cxx b/vcl/source/filter/GraphicNativeTransform.cxx
index ba6e6a194f63..8083dd4c2e77 100644
--- a/vcl/source/filter/GraphicNativeTransform.cxx
+++ b/vcl/source/filter/GraphicNativeTransform.cxx
@@ -30,12 +30,12 @@
using namespace ::exif;
-GraphicNativeTransform::GraphicNativeTransform(Graphic& rGraphic) :
- mrGraphic(rGraphic)
-{}
+GraphicNativeTransform::GraphicNativeTransform(Graphic& rGraphic)
+ : mrGraphic(rGraphic)
+{
+}
-GraphicNativeTransform::~GraphicNativeTransform()
-{}
+GraphicNativeTransform::~GraphicNativeTransform() {}
void GraphicNativeTransform::rotate(sal_uInt16 aInputRotation)
{
@@ -52,19 +52,19 @@ void GraphicNativeTransform::rotate(sal_uInt16 aInputRotation)
}
GfxLink aLink = mrGraphic.GetGfxLink();
- if ( aLink.GetType() == GfxLinkType::NativeJpg )
+ if (aLink.GetType() == GfxLinkType::NativeJpg)
{
rotateJPEG(aRotation);
}
- else if ( aLink.GetType() == GfxLinkType::NativePng )
+ else if (aLink.GetType() == GfxLinkType::NativePng)
{
rotateGeneric(aRotation, "png");
}
- else if ( aLink.GetType() == GfxLinkType::NativeGif )
+ else if (aLink.GetType() == GfxLinkType::NativeGif)
{
rotateGeneric(aRotation, "gif");
}
- else if ( aLink.GetType() == GfxLinkType::NONE )
+ else if (aLink.GetType() == GfxLinkType::NONE)
{
rotateBitmapOnly(aRotation);
}
@@ -96,24 +96,24 @@ bool GraphicNativeTransform::rotateGeneric(sal_uInt16 aRotation, const OUString&
GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
- css::uno::Sequence< css::beans::PropertyValue > aFilterData( 3 );
- aFilterData[ 0 ].Name = "Interlaced";
- aFilterData[ 0 ].Value <<= sal_Int32(0);
- aFilterData[ 1 ].Name = "Compression";
- aFilterData[ 1 ].Value <<= sal_Int32(9);
- aFilterData[ 2 ].Name = "Quality";
- aFilterData[ 2 ].Value <<= sal_Int32(90);
+ css::uno::Sequence<css::beans::PropertyValue> aFilterData(3);
+ aFilterData[0].Name = "Interlaced";
+ aFilterData[0].Value <<= sal_Int32(0);
+ aFilterData[1].Name = "Compression";
+ aFilterData[1].Value <<= sal_Int32(9);
+ aFilterData[2].Name = "Quality";
+ aFilterData[2].Value <<= sal_Int32(90);
- sal_uInt16 nFilterFormat = rFilter.GetExportFormatNumberForShortName( aType );
+ sal_uInt16 nFilterFormat = rFilter.GetExportFormatNumberForShortName(aType);
BitmapEx aBitmap = mrGraphic.GetBitmapEx();
aBitmap.Rotate(aRotation, COL_BLACK);
- rFilter.ExportGraphic( aBitmap, "none", aStream, nFilterFormat, &aFilterData );
+ rFilter.ExportGraphic(aBitmap, "none", aStream, nFilterFormat, &aFilterData);
- aStream.Seek( STREAM_SEEK_TO_BEGIN );
+ aStream.Seek(STREAM_SEEK_TO_BEGIN);
Graphic aGraphic;
- rFilter.ImportGraphic( aGraphic, "import", aStream );
+ rFilter.ImportGraphic(aGraphic, "import", aStream);
mrGraphic = aGraphic;
return true;
@@ -123,8 +123,7 @@ void GraphicNativeTransform::rotateJPEG(sal_uInt16 aRotation)
{
BitmapEx aBitmap = mrGraphic.GetBitmapEx();
- if (aBitmap.GetSizePixel().Width() % 16 != 0 ||
- aBitmap.GetSizePixel().Height() % 16 != 0 )
+ if (aBitmap.GetSizePixel().Width() % 16 != 0 || aBitmap.GetSizePixel().Height() % 16 != 0)
{
rotateGeneric(aRotation, "png");
}
@@ -134,12 +133,12 @@ void GraphicNativeTransform::rotateJPEG(sal_uInt16 aRotation)
SvMemoryStream aSourceStream;
aSourceStream.WriteBytes(aLink.GetData(), aLink.GetDataSize());
- aSourceStream.Seek( STREAM_SEEK_TO_BEGIN );
+ aSourceStream.Seek(STREAM_SEEK_TO_BEGIN);
Orientation aOrientation = TOP_LEFT;
Exif exif;
- if ( exif.read(aSourceStream) )
+ if (exif.read(aSourceStream))
{
aOrientation = exif.getOrientation();
}
@@ -149,20 +148,20 @@ void GraphicNativeTransform::rotateJPEG(sal_uInt16 aRotation)
transform.setRotate(aRotation);
transform.perform();
- aTargetStream.Seek( STREAM_SEEK_TO_BEGIN );
+ aTargetStream.Seek(STREAM_SEEK_TO_BEGIN);
// Reset orientation in exif if needed
- if ( exif.hasExif() && aOrientation != TOP_LEFT)
+ if (exif.hasExif() && aOrientation != TOP_LEFT)
{
exif.setOrientation(TOP_LEFT);
exif.write(aTargetStream);
}
- aTargetStream.Seek( STREAM_SEEK_TO_BEGIN );
+ aTargetStream.Seek(STREAM_SEEK_TO_BEGIN);
Graphic aGraphic;
GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
- rFilter.ImportGraphic( aGraphic, "import", aTargetStream );
+ rFilter.ImportGraphic(aGraphic, "import", aTargetStream);
mrGraphic = aGraphic;
}
}