summaryrefslogtreecommitdiff
path: root/vcl/unx/generic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-29 11:18:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-30 08:43:51 +0200
commitdd8d5e5795358d732a9f7a8af7c35f662321e332 (patch)
tree9983c2a5f0bc3f2c29133aa57e4ceb510eb68a11 /vcl/unx/generic
parent22f2cf3ccc6d0c9ba2c2860735e789d6b3a25f72 (diff)
improve loplugin:stringconstant
to find more places we can elide the OUString() constructor at call sites Change-Id: Ie09f3c61f2c4b4959c97dc98ebcbaf7c51d5d713 Reviewed-on: https://gerrit.libreoffice.org/71514 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r--vcl/unx/generic/print/printerjob.cxx2
-rw-r--r--vcl/unx/generic/print/prtsetup.cxx12
-rw-r--r--vcl/unx/generic/printer/jobdata.cxx12
-rw-r--r--vcl/unx/generic/printer/ppdparser.cxx38
-rw-r--r--vcl/unx/generic/printer/printerinfomanager.cxx6
5 files changed, 35 insertions, 35 deletions
diff --git a/vcl/unx/generic/print/printerjob.cxx b/vcl/unx/generic/print/printerjob.cxx
index f79e174225bf..4b00e8924b47 100644
--- a/vcl/unx/generic/print/printerjob.cxx
+++ b/vcl/unx/generic/print/printerjob.cxx
@@ -789,7 +789,7 @@ void PrinterJob::writeJobPatch( osl::File* pFile, const JobData& rJobData )
const PPDKey* pKey = nullptr;
if( rJobData.m_pParser )
- pKey = rJobData.m_pParser->getKey( OUString( "JobPatchFile" ) );
+ pKey = rJobData.m_pParser->getKey( "JobPatchFile" );
if( ! pKey )
return;
diff --git a/vcl/unx/generic/print/prtsetup.cxx b/vcl/unx/generic/print/prtsetup.cxx
index 6a38db31b1d9..d3c565846c17 100644
--- a/vcl/unx/generic/print/prtsetup.cxx
+++ b/vcl/unx/generic/print/prtsetup.cxx
@@ -178,7 +178,7 @@ void RTSPaperPage::update()
// duplex
if( m_pParent->m_aJobData.m_pParser &&
- (pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString( "Duplex" ) )) )
+ (pKey = m_pParent->m_aJobData.m_pParser->getKey( "Duplex" )) )
{
m_pParent->insertAllPPDValues( *m_xDuplexBox, m_pParent->m_aJobData.m_pParser, pKey );
}
@@ -190,7 +190,7 @@ void RTSPaperPage::update()
// paper
if( m_pParent->m_aJobData.m_pParser &&
- (pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString( "PageSize" ) )) )
+ (pKey = m_pParent->m_aJobData.m_pParser->getKey( "PageSize" )) )
{
m_pParent->insertAllPPDValues( *m_xPaperBox, m_pParent->m_aJobData.m_pParser, pKey );
}
@@ -202,7 +202,7 @@ void RTSPaperPage::update()
// input slots
if( m_pParent->m_aJobData.m_pParser &&
- (pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString("InputSlot") )) )
+ (pKey = m_pParent->m_aJobData.m_pParser->getKey( "InputSlot" )) )
{
m_pParent->insertAllPPDValues( *m_xSlotBox, m_pParent->m_aJobData.m_pParser, pKey );
}
@@ -236,17 +236,17 @@ IMPL_LINK( RTSPaperPage, SelectHdl, weld::ComboBox&, rBox, void )
if( &rBox == m_xPaperBox.get() )
{
if( m_pParent->m_aJobData.m_pParser )
- pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString( "PageSize" ) );
+ pKey = m_pParent->m_aJobData.m_pParser->getKey( "PageSize" );
}
else if( &rBox == m_xDuplexBox.get() )
{
if( m_pParent->m_aJobData.m_pParser )
- pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString( "Duplex" ) );
+ pKey = m_pParent->m_aJobData.m_pParser->getKey( "Duplex" );
}
else if( &rBox == m_xSlotBox.get() )
{
if( m_pParent->m_aJobData.m_pParser )
- pKey = m_pParent->m_aJobData.m_pParser->getKey( OUString( "InputSlot" ) );
+ pKey = m_pParent->m_aJobData.m_pParser->getKey( "InputSlot" );
}
else if( &rBox == m_xOrientBox.get() )
{
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index 02d10cf48077..11f1b931ecaf 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -66,17 +66,17 @@ void JobData::setCollate( bool bCollate )
const PPDParser* pParser = m_aContext.getParser();
if( pParser )
{
- const PPDKey* pKey = pParser->getKey( OUString( "Collate" ) );
+ const PPDKey* pKey = pParser->getKey( "Collate" );
if( pKey )
{
const PPDValue* pVal = nullptr;
if( bCollate )
- pVal = pKey->getValue( OUString( "True" ) );
+ pVal = pKey->getValue( "True" );
else
{
- pVal = pKey->getValue( OUString( "False" ) );
+ pVal = pKey->getValue( "False" );
if( ! pVal )
- pVal = pKey->getValue( OUString( "None" ) );
+ pVal = pKey->getValue( "None" );
}
m_aContext.setValue( pKey, pVal );
}
@@ -89,7 +89,7 @@ void JobData::setPaper( int i_nWidth, int i_nHeight )
{
OUString aPaper( m_pParser->matchPaper( i_nWidth, i_nHeight ) );
- const PPDKey* pKey = m_pParser->getKey( OUString( "PageSize" ) );
+ const PPDKey* pKey = m_pParser->getKey( "PageSize" );
const PPDValue* pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : nullptr;
if (pKey && pValue)
@@ -101,7 +101,7 @@ void JobData::setPaperBin( int i_nPaperBin )
{
if( m_pParser )
{
- const PPDKey* pKey = m_pParser->getKey( OUString( "InputSlot" ) );
+ const PPDKey* pKey = m_pParser->getKey( "InputSlot" );
const PPDValue* pValue = pKey ? pKey->getValue( i_nPaperBin ) : nullptr;
if (pKey && pValue)
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index d05455e47d14..4fc3bc79ac61 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -604,7 +604,7 @@ PPDParser::PPDParser(const OUString& rFile, const std::vector<PPDKey*>& keys)
// fill in shortcuts
const PPDKey* pKey;
- pKey = getKey( OUString( "PageSize" ) );
+ pKey = getKey( "PageSize" );
if ( pKey ) {
std::unique_ptr<PPDKey> pImageableAreas(new PPDKey("ImageableArea"));
@@ -644,7 +644,7 @@ PPDParser::PPDParser(const OUString& rFile, const std::vector<PPDKey*>& keys)
insertKey(std::move(pPaperDimensions));
}
- m_pImageableAreas = getKey( OUString( "ImageableArea" ) );
+ m_pImageableAreas = getKey( "ImageableArea" );
const PPDValue* pDefaultImageableArea = nullptr;
if( m_pImageableAreas )
pDefaultImageableArea = m_pImageableAreas->getDefaultValue();
@@ -655,7 +655,7 @@ PPDParser::PPDParser(const OUString& rFile, const std::vector<PPDKey*>& keys)
SAL_WARN( "vcl.unx.print", "no DefaultImageableArea in " << m_aFile);
}
- m_pPaperDimensions = getKey( OUString( "PaperDimension" ) );
+ m_pPaperDimensions = getKey( "PaperDimension" );
if( m_pPaperDimensions )
m_pDefaultPaperDimension = m_pPaperDimensions->getDefaultValue();
if (m_pPaperDimensions == nullptr) {
@@ -665,7 +665,7 @@ PPDParser::PPDParser(const OUString& rFile, const std::vector<PPDKey*>& keys)
SAL_WARN( "vcl.unx.print", "no DefaultPaperDimensions in " << m_aFile);
}
- auto pResolutions = getKey( OUString( "Resolution" ) );
+ auto pResolutions = getKey( "Resolution" );
if( pResolutions )
m_pDefaultResolution = pResolutions->getDefaultValue();
if (pResolutions == nullptr) {
@@ -673,19 +673,19 @@ PPDParser::PPDParser(const OUString& rFile, const std::vector<PPDKey*>& keys)
}
SAL_INFO_IF(!m_pDefaultResolution, "vcl.unx.print", "no DefaultResolution in " + m_aFile);
- auto pInputSlots = getKey( OUString( "InputSlot" ) );
+ auto pInputSlots = getKey( "InputSlot" );
if( pInputSlots )
m_pDefaultInputSlot = pInputSlots->getDefaultValue();
SAL_INFO_IF(!pInputSlots, "vcl.unx.print", "no InputSlot in " << m_aFile);
SAL_INFO_IF(!m_pDefaultInputSlot, "vcl.unx.print", "no DefaultInputSlot in " << m_aFile);
- auto pFontList = getKey( OUString( "Font" ) );
+ auto pFontList = getKey( "Font" );
if (pFontList == nullptr) {
SAL_WARN( "vcl.unx.print", "no Font in " << m_aFile);
}
// fill in direct values
- if( (pKey = getKey( OUString( "print-color-mode" ) )) )
+ if( (pKey = getKey( "print-color-mode" )) )
m_bColorDevice = pKey->countValues() > 1;
}
@@ -810,7 +810,7 @@ PPDParser::PPDParser( const OUString& rFile ) :
// fill in shortcuts
const PPDKey* pKey;
- m_pImageableAreas = getKey( OUString( "ImageableArea" ) );
+ m_pImageableAreas = getKey( "ImageableArea" );
const PPDValue * pDefaultImageableArea = nullptr;
if( m_pImageableAreas )
pDefaultImageableArea = m_pImageableAreas->getDefaultValue();
@@ -821,7 +821,7 @@ PPDParser::PPDParser( const OUString& rFile ) :
SAL_WARN( "vcl.unx.print", "no DefaultImageableArea in " << m_aFile);
}
- m_pPaperDimensions = getKey( OUString( "PaperDimension" ) );
+ m_pPaperDimensions = getKey( "PaperDimension" );
if( m_pPaperDimensions )
m_pDefaultPaperDimension = m_pPaperDimensions->getDefaultValue();
if (m_pPaperDimensions == nullptr) {
@@ -831,7 +831,7 @@ PPDParser::PPDParser( const OUString& rFile ) :
SAL_WARN( "vcl.unx.print", "no DefaultPaperDimensions in " << m_aFile);
}
- auto pResolutions = getKey( OUString( "Resolution" ) );
+ auto pResolutions = getKey( "Resolution" );
if( pResolutions )
m_pDefaultResolution = pResolutions->getDefaultValue();
if (pResolutions == nullptr) {
@@ -839,30 +839,30 @@ PPDParser::PPDParser( const OUString& rFile ) :
}
SAL_INFO_IF(!m_pDefaultResolution, "vcl.unx.print", "no DefaultResolution in " + m_aFile);
- auto pInputSlots = getKey( OUString( "InputSlot" ) );
+ auto pInputSlots = getKey( "InputSlot" );
if( pInputSlots )
m_pDefaultInputSlot = pInputSlots->getDefaultValue();
SAL_INFO_IF(!pInputSlots, "vcl.unx.print", "no InputSlot in " << m_aFile);
SAL_INFO_IF(!m_pDefaultInputSlot, "vcl.unx.print", "no DefaultInputSlot in " << m_aFile);
- auto pFontList = getKey( OUString( "Font" ) );
+ auto pFontList = getKey( "Font" );
if (pFontList == nullptr) {
SAL_WARN( "vcl.unx.print", "no Font in " << m_aFile);
}
// fill in direct values
- if ((pKey = getKey(OUString("ColorDevice"))))
+ if ((pKey = getKey("ColorDevice")))
{
if (const PPDValue* pValue = pKey->getValue(0))
m_bColorDevice = pValue->m_aValue.startsWithIgnoreAsciiCase("true");
}
- if ((pKey = getKey(OUString("LanguageLevel"))))
+ if ((pKey = getKey("LanguageLevel")))
{
if (const PPDValue* pValue = pKey->getValue(0))
m_nLanguageLevel = pValue->m_aValue.toInt32();
}
- if ((pKey = getKey(OUString("TTRasterizer"))))
+ if ((pKey = getKey("TTRasterizer")))
{
if (const PPDValue* pValue = pKey->getValue(0))
m_bType42Capable = pValue->m_aValue.equalsIgnoreAsciiCase( "Type42" );
@@ -1757,9 +1757,9 @@ bool PPDContext::resetValue( const PPDKey* pKey, bool bDefaultable )
if( ! pKey || ! m_pParser || ! m_pParser->hasKey( pKey ) )
return false;
- const PPDValue* pResetValue = pKey->getValue( OUString( "None" ) );
+ const PPDValue* pResetValue = pKey->getValue( "None" );
if( ! pResetValue )
- pResetValue = pKey->getValue( OUString( "False" ) );
+ pResetValue = pKey->getValue( "False" );
if( ! pResetValue && bDefaultable )
pResetValue = pKey->getDefaultValue();
@@ -1938,7 +1938,7 @@ int PPDContext::getRenderResolution() const
if( m_pParser )
{
int nDPIx = 300, nDPIy = 300;
- const PPDKey* pKey = m_pParser->getKey( OUString( "Resolution" ) );
+ const PPDKey* pKey = m_pParser->getKey( "Resolution" );
if( pKey )
{
const PPDValue* pValue = getValue( pKey );
@@ -1963,7 +1963,7 @@ void PPDContext::getPageSize( OUString& rPaper, int& rWidth, int& rHeight ) cons
rHeight = 842;
if( m_pParser )
{
- const PPDKey* pKey = m_pParser->getKey( OUString( "PageSize" ) );
+ const PPDKey* pKey = m_pParser->getKey( "PageSize" );
if( pKey )
{
const PPDValue* pValue = getValue( pKey );
diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx
index 28ba5eee2e7b..f70141c9e16c 100644
--- a/vcl/unx/generic/printer/printerinfomanager.cxx
+++ b/vcl/unx/generic/printer/printerinfomanager.cxx
@@ -501,8 +501,8 @@ void PrinterInfoManager::initialize()
{
PrinterInfo aDefaultInfo( getPrinterInfo( m_aDefaultPrinter ) );
- const PPDKey* pDefKey = aDefaultInfo.m_pParser->getKey( OUString( "PageSize" ) );
- const PPDKey* pMergeKey = aMergeInfo.m_pParser->getKey( OUString( "PageSize" ) );
+ const PPDKey* pDefKey = aDefaultInfo.m_pParser->getKey( "PageSize" );
+ const PPDKey* pMergeKey = aMergeInfo.m_pParser->getKey( "PageSize" );
const PPDValue* pDefValue = aDefaultInfo.m_aContext.getValue( pDefKey );
const PPDValue* pMergeValue = pMergeKey ? pMergeKey->getValue( pDefValue->m_aOption ) : nullptr;
if( pMergeKey && pMergeValue )
@@ -603,7 +603,7 @@ void PrinterInfoManager::setDefaultPaper( PPDContext& rContext ) const
if( ! rContext.getParser() )
return;
- const PPDKey* pPageSizeKey = rContext.getParser()->getKey( OUString( "PageSize" ) );
+ const PPDKey* pPageSizeKey = rContext.getParser()->getKey( "PageSize" );
if( ! pPageSizeKey )
return;