Re: [Libreoffice] Wrong cast to css.table.BorderLine2

2012-01-26 Thread Eike Rathke
Hi,

On Wednesday, 2012-01-25 16:33:28 +0100, Eike Rathke wrote:
 On Wednesday, 2012-01-25 11:17:54 +0100, Stephan Bergmann wrote:
  On 01/25/2012 09:48 AM, Cedric Bosdonnat wrote:
  Hum, I'll have a look at that... but my problem with BorderLine and
  BorderLine2 is that the second one should be used everywhere... and that
  sometimes isn't the case.
  
  You apparently need a css.table.TableBorder2 that has members of
  type BorderLine2 instead of plain BorderLine.
 
 Right. Just to say that I'm wading my way through this as Cedric is
 occupied with Writer stuff. This is going to be a larger patch that
 will also have to go into 3.5.0

No way I'll do that now.. that's way too invasive and would need
adapting places in the API that needed to support both TableBorder and
TableBorder2 then.

I fixed this now with
http://cgit.freedesktop.org/libreoffice/core/commit/?id=97c66b3b13528cc50f271217663718b3d6681bd9
that just doesn't access arbitrary memory anymore and sets a solid line
style instead.

Cedric, please take over again and implement BorderLine2 with
a TableBorder2 as an optional property of text::TextTable,
table::CellProperties and sheet::TableAutoFormatField

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD


pgpLZPqKeTEEn.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] Wrong cast to css.table.BorderLine2

2012-01-25 Thread Cedric Bosdonnat
Hi Stephan,

On Mon, 2012-01-23 at 21:41 +0100, Stephan Bergmann wrote:

 where borderline.cxx:128
 const table::BorderLine2 rBorder2 = static_cast const 
 table::BorderLine2 ( rStruct );
 
 erroneously treats a BorderLine contained in a TableBorder (created at 
 afmtuno.cxx:776) as a derived BorderLine2.  That cast seemingly got in with
 
  commit 89d3e8a8424ce44404a554812e5136452bb8cb60
  Author: Cédric Bosdonnat cedricbo...@openoffice.org
  Date:   Fri Dec 24 10:00:15 2010 +0100
 
  Switching the order of the SetLinesWidth arguments

Hum, I'll have a look at that... but my problem with BorderLine and
BorderLine2 is that the second one should be used everywhere... and that
sometimes isn't the case. If only we could extend existing published UNO
types instead of specializing these.

--
Cedric

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] Wrong cast to css.table.BorderLine2

2012-01-25 Thread Stephan Bergmann

On 01/25/2012 09:48 AM, Cedric Bosdonnat wrote:

Hum, I'll have a look at that... but my problem with BorderLine and
BorderLine2 is that the second one should be used everywhere... and that
sometimes isn't the case.


You apparently need a css.table.TableBorder2 that has members of type 
BorderLine2 instead of plain BorderLine.  At least in the C++ UNO 
language binding (unlike in the Java one), struct members within structs 
are contained directly in the enclosing struct, without any 
pointer/reference indirection, so that, say, assigning a BorderLine2 
instance to a TableBorder.TopLine slices it to just BorderLine.


Stephan
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] Wrong cast to css.table.BorderLine2

2012-01-25 Thread Eike Rathke
Hi,

On Wednesday, 2012-01-25 11:17:54 +0100, Stephan Bergmann wrote:

 On 01/25/2012 09:48 AM, Cedric Bosdonnat wrote:
 Hum, I'll have a look at that... but my problem with BorderLine and
 BorderLine2 is that the second one should be used everywhere... and that
 sometimes isn't the case.
 
 You apparently need a css.table.TableBorder2 that has members of
 type BorderLine2 instead of plain BorderLine.

Right. Just to say that I'm wading my way through this as Cedric is
occupied with Writer stuff. This is going to be a larger patch that
will also have to go into 3.5.0

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD


pgpNWX3Gb8XzZ.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] Wrong cast to css.table.BorderLine2

2012-01-23 Thread Stephan Bergmann

Valgrind'ing sc_unoapi unearthed


