summaryrefslogtreecommitdiff
path: root/automation/source/server
diff options
context:
space:
mode:
Diffstat (limited to 'automation/source/server')
-rw-r--r--automation/source/server/XMLParser.cxx689
-rw-r--r--automation/source/server/cmdbasestream.cxx353
-rw-r--r--automation/source/server/editwin.cxx166
-rw-r--r--automation/source/server/editwin.hxx72
-rw-r--r--automation/source/server/makefile.mk69
-rw-r--r--automation/source/server/prof_nul.cxx98
-rw-r--r--automation/source/server/prof_usl.cxx138
-rw-r--r--automation/source/server/profiler.cxx264
-rw-r--r--automation/source/server/profiler.hxx134
-rw-r--r--automation/source/server/recorder.cxx661
-rw-r--r--automation/source/server/recorder.hxx85
-rw-r--r--automation/source/server/retstrm.cxx127
-rw-r--r--automation/source/server/retstrm.hxx87
-rw-r--r--automation/source/server/scmdstrm.cxx216
-rw-r--r--automation/source/server/scmdstrm.hxx62
-rw-r--r--automation/source/server/server.cxx889
-rw-r--r--automation/source/server/server.hxx68
-rw-r--r--automation/source/server/sta_list.cxx1194
-rw-r--r--automation/source/server/statemnt.cxx6339
-rw-r--r--automation/source/server/statemnt.hxx492
-rw-r--r--automation/source/server/svcommstream.cxx51
-rw-r--r--automation/source/server/testtool.hrc55
22 files changed, 0 insertions, 12309 deletions
diff --git a/automation/source/server/XMLParser.cxx b/automation/source/server/XMLParser.cxx
deleted file mode 100644
index d056fba6f..000000000
--- a/automation/source/server/XMLParser.cxx
+++ /dev/null
@@ -1,689 +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_automation.hxx"
-#include <tools/stream.hxx>
-#include "statemnt.hxx"
-#include "rcontrol.hxx"
-#include "retstrm.hxx"
-#include <basic/svtmsg.hrc>
-
-#include <basic/ttstrhlp.hxx>
-
-#include <com/sun/star/xml/sax/XParser.hpp>
-#include <com/sun/star/xml/sax/SAXException.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/util/XCloneable.hpp>
-#include <comphelper/processfactory.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/xml/sax/SAXParseException.hpp>
-
-using namespace com::sun::star::xml::sax;
-using namespace com::sun::star::io;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::util;
-
-using ::rtl::OUString;
-
-class SVInputStream : public cppu::WeakImplHelper1< XInputStream >
-{
- SvStream* pStream;
-public:
- SVInputStream( SvStream* pSt ):pStream( pSt ){};
- ~SVInputStream(){ delete pStream; pStream=NULL; }
-
- // Methods XInputStream
- virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL available( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeInput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
-};
-
-
-sal_Int32 SAL_CALL SVInputStream::readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- aData.realloc( nBytesToRead );
- sal_Int32 nRead = pStream->Read( aData.getArray(), nBytesToRead );
- aData.realloc( nRead );
- return nRead;
-}
-
-sal_Int32 SAL_CALL SVInputStream::readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- return readBytes( aData, nMaxBytesToRead );
-}
-
-void SAL_CALL SVInputStream::skipBytes( sal_Int32 nBytesToSkip ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- if ( nBytesToSkip > 0 )
- pStream->SeekRel( nBytesToSkip );
-}
-
-sal_Int32 SAL_CALL SVInputStream::available( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- sal_uLong nCurrent = pStream->Tell();
- sal_uLong nSize = pStream->Seek( STREAM_SEEK_TO_END );
- sal_uLong nAvailable = nSize - nCurrent;
- pStream->Seek( nCurrent );
- return nAvailable;
-}
-
-void SAL_CALL SVInputStream::closeInput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
-// pStream->Close(); // automatically done in destructor
- delete pStream;
- pStream = NULL;
-}
-
-class Node;
-SV_DECL_REF(Node)
-
-enum NodeType { NODE_CHARACTER = CONST_NodeTypeCharacter,
- NODE_ELEMENT = CONST_NodeTypeElement,
- NODE_COMMENT = CONST_NodeTypeComment };
-
-class Node : public SvRefBase
-{
- NodeType aNodeType;
- Node* pParent; // Use pointer to prevent cyclic references resulting in undeleted objects
-
-protected:
- Node( NodeType aType ): aNodeType( aType ), pParent( NULL ){};
- virtual ~Node();
-
-public:
- NodeType GetNodeType() { return aNodeType; }
- void SetParent( NodeRef xNewParent );
- NodeRef GetParent();
-};
-
-SV_IMPL_REF(Node)
-// generate NodeRefMemberList
-SV_DECL_IMPL_REF_LIST( NodeRef, Node* )
-
-Node::~Node()
-{
-}
-
-void Node::SetParent( NodeRef xNewParent )
-{
- pParent = &xNewParent;
-}
-
-NodeRef Node::GetParent()
-{
- return NodeRef( pParent );
-}
-
-class CharacterNode : public Node
-{
- String aCharacters;
-public:
- CharacterNode( const String& aChars ): Node( NODE_CHARACTER ), aCharacters( aChars ){};
-
- String GetCharacters() { return aCharacters; }
-};
-
-class ElementNode : public Node
-{
- String aNodeName;
- Reference < XAttributeList > xAttributeList;
- NodeRefMemberList aDocumentNodeList;
-public:
- ElementNode( const String& aName, Reference < XAttributeList > xAttributes );
- void AppendNode( NodeRef xNewNode );
- sal_uLong GetChildCount(){ return aDocumentNodeList.Count(); }
- NodeRef GetChild( sal_uInt16 nIndex ){ return aDocumentNodeList.GetObject( nIndex ); }
- Reference < XAttributeList > GetAttributes(){ return xAttributeList; }
-
- String GetNodeName() { return aNodeName; }
-};
-
-ElementNode::ElementNode( const String& aName, Reference < XAttributeList > xAttributes )
-: Node( NODE_ELEMENT )
-, aNodeName( aName )
-{
- if ( xAttributes.is() )
- {
- Reference < XCloneable > xAttributeCloner( xAttributes, UNO_QUERY );
- if ( xAttributeCloner.is() )
- xAttributeList = Reference < XAttributeList > ( xAttributeCloner->createClone() , UNO_QUERY );
- else
- {
- OSL_FAIL("Unable to clone AttributeList");
- }
- }
-};
-
-void ElementNode::AppendNode( NodeRef xNewNode )
-{
- aDocumentNodeList.Insert ( xNewNode, LIST_APPEND );
- xNewNode->SetParent( this );
-}
-
-// XIndexAccess
-
-
-
-
-
-enum ParseAction { COLLECT_DATA, COLLECT_DATA_IGNORE_WHITESPACE, PARSE_ONLY };
-
-class SAXParser : public cppu::WeakImplHelper2< XErrorHandler, XDocumentHandler >
-{
- String aFilename;
- Reference < XParser > xParser;
-
- // XErrorHandler
- void AddToList( const sal_Char* cuType, const ::com::sun::star::uno::Any& aSAXParseException );
- String aErrors;
-
- NodeRef xTreeRoot;
- NodeRef xCurrentNode;
- sal_uLong nTimestamp;
- ParseAction aAction;
-
-public:
- SAXParser( const String &rFilename );
- ~SAXParser();
-
- // Access Methods
- NodeRef GetCurrentNode(){ return xCurrentNode; }
- void SetCurrentNode( NodeRef xCurrent ){ xCurrentNode = xCurrent; }
- NodeRef GetRootNode(){ return xTreeRoot; }
- sal_uLong GetTimestamp(){ return nTimestamp; }
- void Touch(){ nTimestamp = Time::GetSystemTicks(); }
-
- // Methods SAXParser
- sal_Bool Parse( ParseAction aAct );
- String GetErrors(){ return aErrors; }
-
- // Methods XErrorHandler
- virtual void SAL_CALL error( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL fatalError( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL warning( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
-
- // Methods XDocumentHandler
- virtual void SAL_CALL startDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL endDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL startElement( const ::rtl::OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL endElement( const ::rtl::OUString& aName ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL characters( const ::rtl::OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL ignorableWhitespace( const ::rtl::OUString& aWhitespaces ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL processingInstruction( const ::rtl::OUString& aTarget, const ::rtl::OUString& aData ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDocumentLocator( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& xLocator ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
-};
-
-
-SAXParser::SAXParser( const String &rFilename )
-: aFilename( rFilename )
-{
- Touch();
-}
-
-SAXParser::~SAXParser()
-{
- xParser.clear();
-}
-
-sal_Bool SAXParser::Parse( ParseAction aAct )
-{
- aAction = aAct;
- Touch();
- SvStream* pStream = new SvFileStream( aFilename, STREAM_STD_READ );
- if ( pStream->GetError() )
- return sal_False;
-
- InputSource sSource;
- sSource.aInputStream = new SVInputStream( pStream ); // is refcounted and hence deletet appropriately
- sSource.sPublicId = OUString( aFilename );
-
- xParser = Reference < XParser > ( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.xml.sax.Parser") ), UNO_QUERY );
- if ( xParser.is() )
- {
- xParser->setErrorHandler( ( XErrorHandler*) this );
- if ( aAction == COLLECT_DATA || aAction == COLLECT_DATA_IGNORE_WHITESPACE )
- xParser->setDocumentHandler( ( XDocumentHandler*) this );
-
- try
- {
- xParser->parseStream ( sSource );
- }
- catch( class SAXParseException & rPEx)
- {
- // TODO
- }
- catch( class Exception & rEx)
- {
- // TODO
- }
- xParser->setErrorHandler( NULL ); // otherwile Object holds itself
- if ( aAction == COLLECT_DATA || aAction == COLLECT_DATA_IGNORE_WHITESPACE )
- xParser->setDocumentHandler( NULL ); // otherwile Object holds itself
- }
- else
- return sal_False;
- return sal_True;
-}
-
-
-// Helper Methods XErrorHandler
-void SAXParser::AddToList( const sal_Char* cuType, const ::com::sun::star::uno::Any& aSAXParseException )
-{
- SAXParseException aException;
- aSAXParseException >>= aException;
-
- aErrors.Append( String( aException.PublicId ) );
- aErrors.AppendAscii( "(" );
- aErrors.Append( String::CreateFromInt64( aException.LineNumber ) );
- aErrors.AppendAscii( ":" );
- aErrors.Append( String::CreateFromInt64( aException.ColumnNumber ) );
- aErrors.AppendAscii( ") : " );
- aErrors.AppendAscii( cuType );
- aErrors.AppendAscii( ": " );
- aErrors.Append( String( aException.Message ) );
- aErrors.AppendAscii( "\n" );
-}
-
-// Methods XErrorHandler
-void SAL_CALL SAXParser::error( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
- AddToList( "error", aSAXParseException );
-}
-
-void SAL_CALL SAXParser::fatalError( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
- AddToList( "fatal error", aSAXParseException );
-}
-
-void SAL_CALL SAXParser::warning( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
- AddToList( "warning", aSAXParseException );
-}
-
-
-// Methods XDocumentHandler
-void SAXParser::startDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
- xTreeRoot = new ElementNode( CUniString("/"), Reference < XAttributeList > (NULL) );
- xCurrentNode = xTreeRoot;
- Touch();
-}
-
-void SAXParser::endDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
-}
-
-void SAXParser::startElement( const ::rtl::OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
- NodeRef xNewNode = new ElementNode ( String(aName), xAttribs );
- ((ElementNode*)(&xCurrentNode))->AppendNode( xNewNode );
- xCurrentNode = xNewNode;
-}
-
-void SAXParser::endElement( const ::rtl::OUString& aName ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
- (void) aName; /* avoid warning about unused parameter */
- xCurrentNode = xCurrentNode->GetParent();
-}
-
-void SAXParser::characters( const ::rtl::OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
- if ( aAction == COLLECT_DATA_IGNORE_WHITESPACE )
- { // check for whitespace
- sal_Bool bAllWhitespace = sal_True;
- for ( int i = 0 ; bAllWhitespace && i < aChars.getLength() ; i++ )
- if ( aChars[i] != 10 // LF
- && aChars[i] != 13 // CR
- && aChars[i] != ' ' // Blank
- && aChars[i] != '\t' ) // Tab
- bAllWhitespace = sal_False;
- if ( bAllWhitespace )
- return;
- }
- NodeRef xNewNode = new CharacterNode ( String(aChars) );
- ((ElementNode*)(&xCurrentNode))->AppendNode( xNewNode );
-}
-
-void SAXParser::ignorableWhitespace( const ::rtl::OUString& aWhitespaces ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
- (void) aWhitespaces; /* avoid warning about unused parameter */
-}
-
-void SAXParser::processingInstruction( const ::rtl::OUString& aTarget, const ::rtl::OUString& aData ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
- (void) aTarget; /* avoid warning about unused parameter */
- (void) aData; /* avoid warning about unused parameter */
-}
-
-void SAXParser::setDocumentLocator( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& xLocator ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
-{
- (void) xLocator; /* avoid warning about unused parameter */
-#if OSL_DEBUG_LEVEL > 1
- ::rtl::OUString aTester;
- aTester = xLocator->getPublicId();
- aTester = xLocator->getSystemId();
-#endif
-}
-
-
-
-
-void StatementCommand::HandleSAXParser()
-{
- static Reference < XReference > xParserKeepaliveReference; // this is to keep the Object alive only
- static SAXParser* pSAXParser;
-
- // We need spechial prerequisites for these!
-
- ElementNode* pElementNode = NULL;
- switch ( nMethodId )
- {
- case RC_SAXGetNodeType:
- case RC_SAXGetAttributeCount:
- case RC_SAXGetAttributeName:
- case RC_SAXGetAttributeValue:
- case RC_SAXGetChildCount:
- case RC_SAXGetElementName:
- case RC_SAXGetChars:
-
- case RC_SAXSeekElement:
- case RC_SAXHasElement:
- case RC_SAXGetElementPath:
- {
- if ( xParserKeepaliveReference.is() && pSAXParser->GetCurrentNode().Is() )
- {
- if ( pSAXParser->GetCurrentNode()->GetNodeType() == NODE_ELEMENT )
- {
- NodeRef xNode=pSAXParser->GetCurrentNode();
- pElementNode = (ElementNode*)(&xNode);
- }
- }
- else
- {
- ReportError( GEN_RES_STR1( S_NO_SAX_PARSER, RcString( nMethodId ) ) );
- return;
- }
-
- }
- }
-
- switch ( nMethodId )
- {
- case RC_SAXCheckWellformed:
- {
- if( (nParams & PARAM_STR_1) )
- {
- xParserKeepaliveReference.clear();
- pSAXParser = new SAXParser( aString1 );
- xParserKeepaliveReference = ( XReference* )pSAXParser;
- if ( !xParserKeepaliveReference.is() )
- ReportError( GEN_RES_STR1( S_NO_SAX_PARSER, RcString( nMethodId ) ) );
- else
- {
- if ( !pSAXParser->Parse( PARSE_ONLY ) )
- ReportError( GEN_RES_STR1( S_NO_SAX_PARSER, RcString( nMethodId ) ) );
- pRet->GenReturn ( RET_Value, nMethodId, pSAXParser->GetErrors() );
- }
-
- xParserKeepaliveReference.clear();
- }
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- break;
-
- case RC_SAXReadFile:
- {
- if( (nParams & PARAM_STR_1) )
- {
- ParseAction aAction;
- if( (nParams & PARAM_BOOL_1) && bBool1 )
- aAction = COLLECT_DATA;
- else
- aAction = COLLECT_DATA_IGNORE_WHITESPACE;
-
- xParserKeepaliveReference.clear();
- pSAXParser = new SAXParser( aString1 );
- xParserKeepaliveReference = ( XReference* )pSAXParser;
- if ( !xParserKeepaliveReference.is() )
- ReportError( GEN_RES_STR1( S_NO_SAX_PARSER, RcString( nMethodId ) ) );
- else
- {
-
- if ( !pSAXParser->Parse( aAction ) )
- ReportError( GEN_RES_STR1( S_NO_SAX_PARSER, RcString( nMethodId ) ) );
- pRet->GenReturn ( RET_Value, nMethodId, pSAXParser->GetErrors() );
- }
- }
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- break;
- case RC_SAXGetNodeType:
- {
- pRet->GenReturn ( RET_Value, nMethodId, (comm_UINT32)pSAXParser->GetCurrentNode()->GetNodeType() );
- }
- break;
- case RC_SAXGetAttributeCount:
- case RC_SAXGetAttributeName:
- case RC_SAXGetAttributeValue:
- case RC_SAXGetChildCount:
- case RC_SAXGetElementName:
- {
- if ( pElementNode )
- {
- Reference < XAttributeList > xAttributeList = pElementNode->GetAttributes();
- switch ( nMethodId )
- {
- case RC_SAXGetElementName:
- pRet->GenReturn ( RET_Value, nMethodId, pElementNode->GetNodeName() );
- break;
- case RC_SAXGetChildCount:
- pRet->GenReturn ( RET_Value, nMethodId, (comm_UINT32)pElementNode->GetChildCount() );
- break;
- case RC_SAXGetAttributeCount:
- if ( xAttributeList.is() )
- pRet->GenReturn ( RET_Value, nMethodId, (comm_UINT32)xAttributeList->getLength() );
- else
- pRet->GenReturn ( RET_Value, nMethodId, (comm_UINT32)0 );
- break;
- case RC_SAXGetAttributeName:
- {
- if( (nParams & PARAM_UINT16_1) && ValueOK( rtl::OString(), RcString( nMethodId ), nNr1, xAttributeList.is()?xAttributeList->getLength():0 ) )
- {
- String aRet( xAttributeList->getNameByIndex( nNr1-1 ) );
- pRet->GenReturn ( RET_Value, nMethodId, aRet );
- }
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- break;
- case RC_SAXGetAttributeValue:
- // Number or String
- {
- if( (nParams & PARAM_UINT16_1) && ValueOK( rtl::OString(), RcString( nMethodId ), nNr1, xAttributeList.is()?xAttributeList->getLength():0 ) )
- {
- String aRet( xAttributeList->getValueByIndex( nNr1-1 ) );
- pRet->GenReturn ( RET_Value, nMethodId, aRet );
- }
- else if( (nParams & PARAM_STR_1) && xAttributeList.is() )
- {
- String aRet( xAttributeList->getValueByName( aString1 ) );
- pRet->GenReturn ( RET_Value, nMethodId, aRet );
- }
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- break;
-
- default:
- ReportError( GEN_RES_STR1( S_INTERNAL_ERROR, RcString( nMethodId ) ) );
- }
- }
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- break;
- case RC_SAXGetChars:
- {
- if ( pSAXParser->GetCurrentNode()->GetNodeType() == NODE_CHARACTER )
- {
- NodeRef xNode=pSAXParser->GetCurrentNode();
- CharacterNode* aCharacterNode = (CharacterNode*)(&xNode);
- pRet->GenReturn ( RET_Value, nMethodId, aCharacterNode->GetCharacters() );
- }
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- break;
-
- case RC_SAXSeekElement:
- case RC_SAXHasElement:
- // Number or String
- {
- sal_Bool bCheckOnly = nMethodId == RC_SAXHasElement;
-
- if( (nParams & PARAM_UINT16_1) && !(nParams & PARAM_STR_1) )
- {
- if ( nNr1 == 0 )
- {
- if ( bCheckOnly )
- pRet->GenReturn ( RET_Value, nMethodId, pSAXParser->GetCurrentNode()->GetParent().Is() );
- else if ( pSAXParser->GetCurrentNode()->GetParent().Is() )
- pSAXParser->SetCurrentNode( pSAXParser->GetCurrentNode()->GetParent() );
- }
- else if ( !pElementNode )
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- else if ( bCheckOnly )
- pRet->GenReturn ( RET_Value, nMethodId, ValueOK( rtl::OString(), RcString( nMethodId ), nNr1, pElementNode->GetChildCount() ) );
- else if ( ValueOK( rtl::OString(), RcString( nMethodId ), nNr1, pElementNode->GetChildCount() ) )
- pSAXParser->SetCurrentNode( pElementNode->GetChild( nNr1-1 ) );
- }
- else if( (nParams & PARAM_STR_1) )
- {
- if ( aString1.EqualsAscii( "/" ) )
- {
- if ( bCheckOnly )
- pRet->GenReturn ( RET_Value, nMethodId, (comm_BOOL)sal_True );
- else
- pSAXParser->SetCurrentNode( pSAXParser->GetRootNode() );
- }
- else if ( aString1.Copy(0,2).EqualsAscii( "*:" ) )
- {
- sal_uLong nTimestamp = (sal_uLong)aString1.GetToken( 1, ':' ).ToInt64();
- sal_uLong nPointer = (sal_uLong)aString1.GetToken( 2, ':' ).ToInt64();
- if ( bCheckOnly )
- pRet->GenReturn ( RET_Value, nMethodId, (comm_BOOL)(pSAXParser->GetTimestamp() == nTimestamp) );
- else
- if ( pSAXParser->GetTimestamp() == nTimestamp )
- {
- {
- Node* pNode = (Node*)nPointer;
- pSAXParser->SetCurrentNode( NodeRef( pNode ) );
- }
- }
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- else if ( pElementNode )
- {
- sal_uInt16 nNthOccurrence;
- if( (nParams & PARAM_UINT16_1) )
- nNthOccurrence = nNr1;
- else
- nNthOccurrence = 1;
-
- sal_uInt16 i;
- NodeRef xNew;
- for ( i = 0 ; i < pElementNode->GetChildCount() && !xNew.Is() ; i++ )
- {
- xNew = pElementNode->GetChild( i );
- if ( xNew->GetNodeType() == NODE_ELEMENT )
- {
- ElementNode* pNewElement = (ElementNode*)(&xNew);
- if ( aString1.Equals( pNewElement->GetNodeName() ) )
- {
- if ( nNthOccurrence > 1 )
- {
- xNew.Clear();
- nNthOccurrence--;
- }
- }
- else
- xNew.Clear();
- }
- else
- xNew.Clear();
- }
- if ( bCheckOnly )
- pRet->GenReturn ( RET_Value, nMethodId, xNew.Is() );
- else
- if ( xNew.Is() )
- pSAXParser->SetCurrentNode( xNew );
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- else
- if ( bCheckOnly )
- pRet->GenReturn ( RET_Value, nMethodId, (comm_BOOL)sal_False );
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- break;
- case RC_SAXGetElementPath:
- {
- DBG_ASSERT( sizeof( sal_uIntPtr ) == sizeof ( void* ), "Pointertype has different size than sal_uIntPtr");
- String aPath;
- aPath.AppendAscii( "*:" );
- aPath.Append( String::CreateFromInt64( pSAXParser->GetTimestamp() ) );
- aPath.AppendAscii( ":" );
- NodeRef xNode=pSAXParser->GetCurrentNode();
- Node* pNode = (Node*)(&xNode);
- aPath.Append( String::CreateFromInt64( (sal_uIntPtr)pNode ) );
- pRet->GenReturn ( RET_Value, nMethodId, aPath );
- }
- break;
-
- case RC_SAXRelease:
- {
- xParserKeepaliveReference.clear();
- }
- break;
- default:
- ReportError( GEN_RES_STR1( S_INTERNAL_ERROR, RcString( nMethodId ) ) );
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/cmdbasestream.cxx b/automation/source/server/cmdbasestream.cxx
deleted file mode 100644
index 4d8dfe844..000000000
--- a/automation/source/server/cmdbasestream.cxx
+++ /dev/null
@@ -1,353 +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_automation.hxx"
-
-/*************************************************************************
- *
- * ATTENTION
- * This file is intended to work inside and outside the StarOffice environment.
- * Only adaption of file commtypes.hxx should be necessary. Else it is a bug!
- *
- ************************************************************************/
-#include <osl/endian.h>
-#include <osl/diagnose.h>
-
-#include "cmdbasestream.hxx"
-#include "rcontrol.hxx"
-
-CmdBaseStream::CmdBaseStream()
-: pCommStream( NULL )
-{
-}
-
-CmdBaseStream::~CmdBaseStream()
-{
-}
-
-void CmdBaseStream::GenError (rtl::OString *pUId, comm_String *pString )
-{
- Write(comm_UINT16(SIReturnError));
- Write(pUId);
- Write(pString);
-}
-
-void CmdBaseStream::GenReturn (comm_UINT16 nRet, comm_UINT32 nUId )
-{
- Write(comm_UINT16(SIReturn));
- Write(nRet);
- Write(nUId);
- Write(comm_UINT16(PARAM_NONE)); // Typ der folgenden Parameter
-}
-
-void CmdBaseStream::GenReturn (comm_UINT16 nRet, rtl::OString *pUId, comm_UINT32 nNr )
-{
- Write(comm_UINT16(SIReturn));
- Write(nRet);
- if (pUId->equalsL(RTL_CONSTASCII_STRINGPARAM("UID_ACTIVE")))
- Write(comm_UINT32(0));
- else
- Write(pUId);
- Write(comm_UINT16(PARAM_UINT32_1)); // Typ der folgenden Parameter
- Write(nNr);
-}
-
-void CmdBaseStream::GenReturn (comm_UINT16 nRet, rtl::OString *pUId, comm_String *pString )
-{
- Write(comm_UINT16(SIReturn));
- Write(nRet);
- if (pUId->equalsL(RTL_CONSTASCII_STRINGPARAM("UID_ACTIVE")))
- Write(comm_UINT32(0));
- else
- Write(pUId);
- Write(comm_UINT16(PARAM_STR_1)); // Typ der folgenden Parameter
- Write(pString);
-}
-
-void CmdBaseStream::GenReturn (comm_UINT16 nRet, rtl::OString *pUId, comm_BOOL bBool )
-{
- Write(comm_UINT16(SIReturn));
- Write(nRet);
- if (pUId->equalsL(RTL_CONSTASCII_STRINGPARAM("UID_ACTIVE")))
- Write(comm_UINT32(0));
- else
- Write(pUId);
- Write(comm_UINT16(PARAM_BOOL_1)); // Typ der folgenden Parameter
- Write(bBool);
-}
-
-void CmdBaseStream::GenReturn (comm_UINT16 nRet, rtl::OString *pUId, comm_UINT32 nNr, comm_String *pString, comm_BOOL bBool )
-{
- Write(comm_UINT16(SIReturn));
- Write(nRet);
- if (pUId->equalsL(RTL_CONSTASCII_STRINGPARAM("UID_ACTIVE")))
- Write(comm_UINT32(0));
- else
- Write(pUId);
- Write(comm_UINT16(PARAM_UINT32_1|PARAM_STR_1|PARAM_BOOL_1)); // Typ der folgenden Parameter
- Write(nNr);
- Write(pString);
- Write(bBool);
-}
-
-void CmdBaseStream::GenReturn (comm_UINT16 nRet, comm_UINT16 nMethod, comm_UINT32 nNr )
-{
- Write(comm_UINT16(SIReturn));
- Write(nRet);
- Write((comm_UINT32)nMethod); //HELPID BACKWARD (no sal_uLong needed)
- Write(comm_UINT16(PARAM_UINT32_1)); // Typ der folgenden Parameter
- Write(nNr);
-}
-
-void CmdBaseStream::GenReturn (comm_UINT16 nRet, comm_UINT16 nMethod, comm_String *pString )
-{
- Write(comm_UINT16(SIReturn));
- Write(nRet);
- Write((comm_UINT32)nMethod); //HELPID BACKWARD (no sal_uLong needed)
- Write(comm_UINT16(PARAM_STR_1)); // Typ der folgenden Parameter
- Write(pString);
-}
-
-void CmdBaseStream::GenReturn (comm_UINT16 nRet, comm_UINT16 nMethod, comm_BOOL bBool )
-{
- Write(comm_UINT16(SIReturn));
- Write(nRet);
- Write((comm_UINT32)nMethod); //HELPID BACKWARD (no sal_uLong needed)
- Write(comm_UINT16(PARAM_BOOL_1)); // Typ der folgenden Parameter
- Write(bBool);
-}
-
-void CmdBaseStream::GenReturn (comm_UINT16 nRet, comm_UINT16 nMethod, comm_UINT16 nNr )
-{
- Write(comm_UINT16(SIReturn));
- Write(nRet);
- Write((comm_UINT32)nMethod); //HELPID BACKWARD (no sal_uLong needed)
- Write(comm_UINT16(PARAM_UINT16_1)); // Typ der folgenden Parameter
- Write(nNr);
-}
-
-
-// MacroRecorder
-void CmdBaseStream::GenReturn( comm_UINT16 nRet, rtl::OString *pUId, comm_UINT16 nMethod )
-{
- Write(comm_UINT16(SIReturn));
- Write(nRet);
- Write(pUId);
- Write(comm_UINT16(PARAM_UINT16_1)); // Typ der folgenden Parameter
- Write(nMethod);
-}
-
-void CmdBaseStream::GenReturn( comm_UINT16 nRet, rtl::OString *pUId, comm_UINT16 nMethod, comm_String *pString )
-{
- Write(comm_UINT16(SIReturn));
- Write(nRet);
- Write(pUId);
- Write(comm_UINT16(PARAM_UINT16_1|PARAM_STR_1)); // Typ der folgenden Parameter
- Write(nMethod);
- Write(pString);
-}
-
-void CmdBaseStream::GenReturn( comm_UINT16 nRet, rtl::OString *pUId, comm_UINT16 nMethod, comm_String *pString, comm_BOOL bBool )
-{
- Write(comm_UINT16(SIReturn));
- Write(nRet);
- Write(pUId);
- Write(comm_UINT16(PARAM_UINT16_1|PARAM_STR_1|PARAM_BOOL_1)); // Typ der folgenden Parameter
- Write(nMethod);
- Write(pString);
- Write(bBool);
-}
-
-void CmdBaseStream::GenReturn( comm_UINT16 nRet, rtl::OString *pUId, comm_UINT16 nMethod, comm_BOOL bBool )
-{
- Write(comm_UINT16(SIReturn));
- Write(nRet);
- Write(pUId);
- Write(comm_UINT16(PARAM_UINT16_1|PARAM_BOOL_1)); // Typ der folgenden Parameter
- Write(nMethod);
- Write(bBool);
-}
-
-void CmdBaseStream::GenReturn( comm_UINT16 nRet, rtl::OString *pUId, comm_UINT16 nMethod, comm_UINT32 nNr )
-{
- Write(comm_UINT16(SIReturn));
- Write(nRet);
- Write(pUId);
- Write(comm_UINT16(PARAM_UINT16_1|PARAM_UINT32_1)); // Typ der folgenden Parameter
- Write(nMethod);
- Write(nNr);
-}
-
-
-
-void CmdBaseStream::Read (comm_UINT16 &nNr)
-{
- comm_UINT16 nId;
- *pCommStream >> nId;
- if (pCommStream->IsEof()) return;
-#if OSL_DEBUG_LEVEL > 1
- if (nId != BinUINT16) OSL_TRACE( "Falscher Typ im Stream: Erwartet USHORT, gefunden :%hu", nId );
-#endif
- *pCommStream >> nNr;
-}
-
-void CmdBaseStream::Read (comm_UINT32 &nNr)
-{
- comm_UINT16 nId;
- *pCommStream >> nId;
- if (pCommStream->IsEof()) return;
-#if OSL_DEBUG_LEVEL > 1
- if (nId != BinUINT32) OSL_TRACE( "Falscher Typ im Stream: Erwartet ULONG, gefunden :%hu", nId );
-#endif
- *pCommStream >> nNr;
-}
-
-void CmdBaseStream::Read (comm_UniChar* &aString, comm_UINT16 &nLenInChars )
-{
- comm_UINT16 nId;
- *pCommStream >> nId;
-#if OSL_DEBUG_LEVEL > 1
- if (nId != BinString) OSL_TRACE( "Falscher Typ im Stream: Erwartet String, gefunden :%hu", nId );
-#endif
-
- *pCommStream >> nLenInChars;
-
- aString = new comm_UniChar [nLenInChars];
- pCommStream->Read( aString, ((comm_UINT32)nLenInChars) * sizeof( comm_UniChar ) );
-#ifdef OSL_BIGENDIAN
- // we have to change the byteorder
- comm_UINT16 n;
- for ( n = 0 ; n < nLenInChars ; n++ )
- aString[ n ] = aString[ n ] >> 8 | aString[ n ] << 8;
-#endif
-}
-
-void CmdBaseStream::Read (comm_BOOL &bBool)
-{
- comm_UINT16 nId;
- *pCommStream >> nId;
-#if OSL_DEBUG_LEVEL > 1
- if (nId != BinBool) OSL_TRACE( "Falscher Typ im Stream: Erwartet BOOL, gefunden :%hu", nId );
-#endif
- *pCommStream >> bBool;
-}
-
-comm_UINT16 CmdBaseStream::GetNextType()
-{
- comm_UINT16 nId;
- *pCommStream >> nId;
- pCommStream->SeekRel(-2);
- return nId;
-}
-
-
-void CmdBaseStream::Write( comm_UINT16 nNr )
-{
- *pCommStream << comm_UINT16( BinUINT16 );
- *pCommStream << nNr;
-}
-
-void CmdBaseStream::Write( comm_UINT32 nNr )
-{
- *pCommStream << comm_UINT16( BinUINT32 );
- *pCommStream << nNr;
-}
-
-void CmdBaseStream::Write( const comm_UniChar* aString, comm_UINT16 nLenInChars )
-{
- *pCommStream << comm_UINT16(BinString);
-
- comm_UINT16 n;
-
- // remove BiDi and zero-width-markers 0x200B - 0x200F
- // remove BiDi and paragraph-markers 0x2028 - 0x202E
-
- comm_UniChar* aNoBiDiString;
- aNoBiDiString = new comm_UniChar [nLenInChars];
- comm_UINT16 nNewLenInChars = 0;
- for ( n = 0 ; n < nLenInChars ; n++ )
- {
- comm_UniChar c = aString[ n ];
- if ( ((c >= 0x200B) && (c <= 0x200F))
- ||((c >= 0x2028) && (c <= 0x202E)) )
- { //Ignore character
- }
- else
- {
- aNoBiDiString[ nNewLenInChars ] = c;
- nNewLenInChars++;
- }
- }
-
- *pCommStream << nNewLenInChars;
-
-#ifdef OSL_BIGENDIAN
- // we have to change the byteorder
- comm_UniChar* aNewString;
- aNewString = new comm_UniChar [nNewLenInChars];
- for ( n = 0 ; n < nNewLenInChars ; n++ )
- aNewString[ n ] = aNoBiDiString[ n ] >> 8 | aNoBiDiString[ n ] << 8;
- pCommStream->Write( aNewString, ((comm_UINT32)nNewLenInChars) * sizeof( comm_UniChar ) );
- delete [] aNewString;
-#else
- pCommStream->Write( aNoBiDiString, ((comm_UINT32)nNewLenInChars) * sizeof( comm_UniChar ) );
-#endif
-
- delete [] aNoBiDiString;
-}
-
-void CmdBaseStream::Write( comm_BOOL bBool )
-{
- *pCommStream << comm_UINT16( BinBool );
- *pCommStream << bBool;
-}
-
-void CmdBaseStream::Read ( comm_String* &pString )
-{
- (void) pString; /* avoid warning about unused parameter */
- OSL_FAIL("Read ( comm_String* &pString ) Not Implemented");
-}
-void CmdBaseStream::Read ( rtl::OString* &pId )
-{
- (void) pId; /* avoid warning about unused parameter */
- OSL_FAIL("Read ( rtl::OString* &pId ) Not Implemented");
-}
-
-void CmdBaseStream::Write( comm_String *pString )
-{
- (void) pString; /* avoid warning about unused parameter */
- OSL_FAIL("Write( comm_String *pString ) Not Implemented");
-}
-void CmdBaseStream::Write( rtl::OString* pId )
-{
- (void) pId; /* avoid warning about unused parameter */
- OSL_FAIL("Write( rtl::OString* pId ) Not Implemented");
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/editwin.cxx b/automation/source/server/editwin.cxx
deleted file mode 100644
index 1decbaef4..000000000
--- a/automation/source/server/editwin.cxx
+++ /dev/null
@@ -1,166 +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_automation.hxx"
-
-#if OSL_DEBUG_LEVEL > 1
-#include <vcl/svapp.hxx>
-#include "editwin.hxx"
-
-
-class ImpWorkWindow : public WorkWindow
-{
-public:
- MultiLineEdit m_aInhalt;
- ImpWorkWindow( WorkWindow *pParent, const UniString &rName, WinBits );
- ~ImpWorkWindow();
- void Resize();
-};
-
-ImpWorkWindow::ImpWorkWindow( WorkWindow *pParent, const String &rName, WinBits iWstyle )
-: WorkWindow( pParent , WB_SIZEMOVE )
-, m_aInhalt( this, iWstyle )
-{
- m_aInhalt.Show();
- SetText(rName);
- SetPosSizePixel( Point( 1,40 ), Size(500,150) );
- Resize();
-}
-
-ImpWorkWindow::~ImpWorkWindow()
-{
- Hide();
-}
-
-void ImpWorkWindow::Resize()
-{
- m_aInhalt.SetPosSizePixel( Point(), GetOutputSizePixel() );
-}
-
-sal_Bool EditWindow::Close()
-{
- if ( pImpWorkWindow )
- {
- delete pImpWorkWindow;
- pImpWorkWindow = NULL;
- }
- return sal_True;
-}
-
-void EditWindow::Show()
-{
- if ( Check() )
- pImpWorkWindow->Show();
- else
- bShowWin = sal_True;
-}
-
-void EditWindow::Hide()
-{
- if ( Check() )
- pImpWorkWindow->Hide();
- else
- bShowWin = sal_False;
-}
-
-EditWindow::EditWindow( WorkWindow *pParent, const String &rName, WinBits iWstyle )
-: pImpWorkWindow(NULL)
-, pMemParent(pParent)
-, aMemName(rName)
-, iMemWstyle(iWstyle)
-, nTextLen(0)
-, bQuiet(sal_False)
-{
-}
-
-EditWindow::~EditWindow()
-{
- Close();
-}
-
-sal_Bool EditWindow::Check()
-{
- if ( ! pImpWorkWindow && Application::IsInExecute() )
- {
- pImpWorkWindow = new ImpWorkWindow( pMemParent, aMemName, iMemWstyle );
- pImpWorkWindow->m_aInhalt.SetText( aMemPreWinText );
- nTextLen = aMemPreWinText.Len();
- aMemPreWinText.Erase();
- if ( bShowWin )
- pImpWorkWindow->Show();
- return sal_True;
- }
- return pImpWorkWindow != NULL;
-}
-
-void EditWindow::Clear()
-{
- if ( Check() )
- {
- pImpWorkWindow->m_aInhalt.SetText( String() );
- nTextLen = 0;
- }
- aMemPreWinText.Erase();
-}
-
-void EditWindow::AddText( const sal_Char* rNew )
-{
- AddText( UniString::CreateFromAscii( rNew ) );
-}
-
-void EditWindow::AddText( const String &rNew )
-{
- if ( bQuiet ) return;
-
- String aText = rNew;
- aText.ConvertLineEnd();
-
- if ( Check() )
- {
- if ( nTextLen > 5000 )
- {
- pImpWorkWindow->m_aInhalt.SetText( pImpWorkWindow->m_aInhalt.GetText().Erase(0,1000) );
- nTextLen = pImpWorkWindow->m_aInhalt.GetText().Len(); // Absolut, um Fehler sonstwo auszubügeln
- }
-
-
- pImpWorkWindow->m_aInhalt.SetSelection( Selection( SELECTION_MAX, SELECTION_MAX ) );
- pImpWorkWindow->m_aInhalt.ReplaceSelected( aText );
- nTextLen = nTextLen + aText.Len();
- pImpWorkWindow->m_aInhalt.SetSelection( Selection( SELECTION_MAX, SELECTION_MAX ) );
- }
- else
- {
- aMemPreWinText += aText;
- }
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/editwin.hxx b/automation/source/server/editwin.hxx
deleted file mode 100644
index bfc7e184f..000000000
--- a/automation/source/server/editwin.hxx
+++ /dev/null
@@ -1,72 +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 _EDITWIN_HXX
-#define _EDITWIN_HXX
-
-#if OSL_DEBUG_LEVEL > 1
-
-#include <vcl/wrkwin.hxx>
-
-#include <svtools/svmedit.hxx>
-
-class ImpWorkWindow;
-
-class EditWindow
-{
-protected:
- ImpWorkWindow *pImpWorkWindow;
- sal_Bool check();
-
- WorkWindow *pMemParent;
- String aMemName;
- WinBits iMemWstyle;
-
- String aMemPreWinText;
- sal_Bool bShowWin;
-
- xub_StrLen nTextLen; // aus Performanzgründen eigene Länge mitführen
-
-public:
- EditWindow( WorkWindow *pParent, const UniString &rName = UniString( RTL_CONSTASCII_USTRINGPARAM ( "Debug" ) ), WinBits iWstyle = WB_HSCROLL | WB_VSCROLL );
- virtual ~EditWindow();
-
- void Clear();
- void Show();
- void Hide();
- void AddText( const String &rNew );
- void AddText( const sal_Char* rNew );
-
- virtual sal_Bool Close(); // derived
- sal_Bool bQuiet;
- sal_Bool Check();
-};
-
-#endif
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/makefile.mk b/automation/source/server/makefile.mk
deleted file mode 100644
index a6e1ec711..000000000
--- a/automation/source/server/makefile.mk
+++ /dev/null
@@ -1,69 +0,0 @@
-#*************************************************************************
-#
-# 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.
-#
-#*************************************************************************
-PRJ=..$/..
-
-PRJNAME=automation
-TARGET=server
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES = \
- $(EXCEPTIONSFILES) \
- $(SLO)$/cmdbasestream.obj \
- $(SLO)$/editwin.obj \
- $(SLO)$/retstrm.obj \
- $(SLO)$/scmdstrm.obj \
- $(SLO)$/svcommstream.obj
-
-
-OBJFILES = \
- $(OBJ)$/cmdbasestream.obj \
- $(OBJ)$/svcommstream.obj
-
-EXCEPTIONSFILES = \
- $(SLO)$/XMLParser.obj \
- $(SLO)$/profiler.obj \
- $(SLO)$/recorder.obj \
- $(SLO)$/server.obj \
- $(SLO)$/sta_list.obj \
- $(SLO)$/statemnt.obj
-
-NOOPTFILES = $(SLO)$/statemnt.obj
-
-.IF "$(OS)"=="SOLARIS"
-SLOFILES += $(SLO)$/prof_usl.obj
-.ELSE
-SLOFILES += $(SLO)$/prof_nul.obj
-.ENDIF
-
-# --- Tagets -------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/automation/source/server/prof_nul.cxx b/automation/source/server/prof_nul.cxx
deleted file mode 100644
index b9106ec7c..000000000
--- a/automation/source/server/prof_nul.cxx
+++ /dev/null
@@ -1,98 +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_automation.hxx"
-
-
-#include "profiler.hxx"
-#include "rcontrol.hxx"
-#include <basic/ttstrhlp.hxx>
-
-struct SysdepProfileSnapshot
-{
- // Hier stehen alle Felder zum Speichern eines Snapshot
-};
-
-
-struct SysdepStaticData
-{
- // Hier steht alles, was während des Profiles ständig gebraucht wird
-};
-
-
-void TTProfiler::InitSysdepProfiler()
-{
- if ( !pSysDepStatic ) // Sollte immer so sein!!
- pSysDepStatic = new SysdepStaticData;
- // Hier initialisieren
-
-};
-
-void TTProfiler::DeinitSysdepProfiler()
-{
- if ( pSysDepStatic ) // Sollte immer so sein!!
- {
- // Hier aufräumen und eventuell Speicher freigeben
-
- delete pSysDepStatic;
- }
-};
-
-SysdepProfileSnapshot *TTProfiler::NewSysdepSnapshotData()
-{
- return new SysdepProfileSnapshot;
-};
-
-void TTProfiler::DeleteSysdepSnapshotData( SysdepProfileSnapshot *pSysdepProfileSnapshot )
-{
- delete pSysdepProfileSnapshot;
-};
-
-
-// Titelzeile für Logdatei
-String TTProfiler::GetSysdepProfileHeader()
-{
- return String(CUniString("(noch) keine weiteren Daten Implementiert"));
-};
-
-
-// Zustand merken
-void TTProfiler::GetSysdepProfileSnapshot( SysdepProfileSnapshot *, sal_uInt16 )
-{};
-
-
-// Informationszeile zusammenbauen
-String TTProfiler::GetSysdepProfileLine( SysdepProfileSnapshot *, SysdepProfileSnapshot * )
-{
- return String();
-};
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/prof_usl.cxx b/automation/source/server/prof_usl.cxx
deleted file mode 100644
index dfbbe0fd5..000000000
--- a/automation/source/server/prof_usl.cxx
+++ /dev/null
@@ -1,138 +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_automation.hxx"
-
-
-#include <procfs.h>
-#include <tools/stream.hxx>
-#include "profiler.hxx"
-
-
-struct SysdepProfileSnapshot
-{
- pstatus mpstatus;
- psinfo mpsinfo;
- prusage mprusage;
-};
-
-
-struct SysdepStaticData
-{
- // Hier steht alles, was während des Profiles ständig gebraucht wird
-};
-
-
-void TTProfiler::InitSysdepProfiler()
-{
- if ( !pSysDepStatic ) // Sollte immer so sein!!
- pSysDepStatic = new SysdepStaticData;
- // Hier initialisieren
-
-};
-
-void TTProfiler::DeinitSysdepProfiler()
-{
- if ( pSysDepStatic ) // Sollte immer so sein!!
- {
- // Hier aufräumen und eventuell Speicher freigeben
-
- delete pSysDepStatic;
- }
-};
-
-SysdepProfileSnapshot *TTProfiler::NewSysdepSnapshotData()
-{
- return new SysdepProfileSnapshot;
-};
-
-void TTProfiler::DeleteSysdepSnapshotData( SysdepProfileSnapshot *pSysdepProfileSnapshot )
-{
- delete pSysdepProfileSnapshot;
-};
-
-
-// Titelzeile für Logdatei
-String TTProfiler::GetSysdepProfileHeader()
-{
- return String::CreateFromAscii(" Size(Kb) ResidentSZ rtime ktime utime total");
-};
-
-
-// Zustand merken
-void TTProfiler::GetSysdepProfileSnapshot( SysdepProfileSnapshot *pSysdepProfileSnapshot, sal_uInt16 )
-{
- SvFileStream aStream( String::CreateFromAscii("/proc/self/psinfo"), STREAM_READ ); // Das ist ein expliziter Pfad für UNXSOL!
- if ( aStream.IsOpen() )
- {
- aStream.Read( &(pSysdepProfileSnapshot->mpsinfo), sizeof( psinfo ) );
- aStream.Close();
- }
- SvFileStream anotherStream( String::CreateFromAscii("/proc/self/status"), STREAM_READ ); // Das ist ein expliziter Pfad für UNXSOL!
- if ( anotherStream.IsOpen() )
- {
- anotherStream.Read( &(pSysdepProfileSnapshot->mpstatus), sizeof( pstatus ) );
- anotherStream.Close();
- }
- SvFileStream YetAnotherStream( String::CreateFromAscii("/proc/self/usage"), STREAM_READ ); // Das ist ein expliziter Pfad für UNXSOL!
- if ( YetAnotherStream.IsOpen() )
- {
- YetAnotherStream.Read( &(pSysdepProfileSnapshot->mprusage), sizeof( prusage ) );
- YetAnotherStream.Close();
- }
-};
-
-#define DIFF2( aFirst, aSecond, Membername ) ( aSecond.Membername - aFirst.Membername )
-#define CALC_MS( nSec, nNSec ) ( nSec * 1000 + (nNSec+500000) / 1000000 )
-#define DIFF_MS( pStart, pEnd, Member ) ( CALC_MS( pEnd->Member.tv_sec, pEnd->Member.tv_nsec ) - CALC_MS( pStart->Member.tv_sec, pStart->Member.tv_nsec ) )
-// Informationszeile zusammenbauen
-String TTProfiler::GetSysdepProfileLine( SysdepProfileSnapshot *pStart, SysdepProfileSnapshot *pStop )
-{
- String aProfile;
-
- aProfile += Pad( String::CreateFromInt64(pStop->mpsinfo.pr_size), 9);
- aProfile += Pad( String::CreateFromInt64(pStop->mpsinfo.pr_rssize), 11);
-
-
- aProfile += Pad( String::CreateFromInt64(DIFF_MS( pStart, pStop, mprusage.pr_rtime ) / AVER( pStart, pStop, mprusage.pr_count )), 7 );
-
-
- sal_uLong d_utime = DIFF_MS( pStart, pStop, mpstatus.pr_utime ) + DIFF_MS( pStart, pStop, mpstatus.pr_cutime );
- sal_uLong d_stime = DIFF_MS( pStart, pStop, mpstatus.pr_stime ) + DIFF_MS( pStart, pStop, mpstatus.pr_cstime );
-
- aProfile += Pad( String::CreateFromInt64(d_utime), 7 );
- aProfile += Pad( String::CreateFromInt64(d_stime), 7 );
- aProfile += Pad( String::CreateFromInt64(d_utime + d_stime), 7 );
-
- return aProfile;
-};
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/profiler.cxx b/automation/source/server/profiler.cxx
deleted file mode 100644
index c8b623167..000000000
--- a/automation/source/server/profiler.cxx
+++ /dev/null
@@ -1,264 +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_automation.hxx"
-
-
-#include <tools/time.hxx>
-#include <tools/string.hxx>
-#include <unotools/localedatawrapper.hxx>
-#include <vcl/svapp.hxx>
-#include <basic/ttstrhlp.hxx>
-
-
-#include "profiler.hxx"
-
-
-TTProfiler::TTProfiler()
-: mpStart( NULL )
-, mpEnd( NULL )
-, bIsProfileIntervalStarted( sal_False )
-, bIsProfilingPerCommand( sal_False )
-, bIsPartitioning( sal_False )
-, bIsAutoProfiling( sal_False )
-, pSysDepStatic( NULL )
-{
- InitSysdepProfiler();
- mpStart = new ProfileSnapshot;
- mpStart->pSysdepProfileSnapshot = NewSysdepSnapshotData();
- mpEnd = new ProfileSnapshot;
- mpEnd->pSysdepProfileSnapshot = NewSysdepSnapshotData();
- StartProfileInterval();
-}
-
-TTProfiler::~TTProfiler()
-{
- if ( IsAutoProfiling() )
- StopAutoProfiling();
- if ( mpStart )
- {
- if ( mpStart->pSysdepProfileSnapshot )
- DeleteSysdepSnapshotData( mpStart->pSysdepProfileSnapshot );
- delete mpStart;
- mpStart = NULL;
- }
- if ( mpEnd )
- {
- if ( mpEnd->pSysdepProfileSnapshot )
- DeleteSysdepSnapshotData( mpEnd->pSysdepProfileSnapshot );
- delete mpEnd;
- mpEnd = NULL;
- }
- DeinitSysdepProfiler();
-}
-
-
-String TTProfiler::GetProfileHeader()
-{
- UniString aReturn;
- aReturn += '\n';
- if ( !IsAutoProfiling() )
- aReturn.AppendAscii("Befehl").Append(TabString(36));
-
- aReturn.AppendAscii(" Zeitdauer");
- aReturn.AppendAscii(" Ticks in %");
- aReturn.Append( GetSysdepProfileHeader() );
- aReturn.AppendAscii("\n");
- return aReturn;
-}
-
-
-void TTProfiler::StartProfileInterval( sal_Bool bReadAnyway )
-{
- if ( !bIsProfileIntervalStarted || bReadAnyway )
- {
- GetProfileSnapshot( mpStart );
- GetSysdepProfileSnapshot( mpStart->pSysdepProfileSnapshot, PROFILE_START );
- bIsProfileIntervalStarted = sal_True;
- }
-}
-
-String TTProfiler::GetProfileLine( ProfileSnapshot *pStart, ProfileSnapshot *pEnd )
-{
- String aProfileString;
-
- aProfileString += Pad(GetpApp()->GetAppLocaleDataWrapper().getDuration( DIFF( pStart, pEnd, aTime) , sal_True, sal_True ), 12);
-
- sal_uLong nProcessTicks = DIFF( pStart, pEnd, nProcessTicks );
- sal_uLong nSystemTicks = DIFF( pStart, pEnd, nSystemTicks );
- if ( nSystemTicks )
- {
- aProfileString += Pad(UniString::CreateFromInt32( (100 * nProcessTicks) / nSystemTicks ), 11);
- aProfileString += '%';
- }
- else
- aProfileString += Pad(CUniString("?? "), 12);
-
- return aProfileString;
-}
-
-
-String TTProfiler::GetProfileLine( String &aPrefix )
-{
- String aProfileString;
- if ( IsProfilingPerCommand() || IsAutoProfiling() )
- {
- aProfileString = aPrefix;
- aProfileString += TabString(35);
-
-
- aProfileString += GetProfileLine( mpStart, mpEnd );
- aProfileString += GetSysdepProfileLine( mpStart->pSysdepProfileSnapshot, mpEnd->pSysdepProfileSnapshot );
- aProfileString += '\n';
- }
-
- return aProfileString;
-}
-
-
-void TTProfiler::EndProfileInterval()
-{
- GetProfileSnapshot( mpEnd );
- GetSysdepProfileSnapshot( mpEnd->pSysdepProfileSnapshot, PROFILE_END );
- bIsProfileIntervalStarted = sal_False;
-}
-
-
-void TTProfiler::GetProfileSnapshot( ProfileSnapshot *pProfileSnapshot )
-{
- pProfileSnapshot->aTime = Time();
- pProfileSnapshot->nProcessTicks = Time::GetProcessTicks();
- pProfileSnapshot->nSystemTicks = Time::GetSystemTicks();
-}
-
-
-void TTProfiler::StartProfilingPerCommand() // Jeden Befehl mitschneiden
-{
- bIsProfilingPerCommand = sal_True;
-}
-
-void TTProfiler::StopProfilingPerCommand()
-{
- bIsProfilingPerCommand = sal_False;
-}
-
-void TTProfiler::StartPartitioning()
-{
- bIsPartitioning = sal_True;
-}
-
-void TTProfiler::StopPartitioning()
-{
- bIsPartitioning = sal_True;
-}
-
-sal_uLong TTProfiler::GetPartitioningTime()
-{
- return DIFF( mpStart, mpEnd, nSystemTicks );
-}
-
-
-
-void TTProfiler::StartAutoProfiling( sal_uLong nMSec )
-{
- if ( !bIsAutoProfiling )
- {
- pAutoStart = new ProfileSnapshot;
- pAutoStart->pSysdepProfileSnapshot = NewSysdepSnapshotData();
- pAutoEnd = new ProfileSnapshot;
- pAutoEnd->pSysdepProfileSnapshot = NewSysdepSnapshotData();
- GetProfileSnapshot( pAutoStart );
- GetSysdepProfileSnapshot( pAutoStart->pSysdepProfileSnapshot, PROFILE_START );
- SetTimeout( nMSec );
- bIsAutoProfiling = sal_True;
- Start();
- }
-
-}
-
-void TTProfiler::Timeout()
-{
- GetProfileSnapshot( pAutoEnd );
- GetSysdepProfileSnapshot( pAutoEnd->pSysdepProfileSnapshot, PROFILE_END );
- String aLine;
-
- aLine += GetProfileLine( pAutoStart, pAutoEnd );
- aLine += GetSysdepProfileLine( pAutoStart->pSysdepProfileSnapshot, pAutoEnd->pSysdepProfileSnapshot );
- aLine += '\n';
-
- aAutoProfileBuffer += aLine;
-
- ProfileSnapshot *pTemp = pAutoStart; // Tauschen, so daß jetziges Ende nächsten Start wird
- pAutoStart = pAutoEnd;
- pAutoEnd = pTemp;
-
- Start(); // Timer neu starten
-}
-
-String TTProfiler::GetAutoProfiling()
-{
- String aTemp(aAutoProfileBuffer);
- aAutoProfileBuffer.Erase();
- return aTemp;
-}
-
-void TTProfiler::StopAutoProfiling()
-{
- if ( bIsAutoProfiling )
- {
- Stop();
- bIsAutoProfiling = sal_False;
- }
-}
-
-
-
-//String TTProfiler::Hex( sal_uLong nNr )
-String TTProfiler::Dec( sal_uLong nNr )
-{
- String aRet(UniString::CreateFromInt32(nNr));
- if ( nNr < 100 )
- {
- aRet = Pad( aRet, 3);
- aRet.SearchAndReplaceAll(' ','0');
- }
- aRet.Insert( ',', aRet.Len() - 2 );
- return aRet;
-}
-
-String TTProfiler::Pad( const String &aS, xub_StrLen nLen )
-{
- if ( nLen > aS.Len() )
- return UniString().Fill( nLen - aS.Len() ).Append( aS );
- else
- return CUniString(" ").Append( aS );
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/profiler.hxx b/automation/source/server/profiler.hxx
deleted file mode 100644
index d6ff79b85..000000000
--- a/automation/source/server/profiler.hxx
+++ /dev/null
@@ -1,134 +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.
- *
- ************************************************************************/
-
-
-
-#define AVER( pFirst, pSecond, Membername ) (( pFirst->Membername + pSecond->Membername ) / 2 )
-#define DIFF( pFirst, pSecond, Membername ) ( pSecond->Membername - pFirst->Membername )
-#define S_SAFEDIV( a,b ) ((b)==0?CUniString("#DIV"):UniString::CreateFromInt32( (ULONG) ((a)/(b))))
-#define S_SAFEDIV_DEC( a,b ) ((b)==0?CUniString("#DIV"):Dec((ULONG) ((a)/(b))))
-
-#include <tools/time.hxx>
-#include <tools/string.hxx>
-#include <vcl/timer.hxx>
-
-#define PROFILE_START 0x01
-#define PROFILE_END 0x02
-
-
-struct SysdepProfileSnapshot;
-struct SysdepStaticData; // Nicht wirklich statisch, sondern statisch �ber mehrere Snapshots
-
-struct ProfileSnapshot
-{
- Time aTime;
- SysdepProfileSnapshot *pSysdepProfileSnapshot;
- sal_uLong nProcessTicks;
- sal_uLong nSystemTicks;
-};
-
-
-class TTProfiler : private Timer
-{
-public:
- TTProfiler();
- ~TTProfiler();
-
- String GetProfileHeader(); // Titelzeile f�r Logdatei
- void StartProfileInterval( sal_Bool bReadAnyway = sal_False ); // Zustand merken
- void EndProfileInterval(); // Informationszeile zusammenbauen
- String GetProfileLine( String &aPrefix );
-
-
- void StartProfilingPerCommand(); // Jeden Befehl mitschneiden
- void StopProfilingPerCommand();
- sal_Bool IsProfilingPerCommand() { return bIsProfilingPerCommand; }
-
- void StartPartitioning();
- void StopPartitioning();
- sal_Bool IsPartitioning() { return bIsPartitioning; }
- sal_uLong GetPartitioningTime();
-
- void StartAutoProfiling( sal_uLong nMSec ); // Automatisch alle nMSec Milisekunden sampeln
- String GetAutoProfiling(); // Aktuelle `Sammlung` abholen
- void StopAutoProfiling(); // Sampeln beenden
- sal_Bool IsAutoProfiling() { return bIsAutoProfiling; }
-
-private:
-
- void GetProfileSnapshot( ProfileSnapshot *pProfileSnapshot );
-
- // Informationszeile zusammenbauen
- String GetProfileLine( ProfileSnapshot *pStart, ProfileSnapshot *pStop );
-
-
- ProfileSnapshot *mpStart;
- ProfileSnapshot *mpEnd;
- sal_Bool bIsProfileIntervalStarted;
- sal_Bool bIsProfilingPerCommand;
- sal_Bool bIsPartitioning;
-
-
-// F�r das Automatische Profiling in festen Intervallen
-
- ProfileSnapshot *pAutoStart;
- ProfileSnapshot *pAutoEnd;
- sal_Bool bIsAutoProfiling;
- String aAutoProfileBuffer;
-
- virtual void Timeout();
-
-
-// Einige Hilfsfunktionen
-
- String Dec( sal_uLong nNr ); // Ergebnis = nNr / 100 mit 2 Dezimalen
- String Pad( const String &aS, xub_StrLen nLen ); // F�gt blanks links an den String an
-
-/* Ab hier werden die Methoden Systemabh�ngig in den entsprechenden cxx implementiert
- Sie werden von den oberen Methoden gerufen.
-*/
-
- SysdepStaticData *pSysDepStatic;
-
- void InitSysdepProfiler();
- void DeinitSysdepProfiler();
-
- SysdepProfileSnapshot *NewSysdepSnapshotData();
- void DeleteSysdepSnapshotData( SysdepProfileSnapshot *pSysdepProfileSnapshot );
-
- // Titelzeile f�r Logdatei
- String GetSysdepProfileHeader();
-
- // Zustand merken
- void GetSysdepProfileSnapshot( SysdepProfileSnapshot *pSysdepProfileSnapshot, sal_uInt16 nMode = PROFILE_START | PROFILE_END );
-
- // Informationszeile zusammenbauen
- String GetSysdepProfileLine( SysdepProfileSnapshot *pStart, SysdepProfileSnapshot *pStop );
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/recorder.cxx b/automation/source/server/recorder.cxx
deleted file mode 100644
index a88efbebf..000000000
--- a/automation/source/server/recorder.cxx
+++ /dev/null
@@ -1,661 +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_automation.hxx"
-#include <osl/mutex.hxx>
-
-#include <vcl/window.hxx>
-#include <vcl/vclevent.hxx>
-#include <vcl/button.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/spinfld.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/toolbox.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/sound.hxx>
-#include <vcl/combobox.hxx>
-#include <vcl/floatwin.hxx>
-#include <basic/ttstrhlp.hxx>
-#include "statemnt.hxx"
-#include "retstrm.hxx"
-#include "rcontrol.hxx"
-#include "recorder.hxx"
-
-#include <comphelper/uieventslogger.hxx>
-
-MacroRecorder* MacroRecorder::pMacroRecorder = NULL;
-
-MacroRecorder::MacroRecorder()
-: pLastWin( NULL )
-, pEditModify( NULL )
-, pActionParent( NULL )
-, aKeyUniqueID()
-, pKeyWin( NULL )
-, bKeyFollowFocus( sal_False )
-, m_bRecord( sal_False )
-, m_bLog( sal_False )
-{
- aHookRefresh.SetTimeout( 500 );
- aHookRefresh.SetTimeoutHdl( LINK( this, MacroRecorder, HookRefreshHdl) );
- aHookRefresh.Start();
- aEventListenerHdl = LINK( this, MacroRecorder, EventListener );
- AddEventHooks();
-}
-
-MacroRecorder::~MacroRecorder()
-{
- aHookRefresh.Stop();
- RemoveEventHooks();
-}
-
-void MacroRecorder::AddEventHooks()
-{
- Window *pTopLevel = Application::GetFirstTopLevelWindow();
- while ( pTopLevel )
- {
- Window *pParent = pTopLevel;
- while ( pParent->GetParent() )
- pParent = pParent->GetParent();
-
- pParent->RemoveChildEventListener( aEventListenerHdl ); // might be instrumented already
- pParent->AddChildEventListener( aEventListenerHdl );
-
- pTopLevel = Application::GetNextTopLevelWindow( pTopLevel );
- }
-}
-
-void MacroRecorder::RemoveEventHooks()
-{
- Window *pTopLevel = Application::GetFirstTopLevelWindow();
- while ( pTopLevel )
- {
- pTopLevel->RemoveChildEventListener( aEventListenerHdl );
- pTopLevel = Application::GetNextTopLevelWindow( pTopLevel );
- }
-}
-
-IMPL_LINK( MacroRecorder, HookRefreshHdl, void*, EMPTYARG )
-{
- AddEventHooks();
- return 0;
-}
-
-void MacroRecorder::LogVCL( rtl::OString aParentID, sal_uInt16 nVCLWindowType, rtl::OString aID, String aMethod, sal_uInt16 nParam )
-{
- ::comphelper::UiEventsLogger::logVcl( Id2Str( aParentID ), nVCLWindowType, Id2Str( aID ), aMethod, nParam );
-}
-
-void MacroRecorder::LogVCL( rtl::OString aParentID, sal_uInt16 nVCLWindowType, rtl::OString aID, String aMethod )
-{
- ::comphelper::UiEventsLogger::logVcl( Id2Str( aParentID ), nVCLWindowType, Id2Str( aID ), aMethod );
-}
-
-Window* MacroRecorder::GetParentWithID( Window* pThis )
-{
- Window *pOverlap = pThis->GetWindow( WINDOW_OVERLAP );
- while ( pOverlap != pThis && !pThis->GetUniqueOrHelpId().getLength() && pThis->GET_REAL_PARENT() )
- pThis = pThis->GET_REAL_PARENT();
- return pThis;
-}
-
-rtl::OString MacroRecorder::GetParentID( Window* pThis )
-{
- if ( pThis->GetParent() )
- return pThis->GetParent()->GetUniqueOrHelpId();
- else
- return rtl::OString();
-}
-
-IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent )
-{
- sal_Bool bSendData = sal_False;
-
- if ( pEvent->ISA( VclWindowEvent ) )
- {
- VclWindowEvent* pWinEvent = ( VclWindowEvent* ) pEvent;
- Window* pWin = pWinEvent->GetWindow();
- sal_uLong nEventID = pWinEvent->GetId();
-#if OSL_DEBUG_LEVEL > 1
- if ( nEventID >= 1001 && nEventID != VCLEVENT_WINDOW_KEYUP )
- nEventID = pWinEvent->GetId(); // Just something to set a breakpoint
- else
- return 0;
-#endif
-
-// check for different action after collecting keys
- // send if there_is_something_to_send
- // and eather event_is_not_of_interest
- // or ( new_window and new_window_is_interesting ) ( ignore interesting events to uninteresting window )
-
- if ( aKeyString.Len()
- && ( ( nEventID != VCLEVENT_WINDOW_KEYINPUT
- && nEventID != VCLEVENT_WINDOW_MOUSEMOVE
- && nEventID != VCLEVENT_WINDOW_COMMAND
- && nEventID != VCLEVENT_WINDOW_KEYUP )
- || ( pKeyWin != pWin
- && ( pWin->GetType() == WINDOW_CONTROL || pWin->GetType() == WINDOW_WINDOW )
- )
- )
- )
- {
- if ( m_bRecord )
- {
- // we cannot access pKeyWin since it might have dissapeared
- if ( bKeyFollowFocus )
- StatementList::pRet->GenReturn( RET_MacroRecorder, aKeyUniqueID, (sal_uInt16)M_TypeKeys, aKeyString, bKeyFollowFocus );
- else
- StatementList::pRet->GenReturn( RET_MacroRecorder, aKeyUniqueID, (sal_uInt16)M_TypeKeys, aKeyString );
-#if OSL_DEBUG_LEVEL > 1
- StatementList::pRet->GenReturn( RET_MacroRecorder, aKeyUniqueID, (sal_uInt16)M_TypeKeys, String::CreateFromInt32( nEventID ) );
-#endif
- bSendData = sal_True;
- }
- // cleanup
- aKeyString.Erase();
- pKeyWin = NULL;
- bKeyFollowFocus = sal_False;
- }
-
- switch ( pWin->GetType() )
- {
- case WINDOW_TABPAGE:
- switch( nEventID )
- {
- case VCLEVENT_WINDOW_ACTIVATE:
- if ( m_bRecord )
- {
- StatementList::pRet->GenReturn( RET_MacroRecorder, rtl::OString(), (comm_UINT16)(M_SetPage|M_RET_NUM_CONTROL), Id2Str( pWin->GetUniqueOrHelpId() ) );
- bSendData = sal_True;
- }
- if ( m_bLog )
- {
- LogVCL( rtl::OString(), pWin->GetType(), pWin->GetUniqueOrHelpId(), CUniString("SetPage") );
- }
- break;
- }
- break;
- case WINDOW_RADIOBUTTON:
- case WINDOW_IMAGERADIOBUTTON:
- switch( nEventID )
- {
- case VCLEVENT_BUTTON_CLICK: // VCLEVENT_RADIOBUTTON_TOGGLE
- {
- if ( ((RadioButton*)pWin)->IsChecked() )
- {
- if ( m_bRecord )
- {
- StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), (comm_UINT16)M_Check );
- bSendData = sal_True;
- }
- if ( m_bLog )
- {
- LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), CUniString("Check") );
- }
- }
- }
- break;
- }
- break;
- case WINDOW_CHECKBOX:
- case WINDOW_TRISTATEBOX:
- switch( nEventID )
- {
- case VCLEVENT_BUTTON_CLICK: //VCLEVENT_CHECKBOX_TOGGLE:
- {
- comm_UINT16 nMethod;
- String aMethod;
- switch ( ((TriStateBox*)pWin)->GetState() )
- {
- case STATE_CHECK: nMethod = M_Check; aMethod = CUniString("Check"); break;
- case STATE_NOCHECK: nMethod = M_UnCheck; aMethod = CUniString("UnCheck"); break;
- case STATE_DONTKNOW: nMethod = M_TriState; aMethod = CUniString("TriState"); break;
- default: nMethod = M_Check;
- OSL_FAIL( "Unknown state in TriStateBox::GetState()" );
- }
- if ( m_bRecord )
- {
- StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), nMethod );
- bSendData = sal_True;
- }
- if ( m_bLog )
- {
- LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), aMethod );
- }
- }
- break;
- }
- break;
- case WINDOW_EDIT:
- case WINDOW_MULTILINEEDIT:
- switch( nEventID )
- {
- case VCLEVENT_EDIT_MODIFY:
- pEditModify = pWin;
- aEditModifyString = ((Edit*)pWin)->GetText();
- break;
- }
- break;
- case WINDOW_MULTILISTBOX:
- switch( nEventID )
- {
- case VCLEVENT_LISTBOX_SELECT:
- Sound::Beep();
- }
- case WINDOW_LISTBOX:
- switch( nEventID )
- {
- case VCLEVENT_LISTBOX_SELECT:
- if ( m_bRecord )
- {
- StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), (comm_UINT16)M_Select, comm_UINT32( ((ListBox*)pWin)->GetSelectEntryPos() +1 ) );
- bSendData = sal_True;
- }
- if ( m_bLog )
- {
- LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), CUniString("Select"), ((ListBox*)pWin)->GetSelectEntryPos() );
- }
- break;
- }
- break;
- case WINDOW_COMBOBOX:
- case WINDOW_PATTERNBOX:
- case WINDOW_NUMERICBOX:
- case WINDOW_METRICBOX:
- case WINDOW_CURRENCYBOX:
- case WINDOW_DATEBOX:
- case WINDOW_TIMEBOX:
- switch( nEventID )
- {
- case VCLEVENT_EDIT_MODIFY:
- pEditModify = pWin;
- aEditModifyString = ((Edit*)pWin)->GetText();
- break;
- case VCLEVENT_COMBOBOX_SELECT:
- {
- pEditModify = NULL;
- aEditModifyString.Erase();
-
- sal_uInt16 nPos = ((ComboBox*)pWin)->GetEntryPos(((ComboBox*)pWin)->GetText());
- if ( m_bRecord )
- {
- if ( nPos == COMBOBOX_ENTRY_NOTFOUND )
- Sound::Beep();
- else
- {
- StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), (comm_UINT16)M_Select, (comm_UINT32) nPos+1 );
- bSendData = sal_True;
- }
- }
- if ( m_bLog )
- {
- LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), CUniString("Select"), nPos );
- }
- }
- }
- break;
- case WINDOW_PUSHBUTTON:
- case WINDOW_OKBUTTON:
- case WINDOW_CANCELBUTTON:
- case WINDOW_IMAGEBUTTON:
- case WINDOW_MOREBUTTON:
- case WINDOW_HELPBUTTON:
- switch( nEventID )
- {
- case VCLEVENT_BUTTON_CLICK:
- Window* pParent = pWin->GetParent();
- sal_Bool bDone = sal_False;
- if ( pParent->IsDialog() && !pWin->GetUniqueOrHelpId().getLength() )
- {
- switch ( pParent->GetType() )
- {
- case WINDOW_MESSBOX:
- case WINDOW_INFOBOX:
- case WINDOW_WARNINGBOX:
- case WINDOW_ERRORBOX:
- case WINDOW_QUERYBOX:
- case WINDOW_BUTTONDIALOG:
- {
- comm_UINT16 nMethod;
- String aMethod;
- ButtonDialog* pBD = (ButtonDialog*)pParent;
-
- // we have to find the current Button ID ourselves since it is not generated at this point :-(
- sal_uInt16 nCurrentButtonId = 0xffff; // Some wild value to wak up people
- sal_uInt16 i;
- for ( i = 0; i < pBD->GetButtonCount() ; i++ )
- {
- if ( pBD->GetPushButton( pBD->GetButtonId(i) ) == pWin )
- {
- nCurrentButtonId = pBD->GetButtonId(i);
- break;
- }
- }
-
- switch ( nCurrentButtonId )
- {
- case BUTTONID_OK: nMethod = M_OK; aMethod = CUniString("OK"); break;
- case BUTTONID_CANCEL: nMethod = M_Cancel; aMethod = CUniString("Cancel"); break;
- case BUTTONID_YES: nMethod = M_Yes; aMethod = CUniString("Yes"); break;
- case BUTTONID_NO: nMethod = M_No; aMethod = CUniString("No"); break;
- case BUTTONID_RETRY: nMethod = M_Repeat; aMethod = CUniString("Repeat"); break;
- case BUTTONID_HELP: nMethod = M_Help; aMethod = CUniString("Help"); break;
- default: nMethod = M_Click; aMethod = CUniString("Click");
- }
- if ( m_bRecord )
- {
- if ( nMethod != M_Click )
- StatementList::pRet->GenReturn( RET_MacroRecorder, UID_ACTIVE, nMethod );
- else
- StatementList::pRet->GenReturn( RET_MacroRecorder, UID_ACTIVE, nMethod, (comm_UINT32)nCurrentButtonId );
- bSendData = sal_True;
- }
- if ( m_bLog )
- {
- if ( nMethod != M_Click )
- LogVCL( rtl::OString(), pWin->GetType(), pWin->GetUniqueOrHelpId(), aMethod );
- else
- LogVCL( rtl::OString(), pWin->GetType(), pWin->GetUniqueOrHelpId(), aMethod, nCurrentButtonId );
- bDone = sal_True;
- }
- }
- break;
- default:
- {
- comm_UINT16 nMethod;
- String aMethod;
- switch ( pWin->GetType() )
- {
- case WINDOW_OKBUTTON: nMethod = M_OK; aMethod = CUniString("OK"); break;
- case WINDOW_CANCELBUTTON: nMethod = M_Cancel; aMethod = CUniString("Cancel"); break;
- case WINDOW_HELPBUTTON: nMethod = M_Help; aMethod = CUniString("Help"); break;
- default: nMethod = M_Default;aMethod = CUniString("Unknown Button");
- OSL_FAIL( "Unknown Button" );
- }
- if ( m_bRecord )
- {
- StatementList::pRet->GenReturn( RET_MacroRecorder, pParent->GetUniqueOrHelpId(), nMethod );
- bSendData = sal_True;
- }
- if ( m_bLog )
- {
- LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), aMethod );
- bDone = sal_True;
- }
- }
- break;
- }
- }
- if ( m_bRecord )
- {
- if ( !bSendData && pWin->GetUniqueOrHelpId().getLength() )
- {
- StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), (comm_UINT16)M_Click );
- bSendData = sal_True;
- }
- }
- if ( m_bLog )
- {
- if ( !bDone )
- LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), CUniString("Click") );
- }
- }
- break;
- case WINDOW_SPINFIELD:
- case WINDOW_PATTERNFIELD:
- case WINDOW_NUMERICFIELD:
- case WINDOW_METRICFIELD:
- case WINDOW_CURRENCYFIELD:
- case WINDOW_DATEFIELD:
- case WINDOW_TIMEFIELD:
- switch( nEventID )
- {
- case VCLEVENT_SPINFIELD_UP:
- case VCLEVENT_SPINFIELD_DOWN:
- case VCLEVENT_SPINFIELD_FIRST:
- case VCLEVENT_SPINFIELD_LAST:
- {
- pEditModify = NULL;
- aEditModifyString.Erase();
-
- comm_UINT16 nMethod;
- String aMethod;
- switch ( nEventID )
- {
- case VCLEVENT_SPINFIELD_UP: nMethod = M_More; aMethod = CUniString("More"); break;
- case VCLEVENT_SPINFIELD_DOWN: nMethod = M_Less; aMethod = CUniString("Less"); break;
- case VCLEVENT_SPINFIELD_FIRST: nMethod = M_ToMin; aMethod = CUniString("ToMin"); break;
- case VCLEVENT_SPINFIELD_LAST: nMethod = M_ToMax; aMethod = CUniString("ToMax"); break;
- default: nMethod = M_ToMin; aMethod = CUniString("Unknown");
- OSL_FAIL( "Unknown EventID in Spinfield" );
- }
- if ( m_bRecord )
- {
- StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), nMethod );
- bSendData = sal_True;
- }
- if ( m_bLog )
- {
- LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), aMethod );
- }
- }
- break;
- case VCLEVENT_EDIT_MODIFY:
- pEditModify = pWin;
- aEditModifyString = ((SpinField*)pWin)->GetText();
- break;
- }
- break;
-
- case WINDOW_MENUBUTTON:
- switch( nEventID )
- {
- case VCLEVENT_BUTTON_CLICK:
- if ( m_bRecord )
- {
- StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), (comm_UINT16)M_Click );
- bSendData = sal_True;
- }
- if ( m_bLog )
- {
- LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), CUniString("Click") );
- }
- break;
- }
- break;
- case WINDOW_TOOLBOX:
- {
- ToolBox *pTB = ((ToolBox*)pWin);
- switch( nEventID )
- {
- case VCLEVENT_TOOLBOX_SELECT:
- { // a Button has been clicked
- // so this cannot be a tearoff or OpenMenu anymore
- pActionParent = NULL;
- // compare to 1 for floating ToolBoxes
- if ( m_bRecord )
- {
- if ( !pWin->GetUniqueOrHelpId().getLength() /* || pWin->GetUniqueOrHelpId().Matches( 1 ) */ )
- // generate direct Button access
- StatementList::pRet->GenReturn( RET_MacroRecorder, Str2Id( pTB->GetItemCommand( pTB->GetCurItemId() ) ), (comm_UINT16)(M_Click) );
- else
- // access via Toolbox
- StatementList::pRet->GenReturn( RET_MacroRecorder, pTB->GetUniqueOrHelpId(), (comm_UINT16)(M_Click|M_RET_NUM_CONTROL), Id2Str( pTB->GetHelpId( pTB->GetCurItemId() ) ) );
- bSendData = sal_True;
- }
- }
- break;
- case VCLEVENT_TOOLBOX_CLICK: /// ATTENTION this is called during initialisation of toolbox. whoever 'invented' this
- pActionParent = pTB;
- break;
- case VCLEVENT_TOOLBOX_DEACTIVATE:
- pActionParent = NULL;
- break;
- }
- }
- break;
- case WINDOW_CONTROL:
- case WINDOW_WINDOW:
- switch( nEventID )
- {
- case VCLEVENT_WINDOW_COMMAND:
- break;
- case VCLEVENT_WINDOW_KEYINPUT:
- {
- const KeyEvent *pKeyEvent = ((KeyEvent*)pWinEvent->GetData());
- const KeyCode aKeyCode = pKeyEvent->GetKeyCode();
- if ( pKeyEvent )
- {
- pKeyWin = pWin;
- Window *pIdWin = GetParentWithID( pWin );
- if ( pIdWin != pWin )
- bKeyFollowFocus = sal_True;
- aKeyUniqueID = pIdWin->GetUniqueOrHelpId();
- if ( ( !aKeyCode.IsMod1() && !aKeyCode.IsMod2() ) &&
- (( aKeyCode.GetGroup() == KEYGROUP_NUM) ||
- ( aKeyCode.GetGroup() == KEYGROUP_ALPHA) ||
- ( aKeyCode.GetCode() == KEY_SPACE) ||
- ( aKeyCode.GetCode() == KEY_ADD) ||
- ( aKeyCode.GetCode() == KEY_SUBTRACT) ||
- ( aKeyCode.GetCode() == KEY_MULTIPLY) ||
- ( aKeyCode.GetCode() == KEY_DIVIDE) ||
- ( aKeyCode.GetCode() == KEY_POINT) ||
- ( aKeyCode.GetCode() == KEY_COMMA) ||
- ( aKeyCode.GetCode() == KEY_EQUAL) ||
- ( aKeyCode.GetCode() == 0) ) )
- {
- DBG_ASSERT( pKeyEvent->GetCharCode(), "no charcode found" );
- aKeyString += pKeyEvent->GetCharCode();
- }
- else
- { // not a regular key, transfer KeyCode
- aKeyString += sal_Unicode(1); // mask it
- // extra for '>' which is coded as <SHIFT GREATER>
- if ( pKeyEvent->GetCharCode() == '>' )
- aKeyString += sal_Unicode( KEY_GREATER | (aKeyCode.GetAllModifier() & ~KEY_SHIFT) );
- else
- aKeyString += sal_Unicode( aKeyCode.GetCode() | aKeyCode.GetAllModifier() );
- }
- }
- }
- break;
-
- case VCLEVENT_WINDOW_MOUSEMOVE:
- case VCLEVENT_WINDOW_MOUSEBUTTONDOWN:
- case VCLEVENT_WINDOW_MOUSEBUTTONUP:
- {
- }
- break;
-
-
- }
- break;
- case WINDOW_DOCKINGWINDOW:
- {
-// case 1 .. 0xffff:
- OSL_TRACE( "TT_VCLMessage %u %u %X",nEventID, pWin->GetType(), pWin );
- }
- break;
- case WINDOW_FLOATINGWINDOW:
- {
- OSL_TRACE( "TT_VCLMessage %u %u %X",nEventID, pWin->GetType(), pWin );
- }
- break;
- }
-
- switch( nEventID )
- {
- case VCLEVENT_CONTROL_LOSEFOCUS:
- if ( pEditModify == pWin )
- {
- if ( m_bRecord )
- {
- StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), M_SetText, aEditModifyString );
- bSendData = sal_True;
- }
- if ( m_bLog )
- {
- LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), CUniString("Modify") );
- }
- pEditModify = NULL;
- aEditModifyString.Erase(); //could be somewhat lengthy
- }
- break;
- }
-
- pLastWin = pWin;
- } // if
-
- if ( bSendData )
- new StatementFlow( NULL, F_EndCommandBlock ); // Kommando zum Senden erzeugen und in que eintragen
-
- return 0;
-}
-
-
-
-static ::osl::Mutex * getRecorderMutex()
-{
- static ::osl::Mutex * pMutex = NULL;
- if(pMutex==NULL)
- {
- ::osl::MutexGuard aGuard(::osl::Mutex::getGlobalMutex());
- if(pMutex==NULL)
- pMutex = new ::osl::Mutex();
- }
- return pMutex;
-}
-
-
-void MacroRecorder::CheckDelete()
-{
- ::osl::MutexGuard aGuard( getRecorderMutex() );
- if ( !m_bRecord && !m_bLog )
- {
- pMacroRecorder = NULL;
- delete this;
- }
-}
-
-
-MacroRecorder* MacroRecorder::GetMacroRecorder()
-{
- ::osl::MutexGuard aGuard( getRecorderMutex() );
- if ( !pMacroRecorder )
- pMacroRecorder = new MacroRecorder;
-
- return pMacroRecorder;
-}
-
-sal_Bool MacroRecorder::HasMacroRecorder()
-{
- ::osl::MutexGuard aGuard( getRecorderMutex() );
- return pMacroRecorder != NULL;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/recorder.hxx b/automation/source/server/recorder.hxx
deleted file mode 100644
index 179319850..000000000
--- a/automation/source/server/recorder.hxx
+++ /dev/null
@@ -1,85 +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.
- *
- ************************************************************************/
-
-#include <tools/string.hxx>
-#include <tools/link.hxx>
-#include <vcl/timer.hxx>
-
-class ToolBox;
-class Window;
-class VclSimpleEvent;
-
-class MacroRecorder
-{
-private:
- Window* GetParentWithID( Window* pThis );
- rtl::OString GetParentID( Window* pThis );
-
- Link aEventListenerHdl;
- DECL_LINK( EventListener, VclSimpleEvent* );
-
- Window* pLastWin;
- Window* pEditModify;
- String aEditModifyString;
-
- ToolBox *pActionParent; // toolbox from which a tearoff or OpenMenu might happen
-
- // record keys
- String aKeyString;
- rtl::OString aKeyUniqueID; // has to be remembered seperately since Window might be gone when needed
- Window* pKeyWin;
- sal_Bool bKeyFollowFocus;
-
- AutoTimer aHookRefresh;
- void AddEventHooks();
- void RemoveEventHooks();
- DECL_LINK( HookRefreshHdl, void* );
-
- void LogVCL( rtl::OString aParentID, sal_uInt16 nVCLWindowType, rtl::OString aID, String aMethod, sal_uInt16 aParam );
- void LogVCL( rtl::OString aParentID, sal_uInt16 nVCLWindowType, rtl::OString aID, String aMethod );
-
- static MacroRecorder *pMacroRecorder;
-
- MacroRecorder();
- ~MacroRecorder();
- void CheckDelete();
-
- // Actions to perform
- sal_Bool m_bRecord;
- sal_Bool m_bLog;
-
-public:
-
- void SetActionRecord( sal_Bool bRecord = sal_True ) { m_bRecord = bRecord; CheckDelete(); };
- void SetActionLog( sal_Bool bLog = sal_True ) { m_bLog = bLog; CheckDelete(); };
-
- static MacroRecorder* GetMacroRecorder();
- static sal_Bool HasMacroRecorder();
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/retstrm.cxx b/automation/source/server/retstrm.cxx
deleted file mode 100644
index 8cc639a43..000000000
--- a/automation/source/server/retstrm.cxx
+++ /dev/null
@@ -1,127 +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_automation.hxx"
-#include <tools/stream.hxx>
-#include <basic/ttstrhlp.hxx>
-
-#include "retstrm.hxx"
-#include "rcontrol.hxx"
-#include "svcommstream.hxx"
-
-
-RetStream::RetStream()
-{
- pSammel = new SvMemoryStream();
- pCommStream = new SvCommStream( pSammel );
-}
-
-RetStream::~RetStream()
-{
- delete pCommStream;
- delete pSammel;
-}
-
-void RetStream::GenError ( rtl::OString aUId, String aString )
-{
- CmdBaseStream::GenError ( &aUId, &aString );
-}
-
-void RetStream::GenReturn ( sal_uInt16 nRet, rtl::OString aUId, String aString )
-{
- CmdBaseStream::GenReturn ( nRet, &aUId, &aString );
-}
-
-void RetStream::GenReturn ( sal_uInt16 nRet, rtl::OString aUId, comm_UINT32 nNr, String aString, sal_Bool bBool )
-{
- CmdBaseStream::GenReturn ( nRet, &aUId, nNr, &aString, bBool );
-}
-
-// MacroRecorder
-void RetStream::GenReturn( sal_uInt16 nRet, rtl::OString aUId, comm_UINT16 nMethod, String aString )
-{
- CmdBaseStream::GenReturn ( nRet, &aUId, nMethod, &aString );
-}
-
-void RetStream::GenReturn( sal_uInt16 nRet, rtl::OString aUId, comm_UINT16 nMethod, String aString, sal_Bool bBool )
-{
- CmdBaseStream::GenReturn ( nRet, &aUId, nMethod, &aString, bBool );
-}
-
-
-void RetStream::GenReturn ( sal_uInt16 nRet, sal_uInt16 nMethod, SbxValue &aValue )
-{
- Write(sal_uInt16(SIReturn));
- Write(nRet);
- Write((comm_UINT32)nMethod); //HELPID BACKWARD (no sal_uLong needed)
- Write(sal_uInt16(PARAM_SBXVALUE_1)); // Typ der folgenden Parameter
- Write(aValue);
-}
-
-void RetStream::GenReturn( sal_uInt16 nRet, sal_uInt16 nMethod, String aString )
-{
- CmdBaseStream::GenReturn ( nRet, nMethod, &aString );
-}
-
-
-
-
-void RetStream::Write( String *pString )
-{
- CmdBaseStream::Write( pString->GetBuffer(), pString->Len() );
-}
-
-void RetStream::Write( SbxValue &aValue )
-{
- *pSammel << sal_uInt16( BinSbxValue );
- aValue.Store( *pSammel );
-}
-
-void RetStream::Write( rtl::OString* pId )
-{
- //HELPID BACKWARD (should use ByteString or OString)
- String aTmp( Id2Str( *pId ) );
- Write( &aTmp );
-}
-
-
-SvStream* RetStream::GetStream()
-{
- return pSammel;
-}
-
-void RetStream::Reset ()
-{
- delete pCommStream;
- delete pSammel;
- pSammel = new SvMemoryStream();
- pCommStream = new SvCommStream( pSammel );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/retstrm.hxx b/automation/source/server/retstrm.hxx
deleted file mode 100644
index 30e2625f5..000000000
--- a/automation/source/server/retstrm.hxx
+++ /dev/null
@@ -1,87 +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 _RETSTRM_HXX
-#define _RETSTRM_HXX
-
-#include <basic/sbxvar.hxx>
-#include "cmdbasestream.hxx"
-
-class SvStream;
-
-class RetStream: public CmdBaseStream
-{
-
-public:
- RetStream();
- ~RetStream();
-
- using CmdBaseStream::GenError;
- void GenError( rtl::OString aUId, String aString );
-
- using CmdBaseStream::GenReturn;
- void GenReturn( comm_UINT16 nRet, comm_UINT32 nNr ){CmdBaseStream::GenReturn( nRet, nNr );}
- void GenReturn( comm_UINT16 nRet, rtl::OString aUId, comm_UINT32 nNr ){CmdBaseStream::GenReturn( nRet, &aUId, nNr );}
- void GenReturn( comm_UINT16 nRet, rtl::OString aUId, comm_BOOL bBool ){CmdBaseStream::GenReturn( nRet, &aUId, bBool );}
-
-// MacroRecorder
- void GenReturn( comm_UINT16 nRet, rtl::OString aUId, comm_UINT16 nMethod ){CmdBaseStream::GenReturn( nRet, &aUId, nMethod );} // also used outside MacroRecorder
- void GenReturn( comm_UINT16 nRet, rtl::OString aUId, comm_UINT16 nMethod, comm_BOOL bBool ){CmdBaseStream::GenReturn( nRet, &aUId, nMethod, bBool );}
- void GenReturn( comm_UINT16 nRet, rtl::OString aUId, comm_UINT16 nMethod, comm_UINT32 nNr ){CmdBaseStream::GenReturn( nRet, &aUId, nMethod, nNr );}
-
- void GenReturn( sal_uInt16 nRet, rtl::OString aUId, String aString );
- void GenReturn( sal_uInt16 nRet, rtl::OString aUId, comm_UINT32 nNr, String aString, sal_Bool bBool );
-
-// needed for RemoteCommand and Profiling
- void GenReturn( sal_uInt16 nRet, sal_uInt16 nMethod, SbxValue &aValue );
- void GenReturn( sal_uInt16 nRet, sal_uInt16 nMethod, String aString );
-
-// MacroRecorder
- void GenReturn( sal_uInt16 nRet, rtl::OString aUId, comm_UINT16 nMethod, String aString );
- void GenReturn( sal_uInt16 nRet, rtl::OString aUId, comm_UINT16 nMethod, String aString, sal_Bool bBool );
-
- void Reset();
- SvStream* GetStream();
-
-
-
- using CmdBaseStream::Write;
- void Write( comm_UINT16 nNr ){CmdBaseStream::Write( nNr );}
- void Write( comm_UINT32 nNr ){CmdBaseStream::Write( nNr );}
- void Write( comm_BOOL bBool ){CmdBaseStream::Write( bBool );}
- void Write( SbxValue &aValue );
-
-// Complex Datatypes to be handled system dependent
- virtual void Write( rtl::OString* pId );
- virtual void Write( String *pString );
-
- SvStream *pSammel;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/scmdstrm.cxx b/automation/source/server/scmdstrm.cxx
deleted file mode 100644
index 2ab459c7a..000000000
--- a/automation/source/server/scmdstrm.cxx
+++ /dev/null
@@ -1,216 +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_automation.hxx"
-#include <svl/intitem.hxx>
-#include <svl/stritem.hxx>
-#include <svl/eitem.hxx>
-#include "scmdstrm.hxx"
-#include "svcommstream.hxx"
-#include "rcontrol.hxx"
-
-#if OSL_DEBUG_LEVEL > 1
-#include "editwin.hxx"
-#include "statemnt.hxx"
-#endif
-
-SCmdStream::SCmdStream(SvStream *pIn)
-{
- pSammel = pIn;
- pCommStream = new SvCommStream( pSammel );
-}
-
-SCmdStream::~SCmdStream()
-{
- delete pCommStream;
-}
-
-void SCmdStream::Read (String* &pString)
-{
- if ( !pString )
- pString = new String();
- comm_UniChar* pStr;
- sal_uInt16 nLenInChars;
- CmdBaseStream::Read( pStr, nLenInChars );
-
- *pString = String( pStr, nLenInChars );
- delete [] pStr;
-}
-
-void SCmdStream::Read (String &aString)
-{
- comm_UniChar* pStr;
- sal_uInt16 nLenInChars;
- CmdBaseStream::Read( pStr, nLenInChars );
-
- aString = String( pStr, nLenInChars );
- delete [] pStr;
-}
-
-void SCmdStream::Read ( SfxPoolItem *&pItem )
-{
- sal_uInt16 nType;
- sal_uInt16 nId;
- Read(nId);
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "Parameter: " );
- StatementList::m_pDbgWin->AddText( String::CreateFromInt32( nId ) );
- StatementList::m_pDbgWin->AddText( " " );
-#endif
- Read( nType );
- switch (nType)
- {
- case BinUINT16:
- {
- comm_UINT16 nNr;
- Read (nNr );
- pItem = new SfxUInt16Item(nId,nNr);
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "UINT16" );
- StatementList::m_pDbgWin->AddText( String::CreateFromInt32( nNr ) );
-#endif
- }
- break;
- case BinUINT32:
- {
- comm_UINT32 nNr;
- Read (nNr );
- pItem = new SfxUInt32Item(nId,nNr);
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "UINT32" );
- StatementList::m_pDbgWin->AddText( String::CreateFromInt64( nNr ) );
-#endif
- }
- break;
- case BinString:
- {
- String aString;
- Read (aString);
-
- pItem = new SfxStringItem(nId,aString);
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "String:" );
- StatementList::m_pDbgWin->AddText( aString );
-#endif
- }
- break;
- case BinBool:
- {
- comm_BOOL bBool;
- Read (bBool);
- pItem = new SfxBoolItem(nId,bBool);
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "BOOL:" );
- StatementList::m_pDbgWin->AddText( bBool ? "TRUE" : "FALSE" );
-#endif
- }
- break;
- default:
- OSL_TRACE( "Ungültiger Typ im Stream:%hu", nType );
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "Ungültiger Typ !!!! " );
-#endif
- break;
- }
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "\n" );
-#endif
-}
-
-void SCmdStream::Read ( ::com::sun::star::beans::PropertyValue &rItem )
-{
- sal_uInt16 nType;
- String aId;
- Read(aId);
- rItem.Name = rtl::OUString( aId );
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "Parameter: " );
- StatementList::m_pDbgWin->AddText( aId );
- StatementList::m_pDbgWin->AddText( " " );
-#endif
- nType = GetNextType();
- switch (nType)
- {
- case BinUINT16:
- {
- comm_UINT16 nNr;
- Read (nNr );
- rItem.Value <<= nNr;
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "UINT16" );
- StatementList::m_pDbgWin->AddText( String::CreateFromInt32( nNr ) );
-#endif
- }
- break;
- case BinUINT32:
- {
- comm_UINT32 nNr;
- Read (nNr );
- rItem.Value <<= nNr;
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "UINT32" );
- StatementList::m_pDbgWin->AddText( String::CreateFromInt64( nNr ) );
-#endif
- }
- break;
- case BinString:
- {
- String aString;
- Read (aString);
- rItem.Value <<= ::rtl::OUString( aString );
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "String:" );
- StatementList::m_pDbgWin->AddText( aString );
-#endif
- }
- break;
- case BinBool:
- {
- comm_BOOL bBool;
- Read (bBool);
- rItem.Value <<= bBool;
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "BOOL:" );
- StatementList::m_pDbgWin->AddText( bBool ? "TRUE" : "FALSE" );
-#endif
- }
- break;
- default:
- OSL_TRACE( "Ungültiger Typ im Stream:%hu", nType );
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "Ungültiger Typ !!!! " );
-#endif
- break;
- }
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "\n" );
-#endif
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/scmdstrm.hxx b/automation/source/server/scmdstrm.hxx
deleted file mode 100644
index 5ef7a8c2b..000000000
--- a/automation/source/server/scmdstrm.hxx
+++ /dev/null
@@ -1,62 +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 _SCMDSTRM_HXX
-#define _SCMDSTRM_HXX
-
-#include <tools/solar.h>
-#include <com/sun/star/beans/PropertyValue.hpp>
-
-#include "cmdbasestream.hxx"
-
-class SvStream;
-class SfxPoolItem;
-class String;
-class ICommStream;
-
-class SCmdStream: public CmdBaseStream
-{
- SvStream *pSammel;
-
-public:
- SCmdStream( SvStream *pIn );
- ~SCmdStream();
-
- using CmdBaseStream::Read;
- void Read ( comm_UINT16 &nNr ){CmdBaseStream::Read ( nNr );}
- void Read ( comm_UINT32 &nNr ){CmdBaseStream::Read ( nNr );}
- void Read ( comm_BOOL &bBool ){CmdBaseStream::Read ( bBool );}
- void Read ( String &aString );
- void Read ( SfxPoolItem *&pItem );
- void Read ( ::com::sun::star::beans::PropertyValue &rItem );
-
- virtual void Read (String* &pString);
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/server.cxx b/automation/source/server/server.cxx
deleted file mode 100644
index 0fdafedd4..000000000
--- a/automation/source/server/server.cxx
+++ /dev/null
@@ -1,889 +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_automation.hxx"
-
-// do not use Application Idle but AutoTimer instead
-#define TIMERIDLE
-
-#include <vcl/timer.hxx>
-#include <vcl/wrkwin.hxx>
-#include <osl/diagnose.h>
-#include <osl/mutex.hxx>
-#include <osl/socket.hxx>
-
-#include <vcl/dialog.hxx>
-#include <tools/stream.hxx>
-#include <tools/config.hxx>
-
-#include <svtools/ttprops.hxx>
-#include <basic/ttstrhlp.hxx>
-#include <svl/stritem.hxx>
-#include <svtools/stringtransfer.hxx>
-#include <vcl/sound.hxx>
-#include "testtool.hrc"
-#include <vcl/bitmap.hxx>
-// Hat keinen Includeschutz
-#include <svtools/svtdata.hxx>
-#include <rtl/textenc.h>
-#include <rtl/uri.h>
-#include <rtl/uri.hxx>
-#include "statemnt.hxx"
-#include "scmdstrm.hxx"
-#include "rcontrol.hxx"
-#include "server.hxx"
-#include "testtool.hxx"
-#include "automation/automation.hxx"
-#include "recorder.hxx"
-
-#include "basic/svtmsg.hrc"
-
-#ifdef DBG_UTIL
-void TestToolDebugPrint( const sal_Char *pString )
-{
- if ( !DbgFilterMessage( pString ) )
- StatementList::DirectLog( S_AssertError, UniString( pString, RTL_TEXTENCODING_UTF8 ) );
-}
-void SAL_CALL osl_TestToolDebugPrint( const sal_Char *pString )
-{
- TestToolDebugPrint( pString );
-}
-#endif
-
-
-sal_uLong RemoteControlCommunicationManager::nPortIs = TT_PORT_NOT_INITIALIZED;
-sal_uInt16 RemoteControlCommunicationManager::nComm = 0;
-sal_Bool RemoteControlCommunicationManager::bQuiet = sal_False;
-
-#if OSL_DEBUG_LEVEL > 1
-RemoteControlCommunicationManager::RemoteControlCommunicationManager( EditWindow * pDbgWin )
-#else
-RemoteControlCommunicationManager::RemoteControlCommunicationManager()
-#endif
-: CommunicationManagerServerViaSocket( GetPort(), 1, sal_True )
-#if OSL_DEBUG_LEVEL > 1
-, m_pDbgWin( pDbgWin )
-#endif
-, pTimer( NULL )
-{
- bIsPortValid = ( GetPort() != 0 );
- if ( bQuiet )
- {
- SetInfoType( CM_NO_TEXT );
- }
- else
- {
- SetInfoType( CM_SHORT_TEXT | CM_ALL );
- ByteString aByteString;
- InfoMsg( InfoString( aByteString, CM_ALL ) ); // Anzeigen, da� wir da sind
- }
-}
-
-RemoteControlCommunicationManager::~RemoteControlCommunicationManager()
-{
- if ( pTimer )
- delete pTimer;
- DoQuickShutdown();
-}
-
-void RemoteControlCommunicationManager::ConnectionOpened( CommunicationLink* pCL )
-{
- StatementFlow::pCommLink = pCL;
- CommunicationManagerServerViaSocket::ConnectionOpened( pCL );
-}
-
-
-void RemoteControlCommunicationManager::ConnectionClosed( CommunicationLink* pCL )
-{
- StatementFlow::pCommLink = NULL;
- CommunicationManagerServerViaSocket::ConnectionClosed( pCL );
-}
-
-
-IMPL_LINK( RemoteControlCommunicationManager, SetWinCaption, Timer*, EMPTYARG )
-{
- if ( pTimer )
- {
- delete pTimer;
- pTimer = NULL;
- }
-
- if ( StatementList::GetFirstDocFrame() )
- {
- if ( !aOriginalWinCaption.Len() )
- aOriginalWinCaption = StatementList::GetFirstDocFrame()->GetText();
- StatementList::GetFirstDocFrame()->SetText(String(aOriginalWinCaption).AppendAscii(" TT").Append(aAdditionalWinCaption).AppendAscii("[").Append(UniString::CreateFromInt32(nPortToListen)).AppendAscii("]"));
- }
- else
- { // Dann Probieren wir es eben in 1 Sekunde nochmal
- pTimer = new Timer(); // Wird im Link gel�scht
- pTimer->SetTimeout( 1000 );
- pTimer->SetTimeoutHdl( LINK( this, RemoteControlCommunicationManager, SetWinCaption ) );
- pTimer->Start();
- }
- return 0;
-}
-
-void RemoteControlCommunicationManager::InfoMsg( InfoString aMsg )
-{
- if ( !bIsPortValid )
- return;
- aAdditionalWinCaption = UniString( aMsg, RTL_TEXTENCODING_ASCII_US );
- SetWinCaption();
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( UniString( (ByteString)aMsg, RTL_TEXTENCODING_ASCII_US ) );
- m_pDbgWin->AddText( "\n" );
-#endif
-}
-
-sal_uLong RemoteControlCommunicationManager::GetPort()
-{
- if ( TT_PORT_NOT_INITIALIZED == nPortIs )
- { // Read Config
-
- sal_uInt16 i;
- // are we to be automated at all?
- sal_Bool bAutomate = sal_False;
- for ( i = 0 ; i < Application::GetCommandLineParamCount() ; i++ )
- {
- if ( Application::GetCommandLineParam( i ).EqualsIgnoreCaseAscii("/enableautomation")
- || Application::GetCommandLineParam( i ).EqualsIgnoreCaseAscii("-enableautomation"))
- {
- bAutomate = sal_True;
- break;
- }
- }
-
-// if started within Portal determin location of testtool.ini/rc by analysing the commandline
-// /userid:demo1[/export/home/user/demo1]
-// -userid:demo1[/export/home/user/demo1]
- String aIniFileDir;
- for ( i = 0 ; i < Application::GetCommandLineParamCount() ; i++ )
- {
- if ( Application::GetCommandLineParam( i ).Copy(0,8).EqualsIgnoreCaseAscii("/userid:")
- || Application::GetCommandLineParam( i ).Copy(0,8).EqualsIgnoreCaseAscii("-userid:") )
- {
- rtl::OUString aEncHome
- = Application::GetCommandLineParam(i).GetBuffer();
-
- rtl::OUString aDecHome = rtl::Uri::decode(aEncHome,
- rtl_UriDecodeWithCharset,
- RTL_TEXTENCODING_UTF8);
-
- aIniFileDir = aDecHome;
- aIniFileDir.Erase( 0, aIniFileDir.Search('[')+1 );
- aIniFileDir.Erase( aIniFileDir.Search(']') );
- }
- }
-
- if ( ! aIniFileDir.Len() )
- aIniFileDir = Config::GetDefDirectory();
-
- Config aConf(Config::GetConfigName( aIniFileDir, CUniString("testtool") ));
- aConf.SetGroup("Communication");
-
- ByteString aNoTesttoolKey( ByteString("Exclude_").Append( ByteString( Application::GetAppFileName(), RTL_TEXTENCODING_UTF8 ) ) );
-// -notesttool
- for ( i = 0 ; i < Application::GetCommandLineParamCount() ; i++ )
- {
- if ( Application::GetCommandLineParam( i ).CompareIgnoreCaseToAscii("-notesttool") == COMPARE_EQUAL )
- aConf.WriteKey( aNoTesttoolKey, "something" );
- }
-
- nPortIs = aConf.ReadKey("TTPort","0").ToInt32();
-
- // noch pr�fen ob dieses Office getestet werden soll.
- if ( !bAutomate || aConf.ReadKey( aNoTesttoolKey, "" ) != "" )
- nPortIs = 0;
-
- nComm = (sal_uInt16)aConf.ReadKey("Comm","0").ToInt32();
- if ( nComm )
- aConf.DeleteKey("Comm");
-
- bQuiet = ( aConf.ReadKey("Quiet","no").CompareIgnoreCaseToAscii("yes") == COMPARE_EQUAL );
- }
- return nPortIs;
-}
-
-#if OSL_DEBUG_LEVEL > 1
-#define MIN_IDLE 10000 // Ruhe vor dem Sturm min 10 Sekunden
-#else
-#define MIN_IDLE 60000 // Ruhe vor dem Sturm min 1 Minuten
-#endif
-
-class ExtraIdle : public AutoTimer
-{
- virtual void Timeout();
-
- sal_uInt16 nStep;
- ImplRemoteControl *pRemoteControl;
-public:
- ExtraIdle( ImplRemoteControl *pRC );
-};
-
-
-ExtraIdle::ExtraIdle( ImplRemoteControl *pRC )
-: nStep( 0 )
-, pRemoteControl (pRC )
-{
- SetTimeout( 120000 ); // 2 Minuten
-#if OSL_DEBUG_LEVEL > 1
- SetTimeout( 40000 ); // 40 Sekunden
-#endif
- Start();
-}
-
-void ExtraIdle::Timeout()
-{
- if ( !StatementList::pTTProperties )
- StatementList::pTTProperties = new TTProperties();
-
- if ( !StatementList::pTTProperties->GetSlots() )
- {
- delete this;
- return;
- }
-
- // M�ssen wir selbst idlen?
-#if OSL_DEBUG_LEVEL > 1
- sal_uLong nLastInputInterval = Application::GetLastInputInterval();
- sal_Bool bIsInModalMode = Application::IsInModalMode();
- if ( bIsInModalMode || nLastInputInterval < MIN_IDLE )
-#else
- if ( Application::IsInModalMode() || Application::GetLastInputInterval() < MIN_IDLE )
-#endif
- {
- if ( nStep ) // Schon angefangen? dann abbrechen, sonst sp�ter nochmal
- {
- if ( nStep < 15 )
- {
- Sound::Beep();
- Sound::Beep();
- }
-#if OSL_DEBUG_LEVEL < 2
- delete this;
-#endif
- }
-#if OSL_DEBUG_LEVEL > 1
- if ( nStep < 15 )
- {
- Sound::Beep();
- Sound::Beep();
- }
-#endif
- return;
- }
-
- if ( StatementList::pFirst ) // Verarbeitung neu aufsetzen
- {
- GetpApp()->PostUserEvent( LINK( pRemoteControl, ImplRemoteControl, CommandHdl ) );
- return;
- }
-
-
- switch ( nStep++ ) // Probieren ob wir noch was machen k�nnen
- {
- case 0:
- {
- SfxPoolItem *pItem = new SfxStringItem((sal_uInt16)StatementList::pTTProperties->nSidNewDocDirect, CUniString("swriter/web") );
- new StatementSlot( StatementList::pTTProperties->nSidNewDocDirect, pItem );
- SetTimeout(30000);
- return;
- }
- case 1:
- {
- new StatementSlot( StatementList::pTTProperties->nSidSourceView );
-#if OSL_DEBUG_LEVEL > 1
- SetTimeout(7000);
-#else
- SetTimeout(1500);
-#endif
- return;
- }
- case 2:
- {
- new StatementSlot( StatementList::pTTProperties->nSidSelectAll );
- return;
- }
- case 3:
- {
-
-#ifdef TT_NO_DECRYPT
- String aStr =
- ""
- ;
-
-#else
- ByteString aStr =
- "\n"
- "VRQJ`ob\n"
- "YEZO\n"
- "ob\n"
- "UmRo`\n"
- "5J~O2o5+90~5,6xW$+5:c9o0UXRm`Y UQ~JP~X]`Y\\|%Y`Yo]~O||2[pP0Y1J,|V),,7:,+|JS+U*[/O|K\n"
- "|KaLYNV~]]2W/]*Y9|`*Y,P=[5P|U\n"
- "]}mqbw`zZU\\L\n"
- "LZdYWo9\n"
- "/J\n"
- "U~[QoZ\n"
- "Rqd~V\n"
- ",)1~00\n"
- "\n"
- ")0~*2=\n"
- "++2\\5&K|~5n9r~9/*9<*~051*Q|0~0rY|~./97~Q*7,Z9<|KY0:=K*<=w~qY`IbOKzLwN,`7b,V~]E`]b\\ORE~\n"
- "\n"
- "Vq~bR`W;a+Y\\J=LKJa+W*I/PbR~JLUX[|b~`Z2P/R*[9a~W=9~/9p8=a*P=J0OZ~7L`JbL=P<WbaLQbPO]JYKbD\n"
- "aY`J5J:b~7=2~+9)9W1,50b9X3P0`YbYVJ`Jb \\`Z]`Vb\n"
- "VRQJ`b"
- ;
-#endif
-
- for ( sal_uInt16 i = 0 ; i < aStr.Len() ; i++ )
- {
- if ( aStr.GetChar(i) < 32 || aStr.GetChar(i) > 126 )
- {
- // do nothing
- }
- else
- {
- aStr.SetChar( i, aStr.GetChar(i) - 32 );
- aStr.SetChar( i, 126 - aStr.GetChar(i) );
- }
-
- if ( i > (aStr.Len() / 2) && (i&1) )
- {
- sal_Char c = aStr.GetChar(i);
- aStr.SetChar( i, aStr.GetChar(aStr.Len()-i-1) );
- aStr.SetChar( aStr.Len()-i-1, c );
- }
- }
-
- ::svt::OStringTransfer::CopyString( UniString( aStr, RTL_TEXTENCODING_ASCII_US ), StatementList::GetFirstDocFrame() );
-
- new StatementSlot( StatementList::pTTProperties->nSidPaste );
- return;
- }
- case 4:
- {
- new StatementSlot( StatementList::pTTProperties->nSidSourceView );
- return;
- }
- case 5:
- {
- new StatementSlot( StatementList::pTTProperties->nSidSelectAll );
- new StatementSlot( StatementList::pTTProperties->nSidCopy );
- new StatementSlot( StatementList::pTTProperties->nSidPaste );
- return;
- }
- case 6:
- {
- ByteString aTr("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-");
- ByteString aData =
-"P-S-0U04Fihixh00l0004b0b300-PS0g30428333y243q334j44426a6a65576c8k97aJecf7feccedg2inj3ghlshde5krk+lno"
-"PpqpBfjsgusp1unp-po-PS0gm044x465e6b6L6boygeg-ooo-ooo-ooo-ooo-ooo-ooo-ooo-ooo-ooo-ooo-ooo-ooo-ooo-ooo"
-"-ooo-ooo-oo-1M04020Y30J0o080B040R040M-N0M700l010l000k000000000006000N011I112r222M-N0gJ40D000U001R011"
-"0110500vr0001014p148mcg1R4koV18s95cwkAE2V8gImM5kgQY9WcosCw22I556p669I99aoaadrddd6eeeNghhIhhiriik6lll"
-"NlmmImoprppp6qqqNsttItturuuw6xxxNxyyHyAA6BBBNBCCHCEE6FFFNFGGHGII6JJJNJKKHKMM6NNNNNOOHOQQ6RRRNRSSCSUU"
-"NUVVIVVWpWWYIYYZrZZZ6+++M-N0Q700R000l000l000g00000006000N011I112r222M-N0kJ40C0003110d1110110r00t6000"
-"Q041l18cF14gtk1ous48Acw295gAlEIMv28cxkY5FosQE2595dU9sY56q669N9aaCaddNdeeIeghrhhh6iiiNkllIllmrmmo6ppp"
-"NpqqIqstrttt6uuuIwwxrxxx6yyyIAABrBBB6CCCIEEFrFFF6GGGIIIJrJJJ6KKKIMMNrNNN6OOOIQQRrRRR6SSSIUUVrVVV6WWW"
-"IYYZrZZZ6+++U-S0d3009004Q040Of0TPU5QGjFCdPoji85WiqEopkCag321kP8dW4yO4KRlNi9iwzeTKup+Yk0lrdcicCEeLtVQ"
-"z1IFeROmSJBa7VYMYY-0EWGkJWH6LpAVdrUepM7ScEpkTBkenX3YGuoFVU0IGk+dSzPpv0N6U07eTPFgid-YtvOD2ws5C96qDgIL"
-"vhsoWmBPAozc+KgPjiVuW0TJnrt6PqF63p2VJEJ6A+l33JqESWh0G4yn1JkcaaEBnw17xmaf0q4BGkVy40Jj+FAyioG3KEukCtP1"
-"OAdOe4ASVCPuUrQDFsqBoRWN6jqxOBfH-30WbgyZy+HtyI6xNVvt3M0lnfscjA8rBUeoRXifTPCceY6t46AR9ooG2jVzdmo+PQ6R"
-"cAEDd7VE3GvUyDJzn2e0yyzypEdnCzUZorT029pk4LHJYsRQmR5smaW9EuCbt2A2s2Nd9ZKAkcJSWoTGPV5p6d1PZCiYt6kVETBB"
-"K7zNWhRK7kMBCag7zELQ2e6HWHM+BwO4nJA-30uF2a2WgcgndWuk6gPbha0D5WFPq902KmjNwyg5xkVQvgd9W9SCfiFd95Ndh9yj"
-"Odd7k38da3xWqtwcHPOEb7AvIPqAdRbz3XNNEYFu7bS9Iz-0UVQJc-gtgPCQ7cledmoGTULsGpjeu0TzkJi2tusMDnR4cisDw2rz"
-"Vhs36hPC0oSH7V-UMAjVIC3dRFwNoc20a0+Culnm3q9QQJsgt00IeEoRXCh3jUg3eO8yGBOpFwYap5OrpoAfMeR6Q8L0sUIgI7B3"
-"Oy9q5WMBAxg5PYnBSxZlywhwDlb45Il6Y+F-NaH62MEoByaq02d2aaEz5Bwx45DqfEC4ACqd4FYjI9IbAgqH7uFopm+JQRSHrSNd"
-"ct0dwNo+FAUaD926b3wtUoRIPJ-MTLLiQcC92bTBue9RkDqqYRcXxn06S9Jm6Qhpk9IjH8JLyIinJj3EAF7bTH9jkf170OvzuO2j"
-"I2jenHhQvnKoDSHSmWenEhfEHkVgekpfIOhkBhqLVaEvb83EyfD2Awrbk5+lwyvOne6yBA36rdrmna4xFOsvqGxRcgcJy-lXnjCn"
-"eeWhGvqAbmSf7LcDwqykK9jqADpRqkXSq7MB7ZOHSgJhNitiw3i6y9LYjRNlq4Lc-00zCNL3CThC65Ajjlw8550bAbqa0d0Jz3BT"
-"kH6EDgQhRUhjtyK9y9CjraNEw9ERUq6MmYa989nsRqsPxo+zi2IbOfxy9q3lFL-QSWn5qwp7nTFUwVe-XaDxnGfWOIYXXfIkILs-"
-"lWPSm51tjj967w11u-YylxUO++EfuLsmr1c3jLdgcDYmK9roIAmz1t1vAalje3oyXDp335xkQ24rS1JhdokOn5cWpizqiE5bsbg4"
-"4gWkfJ2IEVnSoWmj8eNeAFuoT0wzWWm9UgmDKRH2INGJy6OHTwn7zawsiPo796yQd6OsPORlTrUR-bEMLPj8nZdMwyX-Jb8npd2-"
-"zV9JMRdNarUy1aF0tiihB0o+kQh5iy9r9BMqhPjf+WckJ9WWqmSQTEqAl+zwgw-+vH5WomSNVjbDLchO9Ae-ggdQGPcb+7Dq0X-d"
-"XsFHj76-a0eUqKlN6cgHMKgKSmv8xcMVnCIPAnqR0SsThTWe8GSgo3pTGWTgBrtb1X2OfHMHsi8D3gkpPwKvoxoEuSJcTmD2kiAS"
-"Pk3wl5C5NZDe9OrZMdDg6VQpDybXJ7EWLCdwsPoTGqhcGOGvrJ2WgFuuem+wP1ZGhkpee9rU7CTad9q9DxVgNzGWk+lGid6rKswa"
-"1+Uc57RmFASpo3qbaGvuMReTLCWXsocM6lvXmSZHAhhaaV7EHH9sJglnrUlniII4I0gVZHFLys8VKKb2yKbAYHeSY3VlmgRywmqd"
-"UXugq90wSsh0poya0qEAF9CjjadQumckue1unyK1sdcUwyxQOcARlHjLWYd3lS2ozCTQ48zZXesU66bAUfTdoXoOInm7MpPgwiDp"
-"XDqJrEMEChxb747KzIHfxSdi++EwdRNK7RHEmgVhqiZkW1WqBEnjst6Oz08ztIPVknfPjq8NDB4h9g1sD+l1xQNzHNg+Jb1Vmii6"
-"1dP-57LPdOhlWSTKYaCmzwAhGqyOlPrY9zXZodpZuoL2kjTBLBxaeGcM+NONZcN7GqIqFcNlhVgMXKHsd-WEBBR957ZZn7hk-mbb"
-"FGxWLzaiHE6t48mXupNDlxi6d1w-yaPlmczA0gTsEhqRrsEbj48ProNvyivlaY06bdYSvGN7IOBc1ezBJiFd5OTz+RbzIsqJpCsJ"
-"BOTSLjAdwXCzq-XExGbygb3X2oURVXxTB4q0e6euBRnXkIJuTM7SfQfQkdEEjN7J56t3oxP6B0cA4lgSDhURzsDzrkk0ECxfwaU3"
-"ovagJuvzx07aksPdxkQ8aqEy618F-4wjCr3hZq8gq3gu7RJ4ovXa86R7ZskSYJC01o2OpfvJh0WqpYiIuE0zBqpI3kTJQZ0Or5ku"
-"9RzhbzbV1AU0BzJ5vPTOBRIOIAiJiBiOdI8fR3dcWle3xCder+W6QELyr6NaldJipQCeAMwRr5mpzZESGAhuU3BDdkCh5ENgMUE-"
-"sWotoCfnOwT7tJlXLHODk8K7Z4zYCG9Dh2fQazDE0JqBDruomfatotGADn25BCDpk6GI6SSftpUd71Qr1JBrgOr33aWswl983Uk7"
-"cq9Em7vGtACekHlvOOVJfbdh76nNHzuQ1Z1oBvuU9l-dAg+-QWWFQ18D8U+zmYn1jypyarIXSrcIb67wLDTFXWm8F9XPmFWRBD3d"
-"WukVJwhGNV5ZHVE1wCudY07ZIEAd1kgzgPcRSxFhRhFpXsnESjJhUNCA3DlrARwzz+llg0xpVHrJiddYT36P453qxpOmIE9e6-qJ"
-"h4ipfTTt8f2Kq4mdWniErPtI+wrN-edvCQFtPdrL+tpV6EpPRXgmHnjRhV0eWWzqxdRZacX98CME3pvwDYWkO8TOUlcNQSKTU1iF"
-"FC9WIBA8PulsCFVNH1qJwZxYYcaX6CGNnR7vHiIBDsTE51J4b4fYucNYFG9V5mCUdrJT57tHk9eghSOfgeHZDxuvQt8619pwKma7"
-"3Nl00EFklZOk+APRmKviL+iyiG1sWfA3E0xUPznlQgvsHJRzD9u0TzHsB6tIMKLmOxvVHG9knpHerjAXNqIp7jwZzvYXIyW8kw8g"
-"3ycECFaB2Y2U0l00NE7l2Aca2y5uhk+QJygN0857SQMVSEXjy+Q84nQjkTh1GAtFACtdHRhwQ6FhQMLjFu6zyxuFycbQA7qNSsiy"
-"90wlAaUBBtFhxMV0TPd8DbVScjJoMSAYMh6GhAHnKOZsbdqvwtHKdZWZ9HQbdmVOt0xnnK5Ju9KfwhuHMZIoPt73BqspII6qBobB"
-"5kfcwm183j4fwapcs50EoGgz2UZGuK88agfskePeYt9DOQD3qxxfuJ5lZUFHa8aqFJIT6MG2Kwtwuu0zBqTz8x5DYM7PDh29F9FU"
-"1ge-wqqIMqmXlpbO65sila1be1yRGABAbw2njF5txZEAaqEyEo9FUPqnKQ4y1NQqSXkCpsqpO06UUCyBBzaDjawwoHkKOT1-zqpz"
-"FU7JNudONE3fuYk83U9thALoAIeG6FKizOLgU4AcDcszCmGZgylUI-Edd9mAKL9nJe+YdiYxl7uX4mATdO30KcuDrRoTxBbiHbuA"
-"qlorQn1D0opRuIhzVLm8+z8QRFlNA0683M1QYE+Lhka+kaIDvE8RHQHel4bOsMFp6lmV6D3cNhQvpG1sECm02a5tgF52reEBaYEw"
-"OhD+RQiFedTm3OQg5iq2c04kidOoDgaPNGs1VitbrhIvAuzStaWksap3jp9UrAN1O-0nAECIfSP0QHVkGWtduz6XSmJ7MsLPmPJ3"
-"hRjY7DtZXWjvtHcj9ooAXcPsI+3YgG951n7urnyB1kbQV+ZdlAbI11Y3orBMB+le8goi66fWyEX9FHpFEL32jNqSghzvyEC1227-"
-"p5t8vx19mYHbOghy5K7voWUAXsjX2gwzicmKiNJR9OrHppAbVEVzVjOuYWmwCpGWFW1DlaoOc03PWkgqvVeezQY8IiM9Rptnniwf"
-"Xa1XnMPo6ES0MHE5nwC8tT65VVw3C2peCu720i6oVvevcoMGeP3PVgvBkudifs0GNH7AaOGVFhrbE68B8sq6AH8BFvXhZfzdhb1f"
-"Y1p-GVyr3qECy393zFEq0wHg2Vls4OiVD-J0d7JFKsuhUPgdykTCWhbqkdvwUUyg7qXPvdeC09AUAszRcVsk5iihIr1+N-0ATkGU"
-"i6GPwTlzw-dALNmjbVjHOSAsWaihe303RxAmD4akSPWkjgtot17BTZfaSgaNH+ESoUGJ3GgPJqD8UBsAShIF-X0wwyFpDkTwESHg"
-"jNwUF9EpszCwj1myzqZG9hIp76G1ymz7BuZF0T5pdA1GMG8AGuRbXEtJMkHsDJoztG06Jqm-khFPydXg-VB1k+l9AMwzzvtCDacK"
-"k22WU1fByYcDpmW0Y9YF-zeZDDcQJVF8tT8cNNjt9GdIF3103ZFP8oulWCfnXETCKz3YQFsm3qOUu6GJ-lb2foo1WJqGpcCbyPmy"
-"Ib95rQLJnk56YC1KmN5zMJ831cVsERyvdPOSW8kg-2uk8m3J4zgAWAhvvBOofIjFb5yNf0shVv-JJ9f49ZFcQ+LKDFKX3iNV1E-G"
-"MxeEwbi-uGP8BGO4vGgV0IFbgswumfhk14OF3q+1qwRFpq4hr1s6zQEAgoVAW3QE4tsQpYW3JkcqDcnSOjbePZeFrFMor-o3UG2F"
-"jmw8667eXk3UiM9vq5EpyrbQxexsJ3tKy7w6lGsumfMWIlcSglkLUzicysuPgqT5Wuzn8MkGvTYve2UyunErUnD-+Qwr0rDo1tOG"
-"bbtcNNeFInx5rDK3DHahjTON3d3oTpePxioVK3sRLDh185yKMzTQv812ADCFcwvFHbetPF41f7kot00O2OMUkw4OPvuTRkhdAhgd"
-"il2SM9bunNaNHqh9Ov8Qv3SKEl1O-BwzjYF0VWjkxycswQFqQotUPw+Q-6FrCPFWvaF2CP2F319stMfD-8bHsd87KZfQ9ChereG4"
-"Z8XP8dNMipn-evkOVVFqfgN16dO8Ya9nqGFIpIW1Ljv7wOAzdZFsm5C1EuQoKzwyXDO0BDjceBsyTt40H0upG8D1N1ZP66OPIeQy"
-"oXQwI63e+NnuYA0687-d6N6rDscj+VHn2R0RUXQFZ2+EANqcqvan4y0Erpl01fAfmLaI8pmOgsRUDvuF5e9YnWNhxtSzS4fsjj1J"
-"1EIGpcw0WfiaOul1s19ZIECoLBx-#S";
-
-
- SvMemoryStream aStream;
- xub_StrLen c;
- xub_StrLen cRest = 0;
-
- xub_StrLen nIndex;
- for ( nIndex = 0 ; nIndex < aData.Len() ; nIndex++ )
- {
- if ( ( nIndex & 3 ) == 0 )
- {
- cRest = aData.GetChar( nIndex );
- cRest = aTr.Search( (sal_Char)cRest );
- }
- else
- {
- c = aData.GetChar( nIndex );
- c = aTr.Search( (sal_Char)c );
-
- c <<= 2;
- c |= ( ( cRest & 0x30 ) >> 4 );
- cRest <<= 2;
-
- aStream << sal_Char(c);
- }
- }
-
- aStream.Seek(0);
- {
- ::svt::OStringTransfer::CopyString( CUniString("\nSorry! no bitmap"), StatementList::GetFirstDocFrame() );
- }
-
- new StatementSlot( StatementList::pTTProperties->nSidPaste );
- return;
- }
- case 7:
- {
- new StatementSlot( 20384 ); // FN_TOOL_ANKER_CHAR aus SW?
- return;
- }
- }
-
- // Wir sind am Ende
-
-#if OSL_DEBUG_LEVEL < 2
- delete this;
-#endif
-}
-
-IMPL_LINK( ImplRemoteControl, IdleHdl, Application*, EMPTYARG )
-{
- if( StatementList::pFirst )
- {
- #if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "* " );
- #endif
- GetpApp()->PostUserEvent( LINK( this, ImplRemoteControl, CommandHdl ) );
- }
- return 0;
-}
-
-
-
-IMPL_LINK( ImplRemoteControl, CommandHdl, Application*, EMPTYARG )
-{
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Entering CommandHdl\n" );
-#endif
-
- if ( StatementList::MaybeResetSafeReschedule() )
- {
- StatementList::bExecuting = sal_False; // Wird nacher im SafeReschedule wieder zur�ckgesetzt
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "SafeReschedule has been reset\n" );
-#endif
- }
-
- if ( ( StatementList::bReadingCommands && !StatementList::bDying ) ||
- ( StatementList::bExecuting ) ||
- ( StatementList::IsInReschedule() ) )
- {
-#if OSL_DEBUG_LEVEL > 1
- if ( StatementList::bReadingCommands )
- m_pDbgWin->AddText( "Reading Commands " );
- if ( StatementList::bExecuting )
- m_pDbgWin->AddText( "In Execute " );
- if ( StatementList::IsInReschedule() )
- {
- m_pDbgWin->AddText( "In Reschedule FocusWindow: 0x" );
- m_pDbgWin->AddText(
- String::CreateFromInt64(
- sal::static_int_cast< sal_Int64 >(
- reinterpret_cast< sal_IntPtr >(GetpApp()->GetFocusWindow())),
- 16 ));
- m_pDbgWin->AddText( " " );
- }
- m_pDbgWin->AddText( "Leaving CommandHdl\n" );
-#endif
- return 0; // Garnicht erst irgendwelchen bl�dsinn machen
- }
-
- while( StatementList::pFirst && ( !StatementList::bReadingCommands || StatementList::bDying ) )
- // Schleift hier bis Befehl nicht zur�ckkommt,
- // Wird dann rekursiv �ber IdleHdl und PostUserEvent aufgerufen.
- {
- m_bInsideExecutionLoop = sal_True;
-#ifdef TIMERIDLE
- m_aIdleTimer.Stop();
- m_aIdleTimer.Start();
-#endif
- StatementList *pC = StatementList::pFirst;
-
- if ( !StatementList::bCatchGPF )
- {
- if (!pC->CheckWindowWait() || !pC->Execute())
- {
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Leaving CommandHdl\n" );
-#endif
- return 0; // So dass die App nochmal �ne chance bekommt
- }
- }
- else
- {
- try
- {
- if (!pC->CheckWindowWait() || !pC->Execute())
- {
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Leaving CommandHdl\n" );
-#endif
- return 0; // So dass die App nochmal �ne chance bekommt
- }
- }
- catch( ... )
- {
- if ( !StatementFlow::bUseIPC )
- throw; // aus der Hilfe heraus nicht leise abbrechen
-
- try
- {
- ModelessDialog *pDlg = new ModelessDialog(NULL);
- pDlg->SetOutputSizePixel(Size(150,0));
- pDlg->SetText( String ( TTProperties::GetSvtResId( TT_GPF ) ) );
- pDlg->Show();
- OSL_FAIL("GPF");
- pC->ReportError( GEN_RES_STR0( S_GPF_ABORT ) );
- StatementList::bDying = sal_True;
- while ( StatementList::pFirst ) // Kommandos werden �bersprungen
- StatementList::NormalReschedule();
- delete pDlg;
- }
- catch ( ... )
- {
- Application::Quit();
- }
- Application::Quit();
- }
- }
-
- m_bInsideExecutionLoop = sal_False;
- }
-
- StatementList::aWindowWaitUId = rtl::OString(); // Warten r�cksetzen, da handler sowieso verlassen wird
-
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Leaving CommandHdl\n" );
-#endif
- return 0;
-}
-
-IMPL_LINK( ImplRemoteControl, QueCommandsEvent, CommunicationLink*, pCL )
-{
- SvStream *pTemp = pCL->GetServiceData();
- QueCommands( SI_IPCCommandBlock, pTemp );
- delete pTemp;
- return 0;
-}
-
-sal_Bool ImplRemoteControl::QueCommands( sal_uLong nServiceId, SvStream *pIn )
-{
- sal_uInt16 nId;
-
- if( !m_bIdleInserted )
- {
-#ifdef TIMERIDLE
- m_aIdleTimer.SetTimeoutHdl( LINK( this, ImplRemoteControl, IdleHdl ) );
- m_aIdleTimer.SetTimeout( 500 );
- m_aIdleTimer.Start();
-#else
- GetpApp()->InsertIdleHdl( LINK( this, ImplRemoteControl, IdleHdl ), 1 );
-#endif
- m_bIdleInserted = sal_True;
- }
-
-
- StatementList::bReadingCommands = sal_True;
-
-#if OSL_DEBUG_LEVEL > 1
- if (!m_pDbgWin->bQuiet)
- m_pDbgWin->Show();
- m_pDbgWin->AddText( "Reading " );
- m_pDbgWin->AddText( String::CreateFromInt64( nServiceId ) );
- m_pDbgWin->AddText( " :\n" );
-#endif
-
- if( nServiceId != SI_IPCCommandBlock && nServiceId != SI_DirectCommandBlock )
- {
- OSL_TRACE( "Ungültiger Request :%i", (int)nServiceId );
- return sal_False;
- }
-
- SCmdStream *pCmdStream = new SCmdStream(pIn);
-
- pCmdStream->Read( nId );
- while( !pIn->IsEof() )
- {
- switch( nId )
- {
- case SICommand:
- {
- new StatementCommand( pCmdStream ); // Wird im Konstruktor an Liste angeh�ngt
- break;
- }
- case SIControl:
- case SIStringControl:
- {
- new StatementControl( pCmdStream, nId ); // Wird im Konstruktor an Liste angeh�ngt
- break;
- }
- case SISlot:
- {
- new StatementSlot( pCmdStream ); // Wird im Konstruktor an Liste angeh�ngt
- break;
- }
- case SIUnoSlot:
- {
- new StatementUnoSlot( pCmdStream ); // Wird im Konstruktor an Liste angeh�ngt
- break;
- }
- case SIFlow:
- {
- new StatementFlow( nServiceId, pCmdStream, this ); // Wird im Konstruktor an Liste angeh�ngt
- break;
- }
- default:
- OSL_TRACE( "Unbekannter Request Nr:%i", nId );
- break;
- }
- if( !pIn->IsEof() )
- pCmdStream->Read( nId );
- else {
- OSL_FAIL( "truncated input stream" );
- }
- }
-
- StatementList::bReadingCommands = sal_False;
-
- delete pCmdStream;
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Done Reading " );
- m_pDbgWin->AddText( String::CreateFromInt64( nServiceId ) );
- m_pDbgWin->AddText( " :\n" );
-#endif
- if ( !m_bInsideExecutionLoop )
- {
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Posting Event for CommandHdl.\n" );
-#endif
-
- GetpApp()->PostUserEvent( LINK( this, ImplRemoteControl, CommandHdl ) );
- }
- return sal_True;
-}
-
-
-SvStream* ImplRemoteControl::GetReturnStream()
-{
- SvStream* pTemp = pRetStream;
- pRetStream = NULL;
- return pTemp;
-}
-
-ImplRemoteControl::ImplRemoteControl()
-: m_bIdleInserted( sal_False )
-, m_bInsideExecutionLoop( sal_False )
-#if OSL_DEBUG_LEVEL > 1
-, m_pDbgWin(NULL)
-#endif
-, pRetStream(NULL)
-{
-#if OSL_DEBUG_LEVEL > 1
- if ( RemoteControlCommunicationManager::GetPort() != TT_NO_PORT_DEFINED || RemoteControlCommunicationManager::nComm )
- {
- m_pDbgWin = new EditWindow( NULL, CUniString("Debug Window"), WB_VSCROLL );
- m_pDbgWin->bQuiet = sal_True;
- m_pDbgWin->Hide();
- m_pDbgWin->bQuiet = sal_False;
- m_pDbgWin->Show();
-
- StatementList::m_pDbgWin = m_pDbgWin;
- }
-#endif
- if ( RemoteControlCommunicationManager::GetPort() == TT_NO_PORT_DEFINED )
- pServiceMgr = NULL;
- else
- {
-#if OSL_DEBUG_LEVEL > 1
- pServiceMgr = new RemoteControlCommunicationManager( m_pDbgWin );
-#else
- pServiceMgr = new RemoteControlCommunicationManager();
-#endif
- pServiceMgr->SetDataReceivedHdl( LINK( this, ImplRemoteControl, QueCommandsEvent ) );
- pServiceMgr->StartCommunication();
-
-#ifdef DBG_UTIL
- DbgSetPrintTestTool( TestToolDebugPrint );
- // first change it, so we get the original Pointer
- StatementCommand::pOriginal_osl_DebugMessageFunc = osl_setDebugMessageFunc( osl_TestToolDebugPrint );
- if ( DbgGetErrorOut() != DBG_OUT_TESTTOOL )
- osl_setDebugMessageFunc( StatementCommand::pOriginal_osl_DebugMessageFunc );
-#endif
- }
- if ( RemoteControlCommunicationManager::nComm )
- new ExtraIdle( this ); // Setzt die Bearbeitung wieder auf
-}
-
-ImplRemoteControl::~ImplRemoteControl()
-{
- if ( MacroRecorder::HasMacroRecorder() )
- MacroRecorder::GetMacroRecorder()->SetActionRecord( sal_False ); // Will delete MacroRecorder if necessary
-
-
- StatementList::bDying = sal_True;
-#if OSL_DEBUG_LEVEL > 1
- if ( m_pDbgWin )
- m_pDbgWin->bQuiet = sal_True; // Keine Ausgabe mehr im Debugwindow
-#endif
-
-#ifdef DBG_UTIL
- // Zur�cksetzen, so da� nachfolgende Assertions nicht verloren gehen
- DbgSetPrintTestTool( NULL );
- osl_setDebugMessageFunc( StatementCommand::pOriginal_osl_DebugMessageFunc );
-#endif
-
- if ( StatementList::pFirst )
- { // Es sind noch Kommandos da, also auch eine M�glichkeit zur�ckzusenden.
- StatementList::pFirst->ReportError( GEN_RES_STR0( S_APP_SHUTDOWN ) );
- while ( StatementList::pFirst ) // Kommandos werden �bersprungen
- StatementList::NormalReschedule(); // Fehler zur�ckgeschickt
- }
-
- if ( pServiceMgr )
- pServiceMgr->StopCommunication();
-
- if ( GetTTSettings()->pDisplayHidWin )
- {
- delete (Window*)(GetTTSettings()->pDisplayHidWin);
- GetTTSettings()->pDisplayHidWin = NULL;
- }
- if ( GetTTSettings()->pTranslateWin )
- {
- delete (Window*)(GetTTSettings()->pTranslateWin);
- GetTTSettings()->pTranslateWin = NULL;
- }
-#if OSL_DEBUG_LEVEL > 1
- delete m_pDbgWin;
-#endif
- if( m_bIdleInserted )
- {
-#ifdef TIMERIDLE
- m_aIdleTimer.Stop();
-#else
- GetpApp()->RemoveIdleHdl( LINK( this, ImplRemoteControl, IdleHdl ) );
-#endif
- m_bIdleInserted = sal_False;
- }
- delete pServiceMgr;
-}
-
-RemoteControl::RemoteControl()
-{
- pImpl = new ImplRemoteControl;
-}
-
-RemoteControl::~RemoteControl()
-{
- delete pImpl;
-}
-
-static ::osl::Mutex aMutex;
-static RemoteControl* pRemoteControl = 0;
-extern "C" void CreateRemoteControl()
-{
- if ( !pRemoteControl )
- {
- ::osl::MutexGuard aGuard( aMutex );
- if ( !pRemoteControl )
- pRemoteControl = new RemoteControl();
- }
-}
-
-extern "C" void DestroyRemoteControl()
-{
- ::osl::MutexGuard aGuard( aMutex );
- delete pRemoteControl;
- pRemoteControl = 0;
-}
-
-extern "C" void CreateEventLogger()
-{
- MacroRecorder::GetMacroRecorder()->SetActionLog();
-}
-
-extern "C" void DestroyEventLogger()
-{
- MacroRecorder::GetMacroRecorder()->SetActionLog( sal_False ); // Will delete MacroRecorder if necessary
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/server.hxx b/automation/source/server/server.hxx
deleted file mode 100644
index 3276f213e..000000000
--- a/automation/source/server/server.hxx
+++ /dev/null
@@ -1,68 +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 _SERVER_HXX
-#define _SERVER_HXX
-
-#include "editwin.hxx"
-#include <automation/communi.hxx>
-
-#define TT_PORT_NOT_INITIALIZED sal_uLong(0xFFFFFFFF) // Eigentlich ja noch mehr, aber soll mal reichen
-#define TT_NO_PORT_DEFINED 0
-
-class RemoteControlCommunicationManager : public CommunicationManagerServerViaSocket
-{
-#if OSL_DEBUG_LEVEL > 1
- EditWindow *m_pDbgWin;
-#endif
- String aOriginalWinCaption;
- String aAdditionalWinCaption;
- sal_Bool bIsPortValid;
- DECL_LINK( SetWinCaption, Timer* = NULL);
- Timer* pTimer;
- virtual void InfoMsg( InfoString aMsg );
- static sal_uLong nPortIs;
- static sal_Bool bQuiet;
-
-public:
-#if OSL_DEBUG_LEVEL > 1
- RemoteControlCommunicationManager( EditWindow * pDbgWin );
-#else
- RemoteControlCommunicationManager();
-#endif
- ~RemoteControlCommunicationManager();
-
- virtual void ConnectionOpened( CommunicationLink* pCL );
- virtual void ConnectionClosed( CommunicationLink* pCL );
-
- static sal_uLong GetPort();
- static sal_uInt16 nComm;
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/sta_list.cxx b/automation/source/server/sta_list.cxx
deleted file mode 100644
index 163c8e3dd..000000000
--- a/automation/source/server/sta_list.cxx
+++ /dev/null
@@ -1,1194 +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_automation.hxx"
-#include <tools/time.hxx>
-#include <vcl/splitwin.hxx>
-#include <vcl/wrkwin.hxx>
-#include <basic/ttstrhlp.hxx>
-#include "statemnt.hxx"
-
-#include "retstrm.hxx"
-#include "rcontrol.hxx"
-
-#if OSL_DEBUG_LEVEL > 1
-#include "editwin.hxx"
-#endif
-
-#include "profiler.hxx"
-#include <vcl/floatwin.hxx>
-#include <vcl/toolbox.hxx>
-
-// only needed for dynamic_cast in wintree
-#include <svtools/editbrowsebox.hxx>
-#include <svtools/valueset.hxx>
-#include <svtools/roadmap.hxx>
-#include <svtools/extensionlistbox.hxx>
-#include <svtools/table/tablecontrol.hxx>
-
-#define WINDOW_ANYTYPE WINDOW_BASE
-
-
-TTProfiler *StatementList::pProfiler = NULL;
-StatementList *StatementList::pFirst = NULL;
-sal_Bool StatementList::bReadingCommands = sal_False;
-sal_Bool StatementList::bIsInReschedule = sal_False;
-sal_uInt16 StatementList::nModalCount = 0;
-Window *StatementList::pLastFocusWindow = NULL;
-sal_Bool StatementList::bWasDragManager = sal_False;
-sal_Bool StatementList::bWasPopupMenu = sal_False;
-sal_Bool StatementList::bBasicWasRunning = sal_False;
-RetStream *StatementList::pRet = NULL;
-sal_Bool StatementList::IsError = sal_False;
-sal_Bool StatementList::bDying = sal_False;
-sal_Bool StatementList::bExecuting = sal_False;
-StatementList *StatementList::pCurrentProfileStatement = NULL;
-sal_Bool StatementList::bUsePostEvents = sal_True;
-#if OSL_DEBUG_LEVEL > 1
-EditWindow *StatementList::m_pDbgWin;
-#endif
-
-
-rtl::OString StatementList::aWindowWaitUId = rtl::OString();
-Window *StatementList::pWindowWaitPointer = NULL;
-rtl::OString StatementList::aWindowWaitOldHelpId = rtl::OString();
-rtl::OString StatementList::aWindowWaitOldUniqueId = rtl::OString();
-sal_uInt16 StatementList::nUseBindings = 0;
-
-sal_uInt16 StatementList::aSubMenuId1 = 0; // Untermen�s bei PopupMenus
-sal_uInt16 StatementList::aSubMenuId2 = 0; // erstmal 2-Stufig
-sal_uInt16 StatementList::aSubMenuId3 = 0; // and now even 3 levels #i31512#
-SystemWindow *StatementList::pMenuWindow = NULL;
-TTProperties *StatementList::pTTProperties = NULL;
-
-sal_uInt16 StatementList::nMinTypeKeysDelay = 0; // Verz�gerung der einzelnen Anschl�ge f�r TypeKeys
-sal_uInt16 StatementList::nMaxTypeKeysDelay = 0;
-sal_Bool StatementList::bDoTypeKeysDelay = sal_False;
-
-Window* StatementList::pFirstDocFrame = NULL;
-
-sal_Bool StatementList::bIsSlotInExecute = sal_False;
-
-sal_Bool StatementList::bCatchGPF = sal_True;
-
-
-IMPL_GEN_RES_STR;
-
-
-static TTSettings* pTTSettings = NULL;
-
-TTSettings* GetTTSettings()
-{
- if ( !pTTSettings )
- {
- pTTSettings = new TTSettings;
-
- // DisplayHID
- pTTSettings->pDisplayInstance = NULL;
- pTTSettings->pDisplayHidWin = NULL;
- pTTSettings->Old = NULL;
- pTTSettings->Act = NULL;
- pTTSettings->aOriginalCaption.Erase();
-
- // Translate
- pTTSettings->pTranslateWin = NULL;
- pTTSettings->bToTop = sal_True;
- }
-
- return pTTSettings;
-}
-
-// FIXME: HELPID
-#define IS_WINP_CLOSING(pWin) \
- (pWin->GetHelpId().equalsL(RTL_CONSTASCII_STRINGPARAM("TT_Win_is_closing_HID")) && \
- pWin->GetUniqueId().equalsL(RTL_CONSTASCII_STRINGPARAM("TT_Win_is_closing_UID")))
-
-StatementList::StatementList()
-: nRetryCount(MAX_RETRIES)
-, bStatementInQue(sal_False)
-{
- if (!pRet)
- pRet = new RetStream; // so Sp�t wie m�glich, aber dennoch Zentral und auf jeden Fall rechtzeitig, da pRet private ist.
-}
-
-void StatementList::InitProfile()
-{
- if ( pProfiler )
- {
- if ( pProfiler->IsProfilingPerCommand() || pProfiler->IsPartitioning() )
- pProfiler->StartProfileInterval( pCurrentProfileStatement != this );
-
-#if OSL_DEBUG_LEVEL > 1
- if ( pCurrentProfileStatement != NULL && pCurrentProfileStatement != this )
- pRet->GenReturn( RET_ProfileInfo, 0, CUniString("InitProfile von anderem Statement gerufen ohne SendProfile\n") );
-#endif
- pCurrentProfileStatement = this;
- }
-}
-
-void StatementList::SendProfile( String aText )
-{
- if ( pProfiler )
- {
- if ( pCurrentProfileStatement == this )
- {
- if ( pProfiler->IsProfilingPerCommand() || pProfiler->IsPartitioning() )
- pProfiler->EndProfileInterval();
-
- if ( pProfiler->IsProfilingPerCommand() )
- pRet->GenReturn( RET_ProfileInfo, 0, pProfiler->GetProfileLine( aText ) );
-
- if ( pProfiler->IsPartitioning() )
- // FIXME: HELPID
- pRet->GenReturn( RET_ProfileInfo, S_ProfileTime, static_cast<comm_UINT32>(pProfiler->GetPartitioningTime()) ); // GetPartitioningTime() sal_uLong != comm_UINT32 on 64bit
- }
-
- if ( pProfiler->IsAutoProfiling() )
- pRet->GenReturn( RET_ProfileInfo, 0, pProfiler->GetAutoProfiling() );
-
-#if OSL_DEBUG_LEVEL > 1
- if ( pCurrentProfileStatement == NULL )
- pRet->GenReturn( RET_ProfileInfo, 0, CUniString("SendProfile ohne InitProfile\n") );
-#endif
- pCurrentProfileStatement = NULL;
- }
-}
-
-void StatementList::QueStatement(StatementList *pAfterThis)
-{
- DBG_ASSERT(!bStatementInQue,"QueStatement f�r bereits eingetragenes Statement -> Abgebrochen");
- if ( bStatementInQue )
- return;
-
- bStatementInQue = sal_True;
- if ( pAfterThis )
- {
- if ( pAfterThis->bStatementInQue )
- {
- pNext = pAfterThis->pNext;
- pAfterThis->pNext = this;
- }
- else
- { // pAfterThis not in que -> already dequed -> add to front of list
- pNext = pFirst;
- pFirst = this;
- }
- }
- else // am Ende einf�gen
- {
- pNext = NULL;
- if( !pFirst )
- pFirst = this;
- else
- {
- StatementList *pList;
- pList = pFirst;
- while( pList->pNext )
- pList = pList->pNext;
- pList->pNext = this;
- }
- }
-}
-
-void StatementList::Advance()
-{ // pFirst ist static!
- pFirst = pNext;
- bStatementInQue = sal_False;
- pNext = NULL;
-}
-
-
-StatementList::~StatementList()
-{
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Deleting \n" );
-#endif
- DBG_ASSERT(!bReadingCommands,"Deleting commands while reading them!");
-}
-
-Window* StatementList::GetDocWin( sal_uInt16 nNr )
-{
- Window* pBase = Application::GetFirstTopLevelWindow();
-
- while ( pBase )
- {
- if ( IsDocWin( pBase ) )
- {
- if ( !nNr )
- return pBase;
- nNr--;
- }
- pBase = Application::GetNextTopLevelWindow( pBase );
- }
- return NULL;
-}
-
-sal_uInt16 StatementList::GetDocFrameCount()
-{
- Window* pBase = Application::GetFirstTopLevelWindow();
- sal_uInt16 nCount = 0;
-
- while ( pBase )
- {
- if ( IsDocFrame( pBase ) )
- nCount++;
- pBase = Application::GetNextTopLevelWindow( pBase );
- }
- return nCount;
-}
-
-sal_uInt16 StatementList::GetDocWinCount()
-{
- Window* pBase = Application::GetFirstTopLevelWindow();
- sal_uInt16 nCount = 0;
-
- while ( pBase )
- {
- if ( IsDocWin( pBase ) )
- nCount++;
- pBase = Application::GetNextTopLevelWindow( pBase );
- }
- return nCount;
-}
-
-Window* StatementList::SearchAllWin( Window *pBase, Search &aSearch, sal_Bool MaybeBase )
-{
-
- if ( !pBase && !aSearch.HasSearchFlag( SEARCH_NO_TOPLEVEL_WIN ) )
- {
- sal_Bool bSearchFocusFirst = aSearch.HasSearchFlag( SEARCH_FOCUS_FIRST );
-
- Window *pControl = NULL;
- if ( bSearchFocusFirst )
- {
- // first test Parent of Focus Window
- pBase = Application::GetFocusWindow();
- if ( pBase )
- {
- DBG_ASSERT( WinPtrValid( pBase ), "GetFocusWindow is no valid WindowPointer" );
- Window *pPParent = pBase;
- while ( pPParent->GET_REAL_PARENT() )
- pPParent = pPParent->GET_REAL_PARENT();
-
- // get overlap window. Will be dialog else document itself
- pBase = pBase->GetWindow( WINDOW_OVERLAP );
-
- // set flag to find disabled elements.
- // This is better than an enabled one on another Window
- aSearch.AddSearchFlags( SEARCH_FIND_DISABLED );
-
- // search on current Dialog first
- pControl = SearchAllWin( pBase, aSearch );
-
- // search on current Document
- if ( !pControl && pBase != pPParent )
- pControl = SearchAllWin( pPParent, aSearch );
-
- aSearch.RemoveSearchFlags( SEARCH_FIND_DISABLED );
-
- if ( pControl )
- return pControl;
- }
- }
-
- pBase = Application::GetFirstTopLevelWindow();
-
- while ( pBase )
- {
- pControl = SearchAllWin( pBase, aSearch );
- if ( pControl )
- return pControl;
-
- pBase = Application::GetNextTopLevelWindow( pBase );
- }
- return NULL;
- }
-
-
- Window *pResult = NULL;
- pResult = SearchClientWin( pBase, aSearch, MaybeBase );
- if ( pResult )
- return pResult;
-
- if ( !aSearch.HasSearchFlag( SEARCH_NOOVERLAP ) )
- {
- if ( pBase->GetWindow( WINDOW_FIRSTOVERLAP ) )
- pResult = SearchAllWin( pBase->GetWindow( WINDOW_FIRSTOVERLAP ), aSearch );
-
- if ( !pResult && pBase->GetWindow( WINDOW_NEXT ) )
- pResult = SearchAllWin( pBase->GetWindow( WINDOW_NEXT ), aSearch );
- }
-
- return pResult;
-}
-
-
-Window* StatementList::SearchClientWin( Window *pBase, Search &aSearch, sal_Bool MaybeBase )
-{
- if ( !pBase )
- return NULL;
-
- if ( MaybeBase && aSearch.IsWinOK( pBase ) )
- return pBase;
-
- Window *pResult = NULL;
-
- sal_uInt16 i;
- for( i = 0 ; i < pBase->GetChildCount() && !pResult; i++ )
- pResult = SearchClientWin( pBase->GetChild(i), aSearch );
-
- return pResult;
-}
-
-
-sal_Bool SearchUID::IsWinOK( Window *pWin )
-{
- if ( aUId.equals( pWin->GetUniqueOrHelpId() ) )
- {
- if ( ( pWin->IsEnabled() || HasSearchFlag( SEARCH_FIND_DISABLED ) ) && pWin->IsVisible() )
- return sal_True;
- else
- {
- if ( !pMaybeResult )
- pMaybeResult = pWin;
- return sal_False;
- }
- }
- else if ( pWin->GetType() == WINDOW_TOOLBOX ) // Buttons and Controls on ToolBox.
- {
- ToolBox *pTB = ((ToolBox*)pWin);
- sal_uInt16 i;
- for ( i = 0; i < pTB->GetItemCount() ; i++ )
- {
- if ( aUId.equals( Str2Id( pTB->GetItemCommand(pTB->GetItemId( i )) ) ) || aUId.equals( pTB->GetHelpId(pTB->GetItemId( i )) ) )
- { // ID matches.
- Window *pItemWin;
- pItemWin = pTB->GetItemWindow( pTB->GetItemId( i ) );
-
- if ( bSearchButtonOnToolbox && pTB->GetItemType( i ) == TOOLBOXITEM_BUTTON && !pItemWin )
- { // We got a Control, see if its valid also.
- // Same as above.
- if ( ( pTB->IsEnabled() || HasSearchFlag( SEARCH_FIND_DISABLED ) ) && pTB->IsVisible() )
- { // We got a Button, see if its valid also.
- if ( ( pTB->IsItemEnabled(pTB->GetItemId(i)) || HasSearchFlag( SEARCH_FIND_DISABLED ) )
- && pTB->IsItemVisible(pTB->GetItemId(i)) )
- return sal_True; // We got a Button.
- else
- { // better a disabled Button on a valid ToolBox than an invalid ToolBox as below
- pMaybeResult = pTB;
- return sal_False;
- }
- }
- else if ( !pMaybeResult )
- { // invalid ToolBox
- pMaybeResult = pTB;
- return sal_False;
- }
- }
- if ( pItemWin )
- { // We got a Control, see if its valid also.
- // Same as above.
- if ( ( pItemWin->IsEnabled() || HasSearchFlag( SEARCH_FIND_DISABLED ) ) && pItemWin->IsVisible() )
- {
- if ( !pAlternateResult ) // only take the first found ItemWindow #i35365
- pAlternateResult = pItemWin; // since we cannot return a Window here
- return sal_False; // continue searching to prefer a window with the right ID #i32292
- }
- else if ( !pMaybeResult )
- {
- pMaybeResult = pItemWin;
- return sal_False;
- }
- }
- }
- }
- return sal_False;
- }
- else
- return sal_False;
-}
-
-Window* StatementList::SearchTree( rtl::OString aUId ,sal_Bool bSearchButtonOnToolbox )
-{
- SearchUID aSearch(aUId,bSearchButtonOnToolbox);
-
- Window *pResult = SearchAllWin( NULL, aSearch );
- if ( pResult )
- return pResult;
- else if ( aSearch.GetAlternateResultWin() )
- return aSearch.GetAlternateResultWin();
- else
- return aSearch.GetMaybeWin();
-}
-
-
-sal_Bool SearchWinPtr::IsWinOK( Window *pWin )
-{
- return pWin == pTest;
-}
-
-sal_Bool StatementList::WinPtrValid(Window *pTest)
-{
- SearchWinPtr aSearch( pTest );
- return SearchAllWin( NULL, aSearch ) != NULL;
-}
-
-
-sal_Bool SearchRT::IsWinOK( Window *pWin )
-{
- if ( pWin->IsVisible() && pWin->GetType() == mnRT )
- {
- mnCount++;
- if ( mnSkip )
- {
- mnSkip--;
- return sal_False;
- }
- else
- return sal_True;
- }
- return sal_False;
-}
-
-Window* StatementList::GetWinByRT( Window *pBase, WindowType nRT, sal_Bool MaybeBase, sal_uInt16 nSkip, sal_Bool bSearchAll )
-{
- SearchRT aSearch( nRT, 0, nSkip );
- if ( bSearchAll )
- aSearch.AddSearchFlags( SEARCH_FOCUS_FIRST | SEARCH_FIND_DISABLED );
- else
- aSearch.AddSearchFlags( SEARCH_NOOVERLAP | SEARCH_NO_TOPLEVEL_WIN );
-
- return SearchAllWin( pBase, aSearch, MaybeBase );
-}
-
-sal_uInt16 StatementList::CountWinByRT( Window *pBase, WindowType nRT, sal_Bool MaybeBase )
-{
- SearchRT aSearch( nRT, SEARCH_NOOVERLAP | SEARCH_NO_TOPLEVEL_WIN, 0xFFFF );
-
- SearchAllWin( pBase, aSearch, MaybeBase );
- return aSearch.GetCount();
-}
-
-sal_Bool SearchScroll::IsWinOK( Window *pWin )
-{
- if ( SearchRT::IsWinOK( pWin ) )
- {
- DBG_ASSERT( pWin->GetStyle() & ( WB_HORZ | WB_VERT ), "Nither WB_HORZ nor WB_VERT set on ScrollBar");
- return (( pWin->GetStyle() & WB_HORZ ) && ( nDirection == CONST_ALIGN_BOTTOM ))
- || (( pWin->GetStyle() & WB_VERT ) && ( nDirection == CONST_ALIGN_RIGHT ));
- }
- return sal_False;
-}
-
-ScrollBar* StatementList::GetScrollBar( Window *pBase, sal_uInt16 nDirection, sal_Bool MaybeBase )
-{
- SearchScroll aSearch( nDirection, SEARCH_NOOVERLAP | SEARCH_NO_TOPLEVEL_WIN );
-
- return (ScrollBar*)SearchAllWin( pBase, aSearch, MaybeBase );
-}
-
-
-sal_Bool SearchPopupFloatingWin::IsWinOK( Window *pWin )
-{
- return pWin->IsVisible() && pWin->GetType() == WINDOW_FLOATINGWINDOW && ((FloatingWindow*)pWin)->IsInPopupMode();
-}
-
-Window* StatementList::GetPopupFloatingWin( sal_Bool MaybeBase )
-{
- SearchPopupFloatingWin aSearch;
-
- return SearchAllWin( NULL, aSearch, MaybeBase );
-}
-
-
-Menu* StatementList::GetMatchingMenu( Window* pWin, Menu* pBaseMenu )
-{
- if ( pBaseMenu )
- {
- if ( pBaseMenu->GetWindow() == pWin )
- return pBaseMenu;
-
- sal_uInt16 i;
- i = 0;
- while ( i < pBaseMenu->GetItemCount() )
- {
- PopupMenu* pPopup = pBaseMenu->GetPopupMenu( pBaseMenu->GetItemId( i ) );
- if ( pPopup && pPopup->GetWindow() )
- {
- if ( pPopup->GetWindow() == pWin )
- return pPopup;
- else
- {
- pBaseMenu = pPopup;
- i = 0;
- }
- }
- else
- i++;
- }
- }
- else
- {
- if ( PopupMenu::GetActivePopupMenu() )
- {
- Menu* pMenu = GetMatchingMenu( pWin, PopupMenu::GetActivePopupMenu() );
- if ( pMenu )
- return pMenu;
- }
-
- sal_uInt16 nSkip = 0;
- Window* pMenuBarWin = NULL;
- while ( (pMenuBarWin = GetWinByRT( NULL, WINDOW_MENUBARWINDOW, sal_True, nSkip++, sal_True )) != NULL )
- {
- Window* pParent = pMenuBarWin->GET_REAL_PARENT();
- if ( pParent && pParent->GetType() == WINDOW_BORDERWINDOW && pParent->IsVisible() )
- {
- Menu* pMenu = NULL;
- // find Menu of MenuBarWindow
- sal_uInt16 nCount;
- for ( nCount = 0 ; nCount < pParent->GetChildCount() ; nCount++ )
- {
- if ( pParent->GetChild( nCount )->GetType() == WINDOW_WORKWINDOW )
- pMenu = ((WorkWindow*)(pParent->GetChild( nCount )))->GetMenuBar();
- }
- if ( pMenu )
- {
- // check for menu bar in Task Window
- if ( pMenuBarWin == pWin )
- return pMenu;
-
- // search submenues
- pMenu = GetMatchingMenu( pWin, pMenu );
- if ( pMenu )
- return pMenu;
- }
- }
- }
- }
- return NULL;
-}
-
-
-sal_Bool SearchActive::IsWinOK( Window *pWin )
-{
- // only matches ResID due to problems with UNIX Window Managers
- return pWin->IsVisible() && ( (nRT == WINDOW_ANYTYPE && IsDialog(pWin) ) || pWin->GetType() == nRT );
-}
-
-Window* StatementList::GetActive( WindowType nRT, sal_Bool MaybeBase )
-{
- SearchActive aSearch( nRT );
-
- return SearchAllWin( NULL, aSearch, MaybeBase );
-}
-
-sal_Bool SearchFadeSplitWin::IsWinOK( Window *pWin )
-{
-#if OSL_DEBUG_LEVEL > 1
- if ( pWin->GetType() == WINDOW_SPLITWINDOW )
- {
- sal_Bool bResult;
- WindowAlign aAlign;
- bResult = pWin->IsVisible();
- bResult = ((SplitWindow*)pWin)->IsFadeInButtonVisible();
- bResult = ((SplitWindow*)pWin)->IsFadeOutButtonVisible();
- bResult = ((SplitWindow*)pWin)->IsAutoHideButtonVisible();
- aAlign = ((SplitWindow*)pWin)->GetAlign();
- }
-#endif
- return pWin->IsVisible() && ( pWin->GetType() == WINDOW_SPLITWINDOW )
- && (((SplitWindow*)pWin)->IsFadeInButtonVisible() || ((SplitWindow*)pWin)->IsFadeOutButtonVisible() )
- /*&& ((SplitWindow*)pWin)->IsAutoHideButtonVisible()*/ && ((SplitWindow*)pWin)->GetAlign() == nAlign;
-}
-
-Window* StatementList::GetFadeSplitWin( Window *pBase, WindowAlign nAlign, sal_Bool MaybeBase )
-{
- SearchFadeSplitWin aSearch( nAlign );
-
- if ( GetpApp()->GetAppWindow() == pBase && pBase->GetType() != WINDOW_BORDERWINDOW )
- pBase = pBase->GetWindow( WINDOW_OVERLAP );
-
- return SearchAllWin( pBase, aSearch, MaybeBase );
-}
-
-Window* StatementList::GetMouseWin()
-{
- Window *pBase = Application::GetFirstTopLevelWindow();
- Window *pControl = NULL;
- while ( pBase )
- {
- Window *pBaseFrame = pBase->GetWindow( WINDOW_OVERLAP );
-
- Point aP = pBaseFrame->GetPointerPosPixel();
- pControl = pBaseFrame->FindWindow( aP );
- if ( pControl )
- return pControl;
-
- pBase = Application::GetNextTopLevelWindow( pBase );
- }
- return NULL;
-}
-
-Window* StatementList::GetFocus( WindowType nRT, sal_Bool MaybeBase )
-{
-
- if ( nRT == WINDOW_TABCONTROL )
- {
- Window *pResult = GetActive( WINDOW_TABDIALOG, MaybeBase);
- for( sal_uInt16 i = 0 ; pResult && i < pResult->GetChildCount(); i++ )
- if ( pResult->GetChild(i)->GetType() == nRT )
- return pResult->GetChild(i);
- }
-
- return NULL;
-}
-
-Window* StatementList::GetAnyActive( sal_Bool MaybeBase )
-{
- Window *pControl;
-
- pControl = GetActive( WINDOW_MESSBOX, MaybeBase);
- if ( !pControl )
- {
- pControl = GetActive( WINDOW_INFOBOX, MaybeBase);
- }
- if ( !pControl )
- {
- pControl = GetActive( WINDOW_WARNINGBOX, MaybeBase);
- }
- if ( !pControl )
- {
- pControl = GetActive( WINDOW_ERRORBOX, MaybeBase);
- }
- if ( !pControl )
- {
- pControl = GetActive( WINDOW_QUERYBOX, MaybeBase);
- }
- if ( !pControl )
- {
- pControl = GetActive( WINDOW_BUTTONDIALOG, MaybeBase);
- }
- if ( !pControl )
- {
- pControl = GetActive( WINDOW_FILEDIALOG, MaybeBase);
- }
- if ( !pControl )
- {
- pControl = GetActive( WINDOW_PATHDIALOG, MaybeBase);
- }
- if ( !pControl )
- {
- pControl = GetActive( WINDOW_PRINTDIALOG, MaybeBase);
- }
- if ( !pControl )
- {
- pControl = GetActive( WINDOW_PRINTERSETUPDIALOG, MaybeBase);
- }
- if ( !pControl )
- {
- pControl = GetActive( WINDOW_COLORDIALOG, MaybeBase);
- }
- if ( !pControl )
- {
- pControl = GetFocus( WINDOW_TABCONTROL, MaybeBase);
- }
-
- return pControl;
-}
-
-void StatementList::SetFirstDocFrame( Window* pWin )
-{
- DBG_ASSERT( IsDocFrame( pWin ), "Non Document Frame set as first Document Frame" );
- pFirstDocFrame = pWin;
-}
-
-Window* StatementList::GetFirstDocFrame()
-{
-
- if ( pFirstDocFrame && !WinPtrValid( pFirstDocFrame ) )
- pFirstDocFrame = NULL;
- if ( pFirstDocFrame && !pFirstDocFrame->IsVisible() )
- pFirstDocFrame = NULL;
- if ( pFirstDocFrame && !IsDocFrame( pFirstDocFrame ) )
- pFirstDocFrame = NULL;
- if ( !pFirstDocFrame )
- {
- Window* pBase = Application::GetFirstTopLevelWindow();
- while ( pBase && !IsDocFrame( pBase ) )
- pBase = Application::GetNextTopLevelWindow( pBase );
-
- if ( pBase )
- SetFirstDocFrame( pBase );
-
- if ( !pBase ) // find just something
- {
- pBase = Application::GetFirstTopLevelWindow();
- while ( pBase && !pBase->IsVisible() )
- pBase = Application::GetNextTopLevelWindow( pBase );
-
- return pBase; // just for now, later we will hopefully have a Window
- }
- }
- return pFirstDocFrame;
-}
-
-sal_Bool StatementList::IsFirstDocFrame( Window* pWin )
-{
- return pWin && ( pWin == GetFirstDocFrame() || ( GetFirstDocFrame() && pWin == GetFirstDocFrame()->GetWindow( WINDOW_CLIENT ) ) ) && ( GetFirstDocFrame() && IsDocFrame( GetFirstDocFrame() ) );
-}
-
-MenuBar* StatementList::GetDocFrameMenuBar( Window* pWin )
-{
- if ( pWin && pWin->IsVisible() && pWin->GetType() == WINDOW_BORDERWINDOW )
- {
- sal_uInt16 nCount;
- for ( nCount = 0 ; nCount < pWin->GetChildCount() ; nCount++ )
- {
- if ( pWin->GetChild( nCount )->GetType() == WINDOW_WORKWINDOW )
- return ((WorkWindow*)(pWin->GetChild( nCount )))->GetMenuBar();
- }
- }
- return NULL;
-}
-
-// a Doc Frame is a Document or the Backing Window
-sal_Bool StatementList::IsDocFrame( Window* pWin )
-{
- if ( pWin && pWin->IsVisible() && pWin->GetType() == WINDOW_BORDERWINDOW )
- {
- sal_uInt16 nCount;
- sal_Bool bHasWorkWindow = sal_False;
- sal_Bool bHasMenuBar = sal_False;
- // #91724# it is now necessary to sort out the IME WIndow in Solaris as well.
- // so now we check for existence of WINDOW_WORKWINDOW and newly for
- // WINDOW_MENUBARWINDOW which contains the Menu and the close/min/max buttons
- for ( nCount = 0 ; nCount < pWin->GetChildCount() ; nCount++ )
- {
- if ( pWin->GetChild( nCount )->GetType() == WINDOW_WORKWINDOW )
- bHasWorkWindow = sal_True;
- if ( pWin->GetChild( nCount )->GetType() == WINDOW_MENUBARWINDOW )
- bHasMenuBar = sal_True;
- }
- return bHasWorkWindow && bHasMenuBar;
- }
- return sal_False;
-}
-
-// a Doc Win is a real document (not the Backing Window)
-sal_Bool StatementList::IsDocWin( Window* pWin )
-{
- if ( pWin && IsDocFrame( pWin ) )
- {
- if ( GetDocFrameCount() != 1 )
- return sal_True;
- else
- {
- // check for the close button to see if we are the last one or only the backing Window
- if ( GetDocFrameMenuBar( pWin ) )
- return GetDocFrameMenuBar( pWin )->HasCloser();
- }
- }
- return sal_False;
-}
-
-sal_Bool StatementList::IsIMEWin( Window* pWin ) // Input Window for CJK under Solaris
-{
- if ( pWin && pWin->IsVisible() && pWin->GetType() == WINDOW_BORDERWINDOW )
- {
- sal_uInt16 nCount;
- sal_Bool bHasWorkWindow = sal_False;
- sal_Bool bHasWindow = sal_False;
- // #91724# it is now necessary to sort out the IME WIndow in Solaris as well.
- // so now we check for existence of WINDOW_WORKWINDOW and newly for
- // WINDOW_WINDOW which contains the Menu and the close/min/max buttons
- for ( nCount = 0 ; nCount < pWin->GetChildCount() ; nCount++ )
- if ( pWin->GetChild( nCount )->GetType() == WINDOW_WORKWINDOW )
- bHasWorkWindow = sal_True;
- for ( nCount = 0 ; nCount < pWin->GetChildCount() ; nCount++ )
- if ( pWin->GetChild( nCount )->GetType() == WINDOW_WINDOW )
- bHasWindow = sal_True;
- return bHasWorkWindow && !bHasWindow;
- }
- return sal_False;
-}
-
-UniString StatementList::Tree(Window *pBase, int Indent)
-{
-
- String aReturn, aSep;
- if ( !pBase )
- {
- aSep.AssignAscii("============================\n");
- aSep.ConvertLineEnd();
- pBase = Application::GetFirstTopLevelWindow();
- while ( pBase )
- {
- Window *pBaseFrame = pBase->GetWindow( WINDOW_OVERLAP );
-
- aReturn += aSep;
- aReturn += Tree( pBaseFrame, Indent+1 );
-
- pBase = Application::GetNextTopLevelWindow( pBase );
- }
- return aReturn;
- }
-
-
- aSep.AssignAscii("----------------------------\n");
- aSep.ConvertLineEnd();
-
- aReturn += ClientTree( pBase, Indent );
-
- if ( pBase->GetWindow( WINDOW_FIRSTOVERLAP ) )
- {
- aReturn += aSep;
- aReturn += Tree( pBase->GetWindow( WINDOW_FIRSTOVERLAP ), Indent+1 );
- }
-
- if ( pBase->GetWindow( WINDOW_NEXT ) )
- {
- aReturn += aSep;
- aReturn += Tree( pBase->GetWindow( WINDOW_NEXT ), Indent );
- }
-
- return aReturn;
-}
-
-String StatementList::ClientTree(Window *pBase, int Indent)
-{
-#if OSL_DEBUG_LEVEL > 1
-#define WRITE(Text) { m_pDbgWin->AddText(Text); aReturn += Text; }
-#define WRITEc(Text) { m_pDbgWin->AddText(Text); aReturn.AppendAscii(Text); }
-#else
-#define WRITE(Text) { aReturn += Text; }
-#define WRITEc(Text) { aReturn.AppendAscii(Text); }
-#endif
-
- String sIndent,aText,aReturn;
- sIndent.Expand(sal::static_int_cast< xub_StrLen >(2*Indent));
-
- aText = pBase->GetText();
-
-
- UniString t1,t2;t1 = CUniString("\n"); t2 = CUniString("\\n");
- aText.SearchAndReplaceAll(t1,t2 );
-
- WRITE(sIndent);
-
- if (pBase->IsDialog())
- {
- WRITEc("*(Dialog(TH))");
- }
- if (IsDialog( pBase ))
- {
- WRITEc("*(Dialog(GH))");
- }
- if (pBase->HasFocus())
- {
- WRITEc("*(Focus)");
- }
- if (!pBase->IsEnabled())
- {
- WRITEc("*(Disab)");
- }
- if (pBase->IsVisible())
- {
- WRITEc("*(Visible)");
- }
- if ( IsDialog(pBase) && ((SystemWindow*)pBase)->IsActive() )
- {
- WRITEc("*(Active)");
- }
- if ( pBase->GetStyle() & WB_CLOSEABLE )
- {
- WRITEc("*(Closable)");
- }
- if ( pBase->GetType() == WINDOW_DOCKINGWINDOW &&
- ((((DockingWindow*)pBase)->GetFloatStyle()) & WB_CLOSEABLE) )
- {
- WRITEc("*(Closable Docking in Floatingstyle)");
- }
- if ( pBase->GetStyle() & WB_DOCKABLE )
- {
- WRITEc("*(Dockable)");
- }
- if ( pBase->GetType() == WINDOW_SPLITWINDOW &&
- (((SplitWindow*)pBase)->IsFadeInButtonVisible() || ((SplitWindow*)pBase)->IsFadeOutButtonVisible()) )
- {
- WRITEc("*(FadeIn/Out)");
- }
- WRITEc("Text: ");
- WRITE(aText);
- WRITEc("\n");
-
- WRITE(sIndent);
- WRITEc("UId : ");
- WRITE(Id2Str(pBase->GetUniqueOrHelpId()));
- WRITEc(":0x");
- WRITE(
- String::CreateFromInt64(
- sal::static_int_cast< sal_Int64 >(
- reinterpret_cast< sal_IntPtr >(pBase)),
- 16 ));
- WRITEc(":");
- WRITE(pBase->GetQuickHelpText());
- WRITEc(":");
- WRITE(pBase->GetHelpText());
- WRITEc("\n");
-
- WRITE(sIndent);
- WRITEc("RTyp: ");
- WRITE(MakeStringNumber(TypeKenn,pBase->GetType()));
- if ( pBase->GetType() == WINDOW_CONTROL )
- {
- if ( dynamic_cast< svt::EditBrowseBox* >(pBase) )
- WRITEc("/BrowseBox")
- else if ( dynamic_cast< ValueSet* >(pBase) )
- WRITEc("/ValueSet")
- else if ( dynamic_cast< svt::ORoadmap* >(pBase) )
- WRITEc("/RoadMap")
- else if ( dynamic_cast< svt::IExtensionListBox* >(pBase) )
- WRITEc("/ExtensionListBox")
- else if ( dynamic_cast< svt::table::TableControl* >(pBase) )
- WRITEc("/TableControl")
- else
- WRITEc("/Unknown")
- }
- WRITEc("\n");
-
- aReturn.ConvertLineEnd();
- sal_uInt16 i;
- for (i = 0 ; i < pBase->GetChildCount() ; i++)
- {
- aReturn += ClientTree(pBase->GetChild(i),Indent+1);
- }
- return aReturn;
-}
-
-
-sal_Bool StatementList::CheckWindowWait()
-{
- static Time StartTime = Time(0L); // Abbruch wenn Fenster absolut nicht schliesst.
- if ( StartTime == Time(0L) )
- StartTime = Time();
-
- if ( pWindowWaitPointer )
- {
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Waiting for Window to close ... " );
-#endif
- if ( WinPtrValid(pWindowWaitPointer) && IS_WINP_CLOSING(pWindowWaitPointer) )
- {
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( Id2Str(aWindowWaitUId).AppendAscii(" Still Open. RType=") );
- m_pDbgWin->AddText( String::CreateFromInt32( pWindowWaitPointer->GetType() ).AppendAscii("\n") );
-#endif
-
- // Ist die Zeit schonn abgelaufen?
- if ( StartTime + Time(0,0,10) < Time() ) // 10 Sekunden reichen wohl
- {
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Close timed out. Going on!! " );
-#endif
- pWindowWaitPointer->SetHelpId(aWindowWaitOldHelpId);
- pWindowWaitPointer->SetUniqueId(aWindowWaitOldUniqueId);
-
- aWindowWaitUId = rtl::OString();
- pWindowWaitPointer = NULL;
- StartTime = Time(0L);
- return sal_True;
- }
-
- return sal_False;
- }
- pWindowWaitPointer = NULL;
- aWindowWaitUId = rtl::OString();
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Closed, Going on.\n" );
-#endif
- }
- StartTime = Time(0L);
- return sal_True;
-}
-
-void StatementList::ReportError(String aMessage)
-{
- ReportError ( rtl::OString(), aMessage );
-}
-
-void StatementList::ReportError(rtl::OString aUId, String aMessage)
-{
- pRet->GenError ( aUId, aMessage );
- IsError = sal_True;
-}
-
-void StatementList::ReportError(String aMessage, sal_uLong nWhatever)
-{
- ReportError ( aMessage.AppendAscii(" ").Append(UniString::CreateFromInt32(nWhatever)));
-}
-
-void StatementList::DirectLog( sal_uLong nType, String aMessage )
-{
- if ( pRet )
- pRet->GenReturn( RET_DirectLoging, (sal_uInt16) nType, aMessage );
-}
-
-
-#define CALL_EVENT_WITH_NOTIFY( EventType, Event, WinP, Method ) \
-{ \
- if ( StatementList::WinPtrValid( WinP ) ) \
- { \
- NotifyEvent aNEvt( EventType, WinP, &Event ); \
- if ( !WinP->PreNotify( aNEvt ) ) \
- WinP->Method( Event ); \
- } \
-}
-
-void ImplKeyInput( Window* pWin, KeyEvent &aKEvnt, sal_Bool bForceDirect )
-{
-
- if ( StatementList::bUsePostEvents && !bForceDirect )
- {
- if ( StatementList::WinPtrValid( pWin ) )
- {
- sal_uLong nID1;
- sal_uLong nID2;
- nID1 = Application::PostKeyEvent( VCLEVENT_WINDOW_KEYINPUT, pWin, &aKEvnt );
- nID2 = Application::PostKeyEvent( VCLEVENT_WINDOW_KEYUP, pWin, &aKEvnt );
- // wait after posting both events so deleting pWin will remove the second event also
- ImplEventWait( nID1 );
- ImplEventWait( nID2 );
- }
- }
- else
- {
- if ( !Application::CallAccel( aKEvnt.GetKeyCode() ) )
- {
- CALL_EVENT_WITH_NOTIFY( EVENT_KEYINPUT, aKEvnt, pWin, KeyInput )
-
- KeyCode aCode = aKEvnt.GetKeyCode();
- if ( (aCode.GetCode() == KEY_CONTEXTMENU) || ((aCode.GetCode() == KEY_F10) && aCode.IsShift()) )
- {
- if ( StatementList::WinPtrValid( pWin ) )
- {
- Point aPos;
- // simulate mouseposition at center of window
- Size aSize = pWin->GetOutputSize();
- aPos = Point( aSize.getWidth()/2, aSize.getHeight()/2 );
-
- CommandEvent aEvent( aPos, COMMAND_CONTEXTMENU, sal_False );
- ImplCommand( pWin, aEvent );
- }
- }
- }
-
- CALL_EVENT_WITH_NOTIFY( EVENT_KEYUP, aKEvnt, pWin, KeyUp )
- }
-};
-
-void ImplMouseMove( Window* pWin, MouseEvent &aMEvnt, sal_Bool bForceDirect )
-{
- if ( StatementList::bUsePostEvents && !bForceDirect )
- {
- if ( StatementList::WinPtrValid( pWin ) )
- {
- sal_uLong nID;
- nID = Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEMOVE, pWin, &aMEvnt );
- ImplEventWait( nID );
- }
- }
- else
- {
- if ( pWin->IsTracking() )
- {
- TrackingEvent aTEvt( aMEvnt );
- pWin->Tracking( aTEvt );
- }
- else
- CALL_EVENT_WITH_NOTIFY( EVENT_MOUSEMOVE, aMEvnt, pWin, MouseMove )
- }
-};
-
-void ImplMouseButtonDown( Window* pWin, MouseEvent &aMEvnt, sal_Bool bForceDirect )
-{
- if ( StatementList::bUsePostEvents && !bForceDirect )
- {
- if ( StatementList::WinPtrValid( pWin ) )
- {
- sal_uLong nID;
- nID = Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, pWin, &aMEvnt );
- ImplEventWait( nID );
- }
- }
- else
- {
- CALL_EVENT_WITH_NOTIFY( EVENT_MOUSEBUTTONDOWN, aMEvnt, pWin, MouseButtonDown )
- }
-};
-
-void ImplMouseButtonUp( Window* pWin, MouseEvent &aMEvnt, sal_Bool bForceDirect )
-{
- if ( StatementList::bUsePostEvents && !bForceDirect )
- {
- if ( StatementList::WinPtrValid( pWin ) )
- {
- sal_uLong nID;
- nID = Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEBUTTONUP, pWin, &aMEvnt );
- ImplEventWait( nID );
- }
- }
- else
- {
- if ( pWin->IsTracking() )
- {
- // siehe #64693 die Position ist f�r Toolboxen relevant
- // #60020 Jetzt hoffentlich kein GPF mehr
- // Zuerst Tracking beenden ohne Event
- pWin->EndTracking( ENDTRACK_DONTCALLHDL );
- // dann eigenen Event mit richtigem Maus-Event senden
- TrackingEvent aTEvt( aMEvnt, ENDTRACK_END );
- pWin->Tracking( aTEvt );
- }
- else
- CALL_EVENT_WITH_NOTIFY( EVENT_MOUSEBUTTONUP, aMEvnt, pWin, MouseButtonUp )
- }
-};
-
-void ImplEventWait( sal_uLong nID )
-{
- while ( !Application::IsProcessedMouseOrKeyEvent( nID ) )
- Application::Yield();
-}
-
-void ImplCommand( Window* pWin, CommandEvent &aCmdEvnt )
-{
- CALL_EVENT_WITH_NOTIFY( EVENT_COMMAND, aCmdEvnt, pWin, Command )
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx
deleted file mode 100644
index 23641de88..000000000
--- a/automation/source/server/statemnt.cxx
+++ /dev/null
@@ -1,6339 +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_automation.hxx"
-#include <com/sun/star/frame/XFramesSupplier.hpp>
-#include <com/sun/star/frame/XDispatch.hpp>
-#include <com/sun/star/frame/XDispatchProvider.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
-#include <comphelper/processfactory.hxx>
-#include <comphelper/uieventslogger.hxx>
-
-#include <tools/wintypes.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/menubtn.hxx>
-#include <svtools/svtreebx.hxx>
-#include <svtools/brwbox.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/dockwin.hxx>
-#include <vcl/floatwin.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/combobox.hxx>
-#include <vcl/morebtn.hxx>
-#include <vcl/field.hxx>
-#include <vcl/toolbox.hxx>
-#include <vcl/tabctrl.hxx>
-#include <vcl/tabpage.hxx>
-#include <vcl/menu.hxx>
-#include <vcl/status.hxx>
-#include <svtools/prgsbar.hxx>
-#include <svtools/editbrowsebox.hxx>
-#include <vcl/splitwin.hxx>
-#include <vcl/group.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/wrkwin.hxx>
-#include <osl/diagnose.h>
-#include <svtools/valueset.hxx>
-#include <svtools/roadmap.hxx>
-#include <svtools/table/tablecontrol.hxx>
-#include <svtools/table/tablecontrolinterface.hxx>
-#include <svl/poolitem.hxx>
-#include <svtools/extensionlistbox.hxx>
-// Hat keinen Includeschutz
-#include <svtools/svtdata.hxx>
-#include <tools/time.hxx>
-#include <svtools/stringtransfer.hxx>
-#include <tools/stream.hxx>
-#include <tools/fsys.hxx>
-#include <svl/stritem.hxx>
-#include <svtools/ttprops.hxx>
-#include <basic/ttstrhlp.hxx>
-#include <basic/dispdefs.hxx>
-#include <basic/sbuno.hxx>
-#include <svl/pickerhistory.hxx>
-#include <com/sun/star/util/XCancellable.hpp>
-
-#include <sot/storage.hxx>
-#include <sot/storinfo.hxx>
-#include "statemnt.hxx"
-#include "scmdstrm.hxx"
-
-#include "retstrm.hxx"
-
-#if OSL_DEBUG_LEVEL > 1
-# include "editwin.hxx"
-#endif
-
-#include "rcontrol.hxx"
-#include <automation/communi.hxx>
-#include "testtool.hxx"
-
-#include "profiler.hxx"
-
-#include "recorder.hxx"
-
-#include "testtool.hrc"
-#include <basic/svtmsg.hrc>
-
-#include <algorithm>
-
-
-using namespace com::sun::star::frame;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::beans;
-using namespace svt;
-
-
-#ifndef SBX_VALUE_DECL_DEFINED
-#define SBX_VALUE_DECL_DEFINED
-SV_DECL_REF(SbxValue)
-#endif
-SV_IMPL_REF(SbxValue)
-
-CommunicationLink *StatementFlow::pCommLink = NULL;
-sal_Bool StatementFlow::bUseIPC = sal_True;
-sal_Bool StatementFlow::bSending = sal_False;
-ImplRemoteControl *StatementFlow::pRemoteControl = NULL;
-
-sal_uInt16 StatementCommand::nDirPos = 0;
-Dir *StatementCommand::pDir = NULL;
-pfunc_osl_printDebugMessage StatementCommand::pOriginal_osl_DebugMessageFunc = NULL;
-
-
-#define SET_WINP_CLOSING(pWin) \
- pWindowWaitPointer = pWin; \
- aWindowWaitUId = pControl->GetUniqueOrHelpId(); \
- aWindowWaitOldHelpId = pWin->GetHelpId(); \
- aWindowWaitOldUniqueId = pWin->GetUniqueId(); \
- pWin->SetHelpId( rtl::OString("TT_Win_is_closing_HID") ); \
- pWin->SetUniqueId( rtl::OString("TT_Win_is_closing_UID") );
-
-
-StatementFlow::StatementFlow( StatementList *pAfterThis, sal_uInt16 nArtP )
-: nArt(nArtP)
-, nParams(0)
-, nSNr1(0)
-, nLNr1(0)
-, aString1()
-, bBool1(sal_False)
-{
- QueStatement( pAfterThis );
-}
-
-StatementFlow::StatementFlow( sal_uLong nServiceId, SCmdStream *pCmdIn, ImplRemoteControl *pRC )
-: nArt(0)
-, nParams(0)
-, nSNr1(0)
-, nLNr1(0)
-, aString1()
-, bBool1(sal_False)
-{
- QueStatement( NULL );
- bUseIPC = (nServiceId == SI_IPCCommandBlock);
- pRemoteControl = pRC;
- pCmdIn->Read( nArt );
- pCmdIn->Read( nParams );
-
- if( nParams & PARAM_UINT16_1 ) pCmdIn->Read( nSNr1 );
- if( nParams & PARAM_UINT32_1 ) pCmdIn->Read( nLNr1 );
- if( nParams & PARAM_STR_1 ) pCmdIn->Read( aString1 );
- if( nParams & PARAM_BOOL_1 ) pCmdIn->Read( bBool1 );// Should NEVER happen
-
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Reading FlowControl: " );
- m_pDbgWin->AddText( String::CreateFromInt32( nArt ) );
- m_pDbgWin->AddText( " Params:" );
- if( nParams & PARAM_UINT16_1 ) {m_pDbgWin->AddText( " n1:" );m_pDbgWin->AddText( String::CreateFromInt32( nSNr1 ) );}
- if( nParams & PARAM_UINT32_1 ) {m_pDbgWin->AddText( " l1:" );m_pDbgWin->AddText( String::CreateFromInt64( nLNr1 ) );}
- if( nParams & PARAM_STR_1 ) {m_pDbgWin->AddText( " s1:" );m_pDbgWin->AddText( aString1 );}
- if( nParams & PARAM_BOOL_1 ) {m_pDbgWin->AddText( " b2:" );m_pDbgWin->AddText( bBool1 ? "TRUE" : "FALSE" );}
- m_pDbgWin->AddText( "\n" );
-#endif
-}
-
-void StatementFlow::SendViaSocket()
-{
- if ( bSending )
- {
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "SendViaSocket called recursively. Aborted!!!\n" );
-#endif
- OSL_FAIL("SendViaSocket called recursively. Aborted!!!");
- return;
- }
- bSending = sal_True;
- if ( pCommLink )
- {
- if ( !pCommLink->TransferDataStream( pRet->GetStream() ) ) // tritt ein Fehler auf, so wird sofort gel�scht ...
- pCommLink = NULL;
- }
- else
- {
- // Macht nix. Wenn das Basic nicht mehr da ist, ist sowiso alles egal
- OSL_FAIL("Cannot send results to TestTool");
- }
-
- pRet->Reset();
- bSending = sal_False;
- IsError = sal_False;
-}
-
-sal_Bool StatementFlow::Execute()
-{
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Executing Flow: " );
- m_pDbgWin->AddText( String::CreateFromInt32( nArt ) );
- m_pDbgWin->AddText( "\n" );
-#endif
- switch ( nArt )
- {
- case F_EndCommandBlock:
- {
-
- if ( !bUseIPC )
- {
- // bBool1 wurde im CTOR auf sal_False initialisiert
- if ( !bBool1 ) // also erster Durchlauf
- {
- pRemoteControl->pRetStream = pRet->GetStream();
- bBool1 = sal_True; // wurde im CTOR auf sal_False initialisiert
- nRetryCount = nRetryCount * 4;
- }
- if ( pRemoteControl->pRetStream && (nRetryCount--) ) // also solange nicht abgeholt
- {
- return sal_False; // Bitte einmal vom Callstack runter
- }
- }
-
- }
- break;
- }
-
- Advance();
- switch ( nArt )
- {
- case F_EndCommandBlock:
- if ( !bUseIPC )
- { // wird oben abgehandelt
- pRet->Reset();
- IsError = sal_False;
- }
- else
- SendViaSocket();
-
- break;
-
- case F_Sequence:
-
- pRet->GenReturn(RET_Sequence,nLNr1);
- #if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Sending Sequence Nr: " );
- m_pDbgWin->AddText( String::CreateFromInt64( nLNr1 ) );
- m_pDbgWin->AddText( "\n" );
- #endif
-
- break;
- default:
- OSL_FAIL( "Unknown Flowcontrol" );
- break;
- }
-
- delete this;
- return sal_True;
-}
-
-
-// neue Hilfsfunktion, die stetig erweitert werden muss
-static short ImpGetRType( Window *pWin )
-{
- short nRT = C_NoType;
- WindowType eRT = pWin->GetType();
- switch( eRT ) {
- case WINDOW_WINDOW: nRT = C_Window ; break;
-
- case WINDOW_TABCONTROL: nRT = C_TabControl ; break;
- case WINDOW_RADIOBUTTON: nRT = C_RadioButton ; break;
- case WINDOW_CHECKBOX: nRT = C_CheckBox ; break;
- case WINDOW_TRISTATEBOX: nRT = C_TriStateBox ; break;
- case WINDOW_EDIT: nRT = C_Edit ; break;
- case WINDOW_MULTILINEEDIT: nRT = C_MultiLineEdit ; break;
- case WINDOW_MULTILISTBOX: nRT = C_MultiListBox ; break;
- case WINDOW_LISTBOX: nRT = C_ListBox ; break;
- case WINDOW_COMBOBOX: nRT = C_ComboBox ; break;
- case WINDOW_PUSHBUTTON: nRT = C_PushButton ; break;
- case WINDOW_SPINFIELD: nRT = C_SpinField ; break;
- case WINDOW_PATTERNFIELD: nRT = C_PatternField ; break;
- case WINDOW_NUMERICFIELD: nRT = C_NumericField ; break;
- case WINDOW_METRICFIELD: nRT = C_MetricField ; break;
- case WINDOW_CURRENCYFIELD: nRT = C_CurrencyField ; break;
- case WINDOW_DATEFIELD: nRT = C_DateField ; break;
- case WINDOW_TIMEFIELD: nRT = C_TimeField ; break;
- case WINDOW_IMAGERADIOBUTTON: nRT = C_ImageRadioButton ; break;
- case WINDOW_NUMERICBOX: nRT = C_NumericBox ; break;
- case WINDOW_METRICBOX: nRT = C_MetricBox ; break;
- case WINDOW_CURRENCYBOX: nRT = C_CurrencyBox ; break;
- case WINDOW_DATEBOX: nRT = C_DateBox ; break;
- case WINDOW_TIMEBOX: nRT = C_TimeBox ; break;
- case WINDOW_IMAGEBUTTON: nRT = C_ImageButton ; break;
- case WINDOW_MENUBUTTON: nRT = C_MenuButton ; break;
- case WINDOW_MOREBUTTON: nRT = C_MoreButton ; break;
-
-
- case WINDOW_TABPAGE: nRT = C_TabPage; break;
- case WINDOW_MODALDIALOG: nRT = C_ModalDlg; break;
- case WINDOW_FLOATINGWINDOW: nRT = C_FloatWin; break;
- case WINDOW_MODELESSDIALOG: nRT = C_ModelessDlg; break;
- case WINDOW_WORKWINDOW: nRT = C_WorkWin; break;
- case WINDOW_DOCKINGWINDOW: nRT = C_DockingWin; break;
-
- case WINDOW_MESSBOX: nRT = C_MessBox; break;
- case WINDOW_INFOBOX: nRT = C_InfoBox; break;
- case WINDOW_WARNINGBOX: nRT = C_WarningBox; break;
- case WINDOW_ERRORBOX: nRT = C_ErrorBox; break;
- case WINDOW_QUERYBOX: nRT = C_QueryBox; break;
- case WINDOW_TABDIALOG: nRT = C_TabDlg; break;
-
- case WINDOW_PATTERNBOX: nRT = C_PatternBox; break;
- case WINDOW_TOOLBOX: nRT = C_ToolBox; break;
- case WINDOW_CONTROL: nRT = C_Control; break;
- case WINDOW_OKBUTTON: nRT = C_OkButton; break;
- case WINDOW_CANCELBUTTON: nRT = C_CancelButton; break;
- case WINDOW_BUTTONDIALOG: nRT = C_ButtonDialog; break;
- case WINDOW_TREELISTBOX: nRT = C_TreeListBox; break;
-
- case WINDOW_DIALOG: nRT = C_Dialog; break;
- }
- return nRT;
-}
-
-
-StatementSlot::StatementSlot( SCmdStream *pCmdIn )
-: pItemArr(NULL)
-{
- QueStatement( NULL );
- pCmdIn->Read( nFunctionId );
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Reading Slot: " );
- m_pDbgWin->AddText( String::CreateFromInt32( nFunctionId ) );
- m_pDbgWin->AddText( "\n" );
-#endif
- pCmdIn->Read( nAnzahl );
- if ( nAnzahl )
- {
- switch ( pCmdIn->GetNextType() )
- {
- case BinUINT16: // use old calling method
- {
- nAnzahl++;
- pItemArr = new SfxPoolItem*[nAnzahl];
- for (sal_uInt16 i = 0 ; i+1 < nAnzahl ; i++)
- pCmdIn->Read( pItemArr[i] );
- pItemArr[nAnzahl-1] = NULL;
- }
- break;
- case BinString: // new Method
- {
- aArgs.realloc(nAnzahl);
- PropertyValue* pArg = aArgs.getArray();
- for (sal_uInt16 i = 0 ; i < nAnzahl ; i++)
- pCmdIn->Read( pArg[i] );
- }
- break;
- }
- }
-}
-
-// Constructor for UnoSlot
-StatementSlot::StatementSlot()
-: nAnzahl( 0 )
-, pItemArr(NULL)
-, nFunctionId( 0 )
-, bMenuClosed(sal_False)
-{}
-
-StatementSlot::StatementSlot( sal_uLong nSlot, SfxPoolItem* pItem )
-: pItemArr(NULL)
-, bMenuClosed(sal_False)
-{
- QueStatement( NULL );
- nFunctionId = sal_uInt16(nSlot);
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Reading Slot: " );
- m_pDbgWin->AddText( String::CreateFromInt32( nFunctionId ) );
- m_pDbgWin->AddText( "\n" );
-#endif
- if ( pItem )
- {
- nAnzahl = 2;
- pItemArr = new SfxPoolItem*[2];
- pItemArr[0] = pItem;
- pItemArr[1] = NULL;
- }
- else
- nAnzahl = 0;
-}
-
-StatementSlot::~StatementSlot()
-{
- if (nAnzahl)
- {
- if ( pItemArr )
- {
- for (sal_uInt16 i = 0 ; i+1 < nAnzahl ; i++)
- delete pItemArr[i];
- delete[] pItemArr;
- }
-
- aArgs.realloc( 0 );
- }
-}
-
-void StatementSlot::AddReferer()
-{
- HACK( "only to test!" );
-// because slot 6102 /*SID_VERB_START*/ crashes when called with Property Referer
-// We return to the previous behavior (which was a bug realy) of not adding this Property to calls which have no properties at all
-// according to MBA most likely this Property can be removed at all and is maybe only needed for Slots with URLs
- if ( !nAnzahl )
- return;
-
- PropertyValue* pArg;
-
- nAnzahl++;
- aArgs.realloc(nAnzahl);
- pArg = aArgs.getArray();
- pArg[nAnzahl-1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Referer" ));
- pArg[nAnzahl-1].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:user" ));
-
- nAnzahl++;
- aArgs.realloc(nAnzahl);
- pArg = aArgs.getArray();
- pArg[nAnzahl-1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SynchronMode" ));
- pArg[nAnzahl-1].Value <<= sal_Bool( sal_True );
-}
-
-class SlotStatusListener : public cppu::WeakImplHelper1< XStatusListener >
-{
-public:
- SlotStatusListener();
-
- // XStatusListener
- virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
-
- // local Members
- sal_Bool bDisposed;
- sal_Bool bEnabled;
-};
-
-SlotStatusListener::SlotStatusListener()
-: bDisposed( sal_False )
-, bEnabled( sal_True )
-{}
-
-// XStatusListener
-void SAL_CALL SlotStatusListener::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
-{
- bEnabled = Event.IsEnabled;
-}
-
-// XEventListener
-void SAL_CALL SlotStatusListener::disposing( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException)
-{
- bDisposed = sal_True;
-}
-
-sal_Bool StatementSlot::Execute()
-{
- if ( IsError )
- {
- #if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Skipping Slot: " );
- m_pDbgWin->AddText( String::CreateFromInt32( nFunctionId ) );
- m_pDbgWin->AddText( "\n" );
- #endif
-
- Advance();
- delete this;
- return sal_True;
- }
-
- InitProfile();
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Executing Slot: " );
- m_pDbgWin->AddText( String::CreateFromInt32( nFunctionId ) );
- m_pDbgWin->AddText( "\n" );
-#endif
-
- PopupMenu *pPopup = NULL;
- MenuBar *pMenuBar = NULL;
- Menu *pMenu;
-
- GetCurrentMenues( pPopup, pMenuBar, pMenu );
- if ( pPopup )
- {
- if ( !bMenuClosed )
- {
- pPopup->EndExecute(0);
- aSubMenuId1 = 0;
- aSubMenuId2 = 0;
- aSubMenuId3 = 0;
- pMenuWindow = NULL;
- bMenuClosed = sal_True;
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Closed contextmenu\n" );
-#endif
- return sal_False;
- }
- else if ( nRetryCount-- )
- {
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Waiting for contextmenu to close\n" );
-#endif
- return sal_False;
- }
- else
- ReportError( GEN_RES_STR0( S_MENU_NOT_CLOSING ) );
- }
-
- Advance();
-
- if ( !IsError )
- {
- if ( ( nAnzahl == 0 && !getenv("OLDSLOTHANDLING") ) || aArgs.hasElements() )
- { // trying to call slots via uno
- AddReferer();
- if ( !aUnoUrl.Len() )
- aUnoUrl = CUniString("slot:").Append( String::CreateFromInt32( nFunctionId ) );
- ::com::sun::star::util::URL aTargetURL;
- aTargetURL.Complete = aUnoUrl;
- Reference < XFramesSupplier > xDesktop = Reference < XFramesSupplier >( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.frame.Desktop") ), UNO_QUERY );
- Reference < XFrame > xFrame;
-
- if ( xDesktop.is() )
- {
- xFrame = xDesktop->getActiveFrame();
- if ( !xFrame.is() )
- {
- Reference < XFrames > xFrames;
- xFrames = xDesktop->getFrames();
- if ( xFrames.is() && xFrames->getCount() > 0 )
- {
- Any aFrame = xFrames->getByIndex( xFrames->getCount() -1 );
- aFrame >>= xFrame;
- }
- }
- if ( !xFrame.is() )
- {
- if ( GetFirstDocFrame() )
- GetFirstDocFrame()->ToTop();
- xFrame = xDesktop->getActiveFrame();
- }
- }
-
- if ( xFrame.is() )
- xDesktop = Reference < XFramesSupplier >( xFrame, UNO_QUERY );
- else
- xDesktop.clear();
-
- while ( xDesktop.is() && xDesktop->getActiveFrame().is() )
- {
- xFrame = xDesktop->getActiveFrame();
-#if OSL_DEBUG_LEVEL > 1
- ::rtl::OUString aName;
- if ( xFrame.is() )
- aName = xFrame->getName();
-#endif
- xDesktop = Reference < XFramesSupplier >( xFrame, UNO_QUERY );
- }
-
- if ( !xFrame.is() )
- ReportError( GEN_RES_STR1( S_UNO_URL_EXECUTE_FAILED_NO_FRAME, aTargetURL.Complete ) );
- else
- {
- Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.util.URLTransformer" )), UNO_QUERY );
- xTrans->parseStrict( aTargetURL );
-
- Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY );
- Reference < XDispatch > xDisp;
- while ( xProv.is() && !xDisp.is() )
- {
- xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString(), 0 );
- if ( !xDisp.is() )
- {
- xFrame = Reference < XFrame > ( xFrame->getCreator(), UNO_QUERY );
- xProv = Reference < XDispatchProvider > ( xFrame, UNO_QUERY );
- }
- }
-
- if ( xDisp.is() )
- {
- Reference < XStatusListener > xListener = ( XStatusListener* )new SlotStatusListener;
- xDisp->addStatusListener( xListener, aTargetURL );
- if ( static_cast< SlotStatusListener* >(xListener.get())->bEnabled )
- {
- if ( bIsSlotInExecute )
- ReportError( GEN_RES_STR0( S_SLOT_IN_EXECUTE ) );
- else
- {
- bIsSlotInExecute = sal_True;
- xDisp->dispatch( aTargetURL, aArgs );
- bIsSlotInExecute = sal_False;
- }
- }
- else
- ReportError( GEN_RES_STR1( S_UNO_URL_EXECUTE_FAILED_DISABLED, aTargetURL.Complete ) );
- xDisp->removeStatusListener( xListener, aTargetURL );
- }
- else
- ReportError( GEN_RES_STR1( S_UNO_URL_EXECUTE_FAILED_NO_DISPATCHER, aTargetURL.Complete ) );
- }
- }
- else
- {
- DirectLog( S_QAError, GEN_RES_STR0( S_DEPRECATED ) );
- if ( !pTTProperties )
- pTTProperties = new TTProperties();
-
- switch ( pTTProperties->ExecuteFunction( nFunctionId, pItemArr, EXECUTEMODE_DIALOGASYNCHRON | nUseBindings ) )
- {
- case TT_PR_ERR_NODISPATCHER:
- {
- ReportError( rtl::OString::valueOf((sal_Int32)nFunctionId), GEN_RES_STR0( S_SID_EXECUTE_FAILED_NO_DISPATCHER ) );
- }
- break;
- case TT_PR_ERR_NOEXECUTE:
- {
- ReportError( rtl::OString::valueOf((sal_Int32)nFunctionId), GEN_RES_STR0( S_SID_EXECUTE_FAILED ) );
- }
- break;
- }
- }
- }
-
-
-/* Neues Verfahren ab 334!
- Neue Methode zum einstellen, da� Modale Dialoge immer Asynchron aufgerufen werden
- und echter Returnwert, ob Slot geklappt hat
- und Testen ob Slot �berhaupt durch UI aufgerufen werden kann */
-
-
- SendProfile( SlotString( nFunctionId ) );
- delete this;
- return sal_True;
-}
-
-
-StatementUnoSlot::StatementUnoSlot(SCmdStream *pIn)
-{
- QueStatement( NULL );
-
- pIn->Read( aUnoUrl );
-
-#if OSL_DEBUG_LEVEL > 1
- StatementList::m_pDbgWin->AddText( "UnoUrl:" );
- StatementList::m_pDbgWin->AddText( aUnoUrl );
- StatementList::m_pDbgWin->AddText( "\n" );
-#endif
-
-}
-
-
-StatementCommand::StatementCommand( StatementList *pAfterThis, sal_uInt16 MethodId, sal_uInt16 Params, sal_uInt16 Nr1 )
-: nMethodId( MethodId )
-, nParams(Params)
-, nNr1(Nr1)
-, nNr2(0)
-, nNr3(0)
-, nNr4(0)
-, aString1()
-, aString2()
-, bBool1(sal_False)
-, bBool2(sal_False)
-{
- nLNr1_and_Pointer.pWindow = 0;
-
- QueStatement( pAfterThis );
-
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Directly adding Conmmand:" );
- m_pDbgWin->AddText( " Methode: " );
- m_pDbgWin->AddText( String::CreateFromInt32( nMethodId ) );
- m_pDbgWin->AddText( " Params:" );
- if( nParams & PARAM_UINT16_1 ) {m_pDbgWin->AddText( " n1:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr1 ) );}
- if( nParams & PARAM_UINT16_2 ) {m_pDbgWin->AddText( " n2:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr2 ) );}
- if( nParams & PARAM_UINT16_3 ) {m_pDbgWin->AddText( " n3:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr3 ) );}
- if( nParams & PARAM_UINT16_4 ) {m_pDbgWin->AddText( " n4:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr4 ) );}
- if( nParams & PARAM_UINT32_1 ) {m_pDbgWin->AddText( " nl1:" );m_pDbgWin->AddText( String::CreateFromInt64( nLNr1 ) );}
- if( nParams & PARAM_STR_1 ) {m_pDbgWin->AddText( " s1:" );m_pDbgWin->AddText( aString1 );}
- if( nParams & PARAM_STR_2 ) {m_pDbgWin->AddText( " s2:" );m_pDbgWin->AddText( aString2 );}
- if( nParams & PARAM_BOOL_1 ) {m_pDbgWin->AddText( " b1:" );m_pDbgWin->AddText( bBool1 ? "TRUE" : "FALSE" );}
- if( nParams & PARAM_BOOL_2 ) {m_pDbgWin->AddText( " b2:" );m_pDbgWin->AddText( bBool2 ? "TRUE" : "FALSE" );}
- m_pDbgWin->AddText( "\n" );
-#endif
-}
-
-
-StatementCommand::StatementCommand( SCmdStream *pCmdIn )
-: nMethodId(0)
-, nParams(0)
-, nNr1(0)
-, nNr2(0)
-, nNr3(0)
-, nNr4(0)
-, aString1()
-, aString2()
-, bBool1(sal_False)
-, bBool2(sal_False)
-{
- nLNr1_and_Pointer.pWindow = 0;
-
- QueStatement( NULL );
- pCmdIn->Read( nMethodId );
- pCmdIn->Read( nParams );
-
- if( nParams & PARAM_UINT16_1 ) pCmdIn->Read( nNr1 );
- if( nParams & PARAM_UINT16_2 ) pCmdIn->Read( nNr2 );
- if( nParams & PARAM_UINT16_3 ) pCmdIn->Read( nNr3 );
- if( nParams & PARAM_UINT16_4 ) pCmdIn->Read( nNr4 );
- if( nParams & PARAM_UINT32_1 ) pCmdIn->Read( nLNr1_and_Pointer.nLNr1 );
- if( nParams & PARAM_STR_1 ) pCmdIn->Read( aString1 );
- if( nParams & PARAM_STR_2 ) pCmdIn->Read( aString2 );
- if( nParams & PARAM_BOOL_1 ) pCmdIn->Read( bBool1 );
- if( nParams & PARAM_BOOL_2 ) pCmdIn->Read( bBool2 );
-
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Reading Conmmand:" );
- m_pDbgWin->AddText( " Methode: " );
- m_pDbgWin->AddText( String::CreateFromInt32( nMethodId ) );
- m_pDbgWin->AddText( " Params:" );
- if( nParams & PARAM_UINT16_1 ) {m_pDbgWin->AddText( " n1:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr1 ) );}
- if( nParams & PARAM_UINT16_2 ) {m_pDbgWin->AddText( " n2:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr2 ) );}
- if( nParams & PARAM_UINT16_3 ) {m_pDbgWin->AddText( " n3:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr3 ) );}
- if( nParams & PARAM_UINT16_4 ) {m_pDbgWin->AddText( " n4:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr4 ) );}
- if( nParams & PARAM_UINT32_1 ) {m_pDbgWin->AddText( " nl1:" );m_pDbgWin->AddText( String::CreateFromInt64( nLNr1 ) );}
- if( nParams & PARAM_STR_1 ) {m_pDbgWin->AddText( " s1:" );m_pDbgWin->AddText( aString1 );}
- if( nParams & PARAM_STR_2 ) {m_pDbgWin->AddText( " s2:" );m_pDbgWin->AddText( aString2 );}
- if( nParams & PARAM_BOOL_1 ) {m_pDbgWin->AddText( " b1:" );m_pDbgWin->AddText( bBool1 ? "TRUE" : "FALSE" );}
- if( nParams & PARAM_BOOL_2 ) {m_pDbgWin->AddText( " b2:" );m_pDbgWin->AddText( bBool2 ? "TRUE" : "FALSE" );}
- m_pDbgWin->AddText( "\n" );
-#endif
-
- if ( nMethodId == RC_AppAbort )
- {
- #if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "*Deleting all Commands:\n" );
- #endif
- bReadingCommands = sal_False;
- while ( StatementList::pFirst != this ) // Alles L�schen au�er mich selbst
- {
- StatementList *pDeQue = StatementList::pFirst;
- pDeQue->Advance();
- delete pDeQue;
- }
- bReadingCommands = sal_True;
- #if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "*Done deleting all Commands:\n" );
- #endif
- }
-
-}
-
-void StatementCommand::WriteControlData( Window *pBase, sal_uLong nConf, sal_Bool bFirst )
-{
-
- if ( IsDialog(pBase) && !bFirst )
- return;
-
- if ( bFirst )
- pRet->GenReturn ( RET_WinInfo, rtl::OString(), (comm_UINT32)nConf | DH_MODE_DATA_VALID, UniString(), sal_True );
-
- if ( bFirst )
- {
- if ( pBase->GetType() == WINDOW_WINDOW && pBase->GetParent() && pBase->GetParent()->GetType() == WINDOW_CONTROL &&
- dynamic_cast< svt::table::TableControl* > ( pBase->GetParent() ) )
- pBase = pBase->GetParent();
- }
-
- { // Klammerung, so da� der String nicht w�hrend der Rekursion bestehen bleibt
- String aName;
- sal_Bool bSkip = sal_False;
-
- switch ( pBase->GetType() )
- {
- case WINDOW_RADIOBUTTON:
- case WINDOW_CHECKBOX:
- case WINDOW_TRISTATEBOX:
- case WINDOW_PUSHBUTTON:
- case WINDOW_OKBUTTON:
- case WINDOW_CANCELBUTTON:
- case WINDOW_IMAGERADIOBUTTON:
- case WINDOW_IMAGEBUTTON:
- case WINDOW_MENUBUTTON:
- case WINDOW_MOREBUTTON:
- case WINDOW_TABPAGE:
- case WINDOW_MODALDIALOG:
- case WINDOW_FLOATINGWINDOW:
- case WINDOW_MODELESSDIALOG:
- case WINDOW_WORKWINDOW:
- case WINDOW_DOCKINGWINDOW:
- case WINDOW_CONTROL:
-
- case WINDOW_FILEDIALOG:
- case WINDOW_PATHDIALOG:
- case WINDOW_PRINTDIALOG:
- case WINDOW_PRINTERSETUPDIALOG:
- case WINDOW_COLORDIALOG:
- case WINDOW_TABDIALOG:
-
- case WINDOW_BUTTONDIALOG:
-
- case WINDOW_MENUBARWINDOW:
- aName = pBase->GetText().EraseAllChars('~');
- break;
-
- case WINDOW_EDIT:
- case WINDOW_MULTILINEEDIT:
- case WINDOW_MULTILISTBOX:
- case WINDOW_LISTBOX:
- case WINDOW_COMBOBOX:
- case WINDOW_SPINFIELD:
- case WINDOW_PATTERNFIELD:
- case WINDOW_NUMERICFIELD:
- case WINDOW_METRICFIELD:
- case WINDOW_CURRENCYFIELD:
- case WINDOW_DATEFIELD:
- case WINDOW_TIMEFIELD:
- case WINDOW_NUMERICBOX:
- case WINDOW_METRICBOX:
- case WINDOW_CURRENCYBOX:
- case WINDOW_DATEBOX:
- case WINDOW_TIMEBOX:
- case WINDOW_PATTERNBOX:
- case WINDOW_TOOLBOX:
- aName = pBase->GetQuickHelpText();
- break;
-
- case WINDOW_MESSBOX:
- case WINDOW_INFOBOX:
- case WINDOW_WARNINGBOX:
- case WINDOW_ERRORBOX:
- case WINDOW_QUERYBOX:
- aName = ((MessBox*)pBase)->GetMessText();
- break;
-
- default:
- if ( ( pBase->GetUniqueOrHelpId().getLength() == 0 ) && !( nConf & DH_MODE_ALLWIN ) )
- bSkip = sal_True;
- break;
- }
-
- if ( !bSkip )
- {
- if ( aName.Len() == 0 )
- aName = pBase->GetQuickHelpText();
- if ( aName.Len() == 0 )
- aName = pBase->GetHelpText();
- if ( aName.Len() == 0 )
- aName = pBase->GetText();
-
-
- String aTypeSuffix;
- if ( pBase->GetType() == WINDOW_CONTROL )
- {
- if ( dynamic_cast< EditBrowseBox* >(pBase) )
- aTypeSuffix.AppendAscii( "/BrowseBox", 10 );
- else if ( dynamic_cast< ValueSet* >(pBase) )
- aTypeSuffix.AppendAscii( "/ValueSet", 9 );
- else if ( dynamic_cast< ORoadmap* >(pBase) )
- aTypeSuffix.AppendAscii( "/RoadMap", 8 );
- else if ( dynamic_cast< IExtensionListBox* >(pBase) )
- aTypeSuffix.AppendAscii( "/ExtensionListBox" );
- else if ( dynamic_cast< svt::table::TableControl* >(pBase) )
- aTypeSuffix.AppendAscii( "/TableControl" );
- else
- aTypeSuffix.AppendAscii( "/Unknown", 8 );
- }
-
- rtl::OString aId = pBase->GetUniqueOrHelpId();
- pRet->GenReturn ( RET_WinInfo, aId, (comm_UINT32)pBase->GetType(),
- TypeString(pBase->GetType()).Append(aTypeSuffix).AppendAscii(": ").Append(aName), sal_False );
-
-
- if ( pBase->GetType() == WINDOW_TOOLBOX ) // Buttons und Controls auf Toolboxen.
- {
- ToolBox *pTB = ((ToolBox*)pBase);
- sal_uInt16 i;
- for ( i = 0; i < pTB->GetItemCount() ; i++ )
- {
- aName = String();
- if ( aName.Len() == 0 )
- aName = pTB->GetHelpText( pTB->GetItemId( i ) );
- if ( aName.Len() == 0 )
- aName = pTB->GetItemText( pTB->GetItemId( i ) );
-
- Window *pItemWin;
- pItemWin = pTB->GetItemWindow( pTB->GetItemId( i ) );
- if ( pTB->GetItemType( i ) == TOOLBOXITEM_BUTTON && ( !pItemWin || !pItemWin->IsVisible() ) )
- {
- if ( pTB->GetItemCommand(pTB->GetItemId( i )).Len() || ( nConf & DH_MODE_ALLWIN ) )
- pRet->GenReturn ( RET_WinInfo, Str2Id(pTB->GetItemCommand(pTB->GetItemId( i ))), (comm_UINT32)WINDOW_BUTTON,
- TypeString(WINDOW_BUTTON).AppendAscii(": ").Append(aName), sal_False );
- if ( !pTB->GetItemCommand(pTB->GetItemId( i )).Len() || ( nConf & DH_MODE_ALLWIN ) )
- pRet->GenReturn ( RET_WinInfo, pTB->GetHelpId(pTB->GetItemId( i )), (comm_UINT32)WINDOW_BUTTON,
- TypeString(WINDOW_BUTTON).AppendAscii(": ").Append(aName), sal_False );
- }
- else
- {
- if ( pItemWin )
- {
- if ( pTB->GetItemCommand(pTB->GetItemId( i )).Len() || ( nConf & DH_MODE_ALLWIN ) )
- pRet->GenReturn ( RET_WinInfo, Str2Id(pTB->GetItemCommand(pTB->GetItemId( i ))), (comm_UINT32)pItemWin->GetType(),
- TypeString(pItemWin->GetType()).AppendAscii(": ").Append(aName), sal_False );
- if ( !pTB->GetItemCommand(pTB->GetItemId( i )).Len() || ( nConf & DH_MODE_ALLWIN ) )
- pRet->GenReturn ( RET_WinInfo, pTB->GetHelpId(pTB->GetItemId( i )), (comm_UINT32)pItemWin->GetType(),
- TypeString(pItemWin->GetType()).AppendAscii(": ").Append(aName), sal_False );
- sal_uInt16 ii;
- for( ii = 0 ; ii < pItemWin->GetChildCount(); ii++ )
- WriteControlData( pItemWin->GetChild(ii), nConf, sal_False );
- }
- else
- {
- if ( nConf & DH_MODE_ALLWIN )
- {
- String aToolBoxItemType;
- switch ( pTB->GetItemType( i ) )
- {
- case TOOLBOXITEM_DONTKNOW:
- aToolBoxItemType.AssignAscii("TOOLBOXITEM_DONTKNOW");
- break;
- case TOOLBOXITEM_BUTTON:
- aToolBoxItemType.AssignAscii("TOOLBOXITEM_BUTTON");
- break;
- case TOOLBOXITEM_SPACE:
- aToolBoxItemType.AssignAscii("TOOLBOXITEM_SPACE");
- break;
- case TOOLBOXITEM_SEPARATOR:
- aToolBoxItemType.AssignAscii("TOOLBOXITEM_SEPARATOR");
- break;
- case TOOLBOXITEM_BREAK:
- aToolBoxItemType.AssignAscii("TOOLBOXITEM_BREAK");
- break;
- default:
- OSL_TRACE( "Unknown TOOLBOXITEM %i", pTB->GetItemType( i ) );
- }
- if ( pTB->GetItemCommand(pTB->GetItemId( i )).Len() || ( nConf & DH_MODE_ALLWIN ) )
- pRet->GenReturn ( RET_WinInfo, Str2Id( pTB->GetItemCommand(pTB->GetItemId( i )) ), (comm_UINT32)WINDOW_BASE,
- aToolBoxItemType.AppendAscii(": ").Append(aName), sal_False );
- if ( !pTB->GetItemCommand(pTB->GetItemId( i )).Len() || ( nConf & DH_MODE_ALLWIN ) )
- pRet->GenReturn ( RET_WinInfo, pTB->GetHelpId(pTB->GetItemId( i )), (comm_UINT32)WINDOW_BASE,
- aToolBoxItemType.AppendAscii(": ").Append(aName), sal_False );
- }
- }
- }
- }
-
- return; // ToolBox ist hier schon komplett abgehandelt.
- }
-
-
- if ( pBase->GetType() == WINDOW_BUTTONDIALOG // Buttons auf Buttondialogen mit ID
- || pBase->GetType() == WINDOW_MESSBOX
- || pBase->GetType() == WINDOW_INFOBOX
- || pBase->GetType() == WINDOW_WARNINGBOX
- || pBase->GetType() == WINDOW_ERRORBOX
- || pBase->GetType() == WINDOW_QUERYBOX )
- {
- ButtonDialog *pBD = ((ButtonDialog*)pBase);
- sal_uInt16 i;
- for ( i = 0; i < pBD->GetButtonCount() ; i++ )
- {
- aName = String();
- if ( aName.Len() == 0 )
- aName = pBD->GetPushButton( pBD->GetButtonId(i) )->GetText();
- ByteString aID;
- switch ( pBD->GetButtonId(i) )
- {
- case BUTTONID_OK:
- aID.Assign("Ok");
- break;
- case BUTTONID_CANCEL:
- aID.Assign("Cancel");
- break;
- case BUTTONID_YES:
- aID.Assign("Yes");
- break;
- case BUTTONID_NO:
- aID.Assign("No");
- break;
- case BUTTONID_RETRY:
- aID.Assign("Retry");
- break;
- case BUTTONID_HELP:
- aID.Assign("Help");
- break;
- default:
- aID = rtl::OString::valueOf(
- static_cast<sal_Int32>(pBD->GetButtonId(i)));
- break;
- }
-
- pRet->GenReturn ( RET_WinInfo, aID, (comm_UINT32)pBD->GetPushButton( pBD->GetButtonId(i) )->GetType(), // So da� der Text angezeigt wird!
- TypeString(pBD->GetPushButton( pBD->GetButtonId(i) )->GetType()).AppendAscii(": ").Append(aName)
- .AppendAscii(" ButtonId = ").AppendAscii( aID.GetBuffer() ), sal_False );
- }
-
- return; // ButtonDialog ist hier schon komplett abgehandelt.
- }
-
-
- Menu* pMenu = GetMatchingMenu( pBase );
-
- if ( pMenu ) // Menus
- {
- sal_uInt16 i;
- for ( i = 0; i < pMenu->GetItemCount() ; i++ )
- {
- sal_uInt16 nID = pMenu->GetItemId( i );
-
- aName = String();
- if ( aName.Len() == 0 )
- aName = pMenu->GetHelpText( nID );
- if ( aName.Len() == 0 )
- aName = pMenu->GetItemText( nID );
-
-
- if ( pMenu->GetItemType( i ) == MENUITEM_STRING || pMenu->GetItemType( i ) == MENUITEM_IMAGE || pMenu->GetItemType( i ) == MENUITEM_STRINGIMAGE || (nConf & DH_MODE_ALLWIN) )
- {
- String aMenuItemType;
- switch ( pMenu->GetItemType( i ) )
- {
- case MENUITEM_STRING:
- aMenuItemType.AssignAscii("MENUITEM_STRING");
- break;
- case MENUITEM_STRINGIMAGE:
- aMenuItemType.AssignAscii("MENUITEM_STRINGIMAGE");
- break;
- case MENUITEM_IMAGE:
- aMenuItemType.AssignAscii("MENUITEM_IMAGE");
- break;
- case MENUITEM_SEPARATOR:
- aMenuItemType.AssignAscii("MENUITEM_SEPARATOR");
- break;
- case MENUITEM_DONTKNOW:
- aMenuItemType.AssignAscii("MENUITEM_DONTKNOW");
- break;
- default:
- OSL_TRACE( "Unknown MENUITEM %i", pMenu->GetItemType( i ) );
- }
- if ( pMenu->GetItemCommand(nID).Len() || ( nConf & DH_MODE_ALLWIN ) )
- pRet->GenReturn ( RET_WinInfo, Str2Id( pMenu->GetItemCommand(nID) ), (comm_UINT32)0,
- aMenuItemType.AppendAscii(": ").Append(aName), sal_False );
- if ( !pMenu->GetItemCommand(nID).Len() || ( nConf & DH_MODE_ALLWIN ) )
- pRet->GenReturn ( RET_WinInfo, rtl::OString::valueOf( (sal_Int32)nID ), (comm_UINT32)0,
- aMenuItemType.AppendAscii(": ").Append(aName), sal_False );
- }
- }
-
- return; // Menu ist hier schon komplett abgehandelt.
- }
- }
- }
-
- for( sal_uInt16 i = 0 ; i < pBase->GetChildCount(); i++ )
- WriteControlData( pBase->GetChild(i), nConf, sal_False );
-}
-
-class SysWinContainer : public WorkWindow
-{
-private:
- ToolBox *pClientWin;
- DockingWindow *pDock;
-public:
- SysWinContainer( ToolBox *pClient );
- ~SysWinContainer();
- virtual void Resize();
- virtual void Resizing( Size& rSize );
-};
-
-SysWinContainer::SysWinContainer( ToolBox *pClient )
-: WorkWindow( NULL, WB_BORDER | WB_SIZEMOVE | WB_CLOSEABLE )
-, pClientWin( pClient )
-{
- pDock = new DockingWindow( this );
- pClientWin->SetParent( pDock );
- pClientWin->SetFloatingMode( sal_False );
- SetText( pClient->GetText() );
- SetPosPixel( Point( 1,40 ) );
- Resize();
- pDock->Show();
- EnableAlwaysOnTop();
- Show();
-}
-
-SysWinContainer::~SysWinContainer()
-{
- delete pDock;
-}
-
-void SysWinContainer::Resize()
-{
- Size aSize( GetOutputSizePixel() );
- Resizing( aSize );
-
- if ( aSize != GetSizePixel() )
- {
- SetOutputSizePixel( aSize );
- pDock->SetSizePixel( aSize );
- pClientWin->SetSizePixel( aSize );
- }
-}
-
-void SysWinContainer::Resizing( Size& rSize )
-{
- Size aSize;
- Size aBestSize;
- sal_uInt16 i;
- sal_Bool bHasValue = sal_False;
- sal_uLong nBestValue = 0;
- sal_uLong nThisValue;
- for ( i=1 ; i<=1 ; i++ )
- {
- aSize = pClientWin->CalcWindowSizePixel( i );
- nThisValue = Abs( aSize.Width() - rSize.Width() ) + Abs( aSize.Height() - rSize.Height() );
- if ( !bHasValue || ( nThisValue < nBestValue ) )
- {
- nBestValue = nThisValue;
- aBestSize = aSize;
- bHasValue = sal_True;
- }
- }
- rSize = aBestSize;
-}
-
-
-class DisplayHidWin : public ToolBox
-{
- Edit *pEdit;
- Size aMinEditSize;
- sal_uInt16 nLastItemID;
- sal_Bool bIsDraging;
- sal_Bool bIsPermanentDraging;
- void SetDraging( sal_Bool bNewDraging );
- Image *pShow, *pShow2;
- sal_Bool bConfigChanged;
- void EnableButtons( sal_uLong nConf );
-
- sal_uLong nEventHookID;
- static long stub_VCLEventHookProc( NotifyEvent& rEvt, void* pData )
- {
- return ((DisplayHidWin*)pData)->VCLEventHook( rEvt );
- }
-
- long VCLEventHook( NotifyEvent& rEvt );
- Window *pLastMouseMoveWin;
-
- SysWinContainer *pContainer;
-
- // aborting by pressing shist twice
- sal_Bool bOldShift;
- Time aLatest;
- sal_uInt16 nShiftCount;
-
-public:
- DisplayHidWin();
- ~DisplayHidWin();
-
- virtual void Tracking( const TrackingEvent& rTEvt );
- virtual void Click();
- virtual void Select();
- virtual void SetText( const XubString& rStr );
-
- void SetDisplayText( const String &aNewText ){ pEdit->SetText(aNewText); }
- String GetDisplayText() const { return pEdit->GetText(); }
- sal_Bool IsDisplayTextModified() const { return pEdit->IsModified(); }
- void ClearDisplayTextModified() const { pEdit->ClearModifyFlag(); }
-
- void SetConfig( sal_uLong nConf );
- sal_uLong GetConfig();
-
- sal_Bool IsConfigChanged() { return bConfigChanged; }
- void ConfigSent() { bConfigChanged = sal_False; }
-
- sal_Bool IsSendData() { return GetItemState( TT_SEND_DATA ) == STATE_CHECK; }
-
- sal_Bool IsDraging() { return bIsDraging; }
-
- Window* LastMouseMoveWin() { return pLastMouseMoveWin; }
-};
-
-DisplayHidWin::DisplayHidWin()
-: ToolBox( StatementList::GetFirstDocFrame(), TTProperties::GetSvtResId(DisplayHidToolBox) )
-, bIsDraging( sal_False )
-, bIsPermanentDraging( sal_False )
-, pShow( NULL )
-, pShow2( NULL )
-, pLastMouseMoveWin( NULL )
-, bOldShift( 0 )
-, nShiftCount( 0 )
-{
- SetOutStyle( TOOLBOX_STYLE_HANDPOINTER | TOOLBOX_STYLE_FLAT );
- pEdit = new Edit( this, WB_CENTER | WB_BORDER );
- aMinEditSize = GetItemRect( TT_OUTPUT ).GetSize();
-/**/ aMinEditSize=Size(20,20);
- aMinEditSize.Width() *= 12;
- pEdit->SetSizePixel( aMinEditSize );
- pEdit->Show();
- SetItemWindow( TT_OUTPUT, pEdit );
- Resize();
- pContainer = new SysWinContainer( this );
- nEventHookID = Application::AddEventHook( stub_VCLEventHookProc, this );
-}
-
-DisplayHidWin::~DisplayHidWin()
-{
- Application::RemoveEventHook( nEventHookID );
- Hide(); // so GetFirstDocFrame won't return ourselves (needed for SOPlayer)
- SetParent( StatementList::GetFirstDocFrame() );
- delete pContainer;
- delete pEdit;
-}
-
-void DisplayHidWin::SetDraging( sal_Bool bNewDraging )
-{
- if ( !pShow )
- pShow = new Image( GetItemImage( TT_SHOW ) );
- if ( !pShow2 )
- pShow2 = new Image( Bitmap( TTProperties::GetSvtResId( TT_SHOW2 ) ) );
-
- if ( bNewDraging )
- SetItemImage( TT_SHOW, *pShow2 );
- else
- SetItemImage( TT_SHOW, *pShow );
-
- bIsDraging = bNewDraging;
-}
-
-void DisplayHidWin::EnableButtons( sal_uLong nConf )
-{
- sal_Bool bSend = sal_Bool(nConf & DH_MODE_SEND_DATA);
- EnableItem( TT_ALLWIN, bSend );
- EnableItem( TT_KURZNAME, bSend );
- EnableItem( TT_LANGNAME, bSend );
-}
-
-void DisplayHidWin::Tracking( const TrackingEvent& rTEvt )
-{
- if ( nLastItemID == TT_SHOW && GetItemState( TT_SHOW ) == STATE_NOCHECK )
- EndTracking( ENDTRACK_CANCEL );
- ToolBox::Tracking( rTEvt);
-}
-
-void DisplayHidWin::Click()
-{
- nLastItemID = GetCurItemId();
- if ( nLastItemID == TT_SHOW )
- {
- SetDraging( sal_True );
- }
- ToolBox::Click();
-}
-
-void DisplayHidWin::Select()
-{
- if ( GetItemState( GetCurItemId() ) == STATE_NOCHECK )
- {
- SetItemState( GetCurItemId(), STATE_CHECK );
- if ( GetCurItemId() == TT_SHOW )
- {
- bIsPermanentDraging = sal_True;
- SetDraging( sal_True );
- }
- }
- else
- {
- SetItemState( GetCurItemId(), STATE_NOCHECK );
- if ( GetCurItemId() == TT_SHOW )
- {
- bIsPermanentDraging = sal_False;
- SetDraging( sal_False );
- }
- }
- if ( GetCurItemId() == TT_SEND_DATA )
- {
- EnableButtons( GetConfig() );
- }
-}
-
-void DisplayHidWin::SetConfig( sal_uLong nConf )
-{
- SetItemState( TT_KURZNAME, ( nConf & DH_MODE_KURZNAME ) ? STATE_CHECK : STATE_NOCHECK );
- SetItemState( TT_LANGNAME, ( nConf & DH_MODE_LANGNAME ) ? STATE_CHECK : STATE_NOCHECK );
- SetItemState( TT_ALLWIN, ( nConf & DH_MODE_ALLWIN ) ? STATE_CHECK : STATE_NOCHECK );
- SetItemState( TT_SEND_DATA, ( nConf & DH_MODE_SEND_DATA ) ? STATE_CHECK : STATE_NOCHECK );
- EnableButtons( nConf );
-}
-
-sal_uLong DisplayHidWin::GetConfig()
-{
- sal_uLong nConf = 0;
- if ( GetItemState( TT_KURZNAME ) == STATE_CHECK )
- nConf |= DH_MODE_KURZNAME;
- if ( GetItemState( TT_LANGNAME ) == STATE_CHECK )
- nConf |= DH_MODE_LANGNAME;
- if ( GetItemState( TT_ALLWIN ) == STATE_CHECK )
- nConf |= DH_MODE_ALLWIN;
- if ( IsSendData() )
- nConf |= DH_MODE_SEND_DATA;
-
- return nConf;
-}
-
-void DisplayHidWin::SetText( const XubString& rStr )
-{
- pContainer->SetText( rStr );
-}
-
-long DisplayHidWin::VCLEventHook( NotifyEvent& rEvt )
-{
- if ( EVENT_MOUSEMOVE == rEvt.GetType() )
- {
- pLastMouseMoveWin = rEvt.GetWindow();
-
- // check if abort with pressing shift twice
- MouseEvent* pMEvt = (MouseEvent*)rEvt.GetMouseEvent();
-
- if ( ( pMEvt->IsShift() && !bOldShift ) ) // Shift pressed
- {
- if ( aLatest < Time() )
- {
- nShiftCount = 0;
- aLatest = Time()+Time( 0, 0, 0, 50 );
- }
- nShiftCount++;
- }
- if ( ( !pMEvt->IsShift() && bOldShift ) ) // Shift released
- {
- nShiftCount++;
- if ( nShiftCount == 4 && aLatest > Time() )
- {
- bIsPermanentDraging = sal_False;
- SetDraging( sal_False );
- SetItemState( TT_SHOW, STATE_NOCHECK );
- }
- }
- bOldShift = pMEvt->IsShift();
- }
- if ( ( ( EVENT_MOUSEBUTTONUP == rEvt.GetType() && rEvt.GetMouseEvent()->GetButtons() == MOUSE_LEFT) || ( EVENT_MOUSEMOVE == rEvt.GetType() && !rEvt.GetMouseEvent()->GetButtons() ) )
- && IsDraging() && !bIsPermanentDraging )
- SetDraging( sal_False );
- return 0;
-}
-
-
-sal_Bool StatementCommand::DisplayHID()
-{
- // Return sal_True -> reexecute command
-
- if ( !bBool2 ) // Wird auf sal_False initialisiert
- {
- bBool2 = sal_True; // Wir sind initialisiert.
- GetTTSettings()->pDisplayInstance = this; // Und haben die Macht (Alle anderen beenden sich)
-
- if ( !(nParams & PARAM_UINT32_1) )
- {
- if( GetTTSettings()->pDisplayHidWin ) // Nichts ver�ndern
- nLNr1_and_Pointer.nLNr1 = GetTTSettings()->pDisplayHidWin->GetConfig();
- else // Beim ersten Aufruf wollen wir alles richtig einstellen
- nLNr1_and_Pointer.nLNr1 = DH_MODE_KURZNAME | DH_MODE_LANGNAME;
-
- if( ((nParams & PARAM_BOOL_1) && bBool1) )
- nLNr1_and_Pointer.nLNr1 |= DH_MODE_SEND_DATA;
- else
- nLNr1_and_Pointer.nLNr1 &= ( ~DH_MODE_SEND_DATA );
- }
-
- if ( GetTTSettings()->pDisplayHidWin )
- GetTTSettings()->pDisplayHidWin->SetConfig( nLNr1_and_Pointer.nLNr1 );
- }
-
- if ( GetTTSettings()->pDisplayInstance && GetTTSettings()->pDisplayInstance != this )
- {
- DBG_WARNING("Mehrere DisplayHID am laufen");
- return sal_False; // Noch eine andere Instanz macht das gleiche!
- }
-
- if ( !GetTTSettings()->pDisplayHidWin )
- {
- GetTTSettings()->pDisplayHidWin = new DisplayHidWin();
- GetTTSettings()->aOriginalCaption = GetTTSettings()->pDisplayHidWin->GetText();
- GetTTSettings()->pDisplayHidWin->Show();
- if ( bBool1 )
- nLNr1_and_Pointer.nLNr1 |= DH_MODE_SEND_DATA;
- GetTTSettings()->pDisplayHidWin->SetConfig( nLNr1_and_Pointer.nLNr1 );
-
- GetTTSettings()->Old = NULL;
- GetTTSettings()->Act = NULL;
- GetTTSettings()->pDisplayInstance = this;
- }
- else
- {
- GetTTSettings()->pDisplayHidWin->GetWindow( WINDOW_OVERLAP )->Enable( sal_True, sal_True );
- GetTTSettings()->pDisplayHidWin->GetWindow( WINDOW_OVERLAP )->EnableInput( sal_True, sal_True );
- }
-
-
- if ( GetTTSettings()->pDisplayHidWin->IsVisible() && !bDying )
- {
-
- if ( GetTTSettings()->pDisplayHidWin->IsDraging() )
- {
-
-
-#define HIGHLIGHT_WIN( WinPtr ) \
- { \
- Color aLineColMem = WinPtr->GetLineColor(); \
- WinPtr->SetLineColor( Color( COL_WHITE ) ); \
- Color aFillColMem = WinPtr->GetFillColor(); \
- WinPtr->SetFillColor( Color( COL_LIGHTRED ) ); \
- RasterOp aROp = WinPtr->GetRasterOp(); \
- WinPtr->SetRasterOp( ROP_XOR ); \
- Size aSz = WinPtr->PixelToLogic( WinPtr->GetSizePixel() );\
- sal_uLong nMaxCornerRadius = WinPtr->PixelToLogic( Point( 80, 0 ) ).X();\
- sal_uLong iCorner = std::max ((sal_uLong) 8, (sal_uLong) std::min( nMaxCornerRadius, (sal_uLong) std::min((sal_uLong) (aSz.Width() / 6), (sal_uLong)(aSz.Height() / 6))));\
- WinPtr->DrawRect(Rectangle(Point(),aSz), iCorner, iCorner);\
- WinPtr->SetLineColor( aLineColMem ); \
- WinPtr->SetFillColor( aFillColMem ); \
- WinPtr->SetRasterOp( aROp ); \
- }
-
-
-#define SET_WIN( WinPtr ) \
- if ( StatementList::WinPtrValid(WinPtr) ) \
- { \
- HIGHLIGHT_WIN ( WinPtr ); \
- }
-
-#define RESET_WIN( WinPtr ) \
- if ( StatementList::WinPtrValid(WinPtr) ) \
- { \
- WinPtr->Invalidate( INVALIDATE_NOTRANSPARENT ); \
- WinPtr->Update(); \
- }
-
-
- GetTTSettings()->Old = GetTTSettings()->Act;
- GetTTSettings()->Act = GetTTSettings()->pDisplayHidWin->LastMouseMoveWin();
-
- if ( !StatementList::WinPtrValid ( GetTTSettings()->Old ) )
- GetTTSettings()->Old = NULL;
- if ( !StatementList::WinPtrValid ( GetTTSettings()->Act ) )
- GetTTSettings()->Act = NULL;
-
- if ( GetTTSettings()->Act && GetTTSettings()->Act->GetType() == WINDOW_BORDERWINDOW )
- GetTTSettings()->Act = GetTTSettings()->Act->GetWindow( WINDOW_CLIENT );
-
- if ( GetTTSettings()->Act != GetTTSettings()->Old )
- {
- if ( GetTTSettings()->Old )
- {
- RESET_WIN(GetTTSettings()->Old);
- }
- if ( GetTTSettings()->Act )
- {
- SET_WIN(GetTTSettings()->Act);
- GetTTSettings()->pDisplayHidWin->SetDisplayText( Id2Str(GetTTSettings()->Act->GetUniqueOrHelpId()).AppendAscii(" WinType: ")
- .Append(UniString::CreateFromInt64(GetTTSettings()->Act->GetType())).AppendAscii(" ").Append(GetTTSettings()->Act->GetText()));
- if ( GetTTSettings()->Act && !GetTTSettings()->Act->GetUniqueId().equals( GetTTSettings()->Act->GetHelpId() ) )
- GetTTSettings()->pDisplayHidWin->SetText(UniString( TTProperties::GetSvtResId( TT_ALTERNATE_CAPTION ) ).AppendAscii(GetTTSettings()->Act->GetHelpId().getStr()));
- else
- GetTTSettings()->pDisplayHidWin->SetText( GetTTSettings()->aOriginalCaption );
- }
- else
- GetTTSettings()->pDisplayHidWin->SetDisplayText(CUniString("Kein Window/Control gefunden"));
- }
- else if ( GetTTSettings()->Act )
- {
- // allow setting a HelpID manually (just enter the ID in the displayHID Window and terminate it by |
- if ( GetTTSettings()->pDisplayHidWin->IsDisplayTextModified() && GetTTSettings()->pDisplayHidWin->GetDisplayText().GetTokenCount( '|' ) > 1 )
- {
- GetTTSettings()->Act->SetUniqueId( Str2Id( GetTTSettings()->pDisplayHidWin->GetDisplayText().GetToken( '|' ) ) );
- GetTTSettings()->pDisplayHidWin->ClearDisplayTextModified();
- }
- }
-
- if ( GetTTSettings()->pDisplayHidWin->IsSendData() && GetTTSettings()->Act )
- {
- if ( !StatementFlow::bSending )
- { // Normalerweise syncronisierung �ber Protokoll. Hier ist das aber asyncron!!!
- WriteControlData( GetTTSettings()->Act, GetTTSettings()->pDisplayHidWin->GetConfig() );
- new StatementFlow( this, F_EndCommandBlock ); // Kommando zum Senden erzeugen und in que eintragen
- }
- }
- }
- else
- {
- if ( GetTTSettings()->Act )
- {
- RESET_WIN(GetTTSettings()->Act);
- GetTTSettings()->Act = NULL;
- }
- }
-
- if ( pFirst == this ) // Sollte immer so sein, aber besser isses
- if ( pNext ) // Befehle warten auf Ausf�hrung
- { // An Ende neu einsortieren
- Advance();
- QueStatement( NULL );
- }
- }
- else
- {
- delete GetTTSettings()->pDisplayHidWin;
- GetTTSettings()->pDisplayHidWin = NULL;
- GetTTSettings()->pDisplayInstance = NULL;
- }
-
- return GetTTSettings()->pDisplayHidWin != NULL;
-}
-
-class TranslateWin : public WorkWindow
-{
-private:
- DECL_LINK( DoAccept, PushButton* );
- DECL_LINK( DoNext, PushButton* );
- DECL_LINK( DoSelect, PushButton* );
- DECL_LINK( DoRestore, PushButton* );
- DECL_LINK( TranslationChanged, Edit* );
- DECL_LINK( ShowInplace, Timer* );
-
- Timer InplaceTimer;
-
- PushButton PushButtonTT_PB_NEXT;
- GroupBox GroupBoxTT_GB_TRANSLATION;
- Edit EditTT_E_NEW;
- GroupBox GroupBoxTT_GB_COMMENT;
- Edit EditTT_E_COMMENT;
- PushButton PushButtonTT_PB_ACCEPT;
- FixedText FixedTextTT_FT_OLD;
- PushButton PushButtonTT_PB_SELECT;
- PushButton PushButtonTT_PB_RESTORE;
-
- Window *Old;
- Window *Act;
- Window *pTranslateWin;
- sal_Bool bSelecting;
-
- sal_Bool bAvailable;
- sal_Bool bNext;
-
- sal_Bool TestChangedDataSaved();
-
-
- sal_uLong nEventHookID;
- static long stub_VCLEventHookProc( NotifyEvent& rEvt, void* pData )
- {
- return ((TranslateWin*)pData)->VCLEventHook( rEvt );
- }
-
- long VCLEventHook( NotifyEvent& rEvt );
-
-public:
- TranslateWin();
- ~TranslateWin();
-
- static String MarkShortcutErrors( Window* pBase, sal_Bool bMark );
-
- sal_Bool IsTranslationAvailable(){ return bAvailable; }
- sal_Bool IsNextDialog(){ return bNext; }
- void ResetNextDialog(){ bNext = sal_False; }
-
- Window* GetTranslationWindow(){ return pTranslateWin; }
- String GetOriginalText(){ return FixedTextTT_FT_OLD.GetText(); }
- String GetTranslationText(){ return EditTT_E_NEW.GetText(); }
- String GetComment(){ return EditTT_E_COMMENT.GetText(); }
-
- void EnableTranslation();
-};
-
-TranslateWin::TranslateWin()
-: WorkWindow( NULL, TTProperties::GetSvtResId( TT_INLINE_TRANSLATION ) )
-, PushButtonTT_PB_NEXT( this, TTProperties::GetSvtResId( TT_PB_NEXT ) )
-, GroupBoxTT_GB_TRANSLATION( this, TTProperties::GetSvtResId( TT_GB_TRANSLATION ) )
-, EditTT_E_NEW( this, TTProperties::GetSvtResId( TT_E_NEW ) )
-, GroupBoxTT_GB_COMMENT( this, TTProperties::GetSvtResId( TT_GB_COMMENT ) )
-, EditTT_E_COMMENT( this, TTProperties::GetSvtResId( TT_E_COMMENT ) )
-, PushButtonTT_PB_ACCEPT( this, TTProperties::GetSvtResId( TT_PB_ACCEPT ) )
-, FixedTextTT_FT_OLD( this, TTProperties::GetSvtResId( TT_FT_OLD ) )
-, PushButtonTT_PB_SELECT( this, TTProperties::GetSvtResId( TT_PB_SELECT ) )
-, PushButtonTT_PB_RESTORE( this, TTProperties::GetSvtResId( TT_PB_RESTORE ) )
-, Old( NULL )
-, Act( NULL )
-, pTranslateWin( NULL )
-, bSelecting( sal_False )
-, bAvailable( sal_False )
-, bNext( sal_False )
-{
- FreeResource();
- PushButtonTT_PB_NEXT.SetClickHdl( LINK( this, TranslateWin, DoNext ) );
- PushButtonTT_PB_ACCEPT.SetClickHdl( LINK( this, TranslateWin, DoAccept ) );
- PushButtonTT_PB_SELECT.SetClickHdl( LINK( this, TranslateWin, DoSelect ) );
- PushButtonTT_PB_RESTORE.SetClickHdl( LINK( this, TranslateWin, DoRestore ) );
- EditTT_E_NEW.SetModifyHdl( LINK( this, TranslateWin, TranslationChanged ) );
- InplaceTimer.SetTimeout( 250 );
- InplaceTimer.SetTimeoutHdl( LINK( this, TranslateWin, ShowInplace ) );
- EnableAlwaysOnTop();
- nEventHookID = Application::AddEventHook( stub_VCLEventHookProc, this );
-}
-
-TranslateWin::~TranslateWin()
-{
- Application::RemoveEventHook( nEventHookID );
-}
-
-sal_Bool TranslateWin::TestChangedDataSaved()
-{
- if ( ( EditTT_E_NEW.GetText().CompareTo( FixedTextTT_FT_OLD.GetText() ) != COMPARE_EQUAL
- || EditTT_E_COMMENT.GetText().Len() )
- && PushButtonTT_PB_ACCEPT.IsEnabled() )
- {
- return MessBox( this, TTProperties::GetSvtResId( TT_DISCARD_CHANGED_DATA ) ).Execute() == RET_YES;
- }
- else
- return sal_True;
-}
-
-IMPL_LINK( TranslateWin, DoAccept, PushButton*, EMPTYARG )
-{
- PushButtonTT_PB_SELECT.Disable();
- PushButtonTT_PB_NEXT.Disable();
- PushButtonTT_PB_RESTORE.Disable();
- EditTT_E_NEW.Disable();
- EditTT_E_COMMENT.Disable();
- PushButtonTT_PB_ACCEPT.Disable();
- bAvailable = sal_True;
- return 0;
-}
-
-IMPL_LINK( TranslateWin, DoNext, PushButton*, EMPTYARG )
-{
- if ( TestChangedDataSaved() )
- {
- PushButtonTT_PB_SELECT.Disable();
- PushButtonTT_PB_NEXT.Disable();
- PushButtonTT_PB_RESTORE.Disable();
- EditTT_E_NEW.Disable();
- EditTT_E_COMMENT.Disable();
- PushButtonTT_PB_ACCEPT.Disable();
- bNext = sal_True;
- }
- return 0;
-}
-
-IMPL_LINK( TranslateWin, DoSelect, PushButton*, EMPTYARG )
-{
- if ( bSelecting )
- {
- bSelecting = sal_False;
- }
- else
- {
- if ( TestChangedDataSaved() )
- {
- PushButtonTT_PB_RESTORE.Disable();
- bSelecting = sal_True;
- }
- }
- return 0;
-}
-
-IMPL_LINK( TranslateWin, DoRestore, PushButton*, EMPTYARG )
-{
- String sTT_E_OLD( FixedTextTT_FT_OLD.GetText());
- sTT_E_OLD.SearchAndReplaceAll( CUniString("\\n"), CUniString("\n") );
- sTT_E_OLD.SearchAndReplaceAll( CUniString("\\t"), CUniString("\t") );
-
- String sTT_E_NEW( EditTT_E_NEW.GetText());
- sTT_E_NEW.SearchAndReplaceAll( CUniString("\\n"), CUniString("\n") );
- sTT_E_NEW.SearchAndReplaceAll( CUniString("\\t"), CUniString("\t") );
-
- if ( StatementList::WinPtrValid( pTranslateWin ) && pTranslateWin->GetText().CompareTo( sTT_E_NEW ) == COMPARE_EQUAL )
- { // Im ersten schritt nur in der UI zur�ck
- pTranslateWin->SetText( sTT_E_OLD );
- }
- else
- { // Im zweite Schritt auch den eingegebenen Text
- EditTT_E_NEW.SetText( FixedTextTT_FT_OLD.GetText() );
- PushButtonTT_PB_RESTORE.Disable();
- }
- if ( StatementList::WinPtrValid( pTranslateWin ) )
- MarkShortcutErrors( pTranslateWin->GetWindow( WINDOW_OVERLAP ), sal_True );
- return 0;
-}
-
-IMPL_LINK( TranslateWin, TranslationChanged, Edit*, pEdit )
-{
- (void) pEdit; /* avoid warning about unused parameter */
- PushButtonTT_PB_RESTORE.Enable();
- InplaceTimer.Start();
- return 0;
-}
-
-IMPL_LINK( TranslateWin, ShowInplace, Timer*, EMPTYARG )
-{
- PushButtonTT_PB_RESTORE.Enable();
- if ( StatementList::WinPtrValid( pTranslateWin ) )
- {
- String sTT_E_NEW( EditTT_E_NEW.GetText());
- // alle CRs UnQuoten
- sTT_E_NEW.SearchAndReplaceAll( CUniString("\\n"), CUniString("\n") );
- // alle TABSs UnQuoten
- sTT_E_NEW.SearchAndReplaceAll( CUniString("\\t"), CUniString("\t") );
- pTranslateWin->SetText( sTT_E_NEW );
-
- MarkShortcutErrors( pTranslateWin->GetWindow( WINDOW_OVERLAP ), sal_True );
- }
- return 0;
-}
-
-long TranslateWin::VCLEventHook( NotifyEvent& rEvt )
-{
- if ( EVENT_MOUSEMOVE == rEvt.GetType() )
- {
- if ( bSelecting )
- {
- const MouseEvent *pMEvt = rEvt.GetMouseEvent();
- Old = Act;
- Act = rEvt.GetWindow();
-
- if ( Act )
- {
- Window *pWin = Act;
- sal_uInt16 i;
- for ( i = 0 ; i < Act->GetChildCount() ; i++ )
- {
- pWin = Act->GetChild(i);
- Rectangle aWinPosSize( pWin->GetPosPixel(), pWin->GetSizePixel() );
-
- if ( ( pWin->IsMouseTransparent() || !pWin->IsEnabled() ) && aWinPosSize.IsInside( pMEvt->GetPosPixel() ) )
- {
- Act = pWin;
- break;
- }
- }
- }
-
- if ( !StatementList::WinPtrValid ( Old ) )
- Old = NULL;
-
- if ( Act != Old )
- {
- if ( Old )
- {
- Window *pWin;
- if ( Old->IsMouseTransparent() && Old->GET_REAL_PARENT() )
- pWin = Old->GET_REAL_PARENT();
- else
- pWin = Old;
- RESET_WIN(pWin);
- }
- if ( Act )
- {
- SET_WIN(Act);
- FixedTextTT_FT_OLD.SetText( Act->GetText() );
- }
- else
- FixedTextTT_FT_OLD.SetText( String() );
- }
- else if ( Act )
- {
- }
- }
- else
- {
- if ( Act )
- {
- if ( Act->IsMouseTransparent() && Act->GET_REAL_PARENT() )
- Act = Act->GET_REAL_PARENT();
- RESET_WIN(Act);
- Act = NULL;
- }
- }
- }
- else if ( EVENT_MOUSEBUTTONUP == rEvt.GetType() )
- {
- if ( bSelecting )
- {
- pTranslateWin = Act;
- if ( pTranslateWin )
- {
- MarkShortcutErrors( pTranslateWin->GetWindow( WINDOW_OVERLAP ), sal_True );
- // alle CRs quoten (NF)
- String sTT_E_NEW( pTranslateWin->GetText());
- sTT_E_NEW.SearchAndReplaceAll( CUniString("\n"), CUniString("\\n") );
- // alle TABSs quoten ()
- sTT_E_NEW.SearchAndReplaceAll( CUniString("\t"), CUniString("\\t") );
-
- FixedTextTT_FT_OLD.SetText( sTT_E_NEW );
- EditTT_E_NEW.SetText( sTT_E_NEW );
- EditTT_E_NEW.Enable();
- EditTT_E_NEW.GrabFocus();
- EditTT_E_COMMENT.SetText( String() );
- EditTT_E_COMMENT.Enable();
- PushButtonTT_PB_ACCEPT.Enable();
- }
- bSelecting = sal_False;
- }
- }
-
- return 0;
-}
-
-#define FDS_ACTION_COLLECT 1
-#define FDS_ACTION_MARK 2
-#define FDS_ACTION_UNMARK 3
-
-class FindShortcutErrors: public Search
-{
- String aShortcuts,aDoubleShortcuts;
- sal_uInt16 nAction;
-public:
- FindShortcutErrors();
- virtual sal_Bool IsWinOK( Window *pWin );
- void SetAction( sal_uInt16 nA );
- String GetDoubleShortcuts() { return aDoubleShortcuts; }
-};
-
-FindShortcutErrors::FindShortcutErrors()
-: Search( SEARCH_NOOVERLAP | SEARCH_NO_TOPLEVEL_WIN )
-{
- SetAction( FDS_ACTION_COLLECT ); // Wir fange immer mit sammeln an, ODER??
-}
-
-void FindShortcutErrors::SetAction( sal_uInt16 nA )
-{
- nAction = nA;
- if ( FDS_ACTION_COLLECT == nAction )
- {
- aShortcuts = UniString();
- aDoubleShortcuts = UniString();
- }
-}
-
-sal_Bool FindShortcutErrors::IsWinOK( Window *pWin )
-{
- if ( pWin->IsReallyVisible() )
- {
- String aText = pWin->GetText();
- xub_StrLen nPos = aText.Search('~');
- String aShortcut;
- sal_Bool bHasAccel = sal_False;
- if ( nPos != STRING_NOTFOUND )
- {
- aShortcut = aText.Copy( nPos+1, 1 );
- aShortcut.ToLowerAscii();
- bHasAccel = aShortcut.Len() == 1;
- }
-
- switch ( nAction )
- {
- case FDS_ACTION_COLLECT:
- {
- if ( aShortcuts.Search( aShortcut ) != STRING_NOTFOUND )
- aDoubleShortcuts += aShortcut;
- else
- aShortcuts += aShortcut;
- }
- break;
- case FDS_ACTION_MARK:
- {
- sal_Bool bMissing = sal_False;
- if ( !bHasAccel && aText.Len() ) // should there be an accelarator defined
- {
-
- Window* pChild;
- pChild = pWin->GetWindow( WINDOW_CLIENT );
-
- if ( (pChild->GetType() == WINDOW_RADIOBUTTON) ||
- (pChild->GetType() == WINDOW_IMAGERADIOBUTTON) ||
- (pChild->GetType() == WINDOW_CHECKBOX) ||
- (pChild->GetType() == WINDOW_TRISTATEBOX) ||
- (pChild->GetType() == WINDOW_PUSHBUTTON) )
- {
- if ( !pChild->GetText().EqualsAscii( "..." ) )
- bMissing = sal_True;
- }
-
- if ( pChild->GetType() == WINDOW_FIXEDTEXT )
- {
- Window* pTempChild = pWin->GetWindow( WINDOW_NEXT );
- if ( pTempChild )
- pTempChild = pTempChild->GetWindow( WINDOW_CLIENT );
-
- if ( pTempChild && pChild->GetText().Len() )
- {
- if ( (pTempChild->GetType() == WINDOW_EDIT) ||
- (pTempChild->GetType() == WINDOW_MULTILINEEDIT) ||
- (pTempChild->GetType() == WINDOW_SPINFIELD) ||
- (pTempChild->GetType() == WINDOW_PATTERNFIELD) ||
- (pTempChild->GetType() == WINDOW_NUMERICFIELD) ||
- (pTempChild->GetType() == WINDOW_METRICFIELD) ||
- (pTempChild->GetType() == WINDOW_CURRENCYFIELD) ||
- (pTempChild->GetType() == WINDOW_DATEFIELD) ||
- (pTempChild->GetType() == WINDOW_TIMEFIELD) ||
- (pTempChild->GetType() == WINDOW_LISTBOX) ||
- (pTempChild->GetType() == WINDOW_MULTILISTBOX) ||
- (pTempChild->GetType() == WINDOW_COMBOBOX) ||
- (pTempChild->GetType() == WINDOW_PATTERNBOX) ||
- (pTempChild->GetType() == WINDOW_NUMERICBOX) ||
- (pTempChild->GetType() == WINDOW_METRICBOX) ||
- (pTempChild->GetType() == WINDOW_CURRENCYBOX) ||
- (pTempChild->GetType() == WINDOW_DATEBOX) ||
- (pTempChild->GetType() == WINDOW_TIMEBOX) )
- {
- bMissing = sal_True;
- }
- }
- }
- }
-
- if ( bHasAccel && aDoubleShortcuts.Search( aShortcut ) != STRING_NOTFOUND )
- {
- if ( pWin->GetType() == WINDOW_GROUPBOX )
- pWin->SetControlForeground( Color( COL_LIGHTRED ) );
- else
- {
- pWin->SetControlBackground();
- Color aCol(COL_GRAY);
- aCol.SetRed( 0xff );
- pWin->SetControlBackground( aCol );
- }
- }
- else if ( bMissing )
- {
- pWin->SetControlBackground();
- Color aCol(COL_GRAY);
- aCol.SetRed( 0xff );
- aCol.SetGreen( 0xff );
- pWin->SetControlBackground( aCol );
- }
- else
- {
- pWin->SetControlForeground();
- pWin->SetControlBackground();
- }
- }
- break;
- case FDS_ACTION_UNMARK:
- {
- pWin->SetControlForeground();
- pWin->SetControlBackground();
- }
- break;
- }
- }
- else
- if ( FDS_ACTION_MARK == nAction || FDS_ACTION_UNMARK == nAction )
- {
- pWin->SetControlForeground();
- pWin->SetControlBackground();
- }
-
- return sal_False;
-}
-
-String TranslateWin::MarkShortcutErrors( Window* pBase, sal_Bool bMark )
-{
- if ( pBase )
- {
- FindShortcutErrors aFinder;
- if ( bMark )
- {
- StatementList::SearchAllWin( pBase, aFinder, sal_True ); // collect Shortcuts first
- aFinder.SetAction( FDS_ACTION_MARK );
- }
- else
- aFinder.SetAction( FDS_ACTION_UNMARK );
- StatementList::SearchAllWin( pBase, aFinder, sal_True );
- return aFinder.GetDoubleShortcuts();
- }
- return UniString();
-}
-
-void TranslateWin::EnableTranslation()
-{
- PushButtonTT_PB_SELECT.Enable();
- PushButtonTT_PB_NEXT.Enable();
- bAvailable = sal_False;
- bNext = sal_False;
-}
-
-void StatementCommand::Translate()
-{
- // Es wurde eine initale UniqueId mitgegeben. Dann nur die dopelten Shortcuts liefern
- if( (nParams & PARAM_STR_1) && nLNr1_and_Pointer.nLNr1 )
- {
- String aDouble;
- Window *pWin = SearchTree( Str2Id( aString1 ) ,sal_False );
- if ( pWin )
- {
- pWin = pWin->GetWindow( WINDOW_OVERLAP );
- aDouble = TranslateWin::MarkShortcutErrors( pWin, sal_True );
- }
- pRet->GenReturn ( RET_Value, nMethodId, aDouble );
- return;
- }
-
- if ( !GetTTSettings()->pTranslateWin )
- {
- GetTTSettings()->pTranslateWin = new TranslateWin;
- GetTTSettings()->bToTop = sal_True;
- }
-
- GetTTSettings()->pTranslateWin->Show();
- if ( GetTTSettings()->bToTop )
- {
- GetTTSettings()->pTranslateWin->ToTop();
- GetTTSettings()->bToTop = sal_False;
- }
-
- GetTTSettings()->pTranslateWin->GetWindow( WINDOW_OVERLAP )->EnableInput( sal_True, sal_True );
-
- if ( GetTTSettings()->pTranslateWin->IsTranslationAvailable() )
- {
- String aTranslation;
- Window* pTranslationWindow = GetTTSettings()->pTranslateWin->GetTranslationWindow();
-
- DBG_ASSERT( pTranslationWindow, "Kein Translation Window" );
-
- if ( WinPtrValid( pTranslationWindow ) )
- {
- if ( pTranslationWindow->GetType() == WINDOW_BORDERWINDOW && pTranslationWindow->GetWindow( WINDOW_CLIENT ) )
- {
- Window* pNew = pTranslationWindow->GetWindow( WINDOW_CLIENT );
- // Bei Dockingwindoes das kanze Geraffel von Docking Floating �berspringen
- while ( IsDialog( pNew ) && !pNew->GetUniqueOrHelpId().getLength() && pNew->GetChildCount() == 1 )
- pNew = pNew->GetChild( 0 );
- pTranslationWindow = pNew;
- }
-
- aTranslation = CUniString("0;");
-
- aTranslation += Id2Str( pTranslationWindow->GetUniqueOrHelpId() );
- aTranslation += ';';
-
- aTranslation += TypeString( pTranslationWindow->GetType() );
- aTranslation += ';';
-
- Window* pParentDialog = pTranslationWindow;
- while ( pParentDialog && !IsDialog( pParentDialog ) )
- {
- pParentDialog = pParentDialog->GET_REAL_PARENT();
- }
-
- if ( pParentDialog )
- {
- aTranslation += Id2Str(pParentDialog->GetUniqueOrHelpId());
- aTranslation += ';';
- aTranslation += TypeString( pParentDialog->GetType() );
- }
- else
- aTranslation.AppendAscii( "0;" ); // Zahl + leerer String
- aTranslation += ';';
-
- aTranslation += '\"';
- aTranslation += GetTTSettings()->pTranslateWin->GetOriginalText();
- aTranslation += '\"';
-
- aTranslation += ';';
-
- aTranslation += '\"';
- aTranslation += GetTTSettings()->pTranslateWin->GetTranslationText();
- aTranslation += '\"';
-
- aTranslation += ';';
-
- aTranslation += '\"';
- aTranslation += GetTTSettings()->pTranslateWin->GetComment();
- aTranslation += '\"';
-
- // alle CRs quoten (NF)
- aTranslation.SearchAndReplaceAll( CUniString("\n"), CUniString("\\n") );
- // alle TABSs quoten ()
- aTranslation.SearchAndReplaceAll( CUniString("\t"), CUniString("\\t") );
-
- pRet->GenReturn ( RET_Value, nMethodId, aTranslation );
- GetTTSettings()->pTranslateWin->EnableTranslation();
- GetTTSettings()->bToTop = sal_True;
- }
- else
- {
- pRet->GenReturn ( RET_Value, nMethodId, String() );
- GetTTSettings()->pTranslateWin->EnableTranslation();
- ErrorBox err( GetTTSettings()->pTranslateWin, TTProperties::GetSvtResId( TT_NO_CONTROL ));
- err.Execute();
- GetTTSettings()->bToTop = sal_True;
- }
-
- }
- else if ( GetTTSettings()->pTranslateWin->IsNextDialog() )
- {
- pRet->GenReturn ( RET_Value, nMethodId, CUniString("1") );
- GetTTSettings()->pTranslateWin->ResetNextDialog();
- GetTTSettings()->pTranslateWin->LoseFocus();
- GetTTSettings()->bToTop = sal_True;
- }
- else
- {
- GetTTSettings()->pTranslateWin->EnableTranslation();
- pRet->GenReturn ( RET_Value, nMethodId, String() );
- }
-}
-
-Window* StatementCommand::GetNextOverlap( Window* pBase )
-{ // Findet irgendwelche Overlap-Fenster, die schlie�bar aussehen
- // Eventuell mu� noch die Auswahl verfeinert werden.
-
- if ( pBase->GetType() != WINDOW_BORDERWINDOW )
- pBase = pBase->GetWindow( WINDOW_OVERLAP );
-
- Window *pControl = NULL;
- if ( pBase->GetWindow( WINDOW_FIRSTOVERLAP ) )
- {
- pControl = GetNextOverlap( pBase->GetWindow( WINDOW_FIRSTOVERLAP ) );
- }
-
- if ( !pControl && pBase->GetWindow( WINDOW_NEXT ) )
- {
- pControl = GetNextOverlap( pBase->GetWindow( WINDOW_NEXT ) );
- }
-
- if ( !pControl )
- {
- Window *pTest = pBase->GetWindow( WINDOW_CLIENT );
- if ( IsAccessable (pTest)
- && pTest->IsEnabled()
- && pTest->IsVisible()
- && ((pTest->GetStyle() & WB_CLOSEABLE ) || (pBase->GetStyle() & WB_CLOSEABLE )) )
- return pTest;
- else
- return NULL;
- }
- else
- return pControl;
-}
-
-Window* StatementCommand::GetNextRecoverWin()
-{
- // �ber die TopLevelWindows der App iterieren
- Window* pBase = Application::GetFirstTopLevelWindow();
- Window *pControl = NULL;
- Window* pMyFirstDocFrame = NULL;
- while ( pBase )
- {
- // zuerst weitere Fenster auf dem Fenster suchen und schliessen
- pControl = GetNextOverlap( pBase );
- if ( pControl && pControl->GetType() == WINDOW_HELPTEXTWINDOW )
- {} // skip it
- else
- {
- if ( pControl && pControl->IsVisible() && !IsFirstDocFrame( pControl ) && !IsIMEWin( pControl ) )
- {
- Window* pTB = pControl->GetChild( 0 );
- if ( pControl->GetChildCount() == 1 && pTB->GetType() == WINDOW_TOOLBOX )
- ; // do not act on floating toolboxes #i38796
- else
- return pControl;
- }
-
- // dann das Fenster selbst Schliessen
- // erstes DocWin �berspringen
- // Assumption that Doc Windows are Borderwindows and ButtonDialog and such are not
- if ( pBase->IsVisible() && !IsFirstDocFrame( pBase ) && pBase->GetType() != WINDOW_BORDERWINDOW && !IsIMEWin( pBase ) )
- return pBase;
-
- if ( !pMyFirstDocFrame && IsFirstDocFrame( pBase ) )
- pMyFirstDocFrame = pBase;
- }
-
- pBase = Application::GetNextTopLevelWindow( pBase );
- }
- // close the FirstDocFrame last, It will not be closed, but the Document inside will be closed.
- if ( IsDocWin( pMyFirstDocFrame ) )
- return pMyFirstDocFrame;
-
- return NULL;
-}
-
-sal_Bool StatementCommand::Execute()
-{
- if ( IsError )
- {
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Skipping Command: " );
- m_pDbgWin->AddText( String::CreateFromInt32( nMethodId ) );
- m_pDbgWin->AddText( "\n" );
- #endif
-
- Advance();
- delete this;
- return sal_True;
- }
-
- InitProfile();
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Executing Command: " );
- m_pDbgWin->AddText( String::CreateFromInt32( nMethodId ) );
- m_pDbgWin->AddText( "\n" );
-#endif
-
-
-
-
-
-#if OSL_DEBUG_LEVEL > 1
-#define REPORT_WIN_CLOSED(pControl, aInfo) \
- _REPORT_WIN_CLOSED(pControl, aInfo) \
- m_pDbgWin->AddText( aInfo.AppendAscii(" \"").Append( pControl->GetText() ).AppendAscii("\" geschlossen, RType = ").Append( TypeString(pControl->GetType()) ).AppendAscii(", UId = ").Append( UIdString( pControl->GetUniqueOrHelpId() ) ) );
-#else
-#define REPORT_WIN_CLOSED(pControl, aInfo) _REPORT_WIN_CLOSED(pControl, aInfo)
-#endif
-
-#define REPORT_WIN_CLOSEDc(pControl, aInfo ) \
- REPORT_WIN_CLOSED(pControl, CUniString(aInfo) )
-
-#define _REPORT_WIN_CLOSED(pControl, aInfo) \
- if ( aString1.Len() ) \
- aString1 += '\n'; \
- aString1 += aInfo; \
- aString1.AppendAscii(" \""); \
- aString1 += pControl->GetText(); \
- aString1.AppendAscii("\" geschlossen, RType = ");\
- aString1 += TypeString(pControl->GetType()); \
- aString1.AppendAscii(", UId = "); \
- aString1 += UIdString(pControl->GetUniqueOrHelpId());
-
-
- switch ( nMethodId )
- {
- case RC_AppDelay:
- if ( !bBool1 )
- {
- nLNr1_and_Pointer.nLNr1 = Time().GetTime() + nNr1/10;
- bBool1 = sal_True;
- }
- if ( Time().GetTime() < sal_Int32(nLNr1_and_Pointer.nLNr1) ) // Aktuelle Zeit kleiner Endzeit
- return sal_False;
- break;
- case RC_DisplayHid:
- if ( DisplayHID() )
- return sal_False;
- break;
- case RC_ResetApplication:
- {
- if ( !bBool1 )
- {
- nRetryCount = 150; // das sollte reichen.
- bBool1 = sal_True; // Nur beim ersten mal!
- nNr1 = 1; // Welcher Button ist dran?
- nLNr1_and_Pointer.pWindow = 0; // Speichern des AppWin
- aString1 = UniString(); // Liste der geschlossenen Fenster
-
- // So da� nacher auch wieder alles auf Default steht
- nUseBindings = 0;
- bCatchGPF = sal_True;
- bUsePostEvents = sal_True;
-
- aSubMenuId1 = 0;
- aSubMenuId2 = 0;
- aSubMenuId3 = 0;
- pMenuWindow = NULL;
- }
- if ( !nRetryCount )
- ReportError( GEN_RES_STR0( S_RESETAPPLICATION_FAILED_COMPLEX ) );
-
- Window *pControl = GetNextRecoverWin();
-
- if ( pControl )
- {
- bBool2 = sal_False; // flag for wait when all windows are closed
- pControl->GrabFocus();
-
- if ( pControl->GetType() != WINDOW_DOCKINGWINDOW
- && pControl->GetType() != WINDOW_FLOATINGWINDOW
- && pControl->GetType() != WINDOW_MODELESSDIALOG
- && pControl->GetType() != WINDOW_WORKWINDOW
- && pControl->GetType() != WINDOW_TOOLBOX
- && pControl->GetType() != WINDOW_BORDERWINDOW
- && nRetryCount-- )
- {
- short nRT = ImpGetRType( pControl );
-
- if ( nRT == C_TabControl && pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_TABDIALOG )
- { // Bei Tabcontrol den zugeh�rigen Tabdialog nehmen
- pControl = pControl->GET_REAL_PARENT();
- nRT = ImpGetRType( pControl );
- }
-
- switch( nRT )
- {
- case C_ModalDlg:
- case C_Dialog:
- case C_TabDlg:
- REPORT_WIN_CLOSEDc(pControl, "Dialog");
- SET_WINP_CLOSING(pControl);
- ((SystemWindow*)pControl)->Close();
- break;
- case C_WorkWin:
- break;
- case C_MessBox:
- case C_InfoBox:
- case C_WarningBox:
- case C_ErrorBox:
- case C_QueryBox:
- case C_ButtonDialog:
- {
- ButtonDialog* pBD = (ButtonDialog*)pControl;
- // nNr1 >= 10 bedeutet (Custom)-Buttons durchgehen
- if ( nNr1 >= 10+pBD->GetButtonCount() ) nNr1 = 1;
- switch( nNr1 )
- {
- case 5:
- if ( pBD->GetPushButton( BUTTONID_OK ) )
- {
- REPORT_WIN_CLOSEDc(pControl, "Message Box (OK)");
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(RET_OK);
- }
- nNr1 = 10; // Nochmal alle Buttons der Reihe nach
- break;
- case 4:
- if ( pBD->GetPushButton( BUTTONID_CANCEL ) )
- {
- REPORT_WIN_CLOSEDc(pControl, "Message Box (Cancel)");
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(RET_CANCEL);
- }
- nNr1++;
- break;
- case 3:
- if ( pBD->GetPushButton( BUTTONID_YES ) )
- {
- REPORT_WIN_CLOSEDc(pControl, "Message Box (Yes)");
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(RET_YES);
- }
- nNr1++;
- break;
- case 2:
- case 1:
- if ( pBD->GetPushButton( BUTTONID_NO ) )
- {
- REPORT_WIN_CLOSEDc(pControl, "Message Box (No)");
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(RET_NO);
- }
- nNr1++;
- break;
- default:
- {
- sal_uInt16 nID = pBD->GetButtonId( nNr1-10 );
- if ( nID != BUTTONID_HELP )
- {
- REPORT_WIN_CLOSED(pControl, CUniString("Message Box (").Append( UniString::CreateFromInt32(nID) ).AppendAscii(")"));
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(nID);
- }
- nNr1++;
- }
- }
- break;
- }
- default:
- OSL_FAIL( "Unknown Windowtype" );
- REPORT_WIN_CLOSEDc(pControl, "Unknown Windowtype");
- ReportError( GEN_RES_STR0( S_RESETAPPLICATION_FAILED_UNKNOWN ), pControl->GetType() );
- #if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( " Unbekannter Objekttyp aus UId" );
- #endif
- break;
- }
- return sal_False;
- }
- else
- {
- if ( (pControl->GetType() == WINDOW_DOCKINGWINDOW || pControl->GetType() == WINDOW_TOOLBOX) && nRetryCount-- )
- {
- if ( (((DockingWindow*)pControl)->GetStyle() | ((DockingWindow*)pControl)->GetFloatStyle()) & WB_CLOSEABLE )
- {
- REPORT_WIN_CLOSED(pControl, TypeString(pControl->GetType()));
- SET_WINP_CLOSING(pControl);
- ((DockingWindow*)pControl)->Close();
-
- // Eigentlich nur bei TaskWindows! Hoffen wir mal, da� keine anderen DockingWindows dazwischen hauen.
- if ( nLNr1_and_Pointer.pWindow != pControl )
- nNr1 = 1; // Zum durchprobieren der Buttons beim Schlie�en
- nLNr1_and_Pointer.pWindow = pControl;
-
- return sal_False;
- }
- }
- if ( nRetryCount--
- && ( (pControl->GetType() == WINDOW_FLOATINGWINDOW)
- || (pControl->GetType() == WINDOW_MODELESSDIALOG)
- || (pControl->GetType() == WINDOW_WORKWINDOW)
- || (pControl->GetType() == WINDOW_BORDERWINDOW) ) )
- {
- // Special handling for last Document; do not close the Frame, only the Document
- if ( GetDocWinCount() == 1 && IsDocFrame( pControl ) )
- {
- if ( IsDocWin( pControl ) )
- {
- if ( GetDocFrameMenuBar( pControl ) )
- {
- MenuBar* pMenu = GetDocFrameMenuBar( pControl );
- if ( pMenu->HasCloser() )
- {
- REPORT_WIN_CLOSED( pControl, TypeString(pControl->GetType()));
- SET_WINP_CLOSING(pControl);
-
- pMenu->GetCloserHdl().Call( pMenu );
-
- // nur bei TaskWindows!
- if ( nLNr1_and_Pointer.pWindow != pControl )
- nNr1 = 1; // Zum durchprobieren der Buttons beim Schlie�en
- nLNr1_and_Pointer.pWindow = pControl;
-
- return sal_False;
- }
- }
- }
- }
- else
- {
- REPORT_WIN_CLOSED( pControl, TypeString(pControl->GetType()));
- SET_WINP_CLOSING(pControl);
- ((SystemWindow*)pControl)->Close();
-
- // Eigentlich nur bei TaskWindows!
- if ( nLNr1_and_Pointer.pWindow != pControl )
- nNr1 = 1; // Zum durchprobieren der Buttons beim Schlie�en
- nLNr1_and_Pointer.pWindow = pControl;
-
- return sal_False;
- }
- }
- }
- }
- // wait for some time if more windows show up
- // E.g.: Floating toolbars on a Task which was hidden by another Task before
- if ( !bBool2 )
- {
- nLNr1_and_Pointer.nLNr1 = Time().GetTime() + 100; // 100 = 1 Second
- bBool2 = sal_True;
- }
- if ( Time().GetTime() < sal_Int32(nLNr1_and_Pointer.nLNr1) ) // Aktuelle Zeit kleiner Endzeit
- return sal_False;
- else
- pRet->GenReturn ( RET_Value, nMethodId, aString1);
- }
- break;
- case RC_WaitSlot:
- {
- if ( ! (nParams & PARAM_UINT16_1) )
- nNr1 = 1000; // defaults to 1000 = 1 Sec.
- if ( !bBool1 )
- {
- nLNr1_and_Pointer.nLNr1 = Time().GetTime() + nNr1/10;
- bBool1 = sal_True;
- }
-
- if ( !bIsSlotInExecute )
- pRet->GenReturn ( RET_Value, nMethodId, comm_UINT16(CONST_WSFinished) );
- else
- {
- if ( Time().GetTime() < sal_Int32(nLNr1_and_Pointer.nLNr1) ) // Aktuelle Zeit kleiner Endzeit
- return sal_False;
- pRet->GenReturn ( RET_Value, nMethodId, comm_UINT16(CONST_WSTimeout) );
- }
- }
- break;
- }
-
-
- Advance();
-
-
- switch ( nMethodId )
- {
- case RC_AppDelay: // Diese Befehle werden anderswo behandelt
- case RC_DisplayHid:
- case RC_ResetApplication:
- case RC_WaitSlot:
-
- case RC_AppAbort: // Sofortiges L�schen aller Befehle
- break;
- case RC_Assert:
- {
- ByteString aAssertion( "Diese Assertion wurde vom Testtool per Befehl ausgel�st" );
- aAssertion = ByteString( String( aAssertion, RTL_TEXTENCODING_MS_1252 ), RTL_TEXTENCODING_UTF8 );
- DBG_ASSERT( !aString1.Len(), ByteString( aString1, RTL_TEXTENCODING_UTF8 ).GetBuffer() );
- DBG_ASSERT( aString1.Len(), aAssertion.GetBuffer() );
- OSL_ENSURE( !aString1.Len(), ByteString( aString1, RTL_TEXTENCODING_UTF8 ).GetBuffer() );
- OSL_ENSURE( aString1.Len(), aAssertion.GetBuffer() );
- }
- break;
- case RC_CaptureAssertions:
-#ifdef DBG_UTIL
- if( !(nParams & PARAM_BOOL_1) || bBool1 )
- {
- DBG_INSTOUTERROR( DBG_OUT_TESTTOOL );
- osl_setDebugMessageFunc( osl_TestToolDebugPrint );
- }
- else
- {
- DBG_INSTOUTERROR( DBG_OUT_MSGBOX );
- osl_setDebugMessageFunc( pOriginal_osl_DebugMessageFunc );
- }
-#endif
- break;
- case RC_Translate:
- Translate();
- break;
- case RC_ApplicationBusy:
- {
- sal_Bool bWait = sal_False;
- ReportError( GEN_RES_STR0( S_NO_ACTIVE_WINDOW ) );
- pRet->GenReturn ( RET_Value, nMethodId, bWait );
- break;
- }
- case RC_GetClipboard:
- {
- ::rtl::OUString aTemp;
- ::svt::OStringTransfer::PasteString( aTemp, GetFirstDocFrame() );
- pRet->GenReturn ( RET_Value, nMethodId, String( aTemp ) );
- }
- break;
- case RC_SetClipboard:
- ::svt::OStringTransfer::CopyString(aString1,GetFirstDocFrame());
- break;
- case RC_WinTree:
- pRet->GenReturn ( RET_Value, nMethodId, Tree( NULL, 0));
- break;
- #if OSL_DEBUG_LEVEL > 1
- case RC_NoDebug:
- m_pDbgWin->bQuiet = sal_True;
- m_pDbgWin->Hide();
- m_pDbgWin->Clear();
- break;
- case RC_Debug:
- m_pDbgWin->bQuiet = sal_False;
- m_pDbgWin->Show();
- break;
- #endif
- case RC_GPF:
- ((TabControl*)NULL)->SetCurPageId( 12345 );
- break;
- case RC_GetNextCloseWindow:
- {
- Window *pWin = GetActive( WINDOW_BASE ); // WINDOW_ANYTYPE
- if ( !pWin )
- ReportError( GEN_RES_STR0( S_NO_ACTIVE_WINDOW ) );
- else if ( !IsDialog(pWin) )
- ReportError( GEN_RES_STR0( S_NO_DIALOG_IN_GETACTIVE ) );
- else
- {
- pRet->GenReturn( RET_Value, nMethodId, Id2Str(pWin->GetUniqueOrHelpId()) );
- }
- }
- break;
- case RC_UseBindings:
- if( !(nParams & PARAM_BOOL_1) || bBool1 )
- nUseBindings = SFX_USE_BINDINGS;
- else
- nUseBindings = 0;
- break;
- case RC_Profile:
- // Bei folgenden Parametern passiert folgendes:
- // ein boolean=false Alles Profiling stoppen (Ergebnisse liefern)
- // ein boolean=true, 1-4 ints Einteilung der Zeiten in K�stchen
- // kein! boolean keine ints loggen jeden Befehls
- // kein! boolean 1 int loggen alle int Millisekunden
- // ein String wird in das Logfile �bernommen(sonst passiert nichts)
- if( !(nParams & PARAM_BOOL_1) || bBool1 )
- {
- if ( !pProfiler )
- {
- pProfiler = new TTProfiler;
- InitProfile();
- }
-
- if( !(nParams & PARAM_BOOL_1) && (nParams & PARAM_UINT16_1) )
- { // Autoprofiling: Profile nNr
- if ( pProfiler->IsProfilingPerCommand() )
- {
- pProfiler->StopProfilingPerCommand();
- }
- pProfiler->StartAutoProfiling( nNr1 );
-
- // Der Header ist abh�ngig vom Modus
- pRet->GenReturn( RET_ProfileInfo, 0, pProfiler->GetProfileHeader() );
- }
- else if ( nParams & PARAM_UINT16_1 )
- { // Partitioning initialisieren: Profile true [,nNr][,nNr][,nNr][,nNr]
- comm_UINT32 nAnzahl=0;
- if ( nParams & PARAM_UINT16_1 ) { nAnzahl++; };
- if ( nParams & PARAM_UINT16_2 ) { nAnzahl++; };
- if ( nParams & PARAM_UINT16_3 ) { nAnzahl++; };
- if ( nParams & PARAM_UINT16_4 ) { nAnzahl++; };
-
- // Hier werden die Parameter ans Testtool zur�ck �bertragen.
- // Das ist zwar etwas eigenartig, aber ansonsten m�sste man im Testtool
- // die einfache Struktur der Remotebefehle aufbrechen.
- pRet->GenReturn( RET_ProfileInfo, S_ProfileReset, nAnzahl );
-
- // Und die einzelnen Grenzen
- if ( nParams & PARAM_UINT16_1 ) { pRet->GenReturn( RET_ProfileInfo, S_ProfileBorder1, (comm_UINT32)nNr1 ); };
- if ( nParams & PARAM_UINT16_2 ) { pRet->GenReturn( RET_ProfileInfo, S_ProfileBorder2, (comm_UINT32)nNr2 ); };
- if ( nParams & PARAM_UINT16_3 ) { pRet->GenReturn( RET_ProfileInfo, S_ProfileBorder3, (comm_UINT32)nNr3 ); };
- if ( nParams & PARAM_UINT16_4 ) { pRet->GenReturn( RET_ProfileInfo, S_ProfileBorder4, (comm_UINT32)nNr4 ); };
-
- pProfiler->StartPartitioning();
- }
- else if( nParams == PARAM_STR_1 ) // Genau ein String!
- { // Nur einen String ins Profiling aufnehmen
- aString1 += '\n';
- pRet->GenReturn( RET_ProfileInfo, 0, aString1 );
- }
- else
- { // Normales Profiling je Kommando: profile
- if ( pProfiler->IsAutoProfiling() )
- {
- pRet->GenReturn( RET_ProfileInfo, 0, pProfiler->GetAutoProfiling() );
- pProfiler->StopAutoProfiling();
- }
- pProfiler->StartProfilingPerCommand();
-
- // Der Header ist abh�ngig vom Modus
- pRet->GenReturn( RET_ProfileInfo, 0, pProfiler->GetProfileHeader() );
- }
- }
- else // Profiling wieder ausschalten: Profile false
- if ( pProfiler )
- {
- if ( pProfiler->IsProfilingPerCommand() )
- pProfiler->StopProfilingPerCommand();
-
- if ( pProfiler->IsAutoProfiling() )
- {
- pRet->GenReturn( RET_ProfileInfo, 0, pProfiler->GetAutoProfiling() );
- pProfiler->StopAutoProfiling();
- }
-
- if ( pProfiler->IsPartitioning() )
- {
- pRet->GenReturn( RET_ProfileInfo, S_ProfileDump, (comm_UINT32)0 );
- pProfiler->StopPartitioning();
- }
-
- delete pProfiler;
- pProfiler = NULL;
- }
- break;
- case RC_MenuGetItemCount:
- case RC_MenuGetItemId:
- case RC_MenuGetItemPos:
- case RC_MenuIsSeperator:
- case RC_MenuIsItemChecked:
- case RC_MenuIsItemEnabled:
- case RC_MenuGetItemText:
- case RC_MenuGetItemCommand:
- case RC_MenuHasSubMenu:
- case RC_MenuSelect:
- {
- PopupMenu *pPopup = NULL;
- MenuBar *pMenuBar = NULL;
- Menu *pMenu;
-
- sal_uInt16 nErr = GetCurrentMenues( pPopup, pMenuBar, pMenu );
-
- if ( !pMenu )
- {
- if ( nErr == 1 )
- ReportError( GEN_RES_STR0( S_NO_POPUP ) );
- else
- ReportError( GEN_RES_STR0( S_NO_SUBMENU ) );
- break;
- }
-
- sal_uInt16 nItemCount = 0;
- switch ( nMethodId )
- {
- case RC_MenuGetItemCount:
- case RC_MenuGetItemId:
- case RC_MenuIsSeperator:
- {
- nItemCount = pMenu->GetItemCount();
- if ( pMenu->GetMenuFlags() & MENU_FLAG_HIDEDISABLEDENTRIES )
- { // jep, we have to adjust the count
- sal_Bool bLastWasSeperator = sal_True; // sal_True for Separator at the top
- for ( sal_uInt16 i = 0 ; i < pMenu->GetItemCount() ; i++ )
- {
- if ( !pMenu->IsItemEnabled( pMenu->GetItemId( i ) ) )
- nItemCount--;
- else
- {
- if ( pMenu->GetItemType( i ) == MENUITEM_SEPARATOR && bLastWasSeperator )
- nItemCount--;
- bLastWasSeperator = pMenu->GetItemType( i ) == MENUITEM_SEPARATOR;
- }
- }
- if ( bLastWasSeperator ) // Separator at bottom
- nItemCount--;
- }
- }
- break;
- }
-
- // for certain methods calculate the physical index (reinserting the hidden entries)
- sal_uInt16 nPhysicalIndex = 0;
- switch ( nMethodId )
- {
- case RC_MenuGetItemId:
- case RC_MenuIsSeperator:
- {
- nPhysicalIndex = nNr1;
- if ( pMenu->GetMenuFlags() & MENU_FLAG_HIDEDISABLEDENTRIES )
- { // jep, we have to adjust the position
- sal_Bool bLastWasSeperator = sal_True; // sal_True for Separator at the top
- sal_uInt16 nVisibleCount = 0;
- for ( sal_uInt16 i = 0 ; i < pMenu->GetItemCount() && nVisibleCount < nNr1 ; i++ )
- {
- if ( pMenu->IsItemEnabled( pMenu->GetItemId( i ) )
- && !( pMenu->GetItemType( i ) == MENUITEM_SEPARATOR && bLastWasSeperator ) )
- {
- nVisibleCount++;
- bLastWasSeperator = pMenu->GetItemType( i ) == MENUITEM_SEPARATOR;
- }
- else
- nPhysicalIndex++;
- }
- DBG_ASSERT( nVisibleCount == nNr1, "Adaption of Index failed: nVisibleCount != nNr1" );
- }
- }
- break;
- }
-
-
-
- switch ( nMethodId )
- {
- case RC_MenuGetItemCount:
- {
- pRet->GenReturn ( RET_Value, nMethodId, (comm_UINT32)nItemCount );
- }
- break;
- case RC_MenuGetItemId:
- {
- if ( ValueOK( rtl::OString(), RcString( nMethodId ),nNr1,nItemCount) )
- pRet->GenReturn ( RET_Value, nMethodId, (comm_UINT32)pMenu->GetItemId(nPhysicalIndex-1) );
- }
- break;
- case RC_MenuGetItemPos:
- {
- sal_uInt16 nLogicalPos = pMenu->GetItemPos(nNr1);
- if ( MENU_ITEM_NOTFOUND != nLogicalPos && pMenu->GetMenuFlags() & MENU_FLAG_HIDEDISABLEDENTRIES )
- { // jep, we have to adjust the position
- if ( !pMenu->IsItemEnabled( nNr1 ) )
- nLogicalPos = MENU_ITEM_NOTFOUND;
- else
- {
- sal_Bool bLastWasSeperator = sal_False;
- for ( int i = nLogicalPos ; i >= 0 ; i-- )
- {
- if ( !pMenu->IsItemEnabled( pMenu->GetItemId( sal::static_int_cast< sal_uInt16 >(i) ) ) ||
- ( pMenu->GetItemType( sal::static_int_cast< sal_uInt16 >(i) ) == MENUITEM_SEPARATOR && bLastWasSeperator ) )
- nLogicalPos--;
- bLastWasSeperator = pMenu->GetItemType( sal::static_int_cast< sal_uInt16 >(i) ) == MENUITEM_SEPARATOR;
- }
- }
- }
- pRet->GenReturn ( RET_Value, nMethodId, (comm_UINT32)(nLogicalPos+1) );
- }
- break;
- case RC_MenuIsSeperator:
- {
- if ( ValueOK( rtl::OString(), RcString( nMethodId ),nNr1,nItemCount) )
- pRet->GenReturn ( RET_Value, nMethodId, (comm_BOOL)(pMenu->GetItemType(nPhysicalIndex-1) == MENUITEM_SEPARATOR) );
- }
- break;
- case RC_MenuIsItemChecked:
- {
- pRet->GenReturn ( RET_Value, nMethodId, (comm_BOOL)pMenu->IsItemChecked(nNr1) );
- }
- break;
- case RC_MenuIsItemEnabled:
- {
- pRet->GenReturn ( RET_Value, nMethodId, (comm_BOOL)pMenu->IsItemEnabled(nNr1) );
- }
- break;
- case RC_MenuGetItemText:
- {
- pRet->GenReturn ( RET_Value, nMethodId, (String)pMenu->GetItemText(nNr1) );
- }
- break;
- case RC_MenuGetItemCommand:
- {
- pRet->GenReturn ( RET_Value, nMethodId, (String)pMenu->GetItemCommand(nNr1) );
- }
- break;
- case RC_MenuHasSubMenu:
- {
- pRet->GenReturn ( RET_Value, nMethodId, (sal_Bool)(pMenu->GetPopupMenu(nNr1) != NULL) );
- }
- break;
- case RC_MenuSelect:
- {
- if ( pMenu->GetPopupMenu(nNr1) )
- {
- if ( !aSubMenuId1 )
- aSubMenuId1 = nNr1;
- else if ( !aSubMenuId2 )
- aSubMenuId2 = nNr1;
- else if ( !aSubMenuId3 )
- aSubMenuId3 = nNr1;
-
- if ( pPopup )
- pPopup->SelectEntry(nNr1);
- else
- pMenuBar->SelectEntry(nNr1);
- }
- else
- {
- if ( pPopup )
- {
- pPopup->EndExecute(nNr1);
- aSubMenuId1 = 0;
- aSubMenuId2 = 0;
- aSubMenuId3 = 0;
- pMenuWindow = NULL;
- }
- else
- {
- pMenuBar->SelectEntry(nNr1);
- aSubMenuId1 = 0;
- aSubMenuId2 = 0;
- aSubMenuId3 = 0;
- pMenuWindow = NULL;
- }
- }
- }
- break;
- }
- }
- break;
- case RC_SetControlType:
- {
- DirectLog( S_QAError, GEN_RES_STR0( S_DEPRECATED ) );
- }
- break;
- case RC_Kill:
- case RC_RmDir:
- case RC_MkDir:
- case RC_FileCopy:
- case RC_Name:
- case RC_Dir:
- case RC_FileLen:
- case RC_FileDateTime:
- {
- long nErrorcode = FSYS_ERR_OK;
- switch ( nMethodId )
- {
- case RC_Kill:
- {
- DirEntry aFile( aString1 );
- nErrorcode = aFile.GetError();
- if ( FSYS_ERR_OK == nErrorcode && FileStat( aFile ).IsKind( FSYS_KIND_FILE ) )
- nErrorcode = aFile.Kill();
- else
- nErrorcode = FSYS_ERR_NOTAFILE;
- }
- break;
- case RC_RmDir:
- {
- DirEntry aDir( aString1 );
- nErrorcode = aDir.GetError();
- if ( FSYS_ERR_OK == nErrorcode && FileStat( aDir ).IsKind( FSYS_KIND_DIR ) )
- nErrorcode = aDir.Kill();
- else
- nErrorcode = FSYS_ERR_NOTADIRECTORY;
- }
- break;
- case RC_MkDir:
- {
- DirEntry aDir( aString1 );
- nErrorcode = aDir.GetError();
- if ( !nErrorcode && !aDir.MakeDir() )
- nErrorcode = FSYS_ERR_UNKNOWN;
- }
- break;
- case RC_FileCopy:
- {
- nErrorcode = DirEntry( aString1 ).CopyTo( DirEntry( aString2 ), FSYS_ACTION_COPYFILE );
- }
- break;
- case RC_Name:
- {
- nErrorcode = DirEntry( aString1 ).MoveTo( DirEntry( aString2 ) );
- }
- break;
- case RC_Dir:
- {
-
- String aPath;
- sal_uInt16 nDirFlags = 0;
-// from basic/source/inc/runtime.hxx
-#define Sb_ATTR_NORMAL 0x0000
-#define Sb_ATTR_HIDDEN 0x0002
-#define Sb_ATTR_SYSTEM 0x0004
-#define Sb_ATTR_VOLUME 0x0008
-#define Sb_ATTR_DIRECTORY 0x0010
-#define Sb_ATTR_ARCHIVE 0x0020
- // copied from Basic and adapted basic/source/runtime/methods.cxx Revision 1.54
- if ( (nParams & PARAM_STR_1) )
- {
- delete pDir;
- pDir = NULL; // wg. Sonderbehandlung Sb_ATTR_VOLUME
- DirEntry aEntry( aString1 );
- FileStat aStat( aEntry );
- if(!aStat.GetError() && (aStat.GetKind() & FSYS_KIND_FILE))
- {
- // OK, only a filename
- // cut off path (VB4)
- aPath = aEntry.GetName();
- }
- else
- {
- sal_uInt16 nFlags = 0;
- if ( (nParams & PARAM_UINT16_1) )
- nDirFlags = nFlags = nNr1;
- else
- nDirFlags = nFlags = Sb_ATTR_HIDDEN | Sb_ATTR_SYSTEM | Sb_ATTR_DIRECTORY;
-
- // Nur diese Bitmaske ist unter Windows erlaubt
- // Sb_ATTR_VOLUME wird getrennt gehandelt
- if( nDirFlags & Sb_ATTR_VOLUME )
- aPath = aEntry.GetVolume();
- else
- {
- // Die richtige Auswahl treffen
- sal_uInt16 nMode = FSYS_KIND_FILE;
- if( nFlags & Sb_ATTR_DIRECTORY )
- nMode |= FSYS_KIND_DIR;
- if( nFlags == Sb_ATTR_DIRECTORY )
- nMode = FSYS_KIND_DIR;
- pDir = new Dir( aEntry, (DirEntryKind) nMode );
- nErrorcode = pDir->GetError();
- nDirPos = 0;
- }
- }
- }
-
- if( pDir )
- {
- for( ;; )
- {
- if( nDirPos >= pDir->Count() )
- {
- delete pDir;
- pDir = NULL;
- aPath.Erase();
- break;
- }
- DirEntry aNextEntry=(*(pDir))[nDirPos++];
- aPath = aNextEntry.GetName();
- break;
- }
- }
- if ( !nErrorcode )
- {
- pRet->GenReturn ( RET_Value, nMethodId, aPath );
- }
-
- }
- break;
- case RC_FileLen:
- {
- DirEntry aFile( aString1 );
- nErrorcode = aFile.GetError();
- if ( FSYS_ERR_OK == nErrorcode )
- {
- FileStat aFS( aFile );
- pRet->GenReturn ( RET_Value, nMethodId, static_cast<comm_UINT32>(aFS.GetSize()) ); //GetSize() sal_uLong != comm_UINT32 on 64bit
- nErrorcode = aFS.GetError();
- }
- }
- break;
- case RC_FileDateTime:
- {
- DirEntry aFile( aString1 );
- nErrorcode = aFile.GetError();
- if ( FSYS_ERR_OK == nErrorcode )
- {
- FileStat aStat( aFile );
- Time aTime( aStat.TimeModified() );
- Date aDate( aStat.DateModified() );
- nErrorcode = aStat.GetError();
-
- double fSerial = (double)( aDate - Date(30,12,1899) );
- long nSeconds = aTime.GetHour();
- nSeconds *= 3600;
- nSeconds += aTime.GetMin() * 60;
- nSeconds += aTime.GetSec();
- double nDays = ((double)nSeconds) / (double)(24.0*3600.0);
- fSerial += nDays;
-
- SbxValueRef xValue = new SbxValue( SbxDATE );
- xValue->PutDate( fSerial );
-
- pRet->GenReturn ( RET_Value, nMethodId, *xValue );
- }
- }
- break;
- }
- switch ( nErrorcode )
- {
- case FSYS_ERR_OK:
- break;
- case FSYS_ERR_MISPLACEDCHAR:
- {
- ReportError( CUniString("MISPLACEDCHAR") );
- }
- break;
- case FSYS_ERR_INVALIDCHAR:
- {
- ReportError( CUniString("INVALIDCHAR") );
- }
- break;
- case FSYS_ERR_NOTEXISTS:
- {
- ReportError( CUniString("NOTEXISTS") );
- }
- break;
- case FSYS_ERR_ALREADYEXISTS:
- {
- ReportError( CUniString("ALREADYEXISTS") );
- }
- break;
- case FSYS_ERR_NOTADIRECTORY:
- {
- ReportError( CUniString("NOTADIRECTORY") );
- }
- break;
- case FSYS_ERR_NOTAFILE:
- {
- ReportError( CUniString("NOTAFILE") );
- }
- break;
- case FSYS_ERR_INVALIDDEVICE:
- {
- ReportError( CUniString("INVALIDDEVICE") );
- }
- break;
- case FSYS_ERR_ACCESSDENIED:
- {
- ReportError( CUniString("ACCESSDENIED") );
- }
- break;
- case FSYS_ERR_LOCKVIOLATION:
- {
- ReportError( CUniString("LOCKVIOLATION") );
- }
- break;
- case FSYS_ERR_VOLUMEFULL:
- {
- ReportError( CUniString("VOLUMEFULL") );
- }
- break;
- case FSYS_ERR_ISWILDCARD:
- {
- ReportError( CUniString("ISWILDCARD") );
- }
- break;
- case FSYS_ERR_NOTSUPPORTED:
- {
- ReportError( CUniString("NOTSUPPORTED") );
- }
- break;
- case FSYS_ERR_UNKNOWN:
- {
- ReportError( CUniString("UNKNOWN") );
- }
- break;
- default:
- {
- ReportError( CUniString("Not an FSYS Error") );
- }
- }
-
- }
- break;
- case RC_TypeKeysDelay:
- {
- if( (nParams & PARAM_BOOL_1) )
- {
- bDoTypeKeysDelay = bBool1;
- }
- else if( nParams & PARAM_UINT16_1 )
- {
- nMinTypeKeysDelay = nNr1;
- if( nParams & PARAM_UINT16_2 )
- nMaxTypeKeysDelay = nNr2;
- else
- nMaxTypeKeysDelay = nMinTypeKeysDelay;
- }
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- break;
- case RC_GetMouseStyle:
- {
- Pointer aPointer;
- Window *pActualWin = GetMouseWin();
- if ( pActualWin )
- aPointer = pActualWin->GetPointer();
- else
- {
- ReportError( GEN_RES_STR1( S_POINTER_OUTSIDE_APPWIN, RcString( nMethodId ) ) );
- aPointer = Pointer( POINTER_NULL );
- }
- pRet->GenReturn ( RET_Value, nMethodId, (comm_UINT32)aPointer.GetStyle() );
- }
- break;
- case RC_UnpackStorage:
- {
- if( (nParams & PARAM_STR_1) )
- {
- String aFileName( aString1 );
- DirEntry aDestPath;
- if( (nParams & PARAM_STR_2) )
- aDestPath = DirEntry( aString2 );
- else
- {
- aDestPath = DirEntry( aFileName );
- aDestPath.SetExtension( CUniString( "plaintext" ) );
- }
-
-#if OSL_DEBUG_LEVEL > 1
- sal_uInt16 nEntries = Dir( aDestPath, FSYS_KIND_FILE | FSYS_KIND_DIR ).Count();
- (void) nEntries; /* avoid warning about unused parameter */
-#endif
- // The Count is only larger than 2 is the path is a directory which is not empty
- // the Count of 2 results from the "." and ".." directory
- if ( Dir( aDestPath, FSYS_KIND_FILE | FSYS_KIND_DIR ).Count() > 2 )
- DirectLog( S_QAError, GEN_RES_STR1( S_DIRECTORY_NOT_EMPTY, aDestPath.GetFull() ) );
-
- SotStorageRef xStorage = new SotStorage( aFileName, STREAM_STD_READ );
- if ( xStorage->GetError() )
- ReportError( GEN_RES_STR2(S_UNPACKING_STORAGE_FAILED, aFileName, aDestPath.GetFull()) );
- else
- UnpackStorage( xStorage, aDestPath );
- }
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- break;
- case RC_CloseSysDialog:
- case RC_ExistsSysDialog:
- {
- if( (nParams & PARAM_UINT16_1) )
- {
- Reference < ::com::sun::star::util::XCancellable > xPicker;
- switch( nNr1 )
- {
- case CONST_FilePicker:
- {
- xPicker.set( Reference < ::com::sun::star::util::XCancellable >( svt::GetTopMostFilePicker(), UNO_QUERY ) );
- }
- break;
- case CONST_FolderPicker:
- {
- xPicker.set( Reference < ::com::sun::star::util::XCancellable >( svt::GetTopMostFolderPicker(), UNO_QUERY ) );
- }
- break;
- default:
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- switch( nMethodId )
- {
- case RC_CloseSysDialog:
- {
- if ( xPicker.is() )
- xPicker->cancel();
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- break;
- case RC_ExistsSysDialog:
- {
- pRet->GenReturn ( RET_Value, nMethodId, (comm_BOOL)xPicker.is() );
- }
- break;
- default:
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- }
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- break;
- case RC_SAXCheckWellformed:
- case RC_SAXReadFile:
-
- case RC_SAXGetNodeType:
- case RC_SAXGetAttributeCount:
- case RC_SAXGetAttributeName:
- case RC_SAXGetAttributeValue:
- case RC_SAXGetChildCount:
- case RC_SAXGetElementName:
- case RC_SAXGetChars:
-
- case RC_SAXSeekElement:
- case RC_SAXHasElement:
- case RC_SAXGetElementPath:
-
- case RC_SAXRelease:
- {
- HandleSAXParser();
- }
- break;
- case RC_RecordMacro:
- {
- if ( ! (nParams & PARAM_BOOL_1) )
- bBool1 = sal_True;
-
- MacroRecorder::GetMacroRecorder()->SetActionRecord( bBool1 );
- }
- break;
- case RC_GetDocumentCount :
- {
- pRet->GenReturn ( RET_Value, nMethodId, (comm_UINT16)GetDocWinCount() );
- }
- break;
- case RC_ActivateDocument :
- {
- if( nParams & PARAM_UINT16_1 )
- {
- if ( ValueOK( rtl::OString(), RcString( nMethodId ), nNr1, GetDocWinCount() ) )
- {
- Window* pWin = GetDocWin( nNr1-1 );
- if ( pWin )
- {
- pWin->ToTop();
- pWin->GrabFocus();
- }
- }
- }
- else
- ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- }
- break;
- case RC_GetSystemLanguage :
- {
- pRet->GenReturn ( RET_Value, nMethodId, (comm_UINT16)Application::GetSettings().GetLanguage() );
- }
- break;
- case RC_CatchGPF :
- {
- if( (nParams & PARAM_BOOL_1) )
- bCatchGPF = bBool1;
- else
- bCatchGPF = sal_True;
- }
- break;
- case RC_IsProduct :
- {
- sal_Bool bIsProduct;
- #ifdef DBG_UTIL
- bIsProduct = sal_False;
- #else
- bIsProduct = sal_True;
- #endif
- pRet->GenReturn ( RET_Value, nMethodId, (sal_Bool)bIsProduct );
- }
- break;
- case RC_UsePostEvents :
- {
- if( (nParams & PARAM_BOOL_1) )
- bUsePostEvents = bBool1;
- else
- bUsePostEvents = sal_True;
- }
- break;
- default:
- ReportError( GEN_RES_STR1( S_UNKNOWN_COMMAND, RcString( nMethodId ) ) );
- }
- SendProfile( RcString(nMethodId) );
- delete this;
- return sal_True;
-}
-
-
-sal_Bool StatementCommand::UnpackStorage( SotStorageRef xStorage, DirEntry &aBaseDir )
-{
- SvStorageInfoList aList;
- xStorage->FillInfoList( &aList );
-
- for( size_t i = 0; i < aList.size(); i++ )
- {
- SvStorageInfo& rInfo = aList[ i ];
- String aName = rInfo.GetName();
- DirEntry aPath ( aBaseDir );
- aPath += DirEntry( aName );
- sal_Bool bIsStorage = xStorage->IsStorage( aName );
- if ( bIsStorage )
- {
- SotStorageRef xSubStorage = xStorage->OpenSotStorage( aName, STREAM_STD_READ );
- if ( xSubStorage->GetError() )
- {
- ReportError( GEN_RES_STR2(S_UNPACKING_STORAGE_FAILED, aName, aPath.GetFull()) );
- return sal_False;
- }
- UnpackStorage( xSubStorage, aPath );
- }
- else
- {
- if ( !aPath.MakeDir( sal_True ) )
- {
- ReportError( GEN_RES_STR1(S_CANNOT_CREATE_DIRECTORY, aPath.GetFull()) );
- return sal_False;
- }
- SotStorageStreamRef xStream = xStorage->OpenSotStream( aName, STREAM_STD_READ );
- SvFileStream aDestination( aPath.GetFull(), STREAM_STD_READWRITE | STREAM_TRUNC );
- (*xStream) >> aDestination;
- if ( aDestination.GetError() != ERRCODE_NONE )
- {
- ReportError( GEN_RES_STR2(S_UNPACKING_STORAGE_FAILED, aName, aPath.GetFull()) );
- return sal_False;
- }
- aDestination.Close();
- }
- }
- return sal_True;
-}
-
-
-StatementControl::StatementControl( SCmdStream *pCmdIn, sal_uInt16 nControlIdType )
-: StatementList()
-, nNr1( 0 )
-, nNr2( 0 )
-, nNr3( 0 )
-, nNr4( 0 )
-, nLNr1( 0 )
-, aString1()
-, aString2()
-, bBool1(sal_False)
-, bBool2(sal_False)
-{
- QueStatement( NULL );
- //HELPID BACKWARD (SIControl is no longer needed)
- if ( nControlIdType == SIControl )
- {
- comm_UINT32 nId;
- pCmdIn->Read( nId );
- aUId = rtl::OString( nId );
- if ( nId == 0 )
- aUId = UID_ACTIVE;
- else
- ReportError( aUId, GEN_RES_STR1c( S_INTERNAL_ERROR, "using numeric HelpID from old Testtool" ) );
- }
- else if ( nControlIdType == SIStringControl )
- {
- String aId;
- pCmdIn->Read( aId );
- aUId = Str2Id( aId );
- }
- else
- {
- OSL_FAIL( "Wrong ControlType" );
- }
-
- pCmdIn->Read( nMethodId );
- pCmdIn->Read( nParams );
-
- if( nParams & PARAM_UINT16_1 ) pCmdIn->Read( nNr1 );
- if( nParams & PARAM_UINT16_2 ) pCmdIn->Read( nNr2 );
- if( nParams & PARAM_UINT16_3 ) pCmdIn->Read( nNr3 );
- if( nParams & PARAM_UINT16_4 ) pCmdIn->Read( nNr4 );
- if( nParams & PARAM_UINT32_1 ) pCmdIn->Read( nLNr1 );
- if( nParams & PARAM_STR_1 ) pCmdIn->Read( aString1 );
- if( nParams & PARAM_STR_2 ) pCmdIn->Read( aString2 );
- if( nParams & PARAM_BOOL_1 ) pCmdIn->Read( bBool1 );
- if( nParams & PARAM_BOOL_2 ) pCmdIn->Read( bBool2 );
-
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Reading Control: UId: " );
- m_pDbgWin->AddText( Id2Str( aUId ) );
- m_pDbgWin->AddText( " Methode: " );
- m_pDbgWin->AddText( String::CreateFromInt32( nMethodId ) );
- m_pDbgWin->AddText( " Params:" );
- if( nParams & PARAM_UINT16_1 ) {m_pDbgWin->AddText( " n1:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr1 ) );}
- if( nParams & PARAM_UINT16_2 ) {m_pDbgWin->AddText( " n2:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr2 ) );}
- if( nParams & PARAM_UINT16_3 ) {m_pDbgWin->AddText( " n3:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr3 ) );}
- if( nParams & PARAM_UINT16_4 ) {m_pDbgWin->AddText( " n4:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr4 ) );}
- if( nParams & PARAM_UINT32_1 ) {m_pDbgWin->AddText( " nl1:" );m_pDbgWin->AddText( String::CreateFromInt64( nLNr1 ) );}
- if( nParams & PARAM_STR_1 ) {m_pDbgWin->AddText( " s1:" );m_pDbgWin->AddText( aString1 );}
- if( nParams & PARAM_STR_2 ) {m_pDbgWin->AddText( " s2:" );m_pDbgWin->AddText( aString2 );}
- m_pDbgWin->AddText( "\n" );
-#endif
-}
-
-sal_Bool IsDialog(Window *pWin)
-{ // Alles was von SystemWindow abgeleitet ist
- if ( !pWin )
- return sal_False;
-
- switch (pWin->GetType())
- {
- case WINDOW_FLOATINGWINDOW:
- case WINDOW_DOCKINGWINDOW:
- case WINDOW_MODELESSDIALOG:
- case WINDOW_DIALOG:
- case WINDOW_MODALDIALOG:
- case WINDOW_WORKWINDOW:
- case WINDOW_TABDIALOG:
-
- case WINDOW_MESSBOX:
- case WINDOW_INFOBOX:
- case WINDOW_WARNINGBOX:
- case WINDOW_ERRORBOX:
- case WINDOW_QUERYBOX:
- case WINDOW_BUTTONDIALOG:
- case WINDOW_FILEDIALOG:
- case WINDOW_PRINTDIALOG:
- case WINDOW_PRINTERSETUPDIALOG:
-
-// ab hier nicht ansprechbar (da nicht implementiert)
- case WINDOW_SYSWINDOW:
- case WINDOW_SYSTEMDIALOG:
- case WINDOW_COLORDIALOG:
- case WINDOW_FONTDIALOG:
- case WINDOW_PATHDIALOG:
-
-
- return sal_True;
- default:
- return sal_False;
- }
-}
-
-
-sal_Bool IsAccessable(Window *pWin)
-{
- if ( pWin == NULL )
- return sal_False;
-
- return pWin->IsEnabled() && pWin->IsInputEnabled();
-}
-
-
-
-// neue Hilfsfunktion
-static Window*ImpGetButton( Window *pBase, WinBits nMask, WinBits nWinBits )
-{
- sal_uInt16 n = pBase->GetChildCount();
- for( sal_uInt16 i = 0 ; i < n; i++ ) {
- Window *pChild = pBase->GetChild(i);
- if( pChild->GetType() == WINDOW_OKBUTTON
- || pChild->GetType() == WINDOW_CANCELBUTTON
- || pChild->GetType() == WINDOW_HELPBUTTON
- || pChild->GetType() == WINDOW_PUSHBUTTON )
- if( !nMask || ( pChild->GetStyle() & nMask ) == nWinBits )
- return pChild;
- }
- return NULL;
-}
-
-sal_Bool StatementControl::ControlOK( Window *pControl, const sal_Char* cBezeichnung )
-{
- if ( pControl && ( ( ( IsAccessable(pControl) || (nMethodId & M_WITH_RETURN) ) &&
- pControl->IsVisible() ) ||
- aUId.equals( UID_ACTIVE ) ) )
- return sal_True;
- else
- {
- UniString aBezeichnung( cBezeichnung, RTL_TEXTENCODING_ASCII_US );
- if ( aBezeichnung.Len() > 0 )
- {
- if (!pControl)
- ReportError( aUId, GEN_RES_STR1( S_WIN_NOT_FOUND, aBezeichnung ) );
- else if ( !pControl->IsVisible() )
- ReportError( aUId, GEN_RES_STR1( S_WIN_INVISIBLE, aBezeichnung ) );
- else
- ReportError( aUId, GEN_RES_STR1( S_WIN_DISABLED, aBezeichnung ) );
- }
- #if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( aBezeichnung.AppendAscii(" NotFound or Disabled or Invisible") );
- #endif
-
- return sal_False;
- }
-}
-
-
-sal_Bool StatementList::ValueOK( rtl::OString aId, String aBezeichnung, sal_uLong nValue, sal_uLong nMax )
-{
-
- if ( nMax < nValue )
- {
- if ( aBezeichnung.Len() > 0 )
- ReportError( aId, GEN_RES_STR3( S_NUMBER_TOO_BIG, aBezeichnung, UniString::CreateFromInt32( nValue ), UniString::CreateFromInt32( nMax ) ) );
- return sal_False;
- }
- if ( nValue < 1 )
- {
- if ( aBezeichnung.Len() > 0 )
- ReportError( aId, GEN_RES_STR3c3( S_NUMBER_TOO_SMALL, aBezeichnung, UniString::CreateFromInt32( nValue ), "1" ) );
- return sal_False;
- }
- return sal_True;
-}
-
-sal_uInt16 StatementList::GetCurrentMenues( PopupMenu *&pPopup, MenuBar *&pMenuBar, Menu *&pMenu )
-{
- if ( WinPtrValid( pMenuWindow ) )
- pMenuBar = pMenuWindow->GetMenuBar();
-
- if ( pMenuBar ) // use MenuBar as base
- pMenu = pMenuBar;
- else // use contextmenu as base
- {
- pMenu = PopupMenu::GetActivePopupMenu();
- pPopup = PopupMenu::GetActivePopupMenu();
- }
-
- if ( !pMenu )
- return 1;
-
- if ( aSubMenuId1 )
- {
- pPopup = pMenu->GetPopupMenu( aSubMenuId1 );
- pMenu = pPopup;
- }
-
- if ( pMenu && aSubMenuId2 )
- {
- pPopup = pMenu->GetPopupMenu( aSubMenuId2 );
- pMenu = pPopup;
- }
-
- if ( pMenu && aSubMenuId3 )
- {
- pPopup = pMenu->GetPopupMenu( aSubMenuId3 );
- pMenu = pPopup;
- }
-
- return 0;
-}
-
-void StatementControl::AnimateMouse( Window *pControl, TTHotSpots aWohin )
-{
- Point aZiel;
-
- switch (aWohin)
- {
- case MitteLinks:
- {
- long nHeight = pControl->GetSizePixel().Height();
- aZiel.X() += 5;
- aZiel.Y() += nHeight / 2;
- }
- break;
- case Mitte:
- {
- Size aSize = pControl->GetOutputSizePixel();
- aZiel.Move( aSize.Width() / 2, aSize.Height() / 2 );
- }
- break;
- case MitteOben:
- {
- long nWidth = pControl->GetSizePixel().Width();
- aZiel.X() += nWidth / 2;
- aZiel.Y() += 5;
- }
- break;
- }
- AnimateMouse( pControl, aZiel );
-}
-
-
-void StatementControl::AnimateMouse( Window *pControl, Point aWohin )
-{
- Point aAkt = pControl->GetPointerPosPixel();
- Point aZiel = aWohin;
-
- long nSteps;
- Point aDiff = aAkt - aZiel;
-
- if ( Abs(aDiff.X()) < Abs(aDiff.Y()) )
- nSteps = Abs(aDiff.Y()) / 5;
- else
- nSteps = Abs(aDiff.X()) / 5;
- if ( nSteps == 0 )
- return;
-
- aDiff *= 1000;
- aDiff /= nSteps;
-
- StatementList::bExecuting = sal_True; // Bah ist das ein ekliger Hack
- // Das verhindert, da� schon der n�chste Befehl ausgef�hrt wird.
-
- for ( ; nSteps ; nSteps-- )
- {
- if ( Abs((aAkt - pControl->GetPointerPosPixel()).X()) > 5 ||
- Abs((aAkt - pControl->GetPointerPosPixel()).Y()) > 5 )
- nSteps = 1;
- aAkt = aZiel + aDiff * nSteps / 1000;
- pControl->SetPointerPosPixel(aAkt);
- SafeReschedule();
- }
- pControl->SetPointerPosPixel(aZiel);
- StatementList::bExecuting = sal_False; // Bah ist das ein ekliger Hack
-}
-
-
-sal_Bool StatementControl::MaybeDoTypeKeysDelay( Window *pTestWindow )
-{
- if ( bDoTypeKeysDelay )
- {
- sal_uLong nTimeWait = nMinTypeKeysDelay;
- if ( nMaxTypeKeysDelay != nMinTypeKeysDelay )
- nTimeWait += Time::GetSystemTicks() % ( nMaxTypeKeysDelay - nMinTypeKeysDelay );
- Timer aTimer;
- aTimer.SetTimeout( nTimeWait );
- aTimer.Start();
- StatementList::bExecuting = sal_True; // Bah ist das ein ekliger Hack
- // Das verhindert, da� schon der n�chste Befehl ausgef�hrt wird.
- while ( aTimer.IsActive() )
- {
- SafeReschedule( sal_True );
- }
- StatementList::bExecuting = sal_False; // Bah ist das ein ekliger Hack
- if ( !WinPtrValid(pTestWindow ) )
- {
- ReportError( aUId, GEN_RES_STR1( S_WINDOW_DISAPPEARED, MethodString( nMethodId ) ) );
- return sal_False;
- }
- }
- return sal_True;
-}
-
-sal_Bool StatementControl::HandleVisibleControls( Window *pControl )
-{
- if( pControl ) // Also auch bei Disabled nicht jedoch bei Invisible
- {
- switch( nMethodId )
- {
- case M_IsEnabled:
- pRet->GenReturn ( RET_Value, aUId, IsAccessable(pControl) );
- break;
- case M_IsVisible:
- pRet->GenReturn ( RET_Value, aUId, pControl->IsVisible() );
- break;
- case M_GetPosX:
- if ( pControl->GetType() == WINDOW_DOCKINGWINDOW && pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_FLOATINGWINDOW )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r FloatingWindows
- if ( pControl->GetType() == WINDOW_TABCONTROL && pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_TABDIALOG )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r TabDialoge
- if ( pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_BORDERWINDOW )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r Border
- if ( (nParams & PARAM_BOOL_1) && bBool1 )
- pControl = pControl->GetWindow( WINDOW_OVERLAP );
-
- if ( pControl->GetType() == WINDOW_DOCKINGWINDOW && pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_SPLITWINDOW )
- {
- Point aPos = pControl->GetPosPixel();
- aPos = pControl->GET_REAL_PARENT()->OutputToScreenPixel( aPos );
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)aPos.X() );
- }
- else
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)pControl->GetPosPixel().X() );
- break;
- case M_GetPosY:
- if ( pControl->GetType() == WINDOW_DOCKINGWINDOW && pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_FLOATINGWINDOW )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r FloatingWindows
- if ( pControl->GetType() == WINDOW_TABCONTROL && pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_TABDIALOG )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r TabDialoge
- if ( pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_BORDERWINDOW )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r Border
- if ( (nParams & PARAM_BOOL_1) && bBool1 )
- pControl = pControl->GetWindow( WINDOW_OVERLAP );
-
- if ( pControl->GetType() == WINDOW_DOCKINGWINDOW && pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_SPLITWINDOW )
- {
- Point aPos = pControl->GetPosPixel();
- aPos = pControl->GET_REAL_PARENT()->OutputToScreenPixel( aPos );
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)aPos.Y() );
- }
- else
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)pControl->GetPosPixel().Y() );
- break;
- case M_GetSizeX:
- if ( pControl->GetType() == WINDOW_DOCKINGWINDOW && pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_FLOATINGWINDOW )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r FloatingWindows
- if ( pControl->GetType() == WINDOW_TABCONTROL && pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_TABDIALOG )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r TabDialoge
- if ( pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_BORDERWINDOW )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r Border
- if ( (nParams & PARAM_BOOL_1) && bBool1 )
- pControl = pControl->GetWindow( WINDOW_OVERLAP );
-
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)pControl->GetSizePixel().Width() );
- break;
- case M_GetSizeY:
- if ( pControl->GetType() == WINDOW_DOCKINGWINDOW && pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_FLOATINGWINDOW )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r FloatingWindows
- if ( pControl->GetType() == WINDOW_TABCONTROL && pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_TABDIALOG )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r TabDialoge
- if ( pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_BORDERWINDOW )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r Border
- if ( (nParams & PARAM_BOOL_1) && bBool1 )
- pControl = pControl->GetWindow( WINDOW_OVERLAP );
-
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)pControl->GetSizePixel().Height() );
- break;
- case M_SnapShot:
- {
- if ( pControl->GetType() == WINDOW_DOCKINGWINDOW && pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_FLOATINGWINDOW )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r FloatingWindows
- if ( pControl->GetType() == WINDOW_TABCONTROL && pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_TABDIALOG )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r TabDialoge
- if ( pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_BORDERWINDOW )
- pControl = pControl->GET_REAL_PARENT(); // Sonderbehandlung f�r Border
- if ( (nParams & PARAM_BOOL_1) && bBool1 )
- pControl = pControl->GetWindow( WINDOW_OVERLAP );
-
- Bitmap aBmp = pControl->SnapShot();
- if ( pControl->GetType() == WINDOW_WORKWINDOW )
- {
- Point aStart = pControl->GetPosPixel();
- if ( !(nParams & PARAM_UINT16_4) )
- {
- nParams |= PARAM_UINT16_1;
- nParams |= PARAM_UINT16_2;
- nParams |= PARAM_UINT16_3;
- nParams |= PARAM_UINT16_4;
- nNr1 = (sal_uInt16)-aStart.X();
- nNr2 = (sal_uInt16)-aStart.Y();
- nNr3 = (sal_uInt16)pControl->GetSizePixel().Width() + 2*(sal_uInt16)aStart.X();
- nNr4 = (sal_uInt16)pControl->GetSizePixel().Height() + 2*(sal_uInt16)aStart.Y();
- }
- nNr1 = std::max((sal_uInt16)-aStart.X(),nNr1);
- nNr2 = std::max((sal_uInt16)-aStart.Y(),nNr2);
- nNr3 = std::min((sal_uInt16)(pControl->GetSizePixel().Width() + 2*(sal_uInt16)aStart.X()),nNr3);
- nNr4 = std::min((sal_uInt16)(pControl->GetSizePixel().Height() + 2*(sal_uInt16)aStart.Y()),nNr4);
- }
- if( nParams & PARAM_UINT16_4 )
- { // Zuschneiden
- Point aPt(-nNr1,-nNr2);
- Size aSz(nNr3,nNr4);
- VirtualDevice aVDev( *pControl );
-
- aVDev.SetOutputSizePixel( aSz );
- aVDev.DrawBitmap( aPt, aBmp );
- aBmp = aVDev.GetBitmap( Point(), aSz );
- }
-
- SvFileStream fOut;
- fOut.Open(aString1,STREAM_STD_WRITE);
- aBmp.Write(fOut);
- if ( fOut.GetError() )
- ReportError( aUId, GEN_RES_STR1( S_ERROR_SAVING_IMAGE, UniString::CreateFromInt32( fOut.GetError() ) ) );
- fOut.Close();
- }
- break;
- case M_GetFixedTextCount:
- {
- pRet->GenReturn ( RET_Value, aUId, CountWinByRT( pControl, WINDOW_FIXEDTEXT, sal_True ) );
- }
- break;
- case M_GetFixedText:
- {
- if( ( nParams & PARAM_UINT16_1 ) == 0 )
- nNr1 = 1;
-
- FixedText* pFixedText = (FixedText*)GetWinByRT( pControl, WINDOW_FIXEDTEXT, sal_True, nNr1-1 );
- if ( pFixedText )
- pRet->GenReturn ( RET_Value, aUId, pFixedText->GetText() );
- else
- ValueOK(aUId, MethodString( nMethodId ),nNr1,CountWinByRT( pControl, WINDOW_FIXEDTEXT, sal_True ) );
- }
- break;
- default:
- return sal_False;
- }
- SendProfile( UIdString( aUId ).Append('.').Append( MethodString( nMethodId ) ) );
- return sal_True;
- }
- return sal_False;
-}
-
-sal_Bool StatementControl::HandleCommonMethods( Window *pControl )
-{
- switch( nMethodId ) // Diese k�nnen an jedem Window ausgef�hrt werden
- {
- case M_Exists: // Oben schon Behandelt. Unterdr�ckt hier nur Fehler
- case M_NotExists:
- case M_IsEnabled:
- case M_IsVisible:
- case M_SnapShot:
- break;
- case M_Caption :
- {
- if ( pControl->GetText().Len() == 0 && IsDocFrame( pControl->GetWindow( WINDOW_FRAME ) ) )
- pRet->GenReturn ( RET_Value, aUId, pControl->GetWindow( WINDOW_FRAME )->GetText());
- else
- pRet->GenReturn ( RET_Value, aUId, pControl->GetText());
- }
- break;
- case M_GetRT:
- {
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)pControl->GetType() );
- }
- break;
- case M_TypeKeys:
- {
- if( !(nParams & PARAM_UINT16_1) ) // Anzahl wiederholungen
- nNr1 = 1;
- if( !(nParams & PARAM_BOOL_1) ) // Follow Focus
- bBool1 = sal_False; // so bleibt das bisherige Verhalten
-
- if ( !bBool1 ) // Altes Verhalten
- pControl->GrabFocus();
- else // If focus is not inside given control we grab it once.
- {
- Window *pFocus = GetpApp()->GetFocusWindow();
- if ( !pFocus || !pControl->IsWindowOrChild( pFocus, sal_True ) )
- pControl->GrabFocus();
- }
-
-
- // maybe this can get removed since we are using GetPreferredKeyInputWindow()
- if ( pControl->GetType() == WINDOW_COMBOBOX )
- { // Bei COMBOBOX an das Edit direkt liefern
- Window *pTemp = NULL;
- for ( sal_uInt16 i = 0 ; i < pControl->GetChildCount() && !pTemp ; i++ )
- if ( pControl->GetChild( i )->GetType() == WINDOW_EDIT )
- pTemp = pControl->GetChild( i );
- if ( pTemp )
- pControl = pTemp;
- }
-
- Window *pDeliverHere = pControl;
- for (int j = 0; j < nNr1; j++)
- for (xub_StrLen i = 0; i < aString1.Len(); i++)
- {
- if ( StatementList::bUsePostEvents )
- { // grab focus every time
- Window *pFocus = GetpApp()->GetFocusWindow();
- if ( !pFocus || !pControl->IsWindowOrChild( pFocus, sal_True ) )
- pControl->GrabFocus();
- }
- if ( bBool1 ) // Jedesmal das FocusWindow finden
- {
- Window *pFocus = GetpApp()->GetFocusWindow();
- if ( pFocus && pControl->IsWindowOrChild( pFocus, sal_True ) )
- pDeliverHere = pFocus;
- else // sonst fallback auf das Basisfenster
- pDeliverHere = pControl;
- }
- pDeliverHere = pDeliverHere->GetPreferredKeyInputWindow();
- KeyEvent aEvent;
- if ( ((sal_uInt16)aString1.GetChar(i)) <= 7 )
- {
- sal_uInt16 nVal = 0;
- switch (aString1.GetChar(i))
- {
- case 1: nVal = aString1.GetChar(i+1) + (aString1.GetChar(i+2) << 8);
- i += 2;
- break;
- case 3: nVal = (aString1.GetChar(i+1) << 8);
- i++;
- break;
- case 5: nVal = aString1.GetChar(i+1);
- i++;
- break;
- case 7: nVal = 0;
- break;
- }
- // #105672#
- // find out the keycode
- sal_uInt16 nKeygroup = nVal & KEYGROUP_TYPE;
- sal_uInt16 nKeyCode = nVal & KEY_CODE;
- sal_Unicode aCh;
- switch (nKeygroup)
- {
- case KEYGROUP_NUM:
- aCh = nKeyCode - KEY_0 + '0';
- break;
- case KEYGROUP_ALPHA:
- aCh = nKeyCode - KEY_A;
- if ( nVal & KEY_MOD1 )
- {}
- else if ( nVal & KEY_SHIFT )
- aCh += 'A';
- else
- aCh += 'a';
- break;
- case KEYGROUP_MISC:
- { // CR ESC TAB BACK
- ByteString aPrintableMisc("\x0d\x1b\x09\x08 **+-*/.,<>=",16);
- if ( nKeyCode-KEY_RETURN < aPrintableMisc.Len()
- && nKeyCode != KEY_INSERT && nKeyCode != KEY_DELETE )
- aCh = aPrintableMisc.GetChar( nKeyCode-KEY_RETURN );
- else
- aCh = 0;
- }
- break;
- case KEYGROUP_CURSOR:
- case KEYGROUP_FKEYS:
- default:
- aCh = 0;
- }
- aEvent = KeyEvent(aCh,KeyCode(nVal & 0xFFF,nVal & 0xF000));
- }
- else
- {
- // CR ESC TAB BACK
- String aPrintableMisc = CUniString("\x0d\x1b\x09\x08 xx+-*/.,<>=");
- sal_Unicode aCh = aString1.GetChar(i);
- if ( aCh >= 'a' && aCh <= 'z' )
- aEvent = KeyEvent(aCh, KeyCode(KEYGROUP_ALPHA + aCh-'a', 0));
- else if ( aCh >= 'A' && aCh <= 'Z' )
- aEvent = KeyEvent(aCh, KeyCode(KEYGROUP_ALPHA + aCh-'a', KEY_SHIFT));
- else if ( aCh >= '0' && aCh <= '9' )
- aEvent = KeyEvent(aCh, KeyCode(KEYGROUP_NUM + aCh-'0', 0));
- else if ( aPrintableMisc.Search(aCh) != STRING_NOTFOUND )
- aEvent = KeyEvent(aCh, KeyCode(KEYGROUP_MISC + (sal_uInt16)aPrintableMisc.Search(aCh), 0));
- else // Sollte eigentlich nicht auftreten
- aEvent = KeyEvent(aCh, KeyCode());
- }
- ImplKeyInput( pDeliverHere, aEvent );
- if ( !MaybeDoTypeKeysDelay( pControl ) )
- break;
- else
- SafeReschedule();SafeReschedule();SafeReschedule();
- }
- }
- break;
-
-#define CalcMouseButton\
- sal_uInt16 nButton = MOUSE_LEFT;\
- if ( (nParams & PARAM_UINT16_3) )\
- {\
- switch ( nNr3 )\
- {\
- case 1: nButton = MOUSE_LEFT; break;\
- case 2: nButton = MOUSE_MIDDLE; break;\
- case 3: nButton = MOUSE_RIGHT; break;\
- }\
- }\
-
- case M_MouseDown:
- {
- CalcMouseButton;
- Size aS = pControl->GetOutputSizePixel();
- Point aPos = Point(aS.Width() * nNr1 / 100,aS.Height() * nNr2 / 100);
- Window *pActualWin = pControl->FindWindow( aPos );
-
- if ( pActualWin )
- aPos = pActualWin->AbsoluteScreenToOutputPixel( pControl->OutputToAbsoluteScreenPixel ( aPos ) );
- else
- pActualWin = pControl;
-
- AnimateMouse( pActualWin, aPos );
- pActualWin->GrabFocus();
- MouseEvent aMEvnt(aPos,1,MOUSE_SIMPLECLICK|MOUSE_SELECT,nButton);
- ImplMouseButtonDown( pActualWin, aMEvnt );
- }
- break;
- case M_MouseUp:
- {
- CalcMouseButton;
- Size aS = pControl->GetOutputSizePixel();
- Point aPos = Point(aS.Width() * nNr1 / 100,aS.Height() * nNr2 / 100);
- Window *pActualWin = pControl->FindWindow( aPos );
-
- if ( pActualWin )
- aPos = pActualWin->AbsoluteScreenToOutputPixel( pControl->OutputToAbsoluteScreenPixel ( aPos ) );
- else
- pActualWin = pControl;
-
- AnimateMouse( pActualWin, aPos );
- MouseEvent aMEvt( aPos, 1, MOUSE_SIMPLECLICK|MOUSE_SELECT, nButton );
- ImplMouseButtonUp( pActualWin, aMEvt );
- }
- break;
- case M_MouseMove:
- {
- CalcMouseButton;
- Size aS = pControl->GetOutputSizePixel();
- Point aPos = Point(aS.Width() * nNr1 / 100,aS.Height() * nNr2 / 100);
- Window *pActualWin = pControl->FindWindow( aPos );
-
- if ( pActualWin )
- {
- aPos = pActualWin->AbsoluteScreenToOutputPixel( pControl->OutputToAbsoluteScreenPixel ( aPos ) );
- }
- else
- pActualWin = pControl;
-
- AnimateMouse( pActualWin, aPos );
- MouseEvent aMEvt( aPos, 0, MOUSE_SIMPLEMOVE|MOUSE_DRAGMOVE, nButton );
- ImplMouseMove( pActualWin, aMEvt );
- }
- break;
- case M_MouseDoubleClick:
- {
- CalcMouseButton;
- Size aS = pControl->GetOutputSizePixel();
- Point aPos = Point(aS.Width() * nNr1 / 100,aS.Height() * nNr2 / 100);
- Window *pActualWin = pControl->FindWindow( aPos );
-
- if ( pActualWin )
- {
- aPos = pActualWin->AbsoluteScreenToOutputPixel( pControl->OutputToAbsoluteScreenPixel ( aPos ) );
- }
- else
- pActualWin = pControl;
-
- AnimateMouse( pActualWin, aPos );
- pActualWin->GrabFocus();
- MouseEvent aMEvnt;
- aMEvnt = MouseEvent(aPos,1,MOUSE_SIMPLECLICK|MOUSE_SELECT,nButton);
- ImplMouseButtonDown( pActualWin, aMEvnt );
- ImplMouseButtonUp ( pActualWin, aMEvnt );
- aMEvnt = MouseEvent(aPos,2,MOUSE_SIMPLECLICK|MOUSE_SELECT,nButton);
- ImplMouseButtonDown( pActualWin, aMEvnt );
- ImplMouseButtonUp ( pActualWin, aMEvnt );
- }
- break;
- case M_DisplayPercent:
- {
- ModelessDialog *pDlg = new ModelessDialog(NULL);
- pDlg->SetOutputSizePixel(Size(100,30));
-
- Edit *pMyEd = new Edit(pDlg,WB_CENTER | WB_BORDER );
- pMyEd->SetSizePixel(Size(100,30));
- pDlg->SetText(UniString("Schlie�en", RTL_TEXTENCODING_ISO_8859_1));
- pDlg->Show();
- pMyEd->Show();
- sal_uLong nTime = Time().GetTime();
-
- while (pDlg->IsVisible())
- {
- pDlg->ToTop();
- for (int i = 1 ; i<10 ; i++)
- SafeReschedule();
- Point Pos = pControl->GetPointerPosPixel();
- Size Siz=pControl->GetOutputSizePixel();
- if ( Time().GetTime() - nTime > 10 )
- {
- nTime = Time().GetTime();
- pMyEd->SetText(UniString::CreateFromInt32(Pos.X()*100/Siz.Width()).AppendAscii("%x").Append( UniString::CreateFromInt32(Pos.Y()*100/Siz.Height()) ).Append('%'));
- }
- }
-
- delete pMyEd;
- delete pDlg;
- }
- break;
- case M_OpenContextMenu:
- {
- aSubMenuId1 = 0;
- aSubMenuId2 = 0;
- aSubMenuId3 = 0;
- pMenuWindow = NULL;
- Point aPos;
- ToolBox* pTB = (ToolBox*)pControl;
- if ( (pControl->GetType() == WINDOW_TOOLBOX) && pTB->IsMenuEnabled() )
- {
- pTB->ExecuteCustomMenu();
- }
- else
- {
- sal_Bool bAtMousePos = ( nParams & PARAM_BOOL_1 ) && bBool1;
- if ( bAtMousePos )
- {
- aPos = pControl->GetPointerPosPixel();
- Window *pActualWin = pControl->FindWindow( aPos );
-
- if ( pActualWin )
- {
- aPos = pActualWin->AbsoluteScreenToOutputPixel( pControl->OutputToAbsoluteScreenPixel ( aPos ) );
- pControl = pActualWin;
- }
- }
- CommandEvent aEvent( aPos, COMMAND_CONTEXTMENU, bAtMousePos );
- ImplCommand( pControl, aEvent );
- }
- }
- break;
- case M_UseMenu:
- {
- aSubMenuId1 = 0;
- aSubMenuId2 = 0;
- aSubMenuId3 = 0;
- pMenuWindow = NULL;
-
- while ( pControl && !( ( pControl->GetType() == WINDOW_SYSWINDOW || pControl->GetType() == WINDOW_WORKWINDOW ) && ControlOK( pControl, "" ) ) )
- pControl = pControl->GET_REAL_PARENT();
-
- if ( pControl && ((SystemWindow*)pControl)->GetMenuBar() )
- pMenuWindow = ((SystemWindow*)pControl);
- else
- ReportError( GEN_RES_STR1( S_NO_MENU, MethodString( nMethodId ) ) );
- }
- break;
- case M_FadeIn:
- case M_FadeOut:
- case M_Pin:
- case M_IsFadeIn:
- case M_IsPin:
- {
- WindowAlign aWindowAlign = WINDOWALIGN_LEFT;
- if ( (nParams & PARAM_UINT16_1) )
- {
- switch ( nNr1 )
- {
- case CONST_ALIGN_LEFT:
- aWindowAlign = WINDOWALIGN_LEFT;
- break;
- case CONST_ALIGN_TOP:
- aWindowAlign = WINDOWALIGN_TOP;
- break;
- case CONST_ALIGN_RIGHT:
- aWindowAlign = WINDOWALIGN_RIGHT;
- break;
- case CONST_ALIGN_BOTTOM:
- aWindowAlign = WINDOWALIGN_BOTTOM;
- break;
- default:
- ReportError( aUId, GEN_RES_STR1( S_INVALID_POSITION, MethodString( nMethodId ) ) );
- }
- }
-
- Window* pTemp = NULL;
- while ( !pTemp && pControl )
- {
- pTemp = GetFadeSplitWin( pControl, aWindowAlign );
- pControl = pControl->GET_REAL_PARENT();
- }
-
- if ( !pTemp )
- {
- ReportError( aUId, GEN_RES_STR1( S_SPLITWIN_NOT_FOUND, MethodString( nMethodId ) ) );
- break;
- }
-
- pControl = pTemp; // So da� wir unten ohne Fehler durchkommen
- SplitWindow *pSW = (SplitWindow*) pTemp;
-
- switch( nMethodId )
- {
- case M_FadeIn:
- if ( pSW->IsFadeInButtonVisible() )
- pSW->FadeIn();
- break;
- case M_FadeOut:
- if ( pSW->IsFadeOutButtonVisible() )
- pSW->FadeOut();
- break;
- case M_Pin:
- if ( ( pSW->GetAutoHideState() && bBool1 )
- || ( !pSW->GetAutoHideState() && !bBool1 ) )
- {
- MouseEvent aMEvnt;
- Point aPt( pSW->GetAutoHideRect().Center() );
- aMEvnt = MouseEvent( aPt,1,MOUSE_SIMPLECLICK,MOUSE_LEFT );
- ImplMouseButtonDown( pControl, aMEvnt, FORCE_DIRECT_CALL );
- ImplMouseButtonUp ( pControl, aMEvnt, FORCE_DIRECT_CALL );
- }
- break;
- case M_IsFadeIn:
- pRet->GenReturn ( RET_Value, aUId, pSW->IsFadeOutButtonVisible() );
- break;
- case M_IsPin:
- pRet->GenReturn ( RET_Value, aUId, (comm_BOOL)!pSW->GetAutoHideState() );
- break;
- default:
- ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) );
- }
- SendProfile( UIdString( aUId ).Append('.').Append( MethodString( nMethodId ) ) );
- }
- break;
- case M_StatusGetText:
- case M_StatusIsProgress:
- case M_StatusGetItemCount:
- case M_StatusGetItemId:
- {
- StatusBar *pStatus = NULL;
- while ( !pStatus && pControl )
- {
- pStatus = (StatusBar*)GetWinByRT( pControl, WINDOW_STATUSBAR, sal_True );
- pControl = pControl->GET_REAL_PARENT();
- }
-
- if ( !pStatus )
- {
- ReportError( aUId, GEN_RES_STR1( S_NO_STATUSBAR, MethodString( nMethodId ) ) );
- break;
- }
-
- switch ( nMethodId )
- {
- case M_StatusGetText:
- {
- if ( (nParams & PARAM_UINT16_1) )
- {
- if ( pStatus->AreItemsVisible() )
- pRet->GenReturn ( RET_Value, aUId, String(pStatus->GetItemText(nNr1)));
- else
- ReportError( aUId, GEN_RES_STR1( S_ITEMS_INVISIBLE, MethodString( nMethodId ) ) );
- }
- else
- {
- if ( pStatus->AreItemsVisible() )
- {
- if ( pStatus->GetItemCount() == 1 )
- {
- pRet->GenReturn ( RET_Value, aUId, pStatus->GetItemText( pStatus->GetItemId(0) ));
- }
- else
- {
- pRet->GenReturn ( RET_Value, aUId, String() );
- }
- }
- else
- pRet->GenReturn ( RET_Value, aUId, (String)pStatus->GetText() );
- }
- }
- break;
- case M_StatusIsProgress:
- {
- pRet->GenReturn ( RET_Value, aUId, (comm_BOOL)pStatus->IsProgressMode() );
- }
- break;
- case M_StatusGetItemCount:
- if ( pStatus->AreItemsVisible() )
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(pStatus->GetItemCount()));
- else
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(0));
- break;
- case M_StatusGetItemId:
- if ( ValueOK(aUId, MethodString( nMethodId ),nNr1,pStatus->GetItemCount()) )
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(pStatus->GetItemId(nNr1-1)));
- break;
- }
- }
- break;
- case M_HasScrollBar:
- case M_IsScrollBarEnabled:
- {
- if ( (nParams | PARAM_UINT16_1) != PARAM_UINT16_1 ) // so there are other params
- {
- ReportError( aUId, GEN_RES_STR0( S_INVALID_PARAMETERS ) );
- break;
- }
-
- if( !(nParams & PARAM_UINT16_1) )
- nNr1 = CONST_ALIGN_RIGHT; // default is right Scrollbar(vertical)
-
- if ( (nNr1 != CONST_ALIGN_RIGHT) && (nNr1 != CONST_ALIGN_BOTTOM) )
- {
- ReportError( aUId, GEN_RES_STR1( S_INVALID_POSITION, MethodString( nMethodId ) ) );
- break;
- }
-
- ScrollBar *pScroll = NULL;
-
- sal_uInt16 nSteps = 2;
- while ( !pScroll && pControl && nSteps-- )
- {
- pScroll = GetScrollBar( pControl, nNr1, sal_True );
- pControl = pControl->GET_REAL_PARENT();
- }
-
- switch ( nMethodId )
- {
- case M_HasScrollBar:
- {
- if ( pScroll )
- pRet->GenReturn ( RET_Value, aUId, (comm_BOOL)sal_True );
- else
- pRet->GenReturn ( RET_Value, aUId, (comm_BOOL)sal_False );
- }
- break;
- case M_IsScrollBarEnabled:
- {
- if ( !pScroll )
- {
- ReportError( aUId, GEN_RES_STR1( S_NO_SCROLLBAR, MethodString( nMethodId ) ) );
- break;
- }
- pRet->GenReturn ( RET_Value, aUId, pScroll->IsEnabled() );
- }
- break;
- }
- }
- break;
- default:
- return sal_False;
- }
- return sal_True;
-}
-
-
-sal_Bool StatementControl::Execute()
-{
- Window *pControl;
- sal_Bool bStatementDone = sal_True;
-
-
- if ( IsError )
- {
- #if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Skipping Window: " );
- m_pDbgWin->AddText( Id2Str( aUId ) );
- m_pDbgWin->AddText( " Method: " );
- m_pDbgWin->AddText( String::CreateFromInt32( nMethodId ) );
- m_pDbgWin->AddText( "\n" );
- #endif
- Advance();
- delete this;
- return sal_True;
- }
-
- InitProfile();
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Executing Window: " );
- m_pDbgWin->AddText( Id2Str( aUId ) );
- m_pDbgWin->AddText( " Method: " );
- m_pDbgWin->AddText( String::CreateFromInt32( nMethodId ) );
- m_pDbgWin->AddText( "\n" );
-#endif
-
-
- if ( aUId.equals( UID_ACTIVE ) )
- pControl = GetAnyActive();
- else
- {
- sal_Bool bSearchButtonOnToolbox = (nParams == PARAM_NONE) && ((M_Click == nMethodId) || (M_TearOff == nMethodId) || (M_IsEnabled == nMethodId) || (M_OpenMenu == nMethodId));
- bSearchButtonOnToolbox |= (nParams == PARAM_UINT16_1) && (M_GetState == nMethodId);
- if ( nMethodId == M_TypeKeys || nMethodId == M_MouseDown
- || nMethodId == M_MouseUp || nMethodId == M_MouseMove
- || nMethodId == M_SnapShot )
- {
- pControl = NULL;
- if ( /*(nMethodId == M_SnapShot || nMethodId == M_TypeKeys) &&*/ !pControl )
- pControl = SearchTree( aUId ,bSearchButtonOnToolbox );
- }
- else
- pControl = SearchTree( aUId ,bSearchButtonOnToolbox );
- }
-
-
- if ( pControl && pControl->GetType() == WINDOW_TOOLBOX )
- {
- if ( !aUId.equals( pControl->GetUniqueOrHelpId() ) )
- { // Also wenn wir irgendwas auf einer Toolbox gefunden haben
- switch ( nMethodId )
- {
- case M_Click:
- case M_TearOff:
- case M_OpenMenu:
- case M_GetState:
- break;
- case M_IsEnabled:
- nMethodId = _M_IsEnabled; // Umlabeln, da die Behandlung essentiell anders ist!
- break;
- default:
- pControl = NULL;
- }
- }
- }
-
-
- switch ( nMethodId )
- {
- case M_Exists:
- case M_NotExists:
- Time aT;
- sal_uInt16 aSeconds = aT.GetMin()*60+aT.GetSec();
- if ( !bBool2 ) // wurde im Konstruktor auf sal_False gesetzt
- {
- bBool2 = sal_True;
- nNr2 = aSeconds;
- if( !(nParams & PARAM_UINT16_1) )
- nNr1 = 0; // defaultm��ig sofort zur�ck
- }
- if ( aSeconds < nNr2 ) // Falls die Stunde umgesprungen ist
- aSeconds += 60*60;
-
- if ( !pControl || !pControl->IsVisible() )
- pControl = NULL;
- if ( ((nMethodId == M_Exists) && pControl) ||
- ((nMethodId == M_NotExists) && !pControl) )
- { // Wenn Bedingung erf�llt
- pRet->GenReturn ( RET_Value, aUId, (comm_BOOL)sal_True );
- }
- else
- if ( aSeconds <= nNr2 + nNr1 ) // Zeit ist noch nicht abgelaufen
- return sal_False;
- else
- pRet->GenReturn ( RET_Value, aUId, (comm_BOOL)sal_False );
-
- Advance();
- delete this;
- return sal_True;
- }
-
-
- short nRT = 0;
-
- if( pControl ) // Das Fenster Existiert irgendwo, kann aber auch hidden sein!
- {
- nRT = ImpGetRType( pControl );
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Type is: " );
- m_pDbgWin->AddText( String::CreateFromInt32( nRT ) );
- m_pDbgWin->AddText( "\n" );
-#endif
- }
-
- if ( nRT == C_Window && // Search for WorkWindow to satisfy these commands
- ( nMethodId == M_Close
- || nMethodId == M_IsMax
- || nMethodId == M_IsMin
- || nMethodId == M_IsRestore
- || nMethodId == M_Minimize
- || nMethodId == M_Maximize
- || nMethodId == M_Restore ) )
- {
- Window* pNewControl = pControl;
- while ( pNewControl && pNewControl->GetType() != WINDOW_WORKWINDOW )
- pNewControl = pNewControl->GET_REAL_PARENT();
-
- if ( pNewControl )
- {
- pControl = pNewControl;
- nRT = C_WorkWin;
- }
- }
-
-
- if ( (!ControlOK( pControl, "" )) && ( nMethodId != M_SnapShot ) && (nRetryCount--))
- {
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( CUniString("Reschedule command (").Append( UniString::CreateFromInt32(nRetryCount) ).AppendAscii(")\n") );
-#endif
- return sal_False;
- }
-
- if( ControlOK( pControl, "" ) )
- {
- if ( nMethodId == M_OpenContextMenu && !bBool2 )
- {
- pControl->GrabFocus(); // to get asyncron focus on unix
- bBool2 = sal_True;
- return sal_False;
- }
- // TODO: handle GetFocus for all Methods and Windows like this (remove part below)
- // See for impact of changed focus for HandleVisibleControls() (taking Snapshots might be different, possible exclude those methods)
- if (( (nRT == C_TreeListBox) && !bBool2 )
- && nMethodId != M_TypeKeys // TypeKeys macht das selbst, falls eigenes Focushandling gew�nscht
- && nMethodId != M_MouseDown
- && nMethodId != M_MouseUp
- && nMethodId != M_MouseMove )
- {
- if ( !pControl->HasFocus() )
- {
- pControl->GrabFocus();
- int i = 10;
- while ( i-- && !pControl->HasFocus() ) // reschedule a bit
- {
- SafeReschedule();
- if ( !WinPtrValid( pControl ) )
- return sal_False;
- }
- if ( !pControl->HasFocus() ) // to get asyncronous focus
- {
- bBool2 = sal_True;
- return sal_False;
- }
- }
- }
- }
-
- Advance();
-
- if ( HandleVisibleControls( pControl ) )
- {
- delete this;
- return sal_True;
- }
- if( ControlOK( pControl, "Window/Control" ) )
- {
- if (((( nRT < C_TabPage && nRT > C_TabControl )
- || nRT == C_PatternBox
- || nRT == C_ToolBox
- || nRT == C_ValueSet
- || nRT == C_Control
- || nRT == C_TreeListBox
- )
- || nMethodId == M_OpenContextMenu )
- && nMethodId != M_TypeKeys // TypeKeys macht das selbst, falls eigenes Focushandling gew�nscht
- && nMethodId != M_MouseDown
- && nMethodId != M_MouseUp
- && nMethodId != M_MouseMove )
- pControl->GrabFocus();
-
- if ( !HandleCommonMethods( pControl ) )
- {
- switch( nRT )
- {
- case C_TabControl:
- switch( nMethodId )
- {
- case M_GetPageId:
- if ( (nParams & PARAM_UINT16_1) )
- {
- if ( ValueOK(aUId, MethodString( nMethodId ),nNr1,((TabControl*)pControl)->GetPageCount() ) )
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)((TabControl*)pControl)->GetPageId(nNr1-1));
- }
- else
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)((TabControl*)pControl)->GetCurPageId());
- break;
- case M_GetPageCount:
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)((TabControl*)pControl)->GetPageCount());
- break;
- case M_SetPageId:
- if (((TabControl*)pControl)->GetCurPageId())
- ((TabControl*)pControl)->DeactivatePage();
- ((TabControl*)pControl)->SetCurPageId( nNr1 );
- ((TabControl*)pControl)->ActivatePage();
- break;
- case M_SetPageNr:
- if ( ValueOK(aUId, MethodString( nMethodId ),nNr1,((TabControl*)pControl)->GetPageCount() ) )
- {
- if (((TabControl*)pControl)->GetCurPageId())
- ((TabControl*)pControl)->DeactivatePage();
- ((TabControl*)pControl)->SetCurPageId( ((TabControl*)pControl)->GetPageId( nNr1-1 ) );
- ((TabControl*)pControl)->ActivatePage();
- }
- break;
- case M_GetPage:
- pRet->GenReturn ( RET_Value, aUId, Id2Str( ((TabControl*)pControl)->GetTabPage(((TabControl*)pControl)->GetCurPageId())->GetUniqueOrHelpId() ) );
- break;
- case M_SetPage :
- { // Wegen lokaler Variablen
- TabControl *pTControl = ((TabControl*)pControl);
- sal_uInt16 nActive = pTControl->GetCurPageId();
- sal_uInt16 i,anz;
- rtl::OString aID;
- rtl::OString aWantedID;
- //HELPID BACKWARD (No numbers please (remove PARAM_UINT32_1 part)
- if ( (nParams & PARAM_UINT32_1) )
- {
- ReportError( aUId, GEN_RES_STR1c( S_INTERNAL_ERROR, "using numeric HelpID from old Testtool" ) );
- }
- else if ( (nParams & PARAM_STR_1) )
- {
- aWantedID = Str2Id( aString1 );
- }
- else
- ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) );
-
- i = pTControl->GetPagePos( pTControl->GetCurPageId() );
- for ( anz=0 ; anz < pTControl->GetPageCount() && !aID.equals( aWantedID ) ; anz++ )
- {
- pTControl->SelectTabPage( pTControl->GetPageId(i) );
- aID = pTControl->GetTabPage(pTControl->GetCurPageId())->GetUniqueOrHelpId();
- i++;
- if ( i >= pTControl->GetPageCount() )
- i = 0;
- if ( !MaybeDoTypeKeysDelay( pTControl ) || !MaybeDoTypeKeysDelay( pTControl ) || !MaybeDoTypeKeysDelay( pTControl ) ) // 3 Mal aufrufen
- break;
- }
- if ( !aID.equals( aWantedID ) )
- {
- pTControl->SelectTabPage( nActive );
- ReportError( aWantedID, GEN_RES_STR1( S_TABPAGE_NOT_FOUND, MethodString( nMethodId ) ) );
- }
- }
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "TabControl" ) );
- break;
- }
- break;
- case C_RadioButton:
- case C_ImageRadioButton:
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, MitteLinks);
- break;
- case M_IsChecked :
- pRet->GenReturn ( RET_Value, aUId, ((RadioButton*)pControl)->IsChecked());
- break;
- case M_Check :
- ((RadioButton*)pControl)->Check();
- ((RadioButton*)pControl)->Click();
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "RadioButton" ) );
- break;
- }
- break;
- case C_CheckBox:
- case C_TriStateBox:
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, MitteLinks);
- break;
- case M_IsChecked :
- pRet->GenReturn ( RET_Value, aUId, comm_BOOL( ((TriStateBox*)pControl)->GetState() == STATE_CHECK) );
- break;
- case M_IsTristate :
- pRet->GenReturn ( RET_Value, aUId, comm_BOOL( ((TriStateBox*)pControl)->GetState() == STATE_DONTKNOW) );
- break;
- case M_GetState :
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(((TriStateBox*)pControl)->GetState()));
- break;
- case M_Check :
- ((TriStateBox*)pControl)->SetState( STATE_CHECK );
- ((TriStateBox*)pControl)->Click();
- break;
- case M_UnCheck :
- ((TriStateBox*)pControl)->SetState( STATE_NOCHECK );
- ((TriStateBox*)pControl)->Click();
- break;
- case M_TriState :
- if ( ((TriStateBox*)pControl)->IsTriStateEnabled() )
- {
- ((TriStateBox*)pControl)->SetState( STATE_DONTKNOW );
- ((TriStateBox*)pControl)->Click();
- }
- else
- {
- ReportError( aUId, GEN_RES_STR0( S_TRISTATE_NOT_ALLOWED ) );
- }
- break;
- case M_Click :
- {
- TriStateBox *pTB = ((TriStateBox*)pControl);
- if ( pTB->GetState() == STATE_NOCHECK )
- pTB->SetState( STATE_CHECK );
- else if ( pTB->GetState() == STATE_CHECK )
- {
- if ( pTB->IsTriStateEnabled() )
- pTB->SetState( STATE_DONTKNOW );
- else
- pTB->SetState( STATE_NOCHECK );
- }
- else
- pTB->SetState( STATE_NOCHECK );
- pTB->Click();
- }
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "TriStateBox" ) );
- break;
- }
- break;
- case C_Edit:
- case C_MultiLineEdit:
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, Mitte);
- break;
- case M_GetText :
- pRet->GenReturn ( RET_Value, aUId, ((Edit*)pControl)->GetText());
- break;
- case M_IsWritable:
- pRet->GenReturn ( RET_Value, aUId, (comm_BOOL) !((Edit*)pControl)->IsReadOnly() );
- break;
- default:
- if ( ! ((Edit*)pControl)->IsReadOnly() )
- {
- switch( nMethodId )
- {
- case M_SetText :
- ((Edit*)pControl)->SetText( aString1 );
- if ( nRT == C_MultiLineEdit ) // since SetModifyFlag is not virtual we have to do this
- ((MultiLineEdit*)pControl)->SetModifyFlag();
- else
- ((Edit*)pControl)->SetModifyFlag();
- ((Edit*)pControl)->Modify();
- if ( ((Edit*)pControl)->GetText().CompareTo(aString1) != COMPARE_EQUAL )
- ReportError( aUId, GEN_RES_STR1( S_ERROR_IN_SET_TEXT, MethodString( nMethodId ) ) );
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "(MultiLine)Edit" ) );
- break;
- }
- }
- else
- ReportError( aUId, GEN_RES_STR1c( S_ATTEMPT_TO_WRITE_READONLY, "(MultiLine)Edit" ) );
- }
- break;
- case C_MultiListBox:
- case C_ListBox:
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, MitteOben);
- break;
- case M_GetSelCount :
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(((ListBox*)pControl)->GetSelectEntryCount()));
- break;
- case M_GetSelIndex :
- if ( ! (nParams & PARAM_UINT16_1) )
- {
- if ( ((ListBox*)pControl)->GetSelectEntryCount() == 0 )
- {
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(0));
- break;
- }
- nNr1 = 1;
- }
- ValueOK(aUId, MethodString( nMethodId ),nNr1,((ListBox*)pControl)->GetSelectEntryCount());
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(((ListBox*)pControl)->GetSelectEntryPos(nNr1-1)) +1);
- break;
- case M_GetSelText :
- if ( ! (nParams & PARAM_UINT16_1) )
- nNr1 = 1;
- pRet->GenReturn ( RET_Value, aUId, ((ListBox*)pControl)->GetSelectEntry(nNr1-1));
- break;
- case M_GetItemCount :
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(((ListBox*)pControl)->GetEntryCount()));
- break;
- case M_GetItemText :
- pRet->GenReturn ( RET_Value, aUId, ((ListBox*)pControl)->GetEntry(nNr1-1));
- break;
- case M_Select:
- case M_MultiSelect:
- {
- sal_Bool bUnselectBeforeSelect = ( nMethodId == M_Select );
- sal_Bool bFehler = sal_False;
- if ( ! (nParams & PARAM_BOOL_1) )
- bBool1 = sal_True;
-
- if ( nMethodId == M_MultiSelect && nRT == C_ListBox )
- {
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "ListBox" ) );
- bFehler = sal_True;
- }
-
- if ( !bBool1 && nMethodId == M_Select )
- {
- ReportError( aUId, GEN_RES_STR1( S_NO_SELECT_FALSE, MethodString( nMethodId ) ) );
- bFehler = sal_True;
- }
-
- if ( !bFehler )
- {
- if( nParams & PARAM_STR_1 )
- {
- ListBox *pLB = ((ListBox*)pControl);
- sal_uInt16 nPos;
- if ( (nPos = pLB->GetEntryPos( aString1 )) == LISTBOX_ENTRY_NOTFOUND )
- ReportError( aUId, GEN_RES_STR2( S_ENTRY_NOT_FOUND, MethodString( nMethodId ), aString1 ) );
- else
- {
- if ( bUnselectBeforeSelect )
- pLB->SetNoSelection();
- pLB->SelectEntryPos( nPos, bBool1 );
- if ( pLB->IsEntryPosSelected( nPos ) ? !bBool1 : bBool1 ) // XOR rein mit BOOL
- ReportError( aUId, GEN_RES_STR2( S_METHOD_FAILED, MethodString( nMethodId ), aString1 ) );
- }
- }
- else
- {
- ListBox *pLB = ((ListBox*)pControl);
- pLB = static_cast<ListBox*>(pControl);
- if ( ValueOK(aUId, MethodString( nMethodId ),nNr1,pLB->GetEntryCount()) )
- {
- if ( bUnselectBeforeSelect )
- pLB->SetNoSelection();
- pLB->SelectEntryPos( nNr1-1, bBool1 );
- if ( pLB->IsEntryPosSelected( nNr1-1 ) ? !bBool1 : bBool1 ) // XOR rein mit BOOL
- ReportError( aUId, GEN_RES_STR2( S_METHOD_FAILED, MethodString( nMethodId ), UniString::CreateFromInt32( nNr1 ) ) );
- }
- }
- ((ListBox*)pControl)->Select();
- }
- }
- break;
- case M_SetNoSelection :
- ((ListBox*)pControl)->SetNoSelection();
- ((ListBox*)pControl)->Select();
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "(Multi)ListBox" ) );
- break;
- }
- break;
- case C_ComboBox:
- case C_PatternBox:
- case C_NumericBox:
- case C_MetricBox:
- case C_CurrencyBox:
- case C_DateBox:
- case C_TimeBox:
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, MitteOben);
- break;
- case M_GetSelText :
- pRet->GenReturn ( RET_Value, aUId, ((ComboBox*)pControl)->GetText());
- break;
- case M_GetSelIndex :
- {
- sal_uInt16 nPos = ((ComboBox*)pControl)->GetEntryPos(((ComboBox*)pControl)->GetText());
- if ( nPos == COMBOBOX_ENTRY_NOTFOUND )
- nPos = 0;
- else
- nPos++;
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32) nPos);
- }
- break;
- case M_GetItemCount :
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(((ComboBox*)pControl)->GetEntryCount()));
- break;
- case M_GetItemText :
- pRet->GenReturn ( RET_Value, aUId, ((ComboBox*)pControl)->GetEntry(nNr1-1));
- break;
- case M_IsWritable:
- pRet->GenReturn ( RET_Value, aUId, (comm_BOOL) !((ComboBox*)pControl)->IsReadOnly() );
- break;
- case M_Select :
- if( nParams & PARAM_UINT16_1 )
- {
- if ( !ValueOK(aUId, MethodString( nMethodId ),nNr1,((ComboBox*)pControl)->GetEntryCount()) )
- break;
- aString1 = ((ComboBox*)pControl)->GetEntry(nNr1-1);
- }
- else
- {
- if ( ((ComboBox*)pControl)->GetEntryPos( aString1 ) == COMBOBOX_ENTRY_NOTFOUND )
- {
- ReportError( aUId, GEN_RES_STR2( S_ENTRY_NOT_FOUND, MethodString( nMethodId ), aString1 ) );
- break;
- }
- }
-
-
- ((ComboBox*)pControl)->SetText( aString1 );
- ((ComboBox*)pControl)->SetModifyFlag();
- ((ComboBox*)pControl)->Modify();
- break;
- case M_SetText :
- if ( ! ((ComboBox*)pControl)->IsReadOnly() )
- {
- if ( ! (nParams & PARAM_STR_1) )
- aString1 = String();
- ((ComboBox*)pControl)->SetText( aString1 );
- ((ComboBox*)pControl)->SetModifyFlag();
- ((ComboBox*)pControl)->Modify();
- }
- else
- ReportError( aUId, GEN_RES_STR1c( S_ATTEMPT_TO_WRITE_READONLY, "ComboBox" ) );
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "ComboBox" ) );
- break;
- }
- break;
- case C_PushButton:
- case C_OkButton:
- case C_CancelButton:
- case C_ImageButton:
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, Mitte);
- break;
- case M_Click :
- ((PushButton*)pControl)->Click();
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "PushButton" ) );
- break;
- }
- break;
- case C_MoreButton:
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, Mitte);
- break;
- case M_IsOpen :
- pRet->GenReturn ( RET_Value, aUId, ((MoreButton*)pControl)->GetState());
- break;
- case M_Click :
- ((MoreButton*)pControl)->Click();
- break;
- case M_Open :
- ((MoreButton*)pControl)->SetState(sal_True);
- break;
- case M_Close :
- ((MoreButton*)pControl)->SetState(sal_False);
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "MoreButton" ) );
- break;
- }
- break;
- case C_SpinField:
- case C_PatternField:
- case C_NumericField:
- case C_MetricField:
- case C_CurrencyField:
- case C_DateField:
- case C_TimeField:
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, Mitte);
- break;
- case M_GetText :
- pRet->GenReturn ( RET_Value, aUId, ((SpinField*)pControl)->GetText());
- break;
- case M_IsWritable:
- pRet->GenReturn ( RET_Value, aUId, (comm_BOOL) !((SpinField*)pControl)->IsReadOnly() );
- break;
- case M_SetText :
- if ( ! ((SpinField*)pControl)->IsReadOnly() )
- {
- ((SpinField*)pControl)->SetText( aString1 );
- ((SpinField*)pControl)->SetModifyFlag();
- ((SpinField*)pControl)->Modify();
- }
- else
- ReportError( aUId, GEN_RES_STR1c( S_ATTEMPT_TO_WRITE_READONLY, "SpinField" ) );
- break;
- case M_More :
- {
- if ( !(nParams & PARAM_UINT16_1) )
- nNr1 = 1;
- for (int i = 1; i<= nNr1; i++)
- {
- ((SpinField*)pControl)->Up();
- ((SpinField*)pControl)->SetModifyFlag();
- ((SpinField*)pControl)->Modify();
- }
- }
- break;
- case M_Less :
- {
- if ( !(nParams & PARAM_UINT16_1) )
- nNr1 = 1;
- for (int i = 1; i<= nNr1; i++)
- {
- ((SpinField*)pControl)->Down();
- ((SpinField*)pControl)->SetModifyFlag();
- ((SpinField*)pControl)->Modify();
- }
- }
- break;
- case M_ToMin :
- ((SpinField*)pControl)->First();
- ((SpinField*)pControl)->SetModifyFlag();
- ((SpinField*)pControl)->Modify();
- break;
- case M_ToMax :
- ((SpinField*)pControl)->Last();
- ((SpinField*)pControl)->SetModifyFlag();
- ((SpinField*)pControl)->Modify();
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "SpinField" ) );
- break;
- }
- break;
-
- case C_MenuButton:
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, Mitte);
- break;
- case M_Click :
- {
- MouseEvent aMEvnt;
- Point aPt( pControl->GetSizePixel().Width() / 2, pControl->GetSizePixel().Height() / 2 );
- aMEvnt = MouseEvent( aPt,1,MOUSE_SIMPLECLICK,MOUSE_LEFT );
- ImplMouseButtonDown( pControl, aMEvnt, FORCE_DIRECT_CALL );
- ImplMouseButtonUp ( pControl, aMEvnt, FORCE_DIRECT_CALL );
- }
- break;
- case M_Open :
- case M_OpenMenu :
- {
- MouseEvent aMEvnt;
- Point aPt( pControl->GetSizePixel().Width() / 2, pControl->GetSizePixel().Height() / 2 );
- aMEvnt = MouseEvent( aPt,1,MOUSE_SIMPLECLICK,MOUSE_LEFT );
- ImplMouseButtonDown( pControl, aMEvnt, FORCE_DIRECT_CALL );
-
- sal_uLong nStart = Time::GetSystemTicks();
- sal_uLong nDelay = pControl->GetSettings().GetMouseSettings().GetActionDelay();
- while ( ( Time::GetSystemTicks() - nStart ) < nDelay + 100 )
- SafeReschedule();
-
- ImplMouseButtonUp ( pControl, aMEvnt, FORCE_DIRECT_CALL );
-
- aSubMenuId1 = 0;
- aSubMenuId2 = 0;
- aSubMenuId3 = 0;
- pMenuWindow = NULL;
- }
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "MenuButton" ) );
- break;
- }
- break;
- case C_ToolBox:
- {
- ToolBox *pTB = ((ToolBox*)pControl);
- if ( !aUId.equals( pTB->GetUniqueOrHelpId() ) ) // So we found a Button on the ToolBox
- {
- if ( (nParams == PARAM_NONE) || (nParams == PARAM_UINT16_1) )
- { // Wir f�lschen einen Parameter
- nParams |= PARAM_STR_1;
- aString1 = Id2Str( aUId );
- }
- else
- ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) );
- }
-
-#define FIND_ITEM\
- sal_uInt16 nItemPos = 0;\
- sal_Bool bItemFound = sal_False;\
- {\
- rtl::OString aButtonId;\
- if( nParams & PARAM_STR_1 )\
- aButtonId = Str2Id( aString1 );\
- else\
- ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) );\
- for ( nItemPos = 0; nItemPos < pTB->GetItemCount() && !aButtonId.equals(Str2Id( pTB->GetItemCommand(pTB->GetItemId(nItemPos)) )) &&\
- !aButtonId.equals(pTB->GetHelpId(pTB->GetItemId(nItemPos))) ; nItemPos++ ) {}\
- bItemFound = aButtonId.equals(Str2Id( pTB->GetItemCommand(pTB->GetItemId(nItemPos)) )) || aButtonId.equals(pTB->GetHelpId(pTB->GetItemId(nItemPos)));\
- if ( !bItemFound )\
- ReportError( aUId, GEN_RES_STR1( S_HELPID_ON_TOOLBOX_NOT_FOUND, MethodString( nMethodId ) ) );\
- else\
- {\
- if ( !pTB->IsItemEnabled( pTB->GetItemId(nItemPos) ) && nMethodId != _M_IsEnabled && nMethodId != M_GetState )\
- {\
- ReportError( aUId, GEN_RES_STR1( S_BUTTON_DISABLED_ON_TOOLBOX, MethodString( nMethodId ) ) );\
- bItemFound = sal_False;\
- }\
- else if ( !pTB->IsItemVisible( pTB->GetItemId(nItemPos) ) && nMethodId != M_GetState )\
- {\
- ReportError( aUId, GEN_RES_STR1( S_BUTTON_HIDDEN_ON_TOOLBOX, MethodString( nMethodId ) ) );\
- bItemFound = sal_False;\
- }\
- else\
- {\
- if ( pTB->IsMenuEnabled() )\
- { /* button is in Menu */\
- }\
- else\
- { /* Try the multi line way */\
- if ( pTB->GetItemRect(pTB->GetItemId(nItemPos)).IsEmpty() )\
- {\
- sal_uInt16 nLine = pTB->GetCurLine();\
- do\
- {\
- pTB->ShowLine( sal_False );\
- for ( int i = 1 ; i < 30 ; i++ )\
- SafeReschedule();\
- }\
- while ( pTB->GetCurLine() != nLine && pTB->GetItemRect(pTB->GetItemId(nItemPos)).IsEmpty() );\
- pTB->Invalidate( pTB->GetScrollRect() );\
- }\
- if ( pTB->GetItemRect(pTB->GetItemId(nItemPos)).IsEmpty() )\
- {\
- ReportError( aUId, GEN_RES_STR1( S_CANNOT_MAKE_BUTTON_VISIBLE_IN_TOOLBOX, MethodString( nMethodId ) ) );\
- bItemFound = sal_False;\
- }\
- }\
- }\
- }\
- }
-
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, MitteLinks);
- break;
- case M_Click :
- {
- FIND_ITEM;
- if ( bItemFound ) // FIND_ITEM Erfolgreich
- {
- Rectangle aRect = pTB->GetItemRect(pTB->GetItemId(nItemPos));
- if ( aRect.IsEmpty() )
- {
- pTB->ExecuteCustomMenu();
-
- aSubMenuId1 = 0;
- aSubMenuId2 = 0;
- aSubMenuId3 = 0;
- pMenuWindow = NULL;
-
- new StatementCommand( this, RC_MenuSelect, PARAM_UINT16_1, pTB->GetItemId(nItemPos) + TOOLBOX_MENUITEM_START );
- }
- else
- {
- aRect = pTB->GetItemRect(pTB->GetItemId(nItemPos));
- MouseEvent aMEvnt;
- aMEvnt = MouseEvent(aRect.Center(),1,MOUSE_SIMPLECLICK,MOUSE_LEFT);
- ImplMouseButtonDown( pTB, aMEvnt, FORCE_DIRECT_CALL );
- ImplMouseButtonUp ( pTB, aMEvnt, FORCE_DIRECT_CALL );
- }
- }
- }
- break;
- case M_TearOff :
- {
- FIND_ITEM;
- if ( bItemFound ) // FIND_ITEM Erfolgreich
- {
- Rectangle aRect = pTB->GetItemPosDropDownRect( nItemPos );
- AnimateMouse( pControl, aRect.Center() );
- MouseEvent aMEvnt(aRect.Center(),1,MOUSE_SIMPLECLICK,MOUSE_LEFT);
- ImplMouseButtonDown( pTB, aMEvnt, FORCE_DIRECT_CALL );
-
- Window *pWin = NULL;
- // Wait for the window to open.
- StatementList::bExecuting = sal_True; // Bah ist das ein ekliger Hack
- { // Das verhindert, da� schon der n�chste Befehl ausgef�hrt wird.
- Time aDelay;
- while ( !pWin && ( (pWin = GetPopupFloatingWin()) == NULL ) && ( Time() - aDelay ).GetSec() < 15 )
- SafeReschedule();
- }
- StatementList::bExecuting = sal_False; // Bah ist das ein ekliger Hack
-
- if ( pWin && pWin->GetType() == WINDOW_FLOATINGWINDOW )
- {
- aMEvnt = MouseEvent(aRect.Center(),1,MOUSE_SIMPLECLICK,MOUSE_LEFT);
- ImplMouseButtonUp( pTB, aMEvnt, FORCE_DIRECT_CALL );
- ((FloatingWindow*)pWin)->EndPopupMode( FLOATWIN_POPUPMODEEND_TEAROFF );
- }
- else
- {
- aMEvnt = MouseEvent(Point(1,-10), 1, MOUSE_SIMPLECLICK,MOUSE_LEFT);
- ImplMouseButtonUp( pTB, aMEvnt, FORCE_DIRECT_CALL );
- ReportError( aUId, GEN_RES_STR1( S_TEAROFF_FAILED, MethodString( nMethodId ) ) );
- }
- }
- }
- break;
- case M_OpenMenu :
- {
- FIND_ITEM;
- if ( bItemFound ) // FIND_ITEM Erfolgreich
- {
- Rectangle aRect = pTB->GetItemPosDropDownRect( nItemPos );
- AnimateMouse( pControl, aRect.Center() );
- MouseEvent aMEvnt(aRect.Center(),1,MOUSE_SIMPLECLICK,MOUSE_LEFT);
- ImplMouseButtonDown( pTB, aMEvnt);
- ImplMouseButtonUp( pTB, aMEvnt);
-
- // Das Fenster ist offen.
- aSubMenuId1 = 0;
- aSubMenuId2 = 0;
- aSubMenuId3 = 0;
- pMenuWindow = NULL;
- }
- }
- break;
- case _M_IsEnabled:
- {
- FIND_ITEM;
- if ( bItemFound ) // FIND_ITEM Erfolgreich
- {
- pRet->GenReturn ( RET_Value, aUId, pTB->IsItemEnabled( pTB->GetItemId(nItemPos) ) );
- }
- }
- break;
- case M_GetState :
- {
- FIND_ITEM;
- if ( bItemFound ) // FIND_ITEM Erfolgreich
- {
- if ( ValueOK( aUId, CUniString("GetState"), nNr1, 4 ) )
- switch (nNr1)
- {
- case 0:
- pRet->GenReturn ( RET_Value, aUId, Id2Str( pTB->GetHelpId(pTB->GetItemId(nItemPos)) ) );
- break;
- case 1:
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)pTB->GetItemType(nItemPos));
- break;
- case 2:
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)pTB->GetItemState(pTB->GetItemId(nItemPos)));
- break;
- case 3:
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)pTB->GetItemId(nItemPos));
- break;
- default:
- ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) );
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(0));
- break;
- }
- }
- }
- break;
- case M_GetItemText :
- pRet->GenReturn ( RET_Value, aUId, (String)pTB->GetItemText(nNr1));
- break;
- case M_GetText :
- pRet->GenReturn ( RET_Value, aUId, (String)pTB->GetText());
- break;
- case M_GetItemCount :
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)pTB->GetItemCount());
- break;
- case M_SetNextToolBox :
- if ( (nParams & PARAM_STR_1) )
- pTB->SetNextToolBox( aString1 );
- else
- pTB->SetNextToolBox( pTB->GetNextToolBox() );
- pTB->NextToolBox();
- break;
- case M_GetNextToolBox :
- pRet->GenReturn ( RET_Value, aUId, (String)pTB->GetNextToolBox());
- break;
- case M_Dock :
- case M_Undock :
- case M_IsDocked :
- case M_Close:
- case M_Size:
- case M_Move:
- case M_IsMax:
- case M_Minimize:
- case M_Maximize:
- case M_Help: // Alles was unten weiterbehandelt werden soll
- goto DockingWin;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "ToolBox" ) );
- break;
- }
- }
- break;
-
- case C_TreeListBox:
- switch( nMethodId )
- {
-
-
-
-#define GET_NTH_ENTRY_LBOX( First, Next, Anzahl) \
- SvLBoxEntry *pThisEntry = ((SvTreeListBox*)pControl)->First(); \
- { \
- int niTemp = Anzahl; \
- while ( niTemp-- ) \
- { \
- pThisEntry = ((SvTreeListBox*)pControl)->Next( pThisEntry ); \
- } \
- }
-
- case M_GetText : // Get the first text of the given (default=1) line
- { // should get removed some time
- SvTreeListBox *pTree = (SvTreeListBox*)pControl;
- SvLBoxEntry *pThisEntry = pTree->GetCurEntry();
- if ( ! (nParams & PARAM_UINT16_1) )
- nNr1 = 1;
- if ( pThisEntry )
- {
- SvLBoxString* pItem = NULL;
- sal_uInt16 nValidTextItemCount = 0;
- {
- sal_uInt16 nIndex = 0;
- SvLBoxItem *pMyItem;
- while ( ( nValidTextItemCount < nNr1 ) && nIndex < pThisEntry->ItemCount() )
- {
- pMyItem = pThisEntry->GetItem( nIndex );
- if ( pMyItem->IsA() == SV_ITEM_ID_LBOXSTRING )
- {
- pItem = (SvLBoxString*)pMyItem;
- nValidTextItemCount++;
- }
- nIndex++;
- }
- }
- if ( ValueOK( aUId, CUniString("GetText"), nNr1, nValidTextItemCount ) )
- pRet->GenReturn ( RET_Value, aUId, pItem->GetText() );
- }
- else
- ReportError( aUId, GEN_RES_STR2c2( S_NO_SELECTED_ENTRY, MethodString( nMethodId ), "TreeListBox" ) );
- }
- break;
- case M_GetSelCount :
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(((SvLBox*)pControl)->GetSelectionCount()));
- break;
- case M_GetItemCount :
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(((SvLBox*)pControl)->GetVisibleCount()) );
- break;
- case M_GetSelIndex :
- if ( ! (nParams & PARAM_UINT16_1) )
- nNr1 = 1;
- if ( ValueOK(aUId, CUniString("GetSelIndex"),nNr1,((SvLBox*)pControl)->GetSelectionCount()) )
- {
- nNr1--;
- GET_NTH_ENTRY_LBOX( FirstSelected, NextSelected, nNr1);
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32( ((SvTreeListBox*)pControl)->GetVisiblePos( pThisEntry )) +1 );
- }
- break;
- case M_Select :
- if ( ! (nParams & PARAM_BOOL_1) )
- bBool1 = sal_True;
- if( nParams & PARAM_STR_1 )
- {
- ReportError( aUId, GEN_RES_STR1( S_SELECT_DESELECT_VIA_STRING_NOT_IMPLEMENTED, MethodString( nMethodId ) ) );
- }
- else
- {
- if ( ValueOK(aUId, MethodString( nMethodId ),nNr1,((SvLBox*)pControl)->GetVisibleCount()) )
- {
- SvLBoxEntry *pEntry = (SvLBoxEntry*)((SvTreeListBox*)pControl)->GetEntryAtVisPos( nNr1-1 );
- ((SvTreeListBox*)pControl)->Select ( pEntry, bBool1 );
- }
- }
- break;
- case M_GetSelText :
- if ( ! (nParams & PARAM_UINT16_1) )
- nNr1 = 1;
- if ( ! (nParams & PARAM_UINT16_2) )
- nNr2 = 1;
- if ( ValueOK(aUId, CUniString("GetSelText"),nNr1,((SvLBox*)pControl)->GetSelectionCount()) )
- {
- nNr1--;
- GET_NTH_ENTRY_LBOX( FirstSelected, NextSelected, nNr1);
- if ( ValueOK( aUId, MethodString( nMethodId ),nNr2,pThisEntry->ItemCount() ) )
- {
- SvLBoxString* pItem = NULL;
- if ( ! (nParams & PARAM_UINT16_2) )
- pItem = (SvLBoxString*)pThisEntry->GetFirstItem( SV_ITEM_ID_LBOXSTRING );
- else
- {
- SvLBoxItem *pMyItem = pThisEntry->GetItem( nNr2-1 );
- if ( pMyItem->IsA() == SV_ITEM_ID_LBOXSTRING )
- pItem = (SvLBoxString*)pMyItem;
- }
-
- if ( pItem )
- pRet->GenReturn ( RET_Value, aUId, pItem->GetText() );
- else
- ReportError( aUId, GEN_RES_STR1( S_NO_LIST_BOX_STRING, MethodString( nMethodId ) ) );
- }
- }
- break;
- case M_GetItemText :
- if ( ValueOK(aUId, MethodString( nMethodId ),nNr1,((SvLBox*)pControl)->GetVisibleCount()) )
- {
- SvLBoxEntry *pThisEntry = (SvLBoxEntry*)((SvTreeListBox*)pControl)->GetEntryAtVisPos( nNr1-1 );
- if ( ! (nParams & PARAM_UINT16_2) )
- nNr2 = 1;
- if ( ValueOK( aUId, MethodString( nMethodId ),nNr2,pThisEntry->ItemCount() ) )
- {
- SvLBoxString* pItem = NULL;
- if ( ! (nParams & PARAM_UINT16_2) )
- pItem = (SvLBoxString*)pThisEntry->GetFirstItem( SV_ITEM_ID_LBOXSTRING );
- else
- {
- SvLBoxItem *pMyItem = pThisEntry->GetItem( nNr2-1 );
- if ( pMyItem->IsA() == SV_ITEM_ID_LBOXSTRING )
- pItem = (SvLBoxString*)pMyItem;
- }
-
- if ( pItem )
- pRet->GenReturn ( RET_Value, aUId, pItem->GetText() );
- else
- ReportError( aUId, GEN_RES_STR1( S_NO_LIST_BOX_STRING, MethodString( nMethodId ) ) );
- }
- }
- break;
- case M_IsChecked :
- case M_IsTristate :
- case M_GetState :
- case M_Check :
- case M_UnCheck :
- case M_TriState :
- {
- SvTreeListBox *pTree = (SvTreeListBox*)pControl;
- SvLBoxEntry *pThisEntry = NULL;
-
- if ( ! (nParams & PARAM_UINT16_1) )
- {
- pThisEntry = pTree->GetCurEntry();
- if ( !pThisEntry )
- ReportError( aUId, GEN_RES_STR2c2( S_NO_SELECTED_ENTRY, MethodString( nMethodId ), "TreeListBox" ) );
- }
- else
- {
- if ( ValueOK(aUId, MethodString( nMethodId ),nNr1,((SvLBox*)pControl)->GetVisibleCount()) )
- {
- pThisEntry = (SvLBoxEntry*)pTree->GetEntryAtVisPos( nNr1-1 );
- }
- }
-
- if ( ! (nParams & PARAM_UINT16_2) )
- nNr2 = 1;
-
- if ( pThisEntry )
- {
- if ( ValueOK( aUId, MethodString( nMethodId ),nNr2,pThisEntry->ItemCount() ) )
- {
- SvLBoxButton* pItem = NULL;
- if ( ! (nParams & PARAM_UINT16_2) )
- pItem = (SvLBoxButton*)pThisEntry->GetFirstItem( SV_ITEM_ID_LBOXBUTTON );
- else
- {
- SvLBoxItem *pMyItem = pThisEntry->GetItem( nNr2-1 );
- if ( pMyItem->IsA() == SV_ITEM_ID_LBOXBUTTON )
- pItem = (SvLBoxButton*)pMyItem;
- }
-
- if ( pItem )
- {
- switch( nMethodId )
- {
- case M_IsChecked :
- pRet->GenReturn ( RET_Value, aUId, comm_BOOL( pItem->IsStateChecked() ) );
- break;
- case M_IsTristate :
- pRet->GenReturn ( RET_Value, aUId, comm_BOOL( pItem->IsStateTristate() ) );
- break;
- case M_GetState :
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32( pItem->GetButtonFlags() & ~SV_STATE_MASK ));
- break;
- case M_Check :
- if ( !pItem->IsStateChecked() )
- {
- pItem->SetStateChecked();
- pTree->CheckButtonHdl();
- pTree->InvalidateEntry( pThisEntry );
- }
- break;
- case M_UnCheck :
- if ( pItem->IsStateChecked() || pItem->IsStateTristate() )
- {
- pItem->SetStateUnchecked();
- pTree->CheckButtonHdl();
- pTree->InvalidateEntry( pThisEntry );
- }
- break;
- case M_TriState :
- if ( !pItem->IsStateTristate() )
- {
- pItem->SetStateTristate();
- pTree->CheckButtonHdl();
- pTree->InvalidateEntry( pThisEntry );
- }
- break;
- default:
- ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) );
- break;
- }
- }
- else
- ReportError( aUId, GEN_RES_STR1( S_NO_LIST_BOX_BUTTON, MethodString( nMethodId ) ) );
- }
- }
- }
- break;
- case M_GetItemType :
- {
- SvTreeListBox *pTree = (SvTreeListBox*)pControl;
- SvLBoxEntry *pThisEntry = NULL;
-
- if ( ! (nParams & PARAM_UINT16_1) )
- {
- pThisEntry = pTree->GetCurEntry();
- if ( !pThisEntry )
- ReportError( aUId, GEN_RES_STR2c2( S_NO_SELECTED_ENTRY, MethodString( nMethodId ), "TreeListBox" ) );
- }
- else
- {
- if ( ValueOK(aUId, MethodString( nMethodId ),nNr1,((SvLBox*)pControl)->GetVisibleCount()) )
- {
- pThisEntry = (SvLBoxEntry*)pTree->GetEntryAtVisPos( nNr1-1 );
- }
- }
-
- if ( pThisEntry )
- {
- if ( ! (nParams & PARAM_UINT16_2) )
- nNr2 = 1;
- if ( ValueOK( aUId, MethodString( nMethodId ),nNr2,pThisEntry->ItemCount() ) )
- {
- SvLBoxItem *pMyItem = pThisEntry->GetItem( nNr2-1 );
- comm_UINT16 nType;
- switch ( pMyItem->IsA() )
- {
- case SV_ITEM_ID_LBOXSTRING: nType = CONST_ItemTypeText ; break;
- case SV_ITEM_ID_LBOXBMP: nType = CONST_ItemTypeBMP ; break;
- case SV_ITEM_ID_LBOXBUTTON: nType = CONST_ItemTypeCheckbox ; break;
- case SV_ITEM_ID_LBOXCONTEXTBMP: nType = CONST_ItemTypeContextBMP ; break;
- default: nType = CONST_ItemTypeUnknown;
- }
- pRet->GenReturn ( RET_Value, aUId, nType );
- }
- }
- }
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "TreeListBox" ) );
- break;
- }
- break;
- case C_Control:
- {
- sal_uInt16 nRealControlType = 0;
- if ( dynamic_cast< EditBrowseBox* >(pControl) )
- nRealControlType = CONST_CTBrowseBox;
- else if ( dynamic_cast< ValueSet* >(pControl) )
- nRealControlType = CONST_CTValueSet;
- else if ( dynamic_cast< ORoadmap* >(pControl) )
- nRealControlType = CONST_CTORoadmap;
- else if ( dynamic_cast< IExtensionListBox* >(pControl) )
- nRealControlType = CONST_CTIExtensionListBox;
- else if ( dynamic_cast< ::svt::table::TableControl* >(pControl) )
- nRealControlType = CONST_CTTableControl;
- else
- nRealControlType = CONST_CTUnknown;
-
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, MitteOben);
- break;
- default:
- switch( nRealControlType )
- {
- case CONST_CTBrowseBox:
- {
- EditBrowseBox* pEBBox = dynamic_cast< EditBrowseBox* >(pControl);
- switch( nMethodId )
- {
- case M_GetSelText :
- {
- pRet->GenReturn ( RET_Value, aUId, pEBBox->GetCellText( pEBBox->GetCurrRow(), pEBBox->GetColumnId( pEBBox->GetCurrColumn() )));
- }
- break;
- case M_GetColumnCount :
- {
- sal_uInt16 nColCount = pEBBox->GetColumnCount();
- comm_UINT16 nUnfrozenColCount = 0;
- sal_uInt16 i;
- for ( i=0 ; i < nColCount ; i++ )
- {
- if ( !pEBBox->IsFrozen( pEBBox->GetColumnId( i ) ) )
- nUnfrozenColCount++;
- }
- pRet->GenReturn ( RET_Value, aUId, nUnfrozenColCount );
- }
- break;
- case M_GetRowCount :
- {
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)pEBBox->GetRowCount() );
- }
- break;
- case M_IsEditing :
- {
- CellControllerRef aControler;
- aControler = pEBBox->Controller();
- pRet->GenReturn ( RET_Value, aUId, (comm_BOOL)aControler.Is() );
- }
- break;
- case M_Select :
- {
- if ( ValueOK(aUId, MethodString( nMethodId ),nNr1,pEBBox->GetRowCount() ) )
- {
- sal_uInt16 nColCount = pEBBox->GetColumnCount();
- comm_UINT16 nUnfrozenColCount = 0;
- sal_uInt16 i;
- for ( i=0 ; i < nColCount ; i++ )
- {
- if ( !pEBBox->IsFrozen( pEBBox->GetColumnId( i ) ) )
- nUnfrozenColCount++;
- }
- if ( ValueOK(aUId, MethodString( nMethodId ),nNr2,nUnfrozenColCount ) )
- pEBBox->GoToRowColumnId( nNr1-1, pEBBox->GetColumnId( nNr2 ) );
- }
- }
- break;
-
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "EditBrowseBox" ) );
- break;
- }
- }
- break;
- case CONST_CTValueSet:
- {
- ValueSet *pVS = dynamic_cast< ValueSet* >(pControl);
- switch ( nMethodId )
- {
- case M_GetItemCount:
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32( pVS->GetItemCount()));
- break;
- case M_GetItemText:
- if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pVS->GetItemCount() ))
- pRet->GenReturn ( RET_Value, aUId, pVS->GetItemText( pVS->GetItemId( nNr1-1 ) ) );
- break;
- case M_Select:
- if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pVS->GetItemCount() ))
- pVS->SelectItem( pVS->GetItemId( nNr1-1 ) );
- break;
- case M_GetSelIndex :
- if ( pVS->IsNoSelection() )
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(0));
- else
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32( pVS->GetItemPos( pVS->GetSelectItemId() ) +1));
- break;
- case M_GetSelText :
- if ( pVS->IsNoSelection() )
- pRet->GenReturn ( RET_Value, aUId, String() );
- else
- pRet->GenReturn ( RET_Value, aUId, pVS->GetItemText( pVS->GetSelectItemId() ) );
- break;
- case M_SetNoSelection :
- pVS->SetNoSelection();
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "ValueSet" ) );
- break;
- }
- }
- break;
- case CONST_CTORoadmap:
- {
- ORoadmap *pRM = dynamic_cast< ORoadmap* >(pControl);
- switch ( nMethodId )
- {
- case M_GetItemCount:
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32( pRM->GetItemCount()));
- break;
- case M_GetItemText:
- if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pRM->GetItemCount() ))
- pRet->GenReturn ( RET_Value, aUId, pRM->GetRoadmapItemLabel( pRM->GetItemID( nNr1-1 ) ) );
- break;
- case M_Select:
- if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pRM->GetItemCount() ))
- {
- if ( pRM->IsRoadmapItemEnabled( pRM->GetItemID( nNr1-1 ) ) )
- pRM->SelectRoadmapItemByID( pRM->GetItemID( nNr1-1 ) );
- else
- ReportError( aUId, GEN_RES_STR1c( S_WIN_DISABLED, "RoadmapItem" ) );
- }
- break;
- case M_GetSelIndex :
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32( pRM->GetItemIndex( pRM->GetCurrentRoadmapItemID() ) +1));
- break;
- case M_GetSelText :
- pRet->GenReturn ( RET_Value, aUId, pRM->GetRoadmapItemLabel( pRM->GetCurrentRoadmapItemID() ) );
- break;
- case M_IsItemEnabled :
- if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pRM->GetItemCount() ))
- pRet->GenReturn ( RET_Value, aUId, (comm_BOOL)pRM->IsRoadmapItemEnabled( pRM->GetItemID( nNr1-1 ) ) );
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "RoadMap" ) );
- break;
- }
- }
- break;
- case CONST_CTIExtensionListBox:
- {
- IExtensionListBox *pELB = dynamic_cast< IExtensionListBox* >(pControl);
- switch ( nMethodId )
- {
- case M_GetItemCount:
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32( pELB->getItemCount()));
- break;
- case M_GetItemText:
- if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pELB->getItemCount() ))
- switch ( nNr2 )
- {
- case 1:
- pRet->GenReturn ( RET_Value, aUId, pELB->getItemName( nNr1 -1 ) );
- break;
- case 2:
- pRet->GenReturn ( RET_Value, aUId, pELB->getItemVersion( nNr1 -1 ) );
- break;
- case 3:
- pRet->GenReturn ( RET_Value, aUId, pELB->getItemDescription( nNr1 -1 ) );
- break;
- case 4:
- pRet->GenReturn ( RET_Value, aUId, pELB->getItemPublisher( nNr1 -1 ) );
- break;
- case 5:
- pRet->GenReturn ( RET_Value, aUId, pELB->getItemPublisherLink( nNr1 -1 ) );
- break;
- default:
- ValueOK( aUId, MethodString( nMethodId ).AppendAscii(" String Number"), nNr2, 5 );
- }
- break;
- case M_Select:
- if ( (nParams & PARAM_UINT16_1) )
- {
- if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pELB->getItemCount() ))
- {
- pELB->select( nNr1-1 );
- }
- }
- else if ( (nParams & PARAM_STR_1) )
- {
- pELB->select( aString1 );
- sal_Bool bSuccess = sal_True;
- if ( pELB->getSelIndex() == EXTENSION_LISTBOX_ENTRY_NOTFOUND )
- bSuccess = sal_False;
- else
- {
- if ( !aString1.Equals( String( pELB->getItemName( pELB->getSelIndex() ) ) ) )
- bSuccess = sal_False;
- }
- if ( !bSuccess )
- ReportError( aUId, GEN_RES_STR2( S_ENTRY_NOT_FOUND, MethodString( nMethodId ), aString1 ) );
- }
- break;
- case M_GetSelCount :
- if ( pELB->getSelIndex() == EXTENSION_LISTBOX_ENTRY_NOTFOUND )
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32( 0 ));
- else
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32( 1 ));
- break;
- case M_GetSelIndex :
- if ( pELB->getSelIndex() == EXTENSION_LISTBOX_ENTRY_NOTFOUND )
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32( 0 ));
- else
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32( pELB->getSelIndex() +1));
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "RoadMap" ) );
- break;
- }
- }
- break;
-
- case CONST_CTTableControl:
- {
- ::svt::table::TableControl *pTC = dynamic_cast< ::svt::table::TableControl* >(pControl);
- switch ( nMethodId )
- {
- case M_GetItemType :
- {
- if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetColumnCount() ) &&
- ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() ))
- {
- ::svt::table::PTableModel pModel = pTC->GetModel();
- Any aCell;
- pModel->getCellContent( nNr1-1, nNr2-1, aCell );
- pRet->GenReturn ( RET_Value, aUId, String( aCell.getValueTypeName() ));
- }
- }
- break;
- case M_GetItemText :
- {
- if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetColumnCount() ) &&
- ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() ))
- {
- ::svt::table::PTableModel pModel = pTC->GetModel();
- Any aCell;
- pModel->getCellContent( nNr1-1, nNr2-1, aCell );
-
- Type aType = aCell.getValueType();
- TypeClass eTypeClass = aType.getTypeClass();
- switch( eTypeClass )
- {
- case TypeClass_BOOLEAN:
- pRet->GenReturn ( RET_Value, aUId, *(sal_Bool*)aCell.getValue() );
- break;
- case TypeClass_CHAR:
- {
- ::rtl::OUString aContent( *(sal_Unicode*)aCell.getValue() );
- pRet->GenReturn ( RET_Value, aUId, aContent );
- }
- break;
- case TypeClass_STRING:
- {
- ::rtl::OUString aContent;
- aCell >>= aContent;
- pRet->GenReturn ( RET_Value, aUId, aContent );
- }
- break;
- case TypeClass_BYTE:
- case TypeClass_SHORT:
- case TypeClass_LONG:
- case TypeClass_HYPER:
- case TypeClass_UNSIGNED_LONG:
- case TypeClass_UNSIGNED_HYPER:
- {
- comm_UINT32 val = 0;
- aCell >>= val;
- pRet->GenReturn ( RET_Value, aUId, val );
- }
- break;
- case TypeClass_UNSIGNED_SHORT:
- {
- comm_UINT16 val = 0;
- aCell >>= val;
- pRet->GenReturn ( RET_Value, aUId, val );
- }
- break;
- default:
- pRet->GenReturn ( RET_Value, aUId, comm_UINT16(0) );
- break;
- }
- }
- }
- break;
- case M_GetColumnCount :
- {
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)pTC->GetColumnCount() );
- }
- break;
- case M_GetRowCount :
- {
- pRet->GenReturn ( RET_Value, aUId, (comm_UINT32)pTC->GetRowCount() );
- }
- break;
- case M_Select :
- {
- if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetRowCount() ))
- {
- if ( pTC->GoToRow( ::svt::table::RowPos( nNr1-1 ) ) )
- {
- Size aSize( pTC->GetSizePixel() );
- Point aPos( aSize.Width() / 2, aSize.Height() / 2 );
- long nStep = aSize.Height() / 4;
- ::svt::table::RowPos nLastPos;
- while ( ( nLastPos = pTC->getTableControlInterface().hitTest( aPos ).nRow ) != nNr1-1 && nStep > 0 )
- {
- if ( nLastPos > nNr1-1 || nLastPos == ROW_INVALID )
- aPos.Y() -= nStep;
- else
- aPos.Y() += nStep;
- nStep /= 2;
- }
- if ( pTC->getTableControlInterface().hitTest( aPos ).nRow == nNr1-1 )
- {
- MouseEvent aMEvnt(aPos,1,MOUSE_SIMPLECLICK|MOUSE_SELECT,MOUSE_LEFT,KEY_MOD1);
- pTC->getSelEngine()->SelMouseButtonDown( aMEvnt );
- pTC->getSelEngine()->SelMouseButtonUp( aMEvnt );
- if ( pTC->IsRowSelected( nNr1-1 ) )
- pTC->Select();
- }
- else
- ReportError( aUId, GEN_RES_STR2c2( S_METHOD_FAILED, MethodString( nMethodId ), "find pos" ) );
- }
- else
- ReportError( aUId, GEN_RES_STR2c2( S_METHOD_FAILED, MethodString( nMethodId ), "GoTo" ) );
- }
- }
- break;
- case M_GetSelCount :
- pRet->GenReturn ( RET_Value, aUId, comm_UINT16( pTC->GetSelectedRowCount() ));
- break;
- case M_GetSelIndex :
- if ( ! (nParams & PARAM_UINT16_1) )
- nNr1 = 1;
- if ( ValueOK( aUId, CUniString("GetSelIndex"), nNr1, pTC->GetSelectedRowCount() ) )
- pRet->GenReturn ( RET_Value, aUId, comm_UINT16( pTC->GetSelectedRowIndex( nNr1-1 ) +1 ) );
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "TableControl" ) );
- break;
- }
- }
- break;
-
- case CONST_CTUnknown:
- ReportError( aUId, GEN_RES_STR2( S_UNKNOWN_TYPE, UniString::CreateFromInt32( nRT ), MethodString(nMethodId) ) );
- break;
- default:
- ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) );
- break;
- }
- }
- break;
- }
- case C_Window:
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, MitteOben);
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "Window" ) );
- break;
- }
- break;
-
- case C_DockingWin:
- DockingWin:
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, MitteOben);
- break;
- case M_Dock :
- if ( ((DockingWindow*)pControl)->IsFloatingMode() )
- ((DockingWindow*)pControl)->SetFloatingMode(sal_False);
- else
- ReportError( aUId, GEN_RES_STR1( S_ALLOWED_ONLY_IN_FLOATING_MODE, MethodString( nMethodId ) ) );
- break;
- case M_Undock :
- if ( !((DockingWindow*)pControl)->IsFloatingMode() )
- ((DockingWindow*)pControl)->SetFloatingMode(sal_True);
- else
- ReportError( aUId, GEN_RES_STR1( S_ALLOWED_ONLY_IN_FLOATING_MODE, MethodString( nMethodId ) ) );
- break;
- case M_IsDocked :
- pRet->GenReturn ( RET_Value, aUId, (comm_BOOL) !((DockingWindow*)pControl)->IsFloatingMode());
- break;
- case M_Close:
- DBG_ASSERT( aUId.equals( pControl->GetUniqueOrHelpId() ), "aUID != UniqueOrHelpId");
- SET_WINP_CLOSING(pControl);
- ((DockingWindow*)pControl)->Close();
- break;
- case M_Size:
- case M_Move:
- case M_IsMax:
- case M_Minimize:
- case M_Maximize:
- if ( ((DockingWindow*)pControl)->IsFloatingMode() )
- {
- Window* pFloat = ((DockingWindow*)pControl)->GetFloatingWindow();
- if ( !pFloat && ((DockingWindow*)pControl)->IsFloatingMode() )
- {
- if ( pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_FLOATINGWINDOW )
- pFloat = pControl->GET_REAL_PARENT();
- else
- {
- OSL_FAIL("FloatingMode set but Parent is no FloatingWindow");
- }
- }
- if ( pFloat && pFloat->GetType() == WINDOW_FLOATINGWINDOW )
- {
- pControl = pFloat;
- goto FloatWin;
- }
- else
- ReportError( aUId, GEN_RES_STR1( S_CANNOT_FIND_FLOATING_WIN, MethodString( nMethodId ) ) );
- }
- else
- ReportError( aUId, GEN_RES_STR1( S_ALLOWED_ONLY_IN_DOCKING_MODE, MethodString( nMethodId ) ) );
- break;
- case M_Help: // Alles was unten weiterbehandelt werden soll
- goto MoreDialog;
-
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "DockingWindow" ) );
- break;
- }
- break;
- case C_FloatWin:
- FloatWin:
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, MitteOben);
- break;
- case M_IsMax :
- pRet->GenReturn ( RET_Value, aUId, (comm_BOOL)!((FloatingWindow*)pControl)->IsRollUp());
- break;
- case M_Minimize :
- ((FloatingWindow*)pControl)->RollUp();
- break;
- case M_Maximize :
- ((FloatingWindow*)pControl)->RollDown();
- break;
- case M_Size:
- {
- if ( pControl->GetStyle() & WB_SIZEABLE )
- {
- Size aMin = ((FloatingWindow*)pControl)->GetMinOutputSizePixel();
- if ( aMin.Width() <= nNr1 && aMin.Height() <= nNr2 )
- {
- pControl->SetSizePixel(Size(nNr1,nNr2));
- pControl->Resize();
- }
- else
- {
- ReportError( aUId, GEN_RES_STR2( S_SIZE_BELOW_MINIMUM, String::CreateFromInt32( aMin.Width() ), String::CreateFromInt32( aMin.Height() ) ) );
- }
- }
- else
- ReportError( aUId, GEN_RES_STR1( S_SIZE_NOT_CHANGEABLE, MethodString( nMethodId ) ) );
- break;
- }
- case M_Close:
- DBG_ASSERT( aUId.equals( pControl->GetUniqueOrHelpId() ), "aUID != UniqueOrHelpId");
- SET_WINP_CLOSING(pControl);
- ((FloatingWindow*)pControl)->Close();
- break;
- case M_Help: // Alles was unten weiterbehandelt werden soll
- case M_Move:
- goto MoreDialog;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "FloatingWin" ) );
- break;
- }
- break;
- case C_ModelessDlg:
- case C_ModalDlg:
- case C_Dialog:
- case C_TabDlg:
- MoreDialog:
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, MitteOben);
- break;
- case M_Close:
- DBG_ASSERT( aUId.equals( pControl->GetUniqueOrHelpId() ), "aUID != UniqueOrHelpId");
- SET_WINP_CLOSING(pControl);
- ((SystemWindow*)pControl)->Close();
- break;
- case M_OK:
- {
- Window *pChild = GetWinByRT( pControl, WINDOW_OKBUTTON );
- if( ControlOK( pChild, "OK Button" ) )
- {
- DBG_ASSERT( aUId.equals( pControl->GetUniqueOrHelpId() ), "aUID != UniqueOrHelpId");
- SET_WINP_CLOSING(pControl);
- ((Button*)pChild)->Click();
- }
- break;
- }
- case M_Cancel:
- {
- Window *pChild = GetWinByRT( pControl, WINDOW_CANCELBUTTON );
- if( ControlOK( pChild, "Cancel Button" ) )
- {
- DBG_ASSERT( aUId.equals( pControl->GetUniqueOrHelpId() ), "aUID != UniqueOrHelpId");
- SET_WINP_CLOSING(pControl);
- ((Button*)pChild)->Click();
- }
- break;
- }
- case M_Help:
- {
- Window *pChild = GetWinByRT( pControl, WINDOW_HELPBUTTON );
- if( ControlOK( pChild, "Help Button" ) )
- ((Button*)pChild)->Click();
- break;
- }
- case M_Default:
- {
- Window *pChild = ImpGetButton( pControl, WB_DEFBUTTON, WB_DEFBUTTON );
- if( ControlOK( pChild, "Default Button" ) )
- ((Button*)pChild)->Click();
- break;
- }
- case M_Move:
- {
- pControl->SetPosPixel(Point(nNr1,nNr2));
- break;
- }
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "Dialog" ) );
- break;
- }
- break;
- case C_WorkWin:
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, MitteOben);
- break;
- case M_Close:
- DBG_ASSERT( aUId.equals( pControl->GetUniqueOrHelpId() ), "aUID != UniqueOrHelpId");
- SET_WINP_CLOSING(pControl);
- ((WorkWindow*)pControl)->Close();
- break;
- case M_Size:
- case M_Move:
- goto FloatWin;
- case M_IsMax :
- pRet->GenReturn ( RET_Value, aUId, ((WorkWindow*)pControl)->IsMaximized() );
- break;
- case M_IsMin :
- pRet->GenReturn ( RET_Value, aUId, ((WorkWindow*)pControl)->IsMinimized() );
- break;
- case M_IsRestore :
- pRet->GenReturn ( RET_Value, aUId, comm_BOOL (!((WorkWindow*)pControl)->IsMaximized() && !((WorkWindow*)pControl)->IsMinimized()) );
- break;
- case M_Minimize :
- ((WorkWindow*)pControl)->Maximize( sal_False );
- ((WorkWindow*)pControl)->Minimize();
- break;
- case M_Maximize :
- ((WorkWindow*)pControl)->Maximize();
- break;
- case M_Restore :
- ((WorkWindow*)pControl)->Maximize( sal_False );
- ((WorkWindow*)pControl)->Restore();
- break;
- case M_Help: // Alles was unten weiterbehandelt werden soll
- goto MoreDialog;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "WorkWindow" ) );
- break;
- }
- break;
- case C_TabPage:
- ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) );
- break;
- case C_MessBox:
- case C_InfoBox:
- case C_WarningBox:
- case C_ErrorBox:
- case C_QueryBox:
- {
- sal_Bool bDone = sal_True;
- MessBox* pMB = (MessBox*)pControl;
- switch( nMethodId )
- {
- case M_GetCheckBoxText:
- pRet->GenReturn ( RET_Value, aUId, pMB->GetCheckBoxText() );
- break;
- case M_IsChecked :
- pRet->GenReturn ( RET_Value, aUId, comm_BOOL( pMB->GetCheckBoxState() == STATE_CHECK) );
- break;
- case M_Check :
- pMB->SetCheckBoxState( sal_True );
- break;
- case M_UnCheck :
- pMB->SetCheckBoxState( sal_False );
- break;
- case M_GetText :
- pRet->GenReturn ( RET_Value, aUId, pMB->GetMessText());
- break;
-
- default:
- bDone = sal_False;
- break;
- }
- if ( bDone )
- break; // break the case here else continue at C_ButtonDialog
- }
- case C_ButtonDialog:
- {
- ButtonDialog* pBD = (ButtonDialog*)pControl;
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "Working MessBox: " );
- if (pControl->IsVisible())
- m_pDbgWin->AddText("*(Visible)\n");
- else
- m_pDbgWin->AddText("*(nicht Visible)\n");
-#endif
- switch( nMethodId )
- {
- case M_AnimateMouse :
- AnimateMouse( pControl, Mitte);
- break;
- case M_OK:
- if ( pBD->GetPushButton( BUTTONID_OK ) )
- {
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(RET_OK);
- }
- else
- ReportError( aUId, GEN_RES_STR1( S_NO_OK_BUTTON, MethodString( nMethodId ) ) );
- break;
- case M_Cancel:
- if ( pBD->GetPushButton( BUTTONID_CANCEL ) )
- {
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(RET_CANCEL);
- }
- else
- ReportError( aUId, GEN_RES_STR1( S_NO_CANCEL_BUTTON, MethodString( nMethodId ) ) );
- break;
- case M_Yes:
- if ( pBD->GetPushButton( BUTTONID_YES ) )
- {
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(RET_YES);
- }
- else
- ReportError( aUId, GEN_RES_STR1( S_NO_YES_BUTTON, MethodString( nMethodId ) ) );
- break;
- case M_No:
- if ( pBD->GetPushButton( BUTTONID_NO ) )
- {
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(RET_NO);
- }
- else
- ReportError( aUId, GEN_RES_STR1( S_NO_NO_BUTTON, MethodString( nMethodId ) ) );
- break;
- case M_Repeat:
- if ( pBD->GetPushButton( BUTTONID_RETRY ) )
- {
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(RET_RETRY);
- }
- else
- ReportError( aUId, GEN_RES_STR1( S_NO_RETRY_BUTTON, MethodString( nMethodId ) ) );
- break;
- case M_Help:
- if ( pBD->GetPushButton( BUTTONID_HELP ) )
- {
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(BUTTONID_HELP);
- }
- else
- ReportError( aUId, GEN_RES_STR1( S_NO_HELP_BUTTON, MethodString( nMethodId ) ) );
- break;
- case M_Default:
- {
- WinBits Style = pControl->GetStyle();
- if ( Style & WB_DEF_OK )
- {
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(RET_OK);
- }
- else if ( Style & WB_DEF_CANCEL )
- {
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(RET_CANCEL);
- }
- else if ( Style & WB_DEF_YES )
- {
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(RET_YES);
- }
- else if ( Style & WB_DEF_NO )
- {
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(RET_NO);
- }
- else if ( Style & WB_DEF_RETRY )
- {
- SET_WINP_CLOSING(pControl);
- pBD->EndDialog(RET_RETRY);
- }
- else
- ReportError( aUId, GEN_RES_STR1( S_NO_DEFAULT_BUTTON, MethodString( nMethodId ) ) );
- }
- break;
- case M_GetText :
- pRet->GenReturn ( RET_Value, aUId, pControl->GetText());
- break;
- case M_Click:
- if ( nParams & PARAM_UINT16_1 )
- {
- if ( pBD->GetPushButton( nNr1 ) )
- {
- if ( nNr1 != BUTTONID_HELP )
- {
- SET_WINP_CLOSING(pControl);
- }
- pBD->GetPushButton( nNr1 )->Click();
- }
- else
- ReportError( aUId, GEN_RES_STR2( S_NO_DEFAULT_BUTTON, UniString::CreateFromInt32( nNr1 ), MethodString( nMethodId ) ) );
- }
- else
- ReportError( aUId, GEN_RES_STR1( S_BUTTONID_REQUIRED, MethodString( nMethodId ) ) );
- break;
- case M_GetButtonCount :
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(pBD->GetButtonCount()));
- break;
- case M_GetButtonId :
- if ( ValueOK(aUId, MethodString( nMethodId ),nNr1,pBD->GetButtonCount()) )
- pRet->GenReturn ( RET_Value, aUId, comm_UINT32(pBD->GetButtonId(nNr1-1)));
- break;
- default:
- ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "MessageBox" ) );
- break;
- }
- break;
- }
- default:
- OSL_FAIL( "Unknown Objekttype from UId or Method not suported" );
- ReportError( aUId, GEN_RES_STR2( S_UNKNOWN_TYPE, UniString::CreateFromInt32( nRT ), MethodString(nMethodId) ) );
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( " Unknown Objekttype from UId or Method not suported" );
-#endif
- break;
- }
- }
- for( int i = 0; i < 32; i++ )
- SafeReschedule();
- }
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( "\n" );
-#endif
- if ( bStatementDone )
- {
- SendProfile( UIdString( aUId ).Append('.').Append( MethodString( nMethodId ) ) );
- delete this;
- }
- else
- {
- if ( nRetryCount-- )
- {
-#if OSL_DEBUG_LEVEL > 1
- m_pDbgWin->AddText( CUniString("Reschedule command (requed) (").Append( UniString::CreateFromInt32(nRetryCount) ).AppendAscii(")\n") );
-#endif
- QueStatement( this ); // will que at the start of the list
- }
- else
- {
- bStatementDone=sal_True;
- }
- }
- return bStatementDone;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/statemnt.hxx b/automation/source/server/statemnt.hxx
deleted file mode 100644
index fa8f0ffdd..000000000
--- a/automation/source/server/statemnt.hxx
+++ /dev/null
@@ -1,492 +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.
- *
- ************************************************************************/
-/***************************************************************************
-**
-** Von StatementList werden alle Statements abgeleitet.
-** Es gibt immer nur eine Statementliste, die verpointert ist.
-** jederzeit kann das der Anfang der Kette abgefragt werden.
-**
-***************************************************************************/
-#ifndef _STATEMNT_HXX
-#define _STATEMNT_HXX
-
-#include <tools/wintypes.hxx>
-#include <tools/string.hxx>
-#include <tools/debug.hxx>
-#include <tools/time.hxx>
-#include <vcl/menu.hxx>
-#include <vcl/svapp.hxx>
-#include <tools/fsys.hxx>
-#include <sot/storage.hxx>
-#include <basic/sbstar.hxx>
-#include <vcl/event.hxx>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <automation/commtypes.hxx>
-
-class Window;
-class SystemWindow;
-class Point;
-class SfxPoolItem;
-
-class ScrollBar;
-
-class SCmdStream;
-class RetStream;
-class ImplRemoteControl;
-
-class TTProfiler;
-class TTProperties;
-
-class Dir;
-
-class CommunicationLink;
-
-#if OSL_DEBUG_LEVEL > 1
-class EditWindow;
-#endif
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
- void SAL_CALL osl_TestToolDebugPrint( const sal_Char *pString );
-#ifdef __cplusplus
-}
-#endif
-
-
-#define IsVisible IsReallyVisible
-#define GET_REAL_PARENT() GetWindow( WINDOW_REALPARENT )
-
-// switch behaviour of ImplMouse* and ImplKeyInput
-#define FORCE_DIRECT_CALL sal_True
-
-typedef sal_uInt16 SearchFlags;
-#define SEARCH_NOOVERLAP ((SearchFlags) 0x0001)
-#define SEARCH_NO_TOPLEVEL_WIN ((SearchFlags) 0x0002)
-#define SEARCH_FOCUS_FIRST ((SearchFlags) 0x0004)
-#define SEARCH_FIND_DISABLED ((SearchFlags) 0x0008)
-
-class Search
-{
- SearchFlags nmSearchFlags;
-public:
- Search( SearchFlags nSearchFlags = 0): nmSearchFlags(nSearchFlags) {}
- virtual ~Search() {}
-
- virtual sal_Bool IsWinOK( Window *pWin ) = 0;
- SearchFlags GetSearchFlags() { return nmSearchFlags; }
- void AddSearchFlags( SearchFlags aNewFlags ) { nmSearchFlags |= aNewFlags; }
- void RemoveSearchFlags( SearchFlags aRemoveFlags ) { nmSearchFlags &= ( ~aRemoveFlags ); }
- sal_Bool HasSearchFlag( SearchFlags aQueryFlag ) { return (nmSearchFlags & aQueryFlag) == aQueryFlag; }
-};
-
-sal_Bool IsDialog(Window *pWin); // Ist *pWin von SystemWindow abgeleitet (Kann es Active sein)
-sal_Bool IsAccessable(Window *pWin); // Ist *pWin Zugreifbar (�ber IsEnabled und Parents gepr�ft)
-
-
-class SafePointer
-{
- SafePointer *pSelf;
-public:
- SafePointer() { pSelf = this; }
- virtual ~SafePointer() { DBG_ASSERT(pSelf==this,"Destructor von Nicht existierendem Objekt aufgerufen");
- pSelf = NULL; }
-};
-
-
-class DisplayHidWin;
-class StatementCommand;
-class TranslateWin;
-
-struct TTSettings
-{
- // DisplayHID
- StatementCommand *pDisplayInstance;
- DisplayHidWin *pDisplayHidWin;
- Window *Old;
- Window *Act;
- String aOriginalCaption;
-
- // Translate
- TranslateWin *pTranslateWin;
- sal_Bool bToTop;
-};
-
-
-TTSettings* GetTTSettings();
-
-
-#define MAX_RETRIES 9
-class StatementList : public SafePointer
-{
-private:
- StatementList(const StatementList&);
- StatementList & operator=(const StatementList&);
-
-protected:
- StatementList();
- sal_uInt16 nRetryCount;
- void QueStatement(StatementList *pAfterThis);
- sal_Bool bStatementInQue;
- static sal_uInt16 nUseBindings;
-
- static TTProfiler *pProfiler;
- void InitProfile();
- void SendProfile( String aText );
- static StatementList *pCurrentProfileStatement;
-
- static sal_Bool bIsInReschedule;
- static sal_uInt16 nModalCount;
- static Window *pLastFocusWindow; // Wenn dieses sich �ndert wird Safe Reschedule abgebrochen
- static sal_Bool bWasDragManager; // Wenn dieses sich �ndert wird Safe Reschedule abgebrochen
- static sal_Bool bWasPopupMenu; // Wenn dieses sich �ndert wird Safe Reschedule abgebrochen
- static sal_Bool bBasicWasRunning;
-
- static sal_uInt16 nMinTypeKeysDelay; /// Verz�gerung der einzelnen Anschl�ge f�r TypeKeys
- static sal_uInt16 nMaxTypeKeysDelay;
- static sal_Bool bDoTypeKeysDelay;
-
- static Window* pFirstDocFrame;
-
- static sal_Bool bIsSlotInExecute;
-
-public:
- static sal_Bool IsInReschedule() { return bIsInReschedule; }
- void SafeReschedule( sal_Bool bYield = sal_False ) // Setzt Flag, so da� nicht schon der n�chste Befehl ausgef�hrt wird
- {
- nModalCount = Application::GetModalModeCount();
- bIsInReschedule = sal_True;
- pLastFocusWindow = GetpApp()->GetFocusWindow();
- bWasDragManager = false /*!= DragManager::GetDragManager()*/;
- bWasPopupMenu = NULL != PopupMenu::GetActivePopupMenu();
- bBasicWasRunning = StarBASIC::IsRunning();
- bWasExecuting = bExecuting;
- if ( bYield )
- GetpApp()->Yield();
- else
- GetpApp()->Reschedule();
- bExecuting = bWasExecuting;
- bBasicWasRunning = sal_False;
- bWasPopupMenu = sal_False;
- bWasDragManager = sal_False;
- pLastFocusWindow = NULL;
- bIsInReschedule = sal_False;
- nModalCount = 0;
- }
- static sal_Bool MaybeResetSafeReschedule()
- { // Implementierung mu� hier zwar nicht sein, ist aber �bersichtlicher so
- if ( !bIsInReschedule )
- return sal_False;
-
- if ( pLastFocusWindow != GetpApp()->GetFocusWindow()
- || ( Application::GetModalModeCount() > nModalCount )
- || ( PopupMenu::GetActivePopupMenu() && !bWasPopupMenu )
- || ( StarBASIC::IsRunning() && !bBasicWasRunning ) )
- {
- bIsInReschedule = sal_False;
- pLastFocusWindow = NULL;
- return sal_True;
- }
- else
- return sal_False;
- }
- static void NormalReschedule() // Setzt das flag nicht
- {
- GetpApp()->Reschedule();
- }
-#define Reschedule RescheduleNichtBenutzen_StattdessenSafeRescheduleAnStatementList
-
- static Window* GetMouseWin();
- static sal_Bool WinPtrValid(Window *pTest);
- static Window* SearchAllWin( Window *pBase, Search &aSearch, sal_Bool MaybeBase = sal_True );
-protected:
- static Window* SearchClientWin( Window *pBase, Search &aSearch, sal_Bool MaybeBase = sal_True );
-
- Window* SearchTree( rtl::OString aUId, sal_Bool bSearchButtonOnToolbox = sal_False );
- Window* GetActive( WindowType nRT, sal_Bool MaybeBase = sal_True );
- Window* GetFocus( WindowType nRT, sal_Bool MaybeBase = sal_True );
- Window* GetAnyActive( sal_Bool MaybeBase = sal_True );
- ScrollBar* GetScrollBar( Window *pBase, sal_uInt16 nDirection, sal_Bool MaybeBase = sal_True );
- Window* GetPopupFloatingWin( sal_Bool MaybeBase = sal_True );
- Menu* GetMatchingMenu( Window* pWin, Menu* pBaseMenu = NULL );
- Window* GetWinByRT( Window *pBase, WindowType nRT, sal_Bool MaybeBase = sal_True, sal_uInt16 nSkip = 0, sal_Bool bSearchAll = sal_False );
- sal_uInt16 CountWinByRT( Window *pBase, WindowType nRT, sal_Bool MaybeBase = sal_True );
- Window* GetDocWin( sal_uInt16 nNr );
- sal_uInt16 GetDocWinCount();
- Window* GetFadeSplitWin( Window *pBase, WindowAlign nAlign, sal_Bool MaybeBase = sal_True );
- sal_Bool ValueOK(rtl::OString nId, String aBezeichnung, sal_uLong nValue, sal_uLong nMax);
-
- sal_uInt16 GetCurrentMenues( PopupMenu *&pPopup, MenuBar *&pMenuBar, Menu *&pMenu );
-
-public:
- virtual ~StatementList();
- void Advance();
- virtual sal_Bool Execute() = 0;
-/***************************************************************************
-** Bestimmt erst den n�chsten Befehl, setzt Current
-** und f�hrt dann aus.
-** Returnwert gibt an, ob Befehl nochmal ausgef�hrt
-** werden soll. Dann mu� auch der UserEvent verlassen werden, um der Applikation
-** normales Arbeiten zu erm�glichen (Dialog schliessen)
-** sal_True bedeutet, dass alles klar gegangen ist
-** sal_False bedeutet nochmal Bitte
-***************************************************************************/
-
- void ReportError(String aMessage);
- void ReportError(rtl::OString aUId, String aMessage);
- void ReportError(String aMessage, sal_uLong nWhatever);
-
- static void DirectLog( sal_uLong nType, String aString );
-
- String Tree(Window *pBase, int Indent);
- String ClientTree(Window *pBase, int Indent);
-
- StatementList *pNext;
- static StatementList /**pCurrent,*/ *pFirst;
- static sal_Bool bReadingCommands;
- static rtl::OString aWindowWaitUId;
- static Window *pWindowWaitPointer;
- static rtl::OString aWindowWaitOldHelpId;
- static rtl::OString aWindowWaitOldUniqueId;
- static RetStream *pRet;
- static sal_Bool IsError;
- static sal_Bool bDying;
- static sal_Bool bExecuting; // Gesetzt, wenn ein Befehl rescheduled ohne einen neuen Befehl zu erlauben
- sal_Bool bWasExecuting; // Wurde bei einem MaybeResetSafeReschedule resettet, so wird der Zustand danach wiederhergestellt
- static sal_uInt16 aSubMenuId1; // Untermen�s bei PopupMenus
- static sal_uInt16 aSubMenuId2; // erstmal 2-Stufig
- static sal_uInt16 aSubMenuId3; // and now even 3 levels #i31512#
- static SystemWindow *pMenuWindow; // when using MenuBar as base for MenuCommands
- static TTProperties *pTTProperties; // Hier stehen die SlotIDs aus dem SFX drin
-
- sal_Bool CheckWindowWait(); //True heisst, dass Window noch existiert
- //False -> Window weg;
- static void SetFirstDocFrame( Window* pWin );
- static Window* GetFirstDocFrame();
- static sal_Bool IsFirstDocFrame( Window* pWin );
- static sal_Bool IsDocWin( Window* pWin );
- static sal_Bool IsIMEWin( Window* pWin ); // Input Window for CJK under Solaris
- static sal_Bool IsDocFrame( Window* pWin );
- static MenuBar* GetDocFrameMenuBar( Window* pWin );
- static sal_uInt16 GetDocFrameCount();
-
- static sal_Bool bCatchGPF;
-
- static sal_Bool bUsePostEvents; // use Application::Post*Event or own impl to handle key and mouseevents
-
-#if OSL_DEBUG_LEVEL > 1
- static EditWindow *m_pDbgWin;
-#endif
-};
-
-class StatementSlot : public StatementList //Slots aufrufen
-{
-protected:
- sal_uInt16 nAnzahl;
- SfxPoolItem **pItemArr;
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> aArgs;
- sal_uInt16 nFunctionId; // can get removed when the old (numeric) slothandling is removed
- String aUnoUrl;
- sal_Bool bMenuClosed;
-
- StatementSlot();
- void AddReferer();
-public:
- StatementSlot( SCmdStream *pIn );
- StatementSlot( sal_uLong nSlot, SfxPoolItem* pItem = NULL );
- virtual ~StatementSlot();
- virtual sal_Bool Execute();
-};
-
-class StatementUnoSlot : public StatementSlot //Uno Slots aufrufen
-{
-public:
- StatementUnoSlot(SCmdStream *pIn);
-};
-
-union munge
-{
- comm_UINT32 nLNr1;
- Window *pWindow;
-};
-
-class StatementCommand : public StatementList // Befehl ausf�hren (wintree, resetaplication ...)
-{
- friend class ImplRemoteControl;
-protected:
- sal_uInt16 nMethodId;
- sal_uInt16 nParams;
- comm_UINT16 nNr1,nNr2,nNr3,nNr4;
- munge nLNr1_and_Pointer;
- String aString1,aString2;
- sal_Bool bBool1,bBool2;
-
- Window* GetNextOverlap( Window* pBase );
- Window* GetNextRecoverWin();
-
- static sal_uInt16 nDirPos;
- static Dir *pDir;
- static pfunc_osl_printDebugMessage pOriginal_osl_DebugMessageFunc;
-
-
- sal_Bool UnpackStorage( SotStorageRef xStorage, DirEntry &aBaseDir );
-
- void HandleSAXParser();
-
-public:
- StatementCommand( SCmdStream *pIn );
- StatementCommand( StatementList *pAfterThis, sal_uInt16 MethodId, sal_uInt16 Params, sal_uInt16 Nr1 );
- virtual sal_Bool Execute();
- sal_Bool DisplayHID();
- void Translate();
- void WriteControlData( Window *pBase, sal_uLong nConf, sal_Bool bFirst = sal_True );
-
-};
-
-
-enum TTHotSpots { MitteLinks, Mitte, MitteOben };
-
-class StatementControl : public StatementList
-{
-protected:
- rtl::OString aUId;
- sal_uInt16 nMethodId;
- sal_uInt16 nParams;
- comm_UINT16 nNr1,nNr2,nNr3,nNr4;
- comm_UINT32 nLNr1;
- String aString1,aString2;
- sal_Bool bBool1,bBool2;
- sal_Bool ControlOK( Window *pControl, const sal_Char* aBezeichnung );
- void AnimateMouse( Window *pControl, TTHotSpots aWohin );
- void AnimateMouse( Window *pControl, Point aWohin );
-
- sal_Bool MaybeDoTypeKeysDelay( Window *pTestWindow );
-
- sal_Bool HandleVisibleControls( Window *pControl );
- sal_Bool HandleCommonMethods( Window *pControl );
-
-public:
- StatementControl( SCmdStream *pIn, sal_uInt16 nControlType );
- virtual sal_Bool Execute();
-
-};
-
-class StatementFlow : public StatementList // Kommunikation mit Sequence
-{
- sal_uInt16 nArt;
-
- sal_uInt16 nParams;
- comm_UINT16 nSNr1;
- comm_UINT32 nLNr1;
- String aString1;
- sal_Bool bBool1;
-
-
-public:
- StatementFlow (sal_uLong nServiceId, SCmdStream *pIn, ImplRemoteControl *pRC );
- StatementFlow( StatementList *pAfterThis, sal_uInt16 nArtP );
- virtual sal_Bool Execute();
- static CommunicationLink *pCommLink;
- static sal_Bool bSending;
-
- static sal_Bool bUseIPC; // Soll zur r�ckmeldung IPC verwendet werden?
- static ImplRemoteControl *pRemoteControl; // Static f�r 2. Constructor
-
-private:
- void SendViaSocket();
-};
-
-class SearchUID : public Search
-{
- Window *pMaybeResult;
- Window *pAlternateResult;
- rtl::OString aUId;
- sal_Bool bSearchButtonOnToolbox;
-public:
- SearchUID( rtl::OString aUIdP, sal_Bool bSearchButtonOnToolboxP ): Search( SEARCH_FOCUS_FIRST ), pMaybeResult(NULL), pAlternateResult(NULL), aUId(aUIdP), bSearchButtonOnToolbox(bSearchButtonOnToolboxP) {}
- virtual sal_Bool IsWinOK( Window *pWin );
- Window* GetMaybeWin() { return pMaybeResult; }
- Window* GetAlternateResultWin() { return pAlternateResult; }
-};
-class SearchActive : public Search
-{
- WindowType nRT;
-public:
- SearchActive( WindowType nRTP ): nRT(nRTP) {}
- virtual sal_Bool IsWinOK( Window *pWin );
-};
-class SearchPopupFloatingWin : public Search
-{
-public:
- SearchPopupFloatingWin(): Search( SEARCH_FOCUS_FIRST ) {}
- virtual sal_Bool IsWinOK( Window *pWin );
-};
-class SearchRT : public Search
-{
- WindowType mnRT;
- sal_uInt16 mnSkip;
- sal_uInt16 mnCount;
-public:
- SearchRT( WindowType nRTP, SearchFlags nSearchFlags, sal_uInt16 nSkip = 0 ): Search(nSearchFlags), mnRT(nRTP), mnSkip( nSkip ), mnCount( 0 ) {}
- virtual sal_Bool IsWinOK( Window *pWin );
- sal_uInt16 GetCount(){ return mnCount; }
-};
-class SearchScroll : public SearchRT
-{
- sal_uInt16 nDirection;
-public:
- SearchScroll( sal_uInt16 nDir, SearchFlags nSearchFlags ): SearchRT(WINDOW_SCROLLBAR, nSearchFlags), nDirection(nDir) {}
- virtual sal_Bool IsWinOK( Window *pWin );
-};
-class SearchWinPtr : public Search
-{
- Window *pTest;
-public:
- SearchWinPtr( Window *pTestP ): pTest(pTestP) {}
- virtual sal_Bool IsWinOK( Window *pWin );
-};
-class SearchFadeSplitWin : public Search
-{
- WindowAlign nAlign;
-public:
- SearchFadeSplitWin( WindowAlign nAlignP ): nAlign(nAlignP) {}
- virtual sal_Bool IsWinOK( Window *pWin );
-};
-
-
-void ImplKeyInput( Window* pWin, KeyEvent &aKEvnt, sal_Bool bForceDirect=sal_False );
-void ImplMouseMove( Window* pWin, MouseEvent &aMEvnt, sal_Bool bForceDirect=sal_False );
-void ImplMouseButtonDown( Window* pWin, MouseEvent &aMEvnt, sal_Bool bForceDirect=sal_False );
-void ImplMouseButtonUp( Window* pWin, MouseEvent &aMEvnt, sal_Bool bForceDirect=sal_False );
-void ImplCommand( Window* pWin, CommandEvent &aCmdEvnt );
-void ImplEventWait( sal_uLong nID );
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/svcommstream.cxx b/automation/source/server/svcommstream.cxx
deleted file mode 100644
index 730cfabc6..000000000
--- a/automation/source/server/svcommstream.cxx
+++ /dev/null
@@ -1,51 +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_automation.hxx"
-
-#include "svcommstream.hxx"
-
-SvCommStream::SvCommStream( SvStream* pIO ) { pStream = pIO; }
-SvCommStream::~SvCommStream() {}
-
-ICommStream& SvCommStream::operator>>( comm_UINT16& rUShort ) { *pStream >> rUShort; return *this; }
-ICommStream& SvCommStream::operator>>( comm_UINT32& rULong ) { *pStream >> rULong; return *this; }
-ICommStream& SvCommStream::operator>>( comm_BOOL& rChar ) { *pStream >> rChar; return *this; }
-
-ICommStream& SvCommStream::operator<<( comm_UINT16 nUShort ) { *pStream << nUShort; return *this; }
-ICommStream& SvCommStream::operator<<( comm_UINT32 nULong ) { *pStream << nULong; return *this; }
-ICommStream& SvCommStream::operator<<( comm_BOOL nChar ) { *pStream << nChar; return *this; }
-
-comm_UINT32 SvCommStream::Read( void* pData, comm_UINT32 nSize ) { return pStream->Read( pData, nSize ); }
-comm_UINT32 SvCommStream::Write( const void* pData, comm_UINT32 nSize ) { return pStream->Write( pData, nSize ); }
-
-comm_BOOL SvCommStream::IsEof() const { return pStream->IsEof(); }
-comm_UINT32 SvCommStream::SeekRel( long nPos ) { return pStream->SeekRel( nPos ); }
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/automation/source/server/testtool.hrc b/automation/source/server/testtool.hrc
deleted file mode 100644
index e8d1c04ac..000000000
--- a/automation/source/server/testtool.hrc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-#define TTSTART 12345
-
-#define DisplayHidToolBox ( TTSTART + 0 )
-#define TT_SHOW 1
-#define TT_SHOW2 ( TTSTART + 1 )
-#define TT_OUTPUT 3
-#define TT_SEND_DATA 4
-#define TT_ALLWIN 5
-#define TT_KURZNAME 6
-#define TT_LANGNAME 7
-#define TT_ALTERNATE_CAPTION ( TTSTART + 2 )
-
-#define TT_INLINE_TRANSLATION ( TTSTART + 3)
-#define TT_GB_TRANSLATION 1
-#define TT_E_NEW 2
-#define TT_FT_OLD 3
-#define TT_GB_COMMENT 4
-#define TT_E_COMMENT 5
-
-#define TT_PB_SELECT 6
-#define TT_PB_RESTORE 7
-#define TT_PB_ACCEPT 8
-#define TT_PB_NEXT 9
-
-#define TT_DISCARD_CHANGED_DATA ( TTSTART + 4 )
-#define TT_NO_CONTROL ( TTSTART + 5 )
-
-
-#define TT_GPF ( TTSTART + 6 )