[Libreoffice-commits] core.git: 2 commits - basctl/source filter/source include/tools include/vcl lotuswordpro/source sc/qa sd/qa vcl/inc vcl/quartz vcl/source vcl/unx vcl/win
Noel Grandin
noel.grandin at collabora.co.uk
Fri Mar 9 06:14:48 UTC 2018
basctl/source/accessibility/accessibledialogcontrolshape.cxx | 16 ++--
basctl/source/accessibility/accessibledialogwindow.cxx | 16 ++--
filter/source/pdf/impdialog.cxx | 2
filter/source/pdf/pdfexport.cxx | 2
include/tools/color.hxx | 6 -
include/vcl/bitmapex.hxx | 3
include/vcl/dibtools.hxx | 5 -
include/vcl/opengl/OpenGLHelper.hxx | 4 -
include/vcl/pdfwriter.hxx | 4 -
include/vcl/svapp.hxx | 3
lotuswordpro/source/filter/lwpbackgroundstuff.cxx | 2
sc/qa/extras/new_cond_format.cxx | 12 +--
sc/qa/unit/subsequent_export-test.cxx | 2
sd/qa/unit/export-tests-ooxml1.cxx | 6 -
sd/qa/unit/import-tests.cxx | 4 -
sd/qa/unit/sdmodeltestbase.hxx | 2
vcl/inc/sft.hxx | 7 -
vcl/quartz/salbmp.cxx | 6 -
vcl/quartz/salgdicommon.cxx | 2
vcl/source/app/svapp.cxx | 6 -
vcl/source/fontsubset/sft.cxx | 16 +---
vcl/source/gdi/bitmapex.cxx | 4 -
vcl/source/gdi/dibtools.cxx | 12 +--
vcl/source/gdi/gdimtf.cxx | 2
vcl/source/gdi/pdfwriter.cxx | 5 -
vcl/source/opengl/OpenGLHelper.cxx | 4 -
vcl/unx/generic/app/gensys.cxx | 44 -----------
vcl/unx/generic/fontmanager/fontmanager.cxx | 4 -
vcl/unx/generic/printer/ppdparser.cxx | 7 -
vcl/win/gdi/salfont.cxx | 2
30 files changed, 71 insertions(+), 139 deletions(-)
New commits:
commit 97e47e7b004945d3ac28a9262df371ca2faf1903
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Mar 8 14:42:07 2018 +0200
loplugin:constantparam in vcl
Change-Id: I1618280494ff10d884a3285501303c6a74ef3542
Reviewed-on: https://gerrit.libreoffice.org/50951
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 1f65e3bad4b5..65579a7fd87c 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -1345,7 +1345,7 @@ IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl, Button*, void)
mbHaveUserPassword = !aUserPW.isEmpty();
mbHaveOwnerPassword = !aOwnerPW.isEmpty();
- mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, aUserPW, true );
+ mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, aUserPW );
if( mbHaveOwnerPassword )
{
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index ab7457350f85..f6e87b717178 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -697,7 +697,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
aContext.Encryption.CanCopyOrExtract = mbCanCopyOrExtract;
aContext.Encryption.CanExtractForAccessibility = mbCanExtractForAccessibility;
if( mbEncrypt && ! xEnc.is() )
- xEnc = vcl::PDFWriter::InitEncryption( aPermissionPassword, aOpenPassword, true/*bSecurity128bit*/ );
+ xEnc = vcl::PDFWriter::InitEncryption( aPermissionPassword, aOpenPassword );
if( mbEncrypt && !aPermissionPassword.isEmpty() && ! aPreparedPermissionPassword.getLength() )
aPreparedPermissionPassword = comphelper::OStorageHelper::CreatePackageEncryptionData( aPermissionPassword );
}
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index ce45c0a6891f..c596a71a17a3 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -302,8 +302,7 @@ public:
void Replace(
const Color* pSearchColors,
const Color* pReplaceColors,
- sal_uLong nColorCount,
- const sal_uInt8* pTols = nullptr );
+ sal_uLong nColorCount );
/** Change various global color characteristics
diff --git a/include/vcl/dibtools.hxx b/include/vcl/dibtools.hxx
index f56ee96bd4e4..02c356b5cca8 100644
--- a/include/vcl/dibtools.hxx
+++ b/include/vcl/dibtools.hxx
@@ -60,11 +60,10 @@ bool VCL_DLLPUBLIC WriteDIB( // WriteDIB(rBitmap, rOStm, false, true);
bool bCompressed,
bool bFileHeader);
+// compressed, with file header
bool VCL_DLLPUBLIC WriteDIB( // WriteDIB(rBitmap, rOStm, false, true);
const BitmapEx& rSource,
- SvStream& rOStm,
- bool bCompressed,
- bool bFileHeader);
+ SvStream& rOStm);
bool VCL_DLLPUBLIC WriteDIBBitmapEx(
const BitmapEx& rSource,
diff --git a/include/vcl/opengl/OpenGLHelper.hxx b/include/vcl/opengl/OpenGLHelper.hxx
index 23b9b79a361c..ab3eca6d3acf 100644
--- a/include/vcl/opengl/OpenGLHelper.hxx
+++ b/include/vcl/opengl/OpenGLHelper.hxx
@@ -56,10 +56,8 @@ public:
/**
* The caller is responsible for allocate the memory for the RGBA buffer, before call
* this method. RGBA buffer size is assumed to be 4*width*height.
- * Since OpenGL uses textures flipped relative to BitmapEx storage this method
- * also adds the possibility to mirror the bitmap vertically at the same time.
**/
- static void ConvertBitmapExToRGBATextureBuffer(const BitmapEx& rBitmapEx, sal_uInt8* o_pRGBABuffer, const bool bFlip = false);
+ static void ConvertBitmapExToRGBATextureBuffer(const BitmapEx& rBitmapEx, sal_uInt8* o_pRGBABuffer);
static BitmapEx ConvertBGRABufferToBitmapEx(const sal_uInt8* const pBuffer, long nWidth, long nHeight);
static void renderToFile(long nWidth, long nHeight, const OUString& rFileName);
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 1db80a5b6da1..758acdb1f08d 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -723,10 +723,10 @@ The following structure describes the permissions used in PDF security
*/
std::set< ErrorCode > const & GetErrors();
+ // uses 128bit encryption
static css::uno::Reference< css::beans::XMaterialHolder >
InitEncryption( const OUString& i_rOwnerPassword,
- const OUString& i_rUserPassword,
- bool b128Bit
+ const OUString& i_rUserPassword
);
/* functions for graphics state */
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index d9daba3154a8..98c123e217b5 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -716,13 +716,12 @@ public:
/** Send event to all VCL application event listeners
- @param nEvent Event ID
@param pWin Pointer to window to send event
@param pData Pointer to data to send with event
@see ImplCallEventListeners(VclSimpleEvent* pEvent)
*/
- static void ImplCallEventListeners( VclEventId nEvent, void* pData );
+ static void ImplCallEventListenersApplicationDataChanged( void* pData );
/** Send event to all VCL application event listeners
diff --git a/lotuswordpro/source/filter/lwpbackgroundstuff.cxx b/lotuswordpro/source/filter/lwpbackgroundstuff.cxx
index 3120e3927bb7..4bce3d669545 100644
--- a/lotuswordpro/source/filter/lwpbackgroundstuff.cxx
+++ b/lotuswordpro/source/filter/lwpbackgroundstuff.cxx
@@ -145,7 +145,7 @@ std::unique_ptr<XFBGImage> LwpBackgroundStuff::GetFillPattern()
// transfer image data from XOBitmap->SvStream->BYTE-Array
SvMemoryStream aPicMemStream;
aXOBitmap.Array2Bitmap();
- WriteDIB(aXOBitmap.GetBitmap(), aPicMemStream, true, true);
+ WriteDIB(aXOBitmap.GetBitmap(), aPicMemStream);
sal_uInt32 nSize = aPicMemStream.GetEndOfData();
sal_uInt8* pImageBuff = new sal_uInt8 [nSize];
memcpy(pImageBuff, aPicMemStream.GetData(), nSize);
diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index e184ff164291..1888f8bf79f6 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -339,9 +339,6 @@ namespace vcl
* the glyphID glyphArray[i]. Character code 0 usually points to a default
* glyph (glyphID 0)
* @param nGlyphs number of glyph IDs in glyphArray and encoding values in encoding
- * @param nNameRecs number of NameRecords for the font, if 0 the name table from the
- * original font will be used
- * @param nr array of NameRecords
* @param flags or'ed TTCreationFlags
* @return return the value of SFErrCodes enum
* @see SFErrCodes
@@ -352,9 +349,7 @@ namespace vcl
const char *fname,
sal_uInt16 const *glyphArray,
sal_uInt8 const *encoding,
- int nGlyphs,
- int nNameRecs,
- NameRecord const *nr);
+ int nGlyphs);
/**
* Generates a new PostScript Type42 font and dumps it to <b>outf</b> file.
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index bbac31eb1f65..76644b4f0a11 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -318,7 +318,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile,
// write subset into destination file
nRC = ::CreateTTFromTTGlyphs( pSftFont, aToFile.getStr(), aShortIDs,
- aTempEncs, nGlyphCount, 0, nullptr );
+ aTempEncs, nGlyphCount );
::CloseTTFont(pSftFont);
return (nRC == SF_OK);
}
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 4543b6835fb7..10d4326228cc 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -660,7 +660,7 @@ void Application::SetSettings( const AllSettings& rSettings )
DataChangedEvent aDCEvt( DataChangedEventType::SETTINGS, &aOldSettings, nChangeFlags );
// notify data change handler
- ImplCallEventListeners( VclEventId::ApplicationDataChanged, &aDCEvt);
+ ImplCallEventListenersApplicationDataChanged( &aDCEvt);
// Update all windows
vcl::Window* pFirstFrame = pSVData->maWinData.mpFirstFrame;
@@ -775,10 +775,10 @@ void Application::NotifyAllWindows( DataChangedEvent& rDCEvt )
}
}
-void Application::ImplCallEventListeners( VclEventId nEvent, void* pData )
+void Application::ImplCallEventListenersApplicationDataChanged( void* pData )
{
ImplSVData* pSVData = ImplGetSVData();
- VclWindowEvent aEvent( nullptr, nEvent, pData );
+ VclWindowEvent aEvent( nullptr, VclEventId::ApplicationDataChanged, pData );
if ( pSVData->maAppData.mpEventListeners )
pSVData->maAppData.mpEventListeners->Call( aEvent );
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 7449725b4ac1..bcb1ba251132 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1911,9 +1911,7 @@ int CreateTTFromTTGlyphs(TrueTypeFont *ttf,
const char *fname,
sal_uInt16 const *glyphArray,
sal_uInt8 const *encoding,
- int nGlyphs,
- int nNameRecs,
- NameRecord const *nr)
+ int nGlyphs)
{
TrueTypeCreator *ttcr;
TrueTypeTable *head=nullptr, *hhea=nullptr, *maxp=nullptr, *cvt=nullptr, *prep=nullptr, *glyf=nullptr, *fpgm=nullptr, *cmap=nullptr, *name=nullptr, *post = nullptr, *os2 = nullptr;
@@ -1924,14 +1922,10 @@ int CreateTTFromTTGlyphs(TrueTypeFont *ttf,
/** name **/
- if (nNameRecs == 0) {
- NameRecord *names;
- int n = GetTTNameRecords(ttf, &names);
- name = TrueTypeTableNew_name(n, names);
- DisposeNameRecords(names, n);
- } else {
- name = TrueTypeTableNew_name(nNameRecs, nr);
- }
+ NameRecord *names;
+ int n = GetTTNameRecords(ttf, &names);
+ name = TrueTypeTableNew_name(n, names);
+ DisposeNameRecords(names, n);
/** maxp **/
maxp = TrueTypeTableNew_maxp(getTable(ttf, O_maxp), getTableSize(ttf, O_maxp));
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index ea883d0be6eb..83cf57c8083b 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -615,10 +615,10 @@ void BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor )
aBitmap.Replace( rSearchColor, rReplaceColor );
}
-void BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount, const sal_uInt8* pTols )
+void BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount )
{
if (!!aBitmap)
- aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, pTols );
+ aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, /*pTols*/nullptr );
}
bool BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent,
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index 95c07b589d8d..810fa381b4d5 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -1608,10 +1608,10 @@ bool ImplWriteDIBBody(const Bitmap& rBitmap, SvStream& rOStm, BitmapReadAccess c
return bRet;
}
-bool ImplWriteDIBFileHeader(SvStream& rOStm, BitmapReadAccess const & rAcc, bool bUseDIBV5)
+bool ImplWriteDIBFileHeader(SvStream& rOStm, BitmapReadAccess const & rAcc)
{
const sal_uInt32 nPalCount((rAcc.HasPalette() ? rAcc.GetPaletteEntryCount() : isBitfieldCompression(rAcc.GetScanlineFormat()) ? 3UL : 0UL));
- const sal_uInt32 nOffset(14 + (bUseDIBV5 ? DIBV5HEADERSIZE : DIBINFOHEADERSIZE) + nPalCount * 4UL);
+ const sal_uInt32 nOffset(14 + DIBINFOHEADERSIZE + nPalCount * 4UL);
rOStm.WriteUInt16( 0x4D42 ); // 'MB' from BITMAPFILEHEADER
rOStm.WriteUInt32( nOffset + (rAcc.Height() * rAcc.GetScanlineSize()) );
@@ -1686,7 +1686,7 @@ bool ImplWriteDIB(
{
if(bFileHeader)
{
- if(ImplWriteDIBFileHeader(rOStm, *pAcc, false))
+ if(ImplWriteDIBFileHeader(rOStm, *pAcc))
{
bRet = ImplWriteDIBBody(rSource, rOStm, *pAcc, pAccAlpha.get(), bCompressed);
}
@@ -1829,11 +1829,9 @@ bool WriteDIB(
bool WriteDIB(
const BitmapEx& rSource,
- SvStream& rOStm,
- bool bCompressed,
- bool bFileHeader)
+ SvStream& rOStm)
{
- return ImplWriteDIB(rSource.GetBitmapRef(), rOStm, bCompressed, bFileHeader);
+ return ImplWriteDIB(rSource.GetBitmapRef(), rOStm, /*bCompressed*/true, /*bFileHeader*/true);
}
bool WriteDIBBitmapEx(
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 42bad03edd9e..84c0586da8e3 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -1814,7 +1814,7 @@ BitmapEx GDIMetaFile::ImplBmpReplaceFnc( const BitmapEx& rBmpEx, const void* pBm
const ImplBmpReplaceParam* p = static_cast<const ImplBmpReplaceParam*>(pBmpParam);
BitmapEx aRet( rBmpEx );
- aRet.Replace( p->pSrcCols, p->pDstCols, p->nCount, nullptr );
+ aRet.Replace( p->pSrcCols, p->pDstCols, p->nCount );
return aRet;
}
diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx
index 3b9dc7f65c99..e5899449d82f 100644
--- a/vcl/source/gdi/pdfwriter.cxx
+++ b/vcl/source/gdi/pdfwriter.cxx
@@ -464,11 +464,10 @@ std::set< PDFWriter::ErrorCode > const & PDFWriter::GetErrors()
css::uno::Reference< css::beans::XMaterialHolder >
PDFWriter::InitEncryption( const OUString& i_rOwnerPassword,
- const OUString& i_rUserPassword,
- bool b128Bit
+ const OUString& i_rUserPassword
)
{
- return PDFWriterImpl::initEncryption( i_rOwnerPassword, i_rUserPassword, b128Bit );
+ return PDFWriterImpl::initEncryption( i_rOwnerPassword, i_rUserPassword, /*b128Bit*/true );
}
void PDFWriter::PlayMetafile( const GDIMetaFile& i_rMTF, const vcl::PDFWriter::PlayMetafileContext& i_rPlayContext, PDFExtOutDevData* i_pData )
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index a25a0b1e781e..43038867f7e5 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -533,7 +533,7 @@ GLint OpenGLHelper::LoadShaders(const OUString& rVertexShaderName,
return LoadShaders(rVertexShaderName, rFragmentShaderName, OUString(), "", "");
}
-void OpenGLHelper::ConvertBitmapExToRGBATextureBuffer(const BitmapEx& rBitmapEx, sal_uInt8* o_pRGBABuffer, const bool bFlip)
+void OpenGLHelper::ConvertBitmapExToRGBATextureBuffer(const BitmapEx& rBitmapEx, sal_uInt8* o_pRGBABuffer)
{
long nBmpWidth = rBitmapEx.GetSizePixel().Width();
long nBmpHeight = rBitmapEx.GetSizePixel().Height();
@@ -543,7 +543,7 @@ void OpenGLHelper::ConvertBitmapExToRGBATextureBuffer(const BitmapEx& rBitmapEx,
Bitmap::ScopedReadAccess pReadAccces( aBitmap );
AlphaMask::ScopedReadAccess pAlphaReadAccess( aAlpha );
size_t i = 0;
- for (long ny = (bFlip ? nBmpHeight - 1 : 0); (bFlip ? ny >= 0 : ny < nBmpHeight); (bFlip ? ny-- : ny++))
+ for (long ny = 0; ny < nBmpHeight; ny++)
{
Scanline pAScan = pAlphaReadAccess ? pAlphaReadAccess->GetScanline(ny) : nullptr;
for(long nx = 0; nx < nBmpWidth; nx++)
diff --git a/vcl/unx/generic/app/gensys.cxx b/vcl/unx/generic/app/gensys.cxx
index 3f2dfef56685..b512123f768e 100644
--- a/vcl/unx/generic/app/gensys.cxx
+++ b/vcl/unx/generic/app/gensys.cxx
@@ -40,48 +40,6 @@
using namespace com::sun::star;
-namespace {
-
-OUString GetNativeMessageBoxButtonText( StandardButtonType nButtonId, bool bUseResources )
-{
- OUString aText;
- if( bUseResources )
- {
- aText = Button::GetStandardText( nButtonId );
- }
- if( aText.isEmpty() )
- {
- switch( nButtonId )
- {
- case StandardButtonType::OK:
- aText = "OK";
- break;
- case StandardButtonType::Cancel:
- aText = "Cancel";
- break;
- case StandardButtonType::Abort:
- aText = "Abort";
- break;
- case StandardButtonType::Retry:
- aText = "Retry";
- break;
- case StandardButtonType::Ignore:
- aText = "Ignore";
- break;
- case StandardButtonType::Yes:
- aText = "Yes";
- break;
- case StandardButtonType::No:
- aText = "No";
- break;
- default: break;
- }
- }
- return aText;
-}
-
-}
-
SalGenericSystem::SalGenericSystem()
{
}
@@ -97,7 +55,7 @@ int SalGenericSystem::ShowNativeMessageBox( const OUString& rTitle, const OUStri
ImplHideSplash();
- aButtons.push_back( GetNativeMessageBoxButtonText( StandardButtonType::OK, false/*bUseResources*/ ) );
+ aButtons.push_back( "OK" );
nButtonIds[nBut++] = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK;
int nResult = ShowNativeDialog( rTitle, rMessage, aButtons );
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
index 5288fead1298..a66aee353449 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -1111,9 +1111,7 @@ bool PrintFontManager::createFontSubset(
aToFile.getStr(),
pGID,
pEnc,
- nGlyphs,
- 0,
- nullptr ) );
+ nGlyphs ) );
CloseTTFont( pTTFont );
return bSuccess;
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index e4c4a8be33cf..a6109af7f289 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -127,12 +127,11 @@ namespace psp
};
static css::lang::Locale normalizeInputLocale(
- const css::lang::Locale& i_rLocale,
- bool bInsertDefault
+ const css::lang::Locale& i_rLocale
)
{
css::lang::Locale aLoc( i_rLocale );
- if( bInsertDefault && aLoc.Language.isEmpty() )
+ if( aLoc.Language.isEmpty() )
{
// empty locale requested, fill in application UI locale
aLoc = Application::GetSettings().GetUILanguageTag().getLocale();
@@ -214,7 +213,7 @@ namespace psp
{
const translation_map& rMap( it->second );
- css::lang::Locale aLoc( normalizeInputLocale( css::lang::Locale(), true ) );
+ css::lang::Locale aLoc( normalizeInputLocale( css::lang::Locale() ) );
/* FIXME-BCP47: use LanguageTag::getFallbackStrings()? */
for( int nTry = 0; nTry < 4; nTry++ )
{
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index 35fb6a3fb3d4..a6e050be9328 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -1709,7 +1709,7 @@ bool WinSalGraphics::CreateFontSubset( const OUString& rToFile,
// write subset into destination file
nRC = ::CreateTTFromTTGlyphs( aSftTTF.get(), aToFile.getStr(), aShortIDs,
- aTempEncs, nGlyphCount, 0, nullptr );
+ aTempEncs, nGlyphCount );
return (nRC == SF_OK);
}
commit ba43b0cb7a62f34fcda214d43122c7c66df2e5a0
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Thu Mar 8 10:06:35 2018 +0200
drop getColor() method of Color
no longer necessary
Change-Id: I9e0fcea1134e8c5e27f9effbb5eb79fe5446e33d
Reviewed-on: https://gerrit.libreoffice.org/50925
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/basctl/source/accessibility/accessibledialogcontrolshape.cxx b/basctl/source/accessibility/accessibledialogcontrolshape.cxx
index 5502cde6d32b..25f90d11090c 100644
--- a/basctl/source/accessibility/accessibledialogcontrolshape.cxx
+++ b/basctl/source/accessibility/accessibledialogcontrolshape.cxx
@@ -447,12 +447,12 @@ sal_Int32 AccessibleDialogControlShape::getForeground( )
{
OExternalLockGuard aGuard( this );
- sal_Int32 nColor = 0;
+ Color nColor;
vcl::Window* pWindow = GetWindow();
if ( pWindow )
{
if ( pWindow->IsControlForeground() )
- nColor = pWindow->GetControlForeground().GetColor();
+ nColor = pWindow->GetControlForeground();
else
{
vcl::Font aFont;
@@ -460,11 +460,11 @@ sal_Int32 AccessibleDialogControlShape::getForeground( )
aFont = pWindow->GetControlFont();
else
aFont = pWindow->GetFont();
- nColor = aFont.GetColor().GetColor();
+ nColor = aFont.GetColor();
}
}
- return nColor;
+ return sal_Int32(nColor);
}
@@ -472,17 +472,17 @@ sal_Int32 AccessibleDialogControlShape::getBackground( )
{
OExternalLockGuard aGuard( this );
- sal_Int32 nColor = 0;
+ Color nColor;
vcl::Window* pWindow = GetWindow();
if ( pWindow )
{
if ( pWindow->IsControlBackground() )
- nColor = pWindow->GetControlBackground().GetColor();
+ nColor = pWindow->GetControlBackground();
else
- nColor = pWindow->GetBackground().GetColor().GetColor();
+ nColor = pWindow->GetBackground().GetColor();
}
- return nColor;
+ return sal_Int32(nColor);
}
diff --git a/basctl/source/accessibility/accessibledialogwindow.cxx b/basctl/source/accessibility/accessibledialogwindow.cxx
index 473f698d53d8..c7f66797e2a8 100644
--- a/basctl/source/accessibility/accessibledialogwindow.cxx
+++ b/basctl/source/accessibility/accessibledialogwindow.cxx
@@ -758,11 +758,11 @@ sal_Int32 AccessibleDialogWindow::getForeground( )
{
OExternalLockGuard aGuard( this );
- sal_Int32 nColor = 0;
+ Color nColor;
if ( m_pDialogWindow )
{
if ( m_pDialogWindow->IsControlForeground() )
- nColor = m_pDialogWindow->GetControlForeground().GetColor();
+ nColor = m_pDialogWindow->GetControlForeground();
else
{
vcl::Font aFont;
@@ -770,11 +770,11 @@ sal_Int32 AccessibleDialogWindow::getForeground( )
aFont = m_pDialogWindow->GetControlFont();
else
aFont = m_pDialogWindow->GetFont();
- nColor = aFont.GetColor().GetColor();
+ nColor = aFont.GetColor();
}
}
- return nColor;
+ return sal_Int32(nColor);
}
@@ -782,16 +782,16 @@ sal_Int32 AccessibleDialogWindow::getBackground( )
{
OExternalLockGuard aGuard( this );
- sal_Int32 nColor = 0;
+ Color nColor;
if ( m_pDialogWindow )
{
if ( m_pDialogWindow->IsControlBackground() )
- nColor = m_pDialogWindow->GetControlBackground().GetColor();
+ nColor = m_pDialogWindow->GetControlBackground();
else
- nColor = m_pDialogWindow->GetBackground().GetColor().GetColor();
+ nColor = m_pDialogWindow->GetBackground().GetColor();
}
- return nColor;
+ return sal_Int32(nColor);
}
diff --git a/include/tools/color.hxx b/include/tools/color.hxx
index 7d9202282ea9..1b8fb3eecdd1 100644
--- a/include/tools/color.hxx
+++ b/include/tools/color.hxx
@@ -74,7 +74,7 @@ public:
bool operator<(const Color& b) const
{
- return mnColor < b.GetColor();
+ return mnColor < b.mnColor;
}
void SetRed(sal_uInt8 nRed);
@@ -98,10 +98,6 @@ public:
return COLORDATA_TRANSPARENCY(mnColor);
}
- sal_uInt32 GetColor() const
- {
- return mnColor;
- }
Color GetRGBColor() const
{
return COLORDATA_RGB(mnColor);
diff --git a/sc/qa/extras/new_cond_format.cxx b/sc/qa/extras/new_cond_format.cxx
index b6587e6059e7..e3bf1e2a44ad 100644
--- a/sc/qa/extras/new_cond_format.cxx
+++ b/sc/qa/extras/new_cond_format.cxx
@@ -201,26 +201,26 @@ void testUseGradient(uno::Reference<beans::XPropertySet> const & xPropSet, bool
void testPositiveColor(uno::Reference<beans::XPropertySet> const & xPropSet, Color aColor)
{
- sal_Int32 nColor = 0;
+ ::Color nColor;
uno::Any aAny = xPropSet->getPropertyValue("Color");
CPPUNIT_ASSERT(aAny >>= nColor);
- CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), sal_uInt32(nColor));
+ CPPUNIT_ASSERT_EQUAL(aColor, nColor);
}
void testNegativeColor(uno::Reference<beans::XPropertySet> const & xPropSet, Color aColor)
{
- sal_Int32 nColor = 0;
+ ::Color nColor;
uno::Any aAny = xPropSet->getPropertyValue("NegativeColor");
CPPUNIT_ASSERT(aAny >>= nColor);
- CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), sal_uInt32(nColor));
+ CPPUNIT_ASSERT_EQUAL(aColor, nColor);
}
void testAxisColor(uno::Reference<beans::XPropertySet> const & xPropSet, Color aColor)
{
- sal_Int32 nColor = 0;
+ ::Color nColor;
uno::Any aAny = xPropSet->getPropertyValue("AxisColor");
CPPUNIT_ASSERT(aAny >>= nColor);
- CPPUNIT_ASSERT_EQUAL(aColor.GetColor(), sal_uInt32(nColor));
+ CPPUNIT_ASSERT_EQUAL(aColor, nColor);
}
void testDataBarEntryValue(uno::Reference<sheet::XDataBarEntry> const & xEntry,
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index fe073203818b..688378166014 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -2691,7 +2691,7 @@ void ScExportTest::testSheetTabColorsXLSX()
for (size_t i = 0; i < SAL_N_ELEMENTS(aXclColors); ++i)
{
- if (aXclColors[i] != rDoc.GetTabBgColor(i).GetColor())
+ if (aXclColors[i] != rDoc.GetTabBgColor(i))
{
cerr << "wrong sheet color for sheet " << i << endl;
return false;
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index 54e411a482f7..8c920a516973 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -377,12 +377,12 @@ void SdOOXMLExportTest1::testBnc880763()
CPPUNIT_ASSERT(pObjGroup);
const SdrObject *pObj = pObjGroup->GetSubList()->GetObj(0);
CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr);
- CPPUNIT_ASSERT_EQUAL( sal_uInt32(0x0000ff),(static_cast< const XColorItem& >(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue().GetColor());
+ CPPUNIT_ASSERT_EQUAL( Color(0x0000ff),(static_cast< const XColorItem& >(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue());
// Second object at the front has green background color
pObj = pPage->GetObj(2); // FIXME should be 1, smartart import creates an additional empty group for some reason
CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr);
- CPPUNIT_ASSERT_EQUAL( sal_uInt32(0x00ff00),(static_cast< const XColorItem& >(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue().GetColor());
+ CPPUNIT_ASSERT_EQUAL( Color(0x00ff00),(static_cast< const XColorItem& >(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue());
xDocShRef->DoClose();
}
@@ -617,7 +617,7 @@ void SdOOXMLExportTest1::testBulletColor()
const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
const SvxNumBulletItem *pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET);
CPPUNIT_ASSERT(pNumFmt);
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's color is wrong!", sal_uInt32(0xff0000),pNumFmt->GetNumRule()->GetLevel(0).GetBulletColor().GetColor());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's color is wrong!", Color(0xff0000),pNumFmt->GetNumRule()->GetLevel(0).GetBulletColor());
xDocShRef->DoClose();
}
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index bc343af65ba5..27265d21bb21 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -450,7 +450,7 @@ void SdImportTest::testN862510_4()
for( std::vector<EECharAttrib>::reverse_iterator it = rLst.rbegin(); it != rLst.rend(); ++it )
{
const SvxColorItem *pC = dynamic_cast<const SvxColorItem *>( (*it).pAttr );
- CPPUNIT_ASSERT_MESSAGE( "gradfill for text color not handled!", !( pC && pC->GetValue().GetColor() == 0 ) );
+ CPPUNIT_ASSERT_MESSAGE( "gradfill for text color not handled!", !( pC && pC->GetValue() == Color(0) ) );
}
}
@@ -1774,7 +1774,7 @@ void SdImportTest::testTdf103477()
const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject();
const SvxNumBulletItem *pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET);
CPPUNIT_ASSERT(pNumFmt);
- CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's color is wrong!", sal_uInt32(0x000000), pNumFmt->GetNumRule()->GetLevel(1).GetBulletColor().GetColor());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's color is wrong!", Color(0x000000), pNumFmt->GetNumRule()->GetLevel(1).GetBulletColor());
xDocShRef->DoClose();
}
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 512e945cad86..a51bc3c260a1 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -412,7 +412,7 @@ template<> struct assertion_traits<Color>
static std::string toString( const Color& c )
{
OStringStream ost;
- ost << static_cast<unsigned int>(c.GetColor());
+ ost << static_cast<sal_uInt32>(c);
return ost.str();
}
};
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index dde6470aeb08..f9a10a44020b 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -465,7 +465,7 @@ public:
}
virtual Color ReadPixel() override
{
- return mrPalette[ *pData++ ].GetColor().GetColor();
+ return mrPalette[ *pData++ ].GetColor();
}
virtual void WritePixel( Color nColor ) override
{
@@ -508,7 +508,7 @@ public:
const BitmapColor& rColor = mrPalette[( pData[mnX >> 1] >> mnShift) & 0x0f];
mnX++;
mnShift ^= 4;
- return rColor.GetColor().GetColor();
+ return rColor.GetColor();
}
virtual void WritePixel( Color nColor ) override
{
@@ -546,7 +546,7 @@ public:
{
const BitmapColor& rColor = mrPalette[ (pData[mnX >> 3 ] >> ( 7 - ( mnX & 7 ) )) & 1];
mnX++;
- return rColor.GetColor().GetColor();
+ return rColor.GetColor();
}
virtual void WritePixel( Color nColor ) override
{
More information about the Libreoffice-commits
mailing list