/* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ package complex.storages; import com.sun.star.uno.XInterface; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XSingleServiceFactory; import com.sun.star.bridge.XUnoUrlResolver; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; import com.sun.star.lang.IllegalArgumentException; import com.sun.star.container.NoSuchElementException; import com.sun.star.container.ElementExistException; import com.sun.star.embed.*; import share.LogWriter; import complex.storages.TestHelper; import complex.storages.StorageTest; public class Test06 implements StorageTest { XMultiServiceFactory m_xMSF; XSingleServiceFactory m_xStorageFactory; TestHelper m_aTestHelper; public Test06( XMultiServiceFactory xMSF, XSingleServiceFactory xStorageFactory, LogWriter aLogWriter ) { m_xMSF = xMSF; m_xStorageFactory = xStorageFactory; m_aTestHelper = new TestHelper( aLogWriter, "Test06: " ); } public boolean test() { try { // create temporary storage based on arbitrary medium // after such a storage is closed it is lost Object oTempStorage = m_xStorageFactory.createInstance(); XStorage xTempStorage = (XStorage) UnoRuntime.queryInterface( XStorage.class, oTempStorage ); if ( xTempStorage == null ) { m_aTestHelper.Error( "Can't create temporary storage representation!" ); return false; } try { xTempStorage.copyToStorage( null ); m_aTestHelper.Error( "The method must throw an exception because of illegal parameter!" ); return false; } catch( com.sun.star.lang.IllegalArgumentException iae ) {} catch( com.sun.star.uno.Exception ue ) {} catch( Exception e ) { m_aTestHelper.Error( "Unexpected excepion because of illegal parameter : " + e ); return false; } // open new substorages XStorage xTempSubStorage1 = m_aTestHelper.openSubStorage( xTempStorage, "SubStorage1", ElementModes.WRITE ); XStorage xTempSubStorage2 = m_aTestHelper.openSubStorage( xTempStorage, "SubStorage2", ElementModes.WRITE ); if ( xTempSubStorage1 == null || xTempSubStorage2 == null ) { m_aTestHelper.Error( "Can't create substorage!" ); return false; } // in case stream is open for reading it must exist try { xTempSubStorage1.openStreamElement( "NonExistingStream", ElementModes.READ ); m_aTestHelper.Error( "The method must throw an exception in case of try to open nonexistent stream for reading!" ); return false; } catch( com.sun.star.uno.Exception ue ) {} catch( Exception e ) { m_aTestHelper.Error( "Unexpected excepion in case of try to open nonexistent stream for reading : " + e ); return false; } // in case a storage is open for reading it must exist try { xTempSubStorage1.openStreamElement( "NonExistingStorage", ElementModes.READ ); m_aTestHelper.Error( "The method must throw an exception in case of try to open nonexistent storage for reading!" ); return false; } catch( com.sun.star.uno.Exception ue ) {} catch( Exception e ) { m_aTestHelper.Error( "Unexpected excepion in case of try to open nonexistent storage for reading : " + e ); return false; } // in case of removing nonexistent element an exception must be thrown try { xTempSubStorage1.removeElement( "NonExistingElement" ); m_aTestHelper.Error( "An exception must be thrown in case of removing nonexistent element!" ); return false; } catch( com.sun.star.container.NoSuchElementException ne ) {} catch( Exception e ) { m_aTestHelper.Error( "Unexpected excepion in case of try to remove nonexistent element : " + e ); return false; } // in case of renaming of nonexistent element an exception must be thrown try { xTempSubStorage1.renameElement( "NonExistingElement", "NewName" ); m_aTestHelper.Error( "An exception must be thrown in case of renaming nonexistent element!" ); return false; } catch( com.sun.star.container.NoSuchElementException ne ) {} catch( Exception e ) { m_aTestHelper.Error( "Unexpected excepion in case of try to rename nonexistent element : " + e ); return false; } // in case of renaming to a name of existent element an exception must be thrown try { xTempStorage.renameElement( "SubStorage1", "SubStorage2" ); m_aTestHelper.Error( "An exception must be thrown in case of renaming to the name of existent element!" ); return false; } catch( com.sun.star.container.ElementExistException ee ) {} catch( Exception e ) { m_aTestHelper.Error( "Unexpected excepion in case of try to rename to the name of existent element : " + e ); return false; } // in case of copying target storage must be provided try { xTempStorage.copyElementTo( "SubStorage1", null, "SubStorage1" ); m_aTestHelper.Error( "An exception must be thrown in case empty reference is provided as target for copying!" ); return false; } catch( com.sun.star.lang.IllegalArgumentException iae ) {} catch( com.sun.star.uno.Exception ue ) {} catch( Exception e ) { m_aTestHelper.Error( "Unexpected excepion in case empty reference is provieded as target for copying : " + e ); return false; } // in case of moving target storage must be provided try { xTempStorage.moveElementTo( "SubStorage1", null, "SubStorage1" ); m_aTestHelper.Error( "An exception must be thrown in case empty reference is provided as target for moving!" ); return false; } catch( com.sun.star.lang.IllegalArgumentException iae ) {} catch( com.sun.star.uno.Exception ue ) {} catch( Exception e ) { m_aTestHelper.Error( "Unexpected excepion in case empty reference is provieded as target for moving : " + e ); return false; } // prepare target for further testings // create new temporary storage based on arbitrary medium Object oTargetStorage = m_xStorageFactory.createInstance(); XStorage xTargetStorage = (XStorage) UnoRuntime.queryInterface( XStorage.class, oTargetStorage ); if ( xTargetStorage == null ) { m_aTestHelper.Error( "Can't create temporary storage representation!" ); return false; } // open a new substorage XStorage xTargetSubStorage = m_aTestHelper.openSubStorage( xTargetStorage, "SubStorage1", ElementModes.WRITE ); if ( xTargetSubStorage == null ) { m_aTestHelper.Error( "Can't create substorage!" ); return false; } // in case of copying of nonexistent element an exception must be thrown try { xTempStorage.copyElementTo( "Nonexistent element", xTargetStorage, "Target" ); m_aTestHelper.Error( "An exception must be thrown in case of copying of nonexistent element!" ); return false; } catch( com.sun.star.container.NoSuchElementException ne ) {} catch( Exception e ) { m_aTestHelper.Error( "Unexpected excepion in case of copying of nonexistent element: " + e ); return false; } // in case of moving of nonexistent element an exception must be thrown try { xTempStorage.moveElementTo( "Nonexistent element", xTargetStorage, "Target" ); m_aTestHelper.Error( "An exception must be thrown in case of moving of nonexistent element!" ); return false; } catch( com.sun.star.container.NoSuchElementException ne ) {} catch( Exception e ) { m_aTestHelper.Error( "Unexpected excepion in case of moving of nonexistent element: " + e ); return false; } // in case target for copying already exists an exception must be thrown try { xTempStorage.copyElementTo( "SubStorage1", xTargetStorage, "SubStorage1" ); m_aTestHelper.Error( "An exception must be thrown in case target for copying already exists!" ); return false; } catch( com.sun.star.container.ElementExistException ee ) {} catch( Exception e ) { m_aTestHelper.Error( "Unexpected excepion in case target for copying already exists: " + e ); return false; } // in case target for moving already exists an exception must be thrown try { xTempStorage.moveElementTo( "SubStorage1", xTargetStorage, "SubStorage1" ); m_aTestHelper.Error( "An exception must be thrown in case target for moving already exists!" ); return false; } catch( com.sun.star.container.ElementExistException ee ) {} catch( Exception e ) { m_aTestHelper.Error( "Unexpected excepion in case target for moving already exists: " + e ); return false; } return true; } catch( Exception e ) { m_aTestHelper.Error( "Exception: " + e ); return false; } } } text-boxes LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/icon-themes/colibre/vcl/res
AgeCommit message (Expand)Author
2023-04-24tdf#154976 Fix VCL based asset's contrast in Colibre Dark & harmonizeRizal Muttaqin
2023-04-24tdf#152625 Revise Colibre's tab_select* iconsRizal Muttaqin
2023-04-20Resolves: tdf#152625 add a border around the tab_select_* iconsCaolán McNamara
2022-03-21Colibre: tdf#148029 Remove dark area in dark variantRizal Muttaqin
2021-09-05Colibre: tdf#104169 revise FatCross cursor to make it sharperRizal Muttaqin
2021-05-18Removed executable bits on picture filesAndrea Gelmini
2021-05-18tdf#104169 - Change mouse cursor to FatCross in calc spreadsheetSarabjot Singh
2020-11-05Colibre: fix some dark color, update Choose Control iconsRizal Muttaqin
2020-11-01Colibre: Update navigation, mail merge, gallery component, info iconsRizal Muttaqin
2020-06-17tdf#133268: Update message box, remove unnecessary, update some other etcRizal Muttaqin
2020-06-11tdf#133268Rizal Muttaqin
2020-06-10tdf#133819 support for tristate checkboxesRizal Muttaqin
2020-06-03Fix for tdf#133582, missing checkbox in gen envRizal Muttaqin
2020-05-31Resolves tdf#133268: Update Colibre color paletteRizal Muttaqin
2019-11-18Resolves: tdf#108452 invisible all-black drawing cursors on black bgCaolán McNamara
2019-10-07hidpi cursors for macOSNoel Grandin
2019-04-25tdf#106229 new icon for infobar type success neededandreas kainz