fwk139: #i110002# Remove unused code from desktop project

This commit is contained in:
Carsten Driesner 2010-05-21 16:07:16 +02:00
parent ca69909c1f
commit 6760ebfafb
8 changed files with 15 additions and 401 deletions

View file

@ -42,6 +42,20 @@ using ::rtl::OUString;
namespace dp_misc
{
//==============================================================================
void xml_parse(
Reference<xml::input::XRoot> const & xRoot,
::ucbhelper::Content & ucb_content,
Reference<XComponentContext> const & xContext )
{
const Any arg(xRoot);
const Reference<xml::sax::XDocumentHandler> xDocHandler(
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
OUSTR("com.sun.star.xml.input.SaxDocumentHandler"),
Sequence<Any>( &arg, 1 ), xContext ), UNO_QUERY_THROW );
xml_parse( xDocHandler, ucb_content, xContext );
}
//==============================================================================
void xml_parse(
Reference<xml::sax::XDocumentHandler> const & xDocHandler,
@ -61,199 +75,4 @@ void xml_parse(
xParser->parseStream( source );
}
//==============================================================================
void xml_parse(
Reference<xml::input::XRoot> const & xRoot,
::ucbhelper::Content & ucb_content,
Reference<XComponentContext> const & xContext )
{
const Any arg(xRoot);
const Reference<xml::sax::XDocumentHandler> xDocHandler(
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
OUSTR("com.sun.star.xml.input.SaxDocumentHandler"),
Sequence<Any>( &arg, 1 ), xContext ), UNO_QUERY_THROW );
xml_parse( xDocHandler, ucb_content, xContext );
}
//##############################################################################
//______________________________________________________________________________
XmlRootElement::XmlRootElement(
OUString const & uri, OUString const & localname )
: m_uri( uri )
{
m_localname = localname;
}
//______________________________________________________________________________
XmlRootElement::~XmlRootElement()
{
}
// XRoot
//______________________________________________________________________________
void XmlRootElement::startDocument(
Reference<xml::input::XNamespaceMapping> const & xMapping )
throw (xml::sax::SAXException, RuntimeException)
{
m_xNamespaceMapping = xMapping;
try {
m_uid = m_xNamespaceMapping->getUidByUri( m_uri );
}
catch (container::NoSuchElementException & exc) {
throw xml::sax::SAXException(
exc.Message, static_cast<OWeakObject *>(this), Any(exc) );
}
}
//______________________________________________________________________________
void XmlRootElement::endDocument()
throw (xml::sax::SAXException, RuntimeException)
{
}
//______________________________________________________________________________
void XmlRootElement::processingInstruction(
OUString const &, OUString const & )
throw (xml::sax::SAXException, RuntimeException)
{
}
//______________________________________________________________________________
void XmlRootElement::setDocumentLocator(
Reference<xml::sax::XLocator> const & )
throw (xml::sax::SAXException, RuntimeException)
{
}
//______________________________________________________________________________
Reference<xml::input::XElement> XmlRootElement::startRootElement(
sal_Int32 uid, OUString const & localname,
Reference<xml::input::XAttributes> const & xAttributes )
throw (xml::sax::SAXException, RuntimeException)
{
check_xmlns( uid );
if (! localname.equals( m_localname )) {
throw xml::sax::SAXException(
OUSTR("unexpected root element ") + localname,
static_cast<OWeakObject *>(this), Any() );
}
m_xAttributes = xAttributes;
return this;
}
//##############################################################################
//______________________________________________________________________________
XmlElement::~XmlElement()
{
}
//______________________________________________________________________________
void XmlElement::check_xmlns( sal_Int32 uid ) const
throw (xml::sax::SAXException)
{
if (uid != m_uid)
{
::rtl::OUStringBuffer buf;
buf.appendAscii(
RTL_CONSTASCII_STRINGPARAM("illegal xml namespace uri=\"") );
try {
buf.append( m_xNamespaceMapping->getUriByUid( uid ) );
}
catch (container::NoSuchElementException & exc) {
throw xml::sax::SAXException(
exc.Message, static_cast<OWeakObject *>(
const_cast<XmlElement *>(this) ), Any(exc) );
}
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"!") );
throw xml::sax::SAXException(
buf.makeStringAndClear(),
static_cast<OWeakObject *>( const_cast<XmlElement *>(this) ),
Any() );
}
}
// XElement
//______________________________________________________________________________
Reference<xml::input::XElement> XmlElement::getParent()
throw (RuntimeException)
{
return m_xParent;
}
//______________________________________________________________________________
OUString XmlElement::getLocalName()
throw (RuntimeException)
{
return m_localname;
}
//______________________________________________________________________________
sal_Int32 XmlElement::getUid()
throw (RuntimeException)
{
return m_uid;
}
//______________________________________________________________________________
Reference<xml::input::XAttributes> XmlElement::getAttributes()
throw (RuntimeException)
{
return m_xAttributes;
}
//______________________________________________________________________________
void XmlElement::ignorableWhitespace(
OUString const & )
throw (xml::sax::SAXException, RuntimeException)
{
}
//______________________________________________________________________________
void XmlElement::characters( OUString const & chars )
throw (xml::sax::SAXException, RuntimeException)
{
m_characters += chars;
}
//______________________________________________________________________________
void XmlElement::processingInstruction(
OUString const &, OUString const & )
throw (xml::sax::SAXException, RuntimeException)
{
}
//______________________________________________________________________________
void XmlElement::endElement()
throw (xml::sax::SAXException, RuntimeException)
{
m_got_endElement = true;
}
//______________________________________________________________________________
Reference<xml::input::XElement> XmlElement::startChildElement(
sal_Int32 uid, OUString const & localName,
Reference<xml::input::XAttributes> const & )
throw (xml::sax::SAXException, RuntimeException)
{
::rtl::OUStringBuffer buf;
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("unexpected element "
"{ tag=\"") );
buf.append( localName );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\", uri=\"") );
try {
buf.append( m_xNamespaceMapping->getUriByUid( uid ) );
}
catch (container::NoSuchElementException & exc) {
throw xml::sax::SAXException(
exc.Message, static_cast<OWeakObject *>(this), Any(exc) );
}
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\" }!") );
throw xml::sax::SAXException(
buf.makeStringAndClear(), static_cast<OWeakObject *>(this), Any() );
}
}

