[Libreoffice-commits] .: sal/inc

2013-01-31 Thread Tor Lillqvist
 sal/inc/sal/log-areas.dox |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 0e63a97066a817f3d01b40d99e3e1ed831ae3598
Author: Tor Lillqvist t...@iki.fi
Date:   Thu Jan 31 14:03:05 2013 +0200

Add vcl.atsui and vcl.coretext

Change-Id: I9c9db51f04db5a0d073bd7493c198e8413299633

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 6e0072f..83440bd 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -175,7 +175,9 @@ certain functionality.
 
 @section VCL
 
+@li @c vcl.atsui - ATSUI (obsolete) -using code for Mac OS X
 @li @c vcl.control
+@li @c vcl.coretext - CoreText-using code for Mac OS X and iOS
 @li @c vcl.gdi - the GDI part of VCL, devices, bitmaps, etc.
 @li @c vcl.gtk - Gtk+ 2/3 plugin
 @li @c vcl.layout - Widget layout
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2013-01-19 Thread Libreoffice Gerrit user
 sal/inc/rtl/string.hxx  |   10 --
 sal/inc/rtl/ustring.hxx |   10 --
 2 files changed, 16 insertions(+), 4 deletions(-)

New commits:
commit 06e76156d2ea1ce8a112f9e2312d6074478de648
Author: Luboš Luňák l.lu...@suse.cz
Date:   Sat Jan 19 13:54:40 2013 +0100

microoptimization for  OUString ctor

Now 'OUString()' and '' should be exactly the same, and thus the latter 
better :).

