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

2012-08-16 Thread Tomaž Vajngerl
 comphelper/inc/comphelper/storagehelper.hxx |  177 -
 comphelper/source/misc/storagehelper.cxx|  511 +---
 2 files changed, 332 insertions(+), 356 deletions(-)

New commits:
commit 72777a66bb8d9e71c4786c282c7971d7ededa729
Author: Tomaž Vajngerl qui...@gmail.com
Date:   Thu Aug 16 19:05:36 2012 +0200

Cleanup comphelper::storagehelper

Change-Id: I04313cf4235ce3db20ff340474691435e9b440b6

diff --git a/comphelper/inc/comphelper/storagehelper.hxx 
b/comphelper/inc/comphelper/storagehelper.hxx
index f255dc8..5e4916e 100644
--- a/comphelper/inc/comphelper/storagehelper.hxx
+++ b/comphelper/inc/comphelper/storagehelper.hxx
@@ -33,14 +33,20 @@
 #include com/sun/star/io/XStream.hpp
 #include comphelper/comphelperdllapi.h
 
+using namespace com::sun::star::uno;
+using namespace com::sun::star::lang;
+using namespace com::sun::star::embed;
+using namespace com::sun::star::io;
+using namespace com::sun::star::beans;
+using rtl::OUString;
 
-#define PACKAGE_STORAGE_FORMAT_STRING   ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( PackageFormat ) )
-#define ZIP_STORAGE_FORMAT_STRING   ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( ZipFormat ) )
-#define OFOPXML_STORAGE_FORMAT_STRING   ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( OFOPXMLFormat ) )
+#define PACKAGE_STORAGE_FORMAT_STRING   OUString( RTL_CONSTASCII_USTRINGPARAM( 
PackageFormat ) )
+#define ZIP_STORAGE_FORMAT_STRING   OUString( RTL_CONSTASCII_USTRINGPARAM( 
ZipFormat ) )
+#define OFOPXML_STORAGE_FORMAT_STRING   OUString( RTL_CONSTASCII_USTRINGPARAM( 
OFOPXMLFormat ) )
 