View file

@ -216,16 +216,6 @@ public:
*/
::rtl::OUString getIconURL( sal_Bool bHighContrast ) const;
/**
Allow direct access to the XPath functionality.
@return
direct access to the XPath functionality; null iff this instance was
constructed with a null <code>element</code>
*/
::com::sun::star::uno::Reference< ::com::sun::star::xml::xpath::XXPathAPI >
getXpath() const;
private:
SAL_DLLPRIVATE ::boost::optional< ::rtl::OUString > getOptionalValue(
::rtl::OUString const & expression) const;

View file

@ -52,110 +52,6 @@ void xml_parse(
::ucbhelper::Content & ucb_content,
css::uno::Reference< css::uno::XComponentContext > const & xContext );
//==============================================================================
void xml_parse(
css::uno::Reference< css::xml::input::XRoot > const & xRoot,
::ucbhelper::Content & ucb_content,
css::uno::Reference< css::uno::XComponentContext > const & xContext );
//==============================================================================
class XmlElement : public ::cppu::WeakImplHelper1< css::xml::input::XElement >
{
protected:
css::uno::Reference<css::xml::input::XNamespaceMapping> m_xNamespaceMapping;
const css::uno::Reference<css::xml::input::XElement> m_xParent;
sal_Int32 m_uid;
::rtl::OUString m_localname;
css::uno::Reference<css::xml::input::XAttributes> m_xAttributes;
::rtl::OUString m_characters;
bool m_got_endElement;
void check_xmlns( sal_Int32 uid ) const throw (css::xml::sax::SAXException);
inline XmlElement()
: m_uid( -1 ),
m_got_endElement( false )
{}
virtual ~XmlElement();
public:
inline bool isParsed() const { return m_got_endElement; }
inline XmlElement(
css::uno::Reference<css::xml::input::XNamespaceMapping>
const & xMapping,
css::uno::Reference<css::xml::input::XElement> const & xParent,
sal_Int32 uid, ::rtl::OUString const & localname,
css::uno::Reference< css::xml::input::XAttributes >
const & xAttributes )
: m_xNamespaceMapping( xMapping ),
m_xParent( xParent ),
m_uid( uid ),
m_localname( localname ),
m_xAttributes( xAttributes ),
m_got_endElement( false )
{}
// XElement
virtual css::uno::Reference<css::xml::input::XElement> SAL_CALL
getParent() throw (css::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getLocalName()
throw (css::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getUid()
throw (css::uno::RuntimeException);
virtual css::uno::Reference<css::xml::input::XAttributes> SAL_CALL
getAttributes() throw (css::uno::RuntimeException);
virtual void SAL_CALL ignorableWhitespace(
::rtl::OUString const & rWhitespaces )
throw (css::xml::sax::SAXException, css::uno::RuntimeException);
virtual void SAL_CALL characters( ::rtl::OUString const & rChars )
throw (css::xml::sax::SAXException, css::uno::RuntimeException);
virtual void SAL_CALL processingInstruction(
::rtl::OUString const & Target, ::rtl::OUString const & Data )
throw (css::xml::sax::SAXException, css::uno::RuntimeException);
virtual void SAL_CALL endElement()
throw (css::xml::sax::SAXException, css::uno::RuntimeException);
virtual css::uno::Reference<css::xml::input::XElement> SAL_CALL
startChildElement(
sal_Int32 nUid, ::rtl::OUString const & rLocalName,
css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
throw (css::xml::sax::SAXException, css::uno::RuntimeException);
};
//==============================================================================
class XmlRootElement : public ::cppu::ImplInheritanceHelper1<
XmlElement, css::xml::input::XRoot >
{
const ::rtl::OUString m_uri;
protected:
virtual ~XmlRootElement();
public:
inline ::rtl::OUString const & getUri() const
{ return m_uri; }
XmlRootElement(
::rtl::OUString const & uri, ::rtl::OUString const & localname );
// XRoot
virtual void SAL_CALL startDocument(
css::uno::Reference<css::xml::input::XNamespaceMapping>
const & xMapping )
throw (css::xml::sax::SAXException, css::uno::RuntimeException);
virtual void SAL_CALL endDocument()
throw (css::xml::sax::SAXException, css::uno::RuntimeException);
virtual void SAL_CALL processingInstruction(
::rtl::OUString const & target, ::rtl::OUString const & data )
throw (css::xml::sax::SAXException, css::uno::RuntimeException);
virtual void SAL_CALL setDocumentLocator(
css::uno::Reference<css::xml::sax::XLocator> const & xLocator )
throw (css::xml::sax::SAXException, css::uno::RuntimeException);
virtual css::uno::Reference<css::xml::input::XElement> SAL_CALL
startRootElement(
sal_Int32 uid, ::rtl::OUString const & localname,
css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
throw (css::xml::sax::SAXException, css::uno::RuntimeException);
};
}
#endif

View file

@ -264,12 +264,6 @@ DescriptionInfoset::getUpdateDownloadUrls() const
::boost::optional< ::rtl::OUString >();
}
css::uno::Reference< css::xml::xpath::XXPathAPI > DescriptionInfoset::getXpath()
const
{
return m_xpath;
}
::boost::optional< ::rtl::OUString > DescriptionInfoset::getOptionalValue(
::rtl::OUString const & expression) const
{

View file

@ -139,17 +139,7 @@ OO3ExtensionMigration::~OO3ExtensionMigration()
}
}
void OO3ExtensionMigration::registerConfigurationPackage( const uno::Reference< deployment::XPackage > & xPkg)
{
const ::rtl::OUString sMediaType = xPkg->getPackageType()->getMediaType();
if ( (sMediaType.equals(sConfigurationDataType) || sMediaType.equals(sConfigurationSchemaType) ) )
{
xPkg->revokePackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
xPkg->registerPackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
}
}
void OO3ExtensionMigration::scanUserExtensions( const ::rtl::OUString& sSourceDir, TStringVector& aMigrateExtensions )
void OO3ExtensionMigration::scanUserExtensions( const ::rtl::OUString& sSourceDir, TStringVector& aMigrateExtensions )
{
osl::Directory aScanRootDir( sSourceDir );
osl::FileStatus fs(FileStatusMask_Type | FileStatusMask_FileURL);
@ -382,35 +372,6 @@ bool OO3ExtensionMigration::migrateExtension( const ::rtl::OUString& sSourceDir
return false;
}
bool OO3ExtensionMigration::copy( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir )
{
bool bRet = false;
INetURLObject aSourceObj( sSourceDir );
INetURLObject aDestObj( sTargetDir );
String aName = aDestObj.getName();
aDestObj.removeSegment();
aDestObj.setFinalSlash();
try
{
::ucbhelper::Content aDestPath( aDestObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () );
uno::Reference< ucb::XCommandInfo > xInfo = aDestPath.getCommands();
::rtl::OUString aTransferName = ::rtl::OUString::createFromAscii( "transfer" );
if ( xInfo->hasCommandByName( aTransferName ) )
{
aDestPath.executeCommand( aTransferName, uno::makeAny(
ucb::TransferInfo( sal_False, aSourceObj.GetMainURL( INetURLObject::NO_DECODE ), aName, ucb::NameClash::OVERWRITE ) ) );
bRet = true;
}
}
catch( uno::Exception& )
{
}
return bRet;
}
// -----------------------------------------------------------------------------
// XServiceInfo
@ -496,32 +457,6 @@ TStringVectorPtr getContent( const ::rtl::OUString& rBaseURL )
return aResult;
}
// -----------------------------------------------------------------------------
// XJob
// -----------------------------------------------------------------------------
void OO3ExtensionMigration::copyConfig( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir )
{
::rtl::OUString sEx1( m_sSourceDir );
sEx1 += sExcludeDir1;
::rtl::OUString sEx2( m_sSourceDir );
sEx2 += sExcludeDir2;
TStringVectorPtr aList = getContent( sSourceDir );
TStringVector::const_iterator aI = aList->begin();
while ( aI != aList->end() )
{
::rtl::OUString sSourceLocalName = aI->copy( sSourceDir.getLength() );
::rtl::OUString aTemp = aI->copy( m_sSourceDir.getLength() );
if ( aTemp != sExcludeDir1 && aTemp != sExcludeDir2 )
{
::rtl::OUString sTargetName = sTargetDir + sSourceLocalName;
copy( (*aI), sTargetName );
}
++aI;
}
}
Any OO3ExtensionMigration::execute( const Sequence< beans::NamedValue >& )
throw (lang::IllegalArgumentException, Exception, RuntimeException)
{
@ -559,12 +494,6 @@ TmpRepositoryCommandEnv::TmpRepositoryCommandEnv()
{
}
TmpRepositoryCommandEnv::TmpRepositoryCommandEnv(
uno::Reference< task::XInteractionHandler> const & handler)
: m_forwardHandler(handler)
{
}
TmpRepositoryCommandEnv::~TmpRepositoryCommandEnv()
{
}

View file

@ -97,16 +97,10 @@ namespace migration
};
::osl::FileBase::RC checkAndCreateDirectory( INetURLObject& rDirURL );
void copyConfig( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir );
bool copy( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir );
ScanResult scanExtensionFolder( const ::rtl::OUString& sExtFolder );
void scanUserExtensions( const ::rtl::OUString& sSourceDir, TStringVector& aMigrateExtensions );
bool scanDescriptionXml( const ::rtl::OUString& sDescriptionXmlFilePath );
bool migrateExtension( const ::rtl::OUString& sSourceDir );
/* fills m_scriptElements and m_dialogElements
*/
void registerConfigurationPackage(
const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > & xPkg);
public:
OO3ExtensionMigration(::com::sun::star::uno::Reference<
@ -142,8 +136,6 @@ namespace migration
public:
virtual ~TmpRepositoryCommandEnv();
TmpRepositoryCommandEnv();
TmpRepositoryCommandEnv(
::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler> const & handler);
// XCommandEnvironment
virtual ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > SAL_CALL

View file

@ -219,11 +219,6 @@ FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAccep
defaultButton(WZB_NEXT);
}
void FirstStartWizard::EnableButtonsWhileMigration()
{
enableButtons(0xff, sal_True);
}
void FirstStartWizard::DisableButtonsWhileMigration()
{
enableButtons(0xff, sal_False);

View file

@ -62,7 +62,6 @@ public:
virtual short Execute();
virtual long PreNotify( NotifyEvent& rNEvt );
void EnableButtonsWhileMigration();
void DisableButtonsWhileMigration();
private: