26#include <svtools/strings.hrc>
30#include <com/sun/star/beans/PropertyValue.hpp>
33 : GenericDialogController(pParent,
"cui/ui/pastespecial.ui",
"PasteSpecialDialog")
34 , m_xFtObjectSource(m_xBuilder->weld_label(
"source"))
35 , m_xLbInsertList(m_xBuilder->weld_tree_view(
"list"))
86 if (rHelper.
HasFormat(SotClipboardFormatId::OBJECTDESCRIPTOR))
89 SotClipboardFormatId::OBJECTDESCRIPTOR, aDesc);
94 OUString aSourceName, aTypeName;
100 DataFlavorExVector::iterator aIter(
const_cast<DataFlavorExVector&
>(*pFormats).begin() ),
102 while( aIter != aEnd )
106 std::map< SotClipboardFormatId, OUString >::iterator itName =
114 const OUString*
pName =
nullptr;
118 if ( !
aName.isEmpty() )
123 pName = &(itName->second);
130 if( SotClipboardFormatId::EMBED_SOURCE == nFormat )
142 else if( SotClipboardFormatId::LINK_SOURCE == nFormat )
146 else if(
aName.isEmpty() )
150 if (nFormat == SotClipboardFormatId::RICHTEXT &&
151 std::any_of(pFormats->begin(), pFormats->end(),
153 return rFlavor.mnSotId == SotClipboardFormatId::RTF;
166 if( aTypeName.isEmpty() && aSourceName.isEmpty() )
174 if( aTypeName.isEmpty() && aSourceName.isEmpty() )
177 aSourceName =
SvtResId(STR_UNKNOWN_SOURCE);
184 if( !aSourceName.isEmpty() )
186 if( !aTypeName.isEmpty() )
189 aTypeName += aSourceName;
205 if (rHelper.
HasFormat(SotClipboardFormatId::OBJECTDESCRIPTOR))
208 SotClipboardFormatId::OBJECTDESCRIPTOR, aDesc);
213 OUString aSourceName, aTypeName;
219 for (
auto const& format : *pFormats)
223 std::map< SotClipboardFormatId, OUString >::iterator itName =
231 const OUString*
pName =
nullptr;
235 if ( !
aName.isEmpty() )
240 pName = &(itName->second);
247 if( SotClipboardFormatId::EMBED_SOURCE == nFormat )
259 else if( SotClipboardFormatId::LINK_SOURCE == nFormat )
263 else if(
aName.isEmpty() )
267 if (nFormat == SotClipboardFormatId::RICHTEXT &&
268 std::any_of(pFormats->begin(), pFormats->end(),
270 return rFlavor.mnSotId == SotClipboardFormatId::RTF;
283 if( aTypeName.isEmpty() && aSourceName.isEmpty() )
291 if( aTypeName.isEmpty() && aSourceName.isEmpty() )
294 aSourceName =
SvtResId(STR_UNKNOWN_SOURCE);
306 if( !aSourceName.isEmpty() )
308 if( !aTypeName.isEmpty() )
311 aTypeName += aSourceName;
319 if (
ObjectLB().get_selected_id().startsWithIgnoreAsciiCase(
".uno"))
322 nSelFormat = SotClipboardFormatId::NONE;
Reference< XExecutableDialog > m_xDialog
weld::TreeView & ObjectLB()
void InsertUno(const OUString &sUnoCmd, const OUString &sLabel)
SvGlobalName aObjClassName
std::unique_ptr< weld::Label > m_xFtObjectSource
std::unique_ptr< weld::Button > m_xOKButton
std::map< SotClipboardFormatId, OUString > aSupplementMap
std::unique_ptr< weld::TreeView > m_xLbInsertList
SvPasteObjectDialog(weld::Window *pParent)
void PreGetFormat(const TransferableDataHelper &aHelper)
PreGetFormat Prepares the dialog for running to get format of paste as a SotClipboardFormatId value b...
SotClipboardFormatId GetFormatOnly()
GetFormatOnly Returns a SotClipboardFormatId value.
void Insert(SotClipboardFormatId nFormat, const OUString &rFormatName)
std::pair< OUString, OUString > aExtraCommand
SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper)
GetFormat Prepares and runs the dialog, and returns a SotClipboardFormatId depending on the RET_OK re...
void SetObjName(const SvGlobalName &rClass, const OUString &rObjName)
static bool GetEmbeddedName(const TransferableDataHelper &rData, OUString &_rName, OUString &_rSource, SotClipboardFormatId const &_nFormat)
static OUString GetSotFormatUIName(SotClipboardFormatId nId)
bool GetTransferableObjectDescriptor(SotClipboardFormatId nFormat, TransferableObjectDescriptor &rDesc)
const DataFlavorExVector & GetDataFlavorExVector() const
bool HasFormat(SotClipboardFormatId nFormat) const
void connect_row_activated(const Link< TreeView &, bool > &rLink)
virtual int find_text(const OUString &rText) const=0
void connect_changed(const Link< TreeView &, void > &rLink)
void append(TreeIter *pRet=nullptr)
virtual OUString get_selected_id() const=0
::std::vector< DataFlavorEx > DataFlavorExVector
std::unique_ptr< weld::Button > m_xOKButton
LineEnd GetSystemLineEnd()
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
#define LINK(Instance, Class, Member)
bool dispatchCommand(const OUString &rCommand, const uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Sequence< css::beans::PropertyValue > &rArguments, const uno::Reference< css::frame::XDispatchResultListener > &rListener)
IMPL_LINK_NOARG(SvPasteObjectDialog, SelectHdl, weld::TreeView &, void)
SVT_DLLPUBLIC OUString SvtResId(TranslateId aId)