[Libreoffice-commits] .: 3 commits - sal/inc sal/qa

2012-03-28 Thread Lubos Lunak
 sal/inc/rtl/string.hxx |  306 +++--
 sal/qa/rtl/strings/test_ostring_stringliterals.cxx |   88 +-
 2 files changed, 369 insertions(+), 25 deletions(-)

New commits:
commit 2ebda60bfe7897ac371dd7ee97c4309e72f20e4b
Author: Luboš Luňák l.lu...@suse.cz
Date:   Wed Mar 28 08:56:05 2012 +0200

more SFINAE to distinguish between const char* and const char[]

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index e7db97b..0593ddf 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -799,18 +799,8 @@ public:
 
 friend sal_Bool operator == ( const OString rStr1, const OString 
rStr2 ) SAL_THROW(())
 { return rStr1.getLength() == rStr2.getLength()  
rStr1.compareTo( rStr2 ) == 0; }
-friend sal_Bool operator == ( const OString rStr1, const sal_Char * 
pStr2 ) SAL_THROW(())
-{ return rStr1.compareTo( pStr2 ) == 0; }
-friend sal_Bool operator == ( const sal_Char * pStr1,   const OString 
rStr2 ) SAL_THROW(())
-{ return OString( pStr1 ).compareTo( rStr2 ) == 0; }
-
 friend sal_Bool operator != ( const OString rStr1, const OString 
rStr2 ) SAL_THROW(())
 { return !(operator == ( rStr1, rStr2 )); }
-friend sal_Bool operator != ( const OString rStr1, const sal_Char * 
pStr2 ) SAL_THROW(())
-{ return !(operator == ( rStr1, pStr2 )); }
-friend sal_Bool operator != ( const sal_Char * pStr1,   const OString 
rStr2 ) SAL_THROW(())
-{ return !(operator == ( pStr1, rStr2 )); }
-
 friend sal_Bool operator   ( const OString rStr1,const OString 
rStr2 ) SAL_THROW(())
 { return rStr1.compareTo( rStr2 )  0; }
 friend sal_Bool operator   ( const OString rStr1,const OString 
rStr2 ) SAL_THROW(())
@@ -820,6 +810,18 @@ public:
 friend sal_Bool operator = ( const OString rStr1,const OString 
rStr2 ) SAL_THROW(())
 { return rStr1.compareTo( rStr2 ) = 0; }
 
+template typename T 
+friend typename internal::CharPtrDetector T, bool ::Type operator==( 
const OString rStr1, const T value ) SAL_THROW(())
+{
+return rStr1.compareTo( value ) == 0;
+}
+
+template typename T 
+friend typename internal::CharPtrDetector T, bool ::Type operator==( 
const T value, const OString rStr2 ) SAL_THROW(())
+{
+return rStr2.compareTo( value ) == 0;
+}
+
 /**
  @overload
  This function accepts an ASCII string literal as its argument.
@@ -829,8 +831,8 @@ public:
 friend bool operator == ( const OString rStr, const char (literal)[ N ] 
) SAL_THROW(())
 {
 RTL_STRING_CONST_FUNCTION
-return rStr.getLength() == N - 1  rtl_str_compare_WithLength( 
rStr.pData-buffer, rStr.pData-length,
-literal, N - 1 );
+return rStr.getLength() == N - 1
+ rtl_str_compare_WithLength( rStr.pData-buffer, 
rStr.pData-length, literal, N - 1 ) == 0;
 }
 
 /**
@@ -856,8 +858,8 @@ public:
 friend bool operator == ( const char (literal)[ N ], const OString rStr 
) SAL_THROW(())
 {
 RTL_STRING_CONST_FUNCTION
-return rStr.getLength() == N - 1  rtl_str_compare_WithLength( 
rStr.pData-buffer, rStr.pData-length,
-literal, N - 1 );
+return rStr.getLength() == N - 1
+ rtl_str_compare_WithLength( rStr.pData-buffer, 
rStr.pData-length, literal, N - 1 ) == 0;
 }
 
 /**
@@ -874,6 +876,18 @@ public:
 return rStr.compareTo( value ) == 0;
 }
 
+template typename T 
+friend typename internal::CharPtrDetector T, bool ::Type operator!=( 
const OString rStr1, const T value ) SAL_THROW(())
+{
+return !(operator == ( rStr1, value ));
+}
+
+template typename T 
+friend typename internal::CharPtrDetector T, bool ::Type operator!=( 
const T value,   const OString rStr2 ) SAL_THROW(())
+{
+return !(operator == ( value, rStr2 ));
+}
+
 /**
  @overload
  This function accepts an ASCII string literal as its argument.
diff --git a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx 
b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
index 0ada709..4af152c 100644
--- a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
@@ -149,20 +149,48 @@ void test::ostring::StringLiterals::checkUsage()
 
 rtl_string_unittest_const_literal = false; // start checking for OString 
conversions
 rtl_string_unittest_non_const_literal_function = false; // and check for 
non-const variants
+rtl_string_unittest_const_literal_function = false;
 CPPUNIT_ASSERT_EQUAL( foo, rtl::OString() = foo );
+CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+rtl_string_unittest_const_literal_function = false;
 CPPUNIT_ASSERT( 

[Libreoffice-commits] .: 2 commits - chart2/source

2012-03-28 Thread Markus Mohrhard
 chart2/source/view/main/ChartView.cxx |   33 +
 1 file changed, 25 insertions(+), 8 deletions(-)

New commits:
commit bef64b011337fa60b27339a00c30303143b4397d
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Mar 28 09:30:00 2012 +0200

add name attribute to chart's layout dumper

diff --git a/chart2/source/view/main/ChartView.cxx 
b/chart2/source/view/main/ChartView.cxx
index bb49dce..77fe6ab 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -3070,7 +3070,15 @@ void dumpXShape( uno::Reference drawing::XShape  
xShape, xmlTextWriterPtr xmlW
 
 uno::Reference lang::XServiceInfo  xServiceInfo( xShape, 
uno::UNO_QUERY_THROW );
 uno::Sequence rtl::OUString  aServiceNames = 
xServiceInfo-getSupportedServiceNames();
-sal_Int32 nServices = aServiceNames.getLength();
+
+uno::Reference beans::XPropertySet  xPropSet(xShape, 
uno::UNO_QUERY_THROW);
+uno::Any aAny = xPropSet-getPropertyValue(Name);
+rtl::OUString aName;
+if (aAny = aName)
+{
+if (!aName.isEmpty())
+xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST(name), 
%s, rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr());
+}
 if (xServiceInfo-supportsService(com.sun.star.drawing.Text))
 {
 uno::Reference text::XText  xText(xShape, uno::UNO_QUERY_THROW);
@@ -3078,19 +3086,20 @@ void dumpXShape( uno::Reference drawing::XShape  
xShape, xmlTextWriterPtr xmlW
 if(!aText.isEmpty())
 xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST(text), 
%s, rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr());
 }
-for (sal_Int32 i = 0; i  nServices; ++i)
+else if(xServiceInfo-supportsService(com.sun.star.drawing.GroupShape))
 {
-if 
(aServiceNames[i].equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(com.sun.star.drawing.GroupShape)))
-{
-uno::Reference drawing::XShapes  xShapes(xShape, 
uno::UNO_QUERY_THROW);
-dumpXShapes(xShapes, xmlWriter);
-}
+uno::Reference drawing::XShapes  xShapes(xShape, 
uno::UNO_QUERY_THROW);
+dumpXShapes(xShapes, xmlWriter);
+}
 #if DEBUG_DUMPER
+sal_Int32 nServices = aServiceNames.getLength();
+for (sal_Int32 i = 0; i  nServices; ++i)
+{
 xmlTextWriterStartElement(xmlWriter, BAD_CAST( ServiceName ));
 xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST( name ), %s, 
rtl::OUStringToOString(aServiceNames[i], RTL_TEXTENCODING_UTF8).getStr());
 xmlTextWriterEndElement( xmlWriter );
-#endif
 }
+#endif
 
 xmlTextWriterEndElement( xmlWriter );
 }
commit f084ac6556ab2374e7cbde5c426feeca0c3b9b9d
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Mar 28 09:01:56 2012 +0200

add drawing.Text to chart's dumper

diff --git a/chart2/source/view/main/ChartView.cxx 
b/chart2/source/view/main/ChartView.cxx
index 250f1c8..bb49dce 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -100,6 +100,7 @@
 #include com/sun/star/awt/Size.hpp
 #include com/sun/star/awt/Point.hpp
 #include com/sun/star/drawing/XShapeDescriptor.hpp
+#include com/sun/star/text/XText.hpp
 
 #include com/sun/star/style/XStyleFamiliesSupplier.hpp
 #include com/sun/star/text/XTextDocument.hpp
@@ -3027,7 +3028,7 @@ uno::Sequence ::rtl::OUString  
ChartView::getAvailableServiceNames() throw (un
 
 namespace {
 
-#define DEBUG_DUMPER 0
+#define DEBUG_DUMPER 1
 
 int writeCallback(void* pContext, const char* sBuffer, int nLen)
 {
@@ -3070,6 +3071,13 @@ void dumpXShape( uno::Reference drawing::XShape  
xShape, xmlTextWriterPtr xmlW
 uno::Reference lang::XServiceInfo  xServiceInfo( xShape, 
uno::UNO_QUERY_THROW );
 uno::Sequence rtl::OUString  aServiceNames = 
xServiceInfo-getSupportedServiceNames();
 sal_Int32 nServices = aServiceNames.getLength();
+if (xServiceInfo-supportsService(com.sun.star.drawing.Text))
+{
+uno::Reference text::XText  xText(xShape, uno::UNO_QUERY_THROW);
+rtl::OUString aText = xText-getString();
+if(!aText.isEmpty())
+xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST(text), 
%s, rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr());
+}
 for (sal_Int32 i = 0; i  nServices; ++i)
 {
 if 
(aServiceNames[i].equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(com.sun.star.drawing.GroupShape)))
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/CppunitTest_sal_osl_process.mk sal/Executable_osl_process_child.mk

2012-03-28 Thread Matus Kukan
 sal/CppunitTest_sal_osl_process.mk  |4 
 sal/Executable_osl_process_child.mk |4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 2fc2a3542988e0dbf71163b40d5fe495a6789d40
Author: Matúš Kukan matus.ku...@gmail.com
Date:   Wed Mar 28 09:43:48 2012 +0200

sal: add dependency for unit test, fix typo in comment

diff --git a/sal/CppunitTest_sal_osl_process.mk 
b/sal/CppunitTest_sal_osl_process.mk
index 257d065..aad9405 100644
--- a/sal/CppunitTest_sal_osl_process.mk
+++ b/sal/CppunitTest_sal_osl_process.mk
@@ -36,4 +36,8 @@ $(eval $(call gb_CppunitTest_add_linked_libs,sal_osl_process,\
 $(gb_STDLIBS) \
 ))
 
+# Depend on to be tested executable
+$(call gb_CppunitTest_get_target,sal_osl_process) : \
+   $(call gb_Executable_get_target,osl_process_child)
+
 # vim: set noet sw=4 ts=4:
diff --git a/sal/Executable_osl_process_child.mk 
b/sal/Executable_osl_process_child.mk
index 3e538ff..fb348fa 100644
--- a/sal/Executable_osl_process_child.mk
+++ b/sal/Executable_osl_process_child.mk
@@ -25,7 +25,7 @@
 # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
 # instead of those above.
 
-# This executable is only required by unit-test sal_osl_profile.
+# This executable is required only by sal_osl_process test.
 # See qa/osl/process/osl_process.cxx:411
 $(eval $(call gb_Executable_Executable,osl_process_child))
 
@@ -38,7 +38,7 @@ $(eval $(call 
gb_Executable_add_exception_objects,osl_process_child,\
sal/qa/osl/process/osl_process_child \
 ))
 
-# Also this batch file is required by sal_osl_profile.
+# Also this batch file is required by sal_osl_process.
 # See qa/osl/process/osl_process.cxx:675
 ifeq ($(OS),WNT)
 BATCH_FILE:=batch.bat
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 4 commits - oox/inc oox/source writerfilter/source

2012-03-28 Thread Miklos Vajna
 oox/inc/oox/vml/vmlshape.hxx|   17 
 oox/inc/oox/vml/vmlshapecontext.hxx |4 +
 oox/source/vml/vmlshape.cxx |   42 +++-
 oox/source/vml/vmlshapecontext.cxx  |   20 +
 writerfilter/source/Makefile|4 -
 writerfilter/source/ooxml/gperffasttokenhandler.xsl |   13 ++
 6 files changed, 89 insertions(+), 11 deletions(-)

New commits:
commit 4159a4e6ce38b333ced3ba5f75e28473605633e8
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Mar 27 18:39:04 2012 +0200

n#751117 oox: implement VML import of shape style 'flip'

diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index bde8823..c4ab2cd 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -81,6 +81,7 @@ struct ShapeTypeModel
 ::rtl::OUString maMarginTop;/// Y position of the shape 
bounding box to shape anchor (number with unit).
 ::rtl::OUString maPositionVerticalRelative; /// The Y position is 
relative to this.
 ::rtl::OUString maRotation; /// Rotation of the shape, in 
degrees.
+::rtl::OUString maFlip; /// Rotation of the shape, in 
degrees.
 sal_BoolmbAutoHeight;   /// If true, the height value 
is a minimum value (mostly used for textboxes)
 
 StrokeModel maStrokeModel;  /// Border line formatting.
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index ad508c6..37e6431 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -367,7 +367,22 @@ SimpleShape::SimpleShape( Drawing rDrawing, const 
OUString rService ) :
 
 Reference XShape  SimpleShape::implConvertAndInsert( const Reference 
XShapes  rxShapes, const Rectangle rShapeRect ) const
 {
-Reference XShape  xShape = mrDrawing.createAndInsertXShape( maService, 
rxShapes, rShapeRect );
+Rectangle aShapeRect(rShapeRect);
+if (!maTypeModel.maFlip.isEmpty())
+{
+if (maTypeModel.maFlip.equalsAscii(x))
+{
+aShapeRect.X += aShapeRect.Width;
+aShapeRect.Width *= -1;
+}
+else if (maTypeModel.maFlip.equalsAscii(y))
+{
+aShapeRect.Y += aShapeRect.Height;
+aShapeRect.Height *= -1;
+}
+}
+
+Reference XShape  xShape = mrDrawing.createAndInsertXShape( maService, 
rxShapes, aShapeRect );
 convertShapeProperties( xShape );
 
 if ( maService.equalsAscii( com.sun.star.text.TextFrame ) )
diff --git a/oox/source/vml/vmlshapecontext.cxx 
b/oox/source/vml/vmlshapecontext.cxx
index fb10331..57a85e9 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -350,6 +350,7 @@ void ShapeTypeContext::setStyle( const OUString rStyle )
 else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( 
mso-position-vertical-relative ) ) ) mrTypeModel.maPositionVerticalRelative = 
aValue;
 else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( 
mso-fit-shape-to-text ) ) )  mrTypeModel.mbAutoHeight = sal_True;
 else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( 
rotation ) ) )  mrTypeModel.maRotation = aValue;
+else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( flip ) 
) )  mrTypeModel.maFlip = aValue;
 }
 }
 }
commit 559ecabbfc6d78df995c899ba996a470e241b76c
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Mar 27 14:34:35 2012 +0200

n#751117 oox: implement VML import of v:line token

diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index c00625c..bde8823 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -186,6 +186,8 @@ struct ShapeModel
 TextBoxPtr  mxTextBox;  /// Text contents and properties.
 ClientDataPtr   mxClientData;   /// Excel specific client data.
 ::rtl::OUString maLegacyDiagramPath;/// Legacy Diagram Fragment Path
+::rtl::OUString maFrom; /// Start point for line shape.
+::rtl::OUString maTo;   /// End point for line shape.
 
 explicitShapeModel();
 ~ShapeModel();
@@ -312,6 +314,19 @@ protected:
 const ::com::sun::star::awt::Rectangle rShapeRect 
) const;
 };
 
+/** A Line shape object. */
+class LineShape : public SimpleShape
+{
+public:
+explicitLineShape( Drawing rDrawing );
+
+protected:
+/** Creates the corresponding XShape and inserts it into the passed 
container. */
+virtual ::com::sun::star::uno::Reference 
::com::sun::star::drawing::XShape 
+implConvertAndInsert(
+const ::com::sun::star::uno::Reference 
::com::sun::star::drawing::XShapes  rxShapes,
+const ::com::sun::star::awt::Rectangle rShapeRect 
) const;
+};
 // 