Creating: sc.ScAutoFormatFieldObj
LOG Log started 23.00.2012 - 21:27:56
LOG create Object ...
Environment created
LOG Log started 23.00.2012 - 21:28:21
checking: [sc.ScAutoFormatFieldObj::com::sun::star::beans::XPropertySet] is 
iface: [com.sun.star.beans.XPropertySet] testcode: [ifc.beans._XPropertySet]
LOG Execute: getPropertySetInfo()
Method getPropertySetInfo() finished with state OK
LOG Getting:
LOG Setting to :New
LOG Getting: 16777215
LOG Setting to :16777220
LOG Getting: 2
LOG Setting to :3
LOG Getting: 76
LOG Setting to :77
LOG Getting: 0
LOG Setting to :5
LOG Getting: Any[Type[void], null]
LOG Property 'HoriJustifyMethod' is void but MAYBEVOID isn't set
LOG Couldn't change Property 'HoriJustifyMethod'
LOG Getting:
LOG Setting to :New
LOG Getting: 100.0
LOG Setting to :116.7
LOG Getting: 100.0
LOG Setting to :116.7
LOG Getting: 10.0
LOG Setting to :26.7
LOG Getting: 100.0
LOG Setting to :116.7
LOG Getting: com.sun.star.table.TableBorder@3bc0f2e5
LOG Setting to :com.sun.star.table.TableBorder@f5e0873
==5465== Thread 8:
==5465== Conditional jump or move depends on uninitialised value(s)
==5465==at 0x217AA402: 
editeng::SvxBorderLine::getWidthImpl(editeng::SvxBorderStyle) 
(/editeng/source/items/borderline.cxx:128)
==5465==by 0x217AACD7: 
editeng::SvxBorderLine::SetStyle(editeng::SvxBorderStyle) 
(/editeng/source/items/borderline.cxx:331)
==5465==by 0x20560DB5: 
ScHelperFunctions::GetBorderLine(editeng::SvxBorderLine, 
com::sun::star::table::BorderLine const) (/sc/source/ui/unoobj/cellsuno.cxx:956)
==5465==by 0x20560F38: ScHelperFunctions::FillBoxItems(SvxBoxItem, 
SvxBoxInfoItem, com::sun::star::table::TableBorder const) 
(/sc/source/ui/unoobj/cellsuno.cxx:973)
==5465==by 0x20552EEB: ScAutoFormatFieldObj::setPropertyValue(rtl::OUString 
const, com::sun::star::uno::Any const) (/sc/source/ui/unoobj/afmtuno.cxx:781)
==5465==by 0x15CEF7F4: callVirtualMethod(void*, unsigned int, void*, 
_typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, 
unsigned long*, unsigned int, double*, unsigned int) 
(/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:155)
==5465==by 0x15CF0334: 
cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, 
bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, 
_typelib_MethodParameter*, void*, void**, _uno_Any**) 
(/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:392)
==5465==by 0x15CF0E19: 
bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, 
_typelib_TypeDescription const*, void*, void**, _uno_Any**) 
(/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:586)
==5465==by 0x1B36EF29: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, 
std::__debug::vectorbinaryurp::BinaryAny, std::allocatorbinaryurp::BinaryAny 
*) const (/binaryurp/source/incomingrequest.cxx:263)
==5465==by 0x1B36DE7E: binaryurp::IncomingRequest::execute() const 
(/binaryurp/source/incomingrequest.cxx:89)
==5465==by 0x1B388B23: request (/binaryurp/source/reader.cxx:107)
==5465==by 0x5BCC9AD: cppu_threadpool::JobQueue::enter(long, unsigned char) 
(/cppu/source/threadpool/jobqueue.cxx:121)
==5465==by 0x5BCFF9F: cppu_threadpool::ORequestThread::run() 
(/cppu/source/threadpool/thread.cxx:222)
==5465==by 0x5BCF73F: cppu_requestThreadWorker 
(/cppu/source/threadpool/thread.cxx:57)
==5465==by 0x4C2D242: osl_thread_start_Impl (/sal/osl/unx/thread.c:292)
==5465==by 0x37E6C07D8F: start_thread 
(/usr/src/debug/glibc-2.14-394-g8f3b1ff/nptl/pthread_create.c:309)
==5465==by 0x37E68EF48C: clone 
(/usr/src/debugglibc-2.14-394-g8f3b1ff/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:115)
==5465==  Uninitialised value was created by a stack allocation
==5465==at 0x20552A5B: ScAutoFormatFieldObj::setPropertyValue(rtl::OUString 
const, com::sun::star::uno::Any const) (/sc/source/ui/unoobj/afmtuno.cxx:709)


where borderline.cxx:128
   const table::BorderLine2 rBorder2 = static_cast const 
table::BorderLine2 ( rStruct );


erroneously treats a BorderLine contained in a TableBorder (created at 
afmtuno.cxx:776) as a derived BorderLine2.  That cast seemingly got in with



commit 89d3e8a8424ce44404a554812e5136452bb8cb60
Author: Cédric Bosdonnat cedricbo...@openoffice.org
Date:   Fri Dec 24 10:00:15 2010 +0100

Switching the order of the SetLinesWidth arguments


Stephan
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice