diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-11-08 11:28:04 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-11-08 15:35:18 +0100 |
commit | b536e10390c171e96b6477c04d66023a1da543c4 (patch) | |
tree | 4c04275831cea51f0a343d00e382f519a08bcd90 /svx/source | |
parent | 958c09acc1058a4a0eba28ac94f2883fff64d600 (diff) |
Retrofit "KeepEmptyLinesAtTheStartOfBlocks: false" into .clang-format
...even if that can cause reformatting of already formatted code. The problem I
came across is that without this something like
> namespace {
>
> void f1();
>
> void f2();
>
> }
(which is quite a common style in the current code base) would be changed to
> namespace
> {
>
> void f1();
>
> void f2();
> }
instead of
> namespace
> {
> void f1();
>
> void f2();
> }
and I found no other clang-format style option that would result in the
presence or absence of an empty line be identical at the start and end of the
namespace block.
vmiklos asked to reformat the existing new (i.e., non-blacklisted) files at the
same time, so this commit includes that. Some of those new files had not been
formatted at all, so this commit includes their full reformatting changes.
Change-Id: I54daf0c11098d07d02c802104cf7f56372e61f7c
Reviewed-on: https://gerrit.libreoffice.org/44450
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/dialog/ClassificationCommon.cxx | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/svx/source/dialog/ClassificationCommon.cxx b/svx/source/dialog/ClassificationCommon.cxx index 4d5d74938d5b..15734d7adc11 100644 --- a/svx/source/dialog/ClassificationCommon.cxx +++ b/svx/source/dialog/ClassificationCommon.cxx @@ -14,14 +14,15 @@ using namespace css; -namespace svx { -namespace classification { - -OUString convertClassificationResultToString(std::vector<svx::ClassificationResult> const & rResults) +namespace svx +{ +namespace classification +{ +OUString convertClassificationResultToString(std::vector<svx::ClassificationResult> const& rResults) { OUString sRepresentation = ""; - for (svx::ClassificationResult const & rResult : rResults) + for (svx::ClassificationResult const& rResult : rResults) { switch (rResult.meType) { @@ -30,17 +31,18 @@ OUString convertClassificationResultToString(std::vector<svx::ClassificationResu case svx::ClassificationType::MARKING: case svx::ClassificationType::TEXT: sRepresentation += rResult.msName; - break; + break; case svx::ClassificationType::PARAGRAPH: sRepresentation += " "; - break; + break; } } return sRepresentation; } -OUString getProperty(uno::Reference<beans::XPropertyContainer> const & rxPropertyContainer, OUString const & rName) +OUString getProperty(uno::Reference<beans::XPropertyContainer> const& rxPropertyContainer, + OUString const& rName) { try { @@ -54,18 +56,18 @@ OUString getProperty(uno::Reference<beans::XPropertyContainer> const & rxPropert return OUString(); } -bool containsProperty(uno::Sequence<beans::Property> const & rProperties, OUString const & rName) +bool containsProperty(uno::Sequence<beans::Property> const& rProperties, OUString const& rName) { - return std::find_if(rProperties.begin(), rProperties.end(), [&](const beans::Property& rProperty) - { - return rProperty.Name == rName; - }) != rProperties.end(); + return std::find_if(rProperties.begin(), rProperties.end(), + [&](const beans::Property& rProperty) { return rProperty.Name == rName; }) + != rProperties.end(); } -void removeAllProperties(uno::Reference<beans::XPropertyContainer> const & rxPropertyContainer) +void removeAllProperties(uno::Reference<beans::XPropertyContainer> const& rxPropertyContainer) { uno::Reference<beans::XPropertySet> xPropertySet(rxPropertyContainer, uno::UNO_QUERY); - uno::Sequence<beans::Property> aProperties = xPropertySet->getPropertySetInfo()->getProperties(); + uno::Sequence<beans::Property> aProperties + = xPropertySet->getPropertySetInfo()->getProperties(); for (const beans::Property& rProperty : aProperties) { @@ -73,7 +75,9 @@ void removeAllProperties(uno::Reference<beans::XPropertyContainer> const & rxPro } } -bool addOrInsertDocumentProperty(uno::Reference<beans::XPropertyContainer> const & rxPropertyContainer, OUString const & rsKey, OUString const & rsValue) +bool addOrInsertDocumentProperty( + uno::Reference<beans::XPropertyContainer> const& rxPropertyContainer, OUString const& rsKey, + OUString const& rsValue) { uno::Reference<beans::XPropertySet> xPropertySet(rxPropertyContainer, uno::UNO_QUERY); @@ -82,7 +86,8 @@ bool addOrInsertDocumentProperty(uno::Reference<beans::XPropertyContainer> const if (containsProperty(xPropertySet->getPropertySetInfo()->getProperties(), rsKey)) xPropertySet->setPropertyValue(rsKey, uno::makeAny(rsValue)); else - rxPropertyContainer->addProperty(rsKey, beans::PropertyAttribute::REMOVABLE, uno::makeAny(rsValue)); + rxPropertyContainer->addProperty(rsKey, beans::PropertyAttribute::REMOVABLE, + uno::makeAny(rsValue)); } catch (const uno::Exception& /*rException*/) { @@ -91,14 +96,16 @@ bool addOrInsertDocumentProperty(uno::Reference<beans::XPropertyContainer> const return true; } -void insertFullTextualRepresentationAsDocumentProperty(uno::Reference<beans::XPropertyContainer> const & rxPropertyContainer, - sfx::ClassificationKeyCreator const & rKeyCreator, - std::vector<svx::ClassificationResult> const & rResults) +void insertFullTextualRepresentationAsDocumentProperty( + uno::Reference<beans::XPropertyContainer> const& rxPropertyContainer, + sfx::ClassificationKeyCreator const& rKeyCreator, + std::vector<svx::ClassificationResult> const& rResults) { OUString sString = convertClassificationResultToString(rResults); - addOrInsertDocumentProperty(rxPropertyContainer, rKeyCreator.makeFullTextualRepresentationKey(), sString); + addOrInsertDocumentProperty(rxPropertyContainer, rKeyCreator.makeFullTextualRepresentationKey(), + sString); } - -}} // end svx::classification namespace +} +} // end svx::classification namespace /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |