[Libreoffice-commits] .: 3 commits - connectivity/source framework/inc framework/Library_fwe.mk framework/source
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Jul 27 01:31:23 PDT 2011
connectivity/source/commontools/dbtools.cxx | 4
framework/Library_fwe.mk | 1
framework/inc/classes/converter.hxx | 12 -
framework/inc/framework/eventsconfiguration.hxx | 12 -
framework/source/fwe/xml/eventsconfiguration.cxx | 157 -------------------
framework/source/fwi/classes/converter.cxx | 190 -----------------------
6 files changed, 3 insertions(+), 373 deletions(-)
New commits:
commit 179312873d83bb7af365f75ebd0919d1e3bd73b8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jul 26 23:51:02 2011 +0100
Related: fdo#35404 survive nil xTable
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index 0ada28c..a93a10c 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -1422,7 +1422,9 @@ namespace
::rtl::OUString& _out_rCatalog, ::rtl::OUString& _out_rSchema, ::rtl::OUString& _out_rName )
{
::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- Reference< XPropertySetInfo > xInfo = _xTable->getPropertySetInfo();
+ Reference< XPropertySetInfo > xInfo;
+ if (_xTable.is())
+ xInfo = _xTable->getPropertySetInfo();
if ( xInfo.is()
&& xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) )
{
commit 669c56b0caafa6a5915a8470f55c68c209699476
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jul 26 22:31:30 2011 +0100
ditch empty .cxx file
diff --git a/framework/Library_fwe.mk b/framework/Library_fwe.mk
index 9a71be9..fefd7eb 100644
--- a/framework/Library_fwe.mk
+++ b/framework/Library_fwe.mk
@@ -82,7 +82,6 @@ $(eval $(call gb_Library_add_exception_objects,fwe,\
framework/source/fwe/helper/documentundoguard \
framework/source/fwe/helper/undomanagerhelper \
framework/source/fwe/interaction/preventduplicateinteraction \
- framework/source/fwe/xml/eventsconfiguration \
framework/source/fwe/xml/eventsdocumenthandler \
framework/source/fwe/xml/menuconfiguration \
framework/source/fwe/xml/menudocumenthandler \
diff --git a/framework/source/fwe/xml/eventsconfiguration.cxx b/framework/source/fwe/xml/eventsconfiguration.cxx
deleted file mode 100644
index eeb4a1d..0000000
--- a/framework/source/fwe/xml/eventsconfiguration.cxx
+++ /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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_framework.hxx"
-#include <framework/eventsconfiguration.hxx>
-#include <xml/eventsdocumenthandler.hxx>
-#include <services.h>
-
-#include <xml/saxnamespacefilter.hxx>
-
-//_________________________________________________________________________________________________________________
-// interface includes
-//_________________________________________________________________________________________________________________
-#include <com/sun/star/xml/sax/XParser.hpp>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-//_________________________________________________________________________________________________________________
-// other includes
-//_________________________________________________________________________________________________________________
-
-#include <comphelper/processfactory.hxx>
-#include <unotools/streamwrap.hxx>
-#include <tools/debug.hxx>
-
-//_________________________________________________________________________________________________________________
-// namespace
-//_________________________________________________________________________________________________________________
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::io;
-
-
-namespace framework
-{
-
-static Reference< XParser > GetSaxParser(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory
- )
-{
- return Reference< XParser >( xServiceFactory->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY);
-}
-
-static Reference< XDocumentHandler > GetSaxWriter(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory
- )
-{
- return Reference< XDocumentHandler >( xServiceFactory->createInstance( SERVICENAME_SAXWRITER), UNO_QUERY) ;
-}
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 9accaad8642d862445393d88f941e46337250c34
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jul 26 22:14:58 2011 +0100
callcatcher: various beautifully crafted, but unused methods
diff --git a/framework/inc/classes/converter.hxx b/framework/inc/classes/converter.hxx
index b0ad6dd..a99dfc9 100644
--- a/framework/inc/classes/converter.hxx
+++ b/framework/inc/classes/converter.hxx
@@ -67,24 +67,12 @@ namespace framework{
class FWI_DLLPUBLIC Converter
{
public:
- // Seq<Any> <=> Seq<beans.PropertyValue>
- static css::uno::Sequence< css::uno::Any > convert_seqProp2seqAny ( const css::uno::Sequence< css::beans::PropertyValue >& lSource );
- static css::uno::Sequence< css::beans::PropertyValue > convert_seqAny2seqProp ( const css::uno::Sequence< css::uno::Any >& lSource );
-
// Seq<beans.NamedValue> <=> Seq<beans.PropertyValue>
- static css::uno::Sequence< css::beans::PropertyValue > convert_seqNamedVal2seqPropVal ( const css::uno::Sequence< css::beans::NamedValue >& lSource );
static css::uno::Sequence< css::beans::NamedValue > convert_seqPropVal2seqNamedVal ( const css::uno::Sequence< css::beans::PropertyValue >& lSource );
// Seq<String> => Vector<String>
static OUStringList convert_seqOUString2OUStringList( const css::uno::Sequence< ::rtl::OUString >& lSource );
- static css::uno::Sequence< ::rtl::OUString > convert_OUStringList2seqOUString( const OUStringList& lSource );
-
- static css::uno::Sequence< css::beans::PropertyValue > convert_OUStringHash2seqProp ( const OUStringHash& lSource );
- static OUStringHash convert_seqProp2OUStringHash ( const css::uno::Sequence< css::beans::PropertyValue >& lSource );
- // String <=> tools.DateTime
- static DateTime convert_String2DateTime ( const ::rtl::OUString& sSource );
- static ::rtl::OUString convert_DateTime2String ( const DateTime& aSource );
static ::rtl::OUString convert_DateTime2ISO8601 ( const DateTime& aSource );
};
diff --git a/framework/inc/framework/eventsconfiguration.hxx b/framework/inc/framework/eventsconfiguration.hxx
index da7d211..0a52126 100644
--- a/framework/inc/framework/eventsconfiguration.hxx
+++ b/framework/inc/framework/eventsconfiguration.hxx
@@ -47,18 +47,6 @@ struct FWE_DLLPUBLIC EventsConfig
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aEventsProperties;
};
-class FWE_DLLPUBLIC EventsConfiguration
-{
- public:
- static sal_Bool LoadEventsConfig(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- SvStream& rInStream, EventsConfig& aItems );
-
- static sal_Bool StoreEventsConfig(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- SvStream& rOutStream, const EventsConfig& aItems );
-};
-
} // namespace framework
#endif // __FRAMEWORK_XML_EVENTSCONFIGURATION_HXX_
diff --git a/framework/source/fwe/xml/eventsconfiguration.cxx b/framework/source/fwe/xml/eventsconfiguration.cxx
index f1583b5..eeb4a1d 100644
--- a/framework/source/fwe/xml/eventsconfiguration.cxx
+++ b/framework/source/fwe/xml/eventsconfiguration.cxx
@@ -77,81 +77,6 @@ static Reference< XDocumentHandler > GetSaxWriter(
return Reference< XDocumentHandler >( xServiceFactory->createInstance( SERVICENAME_SAXWRITER), UNO_QUERY) ;
}
-
-sal_Bool EventsConfiguration::LoadEventsConfig(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- SvStream& rInStream, EventsConfig& aItems )
-{
- Reference< XParser > xParser( GetSaxParser( xServiceFactory ) );
- Reference< XInputStream > xInputStream(
- (::cppu::OWeakObject *)new utl::OInputStreamWrapper( rInStream ),
- UNO_QUERY );
-
- // connect stream to input stream to the parser
- InputSource aInputSource;
-
- aInputSource.aInputStream = xInputStream;
-
- // create namespace filter and set events document handler inside to support xml namespaces
- Reference< XDocumentHandler > xDocHandler( new OReadEventsDocumentHandler( aItems ));
- Reference< XDocumentHandler > xFilter( new SaxNamespaceFilter( xDocHandler ));
-
- // connect parser and filter
- xParser->setDocumentHandler( xFilter );
-
- try
- {
- xParser->parseStream( aInputSource );
- return sal_True;
- }
- catch ( RuntimeException& )
- {
- return sal_False;
- }
- catch( SAXException& )
- {
- return sal_False;
- }
- catch( ::com::sun::star::io::IOException& )
- {
- return sal_False;
- }
-}
-
-
-sal_Bool EventsConfiguration::StoreEventsConfig(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
- SvStream& rOutStream, const EventsConfig& aItems )
-{
- Reference< XDocumentHandler > xWriter( GetSaxWriter( xServiceFactory ) );
-
- Reference< XOutputStream > xOutputStream(
- (::cppu::OWeakObject *)new utl::OOutputStreamWrapper( rOutStream ),
- UNO_QUERY );
-
- Reference< ::com::sun::star::io::XActiveDataSource> xDataSource( xWriter , UNO_QUERY );
- xDataSource->setOutputStream( xOutputStream );
-
- try
- {
- OWriteEventsDocumentHandler aWriteEventsDocumentHandler( aItems, xWriter );
- aWriteEventsDocumentHandler.WriteEventsDocument();
- return sal_True;
- }
- catch ( RuntimeException& )
- {
- return sal_False;
- }
- catch ( SAXException& )
- {
- return sal_False;
- }
- catch ( ::com::sun::star::io::IOException& )
- {
- return sal_False;
- }
-}
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/fwi/classes/converter.cxx b/framework/source/fwi/classes/converter.cxx
index b1b64c5..b6c684f 100644
--- a/framework/source/fwi/classes/converter.cxx
+++ b/framework/source/fwi/classes/converter.cxx
@@ -35,72 +35,6 @@ namespace framework{
//-----------------------------------------------------------------------------
/**
- * pack every property item of source list into an any entry of destination list
- * Resulting list will have follow format then: "sequence< Any(PropertyValue) >".
- * If one item couldn't be converted it will be ignored - means target list can
- * be smaller then source list. Source list isn't changed anytime.
- *
- * algorithm:
- * (a) reserve enough space on destination list for all possible entries of
- * source list
- * (b) try to pack every property of source into an any of destination list
- * (b1) count successfully packed entries only
- * (c) use this count of packed entries to resize destination list
- * Because we getted enough space before - that will remove unused items
- * of destination list at the end of it only.
- */
-css::uno::Sequence< css::uno::Any > Converter::convert_seqProp2seqAny( const css::uno::Sequence< css::beans::PropertyValue >& lSource )
-{
- sal_Int32 nCount = lSource.getLength();
- css::uno::Sequence< css::uno::Any > lDestination(nCount);
-
- for (sal_Int32 nItem=0; nItem<nCount; ++nItem)
- lDestination[nItem]<<=lSource[nItem];
-
- return lDestination;
-}
-
-//-----------------------------------------------------------------------------
-/**
- * do the same like convert_seqProp2seqAny() before - but reverse.
- * It try to unpack PropertyValue items from given Any's.
- */
-css::uno::Sequence< css::beans::PropertyValue > Converter::convert_seqAny2seqProp( const css::uno::Sequence< css::uno::Any >& lSource )
-{
- sal_Int32 nCount = lSource.getLength();
- sal_Int32 nRealCount = 0;
- css::uno::Sequence< css::beans::PropertyValue > lDestination(nCount);
-
- for (sal_Int32 nItem=0; nItem<nCount; ++nItem)
- {
- if (lSource[nItem]>>=lDestination[nItem])
- ++nRealCount;
- }
-
- if (nRealCount!=nCount)
- lDestination.realloc(nRealCount);
-
- return lDestination;
-}
-
-//-----------------------------------------------------------------------------
-/**
- * converts a sequence of NamedValue to a sequence of PropertyValue.
- */
-css::uno::Sequence< css::beans::PropertyValue > Converter::convert_seqNamedVal2seqPropVal( const css::uno::Sequence< css::beans::NamedValue >& lSource )
-{
- sal_Int32 nCount = lSource.getLength();
- css::uno::Sequence< css::beans::PropertyValue > lDestination(nCount);
- for (sal_Int32 nItem=0; nItem<nCount; ++nItem)
- {
- lDestination[nItem].Name = lSource[nItem].Name ;
- lDestination[nItem].Value = lSource[nItem].Value;
- }
- return lDestination;
-}
-
-//-----------------------------------------------------------------------------
-/**
* converts a sequence of PropertyValue to a sequence of NamedValue.
*/
css::uno::Sequence< css::beans::NamedValue > Converter::convert_seqPropVal2seqNamedVal( const css::uno::Sequence< css::beans::PropertyValue >& lSource )
@@ -132,130 +66,6 @@ OUStringList Converter::convert_seqOUString2OUStringList( const css::uno::Sequen
return lDestination;
}
-//-----------------------------------------------------------------------------
-/**
- * converts a vector of unicode strings into a sequence of such items
- */
-css::uno::Sequence< ::rtl::OUString > Converter::convert_OUStringList2seqOUString( const OUStringList& lSource )
-{
- css::uno::Sequence< ::rtl::OUString > lDestination(lSource.size());
- sal_uInt32 nItem = 0;
- for (OUStringList::const_iterator pIterator=lSource.begin(); pIterator!=lSource.end(); ++pIterator)
- {
- lDestination[nItem] = *pIterator;
- ++nItem;
- }
- return lDestination;
-}
-
-//-----------------------------------------------------------------------------
-/**
- * converts an unicode string hash to a sequence<PropertyValue>, where names and values match to key and values.
- */
-css::uno::Sequence< css::beans::PropertyValue > Converter::convert_OUStringHash2seqProp( const OUStringHash& lSource )
-{
- css::uno::Sequence< css::beans::PropertyValue > lDestination (lSource.size());
- css::beans::PropertyValue* pDestination = lDestination.getArray();
- sal_Int32 nItem = 0;
- for (OUStringHash::const_iterator pItem=lSource.begin(); pItem!=lSource.end(); ++pItem)
- {
- pDestination[nItem].Name = pItem->first ;
- pDestination[nItem].Value <<= pItem->second;
- ++nItem;
- }
- return lDestination;
-}
-
-//-----------------------------------------------------------------------------
-/**
- * converts a sequence<PropertyValue> to an unicode string hash, where keys and values match to names and values.
- */
-OUStringHash Converter::convert_seqProp2OUStringHash( const css::uno::Sequence< css::beans::PropertyValue >& lSource )
-{
- OUStringHash lDestination;
- sal_Int32 nCount = lSource.getLength();
- const css::beans::PropertyValue* pSource = lSource.getConstArray();
- for (sal_Int32 nItem=0; nItem<nCount; ++nItem)
- {
- pSource[nItem].Value >>= lDestination[pSource[nItem].Name];
- }
- return lDestination;
-}
-
-//-----------------------------------------------------------------------------
-/**
- @short convert timestamp from String to tools::DateTime notation
- @descr Format: "<day>.<month>.<year>/<hour>:<min>:<sec>"
- e.g. : "1.11.2001/13:45:16"
-
- @param sString
- timestamp in string notation
-
- @return timestamp in DateTime notation
- */
-DateTime Converter::convert_String2DateTime( /*IN*/ const ::rtl::OUString& sSource )
-{
- DateTime aStamp ;
- sal_Int32 nIndex = 0;
-
- sal_uInt16 nDay = (sal_uInt16)(sSource.getToken( 0, (sal_Unicode)'.', nIndex ).toInt32());
- if( nIndex>0 )
- {
- sal_uInt16 nMonth = (sal_uInt16)(sSource.getToken( 0, (sal_Unicode)'.', nIndex ).toInt32());
- if( nIndex>0 )
- {
- sal_uInt16 nYear = (sal_uInt16)(sSource.getToken( 0, (sal_Unicode)'/', nIndex ).toInt32());
- if( nIndex>0 )
- {
- sal_uInt32 nHour = sSource.getToken( 0, (sal_Unicode)':', nIndex ).toInt32();
- if( nIndex>0 )
- {
- sal_uInt32 nMin = sSource.getToken( 0, (sal_Unicode)':', nIndex ).toInt32();
- if( nIndex>0 && nIndex<sSource.getLength() )
- {
- sal_uInt32 nSec = sSource.copy( nIndex, sSource.getLength()-nIndex ).toInt32();
-
- Date aDate( nDay , nMonth, nYear );
- Time aTime( nHour, nMin , nSec );
- aStamp = DateTime( aDate, aTime );
- }
- }
- }
- }
- }
- return aStamp;
-}
-
-//-----------------------------------------------------------------------------
-/**
- @short convert timestamp from DateTime to String notation
- @descr Format: "<day>.<month>.<year>/<hour>:<min>:<sec>"
- e.g. : "1.11.2001/13:45:16"
-
- @param aStamp
- timestamp in DateTime notation
-
- @return timestamp in String notation
- */
-::rtl::OUString Converter::convert_DateTime2String( /*IN*/ const DateTime& aSource )
-{
- ::rtl::OUStringBuffer sBuffer(25);
-
- sBuffer.append( (sal_Int32)aSource.GetDay() );
- sBuffer.append( (sal_Unicode)'.' );
- sBuffer.append( (sal_Int32)aSource.GetMonth() );
- sBuffer.append( (sal_Unicode)'.' );
- sBuffer.append( (sal_Int32)aSource.GetYear() );
- sBuffer.append( (sal_Unicode)'/' );
- sBuffer.append( (sal_Int32)aSource.GetHour() );
- sBuffer.append( (sal_Unicode)':' );
- sBuffer.append( (sal_Int32)aSource.GetMin() );
- sBuffer.append( (sal_Unicode)':' );
- sBuffer.append( (sal_Int32)aSource.GetSec() );
-
- return sBuffer.makeStringAndClear();
-}
-
::rtl::OUString Converter::convert_DateTime2ISO8601( const DateTime& aSource )
{
::rtl::OUStringBuffer sBuffer(25);
More information about the Libreoffice-commits
mailing list