-#define PACKAGE_ENCRYPTIONDATA_SHA256UTF8 ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( PackageSHA256UTF8EncryptionKey ) )
-#define PACKAGE_ENCRYPTIONDATA_SHA1UTF8   ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( PackageSHA1UTF8EncryptionKey ) )
-#define PACKAGE_ENCRYPTIONDATA_SHA1MS1252 ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( PackageSHA1MS1252EncryptionKey ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA256UTF8 OUString( 
RTL_CONSTASCII_USTRINGPARAM( PackageSHA256UTF8EncryptionKey ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA1UTF8   OUString( 
RTL_CONSTASCII_USTRINGPARAM( PackageSHA1UTF8EncryptionKey ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA1MS1252 OUString( 
RTL_CONSTASCII_USTRINGPARAM( PackageSHA1MS1252EncryptionKey ) )
 
 namespace comphelper {
 
@@ -63,131 +69,120 @@ public:
 class COMPHELPER_DLLPUBLIC OStorageHelper
 {
 public:
-static ::com::sun::star::uno::Reference 
::com::sun::star::lang::XSingleServiceFactory 
+static Reference XSingleServiceFactory 
 GetStorageFactory(
-const ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory  xSF
-= ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory () )
-throw ( ::com::sun::star::uno::Exception );
+const Reference XMultiServiceFactory  xSF = Reference 
XMultiServiceFactory () )
+throw ( Exception );
 
-static ::com::sun::star::uno::Reference 
::com::sun::star::lang::XSingleServiceFactory 
+static Reference XSingleServiceFactory 
 GetFileSystemStorageFactory(
-const ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory  xSF
-= ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory () )
-throw ( ::com::sun::star::uno::Exception );
+const Reference XMultiServiceFactory  xSF = Reference 
XMultiServiceFactory () )
+throw ( Exception );
 
-static ::com::sun::star::uno::Reference ::com::sun::star::embed::XStorage 

+static Reference XStorage 
 GetTemporaryStorage(
-const ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory  xFactory
-= ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory () )
-throw ( ::com::sun::star::uno::Exception );
+const Reference XMultiServiceFactory  xFactory = Reference 
XMultiServiceFactory () )
+throw ( Exception );
 
-/// this one will only return Storage
-static ::com::sun::star::uno::Reference ::com::sun::star::embed::XStorage 

+// this one will only return Storage
+static Reference XStorage 
 GetStorageFromURL(
-const ::rtl::OUString aURL,
-sal_Int32 nStorageMode,
-const ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory  xFactory
-= ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory () )
-throw ( ::com::sun::star::uno::Exception );
+const OUString aURL, sal_Int32 nStorageMode,
+const Reference XMultiServiceFactory  xFactory = Reference 
XMultiServiceFactory () )
+throw ( Exception );
 
-/// this one will return either Storage or FileSystemStorage
-static 

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

2012-08-16 Thread Matus Kukan
 comphelper/inc/comphelper/storagehelper.hxx |  177 -
 comphelper/source/misc/storagehelper.cxx|  511 ++--
 2 files changed, 356 insertions(+), 332 deletions(-)

New commits:
commit e3648d4ebc7378cc31b6ce73716328f48b8903e5
Author: Matúš Kukan matus.ku...@gmail.com
Date:   Thu Aug 16 21:47:01 2012 +0200

Revert Cleanup comphelper::storagehelper

This reverts commit 72777a66bb8d9e71c4786c282c7971d7ededa729.

+using namespace com::sun::star::uno; in header is not a good idea
Fails to compile and is hard to parse and figure out what was the point,
so just reverting.
Also +using rtl::OUString; is automatic nowadays whenever possible and
RTL_CONSTASCII_USTRINGPARAM is obsoleted.

Change-Id: I24cb24b7f1a6007734d26cbba41d46323cb55b18

diff --git a/comphelper/inc/comphelper/storagehelper.hxx 
b/comphelper/inc/comphelper/storagehelper.hxx
index 5e4916e..f255dc8 100644
--- a/comphelper/inc/comphelper/storagehelper.hxx
+++ b/comphelper/inc/comphelper/storagehelper.hxx
@@ -33,20 +33,14 @@
 #include com/sun/star/io/XStream.hpp
 #include comphelper/comphelperdllapi.h
 
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::embed;
-using namespace com::sun::star::io;
-using namespace com::sun::star::beans;
-using rtl::OUString;
 
-#define PACKAGE_STORAGE_FORMAT_STRING   OUString( RTL_CONSTASCII_USTRINGPARAM( 
PackageFormat ) )
-#define ZIP_STORAGE_FORMAT_STRING   OUString( RTL_CONSTASCII_USTRINGPARAM( 
ZipFormat ) )
-#define OFOPXML_STORAGE_FORMAT_STRING   OUString( RTL_CONSTASCII_USTRINGPARAM( 
OFOPXMLFormat ) )
+#define PACKAGE_STORAGE_FORMAT_STRING   ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( PackageFormat ) )
+#define ZIP_STORAGE_FORMAT_STRING   ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( ZipFormat ) )
+#define OFOPXML_STORAGE_FORMAT_STRING   ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( OFOPXMLFormat ) )
 
-#define PACKAGE_ENCRYPTIONDATA_SHA256UTF8 OUString( 
RTL_CONSTASCII_USTRINGPARAM( PackageSHA256UTF8EncryptionKey ) )
-#define PACKAGE_ENCRYPTIONDATA_SHA1UTF8   OUString( 
RTL_CONSTASCII_USTRINGPARAM( PackageSHA1UTF8EncryptionKey ) )
-#define PACKAGE_ENCRYPTIONDATA_SHA1MS1252 OUString( 
RTL_CONSTASCII_USTRINGPARAM( PackageSHA1MS1252EncryptionKey ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA256UTF8 ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( PackageSHA256UTF8EncryptionKey ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA1UTF8   ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( PackageSHA1UTF8EncryptionKey ) )
+#define PACKAGE_ENCRYPTIONDATA_SHA1MS1252 ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( PackageSHA1MS1252EncryptionKey ) )
 
 namespace comphelper {
 
@@ -69,120 +63,131 @@ public:
 class COMPHELPER_DLLPUBLIC OStorageHelper
 {
 public:
-static Reference XSingleServiceFactory 
+static ::com::sun::star::uno::Reference 
::com::sun::star::lang::XSingleServiceFactory 
 GetStorageFactory(
-const Reference XMultiServiceFactory  xSF = Reference 
XMultiServiceFactory () )
-throw ( Exception );
+const ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory  xSF
+= ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory () )
+throw ( ::com::sun::star::uno::Exception );
 
-static Reference XSingleServiceFactory 
+static ::com::sun::star::uno::Reference 
::com::sun::star::lang::XSingleServiceFactory 
 GetFileSystemStorageFactory(
-const Reference XMultiServiceFactory  xSF = Reference 
XMultiServiceFactory () )
-throw ( Exception );
+const ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory  xSF
+= ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory () )
+throw ( ::com::sun::star::uno::Exception );
 
-static Reference XStorage 
+static ::com::sun::star::uno::Reference ::com::sun::star::embed::XStorage 

 GetTemporaryStorage(
-const Reference XMultiServiceFactory  xFactory = Reference 
XMultiServiceFactory () )
-throw ( Exception );
+const ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory  xFactory
+= ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory () )
+throw ( ::com::sun::star::uno::Exception );
 
