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
a42f582e
Kaydet (Commit)
a42f582e
authored
Eki 08, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sc tiled rendering: implement LOK_CALLBACK_SEARCH_RESULT_SELECTION
Change-Id: Iaca2c1807a6e92cf7a87b0843000d65aea45fe7b
üst
06d253ef
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
6 deletions
+62
-6
test_desktop_lib.cxx
desktop/qa/desktop_lib/test_desktop_lib.cxx
+13
-0
gridwin.hxx
sc/source/ui/inc/gridwin.hxx
+2
-0
gridwin.cxx
sc/source/ui/view/gridwin.cxx
+20
-3
viewfun2.cxx
sc/source/ui/view/viewfun2.cxx
+27
-3
No files found.
desktop/qa/desktop_lib/test_desktop_lib.cxx
Dosyayı görüntüle @
a42f582e
...
...
@@ -73,6 +73,7 @@ public:
uno
::
Reference
<
lang
::
XComponent
>
mxComponent
;
OString
m_aTextSelection
;
std
::
vector
<
OString
>
m_aSearchResultSelection
;
};
LibLODocument_Impl
*
DesktopLOKTest
::
loadDoc
(
const
char
*
pName
,
LibreOfficeKitDocumentType
eType
)
...
...
@@ -123,6 +124,16 @@ void DesktopLOKTest::callbackImpl(int nType, const char* pPayload)
m_aTextSelection
=
pPayload
;
}
break
;
case
LOK_CALLBACK_SEARCH_RESULT_SELECTION
:
{
m_aSearchResultSelection
.
clear
();
boost
::
property_tree
::
ptree
aTree
;
std
::
stringstream
aStream
(
pPayload
);
boost
::
property_tree
::
read_json
(
aStream
,
aTree
);
for
(
boost
::
property_tree
::
ptree
::
value_type
&
rValue
:
aTree
.
get_child
(
"searchResultSelection"
))
m_aSearchResultSelection
.
push_back
(
rValue
.
second
.
data
().
c_str
());
}
break
;
}
}
...
...
@@ -256,6 +267,8 @@ void DesktopLOKTest::testSearchCalc()
}
while
(
nIndex
>=
0
);
// This was 1, find-all only found one match.
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
size_t
>
(
2
),
aSelections
.
size
());
// Make sure that we get exactly as many rectangle lists as matches.
CPPUNIT_ASSERT_EQUAL
(
static_cast
<
size_t
>
(
2
),
m_aSearchResultSelection
.
size
());
closeDoc
();
comphelper
::
LibreOfficeKit
::
setActive
(
false
);
...
...
sc/source/ui/inc/gridwin.hxx
Dosyayı görüntüle @
a42f582e
...
...
@@ -336,6 +336,8 @@ public:
/// @see vcl::ITiledRenderable::setTextSelection() for the values of nType.
/// Coordinates are in pixels.
void
SetCellSelectionPixel
(
int
nType
,
int
nPixelX
,
int
nPixelY
);
/// Get the cell selection, coordinates are in logic units.
void
GetCellSelection
(
std
::
vector
<
Rectangle
>&
rLogicRects
);
virtual
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
accessibility
::
XAccessible
>
CreateAccessible
()
SAL_OVERRIDE
;
...
...
sc/source/ui/view/gridwin.cxx
Dosyayı görüntüle @
a42f582e
...
...
@@ -5886,8 +5886,12 @@ void ScGridWindow::UpdateCopySourceOverlay()
SetMapMode
(
aOldMode
);
}
/// Turn the selection ranges rRectangles into the LibreOfficeKit selection, and call the callback.
static
void
updateLibreOfficeKitSelection
(
ScViewData
*
pViewData
,
ScDrawLayer
*
pDrawLayer
,
const
std
::
vector
<
Rectangle
>&
rRectangles
)
/**
* Turn the selection ranges rRectangles into the LibreOfficeKit selection, and call the callback.
*
* @param pLogicRects - if not 0, then don't invoke the callback, just collect the rectangles in the pointed vector.
*/
static
void
updateLibreOfficeKitSelection
(
ScViewData
*
pViewData
,
ScDrawLayer
*
pDrawLayer
,
const
std
::
vector
<
Rectangle
>&
rRectangles
,
std
::
vector
<
Rectangle
>*
pLogicRects
=
0
)
{
if
(
!
pDrawLayer
->
isTiledRendering
())
return
;
...
...
@@ -5907,9 +5911,15 @@ static void updateLibreOfficeKitSelection(ScViewData* pViewData, ScDrawLayer* pD
Rectangle
aRect
(
aRectangle
.
Left
()
/
nPPTX
,
aRectangle
.
Top
()
/
nPPTY
,
aRectangle
.
Right
()
/
nPPTX
,
aRectangle
.
Bottom
()
/
nPPTY
);
aRectangles
.
push_back
(
aRect
.
toString
());
if
(
pLogicRects
)
pLogicRects
->
push_back
(
aRect
);
else
aRectangles
.
push_back
(
aRect
.
toString
());
}
if
(
pLogicRects
)
return
;
// selection start handle
Rectangle
aStart
(
aBoundingBox
.
Left
()
/
nPPTX
,
aBoundingBox
.
Top
()
/
nPPTY
,
aBoundingBox
.
Left
()
/
nPPTX
,
(
aBoundingBox
.
Top
()
/
nPPTY
)
+
256
);
...
...
@@ -6093,6 +6103,13 @@ void ScGridWindow::UpdateCursorOverlay()
SetMapMode
(
aOldMode
);
}
void
ScGridWindow
::
GetCellSelection
(
std
::
vector
<
Rectangle
>&
rLogicRects
)
{
std
::
vector
<
Rectangle
>
aPixelRects
;
GetSelectionRects
(
aPixelRects
);
updateLibreOfficeKitSelection
(
pViewData
,
pViewData
->
GetDocument
()
->
GetDrawLayer
(),
aPixelRects
,
&
rLogicRects
);
}
void
ScGridWindow
::
DeleteSelectionOverlay
()
{
mpOOSelection
.
reset
();
...
...
sc/source/ui/view/viewfun2.cxx
Dosyayı görüntüle @
a42f582e
...
...
@@ -89,6 +89,7 @@
#include <vector>
#include <memory>
#include <boost/property_tree/json_parser.hpp>
using
namespace
com
::
sun
::
star
;
using
::
editeng
::
SvxBorderLine
;
...
...
@@ -1837,20 +1838,43 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
AlignToCursor
(
nCol
,
nRow
,
SC_FOLLOW_JUMP
);
SetCursor
(
nCol
,
nRow
,
true
);
// Don't move cell selection handles for find-all: selection of all but the first result would be lost.
if
(
rDoc
.
GetDrawLayer
()
->
isTiledRendering
()
&&
nCommand
==
SvxSearchCmd
::
FIND
)
if
(
rDoc
.
GetDrawLayer
()
->
isTiledRendering
())
{
Point
aCurPos
=
GetViewData
().
GetScrPos
(
nCol
,
nRow
,
GetViewData
().
GetActivePart
());
// just update the cell selection
ScGridWindow
*
pGridWindow
=
GetViewData
().
GetActiveWin
();
if
(
pGridWindow
)
// Don't move cell selection handles for find-all: selection of all but the first result would be lost.
if
(
pGridWindow
&&
nCommand
==
SvxSearchCmd
::
FIND
)
{
// move the cell selection handles
pGridWindow
->
SetCellSelectionPixel
(
LOK_SETTEXTSELECTION_RESET
,
aCurPos
.
X
(),
aCurPos
.
Y
());
pGridWindow
->
SetCellSelectionPixel
(
LOK_SETTEXTSELECTION_START
,
aCurPos
.
X
(),
aCurPos
.
Y
());
pGridWindow
->
SetCellSelectionPixel
(
LOK_SETTEXTSELECTION_END
,
aCurPos
.
X
(),
aCurPos
.
Y
());
}
if
(
pGridWindow
)
{
std
::
vector
<
Rectangle
>
aLogicRects
;
pGridWindow
->
GetCellSelection
(
aLogicRects
);
boost
::
property_tree
::
ptree
aTree
;
aTree
.
put
(
"searchString"
,
pSearchItem
->
GetSearchString
().
toUtf8
().
getStr
());
boost
::
property_tree
::
ptree
aSelections
;
for
(
const
Rectangle
&
rLogicRect
:
aLogicRects
)
{
boost
::
property_tree
::
ptree
aSelection
;
aSelection
.
put
(
""
,
rLogicRect
.
toString
().
getStr
());
aSelections
.
push_back
(
std
::
make_pair
(
""
,
aSelection
));
}
aTree
.
add_child
(
"searchResultSelection"
,
aSelections
);
std
::
stringstream
aStream
;
boost
::
property_tree
::
write_json
(
aStream
,
aTree
);
OString
aPayload
=
aStream
.
str
().
c_str
();
rDoc
.
GetDrawLayer
()
->
libreOfficeKitCallback
(
LOK_CALLBACK_SEARCH_RESULT_SELECTION
,
aPayload
.
getStr
());
}
}
if
(
nCommand
==
SvxSearchCmd
::
REPLACE
...
...
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