summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-12 12:17:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-11 08:24:19 +0100
commitf76bf262a60c154684ffefbd53a5339fa3864e42 (patch)
tree6b287051d4ad9d5258eecd3efa0ebb8a020d2b2c
parentb143e7642f93e83f4f3c4df56c3e1e8e64e36ce0 (diff)
new loplugin indentation
look for mixed indentation in compound statements, which makes them hard to read, and sometimes makes it look like a statement is associated with a nearby if/for Change-Id: Ic8429cee1f9a86d938097a4a8769a2bce97b3361 Reviewed-on: https://gerrit.libreoffice.org/63283 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--compilerplugins/clang/indentation.cxx229
-rw-r--r--compilerplugins/clang/test/indentation.cxx40
-rw-r--r--sfx2/source/doc/objmisc.cxx2
-rw-r--r--solenv/CompilerTest_compilerplugins_clang.mk1
-rw-r--r--solenv/bin/concat-deps.c96
-rw-r--r--solenv/clang-format/blacklist1
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_export.cxx2
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx14
-rw-r--r--xmlscript/source/xmldlg_imexp/xmldlg_import.cxx2
-rw-r--r--xmlsecurity/source/component/certificatecontainer.cxx8
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx2
-rw-r--r--xmlsecurity/source/helper/xsecctl.cxx2
-rw-r--r--xmlsecurity/source/helper/xsecverify.cxx4
-rw-r--r--xmlsecurity/source/xmlsec/nss/nssinitializer.cxx2
-rw-r--r--xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx12
-rw-r--r--xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx2
16 files changed, 345 insertions, 74 deletions
diff --git a/compilerplugins/clang/indentation.cxx b/compilerplugins/clang/indentation.cxx
new file mode 100644
index 000000000000..c63bc58c06d9
--- /dev/null
+++ b/compilerplugins/clang/indentation.cxx
@@ -0,0 +1,229 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * Based on LLVM/Clang.
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ */
+
+#include <cassert>
+#include <string>
+#include <iostream>
+#include <fstream>
+#include <set>
+#include "plugin.hxx"
+
+/*
+Check for child statements inside a compound statement that do not share the same indentation.
+
+TODO if an open-brace starts on a new line by itself, check that it lines up with it's closing-brace
+TODO else should line up with if
+*/
+
+namespace
+{
+class Indentation : public loplugin::FilteringPlugin<Indentation>
+{
+public:
+ explicit Indentation(loplugin::InstantiationData const& data)
+ : FilteringPlugin(data)
+ {
+ }
+
+ virtual void run() override
+ {
+ std::string fn(handler.getMainFileName());
+ loplugin::normalizeDotDotInFilePath(fn);
+ // include another file to build a table
+ if (fn == SRCDIR "/sc/source/core/tool/cellkeytranslator.cxx")
+ return;
+ // weird structure
+ if (fn == SRCDIR "/sc/source/core/tool/compiler.cxx")
+ return;
+ // looks like lex/yacc output
+ if (fn == SRCDIR "/hwpfilter/source/grammar.cxx")
+ return;
+ // TODO need to learn to handle attributes like "[[maybe_unused]]"
+ if (fn == SRCDIR "/binaryurp/source/bridge.cxx")
+ return;
+ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
+ }
+
+ bool VisitCompoundStmt(CompoundStmt const*);
+ bool TraverseSwitchStmt(SwitchStmt*);
+ bool VisitSwitchStmt(SwitchStmt const*);
+
+private:
+ Stmt const* switchStmtBody = nullptr;
+};
+
+bool Indentation::TraverseSwitchStmt(SwitchStmt* switchStmt)
+{
+ auto prev = switchStmtBody;
+ switchStmtBody = switchStmt->getBody();
+ FilteringPlugin::TraverseSwitchStmt(switchStmt);
+ switchStmtBody = prev;
+ return true;
+}
+
+bool Indentation::VisitCompoundStmt(CompoundStmt const* compoundStmt)
+{
+ if (ignoreLocation(compoundStmt))
+ return true;
+ // these are kind of free form
+ if (switchStmtBody == compoundStmt)
+ return true;
+
+ constexpr unsigned MAX = std::numeric_limits<unsigned>::max();
+ unsigned column = MAX;
+ Stmt const* firstStmt = nullptr;
+ unsigned curLine = MAX;
+ unsigned prevLine = MAX;
+ auto& SM = compiler.getSourceManager();
+ for (auto i = compoundStmt->body_begin(); i != compoundStmt->body_end(); ++i)
+ {
+ auto stmt = *i;
+
+ // these show up in macro expansions, not interesting
+ if (isa<NullStmt>(stmt))
+ continue;
+ // these are always weirdly indented
+ if (isa<LabelStmt>(stmt))
+ continue;
+
+ auto stmtLoc = compat::getBeginLoc(stmt);
+
+ StringRef macroName;
+ if (SM.isMacroArgExpansion(stmtLoc) || SM.isMacroBodyExpansion(stmtLoc))
+ {
+ macroName = Lexer::getImmediateMacroNameForDiagnostics(
+ stmtLoc, compiler.getSourceManager(), compiler.getLangOpts());
+ // CPPUNIT_TEST_SUITE/CPPUNIT_TEST/CPPUNIT_TEST_SUITE_END work together, so the one is indented inside the other
+ if (macroName == "CPPUNIT_TEST_SUITE")
+ continue;
+ // similar thing in dbaccess/
+ if (macroName == "DECL_PROP_IMPL")
+ continue;
+ // similar thing in forms/
+ if (macroName == "DECL_IFACE_PROP_IMPL" || macroName == "DECL_BOOL_PROP_IMPL")
+ continue;
+#if CLANG_VERSION >= 80000
+ stmtLoc = SM.getExpansionRange(stmtLoc).getBegin();
+#else
+ stmtLoc = SM.getExpansionRange(stmtLoc).first;
+#endif
+ }
+
+ // check for comment to the left of the statement
+ {
+ const char* p1 = SM.getCharacterData(stmtLoc);
+ --p1;
+ bool foundComment = false;
+ while (*p1 && *p1 != '\n')
+ {
+ if (*p1 == '/')
+ {
+ foundComment = true;
+ break;
+ }
+ --p1;
+ }
+ if (foundComment)
+ continue;
+ }
+
+ bool invalid1 = false;
+ bool invalid2 = false;
+ unsigned tmpColumn = SM.getPresumedColumnNumber(stmtLoc, &invalid1);
+ unsigned tmpLine = SM.getPresumedLineNumber(stmtLoc, &invalid2);
+ if (invalid1 || invalid2)
+ continue;
+ prevLine = curLine;
+ curLine = tmpLine;
+ if (column == MAX)
+ {
+ column = tmpColumn;
+ firstStmt = stmt;
+ }
+ else if (curLine == prevLine)
+ {
+ // ignore multiple statements on same line
+ }
+ else if (column != tmpColumn)
+ {
+ report(DiagnosticsEngine::Warning, "statement mis-aligned compared to neighbours %0",
+ stmtLoc)
+ << macroName;
+ report(DiagnosticsEngine::Note, "measured against this one",
+ compat::getBeginLoc(firstStmt));
+ //getParentStmt(compoundStmt)->dump();
+ //stmt->dump();
+ }
+ }
+ return true;
+}
+
+bool Indentation::VisitSwitchStmt(SwitchStmt const* switchStmt)
+{
+ if (ignoreLocation(switchStmt))
+ return true;
+
+ constexpr unsigned MAX = std::numeric_limits<unsigned>::max();
+ unsigned column = MAX;
+ Stmt const* firstStmt = nullptr;
+ unsigned curLine = MAX;
+ unsigned prevLine = MAX;
+ auto& SM = compiler.getSourceManager();
+ auto compoundStmt = dyn_cast<CompoundStmt>(switchStmt->getBody());
+ if (!compoundStmt)
+ return true;
+ for (auto i = compoundStmt->body_begin(); i != compoundStmt->body_end(); ++i)
+ {
+ Stmt const* caseStmt = dyn_cast<CaseStmt>(*i);
+ if (!caseStmt)
+ caseStmt = dyn_cast<DefaultStmt>(*i);
+ if (!caseStmt)
+ continue;
+
+ auto stmtLoc = compat::getBeginLoc(caseStmt);
+
+ bool invalid1 = false;
+ bool invalid2 = false;
+ unsigned tmpColumn = SM.getPresumedColumnNumber(stmtLoc, &invalid1);
+ unsigned tmpLine = SM.getPresumedLineNumber(stmtLoc, &invalid2);
+ if (invalid1 || invalid2)
+ continue;
+ prevLine = curLine;
+ curLine = tmpLine;
+ if (column == MAX)
+ {
+ column = tmpColumn;
+ firstStmt = caseStmt;
+ }
+ else if (curLine == prevLine)
+ {
+ // ignore multiple statements on same line
+ }
+ else if (column != tmpColumn)
+ {
+ // disable this for now, ends up touching some very large switch statemnts in sw/ and sc/
+ (void)firstStmt;
+ // report(DiagnosticsEngine::Warning, "statement mis-aligned compared to neighbours",
+ // stmtLoc);
+ // report(DiagnosticsEngine::Note, "measured against this one",
+ // compat::getBeginLoc(firstStmt));
+ //getParentStmt(compoundStmt)->dump();
+ //stmt->dump();
+ }
+ }
+ return true;
+}
+
+loplugin::Plugin::Registration<Indentation> X("indentation");
+
+} // namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/compilerplugins/clang/test/indentation.cxx b/compilerplugins/clang/test/indentation.cxx
new file mode 100644
index 000000000000..b313fff1fe62
--- /dev/null
+++ b/compilerplugins/clang/test/indentation.cxx
@@ -0,0 +1,40 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+int foo();
+int foo2(int);
+
+#define SOME_MACRO(x) foo2(x)
+
+void top1(int x) {
+ {
+ foo(); // expected-note {{measured against this one [loplugin:indentation]}}
+ foo(); // expected-error {{statement mis-aligned compared to neighbours [loplugin:indentation]}}
+ }
+ {
+ foo(); // expected-note {{measured against this one [loplugin:indentation]}}
+ SOME_MACRO(1); // expected-error {{statement mis-aligned compared to neighbours SOME_MACRO [loplugin:indentation]}}
+ }
+ // no warning expected
+ {
+ foo(); foo();
+ }
+ // no warning expected
+ /*xxx*/ foo();
+
+
+// disable this for now, ends up touching some very large switch statemnts in sw/ and sc/
+ switch (x)
+ {
+ case 1: foo(); break; // 1expected-note {{measured against this one [loplugin:indentation]}}
+ case 2: foo(); break; // 1expected-error {{statement mis-aligned compared to neighbours [loplugin:indentation]}}
+ };
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 151de48fb17e..84e0b6660f49 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -374,7 +374,7 @@ void SfxObjectShell::SetReadOnly()
// medium open mode is adjusted accordingly, and the write lock
// on the file is removed.
- if ( !pMedium || IsReadOnlyMedium() )
+ if ( !pMedium || IsReadOnlyMedium() )
return;
bool bWasROUI = IsReadOnly();
diff --git a/solenv/CompilerTest_compilerplugins_clang.mk b/solenv/CompilerTest_compilerplugins_clang.mk
index d5dcd1796545..a83cf703793f 100644
--- a/solenv/CompilerTest_compilerplugins_clang.mk
+++ b/solenv/CompilerTest_compilerplugins_clang.mk
@@ -32,6 +32,7 @@ $(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang, \
compilerplugins/clang/test/faileddyncast \
compilerplugins/clang/test/finalprotected \
compilerplugins/clang/test/flatten \
+ compilerplugins/clang/test/indentation \
compilerplugins/clang/test/loopvartoosmall \
compilerplugins/clang/test/oncevar \
compilerplugins/clang/test/oslendian-1 \
diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c
index 9981b7775ee0..b3182e49feae 100644
--- a/solenv/bin/concat-deps.c
+++ b/solenv/bin/concat-deps.c
@@ -143,7 +143,7 @@ int result = 32;
static unsigned int get_unaligned_uint(const unsigned char* cursor)
{
-unsigned int result;
+ unsigned int result;
memcpy(&result, cursor, sizeof(unsigned int));
return result;
@@ -168,9 +168,9 @@ struct pool
static void* pool_take_extent(struct pool* pool, int allocate)
{
-unsigned int size = 0;
-void* extent;
-void* data = NULL;
+ unsigned int size = 0;
+ void* extent;
+ void* data = NULL;
if(pool->extent)
{
@@ -214,7 +214,7 @@ void* data = NULL;
*/
static struct pool* pool_create(int size_elem, int primary, int secondary)
{
-struct pool* pool;
+ struct pool* pool;
assert(primary > 0);
assert(secondary >= 0);
@@ -237,8 +237,8 @@ struct pool* pool;
static void pool_destroy(struct pool* pool)
{
-void* extent;
-void* next;
+ void* extent;
+ void* next;
if(pool != NULL)
{
@@ -255,7 +255,7 @@ void* next;
static void* pool_alloc(struct pool* pool)
{
-void* data;
+ void* data;
data = pool->head_free;
if(data == NULL)
@@ -442,7 +442,7 @@ static void hash_destroy(struct hash* hash)
static struct hash* hash_create(unsigned int size)
{
-struct hash* hash;
+ struct hash* hash;
assert(size > 0);
hash = calloc(1, sizeof(struct hash));
@@ -481,12 +481,12 @@ struct hash* hash;
static void hash_resize(struct hash* hash)
{
-unsigned int old_size = hash->size;
-unsigned int hashed;
-struct hash_elem* hash_elem;
-struct hash_elem* next;
-struct hash_elem** array;
-unsigned int i;
+ unsigned int old_size = hash->size;
+ unsigned int hashed;
+ struct hash_elem* hash_elem;
+ struct hash_elem* next;
+ struct hash_elem** array;
+ unsigned int i;
hash->size = (old_size << 1) + 1;
/* we really should avoid to get there... so print a message to alert of the condition */
@@ -538,9 +538,9 @@ static int compare_key(struct hash const * hash, const char* a, const char* b, i
*/
static int hash_store(struct hash* hash, const char* key, int key_len)
{
-unsigned int hashed;
-struct hash_elem* hash_elem;
-int cost = 0;
+ unsigned int hashed;
+ struct hash_elem* hash_elem;
+ int cost = 0;
(void) cost;
hashed = hash_compute(hash, key, key_len);
@@ -583,7 +583,7 @@ int cost = 0;
static int file_stat(const char* name, struct stat* buffer_stat, int* rc)
{
-int rc_local = 0;
+ int rc_local = 0;
rc_local = stat(name, buffer_stat);
if (rc_local < 0)
@@ -595,8 +595,8 @@ int rc_local = 0;
static off_t file_get_size(const char* name, int* rc)
{
-struct stat buffer_stat;
-off_t size = -1;
+ struct stat buffer_stat;
+ off_t size = -1;
if (!file_stat(name, &buffer_stat, rc))
{
@@ -619,10 +619,10 @@ static size_t file_load_buffer_count = 0;
static char* file_load(const char* name, off_t* size, int* return_rc)
{
-off_t local_size = 0;
-int rc = 0;
-char* buffer = NULL;
-int fd;
+ off_t local_size = 0;
+ int rc = 0;
+ char* buffer = NULL;
+ int fd;
assert(name != NULL);
@@ -657,7 +657,7 @@ int fd;
}
else
{
- ssize_t i;
+ ssize_t i;
REDO:
i = read(fd, buffer, (size_t)(*size));
@@ -873,9 +873,9 @@ static char * eat_space_at_end(char * end)
static char* phony_content_buffer;
static char* generate_phony_line(char const * phony_target, char const * extension)
{
-char const * src;
-char* dest;
-char* last_dot = NULL;
+ char const * src;
+ char* dest;
+ char* last_dot = NULL;
//fprintf(stderr, "generate_phony_line called with phony_target %s and extension %s\n", phony_target, extension);
for(dest = phony_content_buffer+work_dir_len+1, src = phony_target; *src != 0; ++src, ++dest)
{
@@ -898,7 +898,7 @@ char* last_dot = NULL;
static int generate_phony_file(char* fn, char const * content)
{
-FILE* depfile;
+ FILE* depfile;
depfile = fopen(fn, "w");
if(!depfile)
{
@@ -914,17 +914,17 @@ FILE* depfile;
static int process(struct hash* dep_hash, char* fn)
{
-int rc;
-char* buffer;
-char* end;
-char* cursor;
-char* cursor_out;
-char* base;
-char* created_line = NULL;
-char* src_relative;
-int continuation = 0;
-char last_ns = 0;
-off_t size;
+ int rc;
+ char* buffer;
+ char* end;
+ char* cursor;
+ char* cursor_out;
+ char* base;
+ char* created_line = NULL;
+ char* src_relative;
+ int continuation = 0;
+ char last_ns = 0;
+ off_t size;
buffer = file_load(fn, &size, &rc);
if(!rc)
@@ -1129,13 +1129,13 @@ static int get_var(char **var, const char *name)
int main(int argc, char** argv)
{
-int rc = 0;
-off_t in_list_size = 0;
-char* in_list;
-char* in_list_cursor;
-char* in_list_base;
-struct hash* dep_hash = NULL;
-const char *env_str;
+ int rc = 0;
+ off_t in_list_size = 0;
+ char* in_list;
+ char* in_list_cursor;
+ char* in_list_base;
+ struct hash* dep_hash = NULL;
+ const char *env_str;
if(argc < 2)
{
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index c7d477027848..3d48948e1734 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -1824,6 +1824,7 @@ compilerplugins/clang/test/externvar.hxx
compilerplugins/clang/test/faileddyncast.cxx
compilerplugins/clang/test/finalprotected.cxx
compilerplugins/clang/test/flatten.cxx
+compilerplugins/clang/test/indentation.cxx
compilerplugins/clang/test/loopvartoosmall.cxx
compilerplugins/clang/test/oncevar.cxx
compilerplugins/clang/test/oslendian-1.cxx
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index 641370f7cb64..82cf6eca2116 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -928,7 +928,7 @@ void ElementDescriptor::readDataAwareAttr( OUString const & rAttrName )
try
{
Reference< beans::XPropertySet > xConvertor( xFac->createInstance( "com.sun.star.table.CellAddressConversion" ), uno::UNO_QUERY );
- Reference< beans::XPropertySet > xBindable( xBinding->getValueBinding(), UNO_QUERY );
+ Reference< beans::XPropertySet > xBindable( xBinding->getValueBinding(), UNO_QUERY );
if ( xBindable.is() )
{
table::CellAddress aAddress;
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 239f795e426a..16dffcb51681 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -72,9 +72,9 @@ Reference< xml::input::XElement > Frame::startChildElement(
void Frame::endElement()
{
- if ( !m_xContainer.is() )
+ if ( !m_xContainer.is() )
m_xContainer.set( m_xImport->_xDialogModelFactory->createInstance( "com.sun.star.awt.UnoFrameModel" ), UNO_QUERY );
- Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW );
+ Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW );
// m_xImport is what we need to add to ( e.g. the dialog in this case )
ControlImportContext ctx( m_xImport.get(), xProps, getControlId( _xAttributes ) );
@@ -118,7 +118,7 @@ Reference< xml::input::XElement > MultiPage::startChildElement(
// Create new DialogImport for this container
DialogImport* pMultiPageImport = new DialogImport( *m_xImport );
- pMultiPageImport->_xDialogModel = m_xContainer;
+ pMultiPageImport->_xDialogModel = m_xContainer;
return new BulletinBoardElement( rLocalName, xAttributes, this, pMultiPageImport );
}
else
@@ -130,7 +130,7 @@ Reference< xml::input::XElement > MultiPage::startChildElement(
void MultiPage::endElement()
{
- Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW );
+ Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW );
// m_xImport is what we need to add to ( e.g. the dialog in this case )
ControlImportContext ctx( m_xImport.get(), xProps, getControlId( _xAttributes ));
@@ -148,7 +148,7 @@ void MultiPage::endElement()
ctx.importDefaults( 0, 0, _xAttributes ); // inherited from BulletinBoardElement
ctx.importLongProperty("MultiPageValue" , "value", _xAttributes );
- ctx.importBooleanProperty( "Decoration", "withtabs", _xAttributes) ;
+ ctx.importBooleanProperty( "Decoration", "withtabs", _xAttributes) ;
ctx.importEvents( _events );
// avoid ring-reference:
// vector< event elements > holding event elements holding this (via _pParent)
@@ -171,7 +171,7 @@ Reference< xml::input::XElement > Page::startChildElement(
{
DialogImport* pPageImport = new DialogImport( *m_xImport );
- pPageImport->_xDialogModel = m_xContainer;
+ pPageImport->_xDialogModel = m_xContainer;
return new BulletinBoardElement( rLocalName, xAttributes, this, pPageImport );
}
else
@@ -183,7 +183,7 @@ Reference< xml::input::XElement > Page::startChildElement(
void Page::endElement()
{
- Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW );
+ Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW );
ControlImportContext ctx( m_xImport.get(), xProps, getControlId( _xAttributes ));
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index e275ea679832..4c8ea1327b21 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -1766,7 +1766,7 @@ Reference< xml::sax::XDocumentHandler > importDialogModel(
// single set of styles and stylenames apply to all containers
std::shared_ptr< std::vector< OUString > > pStyleNames( new std::vector< OUString > );
std::shared_ptr< std::vector< css::uno::Reference< css::xml::input::XElement > > > pStyles( new std::vector< css::uno::Reference< css::xml::input::XElement > > );
- return ::xmlscript::createDocumentHandler(
+ return ::xmlscript::createDocumentHandler(
static_cast< xml::input::XRoot * >(
new DialogImport( xContext, xDialogModel, pStyleNames, pStyles, xDocument ) ) );
}
diff --git a/xmlsecurity/source/component/certificatecontainer.cxx b/xmlsecurity/source/component/certificatecontainer.cxx
index c110ebb64e6f..845e980baeca 100644
--- a/xmlsecurity/source/component/certificatecontainer.cxx
+++ b/xmlsecurity/source/component/certificatecontainer.cxx
@@ -96,11 +96,11 @@ CertificateContainer::addCertificate( const OUString & url, const OUString & cer
{
certMap.emplace( url, certificate_name );
- //remember that the cert is trusted
- if (trust)
- certTrustMap.emplace( url, certificate_name );
+ //remember that the cert is trusted
+ if (trust)
+ certTrustMap.emplace( url, certificate_name );
- return true;
+ return true;
}
::security::CertificateContainerStatus
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 62f939bd3dfb..fa5da389d55e 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -608,7 +608,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
if ( bSigValid )
{
- bSigValid = DocumentSignatureHelper::checkIfAllFilesAreSigned(
+ bSigValid = DocumentSignatureHelper::checkIfAllFilesAreSigned(
aElementsToBeVerified, rInfo, mode);
if( bSigValid )
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index f6d1f89b6a6b..ed7ccfba7fd2 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -415,7 +415,7 @@ cssu::Reference< css::io::XInputStream >
* xInputStream - the XInputStream interface
******************************************************************************/
{
- cssu::Reference< css::io::XInputStream > xObjectInputStream;
+ cssu::Reference< css::io::XInputStream > xObjectInputStream;
SAL_WARN_IF( !m_xUriBinding.is(), "xmlsecurity.helper", "Need XUriBinding!" );
diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx
index edd78902313b..97204755715d 100644
--- a/xmlsecurity/source/helper/xsecverify.cxx
+++ b/xmlsecurity/source/helper/xsecverify.cxx
@@ -164,7 +164,7 @@ void XSecController::addStreamReference(
bool isBinary,
sal_Int32 nDigestID )
{
- SignatureReferenceType type = (isBinary?SignatureReferenceType::BINARYSTREAM:SignatureReferenceType::XMLSTREAM);
+ SignatureReferenceType type = (isBinary?SignatureReferenceType::BINARYSTREAM:SignatureReferenceType::XMLSTREAM);
if (m_vInternalSignatureInformations.empty())
{
@@ -178,7 +178,7 @@ void XSecController::addStreamReference(
/*
* get the input stream
*/
- cssu::Reference< css::io::XInputStream > xObjectInputStream
+ cssu::Reference< css::io::XInputStream > xObjectInputStream
= getObjectInputStream( ouUri );
if ( xObjectInputStream.is() )
diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
index 534c5bd7fc5c..238f1bb9e41a 100644
--- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
+++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
@@ -176,7 +176,7 @@ struct InitNSSInitialize
bInitialized = nsscrypto_initialize( m_xContext, bNSSInit );
if (bNSSInit)
atexit(nsscrypto_finalize );
- return & bInitialized;
+ return & bInitialized;
}
};
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index b76684f6075e..3a1001b7447c 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -554,17 +554,17 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert,
nullptr /* nickname */,
PR_FALSE /* isPerm */,
PR_TRUE /* copyDER */);
- if (!certTmp)
- {
+ if (!certTmp)
+ {
SAL_INFO("xmlsecurity.xmlsec", "Failed to add a temporary certificate: " << intermediateCerts[i]->getIssuerName());
- }
- else
- {
+ }
+ else
+ {
SAL_INFO("xmlsecurity.xmlsec", "Added temporary certificate: " <<
(certTmp->subjectName ? certTmp->subjectName : ""));
vecTmpNSSCertificates.push_back(certTmp);
- }
+ }
}
diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
index 311ce6aeb69f..a5d8739aa48b 100644
--- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
@@ -210,7 +210,7 @@ SAL_CALL XMLSignature_NssImpl::validate(
throw RuntimeException() ;
}
- setErrorRecorder();
+ setErrorRecorder();
sal_Int32 nSecurityEnvironment = aSecurityCtx->getSecurityEnvironmentNumber();
sal_Int32 i;