-// this one will only return Storage
-static Reference XStorage 
+/// this one will only return Storage
+static ::com::sun::star::uno::Reference ::com::sun::star::embed::XStorage 

 GetStorageFromURL(
-const OUString aURL, sal_Int32 nStorageMode,
-const Reference XMultiServiceFactory  xFactory = Reference 
XMultiServiceFactory () )
-throw ( Exception );
+const ::rtl::OUString aURL,
+sal_Int32 nStorageMode,
+   

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

2012-03-05 Thread Tor Lillqvist
 comphelper/inc/comphelper/oslfile2streamwrap.hxx|4 
 comphelper/source/container/container.cxx   |   31 ++
 comphelper/source/container/enumhelper.cxx  |4 
 comphelper/source/eventattachermgr/eventattachermgr.cxx |   81 +++-
 comphelper/source/property/propagg.cxx  |   13 +-
 5 files changed, 64 insertions(+), 69 deletions(-)

New commits:
commit 8907a41bf8370446a1cc46c72b2841e5e3588806
Author: Tom Thorogood t...@tomthorogood.com
Date:   Tue Feb 28 00:38:23 2012 -0500

Translate german comments in core/comphelper

diff --git a/comphelper/inc/comphelper/oslfile2streamwrap.hxx 
b/comphelper/inc/comphelper/oslfile2streamwrap.hxx
index 754be72..64ebca6 100644
--- a/comphelper/inc/comphelper/oslfile2streamwrap.hxx
+++ b/comphelper/inc/comphelper/oslfile2streamwrap.hxx
@@ -42,7 +42,7 @@ namespace comphelper
 
 //==
 // FmUnoIOStream,
-// stream zum schreiben un lesen von Daten, basieren  auf File
+// Stream to read and write from data read from a file
 //==
 class COMPHELPER_DLLPUBLIC OSLInputStreamWrapper : public 
