Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
7eee0755
Commit
7eee0755
authored
Feb 16, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RtfFormatReader - generate replacement text hyperlink if absent
parent
c329f29e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
28 deletions
+51
-28
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
+51
-28
No files found.
ASCOfficeRtfFile/RtfFormatLib/source/DestinationCommand.h
View file @
7eee0755
...
@@ -1381,10 +1381,20 @@ private:
...
@@ -1381,10 +1381,20 @@ private:
std
::
vector
<
std
::
wstring
>
arResult
;
std
::
vector
<
std
::
wstring
>
arResult
;
boost
::
algorithm
::
split
(
arResult
,
sField
,
boost
::
algorithm
::
is_any_of
(
L"
\"
"
),
boost
::
algorithm
::
token_compress_on
);
boost
::
algorithm
::
split
(
arResult
,
sField
,
boost
::
algorithm
::
is_any_of
(
L"
\"
"
),
boost
::
algorithm
::
token_compress_on
);
if
(
arResult
.
size
()
<
1
)
while
(
!
arResult
.
empty
())
{
if
(
arResult
[
0
].
empty
())
arResult
.
erase
(
arResult
.
begin
(),
arResult
.
begin
()
+
1
);
else
break
;
}
if
(
arResult
.
empty
())
return
;
return
;
if
(
L"SYMBOL"
!=
arResult
[
0
])
if
(
L"SYMBOL"
!=
arResult
[
0
]
&&
L"HYPERLINK"
!=
arResult
[
0
])
return
;
return
;
nStartTokenize
=
arResult
[
0
].
length
();
nStartTokenize
=
arResult
[
0
].
length
();
for
(
size_t
i
=
1
;
i
<
arResult
.
size
();
i
++
)
for
(
size_t
i
=
1
;
i
<
arResult
.
size
();
i
++
)
...
@@ -1429,9 +1439,11 @@ private:
...
@@ -1429,9 +1439,11 @@ private:
nStartTokenize
+=
(
int
)
sResTokenize
.
length
();
nStartTokenize
+=
(
int
)
sResTokenize
.
length
();
}
}
if
(
L""
==
sCharCode
||
L""
==
sCharFont
)
return
;
std
::
wstring
sResult
;
if
(
L"SYMBOL"
==
arResult
[
0
])
{
if
(
L""
==
sCharCode
||
L""
==
sCharFont
)
return
;
int
nCharCode
=
Strings
::
ToInteger
(
sCharCode
);
int
nCharCode
=
Strings
::
ToInteger
(
sCharCode
);
std
::
string
sCharA
;
sCharA
+=
char
(
nCharCode
);
std
::
string
sCharA
;
sCharA
+=
char
(
nCharCode
);
...
@@ -1450,20 +1462,31 @@ private:
...
@@ -1450,20 +1462,31 @@ private:
int
nSkipChar
=
0
;
int
nSkipChar
=
0
;
RtfAbstractReader
reader
;
RtfAbstractReader
reader
;
sResult
=
reader
.
ExecuteTextInternal
(
oDocument
,
oReader
,
sCharA
,
false
,
0
,
nSkipChar
);
}
else
if
(
L"HYPERLINK"
==
arResult
[
0
])
{
sResult
=
sCharCode
;
}
std
::
wstring
sResultSymbol
=
reader
.
ExecuteTextInternal
(
oDocument
,
oReader
,
sCharA
,
false
,
0
,
nSkipChar
)
;
if
(
sResult
.
empty
())
return
;
//свойства копировать ? ващето есть дубль - проверить
m_oField
.
m_p
Result
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
RtfFieldInstPtr
new
Result
=
RtfFieldInstPtr
(
new
RtfFieldInst
()
);
m_oField
.
m_p
Result
->
SetDefault
();
new
Result
->
SetDefault
();
RtfParagraphPtr
pNewPar
(
new
RtfParagraph
()
);
RtfParagraphPtr
pNewPar
(
new
RtfParagraph
()
);
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
RtfCharPtr
pNewChar
(
new
RtfChar
()
);
pNewChar
->
setText
(
sResult
Symbol
);
pNewChar
->
setText
(
sResult
);
pNewChar
->
m_oProperty
=
oReader
.
m_oState
->
m_oCharProp
;
pNewChar
->
m_oProperty
=
m_oField
.
m_pResult
->
m_oCharProperty
;
pNewPar
->
AddItem
(
pNewChar
);
pNewPar
->
AddItem
(
pNewChar
);
m_oField
.
m_pResult
->
m_pTextItems
->
AddItem
(
pNewPar
);
newResult
->
m_pTextItems
->
AddItem
(
pNewPar
);
newResult
->
m_oCharProperty
=
m_oField
.
m_pResult
->
m_oCharProperty
;
m_oField
.
m_pResult
=
newResult
;
if
(
L"SYMBOL"
==
arResult
[
0
])
m_oField
.
m_bTextOnly
=
true
;
m_oField
.
m_bTextOnly
=
true
;
}
}
};
};
...
...
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