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

Stephan Bergmann sbergman at redhat.com
Tue Feb 3 06:31:23 PST 2015


 svtools/source/uno/unoiface.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 0bfb7ed1d3050c827a37f7431cf4c05efeb536cb
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Feb 3 15:30:56 2015 +0100

    Avoid downcast
    
    Change-Id: I0170c1ecd7f6f037640eaa26f5477fdf4852c54f

diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index d59d92b..e9bf072 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -112,8 +112,9 @@ SAL_DLLPUBLIC_EXPORT vcl::Window* CreateWindow( VCLXWindow** ppNewComp, const ::
         static_cast<CalendarField*>(pWindow)->EnableToday();
         static_cast<CalendarField*>(pWindow)->EnableNone();
         static_cast<CalendarField*>(pWindow)->EnableEmptyFieldValue( true );
-        *ppNewComp = new SVTXDateField;
-        static_cast<VCLXFormattedSpinField*>(*ppNewComp)->SetFormatter( (FormatterBase*)static_cast<DateField*>(pWindow) );
+        SVTXDateField * newComp = new SVTXDateField;
+        *ppNewComp = newComp;
+        newComp->SetFormatter( (FormatterBase*)static_cast<DateField*>(pWindow) );
     }
     else if (aServiceName.equalsIgnoreAsciiCase("roadmap") )
     {


More information about the Libreoffice-commits mailing list