::cppu::WeakImplHelper1stario::XInputStream
 {
@@ -63,7 +63,7 @@ public:
 
 //==
 // FmUnoOutStream,
-// Datensenke fuer Files
+// sync data for the files
 //==
 class OSLOutputStreamWrapper : public 
::cppu::WeakImplHelper1stario::XOutputStream
 {
diff --git a/comphelper/source/container/container.cxx 
b/comphelper/source/container/container.cxx
index 7bf2f8f..d3012c2 100644
--- a/comphelper/source/container/container.cxx
+++ b/comphelper/source/container/container.cxx
@@ -51,9 +51,9 @@ IndexAccessIterator::~IndexAccessIterator() {}
 ::com::sun::star::uno::Reference ::com::sun::star::uno::XInterface 
IndexAccessIterator::Next()
 {
 sal_Bool bCheckingStartingPoint = !m_xCurrentObject.is();
-// ist die aktuelle Node der Anfangspunkt ?
+// Is the current node the starting point?
 sal_Bool bAlreadyCheckedCurrent = m_xCurrentObject.is();
-// habe ich die aktuelle Node schon mal mittels ShouldHandleElement 
testen ?
+// Have I already tested the current node through ShouldHandleElement?
 if (!m_xCurrentObject.is())
 m_xCurrentObject = m_xStartingPoint;
 
@@ -62,7 +62,7 @@ IndexAccessIterator::~IndexAccessIterator() {}
 sal_Bool bFoundSomething = sal_False;
 while (!bFoundSomething  bHasMoreToSearch)
 {
-// pre-order-traversierung
+// Priming loop
 if (!bAlreadyCheckedCurrent  ShouldHandleElement(xSearchLoop))
 {
 m_xCurrentObject = xSearchLoop;
@@ -70,10 +70,10 @@ IndexAccessIterator::~IndexAccessIterator() {}
 }
 else
 {
-// zuerst absteigen, wenn moeglich
+// First, check to see if there's a match below
 ::com::sun::star::uno::Reference 
::com::sun::star::container::XIndexAccess xContainerAccess(xSearchLoop, 
::com::sun::star::uno::UNO_QUERY);
 if (xContainerAccess.is()  xContainerAccess-getCount()  
ShouldStepInto(xContainerAccess))
-{   // zum ersten Child
+{
 ::com::sun::star::uno::Any 
aElement(xContainerAccess-getByIndex(0));
 xSearchLoop = *(::com::sun::star::uno::Reference 
::com::sun::star::uno::XInterface*)aElement.getValue();
 bCheckingStartingPoint = sal_False;
@@ -81,10 +81,9 @@ IndexAccessIterator::~IndexAccessIterator() {}
 m_arrChildIndizies.push_back((sal_Int32)0);
 }
 else
-{
-// dann nach oben und nach rechts, wenn moeglich
+{   // otherwise, look above and to the right, if possible
 while (m_arrChildIndizies.size()  0)
-{   // (mein Stack ist nich leer, also kann ich noch nach oben 
gehen)
+{   // If the list isn't empty and there's nothing above
 ::com::sun::star::uno::Reference 
::com::sun::star::container::XChild xChild(xSearchLoop, 
::com::sun::star::uno::UNO_QUERY);
 OSL_ENSURE(xChild.is(), IndexAccessIterator::Next : a 
content has no approriate interface !);
 
@@ -92,36 +91,35 @@ IndexAccessIterator::~IndexAccessIterator() {}
 xContainerAccess = ::com::sun::star::uno::Reference 
::com::sun::star::container::XIndexAccess(xParent, 
::com::sun::star::uno::UNO_QUERY);
 OSL_ENSURE(xContainerAccess.is(), 
IndexAccessIterator::Next : a content has an invalid parent !);
 
-// den Index, den SearchLoop in diesem Parent hatte, von 
meinem 'Stack'
+// Update the search loop index
 sal_Int32 nOldSearchChildIndex = 

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

2012-01-03 Thread Stephan Bergmann
 comphelper/inc/comphelper/oslfile2streamwrap.hxx   |   11 +++
 comphelper/source/streaming/oslfile2streamwrap.cxx |7 +++
 2 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit a90d4d5f036ab7785ba72038936c6c8427b74ba8
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Jan 3 16:11:26 2012 +0100

Do not export whole class to avoid MS C++ implicitly exporting base 
template.

diff --git a/comphelper/inc/comphelper/oslfile2streamwrap.hxx 
b/comphelper/inc/comphelper/oslfile2streamwrap.hxx
index e817be9..754be72 100644
--- a/comphelper/inc/comphelper/oslfile2streamwrap.hxx
+++ b/comphelper/inc/comphelper/oslfile2streamwrap.hxx
@@ -65,17 +65,20 @@ public:
 // FmUnoOutStream,
 // Datensenke fuer Files
 //==
-class COMPHELPER_DLLPUBLIC OSLOutputStreamWrapper : public 
::cppu::WeakImplHelper1stario::XOutputStream
+class OSLOutputStreamWrapper : public 
::cppu::WeakImplHelper1stario::XOutputStream
 {
-::osl::FilerFile;
-
 public:
-OSLOutputStreamWrapper(::osl::File _rFile) :rFile(_rFile) { }
+COMPHELPER_DLLPUBLIC OSLOutputStreamWrapper(::osl::File _rFile);
+
+private:
+virtual ~OSLOutputStreamWrapper();
 
 // stario::XOutputStream
 virtual void SAL_CALL writeBytes(const staruno::Sequence sal_Int8  
aData) throw(stario::NotConnectedException, 
stario::BufferSizeExceededException, staruno::RuntimeException);
 virtual void SAL_CALL flush() throw(stario::NotConnectedException, 
stario::BufferSizeExceededException, staruno::RuntimeException);
 virtual void SAL_CALL closeOutput() throw(stario::NotConnectedException, 
stario::BufferSizeExceededException, staruno::RuntimeException);
+
+::osl::FilerFile;
 };
 
 }   // namespace comphelper
diff --git a/comphelper/source/streaming/oslfile2streamwrap.cxx 
b/comphelper/source/streaming/oslfile2streamwrap.cxx
index 06bac1d..bf93a8e 100644
--- a/comphelper/source/streaming/oslfile2streamwrap.cxx
+++ b/comphelper/source/streaming/oslfile2streamwrap.cxx
@@ -145,6 +145,13 @@ void SAL_CALL OSLInputStreamWrapper::closeInput() throw( 
stario::NotConnectedExc
 /*/
 // stario::XOutputStream
 
//--
+
+OSLOutputStreamWrapper::OSLOutputStreamWrapper(osl::File  _rFile):
+rFile(_rFile)
+{}
+
+OSLOutputStreamWrapper::~OSLOutputStreamWrapper() {}
+
 void SAL_CALL OSLOutputStreamWrapper::writeBytes(const staruno::Sequence 
sal_Int8  aData) throw( stario::NotConnectedException, 
stario::BufferSizeExceededException, staruno::RuntimeException )
 {
 sal_uInt64 nWritten;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits