[Libreoffice-commits] core.git: 2 commits - basic/source compilerplugins/clang cui/source filter/source framework/source sc/source sd/source sfx2/source sw/source unotools/source xmloff/source
Caolán McNamara
caolanm at redhat.com
Thu Sep 3 00:34:22 PDT 2015
basic/source/classes/sbunoobj.cxx | 8 +++---
compilerplugins/clang/stringconstant.cxx | 10 ++++++++
cui/source/customize/cfg.cxx | 6 ++---
cui/source/dialogs/hldocntp.cxx | 2 -
cui/source/dialogs/hldoctp.cxx | 2 -
filter/source/svg/svgexport.cxx | 2 -
framework/source/fwe/helper/configimporter.cxx | 2 -
framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx | 2 -
framework/source/uiconfiguration/uiconfigurationmanager.cxx | 2 -
sc/source/ui/docshell/impex.cxx | 8 +++---
sd/source/ui/unoidl/unopage.cxx | 2 -
sfx2/source/sidebar/Tools.cxx | 2 -
sw/source/filter/ww8/ww8scan.cxx | 11 ---------
sw/source/filter/ww8/ww8scan.hxx | 6 -----
sw/source/uibase/utlui/attrdesc.cxx | 2 -
sw/source/uibase/utlui/unotools.cxx | 2 -
unotools/source/config/bootstrap.cxx | 6 ++---
xmloff/source/text/XMLIndexMarkExport.cxx | 2 -
xmloff/source/text/txtfldi.cxx | 12 +++++-----
xmloff/source/text/txtvfldi.cxx | 10 ++++----
20 files changed, 46 insertions(+), 53 deletions(-)
New commits:
commit 29107378ceed6a76431f27894a3b5753b32e0c31
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Sep 2 17:05:24 2015 +0100
the ww8 dumper is long dead
Change-Id: I8f19daac5ad6bc9e90e9eab5da206a392777473e
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 27822fa..eca4dc3 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -31,16 +31,9 @@
#include <rtl/tencinfo.h>
#include <sal/macros.h>
-#ifdef DUMP
-
-#define ERR_SWG_READ_ERROR 1234
-#define OSL_ENSURE( a, b )
-
-#else // dump
#include <swerror.h>
#include <swtypes.hxx>
-#endif // dump
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include <unotools/localedatawrapper.hxx>
@@ -4344,8 +4337,6 @@ bool WW8PLCFx_AtnBook::getIsEnd() const
return m_bIsEnd;
}
-#ifndef DUMP
-
// In the end of an paragraph in WW6 the attribute extends after the <CR>.
// This will be reset by one character to be used with SW,
// if we don't expect trouble thereby.
@@ -5108,8 +5099,6 @@ bool WW8PLCFMan::HasCharSprm(sal_uInt16 nId,
return static_cast<WW8PLCFx_Cp_FKP*>(pChp->pPLCFx)->HasSprm(nId, rResult);
}
-#endif // !DUMP
-
void WW8PLCFx::Save( WW8PLCFxSave1& rSave ) const
{
rSave.nPLCFxPos = GetIdx();
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index 019bf5c..8dbed12 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -868,8 +868,6 @@ struct WW8PLCFxDesc
void ReduceByOffset();
};
-#ifndef DUMP
-
struct WW8PLCFxSaveAll;
class WW8PLCFMan
{
@@ -967,8 +965,6 @@ struct WW8PLCFxSaveAll
}
};
-#endif // !DUMP
-
class WW8ScannerBase
{
friend WW8PLCFx_PCDAttrs::WW8PLCFx_PCDAttrs(ww::WordVersion eVersion,
@@ -976,10 +972,8 @@ friend WW8PLCFx_PCDAttrs::WW8PLCFx_PCDAttrs(ww::WordVersion eVersion,
friend WW8PLCFx_Cp_FKP::WW8PLCFx_Cp_FKP( SvStream*, SvStream*, SvStream*,
const WW8ScannerBase&, ePLCFT );
-#ifndef DUMP
friend WW8PLCFMan::WW8PLCFMan(WW8ScannerBase*, ManTypes, long, bool);
friend class SwWW8FltControlStack;
-#endif
private:
WW8Fib* pWw8Fib;
commit 37a6fdf890d49a20a57aeb41021dc0ff663cc628
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Sep 3 09:33:39 2015 +0200
loplugin:stringconstant also for cases using char const v[] = "..."
Change-Id: Iba38686620624178a7be39d703389402bbcea4cb
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index e5b05fc..da07e3b 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -966,7 +966,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal )
OUStringBuffer aSeqTypeName;
for( short iDim = 0 ; iDim < nDims ; iDim++ )
{
- aSeqTypeName.appendAscii(aSeqLevelStr);
+ aSeqTypeName.append(aSeqLevelStr);
}
aSeqTypeName.append(aElementType.getTypeName());
aRetType = Type( TypeClass_SEQUENCE, aSeqTypeName.makeStringAndClear() );
@@ -1104,7 +1104,7 @@ static Any implRekMultiDimArrayToSequence( SbxDimArray* pArray,
sal_Int32 i;
for( i = 0 ; i < nSeqLevel ; i++ )
{
- aSeqTypeName.appendAscii(aSeqLevelStr);
+ aSeqTypeName.append(aSeqLevelStr);
}
aSeqTypeName.append(aElemType.getTypeName());
Type aSeqType( TypeClass_SEQUENCE, aSeqTypeName.makeStringAndClear() );
@@ -1769,7 +1769,7 @@ OUString Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj )
OUStringBuffer aRet;
if( eType != TypeClass_INTERFACE )
{
- aRet.appendAscii( ID_DBG_SUPPORTEDINTERFACES );
+ aRet.append( ID_DBG_SUPPORTEDINTERFACES );
aRet.append( " not available.\n(TypeClass is not TypeClass_INTERFACE)\n" );
}
else
@@ -5018,7 +5018,7 @@ void SbUnoStructRefObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if( nId == -1 ) // Property ID_DBG_SUPPORTEDINTERFACES"
{
OUStringBuffer aRet;
- aRet.appendAscii( ID_DBG_SUPPORTEDINTERFACES );
+ aRet.append( ID_DBG_SUPPORTEDINTERFACES );
aRet.append( " not available.\n(TypeClass is not TypeClass_INTERFACE)\n" );
pVar->PutString( aRet.makeStringAndClear() );
diff --git a/compilerplugins/clang/stringconstant.cxx b/compilerplugins/clang/stringconstant.cxx
index 5c675a8..2688542 100644
--- a/compilerplugins/clang/stringconstant.cxx
+++ b/compilerplugins/clang/stringconstant.cxx
@@ -781,6 +781,16 @@ bool StringConstant::isStringConstant(
{
return false;
}
+ DeclRefExpr const * dre = dyn_cast<DeclRefExpr>(expr);
+ if (dre != nullptr) {
+ VarDecl const * var = dyn_cast<VarDecl>(dre->getDecl());
+ if (var != nullptr) {
+ Expr const * init = var->getAnyInitializer();
+ if (init != nullptr) {
+ expr = init->IgnoreParenImpCasts();
+ }
+ }
+ }
StringLiteral const * lit = dyn_cast<StringLiteral>(expr);
if (lit != nullptr) {
if (!lit->isAscii()) {
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 2664fcc..a0924ce 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -305,7 +305,7 @@ generateCustomURL(
SvxEntries* entries )
{
OUString url = OUString(ITEM_TOOLBAR_URL );
- url += OUString(CUSTOM_TOOLBAR_STR );
+ url += CUSTOM_TOOLBAR_STR;
// use a random number to minimize possible clash with existing custom toolbars
url += OUString::number( generateRandomValue(), 16 );
@@ -1134,7 +1134,7 @@ bool MenuSaveInData::LoadSubMenus(
if ( !subMenuTitle.isEmpty() )
{
- subMenuTitle += OUString( aMenuSeparatorStr);
+ subMenuTitle += aMenuSeparatorStr;
}
else
{
@@ -1933,7 +1933,7 @@ void SvxConfigPage::AddSubMenusToUI(
if ( pEntryData->IsPopup() )
{
OUString subMenuTitle( rBaseTitle );
- subMenuTitle += OUString(aMenuSeparatorStr);
+ subMenuTitle += aMenuSeparatorStr;
subMenuTitle += stripHotKey( pEntryData->GetName() );
sal_uInt16 nPos = m_pTopLevelListBox->InsertEntry( subMenuTitle );
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 3acb9fe..12d98d1 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -436,7 +436,7 @@ IMPL_LINK_NOARG_TYPED(SvxHyperlinkNewDocTp, ClickNewHdl_Impl, Button*, void)
OUString aStrTmp( xFolderPicker->getDirectory() );
if( aStrTmp[ aStrTmp.getLength() - 1 ] != sSlash[0] )
- aStrTmp += OUString( sSlash );
+ aStrTmp += sSlash;
// append old file name
if( bHandleFileName )
diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx
index 92c15d7..764d5f3 100644
--- a/cui/source/dialogs/hldoctp.cxx
+++ b/cui/source/dialogs/hldoctp.cxx
@@ -135,7 +135,7 @@ OUString SvxHyperlinkDocTp::GetCurrentURL ()
if( !aStrMark.isEmpty() )
{
- aStrURL += OUString( sHash );
+ aStrURL += sHash;
aStrURL += aStrMark;
}
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 1773740..e39627b 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -1352,7 +1352,7 @@ bool SVGFilter::implExportTextEmbeddedBitmaps()
#define SVGFILTER_EXPORT_SVGSCRIPT( z, n, aFragment ) \
- xExtDocHandler->unknown( OUString::createFromAscii( aFragment ## n ) );
+ xExtDocHandler->unknown( aFragment ## n );
bool SVGFilter::implGenerateScript()
{
diff --git a/framework/source/fwe/helper/configimporter.cxx b/framework/source/fwe/helper/configimporter.cxx
index a51b485..e1306991 100644
--- a/framework/source/fwe/helper/configimporter.cxx
+++ b/framework/source/fwe/helper/configimporter.cxx
@@ -44,7 +44,7 @@ bool UIConfigurationImporterOOo1x::ImportCustomToolbars(
for ( sal_uInt16 i = 1; i <= 4; i++ )
{
OUStringBuffer aCustomTbxName( 20 );
- aCustomTbxName.appendAscii( USERDEFTOOLBOX );
+ aCustomTbxName.append( USERDEFTOOLBOX );
aCustomTbxName[14] = aCustomTbxName[14] + i;
OUString aTbxStreamName( aCustomTbxName.makeStringAndClear() );
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index 844b557..1b3ab4a 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -366,7 +366,7 @@ void ModuleUIConfigurationManager::impl_preloadUIElementTypeList( Layer eLayer,
if ( xElementTypeStorage.is() )
{
OUStringBuffer aBuf( RESOURCEURL_PREFIX_SIZE );
- aBuf.appendAscii( RESOURCEURL_PREFIX );
+ aBuf.append( RESOURCEURL_PREFIX );
aBuf.appendAscii( UIELEMENTTYPENAMES[ nElementType ] );
aBuf.append( "/" );
OUString aResURLPrefix( aBuf.makeStringAndClear() );
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index 6f68a31..a4a9675 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -289,7 +289,7 @@ void UIConfigurationManager::impl_preloadUIElementTypeList( sal_Int16 nElementTy
if ( xElementTypeStorage.is() )
{
OUStringBuffer aBuf( RESOURCEURL_PREFIX_SIZE );
- aBuf.appendAscii( RESOURCEURL_PREFIX );
+ aBuf.append( RESOURCEURL_PREFIX );
aBuf.appendAscii( UIELEMENTTYPENAMES[ nElementType ] );
aBuf.append( "/" );
OUString aResURLPrefix( aBuf.makeStringAndClear() );
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index c9f2c70..da82e0b 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -695,11 +695,11 @@ static void lcl_UnescapeSylk( OUString & rString, SylkVersion eVersion )
// Older versions quoted the string and doubled embedded quotes, but not
// the semicolons, which was plain wrong.
if (eVersion >= SYLK_OOO32)
- rString = rString.replaceAll(OUString(DOUBLE_SEMICOLON), ";");
+ rString = rString.replaceAll(DOUBLE_SEMICOLON, ";");
else
- rString = rString.replaceAll(OUString(DOUBLE_DOUBLEQUOTE), "\"");
+ rString = rString.replaceAll(DOUBLE_DOUBLEQUOTE, "\"");
- rString = rString.replaceAll(OUString(SYLK_LF), "\n");
+ rString = rString.replaceAll(SYLK_LF, "\n");
}
static const sal_Unicode* lcl_ScanSylkString( const sal_Unicode* p,
@@ -2002,7 +2002,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
case CELLTYPE_EDIT:
hasstring:
aCellStr = pDoc->GetString(nCol, nRow, aRange.aStart.Tab());
- aCellStr = aCellStr.replaceAll("\n", OUString(SYLK_LF));
+ aCellStr = aCellStr.replaceAll("\n", SYLK_LF);
aBufStr = "C;X";
aBufStr += OUString::number( c );
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 98e6c33..6d22bec 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2154,7 +2154,7 @@ OUString getPageApiName( SdPage* pPage )
if( aPageName.isEmpty() )
{
OUStringBuffer sBuffer;
- sBuffer.appendAscii( sEmptyPageName );
+ sBuffer.append( sEmptyPageName );
const sal_Int32 nPageNum = ( ( pPage->GetPageNum() - 1 ) >> 1 ) + 1;
sBuffer.append( nPageNum );
aPageName = sBuffer.makeStringAndClear();
diff --git a/sfx2/source/sidebar/Tools.cxx b/sfx2/source/sidebar/Tools.cxx
index 0e62e6d..901449d 100644
--- a/sfx2/source/sidebar/Tools.cxx
+++ b/sfx2/source/sidebar/Tools.cxx
@@ -67,7 +67,7 @@ Image Tools::GetImage (
else if (rsURL.startsWith(sCommandImagePrefix))
{
::rtl::OUStringBuffer aCommandName;
- aCommandName.appendAscii(sUnoCommandPrefix);
+ aCommandName.append(sUnoCommandPrefix);
aCommandName.append(rsURL.copy(nCommandImagePrefixLength));
const ::rtl::OUString sCommandName (aCommandName.makeStringAndClear());
diff --git a/sw/source/uibase/utlui/attrdesc.cxx b/sw/source/uibase/utlui/attrdesc.cxx
index 513a98a..7b2db47 100644
--- a/sw/source/uibase/utlui/attrdesc.cxx
+++ b/sw/source/uibase/utlui/attrdesc.cxx
@@ -83,7 +83,7 @@ void SwAttrSet::GetPresentation(
ePresMetric, aStr,
&rInt );
if( rText.getLength() && aStr.getLength() )
- rText += OUString(sComma);
+ rText += sComma;
rText += aStr;
if( aIter.IsAtEnd() )
break;
diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx
index ffec102..d3479b0 100644
--- a/sw/source/uibase/utlui/unotools.cxx
+++ b/sw/source/uibase/utlui/unotools.cxx
@@ -95,7 +95,7 @@ void SwOneExampleFrame::CreateErrorMessage(vcl::Window* pParent)
if(SwOneExampleFrame::bShowServiceNotAvailableMessage)
{
OUString sInfo(SW_RES(STR_SERVICE_UNAVAILABLE));
- sInfo += OUString(cFrameControl);
+ sInfo += cFrameControl;
ScopedVclPtr<InfoBox>::Create(pParent, sInfo)->Execute();
SwOneExampleFrame::bShowServiceNotAvailableMessage = false;
}
diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx
index 47bf261..0d8f516 100644
--- a/unotools/source/config/bootstrap.cxx
+++ b/unotools/source/config/bootstrap.cxx
@@ -414,14 +414,14 @@ static void addFileError(OUStringBuffer& _rBuf, OUString const& _aPath, AsciiStr
_rBuf.append("The configuration file");
_rBuf.append(" '").append(sSimpleFileName).append("' ");
- _rBuf.appendAscii(_sWhat).appendAscii(PERIOD);
+ _rBuf.appendAscii(_sWhat).append(PERIOD);
}
static void addMissingDirectoryError(OUStringBuffer& _rBuf, OUString const& _aPath)
{
_rBuf.append("The configuration directory");
_rBuf.append(" '").append(_aPath).append("' ");
- _rBuf.appendAscii(IS_MISSING).appendAscii(PERIOD);
+ _rBuf.append(IS_MISSING).append(PERIOD);
}
static void addUnexpectedError(OUStringBuffer& _rBuf, AsciiString _sExtraInfo = NULL)
@@ -429,7 +429,7 @@ static void addUnexpectedError(OUStringBuffer& _rBuf, AsciiString _sExtraInfo =
if (NULL == _sExtraInfo)
_sExtraInfo = "An internal failure occurred";
- _rBuf.appendAscii(_sExtraInfo).appendAscii(PERIOD);
+ _rBuf.appendAscii(_sExtraInfo).append(PERIOD);
}
static Bootstrap::FailureCode describeError(OUStringBuffer& _rBuf, Bootstrap::Impl const& _rData)
diff --git a/xmloff/source/text/XMLIndexMarkExport.cxx b/xmloff/source/text/XMLIndexMarkExport.cxx
index 9004c74..d7f2a2d 100644
--- a/xmloff/source/text/XMLIndexMarkExport.cxx
+++ b/xmloff/source/text/XMLIndexMarkExport.cxx
@@ -248,7 +248,7 @@ void XMLIndexMarkExport::GetID(
// HACK: use address of object to form identifier
sal_Int64 nId = sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(rPropSet.get()));
- sBuf.appendAscii(sPrefix, sizeof(sPrefix)-1);
+ sBuf.append(sPrefix);
sBuf.append(nId);
}
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index d64e177..98a086c 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -3098,8 +3098,8 @@ void XMLDdeFieldDeclImportContext::StartElement(
{
// make service name
OUStringBuffer sBuf;
- sBuf.appendAscii(sAPI_fieldmaster_prefix);
- sBuf.appendAscii(sAPI_dde);
+ sBuf.append(sAPI_fieldmaster_prefix);
+ sBuf.append(sAPI_dde);
// create DDE TextFieldMaster
Reference<XMultiServiceFactory> xFactory(GetImport().GetModel(),
@@ -3192,8 +3192,8 @@ void XMLDdeFieldImportContext::EndElement()
{
// find master
OUStringBuffer sBuf;
- sBuf.appendAscii(sAPI_fieldmaster_prefix);
- sBuf.appendAscii(sAPI_dde);
+ sBuf.append(sAPI_fieldmaster_prefix);
+ sBuf.append(sAPI_dde);
sBuf.append('.');
sBuf.append(sName);
OUString sMasterName = sBuf.makeStringAndClear();
@@ -3212,8 +3212,8 @@ void XMLDdeFieldImportContext::EndElement()
xMaster->setPropertyValue( sPropertyContent, uno::makeAny( GetContent()));
// master exists: create text field and attach
Reference<XPropertySet> xField;
- sBuf.appendAscii(sAPI_textfield_prefix);
- sBuf.appendAscii(sAPI_dde);
+ sBuf.append(sAPI_textfield_prefix);
+ sBuf.append(sAPI_dde);
if (CreateField(xField, sBuf.makeStringAndClear()))
{
Reference<XDependentTextField> xDepTextField(xField,UNO_QUERY);
diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx
index a941063..6917126 100644
--- a/xmloff/source/text/txtvfldi.cxx
+++ b/xmloff/source/text/txtvfldi.cxx
@@ -957,14 +957,14 @@ bool XMLVariableDeclImportContext::FindFieldMaster(
xTextFieldsSupp->getTextFieldMasters(), UNO_QUERY);
OUStringBuffer sBuffer;
- sBuffer.appendAscii(sAPI_fieldmaster_prefix);
- sBuffer.appendAscii(sAPI_set_expression);
+ sBuffer.append(sAPI_fieldmaster_prefix);
+ sBuffer.append(sAPI_set_expression);
sBuffer.append(".");
sBuffer.append(sName);
OUString sVarServiceName = sBuffer.makeStringAndClear();
- sBuffer.appendAscii(sAPI_fieldmaster_prefix);
- sBuffer.appendAscii(sAPI_user);
+ sBuffer.append(sAPI_fieldmaster_prefix);
+ sBuffer.append(sAPI_user);
sBuffer.append(".");
sBuffer.append(sName);
OUString sUserServiceName = sBuffer.makeStringAndClear();
@@ -1040,7 +1040,7 @@ bool XMLVariableDeclImportContext::FindFieldMaster(
if( xFactory.is() ) {
OUStringBuffer sService;
- sService.appendAscii(sAPI_fieldmaster_prefix);
+ sService.append(sAPI_fieldmaster_prefix);
sService.appendAscii((eVarType==VarTypeUserField) ?
sAPI_user : sAPI_set_expression);
Reference<XInterface> xIfc =
More information about the Libreoffice-commits
mailing list