m_aTestHelper.Message ( "Document stored." );
//create StandaloneDocumentInfo object and load it from the file
Object oStandaloneDocInfo = m_xMSF.createInstance (
"com.sun.star.document.StandaloneDocumentInfo" );
XStandaloneDocumentInfo xStandaloneDocInfo =
(XStandaloneDocumentInfo) UnoRuntime.queryInterface (
XStandaloneDocumentInfo.class, oStandaloneDocInfo );
xStandaloneDocInfo.loadFromURL ( sURL );
m_aTestHelper.Message ( "StandaloneDocumentInfo loaded." );
//get the title from the object and check it
XPropertySet xPropSet =
(XPropertySet)UnoRuntime.queryInterface (
XPropertySet.class, oStandaloneDocInfo );
String sTitle = xPropSet.getPropertyValue ( "Title" ).toString ();
m_aTestHelper.Message ( "Get title: " + sTitle );
if ( sTitle.compareTo ( sDocTitle[i] ) != 0 ) {
m_aTestHelper.Error ( "Title not match. Expected \""
+ sDocTitle[i] +
"\"" );
return false;
} else {
m_aTestHelper.Message ( "Title matched." );
}
//set a new title to the object
sTitle += "_new";
xPropSet.setPropertyValue ( "Title", sTitle );
m_aTestHelper.Message ( "Set new title: " + sTitle );
//store the object to the same file
xStandaloneDocInfo.storeIntoURL ( sURL );
m_aTestHelper.Message ( "Document info stored." );
//create a new StandaloneDocumentInfo object and load it from the file
Object oStandaloneDocInfo_ = m_xMSF.createInstance (
"com.sun.star.document.StandaloneDocumentInfo" );
XStandaloneDocumentInfo xStandaloneDocInfo_ =
(XStandaloneDocumentInfo)UnoRuntime.queryInterface (
XStandaloneDocumentInfo.class, oStandaloneDocInfo_ );
xStandaloneDocInfo_.loadFromURL ( sURL );
m_aTestHelper.Message ( "New StandaloneDocumentInfo loaded." );
//get the title and check it
XPropertySet xPropSet_ = (XPropertySet)UnoRuntime.queryInterface (
XPropertySet.class, oStandaloneDocInfo_ );