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
92c7b673
Kaydet (Commit)
92c7b673
authored
Ock 10, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#38057 implement RTF import progressbar
üst
7cee57f3
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
58 additions
and
11 deletions
+58
-11
dialogs.hrc
svx/inc/svx/dialogs.hrc
+1
-0
stbctrls.src
svx/source/stbctrls/stbctrls.src
+5
-0
Library_rtftok.mk
writerfilter/Library_rtftok.mk
+1
-0
RTFDocument.hxx
writerfilter/inc/rtftok/RTFDocument.hxx
+3
-1
RtfFilter.cxx
writerfilter/source/filter/RtfFilter.cxx
+7
-1
rtfdocumentfactory.cxx
writerfilter/source/rtftok/rtfdocumentfactory.cxx
+3
-2
rtfdocumentimpl.cxx
writerfilter/source/rtftok/rtfdocumentimpl.cxx
+5
-3
rtfdocumentimpl.hxx
writerfilter/source/rtftok/rtfdocumentimpl.hxx
+3
-1
rtftokenizer.cxx
writerfilter/source/rtftok/rtftokenizer.cxx
+28
-2
rtftokenizer.hxx
writerfilter/source/rtftok/rtftokenizer.hxx
+2
-1
No files found.
svx/inc/svx/dialogs.hrc
Dosyayı görüntüle @
92c7b673
...
@@ -1175,5 +1175,6 @@
...
@@ -1175,5 +1175,6 @@
#define RID_SVXBMP_DOC_MODIFIED_FEEDBACK (SVX_OOO_BUILD_START + 3)
#define RID_SVXBMP_DOC_MODIFIED_FEEDBACK (SVX_OOO_BUILD_START + 3)
#define RID_SVXSTR_DOC_MODIFIED_YES (SVX_OOO_BUILD_START + 4)
#define RID_SVXSTR_DOC_MODIFIED_YES (SVX_OOO_BUILD_START + 4)
#define RID_SVXSTR_DOC_MODIFIED_NO (SVX_OOO_BUILD_START + 5)
#define RID_SVXSTR_DOC_MODIFIED_NO (SVX_OOO_BUILD_START + 5)
#define RID_SVXSTR_DOC_LOAD (SVX_OOO_BUILD_START + 6)
#endif
#endif
svx/source/stbctrls/stbctrls.src
Dosyayı görüntüle @
92c7b673
...
@@ -97,6 +97,11 @@ String RID_SVXSTR_DOC_MODIFIED_NO
...
@@ -97,6 +97,11 @@ String RID_SVXSTR_DOC_MODIFIED_NO
Text [ en-US ] = "The document has not been modified since the last save.";
Text [ en-US ] = "The document has not been modified since the last save.";
};
};
String RID_SVXSTR_DOC_LOAD
{
Text [ en-US ] = "Loading document...";
};
// PopupMenu -------------------------------------------------------------
// PopupMenu -------------------------------------------------------------
Menu RID_SVXMNU_ZOOM
Menu RID_SVXMNU_ZOOM
{
{
...
...
writerfilter/Library_rtftok.mk
Dosyayı görüntüle @
92c7b673
...
@@ -56,6 +56,7 @@ $(eval $(call gb_Library_add_linked_libs,rtftok,\
...
@@ -56,6 +56,7 @@ $(eval $(call gb_Library_add_linked_libs,rtftok,\
utl \
utl \
tl \
tl \
resourcemodel \
resourcemodel \
vcl \
$(gb_STDLIBS) \
$(gb_STDLIBS) \
))
))
...
...
writerfilter/inc/rtftok/RTFDocument.hxx
Dosyayı görüntüle @
92c7b673
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
namespace
writerfilter
{
namespace
writerfilter
{
namespace
rtftok
{
namespace
rtftok
{
...
@@ -62,7 +63,8 @@ namespace writerfilter {
...
@@ -62,7 +63,8 @@ namespace writerfilter {
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
const
&
xContext
,
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XComponentContext
>
const
&
xContext
,
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
io
::
XInputStream
>
const
&
xInputStream
,
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
io
::
XInputStream
>
const
&
xInputStream
,
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XComponent
>
const
&
xDstDoc
,
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XComponent
>
const
&
xDstDoc
,
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
frame
::
XFrame
>
const
&
xFrame
);
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
frame
::
XFrame
>
const
&
xFrame
,
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
task
::
XStatusIndicator
>
const
&
xStatusIndicator
);
};
};
}
// namespace rtftok
}
// namespace rtftok
}
// namespace writerfilter
}
// namespace writerfilter
...
...
writerfilter/source/filter/RtfFilter.cxx
Dosyayı görüntüle @
92c7b673
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include <dmapper/DomainMapper.hxx>
#include <dmapper/DomainMapper.hxx>
#include <rtftok/RTFDocument.hxx>
#include <rtftok/RTFDocument.hxx>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
using
namespace
::
rtl
;
using
namespace
::
rtl
;
using
namespace
::
cppu
;
using
namespace
::
cppu
;
...
@@ -88,14 +89,19 @@ sal_Bool RtfFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescri
...
@@ -88,14 +89,19 @@ sal_Bool RtfFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescri
uno
::
Reference
<
frame
::
XFrame
>
xFrame
=
aMediaDesc
.
getUnpackedValueOrDefault
(
MediaDescriptor
::
PROP_FRAME
(),
uno
::
Reference
<
frame
::
XFrame
>
xFrame
=
aMediaDesc
.
getUnpackedValueOrDefault
(
MediaDescriptor
::
PROP_FRAME
(),
uno
::
Reference
<
frame
::
XFrame
>
());
uno
::
Reference
<
frame
::
XFrame
>
());
uno
::
Reference
<
task
::
XStatusIndicator
>
xStatusIndicator
=
aMediaDesc
.
getUnpackedValueOrDefault
(
MediaDescriptor
::
PROP_STATUSINDICATOR
(),
uno
::
Reference
<
task
::
XStatusIndicator
>
());
writerfilter
::
Stream
::
Pointer_t
pStream
(
writerfilter
::
Stream
::
Pointer_t
pStream
(
new
writerfilter
::
dmapper
::
DomainMapper
(
m_xContext
,
xInputStream
,
m_xDstDoc
,
writerfilter
::
dmapper
::
DOCUMENT_RTF
));
new
writerfilter
::
dmapper
::
DomainMapper
(
m_xContext
,
xInputStream
,
m_xDstDoc
,
writerfilter
::
dmapper
::
DOCUMENT_RTF
));
writerfilter
::
rtftok
::
RTFDocument
::
Pointer_t
const
pDocument
(
writerfilter
::
rtftok
::
RTFDocument
::
Pointer_t
const
pDocument
(
writerfilter
::
rtftok
::
RTFDocumentFactory
::
createDocument
(
m_xContext
,
xInputStream
,
m_xDstDoc
,
xFrame
));
writerfilter
::
rtftok
::
RTFDocumentFactory
::
createDocument
(
m_xContext
,
xInputStream
,
m_xDstDoc
,
xFrame
,
xStatusIndicator
));
pDocument
->
resolve
(
*
pStream
);
pDocument
->
resolve
(
*
pStream
);
#ifdef DEBUG_IMPORT
#ifdef DEBUG_IMPORT
dmapperLogger
->
endDocument
();
dmapperLogger
->
endDocument
();
#endif
#endif
if
(
xStatusIndicator
.
is
())
xStatusIndicator
->
end
();
return
sal_True
;
return
sal_True
;
}
}
catch
(
const
uno
::
Exception
&
e
)
catch
(
const
uno
::
Exception
&
e
)
...
...
writerfilter/source/rtftok/rtfdocumentfactory.cxx
Dosyayı görüntüle @
92c7b673
...
@@ -33,9 +33,10 @@ namespace rtftok {
...
@@ -33,9 +33,10 @@ namespace rtftok {
RTFDocument
::
Pointer_t
RTFDocumentFactory
::
createDocument
(
uno
::
Reference
<
uno
::
XComponentContext
>
const
&
xContext
,
RTFDocument
::
Pointer_t
RTFDocumentFactory
::
createDocument
(
uno
::
Reference
<
uno
::
XComponentContext
>
const
&
xContext
,
uno
::
Reference
<
io
::
XInputStream
>
const
&
xInputStream
,
uno
::
Reference
<
io
::
XInputStream
>
const
&
xInputStream
,
uno
::
Reference
<
lang
::
XComponent
>
const
&
xDstDoc
,
uno
::
Reference
<
lang
::
XComponent
>
const
&
xDstDoc
,
uno
::
Reference
<
frame
::
XFrame
>
const
&
xFrame
)
uno
::
Reference
<
frame
::
XFrame
>
const
&
xFrame
,
uno
::
Reference
<
task
::
XStatusIndicator
>
const
&
xStatusIndicator
)
{
{
return
RTFDocument
::
Pointer_t
(
new
RTFDocumentImpl
(
xContext
,
xInputStream
,
xDstDoc
,
xFrame
));
return
RTFDocument
::
Pointer_t
(
new
RTFDocumentImpl
(
xContext
,
xInputStream
,
xDstDoc
,
xFrame
,
xStatusIndicator
));
}
}
}
// namespace rtftok
}
// namespace rtftok
...
...
writerfilter/source/rtftok/rtfdocumentimpl.cxx
Dosyayı görüntüle @
92c7b673
...
@@ -248,11 +248,13 @@ static util::DateTime lcl_getDateTime(std::stack<RTFParserState>& aStates)
...
@@ -248,11 +248,13 @@ static util::DateTime lcl_getDateTime(std::stack<RTFParserState>& aStates)
RTFDocumentImpl
::
RTFDocumentImpl
(
uno
::
Reference
<
uno
::
XComponentContext
>
const
&
xContext
,
RTFDocumentImpl
::
RTFDocumentImpl
(
uno
::
Reference
<
uno
::
XComponentContext
>
const
&
xContext
,
uno
::
Reference
<
io
::
XInputStream
>
const
&
xInputStream
,
uno
::
Reference
<
io
::
XInputStream
>
const
&
xInputStream
,
uno
::
Reference
<
lang
::
XComponent
>
const
&
xDstDoc
,
uno
::
Reference
<
lang
::
XComponent
>
const
&
xDstDoc
,
uno
::
Reference
<
frame
::
XFrame
>
const
&
xFrame
)
uno
::
Reference
<
frame
::
XFrame
>
const
&
xFrame
,
uno
::
Reference
<
task
::
XStatusIndicator
>
const
&
xStatusIndicator
)
:
m_xContext
(
xContext
),
:
m_xContext
(
xContext
),
m_xInputStream
(
xInputStream
),
m_xInputStream
(
xInputStream
),
m_xDstDoc
(
xDstDoc
),
m_xDstDoc
(
xDstDoc
),
m_xFrame
(
xFrame
),
m_xFrame
(
xFrame
),
m_xStatusIndicator
(
xStatusIndicator
),
m_nGroup
(
0
),
m_nGroup
(
0
),
m_aDefaultState
(),
m_aDefaultState
(),
m_bSkipUnknown
(
false
),
m_bSkipUnknown
(
false
),
...
@@ -303,7 +305,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
...
@@ -303,7 +305,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
m_pGraphicHelper
.
reset
(
new
oox
::
GraphicHelper
(
m_xContext
,
xFrame
,
m_xStorage
));
m_pGraphicHelper
.
reset
(
new
oox
::
GraphicHelper
(
m_xContext
,
xFrame
,
m_xStorage
));
m_pTokenizer
.
reset
(
new
RTFTokenizer
(
*
this
,
m_pInStream
.
get
()));
m_pTokenizer
.
reset
(
new
RTFTokenizer
(
*
this
,
m_pInStream
.
get
()
,
m_xStatusIndicator
));
m_pSdrImport
.
reset
(
new
RTFSdrImport
(
*
this
,
m_xDstDoc
));
m_pSdrImport
.
reset
(
new
RTFSdrImport
(
*
this
,
m_xDstDoc
));
}
}
...
@@ -363,7 +365,7 @@ void RTFDocumentImpl::resolveSubstream(sal_uInt32 nPos, Id nId, OUString& rIgnor
...
@@ -363,7 +365,7 @@ void RTFDocumentImpl::resolveSubstream(sal_uInt32 nPos, Id nId, OUString& rIgnor
{
{
sal_uInt32
nCurrent
=
Strm
().
Tell
();
sal_uInt32
nCurrent
=
Strm
().
Tell
();
// Seek to header position, parse, then seek back.
// Seek to header position, parse, then seek back.
RTFDocumentImpl
::
Pointer_t
pImpl
(
new
RTFDocumentImpl
(
m_xContext
,
m_xInputStream
,
m_xDstDoc
,
m_xFrame
));
RTFDocumentImpl
::
Pointer_t
pImpl
(
new
RTFDocumentImpl
(
m_xContext
,
m_xInputStream
,
m_xDstDoc
,
m_xFrame
,
m_xStatusIndicator
));
pImpl
->
setSubstream
(
true
);
pImpl
->
setSubstream
(
true
);
pImpl
->
setIgnoreFirst
(
rIgnoreFirst
);
pImpl
->
setIgnoreFirst
(
rIgnoreFirst
);
if
(
m_aAuthor
.
getLength
())
if
(
m_aAuthor
.
getLength
())
...
...
writerfilter/source/rtftok/rtfdocumentimpl.hxx
Dosyayı görüntüle @
92c7b673
...
@@ -288,7 +288,8 @@ namespace writerfilter {
...
@@ -288,7 +288,8 @@ namespace writerfilter {
RTFDocumentImpl
(
uno
::
Reference
<
uno
::
XComponentContext
>
const
&
xContext
,
RTFDocumentImpl
(
uno
::
Reference
<
uno
::
XComponentContext
>
const
&
xContext
,
uno
::
Reference
<
io
::
XInputStream
>
const
&
xInputStream
,
uno
::
Reference
<
io
::
XInputStream
>
const
&
xInputStream
,
uno
::
Reference
<
lang
::
XComponent
>
const
&
xDstDoc
,
uno
::
Reference
<
lang
::
XComponent
>
const
&
xDstDoc
,
uno
::
Reference
<
frame
::
XFrame
>
const
&
xFrame
);
uno
::
Reference
<
frame
::
XFrame
>
const
&
xFrame
,
uno
::
Reference
<
task
::
XStatusIndicator
>
const
&
xStatusIndicator
);
virtual
~
RTFDocumentImpl
();
virtual
~
RTFDocumentImpl
();
virtual
void
resolve
(
Stream
&
rHandler
);
virtual
void
resolve
(
Stream
&
rHandler
);
virtual
std
::
string
getType
()
const
;
virtual
std
::
string
getType
()
const
;
...
@@ -351,6 +352,7 @@ namespace writerfilter {
...
@@ -351,6 +352,7 @@ namespace writerfilter {
uno
::
Reference
<
io
::
XInputStream
>
const
&
m_xInputStream
;
uno
::
Reference
<
io
::
XInputStream
>
const
&
m_xInputStream
;
uno
::
Reference
<
lang
::
XComponent
>
const
&
m_xDstDoc
;
uno
::
Reference
<
lang
::
XComponent
>
const
&
m_xDstDoc
;
uno
::
Reference
<
frame
::
XFrame
>
const
&
m_xFrame
;
uno
::
Reference
<
frame
::
XFrame
>
const
&
m_xFrame
;
uno
::
Reference
<
task
::
XStatusIndicator
>
const
&
m_xStatusIndicator
;
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
m_xModelFactory
;
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
m_xModelFactory
;
uno
::
Reference
<
document
::
XDocumentProperties
>
m_xDocumentProperties
;
uno
::
Reference
<
document
::
XDocumentProperties
>
m_xDocumentProperties
;
boost
::
shared_ptr
<
SvStream
>
m_pInStream
;
boost
::
shared_ptr
<
SvStream
>
m_pInStream
;
...
...
writerfilter/source/rtftok/rtftokenizer.cxx
Dosyayı görüntüle @
92c7b673
...
@@ -26,6 +26,9 @@
...
@@ -26,6 +26,9 @@
*/
*/
#include <tools/stream.hxx>
#include <tools/stream.hxx>
#include <tools/resmgr.hxx>
#include <svx/dialogs.hrc>
#include <vcl/svapp.hxx>
#include <rtftokenizer.hxx>
#include <rtftokenizer.hxx>
#include <rtfskipdestination.hxx>
#include <rtfskipdestination.hxx>
...
@@ -39,9 +42,10 @@ using rtl::OUStringToOString;
...
@@ -39,9 +42,10 @@ using rtl::OUStringToOString;
namespace
writerfilter
{
namespace
writerfilter
{
namespace
rtftok
{
namespace
rtftok
{
RTFTokenizer
::
RTFTokenizer
(
RTFDocumentImpl
&
rImport
,
SvStream
*
pInStream
)
RTFTokenizer
::
RTFTokenizer
(
RTFDocumentImpl
&
rImport
,
SvStream
*
pInStream
,
uno
::
Reference
<
task
::
XStatusIndicator
>
const
&
xStatusIndicator
)
:
m_rImport
(
rImport
),
:
m_rImport
(
rImport
),
m_pInStream
(
pInStream
)
m_pInStream
(
pInStream
),
m_xStatusIndicator
(
xStatusIndicator
)
{
{
}
}
...
@@ -61,10 +65,32 @@ int RTFTokenizer::resolveParse()
...
@@ -61,10 +65,32 @@ int RTFTokenizer::resolveParse()
int
ret
;
int
ret
;
// for hex chars
// for hex chars
int
b
=
0
,
count
=
2
;
int
b
=
0
,
count
=
2
;
sal_uInt32
nPercentSize
;
sal_uInt32
nLastPos
;
if
(
m_xStatusIndicator
.
is
())
{
static
ResMgr
*
pResMgr
=
ResMgr
::
CreateResMgr
(
"svx"
,
Application
::
GetSettings
().
GetUILocale
());
OUString
sDocLoad
(
ResId
::
toString
(
ResId
(
RID_SVXSTR_DOC_LOAD
,
*
pResMgr
)));
sal_uInt32
nCurrentPos
=
Strm
().
Tell
();
Strm
().
Seek
(
STREAM_SEEK_TO_END
);
sal_uInt32
nEndPos
=
Strm
().
Tell
();
Strm
().
Seek
(
nCurrentPos
);
m_xStatusIndicator
->
start
(
sDocLoad
,
nEndPos
);
nPercentSize
=
nEndPos
/
100
;
m_xStatusIndicator
->
setValue
(
nLastPos
=
nCurrentPos
);
}
while
((
Strm
()
>>
ch
,
!
Strm
().
IsEof
()))
while
((
Strm
()
>>
ch
,
!
Strm
().
IsEof
()))
{
{
//SAL_INFO("writerfilter", OSL_THIS_FUNC << ": parsing character '" << ch << "'");
//SAL_INFO("writerfilter", OSL_THIS_FUNC << ": parsing character '" << ch << "'");
sal_uInt32
nCurrentPos
=
Strm
().
Tell
();
if
(
m_xStatusIndicator
.
is
()
&&
nCurrentPos
>
(
nLastPos
+
nPercentSize
))
m_xStatusIndicator
->
setValue
(
nLastPos
=
nCurrentPos
);
if
(
m_rImport
.
getGroup
()
<
0
)
if
(
m_rImport
.
getGroup
()
<
0
)
return
ERROR_GROUP_UNDER
;
return
ERROR_GROUP_UNDER
;
if
(
!
m_rImport
.
isEmpty
()
&&
m_rImport
.
getState
().
nInternalState
==
INTERNAL_BIN
)
if
(
!
m_rImport
.
isEmpty
()
&&
m_rImport
.
getState
().
nInternalState
==
INTERNAL_BIN
)
...
...
writerfilter/source/rtftok/rtftokenizer.hxx
Dosyayı görüntüle @
92c7b673
...
@@ -38,7 +38,7 @@ namespace writerfilter {
...
@@ -38,7 +38,7 @@ namespace writerfilter {
class
RTFTokenizer
class
RTFTokenizer
{
{
public
:
public
:
RTFTokenizer
(
RTFDocumentImpl
&
rImport
,
SvStream
*
pInStream
);
RTFTokenizer
(
RTFDocumentImpl
&
rImport
,
SvStream
*
pInStream
,
uno
::
Reference
<
task
::
XStatusIndicator
>
const
&
xStatusIndicator
);
virtual
~
RTFTokenizer
();
virtual
~
RTFTokenizer
();
int
resolveParse
();
int
resolveParse
();
...
@@ -50,6 +50,7 @@ namespace writerfilter {
...
@@ -50,6 +50,7 @@ namespace writerfilter {
RTFDocumentImpl
&
m_rImport
;
RTFDocumentImpl
&
m_rImport
;
SvStream
*
m_pInStream
;
SvStream
*
m_pInStream
;
uno
::
Reference
<
task
::
XStatusIndicator
>
const
&
m_xStatusIndicator
;
};
};
}
// namespace rtftok
}
// namespace rtftok
}
// namespace writerfilter
}
// namespace writerfilter
...
...
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