diff options
Diffstat (limited to 'svtools/workben/treecontrol/treetest.cxx')
-rw-r--r-- | svtools/workben/treecontrol/treetest.cxx | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/svtools/workben/treecontrol/treetest.cxx b/svtools/workben/treecontrol/treetest.cxx index bd309b650b8e..f2eb21b01d5a 100644 --- a/svtools/workben/treecontrol/treetest.cxx +++ b/svtools/workben/treecontrol/treetest.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -129,7 +129,7 @@ void DirectoryTree::display( const OUString& rURL ) // first create a data model for our tree control mxTreeDataModel = Reference< XMutableTreeDataModel >( - mxMultiComponentFactoryServer->createInstanceWithContext( + mxMultiComponentFactoryServer->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.tree.MutableTreeDataModel" ) ), mxComponentContext ), UNO_QUERY_THROW ); @@ -144,39 +144,39 @@ void DirectoryTree::display( const OUString& rURL ) // now create the dialog Reference< XControlModel > xDialogModel( - mxMultiComponentFactoryServer->createInstanceWithContext( + mxMultiComponentFactoryServer->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlDialogModel" ) ), mxComponentContext ), UNO_QUERY_THROW ); Reference< XPropertySet > xDialogPropertySet( xDialogModel, UNO_QUERY_THROW ); - xDialogPropertySet->setPropertyValue( sPositionX, Any( sal_Int32(50) ) ); - xDialogPropertySet->setPropertyValue( sPositionY, Any( sal_Int32(50) ) ); - xDialogPropertySet->setPropertyValue( sWidth, Any( sal_Int32(256) ) ); - xDialogPropertySet->setPropertyValue( sHeight, Any( sal_Int32(256) ) ); - xDialogPropertySet->setPropertyValue( sTitle, Any( OUString( RTL_CONSTASCII_USTRINGPARAM( "Tree Control Test" ) ) ) ); + xDialogPropertySet->setPropertyValue( sPositionX, Any( sal_Int32(50) ) ); + xDialogPropertySet->setPropertyValue( sPositionY, Any( sal_Int32(50) ) ); + xDialogPropertySet->setPropertyValue( sWidth, Any( sal_Int32(256) ) ); + xDialogPropertySet->setPropertyValue( sHeight, Any( sal_Int32(256) ) ); + xDialogPropertySet->setPropertyValue( sTitle, Any( OUString( RTL_CONSTASCII_USTRINGPARAM( "Tree Control Test" ) ) ) ); Reference< XMultiServiceFactory > xDialogMSF( xDialogModel, UNO_QUERY_THROW ); // now create our tree control Reference< XControlModel > xTreeControlModel( - xDialogMSF->createInstance( + xDialogMSF->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.tree.TreeControlModel" ) ) ), UNO_QUERY_THROW ); Reference< XPropertySet > XTreeControlModelSet( xTreeControlModel, UNO_QUERY_THROW ); - XTreeControlModelSet->setPropertyValue( sSelectionType, Any( SelectionType_NONE ) ); - XTreeControlModelSet->setPropertyValue( sPositionX, Any( sal_Int32(3) ) ); - XTreeControlModelSet->setPropertyValue( sPositionY, Any( sal_Int32(3) ) ); - XTreeControlModelSet->setPropertyValue( sWidth, Any( sal_Int32(253) ) ); - XTreeControlModelSet->setPropertyValue( sHeight, Any( sal_Int32(253) ) ); - XTreeControlModelSet->setPropertyValue( sDataModel, Any( mxTreeDataModel ) ); + XTreeControlModelSet->setPropertyValue( sSelectionType, Any( SelectionType_NONE ) ); + XTreeControlModelSet->setPropertyValue( sPositionX, Any( sal_Int32(3) ) ); + XTreeControlModelSet->setPropertyValue( sPositionY, Any( sal_Int32(3) ) ); + XTreeControlModelSet->setPropertyValue( sWidth, Any( sal_Int32(253) ) ); + XTreeControlModelSet->setPropertyValue( sHeight, Any( sal_Int32(253) ) ); + XTreeControlModelSet->setPropertyValue( sDataModel, Any( mxTreeDataModel ) ); XTreeControlModelSet->setPropertyValue( sShowsRootHandles,Any( sal_False ) ); - XTreeControlModelSet->setPropertyValue( sShowsHandles, Any( sal_False ) ); - XTreeControlModelSet->setPropertyValue( sRootDisplayed, Any( sal_True ) ); - XTreeControlModelSet->setPropertyValue( sEditable, Any( sal_True ) ); -// XTreeControlModelSet->setPropertyValue( sRowHeight, Any( sal_Int32( 12 ) ) ); - + XTreeControlModelSet->setPropertyValue( sShowsHandles, Any( sal_False ) ); + XTreeControlModelSet->setPropertyValue( sRootDisplayed, Any( sal_True ) ); + XTreeControlModelSet->setPropertyValue( sEditable, Any( sal_True ) ); +// XTreeControlModelSet->setPropertyValue( sRowHeight, Any( sal_Int32( 12 ) ) ); + Reference< XNameContainer > xDialogModelContainer( xDialogModel, UNO_QUERY_THROW ); const OUString sTreeControlName( RTL_CONSTASCII_USTRINGPARAM( "tree" ) ); @@ -185,18 +185,18 @@ void DirectoryTree::display( const OUString& rURL ) // now create the peers Reference< XControl > xDialogControl( - mxMultiComponentFactoryServer->createInstanceWithContext( + mxMultiComponentFactoryServer->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlDialog" ) ), mxComponentContext ), UNO_QUERY_THROW ); xDialogControl->setModel( xDialogModel ); - + Reference< XToolkit > xToolkit( - mxMultiComponentFactoryServer->createInstanceWithContext( + mxMultiComponentFactoryServer->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit" ) ), mxComponentContext ), UNO_QUERY_THROW ); xDialogControl->createPeer( xToolkit, 0 ); - + // get the peers of the sub controls from the dialog peer container Reference< XControlContainer > xDialogContainer( xDialogControl, UNO_QUERY_THROW ); mxTreeControl = Reference< XTreeControl >( xDialogContainer->getControl( sTreeControlName ), UNO_QUERY_THROW ); @@ -315,9 +315,9 @@ int SAL_CALL main( int argc, char **argv ) } if (argc == 3) { - sConnectionString = OUString::createFromAscii(argv[2]); - } - + sConnectionString = OUString::createFromAscii(argv[2]); + } + // Creates a simple registry service instance. Reference< XSimpleRegistry > xSimpleRegistry(::cppu::createSimpleRegistry() ); @@ -335,7 +335,7 @@ int SAL_CALL main( int argc, char **argv ) */ Reference< XComponentContext > xComponentContext( ::cppu::bootstrap_InitialComponentContext( xSimpleRegistry ) ); - + /* Gets the service manager instance to be used (or null). This method has been added for convenience, because the service manager is a often used object. @@ -347,7 +347,7 @@ int SAL_CALL main( int argc, char **argv ) by the factory. */ Reference< XInterface > xInterface = - xMultiComponentFactoryClient->createInstanceWithContext( + xMultiComponentFactoryClient->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.bridge.UnoUrlResolver" ), xComponentContext ); @@ -356,7 +356,7 @@ int SAL_CALL main( int argc, char **argv ) // Resolves the component context from the office, on the uno URL given by argv[1]. try { - xInterface = Reference< XInterface >( + xInterface = Reference< XInterface >( resolver->resolve( sConnectionString ), UNO_QUERY ); } catch ( Exception& e ) @@ -364,9 +364,9 @@ int SAL_CALL main( int argc, char **argv ) printf("Error: cannot establish a connection using '%s':\n %s\n", OUStringToOString(sConnectionString, RTL_TEXTENCODING_ASCII_US).getStr(), OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US).getStr()); - exit(1); + exit(1); } - + // gets the server component context as property of the office component factory Reference< XPropertySet > xPropSet( xInterface, UNO_QUERY ); xPropSet->getPropertyValue( OUString::createFromAscii("DefaultContext") ) >>= xComponentContext; @@ -374,7 +374,7 @@ int SAL_CALL main( int argc, char **argv ) // gets the service manager from the office Reference< XMultiComponentFactory > xMultiComponentFactoryServer( xComponentContext->getServiceManager() ); - + try { OUString ustrFileURL; @@ -387,13 +387,13 @@ int SAL_CALL main( int argc, char **argv ) { printf("Error: exception caught during test:\n %s\n", OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US).getStr()); - exit(1); + exit(1); } // dispose the local service manager Reference< XComponent >::query( xMultiComponentFactoryClient )->dispose(); return 0; -} +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |