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
7efbbe98
Kaydet (Commit)
7efbbe98
authored
Eki 26, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
lok::Document::paste: check if the given mime type is supported
Change-Id: Ib59ea43700815c53cdd4be819e2e9cf35c6f89e9
üst
2e61410d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
1 deletion
+28
-1
test_desktop_lib.cxx
desktop/qa/desktop_lib/test_desktop_lib.cxx
+4
-1
init.cxx
desktop/source/lib/init.cxx
+7
-0
ITiledRenderable.hxx
include/vcl/ITiledRenderable.hxx
+5
-0
unotxdoc.hxx
sw/inc/unotxdoc.hxx
+2
-0
unotxdoc.cxx
sw/source/uibase/uno/unotxdoc.cxx
+10
-0
No files found.
desktop/qa/desktop_lib/test_desktop_lib.cxx
Dosyayı görüntüle @
7efbbe98
...
...
@@ -331,12 +331,15 @@ void DesktopLOKTest::testPasteWriter()
LibLODocument_Impl
*
pDocument
=
loadDoc
(
"blank_text.odt"
);
OString
aText
(
"hello"
);
pDocument
->
pClass
->
paste
(
pDocument
,
"text/plain;charset=utf-8"
,
aText
.
getStr
(),
aText
.
getLength
(
));
CPPUNIT_ASSERT
(
pDocument
->
pClass
->
paste
(
pDocument
,
"text/plain;charset=utf-8"
,
aText
.
getStr
(),
aText
.
getLength
()
));
pDocument
->
pClass
->
postUnoCommand
(
pDocument
,
".uno:SelectAll"
,
0
);
char
*
pText
=
pDocument
->
pClass
->
getTextSelection
(
pDocument
,
"text/plain;charset=utf-8"
,
0
);
CPPUNIT_ASSERT_EQUAL
(
OString
(
"hello"
),
OString
(
pText
));
free
(
pText
);
CPPUNIT_ASSERT
(
!
pDocument
->
pClass
->
paste
(
pDocument
,
"textt/plain;charset=utf-8"
,
aText
.
getStr
(),
aText
.
getLength
()));
comphelper
::
LibreOfficeKit
::
setActive
(
false
);
}
...
...
desktop/source/lib/init.cxx
Dosyayı görüntüle @
7efbbe98
...
...
@@ -1017,6 +1017,13 @@ static bool doc_paste(LibreOfficeKitDocument* pThis, const char* pMimeType, cons
}
pWindow
->
SetClipboard
(
xClipboard
);
if
(
!
pDoc
->
isMimeTypeSupported
())
{
if
(
gImpl
)
gImpl
->
maLastExceptionMsg
=
"Document doesn't support this mime type"
;
return
false
;
}
OUString
aCommand
(
".uno:Paste"
);
uno
::
Sequence
<
beans
::
PropertyValue
>
aPropertyValues
;
if
(
!
comphelper
::
dispatchCommand
(
aCommand
,
aPropertyValues
))
...
...
include/vcl/ITiledRenderable.hxx
Dosyayı görüntüle @
7efbbe98
...
...
@@ -150,6 +150,11 @@ public:
/// Returns the current vcl::Window of the component.
virtual
vcl
::
Window
*
getWindow
()
=
0
;
virtual
bool
isMimeTypeSupported
()
{
return
false
;
}
};
}
// namespace vcl
...
...
sw/inc/unotxdoc.hxx
Dosyayı görüntüle @
7efbbe98
...
...
@@ -433,6 +433,8 @@ public:
virtual
OUString
getPartPageRectangles
()
override
;
/// @see vcl::ITiledRenderable::getWindow().
virtual
vcl
::
Window
*
getWindow
()
override
;
/// @see vcl::ITiledRenderable::isMimeTypeSupported().
virtual
bool
isMimeTypeSupported
()
override
;
// ::com::sun::star::tiledrendering::XTiledRenderable
virtual
void
SAL_CALL
paintTile
(
const
::
css
::
uno
::
Any
&
Parent
,
::
sal_Int32
nOutputWidth
,
::
sal_Int32
nOutputHeight
,
::
sal_Int32
nTilePosX
,
::
sal_Int32
nTilePosY
,
::
sal_Int32
nTileWidth
,
::
sal_Int32
nTileHeight
)
throw
(
::
css
::
uno
::
RuntimeException
,
::
std
::
exception
)
override
;
...
...
sw/source/uibase/uno/unotxdoc.cxx
Dosyayı görüntüle @
7efbbe98
...
...
@@ -3189,6 +3189,16 @@ vcl::Window* SwXTextDocument::getWindow()
return
&
pDocShell
->
GetView
()
->
GetEditWin
();
}
bool
SwXTextDocument
::
isMimeTypeSupported
()
{
SwWrtShell
*
pWrtShell
=
pDocShell
->
GetWrtShell
();
if
(
!
pWrtShell
)
return
false
;
TransferableDataHelper
aDataHelper
(
TransferableDataHelper
::
CreateFromSystemClipboard
(
&
pWrtShell
->
GetView
().
GetEditWin
()));
return
aDataHelper
.
GetXTransferable
().
is
()
&&
SwTransferable
::
IsPaste
(
*
pWrtShell
,
aDataHelper
);
}
int
SwXTextDocument
::
getPart
()
{
SolarMutexGuard
aGuard
;
...
...
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