summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-01-17 18:05:25 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-01-17 18:05:25 +0100
commitc42d8d44853195d861142b1b6d0b98ca2c4b0b7e (patch)
tree06b138f919340e16871b1de6ed8fa81ed15d9960
parentb6dcd5aa346e3b31ea41bce4ae8607adf19a1ccc (diff)
GTK3 getTransferDataFlavorsAsVector: Filter out non-MIME-types
...that would cause needless (though caught, so not causing real harm) exceptions downstream, as in > #0 0x00007ffff6a2d4dd in __cxxabiv1::__cxa_throw(void*, std::type_info*, void (*)(void*)) (obj=0x7c60480, tinfo=0x7ffff7b0c940 <typeinfo for com::sun::star::lang::IllegalArgumentException>, dest=0x7fff81733b80 <com::sun::star::lang::IllegalArgumentException::~IllegalArgumentException()>) at ../../../../libstdc++-v3/libsupc++/eh_throw.cc:63 > #1 0x00007fff817318c5 in CMimeContentType::acceptSym(rtl::OUString const&) (this=0x7fff4617b608, pSymTlb="/") at dtrans/source/cnttype/mcnttype.cxx:113 > #2 0x00007fff817317de in CMimeContentType::type() (this=0x7fff4617b608) at dtrans/source/cnttype/mcnttype.cxx:148 > #3 0x00007fff81730bf6 in CMimeContentType::init(rtl::OUString const&) (this=0x7fff4617b608, aCntType="INTEGER") at dtrans/source/cnttype/mcnttype.cxx:95 > #4 0x00007fff81730a5d in CMimeContentType::CMimeContentType(rtl::OUString const&) (this=0x7fff4617b608, aCntType="INTEGER") at dtrans/source/cnttype/mcnttype.cxx:35 > #5 0x00007fff8172daee in CMimeContentTypeFactory::createMimeContentType(rtl::OUString const&) (this=0x7fff46165e48, aContentType="INTEGER") at dtrans/source/cnttype/mcnttfactory.cxx:50 > #6 0x00007fff8172dbe3 in non-virtual thunk to CMimeContentTypeFactory::createMimeContentType(rtl::OUString const&) () at instdir/program/../program/libmcnttype.so > #7 0x00007fffeecc97e1 in TransferableDataHelper::FillDataFlavorExVector(com::sun::star::uno::Sequence<com::sun::star::datatransfer::DataFlavor> const&, std::__debug::vector<DataFlavorEx, std::allocator<DataFlavorEx> >&) (rDataFlavorSeq=uno::Sequence of length 23 = {...}, rDataFlavorExVector=std::__debug::vector of length 1, capacity 1 = {...}) at svtools/source/misc/transfer.cxx:1221 > #8 0x00007fffeecc894e in TransferableDataHelper::InitFormats() (this=0x7fffffffa698) at svtools/source/misc/transfer.cxx:1308 > #9 0x00007fffeecc8722 in TransferableDataHelper::TransferableDataHelper(com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable> const&) (this=0x7fffffffa698, rxTransferable=uno::Reference to (GtkClipboardTransferable *) 0x7fff46181718) at svtools/source/misc/transfer.cxx:1128 > #10 0x00007fffeecd00bd in TransferableDataHelper::CreateFromSystemClipboard(vcl::Window*) (pWindow=0x1675000) at svtools/source/misc/transfer.cxx:2118 > #11 0x00007fff9f267777 in SwBaseShell::StateClpbrd(SfxItemSet&) (this=0x37df2d0, rSet=SfxItemSet of pool 0x23bed90 with parent 0x0 and Which ranges: [(5311, 5312), (5712, 5712)] = {...}) at sw/source/uibase/shells/basesh.cxx:462 > #12 0x00007fff9f2673c8 in SfxStubSwBaseShellStateClpbrd(SfxShell*, SfxItemSet&) (pShell=0x37df2d0, rSet=SfxItemSet of pool 0x23bed90 with parent 0x0 and Which ranges: [(5311, 5312), (5712, 5712)] = {...}) at workdir/SdiTarget/sw/sdi/swslots.hxx:2104 > #13 0x00007ffff1b9c632 in SfxShell::CallState(void (*)(SfxShell*, SfxItemSet&), SfxItemSet&) (this=0x37df2d0, pFunc=0x7fff9f2673a0 <SfxStubSwBaseShellStateClpbrd(SfxShell*, SfxItemSet&)>, rSet=SfxItemSet of pool 0x23bed90 with parent 0x0 and Which ranges: [(5311, 5312), (5712, 5712)] = {...}) at include/sfx2/shell.hxx:216 > #14 0x00007ffff1bb41c8 in SfxDispatcher::FillState_(SfxSlotServer const&, SfxItemSet&, SfxSlot const*) (this=0x257eea0, rSvr=..., rState=SfxItemSet of pool 0x23bed90 with parent 0x0 and Which ranges: [(5311, 5312), (5712, 5712)] = {...}, pRealSlot=0x7fff9ffad240 <aSwBaseShellSlots_Impl>) at sfx2/source/control/dispatch.cxx:1894 > #15 0x00007ffff1b91d58 in SfxBindings::Update_Impl(SfxStateCache*) (this=0x257ee30, pCache=0x37e0570) at sfx2/source/control/bindings.cxx:327 > #16 0x00007ffff1b9421c in SfxBindings::NextJob_Impl(Timer*) (this=0x257ee30, pTimer=0x1a1e398) at sfx2/source/control/bindings.cxx:1498 > #17 0x00007ffff1b983ed in SfxBindings::NextJob(Timer*) (this=0x257ee30, pTimer=0x1a1e398) at sfx2/source/control/bindings.cxx:1441 > #18 0x00007ffff1b90478 in SfxBindings::LinkStubNextJob(void*, Timer*) (instance=0x257ee30, data=0x1a1e398) at sfx2/source/control/bindings.cxx:1439 > #19 0x00007fffec93f228 in Link<Timer*, void>::Call(Timer*) const (this=0x1a1e3b8, data=0x1a1e398) at include/tools/link.hxx:84 > #20 0x00007fffec93f007 in Timer::Invoke() (this=0x1a1e398) at vcl/source/app/timer.cxx:88 ... Change-Id: I5bac21f400cea04957554483aab2d44cca5b4bfc
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index a8048b5f7146..8ebca1c08713 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -112,6 +112,14 @@ std::vector<css::datatransfer::DataFlavor> GtkTransferable::getTransferDataFlavo
}
}
+ // There are more non-MIME-types reported that are not translated by
+ // aConversionTab, like "SAVE_TARGETS", "INTEGER", "ATOM"; just filter
+ // them out for now before they confuse this code's clients:
+ if (rtl_str_indexOfChar(pFinalName, '/') == -1)
+ {
+ continue;
+ }
+
aFlavor.MimeType = OUString(pFinalName,
rtl_str_getLength(pFinalName),
RTL_TEXTENCODING_UTF8);