remove SfxUsrAnyItem typedef
and rename SfxUsrAnyItem class to SfxUnoAnyItem, the choice being made by leaving the most popular one behind Change-Id: If3818ee0966a50e3036d7e2db951910b6282c91f Reviewed-on: https://gerrit.libreoffice.org/47313 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -304,7 +304,7 @@ void LibBox::NotifyIDE()
|
||||
if (LibEntry* pEntry = static_cast<LibEntry*>(GetEntryData(nSelPos)))
|
||||
{
|
||||
ScriptDocument aDocument( pEntry->GetDocument() );
|
||||
SfxUsrAnyItem aDocumentItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, uno::Any( aDocument.getDocumentOrNull() ) );
|
||||
SfxUnoAnyItem aDocumentItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, uno::Any( aDocument.getDocumentOrNull() ) );
|
||||
OUString aLibName = pEntry->GetLibName();
|
||||
SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, aLibName );
|
||||
if (SfxDispatcher* pDispatcher = GetDispatcher())
|
||||
|
||||
@@ -430,7 +430,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
|
||||
case SID_BASICIDE_LIBLOADED:
|
||||
{
|
||||
DBG_ASSERT( rReq.GetArgs(), "arguments expected" );
|
||||
const SfxUsrAnyItem& rShellItem = static_cast<const SfxUsrAnyItem&>(rReq.GetArgs()->Get( SID_BASICIDE_ARG_DOCUMENT_MODEL ));
|
||||
const SfxUnoAnyItem& rShellItem = static_cast<const SfxUnoAnyItem&>(rReq.GetArgs()->Get( SID_BASICIDE_ARG_DOCUMENT_MODEL ));
|
||||
uno::Reference< frame::XModel > xModel( rShellItem.GetValue(), UNO_QUERY );
|
||||
ScriptDocument aDocument( xModel.is() ? ScriptDocument( xModel ) : ScriptDocument::getApplicationScriptDocument() );
|
||||
const SfxStringItem& rLibNameItem = static_cast<const SfxStringItem&>(rReq.GetArgs()->Get( SID_BASICIDE_ARG_LIBNAME ));
|
||||
@@ -569,7 +569,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
|
||||
pDocument.reset( new ScriptDocument( ScriptDocument::getDocumentWithURLOrCaption( sDocumentCaption ) ) );
|
||||
}
|
||||
|
||||
const SfxUsrAnyItem* pDocModelItem = rReq.GetArg<SfxUsrAnyItem>(SID_BASICIDE_ARG_DOCUMENT_MODEL);
|
||||
const SfxUnoAnyItem* pDocModelItem = rReq.GetArg<SfxUnoAnyItem>(SID_BASICIDE_ARG_DOCUMENT_MODEL);
|
||||
if ( !pDocument.get() && pDocModelItem )
|
||||
{
|
||||
uno::Reference< frame::XModel > xModel( pDocModelItem->GetValue(), UNO_QUERY );
|
||||
|
||||
@@ -618,7 +618,7 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton, void )
|
||||
SfxRequest aRequest( SID_BASICIDE_APPEAR, SfxCallMode::SYNCHRON, aArgs );
|
||||
SfxGetpApp()->ExecuteSlot( aRequest );
|
||||
|
||||
SfxUsrAnyItem aDocItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, Any( m_aCurDocument.getDocumentOrNull() ) );
|
||||
SfxUnoAnyItem aDocItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, Any( m_aCurDocument.getDocumentOrNull() ) );
|
||||
SvTreeListEntry* pCurEntry = m_pLibBox->GetCurEntry();
|
||||
DBG_ASSERT( pCurEntry, "Entry?!" );
|
||||
OUString aLibName( SvTabListBox::GetEntryText( pCurEntry, 0 ) );
|
||||
@@ -1340,7 +1340,7 @@ void LibPage::DeleteCurrent()
|
||||
if ( QueryDelLib( aLibName, bIsLibraryLink, this ) )
|
||||
{
|
||||
// inform BasicIDE
|
||||
SfxUsrAnyItem aDocItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, Any( m_aCurDocument.getDocumentOrNull() ) );
|
||||
SfxUnoAnyItem aDocItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, Any( m_aCurDocument.getDocumentOrNull() ) );
|
||||
SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, aLibName );
|
||||
if (SfxDispatcher* pDispatcher = GetDispatcher())
|
||||
pDispatcher->ExecuteList(SID_BASICIDE_LIBREMOVED,
|
||||
|
||||
@@ -724,7 +724,7 @@ IMPL_LINK( ObjectPage, ButtonHdl, Button *, pButton, void )
|
||||
if (pDocumentEntry)
|
||||
aDocument = pDocumentEntry->GetDocument();
|
||||
}
|
||||
SfxUsrAnyItem aDocItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, Any( aDocument.getDocumentOrNull() ) );
|
||||
SfxUnoAnyItem aDocItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, Any( aDocument.getDocumentOrNull() ) );
|
||||
OUString aLibName( m_pBasicBox->GetEntryText( pCurEntry ) );
|
||||
SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, aLibName );
|
||||
if ( pDispatcher )
|
||||
|
||||
@@ -193,12 +193,12 @@ public:
|
||||
SfxFrame* GetFrame() const { return wFrame; }
|
||||
};
|
||||
|
||||
class SFX2_DLLPUBLIC SfxUsrAnyItem : public SfxPoolItem
|
||||
class SFX2_DLLPUBLIC SfxUnoAnyItem : public SfxPoolItem
|
||||
{
|
||||
css::uno::Any aValue;
|
||||
public:
|
||||
static SfxPoolItem* CreateDefault();
|
||||
SfxUsrAnyItem( sal_uInt16 nWhich, const css::uno::Any& rAny );
|
||||
SfxUnoAnyItem( sal_uInt16 nWhich, const css::uno::Any& rAny );
|
||||
const css::uno::Any& GetValue() const
|
||||
{ return aValue; }
|
||||
virtual bool operator==( const SfxPoolItem& ) const override;
|
||||
@@ -225,8 +225,6 @@ public:
|
||||
virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
|
||||
};
|
||||
|
||||
typedef SfxUsrAnyItem SfxUnoAnyItem;
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
+1
-1
@@ -4240,7 +4240,7 @@ SfxUInt16Item RowHeight FID_ROW_HEIGHT
|
||||
|
||||
|
||||
SfxVoidItem SbaImport SID_SBA_IMPORT
|
||||
(SfxUsrAnyItem Query SID_SBA_IMPORT,SfxStringItem Target FN_PARAM_1)
|
||||
(SfxUnoAnyItem Query SID_SBA_IMPORT,SfxStringItem Target FN_PARAM_1)
|
||||
[
|
||||
AutoUpdate = FALSE,
|
||||
FastCall = FALSE,
|
||||
|
||||
@@ -252,7 +252,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportXLS(SvStream& rStream)
|
||||
ScDLL::Init();
|
||||
SfxMedium aMedium;
|
||||
css::uno::Reference<css::io::XInputStream> xStm(new utl::OInputStreamWrapper(rStream));
|
||||
aMedium.GetItemSet()->Put(SfxUsrAnyItem(SID_INPUTSTREAM, css::uno::makeAny(xStm)));
|
||||
aMedium.GetItemSet()->Put(SfxUnoAnyItem(SID_INPUTSTREAM, css::uno::makeAny(xStm)));
|
||||
|
||||
ScDocShellRef xDocShell = new ScDocShell(SfxModelFlags::EMBEDDED_OBJECT |
|
||||
SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
|
||||
@@ -286,7 +286,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportWKS(SvStream& rStream)
|
||||
ScDLL::Init();
|
||||
SfxMedium aMedium;
|
||||
css::uno::Reference<css::io::XInputStream> xStm(new utl::OInputStreamWrapper(rStream));
|
||||
aMedium.GetItemSet()->Put(SfxUsrAnyItem(SID_INPUTSTREAM, css::uno::makeAny(xStm)));
|
||||
aMedium.GetItemSet()->Put(SfxUnoAnyItem(SID_INPUTSTREAM, css::uno::makeAny(xStm)));
|
||||
ScDocument aDocument;
|
||||
ScDocOptions aDocOpt = aDocument.GetDocOptions();
|
||||
aDocOpt.SetLookUpColRowNames(false);
|
||||
|
||||
@@ -48,7 +48,7 @@ uno::Reference<task::XStatusIndicator> getStatusIndicator(const SfxMedium& rMedi
|
||||
SfxItemSet* pSet = rMedium.GetItemSet();
|
||||
if (pSet)
|
||||
{
|
||||
const SfxUnoAnyItem* pItem = pSet->GetItem<SfxUsrAnyItem>(SID_PROGRESS_STATUSBAR_CONTROL);
|
||||
const SfxUnoAnyItem* pItem = pSet->GetItem<SfxUnoAnyItem>(SID_PROGRESS_STATUSBAR_CONTROL);
|
||||
if (pItem)
|
||||
xStatusIndicator.set(pItem->GetValue(), uno::UNO_QUERY);
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
|
||||
svx::ODataAccessDescriptor aDesc;
|
||||
if ( pReqArgs->GetItemState( nSlot, true, &pItem ) == SfxItemState::SET )
|
||||
{
|
||||
uno::Any aAny = static_cast<const SfxUsrAnyItem*>(pItem)->GetValue();
|
||||
uno::Any aAny = static_cast<const SfxUnoAnyItem*>(pItem)->GetValue();
|
||||
uno::Sequence<beans::PropertyValue> aProperties;
|
||||
if ( aAny >>= aProperties )
|
||||
aDesc.initializeFrom( aProperties );
|
||||
|
||||
@@ -383,7 +383,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
|
||||
uno::Any aDescAny;
|
||||
uno::Sequence<beans::PropertyValue> aProperties = aDesc.createPropertyValueSequence();
|
||||
aDescAny <<= aProperties;
|
||||
SfxUsrAnyItem aDataDesc(SID_SBA_IMPORT, aDescAny);
|
||||
SfxUnoAnyItem aDataDesc(SID_SBA_IMPORT, aDescAny);
|
||||
|
||||
ScDocShell* pDocSh = GetViewData().GetDocShell();
|
||||
SCTAB nTab = GetViewData().GetTabNo();
|
||||
@@ -540,7 +540,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
|
||||
pInsDoc->ResetClip( pDoc, nSrcTab );
|
||||
|
||||
SfxMedium aMed;
|
||||
aMed.GetItemSet()->Put( SfxUsrAnyItem( SID_INPUTSTREAM, uno::makeAny( xStm ) ) );
|
||||
aMed.GetItemSet()->Put( SfxUnoAnyItem( SID_INPUTSTREAM, uno::makeAny( xStm ) ) );
|
||||
ErrCode eErr = ScFormatFilter::Get().ScImportExcel( aMed, pInsDoc, EIF_AUTO );
|
||||
if ( eErr == ERRCODE_NONE )
|
||||
{
|
||||
|
||||
+3
-3
@@ -2066,7 +2066,7 @@ SfxStringItem Keywords SID_DOCINFO_KEYWORDS
|
||||
|
||||
|
||||
SfxStringItem LibLoaded SID_BASICIDE_LIBLOADED
|
||||
(SfxUsrAnyItem Document SID_BASICIDE_ARG_DOCUMENT_MODEL,SfxStringItem LibName SID_BASICIDE_ARG_LIBNAME)
|
||||
(SfxUnoAnyItem Document SID_BASICIDE_ARG_DOCUMENT_MODEL,SfxStringItem LibName SID_BASICIDE_ARG_LIBNAME)
|
||||
[
|
||||
AutoUpdate = FALSE,
|
||||
FastCall = FALSE,
|
||||
@@ -2084,7 +2084,7 @@ SfxStringItem LibLoaded SID_BASICIDE_LIBLOADED
|
||||
|
||||
|
||||
SfxStringItem LibRemoved SID_BASICIDE_LIBREMOVED
|
||||
(SfxUsrAnyItem Document SID_BASICIDE_ARG_DOCUMENT_MODEL,SfxStringItem LibName SID_BASICIDE_ARG_LIBNAME)
|
||||
(SfxUnoAnyItem Document SID_BASICIDE_ARG_DOCUMENT_MODEL,SfxStringItem LibName SID_BASICIDE_ARG_LIBNAME)
|
||||
[
|
||||
AutoUpdate = FALSE,
|
||||
FastCall = FALSE,
|
||||
@@ -2102,7 +2102,7 @@ SfxStringItem LibRemoved SID_BASICIDE_LIBREMOVED
|
||||
|
||||
|
||||
SfxStringItem LibSelect SID_BASICIDE_LIBSELECTED
|
||||
(SfxUsrAnyItem Document SID_BASICIDE_ARG_DOCUMENT_MODEL,SfxStringItem LibName SID_BASICIDE_ARG_LIBNAME)
|
||||
(SfxUnoAnyItem Document SID_BASICIDE_ARG_DOCUMENT_MODEL,SfxStringItem LibName SID_BASICIDE_ARG_LIBNAME)
|
||||
[
|
||||
AutoUpdate = FALSE,
|
||||
FastCall = FALSE,
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
item String SfxMacroInfoItem; //! Dummy
|
||||
item String SfxImageItem; //! Dummy
|
||||
item String SfxObjectShellItem //! Dummy
|
||||
item String SfxUsrAnyItem //! Dummy
|
||||
item String SfxUnoAnyItem //! Dummy
|
||||
item String SfxUnoFrameItem //! Dummy
|
||||
item String SfxWatermarkItem //! Dummy
|
||||
|
||||
|
||||
@@ -1400,9 +1400,9 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
|
||||
if ( rSet.GetItemState( SID_FILLFRAME, false, &pItem ) == SfxItemState::SET )
|
||||
{
|
||||
pValue[nActProp].Name = sFrame;
|
||||
if ( auto pUsrAnyItem = dynamic_cast< const SfxUsrAnyItem *>( pItem ) )
|
||||
if ( auto pUsrAnyItem = dynamic_cast< const SfxUnoAnyItem *>( pItem ) )
|
||||
{
|
||||
OSL_FAIL( "TransformItems: transporting an XFrame via an SfxUsrAnyItem is not deprecated!" );
|
||||
OSL_FAIL( "TransformItems: transporting an XFrame via an SfxUnoAnyItem is not deprecated!" );
|
||||
pValue[nActProp++].Value = pUsrAnyItem->GetValue();
|
||||
}
|
||||
else if ( auto pUnoFrameItem = dynamic_cast< const SfxUnoFrameItem *>( pItem ) )
|
||||
|
||||
@@ -2455,9 +2455,9 @@ void SfxMedium::GetMedium_Impl()
|
||||
{
|
||||
//TODO/MBA: need support for SID_STREAM
|
||||
if ( pImpl->xStream.is() )
|
||||
GetItemSet()->Put( SfxUsrAnyItem( SID_STREAM, makeAny( pImpl->xStream ) ) );
|
||||
GetItemSet()->Put( SfxUnoAnyItem( SID_STREAM, makeAny( pImpl->xStream ) ) );
|
||||
|
||||
GetItemSet()->Put( SfxUsrAnyItem( SID_INPUTSTREAM, makeAny( pImpl->xInputStream ) ) );
|
||||
GetItemSet()->Put( SfxUnoAnyItem( SID_INPUTSTREAM, makeAny( pImpl->xInputStream ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ using namespace ::com::sun::star::util;
|
||||
using namespace ::com::sun::star::frame;
|
||||
using namespace ::com::sun::star::container;
|
||||
|
||||
SfxPoolItem* SfxUsrAnyItem::CreateDefault() { SAL_WARN( "sfx", "No SfxUsrAnyItem factory available"); return nullptr; }
|
||||
SfxPoolItem* SfxUnoAnyItem::CreateDefault() { SAL_WARN( "sfx", "No SfxUnoAnyItem factory available"); return nullptr; }
|
||||
|
||||
SfxPoolItem* SfxUnoFrameItem::CreateDefault()
|
||||
{
|
||||
@@ -300,7 +300,7 @@ void SfxFrame::GetViewData_Impl()
|
||||
if ( GetController().is() && pSet->GetItemState( SID_VIEW_DATA ) != SfxItemState::SET )
|
||||
{
|
||||
css::uno::Any aData = GetController()->getViewData();
|
||||
pSet->Put( SfxUsrAnyItem( SID_VIEW_DATA, aData ) );
|
||||
pSet->Put( SfxUnoAnyItem( SID_VIEW_DATA, aData ) );
|
||||
}
|
||||
|
||||
if ( pViewFrame->GetCurViewId() )
|
||||
@@ -460,29 +460,29 @@ bool SfxFrameItem::PutValue( const css::uno::Any& rVal, sal_uInt8 )
|
||||
}
|
||||
|
||||
|
||||
SfxUsrAnyItem::SfxUsrAnyItem( sal_uInt16 nWhichId, const css::uno::Any& rAny )
|
||||
SfxUnoAnyItem::SfxUnoAnyItem( sal_uInt16 nWhichId, const css::uno::Any& rAny )
|
||||
: SfxPoolItem( nWhichId )
|
||||
{
|
||||
aValue = rAny;
|
||||
}
|
||||
|
||||
bool SfxUsrAnyItem::operator==( const SfxPoolItem& /*rItem*/ ) const
|
||||
bool SfxUnoAnyItem::operator==( const SfxPoolItem& /*rItem*/ ) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
SfxPoolItem* SfxUsrAnyItem::Clone( SfxItemPool *) const
|
||||
SfxPoolItem* SfxUnoAnyItem::Clone( SfxItemPool *) const
|
||||
{
|
||||
return new SfxUsrAnyItem( *this );
|
||||
return new SfxUnoAnyItem( *this );
|
||||
}
|
||||
|
||||
bool SfxUsrAnyItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
|
||||
bool SfxUnoAnyItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
|
||||
{
|
||||
rVal = aValue;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SfxUsrAnyItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
|
||||
bool SfxUnoAnyItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
|
||||
{
|
||||
aValue = rVal;
|
||||
return true;
|
||||
|
||||
@@ -278,7 +278,7 @@
|
||||
<Type Name="CntUnencodedStringItem">
|
||||
<DisplayString>{{which={m_nWhich,x}}} {m_aValue}</DisplayString>
|
||||
</Type>
|
||||
<Type Name="SfxUsrAnyItem">
|
||||
<Type Name="SfxUnoAnyItem">
|
||||
<DisplayString>{{which={m_nWhich,x}}} {aValue}</DisplayString>
|
||||
</Type>
|
||||
<Type Name="SvxFontItem">
|
||||
|
||||
@@ -261,7 +261,7 @@ std::shared_ptr<SwMailMergeConfigItem> SwView::EnsureMailMergeConfigItem(const S
|
||||
{
|
||||
//mailmerge has been called from the database beamer
|
||||
uno::Sequence< beans::PropertyValue> aDBValues;
|
||||
if (static_cast<const SfxUsrAnyItem*>(pItem)->GetValue() >>= aDBValues)
|
||||
if (static_cast<const SfxUnoAnyItem*>(pItem)->GetValue() >>= aDBValues)
|
||||
{
|
||||
SwDBData aDBData;
|
||||
svx::ODataAccessDescriptor aDescriptor(aDBValues);
|
||||
|
||||
@@ -1425,7 +1425,7 @@ void SwDocShell::ReloadFromHtml( const OUString& rStreamName, SwSrcView* pSrcVie
|
||||
if( pBasic )
|
||||
{
|
||||
// Notify the IDE
|
||||
SfxUsrAnyItem aShellItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, makeAny( GetModel() ) );
|
||||
SfxUnoAnyItem aShellItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, makeAny( GetModel() ) );
|
||||
OUString aLibName( pBasic->GetName() );
|
||||
SfxStringItem aLibNameItem( SID_BASICIDE_ARG_LIBNAME, aLibName );
|
||||
pSrcView->GetViewFrame()->GetDispatcher()->ExecuteList(
|
||||
|
||||
@@ -905,7 +905,7 @@ static bool lcl_SaveDoc(
|
||||
pDstMed->GetItemSet()->Put( SfxStringItem(SID_FILE_FILTEROPTIONS,
|
||||
*pStoreToFilterOptions));
|
||||
if( pSaveToFilterData->getLength() )
|
||||
pDstMed->GetItemSet()->Put( SfxUsrAnyItem(SID_FILTER_DATA,
|
||||
pDstMed->GetItemSet()->Put( SfxUnoAnyItem(SID_FILTER_DATA,
|
||||
uno::makeAny(*pSaveToFilterData)));
|
||||
}
|
||||
|
||||
|
||||
@@ -2649,14 +2649,14 @@ bool SwTransferable::PasteDBData( TransferableDataHelper& rData,
|
||||
}
|
||||
else if( nWh )
|
||||
{
|
||||
std::unique_ptr<SfxUsrAnyItem> pConnectionItem;
|
||||
std::unique_ptr<SfxUsrAnyItem> pCursorItem;
|
||||
std::unique_ptr<SfxUsrAnyItem> pColumnItem;
|
||||
std::unique_ptr<SfxUsrAnyItem> pSourceItem;
|
||||
std::unique_ptr<SfxUsrAnyItem> pCommandItem;
|
||||
std::unique_ptr<SfxUsrAnyItem> pCommandTypeItem;
|
||||
std::unique_ptr<SfxUsrAnyItem> pColumnNameItem;
|
||||
std::unique_ptr<SfxUsrAnyItem> pSelectionItem;
|
||||
std::unique_ptr<SfxUnoAnyItem> pConnectionItem;
|
||||
std::unique_ptr<SfxUnoAnyItem> pCursorItem;
|
||||
std::unique_ptr<SfxUnoAnyItem> pColumnItem;
|
||||
std::unique_ptr<SfxUnoAnyItem> pSourceItem;
|
||||
std::unique_ptr<SfxUnoAnyItem> pCommandItem;
|
||||
std::unique_ptr<SfxUnoAnyItem> pCommandTypeItem;
|
||||
std::unique_ptr<SfxUnoAnyItem> pColumnNameItem;
|
||||
std::unique_ptr<SfxUnoAnyItem> pSelectionItem;
|
||||
|
||||
bool bDataAvailable = true;
|
||||
ODataAccessDescriptor aDesc;
|
||||
@@ -2669,14 +2669,14 @@ bool SwTransferable::PasteDBData( TransferableDataHelper& rData,
|
||||
|
||||
if ( bDataAvailable )
|
||||
{
|
||||
pConnectionItem.reset(new SfxUsrAnyItem(FN_DB_CONNECTION_ANY, aDesc[DataAccessDescriptorProperty::Connection]));
|
||||
pColumnItem.reset(new SfxUsrAnyItem(FN_DB_COLUMN_ANY, aDesc[DataAccessDescriptorProperty::ColumnObject]));
|
||||
pSourceItem.reset(new SfxUsrAnyItem(FN_DB_DATA_SOURCE_ANY, makeAny(aDesc.getDataSource())));
|
||||
pCommandItem.reset(new SfxUsrAnyItem(FN_DB_DATA_COMMAND_ANY, aDesc[DataAccessDescriptorProperty::Command]));
|
||||
pCommandTypeItem.reset(new SfxUsrAnyItem(FN_DB_DATA_COMMAND_TYPE_ANY, aDesc[DataAccessDescriptorProperty::CommandType]));
|
||||
pColumnNameItem.reset(new SfxUsrAnyItem(FN_DB_DATA_COLUMN_NAME_ANY, aDesc[DataAccessDescriptorProperty::ColumnName]));
|
||||
pSelectionItem.reset(new SfxUsrAnyItem(FN_DB_DATA_SELECTION_ANY, aDesc[DataAccessDescriptorProperty::Selection]));
|
||||
pCursorItem.reset(new SfxUsrAnyItem(FN_DB_DATA_CURSOR_ANY, aDesc[DataAccessDescriptorProperty::Cursor]));
|
||||
pConnectionItem.reset(new SfxUnoAnyItem(FN_DB_CONNECTION_ANY, aDesc[DataAccessDescriptorProperty::Connection]));
|
||||
pColumnItem.reset(new SfxUnoAnyItem(FN_DB_COLUMN_ANY, aDesc[DataAccessDescriptorProperty::ColumnObject]));
|
||||
pSourceItem.reset(new SfxUnoAnyItem(FN_DB_DATA_SOURCE_ANY, makeAny(aDesc.getDataSource())));
|
||||
pCommandItem.reset(new SfxUnoAnyItem(FN_DB_DATA_COMMAND_ANY, aDesc[DataAccessDescriptorProperty::Command]));
|
||||
pCommandTypeItem.reset(new SfxUnoAnyItem(FN_DB_DATA_COMMAND_TYPE_ANY, aDesc[DataAccessDescriptorProperty::CommandType]));
|
||||
pColumnNameItem.reset(new SfxUnoAnyItem(FN_DB_DATA_COLUMN_NAME_ANY, aDesc[DataAccessDescriptorProperty::ColumnName]));
|
||||
pSelectionItem.reset(new SfxUnoAnyItem(FN_DB_DATA_SELECTION_ANY, aDesc[DataAccessDescriptorProperty::Selection]));
|
||||
pCursorItem.reset(new SfxUnoAnyItem(FN_DB_DATA_CURSOR_ANY, aDesc[DataAccessDescriptorProperty::Cursor]));
|
||||
}
|
||||
|
||||
SwView& rView = rSh.GetView();
|
||||
|
||||
@@ -94,27 +94,27 @@ void SwTextShell::ExecDB(SfxRequest const &rReq)
|
||||
|
||||
Sequence<Any> aSelection;
|
||||
if(pSelectionItem)
|
||||
static_cast<const SfxUsrAnyItem*>(pSelectionItem)->GetValue() >>= aSelection;
|
||||
static_cast<const SfxUnoAnyItem*>(pSelectionItem)->GetValue() >>= aSelection;
|
||||
|
||||
// get the data source name
|
||||
pArgs->GetItemState(FN_DB_DATA_SOURCE_ANY, false, &pSourceItem);
|
||||
if(pSourceItem)
|
||||
static_cast<const SfxUsrAnyItem*>(pSourceItem)->GetValue() >>= sSourceArg;
|
||||
static_cast<const SfxUnoAnyItem*>(pSourceItem)->GetValue() >>= sSourceArg;
|
||||
|
||||
// get the command
|
||||
pArgs->GetItemState(FN_DB_DATA_COMMAND_ANY, false, &pCommandItem);
|
||||
if(pCommandItem)
|
||||
static_cast<const SfxUsrAnyItem*>(pCommandItem)->GetValue() >>= sCommandArg;
|
||||
static_cast<const SfxUnoAnyItem*>(pCommandItem)->GetValue() >>= sCommandArg;
|
||||
|
||||
// get the command type
|
||||
pArgs->GetItemState(FN_DB_DATA_COMMAND_TYPE_ANY, false, &pCommandTypeItem);
|
||||
if(pCommandTypeItem)
|
||||
static_cast<const SfxUsrAnyItem*>(pCommandTypeItem)->GetValue() >>= nCommandTypeArg;
|
||||
static_cast<const SfxUnoAnyItem*>(pCommandTypeItem)->GetValue() >>= nCommandTypeArg;
|
||||
|
||||
Reference<XConnection> xConnection;
|
||||
pArgs->GetItemState(FN_DB_CONNECTION_ANY, false, &pConnectionItem);
|
||||
if ( pConnectionItem )
|
||||
static_cast<const SfxUsrAnyItem*>(pConnectionItem)->GetValue() >>= xConnection;
|
||||
static_cast<const SfxUnoAnyItem*>(pConnectionItem)->GetValue() >>= xConnection;
|
||||
// may be we even get no connection
|
||||
if ( !xConnection.is() )
|
||||
{
|
||||
@@ -128,7 +128,7 @@ void SwTextShell::ExecDB(SfxRequest const &rReq)
|
||||
Reference<XResultSet> xCursor;
|
||||
pArgs->GetItemState(FN_DB_DATA_CURSOR_ANY, false, &pCursorItem);
|
||||
if ( pCursorItem )
|
||||
static_cast<const SfxUsrAnyItem*>(pCursorItem)->GetValue() >>= xCursor;
|
||||
static_cast<const SfxUnoAnyItem*>(pCursorItem)->GetValue() >>= xCursor;
|
||||
|
||||
switch (rReq.GetSlot())
|
||||
{
|
||||
@@ -187,7 +187,7 @@ void SwTextShell::ExecDB(SfxRequest const &rReq)
|
||||
|
||||
OUString sColumnName;
|
||||
if(pColumnNameItem)
|
||||
static_cast<const SfxUsrAnyItem*>(pColumnNameItem)->GetValue() >>= sColumnName;
|
||||
static_cast<const SfxUnoAnyItem*>(pColumnNameItem)->GetValue() >>= sColumnName;
|
||||
OUString sDBName = sSourceArg + OUStringLiteral1(DB_DELIM)
|
||||
+ sCommandArg + OUStringLiteral1(DB_DELIM)
|
||||
+ OUString::number(nCommandTypeArg)
|
||||
@@ -196,9 +196,9 @@ void SwTextShell::ExecDB(SfxRequest const &rReq)
|
||||
SwFieldMgr aFieldMgr(GetShellPtr());
|
||||
SwInsertField_Data aData(TYP_DBFLD, 0, sDBName, OUString(), 0);
|
||||
if(pConnectionItem)
|
||||
aData.m_aDBConnection = static_cast<const SfxUsrAnyItem*>(pConnectionItem)->GetValue();
|
||||
aData.m_aDBConnection = static_cast<const SfxUnoAnyItem*>(pConnectionItem)->GetValue();
|
||||
if(pColumnItem)
|
||||
aData.m_aDBColumn = static_cast<const SfxUsrAnyItem*>(pColumnItem)->GetValue();
|
||||
aData.m_aDBColumn = static_cast<const SfxUnoAnyItem*>(pColumnItem)->GetValue();
|
||||
aFieldMgr.InsertField(aData);
|
||||
SfxViewFrame* pViewFrame = GetView().GetViewFrame();
|
||||
uno::Reference< XDispatchRecorder > xRecorder =
|
||||
|
||||
@@ -231,7 +231,7 @@ void SwXDispatch::dispatch(const util::URL& aURL,
|
||||
}
|
||||
else if(aURL.Complete == cURLFormLetter)
|
||||
{
|
||||
SfxUsrAnyItem aDBProperties(FN_PARAM_DATABASE_PROPERTIES, uno::makeAny(aArgs));
|
||||
SfxUnoAnyItem aDBProperties(FN_PARAM_DATABASE_PROPERTIES, uno::makeAny(aArgs));
|
||||
m_pView->GetViewFrame()->GetDispatcher()->ExecuteList(
|
||||
FN_MAILMERGE_WIZARD,
|
||||
SfxCallMode::ASYNCHRON,
|
||||
|
||||
Reference in New Issue
Block a user