[Libreoffice-commits] core.git: sc/source

Stephan Bergmann sbergman at redhat.com
Tue Jan 12 06:36:29 PST 2016


 sc/source/core/tool/detfunc.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 24af10f6c1aaff9fd25e969dd010f798618f2813
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 12 15:34:29 2016 +0100

    Revert "Stick to exact-type check"
    
    This reverts commit 791ad3e170bcb5a2daedac77932dc9822f7f1092, as discussed on
    IRC:
    
    <sberg> os_cib, ^ or was that intentional?
    <os_cib> sberg: There was no reason for an exact type check. Afterwards the
     pointer is static_casted to an SdrRectObj anyway.
    <sberg> os_cib, but how is that "Afterwards..." part relevant for what the if()
     should actually check?
    <os_cib> sberg: The detective function puts some object types into a certain
     drawing layer (polygons, circles and rectangles). It won't find any other
     object type in that layer.

diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index a045c36..11810e3 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -742,7 +742,7 @@ void ScDetectiveFunc::DeleteBox( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nR
         while (pObject)
         {
             if ( pObject->GetLayer() == SC_LAYER_INTERN &&
-                    typeid(*pObject) == typeid(SdrRectObj) )
+                    dynamic_cast< const SdrRectObj* >(pObject) != nullptr )
             {
                 aObjRect = static_cast<SdrRectObj*>(pObject)->GetLogicRect();
                 aObjRect.Justify();


More information about the Libreoffice-commits mailing list