[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 3 commits - include/vcl solenv/clang-format vcl/inc vcl/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Sun Apr 19 08:39:41 UTC 2020
include/vcl/GraphicNativeMetadata.hxx | 4 -
include/vcl/GraphicNativeTransform.hxx | 6 +-
solenv/clang-format/blacklist | 4 -
vcl/inc/impgraph.hxx | 11 ++-
vcl/source/filter/GraphicNativeMetadata.cxx | 15 ++---
vcl/source/filter/GraphicNativeTransform.cxx | 55 +++++++++----------
vcl/source/gdi/impgraph.cxx | 77 +++++++++++++--------------
vcl/source/graphic/Manager.cxx | 6 +-
8 files changed, 87 insertions(+), 91 deletions(-)
New commits:
commit 71075a45aa9c8c6a09fe14adbda48b3fb78e1690
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Apr 19 10:37:35 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sun Apr 19 10:37:35 2020 +0200
ImpGraphic: make magic bits for vector formats as constexpr
Change-Id: If0caaf76feebbdc0fb9b16a3adeecf0e3e9dc295
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index be5126188f17..568ab369991b 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -55,6 +55,15 @@
#define GRAPHIC_FORMAT_50 COMPAT_FORMAT( 'G', 'R', 'F', '5' )
#define NATIVE_FORMAT_50 COMPAT_FORMAT( 'N', 'A', 'T', '5' )
+namespace {
+
+constexpr sal_uInt32 constSvgMagic((sal_uInt32('s') << 24) | (sal_uInt32('v') << 16) | (sal_uInt32('g') << 8) | sal_uInt32('0'));
+constexpr sal_uInt32 constWmfMagic((sal_uInt32('w') << 24) | (sal_uInt32('m') << 16) | (sal_uInt32('f') << 8) | sal_uInt32('0'));
+constexpr sal_uInt32 constEmfMagic((sal_uInt32('e') << 24) | (sal_uInt32('m') << 16) | (sal_uInt32('f') << 8) | sal_uInt32('0'));
+constexpr sal_uInt32 constPdfMagic((sal_uInt32('s') << 24) | (sal_uInt32('v') << 16) | (sal_uInt32('g') << 8) | sal_uInt32('0'));
+
+}
+
using namespace com::sun::star;
struct ImpSwapFile
@@ -1699,16 +1708,12 @@ void ReadImpGraphic( SvStream& rIStm, ImpGraphic& rImpGraphic )
ErrCode nOrigError = rIStm.GetErrorCode();
// try to stream in Svg defining data (length, byte array and evtl. path)
// See below (operator<<) for more information
- const sal_uInt32 nSvgMagic((sal_uInt32('s') << 24) | (sal_uInt32('v') << 16) | (sal_uInt32('g') << 8) | sal_uInt32('0'));
- const sal_uInt32 nWmfMagic((sal_uInt32('w') << 24) | (sal_uInt32('m') << 16) | (sal_uInt32('f') << 8) | sal_uInt32('0'));
- const sal_uInt32 nEmfMagic((sal_uInt32('e') << 24) | (sal_uInt32('m') << 16) | (sal_uInt32('f') << 8) | sal_uInt32('0'));
- const sal_uInt32 nPdfMagic((sal_uInt32('s') << 24) | (sal_uInt32('v') << 16) | (sal_uInt32('g') << 8) | sal_uInt32('0'));
sal_uInt32 nMagic;
rIStm.Seek(nStmPos1);
rIStm.ResetError();
rIStm.ReadUInt32( nMagic );
- if (nSvgMagic == nMagic || nWmfMagic == nMagic || nEmfMagic == nMagic || nPdfMagic == nMagic)
+ if (constSvgMagic == nMagic || constWmfMagic == nMagic || constEmfMagic == nMagic || constPdfMagic == nMagic)
{
sal_uInt32 nVectorGraphicDataArrayLength(0);
rIStm.ReadUInt32(nVectorGraphicDataArrayLength);
@@ -1724,15 +1729,15 @@ void ReadImpGraphic( SvStream& rIStm, ImpGraphic& rImpGraphic )
{
VectorGraphicDataType aDataType(VectorGraphicDataType::Svg);
- if (nWmfMagic == nMagic)
+ if (constWmfMagic == nMagic)
{
aDataType = VectorGraphicDataType::Wmf;
}
- else if (nEmfMagic == nMagic)
+ else if (constEmfMagic == nMagic)
{
aDataType = VectorGraphicDataType::Emf;
}
- else if (nPdfMagic == nMagic)
+ else if (constPdfMagic == nMagic)
{
aDataType = VectorGraphicDataType::Pdf;
}
@@ -1807,26 +1812,22 @@ void WriteImpGraphic(SvStream& rOStm, const ImpGraphic& rImpGraphic)
{
case VectorGraphicDataType::Wmf:
{
- const sal_uInt32 nWmfMagic((sal_uInt32('w') << 24) | (sal_uInt32('m') << 16) | (sal_uInt32('f') << 8) | sal_uInt32('0'));
- rOStm.WriteUInt32(nWmfMagic);
+ rOStm.WriteUInt32(constWmfMagic);
break;
}
case VectorGraphicDataType::Emf:
{
- const sal_uInt32 nEmfMagic((sal_uInt32('e') << 24) | (sal_uInt32('m') << 16) | (sal_uInt32('f') << 8) | sal_uInt32('0'));
- rOStm.WriteUInt32(nEmfMagic);
+ rOStm.WriteUInt32(constEmfMagic);
break;
}
case VectorGraphicDataType::Svg:
{
- const sal_uInt32 nSvgMagic((sal_uInt32('s') << 24) | (sal_uInt32('v') << 16) | (sal_uInt32('g') << 8) | sal_uInt32('0'));
- rOStm.WriteUInt32(nSvgMagic);
+ rOStm.WriteUInt32(constSvgMagic);
break;
}
case VectorGraphicDataType::Pdf:
{
- const sal_uInt32 nSvgMagic((sal_uInt32('p') << 24) | (sal_uInt32('d') << 16) | (sal_uInt32('f') << 8) | sal_uInt32('0'));
- rOStm.WriteUInt32(nSvgMagic);
+ rOStm.WriteUInt32(constPdfMagic);
break;
}
}
commit 30b21b5579f5b9f10bf3ec3e3e24c12dfacb7bba
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Apr 18 21:40:12 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Sat Apr 18 21:40:12 2020 +0200
remove Impl from swap method names in ImpGraphic
Change-Id: Ie235b6d02582d4d5ee3dc3d9d2be7f022bcb13c4
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 8fa1df9b82fc..8dc3e21de640 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -175,13 +175,14 @@ private:
bool ImplReadEmbedded( SvStream& rIStream );
bool ImplWriteEmbedded( SvStream& rOStream );
- bool ImplSwapIn();
- bool ImplSwapIn( SvStream* pIStm );
+ bool swapIn();
+ bool swapInFromStream(SvStream* pIStm);
- bool ImplSwapOut();
- bool ImplSwapOut( SvStream* pOStm );
+ bool swapOut();
+ bool swapOutToStream(SvStream* pOStm);
+
+ bool isSwappedOut() const { return mbSwapOut;}
- bool ImplIsSwapOut() const { return mbSwapOut;}
bool ImplIsDummyContext() const { return mbDummyContext; }
void ImplSetLink( const std::shared_ptr<GfxLink>& );
std::shared_ptr<GfxLink> ImplGetSharedGfxLink() const;
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 6ea0685e4943..be5126188f17 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -329,7 +329,7 @@ const std::shared_ptr<VectorGraphicData>& ImpGraphic::getVectorGraphicData() con
void ImpGraphic::ImplCreateSwapInfo()
{
- if (!ImplIsSwapOut())
+ if (!isSwappedOut())
{
maSwapInfo.maPrefMapMode = ImplGetPrefMapMode();
maSwapInfo.maPrefSize = ImplGetPrefSize();
@@ -736,7 +736,7 @@ Size ImpGraphic::ImplGetSizePixel() const
{
Size aSize;
- if (ImplIsSwapOut())
+ if (isSwappedOut())
aSize = maSwapInfo.maSizePixel;
else
aSize = ImplGetBitmapEx(GraphicConversionParameters()).GetSizePixel();
@@ -748,7 +748,7 @@ Size ImpGraphic::ImplGetPrefSize() const
{
Size aSize;
- if (ImplIsSwapOut())
+ if (isSwappedOut())
{
aSize = maSwapInfo.maPrefSize;
}
@@ -846,7 +846,7 @@ MapMode ImpGraphic::ImplGetPrefMapMode() const
{
MapMode aMapMode;
- if (ImplIsSwapOut())
+ if (isSwappedOut())
{
aMapMode = maSwapInfo.maPrefMapMode;
}
@@ -962,7 +962,7 @@ sal_uLong ImpGraphic::ImplGetSizeBytes() const
void ImpGraphic::ImplDraw( OutputDevice* pOutDev, const Point& rDestPt ) const
{
ensureAvailable();
- if( ImplIsSupportedGraphic() && !ImplIsSwapOut() )
+ if( ImplIsSupportedGraphic() && !isSwappedOut() )
{
switch( meType )
{
@@ -999,7 +999,7 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev,
const Point& rDestPt, const Size& rDestSize ) const
{
ensureAvailable();
- if( ImplIsSupportedGraphic() && !ImplIsSwapOut() )
+ if( ImplIsSupportedGraphic() && !isSwappedOut() )
{
switch( meType )
{
@@ -1042,7 +1042,7 @@ void ImpGraphic::ImplStartAnimation( OutputDevice* pOutDev, const Point& rDestPt
{
ensureAvailable();
- if( ImplIsSupportedGraphic() && !ImplIsSwapOut() && mpAnimation )
+ if( ImplIsSupportedGraphic() && !isSwappedOut() && mpAnimation )
mpAnimation->Start( pOutDev, rDestPt, rDestSize, nExtraData, pFirstFrameOutDev );
}
@@ -1050,7 +1050,7 @@ void ImpGraphic::ImplStopAnimation( OutputDevice* pOutDev, long nExtraData )
{
ensureAvailable();
- if( ImplIsSupportedGraphic() && !ImplIsSwapOut() && mpAnimation )
+ if( ImplIsSupportedGraphic() && !isSwappedOut() && mpAnimation )
mpAnimation->Stop( pOutDev, nExtraData );
}
@@ -1228,7 +1228,7 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
ensureAvailable();
- if( ( meType != GraphicType::NONE ) && ( meType != GraphicType::Default ) && !ImplIsSwapOut() )
+ if( ( meType != GraphicType::NONE ) && ( meType != GraphicType::Default ) && !isSwappedOut() )
{
const MapMode aMapMode( ImplGetPrefMapMode() );
const Size aSize( ImplGetPrefSize() );
@@ -1300,11 +1300,11 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
return bRet;
}
-bool ImpGraphic::ImplSwapOut()
+bool ImpGraphic::swapOut()
{
bool bRet = false;
- if( !ImplIsSwapOut() )
+ if (!isSwappedOut())
{
::utl::TempFile aTempFile;
const INetURLObject aTmpURL( aTempFile.GetURL() );
@@ -1324,7 +1324,7 @@ bool ImpGraphic::ImplSwapOut()
xOStm->SetVersion( SOFFICE_FILEFORMAT_50 );
xOStm->SetCompressMode( SvStreamCompressFlags::NATIVE );
- bRet = ImplSwapOut( xOStm.get() );
+ bRet = swapOutToStream(xOStm.get());
if( bRet )
{
mpSwapFile = std::make_unique<ImpSwapFile>();
@@ -1345,7 +1345,7 @@ bool ImpGraphic::ImplSwapOut()
return bRet;
}
-bool ImpGraphic::ImplSwapOut( SvStream* xOStm )
+bool ImpGraphic::swapOutToStream(SvStream* xOStm)
{
bool bRet = false;
@@ -1377,8 +1377,8 @@ bool ImpGraphic::ensureAvailable() const
{
auto pThis = const_cast<ImpGraphic*>(this);
- if (ImplIsSwapOut())
- return pThis->ImplSwapIn();
+ if (isSwappedOut())
+ return pThis->swapIn();
pThis->maLastUsed = std::chrono::high_resolution_clock::now();
return true;
@@ -1408,11 +1408,11 @@ bool ImpGraphic::loadPrepared()
return false;
}
-bool ImpGraphic::ImplSwapIn()
+bool ImpGraphic::swapIn()
{
bool bRet = false;
- if (!ImplIsSwapOut())
+ if (!isSwappedOut())
return bRet;
if (mbPrepared)
@@ -1442,7 +1442,7 @@ bool ImpGraphic::ImplSwapIn()
xIStm->SetVersion( SOFFICE_FILEFORMAT_50 );
xIStm->SetCompressMode( SvStreamCompressFlags::NATIVE );
- bRet = ImplSwapIn( xIStm.get() );
+ bRet = swapInFromStream(xIStm.get());
xIStm.reset();
if (mpSwapFile)
setOriginURL(mpSwapFile->maOriginURL);
@@ -1457,7 +1457,7 @@ bool ImpGraphic::ImplSwapIn()
return bRet;
}
-bool ImpGraphic::ImplSwapIn( SvStream* xIStm )
+bool ImpGraphic::swapInFromStream(SvStream* xIStm)
{
bool bRet = false;
@@ -1531,7 +1531,7 @@ BitmapChecksum ImpGraphic::ImplGetChecksum() const
ensureAvailable();
- if( ImplIsSupportedGraphic() && !ImplIsSwapOut() )
+ if( ImplIsSupportedGraphic() && !isSwappedOut() )
{
switch( meType )
{
@@ -1567,7 +1567,7 @@ bool ImpGraphic::ImplExportNative( SvStream& rOStm ) const
if( !rOStm.GetError() )
{
- if( !ImplIsSwapOut() )
+ if( !isSwappedOut() )
{
if( mpGfxLink && mpGfxLink->IsNative() )
bResult = mpGfxLink->ExportNative( rOStm );
@@ -1761,7 +1761,7 @@ void WriteImpGraphic(SvStream& rOStm, const ImpGraphic& rImpGraphic)
rImpGraphic.ensureAvailable();
- if (rImpGraphic.ImplIsSwapOut())
+ if (rImpGraphic.isSwappedOut())
{
rOStm.SetError( SVSTREAM_GENERALERROR );
return;
diff --git a/vcl/source/graphic/Manager.cxx b/vcl/source/graphic/Manager.cxx
index b019d5adceaa..65e81fc1e605 100644
--- a/vcl/source/graphic/Manager.cxx
+++ b/vcl/source/graphic/Manager.cxx
@@ -93,7 +93,7 @@ void Manager::reduceGraphicMemory()
return;
sal_Int64 nCurrentGraphicSize = getGraphicSizeBytes(pEachImpGraphic);
- if (!pEachImpGraphic->ImplIsSwapOut() && nCurrentGraphicSize > 1000000)
+ if (!pEachImpGraphic->isSwappedOut() && nCurrentGraphicSize > 1000000)
{
if (!pEachImpGraphic->mpContext)
{
@@ -102,7 +102,7 @@ void Manager::reduceGraphicMemory()
auto aSeconds = std::chrono::duration_cast<std::chrono::seconds>(aDeltaTime);
if (aSeconds > mnAllowedIdleTime)
- pEachImpGraphic->ImplSwapOut();
+ pEachImpGraphic->swapOut();
}
}
}
@@ -141,7 +141,7 @@ void Manager::registerGraphic(const std::shared_ptr<ImpGraphic>& pImpGraphic,
sal_Int64 calculatedSize = 0;
for (ImpGraphic* pEachImpGraphic : m_pImpGraphicList)
{
- if (!pEachImpGraphic->ImplIsSwapOut())
+ if (!pEachImpGraphic->isSwappedOut())
{
calculatedSize += getGraphicSizeBytes(pEachImpGraphic);
}
commit 85b5e7ba39eea9503e6adcbf324e8cea80318988
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Apr 15 22:05:33 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed Apr 15 22:05:33 2020 +0200
remove GraphicNative{Metadata,Transform} from clang-f. blacklist
Change-Id: Ib60485e5d35e9d3ec2b0028d38fb8d5eaa72421c
diff --git a/include/vcl/GraphicNativeMetadata.hxx b/include/vcl/GraphicNativeMetadata.hxx
index 118efa480df8..318fb724bf25 100644
--- a/include/vcl/GraphicNativeMetadata.hxx
+++ b/include/vcl/GraphicNativeMetadata.hxx
@@ -29,8 +29,8 @@ public:
GraphicNativeMetadata();
~GraphicNativeMetadata();
- bool read(Graphic const & rGraphic);
- sal_uInt16 getRotation() const { return mRotation;}
+ bool read(Graphic const& rGraphic);
+ sal_uInt16 getRotation() const { return mRotation; }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/GraphicNativeTransform.hxx b/include/vcl/GraphicNativeTransform.hxx
index 318327bf5b66..b4d71f2d53d0 100644
--- a/include/vcl/GraphicNativeTransform.hxx
+++ b/include/vcl/GraphicNativeTransform.hxx
@@ -29,9 +29,9 @@ class VCL_DLLPUBLIC GraphicNativeTransform final
{
Graphic& mrGraphic;
- bool rotateBitmapOnly (sal_uInt16 aRotation);
- void rotateJPEG (sal_uInt16 aRotation);
- bool rotateGeneric (sal_uInt16 aRotation, const OUString& aType);
+ bool rotateBitmapOnly(sal_uInt16 aRotation);
+ void rotateJPEG(sal_uInt16 aRotation);
+ bool rotateGeneric(sal_uInt16 aRotation, const OUString& aType);
public:
GraphicNativeTransform(Graphic& rGraphic);
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index d92622eb77a1..92094ca31d95 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -7333,8 +7333,6 @@ include/vcl/BitmapTools.hxx
include/vcl/ColorMask.hxx
include/vcl/EnumContext.hxx
include/vcl/FilterConfigItem.hxx
-include/vcl/GraphicNativeMetadata.hxx
-include/vcl/GraphicNativeTransform.hxx
include/vcl/GraphicObject.hxx
include/vcl/IContext.hxx
include/vcl/IDialogRenderable.hxx
@@ -17165,8 +17163,6 @@ vcl/source/edit/xtextedt.cxx
vcl/source/filter/FilterConfigCache.cxx
vcl/source/filter/FilterConfigCache.hxx
vcl/source/filter/FilterConfigItem.cxx
-vcl/source/filter/GraphicNativeMetadata.cxx
-vcl/source/filter/GraphicNativeTransform.cxx
vcl/source/filter/graphicfilter.cxx
vcl/source/filter/graphicfilter2.cxx
vcl/source/filter/graphicfilter_internal.hxx
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;
}
}
More information about the Libreoffice-commits
mailing list