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
7f6611ab
Commit
7f6611ab
authored
Dec 23, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
..
parent
bb37e348
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
27 deletions
+30
-27
Common/DocxFormat/Source/XlsxFormat/Comments/Comments.h
Common/DocxFormat/Source/XlsxFormat/Comments/Comments.h
+12
-12
Common/DocxFormat/Source/XlsxFormat/Worksheets/Worksheet.h
Common/DocxFormat/Source/XlsxFormat/Worksheets/Worksheet.h
+7
-7
XlsxSerializerCom/Writer/BinaryReader.h
XlsxSerializerCom/Writer/BinaryReader.h
+11
-8
No files found.
Common/DocxFormat/Source/XlsxFormat/Comments/Comments.h
View file @
7f6611ab
...
...
@@ -38,7 +38,7 @@
#include "../../DocxFormat/IFileContainer.h"
#include <map>
#include <
unordered_
map>
namespace
OOX
{
...
...
@@ -74,7 +74,7 @@ namespace OOX
return
m_nRow
.
IsInit
()
&&
m_nCol
.
IsInit
()
&&
m_sAuthor
.
IsInit
();
}
};
class
CAuthors
:
public
WritingElement
WithChilds
<
std
::
wstring
>
class
CAuthors
:
public
WritingElement
{
public:
WritingElement_AdditionConstructors
(
CAuthors
)
...
...
@@ -87,7 +87,7 @@ namespace OOX
}
virtual
void
ClearItems
()
{
m_
arr
Items
.
clear
();
m_
map
Items
.
clear
();
}
virtual
void
fromXML
(
XmlUtils
::
CXmlNode
&
node
)
{
...
...
@@ -100,14 +100,11 @@ namespace OOX
{
writer
.
WriteString
(
L"<authors>"
);
for
(
SpreadsheetElemArray
::
const_iterator
it
=
m_arrItems
.
begin
();
it
!=
m_arr
Items
.
end
();
it
++
)
for
(
std
::
unordered_map
<
int
,
std
::
wstring
>::
const_iterator
it
=
m_mapItems
.
begin
();
it
!=
m_map
Items
.
end
();
it
++
)
{
if
(
*
it
)
{
writer
.
WriteString
(
L"<author>"
);
writer
.
WriteEncodeXmlString
(
*
(
*
it
));
writer
.
WriteString
(
L"</author>"
);
}
writer
.
WriteString
(
L"<author>"
);
writer
.
WriteEncodeXmlString
(
it
->
second
);
writer
.
WriteString
(
L"</author>"
);
}
writer
.
WriteString
(
L"</authors>"
);
}
...
...
@@ -118,6 +115,8 @@ namespace OOX
if
(
oReader
.
IsEmptyNode
()
)
return
;
int
index
=
0
;
int
nCurDepth
=
oReader
.
GetDepth
();
while
(
oReader
.
ReadNextSiblingNode
(
nCurDepth
)
)
{
...
...
@@ -125,8 +124,7 @@ namespace OOX
if
(
L"author"
==
sName
)
{
std
::
wstring
*
str
=
new
std
::
wstring
(
oReader
.
GetText3
());
m_arrItems
.
push_back
(
str
);
m_mapItems
.
insert
(
std
::
make_pair
(
index
++
,
oReader
.
GetText3
()));
}
}
}
...
...
@@ -140,6 +138,8 @@ namespace OOX
void
ReadAttributes
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
{
}
public:
std
::
unordered_map
<
int
,
std
::
wstring
>
m_mapItems
;
};
class
CComment
:
public
WritingElement
{
...
...
Common/DocxFormat/Source/XlsxFormat/Worksheets/Worksheet.h
View file @
7f6611ab
...
...
@@ -189,7 +189,7 @@ namespace OOX
}
void
PrepareComments
(
OOX
::
Spreadsheet
::
CComments
*
pComments
,
OOX
::
CVmlDrawing
*
pVmlDrawing
)
{
std
::
list
<
std
::
wstring
*>
&
aAuthors
=
pComments
->
m_oAuthors
->
m_arr
Items
;
std
::
unordered_map
<
int
,
std
::
wstring
>
&
mapAuthors
=
pComments
->
m_oAuthors
->
m_map
Items
;
if
(
pComments
->
m_oCommentList
.
IsInit
())
{
...
...
@@ -212,12 +212,12 @@ namespace OOX
unsigned
int
nAuthorId
=
pComment
->
m_oAuthorId
->
GetValue
();
std
::
list
<
std
::
wstring
*>::
iterator
itA
=
aAuthors
.
begin
(
);
for
(
int
a
=
0
;
a
<
nAuthorId
;
a
++
)
itA
++
;
if
(
itA
!=
aAuthors
.
end
())
pCommentItem
->
m_sAuthor
=
*
itA
;
std
::
unordered_map
<
int
,
std
::
wstring
>::
iterator
pFind
=
mapAuthors
.
find
(
nAuthorId
);
if
(
pFind
!=
mapAuthors
.
end
())
{
pCommentItem
->
m_sAuthor
=
pFind
->
second
;
}
OOX
::
Spreadsheet
::
CSi
*
pSi
=
pComment
->
m_oText
.
GetPointerEmptyNullable
();
if
(
NULL
!=
pSi
)
...
...
XlsxSerializerCom/Writer/BinaryReader.h
View file @
7f6611ab
...
...
@@ -2535,14 +2535,14 @@ namespace BinXlsxRW {
{
m_pCurVmlDrawing
->
m_mapComments
=
&
m_pCurWorksheet
->
m_mapComments
;
std
::
map
<
std
::
wstring
,
unsigned
int
>
mapAuthors
;
std
::
map
<
std
::
wstring
,
unsigned
int
>
map
By
Authors
;
OOX
::
Spreadsheet
::
CComments
*
pComments
=
new
OOX
::
Spreadsheet
::
CComments
();
pComments
->
m_oCommentList
.
Init
();
std
::
list
<
OOX
::
Spreadsheet
::
CComment
*>&
aComments
=
pComments
->
m_oCommentList
->
m_arrItems
;
pComments
->
m_oAuthors
.
Init
();
std
::
list
<
std
::
wstring
*>&
aAuthors
=
pComments
->
m_oAuthors
->
m_arr
Items
;
std
::
unordered_map
<
int
,
std
::
wstring
>
&
mapByIndex
=
pComments
->
m_oAuthors
->
m_map
Items
;
for
(
std
::
map
<
std
::
wstring
,
OOX
::
Spreadsheet
::
CCommentItem
*>::
const_iterator
it
=
m_pCurWorksheet
->
m_mapComments
.
begin
();
it
!=
m_pCurWorksheet
->
m_mapComments
.
end
();
++
it
)
{
...
...
@@ -2559,15 +2559,18 @@ namespace BinXlsxRW {
if
(
pCommentItem
->
m_sAuthor
.
IsInit
())
{
const
std
::
wstring
&
sAuthor
=
pCommentItem
->
m_sAuthor
.
get
();
std
::
map
<
std
::
wstring
,
unsigned
int
>::
const_iterator
pair
=
mapAuthors
.
find
(
sAuthor
);
std
::
map
<
std
::
wstring
,
unsigned
int
>::
const_iterator
pFind
=
mapByAuthors
.
find
(
sAuthor
);
int
nAuthorId
;
if
(
mapAuthors
.
end
()
!=
pair
)
nAuthorId
=
(
int
)
pair
->
second
;
if
(
pFind
!=
mapByAuthors
.
end
()
)
nAuthorId
=
pFind
->
second
;
else
{
nAuthorId
=
(
int
)
mapAuthors
.
size
();
mapAuthors
[
sAuthor
]
=
nAuthorId
;
aAuthors
.
push_back
(
new
std
::
wstring
(
sAuthor
));
nAuthorId
=
(
int
)
mapByAuthors
.
size
();
mapByAuthors
.
insert
(
std
::
make_pair
(
sAuthor
,
nAuthorId
));
mapByIndex
.
insert
(
std
::
make_pair
(
nAuthorId
,
sAuthor
));
}
pNewComment
->
m_oAuthorId
.
Init
();
pNewComment
->
m_oAuthorId
->
SetValue
(
nAuthorId
);
...
...
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