/* * 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 com.sun.star.wizards.common;
/** * checks if the value of an object that represents an array is null. * check beforehand if the Object is really an array with "AnyConverter.IsArray(oObject) * @param oValue the parameter that has to represent an object * @return a null reference if the array is empty
*/ privatestatic Object getArrayValue(Object oValue)
{ try
{
Object oPropList = com.sun.star.uno.AnyConverter.toArray(oValue); int nlen = java.lang.reflect.Array.getLength(oPropList); if (nlen == 0)
{ returnnull;
} else
{ return oPropList;
}
} catch (Exception exception)
{
exception.printStackTrace(System.err); returnnull;
}
}
publicstatic XComponentContext getComponentContext(XMultiServiceFactory _xMSF)
{ // Get the path to the extension and try to add the path to the class loader final XPropertySet xProps = UnoRuntime.queryInterface(XPropertySet.class, _xMSF); final PropertySetHelper aHelper = new PropertySetHelper(xProps); final Object aDefaultContext = aHelper.getPropertyValueAsObject("DefaultContext"); return UnoRuntime.queryInterface(XComponentContext.class, aDefaultContext);
}
publicstatic XMacroExpander getMacroExpander(XMultiServiceFactory _xMSF)
{ final XComponentContext xComponentContext = getComponentContext(_xMSF); final Object aSingleton = xComponentContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander"); return UnoRuntime.queryInterface(XMacroExpander.class, aSingleton);
}
}
Messung V0.5
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.12Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.