TestHelper.java (a740f2aa) TestHelper.java (a893be29)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 1585 unchanged lines hidden (view full) ---

1594 return true;
1595 }
1596
1597 return false;
1598 }
1599
1600 public XStorage cloneStorage( XSingleServiceFactory xFactory, XStorage xStorage )
1601 {
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 1585 unchanged lines hidden (view full) ---

1594 return true;
1595 }
1596
1597 return false;
1598 }
1599
1600 public XStorage cloneStorage( XSingleServiceFactory xFactory, XStorage xStorage )
1601 {
1602 // create a copy of a last commited version of specified storage
1602 // create a copy of a last committed version of specified storage
1603 XStorage xResult = null;
1604 try
1605 {
1606 Object oTempStorage = xFactory.createInstance();
1607 xResult = (XStorage) UnoRuntime.queryInterface( XStorage.class, oTempStorage );
1608 if ( xResult != null )
1609 xStorage.copyLastCommitTo( xResult );
1610 }
1611 catch( Exception e )
1612 {
1613 Error( "Can't clone storage, exception: " + e );
1614 return null;
1615 }
1616
1617 return xResult;
1618 }
1619
1620 public XStorage cloneSubStorage( XSingleServiceFactory xFactory, XStorage xStorage, String sName )
1621 {
1603 XStorage xResult = null;
1604 try
1605 {
1606 Object oTempStorage = xFactory.createInstance();
1607 xResult = (XStorage) UnoRuntime.queryInterface( XStorage.class, oTempStorage );
1608 if ( xResult != null )
1609 xStorage.copyLastCommitTo( xResult );
1610 }
1611 catch( Exception e )
1612 {
1613 Error( "Can't clone storage, exception: " + e );
1614 return null;
1615 }
1616
1617 return xResult;
1618 }
1619
1620 public XStorage cloneSubStorage( XSingleServiceFactory xFactory, XStorage xStorage, String sName )
1621 {
1622 // create a copy of a last commited version of specified substorage
1622 // create a copy of a last committed version of specified substorage
1623 XStorage xResult = null;
1624 try
1625 {
1626 Object oTempStorage = xFactory.createInstance();
1627 xResult = (XStorage) UnoRuntime.queryInterface( XStorage.class, oTempStorage );
1628 if ( xResult != null )
1629 xStorage.copyStorageElementLastCommitTo( sName, xResult );
1630 }

--- 52 unchanged lines hidden ---
1623 XStorage xResult = null;
1624 try
1625 {
1626 Object oTempStorage = xFactory.createInstance();
1627 xResult = (XStorage) UnoRuntime.queryInterface( XStorage.class, oTempStorage );
1628 if ( xResult != null )
1629 xStorage.copyStorageElementLastCommitTo( sName, xResult );
1630 }

--- 52 unchanged lines hidden ---