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
55d6fdaf
Kaydet (Commit)
55d6fdaf
authored
Kas 21, 2013
tarafından
Matúš Kukan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Import data streams - reuse infrastructure for ScAreaLink.
Change-Id: I18db991d2e8e665d5e4ca778344993e79772ccd5
üst
47bc5672
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
24 deletions
+59
-24
documen8.cxx
sc/source/core/data/documen8.cxx
+3
-2
xmlcelli.cxx
sc/source/filter/xml/xmlcelli.cxx
+15
-0
datastream.cxx
sc/source/ui/docshell/datastream.cxx
+24
-14
datastream.hxx
sc/source/ui/inc/datastream.hxx
+9
-5
datastreamdlg.cxx
sc/source/ui/miscdlgs/datastreamdlg.cxx
+8
-3
No files found.
sc/source/core/data/documen8.cxx
Dosyayı görüntüle @
55d6fdaf
...
...
@@ -86,6 +86,7 @@
#include "columniterator.hxx"
#include "globalnames.hxx"
#include "stringutil.hxx"
#include <datastream.hxx>
#include <memory>
#include <boost/scoped_ptr.hpp>
...
...
@@ -1193,7 +1194,7 @@ bool ScDocument::HasAreaLinks() const
const
::
sfx2
::
SvBaseLinks
&
rLinks
=
pLinkManager
->
GetLinks
();
sal_uInt16
nCount
=
rLinks
.
size
();
for
(
sal_uInt16
i
=
0
;
i
<
nCount
;
i
++
)
if
((
*
rLinks
[
i
])
->
ISA
(
ScAreaLink
))
if
((
*
rLinks
[
i
])
->
ISA
(
ScAreaLink
)
||
(
*
rLinks
[
i
])
->
ISA
(
DataStream
)
)
return
true
;
}
...
...
@@ -1208,7 +1209,7 @@ void ScDocument::UpdateAreaLinks()
for
(
sal_uInt16
i
=
0
;
i
<
rLinks
.
size
();
i
++
)
{
::
sfx2
::
SvBaseLink
*
pBase
=
*
rLinks
[
i
];
if
(
pBase
->
ISA
(
ScAreaLink
))
if
(
pBase
->
ISA
(
ScAreaLink
)
||
(
*
rLinks
[
i
])
->
ISA
(
DataStream
)
)
pBase
->
Update
();
}
}
...
...
sc/source/filter/xml/xmlcelli.cxx
Dosyayı görüntüle @
55d6fdaf
...
...
@@ -52,6 +52,8 @@
#include "tokenarray.hxx"
#include "scmatrix.hxx"
#include "documentimport.hxx"
#include <datastream.hxx>
#include <rangeutl.hxx>
#include <xmloff/xmltkmap.hxx>
#include <xmloff/xmltoken.hxx>
...
...
@@ -997,6 +999,19 @@ void ScXMLTableRowCellContext::SetCellRangeSource( const ScAddress& rPosition )
rPosition
.
Row
()
+
static_cast
<
SCROW
>
(
pCellRangeSource
->
nRows
-
1
),
rPosition
.
Tab
()
);
OUString
sFilterName
(
pCellRangeSource
->
sFilterName
);
OUString
sSourceStr
(
pCellRangeSource
->
sSourceStr
);
OUString
sRangeStr
;
ScRangeStringConverter
::
GetStringFromRange
(
sRangeStr
,
aDestRange
,
pDoc
,
formula
::
FormulaGrammar
::
CONV_OOO
);
if
(
pCellRangeSource
->
sFilterOptions
==
"DataStream"
)
{
DataStream
::
Set
(
dynamic_cast
<
ScDocShell
*>
(
pDoc
->
GetDocumentShell
())
,
pCellRangeSource
->
sURL
// rURL
,
sRangeStr
// rRange
,
sFilterName
.
toInt32
()
// nLimit
,
sSourceStr
// rMove
,
pCellRangeSource
->
nRefresh
// nSettings
);
return
;
}
ScAreaLink
*
pLink
=
new
ScAreaLink
(
pDoc
->
GetDocumentShell
(),
pCellRangeSource
->
sURL
,
sFilterName
,
pCellRangeSource
->
sFilterOptions
,
sSourceStr
,
aDestRange
,
pCellRangeSource
->
nRefresh
);
sfx2
::
LinkManager
*
pLinkManager
=
pDoc
->
GetLinkManager
();
...
...
sc/source/ui/docshell/datastream.cxx
Dosyayı görüntüle @
55d6fdaf
...
...
@@ -138,10 +138,10 @@ private:
}
static
void
lcl_MakeToolbarVisible
(
SfxViewFrame
*
pViewFrame
)
void
DataStream
::
MakeToolbarVisible
(
ScDocShell
*
pShell
)
{
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
xFrame
=
p
ViewFrame
->
GetFrame
().
GetFrameInterface
();
p
Shell
->
GetViewData
()
->
GetViewShell
()
->
GetViewFrame
()
->
GetFrame
().
GetFrameInterface
();
if
(
!
xFrame
.
is
())
return
;
...
...
@@ -163,18 +163,18 @@ static void lcl_MakeToolbarVisible(SfxViewFrame *pViewFrame)
}
}
void
DataStream
::
Set
(
ScDocShell
*
pShell
,
const
OUString
&
rURL
,
const
OUString
&
rRange
,
sal_Int32
nLimit
,
const
OUString
&
rMove
)
DataStream
*
DataStream
::
Set
(
ScDocShell
*
pShell
,
const
OUString
&
rURL
,
const
OUString
&
rRange
,
sal_Int32
nLimit
,
const
OUString
&
rMove
,
sal_uInt32
nSettings
)
{
sfx2
::
SvBaseLink
*
pLink
=
0
;
pLink
=
new
DataStream
(
pShell
,
rURL
,
rRange
,
nLimit
,
rMove
);
pLink
=
new
DataStream
(
pShell
,
rURL
,
rRange
,
nLimit
,
rMove
,
nSettings
);
sfx2
::
LinkManager
*
pLinkManager
=
pShell
->
GetDocument
()
->
GetLinkManager
();
pLinkManager
->
InsertFileLink
(
*
pLink
,
OBJECT_CLIENT_FILE
,
rURL
,
NULL
,
NULL
);
lcl_MakeToolbarVisible
(
pShell
->
GetViewData
()
->
GetViewShell
()
->
GetViewFrame
());
return
dynamic_cast
<
DataStream
*>
(
pLink
);
}
DataStream
::
DataStream
(
ScDocShell
*
pShell
,
const
OUString
&
rURL
,
const
OUString
&
rRange
,
sal_Int32
nLimit
,
const
OUString
&
rMove
)
DataStream
::
DataStream
(
ScDocShell
*
pShell
,
const
OUString
&
rURL
,
const
OUString
&
rRange
,
sal_Int32
nLimit
,
const
OUString
&
rMove
,
sal_uInt32
nSettings
)
:
mpScDocShell
(
pShell
)
,
mpScDocument
(
mpScDocShell
->
GetDocument
())
,
meMove
(
NO_MOVE
)
...
...
@@ -187,7 +187,7 @@ DataStream::DataStream(ScDocShell *pShell, const OUString& rURL,
mxThread
=
new
datastreams
::
CallerThread
(
this
);
mxThread
->
launch
();
Decode
(
rURL
,
rRange
,
rMove
);
Decode
(
rURL
,
rRange
,
rMove
,
nSettings
);
mpStartRange
.
reset
(
new
ScRange
(
*
mpRange
.
get
())
);
sal_Int32
nHeight
=
mpRange
->
aEnd
.
Row
()
-
mpRange
->
aStart
.
Row
()
+
1
;
...
...
@@ -215,6 +215,8 @@ OString DataStream::ConsumeLine()
if
(
!
mpLines
||
mnLinesCount
>=
mpLines
->
size
())
{
mnLinesCount
=
0
;
if
(
mxReaderThread
->
mbTerminateReading
)
return
OString
();
osl
::
ResettableMutexGuard
aGuard
(
mxReaderThread
->
maLinesProtector
);
if
(
mpLines
)
mxReaderThread
->
maUsedLines
.
push
(
mpLines
);
...
...
@@ -233,18 +235,18 @@ OString DataStream::ConsumeLine()
return
mpLines
->
at
(
mnLinesCount
++
);
}
void
DataStream
::
Decode
(
const
OUString
&
rURL
,
const
OUString
&
rRange
,
const
OUString
&
rMove
)
void
DataStream
::
Decode
(
const
OUString
&
rURL
,
const
OUString
&
rRange
,
const
OUString
&
rMove
,
sal_uInt32
nSettings
)
{
sal_Int32
nIndex
=
rURL
.
indexOf
(
sfx2
::
cTokenSeparator
);
SvStream
*
pStream
=
0
;
if
(
n
Index
!=
-
1
)
pStream
=
new
SvScriptStream
(
rURL
.
copy
(
0
,
nIndex
)
);
if
(
n
Settings
&
SCRIPT_STREAM
)
pStream
=
new
SvScriptStream
(
rURL
);
else
pStream
=
new
SvFileStream
(
rURL
,
STREAM_READ
);
mxReaderThread
=
new
datastreams
::
ReaderThread
(
pStream
);
mxReaderThread
->
launch
();
mbValuesInLine
=
!
rRange
.
isEmpty
()
;
mbValuesInLine
=
nSettings
&
VALUES_IN_LINE
;
if
(
!
mbValuesInLine
)
return
;
...
...
@@ -361,6 +363,14 @@ bool DataStream::ImportData()
return
mbRunning
;
}
sfx2
::
SvBaseLink
::
UpdateResult
DataStream
::
DataChanged
(
const
OUString
&
,
const
css
::
uno
::
Any
&
)
{
MakeToolbarVisible
(
mpScDocShell
);
Start
();
return
SUCCESS
;
}
void
DataStream
::
Edit
(
Window
*
,
const
Link
&
)
{
}
...
...
sc/source/ui/inc/datastream.hxx
Dosyayı görüntüle @
55d6fdaf
...
...
@@ -31,18 +31,22 @@ typedef std::vector<OString> LinesList;
class
DataStream
:
boost
::
noncopyable
,
public
sfx2
::
SvBaseLink
{
OString
ConsumeLine
();
void
Decode
(
const
OUString
&
rURL
,
const
OUString
&
rRange
,
const
OUString
&
rMove
);
void
Decode
(
const
OUString
&
rURL
,
const
OUString
&
rRange
,
const
OUString
&
rMove
,
sal_uInt32
nSettings
);
void
MoveData
();
public
:
enum
MoveEnum
{
NO_MOVE
,
RANGE_DOWN
,
MOVE_DOWN
,
MOVE_UP
};
enum
{
SCRIPT_STREAM
=
1
,
VALUES_IN_LINE
=
2
};
static
void
Set
(
ScDocShell
*
pShell
,
const
OUString
&
rURL
,
const
OUString
&
rRange
,
sal_Int32
nLimit
,
const
OUString
&
rMove
);
static
void
MakeToolbarVisible
(
ScDocShell
*
pShell
);
static
DataStream
*
Set
(
ScDocShell
*
pShell
,
const
OUString
&
rURL
,
const
OUString
&
rRange
,
sal_Int32
nLimit
,
const
OUString
&
rMove
,
sal_uInt32
nSettings
);
DataStream
(
ScDocShell
*
pShell
,
const
OUString
&
rURL
,
const
OUString
&
rRange
,
sal_Int32
nLimit
,
const
OUString
&
rMove
);
DataStream
(
ScDocShell
*
pShell
,
const
OUString
&
rURL
,
const
OUString
&
rRange
,
sal_Int32
nLimit
,
const
OUString
&
rMove
,
sal_uInt32
nSettings
);
virtual
~
DataStream
()
SAL_OVERRIDE
;
virtual
sfx2
::
SvBaseLink
::
UpdateResult
DataChanged
(
const
OUString
&
,
const
css
::
uno
::
Any
&
)
SAL_OVERRIDE
;
virtual
void
Edit
(
Window
*
,
const
Link
&
)
SAL_OVERRIDE
;
bool
ImportData
();
...
...
sc/source/ui/miscdlgs/datastreamdlg.cxx
Dosyayı görüntüle @
55d6fdaf
...
...
@@ -10,7 +10,6 @@
#include <datastreamdlg.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/linkmgr.hxx>
#include <svtools/inettbc.hxx>
#include <vcl/layout.hxx>
#include <datastream.hxx>
...
...
@@ -84,15 +83,21 @@ void DataStreamDlg::StartStream()
if
(
m_pRBMaxLimit
->
IsChecked
())
nLimit
=
m_pEdLimit
->
GetText
().
toInt32
();
OUString
rURL
=
m_pCbUrl
->
GetText
();
sal_uInt32
nSettings
=
0
;
if
(
m_pRBScriptData
->
IsChecked
())
rURL
+=
OUString
(
sfx2
::
cTokenSeparator
);
DataStream
::
Set
(
mpDocShell
,
nSettings
|=
DataStream
::
SCRIPT_STREAM
;
if
(
m_pRBValuesInLine
->
IsChecked
())
nSettings
|=
DataStream
::
VALUES_IN_LINE
;
DataStream
*
pStream
=
DataStream
::
Set
(
mpDocShell
,
rURL
,
m_pEdRange
->
GetText
(),
nLimit
,
m_pRBNoMove
->
IsChecked
()
?
OUString
(
"NO_MOVE"
)
:
m_pRBRangeDown
->
IsChecked
()
?
OUString
(
"RANGE_DOWN"
)
:
OUString
(
"MOVE_DOWN"
)
,
nSettings
);
DataStream
::
MakeToolbarVisible
(
mpDocShell
);
pStream
->
Start
();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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