[Libreoffice-commits] .: 6 commits - starmath/source sw/source

Tor Lillqvist tml at kemper.freedesktop.org
Wed Oct 26 01:03:38 PDT 2011


 starmath/source/cursor.cxx        |    1 -
 starmath/source/document.cxx      |    2 +-
 sw/source/core/unocore/unobkm.cxx |    5 ++++-
 sw/source/core/unocore/unoidx.cxx |    2 +-
 sw/source/ui/frmdlg/colmgr.cxx    |    2 +-
 5 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 2998604bda2ade9e2935d2dae7e539cbc71211f2
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Wed Oct 26 10:48:33 2011 +0300

    Make OSL_ENSURE explanation text match the test

diff --git a/sw/source/ui/frmdlg/colmgr.cxx b/sw/source/ui/frmdlg/colmgr.cxx
index 0d1c4c2..e3407f6 100644
--- a/sw/source/ui/frmdlg/colmgr.cxx
+++ b/sw/source/ui/frmdlg/colmgr.cxx
@@ -103,7 +103,7 @@ short SwColMgr::GetLineHeightPercent() const
 
 void SwColMgr::SetLineHeightPercent(short nPercent)
 {
-    OSL_ENSURE(nPercent <= 100, "line height may only be 100 %");
+    OSL_ENSURE(nPercent <= 100, "line height may be at most 100 %");
     aFmtCol.SetLineHeight((sal_uInt8)nPercent);
 }
 
commit 5669a82f094a9e4a381078b200d98999d4d09068
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Wed Oct 26 10:46:20 2011 +0300

    WaE: '%' : unrecognized character escape sequence

diff --git a/sw/source/ui/frmdlg/colmgr.cxx b/sw/source/ui/frmdlg/colmgr.cxx
index 856b008..0d1c4c2 100644
--- a/sw/source/ui/frmdlg/colmgr.cxx
+++ b/sw/source/ui/frmdlg/colmgr.cxx
@@ -103,7 +103,7 @@ short SwColMgr::GetLineHeightPercent() const
 
 void SwColMgr::SetLineHeightPercent(short nPercent)
 {
-    OSL_ENSURE(nPercent <= 100, "line height may only be 100 \%");
+    OSL_ENSURE(nPercent <= 100, "line height may only be 100 %");
     aFmtCol.SetLineHeight((sal_uInt8)nPercent);
 }
 
commit aafc761738fb2d0c7d6931890be490d6cc3877ed
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Wed Oct 26 10:35:13 2011 +0300

    WaE: default constructor could not be generated
    
    MSVC warning C4510: 'TokenType' : default constructor could not be
    generated and warning C4610: struct 'TokenType' can never be
    instantiated - user defined constructor required.
    
    The default constructor could not be generated because of the const
    member eTokenType, so unconstipate that. The g_TokenTypes array is
    const itself anyway.

diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index b4b6c45..7c96a9f 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -2742,7 +2742,7 @@ throw (uno::RuntimeException)
 
 struct TokenType {
     const char *pName;
-    const enum FormTokenType eTokenType;
+    enum FormTokenType eTokenType;
 };
 
 static const struct TokenType g_TokenTypes[] =
commit 8c1c09dced2182701576b5dc2c9d309b1c780cb5
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Wed Oct 26 09:57:13 2011 +0300

    WaE: reinterpret_cast used between related classes
    
    MSVC warning C4946: reinterpret_cast used between related classes:
    'sw::mark::IMark' and 'sw::mark::ICheckboxFieldmark'.
    
    This time changing the reinterpret_cast to static_cast didn't work,
    that caused compilation errors:
    
    cannot convert a 'sw::mark::IMark*' to a
    'sw::mark::ICheckboxFieldmark*'; conversion from a virtual base class
    is implied
    'const_cast' : cannot convert from 'const sw::mark::IMark *' to
    'sw::mark::ICheckboxFieldmark *'
      Conversion from pointer to base class to pointer to derived class
      requires an explicit cast (other than const_cast)
    
    dynamic_cast is what we want here. Also added an OSL_ASSERT sanity
    check. Thanks to sberg and hub for discussing this on IRC.

diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index aa92efd..45b22f7 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -685,8 +685,11 @@ SwXFieldmark::getCheckboxFieldmark()
 {
     ::sw::mark::ICheckboxFieldmark* pCheckboxFm = NULL;
     if ( getFieldType() == rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(ODF_FORMCHECKBOX) ) )
+    {
         // evil #TODO #FIXME casting away the const-ness
-        pCheckboxFm = const_cast<sw::mark::ICheckboxFieldmark*>(reinterpret_cast< const ::sw::mark::ICheckboxFieldmark* >( GetBookmark()));
+        pCheckboxFm = const_cast<sw::mark::ICheckboxFieldmark*>(dynamic_cast< const ::sw::mark::ICheckboxFieldmark* >( GetBookmark()));
+        OSL_ASSERT( GetBookmark() == 0 || pCheckboxFm != 0 );
+    }
     return  pCheckboxFm;
 
 }
commit 2175576c120806f8415be7ab2051ba639a18f564
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Wed Oct 26 09:43:48 2011 +0300

    WaE: unreferenced local variable

diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 90da132..5b00574 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -1197,7 +1197,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
                     for( ; nCnt && nCount; --nCnt, --nCount )
                         (pTmpUndoMgr->*fnDo)();
                 }
-                catch( const Exception& e )
+                catch( const Exception& )
                 {
                     DBG_UNHANDLED_EXCEPTION();
                 }
commit f8766d5258f8c8858e6f9558eb1e6e4a94dc0529
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Wed Oct 26 09:40:02 2011 +0300

    WaE: unreachable code

diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 3375f18..5d92d44 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -1339,7 +1339,6 @@ bool SmCursor::IsLineCompositionNode(SmNode* pNode){
         default:
             return false;
     }
-    return false;
 }
 
 int SmCursor::CountSelectedNodes(SmNode* pNode){


More information about the Libreoffice-commits mailing list