[Libreoffice-commits] .: oox/inc

2012-03-28 Thread Miklos Vajna
 oox/inc/oox/vml/vmlshape.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b9f79762f07448b7100bb09acd1f4ee748b32a2e
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Mar 28 10:36:18 2012 +0200

ShapeTypeModel::maFlip: correct bogus doxygen comment

diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index c4ab2cd..c6c6cb6 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -81,7 +81,7 @@ struct ShapeTypeModel
 ::rtl::OUString maMarginTop;/// Y position of the shape 
bounding box to shape anchor (number with unit).
 ::rtl::OUString maPositionVerticalRelative; /// The Y position is 
relative to this.
 ::rtl::OUString maRotation; /// Rotation of the shape, in 
degrees.
-::rtl::OUString maFlip; /// Rotation of the shape, in 
degrees.
+::rtl::OUString maFlip; /// Flip type of the shape 
(can be x or y).
 sal_BoolmbAutoHeight;   /// If true, the height value 
is a minimum value (mostly used for textboxes)
 
 StrokeModel maStrokeModel;  /// Border line formatting.
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 3 commits - sw/inc sw/source

2012-03-28 Thread Cédric Bosdonnat
 sw/inc/editsh.hxx   |   38 +++-
 sw/source/core/edit/edattr.cxx  |   63 +++
 sw/source/ui/inc/formatclipboard.hxx|7 
 sw/source/ui/uiview/formatclipboard.cxx |  270 ++--
 4 files changed, 258 insertions(+), 120 deletions(-)

New commits:
commit 357fac9713875302d30185feabaf5c165e040ca4
Author: Maxime de Roucy mdero...@linagora.com
Date:   Wed Mar 14 16:07:57 2012 +0100

Rewrite of the format paintbrush

With this patch the format paintbrush differentiate automatic character
attributes apply to character than those apply to paragraph.
Character attributes applied to paragraph are treat as paragraph format
when paragraph format are copied (and so apply to paragraph), and treat
as character format when paragraph format are not copied.

It also change the behavior of the format paintbrush on restart
numbering and restart numbering at attributes. With this patch those
attributes are simply copied… as expected.

diff --git a/sw/source/ui/inc/formatclipboard.hxx 
b/sw/source/ui/inc/formatclipboard.hxx
index 4cca4e7..aa89f99 100644
--- a/sw/source/ui/inc/formatclipboard.hxx
+++ b/sw/source/ui/inc/formatclipboard.hxx
@@ -81,8 +81,11 @@ public:
 private:
 int m_nSelectionType;
 
-/** automatic/named character and paragraph attribute set */
-SfxItemSet* m_pItemSet;
+/** automatic/named character attribute set */
+SfxItemSet* m_pItemSet_TxtAttr;
+/** automatic/named paragraph attribute set
+ * (it can be caractere attribute applyied to the paragraph) */
+SfxItemSet* m_pItemSet_ParAttr;
 
 /** table attribute set */
 SfxItemSet* m_pTableItemSet;
diff --git a/sw/source/ui/uiview/formatclipboard.cxx 
b/sw/source/ui/uiview/formatclipboard.cxx
index 61dfd31..8b09cba 100644
--- a/sw/source/ui/uiview/formatclipboard.cxx
+++ b/sw/source/ui/uiview/formatclipboard.cxx
@@ -84,12 +84,9 @@ RES_TEXTGRID, RES_FRMATR_END-1,
 #define FORMAT_PAINTBRUSH_PARAGRAPH_IDS \
 RES_PARATR_BEGIN, RES_PARATR_END -1, \
 RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END -1, \
-FORMAT_PAINTBRUSH_FRAME_IDS \
-FN_NUMBER_NEWSTART, FN_NUMBER_NEWSTART, \
-FN_NUMBER_NEWSTART_AT, FN_NUMBER_NEWSTART_AT,
+FORMAT_PAINTBRUSH_FRAME_IDS
 
