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


Hi,

On Thu, May 31, 2012 at 05:33:03PM -0500, Brandon Garcia wrote:
Note:

Also made extremely minor adjustments to code in various places primarily
in terms of const-correctness simplification of code.

Practically all of the changes use features that are new in C++11, so we
cannot use this patch.

-ResMgr*                 desktop::Desktop::pResMgr = 0;
+ResMgr*    desktop::Desktop::pResMgr = nullptr;

nullptr is C++11-only.

if (pEventAttacher)
-    {
        xRet = Reference<XInterface>::query(pEventAttacher);
-    }

I would not bother to change this. It is a matter of taste.

-#define INITIAL_UNICODE_BUFFER_CAPACITY     0x100
-#define READ_BYTE_COUNT                     0x100
+constexpr unsigned short initial_unicode_buffer_capacity = 0x100;
+constexpr unsigned short read_byte_count = 0x100;

constexpr is C++-11-only. Also, why to change the names to lowercase?

 OTextOutputStream::OTextOutputStream()
+   : mbEncodingInitialized{false}
{
-     mbEncodingInitialized = false;
}

Bracket initializers are C++11-only.

-        for ( vector < uno::Sequence < PropertyValue > >::const_iterator aIter = 
aManList.begin(), aEnd = >aManList.end();
-             aIter != aEnd;
-             ++aIter, ++nInd )
+        for ( const uno::Sequence<PropertyValue>& seq : aManList )
{
-            aManifestSequence[nInd] = ( *aIter );
+            aManifestSequence[nInd] = ( seq );
+            ++nInd;
}

This style of for loop is C++11-only.

-    for (RtfColorTbl::iterator it=m_aColTbl.begin() ; it != m_aColTbl.end(); ++it )
-        if ((*it).second == rCol)
+    for (auto myColor : m_aColTbl )
+        if (myColor.second == rCol)

Automatically deduced type of variable is C++11-only.

D.

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.