Change-Id: If42b2ca5889967aaa8ccdaf531b45c75c12d54fd

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 6b3d2ff..11a7bf7 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -205,7 +205,10 @@ public:
 {
 assert( strlen( literal ) == internal::ConstCharArrayDetector T 
::size - 1 );
 pData = 0;
-rtl_string_newFromLiteral( pData, literal, 
internal::ConstCharArrayDetector T, void ::size - 1, 0 );
+if( internal::ConstCharArrayDetector T, void ::size - 1 == 0 ) // 
empty string
+rtl_string_new( pData );
+else
+rtl_string_newFromLiteral( pData, literal, 
internal::ConstCharArrayDetector T, void ::size - 1, 0 );
 #ifdef RTL_STRING_UNITTEST
 rtl_string_unittest_const_literal = true;
 #endif
@@ -304,7 +307,10 @@ public:
 {
 RTL_STRING_CONST_FUNCTION
 assert( strlen( literal ) == internal::ConstCharArrayDetector T 
::size - 1 );
-rtl_string_newFromLiteral( pData, literal, 
internal::ConstCharArrayDetector T, void ::size - 1, 0 );
+if( internal::ConstCharArrayDetector T, void ::size - 1 == 0 ) // 
empty string
+rtl_string_new( pData );
+else
+rtl_string_newFromLiteral( pData, literal, 
internal::ConstCharArrayDetector T, void ::size - 1, 0 );
 return *this;
 }
 
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index a4051ac..69b8ab8 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -231,7 +231,10 @@ public:
 {
 assert( strlen( literal ) == internal::ConstCharArrayDetector T 
::size - 1 );
 pData = 0;
-rtl_uString_newFromLiteral( pData, literal, 
internal::ConstCharArrayDetector T, void ::size - 1, 0 );
+if( internal::ConstCharArrayDetector T, void ::size - 1 == 0 ) // 
empty string
+rtl_uString_new( pData );
+else
+rtl_uString_newFromLiteral( pData, literal, 
internal::ConstCharArrayDetector T, void ::size - 1, 0 );
 #ifdef RTL_STRING_UNITTEST
 rtl_string_unittest_const_literal = true;
 #endif
@@ -393,7 +396,10 @@ public:
 typename internal::ConstCharArrayDetector T, OUString ::Type operator=( 
T literal )
 {
 assert( strlen( literal ) == internal::ConstCharArrayDetector T 
::size - 1 );
-rtl_uString_newFromLiteral( pData, literal, 
internal::ConstCharArrayDetector T, void ::size - 1, 0 );
+if( internal::ConstCharArrayDetector T, void ::size - 1 == 0 ) // 
empty string
+rtl_uString_new( pData );
+else
+rtl_uString_newFromLiteral( pData, literal, 
internal::ConstCharArrayDetector T, void ::size - 1, 0 );
 return *this;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-01-18 Thread Libreoffice Gerrit user
 sal/inc/rtl/string.hxx |1 +
 sal/inc/rtl/ustring.hxx|1 +
 sal/qa/rtl/strings/test_strings_valuex.cxx |1 -
 3 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit c881b1b50e3be023efd4dfdebddd002545ed71b3
Author: Luboš Luňák l.lu...@suse.cz
Date:   Fri Jan 18 19:43:17 2013 +0100

long and long long can be the same size (and thus also sal_Int64)

Change-Id: I3961ec27d23915b038c3a803dc71e7d937ca331c

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 325fe28..c04cd13 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -1522,6 +1522,7 @@ public:
 */
 static OString number( unsigned long ll, sal_Int16 radix = 10 )
 {
+assert( ll = SAL_MAX_INT64 ); // valueOfInt64 may not be able to 
handle the highest bit
 sal_Char aBuf[RTL_STR_MAX_VALUEOFINT64];
 rtl_String* pNewData = 0;
 rtl_string_newFromStr_WithLength( pNewData, aBuf, 
rtl_str_valueOfInt64( aBuf, ll, radix ) );
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index c87978f..c0370ff 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -2156,6 +2156,7 @@ public:
 */
 static OUString number( unsigned long ll, sal_Int16 radix = 10 )
 {
+assert( ll = SAL_MAX_INT64 ); // valueOfInt64 may not be able to 
handle the highest bit
 sal_Unicode aBuf[RTL_STR_MAX_VALUEOFINT64];
 rtl_uString* pNewData = 0;
 rtl_uString_newFromStr_WithLength( pNewData, aBuf, 
rtl_ustr_valueOfInt64( aBuf, ll, radix ) );
diff --git a/sal/qa/rtl/strings/test_strings_valuex.cxx 
b/sal/qa/rtl/strings/test_strings_valuex.cxx
index d350b0f..9573b19 100644
--- a/sal/qa/rtl/strings/test_strings_valuex.cxx
+++ b/sal/qa/rtl/strings/test_strings_valuex.cxx
@@ -70,7 +70,6 @@ void testInt() {
 assert( sizeof( long ) = sizeof( sal_Int64 ));
 assert( sizeof( long long ) = sizeof( sal_Int64 ));
 assert( sizeof( unsigned int )  sizeof( sal_Int64 ));
-assert( sizeof( unsigned long )  sizeof( sal_Int64 ));
 }
 
 void test::strings::valueX::testOUInt() {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2013-01-02 Thread Libreoffice Gerrit user
 sal/inc/sal/log-areas.dox |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 49fc6c6b85e4902dc9b776d82ec17ea7c01a8dd1
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Jan 2 18:07:52 2013 +0100

sal: missing jvmfwk in log-areas

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index c167267..428c7fb 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -221,6 +221,7 @@ certain functionality.
 @li @c editeng
 @li @c framework
 @li @c helpcompiler
+@li @c jvmfwk
 @li @c linguistic
 @li @c oox
 @li @c rsc
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-01-02 Thread Libreoffice Gerrit user
 sal/inc/sal/log-areas.dox|1 +
 sw/qa/extras/rtfimport/rtfimport.cxx |1 -
 sw/source/core/crsr/crstrvl.cxx  |2 +-
 sw/source/core/unocore/unostyle.cxx  |2 +-
 sw/source/ui/app/docsh2.cxx  |1 -
 sw/source/ui/ribbar/workctrl.cxx |4 +---
 6 files changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 8275c8fc33b63aa40a0a8a8c215f32b9986edab6
Author: Miklos Vajna vmik...@suse.cz
Date:   Wed Jan 2 19:55:34 2013 +0100

sw: fix loplugin warnings

Change-Id: I090a51c112c960b8cc9b208bc7378a5aa3754552

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 428c7fb..5232778 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -182,6 +182,7 @@ certain functionality.
 @section Writer
 
 @li @c sw
+@li @c sw.level2
 @li @c sw.core - Writer core
 @li @c sw.rtf - .rtf export filter
 @li @c sw.uno - Writer UNO interfaces
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index be8c34d..88e6797 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -527,7 +527,6 @@ void Test::testFdo48356()
 uno::Referencetext::XTextDocument xTextDocument(mxComponent, 
uno::UNO_QUERY);
 uno::Referencecontainer::XEnumerationAccess 
xParaEnumAccess(xTextDocument-getText(), uno::UNO_QUERY);
 uno::Referencecontainer::XEnumeration xParaEnum = 
xParaEnumAccess-createEnumeration();
-OUStringBuffer aBuf;
 int i = 0;
 while (xParaEnum-hasMoreElements())
 {
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 5229fc9..040e998 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1377,7 +1377,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point rPt,
 rCntntAtPos.eCntntAtPos = 
SwContentAtPos::SW_TABLEBOXVALUE;
 else
 #endif
-((SwTblBoxFormula*)pItem)-PtrToBoxNm( 
pTblNd-GetTable() );
+((SwTblBoxFormula*)pItem)-PtrToBoxNm( 
pTblNd-GetTable() );
 
 bRet = sal_True;
 if( bSetCrsr )
diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 71e7d72..7dc7524 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -873,7 +873,7 @@ void SwXStyleFamily::insertByName(const OUString rName, 
const uno::Any rElemen
 #if OSL_DEBUG_LEVEL  1
 SfxStyleSheetBase rNewBase =
 #endif
-pBasePool-Make(sStyleName, eFamily, nMask);
+pBasePool-Make(sStyleName, eFamily, nMask);
 pNewStyle-SetDoc(pDocShell-GetDoc(), pBasePool);
 pNewStyle-SetStyleName(sStyleName);
 String sParentStyleName(pNewStyle-GetParentStyleName());
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index f3cbb08..58bbd6d 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -1691,7 +1691,6 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String 
rURL,
 
 // Create a URL from filename
 INetURLObject aURLObj( rURL );
-String sURL( aURLObj.GetMainURL( INetURLObject::NO_DECODE ) );
 
 // Set filter:
 String 
sFactory(rtl::OUString::createFromAscii(SwDocShell::Factory().GetShortName()));
diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx
index 4e21205..41088d1 100644
--- a/sw/source/ui/ribbar/workctrl.cxx
+++ b/sw/source/ui/ribbar/workctrl.cxx
@@ -208,13 +208,12 @@ SfxPopupWindow* SwTbxAutoTextCtrl::CreatePopupWindow()
 {
 // Gruppenname mit Pfad-Extension besorgen
 String sTitle;
-String sGroupName = pGlossaryList-GetGroupName(i - 1, 
sal_False, sTitle);
 sal_uInt16 nBlockCount = pGlossaryList-GetBlockCount(i 
-1);
 if(nBlockCount)
 {
 sal_uInt16 nIndex = 100 * (i);
 // aber ohne extension einfuegen
-pPopup-InsertItem( i, 
sTitle);//sGroupName.GetToken(0, GLOS_DELIM));
+pPopup-InsertItem( i, sTitle);
 PopupMenu* pSub = new PopupMenu;
 pSub-SetSelectHdl(aLnk);
 pPopup-SetPopupMenu(i, pSub);
@@ -306,7 +305,6 @@ IMPL_LINK(SwTbxAutoTextCtrl, PopupHdl, PopupMenu*, pMenu)
 SwGlossaryList* pGlossaryList = ::GetGlossaryList();
 String sShortName;
 String sGroup = pGlossaryList-GetGroupName(nBlock - 1, sal_False);
-String sLongName(pGlossaryList-GetBlockName(nBlock - 1, nId - (100 * 
nBlock) - 1, sShortName));
 
 SwGlossaryHdl* pGlosHdl = pView-GetGlosHdl();
 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();

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

2012-12-18 Thread Libreoffice Gerrit user
 sal/inc/rtl/string.h   |2 ++
 sal/inc/rtl/ustring.h  |5 +++--
 sal/rtl/source/strtmpl.cxx |4 ++--
 3 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 09123760860f99756d37b70557d83f707fda6b17
Author: Michael Meeks michael.me...@suse.com
Date:   Tue Dec 18 17:43:56 2012 +

fdo#58473 - fix transliteration crasher caused by writing const string.

diff --git a/sal/inc/rtl/string.h b/sal/inc/rtl/string.h
index bfeecf7..26fa5c7 100644
--- a/sal/inc/rtl/string.h
+++ b/sal/inc/rtl/string.h
@@ -821,6 +821,8 @@ SAL_DLLPUBLIC void SAL_CALL rtl_string_new( rtl_String ** 
newStr ) SAL_THROW_EXT
 The reference count of the new string will be 1. The length of the string
 will be nLen. This function does not handle out-of-memory conditions.
 
+For nLen  0 or failed allocation this method returns NULL.
+
 The characters of the capacity are not cleared, and the length is set to
 nLen, unlike the similar method of rtl_String_new_WithLength which
 zeros out the buffer, and sets the length to 0. So should be somewhat
diff --git a/sal/inc/rtl/ustring.h b/sal/inc/rtl/ustring.h
index fe2f2f4..1ff75bd 100644
--- a/sal/inc/rtl/ustring.h
+++ b/sal/inc/rtl/ustring.h
@@ -1152,8 +1152,9 @@ SAL_DLLPUBLIC void SAL_CALL rtl_uString_new(
 /** Allocate a new string containing space for a given number of characters.
 
 The reference count of the new string will be 1. The length of the string
-will be nLen. This function throws std::bad_alloc on out-of-memory
-conditions.
+will be nLen. This function does not handle out-of-memory conditions.
+
+For nLen  0 or failed allocation this method returns NULL.
 
 The characters of the capacity are not cleared, and the length is set to
 nLen, unlike the similar method of rtl_uString_new_WithLength which
diff --git a/sal/rtl/source/strtmpl.cxx b/sal/rtl/source/strtmpl.cxx
index f715a58..cdb4f11 100644
--- a/sal/rtl/source/strtmpl.cxx
+++ b/sal/rtl/source/strtmpl.cxx
@@ -1069,8 +1069,8 @@ void SAL_CALL IMPL_RTL_STRINGNAME( new )( 
IMPL_RTL_STRINGDATA** ppThis )
 IMPL_RTL_STRINGDATA* SAL_CALL IMPL_RTL_STRINGNAME( alloc )( sal_Int32 nLen )
 SAL_THROW_EXTERN_C()
 {
-if ( nLen = 0 )
-return (IMPL_RTL_STRINGDATA*) (IMPL_RTL_EMPTYSTRING);
+if ( nLen  0 )
+return NULL;
 else
 return IMPL_RTL_STRINGNAME( ImplAlloc )( nLen );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-12-17 Thread Libreoffice Gerrit user
 sal/inc/rtl/ustring.hxx |   13 +
 sal/qa/rtl/strings/test_oustring_stringliterals.cxx |1 +
 2 files changed, 14 insertions(+)

New commits:
commit c075b8068bff1b3c6025638aaf0acab5bbebab4d
Author: Luboš Luňák l.lu...@suse.cz
Date:   Mon Dec 17 16:27:22 2012 +0100

OUString::reverseCompareTo() string literal overload to match the AsciiL one

Change-Id: Id5ca706aa3fd1831990db2310933c6b94ca376cb

diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index 5760914..c9fe25e 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -528,6 +528,19 @@ public:
 }
 
 /**
+ @overload
+ This function accepts an ASCII string literal as its argument.
+ @since LibreOffice 4.1
+*/
+template typename T 
+typename internal::ConstCharArrayDetector T, sal_Int32 ::Type 
reverseCompareTo( T literal ) const SAL_THROW(())
+{
+assert( strlen( literal ) == internal::ConstCharArrayDetector T 
::size - 1 );
+return rtl_ustr_asciil_reverseCompare_WithLength( pData-buffer, 
pData-length,
+literal, internal::ConstCharArrayDetector T, void ::size - 1 );
+}
+
+/**
   Perform a comparison of two strings.
 
   The result is true if and only if second string
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx 
b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
index a6d7145..873b536 100644
--- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
@@ -145,6 +145,7 @@ void test::oustring::StringLiterals::checkUsage()
 CPPUNIT_ASSERT( foobarfoo.replaceFirst( foo, test ) == testbarfoo );
 CPPUNIT_ASSERT( foobarfoo.replaceAll( foo, test ) == testbartest );
 CPPUNIT_ASSERT( foobarfoo.replaceAll( foo, test ) == testbartest );
+CPPUNIT_ASSERT( foo.reverseCompareTo( foo ) == 0 );
 // if this is not true, some of the calls above converted to OUString
 CPPUNIT_ASSERT( rtl_string_unittest_const_literal == false );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc sal/Library_sal.mk sal/osl sal/Package_inc.mk sal/rtl

2012-12-17 Thread Libreoffice Gerrit user
 sal/Library_sal.mk|1 
 sal/Package_inc.mk|1 
 sal/inc/rtl/memory.h  |   53 
 sal/osl/all/compat.cxx|   32 ++
 sal/rtl/source/memory.cxx |   55 --
 5 files changed, 32 insertions(+), 110 deletions(-)

New commits:
commit 542ad7f1c5ac7794c42248ac13e9b33f84888490
Author: Arnaud Versini arnaud.vers...@gmail.com
Date:   Sat Dec 8 11:35:00 2012 +0100

API CHANGE: Remove useless deprecated rtl/memory.h

Signed-off-by: Stephan Bergmann sberg...@redhat.com, adapted some function
definitions in sal/osl/all/compat.cxx to avoid must return a value 
warnings.

Change-Id: Iac156b004464018225bbfda24f0a234f9ebcb19f

diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index 5ea6b55..cae8219 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -119,7 +119,6 @@ $(eval $(call gb_Library_add_exception_objects,sal,\
sal/rtl/source/locale \
sal/rtl/source/logfile \
sal/rtl/source/math \
-   sal/rtl/source/memory \
sal/rtl/source/random \
sal/rtl/source/rtl_process \
sal/rtl/source/strbuf \
diff --git a/sal/Package_inc.mk b/sal/Package_inc.mk
index 425db1d..15fb477 100644
--- a/sal/Package_inc.mk
+++ b/sal/Package_inc.mk
@@ -80,7 +80,6 @@ $(eval $(call 
gb_Package_add_file,sal_inc,inc/rtl/logfile.hxx,rtl/logfile.hxx))
 $(eval $(call 
gb_Package_add_file,sal_inc,inc/rtl/malformeduriexception.hxx,rtl/malformeduriexception.hxx))
 $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/math.h,rtl/math.h))
 $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/math.hxx,rtl/math.hxx))
-$(eval $(call gb_Package_add_file,sal_inc,inc/rtl/memory.h,rtl/memory.h))
 $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/process.h,rtl/process.h))
 $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/random.h,rtl/random.h))
 $(eval $(call gb_Package_add_file,sal_inc,inc/rtl/ref.hxx,rtl/ref.hxx))
diff --git a/sal/inc/rtl/memory.h b/sal/inc/rtl/memory.h
deleted file mode 100644
index 25e2a73..000
--- a/sal/inc/rtl/memory.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the License); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-
-#ifndef _RTL_MEMORY_H_
-#define _RTL_MEMORY_H_
-
-#include sal/config.h
-
-#include sal/saldllapi.h
-#include sal/types.h
-
-#ifdef __cplusplus
-extern C {
-#endif
-
-SAL_DEPRECATED(Use memset instead)
-SAL_DLLPUBLIC void SAL_CALL rtl_zeroMemory(void *Ptr, sal_Size Bytes);
-SAL_DEPRECATED(Use memset instead)
-SAL_DLLPUBLIC void SAL_CALL rtl_fillMemory(void *Ptr, sal_Size Bytes, 
sal_uInt8 Fill);
-SAL_DEPRECATED(Use memcpy instead)
-SAL_DLLPUBLIC void SAL_CALL rtl_copyMemory(void *Dst, const void *Src, 
sal_Size Bytes);
-SAL_DEPRECATED(Use memmove instead)
-SAL_DLLPUBLIC void SAL_CALL rtl_moveMemory(void *Dst, const void *Src, 
sal_Size Bytes);
-SAL_DEPRECATED(Use memcmp instead)
-SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_compareMemory(const void *MemA, const 
void *MemB, sal_Size Bytes);
-SAL_DEPRECATED(Use memchr instead)
-SAL_DLLPUBLIC void* SAL_CALL rtl_findInMemory(const void *MemA, sal_uInt8 ch, 
sal_Size Bytes);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /*_RTL_MEMORY_H_ */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/all/compat.cxx b/sal/osl/all/compat.cxx
index fb8a1ec..f9c7129 100644
--- a/sal/osl/all/compat.cxx
+++ b/sal/osl/all/compat.cxx
@@ -37,6 +37,38 @@ SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL 
osl_tryToAcquireSemaphore(void *) {
 for (;;) { std::abort(); } // avoid must return a value warnings
 }
 
+SAL_DLLPUBLIC_EXPORT sal_Int32 SAL_CALL rtl_compareMemory(
+void const *, void const *, sal_Size)
+{
+for (;;) { std::abort(); } // avoid must return a value warnings
+}
+
+SAL_DLLPUBLIC_EXPORT void SAL_CALL rtl_copyMemory(
+void *, void const *, sal_Size)
+{
+std::abort();
+}
+
+SAL_DLLPUBLIC_EXPORT void SAL_CALL rtl_fillMemory(void *, sal_Size, sal_uInt8) 
{
+std::abort();
+}
+
+SAL_DLLPUBLIC_EXPORT void * SAL_CALL rtl_findInMemory(
+void const *, sal_uInt8, sal_Size)
+{
+for (;;) { std::abort(); } // avoid must 

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

2012-12-11 Thread Libreoffice Gerrit user
 sal/inc/rtl/ustrbuf.hxx   |5 ++---
 sal/inc/sal/types.h   |   18 ++
 sfx2/inc/sfx2/docfile.hxx |2 +-
 3 files changed, 21 insertions(+), 4 deletions(-)

New commits:
commit 20b720ba3790d657ea3112fde0678c262908a1b6
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Dec 11 16:00:00 2012 +0100

Introduce SAL_DELETE

Change-Id: I7ac7392646ea34fb2e6a9f15990aca05a2c1e484

diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index d48245b..2095cd5 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -29,6 +29,7 @@
 #include rtl/ustrbuf.h
 #include rtl/ustring.hxx
 #include rtl/stringutils.hxx
+#include sal/types.h
 
 #ifdef RTL_FAST_STRING
 #include rtl/stringconcat.hxx
@@ -574,7 +575,6 @@ public:
 sal_Unicode sz[RTL_USTR_MAX_VALUEOFBOOLEAN];
 return append( sz, rtl_ustr_valueOfBoolean( sz, b ) );
 }
-#ifdef HAVE_CXX11_DELETE
 #ifndef HAVE_SFINAE_ANONYMOUS_BROKEN
 // Pointer can be automatically converted to bool, which is unwanted here.
 // Explicitly delete all pointer append() overloads to prevent this
@@ -582,8 +582,7 @@ public:
 template typename T 
 typename internal::Enable void,
 !internal::CharPtrDetector T* ::ok  
!internal::SalUnicodePtrDetector T* ::ok ::Type
-append( T* ) = delete;
-#endif
+append( T* ) SAL_DELETE;
 #endif
 
 // This overload is needed because OUString has a ctor from rtl_uString*, 
but
diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h
index bc9b2ef..46f6003 100644
--- a/sal/inc/sal/types.h
+++ b/sal/inc/sal/types.h
@@ -23,6 +23,10 @@
 #include sal/config.h
 #include sal/macros.h
 
+#if defined LIBO_INTERNAL_ONLY
+#include config_global.h
+#endif
+
 /* Grab __SIZEOFxxx constants from typesconfig tool on Unix */
 #if defined UNX
   #include sal/typesizes.h
@@ -395,6 +399,20 @@ namespace com { namespace sun { namespace star { } } }
 */
 namespace css = ::com::sun::star;
 
+/** C++11 = delete feature.
+
+With HAVE_CXX11_DELETE, calling a deleted function will cause a 
compile-time
+error, while otherwise it will only cause a link-time error as the declared
+function is not defined.
+
+@since LibreOffice 4.1
+*/
+#if defined HAVE_CXX11_DELETE
+#define SAL_DELETE = delete
+#else
+#define SAL_DELETE
+#endif
+
 #endif /* __cplusplus */
 
 #ifdef __cplusplus
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index f989fde..43675fa 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -94,7 +94,7 @@ public:
 // original overload have been adapted (in platform
 // specific code etc.):
 SfxMedium(String const , StreamMode, void *)
-/* = delete */;
+SAL_DELETE;
 
 SfxMedium( const ::com::sun::star::uno::Reference 
::com::sun::star::embed::XStorage  xStorage,
 const String rBaseURL,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-12-11 Thread Libreoffice Gerrit user
 sal/inc/rtl/ustrbuf.hxx   |2 +-
 sal/inc/sal/types.h   |4 ++--
 sfx2/inc/sfx2/docfile.hxx |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit f00b77c856067b77a6dc5c2d90cc1205d87de03a
Author: Luboš Luňák l.lu...@suse.cz
Date:   Tue Dec 11 17:03:02 2012 +0100

SAL_DELETE - SAL_DELETED_FUNCTION, for a more descriptive name

diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 2095cd5..98f1fc5 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -582,7 +582,7 @@ public:
 template typename T 
 typename internal::Enable void,
 !internal::CharPtrDetector T* ::ok  
!internal::SalUnicodePtrDetector T* ::ok ::Type
-append( T* ) SAL_DELETE;
+append( T* ) SAL_DELETED_FUNCTION;
 #endif
 
 // This overload is needed because OUString has a ctor from rtl_uString*, 
but
diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h
index 46f6003..125c098 100644
--- a/sal/inc/sal/types.h
+++ b/sal/inc/sal/types.h
@@ -408,9 +408,9 @@ namespace css = ::com::sun::star;
 @since LibreOffice 4.1
 */
 #if defined HAVE_CXX11_DELETE
-#define SAL_DELETE = delete
+#define SAL_DELETED_FUNCTION = delete
 #else
-#define SAL_DELETE
+#define SAL_DELETED_FUNCTION
 #endif
 
 #endif /* __cplusplus */
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index 43675fa..02f87fe 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -94,7 +94,7 @@ public:
 // original overload have been adapted (in platform
 // specific code etc.):
 SfxMedium(String const , StreamMode, void *)
-SAL_DELETE;
+SAL_DELETED_FUNCTION;
 
 SfxMedium( const ::com::sun::star::uno::Reference 
::com::sun::star::embed::XStorage  xStorage,
 const String rBaseURL,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-12-11 Thread Libreoffice Gerrit user
 sal/inc/rtl/ustring.hxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit abca8e3afa1c9c42266e89b863ee69cca4b93e21
Author: Ivan Timofeev timofeev@gmail.com
Date:   Tue Dec 11 17:07:26 2012 +0400

use SAL_WARN_UNUSED_RESULT for OUString::replaceAll

Change-Id: I30754e4d0cb0c490e6c125ba034e2e0eac3751e7
Reviewed-on: https://gerrit.libreoffice.org/1297
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index bd1b9cb..5760914 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -1614,7 +1614,9 @@ public:
 
   @since LibreOffice 4.0
 */
-OUString replaceAll(OUString const  from, OUString const  to, sal_Int32 
fromIndex = 0) const {
+SAL_WARN_UNUSED_RESULT OUString replaceAll(
+OUString const  from, OUString const  to, sal_Int32 fromIndex = 0) 
const
+{
 rtl_uString * s = 0;
 rtl_uString_newReplaceAllFromIndex(s, pData, from.pData, to.pData, 
fromIndex);
 return OUString(s, SAL_NO_ACQUIRE);
@@ -1634,7 +1636,7 @@ public:
   @since LibreOffice 3.6
 */
 template typename T 
-typename internal::ConstCharArrayDetector T, OUString ::Type replaceAll( 
T from, OUString const  to) const
+SAL_WARN_UNUSED_RESULT typename internal::ConstCharArrayDetector T, 
OUString ::Type replaceAll( T from, OUString const  to) const
 {
 rtl_uString * s = 0;
 assert( strlen( from ) == internal::ConstCharArrayDetector T ::size 
- 1 );
@@ -1656,7 +1658,7 @@ public:
   @since LibreOffice 3.6
 */
 template typename T1, typename T2 
-typename internal::ConstCharArrayDetector T1, typename 
internal::ConstCharArrayDetector T2, OUString ::Type ::Type
+SAL_WARN_UNUSED_RESULT typename internal::ConstCharArrayDetector T1, 
typename internal::ConstCharArrayDetector T2, OUString ::Type ::Type
 replaceAll( T1 from, T2 to ) const
 {
 rtl_uString * s = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-12-10 Thread Libreoffice Gerrit user
 sal/inc/rtl/strbuf.hxx  |   15 +++
 sal/inc/rtl/ustrbuf.hxx |   15 +++
 2 files changed, 30 insertions(+)

New commits:
commit 17b272effc206875fe4165e58d6452f0ecd8
Author: Luboš Luňák l.lu...@suse.cz
Date:   Mon Dec 10 23:51:22 2012 +0100

operator+ for stringbuffer

This is to complement the RTL_FAST_STRING variant, which allows any
combination, so even two stringbuffers.

Change-Id: Ic15d81246b3d0f3e22b51c0516409e95c3a4dc8d

diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx
index 86f89ef..2740c48 100644
--- a/sal/inc/rtl/strbuf.hxx
+++ b/sal/inc/rtl/strbuf.hxx
@@ -862,6 +862,21 @@ public:
 return *this;
 }
 
+#ifdef LIBO_INTERNAL_ONLY
+// This is to complement the RTL_FAST_STRING operator+, which allows any 
combination of valid operands,
+// even two buffers. It's intentional it returns OString, just like the 
operator+ would in the fast variant.
+#ifndef RTL_FAST_STRING
+/**
+ @internal
+ @since LibreOffice 4.1
+*/
+friend OString operator+( const OStringBuffer str1, const OStringBuffer 
str2  ) SAL_THROW(())
+{
+return OString( str1.pData ).concat( str2.pData );
+}
+#endif
+#endif
+
 private:
 /**
 A pointer to the data structur which contains the data.
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 3814a6f..d48245b 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -1298,6 +1298,21 @@ public:
 return stripStart(c) + stripEnd(c);
 }
 
+#ifdef LIBO_INTERNAL_ONLY
+// This is to complement the RTL_FAST_STRING operator+, which allows any 
combination of valid operands,
+// even two buffers. It's intentional it returns OUString, just like the 
operator+ would in the fast variant.
+#ifndef RTL_FAST_STRING
+/**
+ @internal
+ @since LibreOffice 4.1
+*/
+friend OUString operator+( const OUStringBuffer str1, const 
OUStringBuffer str2  ) SAL_THROW(())
+{
+return OUString( str1.pData ).concat( str2.pData );
+}
+#endif
+#endif
+
 private:
 /**
 A pointer to the data structur which contains the data.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-12-09 Thread Libreoffice Gerrit user
 sal/inc/rtl/ustrbuf.hxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit dc6277ef41dcf529760ad894e0aa124f18722c33
Author: Tor Lillqvist t...@iki.fi
Date:   Sun Dec 9 22:42:04 2012 +0200

WaE: deleted function definitions are a C++11 extension

Change-Id: I8f070fb53c0310761c3a0a2407d48ca1c1ac5e18

diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 3814a6f..9850bfa 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -579,10 +579,17 @@ public:
 // Pointer can be automatically converted to bool, which is unwanted here.
 // Explicitly delete all pointer append() overloads to prevent this
 // (except for char* and sal_Unicode* overloads, which are handled 
elsewhere).
+#if defined(__clang__)  defined(LIBO_WERROR)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored -Wc++11-extensions
+#endif
 template typename T 
 typename internal::Enable void,
 !internal::CharPtrDetector T* ::ok  
!internal::SalUnicodePtrDetector T* ::ok ::Type
 append( T* ) = delete;
+#if defined(__clang__)  defined(LIBO_WERROR)
+#pragma GCC diagnostic pop
+#endif
 #endif
 #endif
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-12-09 Thread Lubos Lunak
On Sunday 09 of December 2012, Libreoffice Gerrit user wrote:
  sal/inc/rtl/ustrbuf.hxx |7 +++
  1 file changed, 7 insertions(+)

 New commits:
 commit dc6277ef41dcf529760ad894e0aa124f18722c33
 Author: Tor Lillqvist t...@iki.fi
 Date:   Sun Dec 9 22:42:04 2012 +0200

 WaE: deleted function definitions are a C++11 extension

 Change-Id: I8f070fb53c0310761c3a0a2407d48ca1c1ac5e18

 diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
 index 3814a6f..9850bfa 100644
 --- a/sal/inc/rtl/ustrbuf.hxx
 +++ b/sal/inc/rtl/ustrbuf.hxx
 @@ -579,10 +579,17 @@ public:
  // Pointer can be automatically converted to bool, which is unwanted
 here. // Explicitly delete all pointer append() overloads to prevent this
 // (except for char* and sal_Unicode* overloads, which are handled
 elsewhere). 
 +#if defined(__clang__)  defined(LIBO_WERROR) 
 +#pragma GCC diagnostic push
 +#pragma GCC diagnostic ignored -Wc++11-extensions
 +#endif
  template typename T 
  typename internal::Enable void,
  !internal::CharPtrDetector T* ::ok 
 !internal::SalUnicodePtrDetector T* ::ok ::Type append( T* ) = delete;
 +#if defined(__clang__)  defined(LIBO_WERROR)
 +#pragma GCC diagnostic pop
 +#endif
  #endif
  #endif

 That doesn't make sense. This code is inside #ifdef that gets enabled only 
inside configure part that requires C++11 support, so this part should get 
compiled only if we compile with C++11 support, thus there should be no way 
to get this warning. So how can anybody possibly need this?

 And, not to put a too fine point on it, I'd appreciate it if you could try 
something a bit more systematic such as fixing the configure check that's 
been put there for a reason instead of a half-assed band-aid somewhere in the 
code. If you think that's too much work, maybe you'll change your mind as 
you'll have to do this for every place where I add this next.

-- 
 Lubos Lunak
 l.lu...@suse.cz
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2012-12-09 Thread Norbert Thiebaud
On Sun, Dec 9, 2012 at 3:37 PM, Lubos Lunak l.lu...@suse.cz wrote:

  And, not to put a too fine point on it, I'd appreciate it if you could try
 something a bit more systematic such as fixing the configure check that's
 been put there for a reason instead of a half-assed band-aid somewhere in the
 code. If you think that's too much work, maybe you'll change your mind as
 you'll have to do this for every place where I add this next.

Maybe he should do like I did. Turn off the tinderbox to avoid
everyone getting spammed ?

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


[Libreoffice-commits] .: sal/inc svl/source xmloff/source

2012-12-06 Thread Libreoffice Gerrit user
 sal/inc/rtl/ustrbuf.hxx  |4 ++--
 svl/source/numbers/zformat.cxx   |   14 +++---
 xmloff/source/style/xmlnumfi.cxx |2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit eafb82821386e4c14f4a072e4b541dc60f4d7af2
Author: Luboš Luňák l.lu...@suse.cz
Date:   Thu Dec 6 18:48:15 2012 +0100

OUStringBuffer::remove( int ) - truncate( int )

Although this may seem consistent with remove( int, int ), it is
in fact rather misleading API. The biggest offender is most probably
buffer.remove( 'a' ) , which definitely does not do what it suggests
to do.

Change-Id: I287619cd4b953228b93fa68fb381d66c344c3865
Reviewed-on: https://gerrit.libreoffice.org/1256
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Norbert Thiebaud nthieb...@gmail.com
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index c5c6f5d..1397a18 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -986,7 +986,7 @@ public:
 
 @since LibreOffice 4.0
  */
-OUStringBuffer  remove( sal_Int32 start = 0)
+OUStringBuffer  truncate( sal_Int32 start = 0 )
 {
 rtl_uStringbuffer_remove( pData, start, getLength() - start );
 return *this;
@@ -1240,7 +1240,7 @@ public:
 }
 if(index  getLength())
 {
-remove(index);
+truncate(index);
 }
 return result - getLength();
 }
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 1d86c92..3f47265 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2625,7 +2625,7 @@ bool SvNumberformat::ImpGetScientificOutput(double 
fNumber,
 break;
 }
 ExpStr = sStr.toString().copy( nExpStart );// part following the 
E+
-sStr.remove( nExPos );
+sStr.truncate( nExPos );
 // cut any decimal delimiter
 sal_Int32 index = 0;
 
@@ -2692,7 +2692,7 @@ bool SvNumberformat::ImpGetScientificOutput(double 
fNumber,
 // weiter Hauptzahl:
 if ( !bCont )
 {
-sStr.remove();
+sStr.truncate();
 }
 else
 {
@@ -2739,7 +2739,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber,
 if (rInfo.nCntExp == 0)
 {
 SAL_WARN( svl.numbers, SvNumberformat:: Bruch, nCntExp == 0);
-sBuff.remove();
+sBuff.truncate();
 return false;
 }
 
@@ -2944,7 +2944,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber,
 }
 if (rInfo.nCntPre  0  nFrac == 0)
 {
-sDiv.remove();
+sDiv.truncate();
 }
 else
 {
@@ -2980,7 +2980,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber,
 // weiter Zaehler:
 if ( !bCont )
 {
-sFrac.remove();
+sFrac.truncate();
 }
 else
 {
@@ -3001,7 +3001,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber,
 // weiter Hauptzahl
 if ( !bCont )
 {
-sStr.remove();
+sStr.truncate();
 }
 else
 {
@@ -4376,7 +4376,7 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber,
 sal_Int32 nLen = rDecSep.getLength();
 if ( sStr.getLength()  nLen  ( sStr.indexOf( rDecSep, 
sStr.getLength() - nLen) == sStr.getLength() - nLen) )
 {
-sStr.remove( sStr.getLength() - nLen );// no decimals = 
strip DecSep
+sStr.truncate( sStr.getLength() - nLen );// no decimals = 
strip DecSep
 }
 }
 if (bSign)
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index d53e004..28a4ec6 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -906,7 +906,7 @@ static void lcl_EnquoteIfNecessary( rtl::OUStringBuffer 
rContent, const SvXMLNu
  rContent[nLen - 1] == (sal_Unicode) '' 
  rContent[nLen - 2] == (sal_Unicode) '' )
 {
-rContent.remove(nLen - 2);
+rContent.truncate(nLen - 2);
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-12-04 Thread Libreoffice Gerrit user
 sal/inc/rtl/string.hxx  |7 +--
 sal/inc/rtl/ustring.hxx |9 ++---
 sal/qa/rtl/strings/test_ostring_concat.cxx  |1 +
 sal/qa/rtl/strings/test_oustring_concat.cxx |1 +
 4 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 4e593d047b9c10de085dffa3fa3dd4602361c407
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Dec 4 11:20:22 2012 +0100

Fix fast concat of empty strings

Change-Id: Ice9c6974f44be3bc4c9b3533de2a9beb5b146ca5

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 2c7a43d..aeb7528 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -262,8 +262,11 @@ public:
 const int l = c.length();
 rtl_String* buffer = NULL;
 rtl_string_new_WithLength( buffer, l );
-char* end = c.addData( buffer-buffer );
-buffer-length = end - buffer-buffer;
+if (l != 0)
+{
+char* end = c.addData( buffer-buffer );
+buffer-length = end - buffer-buffer;
+}
 pData = buffer;
 }
 #endif
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index 534bd88..ec9f90e 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -330,9 +330,12 @@ public:
 const int l = c.length();
 rtl_uString* buffer = NULL;
 rtl_uString_new_WithLength( buffer, l ); // TODO this clears, not 
necessary
-sal_Unicode* end = c.addData( buffer-buffer );
-buffer-length = end - buffer-buffer;
-// TODO realloc in case buffer-length is noticeably smaller than l ?
+if (l != 0)
+{
+sal_Unicode* end = c.addData( buffer-buffer );
+buffer-length = end - buffer-buffer;
+// TODO realloc in case buffer-length is noticeably smaller than 
l?
+}
 pData = buffer;
 }
 #endif
diff --git a/sal/qa/rtl/strings/test_ostring_concat.cxx 
b/sal/qa/rtl/strings/test_ostring_concat.cxx
index a79b2da..46457dd 100644
--- a/sal/qa/rtl/strings/test_ostring_concat.cxx
+++ b/sal/qa/rtl/strings/test_ostring_concat.cxx
@@ -47,6 +47,7 @@ CPPUNIT_TEST_SUITE_END();
 void test::ostring::StringConcat::check()
 {
 // All the extra () are to protect commas againsts being treated as separators 
of macro arguments.
+CPPUNIT_ASSERT_EQUAL( OString(), OString(OString() + OString()) );
 CPPUNIT_ASSERT_EQUAL( OString( foobar ), OString( OString( foo ) + 
OString( bar )));
 TYPES_ASSERT_EQUAL(( typeid( OStringConcat OString, OString  )), typeid( 
OString( foo ) + OString( bar )));
 CPPUNIT_ASSERT_EQUAL( OString( foobar ), OString( OString( foo ) + 
bar ));
diff --git a/sal/qa/rtl/strings/test_oustring_concat.cxx 
b/sal/qa/rtl/strings/test_oustring_concat.cxx
index 0cc2512..4f650dc 100644
--- a/sal/qa/rtl/strings/test_oustring_concat.cxx
+++ b/sal/qa/rtl/strings/test_oustring_concat.cxx
@@ -47,6 +47,7 @@ CPPUNIT_TEST_SUITE_END();
 void test::oustring::StringConcat::check()
 {
 // All the extra () are to protect commas againsts being treated as separators 
of macro arguments.
+CPPUNIT_ASSERT_EQUAL( OUString(), OUString(OUString() + OUString()) );
 CPPUNIT_ASSERT_EQUAL( OUString( foobar ), OUString( OUString( foo ) + 
OUString( bar )));
 TYPES_ASSERT_EQUAL(( typeid( OUStringConcat OUString, OUString  )), 
typeid( OUString( foo ) + OUString( bar )));
 CPPUNIT_ASSERT_EQUAL( OUString( foobar ), OUString( OUString( foo ) + 
bar ));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-12-04 Thread Libreoffice Gerrit user
 sal/inc/rtl/strbuf.hxx   |2 +-
 sal/inc/rtl/string.hxx   |2 +-
 sal/inc/rtl/stringconcat.hxx |   12 +---
 sal/inc/rtl/ustrbuf.hxx  |2 +-
 sal/inc/rtl/ustring.hxx  |4 ++--
 5 files changed, 14 insertions(+), 8 deletions(-)

New commits:
commit bda7beac5b9ea434ddd3185e71d253c9ba11c098
Author: Michael Stahl mst...@redhat.com
Date:   Tue Dec 4 15:55:14 2012 +0100

sal: warning C4267: return: conversion from 'size_t' to 'int'...

... possible loss of data.

Minimal fix that inserts casts when calling strlen; other option would
be to change all length() to return size_t...

Change-Id: I5d1e0b0c7175a1957aad3acd89884fcd37089454

diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx
index 5f1c351..ed627ce 100644
--- a/sal/inc/rtl/strbuf.hxx
+++ b/sal/inc/rtl/strbuf.hxx
@@ -228,7 +228,7 @@ public:
 template typename T1, typename T2 
 OStringBuffer( const OStringConcat T1, T2  c )
 {
-const int l = c.length();
+const sal_Int32 l = c.length();
 rtl_String* buffer = NULL;
 nCapacity = l + 16;
 rtl_string_new_WithLength( buffer, nCapacity );
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index f1e51b7..cbd4b9a 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -260,7 +260,7 @@ public:
 template typename T1, typename T2 
 OString( const OStringConcat T1, T2  c )
 {
-const int l = c.length();
+const sal_Int32 l = c.length();
 rtl_String* buffer = NULL;
 rtl_string_new_WithLength( buffer, l );
 if (l != 0)
diff --git a/sal/inc/rtl/stringconcat.hxx b/sal/inc/rtl/stringconcat.hxx
index bf0244a..2b4fc31 100644
--- a/sal/inc/rtl/stringconcat.hxx
+++ b/sal/inc/rtl/stringconcat.hxx
@@ -100,7 +100,9 @@ sal_Unicode* addDataUString( sal_Unicode* buffer, const 
sal_Unicode* str )
 template
 struct ToStringHelper const char* 
 {
-static int length( const char* str ) { return strlen( str ); }
+static int length( const char* str ) {
+return sal::static_int_castint(strlen( str ));
+}
 static char* addData( char* buffer, const char* str ) { return 
addDataCString( buffer, str ); }
 static const bool allowOStringConcat = true;
 static const bool allowOUStringConcat = false;
@@ -109,7 +111,9 @@ struct ToStringHelper const char* 
 template
 struct ToStringHelper char* 
 {
-static int length( const char* str ) { return strlen( str ); }
+static int length( const char* str ) {
+return sal::static_int_castint(strlen( str ));
+}
 static char* addData( char* buffer, const char* str ) { return 
addDataCString( buffer, str ); }
 static const bool allowOStringConcat = true;
 static const bool allowOUStringConcat = false;
@@ -118,7 +122,9 @@ struct ToStringHelper char* 
 template int N 
 struct ToStringHelper char[ N ] 
 {
-static int length( const char str[ N ] ) { return strlen( str ); }
+static int length( const char str[ N ] ) {
+return sal::static_int_castint(strlen( str ));
+}
 static char* addData( char* buffer, const char str[ N ] ) { return 
addDataCString( buffer, str ); }
 static sal_Unicode* addData( sal_Unicode* buffer, const char str[ N ] ) { 
return addDataLiteral( buffer, str, N - 1 ); }
 static const bool allowOStringConcat = true;
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index f49f7f8..b8f2d05 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -220,7 +220,7 @@ public:
 template typename T1, typename T2 
 OUStringBuffer( const OUStringConcat T1, T2  c )
 {
-const int l = c.length();
+const sal_Int32 l = c.length();
 rtl_uString* buffer = NULL;
 nCapacity = l + 16;
 rtl_uString_new_WithLength( buffer, nCapacity ); // TODO this clears, 
not necessary
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index 4408dfd..3629511 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -328,7 +328,7 @@ public:
 template typename T1, typename T2 
 OUString( const OUStringConcat T1, T2  c )
 {
-const int l = c.length();
+const sal_Int32 l = c.length();
 rtl_uString* buffer = NULL;
 rtl_uString_new_WithLength( buffer, l ); // TODO this clears, not 
necessary
 if (l != 0)
@@ -1592,7 +1592,7 @@ public:
 
   @since LibreOffice 4.0
 */
-OUString replaceAll(OUString const  from, OUString const  to, int 
fromIndex = 0) const {
+OUString replaceAll(OUString const  from, OUString const  to, sal_Int32 
fromIndex = 0) const {
 rtl_uString * s = 0;
 rtl_uString_newReplaceAllFromIndex(s, pData, from.pData, to.pData, 
fromIndex);
 return OUString(s, SAL_NO_ACQUIRE);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] .: sal/inc

2012-12-03 Thread Libreoffice Gerrit user
 sal/inc/sal/log.hxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 9715794fcd076bc07eb6435a27b1d71f7e2b5e07
Author: Tor Lillqvist tlillqv...@suse.com
Date:   Mon Dec 3 15:14:44 2012 +0200

VS2012 knows that std::abort() does what it says on the tin (WaE: 
unreachable code)

diff --git a/sal/inc/sal/log.hxx b/sal/inc/sal/log.hxx
index 2da1479..bd8d476 100644
--- a/sal/inc/sal/log.hxx
+++ b/sal/inc/sal/log.hxx
@@ -94,7 +94,7 @@ template typename T  inline StreamIgnore operator (
 SAL_UNUSED_PARAMETER StreamStart const , SAL_UNUSED_PARAMETER T const )
 {
 std::abort();
-#if defined _MSC_VER
+#if defined _MSC_VER  _MSC_VER  1700
 return StreamIgnore();
 #endif
 }
@@ -103,7 +103,7 @@ template typename T  inline StreamIgnore operator (
 SAL_UNUSED_PARAMETER StreamString const , SAL_UNUSED_PARAMETER T const )
 {
 std::abort();
-#if defined _MSC_VER
+#if defined _MSC_VER  _MSC_VER  1700
 return StreamIgnore();
 #endif
 }
@@ -112,7 +112,7 @@ template typename T  inline StreamIgnore operator (
 SAL_UNUSED_PARAMETER StreamIgnore const , SAL_UNUSED_PARAMETER T const )
 {
 std::abort();
-#if defined _MSC_VER
+#if defined _MSC_VER  _MSC_VER  1700
 return StreamIgnore();
 #endif
 }
@@ -123,7 +123,7 @@ inline char const * unwrapStream(StreamString const  s) { 
return s.string; }
 
 inline char const * unwrapStream(SAL_UNUSED_PARAMETER StreamIgnore const ) {
 std::abort();
-#if defined _MSC_VER
+#if defined _MSC_VER  _MSC_VER  1700
 return 0;
 #endif
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-12-03 Thread Libreoffice Gerrit user
 sal/inc/rtl/ustring.hxx |  123 +++-
 1 file changed, 61 insertions(+), 62 deletions(-)

New commits:
commit 847455f935dfdccf52cd786ea95b445cc6d02b36
Author: Naser Sharifi sharifina...@gmail.com
Date:   Mon Nov 26 14:50:11 2012 -0600

Improve English comments

Corrected types and grammer errors in comments

Change-Id: I47ce77a8d36d71677720be6dd80594ec76970376

diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index ebf548b..c5cfcc3 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -57,27 +57,26 @@ namespace rtl
 /* === */
 
 /**
-  This String class provide base functionality for C++ like Unicode
-  character array handling. The advantage of this class is, that it
-  handle all the memory management for you - and it do it
-  more efficient. If you assign a string to another string, the
+  This String class provides base functionality for C++ like Unicode
+  character array handling. The advantage of this class is that it
+  handles all the memory management for you - and it does it
+  more efficiently. If you assign a string to another string, the
   data of both strings are shared (without any copy operation or
   memory allocation) as long as you do not change the string. This class
-  stores also the length of the string, so that many operations are
-  faster as the C-str-functions.
+  also stores the length of the string, so that many operations are
+  faster than the C-str-functions.
 
-  This class provide only readonly string handling. So you could create
+  This class provides only readonly string handling. So you could create
   a string and you could only query the content from this string.
-  It provide also functionality to change the string, but this results
-  in every case in a new string instance (in the most cases with an
+  It provides also functionality to change the string, but this results
+  in every case in a new string instance (in the most cases with a
   memory allocation). You don't have functionality to change the
-  content of the string. If you want change the string content, than
-  you should us the OStringBuffer class, which provide these
-  functionality and avoid to much memory allocation.
+  content of the string. If you want to change the string content, then
+  you should use the OStringBuffer class, which provides these
+  functionalities and avoids too much memory allocation.
 
-  The design of this class is similar to the string classes in Java
-  and so more people should have fewer understanding problems when they
-  use this class.
+  The design of this class is similar to the string classes in Java so
+  less people should have understanding problems when they use this class.
 */
 
 class SAL_WARN_UNUSED OUString
@@ -165,8 +164,8 @@ public:
 
   @paramvalue   a Unicode character array.
   @paramlength  the number of character which should be copied.
-The character array length must be greater or
-equal than this value.
+The character array length must be greater than
+or equal to this value.
 */
 OUString( const sal_Unicode * value, sal_Int32 length ) SAL_THROW(())
 {
@@ -258,15 +257,15 @@ public:
 #endif
 
 /**
-  New string from a 8-Bit character buffer array.
+  New string from an 8-Bit character buffer array.
 
-  @paramvalue   a 8-Bit character array.
-  @paramlength  the number of character which should be 
converted.
+  @paramvalue   An 8-Bit character array.
+  @paramlength  The number of character which should be 
converted.
 The 8-Bit character array length must be
-greater or equal than this value.
-  @paramencodingthe text encoding from which the 8-Bit 
character
+greater than or equal to this value.
+  @paramencodingThe text encoding from which the 8-Bit 
character
 sequence should be converted.
-  @paramconvertFlagsflags which controls the conversion.
+  @paramconvertFlagsFlags which control the conversion.
 see RTL_TEXTTOUNICODE_FLAGS_...
 
   @exception std::bad_alloc is thrown if an out-of-memory condition occurs
@@ -403,11 +402,11 @@ public:
 }
 
 /**
-  Returns a pointer to the Unicode character buffer from this string.
+  Returns a pointer to the Unicode character buffer for this string.
 
   It isn't necessarily NULL terminated.
 
-  @return   a pointer to the Unicode characters buffer from this object.
+  @return   a pointer to the Unicode characters buffer for this object.
 */
 const sal_Unicode * getStr() 

[Libreoffice-commits] .: sal/inc

2012-12-03 Thread Libreoffice Gerrit user
 sal/inc/sal/types.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2b1c49001a7889d1552b599d83af26ffee892201
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Tue Dec 4 01:04:10 2012 -0600

mac gcc 4.0.1 does not support __attribute((warn_unused_result)) very well

Change-Id: Ie8a6a06cd923192891453c9291f37709dfc15079

diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h
index 53d1645..bc9b2ef 100644
--- a/sal/inc/sal/types.h
+++ b/sal/inc/sal/types.h
@@ -310,7 +310,7 @@ typedef void *   sal_Handle;
 Compilers that support a construct of this nature will emit a compile
 time warning on unchecked return value.
 */
-#if defined(__GNUC__)
+#if (__GNUC__  4 || (__GNUC__ == 4  __GNUC_MINOR__ = 1))
 #   define SAL_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
 #else
 #   define SAL_WARN_UNUSED_RESULT
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-12-01 Thread Libreoffice Gerrit user
 sal/inc/rtl/ustrbuf.hxx |2 +-
 sal/qa/rtl/strings/test_oustring_stringliterals.cxx |1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 10cecb81dbd897aaea5188c9249770877ac20771
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Fri Nov 30 20:24:18 2012 -0600

OUStringBuffer constructor from OUStringBuffer should use const arg

Change-Id: I9f9e072c0a7ebde2de9be811f2378143b2b7abc6
Reviewed-on: https://gerrit.libreoffice.org/1209
Reviewed-by: Luboš Luňák l.lu...@suse.cz
Tested-by: Luboš Luňák l.lu...@suse.cz

diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index d8db905..6338dd1 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -409,7 +409,7 @@ public:
 
 @since LibreOffice 4.0
  */
-OUStringBuffer  append(OUStringBuffer str)
+OUStringBuffer  append(const OUStringBuffer str)
 {
 if(str.getLength()  0)
 {
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx 
b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
index e02bd93..09b55c6 100644
--- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
@@ -181,7 +181,6 @@ void test::oustring::StringLiterals::checkBuffer()
 buf.insert( 3, baz );
 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-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-11-21 Thread Libreoffice Gerrit user
 sal/inc/rtl/ustrbuf.hxx |   66 
 1 file changed, 66 insertions(+)

New commits:
commit 95841e1393868f0fa7d015b31accea960d35a7b6
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Mon Nov 19 22:34:58 2012 -0600

add strip* Family of function to OUStringBuffer

Change-Id: I225f95601009704c93484b6a68a0efd2446d4b48
Reviewed-on: https://gerrit.libreoffice.org/1140
Reviewed-by: Luboš Luňák l.lu...@suse.cz
Tested-by: Norbert Thiebaud nthieb...@gmail.com
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 201e790..a82a30b 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -1102,6 +1102,72 @@ public:
 pData-buffer, pData-length, literal, 
internal::ConstCharArrayDetector T, void ::size - 1);
 }
 
+/**
+   Strip the given character from the start of the buffer.
+
+   @since LibreOffice 4.0
+
+   @paramc the character to strip
+   @return   The number of characters stripped
+
+*/
+sal_Int32 stripStart(sal_Unicode c = (sal_Unicode)' ')
+{
+sal_Int32 index;
+for(index = 0; index  getLength() ; index++)
+{
+if(pData-buffer[ index ] != c)
+{
+break;
+}
+}
+if(index)
+{
+remove(0, index);
+}
+return index;
+}
+
+/**
+   Strip the given character from the end of the buffer.
+
+   @since LibreOffice 4.0
+
+   @paramc the character to strip
+   @return   The number of characters stripped
+
+*/
+sal_Int32 stripEnd(sal_Unicode c = (sal_Unicode)' ')
+{
+sal_Int32 result = getLength();
+sal_Int32 index;
+for(index = getLength(); index  0 ; index--)
+{
+if(pData-buffer[ index - 1 ] != c)
+{
+break;
+}
+}
+if(index  getLength())
+{
+remove(index);
+}
+return result - getLength();
+}
+/**
+   Strip the given character from the both end of the buffer.
+
+   @since LibreOffice 4.0
+
+   @paramc the character to strip
+   @return   The number of characters stripped
+
+*/
+sal_Int32 strip(sal_Unicode c = (sal_Unicode)' ')
+{
+return stripStart(c) + stripEnd(c);
+}
+
 private:
 /**
 A pointer to the data structur which contains the data.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-11-21 Thread Libreoffice Gerrit user
 sal/inc/rtl/ustrbuf.hxx |   20 
 1 file changed, 20 insertions(+)

New commits:
commit bf246fce77cdfac7e031d93a912d0bf2071a6e5e
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Mon Nov 19 22:34:35 2012 -0600

a replace() to OUStringBuffer

Change-Id: I2cbfeea9800ad656c49ce1cae7ff1f4b830f1442
Reviewed-on: https://gerrit.libreoffice.org/1139
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com
Tested-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index a82a30b..25195f1 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -924,6 +924,26 @@ public:
 return *this;
 }
 
+/**
+   Replace all occurrences of
+   oldChar in this string buffer with newChar.
+
+   @since LibreOffice 4.0
+
+   @paramoldChar the old character.
+   @paramnewChar the new character.
+   @return   this string buffer
+*/
+OUStringBuffer replace( sal_Unicode oldChar, sal_Unicode newChar )
+{
+sal_Int32 index = 0;
+while((index = indexOf(oldChar, index)) = 0)
+{
+pData-buffer[ index ] = newChar;
+}
+return *this;
+}
+
 /** Allows access to the internal data of this OUStringBuffer, for 
effective
 manipulation.
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-11-15 Thread Libreoffice Gerrit user
 sal/inc/osl/file.hxx|1 -
 sal/inc/rtl/byteseq.hxx |1 -
 sal/inc/rtl/string.hxx  |1 -
 sal/inc/rtl/ustring.hxx |1 -
 sal/osl/unx/nlsupport.c |1 -
 sal/osl/w32/pipe.c  |1 -
 6 files changed, 6 deletions(-)

New commits:
commit 5e6401ffc58959394e2e06bd7ed68e6d03cae31f
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Nov 15 10:42:28 2012 +0100

Drop obsolete includes of deprecated rtl/memory.h

Change-Id: I532558f5502898e036e01d64faa854c68e7109c9

diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx
index 6b9522d..e47b342 100644
--- a/sal/inc/osl/file.hxx
+++ b/sal/inc/osl/file.hxx
@@ -36,7 +36,6 @@
 #include cassert
 
 #include osl/time.h
-#include rtl/memory.h
 #include rtl/ustring.hxx
 
 #include osl/file.h
diff --git a/sal/inc/rtl/byteseq.hxx b/sal/inc/rtl/byteseq.hxx
index 852670e..6402c84 100644
--- a/sal/inc/rtl/byteseq.hxx
+++ b/sal/inc/rtl/byteseq.hxx
@@ -31,7 +31,6 @@
 #include osl/interlck.h
 #include rtl/byteseq.h
 #include rtl/alloc.h
-#include rtl/memory.h
 
 #if ! defined EXCEPTIONS_OFF
 #include new
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index a2aacb2..c7dd48e 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -35,7 +35,6 @@
 #include ostream
 
 #include osl/diagnose.h
-#include rtl/memory.h
 #include rtl/textenc.h
 #include rtl/string.h
 #include rtl/stringutils.hxx
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index bbd6e96..2489e3c 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -38,7 +38,6 @@
 #include rtl/ustring.h
 #include rtl/string.hxx
 #include rtl/stringutils.hxx
-#include rtl/memory.h
 #include rtl/textenc.h
 #include sal/log.hxx
 
diff --git a/sal/osl/unx/nlsupport.c b/sal/osl/unx/nlsupport.c
index da25a38..c276cb8 100644
--- a/sal/osl/unx/nlsupport.c
+++ b/sal/osl/unx/nlsupport.c
@@ -29,7 +29,6 @@
 #include osl/nlsupport.h
 #include osl/diagnose.h
 #include osl/process.h
-#include rtl/memory.h
 
 #if defined(LINUX) || defined(SOLARIS) || defined(NETBSD) || \
 defined(FREEBSD) || defined(MACOSX)  || defined(IOS) || defined(OPENBSD) 
|| \
diff --git a/sal/osl/w32/pipe.c b/sal/osl/w32/pipe.c
index 3a9f110..1ddd776 100644
--- a/sal/osl/w32/pipe.c
+++ b/sal/osl/w32/pipe.c
@@ -40,7 +40,6 @@
 #include osl/process.h
 
 #include rtl/alloc.h
-#include rtl/memory.h
 
 #define PIPESYSTEM  .\\pipe\\
 #define PIPEPREFIXOSL_PIPE_
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-11-15 Thread Libreoffice Gerrit user
 sal/inc/osl/interlck.h |4 
 sal/inc/sal/config.h   |2 --
 2 files changed, 6 deletions(-)

New commits:
commit 6adc24cd861cdde45d8f55943a836246470fa72c
Author: Luboš Luňák l.lu...@suse.cz
Date:   Thu Nov 15 18:07:06 2012 +0100

Revert use intrinsict to inline InterlockCount() on Windows too

This reverts commit 5ae27819974e3492b6f4d33fa51ef2a9d77b5ce5.

The commit breaks smoketest on Windows, for reasons unknown:

C:/cygwin/home/tinderbox/tinderbox-master-build-libreoffice/smoketest/smoketest.cxx(197)
 : error : Assertion
Test name: `anonymous namespace'::Test::test
assertion failed
- Expression: connection_.isStillAlive()

I can't see why the commit should matter, given that the functions
should be equivalent according to my reading of the docs. And debugging
this on Windows is pain squared, so I can't even figure out what is
going wrong where. Feel free to try your luck.

Note that when debugging this, the code triggering this seems to be
run only if SOLAR_JAVA and JAVA_HOME are set, so 'make verbose=t'
and running just the command without this hides the problem.

diff --git a/sal/inc/osl/interlck.h b/sal/inc/osl/interlck.h
index 22ff985..792ea55 100644
--- a/sal/inc/osl/interlck.h
+++ b/sal/inc/osl/interlck.h
@@ -67,8 +67,6 @@ SAL_DLLPUBLIC oslInterlockedCount SAL_CALL 
osl_decrementInterlockedCount(oslInte
 */
 #if defined( HAVE_GCC_BUILTIN_ATOMIC )
 #define osl_atomic_increment(p)  __sync_add_and_fetch((p), 1)
-#elif defined( _MSC_VER )
-#define osl_atomic_increment(p) _InterlockedIncrement((p))
 #else
 #define osl_atomic_increment(p) osl_incrementInterlockedCount((p))
 #endif
@@ -86,8 +84,6 @@ SAL_DLLPUBLIC oslInterlockedCount SAL_CALL 
osl_decrementInterlockedCount(oslInte
 */
 #if defined( HAVE_GCC_BUILTIN_ATOMIC )
 #define osl_atomic_decrement(p) __sync_sub_and_fetch((p), 1)
-#elif defined( _MSC_VER )
-#define osl_atomic_decrement(p) _InterlockedDecrement((p))
 #else
 #define osl_atomic_decrement(p) osl_decrementInterlockedCount((p))
 #endif
diff --git a/sal/inc/sal/config.h b/sal/inc/sal/config.h
index e81250a..aee8e82 100644
--- a/sal/inc/sal/config.h
+++ b/sal/inc/sal/config.h
@@ -44,8 +44,6 @@
 
 #ifdef _MSC_VER
 
-#include Intrin.h // define intrinsic functions supported by the compiler
-
 #ifndef _USE_MATH_DEFINES
 #define _USE_MATH_DEFINES // needed by Visual C++ for math constants
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-11-14 Thread Libreoffice Gerrit user
 sal/inc/rtl/string.hxx  |1 +
 sal/qa/rtl/strings/test_strings_replace.cxx |3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 4c4a95946b5c067f8e1ebdd3589f282380cc430f
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Nov 14 12:26:08 2012 +0100

Include clean-up

Change-Id: Ice3b97269640c0d739e5b4f4b27a0e07fc854f9f

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index e45b837..a2aacb2 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -32,6 +32,7 @@
 #include sal/config.h
 
 #include cassert
+#include ostream
 
 #include osl/diagnose.h
 #include rtl/memory.h
diff --git a/sal/qa/rtl/strings/test_strings_replace.cxx 
b/sal/qa/rtl/strings/test_strings_replace.cxx
index a46245f..101dc67 100644
--- a/sal/qa/rtl/strings/test_strings_replace.cxx
+++ b/sal/qa/rtl/strings/test_strings_replace.cxx
@@ -26,7 +26,8 @@
  * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
  * instead of those above.
  */
-#include ostream
+
+#include sal/config.h
 
 #include sal/types.h
 #include cppunit/TestAssert.h
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-11-14 Thread Libreoffice Gerrit user
 sal/inc/rtl/memory.h |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit ed80674ec793f640916ad4162ee4121aeceac7f6
Author: Arnaud Versini arnaud.vers...@gmail.com
Date:   Wed Oct 10 20:31:32 2012 +0200

Mark rtl_*memory as deprecated

Change-Id: I0e5e85d6b23961baa9ef3ed4247e39497bb063d7
Reviewed-on: https://gerrit.libreoffice.org/865
Reviewed-by: Niko Rönkkö ron...@iki.fi
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com
Tested-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/sal/inc/rtl/memory.h b/sal/inc/rtl/memory.h
index 0104b78..0dfb79c 100644
--- a/sal/inc/rtl/memory.h
+++ b/sal/inc/rtl/memory.h
@@ -39,11 +39,17 @@
 extern C {
 #endif
 
+SAL_DEPRECATED(Use memset instead)
 SAL_DLLPUBLIC void SAL_CALL rtl_zeroMemory(void *Ptr, sal_Size Bytes);
+SAL_DEPRECATED(Use memset instead)
 SAL_DLLPUBLIC void SAL_CALL rtl_fillMemory(void *Ptr, sal_Size Bytes, 
sal_uInt8 Fill);
+SAL_DEPRECATED(Use memcpy instead)
 SAL_DLLPUBLIC void SAL_CALL rtl_copyMemory(void *Dst, const void *Src, 
sal_Size Bytes);
+SAL_DEPRECATED(Use memmove instead)
 SAL_DLLPUBLIC void SAL_CALL rtl_moveMemory(void *Dst, const void *Src, 
sal_Size Bytes);
+SAL_DEPRECATED(Use memcmp instead)
 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_compareMemory(const void *MemA, const 
void *MemB, sal_Size Bytes);
+SAL_DEPRECATED(Use memchr instead)
 SAL_DLLPUBLIC void* SAL_CALL rtl_findInMemory(const void *MemA, sal_uInt8 ch, 
sal_Size Bytes);
 
 #ifdef __cplusplus
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-11-12 Thread Libreoffice Gerrit user
 sal/inc/osl/diagnose.hxx  |6 ++
 sal/osl/all/debugbase.cxx |5 +
 2 files changed, 3 insertions(+), 8 deletions(-)

New commits:
commit a9966a47409a0149d936ba2a2650bc20cc52cce2
Author: Tor Lillqvist tlillqv...@suse.com
Date:   Mon Nov 12 15:18:58 2012 +0200

WaE: C-linkage specified, but returns user-defined type

Clang says: 'osl_detail_ObjectRegistry_getMutex' has C-linkage
specified, but returns user-defined type '::osl::Mutex ' which is
incompatible with C.

Let's continue disabling that warning also also in 4.0 and later.

Change-Id: I892bdc7e7aa6d546adf6b1c388e4c149db738948

diff --git a/sal/inc/osl/diagnose.hxx b/sal/inc/osl/diagnose.hxx
index 2c7e8c0..7ae1554 100644
--- a/sal/inc/osl/diagnose.hxx
+++ b/sal/inc/osl/diagnose.hxx
@@ -76,7 +76,6 @@ SAL_DLLPUBLIC void SAL_CALL 
osl_detail_ObjectRegistry_revokeObject(
 
 // These functions presumably should not be extern C, but changing
 // that would break binary compatibility.
-#if SUPD  400
 #ifdef __clang__
 #pragma clang diagnostic push
 // Guard against slightly older clang versions that don't have
@@ -84,14 +83,13 @@ SAL_DLLPUBLIC void SAL_CALL 
osl_detail_ObjectRegistry_revokeObject(
 #pragma clang diagnostic ignored -Wunknown-pragmas
 #pragma clang diagnostic ignored -Wreturn-type-c-linkage
 #endif
-#endif
+
 SAL_DLLPUBLIC ::osl::Mutex  SAL_CALL osl_detail_ObjectRegistry_getMutex()
 SAL_THROW_EXTERN_C();
-#if SUPD  400
+
 #ifdef __clang__
 #pragma clang diagnostic pop
 #endif
-#endif
 
 } // extern C
 
diff --git a/sal/osl/all/debugbase.cxx b/sal/osl/all/debugbase.cxx
index 3b468fa..02e86b7 100644
--- a/sal/osl/all/debugbase.cxx
+++ b/sal/osl/all/debugbase.cxx
@@ -83,7 +83,6 @@ extern C {
 
 // These functions presumably should not be extern C, but changing
 // that would break binary compatibility.
-#if SUPD  400
 #ifdef __clang__
 #pragma clang diagnostic push
 // Guard against slightly older clang versions that don't have
@@ -91,17 +90,15 @@ extern C {
 #pragma clang diagnostic ignored -Wunknown-pragmas
 #pragma clang diagnostic ignored -Wreturn-type-c-linkage
 #endif
-#endif
+
 osl::Mutex  SAL_CALL osl_detail_ObjectRegistry_getMutex()
 SAL_THROW_EXTERN_C()
 {
 return DebugBaseMutex::get();
 }
-#if SUPD  400
 #ifdef __clang__
 #pragma clang diagnostic pop
 #endif
-#endif
 
 bool SAL_CALL osl_detail_ObjectRegistry_storeAddresses( char const* pName )
 SAL_THROW_EXTERN_C()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc sal/qa sdext/source unodevtools/source

2012-11-10 Thread Libreoffice Gerrit user
 sal/inc/rtl/string.hxx  |   14 +++
 sal/qa/rtl/strings/test_strings_replace.cxx |   12 --
 sdext/source/pdfimport/test/tests.cxx   |   10 --
 unodevtools/source/skeletonmaker/cppcompskeleton.cxx|1 
 unodevtools/source/skeletonmaker/cpptypemaker.cxx   |1 
 unodevtools/source/skeletonmaker/javacompskeleton.cxx   |1 
 unodevtools/source/skeletonmaker/javatypemaker.cxx  |1 
 unodevtools/source/skeletonmaker/ostringostreaminserter.hxx |   49 
 unodevtools/source/skeletonmaker/skeletoncommon.cxx |1 
 unodevtools/source/skeletonmaker/skeletonmaker.cxx  |1 
 10 files changed, 14 insertions(+), 77 deletions(-)

New commits:
commit 26364f4fd346c36f2c3ba4c2228d62de845fe13e
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Nov 10 10:48:15 2012 +0100

deduplicate OString std::basic_ostream operators

I wanted to add one, based on OUString one, and Stephan on IRC agreed
it's a good idea. Then it turned out we already had it in sal unit
tests, sdext and unodevtools as well. Get rid of all these, and have a
single implementation in string.hxx, so it can be used everywhere.

Change-Id: Ibb820f20a138d055fd87036253c627fb862a31fe

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index a135d4e..e45b837 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -1479,6 +1479,20 @@ struct OStringHash
 
 /* === */
 
+/**
+Support for rtl::OString in std::ostream (and thus in
+CPPUNIT_ASSERT or SAL_INFO macros, for example).
+
+@since LibreOffice 3.7
+ */
+template typename charT, typename traits  std::basic_ostreamcharT, traits 
+operator (
+std::basic_ostreamcharT, traits  stream, rtl::OString const  string)
+{
+return stream  string.getStr();
+// best effort; potentially loses data due to embedded null characters
+}
+
 } /* Namespace */
 
 #ifdef RTL_USING
diff --git a/sal/qa/rtl/strings/test_strings_replace.cxx 
b/sal/qa/rtl/strings/test_strings_replace.cxx
index 5e1b0cf..a46245f 100644
--- a/sal/qa/rtl/strings/test_strings_replace.cxx
+++ b/sal/qa/rtl/strings/test_strings_replace.cxx
@@ -37,18 +37,6 @@
 #include rtl/ustring.h
 #include rtl/ustring.hxx
 
-namespace rtl {
-
-template typename charT, typename traits  std::basic_ostreamcharT, traits 
-operator (
-std::basic_ostreamcharT, traits  stream, rtl::OString const  string)
-{
-return stream  string.getStr();
-// best effort; potentially loses data due to embedded null characters
-}
-
-}
-
 namespace {
 
 class Test: public CppUnit::TestFixture {
diff --git a/sdext/source/pdfimport/test/tests.cxx 
b/sdext/source/pdfimport/test/tests.cxx
index a452ba0..5475619 100644
--- a/sdext/source/pdfimport/test/tests.cxx
+++ b/sdext/source/pdfimport/test/tests.cxx
@@ -72,16 +72,6 @@ using namespace ::pdfparse;
 using namespace ::pdfi;
 using namespace ::com::sun::star;
 
-namespace rtl
-{
-template typename charT, typename traits  std::basic_ostreamcharT, 
traits 
-operator (
-std::basic_ostreamcharT, traits  stream, rtl::OString const 
 string)
-{
-return stream  string.getStr();
-}
-}
-
 namespace
 {
 
diff --git a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx 
b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
index f274456..21dec5f 100644
--- a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
+++ b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
@@ -19,7 +19,6 @@
 
 #include codemaker/commoncpp.hxx
 
-#include ostringostreaminserter.hxx
 #include skeletoncommon.hxx
 #include skeletoncpp.hxx
 
diff --git a/unodevtools/source/skeletonmaker/cpptypemaker.cxx 
b/unodevtools/source/skeletonmaker/cpptypemaker.cxx
index 61f91d3..b66a049 100644
--- a/unodevtools/source/skeletonmaker/cpptypemaker.cxx
+++ b/unodevtools/source/skeletonmaker/cpptypemaker.cxx
@@ -19,7 +19,6 @@
 
 #include codemaker/commoncpp.hxx
 
-#include ostringostreaminserter.hxx
 #include skeletoncommon.hxx
 #include skeletoncpp.hxx
 
diff --git a/unodevtools/source/skeletonmaker/javacompskeleton.cxx 
b/unodevtools/source/skeletonmaker/javacompskeleton.cxx
index 4f09fc7..772a55a 100644
--- a/unodevtools/source/skeletonmaker/javacompskeleton.cxx
+++ b/unodevtools/source/skeletonmaker/javacompskeleton.cxx
@@ -19,7 +19,6 @@
 
 #include codemaker/commonjava.hxx
 
-#include ostringostreaminserter.hxx
 #include skeletoncommon.hxx
 #include skeletonjava.hxx
 
diff --git a/unodevtools/source/skeletonmaker/javatypemaker.cxx 
b/unodevtools/source/skeletonmaker/javatypemaker.cxx
index c60f621..96870f5 100644
--- a/unodevtools/source/skeletonmaker/javatypemaker.cxx
+++ b/unodevtools/source/skeletonmaker/javatypemaker.cxx
@@ -19,7 +19,6 @@
 
 #include codemaker/commonjava.hxx
 
-#include ostringostreaminserter.hxx
 #include skeletoncommon.hxx
 

[Libreoffice-commits] .: sal/inc

2012-11-09 Thread Libreoffice Gerrit user
 sal/inc/rtl/ustrbuf.hxx |  156 
 1 file changed, 156 insertions(+)

New commits:
commit c61a3ff06e57c7c324e69419aaed0f92b37befd0
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Thu Nov 8 11:01:33 2012 -0600

add indexOf family of function to OUStringBuffer

it is fairly common when converting String to OUString
to find code that search for thing and replace/delete
these things... the later need OUStringBuffer, the former
OUString.
This add the search feature provided by the indexOf family
of function found in OUString, into OUStringBuffer

Change-Id: I2de818e6317a94ed520f338ebc9ed08d5f17765c

diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 426d129..8400ac9 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -941,6 +941,162 @@ public:
 *pInternalCapacity = nCapacity;
 }
 
+
+/**
+   Returns the index within this string of the first occurrence of the
+   specified character, starting the search at the specified index.
+
+   @since LibreOffice 4.0
+
+   @paramch  character to be located.
+   @paramfromIndex   the index to start the search from.
+ The index must be greater or equal than 0
+ and less or equal as the string length.
+   @return   the index of the first occurrence of the character in the
+ character sequence represented by this string that is
+ greater than or equal to fromIndex, or
+ -1 if the character does not occur.
+*/
+sal_Int32 indexOf( sal_Unicode ch, sal_Int32 fromIndex = 0 ) const 
SAL_THROW(())
+{
+sal_Int32 ret = rtl_ustr_indexOfChar_WithLength( 
pData-buffer+fromIndex, pData-length-fromIndex, ch );
+return (ret  0 ? ret : ret+fromIndex);
+}
+
+/**
+   Returns the index within this string of the last occurrence of the
+   specified character, searching backward starting at the end.
+
+   @since LibreOffice 4.0
+
+   @paramch  character to be located.
+   @return   the index of the last occurrence of the character in the
+ character sequence represented by this string, or
+ -1 if the character does not occur.
+*/
+sal_Int32 lastIndexOf( sal_Unicode ch ) const SAL_THROW(())
+{
+return rtl_ustr_lastIndexOfChar_WithLength( pData-buffer, 
pData-length, ch );
+}
+
+/**
+   Returns the index within this string of the last occurrence of the
+   specified character, searching backward starting before the specified
+   index.
+
+   @since LibreOffice 4.0
+
+   @paramch  character to be located.
+   @paramfromIndex   the index before which to start the search.
+   @return   the index of the last occurrence of the character in the
+ character sequence represented by this string that
+ is less than fromIndex, or -1
+ if the character does not occur before that point.
+*/
+sal_Int32 lastIndexOf( sal_Unicode ch, sal_Int32 fromIndex ) const 
SAL_THROW(())
+{
+return rtl_ustr_lastIndexOfChar_WithLength( pData-buffer, fromIndex, 
ch );
+}
+
+/**
+   Returns the index within this string of the first occurrence of the
+   specified substring, starting at the specified index.
+
+   If str doesn't include any character, always -1 is
+   returned. This is also the case, if both strings are empty.
+
+   @since LibreOffice 4.0
+
+   @paramstr the substring to search for.
+   @paramfromIndex   the index to start the search from.
+   @return   If the string argument occurs one or more times as a substring
+ within this string at the starting index, then the index
+ of the first character of the first such substring is
+ returned. If it does not occur as a substring starting
+ at fromIndex or beyond, -1 is returned.
+*/
+sal_Int32 indexOf( const OUString  str, sal_Int32 fromIndex = 0 ) const 
SAL_THROW(())
+{
+sal_Int32 ret = rtl_ustr_indexOfStr_WithLength( 
pData-buffer+fromIndex, pData-length-fromIndex,
+str.pData-buffer, 
str.pData-length );
+return (ret  0 ? ret : ret+fromIndex);
+}
+
+/**
+   @overload
+   This function accepts an ASCII string literal as its argument.
+
+   @since LibreOffice 4.0
+*/
+template typename T 
+typename internal::ConstCharArrayDetector T, sal_Int32 ::Type indexOf( 
T literal, sal_Int32 fromIndex = 0 ) const SAL_THROW(())
+{
+sal_Int32 ret = rtl_ustr_indexOfAscii_WithLength(
+pData-buffer + fromIndex, pData-length - fromIndex, literal,
+internal::ConstCharArrayDetector T, void ::size - 1);

[Libreoffice-commits] .: sal/inc xmlsecurity/source

2012-11-07 Thread Libreoffice Gerrit user
 sal/inc/sal/log-areas.dox |2 
 xmlsecurity/source/xmlsec/nss/nssinitializer.cxx  |   23 --
 xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx |7 ++-
 3 files changed, 25 insertions(+), 7 deletions(-)

New commits:
commit 14800ce5f2a23ab45b01a631b9253f7f6f3a7ce5
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Nov 7 16:55:20 2012 +0100

Improve logging

Change-Id: I5ff457c76970356a5748f6f319f32a1f49b86ca1

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 4a603e9..0eadebb 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -200,6 +200,7 @@ certain functionality.
 @section xmlsecurity
 
 @li @c xmlsecurity.dialogs - xml security dialogs
+@li @c xmlsecurity.xmlsec - xmlsec wrapper
 
 @section other
 
@@ -227,7 +228,6 @@ certain functionality.
 @li @c xmlhelp
 @li @c xmloff
 @li @c xmlreader
-@li @c xmlsecurity
 
 */
 /* vim:set ft=cpp shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx 
b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
index a694c3f..a1c01d3 100644
--- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
+++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
@@ -53,7 +53,7 @@
 #include rtl/strbuf.hxx
 #include osl/file.hxx
 #include osl/thread.h
-#include rtl/logfile.hxx
+#include sal/log.hxx
 
 #include seinitializer_nssimpl.hxx
 #include ../diagnose.hxx
@@ -172,7 +172,12 @@ void deleteRootsModule()
 // first, try to get the profile from MOZILLA_CERTIFICATE_FOLDER
 const char* pEnv = getenv(MOZILLA_CERTIFICATE_FOLDER);
 if (pEnv)
+{
+SAL_INFO(
+xmlsecurity.xmlsec,
+Using Mozilla profile from MOZILLA_CERTIFICATE_FOLDER=  pEnv);
 return rtl::OString(pEnv);
+}
 
 // second, try to get saved user-preference
 try
@@ -181,11 +186,19 @@ void deleteRootsModule()
 
officecfg::Office::Common::Security::Scripting::CertDir::get().get_value_or(rtl::OUString());
 
 if (!sUserSetCertPath.isEmpty())
+{
+SAL_INFO(
+xmlsecurity.xmlsec,
+Using Mozilla profile from /org.openoffice.Office.Common/
+Security/Scripting/CertDir:   sUserSetCertPath);
 return rtl::OUStringToOString(sUserSetCertPath, 
osl_getThreadTextEncoding());
+}
 }
 catch (const uno::Exception e)
 {
-SAL_WARN(xmlsecurity, getMozillaCurrentProfile: caught exception 
 e.Message);
+SAL_WARN(
+xmlsecurity.xmlsec,
+getMozillaCurrentProfile: caught exception   e.Message);
 }
 
 // third, dig around to see if there's one available
@@ -211,13 +224,15 @@ void deleteRootsModule()
 if (!profile.isEmpty())
 {
 rtl::OUString sProfilePath = 
xMozillaBootstrap-getProfilePath( productTypes[i], profile );
+SAL_INFO(
+xmlsecurity.xmlsec,
+Using Mozilla profile   sProfilePath);
 return rtl::OUStringToOString(sProfilePath, 
osl_getThreadTextEncoding());
 }
 }
 }
 
-RTL_LOGFILE_PRODUCT_TRACE( XMLSEC: No Mozilla Profile found! );
-
+SAL_INFO(xmlsecurity.xmlsec, No Mozilla profile found);
 return rtl::OString();
 }
 
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx 
b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index 581663b..33a1ea3 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -45,7 +45,7 @@
 #include cppuhelper/servicefactory.hxx
 #include comphelper/docpasswordrequest.hxx
 #include xmlsecurity/biginteger.hxx
-#include rtl/logfile.h
+#include sal/log.hxx
 #include com/sun/star/task/InteractionHandler.hpp
 #include vector
 #include boost/scoped_array.hpp
@@ -444,7 +444,10 @@ void SecurityEnvironment_NssImpl::updateSlots()
 
 if(pSlot != NULL)
 {
-RTL_LOGFILE_TRACE2( XMLSEC: Found a slot: SlotName=%s, 
TokenName=%s, PK11_GetSlotName(pSlot), PK11_GetTokenName(pSlot) );
+SAL_INFO(
+xmlsecurity.xmlsec,
+Found a slot: SlotName=  PK11_GetSlotName(pSlot)
+ , TokenName=  PK11_GetTokenName(pSlot));
 
 //The following code which is commented out checks if a slot, that is a smart 
card for example, is
 //  able to generate a symmetric key of type CKM_DES3_CBC. If this 
fails then this token
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-11-03 Thread Libreoffice Gerrit user
 sal/inc/sal/log-areas.dox |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit ea9a335084785349ca87bbcd0a43dc3b4f7724ed
Author: Miklos Vajna vmik...@suse.cz
Date:   Sat Nov 3 18:07:50 2012 +0100

document writerfilter.profile log area

Change-Id: I882de51f0605c4556d97b735fa3e85f686799c61

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index b6af6f8..4a603e9 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -185,6 +185,11 @@ certain functionality.
 @li @c sw.ww8 - .doc/.docx export filter, .doc import filter (not writerfilter)
 @li @c sw.ww8.level2 - further info for sw.ww8
 
+@section writerfilter
+
+@li @c writerfilter
+@li @c writerfilter.profile - load times of filters
+
 @section xmloff
 
 @li @c xmloff.core
@@ -219,7 +224,6 @@ certain functionality.
 @li @c stoc
 @li @c svx
 @li @c ucbhelper
-@li @c writerfilter
 @li @c xmlhelp
 @li @c xmloff
 @li @c xmlreader
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc sd/source

2012-11-02 Thread Libreoffice Gerrit user
 sal/inc/sal/log-areas.dox   |1 +
 sd/source/filter/html/HtmlOptionsDialog.cxx |4 +---
 sd/source/filter/html/htmlex.cxx|8 +---
 3 files changed, 3 insertions(+), 10 deletions(-)

New commits:
commit 61128761b27beea9d6f550d8eaa23eefa2750108
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Nov 2 08:24:23 2012 +

loplugin: unused UniStrings

Change-Id: Ia6a10bf30685f25a13c091f04566c62888524c94

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 54597a5..777994e 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -59,6 +59,7 @@ certain functionality.
 
 @section Draw
 
+@li @c sd
 @li @c sd.fwk
 @li @c sd.sls
 @li @c sd.tools
diff --git a/sd/source/filter/html/HtmlOptionsDialog.cxx 
b/sd/source/filter/html/HtmlOptionsDialog.cxx
index bc39ae8..cf2f9e4 100644
--- a/sd/source/filter/html/HtmlOptionsDialog.cxx
+++ b/sd/source/filter/html/HtmlOptionsDialog.cxx
@@ -261,9 +261,7 @@ void SdHtmlOptionsDialog::setSourceDocument( const 
Reference XComponent  xDoc
 throw ( IllegalArgumentException, RuntimeException )
 {
 // try to set the corresponding metric unit
-String aConfigPath;
-Reference XServiceInfo  xServiceInfo
-( xDoc, UNO_QUERY );
+Reference XServiceInfo  xServiceInfo(xDoc, UNO_QUERY);
 if ( xServiceInfo.is() )
 {
 if ( xServiceInfo-supportsService( 
com.sun.star.presentation.PresentationDocument ) )
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index babb586..f63fb5e 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -877,7 +877,6 @@ void HtmlExport::ExportWebCast()
 
 CreateFileNames();
 
-String aEmpty;
 if(maCGIPath.Len() == 0)
 maCGIPath.Assign( sal_Unicode('.') );
 
@@ -890,7 +889,6 @@ void HtmlExport::ExportWebCast()
 }
 else
 {
-   String aEmpty2;
 if(maURLPath.Len() == 0)
 maURLPath.Assign( sal_Unicode('.') );
 
@@ -1858,9 +1856,6 @@ bool HtmlExport::CreateHtmlForPresPages()
 // =
 bool HtmlExport::CreateContentPage()
 {
-// Parameter
-String aEmpty;
-
 if( mbDocColors )
 SetDocColors();
 
@@ -2287,9 +2282,8 @@ bool HtmlExport::CreateFrames()
 
 if(mbNotes)
 {
-String aEmpty;
 String aSlash( RTL_CONSTASCII_USTRINGPARAM( // ) );
-aFunction.SearchAndReplaceAll( aSlash, aEmpty);
+aFunction.SearchAndReplaceAll(aSlash, OUString());
 }
 
 // substitute HTML file extension
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-11-02 Thread Libreoffice Gerrit user
 sal/inc/sal/log-areas.dox |1 
 sw/source/filter/ww8/WW8Sttbf.cxx |   10 ---
 sw/source/filter/ww8/WW8TableInfo.cxx |   91 +-
 sw/source/filter/ww8/rtfexport.cxx|   11 
 sw/source/filter/ww8/wrtw8nds.cxx |   13 +---
 sw/source/filter/ww8/wrtww8.cxx   |   74 ---
 sw/source/filter/ww8/ww8par.cxx   |4 -
 7 files changed, 56 insertions(+), 148 deletions(-)

New commits:
commit 091b9e46ece9bb94a67c8867e0d33f4e4bee6fad
Author: Luboš Luňák l.lu...@suse.cz
Date:   Fri Nov 2 19:18:57 2012 +0100

change std::clog debug output to SAL_INFO, so that it can be turned off

Change-Id: I92af860af6ac82302458cdd894f3ad038a863b49

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 777994e..b6af6f8 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -183,6 +183,7 @@ certain functionality.
 @li @c sw.rtf - .rtf export filter
 @li @c sw.uno - Writer UNO interfaces
 @li @c sw.ww8 - .doc/.docx export filter, .doc import filter (not writerfilter)
+@li @c sw.ww8.level2 - further info for sw.ww8
 
 @section xmloff
 
diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx 
b/sw/source/filter/ww8/WW8Sttbf.cxx
index 4280a0a..5762722 100644
--- a/sw/source/filter/ww8/WW8Sttbf.cxx
+++ b/sw/source/filter/ww8/WW8Sttbf.cxx
@@ -98,14 +98,8 @@ namespace ww8
 #endif
 }
 
-#if OSL_DEBUG_LEVEL  1
-char sBuffer[256];
-snprintf(sBuffer, sizeof(sBuffer), offset=\% SAL_PRIuUINT32 \ 
count=\% SAL_PRIuUINT32 \,
- nOffset, nCount);
-::std::clog  WW8Struct-getUString  sBuffer  
- rtl::OUStringToOString( aResult, RTL_TEXTENCODING_UTF8 
).getStr()  /WW8Struct-getUString
- ::std::endl;
-#endif
+SAL_INFO( sw.ww8.level2, WW8Struct-getUString   offset=\  
nOffset
+ \ count=\  nCount  \aResult  
/WW8Struct-getUString );
 
 return aResult;
 
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx 
b/sw/source/filter/ww8/WW8TableInfo.cxx
index 1a30749..c8b4636 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -393,8 +393,7 @@ void WW8TableNodeInfo::setEndOfLine(bool bEndOfLine)
 pInner-setEndOfLine(bEndOfLine);
 
 #ifdef DBG_UTIL
-::std::clog  endOfLine depth=\  mnDepth  \
- toString()  /endOfLine  ::std::endl;
+SAL_INFO( sw.ww8, endOfLine depth=\  mnDepth  \  
toString()  /endOfLine );
 #endif
 }
 
@@ -404,8 +403,7 @@ void WW8TableNodeInfo::setEndOfCell(bool bEndOfCell)
 pInner-setEndOfCell(bEndOfCell);
 
 #ifdef DBG_UTIL
-::std::clog  endOfCell depth=\  mnDepth  \
- toString()  /endOfCell  ::std::endl;
+SAL_INFO( sw.ww8, endOfCell depth=\  mnDepth  \  
toString()  /endOfCell );
 #endif
 }
 
@@ -416,8 +414,7 @@ void WW8TableNodeInfo::setFirstInTable(bool bFirstInTable)
 pInner-setFirstInTable(bFirstInTable);
 
 #ifdef DBG_UTIL
-::std::clog  firstInTable depth=\  mnDepth  \
- toString()  /firstInTable  ::std::endl;
+SAL_INFO( sw.ww8, firstInTable depth=\  mnDepth  \  
toString()  /firstInTable );
 #endif
 }
 
@@ -427,10 +424,8 @@ void WW8TableNodeInfo::setVertMerge(bool bVertMerge)
 
 pInner-setVertMerge(bVertMerge);
 
-
 #ifdef DBG_UTIL
-::std::clog  vertMerge depth=\  mnDepth  \
- toString()  /vertMerge  ::std::endl;
+SAL_INFO( sw.ww8, vertMerge depth=\  mnDepth  \  
toString()  /vertMerge );
 #endif
 }
 
@@ -449,9 +444,7 @@ void WW8TableNodeInfo::setNext(WW8TableNodeInfo * pNext)
 mpNext = pNext;
 
 #ifdef DBG_UTIL
-::std::clog  setnextfrom  toString()  /fromto
- pNext-toString()  /to/setnext
- ::std::endl;
+SAL_INFO( sw.ww8, setnextfrom  toString()  /fromto  
pNext-toString()  /to/setnext );
 #endif
 }
 
@@ -576,15 +569,9 @@ WW8TableInfo::processSwTableByLayout(const SwTable * 
pTable)
 {
 SwRect aRect = aTableCellInfo.getRect();
 
-#ifdef DBG_UTIL
-static char sBuffer[1024];
-::std::clog  CellFrm  ::std::endl;
-
-snprintf(sBuffer, sizeof(sBuffer),
- rect top=\%ld\ bottom=\%ld\ left=\%ld\ 
right=\%ld\/,
- aRect.Top(), aRect.Bottom(), aRect.Left(), aRect.Right());
-::std::clog  sBuffer  ::std::endl;
-#endif
+SAL_INFO( sw.ww8, CellFrm );
+SAL_INFO( sw.ww8, rect top=\  aRect.Top()  \ bottom=\  
aRect.Bottom()
+ \ left=\  aRect.Left()  \ right=\  aRect.Right() 
 \/ );
 const SwTableBox * pTableBox = aTableCellInfo.getTableBox();
 const SwStartNode * pSttNd = pTableBox-GetSttNd();
 
@@ -613,9 +600,7 @@ WW8TableInfo::processSwTableByLayout(const SwTable * pTable)
 while (!bDone);
 }
 
-#ifdef DBG_UTIL
-::std::clog  /CellFrm  ::std::endl;
-#endif
+SAL_INFO( sw.ww8, /CellFrm );
 }
 
 pPrev = reorderByLayout(pTable);
@@ -625,9 +610,7 @@ WW8TableInfo::processSwTableByLayout(const SwTable * 

[Libreoffice-commits] .: sal/inc

2012-11-02 Thread Libreoffice Gerrit user
 sal/inc/sal/mathconf.h |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 19bce817279c7fd150af0422c224975e57ff9f41
Author: Tor Lillqvist t...@iki.fi
Date:   Fri Nov 2 22:25:47 2012 +0200

Try to use isfinite() for iOS

Change-Id: Ia333afbefa4c112f478d2619efbe032e70925417

diff --git a/sal/inc/sal/mathconf.h b/sal/inc/sal/mathconf.h
index f92d8b4..5a49e0b 100644
--- a/sal/inc/sal/mathconf.h
+++ b/sal/inc/sal/mathconf.h
@@ -67,6 +67,8 @@ extern C {
   defined(__cplusplus) \
   ( defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus 
= 201103L )
 #define SAL_MATH_FINITE(d) std::isfinite(d)
+#elif defined( IOS )
+#define SAL_MATH_FINITE(d) isfinite(d)
 #elif defined( WNT)
 #define SAL_MATH_FINITE(d) _finite(d)
 #elif defined LINUX || defined UNX
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-10-26 Thread Libreoffice Gerrit user
 sal/inc/sal/log-areas.dox |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 7be49c34cdae0d942774e232d80528eecf94ac36
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Oct 26 17:16:25 2012 +0100

add svl.numbers to log-areas

Change-Id: I6b26f2805d08d2eb1b28ade459d38a1c6895addf

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 865d92c..c532e06 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -123,6 +123,11 @@ certain functionality.
 
 @li @c slideshow.opengl
 
+@section svl
+
+@li @c svl
+@li @c svl.numbers
+
 @section svtools
 
 @li @c svtools.config
@@ -208,7 +213,6 @@ certain functionality.
 @li @c rsc
 @li @c shell
 @li @c stoc
-@li @c svl
 @li @c svx
 @li @c ucbhelper
 @li @c writerfilter
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-10-26 Thread Libreoffice Gerrit user
 sal/inc/sal/log-areas.dox |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 65e2a0938b8854f859460493485d3d5f5304ac12
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Oct 26 20:42:17 2012 +0100

add generic sc/sw log categories

Change-Id: I64995db8f9e913db5f4ab4e81359dd163bc29d15

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index c532e06..54597a5 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -48,6 +48,7 @@ certain functionality.
 
 @section Calc
 
+@li @c sc
 @li @c sc.core
 @li @c sc.ui - Calc UI
 
@@ -176,6 +177,7 @@ certain functionality.
 
 @section Writer
 
+@li @c sw
 @li @c sw.core - Writer core
 @li @c sw.rtf - .rtf export filter
 @li @c sw.uno - Writer UNO interfaces
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-10-25 Thread Libreoffice Gerrit user
 sal/inc/sal/log-areas.dox |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 638bb3a63ecc8f50fe6d82b510221b771dbb1c83
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Oct 25 16:50:43 2012 +0100

add filter.xslt log area

Change-Id: Ia212489c33da72f85d96618aa1d4db5972044bb2

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 9a3ee16..865d92c 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -77,6 +77,7 @@ certain functionality.
 @section Filter
 
 @li @c filter.ms - escher import/export
+@li @c filter.xslt - xslt import/export
 @li @c oox.xmlstream - XmlStream class
 
 @section formula
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-10-10 Thread Libreoffice Gerrit user
 sal/inc/rtl/logfile.hxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 994ec9638027fdb1dd1afea9a3cb229b5ab900d6
Author: Luboš Luňák l.lu...@suse.cz
Date:   Wed Oct 10 14:12:37 2012 +0200

avoid unused variable warnings for vars used for RTL_LOGFILE_CONTEXT_TRACEx

Change-Id: I8847192f61b2fca696a1ec6fbad65026e1ffdb43

diff --git a/sal/inc/rtl/logfile.hxx b/sal/inc/rtl/logfile.hxx
index 1ed8c66..fc4dc1d 100644
--- a/sal/inc/rtl/logfile.hxx
+++ b/sal/inc/rtl/logfile.hxx
@@ -171,9 +171,9 @@ namespace rtl
 #define RTL_LOGFILE_CONTEXT( instance, name )  ((void)0)
 #define RTL_LOGFILE_CONTEXT_AUTHOR( instance, project, author, name )  
((void)0)
 #define RTL_LOGFILE_CONTEXT_TRACE( instance, message )  ((void)0)
-#define RTL_LOGFILE_CONTEXT_TRACE1( instance, frmt, arg1 ) ((void)0)
-#define RTL_LOGFILE_CONTEXT_TRACE2( instance, frmt, arg1, arg2 ) ((void)0)
-#define RTL_LOGFILE_CONTEXT_TRACE3( instance, frmt, arg1, arg2 , arg3 ) 
((void)0)
+#define RTL_LOGFILE_CONTEXT_TRACE1( instance, frmt, arg1 ) ((void)arg1,(void)0)
+#define RTL_LOGFILE_CONTEXT_TRACE2( instance, frmt, arg1, arg2 ) 
((void)arg1,(void)arg2,(void)0)
+#define RTL_LOGFILE_CONTEXT_TRACE3( instance, frmt, arg1, arg2 , arg3 ) 
((void)arg1,(void)arg2,(void)arg3,(void)0)
 #endif
 
 // Normal RTL_LOGFILE_* entries will not make it into release versions,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc sal/rtl sal/util

2012-10-09 Thread Libreoffice Gerrit user
 sal/inc/rtl/ustring.h  |   23 +++
 sal/inc/rtl/ustring.hxx|8 +---
 sal/rtl/source/ustring.cxx |   10 +-
 sal/util/sal.map   |1 +
 4 files changed, 38 insertions(+), 4 deletions(-)

New commits:
commit 7ef1190c3e9422998d89df2cf8fcf30bddfc1a03
Author: Noel Grandin n...@peralex.com
Date:   Thu Oct 4 15:06:27 2012 +0200

Add a 'fromIndex' parameter to OUString::replaceAll

This method will be needed for forthcoming String-OUStringBuffer
conversions.

Change-Id: I001099baaca5cd402aebcd15c031d9060286a8f9

diff --git a/sal/inc/rtl/ustring.h b/sal/inc/rtl/ustring.h
index 231dcdc..e056bad 100644
--- a/sal/inc/rtl/ustring.h
+++ b/sal/inc/rtl/ustring.h
@@ -1530,6 +1530,29 @@ SAL_DLLPUBLIC void SAL_CALL rtl_uString_newReplaceAll(
 
 @param str  pointer to the original string; must not be null
 
+@param from  pointer to the substring to be replaced; must not be null
+
+@param to  pointer to the replacing substring; must not be null
+
+@param fromIndex  the position in the string where we will begin searching
+
+@since LibreOffice 3.7
+*/
+SAL_DLLPUBLIC void SAL_CALL rtl_uString_newReplaceAllFromIndex(
+rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
+rtl_uString const * to, sal_Int32 fromIndex) SAL_THROW_EXTERN_C();
+
+/** Create a new string by replacing all occurrences of a given substring with
+another substring.
+
+Replacing subsequent occurrences picks up only after a given replacement.
+That is, replacing from xa to xx in xaa results in xxa, not xxx.
+
+@param[in, out] newStr  pointer to the new string; must not be null; must
+point to null or a valid rtl_uString
+
+@param str  pointer to the original string; must not be null
+
 @param from  pointer to the substring to be replaced; must not be null and
 must point to memory of at least \p fromLength ASCII bytes
 
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index 9756801..bbd6e96 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -1531,11 +1531,13 @@ public:
 
   @param to  the replacing substring
 
-  @since LibreOffice 3.6
+  @param fromIndex  the position in the string where we will begin 
searching
+
+  @since LibreOffice 3.7
 */
-OUString replaceAll(OUString const  from, OUString const  to) const {
+OUString replaceAll(OUString const  from, OUString const  to, int 
fromIndex = 0) const {
 rtl_uString * s = 0;
-rtl_uString_newReplaceAll(s, pData, from.pData, to.pData);
+rtl_uString_newReplaceAllFromIndex(s, pData, from.pData, to.pData, 
fromIndex);
 return OUString(s, SAL_NO_ACQUIRE);
 }
 
diff --git a/sal/rtl/source/ustring.cxx b/sal/rtl/source/ustring.cxx
index b219949..ac2d7d9 100644
--- a/sal/rtl/source/ustring.cxx
+++ b/sal/rtl/source/ustring.cxx
@@ -1159,9 +1159,17 @@ void rtl_uString_newReplaceAll(
 rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
 rtl_uString const * to) SAL_THROW_EXTERN_C()
 {
+rtl_uString_newReplaceAllFromIndex( newStr, str, from, to, 0 );
+}
+
+void rtl_uString_newReplaceAllFromIndex(
+rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
+rtl_uString const * to, sal_Int32 fromIndex) SAL_THROW_EXTERN_C()
+{
 assert(to != 0);
+assert(fromIndex = 0  fromIndex = str-length);
 rtl_uString_assign(newStr, str);
-for (sal_Int32 i = 0;; i += to-length) {
+for (sal_Int32 i = fromIndex;; i += to-length) {
 rtl_uString_newReplaceFirst(newStr, *newStr, from, to, i);
 if (i == -1) {
 break;
diff --git a/sal/util/sal.map b/sal/util/sal.map
index 978a66e..bf518d3 100644
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -631,6 +631,7 @@ LIBO_UDK_3.7 { # symbols available in = LibO 3.7
 global:
 rtl_string_newFromSubString;
 rtl_uString_newFromSubString;
+rtl_uString_newReplaceAllFromIndex;
 } LIBO_UDK_3.6;
 
 PRIVATE_1.0 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-10-03 Thread Libreoffice Gerrit user
 sal/inc/rtl/ustrbuf.hxx |   19 ---
 1 file changed, 19 deletions(-)

New commits:
commit 78225f2ebeb30c853395240f7cc87926349aa975
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Oct 3 18:57:54 2012 +0200

Revert add rtl::OUStringBuffer::append(bool)

This reverts commit 563fa900ba22bf83dfa58e67807ed0337f810576.

diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 0b4586b..a11dff1 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -501,25 +501,6 @@ public:
 }
 
 /**
-Appends the string representation of the codebool/code
-argument to the string buffer.
-
-The argument is converted to a string as if by the method
-codeString.valueOf/code, and the characters of that
-string are then appended to this string buffer.
-
-@param   b   a codebool/code.
-@return  this string buffer.
-
-@since LibreOffice 3.7
- */
-OUStringBuffer  append(bool b)
-{
-sal_Unicode sz[RTL_USTR_MAX_VALUEOFBOOLEAN];
-return append( sz, rtl_ustr_valueOfBoolean( sz, b ) );
-}
-
-/**
 Appends the string representation of the codesal_Bool/code
 argument to the string buffer.
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc sal/rtl sal/util

2012-10-02 Thread Libreoffice Gerrit user
 sal/inc/rtl/string.h   |   17 +
 sal/inc/rtl/string.hxx |   36 
 sal/inc/rtl/ustring.h  |   17 +
 sal/inc/rtl/ustring.hxx|   36 
 sal/rtl/source/strtmpl.cxx |   23 +++
 sal/util/sal.map   |6 ++
 6 files changed, 87 insertions(+), 48 deletions(-)

New commits:
commit 595ba03fd4769c069bbe0431ab878956ef1c37ad
Author: Michael Meeks michael.me...@suse.com
Date:   Tue Oct 2 18:39:30 2012 +0100

update string copy semantics to be undefined in a non-crashing way.

Change-Id: I03bb4db5931932280e368012cbaee6bef2854dd6

diff --git a/sal/inc/rtl/string.h b/sal/inc/rtl/string.h
index c38e106..6dd4236 100644
--- a/sal/inc/rtl/string.h
+++ b/sal/inc/rtl/string.h
@@ -889,6 +889,23 @@ SAL_DLLPUBLIC void SAL_CALL rtl_string_newFromStr( 
rtl_String ** newStr, const s
  */
 SAL_DLLPUBLIC void SAL_CALL rtl_string_newFromStr_WithLength( rtl_String ** 
newStr, const sal_Char * value, sal_Int32 len ) SAL_THROW_EXTERN_C();
 
+/** Allocate a new string that is a substring of this string.
+
+The substring begins at the specified beginIndex and contains count
+characters. Meaningless combinations such as negative beginIndex,
+or beginIndex + count greater than the length of the string have
+undefined behaviour.
+
+@param beginIndex   the beginning index, inclusive.
+@param countthe number of characters.
+@returnthe specified substring.
+
+@since LibreOffice 3.7
+ */
+SAL_DLLPUBLIC void SAL_CALL rtl_string_newFromSubString(
+rtl_String ** newStr, const rtl_String * from,
+sal_Int32 beginIndex, sal_Int32 count ) SAL_THROW_EXTERN_C();
+
 /**
  @internal
  @since LibreOffice 3.6
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 84ab48e..d58999b 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -1024,31 +1024,27 @@ public:
 /**
   Returns a new string that is a substring of this string.
 
-  The substring begins at the specified beginIndex.  It is an error for
-  beginIndex to be negative or to be greater than the length of this 
string.
+  The substring begins at the specified beginIndex. If
+  beginIndex is negative or be greater than the length of
+  this string, behaviour is undefined.
 
   @param beginIndex   the beginning index, inclusive.
   @returnthe specified substring.
 */
 OString copy( sal_Int32 beginIndex ) const SAL_THROW(())
 {
-assert(beginIndex = 0  beginIndex = getLength());
-if ( beginIndex == 0 )
-return *this;
-else
-{
-rtl_String* pNew = 0;
-rtl_string_newFromStr_WithLength( pNew, pData-buffer+beginIndex, 
getLength()-beginIndex );
-return OString( pNew, (DO_NOT_ACQUIRE*)0 );
-}
+rtl_String *pNew = 0;
+rtl_string_newFromSubString( pNew, pData, beginIndex, getLength() - 
beginIndex );
+return OString( pNew, (DO_NOT_ACQUIRE*)0 );
 }
 
 /**
   Returns a new string that is a substring of this string.
 
   The substring begins at the specified beginIndex and contains count
-  characters.  It is an error for either beginIndex or count to be 
negative,
-  or for beginIndex + count to be greater than the length of this string.
+  characters.  If either beginIndex or count are negative,
+  or beginIndex + count are greater than the length of this string
+  then behaviour is undefined.
 
   @param beginIndex   the beginning index, inclusive.
   @param countthe number of characters.
@@ -1056,17 +1052,9 @@ public:
 */
 OString copy( sal_Int32 beginIndex, sal_Int32 count ) const SAL_THROW(())
 {
-assert(beginIndex = 0  beginIndex = getLength()  count = 0
- sal::static_int_castsal_uInt32(count) =
-   sal::static_int_castsal_uInt32(getLength() - beginIndex));
-if ( (beginIndex == 0)  (count == getLength()) )
-return *this;
-else
-{
-rtl_String* pNew = 0;
-rtl_string_newFromStr_WithLength( pNew, pData-buffer+beginIndex, 
count );
-return OString( pNew, (DO_NOT_ACQUIRE*)0 );
-}
+rtl_String *pNew = 0;
+rtl_string_newFromSubString( pNew, pData, beginIndex, count );
+return OString( pNew, (DO_NOT_ACQUIRE*)0 );
 }
 
 /**
diff --git a/sal/inc/rtl/ustring.h b/sal/inc/rtl/ustring.h
index 5b4982e..231dcdc 100644
--- a/sal/inc/rtl/ustring.h
+++ b/sal/inc/rtl/ustring.h
@@ -1226,6 +1226,23 @@ SAL_DLLPUBLIC void SAL_CALL rtl_uString_newFromStr(
 SAL_DLLPUBLIC void SAL_CALL rtl_uString_newFromStr_WithLength(
 rtl_uString ** newStr, const sal_Unicode * value, sal_Int32 len ) 
SAL_THROW_EXTERN_C();
 
+/** Allocate a new string that is a substring of this string.
+
+The substring 

[Libreoffice-commits] .: sal/inc

2012-09-24 Thread Libreoffice Gerrit user
 sal/inc/osl/interlck.h |4 
 sal/inc/sal/config.h   |2 ++
 2 files changed, 6 insertions(+)

New commits:
commit 5ae27819974e3492b6f4d33fa51ef2a9d77b5ce5
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Sat Sep 22 04:38:32 2012 -0500

use intrinsict to inline InterlockCount() on Windows too

Change-Id: I93949cc37821c5306514c8ce2f21519550f33775
Reviewed-on: https://gerrit.libreoffice.org/672
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com
Tested-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/sal/inc/osl/interlck.h b/sal/inc/osl/interlck.h
index 792ea55..22ff985 100644
--- a/sal/inc/osl/interlck.h
+++ b/sal/inc/osl/interlck.h
@@ -67,6 +67,8 @@ SAL_DLLPUBLIC oslInterlockedCount SAL_CALL 
osl_decrementInterlockedCount(oslInte
 */
 #if defined( HAVE_GCC_BUILTIN_ATOMIC )
 #define osl_atomic_increment(p)  __sync_add_and_fetch((p), 1)
+#elif defined( _MSC_VER )
+#define osl_atomic_increment(p) _InterlockedIncrement((p))
 #else
 #define osl_atomic_increment(p) osl_incrementInterlockedCount((p))
 #endif
@@ -84,6 +86,8 @@ SAL_DLLPUBLIC oslInterlockedCount SAL_CALL 
osl_decrementInterlockedCount(oslInte
 */
 #if defined( HAVE_GCC_BUILTIN_ATOMIC )
 #define osl_atomic_decrement(p) __sync_sub_and_fetch((p), 1)
+#elif defined( _MSC_VER )
+#define osl_atomic_decrement(p) _InterlockedDecrement((p))
 #else
 #define osl_atomic_decrement(p) osl_decrementInterlockedCount((p))
 #endif
diff --git a/sal/inc/sal/config.h b/sal/inc/sal/config.h
index aee8e82..e81250a 100644
--- a/sal/inc/sal/config.h
+++ b/sal/inc/sal/config.h
@@ -44,6 +44,8 @@
 
 #ifdef _MSC_VER
 
+#include Intrin.h // define intrinsic functions supported by the compiler
+
 #ifndef _USE_MATH_DEFINES
 #define _USE_MATH_DEFINES // needed by Visual C++ for math constants
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-09-18 Thread Libreoffice Gerrit user
 sal/inc/rtl/oustringostreaminserter.hxx |   44 ++--
 sal/inc/rtl/ustring.hxx |   36 ++
 2 files changed, 34 insertions(+), 46 deletions(-)

New commits:
commit 96b45756b46ceb06dbec5c241d09acc96891e121
Author: Luboš Luňák l.lu...@suse.cz
Date:   Tue Sep 18 11:54:05 2012 +0200

move ostream OUString operator directly to ustring.hxx

It apparently works that way, so there's no need to have
an #include loop.

Change-Id: I58d4f0461c14637872a139f0fbfb78f2a99fe28a

diff --git a/sal/inc/rtl/oustringostreaminserter.hxx 
b/sal/inc/rtl/oustringostreaminserter.hxx
index c25998a..48dc79e 100644
--- a/sal/inc/rtl/oustringostreaminserter.hxx
+++ b/sal/inc/rtl/oustringostreaminserter.hxx
@@ -27,47 +27,9 @@
 #ifndef INCLUDED_RTL_OUSTRINGOSTREAMINSERTER_HXX
 #define INCLUDED_RTL_OUSTRINGOSTREAMINSERTER_HXX
 
-#include sal/config.h
-
-#include ostream
-
-#include rtl/textenc.h
-#include rtl/ustring.hxx
-
-// The unittest uses slightly different code to help check that the proper
-// calls are made. The class is put into a different namespace to make
-// sure the compiler generates a different (if generating also non-inline)
-// copy of the function and does not merge them together. The class
-// is brought into the proper rtl namespace by a typedef below.
-#ifdef RTL_STRING_UNITTEST
-#define rtl rtlunittest
-#endif
-
-namespace rtl {
-
-#ifdef RTL_STRING_UNITTEST
-#undef rtl
-#endif
-
-/**
-Support for rtl::OUString in std::ostream (and thus in
-CPPUNIT_ASSERT or SAL_INFO macros, for example).
-
-The rtl::OUString is converted to UTF-8.
-
-@since LibreOffice 3.5.
-*/
-template typename charT, typename traits 
-inline std::basic_ostreamcharT, traits  operator (
-std::basic_ostreamcharT, traits  stream, rtl::OUString const  string)
-{
-return stream 
-rtl::OUStringToOString(string, RTL_TEXTENCODING_UTF8).getStr();
-// best effort; potentially loses data due to conversion failures
-// (stray surrogate halves) and embedded null characters
-}
-
-}
+// File kept only for backwards compatibility, the inserter is now defined
+// together with OUString.
+#include rtl/ustring.hxx
 
 #endif
 
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index 4afb1d2..b008054 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -32,12 +32,14 @@
 #include sal/config.h
 
 #include cassert
+#include ostream
 
 #include osl/diagnose.h
 #include rtl/ustring.h
 #include rtl/string.hxx
 #include rtl/stringutils.hxx
 #include rtl/memory.h
+#include rtl/textenc.h
 #include sal/log.hxx
 
 #if defined EXCEPTIONS_OFF
@@ -2141,6 +2143,35 @@ inline OString OUStringToOString( const OUString  
rUnicode,
 
 } /* Namespace */
 
+#ifdef RTL_STRING_UNITTEST
+#define rtl rtlunittest
+#endif
+namespace rtl
+{
+#ifdef RTL_STRING_UNITTEST
+#undef rtl
+#endif
+
+/**
+Support for rtl::OUString in std::ostream (and thus in
+CPPUNIT_ASSERT or SAL_INFO macros, for example).
+
+The rtl::OUString is converted to UTF-8.
+
+@since LibreOffice 3.5.
+*/
+template typename charT, typename traits 
+inline std::basic_ostreamcharT, traits  operator (
+std::basic_ostreamcharT, traits  stream, OUString const  string)
+{
+return stream 
+rtl::OUStringToOString(string, RTL_TEXTENCODING_UTF8).getStr();
+// best effort; potentially loses data due to conversion failures
+// (stray surrogate halves) and embedded null characters
+}
+
+} // namespace
+
 // RTL_USING is defined by gbuild for all modules except those with stable 
public API
 // (as listed in ure/source/README). It allows to use classes like OUString 
without
 // having to explicitly refer to the rtl namespace, which is kind of 
superfluous
@@ -2154,9 +2185,4 @@ using ::rtl::OUStringToOString;
 
 #endif /* _RTL_USTRING_HXX */
 
-// Include the ostream  operator directly here, so that it's always available
-// for SAL_INFO etc. Make sure it's outside of #ifdef _RTL_USTRING_HXX, because
-// includes ustring.hxx back.
-#include rtl/oustringostreaminserter.hxx
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-08-21 Thread Libreoffice Gerrit user
 sal/inc/systools/win32/comptr.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 95b26a37eec7800a337f4522c9235f6e6306de32
Author: Luboš Luňák l.lu...@suse.cz
Date:   Tue Aug 21 10:24:58 2012 +0200

mingw doesn't know __uuidof

Copied from fpicker/source/win32/filepicker/comptr.hxx, which
otherwise seems to be the same file.

Change-Id: I51ca96c1280e75f9318fcbc74997b2bf755fff95

diff --git a/sal/inc/systools/win32/comptr.hxx 
b/sal/inc/systools/win32/comptr.hxx
index fe7b651..7ef5123 100644
--- a/sal/inc/systools/win32/comptr.hxx
+++ b/sal/inc/systools/win32/comptr.hxx
@@ -174,12 +174,14 @@ class ComPtr
 }
 }
 
+#ifndef __MINGW32__
 //-
 template class T_QUERYINTERFACE 
 HRESULT query(T_QUERYINTERFACE** pQuery)
 {
 return m_pInterface-QueryInterface(__uuidof(T_QUERYINTERFACE), 
(void**)pQuery);
 }
+#endif
 
 //-
 HRESULT query(REFIID rIID  ,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-08-21 Thread Libreoffice Gerrit user
 sal/inc/osl/file.hxx |   67 +++
 1 file changed, 47 insertions(+), 20 deletions(-)

New commits:
commit e9febb63db2f62cd2b9505dfc4ceb3accc32aecb
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Aug 21 12:27:12 2012 +0200

Related fdo#46249: FileStatus can have fewer fields than requested

Turns out 608fe962cc649ad62c489811d3a8666e0e06e5e7 Let osl::FileStatus 
getters
assert programming errors was overly optimistic and misunderstood that
osl_getFileStatus(..., nMask) /can/ return a FileStatus for which 
isValid(nMask)
is false, esp. for stuff like file names and URLs of Windows drives and 
servers.
That in turn leads to existing code now calling
rtl::OUString(_aStatus.ustrFileName) etc. with null argument and crashing.

Change-Id: Icd2168e209aa1c7a6df30cd954513d01034923db

diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx
index 431685a..3d541a9 100644
--- a/sal/inc/osl/file.hxx
+++ b/sal/inc/osl/file.hxx
@@ -731,8 +731,11 @@ public:
 */
 inline Type getFileType() const
 {
-assert(isValid(osl_FileStatus_Mask_Type));
-return static_cast Type (_aStatus.eType);
+SAL_INFO_IF(
+!isValid(osl_FileStatus_Mask_Type), sal,
+no FileStatus Type determined);
+return isValid(osl_FileStatus_Mask_Type)
+? static_cast Type (_aStatus.eType) : Unknown;
 }
 
 /** Is it a directory?
@@ -785,93 +788,117 @@ public:
 
 inline sal_uInt64 getAttributes() const
 {
-assert(isValid(osl_FileStatus_Mask_Attributes));
+SAL_INFO_IF(
+!isValid(osl_FileStatus_Mask_Attributes), sal,
+no FileStatus Attributes determined);
 return _aStatus.uAttributes;
 }
 
 /** Get the creation time of this file.
 
 @return
-The creation time.
+The creation time if this information is valid, an uninitialized
+TimeValue otherwise.
 */
 
 inline TimeValue getCreationTime() const
 {
-assert(isValid(osl_FileStatus_Mask_CreationTime));
+SAL_INFO_IF(
+!isValid(osl_FileStatus_Mask_CreationTime), sal,
+no FileStatus CreationTime determined);
 return _aStatus.aCreationTime;
 }
 
 /** Get the file access time.
 
 @return
-The last access time.
+The last access time if this information is valid, an uninitialized
+TimeValue otherwise.
 */
 
 inline TimeValue getAccessTime() const
 {
-assert(isValid(osl_FileStatus_Mask_AccessTime));
+SAL_INFO_IF(
+!isValid(osl_FileStatus_Mask_AccessTime), sal,
+no FileStatus AccessTime determined);
 return _aStatus.aAccessTime;
 }
 
 /** Get the file modification time.
 
 @return
-The last modified time.
+The last modified time if this information is valid, an uninitialized
+TimeValue otherwise.
 */
 
 inline TimeValue getModifyTime() const
 {
-assert(isValid(osl_FileStatus_Mask_ModifyTime));
+SAL_INFO_IF(
+!isValid(osl_FileStatus_Mask_ModifyTime), sal,
+no FileStatus ModifyTime determined);
 return _aStatus.aModifyTime;
 }
 
 /** Get the size of the file.
 
 @return
-The actual file size.
+The actual file size if this information is valid, 0 otherwise.
 */
 
 inline sal_uInt64 getFileSize() const
 {
-assert(isValid(osl_FileStatus_Mask_FileSize));
+SAL_INFO_IF(
+!isValid(osl_FileStatus_Mask_FileSize), sal,
+no FileStatus FileSize determined);
 return _aStatus.uFileSize;
 }
 
 /** Get the file name.
 
 @return
-The file name.
+The file name if this information is valid, an empty string otherwise.
 */
 
 inline ::rtl::OUString getFileName() const
 {
-assert(isValid(osl_FileStatus_Mask_FileName));
-return rtl::OUString(_aStatus.ustrFileName);
+SAL_INFO_IF(
+!isValid(osl_FileStatus_Mask_FileName), sal,
+no FileStatus FileName determined);
+return isValid(osl_FileStatus_Mask_FileName)
+? rtl::OUString(_aStatus.ustrFileName) : rtl::OUString();
 }
 
 
 /** Get the URL of the file.
 
 @return
-The full qualified URL of the file.
+The full qualified URL of the file if this information is valid, an
+empty string otherwise.
 */
 
 inline ::rtl::OUString getFileURL() const
 {
-assert(isValid(osl_FileStatus_Mask_FileURL));
-return rtl::OUString(_aStatus.ustrFileURL);
+SAL_INFO_IF(
+!isValid(osl_FileStatus_Mask_FileURL), sal,
+no FileStatus FileURL determined);
+return isValid(osl_FileStatus_Mask_FileURL)
+? rtl::OUString(_aStatus.ustrFileURL) : rtl::OUString();
 }
 
 /** Get the link 

[Libreoffice-commits] .: sal/inc sal/osl sal/qa sal/rtl sal/workben

2012-07-27 Thread Arnaud Versini
 sal/inc/osl/file.hxx |6 ++-
 sal/osl/w32/pipe.c   |8 ++--
 sal/osl/w32/procimpl.cxx |3 +
 sal/qa/osl/file/osl_File.cxx |4 +-
 sal/rtl/source/byteseq.cxx   |   12 ---
 sal/rtl/source/cipher.cxx|8 ++--
 sal/rtl/source/digest.cxx|   72 ++-
 sal/rtl/source/strbuf.cxx|   10 +++--
 sal/rtl/source/string.cxx|   10 ++---
 sal/rtl/source/unload.cxx|4 +-
 sal/rtl/source/ustrbuf.cxx   |   10 +++--
 sal/rtl/source/ustring.cxx   |   20 +--
 sal/workben/testfile.cxx |4 +-
 13 files changed, 94 insertions(+), 77 deletions(-)

New commits:
commit d6c284e4b146a44ba69a96836c59a98d077bb934
Author: Arnaud Versini arnaud.vers...@gmail.com
Date:   Wed Jul 25 20:03:22 2012 +0200

Use memset and memcpy insteadof rtl_zeroMemory and rtl_copyMemory in sal

Change-Id: I4f9649ca61c988d425b59e41549d1c46bb808f2c

diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx
index e93682d..431685a 100644
--- a/sal/inc/osl/file.hxx
+++ b/sal/inc/osl/file.hxx
@@ -31,6 +31,8 @@
 
 #include sal/config.h
 
+#include string.h
+
 #include cassert
 
 #include osl/time.h
@@ -444,7 +446,7 @@ public:
 VolumeInfo( sal_uInt32 nMask ): _nMask( nMask )
 {
 _aInfo.uStructSize = sizeof( oslVolumeInfo );
-rtl_zeroMemory( _aInfo.uValidFields, sizeof( oslVolumeInfo ) - 
sizeof( sal_uInt32 ) );
+memset( _aInfo.uValidFields, 0, sizeof( oslVolumeInfo ) - sizeof( 
sal_uInt32 ) );
 _aInfo.pDeviceHandle = _aDevice._aHandle;
 }
 
@@ -692,7 +694,7 @@ public:
 FileStatus( sal_uInt32 nMask ): _nMask( nMask )
 {
 _aStatus.uStructSize = sizeof( oslFileStatus );
-rtl_zeroMemory( _aStatus.uValidFields, sizeof( oslFileStatus ) - 
sizeof( sal_uInt32 ) );
+memset( _aStatus.uValidFields, 0, sizeof( oslFileStatus ) - sizeof( 
sal_uInt32 ) );
 }
 
 /** Destructor.
diff --git a/sal/osl/w32/pipe.c b/sal/osl/w32/pipe.c
index 0532f82..e026923 100644
--- a/sal/osl/w32/pipe.c
+++ b/sal/osl/w32/pipe.c
@@ -26,6 +26,8 @@
  *
  /
 
+#include string.h
+
 #include system.h
 
 #include osl/pipe.h
@@ -314,7 +316,7 @@ oslPipe SAL_CALL osl_acceptPipe(oslPipe pPipe)
 OSL_ASSERT(pPipe);
 OSL_ASSERT(pPipe-m_File != INVALID_HANDLE_VALUE);
 
-rtl_zeroMemory(os, sizeof(OVERLAPPED));
+memset(os, 0, sizeof(OVERLAPPED));
 os.hEvent = pPipe-m_AcceptEvent;
 ResetEvent(pPipe-m_AcceptEvent);
 
@@ -389,7 +391,7 @@ sal_Int32 SAL_CALL osl_receivePipe(oslPipe pPipe,
 
 OSL_ASSERT(pPipe);
 
-rtl_zeroMemory(os,sizeof(OVERLAPPED));
+memset(os, 0, sizeof(OVERLAPPED));
 os.hEvent = pPipe-m_ReadEvent;
 
 ResetEvent(pPipe-m_ReadEvent);
@@ -428,7 +430,7 @@ sal_Int32 SAL_CALL osl_sendPipe(oslPipe pPipe,
 
 OSL_ASSERT(pPipe);
 
-rtl_zeroMemory(os, sizeof(OVERLAPPED));
+memset(os, 0, sizeof(OVERLAPPED));
 os.hEvent = pPipe-m_WriteEvent;
 ResetEvent(pPipe-m_WriteEvent);
 
diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx
index 9dc0959..2b7d6ba 100644
--- a/sal/osl/w32/procimpl.cxx
+++ b/sal/osl/w32/procimpl.cxx
@@ -53,6 +53,7 @@
 #include vector
 #include algorithm
 #include string
+#include string.h
 
 //#
 extern C oslFileHandle SAL_CALL osl_createFileHandleFromOSHandle( HANDLE 
hFile, sal_uInt32 uFlags );
@@ -218,7 +219,7 @@ namespace /* private */
 OSL_ASSERT(envv.getLength());
 
 sal_uInt32 n = envv.getLength() + 1; // copy the final '\0', too
-rtl_copyMemory(
+memcpy(
 reinterpret_castvoid*(environment[pos]),
 reinterpret_castconst void*(envv.getStr()),
 n * sizeof(sal_Unicode));
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index dff2840..b50735d 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -6063,7 +6063,7 @@ namespace osl_Directory
 void rm_test_path(const OUString path)
 {
 sal_Unicode buffer[PATH_BUFFER_SIZE];
-rtl_copyMemory(buffer, path.getStr(), (path.getLength() + 1) * 
sizeof(sal_Unicode));
+memcpy(buffer, path.getStr(), (path.getLength() + 1) * 
sizeof(sal_Unicode));
 
 sal_Int32 i = rtl_ustr_lastIndexOfChar(buffer, '/');
 if (i == path.getLength())
@@ -6185,7 +6185,7 @@ namespace osl_Directory
 {
 char* drv = get_unused_drive_letter();
 char buff[PATH_BUFFER_SIZE];
-rtl_zeroMemory(buff, sizeof(buff));
+memset(buff, 0, sizeof(buff));
 
 strncpy(buff, drv, 1);
 strcat(buff, :\\);
diff --git a/sal/rtl/source/byteseq.cxx b/sal/rtl/source/byteseq.cxx
index 76423f7..432483c 100644
--- a/sal/rtl/source/byteseq.cxx
+++ b/sal/rtl/source/byteseq.cxx
@@ -26,6 +26,8 @@
  *
  

[Libreoffice-commits] .: sal/inc

2012-07-23 Thread Stephan Bergmann
 sal/inc/rtl/string.hxx  |7 ++-
 sal/inc/rtl/ustring.hxx |7 ++-
 2 files changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 8ee7c47404cdf408bcd3b6ea0267fbe54193c93f
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Jul 23 12:09:12 2012 +0200

Make rtl::O[U]String::isEmpty return true bool

...instead of sal_Bool, to work around MSVC warning C4805: unsafe mix of 
type
'sal_Bool' and type 'bool'.

Change-Id: Ia3477539ccc23aa9daec49d633f023d414f2b4bf

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 8c3757f..497e4e3 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -320,12 +320,9 @@ public:
 
   @since LibreOffice 3.4
 */
-sal_Bool isEmpty() const SAL_THROW(())
+bool isEmpty() const SAL_THROW(())
 {
-if ( pData-length )
-return sal_False;
-else
-return sal_True;
+return pData-length == 0;
 }
 
 /**
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index d70a43c..448f620 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -405,12 +405,9 @@ public:
 
   @since LibreOffice 3.4
 */
-sal_Bool isEmpty() const SAL_THROW(())
+bool isEmpty() const SAL_THROW(())
 {
-if ( pData-length )
-return sal_False;
-else
-return sal_True;
+return pData-length == 0;
 }
 
 /**
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-07-11 Thread Stephan Bergmann
 sal/inc/rtl/ustring.hxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit a23f7ddee2a2e19009f473c1e61092a85b9dc1f4
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Jul 11 12:19:20 2012 +0200

Revert WaE: logically last test always passes

This reverts commit 0b1f4248338ff28208b3368b66690a84a75cc480, which appears 
to
be a bogus fix (for a bogus warning?).  Also needs adaption a la
3c598c4064cffdc2c9ff19e094594ca360779b66 sal: work around spurious signed
overflow warnings.

Conflicts:

sal/inc/rtl/ustring.hxx

Change-Id: I7e9d94fd93a37bb10604c1895ab619a8ac2c3f43

diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index f3d224e..427950f 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -1314,7 +1314,9 @@ public:
 */
 OUString copy( sal_Int32 beginIndex, sal_Int32 count ) const SAL_THROW(())
 {
-assert(beginIndex = 0  beginIndex = getLength()  count = 0);
+assert(beginIndex = 0  beginIndex = getLength()  count = 0
+sal::static_int_cast sal_uInt32 (count) =
+  sal::static_int_cast sal_uInt32 (getLength() - 
beginIndex));
 if ( (beginIndex == 0)  (count == getLength()) )
 return *this;
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-06-12 Thread Jesús Corrius
 sal/inc/systools/win32/qswin32.h |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 3a793f9558c61000dc00534df0820e06135c8c24
Author: Jesús Corrius je...@softcatala.org
Date:   Tue Jun 12 12:39:58 2012 +0200

rename Class Name, Window Name and Message of the QuickStarter to avoid 
conflicts with other StarOffice derivatives

diff --git a/sal/inc/systools/win32/qswin32.h b/sal/inc/systools/win32/qswin32.h
index 6953ded..81d6bbd 100644
--- a/sal/inc/systools/win32/qswin32.h
+++ b/sal/inc/systools/win32/qswin32.h
@@ -29,9 +29,9 @@
 #ifndef _QSWIN32_H
 #define _QSWIN32_H
 
-#define QUICKSTART_CLASSNAMEA   SO Listener Class
-#define QUICKSTART_WINDOWNAMEA  SO Listener Window
-#define SHUTDOWN_QUICKSTART_MESSAGEASO KillTray
+#define QUICKSTART_CLASSNAMEA   LO Listener Class
+#define QUICKSTART_WINDOWNAMEA  LO Listener Window
+#define SHUTDOWN_QUICKSTART_MESSAGEALO KillTray
 
 #define QUICKSTART_CLASSNAMEW   L##QUICKSTART_CLASSNAMEA
 #define QUICKSTART_WINDOWNAMEW  L##QUICKSTART_WINDOWNAMEA
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-06-08 Thread Miklos Vajna
 sal/inc/sal/log-areas.dox  |2 +
 sw/source/core/text/porlay.cxx |   66 -
 2 files changed, 35 insertions(+), 33 deletions(-)

New commits:
commit e8c290f48f3f0396e278c7664ec84ff06aeb00b7
Author: Miklos Vajna vmik...@suse.cz
Date:   Fri Jun 8 13:15:12 2012 +0200

SwLineLayout: OSL_ENSURE - SAL_WARN_IF

Change-Id: I948344caeb9d48906732683ff9ba424f525c05d8

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 246b969..c30bc0b 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -46,8 +46,10 @@ certain functionality.
 
 @section Writer
 
+@li @c sw.core - Writer core
 @li @c sw.rtf - .rtf export filter
 @li @c sw.uno - Writer UNO interfaces
 @li @c sw.ww8 - .doc/.docx export filter, .doc import filter (not writerfilter)
 
 */
+/* vim:set ft=cpp shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index feb7588..3e76d1f 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -340,8 +340,8 @@ void SwLineLayout::CalcLine( SwTxtFormatter rLine, 
SwTxtFormatInfo rInf )
 // portion spanning to the end or the next fixed portion
 while( pPos )
 {
-OSL_ENSURE( POR_LIN != pPos-GetWhichPor(),
-SwLineLayout::CalcLine: don't use SwLinePortions ! );
+SAL_WARN_IF( POR_LIN == pPos-GetWhichPor(),
+sw.core, SwLineLayout::CalcLine: don't use 
SwLinePortions ! );
 
 // Null portions are eliminated. They can form if two FlyFrms
 // overlap.
@@ -386,8 +386,8 @@ void SwLineLayout::CalcLine( SwTxtFormatter rLine, 
SwTxtFormatInfo rInf )
 KSHORT nPosHeight = pPos-Height();
 KSHORT nPosAscent = pPos-GetAscent();
 
-OSL_ENSURE( nPosHeight = nPosAscent,
-SwLineLayout::CalcLine: bad ascent or height );
+SAL_WARN_IF( nPosHeight  nPosAscent,
+sw.core, SwLineLayout::CalcLine: bad ascent or 
height );
 
 if( pPos-IsHangingPortion() )
 {
@@ -547,7 +547,7 @@ void SwLineLayout::CalcLine( SwTxtFormatter rLine, 
SwTxtFormatInfo rInf )
 // Robust:
 if( nLineWidth  Width() )
 Width( nLineWidth );
-OSL_ENSURE( nLineWidth = Width(), SwLineLayout::CalcLine: line is 
bursting );
+SAL_WARN_IF( nLineWidth  Width(), sw.core, SwLineLayout::CalcLine: 
line is bursting );
 SetDummy( bTmpDummy );
 SetRedline( rLine.GetRedln() 
 rLine.GetRedln()-CheckLine( rLine.GetStart(), rLine.GetEnd() ) );
@@ -643,7 +643,7 @@ SwScriptInfo::~SwScriptInfo()
 
 sal_uInt8 SwScriptInfo::WhichFont( xub_StrLen nIdx, const String* pTxt, const 
SwScriptInfo* pSI )
 {
-OSL_ENSURE( pTxt || pSI,How should I determine the script type? );
+SAL_WARN_IF( !pTxt  !pSI, sw.core, How should I determine the script 
type? );
 sal_uInt16 nScript;
 
 // First we try to use our SwScriptInfo
@@ -737,7 +737,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode rNode, 
sal_Bool bRTL )
 // if change position = 0 we do not use any data from the arrays
 // because by deleting all characters of the first group at the 
beginning
 // of a paragraph nScript is set to a wrong value
-OSL_ENSURE( CountScriptChg(), Where're my changes of script? );
+SAL_WARN_IF( !CountScriptChg(), sw.core, Where're my changes of 
script? );
 while( nCnt  CountScriptChg() )
 {
 if ( nChg  GetScriptChg( nCnt ) )
@@ -845,9 +845,9 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode rNode, 
sal_Bool bRTL )
 
 nScript = (sal_uInt8)GetI18NScriptTypeOfLanguage( 
(sal_uInt16)GetAppLanguage() );
 
-OSL_ENSURE( i18n::ScriptType::LATIN == nScript ||
-i18n::ScriptType::ASIAN == nScript ||
-i18n::ScriptType::COMPLEX == nScript, Wrong default language 
);
+SAL_WARN_IF( i18n::ScriptType::LATIN != nScript 
+i18n::ScriptType::ASIAN != nScript 
+i18n::ScriptType::COMPLEX != nScript, sw.core, Wrong 
default language );
 
 nChg = nEnd;
 
@@ -870,9 +870,9 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode rNode, 
sal_Bool bRTL )
 
 while ( nChg  rTxt.Len() || ( aScriptChanges.empty()  !rTxt.Len() ) )
 {
-OSL_ENSURE( i18n::ScriptType::WEAK != nScript,
-Inserting WEAK into SwScriptInfo structure );
-OSL_ENSURE( STRING_LEN != nChg, 65K? Strange length of script 
section );
+SAL_WARN_IF( i18n::ScriptType::WEAK == nScript,
+sw.core, Inserting WEAK into SwScriptInfo structure );
+SAL_WARN_IF( STRING_LEN == nChg, sw.core, 65K? Strange length of 
script section );
 
 xub_StrLen nSearchStt = nChg;
 nChg = (xub_StrLen)pBreakIt-GetBreakIter()-endOfScript( rTxt, 
nSearchStt, 

[Libreoffice-commits] .: sal/inc vcl/source vcl/workben

2012-04-27 Thread Tor Lillqvist
 sal/inc/sal/main.h |   17 -
 vcl/source/salmain/salmain.cxx |2 +-
 vcl/workben/svdem.cxx  |2 +-
 vcl/workben/vcldemo.cxx|2 +-
 4 files changed, 3 insertions(+), 20 deletions(-)

New commits:
commit 9c69984f8bf4830c6c0831bc66b128f86143d98f
Author: Tor Lillqvist t...@iki.fi
Date:   Sat Apr 28 08:32:51 2012 +0300

Bin the unused vague SAL_IMPLEMENT_MAIN_WITH_GUI idea

Change-Id: I66dae812f3aea0534907316a7fb41b35ad37be48

diff --git a/sal/inc/sal/main.h b/sal/inc/sal/main.h
index 0f68012..c85bc5a 100644
--- a/sal/inc/sal/main.h
+++ b/sal/inc/sal/main.h
@@ -63,8 +63,6 @@ __attribute__ ((visibility(default))) void lo_main(int 
argc, char **argv) \
 sal_detail_deinitialize(); \
 }
 
-#define SAL_MAIN_WITH_GUI_IMPL SAL_MAIN_IMPL
-
 #else
 
 #define SAL_MAIN_WITH_ARGS_IMPL \
@@ -87,8 +85,6 @@ int SAL_CALL main(int argc, char ** argv) \
 return ret; \
 }
 
-#define SAL_MAIN_WITH_GUI_IMPL SAL_MAIN_IMPL
-
 #endif
 
 
@@ -149,19 +145,6 @@ int WINAPI WinMain( HINSTANCE _hinst, HINSTANCE _dummy, 
char* _cmdline, int _nsh
 SAL_WIN_WinMain \
 static int SAL_CALL sal_main(void)
 
-/* Use SAL_IMPLEMENT_MAIN_WITH_GUI in programs that actually have a
- * VCL GUI. The difference is meaningful only for iOS support, which
- * of course is a highly experimental work in progress. So actually,
- * don't bother, just let developers who care for iOS take care of it
- * when/if necessary.
- */
-
-#define SAL_IMPLEMENT_MAIN_WITH_GUI() \
-static int  SAL_CALL sal_main(void); \
-SAL_MAIN_WITH_GUI_IMPL \
-SAL_WIN_WinMain \
-static int SAL_CALL sal_main(void)
-
 /*
 How to use Examples:
 
diff --git a/vcl/source/salmain/salmain.cxx b/vcl/source/salmain/salmain.cxx
index d3c38c8..1a8c4d8 100644
--- a/vcl/source/salmain/salmain.cxx
+++ b/vcl/source/salmain/salmain.cxx
@@ -35,7 +35,7 @@
 
 #include salinst.hxx
 
-SAL_IMPLEMENT_MAIN_WITH_GUI() {
+SAL_IMPLEMENT_MAIN() {
 tools::extendApplicationEnvironment();
 return SVMain();
 }
diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx
index 53f3353..8e9baa7 100644
--- a/vcl/workben/svdem.cxx
+++ b/vcl/workben/svdem.cxx
@@ -49,7 +49,7 @@ void Main();
 
 // ---
 
-SAL_IMPLEMENT_MAIN_WITH_GUI()
+SAL_IMPLEMENT_MAIN()
 {
 tools::extendApplicationEnvironment();
 
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index d0caa00..7df524a 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -52,7 +52,7 @@ void Main();
 
 // ---
 
-SAL_IMPLEMENT_MAIN_WITH_GUI()
+SAL_IMPLEMENT_MAIN()
 {
 tools::extendApplicationEnvironment();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-04-14 Thread Markus Mohrhard
 sal/inc/rtl/math.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4d804a0052fe661603bc8280bfa541a7b0a302ae
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Apr 15 02:18:37 2012 +0200

fix ambiguous call on windows

diff --git a/sal/inc/rtl/math.hxx b/sal/inc/rtl/math.hxx
index 8f4991a..40eba50 100644
--- a/sal/inc/rtl/math.hxx
+++ b/sal/inc/rtl/math.hxx
@@ -274,7 +274,7 @@ inline bool approxEqual(double a, double b, sal_Int16 nPrec)
 return true;
 double x = a - b;
 return (x  0.0 ? -x : x)
- ((a  0.0 ? -a : a) * (1.0 / (pow(2, nPrec;
+ ((a  0.0 ? -a : a) * (1.0 / (pow(static_castdouble(2.0), 
nPrec;
 }
 /** Add two values.
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-04-13 Thread Tor Lillqvist
 sal/inc/osl/diagnose.hxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit dc4aec872426d95033610c9e6b6579387e5e6423
Author: Tor Lillqvist t...@iki.fi
Date:   Fri Apr 13 09:25:03 2012 +0300

WaE: unknown warning group '-Wreturn-type-c-linkage'

diff --git a/sal/inc/osl/diagnose.hxx b/sal/inc/osl/diagnose.hxx
index 95f5093..6463d8d 100644
--- a/sal/inc/osl/diagnose.hxx
+++ b/sal/inc/osl/diagnose.hxx
@@ -75,6 +75,9 @@ SAL_DLLPUBLIC void SAL_CALL 
osl_detail_ObjectRegistry_revokeObject(
 #if SUPD  400
 #ifdef __clang__
 #pragma clang diagnostic push
+// Guard against slightly older clang versions that don't have
+// -Wreturn-type-c-linkage...
+#pragma clang diagnostic ignored -Wunknown-pragmas
 #pragma clang diagnostic ignored -Wreturn-type-c-linkage
 #endif
 #endif
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-04-10 Thread Lubos Lunak
 sal/inc/osl/diagnose.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3082f7f06b261b951315f096afae34c6b571cc06
Author: Luboš Luňák l.lu...@suse.cz
Date:   Tue Apr 10 20:11:08 2012 +0200

make OSL_ASSERT print the failed expression, not just OSL_ASSERT

diff --git a/sal/inc/osl/diagnose.h b/sal/inc/osl/diagnose.h
index 9a6112b..f094abe 100644
--- a/sal/inc/osl/diagnose.h
+++ b/sal/inc/osl/diagnose.h
@@ -150,7 +150,7 @@ SAL_DLLPUBLIC pfunc_osl_printDetailedDebugMessage SAL_CALL 
osl_setDetailedDebugM
 
 #if OSL_DEBUG_LEVEL  0
 #define OSL_ASSERT(c) \
-SAL_DETAIL_WARN_IF_FORMAT(!(c), legacy.osl, OSL_ASSERT)
+SAL_DETAIL_WARN_IF_FORMAT(!(c), legacy.osl, OSL_ASSERT: %s, #c)
 #define OSL_ENSURE(c, m) SAL_DETAIL_WARN_IF_FORMAT(!(c), legacy.osl, %s, m)
 #define OSL_FAIL(m) SAL_DETAIL_WARN_IF_FORMAT(sal_True, legacy.osl, %s, m)
 #else
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-04-06 Thread Lubos Lunak
 sal/inc/rtl/strbuf.hxx  |   54 +++
 sal/inc/rtl/string.h|3 
 sal/inc/rtl/string.hxx  |4 -
 sal/inc/rtl/ustrbuf.hxx |   69 
 sal/inc/rtl/ustring.h   |   15 +---
 sal/inc/rtl/ustring.hxx |   12 +--
 sal/qa/rtl/strings/test_ostring_stringliterals.cxx  |6 +
 sal/qa/rtl/strings/test_oustring_stringliterals.cxx |   21 +++---
 sal/rtl/source/strtmpl.cxx  |   11 ++-
 9 files changed, 162 insertions(+), 33 deletions(-)

New commits:
commit 066dbfd1970b8ea58ba16b07b2a57f61c0cb8e36
Author: Luboš Luňák l.lu...@suse.cz
Date:   Fri Apr 6 13:45:47 2012 +0200

string literal O(U)StringBuffer ctors too, after all

diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx
index 122eb4b..4500cf0 100644
--- a/sal/inc/rtl/strbuf.hxx
+++ b/sal/inc/rtl/strbuf.hxx
@@ -155,6 +155,60 @@ public:
 }
 
 /**
+@overload
+@since LibreOffice 3.6
+ */
+#ifdef HAVE_SFINAE_ANONYMOUS_BROKEN // see the OString ctors
+OStringBuffer( const char* value )
+: pData(NULL)
+{
+sal_Int32 length = rtl_str_getLength( value );
+nCapacity = length + 16;
+rtl_stringbuffer_newFromStr_WithLength( pData, value, length );
+}
+#else
+template typename T 
+OStringBuffer( const T value, typename internal::CharPtrDetector T, 
internal::Dummy ::Type = internal::Dummy())
+: pData(NULL)
+{
+sal_Int32 length = rtl_str_getLength( value );
+nCapacity = length + 16;
+rtl_stringbuffer_newFromStr_WithLength( pData, value, length );
+}
+
+template typename T 
+OStringBuffer( T value, typename internal::NonConstCharArrayDetector T, 
internal::Dummy ::Type = internal::Dummy())
+: pData(NULL)
+{
+sal_Int32 length = rtl_str_getLength( value );
+nCapacity = length + 16;
+rtl_stringbuffer_newFromStr_WithLength( pData, value, length );
+}
+
+/**
+  Constructs a string buffer so that it represents the same
+sequence of characters as the string literal.
+
+  If there are any embedded \0's in the string literal, the result is 
undefined.
+  Use the overload that explicitly accepts length.
+
+  @since LibreOffice 3.6
+
+  @paramliteral   a string literal
+*/
+template typename T 
+OStringBuffer( T literal, typename internal::ConstCharArrayDetector T, 
internal::Dummy ::Type = internal::Dummy())
+: pData(NULL)
+, nCapacity( internal::ConstCharArrayDetector T, void ::size - 1 + 
16 )
+{
+rtl_string_newFromLiteral( pData, literal, 
internal::ConstCharArrayDetector T, void ::size - 1, 16 );
+#ifdef RTL_STRING_UNITTEST
+rtl_string_unittest_const_literal = true;
+#endif
+}
+#endif // HAVE_SFINAE_ANONYMOUS_BROKEN
+
+/**
 Constructs a string buffer so that it represents the same
 sequence of characters as the string argument.
 
diff --git a/sal/inc/rtl/string.h b/sal/inc/rtl/string.h
index f695c12..f326abe 100644
--- a/sal/inc/rtl/string.h
+++ b/sal/inc/rtl/string.h
@@ -888,8 +888,9 @@ SAL_DLLPUBLIC void SAL_CALL 
rtl_string_newFromStr_WithLength( rtl_String ** newS
 
 /**
  @internal
+ @since LibreOffice 3.6
 */
-SAL_DLLPUBLIC void SAL_CALL rtl_string_newFromLiteral( rtl_String ** newStr, 
const sal_Char * value, sal_Int32 len ) SAL_THROW_EXTERN_C();
+SAL_DLLPUBLIC void SAL_CALL rtl_string_newFromLiteral( rtl_String ** newStr, 
const sal_Char * value, sal_Int32 len, sal_Int32 allocExtra ) 
SAL_THROW_EXTERN_C();
 
 /** Assign a new value to a string.
 
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 0f6246b..9791a8c 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -206,7 +206,7 @@ public:
 OString( T literal, typename internal::ConstCharArrayDetector T, 
internal::Dummy ::Type = internal::Dummy() ) SAL_THROW(())
 {
 pData = 0;
-rtl_string_newFromLiteral( pData, literal, 
internal::ConstCharArrayDetector T, void ::size - 1 );
+rtl_string_newFromLiteral( pData, literal, 
internal::ConstCharArrayDetector T, void ::size - 1, 0 );
 #ifdef RTL_STRING_UNITTEST
 rtl_string_unittest_const_literal = true;
 #endif
@@ -285,7 +285,7 @@ public:
 typename internal::ConstCharArrayDetector T, OString ::Type operator=( 
T literal ) SAL_THROW(())
 {
 RTL_STRING_CONST_FUNCTION
-rtl_string_newFromLiteral( pData, literal, 
internal::ConstCharArrayDetector T, void ::size - 1 );
+rtl_string_newFromLiteral( pData, literal, 
internal::ConstCharArrayDetector T, void ::size - 1, 0 );
 return *this;
 }
 
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 02a507c..17deadd 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -149,6 +149,75 @@ 

[Libreoffice-commits] .: sal/inc

2012-04-06 Thread Lubos Lunak
 sal/inc/rtl/strbuf.hxx  |2 +-
 sal/inc/rtl/ustrbuf.hxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit d91d98a53612a972de368186415aa48698e074d9
Author: Luboš Luňák l.lu...@suse.cz
Date:   Fri Apr 6 15:08:02 2012 +0200

fix gcc-4.0.1 and/or 32bit build for string literals

Plain 0 is ambiguous to convert to either long or const char*,
and just adding an overload next to sal_Int32 would be a dupe if
they actually are the same type, so just go with plain int, which
is the sensible thing to do anyway.

diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx
index 4500cf0..7711308 100644
--- a/sal/inc/rtl/strbuf.hxx
+++ b/sal/inc/rtl/strbuf.hxx
@@ -130,7 +130,7 @@ public:
 
 @param  length   the initial capacity.
  */
-explicit OStringBuffer(sal_Int32 length)
+explicit OStringBuffer(int length)
 : pData(NULL)
 , nCapacity( length )
 {
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 17deadd..a887107 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -125,7 +125,7 @@ public:
 
 @param  length   the initial capacity.
  */
-explicit OUStringBuffer(sal_Int32 length)
+explicit OUStringBuffer(int length)
 : pData(NULL)
 , nCapacity( length )
 {
@@ -155,7 +155,7 @@ public:
 : pData(NULL)
 , nCapacity( N - 1 + 16 )
 {
-rtl_uStringbuffer_newFromStr_WithLength( pData, literal, N - 1 );
+rtl_uString_newFromLiteral( pData, literal, N - 1, 16 );
 #ifdef RTL_STRING_UNITTEST
 rtl_string_unittest_const_literal = true;
 #endif
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-04-03 Thread Tor Lillqvist
 sal/inc/sal/types.h |   14 ++
 1 file changed, 2 insertions(+), 12 deletions(-)

New commits:
commit 61c5883f4cb35cbb1016b9abcf0718ca4d967f3d
Author: Tor Lillqvist t...@iki.fi
Date:   Tue Apr 3 18:22:42 2012 +0300

Simplify SAL_CONST_CAST and SAL_STATIC_CAST defns, mention they are obsolete

diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h
index 52b008f..8d0bb7e 100644
--- a/sal/inc/sal/types.h
+++ b/sal/inc/sal/types.h
@@ -351,22 +351,12 @@ typedef struct _sal_Sequence
 #endif
 
 
-/** Wrap C++ const_cast, reinterpret_cast and static_cast expressions in
-macros to keep code portable to old compilers (since most compilers still
-lack RTTI support, dynamic_cast is not included here).
+/* Historical macros, no need to use, old use cases should be replaced
+ * by their expansions.
  */
 #ifdef __cplusplus
-#if defined SAL_W32 || defined SOLARIS || defined LINUX || defined MACOSX || \
-defined FREEBSD || defined NETBSD || defined AIX || \
-defined OPENBSD || defined DRAGONFLY
 #define SAL_CONST_CAST(type, expr) (const_cast type (expr))
-#define SAL_REINTERPRET_CAST(type, expr) (reinterpret_cast type (expr))
 #define SAL_STATIC_CAST(type, expr) (static_cast type (expr))
-#else /* SAL_W32, SOLARIS, LINUX */
-#define SAL_CONST_CAST(type, expr) ((type) (expr))
-#define SAL_REINTERPRET_CAST(type, expr) ((type) (expr))
-#define SAL_STATIC_CAST(type, expr) ((type) (expr))
-#endif /* SAL_W32, SOLARIS, LINUX */
 #endif /* __cplusplus */
 
 /** Definition of function throw clause macros.  These have been introduced
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-04-03 Thread Tor Lillqvist
 sal/inc/sal/types.h |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 9b9f70737e5133c8aa5a95fd2e49a0f9a5e091e6
Author: Tor Lillqvist tlillqv...@suse.com
Date:   Tue Apr 3 20:37:03 2012 +0300

SAL_REINTERPRET_CAST returns, for API stability (for 3rd-party extensions)

diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h
index 8d0bb7e..288c2e7 100644
--- a/sal/inc/sal/types.h
+++ b/sal/inc/sal/types.h
@@ -356,6 +356,7 @@ typedef struct _sal_Sequence
  */
 #ifdef __cplusplus
 #define SAL_CONST_CAST(type, expr) (const_cast type (expr))
+#define SAL_REINTERPRET_CAST(type, expr) (reinterpret_cast type (expr))
 #define SAL_STATIC_CAST(type, expr) (static_cast type (expr))
 #endif /* __cplusplus */
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc sal/rtl sal/util tools/inc

2012-04-02 Thread Michael Meeks
 sal/inc/rtl/ustrbuf.h  |   28 +
 sal/inc/rtl/ustrbuf.hxx|7 ++
 sal/rtl/source/strimp.hxx  |   18 
 sal/rtl/source/string.cxx  |5 
 sal/rtl/source/strtmpl.cxx |8 ---
 sal/rtl/source/uri.cxx |2 +
 sal/rtl/source/ustrbuf.cxx |   50 -
 sal/rtl/source/ustring.cxx |   15 -
 sal/util/sal.map   |2 +
 tools/inc/tools/string.hxx |4 ++-
 10 files changed, 89 insertions(+), 50 deletions(-)

New commits:
commit 1426d4432c59ef42f28642ec63e57517223eb32d
Author: Michael Meeks michael.me...@suse.com
Date:   Fri Mar 30 18:27:58 2012 +0100

sal: expose more stringbuffer related instrumentation points

Avoid ref/unref pair in makeStringAndClear, hook into the
stringbuffer-like 'String' class to expose it's conversion to
immutable strings, and fixup misc. missing instrumentation.

diff --git a/sal/inc/rtl/ustrbuf.h b/sal/inc/rtl/ustrbuf.h
index 0863da0..1051d0d 100644
--- a/sal/inc/rtl/ustrbuf.h
+++ b/sal/inc/rtl/ustrbuf.h
@@ -179,6 +179,34 @@ SAL_DLLPUBLIC void SAL_CALL rtl_uStringbuffer_remove(
sal_Int32 start,
sal_Int32 len );
 
+/**
+Returns an immutable rtl_uString object, while clearing the string buffer.
+
+This method is primarily used to allow these completed
+string allocation events to be traced.
+
+@param  ppThis  The string, on that the operation should take place
+@param  nCapacity   pointer to the capacity of the string buffer
+
+@since LibreOffice 3.6
+ */
+SAL_DLLPUBLIC rtl_uString * SAL_CALL rtl_uStringBuffer_makeStringAndClear(
+/*inout*/ rtl_uString ** ppThis,
+sal_Int32 *nCapacity );
+
+/**
+References and returns an immutable rtl_uString object, from a mutable
+string-buffer object.
+
+This method is primarily used to allow legacy 'String' class
+conversions to OUString to be accurately traced.
+
+@param  pThis  The string, on that the operation should take place
+
+@since LibreOffice 3.6
+ */
+SAL_DLLPUBLIC rtl_uString * SAL_CALL rtl_uStringBuffer_refReturn( rtl_uString 
*pThis );
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 99afe44..02a507c 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -181,10 +181,9 @@ public:
  */
 OUString makeStringAndClear()
 {
-OUString aRet( pData );
-rtl_uString_new(pData);
-nCapacity = 0;
-return aRet;
+return OUString(
+  rtl_uStringBuffer_makeStringAndClear( pData, nCapacity ),
+  SAL_NO_ACQUIRE );
 }
 
 /**
diff --git a/sal/rtl/source/strimp.hxx b/sal/rtl/source/strimp.hxx
index a9e5a38..82f7f41 100644
--- a/sal/rtl/source/strimp.hxx
+++ b/sal/rtl/source/strimp.hxx
@@ -54,6 +54,24 @@ sal_Int16 rtl_ImplGetDigit( sal_Unicode ch, sal_Int16 nRadix 
);
 
 sal_Bool rtl_ImplIsWhitespace( sal_Unicode c );
 
+// string lifetime instrumentation / diagnostics
+#if 0
+#  include rtl/ustring.hxx
+#  define RTL_LOG_STRING_NEW(s)  \
+  do { 
\
+  fprintf (stderr, +%s\n,
\
+   rtl::OUStringToOString(s, RTL_TEXTENCODING_UTF8).getStr()); 
\
+  } while (0)
+#  define RTL_LOG_STRING_DELETE(s)   \
+  do { 
\
+  fprintf (stderr, -%s\n,
\
+   rtl::OUStringToOString(s, RTL_TEXTENCODING_UTF8).getStr()); 
\
+  } while (0)
+#else
+#  define RTL_LOG_STRING_NEW(s)
+#  define RTL_LOG_STRING_DELETE(s)
+#endif
+
 #endif /* INCLUDED_RTL_SOURCE_STRIMP_HXX */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/rtl/source/string.cxx b/sal/rtl/source/string.cxx
index 9c5393f..42c8ae2 100644
--- a/sal/rtl/source/string.cxx
+++ b/sal/rtl/source/string.cxx
@@ -71,6 +71,11 @@ static rtl_String const aImplEmpty_rtl_String =
 #define IMPL_RTL_STRINGDATA rtl_String
 #define IMPL_RTL_EMPTYSTRINGaImplEmpty_rtl_String
 
+#undef RTL_LOG_STRING_NEW
+#define RTL_LOG_STRING_NEW(s)
+#undef RTL_LOG_STRING_DELETE
+#define RTL_LOG_STRING_DELETE(s)
+
 /* === */
 
 /* Include String/UString template code */
diff --git a/sal/rtl/source/strtmpl.cxx b/sal/rtl/source/strtmpl.cxx
index 8e1de8b..2a33907 100644
--- a/sal/rtl/source/strtmpl.cxx
+++ b/sal/rtl/source/strtmpl.cxx
@@ -49,12 +49,6 @@ inline void rtl_str_ImplCopy( IMPL_RTL_STRCODE* pDest,
 }
 */
 
-// for instrumentation / diagnostics
-#ifndef 

[Libreoffice-commits] .: sal/inc

2012-04-02 Thread Lubos Lunak
 sal/inc/rtl/string.hxx  |3 +--
 sal/inc/rtl/ustring.hxx |2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit d5c5800bffe97911497a0603567417dea15f295f
Author: Luboš Luňák l.lu...@suse.cz
Date:   Tue Apr 3 07:38:00 2012 +0200

I'm dumb, fromAscii() stops at \0.

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index a00e186..0f6246b 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -196,8 +196,7 @@ public:
   New string from a string literal.
 
   If there are any embedded \0's in the string literal, the result is 
undefined.
-  Use the overload that explicitly accepts length or cast the literal
-  explicitly to const char*.
+  Use the overload that explicitly accepts length.
 
   @since LibreOffice 3.6
 
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index 518ef3d..ee1ba7f 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -191,7 +191,7 @@ public:
   providing the encoding to use for the conversion.
 
   If there are any embedded \0's in the string literal, the result is 
undefined.
-  Use the overload that explicitly accepts length or fromAscii().
+  Use the overload that explicitly accepts length.
 
   @paramliteral the 8-bit ASCII string literal
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-03-29 Thread Lubos Lunak
 sal/inc/rtl/stringutils.hxx|9 +
 sal/qa/rtl/strings/test_ostring_stringliterals.cxx |   19 ---
 sw/source/filter/ww8/rtfexport.cxx |4 ++--
 sw/source/filter/ww8/rtfexport.hxx |4 ++--
 4 files changed, 29 insertions(+), 7 deletions(-)

New commits:
commit 8aa60b51a9e48b33ba6f0cb27132c6a415de2358
Author: Luboš Luňák l.lu...@suse.cz
Date:   Thu Mar 29 11:03:47 2012 +0200

(const) char[] (i.e. size unknown) cannot be used with O(U)String

msvc can't handle the necessary template overload (and maybe it's
right, I'm not sure)

diff --git a/sal/inc/rtl/stringutils.hxx b/sal/inc/rtl/stringutils.hxx
index 19c1bf4..3ed36a7 100644
--- a/sal/inc/rtl/stringutils.hxx
+++ b/sal/inc/rtl/stringutils.hxx
@@ -65,6 +65,12 @@ There are 2 cases:
 cast to const char*. Additionally (non-const) char[N] needs to be handled, 
but with the reference
 being const, it would also match const char[N], so another overload with a 
reference to non-const
 and NonConstCharArrayDetector are used to ensure the function is called 
only with (non-const) char[N].
+Additionally, char[] and const char[] (i.e. size unknown) are rather tricky. 
Their usage with 'T' would
+mean it would be 'char()[]', which seems to be invalid. But gcc and clang 
somehow manage when it is
+a template. while msvc complains about no conversion from char[] to char[1]. 
And the reference cannot
+be avoided, because 'const char[]' as argument type would match also 'const 
char[N]'
+So char[] and const char[] should always be used with their contents specified 
(which automatically
+turns them into char[N] or const char[N]), or char* and const char* should be 
used.
 */
 struct Dummy {};
 template typename T1, typename T2 
@@ -91,6 +97,8 @@ struct NonConstCharArrayDetector char[ N ], T 
 {
 typedef T Type;
 };
+#ifdef RTL_STRING_UNITTEST
+// never use, until all compilers handle this
 template typename T 
 struct NonConstCharArrayDetector char[], T 
 {
@@ -101,6 +109,7 @@ struct NonConstCharArrayDetector const char[], T 
 {
 typedef T Type;
 };
+#endif
 
 template typename T1, typename T2 
 struct ConstCharArrayDetector
diff --git a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx 
b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
index 0d5036a..d7e3cf5 100644
--- a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
@@ -66,6 +66,9 @@ private:
 
 void testcall( const char str[] );
 
+static const char bad5[];
+static char bad6[];
+
 CPPUNIT_TEST_SUITE(StringLiterals);
 CPPUNIT_TEST(checkCtors);
 CPPUNIT_TEST(checkUsage);
@@ -100,13 +103,20 @@ void test::ostring::StringLiterals::checkCtors()
 const char* bad4[] = { test1 };
 CPPUNIT_ASSERT( !CONST_CTOR_USED( bad4[ 0 ] ));
 testcall( good1 );
+#ifndef _MSC_VER
+// this is actually not supposed to work (see discussion in 
stringutils.hxx),
+// but gcc and clang somehow manage, so keep it used, just in case some 
other problem
+// shows up somewhen in the future
+CPPUNIT_ASSERT( !CONST_CTOR_USED( bad5 )); // size is not known here
+CPPUNIT_ASSERT( !CONST_CTOR_USED( bad6 ));
+#endif
 
 // This one is technically broken, since the first element is 6 characters 
test\0\0,
 // but there does not appear a way to detect this by compile time (runtime 
will complain).
 // RTL_CONSTASCII_USTRINGPARAM() has the same flaw.
-const char bad5[][ 6 ] = { test, test2 };
-CPPUNIT_ASSERT( CONST_CTOR_USED( bad5[ 0 ] ));
-CPPUNIT_ASSERT( CONST_CTOR_USED( bad5[ 1 ] ));
+const char bad7[][ 6 ] = { test, test2 };
+CPPUNIT_ASSERT( CONST_CTOR_USED( bad7[ 0 ] ));
+CPPUNIT_ASSERT( CONST_CTOR_USED( bad7[ 1 ] ));
 
 // Check that contents are correct and equal to the case when const char* ctor 
is used.
 CPPUNIT_ASSERT( rtl::OString( (const char*) ) == rtl::OString(  ));
@@ -128,6 +138,9 @@ void test::ostring::StringLiterals::checkCtors()
 #endif
 }
 
+const char test::ostring::StringLiterals::bad5[] = test;
+char test::ostring::StringLiterals::bad6[] = test;
+
 void test::ostring::StringLiterals::testcall( const char str[] )
 {
 #ifndef _MSC_VER
diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index dda8b81..00b8e18 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -79,10 +79,10 @@ using rtl::OUStringBuffer;
 
 using sw::mark::IMark;
 
-#if defined(UNX)
+#if defined(UNX22)
 const sal_Char RtfExport::sNewLine = '\012';
 #else
-const sal_Char RtfExport::sNewLine[] = \015\012;
+const sal_Char* const RtfExport::sNewLine = \015\012;
 #endif
 
 // the default text encoding for the export, if it doesn't fit unicode will
diff --git a/sw/source/filter/ww8/rtfexport.hxx 
b/sw/source/filter/ww8/rtfexport.hxx
index 3759f31..9d395de 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ 

[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] .: 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/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] .: 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] .: sal/inc

2012-03-12 Thread Josh Heidenreich
 sal/inc/osl/file.hxx |   16 
 1 file changed, 16 deletions(-)

New commits:
commit bde32dc95d33943e301bd165955655eb02e1e223
Author: Josh Heidenreich josh.sickm...@gmail.com
Date:   Tue Mar 13 16:02:18 2012 +1030

Removed FileStatus::isFile. Use ::isRegular instead.

See:
https://bugs.freedesktop.org/show_bug.cgi?id=44982#c6
https://bugs.freedesktop.org/show_bug.cgi?id=44982#c7

for why.

diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx
index 2cc43d0..16f7a06 100644
--- a/sal/inc/osl/file.hxx
+++ b/sal/inc/osl/file.hxx
@@ -733,22 +733,6 @@ public:
 return static_cast Type (_aStatus.eType);
 }
 
-/** Is it a file?
-This method returns True for both regular files, and links.
-
-@return
-True if it's a file, False otherwise.
-
-@see getFileType
-@see isRegular
-@see isLink
-@since LibreOffice 3.6
-*/
-inline sal_Bool isFile() const
-{
-return ( getFileType() == Regular || getFileType() == Link );
-}
-
 /** Is it a directory?
 This method returns True for both directories, and volumes.
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-03-09 Thread Stephan Bergmann
 sal/inc/osl/file.hxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 8840765e2927d036b6c8b4481eabbd4f4fb460a9
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Mar 9 09:23:08 2012 +0100

Fixed @since tags

diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx
index 0ad8922..ee3ac1f 100644
--- a/sal/inc/osl/file.hxx
+++ b/sal/inc/osl/file.hxx
@@ -739,7 +739,7 @@ public:
 @see getFileType
 @see isRegular
 @see isLink
-@since 3.6
+@since LibreOffice 3.6
 */
 inline sal_Bool isFile() const
 {
@@ -753,7 +753,7 @@ public:
 True if it's a directory, False otherwise.
 
 @see getFileType
-@since 3.6
+@since LibreOffice 3.6
 */
 inline sal_Bool isDirectory() const
 {
@@ -768,7 +768,7 @@ public:
 @see getFileType
 @see isFile
 @see isLink
-@since 3.6
+@since LibreOffice 3.6
 */
 inline sal_Bool isRegular() const
 {
@@ -781,7 +781,7 @@ public:
 True if it's a link, False otherwise.
 
 @see getFileType
-@since 3.6
+@since LibreOffice 3.6
 */
 inline sal_Bool isLink() const
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc tools/source

2012-03-09 Thread Stephan Bergmann
 sal/inc/osl/file.hxx|   47 ++--
 tools/source/stream/strmunx.cxx |4 +--
 2 files changed, 29 insertions(+), 22 deletions(-)

New commits:
commit 608fe962cc649ad62c489811d3a8666e0e06e5e7
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Mar 9 11:52:09 2012 +0100

Let osl::FileStatus getters assert programming errors

...instead of arbitrarily returning certain values when the requested
information is not available.

This reveals a problem in strmunx.cxx that is apparently a regression 
introduced
with 4a086fca7b0a77c20bc9f1c97507966e2861f3da fix SvStream to not require a
custom open or lstat method.

diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx
index ee3ac1f..2cc43d0 100644
--- a/sal/inc/osl/file.hxx
+++ b/sal/inc/osl/file.hxx
@@ -29,14 +29,16 @@
 #ifndef _OSL_FILE_HXX_
 #define _OSL_FILE_HXX_
 
-#ifdef __cplusplus
+#include sal/config.h
+
+#include cassert
 
 #include osl/time.h
-#   include rtl/memory.h
-#   include rtl/ustring.hxx
+#include rtl/memory.h
+#include rtl/ustring.hxx
 
 #include osl/file.h
-#   include rtl/byteseq.hxx
+#include rtl/byteseq.hxx
 
 #include stdio.h
 
@@ -723,11 +725,12 @@ public:
 /** Get the file type.
 
 @return
-The file type if this information is valid, Unknown otherwise.
+The file type.
 */
 inline Type getFileType() const
 {
-return (_aStatus.uValidFields  osl_FileStatus_Mask_Type) ?  (Type) 
_aStatus.eType : Unknown;
+assert(isValid(osl_FileStatus_Mask_Type));
+return static_cast Type (_aStatus.eType);
 }
 
 /** Is it a file?
@@ -796,88 +799,93 @@ public:
 
 inline sal_uInt64 getAttributes() const
 {
+assert(isValid(osl_FileStatus_Mask_Attributes));
 return _aStatus.uAttributes;
 }
 
 /** Get the creation time of this file.
 
 @return
-The creation time if this information is valid,
-an uninitialized TimeValue otherwise.
+The creation time.
 */
 
 inline TimeValue getCreationTime() const
 {
+assert(isValid(osl_FileStatus_Mask_CreationTime));
 return _aStatus.aCreationTime;
 }
 
 /** Get the file access time.
 
 @return
-The last access time if this information is valid,
-an uninitialized TimeValue otherwise.
+The last access time.
 */
 
 inline TimeValue getAccessTime() const
 {
+assert(isValid(osl_FileStatus_Mask_AccessTime));
 return _aStatus.aAccessTime;
 }
 
 /** Get the file modification time.
 
 @return
-The last modified time if this information is valid,
-an uninitialized TimeValue otherwise.
+The last modified time.
 */
 
 inline TimeValue getModifyTime() const
 {
+assert(isValid(osl_FileStatus_Mask_ModifyTime));
 return _aStatus.aModifyTime;
 }
 
 /** Get the size of the file.
 
 @return
-The actual file size if this information is valid, 0 otherwise.
+The actual file size.
 */
 
 inline sal_uInt64 getFileSize() const
 {
+assert(isValid(osl_FileStatus_Mask_FileSize));
 return _aStatus.uFileSize;
 }
 
 /** Get the file name.
 
 @return
-The file name if this information is valid, an empty string otherwise.
+The file name.
 */
 
 inline ::rtl::OUString getFileName() const
 {
-return _aStatus.ustrFileName ? ::rtl::OUString(_aStatus.ustrFileName) 
: ::rtl::OUString();
+assert(isValid(osl_FileStatus_Mask_FileName));
+return rtl::OUString(_aStatus.ustrFileName);
 }
 
 
 /** Get the URL of the file.
 
 @return
-The full qualified URL of the file if this information is valid, an 
empty string otherwise.
+The full qualified URL of the file.
 */
 
 inline ::rtl::OUString getFileURL() const
 {
-return _aStatus.ustrFileURL ? ::rtl::OUString(_aStatus.ustrFileURL) : 
::rtl::OUString();
+assert(isValid(osl_FileStatus_Mask_FileURL));
+return rtl::OUString(_aStatus.ustrFileURL);
 }
 
 /** Get the link target URL.
 
 @return
-The link target URL if this information is valid, an empty string 
otherwise.
+The link target URL.
 */
 
 inline ::rtl::OUString getLinkTargetURL() const
 {
-return _aStatus.ustrLinkTargetURL ? 
::rtl::OUString(_aStatus.ustrLinkTargetURL) : ::rtl::OUString();
+assert(isValid(osl_FileStatus_Mask_LinkTargetURL));
+return rtl::OUString(_aStatus.ustrLinkTargetURL);
 }
 
 friend class DirectoryItem;
@@ -1947,7 +1955,6 @@ public:
 
 } /* namespace osl */
 
-#endif  /* __cplusplus */
 #endif  /* _OSL_FILE_HXX_ */
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index cb55ddc..2317120 100644
--- 

[Libreoffice-commits] .: sal/inc

2012-02-16 Thread Stephan Bergmann
 sal/inc/sal/types.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e2de115700e7c6c5ee9118c17c06eda0c462f394
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Feb 16 13:10:58 2012 +0100

-Wundef

diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h
index 1bed00c..e8b5662 100644
--- a/sal/inc/sal/types.h
+++ b/sal/inc/sal/types.h
@@ -93,7 +93,7 @@ typedef unsigned char   sal_uInt8;
  #error Could not find 32-bit type, add support for your architecture
 #endif
 
-#if (_MSC_VER = 1000)
+#if defined _MSC_VER  _MSC_VER = 1000
 typedef __int64  sal_Int64;
 typedef unsigned __int64 sal_uInt64;
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-02-14 Thread Stephan Bergmann
 sal/inc/rtl/instance.hxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 3073b539d28a4ea29347e8060e19dda080c5d13b
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Feb 14 12:32:54 2012 +0100

Make code exploiting -fthreadsafe-statics properly conditional

Looks like 979e2c8f8b9325a5c75bfc1f388aa8f69b988d2c missed these.

diff --git a/sal/inc/rtl/instance.hxx b/sal/inc/rtl/instance.hxx
index 943a449..9520dac 100644
--- a/sal/inc/rtl/instance.hxx
+++ b/sal/inc/rtl/instance.hxx
@@ -446,7 +446,7 @@ private:
   using the outer class
   (the one that derives from this base class)
 */
-#if (__GNUC__ = 4)
+#if defined HAVE_THREADSAFE_STATICS
 templatetypename T, typename Data, typename Unique
 class StaticWithArg {
 public:
@@ -528,7 +528,7 @@ private:
 @tparam InitAggregate
   initializer functor class
 */
-#if (__GNUC__ = 4)
+#if defined HAVE_THREADSAFE_STATICS
 templatetypename T, typename InitAggregate
 class StaticAggregate {
 public:
@@ -593,7 +593,7 @@ public:
   Initializer functor's return type.
   Default is T (common practice).
 */
-#if (__GNUC__ = 4)
+#if defined HAVE_THREADSAFE_STATICS
 templatetypename T, typename InitData,
  typename Unique = InitData, typename Data = T
 class StaticWithInit {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-02-10 Thread Lubos Lunak
 sal/inc/osl/module.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 31e236c5efa01ac5c681a2f18774fe66a9e1249e
Author: Luboš Luňák l.lu...@suse.cz
Date:   Fri Feb 10 13:33:22 2012 +0100

consistent constness for getFunctionSymbol() overloads

This is an inline function, so there should be no problems with binary
compatibility.

diff --git a/sal/inc/osl/module.hxx b/sal/inc/osl/module.hxx
index c8d39a2..0d7bca6 100644
--- a/sal/inc/osl/module.hxx
+++ b/sal/inc/osl/module.hxx
@@ -147,7 +147,7 @@ public:
 
 @see getSymbol
 */
-oslGenericFunction SAL_CALL getFunctionSymbol( const ::rtl::OUString 
ustrFunctionSymbolName )
+oslGenericFunction SAL_CALL getFunctionSymbol( const ::rtl::OUString 
ustrFunctionSymbolName ) const
 {
 return ( osl_getFunctionSymbol( m_Module, ustrFunctionSymbolName.pData 
) );
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-02-05 Thread François Tigeot
 sal/inc/osl/file.h|   43 
 sal/inc/osl/file.hxx  |   28 -
 sal/osl/unx/file_volume.cxx   |   80 --
 sal/osl/w32/file_dirvol.cxx   |   18 
 sal/qa/helper/gcov/deprecated.txt |2 
 sal/util/sal.map  |2 
 6 files changed, 173 deletions(-)

New commits:
commit 32009128e4c77cfd6506ab50a5345776de8144e6
Author: François Tigeot ftig...@wolfpond.org
Date:   Sun Feb 5 18:33:57 2012 +0100

Remove unused VolumeDevice functions and related code

diff --git a/sal/inc/osl/file.h b/sal/inc/osl/file.h
index 3bcd877..2c2713b 100644
--- a/sal/inc/osl/file.h
+++ b/sal/inc/osl/file.h
@@ -467,47 +467,6 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_getFileStatus(
 
 typedef void *oslVolumeDeviceHandle;
 
-
-/** Unmount a volume device.
-
-Unmount the volume specified by the given oslVolumeDeviceHandle.
-
-@param Handle [in]
-An oslVolumeDeviceHandle received by a call to osl_getVolumeInformation().
-
-@return
-osl_File_E_None on successbr
-
-@todo
-specify all error codes that may be returned
-
-@see osl_getVolumeInformation()
-*/
-
-SAL_DLLPUBLIC oslFileError SAL_CALL osl_unmountVolumeDevice(
-oslVolumeDeviceHandle Handle );
-
-
-/** Automount a volume device.
-
-Automount the volume device specified by the given oslVolumeDeviceHandle.
-
-@param Handle [in]
-An oslVolumeDeviceHandle received by a call to osl_getVolumeInformation().
-
-@return
-osl_File_E_None on successbr
-
-@todo
-specify all error codes that may be returned
-
-@see osl_getVolumeInformation()
-*/
-
-SAL_DLLPUBLIC oslFileError SAL_CALL osl_automountVolumeDevice(
-oslVolumeDeviceHandle Handle );
-
-
 /** Release a volume device handle.
 
 Releases the given oslVolumeDeviceHandle which was acquired by a call to
@@ -575,8 +534,6 @@ SAL_DLLPUBLIC oslFileError SAL_CALL 
osl_acquireVolumeDeviceHandle(
 osl_File_E_EOVERFLOW value too large for defined data typebr
 
 @seeosl_getVolumeInformation()
-@seeosl_automountVolumeDevice()
-@seeosl_unmountVolumeDevice()
 */
 
 SAL_DLLPUBLIC oslFileError SAL_CALL osl_getVolumeDeviceMountPath(
diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx
index d63126b..8c97750 100644
--- a/sal/inc/osl/file.hxx
+++ b/sal/inc/osl/file.hxx
@@ -388,34 +388,6 @@ public:
 return *this;
 }
 
-/** Automount a volume device.
-
-@return
-E_None on success
-
-@todo
-specify all error codes that may be returned
-*/
-
-inline RC automount()
-{
-return (RC)osl_automountVolumeDevice( _aHandle );
-}
-
-/** Unmount a volume device.
-
-@return
-E_None on success
-
-@todo
-specify all error codes that may be returned
-*/
-
-inline RC unmount()
-{
-return (RC)osl_unmountVolumeDevice( _aHandle );
-}
-
 /** Get the full qualified URL where a device is mounted to.
 
@return
diff --git a/sal/osl/unx/file_volume.cxx b/sal/osl/unx/file_volume.cxx
index ce9f832..42965a7 100644
--- a/sal/osl/unx/file_volume.cxx
+++ b/sal/osl/unx/file_volume.cxx
@@ -59,14 +59,12 @@
 #include sys/mnttab.h
 #include sys/statvfs.h
 #define  HAVE_STATFS_H
-static const sal_Char* MOUNTTAB=/etc/mnttab;
 
 #elif defined(LINUX)
 
 #include mntent.h
 #include sys/vfs.h
 #define  HAVE_STATFS_H
-static const sal_Char* MOUNTTAB=/etc/mtab;
 
 #elif defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD) || 
defined(DRAGONFLY)
 
@@ -75,16 +73,11 @@ static const sal_Char* MOUNTTAB=/etc/mtab;
 #include sys/mount.h
 #define  HAVE_STATFS_H
 
-/* No mounting table on *BSD
- * This information is stored only in the kernel. */
-/* static const sal_Char* MOUNTTAB=/etc/mtab; */
-
 #elif defined(MACOSX)
 
 #include sys/param.h
 #include sys/mount.h
 #define HAVE_STATFS_H
-// static const sal_Char* MOUNTTAB=/etc/mtab;
 
 #endif /* HAVE_STATFS_H */
 
@@ -360,42 +353,6 @@ static oslFileError osl_psz_getVolumeInformation (
  *
  */
 
-
-/*
- * osl_unmountVolumeDevice
- /
-
-oslFileError osl_unmountVolumeDevice( oslVolumeDeviceHandle Handle )
-{
-oslFileError tErr = osl_File_E_NOSYS;
-
- /* Perhaps current working directory is set to mount point */
-
- if ( tErr )
-{
-sal_Char *pszHomeDir = getenv(HOME);
-
-if ( pszHomeDir  strlen( pszHomeDir )  0 == chdir( pszHomeDir ) )
-{
-/* try again */
-OSL_ENSURE( tErr, osl_unmountVolumeDevice: CWD was set to volume 
mount point );
-}
-}
-
-return tErr;
-}
-
-/*
- * osl_automountVolumeDevice
- /
-
-oslFileError osl_automountVolumeDevice( oslVolumeDeviceHandle Handle )

[Libreoffice-commits] .: sal/inc

2012-01-30 Thread Miklos Vajna
 sal/inc/sal/log-areas.dox |1 +
 1 file changed, 1 insertion(+)

New commits:
commit f7aac5d4a5f7da91aae2eef906140df4a522e07f
Author: Miklos Vajna vmik...@frugalware.org
Date:   Mon Jan 30 14:21:10 2012 +0100

sal: add sw.rtf log area

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 5c10567..42a96ae 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -21,6 +21,7 @@ certain functionality.
 
 @li sw.uno - Writer's UNO interfaces
 @li sw.ww8 - .doc/.docx export filter, .doc import filter (not writerfilter)
+@li sw.rtf - .rtf export filter
 
 @section StarMath
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-01-30 Thread David Tardon
 sal/inc/sal/log-areas.dox |4 
 1 file changed, 4 insertions(+)

New commits:
commit bfd9753b92c225d7cc2b2d3172b26eb53a8e9228
Author: David Tardon dtar...@redhat.com
Date:   Tue Jan 31 07:18:49 2012 +0100

add vcl log area

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 42a96ae..d0cbaee 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -17,6 +17,10 @@ certain functionality.
 
 @li oox.xmlstream - XmlStream class
 
+@section VCL
+
+@li vcl.gtk - Gtk+ 2/3 plugin
+
 @section Writer
 
 @li sw.uno - Writer's UNO interfaces
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc sal/osl sal/util tools/inc tools/source

2012-01-19 Thread Michael Meeks
 sal/inc/osl/detail/file.h   |   12 --
 sal/inc/osl/file.h  |1 
 sal/osl/unx/file.cxx|2 -
 sal/osl/unx/file_stat.cxx   |   12 --
 sal/util/sal.map|2 -
 tools/inc/tools/stream.hxx  |4 +-
 tools/source/stream/strmunx.cxx |   71 +++-
 7 files changed, 38 insertions(+), 66 deletions(-)

New commits:
commit 4a086fca7b0a77c20bc9f1c97507966e2861f3da
Author: Michael Meeks michael.me...@suse.com
Date:   Thu Jan 19 12:23:23 2012 +

fix SvStream to not require a custom open or lstat method.

diff --git a/sal/inc/osl/detail/file.h b/sal/inc/osl/detail/file.h
index 108d230..065c355 100644
--- a/sal/inc/osl/detail/file.h
+++ b/sal/inc/osl/detail/file.h
@@ -49,25 +49,13 @@ extern C {
 #define osl_File_OpenFlag_Trunc 0x0010L
 #define osl_File_OpenFlag_NoExcl0x0020L
 
-/* Variant of osl_openFile that takes the file pathname directly as a
-   char*
-*/
-
-SAL_DLLPUBLIC oslFileError SAL_CALL osl_openFilePath(
-const char *cpFilePath,
-oslFileHandle *pHandle,
-sal_uInt32 uFlags );
-
 /* Compare directory items for being the same underlying file
  * this unwinds unix hard-links and symlinks etc.
  */
 
 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_identicalDirectoryItem(oslDirectory a, 
oslDirectory b);
 
-SAL_DLLPUBLIC oslFileError SAL_CALL osl_lstatFilePath( const char *cpFilePath, 
struct stat *statb );
-
 /*  Get the OS specific handle of an open file. */
-
 SAL_DLLPUBLIC oslFileError SAL_CALL osl_getFileOSHandle(
 oslFileHandle Handle,
 sal_IntPtr *piFileHandle );
diff --git a/sal/inc/osl/file.h b/sal/inc/osl/file.h
index 2a8cf37..0e0d765 100644
--- a/sal/inc/osl/file.h
+++ b/sal/inc/osl/file.h
@@ -664,6 +664,7 @@ typedef void *oslFileHandle;
 #define osl_File_OpenFlag_Write 0x0002L
 #define osl_File_OpenFlag_Create0x0004L
 #define osl_File_OpenFlag_NoLock0x0008L
+/* larger bit-fields reserved for internal use cf. detail/file.h */
 
 /** Open a regular file.
 
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 64ce977..7bb6bae 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -892,7 +892,7 @@ SAL_CALL osl_openMemoryAsFile( void *address, size_t size, 
oslFileHandle *pHandl
 #define OPEN_CREATE_FLAGS ( O_CREAT | O_RDWR )
 #endif
 
-oslFileError
+static oslFileError
 SAL_CALL osl_openFilePath( const char *cpFilePath, oslFileHandle* pHandle, 
sal_uInt32 uFlags )
 {
 oslFileError eRet;
diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx
index 0477a52..320744f 100644
--- a/sal/osl/unx/file_stat.cxx
+++ b/sal/osl/unx/file_stat.cxx
@@ -462,7 +462,6 @@ SAL_CALL osl_identicalDirectoryItem( oslDirectoryItem a, 
oslDirectoryItem b)
 return sal_True;
 
 fprintf (stderr, We have to do an inode compare !\n);
-
 /*
 int rc = stat_c( cpFilePath, statb );
 
@@ -475,15 +474,4 @@ SAL_CALL osl_identicalDirectoryItem( oslDirectoryItem a, 
oslDirectoryItem b)
 return sal_False;
 }
 
-oslFileError
-SAL_CALL osl_lstatFilePath( const char *cpFilePath, struct stat *statb )
-{
-int rc = lstat_c( cpFilePath, statb );
-
-if (rc == -1)
-return oslTranslateFileError(OSL_FET_ERROR, errno);
-else
-return osl_File_E_None;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/util/sal.map b/sal/util/sal.map
index 26c30fc..02610f5 100644
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -647,9 +647,7 @@ PRIVATE_textenc.1 { # LibreOffice 3.6
 
 PRIVATE_file.1 { # LibreOffice 3.6
 global:
-osl_openFilePath;
 osl_identicalDirectoryItem;
-osl_lstatFilePath;
 osl_getFileOSHandle;
 };
 
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 37b7c3f..8c7fa0c 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -576,10 +576,10 @@ class TOOLS_DLLPUBLIC SvFileStream : public SvStream
 friend class FileCopier;
 
 private:
-StreamData* pInstanceData;
+StreamData* pInstanceData;
 String  aFilename;
 sal_uInt16  nLockCounter;
-sal_BoolbIsOpen;
+sal_BoolbIsOpen;
 sal_uInt32  GetFileHandle() const;
 
 // Forbidden and not implemented.
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index 0fcddbd..d2135fa 100644
--- a/tools/source/stream/strmunx.cxx
+++ b/tools/source/stream/strmunx.cxx
@@ -223,7 +223,7 @@ class StreamData
 public:
 oslFileHandle rHandle;
 
-StreamData() { }
+StreamData() : rHandle( 0 ) { }
 };
 
 // ---
@@ -683,8 +683,6 @@ void SvFileStream::Open( const String rFilename, 
StreamMode nOpenMode )
 {
 sal_uInt32 uFlags;
 oslFileHandle nHandleTmp;
-struct stat buf;
-sal_Bool bStatValid = sal_False;
 
 Close();
 errno = 0;
@@ -707,16 +705,22 @@ void SvFileStream::Open( const 

[Libreoffice-commits] .: sal/inc sal/util tools/source

2012-01-19 Thread Michael Meeks
 sal/inc/osl/file.h  |   24 
 sal/inc/osl/file.hxx|   26 +-
 sal/util/sal.map|2 +-
 tools/source/stream/strmunx.cxx |2 +-
 4 files changed, 51 insertions(+), 3 deletions(-)

New commits:
commit 13a752cdbb9e2c1e2c0f922158f03fc70c12245c
Author: Michael Meeks michael.me...@suse.com
Date:   Thu Jan 19 14:01:33 2012 +

sal: expose a public API for comparing directory items

Windows impl. still pending.

diff --git a/sal/inc/osl/file.h b/sal/inc/osl/file.h
index 0e0d765..3bcd877 100644
--- a/sal/inc/osl/file.h
+++ b/sal/inc/osl/file.h
@@ -316,6 +316,30 @@ SAL_DLLPUBLIC oslFileError SAL_CALL 
osl_acquireDirectoryItem(
 SAL_DLLPUBLIC oslFileError SAL_CALL osl_releaseDirectoryItem(
 oslDirectoryItem Item );
 
+/** Determine if two directory items point the the same underlying file
+
+The comparison is done first by URL, and then by resolving links to
+find the target, and finally by comparing inodes on unix.
+
+@param  pItemA [in]
+A directory handle to compare with another handle
+
+@param  pItemB [in]
+A directory handle to compare with pItemA
+
+@return
+sal_True: if the items point to an identical resourcebr
+sal_False: if the items point to a different resource, or a fatal error 
occuredbr
+
+@see osl_getDirectoryItem()
+
+@since LibreOffice 3.6
+*/
+
+SAL_DLLPUBLIC sal_Bool SAL_CALL osl_identicalDirectoryItem(
+oslDirectoryItem pItemA,
+oslDirectoryItem pItemB );
+
 /* File types */
 
 typedef enum {
diff --git a/sal/inc/osl/file.hxx b/sal/inc/osl/file.hxx
index d9a1d89..85393f5 100644
--- a/sal/inc/osl/file.hxx
+++ b/sal/inc/osl/file.hxx
@@ -1389,9 +1389,9 @@ public:
 
 class DirectoryItem: public FileBase
 {
+oslDirectoryItem _pData;
 
 public:
-oslDirectoryItem _pData;
 
 /** Constructor.
 */
@@ -1529,6 +1529,30 @@ public:
 return (RC) osl_getFileStatus( _pData, rStatus._aStatus, 
rStatus._nMask );
 }
 
+/** Determine if two directory items point the the same underlying file
+
+The comparison is done first by URL, and then by resolving links to
+find the target, and finally by comparing inodes on unix.
+
+@param  pItemA [in]
+A directory handle to compare with another handle
+
+@param  pItemB [in]
+A directory handle to compare with pItemA
+
+@return
+sal_True: if the items point to an identical resourcebr
+sal_False: if the items point to a different resource, or a fatal error 
occuredbr
+
+@see osl_getDirectoryItem()
+
+@since LibreOffice 3.6
+*/
+inline sal_Bool isIdenticalTo( const DirectoryItem pOther )
+{
+return osl_identicalDirectoryItem( _pData, pOther._pData );
+}
+
 friend class Directory;
 };
 
diff --git a/sal/util/sal.map b/sal/util/sal.map
index 02610f5..1e9753b 100644
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -613,6 +613,7 @@ LIBO_UDK_3.5 { # symbols available in = LibO 3.5
 LIBO_UDK_3.6 { # symbols available in = LibO 3.6
 global:
 osl_unmapMappedFile;
+osl_identicalDirectoryItem;
 } UDK_3.10;
 
 PRIVATE_1.0 {
@@ -647,7 +648,6 @@ PRIVATE_textenc.1 { # LibreOffice 3.6
 
 PRIVATE_file.1 { # LibreOffice 3.6
 global:
-osl_identicalDirectoryItem;
 osl_getFileOSHandle;
 };
 
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index 850eedc..031aaa5 100644
--- a/tools/source/stream/strmunx.cxx
+++ b/tools/source/stream/strmunx.cxx
@@ -146,7 +146,7 @@ sal_Bool InternalStreamLock::LockFile( sal_Size nStart, 
sal_Size nEnd, SvFileStr
 for( size_t i = 0; i  rLockList.size(); ++i )
 {
 pLock = rLockList[ i ];
-if( osl_identicalDirectoryItem( aItem._pData, pLock-m_aItem._pData) )
+if( aItem.isIdenticalTo( pLock-m_aItem ) )
 {
 sal_Bool bDenyByOptions = sal_False;
 StreamMode nLockMode = pLock-m_pStream-GetStreamMode();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2012-01-13 Thread Norbert Thiebaud
 sal/inc/osl/security.h |2 -
 sal/inc/osl/semaphor.h |2 -
 sal/inc/osl/socket.h   |   80 -
 sal/inc/osl/time.h |   16 -
 4 files changed, 50 insertions(+), 50 deletions(-)

New commits:
commit 1b8b6ecf5fdf753bd787748d54aaa61964199465
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Fri Jan 13 02:30:20 2012 -0600

suppress doxygen warning in osl

diff --git a/sal/inc/osl/security.h b/sal/inc/osl/security.h
index ed9d9b5..85e8abd 100644
--- a/sal/inc/osl/security.h
+++ b/sal/inc/osl/security.h
@@ -61,7 +61,7 @@ SAL_DLLPUBLIC oslSecurity SAL_CALL 
osl_getCurrentSecurity(void);
 /** Deprecated API
 Create a security handle for the denoted user.
 Try to log in the user on the local system.
-@param[in] strzUserName denotes the name of the user to logg in.
+@param[in] strUserName denotes the name of the user to logg in.
 @param[in] strPasswd the password for this user.
 @param[out] pSecurity returns the security handle if user could be logged 
in.
 @return osl_Security_E_None if user could be logged in, otherwise an 
error-code.
diff --git a/sal/inc/osl/semaphor.h b/sal/inc/osl/semaphor.h
index 0a10a37..fb0cc71 100644
--- a/sal/inc/osl/semaphor.h
+++ b/sal/inc/osl/semaphor.h
@@ -42,7 +42,7 @@ typedef void* oslSemaphore;
 @deprecated
 Must not be used, as unnamed semaphores are not supported on Mac OS X.
 
-@param InitialCount denotes the starting value the semaphore. If you set 
it to
+@param initialCount denotes the starting value the semaphore. If you set 
it to
 zero, the first acquire() blocks. Otherwise InitialCount acquire()s  are
 immedeatly  successfull.
 @return 0 if the semaphore could not be created, otherwise a handle to the 
sem.
diff --git a/sal/inc/osl/socket.h b/sal/inc/osl/socket.h
index 87df672..19554e6 100644
--- a/sal/inc/osl/socket.h
+++ b/sal/inc/osl/socket.h
@@ -229,7 +229,7 @@ SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isEqualSocketAddr(
 oslSocketAddr Addr1, oslSocketAddr Addr2);
 
 /** Uses the systems name-service interface to find an address for strHostname.
-@param strHostname [in] The name for which you search for an address.
+@param[in] strHostname The name for which you search for an address.
 @return The desired address if one could be found, otherwise 0.
 Don't forget to destroy the address if you don't need it any longer.
 */
@@ -241,8 +241,8 @@ SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_resolveHostname(
 in dotted decimal notation as first argument.
 @seeosl_sendToSocket()
 @seeoslSocketAddr
-@param  strDottedAddr [in] dotted decimal internet address, may be 0.
-@param  Port  [in] port number in host byte order.
+@param[in]  strDottedAddr dotted decimal internet address, may be 0.
+@param[in]  Port port number in host byte order.
 @return 0 if address could not be created.
 */
 SAL_DLLPUBLIC oslSocketAddr SAL_CALL osl_createInetBroadcastAddr (
@@ -292,7 +292,7 @@ SAL_DLLPUBLIC sal_Int32 SAL_CALL 
osl_getInetPortOfSocketAddr(
 
 
 /** Sets the Port of Addr.
-@param Port [in] is expected in host byte-order.
+@param[in] Port is expected in host byte-order.
 @return codesal_False/code if Addr is not an inet-addr.
 */
 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setInetPortOfSocketAddr(
@@ -337,8 +337,8 @@ typedef struct oslHostAddrImpl * oslHostAddr;
 
 
 /** Create an oslHostAddr from given hostname and socket address.
-@param strHostname [in] The hostname to be stored.
-@param Addr [in] The socket address to be stored.
+@param[in] strHostname The hostname to be stored.
+@param[in] Addr The socket address to be stored.
 @return The created address or 0 upon failure.
 */
 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddr(
@@ -349,7 +349,7 @@ SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddr(
 Successful name resolution should result in the fully qualified
 domain name (FQDN) and it's address as hostname and socket address
 members of the resulting oslHostAddr.
-@param strHostname [in] The hostname to be resolved.
+@param[in] strHostname The hostname to be resolved.
 @return The resulting address or 0 upon failure.
 */
 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddrByName(rtl_uString 
*strHostname);
@@ -359,7 +359,7 @@ SAL_DLLPUBLIC oslHostAddr SAL_CALL 
osl_createHostAddrByName(rtl_uString *strHost
 Successful name resolution should result in the fully qualified
 domain name (FQDN) and it's address as hostname and socket address
 members of the resulting oslHostAddr.
-@param Addr [in] The socket address to be reverse resolved.
+@param[in] Addr The socket address to be reverse resolved.
 @return The resulting address or 0 upon failure.
 */
 SAL_DLLPUBLIC oslHostAddr SAL_CALL osl_createHostAddrByAddr(const 
oslSocketAddr Addr);
@@ -447,8 +447,8 @@ SAL_DLLPUBLIC oslSocketAddr SAL_CALL 

[Libreoffice-commits] .: sal/inc

2012-01-12 Thread Stephan Bergmann
 sal/inc/sal/log.hxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit ddc3458259222720d000ccc9cc5e6bd9b09ef3c9
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Jan 12 10:57:41 2012 +0100

Make it clear that sal/log.hxx functionality may change again.

diff --git a/sal/inc/sal/log.hxx b/sal/inc/sal/log.hxx
index 6eb152b..816d57a 100644
--- a/sal/inc/sal/log.hxx
+++ b/sal/inc/sal/log.hxx
@@ -153,6 +153,9 @@ inline char const * unwrapStream(StreamIgnore const ) {
 Potentially not only useful within the log framework (where it is used
 automatically), but also when creating exception messages.
 
+@attention For now, this functionality should only be used internally 
within
+LibreOffice. It may change again in a future version.
+
 @since LibreOffice 3.5
 */
 #define SAL_WHERE SAL_DETAIL_WHERE
@@ -166,6 +169,9 @@ inline char const * unwrapStream(StreamIgnore const ) {
 
   SAL_INFO(foo, object:   (hasName ? obj-name : SAL_STREAM(obj)));
 
+@attention For now, this functionality should only be used internally 
within
+LibreOffice. It may change again in a future version.
+
 @since LibreOffice 3.5
 */
 #define SAL_STREAM(stream) \
@@ -251,6 +257,9 @@ inline char const * unwrapStream(StreamIgnore const ) {
 change.  The log output is printed to stderr without further text encoding
 conversion.
 
+@attention For now, this functionality should only be used internally 
within
+LibreOffice. It may change again in a future version.
+
 @since LibreOffice 3.5
 */
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc sal/osl sal/util store/source xmlreader/source

2011-12-21 Thread Tor Lillqvist
 sal/inc/osl/file.h |   45 
 sal/osl/unx/file.cxx   |   56 -
 sal/osl/w32/file.cxx   |7 +
 sal/util/sal.map   |5 +++
 store/source/lockbyte.cxx  |   14 ++
 xmlreader/source/xmlreader.cxx |4 +-
 6 files changed, 112 insertions(+), 19 deletions(-)

New commits:
commit e3ab0fd9016bc24c5a0eb0807f171d5025c3bb79
Author: Tor Lillqvist tlillqv...@suse.com
Date:   Wed Dec 21 13:51:50 2011 +0200

osl_unmapFile can't work for files bundled inside the .apk on Android

On Android, when an app is installed, arbitrary files bundled in the
app won't be unpacked into actual separate files in the file
system. They will exist only as archive entries in the .apk file
(which is a zip archive).

The SDK tooling puts such files under the /assets folder in the
.apk. The LibreOffice bootstrapping code for Android maps the .apk
file into memory.

osl_openFile() knows about the /assets special case, and uses a
separate abstraction for such memory-mapped files.

Obviously, when producing an .apk, one needs to make sure these
bundled files are not compressed, if one wants to be able to use them
directly from the memory-mapped .apk file. We do that in our test and
sample Android projects.

When mapping such files under /assets , just return a pointer to the
file's location inside the mapped .apk archive.

We can't use the old osl_unmapFile() on such mapped files, as that
would unexpectedly unmap fairly arbitrary pages of the .apk mapping,
wreaking havoc on later use of the same pages.

So, introduce a new osl_unmapMappedFile() function that takes also the
oslFileHandle originally passed to osl_mapFile(). Use this instead in
the few places where the code actually called osl_unmapFile(). Make
sure osl_mapFile() is nonexistent on Android.

diff --git a/sal/inc/osl/file.h b/sal/inc/osl/file.h
index cc12b1c..ecf9e60 100644
--- a/sal/inc/osl/file.h
+++ b/sal/inc/osl/file.h
@@ -680,6 +680,12 @@ typedef void *oslFileHandle;
 @param uFlags [in]
 Specifies the open mode.
 
+On Android, if the file path is below the /assets folder, the file
+exists only as a hopefully uncompressed element inside the app
+package (.apk), which has been mapped into memory as a whole by
+the LibreOffice Android bootstrapping code. So files opened from
+there aren't actually files in the OS sense.
+
 @return
 osl_File_E_None on successbr
 osl_File_E_NOMEM not enough memory for allocating structures br
@@ -837,6 +843,15 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_getFileSize(
 
 /** Map a shared file into memory.
 
+Don't know what the shared is supposed to mean there? Also,
+obviously this API can be used to map *part* of a file into
+memory, and different parts can be mapped separately even.
+
+On Android, if the Handle refers to a file that is actually inside
+the app package (.apk zip archive), no new mapping is created,
+just a pointer to the file inside the already mapped .apk is
+returned.
+
 @since UDK 3.2.10
  */
 SAL_DLLPUBLIC oslFileError SAL_CALL osl_mapFile (
@@ -848,8 +863,19 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_mapFile (
 );
 
 
+#ifndef ANDROID
+
 /** Unmap a shared file from memory.
 
+Ditto here, why do we need to mention shared?
+
+This function just won't work on Android in general where for
+(uncompressed) files inside the .apk, per SDK conventions in the
+/assets folder, osl_mapFile() returns a pointer to the file inside
+the already by LibreOffice Android-specific bootstrapping code
+mmapped .apk archive. We can't go and randomly munmap part of the
+.apk archive. So this function is not present on Android.
+
 @since UDK 3.2.10
  */
 SAL_DLLPUBLIC oslFileError SAL_CALL osl_unmapFile (
@@ -857,6 +883,25 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_unmapFile (
   sal_uInt64 uLength
 );
 
+#endif
+
+/** Unmap a file segment from memory.
+
+Like osl_unmapFile(), but takes also the oslFileHandle argument
+passed to osl_mapFile() when creating this mapping.
+
+On Android, for files below /assets, i.e. located inside the app
+archive (.apk), this won't actually unmap anything; all the .apk
+stays mapped.
+
+@since UDK 3.6
+ */
+SAL_DLLPUBLIC oslFileError SAL_CALL osl_unmapMappedFile (
+  oslFileHandle Handle,
+  void*  pAddr,
+  sal_uInt64 uLength
+);
+
 
 /** Read a number of bytes from a file.
 
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index f060413..458554e 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -865,7 +865,6 @@ SAL_CALL osl_openMemoryAsFile( void *address, size_t size, 
oslFileHandle *pHandl
 eRet = oslTranslateFileError (OSL_FET_ERROR, ENOMEM);
 return eRet;
 }
-pImpl-m_kind = 

[Libreoffice-commits] .: sal/inc

2011-12-09 Thread Stephan Bergmann
 sal/inc/rtl/ustrbuf.hxx |   24 
 1 file changed, 24 insertions(+)

New commits:
commit 0670d4652dab1986412f4e9d3c9f36ba2e34db64
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Dec 9 12:31:49 2011 +0100

rtl::OUStringBuffer::insert overloaded for char (similar to ::append).

diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index d9c3893..74df4fe 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -647,6 +647,30 @@ public:
 @param  offset   the offset.
 @param  ch   a codechar/code.
 @return this string buffer.
+
+@since LibreOffice 3.6
+ */
+OUStringBuffer  insert(sal_Int32 offset, char c)
+{
+sal_Unicode u = c;
+return insert( offset, u, 1 );
+}
+
+/**
+Inserts the string representation of the codechar/code
+argument into this string buffer.
+
+The second argument is inserted into the contents of this string
+buffer at the position indicated by codeoffset/code. The length
+of this string buffer increases by one.
+p
+The offset argument must be greater than or equal to
+code0/code, and less than or equal to the length of this
+string buffer.
+
+@param  offset   the offset.
+@param  ch   a codechar/code.
+@return this string buffer.
  */
 OUStringBuffer  insert(sal_Int32 offset, sal_Unicode c)
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-02 Thread Stephan Bergmann

On 12/02/2011 12:59 AM, August Sodora wrote:

  sal/inc/rtl/strbuf.hxx  |   36 
  sal/inc/rtl/ustrbuf.hxx |   36 
  2 files changed, 72 deletions(-)

New commits:
commit 1820e7f575dffe53062f50f08cebf0efa37e2cc2
Author: August Sodoraaug...@gmail.com
Date:   Thu Dec 1 18:58:46 2011 -0500

 Remove charAt/setCharAt once and for all


To not break compatibility with existing extensions etc., please do not 
simply remove functionality from the stable URE interface.


(Fixed now with 
http://cgit.freedesktop.org/libreoffice/core/commit/?id=05fddab006719d9d023787d7e6ee9b979907c048 
Revert 'Remove charAt/setCharAt once and for all' and 
http://cgit.freedesktop.org/libreoffice/core/commit/?id=0b14a86f8a1c77683db2e81cb4604c077b572cf7 
Mark rtl::O[U]StringBuffer::{charAt,setCharAt} as SAL_DEPRECATED.)


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


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

2011-12-02 Thread Michael Meeks

On Fri, 2011-12-02 at 11:12 +0100, Stephan Bergmann wrote:
  commit 1820e7f575dffe53062f50f08cebf0efa37e2cc2
  Author: August Sodoraaug...@gmail.com
  Date:   Thu Dec 1 18:58:46 2011 -0500
 
   Remove charAt/setCharAt once and for all

 To not break compatibility with existing extensions etc., please do not 
 simply remove functionality from the stable URE interface.

Right - you were not to know August :-) Having said that, it'd be good
to get these cleaned up for LibreOffice 4.0 - which (hopefully) is what
marking it deprecated will do for us.

Thanks !

Michael.

-- 
michael.me...@suse.com  , Pseudo Engineer, itinerant idiot

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


[Libreoffice-commits] .: sal/inc

2011-12-01 Thread August Sodora
 sal/inc/rtl/strbuf.hxx  |   36 
 sal/inc/rtl/ustrbuf.hxx |   36 
 2 files changed, 72 deletions(-)

New commits:
commit 1820e7f575dffe53062f50f08cebf0efa37e2cc2
Author: August Sodora aug...@gmail.com
Date:   Thu Dec 1 18:58:46 2011 -0500

Remove charAt/setCharAt once and for all

diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx
index 3ea6bc0..e3ae74b 100644
--- a/sal/inc/rtl/strbuf.hxx
+++ b/sal/inc/rtl/strbuf.hxx
@@ -269,42 +269,6 @@ public:
 }
 
 /**
-Returns the character at a specific index in this string buffer.
-
-The first character of a string buffer is at index
-code0/code, the next at index code1/code, and so on, for
-array indexing.
-p
-The index argument must be greater than or equal to
-code0/code, and less than the length of this string buffer.
-
-@param  index   the index of the desired character.
-@return the character at the specified index of this string buffer.
-*/
-sal_Char charAt( sal_Int32 index )
-{
-assert(index = 0  index  pData-length);
-return pData-buffer[ index ];
-}
-
-/**
-The character at the specified index of this string buffer is set
-to codech/code.
-
-The index argument must be greater than or equal to
-code0/code, and less than the length of this string buffer.
-
-@param  index   the index of the character to modify.
-@param  ch  the new character.
- */
-OStringBuffer  setCharAt(sal_Int32 index, sal_Char ch)
-{
-assert(index = 0  index  pData-length);
-pData-buffer[ index ] = ch;
-return *this;
-}
-
-/**
 Return a null terminated character array.
  */
 const sal_Char* getStr() const { return pData-buffer; }
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index b4d4871..624b6f0 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -248,42 +248,6 @@ public:
 }
 
 /**
-Returns the character at a specific index in this string buffer.
-
-The first character of a string buffer is at index
-code0/code, the next at index code1/code, and so on, for
-array indexing.
-p
-The index argument must be greater than or equal to
-code0/code, and less than the length of this string buffer.
-
-@param  index   the index of the desired character.
-@return the character at the specified index of this string buffer.
- */
-sal_Unicode charAt( sal_Int32 index ) const
-{
-assert(index = 0  index  pData-length);
-return pData-buffer[ index ];
-}
-
-/**
-The character at the specified index of this string buffer is set
-to codech/code.
-
-The index argument must be greater than or equal to
-code0/code, and less than the length of this string buffer.
-
-@param  index   the index of the character to modify.
-@param  ch  the new character.
- */
-OUStringBuffer  setCharAt(sal_Int32 index, sal_Unicode ch)
-{
-assert(index = 0  index  pData-length);
-pData-buffer[ index ] = ch;
-return *this;
-}
-
-/**
 Return a null terminated unicode character array.
  */
 const sal_Unicode*  getStr() const { return pData-buffer; }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-11-30 Thread Stephan Bergmann
 sal/inc/internal/once.h |   82 
 sal/rtl/source/alloc_arena.cxx  |1 
 sal/rtl/source/alloc_cache.cxx  |1 
 sal/rtl/source/alloc_global.cxx |1 
 sal/rtl/source/locale.cxx   |1 
 5 files changed, 86 deletions(-)

New commits:
commit cbcf00ad04e8e1457f5563a25b6f9cf68e3f4a24
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Nov 30 09:10:17 2011 +0100

Removed unused sal/inc/internal/once.h.

diff --git a/sal/inc/internal/once.h b/sal/inc/internal/once.h
deleted file mode 100644
index 45f9c37..000
--- a/sal/inc/internal/once.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * http://www.openoffice.org/license.html
- * for a copy of the LGPLv3 License.
- *
- /
-
-#ifndef INCLUDED_SAL_INTERNAL_ONCE_H
-#define INCLUDED_SAL_INTERNAL_ONCE_H
-
-/** sal_once_type
- *  (platform dependent)
- */
-
-#if defined(SAL_UNX)
-
-#include pthread.h
-
-typedef pthread_once_t sal_once_type;
-
-#define SAL_ONCE_INIT PTHREAD_ONCE_INIT
-#define SAL_ONCE(once, init) pthread_once((once), (init))
-
-#elif defined(SAL_W32)
-
-#define WIN32_LEAN_AND_MEAN
-#pragma warning(push,1) /* disable warnings within system headers */
-#include windows.h
-#pragma warning(pop)
-
-typedef struct sal_once_st sal_once_type;
-struct sal_once_st
-{
-LONG volatile m_done;
-LONG volatile m_lock;
-};
-
-#define SAL_ONCE_INIT { 0, 0 }
-#define SAL_ONCE(once, init) \
-{ \
-sal_once_type * control = (once); \
-if (!(control-m_done)) \
-{ \
-while (InterlockedExchange((control-m_lock), 1) == 1) Sleep(0); \
-if (!(control-m_done)) \
-{ \
-void (*init_routine)(void) = (init); \
-(*init_routine)(); \
-control-m_done = 1; \
-} \
-InterlockedExchange((control-m_lock), 0); \
-} \
-}
-
-#else
-#error Unknown platform
-#endif /* SAL_UNX | SAL_W32 */
-
-#endif /* INCLUDED_SAL_INTERNAL_ONCE_H */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/rtl/source/alloc_arena.cxx b/sal/rtl/source/alloc_arena.cxx
index 20ee962..03c7f47 100644
--- a/sal/rtl/source/alloc_arena.cxx
+++ b/sal/rtl/source/alloc_arena.cxx
@@ -30,7 +30,6 @@
 #include alloc_arena.hxx
 
 #include alloc_impl.hxx
-#include internal/once.h
 #include internal/rtllifecycle.h
 #include sal/macros.h
 #include osl/diagnose.h
diff --git a/sal/rtl/source/alloc_cache.cxx b/sal/rtl/source/alloc_cache.cxx
index a1d8d54..0769b8e 100644
--- a/sal/rtl/source/alloc_cache.cxx
+++ b/sal/rtl/source/alloc_cache.cxx
@@ -29,7 +29,6 @@
 #include alloc_cache.hxx
 #include alloc_impl.hxx
 #include alloc_arena.hxx
-#include internal/once.h
 #include internal/rtllifecycle.h
 #include sal/macros.h
 #include osl/diagnose.h
diff --git a/sal/rtl/source/alloc_global.cxx b/sal/rtl/source/alloc_global.cxx
index e48fdd1..c0de496 100644
--- a/sal/rtl/source/alloc_global.cxx
+++ b/sal/rtl/source/alloc_global.cxx
@@ -51,7 +51,6 @@ static void determine_alloc_mode()
  *
  * = */
 
-#include internal/once.h
 #include sal/macros.h
 
 /* = *
diff --git a/sal/rtl/source/locale.cxx b/sal/rtl/source/locale.cxx
index 1d975ad..885b139 100644
--- a/sal/rtl/source/locale.cxx
+++ b/sal/rtl/source/locale.cxx
@@ -31,7 +31,6 @@
 #include osl/diagnose.h
 #include rtl/alloc.h
 
-#include internal/once.h
 #include internal/rtllifecycle.h
 
 static sal_Int32 RTL_HASHTABLE_SIZE[] =
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-11-25 Thread François Tigeot
 sal/inc/osl/endian.h |   21 -
 sal/osl/unx/system.h |   16 
 2 files changed, 37 deletions(-)

New commits:
commit 3a1441c0d3107c69fd80492fa7e182d4f8c02d3d
Author: François Tigeot ftig...@wolfpond.org
Date:   Fri Nov 25 10:38:14 2011 +0100

PDP_ENDIAN and variants are unused.

Remove their use from the code.

diff --git a/sal/inc/osl/endian.h b/sal/inc/osl/endian.h
index 7069c3b..dace25b 100644
--- a/sal/inc/osl/endian.h
+++ b/sal/inc/osl/endian.h
@@ -61,8 +61,6 @@ extern C {
 #   ifndef _BIG_ENDIAN
 #   define _BIG_ENDIAN
 #   endif
-#   elif __BYTE_ORDER == __PDP_ENDIAN
-#   define _PDP_ENDIAN
 #   endif
 #endif
 
@@ -76,8 +74,6 @@ extern C {
 #   ifndef _BIG_ENDIAN
 #   define _BIG_ENDIAN
 #   endif
-#   elif __BYTE_ORDER == __PDP_ENDIAN
-#   define _PDP_ENDIAN
 #   endif
 #endif
 
@@ -85,13 +81,8 @@ extern C {
 #   include machine/endian.h
 #   if BYTE_ORDER == LITTLE_ENDIAN
 #   undef _BIG_ENDIAN
-#   undef _PDP_ENDIAN
 #   elif BYTE_ORDER == BIG_ENDIAN
 #   undef _LITTLE_ENDIAN
-#   undef _PDP_ENDIAN
-#   elif BYTE_ORDER == PDP_ENDIAN
-#   undef _LITTLE_ENDIAN
-#   undef _BIG_ENDIAN
 #   endif
 #endif
 
@@ -103,8 +94,6 @@ extern C {
 #   define _LITTLE_ENDIAN
 #   elif BYTE_ORDER == BIG_ENDIAN
 #   define _BIG_ENDIAN
-#   elif BYTE_ORDER == PDP_ENDIAN
-#   define _PDP_ENDIAN
 #   endif
 #endif
 #endif
@@ -119,8 +108,6 @@ extern C {
 #   ifndef _BIG_ENDIAN
 #   define _BIG_ENDIAN
 #   endif
-#   elif BYTE_ORDER == PDP_ENDIAN
-#   define _PDP_ENDIAN
 #   endif
 #endif
 
@@ -138,10 +125,6 @@ extern C {
 #   ifndef _BIG_ENDIAN
 #   define _BIG_ENDIAN
 #   endif
-#   elif BYTE_ORDER == PDP_ENDIAN
-#   ifndef _PDP_ENDIAN
-#   define _PDP_ENDIAN
-#   endif
 #   endif
 #endif
 
@@ -155,10 +138,6 @@ extern C {
 #   ifndef _BIG_ENDIAN
 #   define _BIG_ENDIAN
 #   endif
-#   elif BYTE_ORDER == PDP_ENDIAN
-#   ifndef _PDP_ENDIAN
-#   define _PDP_ENDIAN
-#   endif
 #   endif
 #endif
 
diff --git a/sal/osl/unx/system.h b/sal/osl/unx/system.h
index c8f4871..71b9b31 100644
--- a/sal/osl/unx/system.h
+++ b/sal/osl/unx/system.h
@@ -89,8 +89,6 @@
 #   ifndef _BIG_ENDIAN
 #   define _BIG_ENDIAN
 #   endif
-#   elif __BYTE_ORDER == __PDP_ENDIAN
-#   define _PDP_ENDIAN
 #   endif
 #   define  IORESOURCE_TRANSFER_BSD
 #   define  IOCHANNEL_TRANSFER_BSD_RENO
@@ -142,8 +140,6 @@
 #   define _LITTLE_ENDIAN_OO
 #   elif BYTE_ORDER == BIG_ENDIAN
 #   define _BIG_ENDIAN_OO
-#   elif BYTE_ORDER == PDP_ENDIAN
-#   define _PDP_ENDIAN_OO
 #   endif
 #   define  IORESOURCE_TRANSFER_BSD
 #   define  IOCHANNEL_TRANSFER_BSD_RENO
@@ -179,8 +175,6 @@
 #   define _LITTLE_ENDIAN
 #   elif BYTE_ORDER == BIG_ENDIAN
 #   define _BIG_ENDIAN
-#   elif BYTE_ORDER == PDP_ENDIAN
-#   define _PDP_ENDIAN
 #   endif
 #endif
 #   define  NO_PTHREAD_RTL
@@ -248,8 +242,6 @@
 #   ifndef _BIG_ENDIAN
 #   define _BIG_ENDIAN
 #   endif
-#   elif BYTE_ORDER == PDP_ENDIAN
-#   define _PDP_ENDIAN
 #   endif
 #   define  SLEEP_TIMESPEC(timespec)nsleep(timespec, 0)
 #   define  LIBPATH LIBPATH
@@ -301,10 +293,6 @@
 #   ifndef _BIG_ENDIAN
 #   define _BIG_ENDIAN
 #   endif
-#   elif BYTE_ORDER == PDP_ENDIAN
-#   ifndef _PDP_ENDIAN
-#   define _PDP_ENDIAN
-#   endif
 #   endif
 #   define  IOCHANNEL_TRANSFER_BSD_RENO
 #   define  NO_PTHREAD_RTL
@@ -341,10 +329,6 @@ int macxp_resolveAlias(char *path, int buflen);
 #   ifndef _BIG_ENDIAN
 #   define _BIG_ENDIAN
 #   endif
-#   elif BYTE_ORDER == PDP_ENDIAN
-#   ifndef _PDP_ENDIAN
-#   define _PDP_ENDIAN
-#   endif
 #   endif
 #   define  IOCHANNEL_TRANSFER_BSD_RENO
 #   define  NO_PTHREAD_RTL
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2011-11-23 Thread Stephan Bergmann
 sal/inc/sal/log.hxx |   16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 364a3d2864973935b2cd18b328392d1b556456dd
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Nov 23 20:26:52 2011 +0100

Silence bogus MSC must return a value errors.

diff --git a/sal/inc/sal/log.hxx b/sal/inc/sal/log.hxx
index be71d02..cf22519 100644
--- a/sal/inc/sal/log.hxx
+++ b/sal/inc/sal/log.hxx
@@ -91,25 +91,39 @@ template typename T  inline StreamIgnore operator (
 StreamStart const , T const )
 {
 std::abort();
+#if defined _MSC_VER
+return StreamIgnore();
+#endif
 }
 
 template typename T  inline StreamIgnore operator (
 StreamString const , T const )
 {
 std::abort();
+#if defined _MSC_VER
+return StreamIgnore();
+#endif
 }
 
 template typename T  inline StreamIgnore operator (
 StreamIgnore const , T const )
 {
 std::abort();
+#if defined _MSC_VER
+return StreamIgnore();
+#endif
 }
 
 template typename T  typename T::Result getResult(T const );
 
 inline char const * unwrapStream(StreamString const  s) { return s.string; }
 
-inline char const * unwrapStream(StreamIgnore const ) { std::abort(); }
+inline char const * unwrapStream(StreamIgnore const ) {
+std::abort();
+#if defined _MSC_VER
+return 0;
+#endif
+}
 
 } }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2011-11-23 Thread Stephan Bergmann
 sal/inc/sal/log.hxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 0a1f03544a72596b5022985f2367bdcd0699adeb
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Nov 23 21:55:59 2011 +0100

Call getResult with fully qualified name.

diff --git a/sal/inc/sal/log.hxx b/sal/inc/sal/log.hxx
index cf22519..2e09c29 100644
--- a/sal/inc/sal/log.hxx
+++ b/sal/inc/sal/log.hxx
@@ -131,7 +131,8 @@ inline char const * unwrapStream(StreamIgnore const ) {
 #define SAL_DETAIL_LOG_STREAM(condition, level, area, where, stream) \
 do { \
 if (condition) { \
-if (sizeof getResult(::sal::detail::StreamStart()  stream) == 1) 
\
+if (sizeof ::sal::detail::getResult( \
+::sal::detail::StreamStart()  stream) == 1) \
 { \
 ::sal_detail_log( \
 (level), (area), (where), \
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/inc

2011-10-05 Thread Stephan Bergmann
 sal/inc/rtl/strbuf.hxx  |   14 ++
 sal/inc/rtl/string.hxx  |   24 +++-
 sal/inc/rtl/ustrbuf.hxx |   14 ++
 sal/inc/rtl/ustring.hxx |   12 +++-
 4 files changed, 38 insertions(+), 26 deletions(-)

New commits:
commit 112bdf84d684590e042725c7173e059b4afa2f83
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Oct 5 09:20:59 2011 +0200

Removed dangerous rtl::O[U]String[Buffer]::operator sal_{char,Unicode} 
const *.

As a replacement, added appropriate operator [] functions.  All other uses 
can
use getStr().

diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx
index 63ae448..962d3df 100644
--- a/sal/inc/rtl/strbuf.hxx
+++ b/sal/inc/rtl/strbuf.hxx
@@ -287,12 +287,18 @@ public:
 /**
 Return a null terminated character array.
  */
-operatorconst sal_Char *() const { return pData-buffer; }
+const sal_Char* getStr() const { return pData-buffer; }
 
 /**
-Return a null terminated character array.
- */
-const sal_Char* getStr() const { return pData-buffer; }
+  Access to individual characters.
+
+  @param index must be non-negative and less than length.
+
+  @return a reference to the character at the given index.
+
+  @since LibreOffice 3.5
+*/
+sal_Char  operator [](sal_Int32 index) { return pData-buffer[index]; }
 
 /**
 Return a OString instance reflecting the current content
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 96ca406..22de6dd 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -251,19 +251,6 @@ public:
 /**
   Returns a pointer to the characters of this string.
 
-  pThe returned pointer is not guaranteed to point to a null-terminated
-  byte string.  Note that this string object may contain embedded null
-  characters, which will thus also be embedded in the returned byte
-  string./p
-
-  @return a pointer to a (not necessarily null-terminated) byte string
-  representing the characters of this string object.
-*/
-operator const sal_Char *() const SAL_THROW(()) { return pData-buffer; }
-
-/**
-  Returns a pointer to the characters of this string.
-
   pThe returned pointer is guaranteed to point to a null-terminated byte
   string.  But note that this string object may contain embedded null
   characters, which will thus also be embedded in the returned
@@ -275,6 +262,17 @@ public:
 const sal_Char * getStr() const SAL_THROW(()) { return pData-buffer; }
 
 /**
+  Access to individual characters.
+
+  @param index must be non-negative and less than length.
+
+  @return the character at the given index.
+
+  @since LibreOffice 3.5
+*/
+sal_Char operator [](sal_Int32 index) const { return getStr()[index]; }
+
+/**
   Compares two strings.
 
   The comparison is based on the numeric value of each character in
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index a356309..47569e5 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -267,12 +267,18 @@ public:
 /**
 Return a null terminated unicode character array.
  */
-operatorconst sal_Unicode *() const { return pData-buffer; }
+const sal_Unicode*  getStr() const { return pData-buffer; }
 
 /**
-Return a null terminated unicode character array.
- */
-const sal_Unicode*  getStr() const { return pData-buffer; }
+  Access to individual characters.
+
+  @param index must be non-negative and less than length.
+
+  @return a reference to the character at the given index.
+
+  @since LibreOffice 3.5
+*/
+sal_Unicode  operator [](sal_Int32 index) { return pData-buffer[index]; }
 
 /**
 Return a OUString instance reflecting the current content
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index ed268d9..e104f0d 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -300,16 +300,18 @@ public:
 
   @return   a pointer to the Unicode characters buffer from this object.
 */
-operator const sal_Unicode *() const SAL_THROW(()) { return pData-buffer; 
}
+const sal_Unicode * getStr() const SAL_THROW(()) { return pData-buffer; }
 
 /**
-  Returns a pointer to the Unicode character buffer from this string.
+  Access to individual characters.
 
-  It isn't necessarily NULL terminated.
+  @param index must be non-negative and less than length.
 
-  @return   a pointer to the Unicode characters buffer from this object.
+  @return the character at the given index.
+
+  @since LibreOffice 3.5
 */
-const sal_Unicode * getStr() const SAL_THROW(()) { return pData-buffer; }
+sal_Unicode operator [](sal_Int32 index) const { return getStr()[index]; }
 
 /**
   Compares two strings.
___
Libreoffice-commits mailing 

[Libreoffice-commits] .: sal/inc sal/osl sal/textenc

2011-09-27 Thread Stephan Bergmann
 sal/inc/osl/module.h|   24 ++
 sal/inc/osl/module.hxx  |   15 
 sal/osl/unx/module.c|  168 +++-
 sal/osl/w32/module.cxx  |6 +
 sal/textenc/textenc.cxx |   12 ---
 5 files changed, 144 insertions(+), 81 deletions(-)

New commits:
commit 193715bbf0e59256fd8da7ebd8dc5eb937615281
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Sep 27 10:06:54 2011 +0200

FullTextEncodingDataSingleton must not call itself recursively.

Happened on non-standard locales (like hu_HU on Linux) when 
osl_loadModuleRelative
wanted to access non-standard text encodings.

For Windows, the fix is still only a TODO: FIXME dummy.

diff --git a/sal/inc/osl/module.h b/sal/inc/osl/module.h
index c103e41..6784232 100644
--- a/sal/inc/osl/module.h
+++ b/sal/inc/osl/module.h
@@ -102,6 +102,30 @@ oslModule SAL_CALL osl_loadModuleAscii(const sal_Char 
*pModuleName, sal_Int32 nR
 oslModule SAL_CALL osl_loadModuleRelative(
 oslGenericFunction baseModule, rtl_uString * relativePath, sal_Int32 mode);
 
+/** Load a module located relative to some other module.
+
+@param baseModule
+must point to a function that is part of the code of some loaded module;
+must not be NULL.
+
+@param relativePath
+a relative URL containing only ASCII (0x01--7F) characters; must not be
+NULL.
+
+@param mode
+the SAL_LOADMODULE_xxx flags.
+
+@return
+a non-NULL handle to the loaded module, or NULL if an error occurred.
+
+@since LibreOffice 3.5
+*/
+oslModule SAL_CALL osl_loadModuleRelativeAscii(
+oslGenericFunction baseModule, char const * relativePath, sal_Int32 mode);
+/* This function is guaranteed not to call into
+   FullTextEncodingDataSingleton in sal/textenc/textenc.cxx, so can be used
+   in its implementation without running into circles. */
+
 /** Retrieve the handle of an already loaded module.
 
 This function can be used to search for a function symbol in the process 
address space.
diff --git a/sal/inc/osl/module.hxx b/sal/inc/osl/module.hxx
index cfc1c5e..3ece623 100644
--- a/sal/inc/osl/module.hxx
+++ b/sal/inc/osl/module.hxx
@@ -102,6 +102,16 @@ public:
 return is();
 }
 
+/// @since LibreOffice 3.5
+sal_Bool SAL_CALL loadRelative(
+oslGenericFunction baseModule, char const * relativePath,
+sal_Int32 mode = SAL_LOADMODULE_DEFAULT)
+{
+unload();
+m_Module = osl_loadModuleRelativeAscii(baseModule, relativePath, mode);
+return is();
+}
+
 void SAL_CALL unload()
 {
 if (m_Module)
@@ -144,6 +154,11 @@ public:
 return ( osl_getFunctionSymbol( m_Module, ustrFunctionSymbolName.pData 
) );
 }
 
+/// @since LibreOffice 3.5
+oslGenericFunction SAL_CALL getFunctionSymbol(char const * name) const {
+return osl_getAsciiFunctionSymbol(m_Module, name);
+}
+
 operator oslModule() const
 {
 return m_Module;
diff --git a/sal/osl/unx/module.c b/sal/osl/unx/module.c
index 63fbc20..7db8011 100644
--- a/sal/osl/unx/module.c
+++ b/sal/osl/unx/module.c
@@ -46,6 +46,69 @@
 /* implemented in file.c */
 extern int UnicodeToText(char *, size_t, const sal_Unicode *, sal_Int32);
 
+static sal_Bool getModulePathFromAddress(void * address, rtl_String ** path) {
+sal_Bool result = sal_False;
+/* Bah, we do want to use dladdr here also on iOS, I think? */
+#if !defined(NO_DL_FUNCTIONS) || defined(IOS)
+#if defined(AIX)
+int i;
+int size = 4 * 1024;
+char *buf, *filename=NULL;
+struct ld_info *lp;
+
+if ((buf = malloc(size)) == NULL)
+return result;
+
+while((i = loadquery(L_GETINFO, buf, size)) == -1  errno == ENOMEM)
+{
+size += 4 * 1024;
+if ((buf = malloc(size)) == NULL)
+break;
+}
+
+lp = (struct ld_info*) buf;
+while (lp)
+{
+unsigned long start = (unsigned long)lp-ldinfo_dataorg;
+unsigned long end = start + lp-ldinfo_datasize;
+if (start = (unsigned long)address  end  (unsigned long)address)
+{
+filename = lp-ldinfo_filename;
+break;
+}
+if (!lp-ldinfo_next)
+break;
+lp = (struct ld_info*) ((char *) lp + lp-ldinfo_next);
+}
+
+if (filename)
+{
+rtl_string_newFromStr(path, filename);
+result = sal_True;
+}
+else
+{
+result = sal_False;
+}
+
+free(buf);
+#else
+Dl_info dl_info;
+
+if ((result = dladdr(address, dl_info)) != 0)
+{
+rtl_string_newFromStr(path, dl_info.dli_fname);
+result = sal_True;
+}
+else
+{
+result = sal_False;
+}
+#endif
+#endif
+return result;
+}
+
 /*/
 /* osl_loadModule */
 /*/
@@ -104,6 +167,34 @@ oslModule SAL_CALL 

Re: [Libreoffice] SAL_DEPRECATED (was: [Libreoffice-commits] .: sal/inc)

2011-09-12 Thread Bjoern Michaelsen
On Sun, 11 Sep 2011 20:55:21 +0200
Stephan Bergmann sberg...@redhat.com
wrote:

 On 09/09/2011 09:45 PM, Stephan Bergmann wrote:
  Is it true that __declspec must go before the return type for MSC
  (i.e., that the return type must go within the SAL_DEPRECATED
  argument)?

No.

 It turns out SAL_DEPRECATED can be simplified after all, see 
 http://cgit.freedesktop.org/libreoffice/core/commit/?id=d88bceafa0227e0e7bfe6bad1221eb93d3a9619a.

Yes. looking way better.

Best,

Bjoern


-- 
https://launchpad.net/~bjoern-michaelsen


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


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

2011-09-09 Thread Stephan Bergmann

On 09/07/2011 02:56 PM, Bjoern Michaelsen wrote:

  sal/inc/sal/types.h |   16 
  1 file changed, 16 insertions(+)

New commits:
commit de290e726ed2aa5a4c007d61a7db1042c45d43db
Author: Bjoern Michaelsenbjoern.michael...@canonical.com
Date:   Wed Sep 7 12:37:08 2011 +0200

 introduce SAL_DEPRECATED macro


Is it true that __declspec must go before the return type for MSC (i.e., 
that the return type must go within the SAL_DEPRECATED argument)?  Then, 
SAL_DEPRECATED suffers from the multiple-argument template return type 
unpleasantness described at 
http://stackoverflow.com/questions/295120/c-mark-as-deprecated/295229#295229. 
 :(


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