-SfxItemSet* lcl_CreateEmptyItemSet( int nSelectionType, SfxItemPool rPool
-, bool bNoCharacterFormats = false, bool bNoParagraphFormats = 
false )
+SfxItemSet* lcl_CreateEmptyItemSet( int nSelectionType, SfxItemPool rPool, 
bool bNoParagraphFormats = false )
 {
 SfxItemSet* pItemSet = 0;
 if( nSelectionType  (nsSelectionType::SEL_FRM | nsSelectionType::SEL_OLE 
| nsSelectionType::SEL_GRF) )
@@ -102,30 +99,9 @@ SfxItemSet* lcl_CreateEmptyItemSet( int nSelectionType, 
SfxItemPool rPool
 {
 //is handled different
 }
-else if( nSelectionType == nsSelectionType::SEL_TBL )
-{
-pItemSet = new SfxItemSet(rPool,
-SID_ATTR_BORDER_INNER,  SID_ATTR_BORDER_SHADOW, 
//SID_ATTR_BORDER_OUTER is inbetween
-RES_BACKGROUND, RES_SHADOW, //RES_BOX is 
inbetween
-SID_ATTR_BRUSH_ROW, SID_ATTR_BRUSH_TABLE,
-RES_BREAK,  RES_BREAK,
-RES_PAGEDESC,   RES_PAGEDESC,
-RES_LAYOUT_SPLIT,   RES_LAYOUT_SPLIT,
-RES_ROW_SPLIT,  RES_ROW_SPLIT,
-RES_KEEP,   RES_KEEP,
-RES_FRAMEDIR,   RES_FRAMEDIR,
-FN_PARAM_TABLE_HEADLINE, FN_PARAM_TABLE_HEADLINE,
-FN_TABLE_BOX_TEXTORIENTATION, 
FN_TABLE_BOX_TEXTORIENTATION,
-FN_TABLE_SET_VERT_ALIGN, FN_TABLE_SET_VERT_ALIGN,
-0);
-}
 else if( nSelectionType  nsSelectionType::SEL_TXT )
 {
-if( bNoCharacterFormats )
-pItemSet = new SfxItemSet(rPool,
-FORMAT_PAINTBRUSH_PARAGRAPH_IDS
-0);
-else if( bNoParagraphFormats )
+if( bNoParagraphFormats )
 pItemSet = new SfxItemSet(rPool,
 RES_CHRATR_BEGIN, RES_CHRATR_END - 1,
 0);
@@ -270,20 +246,23 @@ void lcl_setTableAttributes( const SfxItemSet rSet, 
SwWrtShell rSh )
 
 SwFormatClipboard::SwFormatClipboard()
 : m_nSelectionType(0)
-, m_pItemSet(0)
+, m_pItemSet_TxtAttr(0)
+, m_pItemSet_ParAttr(0)
 , m_pTableItemSet(0)
 , m_bPersistentCopy(false)
 {
 }
 SwFormatClipboard::~SwFormatClipboard()
 {
-delete m_pItemSet;
+delete m_pItemSet_TxtAttr;
+delete m_pItemSet_ParAttr;
 delete m_pTableItemSet;
 }
 
 bool SwFormatClipboard::HasContent() const
 {
-return m_pItemSet!=0
+return m_pItemSet_TxtAttr!=0
+|| m_pItemSet_ParAttr!=0
 || m_pTableItemSet != 0
 || m_aCharStyle.Len()
 || 

[Libreoffice-commits] .: Branch 'feature/cmclayout' - vcl/inc vcl/qa vcl/source

2012-03-28 Thread Caolán McNamara
 vcl/inc/vcl/window.hxx |2 
 vcl/qa/cppunit/builder/demo.ui |  116 -
 vcl/source/window/builder.cxx  |   21 +++
 vcl/source/window/window.cxx   |   32 +++
 4 files changed, 113 insertions(+), 58 deletions(-)

New commits:
commit 43b1a06faf7bde3e04be95f6e6c35bd3926da52e
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Mar 28 14:10:13 2012 +0100

allow reordering widget according to packing::position

diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index d6028b7..625e9f5 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -1098,6 +1098,8 @@ public:
 return nValue;
 }
 
+void reorderWithinParent(sal_uInt16 nNewPosition);
+
 //-
 //  Native Widget Rendering functions
 //-
diff --git a/vcl/qa/cppunit/builder/demo.ui b/vcl/qa/cppunit/builder/demo.ui
index 786ad76..044a45e 100644
--- a/vcl/qa/cppunit/builder/demo.ui
+++ b/vcl/qa/cppunit/builder/demo.ui
@@ -49,64 +49,6 @@
 property name=position0/property
   /packing
 /child
-child
-  object class=GtkBox id=box2
-property name=visibleTrue/property
-property name=can_focusFalse/property
-child
-  object class=GtkButton id=button3
-property name=label translatable=yesbutton/property
-property name=visibleTrue/property
-property name=can_focusTrue/property
-property name=receives_defaultTrue/property
-property name=use_action_appearanceFalse/property
-  /object
-  packing
-property name=expandFalse/property
-property name=fillTrue/property
-property name=position0/property
-  /packing
-/child
-child
-  object class=GtkRadioButton id=radiobutton1
-property name=label 
translatable=yesradiobutton/property
-property name=visibleTrue/property
-property name=can_focusTrue/property
-property name=receives_defaultFalse/property
-property name=use_action_appearanceFalse/property
-property name=xalign0/property
-property name=activeTrue/property
-property name=draw_indicatorTrue/property
-  /object
-  packing
-property name=expandFalse/property
-property name=fillTrue/property
-property name=position1/property
-  /packing
-/child
-child
-  object class=GtkCheckButton id=checkbutton1
-property name=label 
translatable=yescheckbutton/property
-property name=visibleTrue/property
-property name=can_focusTrue/property
-property name=receives_defaultFalse/property
-property name=use_action_appearanceFalse/property
-property name=xalign0/property
-property name=draw_indicatorTrue/property
-  /object
-  packing
-property name=expandFalse/property
-property name=fillTrue/property
-property name=position2/property
-  /packing
-/child
-  /object
-  packing
-property name=expandFalse/property
-property name=fillTrue/property
-property name=position0/property
-  /packing
-/child
 child internal-child=action_area
   object class=GtkButtonBox id=dialog-action_area1
 property name=can_focusFalse/property
@@ -210,6 +152,64 @@
 property name=position1/property
   /packing
 /child
+child
+  object class=GtkBox id=box2
+property name=visibleTrue/property
+property name=can_focusFalse/property
+child
+  object class=GtkButton id=button3
+property name=label translatable=yesbutton/property
+property name=visibleTrue/property
+property name=can_focusTrue/property
+property name=receives_defaultTrue/property
+property name=use_action_appearanceFalse/property
+  /object
+  packing
+property name=expandFalse/property
+property name=fillTrue/property
+property name=position0/property
+  /packing
+/child
+child
+  object class=GtkRadioButton id=radiobutton1
+property name=label 
translatable=yesradiobutton/property
+property name=visibleTrue/property
+property name=can_focusTrue/property
+property 

[Libreoffice-commits] .: 5 commits - android/Bootstrap android/experiments codemaker/source sal/android ucbhelper/source

2012-03-28 Thread Tor Lillqvist
 android/Bootstrap/src/org/libreoffice/android/Bootstrap.java   
 |4 +
 android/experiments/DocumentLoader/Makefile
 |   13 ---
 
android/experiments/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
 |2 
 codemaker/source/javamaker/javatype.cxx
 |5 +
 sal/android/lo-bootstrap.c 
 |   21 +
 ucbhelper/source/client/contentbroker.cxx  
 |   38 ++
 6 files changed, 71 insertions(+), 12 deletions(-)

New commits:
commit 61d1533961d002ff0630a0505686dc37b5c393ca
Author: Tor Lillqvist tlillqv...@suse.com
Date:   Wed Mar 28 16:45:24 2012 +0300

Include unoil.jar

diff --git a/android/experiments/DocumentLoader/Makefile 
b/android/experiments/DocumentLoader/Makefile
index 872618f..ddf5146 100644
--- a/android/experiments/DocumentLoader/Makefile
+++ b/android/experiments/DocumentLoader/Makefile
@@ -196,21 +196,12 @@ build-ant: copy-stuff
   juh \
   jurt \
   ridl \
+  unoil \
   unoloader \
  ); do \
$(call COPYJAR,$(OUTDIR)/bin/$${F}.jar); \
done
 #
-# com.sun.star.frame.XComponentLoader is not in any jar
-#
-   cd libs  \
-   LD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib \
-   DYLD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib \
-   $(OUTDIR_FOR_BUILD)/bin/javamaker -BUCR -nD \
-   $(OUTDIR)/bin/udkapi.rdb $(OUTDIR)/bin/offapi.rdb \
-   -Tcom.sun.star.frame.XComponentLoader  \
-   jar cvf more.jar com
-#
unset JAVA_HOME  $(ANT) debug
 
 install: build-ant
commit de290c0ffc7a4969fb1cdc33696d241f47804592
Author: Tor Lillqvist tlillqv...@suse.com
Date:   Wed Mar 28 16:44:53 2012 +0300

Leave out reference to the the user registrymodifications.xcu for now

diff --git a/android/experiments/DocumentLoader/Makefile 
b/android/experiments/DocumentLoader/Makefile
index 7aa3264..872618f 100644
--- a/android/experiments/DocumentLoader/Makefile
+++ b/android/experiments/DocumentLoader/Makefile
@@ -156,7 +156,7 @@ copy-stuff:
echo LO_LIB_DIR=file:$(APP_DATA_PATH)/lib/  
assets/program/fundamentalrc
echo URE_LIB_DIR=file://$(APP_DATA_PATH)/lib/  
assets/program/fundamentalrc # checkme - is this used to find configs ?
echo 'BRAND_BASE_DIR=file:///assets'  assets/program/fundamentalrc
-   echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry 
module:$${BRAND_BASE_DIR}/share/registry/modules 
res:$${BRAND_BASE_DIR}/share/registry 
user:$${$$BRAND_BASE_DIR/program/bootstraprc:UserInstallation}/user/registrymodifications.xcu'
  assets/program/fundamentalrc
+   echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry 
module:$${BRAND_BASE_DIR}/share/registry/modules 
res:$${BRAND_BASE_DIR}/share/registry'  assets/program/fundamentalrc
echo 
'URE_BIN_DIR=file:///assets/ure/bin/dir/not-here/can-we/exec-anyway'  
assets/program/fundamentalrc
echo 'URE_MORE_TYPES=file:///assets/bin/ure/types.rdb 
file:///assets/bin/types.rdb'  assets/program/fundamentalrc
echo 'URE_MORE_SERVICES=file:///assets/xml/ure/services.rdb 
file:///assets/xml/services.rdb $$BRAND_BASE_DIR/program/services*'  
assets/program/fundamentalrc
commit 6db50818c1f6685adc4551c6927c9420f0872775
Author: Tor Lillqvist tlillqv...@suse.com
Date:   Wed Mar 28 16:42:34 2012 +0300

Add JNI wrapper for InitUCBHelper() and call it

diff --git a/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java 
b/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java
index e5f2f1e..c60c9e9 100644
--- a/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java
+++ b/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java
@@ -93,6 +93,10 @@ public class Bootstrap extends NativeActivity
 // where the lo-bootstrap library is.
 public static native void setCommandArgs(String[] argv);
 
+// A wrapper for InitUCBHelper() in he ucbhelper library
+// (contentbroker.cxx), also this called indirectly through the 
lo-bootstrap library
+public static native void initUCBHelper();
+
 public static void setup(Activity activity)
 {
 String dataDir = null;
diff --git 
a/android/experiments/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
 
b/android/experiments/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
index 882c73c..93ed87e 100644
--- 
a/android/experiments/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
+++ 
b/android/experiments/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
@@ -91,6 +91,8 @@ public class DocumentLoader
 
 Log.i(TAG, oDesktop is + (oDesktop!=null ?  not : ) +  
null);
 
+

[Libreoffice-commits] .: sw/qa

2012-03-28 Thread Miklos Vajna
 sw/qa/extras/ooxmltok/data/n751117.docx |binary
 sw/qa/extras/ooxmltok/ooxmltok.cxx  |   29 +
 2 files changed, 29 insertions(+)

New commits:
commit bbb03549db3ecb9e4e5a3c4c3cb58059c06ea7e8
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Mar 28 17:35:44 2012 +0200

add testcase for n#751117

diff --git a/sw/qa/extras/ooxmltok/data/n751117.docx 
b/sw/qa/extras/ooxmltok/data/n751117.docx
new file mode 100644
index 000..17cc9c5
Binary files /dev/null and b/sw/qa/extras/ooxmltok/data/n751117.docx differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx 
b/sw/qa/extras/ooxmltok/ooxmltok.cxx
index 32d39af..364d66d 100644
--- a/sw/qa/extras/ooxmltok/ooxmltok.cxx
+++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx
@@ -27,6 +27,7 @@
 
 #include com/sun/star/beans/XPropertySet.hpp
 #include com/sun/star/drawing/XDrawPageSupplier.hpp
+#include com/sun/star/lang/XServiceInfo.hpp
 #include com/sun/star/text/TextContentAnchorType.hpp
 
 #include test/bootstrapfixture.hxx
@@ -44,10 +45,12 @@ public:
 virtual void setUp();
 virtual void tearDown();
 void testN751054();
+void testN751117();
 
 CPPUNIT_TEST_SUITE(OoxmlModelTest);
 #if !defined(MACOSX)  !defined(WNT)
 CPPUNIT_TEST(testN751054);
+CPPUNIT_TEST(testN751117);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
@@ -90,6 +93,32 @@ void OoxmlModelTest::testN751054()
 CPPUNIT_ASSERT(eValue != text::TextContentAnchorType_AS_CHARACTER);
 }
 
+void OoxmlModelTest::testN751117()
+{
+load(n751117.docx);
+
+uno::Referencedrawing::XDrawPageSupplier xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Referencecontainer::XIndexAccess 
xDraws(xDrawPageSupplier-getDrawPage(), uno::UNO_QUERY);
+
+// First shape: the end should be an arrow, should be rotated and should 
be flipped.
+uno::Referencebeans::XPropertySet xPropertySet(xDraws-getByIndex(0), 
uno::UNO_QUERY);
+OUString aValue;
+xPropertySet-getPropertyValue(LineEndName) = aValue;
+CPPUNIT_ASSERT(aValue.indexOf(Arrow) != -1);
+
+sal_Int32 nValue = 0;
+xPropertySet-getPropertyValue(RotateAngle) = nValue;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(90 * 100), nValue);
+
+uno::Referencedrawing::XShape xShape(xPropertySet, uno::UNO_QUERY);
+awt::Size aActualSize(xShape-getSize());
+CPPUNIT_ASSERT(aActualSize.Width  0);
+
+// The second shape should be a line
+uno::Referencelang::XServiceInfo xServiceInfo(xDraws-getByIndex(1), 
uno::UNO_QUERY);
+
CPPUNIT_ASSERT(xServiceInfo-supportsService(com.sun.star.drawing.LineShape));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(OoxmlModelTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc sal/qa

2012-03-28 Thread Lubos Lunak
 sal/inc/rtl/string.hxx |7 +++
 sal/qa/rtl/strings/test_ostring_stringliterals.cxx |2 ++
 2 files changed, 9 insertions(+)

New commits:
commit 86a1e6de4fc3af897271bc5f7f04506261d4f286
Author: Luboš Luňák l.lu...@suse.cz
Date:   Wed Mar 28 17:37:19 2012 +0200

SFINAE workarounds for gcc-4.0.1

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 39414e6..68f41bd 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -551,6 +551,12 @@ public:
   @return   sal_True if the strings are equal;
 sal_False, otherwise.
 */
+#ifdef HAVE_SFINAE_ANONYMOUS_BROKEN
+sal_Bool equalsIgnoreAsciiCase( const sal_Char * asciiStr ) const 
SAL_THROW(())
+{
+return rtl_str_compareIgnoreAsciiCase( pData-buffer, asciiStr ) == 0;
+}
+#else
 template typename T 
 typename internal::CharPtrDetector T, bool ::Type equalsIgnoreAsciiCase( 
const T asciiStr ) const SAL_THROW(())
 {
@@ -577,6 +583,7 @@ public:
 return rtl_str_compareIgnoreAsciiCase_WithLength( pData-buffer, 
pData-length,
   literal, 
internal::ConstCharArrayDetector T, void ::size - 1 ) == 0;
 }
+#endif
 
 /**
   Perform a ASCII lowercase comparison of two strings.
diff --git a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx 
b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
index 4af152c..930b038 100644
--- a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
@@ -152,9 +152,11 @@ void test::ostring::StringLiterals::checkUsage()
 rtl_string_unittest_const_literal_function = false;
 CPPUNIT_ASSERT_EQUAL( foo, rtl::OString() = foo );
 CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+#ifndef HAVE_SFINAE_ANONYMOUS_BROKEN
 rtl_string_unittest_const_literal_function = false;
 CPPUNIT_ASSERT( FoO.equalsIgnoreAsciiCase( fOo ));
 CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+#endif
 rtl_string_unittest_const_literal_function = false;
 CPPUNIT_ASSERT( foobarfoo.match( bar, 3 ));
 CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 9 commits - sc/inc sc/source

2012-03-28 Thread Ivan Timofeev
 sc/inc/chartpos.hxx  |   10 +-
 sc/source/core/tool/chartpos.cxx |  161 +++
 2 files changed, 88 insertions(+), 83 deletions(-)

New commits:
commit 6b170f3d0aa519c6fd4e3ee92421f5a87ab511e3
Author: Ivan Timofeev timofeev@gmail.com
Date:   Wed Mar 28 21:06:03 2012 +0400

WaE: declaration of 'it' shadows a previous local

diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx
index 7ab9e43..78ea6e7 100644
--- a/sc/source/core/tool/chartpos.cxx
+++ b/sc/source/core/tool/chartpos.cxx
@@ -409,8 +409,7 @@ void ScChartPositioner::CreatePositionMap()
 sal_uLong nInsRow = (bNoGlue ? nNoGlueRow : nRow1);
 for ( nRow = nRow1; nRow = nRow2; nRow++, nInsRow++ )
 {
-RowMap::const_iterator it = pCol-find( nInsRow );
-if ( it == pCol-end() )
+if ( pCol-find( nInsRow ) == pCol-end() )
 {
 pCol-insert( RowMap::value_type( nInsRow, new 
ScAddress( nCol, nRow, nTab ) ) );
 }
commit 82e0247c7a36aedf7ecf55488360f9abeb89726a
Author: Ivan Timofeev timofeev@gmail.com
Date:   Wed Mar 28 21:03:17 2012 +0400

remove the wrongly placed semicolon

diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx
index 0d963f1..7ab9e43 100644
--- a/sc/source/core/tool/chartpos.cxx
+++ b/sc/source/core/tool/chartpos.cxx
@@ -565,7 +565,7 @@ ScChartPositionMap::ScChartPositionMap( SCCOL nChartCols, 
SCROW nChartRows,
 ppData[ nIndex ] = pPosIter-second;
 ++pPosIter;
 }
-for ( ; nRow  nRowCount; nRow++, nIndex++ ) ;
+for ( ; nRow  nRowCount; nRow++, nIndex++ )
 ppData[ nIndex ] = NULL;
 
 ++pColIter;
commit 8affd7e908fe695c548da702cafe76a8b031fdef
Author: Ivan Timofeev timofeev@gmail.com
Date:   Wed Mar 28 18:54:13 2012 +0400

this iterator should point to where the insert should start to search

diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx
index cdc27f6..0d963f1 100644
--- a/sc/source/core/tool/chartpos.cxx
+++ b/sc/source/core/tool/chartpos.cxx
@@ -399,7 +399,7 @@ void ScChartPositioner::CreatePositionMap()
 if ( it == pCols-end() )
 {
 pCol = new RowMap;
-pCols-insert(it, ColumnMap::value_type( nInsCol, pCol ) );
+pCols-insert( ColumnMap::value_type( nInsCol, pCol ) );
 }
 else
 pCol = it-second;
@@ -412,7 +412,7 @@ void ScChartPositioner::CreatePositionMap()
 RowMap::const_iterator it = pCol-find( nInsRow );
 if ( it == pCol-end() )
 {
-pCol-insert(it, RowMap::value_type( nInsRow, new 
ScAddress( nCol, nRow, nTab ) ) );
+pCol-insert( RowMap::value_type( nInsRow, new 
ScAddress( nCol, nRow, nTab ) ) );
 }
 }
 }
commit 8627b0a297d6a2b7461bb53da2f434c397cb2603
Author: Ivan Timofeev timofeev@gmail.com
Date:   Tue Mar 27 23:03:03 2012 +0400

there was Table::Insert, let's use map::insert as a replacement

diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx
index bae4802..cdc27f6 100644
--- a/sc/source/core/tool/chartpos.cxx
+++ b/sc/source/core/tool/chartpos.cxx
@@ -475,7 +475,7 @@ void ScChartPositioner::CreatePositionMap()
 {
 sal_uLong nKey = it1-first;
 for (ColumnMap::const_iterator it2 = ++pCols-begin(); it2 != 
pCols-end(); ++it2 )
-(*it2-second)[ nKey ] =  NULL; // keine Daten
+it2-second-insert( RowMap::value_type( nKey, NULL )); // 
keine Daten
 }
 }
 }
commit d976045c9d0296d2418687e0049ee49f9ebeded5
Author: Ivan Timofeev timofeev@gmail.com
Date:   Tue Mar 27 22:34:48 2012 +0400

if/else branches contain same code

diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx
index cd3a4c9..bae4802 100644
--- a/sc/source/core/tool/chartpos.cxx
+++ b/sc/source/core/tool/chartpos.cxx
@@ -395,28 +395,15 @@ void ScChartPositioner::CreatePositionMap()
 for ( nCol = nCol1; nCol = nCol2; ++nCol, ++nInsCol )
 {
 RowMap* pCol = NULL;
-if ( bNoGlue || eGlue == SC_CHARTGLUE_ROWS )
-{   // meistens gleiche Cols
-ColumnMap::const_iterator it = pCols-find( nInsCol );
-if ( it == pCols-end() )
-{
-pCol = new RowMap;
-pCols-insert(it, ColumnMap::value_type( nInsCol, pCol 
) );
-}
-else
-pCol = it-second;
+

[Libreoffice-commits] .: 2 commits - editeng/source

2012-03-28 Thread Kohei Yoshida
 editeng/source/editeng/editdbg.cxx  |   12 ++--
 editeng/source/editeng/editdoc.hxx  |   14 +++---
 editeng/source/editeng/editdoc2.cxx |   11 +++
 editeng/source/editeng/editundo.cxx |   21 +++--
 editeng/source/editeng/impedit5.cxx |2 +-
 5 files changed, 32 insertions(+), 28 deletions(-)

New commits:
commit d192756c71519b1f013bbaa1a0594d46606a6336
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Mar 28 13:35:19 2012 -0400

No more CharAttribArray.

diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index fc9c562..a1b4575 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -496,19 +496,19 @@ sal_Bool ParaPortion::DbgCheckTextPortions()
 }
 #endif
 
-sal_Bool CheckOrderedList( CharAttribArray rAttribs, sal_Bool bStart )
+bool CheckOrderedList(const CharAttribList::AttribsType rAttribs, bool bStart)
 {
 sal_uInt16 nPrev = 0;
-for ( sal_uInt16 nAttr = 0; nAttr  rAttribs.Count(); nAttr++ )
+for (size_t nAttr = 0; nAttr  rAttribs.size(); ++nAttr)
 {
-EditCharAttrib* pAttr = rAttribs[nAttr];
-sal_uInt16 nCur = bStart ? pAttr-GetStart() : pAttr-GetEnd();
+const EditCharAttrib rAttr = rAttribs[nAttr];
+sal_uInt16 nCur = bStart ? rAttr.GetStart() : rAttr.GetEnd();
 if ( nCur  nPrev )
-return sal_False;
+return false;
 
 nPrev = nCur;
 }
-return sal_True;
+return true;
 }
 
 #endif
diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 2bd5151..1114990 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -117,9 +117,6 @@ struct WritingDirectionInfo
 
 typedef std::deque WritingDirectionInfo  WritingDirectionInfos;
 
-typedef EditCharAttrib* EditCharAttribPtr;
-SV_DECL_PTRARR( CharAttribArray, EditCharAttribPtr, 0 )
-
 class ContentAttribsInfo
 {
 private:
@@ -804,7 +801,7 @@ inline EditCharAttrib* 
GetAttrib(CharAttribList::AttribsType rAttribs, size_t n
 return (nAttr  rAttribs.size()) ? rAttribs[nAttr] : NULL;
 }
 
-sal_Bool CheckOrderedList( CharAttribArray rAttribs, sal_Bool bStart );
+bool CheckOrderedList(const CharAttribList::AttribsType rAttribs, bool 
bStart);
 
 // -
 // class EditEngineItemPool
commit 38e07aab9eb8c3c1d18038857b5dda28aace5bff
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Mar 28 13:31:27 2012 -0400

One less use of CharAttribArray.

diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 7ddaa39..2bd5151 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -123,16 +123,19 @@ SV_DECL_PTRARR( CharAttribArray, EditCharAttribPtr, 0 )
 class ContentAttribsInfo
 {
 private:
+typedef boost::ptr_vectorEditCharAttrib CharAttribsType;
+
 SfxItemSet  aPrevParaAttribs;
-CharAttribArray aPrevCharAttribs;
+CharAttribsType aPrevCharAttribs;
 
 public:
 ContentAttribsInfo( const SfxItemSet rParaAttribs );
 
 const SfxItemSet   GetPrevParaAttribs() const  { return 
aPrevParaAttribs; }
-const CharAttribArray  GetPrevCharAttribs() const  { return 
aPrevCharAttribs; }
+const CharAttribsType  GetPrevCharAttribs() const  { return 
aPrevCharAttribs; }
 
-CharAttribArrayGetPrevCharAttribs(){ return 
aPrevCharAttribs; }
+void RemoveAllCharAttribsFromPool(SfxItemPool rPool) const;
+void AppendCharAttrib(EditCharAttrib* pNew);
 };
 
 typedef ContentAttribsInfo* ContentAttribsInfoPtr;
diff --git a/editeng/source/editeng/editdoc2.cxx 
b/editeng/source/editeng/editdoc2.cxx
index 67c0d38..c13b656 100644
--- a/editeng/source/editeng/editdoc2.cxx
+++ b/editeng/source/editeng/editdoc2.cxx
@@ -395,6 +395,17 @@ ContentAttribsInfo::ContentAttribsInfo( const SfxItemSet 
rParaAttribs ) :
 {
 }
 
+void ContentAttribsInfo::RemoveAllCharAttribsFromPool(SfxItemPool rPool) const
+{
+CharAttribsType::const_iterator it = aPrevCharAttribs.begin(), itEnd = 
aPrevCharAttribs.end();
+for (; it != itEnd; ++it)
+rPool.Remove(*it-GetItem());
+}
+
+void ContentAttribsInfo::AppendCharAttrib(EditCharAttrib* pNew)
+{
+aPrevCharAttribs.push_back(pNew);
+}
 
 void ConvertItem( SfxPoolItem rPoolItem, MapUnit eSourceUnit, MapUnit 
eDestUnit )
 {
diff --git a/editeng/source/editeng/editundo.cxx 
b/editeng/source/editeng/editundo.cxx
index 1b96e14..e29043b 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -549,13 +549,7 @@ EditUndoSetAttribs::~EditUndoSetAttribs()
 {
 ContentAttribsInfo* pInf = aPrevAttribs[n];
 DBG_ASSERT( pInf, Undo_DTOR (SetAttribs): pInf = NULL! );
-for ( sal_uInt16 nAttr = 0; nAttr  
pInf-GetPrevCharAttribs().Count(); nAttr++ )
-{
-EditCharAttrib* pX = 

[Libreoffice-commits] .: editeng/source

2012-03-28 Thread Kohei Yoshida
 editeng/source/editeng/editdbg.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 736bf5c26f4f220171d95f52b933669c1ff6b172
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Mar 28 14:00:06 2012 -0400

Keep tinderbox happy.

diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index a1b4575..4070002 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -349,21 +349,21 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, 
sal_Bool bInfoBox )
 sal_uInt16 z;
 for ( z = 0; z  pPPortion-GetNode()-GetCharAttribs().Count(); z++ )
 {
-EditCharAttrib* pAttr = 
pPPortion-GetNode()-GetCharAttribs().GetAttribs().GetObject( z );
+const EditCharAttrib rAttr = 
pPPortion-GetNode()-GetCharAttribs().GetAttribs()[z];
 rtl::OStringBuffer aCharAttribs;
 aCharAttribs.append(RTL_CONSTASCII_STRINGPARAM(\nA));
 aCharAttribs.append(static_castsal_Int32(nPortion));
 aCharAttribs.append(RTL_CONSTASCII_STRINGPARAM(:  ));
-
aCharAttribs.append(static_castsal_Int32(pAttr-GetItem()-Which()));
+
aCharAttribs.append(static_castsal_Int32(rAttr.GetItem()-Which()));
 aCharAttribs.append('\t');
-aCharAttribs.append(static_castsal_Int32(pAttr-GetStart()));
+aCharAttribs.append(static_castsal_Int32(rAttr.GetStart()));
 aCharAttribs.append('\t');
-aCharAttribs.append(static_castsal_Int32(pAttr-GetEnd()));
-if ( pAttr-IsEmpty() )
+aCharAttribs.append(static_castsal_Int32(rAttr.GetEnd()));
+if ( rAttr.IsEmpty() )
 bZeroAttr = sal_True;
 fprintf(fp, %s = , aCharAttribs.getStr());
 
-rtl::OString aDebStr = DbgOutItem( rPool, *pAttr-GetItem() );
+rtl::OString aDebStr = DbgOutItem( rPool, *rAttr.GetItem() );
 fprintf( fp, %s, aDebStr.getStr() );
 }
 if ( bZeroAttr )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - offapi/com

2012-03-28 Thread Kohei Yoshida
 offapi/com/sun/star/sheet/XCellRangesQuery.idl |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 484b44b39bc2788160f475c3b40ce6b569fdc6cb
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Mar 28 14:12:31 2012 -0400

Changed some wording.

diff --git a/offapi/com/sun/star/sheet/XCellRangesQuery.idl 
b/offapi/com/sun/star/sheet/XCellRangesQuery.idl
index a44cc70..35bb831 100644
--- a/offapi/com/sun/star/sheet/XCellRangesQuery.idl
+++ b/offapi/com/sun/star/sheet/XCellRangesQuery.idl
@@ -78,10 +78,10 @@ published interface XCellRangesQuery: 
com::sun::star::uno::XInterface
 atomlong/atom values, this method expects a atomshort/atom
 parameter./p
 
-pAttention: Empty cells in the range are not analyzed.Some
-typeCellFlags/type may not be fully honored. For instance,
-when querying for STYLES, the returned ranges may not include empty
-cells with styles applied./p
+pAttention: Empty cells in the range may be skipped depending on
+the content flag used.  For instance, when querying for STYLES,
+the returned ranges may not include empty cells even if styles are
+applied to those cells./p
 
 @returns
 all cells of the current cell range(s) with the specified
commit 78278561130a3faab44472831bfccc074a0e8194
Author: Laurent Godard lgodard.li...@laposte.net
Date:   Wed Mar 28 17:00:53 2012 +0200

document queryContentCells limitation

add also a missing /p in previous paragraph

diff --git a/offapi/com/sun/star/sheet/XCellRangesQuery.idl 
b/offapi/com/sun/star/sheet/XCellRangesQuery.idl
index f35eec7..a44cc70 100644
--- a/offapi/com/sun/star/sheet/XCellRangesQuery.idl
+++ b/offapi/com/sun/star/sheet/XCellRangesQuery.idl
@@ -76,7 +76,12 @@ published interface XCellRangesQuery: 
com::sun::star::uno::XInterface
 
 pAttention: Despite the typeCellFlags/type flags are
 atomlong/atom values, this method expects a atomshort/atom
-parameter.
+parameter./p
+
+pAttention: Empty cells in the range are not analyzed.Some
+typeCellFlags/type may not be fully honored. For instance,
+when querying for STYLES, the returned ranges may not include empty
+cells with styles applied./p
 
 @returns
 all cells of the current cell range(s) with the specified
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/tubes2' - 2 commits - sc/source

2012-03-28 Thread Eike Rathke
 sc/source/ui/collab/sendfunc.cxx |   72 ++-
 1 file changed, 48 insertions(+), 24 deletions(-)

New commits:
commit eb452d90e6f8afdff69649881f8b7f2ff0f7b047
Author: Eike Rathke er...@redhat.com
Date:   Wed Mar 28 20:24:32 2012 +0200

tubes: shared_ptr for ScDocFunc chains and ScCollaboration

diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx
index c753eee..26f1ef5 100644
--- a/sc/source/ui/collab/sendfunc.cxx
+++ b/sc/source/ui/collab/sendfunc.cxx
@@ -256,20 +256,19 @@ public:
 
 class ScDocFuncRecv : public ScDocFunc
 {
-ScDocFunc *mpChain;
-ScCollaboration* mpCollab;
+boost::shared_ptrScDocFuncDirect  mpChain;
+boost::shared_ptrScCollaboration  mpCollab;
 public:
 // FIXME: really ScDocFunc should be an abstract base
-ScDocFuncRecv( ScDocShell rDocSh, ScDocFunc *pChain )
+ScDocFuncRecv( ScDocShell rDocSh, boost::shared_ptrScDocFuncDirect 
pChain )
 : ScDocFunc( rDocSh ),
-  mpChain( pChain ),
-  mpCollab( NULL)
+  mpChain( pChain )
 {
 fprintf( stderr, Receiver created !\n );
 }
 virtual ~ScDocFuncRecv() {}
 
-void SetCollaboration( ScCollaboration* pCollab )
+void SetCollaboration( boost::shared_ptrScCollaboration pCollab )
 {
 mpCollab = pCollab;
 }
@@ -380,8 +379,8 @@ void ScDocFuncRecv::fileReceived( rtl::OUString *pStr )
 
 class ScDocFuncSend : public ScDocFunc
 {
-ScDocFuncRecv *mpChain;
-ScCollaboration* mpCollab;
+boost::shared_ptrScDocFuncRecvmpChain;
+boost::shared_ptrScCollaboration  mpCollab;
 
 void SendMessage( ScChangeOpWriter rOp )
 {
@@ -424,16 +423,15 @@ class ScDocFuncSend : public ScDocFunc
 public:
 // FIXME: really ScDocFunc should be an abstract base, so
 // we don't need the rDocSh hack/pointer
-ScDocFuncSend( ScDocShell rDocSh, ScDocFuncRecv *pChain )
+ScDocFuncSend( ScDocShell rDocSh, boost::shared_ptrScDocFuncRecv 
pChain )
 : ScDocFunc( rDocSh ),
-mpChain( pChain ),
-mpCollab( NULL)
+mpChain( pChain )
 {
 fprintf( stderr, Sender created !\n );
 }
 virtual ~ScDocFuncSend() {}
 
-void SetCollaboration( ScCollaboration* pCollab )
+void SetCollaboration( boost::shared_ptrScCollaboration pCollab )
 {
 mpCollab = pCollab;
 }
@@ -562,20 +560,28 @@ public:
 
 SC_DLLPRIVATE ScDocFunc *ScDocShell::CreateDocFunc()
 {
-// FIXME: the chains should be auto-ptrs, so should be collab
+// With ScDocFuncDirect shared_ptr it should even be possible during
+// runtime to replace a ScDocFuncDirect instance with a ScDocFuncSend
+// chained instance (holding the same ScDocFuncDirect instance) and vice
+// versa.
 bool bIsMaster = false;
 if (getenv (INTERCEPT))
-return new ScDocFuncSend( *this, new ScDocFuncRecv( *this, new 
ScDocFuncDirect( *this ) ) );
+{
+boost::shared_ptrScDocFuncDirect pDirect( new ScDocFuncDirect( *this 
) );
+boost::shared_ptrScDocFuncRecv pReceiver( new ScDocFuncRecv( *this, 
pDirect ) );
+return new ScDocFuncSend( *this, pReceiver );
+}
 else if (isCollabMode( bIsMaster ))
 {
-ScDocFuncRecv* pReceiver = new ScDocFuncRecv( *this, new 
ScDocFuncDirect( *this ) );
+boost::shared_ptrScDocFuncDirect pDirect( new ScDocFuncDirect( *this 
) );
+boost::shared_ptrScDocFuncRecv pReceiver( new ScDocFuncRecv( *this, 
pDirect ) );
 ScDocFuncSend* pSender = new ScDocFuncSend( *this, pReceiver );
-bool bOk = true;
-ScCollaboration* pCollab = new ScCollaboration();
+boost::shared_ptrScCollaboration pCollab( new ScCollaboration );
 pCollab-sigPacketReceived.connect(
-boost::bind( ScDocFuncRecv::packetReceived, pReceiver, _1, _2 ));
+boost::bind( ScDocFuncRecv::packetReceived, pReceiver, _1, _2 
));
 pCollab-sigFileReceived.connect(
-boost::bind( ScDocFuncRecv::fileReceived, pReceiver, _1));
+boost::bind( ScDocFuncRecv::fileReceived, pReceiver, _1));
+bool bOk = true;
 bOk = bOk  pCollab-initManager(!bIsMaster);
 if (bIsMaster)
 {
@@ -590,7 +596,7 @@ SC_DLLPRIVATE ScDocFunc *ScDocShell::CreateDocFunc()
 else
 {
 fprintf( stderr, Could not start collaboration.\n);
-delete pCollab;
+// pCollab shared_ptr will be destructed
 }
 return pSender;
 }
commit e41d2677b159f8179829b0cdcb290bc581c628ff
Author: Eike Rathke er...@redhat.com
Date:   Wed Mar 28 20:24:23 2012 +0200

tubes: TeleManager::get() takes an argument

initialize with same mode as collaboration

diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx
index 3dddabf..c753eee 100644
--- a/sc/source/ui/collab/sendfunc.cxx
+++ b/sc/source/ui/collab/sendfunc.cxx
@@ -68,6 +68,18 @@ ScBaseCell 

[Libreoffice-commits] .: Branch 'feature/tubes2' - sc/source

2012-03-28 Thread Eike Rathke
 sc/source/ui/collab/sendfunc.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 184b8f8919bced256bcb2315e7c843b3ba9d8027
Author: Eike Rathke er...@redhat.com
Date:   Wed Mar 28 20:27:32 2012 +0200

tubes: LINK is gone

diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx
index 26f1ef5..5055136 100644
--- a/sc/source/ui/collab/sendfunc.cxx
+++ b/sc/source/ui/collab/sendfunc.cxx
@@ -275,7 +275,6 @@ public:
 
 void packetReceived( TeleConference* pConference, const rtl::OString  );
 void fileReceived( rtl::OUString *rStr );
-DECL_LINK( ReceiveFileCallback, rtl::OUString * );
 
 void RecvMessage( const rtl::OString rString )
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - editeng/source

2012-03-28 Thread Kohei Yoshida
 editeng/source/editeng/editdoc.hxx  |   10 +++--
 editeng/source/editeng/editdoc2.cxx |6 +++--
 editeng/source/editeng/editeng.cxx  |2 -
 editeng/source/editeng/editundo.cxx |   40 +++-
 editeng/source/editeng/editundo.hxx |7 --
 editeng/source/editeng/impedit5.cxx |2 -
 6 files changed, 41 insertions(+), 26 deletions(-)

New commits:
commit 48cd6ac1ec7e92a9c9a21f5365db4f9ff5fde93c
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Mar 28 15:31:05 2012 -0400

Fix tinderbox error  some cleanup.

diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 7551eca..7f760f3 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -298,10 +298,11 @@ SV_DECL_PTRARR( DummyContentList, ContentNodePtr, 0 )
 
 class ContentList : public DummyContentList
 {
-  sal_uInt16 nLastCache;
+sal_uInt16 nLastCache;
+
 public:
-  ContentList() : DummyContentList( 0 ), nLastCache(0) {}
-  sal_uInt16 GetPos( const ContentNodePtr rPtr ) const;
+ContentList();
+sal_uInt16 GetPos(ContentNode* p) const;
 };
 
 // -
diff --git a/editeng/source/editeng/editdoc2.cxx 
b/editeng/source/editeng/editdoc2.cxx
index c13b656..68da6aa 100644
--- a/editeng/source/editeng/editdoc2.cxx
+++ b/editeng/source/editeng/editdoc2.cxx
@@ -337,10 +337,12 @@ sal_uInt16 ParaPortionList::GetPos( const ParaPortionPtr 
rPtr ) const
((ParaPortionList *)this)-nLastCache );
 }
 
-sal_uInt16 ContentList::GetPos( const ContentNodePtr rPtr ) const
+ContentList::ContentList() : DummyContentList( 0 ), nLastCache(0) {}
+
+sal_uInt16 ContentList::GetPos(ContentNode* p) const
 {
 return FastGetPos( reinterpret_castconst VoidPtr *( GetData() ),
-   Count(), static_castVoidPtr( rPtr ),
+   Count(), static_castVoidPtr(p),
((ContentList *)this)-nLastCache );
 }
 
diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 0954d51..9fcd0a2 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2113,7 +2113,7 @@ void EditEngine::RemoveFields( sal_Bool bKeepFieldText, 
TypeId aType )
 const SvxFieldData* pFldData = static_castconst 
SvxFieldItem*(rAttr.GetItem())-GetField();
 if ( pFldData  ( !aType || ( pFldData-IsA( aType ) ) ) )
 {
-DBG_ASSERT( rAttr-GetItem()-ISA( SvxFieldItem ), no 
field item... );
+DBG_ASSERT( dynamic_castconst 
SvxFieldItem*(rAttr.GetItem()), no field item... );
 EditSelection aSel( EditPaM(pNode, rAttr.GetStart()), 
EditPaM(pNode, rAttr.GetEnd()) );
 String aFieldText = static_castconst 
EditCharAttribField(rAttr).GetFieldValue();
 pImpEditEngine-ImpInsertText( aSel, aFieldText );
commit 17cc39f2b0ef13efdfb052fe6b815508879fb755
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Mar 28 14:54:42 2012 -0400

ContentInfoArray is gone.

diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 1114990..7551eca 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -135,9 +135,6 @@ public:
 void AppendCharAttrib(EditCharAttrib* pNew);
 };
 
-typedef ContentAttribsInfo* ContentAttribsInfoPtr;
-SV_DECL_PTRARR( ContentInfoArray, ContentAttribsInfoPtr, 1 )
-
 //  --
 //  class SvxColorList
 //  --
diff --git a/editeng/source/editeng/editundo.cxx 
b/editeng/source/editeng/editundo.cxx
index e29043b..b59b71a 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -540,18 +540,26 @@ EditUndoSetAttribs::EditUndoSetAttribs( ImpEditEngine* 
_pImpEE, const ESelection
 nSpecial = 0;
 }
 
+namespace {
+
+struct RemoveAttribsFromPool : std::unary_functionContentAttribsInfo, void
+{
+SfxItemPool mrPool;
+public:
+RemoveAttribsFromPool(SfxItemPool rPool) : mrPool(rPool) {}
+void operator() (ContentAttribsInfo rInfo)
+{
+rInfo.RemoveAllCharAttribsFromPool(mrPool);
+}
+};
+
+}
+
 EditUndoSetAttribs::~EditUndoSetAttribs()
 {
 // Get Items from Pool...
 SfxItemPool* pPool = aNewAttribs.GetPool();
-sal_uInt16 nContents = aPrevAttribs.Count();
-for ( sal_uInt16 n = 0; n  nContents; n++ )
-{
-ContentAttribsInfo* pInf = aPrevAttribs[n];
-DBG_ASSERT( pInf, Undo_DTOR (SetAttribs): pInf = NULL! );
-pInf-RemoveAllCharAttribsFromPool(*pPool);
-delete pInf;
-}
+std::for_each(aPrevAttribs.begin(), aPrevAttribs.end(), 
RemoveAttribsFromPool(*pPool));
 }
 
 void EditUndoSetAttribs::Undo()
@@ -561,20 +569,19 @@ void 

[Libreoffice-commits] .: 8 commits - sal/inc sal/Package_inc.mk sal/qa

2012-03-28 Thread Lubos Lunak
 sal/Package_inc.mk  |1 
 sal/inc/rtl/oustringostreaminserter.hxx |   13 
 sal/inc/rtl/strbuf.hxx  |   70 +++
 sal/inc/rtl/string.hxx  |   81 
 sal/inc/rtl/stringutils.hxx |  133 +++
 sal/inc/rtl/ustrbuf.hxx |   66 ++-
 sal/inc/rtl/ustring.hxx |  354 +++-
 sal/qa/rtl/strings/test_ostring_stringliterals.cxx  |   32 +
 sal/qa/rtl/strings/test_oustring_stringliterals.cxx |   43 +-
 9 files changed, 461 insertions(+), 332 deletions(-)

New commits:
commit ef87e804ec80451ff1517482c1b70e7dccb961ce
Author: Luboš Luňák l.lu...@suse.cz
Date:   Wed Mar 28 22:58:11 2012 +0200

string literal overloads for OStringBuffer

diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx
index 62250f3..54428d3 100644
--- a/sal/inc/rtl/strbuf.hxx
+++ b/sal/inc/rtl/strbuf.hxx
@@ -373,11 +373,31 @@ public:
 @param   str   the characters to be appended.
 @return  this string buffer.
  */
-OStringBuffer  append( const sal_Char * str )
+template typename T 
+typename internal::CharPtrDetector T, OStringBuffer ::Type append( 
const T str )
 {
 return append( str, rtl_str_getLength( str ) );
 }
 
+template typename T 
+typename internal::NonConstCharArrayDetector T, OStringBuffer ::Type 
append( T str )
+{
+return append( str, rtl_str_getLength( str ) );
+}
+
+/**
+ @overload
+ This function accepts an ASCII string literal as its argument.
+ @since LibreOffice 3.6
+*/
+template typename T 
+typename internal::ConstCharArrayDetector T, OStringBuffer ::Type 
append( T literal )
+{
+RTL_STRING_CONST_FUNCTION
+rtl_stringbuffer_insert( pData, nCapacity, getLength(), literal, 
internal::ConstCharArrayDetector T, void ::size - 1 );
+return *this;
+}
+
 /**
 Appends the string representation of the codechar/code array
 argument to this string buffer.
@@ -535,11 +555,31 @@ public:
 @param  str  a character array.
 @return this string buffer.
  */
-OStringBuffer  insert( sal_Int32 offset, const sal_Char * str )
+template typename T 
+typename internal::CharPtrDetector T, OStringBuffer ::Type insert( 
sal_Int32 offset, const T str )
 {
 return insert( offset, str, rtl_str_getLength( str ) );
 }
 
+template typename T 
+typename internal::NonConstCharArrayDetector T, OStringBuffer ::Type 
insert( sal_Int32 offset, T str )
+{
+return insert( offset, str, rtl_str_getLength( str ) );
+}
+
+/**
+ @overload
+ This function accepts an ASCII string literal as its argument.
+ @since LibreOffice 3.6
+*/
+template typename T 
+typename internal::ConstCharArrayDetector T, OStringBuffer ::Type 
insert( sal_Int32 offset, T literal )
+{
+RTL_STRING_CONST_FUNCTION
+rtl_stringbuffer_insert( pData, nCapacity, offset, literal, 
internal::ConstCharArrayDetector T, void ::size - 1 );
+return *this;
+}
+
 /**
 Inserts the string representation of the codechar/code array
 argument into this string buffer.
diff --git a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx 
b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
index 462385e..3f2ed84 100644
--- a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
@@ -40,6 +40,7 @@ bool rtl_string_unittest_non_const_literal_function;
 #include cppunit/extensions/HelperMacros.h
 #include rtl/string.h
 #include rtl/string.hxx
+#include rtl/strbuf.hxx
 
 namespace rtlunittest {
 
@@ -61,6 +62,7 @@ private:
 void checkCtors();
 void checkUsage();
 void checkNonConstUsage();
+void checkBuffer();
 
 void testcall( const char str[] );
 
@@ -68,6 +70,7 @@ CPPUNIT_TEST_SUITE(StringLiterals);
 CPPUNIT_TEST(checkCtors);
 CPPUNIT_TEST(checkUsage);
 CPPUNIT_TEST(checkNonConstUsage);
+CPPUNIT_TEST(checkBuffer);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -247,6 +250,34 @@ void test::ostring::StringLiterals::checkNonConstUsage()
 //CPPUNIT_ASSERT( foobarfoo.lastIndexOf( (const char*)foo_c ) == 6 );
 //CPPUNIT_ASSERT( foobarfoo.lastIndexOf( foo_c ) == 6 );
 // if this is not true, some of the calls above used const variants
+CPPUNIT_ASSERT( rtl_string_unittest_const_literal == false );
+CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == false );
+}
+
+void test::ostring::StringLiterals::checkBuffer()
+{
+rtl::OStringBuffer buf;
+rtl_string_unittest_const_literal_function = false;
+buf.append( foo );
+CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OString( foo ));
+rtl_string_unittest_const_literal_function = false;
+

[Libreoffice-commits] .: sw/source

2012-03-28 Thread Lubos Lunak
 sw/source/filter/ww8/docxexport.cxx   |   22 ++
 sw/source/filter/ww8/writerhelper.cxx |4 ++--
 sw/source/filter/ww8/ww8par3.cxx  |2 +-
 3 files changed, 9 insertions(+), 19 deletions(-)

New commits:
commit b9f7225bb7c9cb58f796296fac3e58f84a619303
Author: Luboš Luňák l.lu...@suse.cz
Date:   Wed Mar 28 23:23:42 2012 +0200

remove RTL_CONSTASCII_(U)STRINGPARAM usage

diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index ceec8e2..ab41592 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -304,21 +304,13 @@ void DocxExport::DoFormText(const SwInputField* /*pFld*/)
 
 rtl::OString DocxExport::OutputChart( uno::Reference frame::XModel  xModel, 
sal_Int32 nCount )
 {
-rtl::OUString aFileName = rtl::OUStringBuffer()
-
.appendAscii(RTL_CONSTASCII_STRINGPARAM(charts/chart))
-.append(nCount)
-
.appendAscii(RTL_CONSTASCII_STRINGPARAM(.xml))
-.makeStringAndClear();
+rtl::OUString aFileName = 
rtl::OUStringBuffer().append(charts/chart).append(nCount).append(.xml).makeStringAndClear();
 
 OUString sId = m_pFilter-addRelation( m_pDocumentFS-getOutputStream(),
 
http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart;,
 aFileName );
 
-aFileName = rtl::OUStringBuffer()
-  .appendAscii(RTL_CONSTASCII_STRINGPARAM(word/charts/chart))
-  .append(nCount)
-  .appendAscii(RTL_CONSTASCII_STRINGPARAM(.xml))
-  .makeStringAndClear();
+aFileName = 
rtl::OUStringBuffer().append(word/charts/chart).append(nCount).append(.xml).makeStringAndClear();
 
 ::sax_fastparser::FSHelperPtr pChartFS =
 m_pFilter-openFragmentStreamWithSerializer( aFileName,
@@ -575,28 +567,26 @@ void DocxExport::WriteHeaderFooter( const SwFmt rFmt, 
bool bHeader, const char*
 ::sax_fastparser::FSHelperPtr pFS;
 if ( bHeader )
 {
-OUString aName( 
OUStringBuffer().appendAscii(RTL_CONSTASCII_STRINGPARAM(header))
-.append( ++m_nHeaders 
).appendAscii(RTL_CONSTASCII_STRINGPARAM(.xml))
-.makeStringAndClear() );
+OUString aName( OUStringBuffer().append(header).append( ++m_nHeaders 
).append(.xml).makeStringAndClear() );
 
 aRelId = m_pFilter-addRelation( m_pDocumentFS-getOutputStream(),
 
http://schemas.openxmlformats.org/officeDocument/2006/relationships/header;,
 aName );
 
-pFS = m_pFilter-openFragmentStreamWithSerializer( 
OUStringBuffer().appendAscii(RTL_CONSTASCII_STRINGPARAM(word/)).append( aName 
).makeStringAndClear(),
+pFS = m_pFilter-openFragmentStreamWithSerializer( 
OUStringBuffer().append(word/).append( aName ).makeStringAndClear(),
 
application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml );
 
 pFS-startElementNS( XML_w, XML_hdr, MainXmlNamespaces( pFS ));
 }
 else
 {
-OUString aName( 
OUStringBuffer().appendAscii(RTL_CONSTASCII_STRINGPARAM(footer)).append( 
++m_nFooters 
).appendAscii(RTL_CONSTASCII_STRINGPARAM(.xml)).makeStringAndClear() );
+OUString aName( OUStringBuffer().append(footer).append( ++m_nFooters 
).append(.xml).makeStringAndClear() );
 
 aRelId = m_pFilter-addRelation( m_pDocumentFS-getOutputStream(),
 
http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer;,
 aName );
 
-pFS = m_pFilter-openFragmentStreamWithSerializer( 
OUStringBuffer().appendAscii(RTL_CONSTASCII_STRINGPARAM(word/)).append( aName 
).makeStringAndClear(),
+pFS = m_pFilter-openFragmentStreamWithSerializer( 
OUStringBuffer().append(word/).append( aName ).makeStringAndClear(),
 
application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml );
 
 pFS-startElementNS( XML_w, XML_ftr, MainXmlNamespaces( pFS ));
diff --git a/sw/source/filter/ww8/writerhelper.cxx 
b/sw/source/filter/ww8/writerhelper.cxx
index e96dfaa..a997ee8 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -633,8 +633,8 @@ namespace sw
 bool IsStarSymbol(const rtl::OUString rFontName)
 {
 rtl::OUString sFamilyNm(GetFontToken(rFontName, 0));
-return 
(sFamilyNm.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM(starsymbol))
 ||
-
sFamilyNm.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM(opensymbol)));
+return (sFamilyNm.equalsIgnoreAsciiCase(starsymbol) ||
+sFamilyNm.equalsIgnoreAsciiCase(opensymbol));
 }
 
 Size GetSwappedInSize(const SwNoTxtNode rNd)
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index e74829b..f50f321 100644
--- 

[Libreoffice-commits] .: sal/inc sal/qa

2012-03-28 Thread Lubos Lunak
 sal/inc/rtl/strbuf.hxx |   14 ++
 sal/qa/rtl/strings/test_ostring_stringliterals.cxx |4 
 2 files changed, 18 insertions(+)

New commits:
commit c9167bac18e1cca061d91f65d2dc91b9d09ef587
Author: Luboš Luňák l.lu...@suse.cz
Date:   Wed Mar 28 23:38:58 2012 +0200

gcc-4.0.1 SFINAE workarounds

diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx
index 54428d3..122eb4b 100644
--- a/sal/inc/rtl/strbuf.hxx
+++ b/sal/inc/rtl/strbuf.hxx
@@ -373,6 +373,12 @@ public:
 @param   str   the characters to be appended.
 @return  this string buffer.
  */
+#ifdef HAVE_SFINAE_ANONYMOUS_BROKEN
+OStringBuffer  append( const sal_Char * str )
+{
+return append( str, rtl_str_getLength( str ) );
+}
+#else
 template typename T 
 typename internal::CharPtrDetector T, OStringBuffer ::Type append( 
const T str )
 {
@@ -397,6 +403,7 @@ public:
 rtl_stringbuffer_insert( pData, nCapacity, getLength(), literal, 
internal::ConstCharArrayDetector T, void ::size - 1 );
 return *this;
 }
+#endif
 
 /**
 Appends the string representation of the codechar/code array
@@ -555,6 +562,12 @@ public:
 @param  str  a character array.
 @return this string buffer.
  */
+#ifdef HAVE_SFINAE_ANONYMOUS_BROKEN
+OStringBuffer  insert( sal_Int32 offset, const sal_Char * str )
+{
+return insert( offset, str, rtl_str_getLength( str ) );
+}
+#else
 template typename T 
 typename internal::CharPtrDetector T, OStringBuffer ::Type insert( 
sal_Int32 offset, const T str )
 {
@@ -579,6 +592,7 @@ public:
 rtl_stringbuffer_insert( pData, nCapacity, offset, literal, 
internal::ConstCharArrayDetector T, void ::size - 1 );
 return *this;
 }
+#endif
 
 /**
 Inserts the string representation of the codechar/code array
diff --git a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx 
b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
index 3f2ed84..494c1da 100644
--- a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
@@ -257,6 +257,7 @@ void test::ostring::StringLiterals::checkNonConstUsage()
 void test::ostring::StringLiterals::checkBuffer()
 {
 rtl::OStringBuffer buf;
+#ifndef HAVE_SFINAE_ANONYMOUS_BROKEN
 rtl_string_unittest_const_literal_function = false;
 buf.append( foo );
 CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
@@ -269,6 +270,9 @@ void test::ostring::StringLiterals::checkBuffer()
 buf.insert( 3, baz );
 CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
 CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OString( foobazbar ));
+#else
+buf.append( foobazbar );
+#endif
 
 rtl::OString foobazbard( foobazbard );
 rtl::OString foodbazbard( foodbazbard );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/qa

2012-03-28 Thread Lubos Lunak
 sal/qa/rtl/strings/test_ostring_stringliterals.cxx  |   10 +-
 sal/qa/rtl/strings/test_oustring_stringliterals.cxx |   14 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit bb070c05b6e2d09b15fed673507a523c11eb2a19
Author: Luboš Luňák l.lu...@suse.cz
Date:   Wed Mar 28 23:48:17 2012 +0200

CPPUNIT_ASSERT_EQUAL() takes expected as the first argument

diff --git a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx 
b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
index 494c1da..0d5036a 100644
--- a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
@@ -261,15 +261,15 @@ void test::ostring::StringLiterals::checkBuffer()
 rtl_string_unittest_const_literal_function = false;
 buf.append( foo );
 CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
-CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OString( foo ));
+CPPUNIT_ASSERT_EQUAL( rtl::OString( foo ), buf.toString());
 rtl_string_unittest_const_literal_function = false;
 buf.append( bar );
 CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
-CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OString( foobar ));
+CPPUNIT_ASSERT_EQUAL( rtl::OString( foobar ), buf.toString());
 rtl_string_unittest_const_literal_function = false;
 buf.insert( 3, baz );
 CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
-CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OString( foobazbar ));
+CPPUNIT_ASSERT_EQUAL( rtl::OString( foobazbar ), buf.toString());
 #else
 buf.append( foobazbar );
 #endif
@@ -279,8 +279,8 @@ void test::ostring::StringLiterals::checkBuffer()
 rtl_string_unittest_const_literal = false; // start checking for OString 
conversions
 rtl_string_unittest_const_literal_function = false; // and check for const 
variants
 char d[] = d;
-CPPUNIT_ASSERT_EQUAL( buf.append( d ).toString(), foobazbard );
-CPPUNIT_ASSERT_EQUAL( buf.insert( 3, d ).toString(), foodbazbard );
+CPPUNIT_ASSERT_EQUAL( foobazbard, buf.append( d ).toString());
+CPPUNIT_ASSERT_EQUAL( foodbazbard, buf.insert( 3, d ).toString() );
 CPPUNIT_ASSERT( rtl_string_unittest_const_literal == false );
 CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == false );
 }
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx 
b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
index 2070698..6316478 100644
--- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
@@ -99,10 +99,10 @@ void test::oustring::StringLiterals::checkCtors()
 
 // Check that contents are correct and equal to the case when 
RTL_CONSTASCII_USTRINGPARAM is used.
 // Also check that embedded \0 is included.
-CPPUNIT_ASSERT_EQUAL( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(  )), 
rtl::OUString(  ));
-CPPUNIT_ASSERT_EQUAL( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( \0 )), 
rtl::OUString( \0 ));
-CPPUNIT_ASSERT_EQUAL( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ab )), 
rtl::OUString( ab ));
-CPPUNIT_ASSERT_EQUAL( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( a\0b 
)), rtl::OUString( a\0b ));
+CPPUNIT_ASSERT_EQUAL( rtl::OUString(  ), rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM(  )));
+CPPUNIT_ASSERT_EQUAL( rtl::OUString( \0 ), rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( \0 )));
+CPPUNIT_ASSERT_EQUAL( rtl::OUString( ab ), rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( ab )));
+CPPUNIT_ASSERT_EQUAL( rtl::OUString( a\0b ), rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( a\0b )));
 }
 
 void test::oustring::StringLiterals::testcall( const char str[] )
@@ -175,11 +175,11 @@ void test::oustring::StringLiterals::checkBuffer()
 {
 rtl::OUStringBuffer buf;
 buf.append( foo );
-CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OUString( foo ));
+CPPUNIT_ASSERT_EQUAL( rtl::OUString( foo ), buf.toString());
 buf.append( bar );
-CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OUString( foobar ));
+CPPUNIT_ASSERT_EQUAL( rtl::OUString( foobar ), buf.toString());
 buf.insert( 3, baz );
-CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OUString( foobazbar ));
+CPPUNIT_ASSERT_EQUAL( rtl::OUString( foobazbar ), buf.toString());
 char d[] = d;
 CPPUNIT_ASSERT( !VALID_CONVERSION( buf.append( d )));
 CPPUNIT_ASSERT( !VALID_CONVERSION( buf.insert( 0, d )));
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-03-28 Thread Lubos Lunak
 sal/inc/rtl/stringutils.hxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 552ba413bc95b1a14638558d9436141825100c52
Author: Luboš Luňák l.lu...@suse.cz
Date:   Thu Mar 29 00:47:41 2012 +0200

fix SFINAE detection of const char[N] for msvc

diff --git a/sal/inc/rtl/stringutils.hxx b/sal/inc/rtl/stringutils.hxx
index 55326ce..3bf72c5 100644
--- a/sal/inc/rtl/stringutils.hxx
+++ b/sal/inc/rtl/stringutils.hxx
@@ -114,6 +114,8 @@ struct ExceptConstCharArrayDetector const char[ N ] 
 };
 // this one is used to rule out only const char[N]
 // (const will be brought in by 'const T' in the function call)
+// msvc needs const char[N] here (not sure whether gcc or msvc
+// are right, it doesn't matter).
 template typename T 
 struct ExceptCharArrayDetector
 {
@@ -123,6 +125,10 @@ template int N 
 struct ExceptCharArrayDetector char[ N ] 
 {
 };
+template int N 
+struct ExceptCharArrayDetector const char[ N ] 
+{
+};
 
 } /* Namespace */
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'feature/tubes2' - 2 commits - sc/CppunitTest_sc_ucalc.mk scp2/source

2012-03-28 Thread Eike Rathke
 sc/CppunitTest_sc_ucalc.mk   |8 +++-
 scp2/source/ooo/file_library_ooo.scp |4 
 scp2/source/ooo/makefile.mk  |4 
 3 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit e3a0e3d5e662d6b4b92f2157daf84da83f3a2685
Author: Eike Rathke er...@redhat.com
Date:   Thu Mar 29 01:02:25 2012 +0200

tubes: link libraries to unit test

diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index cf81696..b4a9a89 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -46,9 +46,15 @@ $(call gb_CxxObject_get_target,sc/qa/unit/ucalc): \
 
 
 ifeq ($(ENABLE_TELEPATHY),TRUE)
-$(eval $(call gb_Library_add_linked_libs,sc_ucalc,\
+
+$(eval $(call gb_CppunitTest_add_linked_libs,sc_ucalc,\
tubes \
 ))
+
+$(eval $(call gb_CppunitTest_add_libs,sc_ucalc,\
+$$(TELEPATHY_LIBS) \
+))
+
 endif
 
 $(eval $(call gb_CppunitTest_add_linked_libs,sc_ucalc, \
commit f188eaaa96660a539b6b9b19bc999f1bccb14df7
Author: Eike Rathke er...@redhat.com
Date:   Wed Mar 28 20:56:27 2012 +0200

tubes: include libtubes in instset

diff --git a/scp2/source/ooo/file_library_ooo.scp 
b/scp2/source/ooo/file_library_ooo.scp
index 1b464cf..ceecfc3 100644
--- a/scp2/source/ooo/file_library_ooo.scp
+++ b/scp2/source/ooo/file_library_ooo.scp
@@ -1809,3 +1809,7 @@ End
 #ifdef ENABLE_LOMENUBAR
 SPECIAL_COMPONENT_LIB_FILE( gid_File_Lib_Lomenubar, lomenubar.uno )
 #endif
+
+#ifdef ENABLE_TELEPATHY
+STD_LIB_FILE( gid_File_Lib_Tubes , tubes)
+#endif
diff --git a/scp2/source/ooo/makefile.mk b/scp2/source/ooo/makefile.mk
index 0987f6f..3bc4e1b 100644
--- a/scp2/source/ooo/makefile.mk
+++ b/scp2/source/ooo/makefile.mk
@@ -302,6 +302,10 @@ SCPDEFS+=-DENABLE_LOMENUBAR
 SCPDEFS+=-DHAVE_WINDOWS_SDK
 .ENDIF
 
+.IF $(ENABLE_TELEPATHY) == TRUE
+SCPDEFS+=-DENABLE_TELEPATHY
+.ENDIF
+
 SCP_PRODUCT_TYPE=osl
 
 ICUVERSION_DEPENDENT_FILES= \
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: connectivity/inc connectivity/source connectivity/workben

2012-03-28 Thread Takeshi Abe
 connectivity/inc/connectivity/sdbcx/VIndex.hxx |1 -
 connectivity/inc/connectivity/sqlparse.hxx |1 -
 connectivity/source/commontools/ConnectionWrapper.cxx  |2 --
 connectivity/source/commontools/TColumnsHelper.cxx |1 -
 connectivity/source/cpool/ZConnectionPool.cxx  |1 -
 connectivity/source/drivers/dbase/DIndex.cxx   |1 -
 connectivity/source/drivers/evoab2/NStatement.hxx  |1 -
 connectivity/source/drivers/file/fcode.cxx |1 -
 connectivity/source/drivers/file/fcomp.cxx |1 -
 connectivity/source/drivers/jdbc/JConnection.cxx   |1 -
 connectivity/source/drivers/jdbc/ResultSet.cxx |1 -
 connectivity/source/drivers/mozab/MColumns.cxx |1 -
 connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx|1 -
 connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.cxx |1 -
 connectivity/source/parse/sqlnode.cxx  |3 ---
 connectivity/source/sdbcx/VCatalog.cxx |1 -
 connectivity/workben/testmoz/main.cxx  |1 -
 connectivity/workben/testmoz/mozthread.cxx |1 -
 18 files changed, 21 deletions(-)

New commits:
commit 86647a187371f03a05a329f24366b0ac2e6c7fbf
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Wed Mar 28 23:39:31 2012 +0900

removed duplicate includes in connectivity

diff --git a/connectivity/inc/connectivity/sdbcx/VIndex.hxx 
b/connectivity/inc/connectivity/sdbcx/VIndex.hxx
index 4058e91..c62d815 100644
--- a/connectivity/inc/connectivity/sdbcx/VIndex.hxx
+++ b/connectivity/inc/connectivity/sdbcx/VIndex.hxx
@@ -41,7 +41,6 @@
 #include connectivity/sdbcx/VDescriptor.hxx
 #include connectivity/dbtoolsdllapi.hxx
 #include com/sun/star/lang/XServiceInfo.hpp
-#include com/sun/star/sdbcx/XDataDescriptorFactory.hpp
 #include cppuhelper/implbase1.hxx
 
 namespace connectivity
diff --git a/connectivity/inc/connectivity/sqlparse.hxx 
b/connectivity/inc/connectivity/sqlparse.hxx
index 6b3f975..88c0637 100644
--- a/connectivity/inc/connectivity/sqlparse.hxx
+++ b/connectivity/inc/connectivity/sqlparse.hxx
@@ -48,7 +48,6 @@
 #include connectivity/dbtoolsdllapi.hxx
 #include connectivity/sqlerror.hxx
 #include salhelper/singletonref.hxx
-#include osl/mutex.hxx
 
 #include map
 
diff --git a/connectivity/source/commontools/ConnectionWrapper.cxx 
b/connectivity/source/commontools/ConnectionWrapper.cxx
index d9a61f6..f668433 100644
--- a/connectivity/source/commontools/ConnectionWrapper.cxx
+++ b/connectivity/source/commontools/ConnectionWrapper.cxx
@@ -37,8 +37,6 @@
 #include rtl/digest.h
 #include algorithm
 
-#include algorithm
-
 using namespace connectivity;
 
//--
 using namespace com::sun::star::uno;
diff --git a/connectivity/source/commontools/TColumnsHelper.cxx 
b/connectivity/source/commontools/TColumnsHelper.cxx
index 2e05aa7..d051a2d 100644
--- a/connectivity/source/commontools/TColumnsHelper.cxx
+++ b/connectivity/source/commontools/TColumnsHelper.cxx
@@ -28,7 +28,6 @@
 
 #include connectivity/TColumnsHelper.hxx
 #include connectivity/sdbcx/VColumn.hxx
-#include connectivity/sdbcx/VColumn.hxx
 #include com/sun/star/sdbc/XRow.hpp
 #include com/sun/star/sdbc/XResultSet.hpp
 #include com/sun/star/sdbc/DataType.hpp
diff --git a/connectivity/source/cpool/ZConnectionPool.cxx 
b/connectivity/source/cpool/ZConnectionPool.cxx
index bfdfafc..0297c3a 100644
--- a/connectivity/source/cpool/ZConnectionPool.cxx
+++ b/connectivity/source/cpool/ZConnectionPool.cxx
@@ -38,7 +38,6 @@
 #include ZPoolCollection.hxx
 #include connectivity/ConnectionWrapper.hxx
 #include com/sun/star/beans/XPropertySet.hpp
-#include connectivity/ConnectionWrapper.hxx
 
 
 using namespace ::com::sun::star::uno;
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx 
b/connectivity/source/drivers/dbase/DIndex.cxx
index f64a630..458afcc 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -46,7 +46,6 @@
 #include connectivity/dbexception.hxx
 #include dbase/DResultSet.hxx
 #include diagnose_ex.h
-#include comphelper/types.hxx
 #include resource/dbase_res.hrc
 #include unotools/sharedunocomponent.hxx
 
diff --git a/connectivity/source/drivers/evoab2/NStatement.hxx 
b/connectivity/source/drivers/evoab2/NStatement.hxx
index 2550003..e292a8f 100644
--- a/connectivity/source/drivers/evoab2/NStatement.hxx
+++ b/connectivity/source/drivers/evoab2/NStatement.hxx
@@ -47,7 +47,6 @@
 #include com/sun/star/util/XCancellable.hpp
 #include cppuhelper/compbase5.hxx
 #include comphelper/propertycontainer.hxx
-#include com/sun/star/lang/XServiceInfo.hpp
 
 #include EApi.h
 
diff --git a/connectivity/source/drivers/file/fcode.cxx 
b/connectivity/source/drivers/file/fcode.cxx
index 

[Libreoffice-commits] .: 3 commits - editeng/source

2012-03-28 Thread Kohei Yoshida
 editeng/source/editeng/editdoc.hxx  |   39 +++-
 editeng/source/editeng/editdoc2.cxx |  113 
 editeng/source/editeng/editeng.cxx  |   16 ++---
 editeng/source/editeng/editundo.cxx |1 
 editeng/source/editeng/editview.cxx |2 
 editeng/source/editeng/impedit.cxx  |5 -
 editeng/source/editeng/impedit.hxx  |   22 ---
 editeng/source/editeng/impedit2.cxx |  105 +++--
 editeng/source/editeng/impedit3.cxx |   36 +--
 editeng/source/editeng/impedit4.cxx |4 -
 editeng/source/editeng/impedit5.cxx |4 -
 11 files changed, 215 insertions(+), 132 deletions(-)

New commits:
commit 175dc9fcc6252177e03486952e867c7bd1f8e9de
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Mar 28 22:49:34 2012 -0400

pRightPortion no longer used.

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index d7d1fa2..661d2c1 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -2275,10 +2275,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( 
ContentNode* pLeft, ContentNode* pR
 
 // First search for Portions since pRight is gone after ConnectParagraphs.
 ParaPortion* pLeftPortion = FindParaPortion( pLeft );
-ParaPortion* pRightPortion = FindParaPortion( pRight );
 OSL_ENSURE( pLeftPortion, Blind Portion in ImpConnectParagraphs(1) );
-OSL_ENSURE( pRightPortion, Blind Portion in ImpConnectParagraphs(2) );
-OSL_ENSURE( nParagraphTobeDeleted == GetParaPortions().GetPos( 
pRightPortion ), NodePos != PortionPos? );
 
 if ( GetStatus().DoOnlineSpelling() )
 {
commit 87d554e97332f418d570d69391c3f2bf95e8cbab
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Mar 28 22:34:57 2012 -0400

ParaPortionList no longer a child class of DummyParaPortionList.

BTW, whoever originally wrote this code obviously didn't like using
const keywords.

diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 9474ee9..2a78af7 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -438,7 +438,7 @@ public:
 ~TextPortionList();
 
 voidReset();
-sal_uInt16  FindPortion( sal_uInt16 nCharPos, sal_uInt16 rPortionStart, 
sal_Bool bPreferStartingPortion = sal_False );
+sal_uInt16  FindPortion( sal_uInt16 nCharPos, sal_uInt16 rPortionStart, 
sal_Bool bPreferStartingPortion = sal_False ) const;
 sal_uInt16  GetStartPos( sal_uInt16 nPortion );
 voidDeleteFromPortion( sal_uInt16 nDelFrom );
 };
@@ -584,9 +584,10 @@ public:
 ParaPortion( ContentNode* pNode );
 ~ParaPortion();
 
-sal_uInt16  GetLineNumber( sal_uInt16 nIndex );
+sal_uInt16 GetLineNumber( sal_uInt16 nIndex ) const;
 
 EditLineList   GetLines()  { return aLineList; }
+const EditLineList GetLines() const { return aLineList; }
 
 sal_BoolIsInvalid() const   { return bInvalid; }
 sal_BoolIsSimpleInvalid()   const   { return bSimple; }
@@ -602,7 +603,7 @@ public:
 voidMarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 
nEnd );
 
 voidSetVisible( sal_Bool bVisible );
-sal_BoolIsVisible() { return bVisible; }
+boolIsVisible() const { return bVisible; }
 
 sal_BoolIsEmpty() { return GetTextPortions().Count() == 1  
GetTextPortions()[0]-GetLen() == 0; }
 
@@ -612,6 +613,7 @@ public:
 
 ContentNode*GetNode() const { return pNode; }
 TextPortionListGetTextPortions()   { return aTextPortionList; 
}
+const TextPortionList GetTextPortions() const { return aTextPortionList; }
 
 sal_uInt16  GetInvalidPosStart() const  { return 
nInvalidPosStart; }
 short   GetInvalidDiff() const  { return nInvalidDiff; }
@@ -622,27 +624,37 @@ public:
 #endif
 };
 
-typedef ParaPortion* ParaPortionPtr;
-SV_DECL_PTRARR( DummyParaPortionList, ParaPortionPtr, 0 )
-
 // -
 // class ParaPortionList
 // -
-class ParaPortionList : public DummyParaPortionList
+class ParaPortionList
 {
-mutable sal_uInt16 nLastCache;
+mutable size_t nLastCache;
+boost::ptr_vectorParaPortion maPortions;
 public:
 ParaPortionList();
 ~ParaPortionList();
 
 voidReset();
-longGetYOffset( ParaPortion* pPPortion );
+long GetYOffset(const ParaPortion* pPPortion) const;
 sal_uInt16  FindParagraph( long nYOffset );
 
-inline ParaPortion* SaveGetObject( sal_uInt16 nPos ) const
-{ return ( nPos  Count() ) ? GetObject( nPos ) : 0; }
+inline const 

[Libreoffice-commits] .: sal/inc

2012-03-28 Thread Lubos Lunak
 sal/inc/rtl/stringutils.hxx |   13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit dbf238ba0a76c64643a28fc3fd9d0d3ede848dd7
Author: Luboš Luňák l.lu...@suse.cz
Date:   Thu Mar 29 07:39:03 2012 +0200

(const) char[] is a plain C string type too

and it's size is not known, so it cannot be taken as a string literal

diff --git a/sal/inc/rtl/stringutils.hxx b/sal/inc/rtl/stringutils.hxx
index 3bf72c5..19c1bf4 100644
--- a/sal/inc/rtl/stringutils.hxx
+++ b/sal/inc/rtl/stringutils.hxx
@@ -50,7 +50,8 @@ namespace internal
 {
 /*
 These templates use SFINAE (Substitution failure is not an error) to help 
distinguish the various
-plain C string types: char*, const char*, char[N] and const char[N]. There are 
2 cases:
+plain C string types: char*, const char*, char[N], const char[N], char[] and 
const char[].
+There are 2 cases:
 1) Only string literal (i.e. const char[N]) is wanted, not any of the others.
 In this case it is necessary to distinguish between const char[N] and 
char[N], as the latter
 would be automatically converted to the const variant, which is not wanted 
(not a string literal
@@ -90,6 +91,16 @@ struct NonConstCharArrayDetector char[ N ], T 
 {
 typedef T Type;
 };
+template typename T 
+struct NonConstCharArrayDetector char[], T 
+{
+typedef T Type;
+};
+template typename T 
+struct NonConstCharArrayDetector const char[], T 
+{
+typedef T Type;
+};
 
 template typename T1, typename T2 
 struct ConstCharArrayDetector
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - editeng/inc editeng/source

2012-03-28 Thread Kohei Yoshida
 editeng/inc/editeng/editeng.hxx |3 
 editeng/inc/editeng/editview.hxx|2 
 editeng/inc/editeng/outliner.hxx|2 
 editeng/source/editeng/editdbg.cxx  |2 
 editeng/source/editeng/editdoc.cxx  |  112 +++-
 editeng/source/editeng/editdoc.hxx  |   72 ++-
 editeng/source/editeng/editdoc2.cxx |   92 ++---
 editeng/source/editeng/editeng.cxx  |8 ++
 editeng/source/editeng/editview.cxx |6 -
 editeng/source/editeng/impedit.cxx  |4 -
 editeng/source/editeng/impedit.hxx  |   31 +
 editeng/source/editeng/impedit2.cxx |   39 ++--
 editeng/source/editeng/impedit3.cxx |2 
 editeng/source/editeng/impedit4.cxx |8 +-
 editeng/source/editeng/impedit5.cxx |   22 ---
 editeng/source/outliner/outlvw.cxx  |2 
 16 files changed, 261 insertions(+), 146 deletions(-)

New commits:
commit ea8f2cbee079932e7f5d9ab646996b472a120c76
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Thu Mar 29 01:43:30 2012 -0400

ContentList no longer a child class of DummyContentList.

diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index 4c0d5e0..c17b15b 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -328,7 +328,8 @@ public:
 SfxStyleSheetPool*  GetStyleSheetPool();
 
 voidSetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle 
);
-SfxStyleSheet*  GetStyleSheet( sal_uInt16 nPara ) const;
+const SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara ) const;
+SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara );
 
 voidSetWordDelimiters( const String rDelimiters );
 String  GetWordDelimiters() const;
diff --git a/editeng/inc/editeng/editview.hxx b/editeng/inc/editeng/editview.hxx
index 7f3dd4c..aa9864f 100644
--- a/editeng/inc/editeng/editview.hxx
+++ b/editeng/inc/editeng/editview.hxx
@@ -183,7 +183,7 @@ public:
 voidSetEditEngineUpdateMode( sal_Bool bUpdate );
 voidForceUpdate();
 
-SfxStyleSheet*  GetStyleSheet() const;
+const SfxStyleSheet* GetStyleSheet() const;
 
 voidSetAnchorMode( EVAnchorMode eMode );
 EVAnchorModeGetAnchorMode() const;
diff --git a/editeng/inc/editeng/outliner.hxx b/editeng/inc/editeng/outliner.hxx
index faceb8a..ee7edec 100644
--- a/editeng/inc/editeng/outliner.hxx
+++ b/editeng/inc/editeng/outliner.hxx
@@ -308,7 +308,7 @@ public:
 voidPaste();
 voidPasteSpecial();
 
-SfxStyleSheet*  GetStyleSheet() const;
+const SfxStyleSheet*  GetStyleSheet() const;
 
 voidSetControlWord( sal_uLong nWord );
 sal_uLong   GetControlWord() const;
diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index 4070002..48f6e00 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -335,7 +335,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool 
bInfoBox )
 for ( sal_uInt16 nPortion = 0; nPortion  
pEE-pImpEditEngine-GetParaPortions(). Count(); nPortion++)
 {
 
-ParaPortion* pPPortion = 
pEE-pImpEditEngine-GetParaPortions().GetObject(nPortion );
+ParaPortion* pPPortion = 
pEE-pImpEditEngine-GetParaPortions()[nPortion];
 fprintf( fp, \nParagraph %i: Length = %i, Invalid = %i\nText = '%s', 
nPortion, pPPortion-GetNode()-Len(), pPPortion-IsInvalid(), 
rtl::OUStringToOString( *pPPortion-GetNode(), RTL_TEXTENCODING_ASCII_US 
).getStr() );
 fprintf( fp, \nVorlage: );
 SfxStyleSheet* pStyle = pPPortion-GetNode()-GetStyleSheet();
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index f83d054..5df6635 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -256,8 +256,6 @@ sal_uInt16 aV5Map[] = {
 4035, 4036, 4037, 4038
 };
 
-SV_IMPL_PTRARR( DummyContentList, ContentNode* );
-
 EditCharAttrib* MakeCharAttrib( SfxItemPool rPool, const SfxPoolItem rAttr, 
sal_uInt16 nS, sal_uInt16 nE )
 {
 // Create a new attribute in the pool
@@ -567,6 +565,25 @@ sal_uInt16 EditLineList::FindLine( sal_uInt16 nChar, 
sal_Bool bInclEnd )
 return ( Count() - 1 );
 }
 
+EditPaM::EditPaM() : pNode(NULL), nIndex(0) {}
+EditPaM::EditPaM(const EditPaM r) : pNode(r.pNode), nIndex(r.nIndex) {}
+EditPaM::EditPaM(ContentNode* p, sal_uInt16 n) : pNode(p), nIndex(n) {}
+
+const ContentNode* EditPaM::GetNode() const
+{
+return pNode;
+}
+
+ContentNode* EditPaM::GetNode()
+{
+return pNode;
+}
+
+void EditPaM::SetNode(ContentNode* p)
+{
+pNode = p;
+}
+
 sal_Bool EditPaM::DbgIsBuggy( EditDoc rDoc )
 {
 if ( !pNode )
@@ -633,8 +650,8 @@ sal_Bool EditSelection::Adjust( const ContentList rNodes )
 DBG_ASSERT( aStartPaM.GetIndex() = aStartPaM.GetNode()-Len(), Index out 
of range in Adjust(1) );
 DBG_ASSERT( aEndPaM.GetIndex() = aEndPaM.GetNode()-Len(), Index out of 
range 

[Libreoffice-commits] .: editeng/inc editeng/source

2012-03-28 Thread Kohei Yoshida
 editeng/inc/editeng/editeng.hxx |3 
 editeng/inc/editeng/editview.hxx|2 
 editeng/inc/editeng/outliner.hxx|2 
 editeng/source/editeng/editdbg.cxx  |2 
 editeng/source/editeng/editdoc.cxx  |  112 
 editeng/source/editeng/editdoc.hxx  |   63 ++--
 editeng/source/editeng/editdoc2.cxx |   80 ++---
 editeng/source/editeng/editeng.cxx  |8 --
 editeng/source/editeng/editview.cxx |6 -
 editeng/source/editeng/impedit.cxx  |4 -
 editeng/source/editeng/impedit.hxx  |   31 -
 editeng/source/editeng/impedit2.cxx |   39 +---
 editeng/source/editeng/impedit3.cxx |2 
 editeng/source/editeng/impedit4.cxx |8 +-
 editeng/source/editeng/impedit5.cxx |   22 ++-
 editeng/source/outliner/outlvw.cxx  |2 
 16 files changed, 139 insertions(+), 247 deletions(-)

New commits:
commit 8bf6eb4519b4b92390570341a10872e65fd95dc1
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Thu Mar 29 01:44:32 2012 -0400

Revert ContentList no longer a child class of DummyContentList.

This reverts commit ea8f2cbee079932e7f5d9ab646996b472a120c76.

diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index c17b15b..4c0d5e0 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -328,8 +328,7 @@ public:
 SfxStyleSheetPool*  GetStyleSheetPool();
 
 voidSetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle 
);
-const SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara ) const;
-SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara );
+SfxStyleSheet*  GetStyleSheet( sal_uInt16 nPara ) const;
 
 voidSetWordDelimiters( const String rDelimiters );
 String  GetWordDelimiters() const;
diff --git a/editeng/inc/editeng/editview.hxx b/editeng/inc/editeng/editview.hxx
index aa9864f..7f3dd4c 100644
--- a/editeng/inc/editeng/editview.hxx
+++ b/editeng/inc/editeng/editview.hxx
@@ -183,7 +183,7 @@ public:
 voidSetEditEngineUpdateMode( sal_Bool bUpdate );
 voidForceUpdate();
 
-const SfxStyleSheet* GetStyleSheet() const;
+SfxStyleSheet*  GetStyleSheet() const;
 
 voidSetAnchorMode( EVAnchorMode eMode );
 EVAnchorModeGetAnchorMode() const;
diff --git a/editeng/inc/editeng/outliner.hxx b/editeng/inc/editeng/outliner.hxx
index ee7edec..faceb8a 100644
--- a/editeng/inc/editeng/outliner.hxx
+++ b/editeng/inc/editeng/outliner.hxx
@@ -308,7 +308,7 @@ public:
 voidPaste();
 voidPasteSpecial();
 
-const SfxStyleSheet*  GetStyleSheet() const;
+SfxStyleSheet*  GetStyleSheet() const;
 
 voidSetControlWord( sal_uLong nWord );
 sal_uLong   GetControlWord() const;
diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index 48f6e00..4070002 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -335,7 +335,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool 
bInfoBox )
 for ( sal_uInt16 nPortion = 0; nPortion  
pEE-pImpEditEngine-GetParaPortions(). Count(); nPortion++)
 {
 
-ParaPortion* pPPortion = 
pEE-pImpEditEngine-GetParaPortions()[nPortion];
+ParaPortion* pPPortion = 
pEE-pImpEditEngine-GetParaPortions().GetObject(nPortion );
 fprintf( fp, \nParagraph %i: Length = %i, Invalid = %i\nText = '%s', 
nPortion, pPPortion-GetNode()-Len(), pPPortion-IsInvalid(), 
rtl::OUStringToOString( *pPPortion-GetNode(), RTL_TEXTENCODING_ASCII_US 
).getStr() );
 fprintf( fp, \nVorlage: );
 SfxStyleSheet* pStyle = pPPortion-GetNode()-GetStyleSheet();
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 5df6635..f83d054 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -256,6 +256,8 @@ sal_uInt16 aV5Map[] = {
 4035, 4036, 4037, 4038
 };
 
+SV_IMPL_PTRARR( DummyContentList, ContentNode* );
+
 EditCharAttrib* MakeCharAttrib( SfxItemPool rPool, const SfxPoolItem rAttr, 
sal_uInt16 nS, sal_uInt16 nE )
 {
 // Create a new attribute in the pool
@@ -565,25 +567,6 @@ sal_uInt16 EditLineList::FindLine( sal_uInt16 nChar, 
sal_Bool bInclEnd )
 return ( Count() - 1 );
 }
 
-EditPaM::EditPaM() : pNode(NULL), nIndex(0) {}
-EditPaM::EditPaM(const EditPaM r) : pNode(r.pNode), nIndex(r.nIndex) {}
-EditPaM::EditPaM(ContentNode* p, sal_uInt16 n) : pNode(p), nIndex(n) {}
-
-const ContentNode* EditPaM::GetNode() const
-{
-return pNode;
-}
-
-ContentNode* EditPaM::GetNode()
-{
-return pNode;
-}
-
-void EditPaM::SetNode(ContentNode* p)
-{
-pNode = p;
-}
-
 sal_Bool EditPaM::DbgIsBuggy( EditDoc rDoc )
 {
 if ( !pNode )
@@ -650,8 +633,8 @@ sal_Bool EditSelection::Adjust( const ContentList rNodes )
 DBG_ASSERT( aStartPaM.GetIndex() = aStartPaM.GetNode()-Len(), Index out 
of range in Adjust(1) );
 

[Libreoffice-commits] .: editeng/inc editeng/source

2012-03-28 Thread Kohei Yoshida
 editeng/inc/editeng/editeng.hxx |3 
 editeng/inc/editeng/editview.hxx|2 
 editeng/inc/editeng/outliner.hxx|2 
 editeng/source/editeng/editdbg.cxx  |2 
 editeng/source/editeng/editdoc.cxx  |  116 +++-
 editeng/source/editeng/editdoc.hxx  |   63 +--
 editeng/source/editeng/editdoc2.cxx |   80 ++--
 editeng/source/editeng/editeng.cxx  |8 ++
 editeng/source/editeng/editview.cxx |6 -
 editeng/source/editeng/impedit.cxx  |4 -
 editeng/source/editeng/impedit.hxx  |   31 -
 editeng/source/editeng/impedit2.cxx |   39 ++--
 editeng/source/editeng/impedit3.cxx |2 
 editeng/source/editeng/impedit4.cxx |8 +-
 editeng/source/editeng/impedit5.cxx |   22 --
 editeng/source/outliner/outlvw.cxx  |2 
 16 files changed, 249 insertions(+), 141 deletions(-)

New commits:
commit c802cbad7f25d3070f2ae5fd8a7e1a7ce17f99a9
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Thu Mar 29 01:43:30 2012 -0400

ContentList no longer a child class of DummyContentList (take 2).

The previous commit was bad as it would cause segfalut on startup.

This one is good as far as I can tell.

diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index 4c0d5e0..c17b15b 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -328,7 +328,8 @@ public:
 SfxStyleSheetPool*  GetStyleSheetPool();
 
 voidSetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle 
);
-SfxStyleSheet*  GetStyleSheet( sal_uInt16 nPara ) const;
+const SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara ) const;
+SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara );
 
 voidSetWordDelimiters( const String rDelimiters );
 String  GetWordDelimiters() const;
diff --git a/editeng/inc/editeng/editview.hxx b/editeng/inc/editeng/editview.hxx
index 7f3dd4c..aa9864f 100644
--- a/editeng/inc/editeng/editview.hxx
+++ b/editeng/inc/editeng/editview.hxx
@@ -183,7 +183,7 @@ public:
 voidSetEditEngineUpdateMode( sal_Bool bUpdate );
 voidForceUpdate();
 
-SfxStyleSheet*  GetStyleSheet() const;
+const SfxStyleSheet* GetStyleSheet() const;
 
 voidSetAnchorMode( EVAnchorMode eMode );
 EVAnchorModeGetAnchorMode() const;
diff --git a/editeng/inc/editeng/outliner.hxx b/editeng/inc/editeng/outliner.hxx
index faceb8a..ee7edec 100644
--- a/editeng/inc/editeng/outliner.hxx
+++ b/editeng/inc/editeng/outliner.hxx
@@ -308,7 +308,7 @@ public:
 voidPaste();
 voidPasteSpecial();
 
-SfxStyleSheet*  GetStyleSheet() const;
+const SfxStyleSheet*  GetStyleSheet() const;
 
 voidSetControlWord( sal_uLong nWord );
 sal_uLong   GetControlWord() const;
diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index 4070002..48f6e00 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -335,7 +335,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool 
bInfoBox )
 for ( sal_uInt16 nPortion = 0; nPortion  
pEE-pImpEditEngine-GetParaPortions(). Count(); nPortion++)
 {
 
-ParaPortion* pPPortion = 
pEE-pImpEditEngine-GetParaPortions().GetObject(nPortion );
+ParaPortion* pPPortion = 
pEE-pImpEditEngine-GetParaPortions()[nPortion];
 fprintf( fp, \nParagraph %i: Length = %i, Invalid = %i\nText = '%s', 
nPortion, pPPortion-GetNode()-Len(), pPPortion-IsInvalid(), 
rtl::OUStringToOString( *pPPortion-GetNode(), RTL_TEXTENCODING_ASCII_US 
).getStr() );
 fprintf( fp, \nVorlage: );
 SfxStyleSheet* pStyle = pPPortion-GetNode()-GetStyleSheet();
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index f83d054..010f40f 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -256,8 +256,6 @@ sal_uInt16 aV5Map[] = {
 4035, 4036, 4037, 4038
 };
 
-SV_IMPL_PTRARR( DummyContentList, ContentNode* );
-
 EditCharAttrib* MakeCharAttrib( SfxItemPool rPool, const SfxPoolItem rAttr, 
sal_uInt16 nS, sal_uInt16 nE )
 {
 // Create a new attribute in the pool
@@ -567,6 +565,25 @@ sal_uInt16 EditLineList::FindLine( sal_uInt16 nChar, 
sal_Bool bInclEnd )
 return ( Count() - 1 );
 }
 
+EditPaM::EditPaM() : pNode(NULL), nIndex(0) {}
+EditPaM::EditPaM(const EditPaM r) : pNode(r.pNode), nIndex(r.nIndex) {}
+EditPaM::EditPaM(ContentNode* p, sal_uInt16 n) : pNode(p), nIndex(n) {}
+
+const ContentNode* EditPaM::GetNode() const
+{
+return pNode;
+}
+
+ContentNode* EditPaM::GetNode()
+{
+return pNode;
+}
+
+void EditPaM::SetNode(ContentNode* p)
+{
+pNode = p;
+}
+
 sal_Bool EditPaM::DbgIsBuggy( EditDoc rDoc )
 {
 if ( !pNode )
@@ -633,8 +650,8 @@ sal_Bool EditSelection::Adjust( const ContentList rNodes )
 DBG_ASSERT( aStartPaM.GetIndex() =