[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 35 commits - accessibility/source compilerplugins/clang cui/source dbaccess/source drawinglayer/CppunitTest_drawinglayer_border.mk drawinglayer/inc drawinglayer/Library_drawinglayercore.mk drawinglayer/Library_drawinglayer.mk drawinglayer/Module_drawinglayer.mk emfio/CppunitTest_emfio_emf_test.mk emfio/Library_emfio.mk extras/source filter/Library_svgfilter.mk helpcontent2 icon-themes/sukapura icon-themes/sukapura_svg include/drawinglayer include/sfx2 include/svtools include/vcl Makefile.in oox/source Repository.mk sc/CppunitTest_sc_ucalc.mk sc/Library_sc.mk sc/source sd/CppunitTest_sd_uimpress.mk sdext/source sd/Library_sd.mk sd/source sfx2/Library_sfx.mk sfx2/source solenv/clang-format solenv/gbuild svgio/CppunitTest_svgio.mk svgio/Library_svgio.mk svtools/inc svtools/source svx/CppunitTest_svx_unit.mk svx/Library_svxcore.mk svx/Library_svx.mk svx/source svx/uiconfig svx/UIConfig_svx.mk sw/CppunitTest_sw_uwriter.mk sw/inc sw/Li brary_sw.mk sw/Library_swui.mk sw/qa sw/source sw/uiconfig vcl/commonfuzzer.mk vcl/inc vcl/Library_vcl.mk vcl/skia vcl/source vcl/unx writerfilter/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 21 12:58:59 UTC 2020
Rebased ref, commits from common ancestor:
commit a966ac9476b714afd4cfd792620da82269d03b1d
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Apr 20 22:29:04 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Apr 21 12:22:31 2020 +0200
ImpGraphic: clean-up and simplify swapOut()
Change-Id: I3e578c3172fcea341a218798843cd750971a5af1
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index f96aacc23b8d..3db2a3fa68a8 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1320,44 +1320,46 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
bool ImpGraphic::swapOut()
{
-
- if( isSwappedOut() )
+ if (isSwappedOut())
return false;
- ::utl::TempFile aTempFile;
- const INetURLObject aTmpURL( aTempFile.GetURL() );
+ utl::TempFile aTempFile;
+ const INetURLObject aTempFileURL(aTempFile.GetURL());
+ OUString sTempFileURLString = aTempFileURL.GetMainURL(INetURLObject::DecodeMechanism::NONE);
- if( aTmpURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ).isEmpty() )
+ if (sTempFileURLString.isEmpty())
return false;
+ std::unique_ptr<SvStream> xOutputStream;
- std::unique_ptr<SvStream> xOStm;
try
{
- xOStm = ::utl::UcbStreamHelper::CreateStream( aTmpURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE );
+ xOutputStream = utl::UcbStreamHelper::CreateStream(sTempFileURLString, StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE);
}
- catch( const css::uno::Exception& )
+ catch (const css::uno::Exception&)
{
}
- if( !xOStm )
+
+ if (!xOutputStream)
return false;
+ xOutputStream->SetVersion(SOFFICE_FILEFORMAT_50);
+ xOutputStream->SetCompressMode(SvStreamCompressFlags::NATIVE);
- xOStm->SetVersion( SOFFICE_FILEFORMAT_50 );
- xOStm->SetCompressMode( SvStreamCompressFlags::NATIVE );
+ bool bResult = swapOutToStream(xOutputStream.get());
- bool bRet = swapOutToStream( xOStm.get() );
- if( bRet )
+ if (bResult)
{
- mpSwapFile = std::make_shared<ImpSwapFile>(aTmpURL, getOriginURL());
+ mpSwapFile = std::make_unique<ImpSwapFile>(aTempFileURL, getOriginURL());
}
else
{
- xOStm.reset();
- utl::UCBContentHelper::Kill(aTmpURL.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+ xOutputStream.reset();
+ utl::UCBContentHelper::Kill(sTempFileURLString);
}
- if (bRet)
+ if (bResult)
vcl::graphic::Manager::get().swappedOut(this);
- return bRet;
+
+ return bResult;
}
bool ImpGraphic::swapOutToStream(SvStream* xOStm)
commit bcb0bae53b45e6bc54cb1d11cf0b122b156eb40f
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Apr 20 22:17:01 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Apr 21 12:22:31 2020 +0200
ImpGraphic: encapsulate members of ImpSwapFile
Change-Id: I882d30f2f27149c865160b3fa68fa974701cea71
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 92dd0c078519..fd9ae31d358c 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -42,7 +42,7 @@ struct ImpSwapInfo
class OutputDevice;
class GfxLink;
-struct ImpSwapFile;
+class ImpSwapFile;
class GraphicConversionParameters;
class ImpGraphic;
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 1cd351b0a7a4..f96aacc23b8d 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -66,15 +66,26 @@ constexpr sal_uInt32 constPdfMagic((sal_uInt32('s') << 24) | (sal_uInt32('v') <<
using namespace com::sun::star;
-struct ImpSwapFile
+class ImpSwapFile
{
- INetURLObject aSwapURL;
+private:
+ INetURLObject maSwapURL;
OUString maOriginURL;
+public:
+ ImpSwapFile(INetURLObject const & aSwapURL, OUString const & rOriginURL)
+ : maSwapURL(aSwapURL)
+ , maOriginURL(rOriginURL)
+ {
+ }
+
~ImpSwapFile() COVERITY_NOEXCEPT_FALSE
{
- utl::UCBContentHelper::Kill(aSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+ utl::UCBContentHelper::Kill(maSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE));
}
+
+ INetURLObject getSwapURL() { return maSwapURL; }
+ OUString const & getOriginURL() { return maOriginURL; }
};
ImpGraphic::ImpGraphic() :
@@ -1336,9 +1347,7 @@ bool ImpGraphic::swapOut()
bool bRet = swapOutToStream( xOStm.get() );
if( bRet )
{
- mpSwapFile = std::make_shared<ImpSwapFile>();
- mpSwapFile->aSwapURL = aTmpURL;
- mpSwapFile->maOriginURL = getOriginURL();
+ mpSwapFile = std::make_shared<ImpSwapFile>(aTmpURL, getOriginURL());
}
else
{
@@ -1428,7 +1437,7 @@ bool ImpGraphic::swapIn()
OUString aSwapURL;
if( mpSwapFile )
- aSwapURL = mpSwapFile->aSwapURL.GetMainURL( INetURLObject::DecodeMechanism::NONE );
+ aSwapURL = mpSwapFile->getSwapURL().GetMainURL( INetURLObject::DecodeMechanism::NONE );
if( !aSwapURL.isEmpty() )
{
@@ -1449,7 +1458,7 @@ bool ImpGraphic::swapIn()
bRet = swapInFromStream(xIStm.get());
xIStm.reset();
if (mpSwapFile)
- setOriginURL(mpSwapFile->maOriginURL);
+ setOriginURL(mpSwapFile->getOriginURL());
mpSwapFile.reset();
}
}
commit 80e169395c59fa92dc4504942929d08d92f23866
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Apr 20 22:07:58 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Apr 21 12:22:31 2020 +0200
ImpGraphic: put ImpSwapFile destructor into the class body
Change-Id: Ia3f7c29bf7b84dfa8d5cc044269ed51e09c9f1a3
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index b02caf0b3d38..1cd351b0a7a4 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -70,7 +70,11 @@ struct ImpSwapFile
{
INetURLObject aSwapURL;
OUString maOriginURL;
- ~ImpSwapFile() COVERITY_NOEXCEPT_FALSE;
+
+ ~ImpSwapFile() COVERITY_NOEXCEPT_FALSE
+ {
+ utl::UCBContentHelper::Kill(aSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+ }
};
ImpGraphic::ImpGraphic() :
@@ -359,11 +363,6 @@ void ImpGraphic::ImplClearGraphics()
maVectorGraphicData.reset();
}
-ImpSwapFile::~ImpSwapFile() COVERITY_NOEXCEPT_FALSE
-{
- utl::UCBContentHelper::Kill(aSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE));
-}
-
void ImpGraphic::ImplSetPrepared(bool bAnimated, const Size* pSizeHint)
{
mbPrepared = true;
commit 283a530b1b95ec2db4d1896f84fa3553ad505cbf
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Apr 19 10:45:11 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Apr 21 12:22:31 2020 +0200
ImpGraphic: rename maEx to maBitmapEx
Change-Id: I49dd552010d008cc486c6aaf51e226cc5bf4a1cb
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 8dc3e21de640..92dd0c078519 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -55,7 +55,7 @@ class ImpGraphic final
private:
GDIMetaFile maMetaFile;
- BitmapEx maEx;
+ BitmapEx maBitmapEx;
/// If maEx is empty, this preferred size will be set on it when it gets initialized.
Size maExPrefSize;
ImpSwapInfo maSwapInfo;
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 7485622e4897..b02caf0b3d38 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -85,7 +85,7 @@ ImpGraphic::ImpGraphic() :
ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic)
: maMetaFile(rImpGraphic.maMetaFile)
- , maEx(rImpGraphic.maEx)
+ , maBitmapEx(rImpGraphic.maBitmapEx)
, maSwapInfo(rImpGraphic.maSwapInfo)
, mpContext(rImpGraphic.mpContext)
, mpSwapFile(rImpGraphic.mpSwapFile)
@@ -102,13 +102,13 @@ ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic)
if( rImpGraphic.mpAnimation )
{
mpAnimation = std::make_unique<Animation>( *rImpGraphic.mpAnimation );
- maEx = mpAnimation->GetBitmapEx();
+ maBitmapEx = mpAnimation->GetBitmapEx();
}
}
ImpGraphic::ImpGraphic(ImpGraphic&& rImpGraphic) noexcept
: maMetaFile(std::move(rImpGraphic.maMetaFile))
- , maEx(std::move(rImpGraphic.maEx))
+ , maBitmapEx(std::move(rImpGraphic.maBitmapEx))
, maSwapInfo(std::move(rImpGraphic.maSwapInfo))
, mpAnimation(std::move(rImpGraphic.mpAnimation))
, mpContext(std::move(rImpGraphic.mpContext))
@@ -139,7 +139,7 @@ ImpGraphic::ImpGraphic(GraphicExternalLink const & rGraphicExternalLink) :
}
ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) :
- maEx ( rBitmap ),
+ maBitmapEx ( rBitmap ),
meType ( !rBitmap.IsEmpty() ? GraphicType::Bitmap : GraphicType::NONE ),
mnSizeBytes ( 0 ),
mbSwapOut ( false ),
@@ -150,7 +150,7 @@ ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) :
}
ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) :
- maEx ( rBitmapEx ),
+ maBitmapEx ( rBitmapEx ),
meType ( !rBitmapEx.IsEmpty() ? GraphicType::Bitmap : GraphicType::NONE ),
mnSizeBytes ( 0 ),
mbSwapOut ( false ),
@@ -172,7 +172,7 @@ ImpGraphic::ImpGraphic(const std::shared_ptr<VectorGraphicData>& rVectorGraphicD
}
ImpGraphic::ImpGraphic( const Animation& rAnimation ) :
- maEx ( rAnimation.GetBitmapEx() ),
+ maBitmapEx ( rAnimation.GetBitmapEx() ),
mpAnimation ( std::make_unique<Animation>( rAnimation ) ),
meType ( GraphicType::Bitmap ),
mnSizeBytes ( 0 ),
@@ -219,11 +219,11 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic )
if ( rImpGraphic.mpAnimation )
{
mpAnimation = std::make_unique<Animation>( *rImpGraphic.mpAnimation );
- maEx = mpAnimation->GetBitmapEx();
+ maBitmapEx = mpAnimation->GetBitmapEx();
}
else
{
- maEx = rImpGraphic.maEx;
+ maBitmapEx = rImpGraphic.maBitmapEx;
}
mbSwapOut = rImpGraphic.mbSwapOut;
@@ -252,7 +252,7 @@ ImpGraphic& ImpGraphic::operator=(ImpGraphic&& rImpGraphic)
mpContext = std::move(rImpGraphic.mpContext);
mbDummyContext = rImpGraphic.mbDummyContext;
mpAnimation = std::move(rImpGraphic.mpAnimation);
- maEx = std::move(rImpGraphic.maEx);
+ maBitmapEx = std::move(rImpGraphic.maBitmapEx);
mbSwapOut = rImpGraphic.mbSwapOut;
mpSwapFile = std::move(rImpGraphic.mpSwapFile);
mpGfxLink = std::move(rImpGraphic.mpGfxLink);
@@ -314,7 +314,7 @@ bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
if( rImpGraphic.mpAnimation && ( *rImpGraphic.mpAnimation == *mpAnimation ) )
bRet = true;
}
- else if( !rImpGraphic.mpAnimation && ( rImpGraphic.maEx == maEx ) )
+ else if( !rImpGraphic.mpAnimation && ( rImpGraphic.maBitmapEx == maBitmapEx ) )
{
bRet = true;
}
@@ -352,7 +352,7 @@ void ImpGraphic::ImplCreateSwapInfo()
void ImpGraphic::ImplClearGraphics()
{
- maEx.Clear();
+ maBitmapEx.Clear();
maMetaFile.Clear();
mpAnimation.reset();
mpGfxLink.reset();
@@ -448,7 +448,7 @@ bool ImpGraphic::ImplIsTransparent() const
}
else if (meType == GraphicType::Bitmap && !maVectorGraphicData.get())
{
- bRet = mpAnimation ? mpAnimation->IsTransparent() : maEx.IsTransparent();
+ bRet = mpAnimation ? mpAnimation->IsTransparent() : maBitmapEx.IsTransparent();
}
return bRet;
@@ -468,7 +468,7 @@ bool ImpGraphic::ImplIsAlpha() const
}
else if (meType == GraphicType::Bitmap)
{
- bRet = (nullptr == mpAnimation && maEx.IsAlpha());
+ bRet = (nullptr == mpAnimation && maBitmapEx.IsAlpha());
}
return bRet;
@@ -519,13 +519,13 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters)
if( meType == GraphicType::Bitmap )
{
- if(maVectorGraphicData.get() && maEx.IsEmpty())
+ if(maVectorGraphicData.get() && maBitmapEx.IsEmpty())
{
- // use maEx as local buffer for rendered svg
- const_cast< ImpGraphic* >(this)->maEx = getVectorGraphicReplacement();
+ // use maBitmapEx as local buffer for rendered svg
+ const_cast< ImpGraphic* >(this)->maBitmapEx = getVectorGraphicReplacement();
}
- const BitmapEx& rRetBmpEx = ( mpAnimation ? mpAnimation->GetBitmapEx() : maEx );
+ const BitmapEx& rRetBmpEx = ( mpAnimation ? mpAnimation->GetBitmapEx() : maBitmapEx );
aRetBmp = rRetBmpEx.GetBitmap( COL_WHITE );
@@ -534,7 +534,7 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters)
}
else if( ( meType != GraphicType::Default ) && ImplIsSupportedGraphic() )
{
- if(maEx.IsEmpty())
+ if(maBitmapEx.IsEmpty())
{
// calculate size
ScopedVclPtrInstance< VirtualDevice > aVDev;
@@ -603,12 +603,12 @@ Bitmap ImpGraphic::ImplGetBitmap(const GraphicConversionParameters& rParameters)
ImplDraw( aVDev.get(), Point(), aDrawSize );
- // use maEx as local buffer for rendered metafile
- const_cast< ImpGraphic* >(this)->maEx = aVDev->GetBitmapEx( Point(), aVDev->GetOutputSizePixel() );
+ // use maBitmapEx as local buffer for rendered metafile
+ const_cast< ImpGraphic* >(this)->maBitmapEx = aVDev->GetBitmapEx( Point(), aVDev->GetOutputSizePixel() );
}
}
- aRetBmp = maEx.GetBitmap();
+ aRetBmp = maBitmapEx.GetBitmap();
}
if( !!aRetBmp )
@@ -628,13 +628,13 @@ BitmapEx ImpGraphic::ImplGetBitmapEx(const GraphicConversionParameters& rParamet
if( meType == GraphicType::Bitmap )
{
- if(maVectorGraphicData.get() && maEx.IsEmpty())
+ if(maVectorGraphicData.get() && maBitmapEx.IsEmpty())
{
- // use maEx as local buffer for rendered svg
- const_cast< ImpGraphic* >(this)->maEx = getVectorGraphicReplacement();
+ // use maBitmapEx as local buffer for rendered svg
+ const_cast< ImpGraphic* >(this)->maBitmapEx = getVectorGraphicReplacement();
}
- aRetBmpEx = ( mpAnimation ? mpAnimation->GetBitmapEx() : maEx );
+ aRetBmpEx = ( mpAnimation ? mpAnimation->GetBitmapEx() : maBitmapEx );
if(rParameters.getSizePixel().Width() || rParameters.getSizePixel().Height())
{
@@ -645,15 +645,15 @@ BitmapEx ImpGraphic::ImplGetBitmapEx(const GraphicConversionParameters& rParamet
}
else if( ( meType != GraphicType::Default ) && ImplIsSupportedGraphic() )
{
- if(maEx.IsEmpty())
+ if(maBitmapEx.IsEmpty())
{
const ImpGraphic aMonoMask( maMetaFile.GetMonochromeMtf( COL_BLACK ) );
- // use maEx as local buffer for rendered metafile
- const_cast< ImpGraphic* >(this)->maEx = BitmapEx(ImplGetBitmap(rParameters), aMonoMask.ImplGetBitmap(rParameters));
+ // use maBitmapEx as local buffer for rendered metafile
+ const_cast< ImpGraphic* >(this)->maBitmapEx = BitmapEx(ImplGetBitmap(rParameters), aMonoMask.ImplGetBitmap(rParameters));
}
- aRetBmpEx = maEx;
+ aRetBmpEx = maBitmapEx;
}
return aRetBmpEx;
@@ -673,7 +673,7 @@ Animation ImpGraphic::ImplGetAnimation() const
const BitmapEx& ImpGraphic::ImplGetBitmapExRef() const
{
ensureAvailable();
- return maEx;
+ return maBitmapEx;
}
const GDIMetaFile& ImpGraphic::ImplGetGDIMetaFile() const
@@ -715,27 +715,27 @@ const GDIMetaFile& ImpGraphic::ImplGetGDIMetaFile() const
// survive copying (change this if not wanted)
ImpGraphic* pThat = const_cast< ImpGraphic* >(this);
- if(maVectorGraphicData.get() && !maEx)
+ if(maVectorGraphicData.get() && !maBitmapEx)
{
- // use maEx as local buffer for rendered svg
- pThat->maEx = getVectorGraphicReplacement();
+ // use maBitmapEx as local buffer for rendered svg
+ pThat->maBitmapEx = getVectorGraphicReplacement();
}
// #123983# directly create a metafile with the same PrefSize and PrefMapMode
// the bitmap has, this will be an always correct metafile
- if(maEx.IsTransparent())
+ if(maBitmapEx.IsTransparent())
{
- pThat->maMetaFile.AddAction(new MetaBmpExScaleAction(Point(), maEx.GetPrefSize(), maEx));
+ pThat->maMetaFile.AddAction(new MetaBmpExScaleAction(Point(), maBitmapEx.GetPrefSize(), maBitmapEx));
}
else
{
- pThat->maMetaFile.AddAction(new MetaBmpScaleAction(Point(), maEx.GetPrefSize(), maEx.GetBitmap()));
+ pThat->maMetaFile.AddAction(new MetaBmpScaleAction(Point(), maBitmapEx.GetPrefSize(), maBitmapEx.GetBitmap()));
}
pThat->maMetaFile.Stop();
pThat->maMetaFile.WindStart();
- pThat->maMetaFile.SetPrefSize(maEx.GetPrefSize());
- pThat->maMetaFile.SetPrefMapMode(maEx.GetPrefMapMode());
+ pThat->maMetaFile.SetPrefSize(maBitmapEx.GetPrefSize());
+ pThat->maMetaFile.SetPrefMapMode(maBitmapEx.GetPrefMapMode());
}
return maMetaFile;
@@ -771,11 +771,11 @@ Size ImpGraphic::ImplGetPrefSize() const
case GraphicType::Bitmap:
{
- if(maVectorGraphicData.get() && maEx.IsEmpty())
+ if(maVectorGraphicData.get() && maBitmapEx.IsEmpty())
{
if (!maExPrefSize.getWidth() || !maExPrefSize.getHeight())
{
- // svg not yet buffered in maEx, return size derived from range
+ // svg not yet buffered in maBitmapEx, return size derived from range
const basegfx::B2DRange& rRange = maVectorGraphicData->getRange();
aSize = Size(basegfx::fround(rRange.getWidth()), basegfx::fround(rRange.getHeight()));
@@ -787,11 +787,11 @@ Size ImpGraphic::ImplGetPrefSize() const
}
else
{
- aSize = maEx.GetPrefSize();
+ aSize = maBitmapEx.GetPrefSize();
if( !aSize.Width() || !aSize.Height() )
{
- aSize = maEx.GetSizePixel();
+ aSize = maBitmapEx.GetSizePixel();
}
}
}
@@ -823,7 +823,7 @@ void ImpGraphic::ImplSetPrefSize( const Size& rPrefSize )
{
// used when importing a writer FlyFrame with SVG as graphic, added conversion
// to allow setting the PrefSize at the BitmapEx to hold it
- if(maVectorGraphicData.get() && maEx.IsEmpty())
+ if(maVectorGraphicData.get() && maBitmapEx.IsEmpty())
{
maExPrefSize = rPrefSize;
}
@@ -837,7 +837,7 @@ void ImpGraphic::ImplSetPrefSize( const Size& rPrefSize )
if (!maExPrefSize.getWidth() || !maExPrefSize.getHeight())
{
- maEx.SetPrefSize( rPrefSize );
+ maBitmapEx.SetPrefSize( rPrefSize );
}
}
break;
@@ -869,17 +869,17 @@ MapMode ImpGraphic::ImplGetPrefMapMode() const
case GraphicType::Bitmap:
{
- if(maVectorGraphicData.get() && maEx.IsEmpty())
+ if(maVectorGraphicData.get() && maBitmapEx.IsEmpty())
{
- // svg not yet buffered in maEx, return default PrefMapMode
+ // svg not yet buffered in maBitmapEx, return default PrefMapMode
aMapMode = MapMode(MapUnit::Map100thMM);
}
else
{
- const Size aSize( maEx.GetPrefSize() );
+ const Size aSize( maBitmapEx.GetPrefSize() );
if ( aSize.Width() && aSize.Height() )
- aMapMode = maEx.GetPrefMapMode();
+ aMapMode = maBitmapEx.GetPrefMapMode();
}
}
break;
@@ -911,7 +911,7 @@ void ImpGraphic::ImplSetPrefMapMode( const MapMode& rPrefMapMode )
if(maVectorGraphicData.get())
{
// ignore for Vector Graphic Data. If this is really used (except the grfcache)
- // it can be extended by using maEx as buffer for getVectorGraphicReplacement()
+ // it can be extended by using maBitmapEx as buffer for getVectorGraphicReplacement()
}
else
{
@@ -922,7 +922,7 @@ void ImpGraphic::ImplSetPrefMapMode( const MapMode& rPrefMapMode )
const_cast< BitmapEx& >(mpAnimation->GetBitmapEx()).SetPrefMapMode( rPrefMapMode );
}
- maEx.SetPrefMapMode( rPrefMapMode );
+ maBitmapEx.SetPrefMapMode( rPrefMapMode );
}
}
break;
@@ -957,7 +957,7 @@ sal_uLong ImpGraphic::ImplGetSizeBytes() const
}
else
{
- mnSizeBytes = mpAnimation ? mpAnimation->GetSizeBytes() : maEx.GetSizeBytes();
+ mnSizeBytes = mpAnimation ? mpAnimation->GetSizeBytes() : maBitmapEx.GetSizeBytes();
}
}
else if( meType == GraphicType::GdiMetafile )
@@ -981,10 +981,10 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev, const Point& rDestPt ) const
case GraphicType::Bitmap:
{
- if(maVectorGraphicData.get() && !maEx)
+ if(maVectorGraphicData.get() && !maBitmapEx)
{
// use maEx as local buffer for rendered svg
- const_cast< ImpGraphic* >(this)->maEx = getVectorGraphicReplacement();
+ const_cast< ImpGraphic* >(this)->maBitmapEx = getVectorGraphicReplacement();
}
if ( mpAnimation )
@@ -993,7 +993,7 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev, const Point& rDestPt ) const
}
else
{
- maEx.Draw( pOutDev, rDestPt );
+ maBitmapEx.Draw( pOutDev, rDestPt );
}
}
break;
@@ -1018,10 +1018,10 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev,
case GraphicType::Bitmap:
{
- if(maVectorGraphicData.get() && maEx.IsEmpty())
+ if(maVectorGraphicData.get() && maBitmapEx.IsEmpty())
{
// use maEx as local buffer for rendered svg
- const_cast< ImpGraphic* >(this)->maEx = getVectorGraphicReplacement();
+ const_cast< ImpGraphic* >(this)->maBitmapEx = getVectorGraphicReplacement();
}
if( mpAnimation )
@@ -1030,7 +1030,7 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev,
}
else
{
- maEx.Draw( pOutDev, rDestPt, rDestSize );
+ maBitmapEx.Draw( pOutDev, rDestPt, rDestSize );
}
}
break;
@@ -1165,18 +1165,18 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm )
{
if( meType == GraphicType::Bitmap )
{
- if(maVectorGraphicData.get() && maEx.IsEmpty())
+ if(maVectorGraphicData.get() && maBitmapEx.IsEmpty())
{
- // use maEx as local buffer for rendered svg
- maEx = getVectorGraphicReplacement();
+ // use maBitmapEx as local buffer for rendered svg
+ maBitmapEx = getVectorGraphicReplacement();
}
- maEx.SetSizePixel(aSize);
+ maBitmapEx.SetSizePixel(aSize);
if( aMapMode != MapMode() )
{
- maEx.SetPrefMapMode( aMapMode );
- maEx.SetPrefSize( aSize );
+ maBitmapEx.SetPrefMapMode( aMapMode );
+ maBitmapEx.SetPrefSize( aSize );
}
}
else
@@ -1550,7 +1550,7 @@ BitmapChecksum ImpGraphic::ImplGetChecksum() const
else if( mpAnimation )
nRet = mpAnimation->GetChecksum();
else
- nRet = maEx.GetChecksum();
+ nRet = maBitmapEx.GetChecksum();
}
break;
@@ -1840,7 +1840,7 @@ void WriteImpGraphic(SvStream& rOStm, const ImpGraphic& rImpGraphic)
}
else
{
- WriteDIBBitmapEx(rImpGraphic.maEx, rOStm);
+ WriteDIBBitmapEx(rImpGraphic.maBitmapEx, rOStm);
}
}
break;
commit 0ba9b7b09d0a7424c1a6f77dfb3ba22ca039a357
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: Tue Apr 21 12:22:31 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 2095d0c8ef71..7485622e4897 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
@@ -1695,16 +1704,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);
@@ -1720,15 +1725,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;
}
@@ -1803,26 +1808,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 52c9fbe3dd97e4c54ef6456372daed79e83b14fe
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: Tue Apr 21 12:22:30 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 9deb69a836e4..2095d0c8ef71 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() )
return;
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() )
return;
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 );
}
@@ -1226,7 +1226,7 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
{
ensureAvailable();
- if( ( meType == GraphicType::NONE ) || ( meType == GraphicType::Default ) || ImplIsSwapOut() )
+ if( ( meType == GraphicType::NONE ) || ( meType == GraphicType::Default ) || isSwappedOut() )
return false;
const MapMode aMapMode( ImplGetPrefMapMode() );
@@ -1299,10 +1299,10 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
return bRet;
}
-bool ImpGraphic::ImplSwapOut()
+bool ImpGraphic::swapOut()
{
- if( ImplIsSwapOut() )
+ if( isSwappedOut() )
return false;
::utl::TempFile aTempFile;
@@ -1325,7 +1325,7 @@ bool ImpGraphic::ImplSwapOut()
xOStm->SetVersion( SOFFICE_FILEFORMAT_50 );
xOStm->SetCompressMode( SvStreamCompressFlags::NATIVE );
- bool bRet = ImplSwapOut( xOStm.get() );
+ bool bRet = swapOutToStream( xOStm.get() );
if( bRet )
{
mpSwapFile = std::make_shared<ImpSwapFile>();
@@ -1343,7 +1343,7 @@ bool ImpGraphic::ImplSwapOut()
return bRet;
}
-bool ImpGraphic::ImplSwapOut( SvStream* xOStm )
+bool ImpGraphic::swapOutToStream(SvStream* xOStm)
{
if( !xOStm )
{
@@ -1374,8 +1374,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;
@@ -1404,11 +1404,11 @@ bool ImpGraphic::loadPrepared()
return true;
}
-bool ImpGraphic::ImplSwapIn()
+bool ImpGraphic::swapIn()
{
bool bRet = false;
- if (!ImplIsSwapOut())
+ if (!isSwappedOut())
return bRet;
if (mbPrepared)
@@ -1438,7 +1438,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);
@@ -1453,7 +1453,7 @@ bool ImpGraphic::ImplSwapIn()
return bRet;
}
-bool ImpGraphic::ImplSwapIn( SvStream* xIStm )
+bool ImpGraphic::swapInFromStream(SvStream* xIStm)
{
bool bRet = false;
@@ -1527,7 +1527,7 @@ BitmapChecksum ImpGraphic::ImplGetChecksum() const
ensureAvailable();
- if( ImplIsSupportedGraphic() && !ImplIsSwapOut() )
+ if( ImplIsSupportedGraphic() && !isSwappedOut() )
{
switch( meType )
{
@@ -1564,7 +1564,7 @@ bool ImpGraphic::ImplExportNative( SvStream& rOStm ) const
bool bResult = false;
- if( !ImplIsSwapOut() )
+ if( !isSwappedOut() )
{
if( mpGfxLink && mpGfxLink->IsNative() )
bResult = mpGfxLink->ExportNative( rOStm );
@@ -1757,7 +1757,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 91c0077f3d5e27da4653a672ad4ac562ae0b7176
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: Tue Apr 21 12:22:30 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;
}
}
commit 800aa2fa961a64736ccf09b4e31ec33d1f89db31
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Apr 14 20:48:56 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Apr 21 12:22:30 2020 +0200
use pragma once
Change-Id: Ia78cc4ee565a5f39835499764b1f2d0a2a72c5ba
diff --git a/include/vcl/GraphicNativeMetadata.hxx b/include/vcl/GraphicNativeMetadata.hxx
index b6b162556e76..118efa480df8 100644
--- a/include/vcl/GraphicNativeMetadata.hxx
+++ b/include/vcl/GraphicNativeMetadata.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_VCL_GRAPHICNATIVEMETADATA_HXX
-#define INCLUDED_VCL_GRAPHICNATIVEMETADATA_HXX
+#pragma once
#include <vcl/graph.hxx>
@@ -34,6 +33,4 @@ public:
sal_uInt16 getRotation() const { return mRotation;}
};
-#endif // INCLUDED_VCL_GRAPHICNATIVEMETADATA_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/GraphicNativeTransform.hxx b/include/vcl/GraphicNativeTransform.hxx
index c8203377dc55..318327bf5b66 100644
--- a/include/vcl/GraphicNativeTransform.hxx
+++ b/include/vcl/GraphicNativeTransform.hxx
@@ -17,12 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_VCL_GRAPHICNATIVETRANSFORM_HXX
-#define INCLUDED_VCL_GRAPHICNATIVETRANSFORM_HXX
+#pragma once
#include <rtl/ustring.hxx>
#include <sal/types.h>
#include <vcl/dllapi.h>
+
class Graphic;
class VCL_DLLPUBLIC GraphicNativeTransform final
@@ -40,6 +40,4 @@ public:
void rotate(sal_uInt16 aRotation);
};
-#endif // INCLUDED_VCL_GRAPHICNATIVETRANSFORM_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/filter/jpeg/Exif.hxx b/vcl/source/filter/jpeg/Exif.hxx
index 47c34e427810..6052a44842da 100644
--- a/vcl/source/filter/jpeg/Exif.hxx
+++ b/vcl/source/filter/jpeg/Exif.hxx
@@ -17,12 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_VCL_SOURCE_FILTER_JPEG_EXIF_HXX
-#define INCLUDED_VCL_SOURCE_FILTER_JPEG_EXIF_HXX
+#pragma once
#include <tools/stream.hxx>
namespace exif {
+
enum Orientation {
TOP_LEFT = 1,
TOP_RIGHT = 2,
@@ -80,6 +80,4 @@ public:
};
-#endif // INCLUDED_VCL_SOURCE_FILTER_JPEG_EXIF_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit d16e196b5682cf688d480c22f589e19330d783b4
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Apr 1 13:00:25 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Apr 21 12:22:30 2020 +0200
Add OutputDevice::drawPrimitive2D to OutputDevice
Change-Id: Ifc22eca62df72bddd247ba097054f34756520614
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index e4430b2415f3..44aa8f821dae 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -49,6 +49,8 @@
#include <com/sun/star/drawing/LineCap.hpp>
#include <com/sun/star/uno/Reference.h>
+#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
+
#include <memory>
#include <vector>
@@ -1955,6 +1957,9 @@ public:
///@}
+ bool drawPrimitive2D(drawinglayer::primitive2d::Primitive2DContainer & rPrimitive2D);
+
+
/** @name Native Widget Rendering functions
These all just call through to the private mpGraphics functions of the same name.
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 64812f920d47..e70f96684c6d 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -80,6 +80,7 @@ $(eval $(call gb_Library_use_libraries,vcl,\
basegfx \
comphelper \
cppuhelper \
+ drawinglayercore \
i18nlangtag \
i18nutil \
$(if $(filter OPENCL,$(BUILD_TYPE)),opencl) \
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 0dcdd84a5d0a..52f31234caa3 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -713,4 +713,9 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
return bDrawn;
}
+bool OutputDevice::drawPrimitive2D(drawinglayer::primitive2d::Primitive2DContainer & rPrimitive2D)
+{
+ return false;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit fde82774bc57cb2f2a38cabd981c326d78d458d4
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Mar 7 14:33:43 2020 +0100
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Apr 21 12:22:30 2020 +0200
Separate core drawinglayer func. into drawinglayercore library
This separates the drawinglayer core functionallity into a
separate library, to keep a strict separation what is backend
dependent and what is not. More strict separation can be done
at a later date.
This will make it possible to push part of drawinglayer
(part of processor2d) directly into VCL.
Change-Id: Ibc26580067e50bf20d7cdd37fa0e44eb10200878
diff --git a/Repository.mk b/Repository.mk
index 83e8ffa6d885..52b4db88e46e 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -351,6 +351,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
$(call gb_Helper_optional,SCRIPTING,dlgprov) \
$(if $(filter WNT,$(OS)),directx9canvas) \
$(if $(ENABLE_OPENGL_CANVAS),oglcanvas) \
+ drawinglayercore \
drawinglayer \
editeng \
$(if $(filter WNT,$(OS)),emser) \
diff --git a/drawinglayer/CppunitTest_drawinglayer_border.mk b/drawinglayer/CppunitTest_drawinglayer_border.mk
index fa2f715590cd..e00006c18dba 100644
--- a/drawinglayer/CppunitTest_drawinglayer_border.mk
+++ b/drawinglayer/CppunitTest_drawinglayer_border.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,drawinglayer_border, \
sal \
salhelper \
drawinglayer \
+ drawinglayercore \
vcl \
test \
tl \
diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk
index 2a0f1030a789..46f21f56b6b6 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_Library_use_externals,drawinglayer,\
))
$(eval $(call gb_Library_use_libraries,drawinglayer,\
+ drawinglayercore \
basegfx \
canvastools \
comphelper \
@@ -67,11 +68,9 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/attribute/sdrsceneattribute3d \
drawinglayer/source/attribute/sdrshadowattribute \
drawinglayer/source/attribute/strokeattribute \
- drawinglayer/source/geometry/viewinformation2d \
drawinglayer/source/geometry/viewinformation3d \
drawinglayer/source/primitive2d/animatedprimitive2d \
drawinglayer/source/primitive2d/backgroundcolorprimitive2d \
- drawinglayer/source/primitive2d/baseprimitive2d \
drawinglayer/source/primitive2d/bitmapprimitive2d \
drawinglayer/source/primitive2d/borderlineprimitive2d \
drawinglayer/source/primitive2d/controlprimitive2d \
@@ -111,7 +110,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D \
drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D \
drawinglayer/source/primitive2d/primitivetools2d \
- drawinglayer/source/primitive2d/Primitive2DContainer \
drawinglayer/source/primitive2d/sceneprimitive2d \
drawinglayer/source/primitive2d/sdrdecompositiontools2d \
drawinglayer/source/primitive2d/shadowprimitive2d \
@@ -126,7 +124,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/primitive2d/textlineprimitive2d \
drawinglayer/source/primitive2d/textprimitive2d \
drawinglayer/source/primitive2d/textstrikeoutprimitive2d \
- drawinglayer/source/primitive2d/Tools \
drawinglayer/source/primitive2d/transformprimitive2d \
drawinglayer/source/primitive2d/transparenceprimitive2d \
drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d \
diff --git a/drawinglayer/Library_drawinglayercore.mk b/drawinglayer/Library_drawinglayercore.mk
new file mode 100644
index 000000000000..f1643d27014d
--- /dev/null
+++ b/drawinglayer/Library_drawinglayercore.mk
@@ -0,0 +1,49 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,drawinglayercore))
+
+$(eval $(call gb_Library_set_include,drawinglayercore,\
+ $$(INCLUDE) \
+ -I$(SRCDIR)/drawinglayer/inc \
+))
+
+$(eval $(call gb_Library_add_defs,drawinglayercore,\
+ -DDRAWINGLAYERCORE_DLLIMPLEMENTATION \
+))
+
+$(eval $(call gb_Library_set_precompiled_header,drawinglayercore,drawinglayer/inc/pch/precompiled_drawinglayercore))
+
+$(eval $(call gb_Library_use_sdk_api,drawinglayercore))
+
+$(eval $(call gb_Library_use_externals,drawinglayercore,\
+ boost_headers \
+ libxml2 \
+))
+
+$(eval $(call gb_Library_use_libraries,drawinglayercore,\
+ basegfx \
+ comphelper \
+ cppu \
+ cppuhelper \
+ i18nlangtag \
+ sal \
+ salhelper \
+ svl \
+ tl \
+))
+
+$(eval $(call gb_Library_add_exception_objects,drawinglayercore,\
+ drawinglayer/source/primitive2d/baseprimitive2d \
+ drawinglayer/source/primitive2d/Primitive2DContainer \
+ drawinglayer/source/primitive2d/Tools \
+ drawinglayer/source/geometry/viewinformation2d \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/drawinglayer/Module_drawinglayer.mk b/drawinglayer/Module_drawinglayer.mk
index 6d329e95c60a..687cd9c2671f 100644
--- a/drawinglayer/Module_drawinglayer.mk
+++ b/drawinglayer/Module_drawinglayer.mk
@@ -10,6 +10,7 @@
$(eval $(call gb_Module_Module,drawinglayer))
$(eval $(call gb_Module_add_targets,drawinglayer,\
+ Library_drawinglayercore \
Library_drawinglayer \
))
diff --git a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
index 25a23a7d3a9e..df6a684135ed 100644
--- a/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
+++ b/drawinglayer/inc/pch/precompiled_drawinglayer.hxx
@@ -13,7 +13,7 @@
manual changes will be rewritten by the next run of update_pch.sh (which presumably
also fixes all possible problems, so it's usually better to use it).
- Generated on 2020-04-02 22:28:40 using:
+ Generated on 2020-04-03 17:41:44 using:
./bin/update_pch drawinglayer drawinglayer --cutoff=4 --exclude:system --exclude:module --exclude:local
If after updating build fails, use the following command to locate conflicting headers:
@@ -92,7 +92,6 @@
#include <basegfx/range/basicrange.hxx>
#include <basegfx/tuple/b2dtuple.hxx>
#include <basegfx/tuple/b3dtuple.hxx>
-#include <basegfx/utils/canvastools.hxx>
#include <basegfx/vector/b2dvector.hxx>
#include <basegfx/vector/b2enums.hxx>
#include <basegfx/vector/b2ivector.hxx>
@@ -104,7 +103,7 @@
#include <com/sun/star/drawing/TextureMode.hpp>
#include <com/sun/star/drawing/TextureProjectionMode.hpp>
#include <com/sun/star/graphic/XPrimitive3D.hpp>
-#include <com/sun/star/util/XAccounting.hpp>
+#include <com/sun/star/uno/Reference.hxx>
#include <comphelper/comphelperdllapi.h>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
@@ -137,7 +136,6 @@
#include <drawinglayer/drawinglayerdllapi.h>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
-#include <drawinglayer/primitive2d/CommonTypes.hxx>
#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonGradientPrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonGraphicPrimitive2D.hxx>
@@ -145,9 +143,6 @@
#include <drawinglayer/primitive2d/PolyPolygonHatchPrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonMarkerPrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonStrokePrimitive2D.hxx>
-#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
-#include <drawinglayer/primitive2d/Primitive2DVisitor.hxx>
-#include <drawinglayer/primitive2d/Tools.hxx>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
diff --git a/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx b/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx
new file mode 100644
index 000000000000..4a8c23ea8e65
--- /dev/null
+++ b/drawinglayer/inc/pch/precompiled_drawinglayercore.cxx
@@ -0,0 +1,12 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "precompiled_drawinglayercore.hxx"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx b/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx
new file mode 100644
index 000000000000..4cc5ca4612c9
--- /dev/null
+++ b/drawinglayer/inc/pch/precompiled_drawinglayercore.hxx
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/*
+ This file has been autogenerated by update_pch.sh. It is possible to edit it
+ manually (such as when an include file has been moved/renamed/removed). All such
+ manual changes will be rewritten by the next run of update_pch.sh (which presumably
+ also fixes all possible problems, so it's usually better to use it).
+
+ Generated on 2020-03-07 12:37:18 using:
+ ./bin/update_pch drawinglayer drawinglayercore --cutoff=4 --exclude:system --exclude:module --exclude:local
+
+ If after updating build fails, use the following command to locate conflicting headers:
+ ./bin/update_pch_bisect ./drawinglayer/inc/pch/precompiled_drawinglayercore.hxx "make drawinglayer.build" --find-conflicts
+*/
+
+#if PCH_LEVEL >= 1
+#include <ostream>
+#include <vector>
+#endif // PCH_LEVEL >= 1
+#if PCH_LEVEL >= 2
+#include <osl/diagnose.h>
+#include <osl/interlck.h>
+#include <sal/config.h>
+#include <sal/types.h>
+#endif // PCH_LEVEL >= 2
+#if PCH_LEVEL >= 3
+#include <basegfx/basegfxdllapi.h>
+#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/range/b2drange.hxx>
+#include <basegfx/range/basicrange.hxx>
+#include <basegfx/tuple/b2dtuple.hxx>
+#include <basegfx/utils/canvastools.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#endif // PCH_LEVEL >= 3
+#if PCH_LEVEL >= 4
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#endif // PCH_LEVEL >= 4
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/emfio/CppunitTest_emfio_emf_test.mk b/emfio/CppunitTest_emfio_emf_test.mk
index 123e4b3549bd..2679c0a604d9 100644
--- a/emfio/CppunitTest_emfio_emf_test.mk
+++ b/emfio/CppunitTest_emfio_emf_test.mk
@@ -23,6 +23,7 @@ $(eval $(call gb_CppunitTest_use_sdk_api,emfio_emf))
$(eval $(call gb_CppunitTest_use_libraries,emfio_emf,\
basegfx \
drawinglayer \
+ drawinglayercore \
cppu \
cppuhelper \
comphelper \
diff --git a/emfio/Library_emfio.mk b/emfio/Library_emfio.mk
index 52fde14885b3..89add50b781a 100644
--- a/emfio/Library_emfio.mk
+++ b/emfio/Library_emfio.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_Library_use_sdk_api,emfio))
$(eval $(call gb_Library_use_libraries,emfio,\
basegfx \
+ drawinglayercore \
drawinglayer \
cppu \
cppuhelper \
diff --git a/filter/Library_svgfilter.mk b/filter/Library_svgfilter.mk
index 21318aa1fd03..1f0caf11758c 100644
--- a/filter/Library_svgfilter.mk
+++ b/filter/Library_svgfilter.mk
@@ -56,6 +56,7 @@ $(eval $(call gb_Library_use_libraries,svgfilter,\
sax \
salhelper \
comphelper \
+ drawinglayercore \
drawinglayer \
basegfx \
cppuhelper \
diff --git a/include/drawinglayer/drawinglayerdllapi.h b/include/drawinglayer/drawinglayerdllapi.h
index 0b3983504919..36a0d8abfea2 100644
--- a/include/drawinglayer/drawinglayerdllapi.h
+++ b/include/drawinglayer/drawinglayerdllapi.h
@@ -19,6 +19,12 @@
#endif
#define DRAWINGLAYER_DLLPRIVATE SAL_DLLPRIVATE
+#if defined(DRAWINGLAYERCORE_DLLIMPLEMENTATION)
+#define DRAWINGLAYERCORE_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define DRAWINGLAYERCORE_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/geometry/viewinformation2d.hxx b/include/drawinglayer/geometry/viewinformation2d.hxx
index 95be29a72bda..06b17248d213 100644
--- a/include/drawinglayer/geometry/viewinformation2d.hxx
+++ b/include/drawinglayer/geometry/viewinformation2d.hxx
@@ -63,7 +63,7 @@ namespace drawinglayer::geometry
It is an implementation to support the sequence of PropertyValues used in a
css::graphic::XPrimitive2D for C++ implementations working with those
*/
-class DRAWINGLAYER_DLLPUBLIC ViewInformation2D
+class DRAWINGLAYERCORE_DLLPUBLIC ViewInformation2D
{
public:
typedef o3tl::cow_wrapper<ImpViewInformation2D, o3tl::ThreadSafeRefCountingPolicy> ImplType;
diff --git a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
index cca3a0a91485..c096e9a8cc2f 100644
--- a/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
+++ b/include/drawinglayer/primitive2d/Primitive2DContainer.hxx
@@ -34,7 +34,7 @@ class ViewInformation2D;
namespace drawinglayer::primitive2d
{
-class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive2DContainer
+class SAL_WARN_UNUSED DRAWINGLAYERCORE_DLLPUBLIC Primitive2DContainer
: public std::deque<Primitive2DReference>,
public Primitive2DDecompositionVisitor
{
diff --git a/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx b/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx
index dfe04b32a320..e174d1e0878d 100644
--- a/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx
+++ b/include/drawinglayer/primitive2d/Primitive2DVisitor.hxx
@@ -27,7 +27,7 @@ namespace drawinglayer::primitive2d
class Primitive2DContainer;
// Visitor class for walking a tree of Primitive2DReference
-class DRAWINGLAYER_DLLPUBLIC Primitive2DDecompositionVisitor
+class DRAWINGLAYERCORE_DLLPUBLIC Primitive2DDecompositionVisitor
{
public:
virtual void append(const Primitive2DReference&) = 0;
diff --git a/include/drawinglayer/primitive2d/Tools.hxx b/include/drawinglayer/primitive2d/Tools.hxx
index fbb6f5717c01..1c30565c8c1b 100644
--- a/include/drawinglayer/primitive2d/Tools.hxx
+++ b/include/drawinglayer/primitive2d/Tools.hxx
@@ -31,16 +31,16 @@ class ViewInformation2D;
namespace drawinglayer::primitive2d
{
/// get B2DRange from a given Primitive2DReference
-basegfx::B2DRange DRAWINGLAYER_DLLPUBLIC getB2DRangeFromPrimitive2DReference(
+basegfx::B2DRange DRAWINGLAYERCORE_DLLPUBLIC getB2DRangeFromPrimitive2DReference(
const Primitive2DReference& rCandidate, const geometry::ViewInformation2D& aViewInformation);
/** compare two Primitive2DReferences for equality, including trying to get implementations (BasePrimitive2D)
and using compare operator
*/
-bool DRAWINGLAYER_DLLPUBLIC arePrimitive2DReferencesEqual(const Primitive2DReference& rA,
- const Primitive2DReference& rB);
+bool DRAWINGLAYERCORE_DLLPUBLIC arePrimitive2DReferencesEqual(const Primitive2DReference& rA,
+ const Primitive2DReference& rB);
-OUString DRAWINGLAYER_DLLPUBLIC idToString(sal_uInt32 nId);
+OUString DRAWINGLAYERCORE_DLLPUBLIC idToString(sal_uInt32 nId);
} // end of namespace drawinglayer::primitive2d
diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
index 5e1a96429ff3..8818cdd0bcde 100644
--- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -121,8 +121,8 @@ typedef cppu::WeakComponentImplHelper<css::graphic::XPrimitive2D, css::util::XAc
for view-independent primitives which are defined by not using ViewInformation2D
in their get2DDecomposition/getB2DRange implementations.
*/
-class DRAWINGLAYER_DLLPUBLIC BasePrimitive2D : protected cppu::BaseMutex,
- public BasePrimitive2DImplBase
+class DRAWINGLAYERCORE_DLLPUBLIC BasePrimitive2D : protected cppu::BaseMutex,
+ public BasePrimitive2DImplBase
{
BasePrimitive2D(const BasePrimitive2D&) = delete;
BasePrimitive2D& operator=(const BasePrimitive2D&) = delete;
@@ -200,7 +200,7 @@ public:
to identify if a new decomposition is needed at the next call
(f) return maBuffered2DDecomposition
*/
-class DRAWINGLAYER_DLLPUBLIC BufferedDecompositionPrimitive2D : public BasePrimitive2D
+class DRAWINGLAYERCORE_DLLPUBLIC BufferedDecompositionPrimitive2D : public BasePrimitive2D
{
private:
/// a sequence used for buffering the last create2DDecomposition() result
diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index 8943de7ab4c3..60fb6676dab9 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_ucalc, \
cppuhelper \
dbtools \
drawinglayer \
+ drawinglayercore \
editeng \
for \
forui \
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 997b14c0add9..b540b27c9834 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -70,6 +70,7 @@ $(eval $(call gb_Library_use_libraries,sc,\
cppu \
cppuhelper \
dbtools \
+ drawinglayercore \
drawinglayer \
editeng \
for \
diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk
index 93426dfc3a55..63f143978231 100644
--- a/sd/CppunitTest_sd_uimpress.mk
+++ b/sd/CppunitTest_sd_uimpress.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_uimpress,\
cppu \
cppuhelper \
drawinglayer \
+ drawinglayercore \
editeng \
i18nlangtag \
i18nutil \
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 43b168be8d8c..24520633e77f 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -74,6 +74,7 @@ $(eval $(call gb_Library_use_libraries,sd,\
cppcanvas \
cppu \
cppuhelper \
+ drawinglayercore \
drawinglayer \
editeng \
i18nlangtag \
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index e04cad7e6667..d6e445744152 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_Library_use_libraries,sfx,\
comphelper \
cppu \
cppuhelper \
+ drawinglayercore \
drawinglayer \
fwe \
i18nlangtag \
diff --git a/svgio/CppunitTest_svgio.mk b/svgio/CppunitTest_svgio.mk
index c6f4db91fc60..24fb7a39af32 100644
--- a/svgio/CppunitTest_svgio.mk
+++ b/svgio/CppunitTest_svgio.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_CppunitTest_use_library_objects,svgio,\
$(eval $(call gb_CppunitTest_use_libraries,svgio,\
basegfx \
drawinglayer \
+ drawinglayercore \
cppu \
cppuhelper \
comphelper \
diff --git a/svgio/Library_svgio.mk b/svgio/Library_svgio.mk
index 449c17f61196..7ef1aeb19513 100644
--- a/svgio/Library_svgio.mk
+++ b/svgio/Library_svgio.mk
@@ -33,6 +33,7 @@ $(eval $(call gb_Library_use_sdk_api,svgio))
$(eval $(call gb_Library_use_libraries,svgio,\
basegfx \
+ drawinglayercore \
drawinglayer \
comphelper \
cppu \
diff --git a/svx/CppunitTest_svx_unit.mk b/svx/CppunitTest_svx_unit.mk
index 92feb45d6578..c78b8d7769eb 100644
--- a/svx/CppunitTest_svx_unit.mk
+++ b/svx/CppunitTest_svx_unit.mk
@@ -35,6 +35,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,svx_unit, \
$(eval $(call gb_CppunitTest_use_libraries,svx_unit, \
basegfx \
drawinglayer \
+ drawinglayercore \
sal \
sfx \
svxcore \
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index d3eff20b6769..9ccba33a748c 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -50,6 +50,7 @@ $(eval $(call gb_Library_use_libraries,svx,\
crashreport) \
$(call gb_Helper_optional,DBCONNECTIVITY, \
dbtools) \
+ drawinglayercore \
drawinglayer \
editeng \
fwe \
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index 80fcdae920f3..fdf5f0165249 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -57,6 +57,7 @@ $(eval $(call gb_Library_use_libraries,svxcore,\
cppu \
$(call gb_Helper_optional,DBCONNECTIVITY, \
dbtools) \
+ drawinglayercore \
drawinglayer \
editeng \
fwe \
diff --git a/sw/CppunitTest_sw_uwriter.mk b/sw/CppunitTest_sw_uwriter.mk
index 6b9ffa4ba683..a881587735e4 100644
--- a/sw/CppunitTest_sw_uwriter.mk
+++ b/sw/CppunitTest_sw_uwriter.mk
@@ -33,6 +33,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_uwriter, \
$(call gb_Helper_optional,DBCONNECTIVITY, \
dbtools) \
drawinglayer \
+ drawinglayercore \
editeng \
i18nlangtag \
i18nutil \
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index b6d75fd890bf..d99c59a58a4b 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -58,6 +58,7 @@ $(eval $(call gb_Library_use_libraries,sw,\
cppuhelper \
$(call gb_Helper_optional,DBCONNECTIVITY, \
dbtools) \
+ drawinglayercore \
drawinglayer \
editeng \
i18nlangtag \
diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk
index 99f1dd20ae3d..4c09d1cc4bda 100644
--- a/sw/Library_swui.mk
+++ b/sw/Library_swui.mk
@@ -75,6 +75,7 @@ $(eval $(call gb_Library_use_libraries,swui,\
ucbhelper \
utl \
vcl \
+ drawinglayercore \
drawinglayer \
))
commit 71de470ef2e7bac21a59d6baad8d12d1cc181628
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Apr 21 10:26:37 2020 +0200
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Apr 21 12:01:08 2020 +0200
don't try to use -fno-enforce-eh-specs with Clang
The use can be triggered when using gb_LinkTarget_use_clang, but
Clang unlike GCC doesn't know the option.
Change-Id: Idd109a09127061a72940de9229f0dd34b221375d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92611
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index f7e553dd5dc8..d19f0d3686ad 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -59,6 +59,12 @@ define gb_CObject__compiler
$(if $(2), $(2), $(gb_CXX)))
endef
+# When gb_LinkTarget_use_clang is used, filter out GCC flags that Clang doesn't know.
+# $(call gb_CObject__filter_out_clang_cflags,cflags)
+define gb_CObject__filter_out_clang_cflags
+ $(filter-out $(gb_FilterOutClangCFLAGS),$(1))
+endef
+
# $(call gb_CObject__command_pattern,object,flags,source,dep-file,compiler-plugins,symbols,compiler)
define gb_CObject__command_pattern
$(call gb_Helper_abbreviate_dirs,\
@@ -72,7 +78,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(WARNINGS_NOT_ERRORS),$(if $(ENABLE_WERROR),$(if $(PLUGIN_WARNINGS_AS_ERRORS),$(gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS))),$(gb_CFLAGS_WERROR)) \
$(if $(5),$(gb_COMPILER_PLUGINS)) \
$(if $(COMPILER_TEST),-fsyntax-only -ferror-limit=0 -Xclang -verify) \
- $(2) \
+ $(if $(7), $(call gb_CObject__filter_out_clang_cflags,$(2)),$(2)) \
$(if $(WARNINGS_DISABLED),$(gb_CXXFLAGS_DISABLE_WARNINGS)) \
$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
-c $(3) \
@@ -125,7 +131,8 @@ $(call gb_Helper_abbreviate_dirs,\
CCACHE_DISABLE=1 $(gb_COMPILER_SETUP) \
$(if $(8),$(8),$(gb_CXX)) \
-x c++-header \
- $(4) $(5) \
+ $(4) \
+ $(if $(7), $(call gb_CObject__filter_out_clang_cflags,$(5)),$(5)) \
$(if $(WARNINGS_DISABLED),$(gb_CXXFLAGS_DISABLE_WARNINGS)) \
$(gb_COMPILERDEPFLAGS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index cc0eabc292f2..baeb215bfb9e 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -194,6 +194,7 @@ ifeq ($(gb_ENABLE_DBGUTIL),$(false))
ifeq ($(HAVE_GCC_FNO_ENFORCE_EH_SPECS),TRUE)
gb_LinkTarget_EXCEPTIONFLAGS += \
-fno-enforce-eh-specs
+gb_FilterOutClangCFLAGS += -fno-enforce-eh-specs
endif
endif
commit 57839969381d93e96e98fdaee65e8593c8f07893
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Apr 20 18:05:28 2020 +0200
Commit: Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Tue Apr 21 11:57:31 2020 +0200
uitest: re-enable test using sleep
and instead of sleep(3) use
timeout = time.time() + 3
while condition != True and time.time() < timeout:
sleep(0.1)
execution time of this particular test goes from 7.785 seconds to 3.343 for me
Change-Id: I7c99385ccd858dfbb77cfc6e53a0b3f1a8b57c73
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92588
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
diff --git a/sw/qa/uitest/writer_tests/wordCount.py b/sw/qa/uitest/writer_tests/wordCount.py
index 96ff3ea47349..d7b7ca07bb4e 100644
--- a/sw/qa/uitest/writer_tests/wordCount.py
+++ b/sw/qa/uitest/writer_tests/wordCount.py
@@ -10,6 +10,7 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.debug import sleep
from uitest.uihelper.common import get_state_as_dict, type_text
from uitest.path import get_srcdir_url
+import time
def get_url_for_data_file(file_name):
return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name
@@ -247,47 +248,58 @@ class writerWordCount(UITestCase):
self.ui_test.close_dialog_through_button(xCloseBtn)
self.ui_test.close_doc()
- #need sleep() in test. Disable for now
-# def test_tdf51816(self):
-# writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf51816.odt"))
-# xWriterDoc = self.xUITest.getTopFocusWindow()
-# xWriterEdit = xWriterDoc.getChild("writer_edit")
-# document = self.ui_test.get_component()
-# #1. Open attached document
-# #2. Tools> Word count
-# self.ui_test.execute_modeless_dialog_through_command(".uno:WordCountDialog")
-# xDialog = self.xUITest.getTopFocusWindow()
-# xselectwords = xDialog.getChild("selectwords")
-# xdocwords = xDialog.getChild("docwords")
-# xselectchars = xDialog.getChild("selectchars")
-# xdocchars = xDialog.getChild("docchars")
-# xselectcharsnospaces = xDialog.getChild("selectcharsnospaces")
-# xdoccharsnospaces = xDialog.getChild("doccharsnospaces")
-# xselectcjkchars = xDialog.getChild("selectcjkchars")
-# xdoccjkchars = xDialog.getChild("doccjkchars")
-
-# #3. Click after "At nunc" then <Ctrl><Shift><Left>
-# self.xUITest.executeCommand(".uno:GoRight")
-# self.xUITest.executeCommand(".uno:GoRight")
-# self.xUITest.executeCommand(".uno:GoRight")
-# self.xUITest.executeCommand(".uno:GoRight")
-# self.xUITest.executeCommand(".uno:GoRight")
-# self.xUITest.executeCommand(".uno:GoRight")
-# self.xUITest.executeCommand(".uno:GoRight")
-# self.xUITest.executeCommand(".uno:WordLeftSel")
-# sleep(3) #need to wait, because Word count dialog is already open and it takes time to refresh the counter
-# #Expected result : Words 1 & Characters 4 #Actual result : Words 0 & Characters 0
-# self.assertEqual(get_state_as_dict(xselectwords)["Text"], "1")
-# self.assertEqual(get_state_as_dict(xselectchars)["Text"], "4")
-# #4. Click after "At nunc" then <Shift><Home>
-# self.xUITest.executeCommand(".uno:StartOfParaSel")
-# sleep(3) #need to wait, because Word count dialog is already open and it takes time to refresh the counter
-# #Expected result : Words 2 & Characters 7 & excluding space 6 #Actual result : Words 0 & Characters 0
-# self.assertEqual(get_state_as_dict(xselectwords)["Text"], "2")
-# self.assertEqual(get_state_as_dict(xselectchars)["Text"], "7")
-# self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "6")
-
-# xCloseBtn = xDialog.getChild("close")
-# self.ui_test.close_dialog_through_button(xCloseBtn)
-# self.ui_test.close_doc()
+ def test_tdf51816(self):
+ writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf51816.odt"))
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ document = self.ui_test.get_component()
+ #1. Open attached document
+ #2. Tools> Word count
+ self.ui_test.execute_modeless_dialog_through_command(".uno:WordCountDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xselectwords = xDialog.getChild("selectwords")
+ xdocwords = xDialog.getChild("docwords")
+ xselectchars = xDialog.getChild("selectchars")
+ xdocchars = xDialog.getChild("docchars")
+ xselectcharsnospaces = xDialog.getChild("selectcharsnospaces")
+ xdoccharsnospaces = xDialog.getChild("doccharsnospaces")
+ xselectcjkchars = xDialog.getChild("selectcjkchars")
+ xdoccjkchars = xDialog.getChild("doccjkchars")
+
+ #3. Click after "At nunc" then <Ctrl><Shift><Left>
+ self.xUITest.executeCommand(".uno:GoRight")
+ self.xUITest.executeCommand(".uno:GoRight")
+ self.xUITest.executeCommand(".uno:GoRight")
+ self.xUITest.executeCommand(".uno:GoRight")
+ self.xUITest.executeCommand(".uno:GoRight")
+ self.xUITest.executeCommand(".uno:GoRight")
+ self.xUITest.executeCommand(".uno:GoRight")
+ self.xUITest.executeCommand(".uno:WordLeftSel")
+
+ #need to wait, because Word count dialog is already open and it takes time to refresh the counter
+ timeout = time.time() + 3
+ while get_state_as_dict(xselectwords)["Text"] != "1" and time.time() < timeout:
+ sleep(0.1)
+
+ #Expected result : Words 1 & Characters 4 #Actual result : Words 0 & Characters 0
+ self.assertEqual(get_state_as_dict(xselectwords)["Text"], "1")
+ self.assertEqual(get_state_as_dict(xselectchars)["Text"], "4")
+
+ #4. Click after "At nunc" then <Shift><Home>
+ self.xUITest.executeCommand(".uno:StartOfParaSel")
+
+ #need to wait, because Word count dialog is already open and it takes time to refresh the counter
+ timeout = time.time() + 3
+ while get_state_as_dict(xselectwords)["Text"] != "2" and time.time() < timeout:
+ sleep(0.1)
+
+ #Expected result : Words 2 & Characters 7 & excluding space 6 #Actual result : Words 0 & Characters 0
+ self.assertEqual(get_state_as_dict(xselectwords)["Text"], "2")
+ self.assertEqual(get_state_as_dict(xselectchars)["Text"], "7")
+
+ self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "6")
+
+ xCloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
commit 850b8de31c5be5127eac16a4f5cc18c26a582e53
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Apr 19 20:36:17 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Apr 21 11:52:58 2020 +0200
weld sidebar text panel
includes
weld SvxFontNameToolBoxControl
Change-Id: Ie48338243600c07f9f8c609701c137175133f8e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92585
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx
index 7cc3c7995fa5..8944f85530f5 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.cxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.cxx
@@ -20,7 +20,6 @@
#include "TextPropertyPanel.hxx"
#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <vcl/toolbox.hxx>
#include <comphelper/lok.hxx>
#include <sfx2/lokhelper.hxx>
@@ -41,20 +40,33 @@ VclPtr<vcl::Window> TextPropertyPanel::Create (
}
TextPropertyPanel::TextPropertyPanel ( vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame )
- : PanelLayout(pParent, "SidebarTextPanel", "svx/ui/sidebartextpanel.ui", rxFrame)
+ : PanelLayout(pParent, "SidebarTextPanel", "svx/ui/sidebartextpanel.ui", rxFrame, true)
+ , mxFont(m_xBuilder->weld_toolbar("font"))
+ , mxFontDispatch(new ToolbarUnoDispatcher(*mxFont, *m_xBuilder, rxFrame))
+ , mxFontHeight(m_xBuilder->weld_toolbar("fontheight"))
+ , mxFontHeightDispatch(new ToolbarUnoDispatcher(*mxFontHeight, *m_xBuilder, rxFrame))
+ , mxFontEffects(m_xBuilder->weld_toolbar("fonteffects"))
+ , mxFontEffectsDispatch(new ToolbarUnoDispatcher(*mxFontEffects, *m_xBuilder, rxFrame))
+ , mxFontAdjust(m_xBuilder->weld_toolbar("fontadjust"))
+ , mxFontAdjustDispatch(new ToolbarUnoDispatcher(*mxFontAdjust, *m_xBuilder, rxFrame))
+ , mxToolBoxFontColorSw(m_xBuilder->weld_toolbar("colorbar_writer"))
+ , mxToolBoxFontColorSwDispatch(new ToolbarUnoDispatcher(*mxToolBoxFontColorSw, *m_xBuilder, rxFrame))
+ , mxToolBoxFontColor(m_xBuilder->weld_toolbar("colorbar_others"))
+ , mxToolBoxFontColorDispatch(new ToolbarUnoDispatcher(*mxToolBoxFontColor, *m_xBuilder, rxFrame))
+ , mxToolBoxBackgroundColor(m_xBuilder->weld_toolbar("colorbar_background"))
+ , mxToolBoxBackgroundColorDispatch(new ToolbarUnoDispatcher(*mxToolBoxBackgroundColor, *m_xBuilder, rxFrame))
+ , mxResetBar(m_xBuilder->weld_toolbar("resetattr"))
+ , mxResetBarDispatch(new ToolbarUnoDispatcher(*mxResetBar, *m_xBuilder, rxFrame))
+ , mxPositionBar(m_xBuilder->weld_toolbar("position"))
+ , mxPositionBarDispatch(new ToolbarUnoDispatcher(*mxPositionBar, *m_xBuilder, rxFrame))
+ , mxSpacingBar(m_xBuilder->weld_toolbar("spacingbar"))
+ , mxSpacingBarDispatch(new ToolbarUnoDispatcher(*mxSpacingBar, *m_xBuilder, rxFrame))
{
- get(mpToolBoxFontColorSw, "colorbar_writer");
- get(mpToolBoxFontColor, "colorbar_others");
- get(mpToolBoxBackgroundColor, "colorbar_background");
-
bool isMobilePhone = false;
if (comphelper::LibreOfficeKit::isActive() &&
comphelper::LibreOfficeKit::isMobilePhone(SfxLokHelper::getView()))
isMobilePhone = true;
- VclPtr<ToolBox> xSpacingBar;
- get(xSpacingBar, "spacingbar");
- xSpacingBar->Show(!isMobilePhone);
- xSpacingBar->ShowItem(0, !isMobilePhone);
+ mxSpacingBar->set_visible(!isMobilePhone);
}
TextPropertyPanel::~TextPropertyPanel()
@@ -64,9 +76,27 @@ TextPropertyPanel::~TextPropertyPanel()
void TextPropertyPanel::dispose()
{
- mpToolBoxFontColorSw.clear();
- mpToolBoxFontColor.clear();
- mpToolBoxBackgroundColor.clear();
+ mxResetBarDispatch.reset();
+ mxPositionBarDispatch.reset();
+ mxSpacingBarDispatch.reset();
+ mxToolBoxFontColorSwDispatch.reset();
+ mxToolBoxFontColorDispatch.reset();
+ mxToolBoxBackgroundColorDispatch.reset();
+ mxFontAdjustDispatch.reset();
+ mxFontEffectsDispatch.reset();
+ mxFontHeightDispatch.reset();
+ mxFontDispatch.reset();
+
+ mxResetBar.reset();
+ mxPositionBar.reset();
+ mxSpacingBar.reset();
+ mxToolBoxFontColorSw.reset();
+ mxToolBoxFontColor.reset();
+ mxToolBoxBackgroundColor.reset();
+ mxFontAdjust.reset();
+ mxFontEffects.reset();
+ mxFontHeight.reset();
+ mxFont.reset();
PanelLayout::dispose();
}
@@ -106,9 +136,9 @@ void TextPropertyPanel::HandleContextChange (
break;
}
- mpToolBoxFontColor->Show(!bWriterText);
- mpToolBoxFontColorSw->Show(bWriterText);
- mpToolBoxBackgroundColor->Show(bDrawText);
+ mxToolBoxFontColor->set_visible(!bWriterText);
+ mxToolBoxFontColorSw->set_visible(bWriterText);
+ mxToolBoxBackgroundColor->set_visible(bDrawText);
}
} // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx
index bbfe13f030d2..bfa905446785 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.hxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.hxx
@@ -20,11 +20,10 @@
#define INCLUDED_SVX_SOURCE_SIDEBAR_TEXT_TEXTPROPERTYPANEL_HXX
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
+#include <sfx2/weldutils.hxx>
#include <vcl/EnumContext.hxx>
#include <svx/sidebar/PanelLayout.hxx>
-class ToolBox;
-
namespace svx { namespace sidebar {
class TextPropertyPanel
@@ -47,9 +46,26 @@ public:
const css::uno::Reference<css::frame::XFrame>& rxFrame);
private:
- VclPtr<ToolBox> mpToolBoxFontColorSw;
- VclPtr<ToolBox> mpToolBoxFontColor;
- VclPtr<ToolBox> mpToolBoxBackgroundColor;
+ std::unique_ptr<weld::Toolbar> mxFont;
+ std::unique_ptr<ToolbarUnoDispatcher> mxFontDispatch;
+ std::unique_ptr<weld::Toolbar> mxFontHeight;
+ std::unique_ptr<ToolbarUnoDispatcher> mxFontHeightDispatch;
+ std::unique_ptr<weld::Toolbar> mxFontEffects;
+ std::unique_ptr<ToolbarUnoDispatcher> mxFontEffectsDispatch;
+ std::unique_ptr<weld::Toolbar> mxFontAdjust;
+ std::unique_ptr<ToolbarUnoDispatcher> mxFontAdjustDispatch;
+ std::unique_ptr<weld::Toolbar> mxToolBoxFontColorSw;
+ std::unique_ptr<ToolbarUnoDispatcher> mxToolBoxFontColorSwDispatch;
+ std::unique_ptr<weld::Toolbar> mxToolBoxFontColor;
+ std::unique_ptr<ToolbarUnoDispatcher> mxToolBoxFontColorDispatch;
+ std::unique_ptr<weld::Toolbar> mxToolBoxBackgroundColor;
+ std::unique_ptr<ToolbarUnoDispatcher> mxToolBoxBackgroundColorDispatch;
+ std::unique_ptr<weld::Toolbar> mxResetBar;
+ std::unique_ptr<ToolbarUnoDispatcher> mxResetBarDispatch;
+ std::unique_ptr<weld::Toolbar> mxPositionBar;
+ std::unique_ptr<ToolbarUnoDispatcher> mxPositionBarDispatch;
+ std::unique_ptr<weld::Toolbar> mxSpacingBar;
+ std::unique_ptr<ToolbarUnoDispatcher> mxSpacingBarDispatch;
vcl::EnumContext maContext;
};
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 523d2816fa64..fef375d4aff6 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -31,6 +31,7 @@
#include <vcl/toolbox.hxx>
#include <vcl/customweld.hxx>
#include <vcl/vclptr.hxx>
+#include <vcl/weldutils.hxx>
#include <svtools/valueset.hxx>
#include <svtools/ctrlbox.hxx>
#include <svl/style.hxx>
@@ -178,9 +179,41 @@ private:
namespace {
-class SvxFontNameBox_Impl final : public InterimItemWindow
+class SvxFontNameBox_Impl;
+class SvxFontNameBox_Base;
+
+class SvxFontNameToolBoxControl : public cppu::ImplInheritanceHelper< svt::ToolboxController,
+ css::lang::XServiceInfo >
{
+public:
+ SvxFontNameToolBoxControl();
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
+
+ // XToolbarController
+ virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& rParent ) override;
+
+ // XComponent
+ virtual void SAL_CALL dispose() override;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
+
private:
+ VclPtr<SvxFontNameBox_Impl> m_xVclBox;
+ std::unique_ptr<SvxFontNameBox_Base> m_xWeldBox;
+ SvxFontNameBox_Base* m_pBox;
+};
+
+class SvxFontNameBox_Base
+{
+protected:
+ SvxFontNameToolBoxControl& m_rCtrl;
+ int m_nCharWidth;
+
std::unique_ptr<FontNameBox> m_xWidget;
const FontList* pFontList;
::std::unique_ptr<FontList> m_aOwnFontList;
@@ -206,15 +239,12 @@ private:
}
void CheckAndMarkUnknownFont();
- void SetOptimalSize();
-
- virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
- virtual void GetFocus() override;
-
public:
- SvxFontNameBox_Impl(vcl::Window* pParent, const Reference<XDispatchProvider>& rDispatchProvider, const Reference<XFrame>& _xFrame);
- virtual ~SvxFontNameBox_Impl() override;
- virtual void dispose() override;
+ SvxFontNameBox_Base(std::unique_ptr<weld::ComboBox> xWidget, const Reference<XDispatchProvider>& rDispatchProvider,
+ const Reference<XFrame>& rFrame, SvxFontNameToolBoxControl& rCtrl);
+ virtual ~SvxFontNameBox_Base()
+ {
+ }
void FillList();
void Update( const css::awt::FontDescriptor* pFontDesc );
@@ -226,16 +256,19 @@ public:
nFtCount = pList->GetFontNameCount();
}
- virtual Reference< css::accessibility::XAccessible > CreateAccessible() override;
- void SetOwnFontList(::std::unique_ptr<FontList> && _aOwnFontList) { m_aOwnFontList = std::move(_aOwnFontList); }
+ void SetOwnFontList(::std::unique_ptr<FontList> && _aOwnFontList) { m_aOwnFontList = std::move(_aOwnFontList); }
- void Enable() {m_xWidget->set_sensitive(true); InterimItemWindow::Enable();}
- void Disable() {m_xWidget->set_sensitive(false); InterimItemWindow::Disable();}
+ virtual void set_sensitive(bool bSensitive)
+ {
+ m_xWidget->set_sensitive(bSensitive);
+ }
void set_active_or_entry_text(const OUString& rText);
void statusChanged_Impl(const css::frame::FeatureStateEvent& rEvent);
+ virtual bool DoKeyInput(const KeyEvent& rKEvt);
+
DECL_LINK(SelectHdl, weld::ComboBox&, void);
DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
DECL_LINK(ActivateHdl, weld::ComboBox&, bool);
@@ -244,6 +277,50 @@ public:
DECL_LINK(DumpAsPropertyTreeHdl, boost::property_tree::ptree&, void);
};
+class SvxFontNameBox_Impl final : public InterimItemWindow
+ , public SvxFontNameBox_Base
+{
+private:
+ virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
+ virtual void GetFocus() override
+ {
+ if (m_xWidget)
+ m_xWidget->grab_focus();
+ InterimItemWindow::GetFocus();
+ }
+
+ void SetOptimalSize();
+
+ virtual bool DoKeyInput(const KeyEvent& rKEvt) override;
+
+public:
+ SvxFontNameBox_Impl(vcl::Window* pParent, const Reference<XDispatchProvider>& rDispatchProvider,
+ const Reference<XFrame>& rFrame, SvxFontNameToolBoxControl& rCtrl);
+
+ virtual void dispose() override
+ {
+ m_xWidget.reset();
+ InterimItemWindow::dispose();
+ }
+
+ virtual ~SvxFontNameBox_Impl() override
+ {
+ disposeOnce();
+ }
+
+ virtual Reference< css::accessibility::XAccessible > CreateAccessible() override;
+
+ virtual void set_sensitive(bool bSensitive) override
+ {
+ m_xWidget->set_sensitive(bSensitive);
+ if (bSensitive)
+ InterimItemWindow::Enable();
+ else
+ InterimItemWindow::Disable();
+ }
+};
+
+
// SelectHdl needs the Modifiers, get them in MouseButtonUp
class SvxFrmValueSet_Impl final : public SvtValueSet
{
@@ -1248,7 +1325,7 @@ boost::property_tree::ptree SvxStyleBox_Impl::DumpAsPropertyTree()
}
-static bool lcl_GetDocFontList( const FontList** ppFontList, SvxFontNameBox_Impl* pBox )
+static bool lcl_GetDocFontList(const FontList** ppFontList, SvxFontNameBox_Base* pBox)
{
bool bChanged = false;
const SfxObjectShell* pDocSh = SfxObjectShell::Current();
@@ -1259,7 +1336,7 @@ static bool lcl_GetDocFontList( const FontList** ppFontList, SvxFontNameBox_Impl
static_cast<const SvxFontListItem*>(pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ));
else
{
- ::std::unique_ptr<FontList> aFontList(new FontList( pBox->GetParent() ));
+ ::std::unique_ptr<FontList> aFontList(new FontList(Application::GetDefaultDevice()));
*ppFontList = aFontList.get();
pBox->SetOwnFontList(std::move(aFontList));
bChanged = true;
@@ -1293,7 +1370,7 @@ static bool lcl_GetDocFontList( const FontList** ppFontList, SvxFontNameBox_Impl
}
if ( pBox )
- pBox->Enable();
+ pBox->set_sensitive(true);
}
else if ( pBox && ( pDocSh || !ppFontList ))
{
@@ -1304,7 +1381,7 @@ static bool lcl_GetDocFontList( const FontList** ppFontList, SvxFontNameBox_Impl
// the help window with F1. After closing the help window, we disable the font name
// combo box. The SfxObjectShell::Current() method returns in that case zero. But the
// font list hasn't changed and therefore the combo box shouldn't be disabled!
- pBox->Disable();
+ pBox->set_sensitive(false);
}
// Fill the FontBox, also the new list if necessary
@@ -1318,48 +1395,44 @@ static bool lcl_GetDocFontList( const FontList** ppFontList, SvxFontNameBox_Impl
return bChanged;
}
-SvxFontNameBox_Impl::SvxFontNameBox_Impl(vcl::Window* pParent, const Reference<XDispatchProvider>& rDispatchProvider,
- const Reference<XFrame>& _xFrame)
- : InterimItemWindow(pParent, "svx/ui/fontnamebox.ui", "FontNameBox")
- , m_xWidget(new FontNameBox(m_xBuilder->weld_combo_box("fontnamecombobox")))
+SvxFontNameBox_Base::SvxFontNameBox_Base(std::unique_ptr<weld::ComboBox> xWidget,
+ const Reference<XDispatchProvider>& rDispatchProvider,
+ const Reference<XFrame>& rFrame,
+ SvxFontNameToolBoxControl& rCtrl)
+ : m_rCtrl(rCtrl)
+ , m_nCharWidth(xWidget->get_approximate_digit_width() * 15)
+ , m_xWidget(new FontNameBox(std::move(xWidget)))
, pFontList(nullptr)
, nFtCount(0)
, bRelease(true)
, m_xDispatchProvider(rDispatchProvider)
- , m_xFrame(_xFrame)
+ , m_xFrame(rFrame)
, mbCheckingUnknownFont(false)
{
EnableControls_Impl();
- set_id("fontnamecombobox");
- m_xWidget->connect_changed(LINK(this, SvxFontNameBox_Impl, SelectHdl));
- m_xWidget->connect_key_press(LINK(this, SvxFontNameBox_Impl, KeyInputHdl));
- m_xWidget->connect_entry_activate(LINK(this, SvxFontNameBox_Impl, ActivateHdl));
- m_xWidget->connect_focus_in(LINK(this, SvxFontNameBox_Impl, FocusInHdl));
- m_xWidget->connect_focus_out(LINK(this, SvxFontNameBox_Impl, FocusOutHdl));
- m_xWidget->connect_get_property_tree(LINK(this, SvxFontNameBox_Impl, DumpAsPropertyTreeHdl));
+ m_xWidget->connect_changed(LINK(this, SvxFontNameBox_Base, SelectHdl));
+ m_xWidget->connect_key_press(LINK(this, SvxFontNameBox_Base, KeyInputHdl));
+ m_xWidget->connect_entry_activate(LINK(this, SvxFontNameBox_Base, ActivateHdl));
+ m_xWidget->connect_focus_in(LINK(this, SvxFontNameBox_Base, FocusInHdl));
+ m_xWidget->connect_focus_out(LINK(this, SvxFontNameBox_Base, FocusOutHdl));
+ m_xWidget->connect_get_property_tree(LINK(this, SvxFontNameBox_Base, DumpAsPropertyTreeHdl));
- const Size aLogicalSize(60, 0);
- Size aSize(LogicToPixel(aLogicalSize, MapMode(MapUnit::MapAppFont)));
// set width in chars low so the size request will not be overridden
m_xWidget->set_entry_width_chars(1);
- m_xWidget->set_size_request(aSize.Width(), -1);
-
- SetOptimalSize();
+ m_xWidget->set_size_request(m_nCharWidth, -1);
}
-SvxFontNameBox_Impl::~SvxFontNameBox_Impl()
-{
- disposeOnce();
-}
-
-void SvxFontNameBox_Impl::dispose()
+SvxFontNameBox_Impl::SvxFontNameBox_Impl(vcl::Window* pParent, const Reference<XDispatchProvider>& rDispatchProvider,
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list