new loplugin:unoquery
look for places we are doing code like:
Reference<XProperty>(model, css::uno::UNO_QUERY)->getAsProperty()
which might result in a SIGSEGV is the query fails
Change-Id: I5cbdbc9e64bd0bed588297c512bf60cbacb9442e
Reviewed-on: https://gerrit.libreoffice.org/69044
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -479,7 +479,7 @@ DECLARE_DUMP_TEST(LegendTest, Chart2DumpTest, false)
|
||||
|
||||
if (sShapeType == "com.sun.star.drawing.TextShape")
|
||||
{
|
||||
uno::Reference<text::XText> xLegendEntryText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
|
||||
uno::Reference<text::XText> xLegendEntryText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText();
|
||||
CPPUNIT_DUMP_ASSERT_STRINGS_EQUAL(xLegendEntryText->getString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
||||
/*
|
||||
* 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/.
|
||||
*/
|
||||
|
||||
#include "sal/config.h"
|
||||
#include "com/sun/star/beans/XProperty.hpp"
|
||||
|
||||
void foo(css::uno::Reference<css::uno::XInterface> model)
|
||||
{
|
||||
css::uno::Reference<css::beans::XProperty>(model, css::uno::UNO_QUERY)->getAsProperty();
|
||||
// expected-error@-1 {{calling UNO_QUERY followed by unconditional method call might result in SIGSEGV, rather use UNO_QUERY_THROW [loplugin:unoquery]}}
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|
||||
@@ -0,0 +1,87 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
||||
/*
|
||||
* 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/.
|
||||
*/
|
||||
|
||||
#include "check.hxx"
|
||||
#include "plugin.hxx"
|
||||
|
||||
// TODO it would be better if we were running some kind of nullability analysis here, where we marked
|
||||
// the results of expressions like Reference(..UNO_QUERY) as being nullable, and then looked for
|
||||
// places where we unconditionally deference the results of that expression.
|
||||
|
||||
namespace
|
||||
{
|
||||
class UnoQuery : public loplugin::FilteringPlugin<UnoQuery>
|
||||
{
|
||||
public:
|
||||
explicit UnoQuery(loplugin::InstantiationData const& data)
|
||||
: FilteringPlugin(data)
|
||||
{
|
||||
}
|
||||
|
||||
void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
|
||||
bool VisitCXXMemberCallExpr(CXXMemberCallExpr const*);
|
||||
};
|
||||
|
||||
bool UnoQuery::VisitCXXMemberCallExpr(CXXMemberCallExpr const* memberCallExpr)
|
||||
{
|
||||
if (ignoreLocation(memberCallExpr))
|
||||
return true;
|
||||
|
||||
memberCallExpr->dump();
|
||||
|
||||
auto isXInterface = [](Decl const* decl) -> bool {
|
||||
return bool(loplugin::DeclCheck(decl)
|
||||
.Class("XInterface")
|
||||
.Namespace("uno")
|
||||
.Namespace("star")
|
||||
.Namespace("sun")
|
||||
.Namespace("com")
|
||||
.GlobalNamespace());
|
||||
};
|
||||
if (!loplugin::isDerivedFrom(memberCallExpr->getRecordDecl(), isXInterface))
|
||||
return true;
|
||||
auto operatorCallExpr = dyn_cast<CXXOperatorCallExpr>(
|
||||
memberCallExpr->getImplicitObjectArgument()->IgnoreImplicit());
|
||||
if (!operatorCallExpr)
|
||||
return true;
|
||||
|
||||
Expr const* expr = operatorCallExpr->getArg(0)->IgnoreImplicit();
|
||||
// depending on the version of clang, the IgnoreImplicit may or may not look through these nodes
|
||||
if (auto matTemp = dyn_cast<MaterializeTemporaryExpr>(expr))
|
||||
expr = matTemp->GetTemporaryExpr();
|
||||
if (auto bindTemp = dyn_cast<CXXBindTemporaryExpr>(expr))
|
||||
expr = bindTemp->getSubExpr();
|
||||
|
||||
auto temporaryExpr = dyn_cast<CXXTemporaryObjectExpr>(expr);
|
||||
if (!temporaryExpr)
|
||||
return true;
|
||||
if (temporaryExpr->getNumArgs() < 2)
|
||||
return true;
|
||||
auto declRefExpr = dyn_cast<DeclRefExpr>(temporaryExpr->getArg(1)->IgnoreImplicit());
|
||||
if (!declRefExpr)
|
||||
return true;
|
||||
auto enumConstant = dyn_cast<EnumConstantDecl>(declRefExpr->getDecl());
|
||||
if (!enumConstant)
|
||||
return true;
|
||||
if (enumConstant->getName() != "UNO_QUERY")
|
||||
return true;
|
||||
|
||||
report(DiagnosticsEngine::Warning,
|
||||
"calling UNO_QUERY followed by unconditional method call might result in SIGSEGV, "
|
||||
"rather use UNO_QUERY_THROW",
|
||||
memberCallExpr->getExprLoc())
|
||||
<< memberCallExpr->getSourceRange();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
loplugin::Plugin::Registration<UnoQuery> unoquery("unoquery", true);
|
||||
};
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|
||||
@@ -84,7 +84,7 @@ void OComponentTable::refreshColumns()
|
||||
::std::vector< OUString> aVector;
|
||||
|
||||
for(const auto& rxColumn : m_aColumns->get())
|
||||
aVector.push_back(Reference< XNamed>(rxColumn,UNO_QUERY)->getName());
|
||||
aVector.push_back(Reference< XNamed>(rxColumn,UNO_QUERY_THROW)->getName());
|
||||
|
||||
if(m_xColumns)
|
||||
m_xColumns->reFill(aVector);
|
||||
|
||||
@@ -641,7 +641,7 @@ void ODbaseTable::refreshColumns()
|
||||
aVector.reserve(m_aColumns->get().size());
|
||||
|
||||
for (auto const& column : m_aColumns->get())
|
||||
aVector.push_back(Reference< XNamed>(column,UNO_QUERY)->getName());
|
||||
aVector.push_back(Reference< XNamed>(column,UNO_QUERY_THROW)->getName());
|
||||
|
||||
if(m_xColumns)
|
||||
m_xColumns->reFill(aVector);
|
||||
@@ -1605,7 +1605,7 @@ Reference<XPropertySet> ODbaseTable::isUniqueByColumnName(sal_Int32 _nColumnPos)
|
||||
xIndex.set(m_xIndexes->getByIndex(i), css::uno::UNO_QUERY);
|
||||
if(xIndex.is() && getBOOL(xIndex->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISUNIQUE))))
|
||||
{
|
||||
Reference<XNameAccess> xCols(Reference<XColumnsSupplier>(xIndex,UNO_QUERY)->getColumns());
|
||||
Reference<XNameAccess> xCols(Reference<XColumnsSupplier>(xIndex,UNO_QUERY_THROW)->getColumns());
|
||||
if(xCols->hasByName(sColName))
|
||||
return xIndex;
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ void OConnection::construct(const OUString& url,const Sequence< PropertyValue >&
|
||||
}
|
||||
else if (aFile.isDocument())
|
||||
{
|
||||
Reference<XContent> xParent(Reference<XChild>(aFile.get(),UNO_QUERY)->getParent(),UNO_QUERY);
|
||||
Reference<XContent> xParent(Reference<XChild>(aFile.get(),UNO_QUERY_THROW)->getParent(),UNO_QUERY_THROW);
|
||||
Reference<XContentIdentifier> xIdent = xParent->getIdentifier();
|
||||
m_xContent = xParent;
|
||||
|
||||
|
||||
@@ -478,7 +478,7 @@ void OStatement_Base::GetAssignValues()
|
||||
// Create Row for the values to be set (Reference through new)
|
||||
if(m_aAssignValues.is())
|
||||
m_aAssignValues->get().clear();
|
||||
sal_Int32 nCount = Reference<XIndexAccess>(m_xColNames,UNO_QUERY)->getCount();
|
||||
sal_Int32 nCount = Reference<XIndexAccess>(m_xColNames,UNO_QUERY_THROW)->getCount();
|
||||
m_aAssignValues = new OAssignValues(nCount);
|
||||
// unbound all
|
||||
std::for_each(m_aAssignValues->get().begin()+1,m_aAssignValues->get().end(),TSetRefBound(false));
|
||||
@@ -565,7 +565,7 @@ void OStatement_Base::GetAssignValues()
|
||||
{
|
||||
if(m_aAssignValues.is())
|
||||
m_aAssignValues->get().clear();
|
||||
sal_Int32 nCount = Reference<XIndexAccess>(m_xColNames,UNO_QUERY)->getCount();
|
||||
sal_Int32 nCount = Reference<XIndexAccess>(m_xColNames,UNO_QUERY_THROW)->getCount();
|
||||
m_aAssignValues = new OAssignValues(nCount);
|
||||
// unbound all
|
||||
std::for_each(m_aAssignValues->get().begin()+1,m_aAssignValues->get().end(),TSetRefBound(false));
|
||||
@@ -642,7 +642,7 @@ void OStatement_Base::SetAssignValue(const OUString& aColumnName,
|
||||
{
|
||||
Reference<XPropertySet> xCol;
|
||||
m_xColNames->getByName(aColumnName) >>= xCol;
|
||||
sal_Int32 nId = Reference<XColumnLocate>(m_xColNames,UNO_QUERY)->findColumn(aColumnName);
|
||||
sal_Int32 nId = Reference<XColumnLocate>(m_xColNames,UNO_QUERY_THROW)->findColumn(aColumnName);
|
||||
// does this column actually exist in the file?
|
||||
|
||||
if (!xCol.is())
|
||||
|
||||
@@ -439,7 +439,7 @@ OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode const * pPredicateNo
|
||||
{
|
||||
if (m_orgColumns->getByName(aColumnName) >>= xCol)
|
||||
{
|
||||
pOperand = OSQLAnalyzer::createOperandAttr(Reference< XColumnLocate>(m_orgColumns,UNO_QUERY)->findColumn(aColumnName),xCol);
|
||||
pOperand = OSQLAnalyzer::createOperandAttr(Reference< XColumnLocate>(m_orgColumns,UNO_QUERY_THROW)->findColumn(aColumnName),xCol);
|
||||
}
|
||||
else
|
||||
{// Column doesn't exist in the Result-set
|
||||
|
||||
@@ -501,7 +501,7 @@ void OFlatTable::refreshColumns()
|
||||
aVector.reserve(m_aColumns->get().size());
|
||||
|
||||
for (auto const& column : m_aColumns->get())
|
||||
aVector.push_back(Reference< XNamed>(column,UNO_QUERY)->getName());
|
||||
aVector.push_back(Reference< XNamed>(column,UNO_QUERY_THROW)->getName());
|
||||
|
||||
if(m_xColumns)
|
||||
m_xColumns->reFill(aVector);
|
||||
|
||||
@@ -81,6 +81,7 @@ using com::sun::star::uno::Sequence;
|
||||
using com::sun::star::uno::Reference;
|
||||
using com::sun::star::uno::XInterface;
|
||||
using com::sun::star::uno::UNO_QUERY;
|
||||
using com::sun::star::uno::UNO_QUERY_THROW;
|
||||
using com::sun::star::uno::XComponentContext;
|
||||
using com::sun::star::uno::Any;
|
||||
|
||||
@@ -607,7 +608,7 @@ Reference< XNameAccess > Connection::getTables()
|
||||
m_settings.tables = Tables::create( m_xMutex, this, &m_settings , &m_settings.pTablesImpl);
|
||||
else
|
||||
// TODO: how to overcome the performance problem ?
|
||||
Reference< css::util::XRefreshable > ( m_settings.tables, UNO_QUERY )->refresh();
|
||||
Reference< css::util::XRefreshable > ( m_settings.tables, UNO_QUERY_THROW )->refresh();
|
||||
return m_settings.tables;
|
||||
}
|
||||
|
||||
@@ -622,7 +623,7 @@ Reference< XNameAccess > Connection::getViews()
|
||||
m_settings.views = Views::create( m_xMutex, this, &m_settings, &(m_settings.pViewsImpl) );
|
||||
else
|
||||
// TODO: how to overcome the performance problem ?
|
||||
Reference< css::util::XRefreshable > ( m_settings.views, UNO_QUERY )->refresh();
|
||||
Reference< css::util::XRefreshable > ( m_settings.views, UNO_QUERY_THROW )->refresh();
|
||||
return m_settings.views;
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ void SignatureLineDialog::Apply()
|
||||
if (bIsExistingSignatureLine)
|
||||
xShapeProps = m_xExistingShapeProperties;
|
||||
else
|
||||
xShapeProps.set(Reference<lang::XMultiServiceFactory>(m_xModel, UNO_QUERY)
|
||||
xShapeProps.set(Reference<lang::XMultiServiceFactory>(m_xModel, UNO_QUERY_THROW)
|
||||
->createInstance("com.sun.star.drawing.GraphicObjectShape"),
|
||||
UNO_QUERY);
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ void OCacheSet::construct( const Reference< XResultSet>& _xDriverSet,const OUSt
|
||||
{
|
||||
m_xDriverSet = _xDriverSet;
|
||||
m_xDriverRow.set(_xDriverSet,UNO_QUERY);
|
||||
m_xSetMetaData = Reference<XResultSetMetaDataSupplier>(_xDriverSet,UNO_QUERY)->getMetaData();
|
||||
m_xSetMetaData = Reference<XResultSetMetaDataSupplier>(_xDriverSet,UNO_QUERY_THROW)->getMetaData();
|
||||
if ( m_xSetMetaData.is() )
|
||||
{
|
||||
const sal_Int32 nCount = m_xSetMetaData->getColumnCount();
|
||||
@@ -218,7 +218,7 @@ void OCacheSet::fillParameters( const ORowSetRow& _rRow
|
||||
&& comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISUNIQUE))
|
||||
&& !comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISPRIMARYKEYINDEX))
|
||||
)
|
||||
aAllIndexColumns.push_back(Reference<XColumnsSupplier>(xIndexColsSup,UNO_QUERY)->getColumns());
|
||||
aAllIndexColumns.push_back(Reference<XColumnsSupplier>(xIndexColsSup,UNO_QUERY_THROW)->getColumns());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ void OCacheSet::deleteRow(const ORowSetRow& _rDeleteRow ,const connectivity::OSQ
|
||||
&& comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISUNIQUE))
|
||||
&& !comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISPRIMARYKEYINDEX))
|
||||
)
|
||||
aAllIndexColumns.push_back(Reference<XColumnsSupplier>(xIndexColsSup,UNO_QUERY)->getColumns());
|
||||
aAllIndexColumns.push_back(Reference<XColumnsSupplier>(xIndexColsSup,UNO_QUERY_THROW)->getColumns());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace
|
||||
&& comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISUNIQUE))
|
||||
&& !comphelper::getBOOL(xIndexColsSup->getPropertyValue(PROPERTY_ISPRIMARYKEYINDEX))
|
||||
)
|
||||
_rAllIndexColumns.push_back(Reference<XColumnsSupplier>(xIndexColsSup,UNO_QUERY)->getColumns());
|
||||
_rAllIndexColumns.push_back(Reference<XColumnsSupplier>(xIndexColsSup,UNO_QUERY_THROW)->getColumns());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ OptimisticSet::OptimisticSet(const Reference<XComponentContext>& _rContext,
|
||||
sal_Int32& o_nRowCount)
|
||||
:OKeySet(nullptr,nullptr,OUString(),_xComposer,_aParameterValueForCache,i_nMaxRows,o_nRowCount)
|
||||
,m_aSqlParser( _rContext )
|
||||
,m_aSqlIterator( i_xConnection, Reference<XTablesSupplier>(_xComposer,UNO_QUERY)->getTables(), m_aSqlParser )
|
||||
,m_aSqlIterator( i_xConnection, Reference<XTablesSupplier>(_xComposer,UNO_QUERY_THROW)->getTables(), m_aSqlParser )
|
||||
,m_bResultSetChanged(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
|
||||
const OUString& i_sRowSetFilter,
|
||||
sal_Int32 i_nMaxRows)
|
||||
:m_xSet(_xRs)
|
||||
,m_xMetaData(Reference< XResultSetMetaDataSupplier >(_xRs,UNO_QUERY)->getMetaData())
|
||||
,m_xMetaData(Reference< XResultSetMetaDataSupplier >(_xRs,UNO_QUERY_THROW)->getMetaData())
|
||||
,m_aContext( _rContext )
|
||||
,m_nFetchSize(0)
|
||||
,m_nRowCount(0)
|
||||
@@ -1693,7 +1693,7 @@ bool ORowSetCache::isResultSetChanged() const
|
||||
void ORowSetCache::reset(const Reference< XResultSet>& _xDriverSet)
|
||||
{
|
||||
m_xSet = _xDriverSet;
|
||||
m_xMetaData.set(Reference< XResultSetMetaDataSupplier >(_xDriverSet,UNO_QUERY)->getMetaData());
|
||||
m_xMetaData.set(Reference< XResultSetMetaDataSupplier >(_xDriverSet,UNO_QUERY_THROW)->getMetaData());
|
||||
m_xCacheSet->reset(_xDriverSet);
|
||||
|
||||
m_bRowCountFinal = false;
|
||||
|
||||
@@ -420,14 +420,14 @@ Reference< XNameAccess> ODBTableDecorator::getIndexes()
|
||||
{
|
||||
::osl::MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
|
||||
return Reference< XIndexesSupplier>(m_xTable,UNO_QUERY)->getIndexes();
|
||||
return Reference< XIndexesSupplier>(m_xTable,UNO_QUERY_THROW)->getIndexes();
|
||||
}
|
||||
|
||||
Reference< XIndexAccess> ODBTableDecorator::getKeys()
|
||||
{
|
||||
::osl::MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed);
|
||||
return Reference< XKeysSupplier>(m_xTable,UNO_QUERY)->getKeys();
|
||||
return Reference< XKeysSupplier>(m_xTable,UNO_QUERY_THROW)->getKeys();
|
||||
}
|
||||
|
||||
Reference< XNameAccess> ODBTableDecorator::getColumns()
|
||||
|
||||
@@ -91,7 +91,7 @@ void SAL_CALL OCallableStatement::registerOutParameter( sal_Int32 parameterIndex
|
||||
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
Reference< XOutParameters >(m_xAggregateAsSet, UNO_QUERY)->registerOutParameter( parameterIndex, sqlType, typeName );
|
||||
Reference< XOutParameters >(m_xAggregateAsSet, UNO_QUERY_THROW)->registerOutParameter( parameterIndex, sqlType, typeName );
|
||||
}
|
||||
|
||||
void SAL_CALL OCallableStatement::registerNumericOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, sal_Int32 scale )
|
||||
@@ -99,7 +99,7 @@ void SAL_CALL OCallableStatement::registerNumericOutParameter( sal_Int32 paramet
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
Reference< XOutParameters >(m_xAggregateAsSet, UNO_QUERY)->registerNumericOutParameter( parameterIndex, sqlType, scale );
|
||||
Reference< XOutParameters >(m_xAggregateAsSet, UNO_QUERY_THROW)->registerNumericOutParameter( parameterIndex, sqlType, scale );
|
||||
}
|
||||
|
||||
// XRow
|
||||
@@ -108,7 +108,7 @@ sal_Bool SAL_CALL OCallableStatement::wasNull( )
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->wasNull();
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->wasNull();
|
||||
}
|
||||
|
||||
OUString SAL_CALL OCallableStatement::getString( sal_Int32 columnIndex )
|
||||
@@ -116,7 +116,7 @@ OUString SAL_CALL OCallableStatement::getString( sal_Int32 columnIndex )
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getString( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getString( columnIndex );
|
||||
}
|
||||
|
||||
sal_Bool SAL_CALL OCallableStatement::getBoolean( sal_Int32 columnIndex )
|
||||
@@ -124,7 +124,7 @@ sal_Bool SAL_CALL OCallableStatement::getBoolean( sal_Int32 columnIndex )
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getBoolean( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBoolean( columnIndex );
|
||||
}
|
||||
|
||||
sal_Int8 SAL_CALL OCallableStatement::getByte( sal_Int32 columnIndex )
|
||||
@@ -132,63 +132,63 @@ sal_Int8 SAL_CALL OCallableStatement::getByte( sal_Int32 columnIndex )
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getByte( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getByte( columnIndex );
|
||||
}
|
||||
|
||||
sal_Int16 SAL_CALL OCallableStatement::getShort( sal_Int32 columnIndex )
|
||||
{
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getShort( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getShort( columnIndex );
|
||||
}
|
||||
|
||||
sal_Int32 SAL_CALL OCallableStatement::getInt( sal_Int32 columnIndex )
|
||||
{
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getInt( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getInt( columnIndex );
|
||||
}
|
||||
|
||||
sal_Int64 SAL_CALL OCallableStatement::getLong( sal_Int32 columnIndex )
|
||||
{
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getLong( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getLong( columnIndex );
|
||||
}
|
||||
|
||||
float SAL_CALL OCallableStatement::getFloat( sal_Int32 columnIndex )
|
||||
{
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getFloat( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getFloat( columnIndex );
|
||||
}
|
||||
|
||||
double SAL_CALL OCallableStatement::getDouble( sal_Int32 columnIndex )
|
||||
{
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getDouble( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getDouble( columnIndex );
|
||||
}
|
||||
|
||||
Sequence< sal_Int8 > SAL_CALL OCallableStatement::getBytes( sal_Int32 columnIndex )
|
||||
{
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getBytes( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBytes( columnIndex );
|
||||
}
|
||||
|
||||
css::util::Date SAL_CALL OCallableStatement::getDate( sal_Int32 columnIndex )
|
||||
{
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getDate( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getDate( columnIndex );
|
||||
}
|
||||
|
||||
css::util::Time SAL_CALL OCallableStatement::getTime( sal_Int32 columnIndex )
|
||||
{
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getTime( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getTime( columnIndex );
|
||||
}
|
||||
|
||||
css::util::DateTime SAL_CALL OCallableStatement::getTimestamp( sal_Int32 columnIndex )
|
||||
@@ -196,7 +196,7 @@ css::util::DateTime SAL_CALL OCallableStatement::getTimestamp( sal_Int32 columnI
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getTimestamp( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getTimestamp( columnIndex );
|
||||
}
|
||||
|
||||
Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getBinaryStream( sal_Int32 columnIndex )
|
||||
@@ -204,7 +204,7 @@ Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getBinaryStream(
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getBinaryStream( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBinaryStream( columnIndex );
|
||||
}
|
||||
|
||||
Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getCharacterStream( sal_Int32 columnIndex )
|
||||
@@ -212,7 +212,7 @@ Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getCharacterStre
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getCharacterStream( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getCharacterStream( columnIndex );
|
||||
}
|
||||
|
||||
Any SAL_CALL OCallableStatement::getObject( sal_Int32 columnIndex, const Reference< css::container::XNameAccess >& typeMap )
|
||||
@@ -220,35 +220,35 @@ Any SAL_CALL OCallableStatement::getObject( sal_Int32 columnIndex, const Referen
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getObject( columnIndex, typeMap );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getObject( columnIndex, typeMap );
|
||||
}
|
||||
|
||||
Reference< XRef > SAL_CALL OCallableStatement::getRef( sal_Int32 columnIndex )
|
||||
{
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getRef( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getRef( columnIndex );
|
||||
}
|
||||
|
||||
Reference< XBlob > SAL_CALL OCallableStatement::getBlob( sal_Int32 columnIndex )
|
||||
{
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getBlob( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBlob( columnIndex );
|
||||
}
|
||||
|
||||
Reference< XClob > SAL_CALL OCallableStatement::getClob( sal_Int32 columnIndex )
|
||||
{
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getClob( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getClob( columnIndex );
|
||||
}
|
||||
|
||||
Reference< XArray > SAL_CALL OCallableStatement::getArray( sal_Int32 columnIndex )
|
||||
{
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY)->getArray( columnIndex );
|
||||
return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getArray( columnIndex );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ Reference< XNameAccess > SAL_CALL OQueryComposer::getTables( )
|
||||
::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
|
||||
|
||||
::osl::MutexGuard aGuard( m_aMutex );
|
||||
return Reference<XTablesSupplier>(m_xComposer,UNO_QUERY)->getTables();
|
||||
return Reference<XTablesSupplier>(m_xComposer,UNO_QUERY_THROW)->getTables();
|
||||
}
|
||||
|
||||
// XColumnsSupplier
|
||||
@@ -256,7 +256,7 @@ Reference< XNameAccess > SAL_CALL OQueryComposer::getColumns( )
|
||||
::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
|
||||
|
||||
::osl::MutexGuard aGuard( m_aMutex );
|
||||
return Reference<XColumnsSupplier>(m_xComposer,UNO_QUERY)->getColumns();
|
||||
return Reference<XColumnsSupplier>(m_xComposer,UNO_QUERY_THROW)->getColumns();
|
||||
}
|
||||
|
||||
Reference< XIndexAccess > SAL_CALL OQueryComposer::getParameters( )
|
||||
@@ -264,7 +264,7 @@ Reference< XIndexAccess > SAL_CALL OQueryComposer::getParameters( )
|
||||
::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed);
|
||||
|
||||
::osl::MutexGuard aGuard( m_aMutex );
|
||||
return Reference<XParametersSupplier>(m_xComposer,UNO_QUERY)->getParameters();
|
||||
return Reference<XParametersSupplier>(m_xComposer,UNO_QUERY_THROW)->getParameters();
|
||||
}
|
||||
|
||||
void SAL_CALL OQueryComposer::acquire() throw()
|
||||
|
||||
@@ -221,7 +221,7 @@ void SAL_CALL OQueryContainer::dropByIndex( sal_Int32 _nIndex )
|
||||
throw DisposedException( OUString(), *this );
|
||||
|
||||
OUString sName;
|
||||
Reference<XPropertySet> xProp(Reference<XIndexAccess>(m_xCommandDefinitions,UNO_QUERY)->getByIndex(_nIndex),UNO_QUERY);
|
||||
Reference<XPropertySet> xProp(Reference<XIndexAccess>(m_xCommandDefinitions,UNO_QUERY_THROW)->getByIndex(_nIndex),UNO_QUERY);
|
||||
if ( xProp.is() )
|
||||
xProp->getPropertyValue(PROPERTY_NAME) >>= sName;
|
||||
|
||||
@@ -401,7 +401,7 @@ sal_Bool SAL_CALL OQueryContainer::hasElements( )
|
||||
sal_Int32 SAL_CALL OQueryContainer::getCount( )
|
||||
{
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
return Reference<XIndexAccess>(m_xCommandDefinitions,UNO_QUERY)->getCount();
|
||||
return Reference<XIndexAccess>(m_xCommandDefinitions,UNO_QUERY_THROW)->getCount();
|
||||
}
|
||||
|
||||
Sequence< OUString > SAL_CALL OQueryContainer::getElementNames( )
|
||||
|
||||
@@ -147,7 +147,7 @@ void OResultSet::disposing()
|
||||
m_pColumns->disposing();
|
||||
|
||||
// close the pending result set
|
||||
Reference< XCloseable > (m_xDelegatorResultSet, UNO_QUERY)->close();
|
||||
Reference< XCloseable > (m_xDelegatorResultSet, UNO_QUERY_THROW)->close();
|
||||
|
||||
m_xDelegatorResultSet = nullptr;
|
||||
m_xDelegatorRow = nullptr;
|
||||
@@ -253,7 +253,7 @@ void OResultSet::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const
|
||||
OSL_ENSURE(!aPropName.isEmpty(), "property not found?");
|
||||
|
||||
// now read the value
|
||||
rValue = Reference< XPropertySet >(m_xDelegatorResultSet, UNO_QUERY)->getPropertyValue(aPropName);
|
||||
rValue = Reference< XPropertySet >(m_xDelegatorResultSet, UNO_QUERY_THROW)->getPropertyValue(aPropName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -279,7 +279,7 @@ Reference< XResultSetMetaData > OResultSet::getMetaData()
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
|
||||
|
||||
return Reference< XResultSetMetaDataSupplier >(m_xDelegatorResultSet, UNO_QUERY)->getMetaData();
|
||||
return Reference< XResultSetMetaDataSupplier >(m_xDelegatorResultSet, UNO_QUERY_THROW)->getMetaData();
|
||||
}
|
||||
|
||||
// css::sdbc::XColumnLocate
|
||||
@@ -288,7 +288,7 @@ sal_Int32 OResultSet::findColumn(const OUString& columnName)
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OResultSetBase::rBHelper.bDisposed);
|
||||
|
||||
return Reference< XColumnLocate >(m_xDelegatorResultSet, UNO_QUERY)->findColumn(columnName);
|
||||
return Reference< XColumnLocate >(m_xDelegatorResultSet, UNO_QUERY_THROW)->findColumn(columnName);
|
||||
}
|
||||
|
||||
namespace
|
||||
@@ -326,7 +326,7 @@ Reference< css::container::XNameAccess > OResultSet::getColumns()
|
||||
if (!m_pColumns->isInitialized())
|
||||
{
|
||||
// get the metadata
|
||||
Reference< XResultSetMetaData > xMetaData = Reference< XResultSetMetaDataSupplier >(m_xDelegatorResultSet, UNO_QUERY)->getMetaData();
|
||||
Reference< XResultSetMetaData > xMetaData = Reference< XResultSetMetaDataSupplier >(m_xDelegatorResultSet, UNO_QUERY_THROW)->getMetaData();
|
||||
|
||||
sal_Int32 nColCount = 0;
|
||||
// do we have columns
|
||||
@@ -868,7 +868,7 @@ Any OResultSet::getBookmark()
|
||||
|
||||
checkBookmarkable();
|
||||
|
||||
return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->getBookmark();
|
||||
return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY_THROW)->getBookmark();
|
||||
}
|
||||
|
||||
sal_Bool OResultSet::moveToBookmark(const Any& bookmark)
|
||||
@@ -878,7 +878,7 @@ sal_Bool OResultSet::moveToBookmark(const Any& bookmark)
|
||||
|
||||
checkBookmarkable();
|
||||
|
||||
return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->moveToBookmark(bookmark);
|
||||
return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY_THROW)->moveToBookmark(bookmark);
|
||||
}
|
||||
|
||||
sal_Bool OResultSet::moveRelativeToBookmark(const Any& bookmark, sal_Int32 rows)
|
||||
@@ -888,7 +888,7 @@ sal_Bool OResultSet::moveRelativeToBookmark(const Any& bookmark, sal_Int32 rows)
|
||||
|
||||
checkBookmarkable();
|
||||
|
||||
return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->moveRelativeToBookmark(bookmark, rows);
|
||||
return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY_THROW)->moveRelativeToBookmark(bookmark, rows);
|
||||
}
|
||||
|
||||
sal_Int32 OResultSet::compareBookmarks(const Any& _first, const Any& _second)
|
||||
@@ -898,7 +898,7 @@ sal_Int32 OResultSet::compareBookmarks(const Any& _first, const Any& _second)
|
||||
|
||||
checkBookmarkable();
|
||||
|
||||
return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->compareBookmarks(_first, _second);
|
||||
return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY_THROW)->compareBookmarks(_first, _second);
|
||||
}
|
||||
|
||||
sal_Bool OResultSet::hasOrderedBookmarks()
|
||||
@@ -908,7 +908,7 @@ sal_Bool OResultSet::hasOrderedBookmarks()
|
||||
|
||||
checkBookmarkable();
|
||||
|
||||
return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->hasOrderedBookmarks();
|
||||
return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY_THROW)->hasOrderedBookmarks();
|
||||
}
|
||||
|
||||
sal_Int32 OResultSet::hashBookmark(const Any& bookmark)
|
||||
@@ -918,7 +918,7 @@ sal_Int32 OResultSet::hashBookmark(const Any& bookmark)
|
||||
|
||||
checkBookmarkable();
|
||||
|
||||
return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY)->hashBookmark(bookmark);
|
||||
return Reference< XRowLocate >(m_xDelegatorResultSet, UNO_QUERY_THROW)->hashBookmark(bookmark);
|
||||
}
|
||||
|
||||
// css::sdbc::XResultSetUpdate
|
||||
|
||||
@@ -147,7 +147,7 @@ void OStatementBase::disposing()
|
||||
{
|
||||
try
|
||||
{
|
||||
Reference< XCloseable > (m_xAggregateAsSet, UNO_QUERY)->close();
|
||||
Reference< XCloseable > (m_xAggregateAsSet, UNO_QUERY_THROW)->close();
|
||||
}
|
||||
catch(RuntimeException& )
|
||||
{// don't care for anymore
|
||||
@@ -292,7 +292,7 @@ Any OStatementBase::getWarnings()
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
return Reference< XWarningsSupplier >(m_xAggregateAsSet, UNO_QUERY)->getWarnings();
|
||||
return Reference< XWarningsSupplier >(m_xAggregateAsSet, UNO_QUERY_THROW)->getWarnings();
|
||||
}
|
||||
|
||||
void OStatementBase::clearWarnings()
|
||||
@@ -300,7 +300,7 @@ void OStatementBase::clearWarnings()
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
Reference< XWarningsSupplier >(m_xAggregateAsSet, UNO_QUERY)->clearWarnings();
|
||||
Reference< XWarningsSupplier >(m_xAggregateAsSet, UNO_QUERY_THROW)->clearWarnings();
|
||||
}
|
||||
|
||||
// css::util::XCancellable
|
||||
@@ -320,11 +320,11 @@ Reference< XResultSet > SAL_CALL OStatementBase::getResultSet( )
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
// first check the meta data
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData();
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
|
||||
if (!xMeta.is() || !xMeta->supportsMultipleResultSets())
|
||||
throwFunctionSequenceException(*this);
|
||||
|
||||
return Reference< XMultipleResults >(m_xAggregateAsSet, UNO_QUERY)->getResultSet();
|
||||
return Reference< XMultipleResults >(m_xAggregateAsSet, UNO_QUERY_THROW)->getResultSet();
|
||||
}
|
||||
|
||||
sal_Int32 SAL_CALL OStatementBase::getUpdateCount( )
|
||||
@@ -333,11 +333,11 @@ sal_Int32 SAL_CALL OStatementBase::getUpdateCount( )
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
// first check the meta data
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData();
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
|
||||
if (!xMeta.is() || !xMeta->supportsMultipleResultSets())
|
||||
throwFunctionSequenceException(*this);
|
||||
|
||||
return Reference< XMultipleResults >(m_xAggregateAsSet, UNO_QUERY)->getUpdateCount();
|
||||
return Reference< XMultipleResults >(m_xAggregateAsSet, UNO_QUERY_THROW)->getUpdateCount();
|
||||
}
|
||||
|
||||
sal_Bool SAL_CALL OStatementBase::getMoreResults( )
|
||||
@@ -346,14 +346,14 @@ sal_Bool SAL_CALL OStatementBase::getMoreResults( )
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
// first check the meta data
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData();
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
|
||||
if (!xMeta.is() || !xMeta->supportsMultipleResultSets())
|
||||
throwFunctionSequenceException(*this);
|
||||
|
||||
// free the previous results
|
||||
disposeResultSet();
|
||||
|
||||
return Reference< XMultipleResults >(m_xAggregateAsSet, UNO_QUERY)->getMoreResults();
|
||||
return Reference< XMultipleResults >(m_xAggregateAsSet, UNO_QUERY_THROW)->getMoreResults();
|
||||
}
|
||||
|
||||
// XPreparedBatchExecution
|
||||
@@ -363,11 +363,11 @@ void SAL_CALL OStatementBase::addBatch( )
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
// first check the meta data
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData();
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
|
||||
if (!xMeta.is() || !xMeta->supportsBatchUpdates())
|
||||
throwFunctionSequenceException(*this);
|
||||
|
||||
Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->addBatch();
|
||||
Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY_THROW)->addBatch();
|
||||
}
|
||||
|
||||
void SAL_CALL OStatementBase::clearBatch( )
|
||||
@@ -376,11 +376,11 @@ void SAL_CALL OStatementBase::clearBatch( )
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
// first check the meta data
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData();
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
|
||||
if (!xMeta.is() || !xMeta->supportsBatchUpdates())
|
||||
throwFunctionSequenceException(*this);
|
||||
|
||||
Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->clearBatch();
|
||||
Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY_THROW)->clearBatch();
|
||||
}
|
||||
|
||||
Sequence< sal_Int32 > SAL_CALL OStatementBase::executeBatch( )
|
||||
@@ -389,14 +389,14 @@ Sequence< sal_Int32 > SAL_CALL OStatementBase::executeBatch( )
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
// first check the meta data
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData();
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
|
||||
if (!xMeta.is() || !xMeta->supportsBatchUpdates())
|
||||
throwFunctionSequenceException(*this);
|
||||
|
||||
// free the previous results
|
||||
disposeResultSet();
|
||||
|
||||
return Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->executeBatch();
|
||||
return Reference< XPreparedBatchExecution >(m_xAggregateAsSet, UNO_QUERY_THROW)->executeBatch();
|
||||
}
|
||||
|
||||
Reference< XResultSet > SAL_CALL OStatementBase::getGeneratedValues( )
|
||||
@@ -495,12 +495,12 @@ void OStatement::addBatch( const OUString& _rSQL )
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
|
||||
// first check the meta data
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData();
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
|
||||
if (!xMeta.is() || !xMeta->supportsBatchUpdates())
|
||||
throwFunctionSequenceException(*this);
|
||||
|
||||
OUString sSQL( impl_doEscapeProcessing_nothrow( _rSQL ) );
|
||||
Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->addBatch( sSQL );
|
||||
Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY_THROW)->addBatch( sSQL );
|
||||
}
|
||||
|
||||
void OStatement::clearBatch( )
|
||||
@@ -508,11 +508,11 @@ void OStatement::clearBatch( )
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
// first check the meta data
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData();
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
|
||||
if (!xMeta.is() || !xMeta->supportsBatchUpdates())
|
||||
throwFunctionSequenceException(*this);
|
||||
|
||||
Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->clearBatch();
|
||||
Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY_THROW)->clearBatch();
|
||||
}
|
||||
|
||||
Sequence< sal_Int32 > OStatement::executeBatch( )
|
||||
@@ -520,10 +520,10 @@ Sequence< sal_Int32 > OStatement::executeBatch( )
|
||||
MutexGuard aGuard(m_aMutex);
|
||||
::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
|
||||
// first check the meta data
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY)->getMetaData();
|
||||
Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData();
|
||||
if (!xMeta.is() || !xMeta->supportsBatchUpdates())
|
||||
throwFunctionSequenceException(*this);
|
||||
return Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->executeBatch( );
|
||||
return Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY_THROW)->executeBatch( );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2042,7 +2042,7 @@ void OApplicationController::renameEntry()
|
||||
if ( xParent.is() )
|
||||
{
|
||||
xHNames = xParent;
|
||||
Reference<XPropertySet>(xRename,UNO_QUERY)->getPropertyValue(PROPERTY_NAME) >>= sName;
|
||||
Reference<XPropertySet>(xRename,UNO_QUERY_THROW)->getPropertyValue(PROPERTY_NAME) >>= sName;
|
||||
}
|
||||
}
|
||||
pNameChecker.reset( new HierarchicalNameCheck( xHNames.get(), OUString() ) );
|
||||
|
||||
@@ -130,7 +130,7 @@ DlgFilterCrit::DlgFilterCrit(weld::Window * pParent,
|
||||
m_xLB_WHEREFIELD3->append_text( *pIter );
|
||||
}
|
||||
|
||||
Reference<XNameAccess> xSelectColumns = Reference<XColumnsSupplier>(m_xQueryComposer,UNO_QUERY)->getColumns();
|
||||
Reference<XNameAccess> xSelectColumns = Reference<XColumnsSupplier>(m_xQueryComposer,UNO_QUERY_THROW)->getColumns();
|
||||
aNames = xSelectColumns->getElementNames();
|
||||
pIter = aNames.getConstArray();
|
||||
pEnd = pIter + aNames.getLength();
|
||||
@@ -357,7 +357,7 @@ Reference< XPropertySet > DlgFilterCrit::getColumn( const OUString& _rFieldName
|
||||
if ( m_xColumns.is() && m_xColumns->hasByName( _rFieldName ) )
|
||||
m_xColumns->getByName( _rFieldName ) >>= xColumn;
|
||||
|
||||
Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY)->getColumns();
|
||||
Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY_THROW)->getColumns();
|
||||
if ( xColumns.is() && !xColumn.is() )
|
||||
{
|
||||
Sequence< OUString> aSeq = xColumns->getElementNames();
|
||||
@@ -393,7 +393,7 @@ Reference< XPropertySet > DlgFilterCrit::getQueryColumn( const OUString& _rField
|
||||
Reference< XPropertySet > xColumn;
|
||||
try
|
||||
{
|
||||
Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY)->getColumns();
|
||||
Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY_THROW)->getColumns();
|
||||
if ( xColumns.is() && xColumns->hasByName( _rFieldName ) )
|
||||
xColumns->getByName( _rFieldName ) >>= xColumn;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ OUString DlgOrderCrit::GetOrderList( ) const
|
||||
Reference<XDatabaseMetaData> xMetaData = m_xConnection->getMetaData();
|
||||
OUString sQuote = xMetaData.is() ? xMetaData->getIdentifierQuoteString() : OUString();
|
||||
|
||||
Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY)->getColumns();
|
||||
Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY_THROW)->getColumns();
|
||||
|
||||
OUStringBuffer sOrder;
|
||||
for( sal_uInt16 i=0 ; i<DOG_ROWS; i++ )
|
||||
|
||||
@@ -61,7 +61,7 @@ void ORowSetImportExport::initialize()
|
||||
Reference<XColumnLocate> xColumnLocate(m_xResultSet,UNO_QUERY);
|
||||
OSL_ENSURE(xColumnLocate.is(),"The rowset normally should support this");
|
||||
|
||||
m_xTargetResultSetMetaData = Reference<XResultSetMetaDataSupplier>(m_xTargetResultSetUpdate,UNO_QUERY)->getMetaData();
|
||||
m_xTargetResultSetMetaData = Reference<XResultSetMetaDataSupplier>(m_xTargetResultSetUpdate,UNO_QUERY_THROW)->getMetaData();
|
||||
if(!m_xTargetResultSetMetaData.is() || !xColumnLocate.is() || !m_xResultSetMetaData.is() )
|
||||
throw SQLException(DBA_RES(STR_UNEXPECTED_ERROR),*this,"S1000",0,Any());
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ void ODatabaseImportExport::initialize()
|
||||
{
|
||||
m_xRow.set( m_xResultSet, UNO_QUERY );
|
||||
m_xRowLocate.set( m_xResultSet, UNO_QUERY );
|
||||
m_xResultSetMetaData = Reference<XResultSetMetaDataSupplier>(m_xRow,UNO_QUERY)->getMetaData();
|
||||
m_xResultSetMetaData = Reference<XResultSetMetaDataSupplier>(m_xRow,UNO_QUERY_THROW)->getMetaData();
|
||||
Reference<XColumnsSupplier> xSup(m_xResultSet,UNO_QUERY_THROW);
|
||||
m_xRowSetColumns.set(xSup->getColumns(),UNO_QUERY_THROW);
|
||||
}
|
||||
|
||||
@@ -430,7 +430,7 @@ void fillTypeInfo( const Reference< css::sdbc::XConnection>& _rxConnection,
|
||||
// Information for a single SQL type
|
||||
if(xRs.is())
|
||||
{
|
||||
Reference<XResultSetMetaData> xResultSetMetaData = Reference<XResultSetMetaDataSupplier>(xRs,UNO_QUERY)->getMetaData();
|
||||
Reference<XResultSetMetaData> xResultSetMetaData = Reference<XResultSetMetaDataSupplier>(xRs,UNO_QUERY_THROW)->getMetaData();
|
||||
::connectivity::ORowSetValue aValue;
|
||||
std::vector<sal_Int32> aTypes;
|
||||
std::vector<bool> aNullable;
|
||||
|
||||
@@ -189,7 +189,7 @@ void ORelationTableView::AddConnection(const OJoinExchangeData& jxdSource, const
|
||||
|
||||
// the number of PKey-Fields in the source
|
||||
const Reference< XNameAccess> xPrimaryKeyColumns = getPrimaryKeyColumns_throw(pSourceWin->GetData()->getTable());
|
||||
bool bAskUser = xPrimaryKeyColumns.is() && Reference< XIndexAccess>(xPrimaryKeyColumns,UNO_QUERY)->getCount() > 1;
|
||||
bool bAskUser = xPrimaryKeyColumns.is() && Reference< XIndexAccess>(xPrimaryKeyColumns,UNO_QUERY_THROW)->getCount() > 1;
|
||||
|
||||
pTabConnData->SetConnLine( 0, sSourceFieldName, sDestFieldName );
|
||||
|
||||
|
||||
@@ -597,7 +597,7 @@ void DesktopLOKTest::testPasteWriterJPEG()
|
||||
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, xShape->getPropertyValue("AnchorType").get<text::TextContentAnchorType>());
|
||||
|
||||
// Delete the pasted picture, and paste again with a custom anchor type.
|
||||
uno::Reference<lang::XComponent>(xShape, uno::UNO_QUERY)->dispose();
|
||||
uno::Reference<lang::XComponent>(xShape, uno::UNO_QUERY_THROW)->dispose();
|
||||
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
|
||||
{
|
||||
{"AnchorType", uno::makeAny(static_cast<sal_uInt16>(text::TextContentAnchorType_AT_CHARACTER))},
|
||||
|
||||
@@ -123,7 +123,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, Sequence< PropertyValue
|
||||
// check for selection
|
||||
try
|
||||
{
|
||||
Reference< frame::XController > xController( Reference< frame::XModel >( rxDoc, UNO_QUERY )->getCurrentController() );
|
||||
Reference< frame::XController > xController( Reference< frame::XModel >( rxDoc, UNO_QUERY_THROW )->getCurrentController() );
|
||||
if( xController.is() )
|
||||
{
|
||||
Reference< view::XSelectionSupplier > xView( xController, UNO_QUERY );
|
||||
|
||||
@@ -2084,7 +2084,7 @@ static void lcl_dispatch(const Reference< XFrame >& xFrame,const Reference<XURLT
|
||||
aURL.Complete = aURLStr;
|
||||
xTransformer->parseStrict(aURL);
|
||||
|
||||
Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY)->queryDispatch(aURL, aTargetName,
|
||||
Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY_THROW)->queryDispatch(aURL, aTargetName,
|
||||
FrameSearchFlag::SELF | FrameSearchFlag::PARENT | FrameSearchFlag::CHILDREN |
|
||||
FrameSearchFlag::SIBLINGS | FrameSearchFlag::CREATE | FrameSearchFlag::TASKS);
|
||||
|
||||
@@ -2175,7 +2175,7 @@ void ODatabaseForm::submit_impl(const Reference<XControl>& Control, const css::a
|
||||
if (xTransformer.is())
|
||||
xTransformer->parseStrict(aURL);
|
||||
|
||||
Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY)->queryDispatch(aURL, aTargetName,
|
||||
Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY_THROW)->queryDispatch(aURL, aTargetName,
|
||||
FrameSearchFlag::SELF | FrameSearchFlag::PARENT | FrameSearchFlag::CHILDREN |
|
||||
FrameSearchFlag::SIBLINGS | FrameSearchFlag::CREATE | FrameSearchFlag::TASKS);
|
||||
|
||||
@@ -2199,7 +2199,7 @@ void ODatabaseForm::submit_impl(const Reference<XControl>& Control, const css::a
|
||||
aURL.Complete = aURLStr;
|
||||
xTransformer->parseStrict(aURL);
|
||||
|
||||
Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY)->queryDispatch(aURL, aTargetName,
|
||||
Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY_THROW)->queryDispatch(aURL, aTargetName,
|
||||
FrameSearchFlag::SELF | FrameSearchFlag::PARENT | FrameSearchFlag::CHILDREN |
|
||||
FrameSearchFlag::SIBLINGS | FrameSearchFlag::CREATE | FrameSearchFlag::TASKS);
|
||||
|
||||
|
||||
@@ -352,7 +352,7 @@ namespace frm
|
||||
case FormComponentType::RADIOBUTTON:
|
||||
{
|
||||
if ( rEvent.Selected == TRISTATE_TRUE )
|
||||
aText.append( ::comphelper::getString( Reference< XPropertySet >( getModel(), UNO_QUERY )->getPropertyValue( PROPERTY_REFVALUE ) ) );
|
||||
aText.append( ::comphelper::getString( Reference< XPropertySet >( getModel(), UNO_QUERY_THROW )->getPropertyValue( PROPERTY_REFVALUE ) ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -598,7 +598,7 @@ namespace frm
|
||||
Reference< XVclWindowPeer > xVclWindow( getPeer(), UNO_QUERY );
|
||||
if (xVclWindow.is())
|
||||
{
|
||||
OUString aRefText = ::comphelper::getString(css::uno::Reference< XPropertySet > (getModel(), UNO_QUERY)->getPropertyValue(PROPERTY_REFVALUE));
|
||||
OUString aRefText = ::comphelper::getString(css::uno::Reference< XPropertySet > (getModel(), UNO_QUERY_THROW)->getPropertyValue(PROPERTY_REFVALUE));
|
||||
Any aValue;
|
||||
if (aText == aRefText)
|
||||
aValue <<= sal_Int32(TRISTATE_TRUE);
|
||||
|
||||
@@ -298,7 +298,7 @@ namespace frm
|
||||
OUString aTargetFrame;
|
||||
xSet->getPropertyValue(PROPERTY_TARGET_FRAME) >>= aTargetFrame;
|
||||
|
||||
Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY)->queryDispatch( aURL, aTargetFrame,
|
||||
Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY_THROW)->queryDispatch( aURL, aTargetFrame,
|
||||
FrameSearchFlag::SELF | FrameSearchFlag::PARENT |
|
||||
FrameSearchFlag::SIBLINGS | FrameSearchFlag::CREATE );
|
||||
|
||||
@@ -314,7 +314,7 @@ namespace frm
|
||||
{
|
||||
URL aHyperLink = m_pFeatureInterception->getTransformer().getStrictURLFromAscii( ".uno:OpenHyperlink" );
|
||||
|
||||
Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY)->queryDispatch(aHyperLink, OUString() , 0);
|
||||
Reference< XDispatch > xDisp = Reference< XDispatchProvider > (xFrame,UNO_QUERY_THROW)->queryDispatch(aHyperLink, OUString() , 0);
|
||||
|
||||
if ( xDisp.is() )
|
||||
{
|
||||
|
||||
@@ -158,7 +158,7 @@ void DispatchTest::tearDown()
|
||||
|
||||
void DispatchTest::dispatchCommand(const uno::Reference<lang::XComponent>& xComponent, const OUString& rCommand, const uno::Sequence<beans::PropertyValue>& rPropertyValues)
|
||||
{
|
||||
uno::Reference<frame::XController> xController = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY)->getCurrentController();
|
||||
uno::Reference<frame::XController> xController = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController();
|
||||
CPPUNIT_ASSERT(xController.is());
|
||||
uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY);
|
||||
CPPUNIT_ASSERT(xFrame.is());
|
||||
|
||||
@@ -1954,7 +1954,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape )
|
||||
|
||||
xParent->getPropertyValue("InteropGrabBag") >>= grabBag;
|
||||
|
||||
entryName = uno::Reference<embed::XEmbedPersist>(xObj, uno::UNO_QUERY)->getEntryName();
|
||||
entryName = uno::Reference<embed::XEmbedPersist>(xObj, uno::UNO_QUERY_THROW)->getEntryName();
|
||||
}
|
||||
catch (uno::Exception const& e)
|
||||
{
|
||||
|
||||
@@ -193,7 +193,7 @@ void VbaProject::importVbaData(const uno::Reference<io::XInputStream>& xInputStr
|
||||
uno::Reference<io::XOutputStream> xDocStream(xDocStorage->openStreamElement("_MS_VBA_Macros_XML", nOpenMode), uno::UNO_QUERY);
|
||||
comphelper::OStorageHelper::CopyInputToOutput(xInputStream, xDocStream);
|
||||
}
|
||||
uno::Reference<embed::XTransactedObject>(xDocStorage, uno::UNO_QUERY)->commit();
|
||||
uno::Reference<embed::XTransactedObject>(xDocStorage, uno::UNO_QUERY_THROW)->commit();
|
||||
}
|
||||
|
||||
void VbaProject::registerMacroAttacher( const VbaMacroAttacherRef& rxAttacher )
|
||||
|
||||
@@ -277,7 +277,7 @@ uno::Reference< frame::XModel > OReportEngineJFree::createDocumentAlive( const u
|
||||
// if there is no frame given, find the right
|
||||
xFrameLoad.set( frame::Desktop::create(m_xContext), uno::UNO_QUERY);
|
||||
sal_Int32 const nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE;
|
||||
uno::Reference< frame::XFrame> xFrame = uno::Reference< frame::XFrame>(xFrameLoad,uno::UNO_QUERY)->findFrame("_blank",nFrameSearchFlag);
|
||||
uno::Reference< frame::XFrame> xFrame = uno::Reference< frame::XFrame>(xFrameLoad,uno::UNO_QUERY_THROW)->findFrame("_blank",nFrameSearchFlag);
|
||||
xFrameLoad.set( xFrame,uno::UNO_QUERY);
|
||||
}
|
||||
|
||||
|
||||
@@ -546,7 +546,7 @@ void ScTiledRenderingTest::testViewCursors()
|
||||
|
||||
void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& xComponent, const OUString& rCommand, const uno::Sequence<beans::PropertyValue>& rArguments)
|
||||
{
|
||||
uno::Reference<frame::XController> xController = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY)->getCurrentController();
|
||||
uno::Reference<frame::XController> xController = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController();
|
||||
CPPUNIT_ASSERT(xController.is());
|
||||
uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY);
|
||||
CPPUNIT_ASSERT(xFrame.is());
|
||||
|
||||
@@ -1791,7 +1791,7 @@ void SdImportTest::testTdf104445()
|
||||
// First shape should not have bullet
|
||||
{
|
||||
uno::Reference< beans::XPropertySet > xShape(getShapeFromPage(0, 0, xDocShRef));
|
||||
uno::Reference< text::XText > xText = uno::Reference< text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
|
||||
uno::Reference< text::XText > xText = uno::Reference< text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText();
|
||||
CPPUNIT_ASSERT_MESSAGE("Not a text shape", xText.is());
|
||||
uno::Reference< beans::XPropertySet > xPropSet(xText, uno::UNO_QUERY_THROW);
|
||||
|
||||
@@ -1812,7 +1812,7 @@ void SdImportTest::testTdf104445()
|
||||
// Second shape should have bullet set
|
||||
{
|
||||
uno::Reference< beans::XPropertySet > xShape(getShapeFromPage(1, 0, xDocShRef));
|
||||
uno::Reference< text::XText > xText = uno::Reference< text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
|
||||
uno::Reference< text::XText > xText = uno::Reference< text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText();
|
||||
CPPUNIT_ASSERT_MESSAGE("Not a text shape", xText.is());
|
||||
uno::Reference< beans::XPropertySet > xPropSet(xText, uno::UNO_QUERY_THROW);
|
||||
|
||||
|
||||
@@ -396,7 +396,7 @@ protected:
|
||||
// Nth paragraph of text in given text shape
|
||||
uno::Reference< text::XTextRange > getParagraphFromShape( int nPara, uno::Reference< beans::XPropertySet > const & xShape )
|
||||
{
|
||||
uno::Reference< text::XText > xText = uno::Reference< text::XTextRange>( xShape, uno::UNO_QUERY )->getText();
|
||||
uno::Reference< text::XText > xText = uno::Reference< text::XTextRange>( xShape, uno::UNO_QUERY_THROW )->getText();
|
||||
CPPUNIT_ASSERT_MESSAGE( "Not a text shape", xText.is() );
|
||||
|
||||
uno::Reference< container::XEnumerationAccess > paraEnumAccess( xText, uno::UNO_QUERY );
|
||||
|
||||
@@ -63,7 +63,7 @@ void ClassificationTest::tearDown()
|
||||
|
||||
void ClassificationTest::dispatchCommand(const uno::Reference<lang::XComponent>& xComponent, const OUString& rCommand, const uno::Sequence<beans::PropertyValue>& rPropertyValues)
|
||||
{
|
||||
uno::Reference<frame::XController> xController = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY)->getCurrentController();
|
||||
uno::Reference<frame::XController> xController = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController();
|
||||
CPPUNIT_ASSERT(xController.is());
|
||||
uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY);
|
||||
CPPUNIT_ASSERT(xFrame.is());
|
||||
|
||||
@@ -68,6 +68,7 @@ $(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang, \
|
||||
compilerplugins/clang/test/unnecessaryoverride-dtor \
|
||||
compilerplugins/clang/test/unnecessaryparen \
|
||||
compilerplugins/clang/test/unoany \
|
||||
compilerplugins/clang/test/unoquery \
|
||||
compilerplugins/clang/test/unreffun \
|
||||
compilerplugins/clang/test/unusedindex \
|
||||
compilerplugins/clang/test/unusedenumconstants \
|
||||
|
||||
@@ -559,10 +559,10 @@ void SAL_CALL FmXGridControl::createPeer(const Reference< css::awt::XToolkit >&
|
||||
Reference< css::sdbcx::XColumnsSupplier > xColumnsSupplier(xForm, UNO_QUERY);
|
||||
if (xColumnsSupplier.is())
|
||||
{
|
||||
if (Reference< XIndexAccess > (xColumnsSupplier->getColumns(),UNO_QUERY)->getCount())
|
||||
if (Reference< XIndexAccess > (xColumnsSupplier->getColumns(),UNO_QUERY_THROW)->getCount())
|
||||
{
|
||||
// we get only a new bookmark if the resultset is not forwardonly
|
||||
if (::comphelper::getINT32(Reference< XPropertySet > (xForm, UNO_QUERY)->getPropertyValue(FM_PROP_RESULTSET_TYPE)) != ResultSetType::FORWARD_ONLY)
|
||||
if (::comphelper::getINT32(Reference< XPropertySet > (xForm, UNO_QUERY_THROW)->getPropertyValue(FM_PROP_RESULTSET_TYPE)) != ResultSetType::FORWARD_ONLY)
|
||||
{
|
||||
// as the FmGridControl touches the data source it is connected to we have to remember the current
|
||||
// cursor position (and restore afterwards)
|
||||
@@ -572,7 +572,7 @@ void SAL_CALL FmXGridControl::createPeer(const Reference< css::awt::XToolkit >&
|
||||
{
|
||||
try
|
||||
{
|
||||
aOldCursorBookmark = Reference< css::sdbcx::XRowLocate > (xForm, UNO_QUERY)->getBookmark();
|
||||
aOldCursorBookmark = Reference< css::sdbcx::XRowLocate > (xForm, UNO_QUERY_THROW)->getBookmark();
|
||||
}
|
||||
catch( const Exception& )
|
||||
{
|
||||
@@ -1512,7 +1512,7 @@ void FmXGridPeer::cursorMoved(const EventObject& _rEvent)
|
||||
VclPtr< FmGridControl > pGrid = GetAs< FmGridControl >();
|
||||
// we are not interested in move to insert row only in the resetted event
|
||||
// which is fired after positioning an the insert row
|
||||
if (pGrid && pGrid->IsOpen() && !::comphelper::getBOOL(Reference< XPropertySet > (_rEvent.Source, UNO_QUERY)->getPropertyValue(FM_PROP_ISNEW)))
|
||||
if (pGrid && pGrid->IsOpen() && !::comphelper::getBOOL(Reference< XPropertySet > (_rEvent.Source, UNO_QUERY_THROW)->getPropertyValue(FM_PROP_ISNEW)))
|
||||
pGrid->positioned();
|
||||
}
|
||||
|
||||
|
||||
@@ -1419,7 +1419,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, DbGridCo
|
||||
// is the new cursor valid ?
|
||||
// the cursor is only valid if it contains some columns
|
||||
// if there is no cursor or the cursor is not valid we have to clean up an leave
|
||||
if (!_xCursor.is() || !Reference< XColumnsSupplier > (_xCursor, UNO_QUERY)->getColumns()->hasElements())
|
||||
if (!_xCursor.is() || !Reference< XColumnsSupplier > (_xCursor, UNO_QUERY_THROW)->getColumns()->hasElements())
|
||||
{
|
||||
RemoveRows();
|
||||
return;
|
||||
|
||||
@@ -1156,7 +1156,7 @@ void FormController::disposing()
|
||||
}
|
||||
}
|
||||
|
||||
Reference< XComponent > (rpChild, UNO_QUERY)->dispose();
|
||||
Reference< XComponent > (rpChild, UNO_QUERY_THROW)->dispose();
|
||||
}
|
||||
m_aChildren.clear();
|
||||
|
||||
|
||||
@@ -376,7 +376,7 @@ void SwMacrosTest::testFdo55289()
|
||||
uno::Reference<drawing::XShapes> const xShapes(xDPS->getDrawPage(),
|
||||
UNO_QUERY);
|
||||
uno::Reference<beans::XPropertySet> const xShape(
|
||||
uno::Reference<lang::XMultiServiceFactory>(xModel, UNO_QUERY)->
|
||||
uno::Reference<lang::XMultiServiceFactory>(xModel, UNO_QUERY_THROW)->
|
||||
createInstance("com.sun.star.drawing.GraphicObjectShape"),
|
||||
UNO_QUERY);
|
||||
xShape->setPropertyValue("AnchorType",
|
||||
@@ -391,7 +391,7 @@ void SwMacrosTest::testFdo55289()
|
||||
xShape->setPropertyValue("AnchorType",
|
||||
makeAny(text::TextContentAnchorType_AS_CHARACTER));
|
||||
uno::Reference<text::XTextRange> const xEnd =
|
||||
uno::Reference<text::XTextDocument>(xModel, UNO_QUERY)->getText()->getEnd();
|
||||
uno::Reference<text::XTextDocument>(xModel, UNO_QUERY_THROW)->getText()->getEnd();
|
||||
uno::Reference<text::XTextContent> const xShapeContent(xShape, UNO_QUERY);
|
||||
xShapeContent->attach(xEnd);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ static void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& xCompone
|
||||
const uno::Sequence<beans::PropertyValue>& rPropertyValues)
|
||||
{
|
||||
uno::Reference<frame::XController> xController
|
||||
= uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY)->getCurrentController();
|
||||
= uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController();
|
||||
CPPUNIT_ASSERT(xController.is());
|
||||
uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY);
|
||||
CPPUNIT_ASSERT(xFrame.is());
|
||||
|
||||
@@ -629,7 +629,7 @@ DECLARE_ODFEXPORT_TEST(testDuplicateCrossRefHeadingBookmark, "CrossRefHeadingBoo
|
||||
CPPUNIT_ASSERT_THROW(xBookmarks->getByName("__RefHeading__1673_25705824"), container::NoSuchElementException);
|
||||
|
||||
uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
|
||||
uno::Reference<util::XRefreshable>(xTextFieldsSupplier->getTextFields(), uno::UNO_QUERY)->refresh();
|
||||
uno::Reference<util::XRefreshable>(xTextFieldsSupplier->getTextFields(), uno::UNO_QUERY_THROW)->refresh();
|
||||
|
||||
uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
|
||||
uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
|
||||
@@ -1058,7 +1058,7 @@ DECLARE_ODFEXPORT_TEST(testTextboxRoundedCorners, "textbox-rounded-corners.odt")
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("round-rectangle"), aCustomShapeGeometry["Type"].get<OUString>());
|
||||
|
||||
// The shape text should start with a table, with "a" in its A1 cell.
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText();
|
||||
uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1, xText), uno::UNO_QUERY);
|
||||
uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY);
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("a"), xCell->getString());
|
||||
@@ -1975,7 +1975,7 @@ DECLARE_ODFEXPORT_TEST(testReferenceLanguage, "referencelanguage.odt")
|
||||
"Az (5)", "az 1", "A 2", "az 1" };
|
||||
uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
|
||||
// update "A (4)" to "Az (5)"
|
||||
uno::Reference<util::XRefreshable>(xTextFieldsSupplier->getTextFields(), uno::UNO_QUERY)->refresh();
|
||||
uno::Reference<util::XRefreshable>(xTextFieldsSupplier->getTextFields(), uno::UNO_QUERY_THROW)->refresh();
|
||||
|
||||
uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
|
||||
uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
|
||||
@@ -2045,7 +2045,7 @@ DECLARE_ODFEXPORT_TEST(testSpellOutNumberingTypes, "spellout-numberingtypes.odt"
|
||||
static const char* const aFieldTextFallbacks[] = { "Ordinal-number 1", "Ordinal 1", "1" };
|
||||
uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
|
||||
// update text field content
|
||||
uno::Reference<util::XRefreshable>(xTextFieldsSupplier->getTextFields(), uno::UNO_QUERY)->refresh();
|
||||
uno::Reference<util::XRefreshable>(xTextFieldsSupplier->getTextFields(), uno::UNO_QUERY_THROW)->refresh();
|
||||
|
||||
uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
|
||||
uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
|
||||
|
||||
@@ -56,7 +56,7 @@ DECLARE_ODFIMPORT_TEST(testHideAllSections, "fdo53210.odt")
|
||||
uno::Reference<beans::XPropertySet> xMaster(xMasters->getByName("com.sun.star.text.fieldmaster.User._CS_Allgemein"), uno::UNO_QUERY);
|
||||
xMaster->setPropertyValue("Content", uno::makeAny(OUString("0")));
|
||||
// This used to crash
|
||||
uno::Reference<util::XRefreshable>(xTextFieldsSupplier->getTextFields(), uno::UNO_QUERY)->refresh();
|
||||
uno::Reference<util::XRefreshable>(xTextFieldsSupplier->getTextFields(), uno::UNO_QUERY_THROW)->refresh();
|
||||
}
|
||||
|
||||
DECLARE_ODFIMPORT_TEST(testOdtBorders, "borders_ooo33.odt")
|
||||
@@ -482,7 +482,7 @@ DECLARE_ODFIMPORT_TEST(testFdo55814, "fdo55814.odt")
|
||||
uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
|
||||
uno::Reference<beans::XPropertySet> xField(xFields->nextElement(), uno::UNO_QUERY);
|
||||
xField->setPropertyValue("Content", uno::makeAny(OUString("Yes")));
|
||||
uno::Reference<util::XRefreshable>(xTextFieldsSupplier->getTextFields(), uno::UNO_QUERY)->refresh();
|
||||
uno::Reference<util::XRefreshable>(xTextFieldsSupplier->getTextFields(), uno::UNO_QUERY_THROW)->refresh();
|
||||
uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
|
||||
uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY);
|
||||
// This was "0".
|
||||
|
||||
@@ -212,7 +212,7 @@ DECLARE_OOXMLEXPORT_TEST(textboxWpgOnly, "textbox-wpg-only.docx")
|
||||
|
||||
// Character escapement was enabled by default, this was 58.
|
||||
uno::Reference<container::XIndexAccess> xGroup(xShape, uno::UNO_QUERY);
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(0), uno::UNO_QUERY)->getText();
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(0), uno::UNO_QUERY_THROW)->getText();
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xText), 1), "CharEscapementHeight"));
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ DECLARE_OOXMLEXPORT_TEST(testMceWpg, "mce-wpg.docx")
|
||||
{
|
||||
// Make sure that we read the primary branch, if wpg is requested as a feature.
|
||||
uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(0), uno::UNO_QUERY)->getText();
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(0), uno::UNO_QUERY_THROW)->getText();
|
||||
// This was VML1.
|
||||
getParagraphOfText(1, xText, "DML1");
|
||||
}
|
||||
@@ -240,7 +240,7 @@ DECLARE_OOXMLEXPORT_TEST(testMceNested, "mce-nested.docx")
|
||||
|
||||
// Now check the top right textbox.
|
||||
uno::Reference<container::XIndexAccess> xGroup(getShape(2), uno::UNO_QUERY);
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY)->getText();
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY_THROW)->getText();
|
||||
uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText, "[Year]");
|
||||
CPPUNIT_ASSERT_EQUAL(48.f, getProperty<float>(getRun(xParagraph, 1), "CharHeight"));
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor"));
|
||||
@@ -372,7 +372,7 @@ DECLARE_OOXMLEXPORT_TEST(testDMLGroupshapeSdt, "dml-groupshape-sdt.docx")
|
||||
{
|
||||
uno::Reference<drawing::XShapes> xGroupShape(getShape(1), uno::UNO_QUERY);
|
||||
// The text in the groupshape was missing due to the w:sdt and w:sdtContent wrapper around it.
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("sdt and sdtContent inside groupshape"), uno::Reference<text::XTextRange>(xGroupShape->getByIndex(1), uno::UNO_QUERY)->getString());
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("sdt and sdtContent inside groupshape"), uno::Reference<text::XTextRange>(xGroupShape->getByIndex(1), uno::UNO_QUERY_THROW)->getString());
|
||||
}
|
||||
|
||||
DECLARE_OOXMLEXPORT_TEST(testDmlCharheightDefault, "dml-charheight-default.docx")
|
||||
@@ -387,7 +387,7 @@ DECLARE_OOXMLEXPORT_TEST(testDMLGroupShapeCapitalization, "dml-groupshape-capita
|
||||
{
|
||||
// Capitalization inside a group shape was not imported
|
||||
uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY)->getText();
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY_THROW)->getText();
|
||||
// 2nd line is written with uppercase letters
|
||||
CPPUNIT_ASSERT_EQUAL(style::CaseMap::UPPERCASE, getProperty<sal_Int16>(getRun(getParagraphOfText(2, xText), 1), "CharCaseMap"));
|
||||
// 3rd line has no capitalization
|
||||
@@ -450,7 +450,7 @@ DECLARE_OOXMLEXPORT_TEST(testDMLGroupShapeRunFonts, "dml-groupshape-runfonts.doc
|
||||
{
|
||||
// Fonts defined by w:rFonts was not imported and so the font specified by a:fontRef was used.
|
||||
uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY)->getText();
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY_THROW)->getText();
|
||||
uno::Reference<text::XTextRange> xRun = getRun(getParagraphOfText(1, xText),1);
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(xRun, "CharFontName"));
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("Arial Unicode MS"), getProperty<OUString>(xRun, "CharFontNameComplex"));
|
||||
|
||||
@@ -950,7 +950,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo60990, "fdo60990.odt")
|
||||
// The shape had no background, no paragraph adjust and no font color.
|
||||
uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00CFE7F5), getProperty<sal_Int32>(xShape, "FillColor"));
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText();
|
||||
uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText);
|
||||
CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xParagraph, "ParaAdjust")));
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00FF00), getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor"));
|
||||
|
||||
@@ -378,7 +378,7 @@ DECLARE_OOXMLEXPORT_TEST(testDMLGroupShapeParaSpacing, "dml-groupshape-paraspaci
|
||||
{
|
||||
// Paragraph spacing (top/bottom margin and line spacing) inside a group shape was not imported
|
||||
uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY)->getText();
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY_THROW)->getText();
|
||||
|
||||
// 1st paragraph has 1.5x line spacing but it has no spacing before/after.
|
||||
uno::Reference<text::XTextRange> xRun = getRun(getParagraphOfText(1, xText),1);
|
||||
|
||||
@@ -70,7 +70,7 @@ DECLARE_OOXMLEXPORT_TEST(testGroupshapeThemeFont, "groupshape-theme-font.docx")
|
||||
{
|
||||
// Font was specified using a theme reference, which wasn't handled.
|
||||
uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(0), uno::UNO_QUERY)->getText();
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(0), uno::UNO_QUERY_THROW)->getText();
|
||||
uno::Reference<text::XTextRange> xRun = getRun(getParagraphOfText(1, xText),1);
|
||||
// This was Calibri.
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("Cambria"), getProperty<OUString>(xRun, "CharFontName"));
|
||||
@@ -874,7 +874,7 @@ DECLARE_OOXMLEXPORT_TEST(testTextboxRoundedCorners, "textbox-rounded-corners.doc
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("ooxml-roundRect"), aCustomShapeGeometry["Type"].get<OUString>());
|
||||
|
||||
// The shape text should start with a table, with "a" in its A1 cell.
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText();
|
||||
uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1, xText), uno::UNO_QUERY);
|
||||
uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY);
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("a"), xCell->getString());
|
||||
|
||||
@@ -1038,16 +1038,16 @@ DECLARE_OOXMLEXPORT_TEST(testFdo46361, "fdo46361.docx")
|
||||
uno::Reference<drawing::XShape> xShape(xGroupShape->getByIndex(0), uno::UNO_QUERY);
|
||||
// This was CENTER.
|
||||
CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_TOP, getProperty<drawing::TextVerticalAdjust>(xShape, "TextVerticalAdjust"));
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText();
|
||||
uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText);
|
||||
// This was LEFT.
|
||||
CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xParagraph, "ParaAdjust")));
|
||||
// This was black, not green.
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x008000), getProperty<sal_Int32>(getRun(xParagraph, 1), "CharColor"));
|
||||
// \n char was missing due to unhandled w:br.
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("text\ntext"), uno::Reference<text::XTextRange>(xGroupShape->getByIndex(1), uno::UNO_QUERY)->getString());
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("text\ntext"), uno::Reference<text::XTextRange>(xGroupShape->getByIndex(1), uno::UNO_QUERY_THROW)->getString());
|
||||
// \n chars were missing, due to unhandled multiple w:p tags.
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("text\ntext\n"), uno::Reference<text::XTextRange>(xGroupShape->getByIndex(2), uno::UNO_QUERY)->getString());
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("text\ntext\n"), uno::Reference<text::XTextRange>(xGroupShape->getByIndex(2), uno::UNO_QUERY_THROW)->getString());
|
||||
}
|
||||
|
||||
DECLARE_OOXMLEXPORT_TEST(testFdo65632, "fdo65632.docx")
|
||||
|
||||
@@ -823,7 +823,7 @@ DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeParaAdjust, "dml-groupshape-paraadjust
|
||||
{
|
||||
// Paragraph adjustment inside a group shape was not imported
|
||||
uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY)->getText();
|
||||
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY_THROW)->getText();
|
||||
// 2nd line is adjusted to the right
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int16(style::ParagraphAdjust_RIGHT), getProperty<sal_Int16>(getRun(getParagraphOfText(2, xText), 1), "ParaAdjust"));
|
||||
// 3rd line has no adjustment
|
||||
|
||||
@@ -90,7 +90,7 @@ DECLARE_OOXMLIMPORT_TEST(testGroupShapeFontName, "groupshape-fontname.docx")
|
||||
// Font names inside a group shape were not imported
|
||||
uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
|
||||
uno::Reference<text::XText> xText
|
||||
= uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY)->getText();
|
||||
= uno::Reference<text::XTextRange>(xGroup->getByIndex(1), uno::UNO_QUERY_THROW)->getText();
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
OUString("Calibri"),
|
||||
|
||||
@@ -642,12 +642,12 @@ DECLARE_RTFEXPORT_TEST(testTextframeTable, "textframe-table.rtf")
|
||||
uno::Reference<text::XText> xText = xTextRange->getText();
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("First para."), getParagraphOfText(1, xText)->getString());
|
||||
uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2, xText), uno::UNO_QUERY);
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
OUString("A"),
|
||||
uno::Reference<text::XTextRange>(xTable->getCellByName("A1"), uno::UNO_QUERY)->getString());
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
OUString("B"),
|
||||
uno::Reference<text::XTextRange>(xTable->getCellByName("B1"), uno::UNO_QUERY)->getString());
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("A"), uno::Reference<text::XTextRange>(
|
||||
xTable->getCellByName("A1"), uno::UNO_QUERY_THROW)
|
||||
->getString());
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("B"), uno::Reference<text::XTextRange>(
|
||||
xTable->getCellByName("B1"), uno::UNO_QUERY_THROW)
|
||||
->getString());
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("Last para."), getParagraphOfText(3, xText)->getString());
|
||||
}
|
||||
|
||||
|
||||
@@ -150,9 +150,11 @@ DECLARE_RTFEXPORT_TEST(testFdo45187, "fdo45187.rtf")
|
||||
uno::Reference<text::XTextRangeCompare> xTextRangeCompare(xTextDocument->getText(),
|
||||
uno::UNO_QUERY);
|
||||
uno::Reference<text::XTextRange> xAnchor0
|
||||
= uno::Reference<text::XTextContent>(xDraws->getByIndex(0), uno::UNO_QUERY)->getAnchor();
|
||||
= uno::Reference<text::XTextContent>(xDraws->getByIndex(0), uno::UNO_QUERY_THROW)
|
||||
->getAnchor();
|
||||
uno::Reference<text::XTextRange> xAnchor1
|
||||
= uno::Reference<text::XTextContent>(xDraws->getByIndex(1), uno::UNO_QUERY)->getAnchor();
|
||||
= uno::Reference<text::XTextContent>(xDraws->getByIndex(1), uno::UNO_QUERY_THROW)
|
||||
->getAnchor();
|
||||
// Was 0 ("starts at the same position"), should be 1 ("starts before")
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xTextRangeCompare->compareRegionStarts(xAnchor0, xAnchor1));
|
||||
}
|
||||
|
||||
@@ -206,9 +206,9 @@ DECLARE_RTFEXPORT_TEST(testFdo66040, "fdo66040.rtf")
|
||||
uno::Reference<text::XTextRange> xTextRange(xDraws->getByIndex(0), uno::UNO_QUERY);
|
||||
uno::Reference<text::XText> xText = xTextRange->getText();
|
||||
uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2, xText), uno::UNO_QUERY);
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
OUString("A"),
|
||||
uno::Reference<text::XTextRange>(xTable->getCellByName("A1"), uno::UNO_QUERY)->getString());
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("A"), uno::Reference<text::XTextRange>(
|
||||
xTable->getCellByName("A1"), uno::UNO_QUERY_THROW)
|
||||
->getString());
|
||||
|
||||
// Make sure the second shape has the correct position and size.
|
||||
uno::Reference<drawing::XShape> xShape(xDraws->getByIndex(1), uno::UNO_QUERY);
|
||||
@@ -401,8 +401,9 @@ DECLARE_RTFEXPORT_TEST(testFooterPara, "footer-para.rtf")
|
||||
uno::Reference<text::XText> xFooterText = getProperty<uno::Reference<text::XText>>(
|
||||
getStyles("PageStyles")->getByName("First Page"), "FooterText");
|
||||
uno::Reference<text::XTextContent> xParagraph = getParagraphOrTable(1, xFooterText);
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("All Rights Reserved."),
|
||||
uno::Reference<text::XTextRange>(xParagraph, uno::UNO_QUERY)->getString());
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
OUString("All Rights Reserved."),
|
||||
uno::Reference<text::XTextRange>(xParagraph, uno::UNO_QUERY_THROW)->getString());
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
sal_Int16(style::ParagraphAdjust_CENTER),
|
||||
getProperty</*style::ParagraphAdjust*/ sal_Int16>(xParagraph, "ParaAdjust"));
|
||||
|
||||
@@ -767,7 +767,7 @@ DECLARE_RTFIMPORT_TEST(testFdo68291, "fdo68291.odt")
|
||||
|
||||
// This was "Standard", causing an unwanted page break on next paste.
|
||||
CPPUNIT_ASSERT_EQUAL(uno::Any(),
|
||||
uno::Reference<beans::XPropertySet>(getParagraph(1), uno::UNO_QUERY)
|
||||
uno::Reference<beans::XPropertySet>(getParagraph(1), uno::UNO_QUERY_THROW)
|
||||
->getPropertyValue("PageDescName"));
|
||||
}
|
||||
|
||||
@@ -811,7 +811,7 @@ DECLARE_RTFIMPORT_TEST(testContSectionPageBreak, "cont-section-pagebreak.rtf")
|
||||
CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE,
|
||||
getProperty<style::BreakType>(xParaSecond, "BreakType"));
|
||||
CPPUNIT_ASSERT_EQUAL(uno::Any(),
|
||||
uno::Reference<beans::XPropertySet>(xParaSecond, uno::UNO_QUERY)
|
||||
uno::Reference<beans::XPropertySet>(xParaSecond, uno::UNO_QUERY_THROW)
|
||||
->getPropertyValue("PageDescName"));
|
||||
// actually not sure how many paragraph there should be between
|
||||
// SECOND and THIRD - important is that the page break is on there
|
||||
@@ -823,8 +823,9 @@ DECLARE_RTFIMPORT_TEST(testContSectionPageBreak, "cont-section-pagebreak.rtf")
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("THIRD"), xParaThird->getString());
|
||||
CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE,
|
||||
getProperty<style::BreakType>(xParaThird, "BreakType"));
|
||||
CPPUNIT_ASSERT_EQUAL(uno::Any(), uno::Reference<beans::XPropertySet>(xParaThird, uno::UNO_QUERY)
|
||||
->getPropertyValue("PageDescName"));
|
||||
CPPUNIT_ASSERT_EQUAL(uno::Any(),
|
||||
uno::Reference<beans::XPropertySet>(xParaThird, uno::UNO_QUERY_THROW)
|
||||
->getPropertyValue("PageDescName"));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(2, getPages());
|
||||
}
|
||||
|
||||
@@ -3978,7 +3978,7 @@ void SwUiWriterTest::testShapeAnchorUndo()
|
||||
|
||||
static void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& xComponent, const OUString& rCommand, const uno::Sequence<beans::PropertyValue>& rPropertyValues)
|
||||
{
|
||||
uno::Reference<frame::XController> xController = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY)->getCurrentController();
|
||||
uno::Reference<frame::XController> xController = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController();
|
||||
CPPUNIT_ASSERT(xController.is());
|
||||
uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY);
|
||||
CPPUNIT_ASSERT(xFrame.is());
|
||||
|
||||
@@ -126,7 +126,7 @@ static void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& xCompone
|
||||
const uno::Sequence<beans::PropertyValue>& rPropertyValues)
|
||||
{
|
||||
uno::Reference<frame::XController> xController
|
||||
= uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY)->getCurrentController();
|
||||
= uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController();
|
||||
CPPUNIT_ASSERT(xController.is());
|
||||
uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY);
|
||||
CPPUNIT_ASSERT(xFrame.is());
|
||||
|
||||
@@ -516,7 +516,7 @@ DECLARE_WW8EXPORT_TEST(testTdf95321, "tdf95321.doc")
|
||||
uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
|
||||
uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
|
||||
uno::Reference<text::XTextTable> xTable(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("Second Column"), uno::Reference<text::XTextRange>(xTable->getCellByName("B1"), uno::UNO_QUERY)->getString());
|
||||
CPPUNIT_ASSERT_EQUAL(OUString("Second Column"), uno::Reference<text::XTextRange>(xTable->getCellByName("B1"), uno::UNO_QUERY_THROW)->getString());
|
||||
}
|
||||
|
||||
DECLARE_WW8EXPORT_TEST(testFdo77844, "fdo77844.doc")
|
||||
|
||||
@@ -3710,7 +3710,7 @@ SwXCellRange::setData(const uno::Sequence< uno::Sequence<double> >& rData)
|
||||
throw uno::RuntimeException("Column count mismatch. expected: " + OUString::number(nColCount) + " got: " + OUString::number(rRow.getLength()), static_cast<cppu::OWeakObject*>(this));
|
||||
for(const auto& rValue : rRow)
|
||||
{
|
||||
uno::Reference<table::XCell>(*pCurrentCell, uno::UNO_QUERY)->setValue(rValue);
|
||||
uno::Reference<table::XCell>(*pCurrentCell, uno::UNO_QUERY_THROW)->setValue(rValue);
|
||||
++pCurrentCell;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ void ModelEventListener::notifyEvent( const document::EventObject& rEvent )
|
||||
try
|
||||
{
|
||||
//remove listener
|
||||
uno::Reference<document::XEventBroadcaster>(rEvent.Source, uno::UNO_QUERY )->removeEventListener(
|
||||
uno::Reference<document::XEventListener>(this));
|
||||
uno::Reference<document::XEventBroadcaster>(rEvent.Source, uno::UNO_QUERY_THROW )->removeEventListener(
|
||||
uno::Reference<document::XEventListener>(this));
|
||||
|
||||
// If we have PAGEREF fields, update fields as well.
|
||||
uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(rEvent.Source, uno::UNO_QUERY);
|
||||
@@ -107,7 +107,7 @@ void ModelEventListener::disposing( const lang::EventObject& rEvent )
|
||||
{
|
||||
try
|
||||
{
|
||||
uno::Reference<document::XEventBroadcaster>(rEvent.Source, uno::UNO_QUERY )->removeEventListener(
|
||||
uno::Reference<document::XEventBroadcaster>(rEvent.Source, uno::UNO_QUERY_THROW )->removeEventListener(
|
||||
uno::Reference<document::XEventListener>(this));
|
||||
}
|
||||
catch( const uno::Exception& )
|
||||
|
||||
@@ -601,7 +601,7 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
|
||||
{
|
||||
uno::Reference<drawing::XShape> xShape(xGroupShape, uno::UNO_QUERY);
|
||||
// set default VertOrient before inserting
|
||||
uno::Reference<beans::XPropertySet>(xShape, uno::UNO_QUERY)
|
||||
uno::Reference<beans::XPropertySet>(xShape, uno::UNO_QUERY_THROW)
|
||||
->setPropertyValue("VertOrient",
|
||||
uno::makeAny(text::VertOrientation::NONE));
|
||||
xDrawSupplier->getDrawPage()->add(xShape);
|
||||
|
||||
Reference in New Issue
Block a user