Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
faa316e6
Kaydet (Commit)
faa316e6
authored
Eki 26, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
lok clipboard: support rich text paste
Change-Id: Ida5028969782be792b32b952d3adba0c30dd8bae
üst
f7760385
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
test_desktop_lib.cxx
desktop/qa/desktop_lib/test_desktop_lib.cxx
+3
-0
lokclipboard.cxx
desktop/source/lib/lokclipboard.cxx
+8
-3
lokclipboard.hxx
desktop/source/lib/lokclipboard.hxx
+1
-1
No files found.
desktop/qa/desktop_lib/test_desktop_lib.cxx
Dosyayı görüntüle @
faa316e6
...
@@ -338,7 +338,10 @@ void DesktopLOKTest::testPasteWriter()
...
@@ -338,7 +338,10 @@ void DesktopLOKTest::testPasteWriter()
CPPUNIT_ASSERT_EQUAL
(
OString
(
"hello"
),
OString
(
pText
));
CPPUNIT_ASSERT_EQUAL
(
OString
(
"hello"
),
OString
(
pText
));
free
(
pText
);
free
(
pText
);
// textt/plain should be rejected.
CPPUNIT_ASSERT
(
!
pDocument
->
pClass
->
paste
(
pDocument
,
"textt/plain;charset=utf-8"
,
aText
.
getStr
(),
aText
.
getLength
()));
CPPUNIT_ASSERT
(
!
pDocument
->
pClass
->
paste
(
pDocument
,
"textt/plain;charset=utf-8"
,
aText
.
getStr
(),
aText
.
getLength
()));
// Writer is expected to support text/html.
CPPUNIT_ASSERT
(
pDocument
->
pClass
->
paste
(
pDocument
,
"text/html"
,
aText
.
getStr
(),
aText
.
getLength
()));
comphelper
::
LibreOfficeKit
::
setActive
(
false
);
comphelper
::
LibreOfficeKit
::
setActive
(
false
);
}
}
...
...
desktop/source/lib/lokclipboard.cxx
Dosyayı görüntüle @
faa316e6
...
@@ -32,7 +32,7 @@ OUString SAL_CALL LOKClipboard::getName() throw (uno::RuntimeException, std::exc
...
@@ -32,7 +32,7 @@ OUString SAL_CALL LOKClipboard::getName() throw (uno::RuntimeException, std::exc
LOKTransferable
::
LOKTransferable
(
const
char
*
pMimeType
,
const
char
*
pData
,
size_t
nSize
)
LOKTransferable
::
LOKTransferable
(
const
char
*
pMimeType
,
const
char
*
pData
,
size_t
nSize
)
:
m_aMimeType
(
pMimeType
),
:
m_aMimeType
(
pMimeType
),
m_a
Text
(
pData
,
nSize
)
m_a
Sequence
(
reinterpret_cast
<
const
sal_Int8
*>
(
pData
)
,
nSize
)
{
{
}
}
...
@@ -40,8 +40,13 @@ uno::Any SAL_CALL LOKTransferable::getTransferData(const datatransfer::DataFlavo
...
@@ -40,8 +40,13 @@ uno::Any SAL_CALL LOKTransferable::getTransferData(const datatransfer::DataFlavo
throw
(
datatransfer
::
UnsupportedFlavorException
,
io
::
IOException
,
uno
::
RuntimeException
,
std
::
exception
)
throw
(
datatransfer
::
UnsupportedFlavorException
,
io
::
IOException
,
uno
::
RuntimeException
,
std
::
exception
)
{
{
uno
::
Any
aRet
;
uno
::
Any
aRet
;
if
(
m_aMimeType
==
"text/plain;charset=utf-8"
&&
rFlavor
.
MimeType
==
"text/plain;charset=utf-16"
)
if
(
rFlavor
.
DataType
==
cppu
::
UnoType
<
OUString
>::
get
())
aRet
<<=
OStringToOUString
(
m_aText
,
RTL_TEXTENCODING_UTF8
);
{
sal_Char
*
pText
=
reinterpret_cast
<
sal_Char
*>
(
m_aSequence
.
getArray
());
aRet
<<=
OUString
(
pText
,
rtl_str_getLength
(
pText
),
RTL_TEXTENCODING_UTF8
);
}
else
aRet
<<=
m_aSequence
;
return
aRet
;
return
aRet
;
}
}
...
...
desktop/source/lib/lokclipboard.hxx
Dosyayı görüntüle @
faa316e6
...
@@ -35,7 +35,7 @@ public:
...
@@ -35,7 +35,7 @@ public:
class
LOKTransferable
:
public
cppu
::
WeakImplHelper
<
css
::
datatransfer
::
XTransferable
>
class
LOKTransferable
:
public
cppu
::
WeakImplHelper
<
css
::
datatransfer
::
XTransferable
>
{
{
OString
m_aMimeType
;
OString
m_aMimeType
;
OString
m_aText
;
css
::
uno
::
Sequence
<
sal_Int8
>
m_aSequence
;
/// Provides a list of flavors, used by getTransferDataFlavors() and isDataFlavorSupported().
/// Provides a list of flavors, used by getTransferDataFlavors() and isDataFlavorSupported().
std
::
vector
<
css
::
datatransfer
::
DataFlavor
>
getTransferDataFlavorsAsVector
();
std
::
vector
<
css
::
datatransfer
::
DataFlavor
>
getTransferDataFlavorsAsVector
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment