Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


On 04/08/14 19:56, Norbert Thiebaud wrote:
On Mon, Aug 4, 2014 at 2:51 PM, Stephan Bergmann <sbergman@redhat.com> wrote:

 And
especially so if a single file out of a coherent set of consistently
formatted files is reformatted differently.


well it was not as illustrated by the snipset below:

        case unoidl::Entity::SORT_CONSTANT_GROUP:
            {
                rtl::Reference<unoidl::ConstantGroupEntity> ent2B(
                    static_cast<unoidl::ConstantGroupEntity *>(entB.get()));
                for
(std::vector<unoidl::ConstantGroupEntity::Member>::const_iterator
                             i(ent2B->getMembers().begin());
                     i != ent2B->getMembers().end(); ++i)
                {
                    bool found = false;
                    if (entA.is()) {
                        rtl::Reference<unoidl::ConstantGroupEntity> ent2A(
                            static_cast<unoidl::ConstantGroupEntity *>(
                                entA.get()));
                        for
(std::vector<unoidl::ConstantGroupEntity::Member>::const_iterator
                                 j(ent2A->getMembers().begin());
                             j != ent2A->getMembers().end(); ++j)
                        {
                            if (i->name == j->name) {
                                found = true;
                                break;
                            }
                        }
                    }
                    if (!(found || valid(i->name))) {
                        std::cerr
                            << "Constant group " << name << " member "
                            << i->name << " uses an invalid identifier"
                            << std::endl;
                        std::exit(EXIT_FAILURE);
                    }
                }
                break;
            }

note the for() and case syntax use { below on a new line.. the if use
{ at the end of the line

So, no, the source was not "consistently formatted"

a rule such as "if the condition is a single line, put the brace on the
same line, if it is multiple lines, put the brace on a separate line"
can still be called consistent  :)

(personally i would find this an improvement over the current formatting...)


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.