Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
81507a3b
Commit
81507a3b
authored
Jul 18, 2013
by
Didier Clerc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolved html pasting issues from 3rd party rich text editor
parent
712bd523
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+4
-2
core.pri
src/core/core.pri
+4
-2
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+2
-1
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
81507a3b
...
...
@@ -62,6 +62,7 @@
#include "core/UBSetting.h"
#include "core/UBPersistenceManager.h"
#include "core/UBApplication.h"
#include "core/UBTextTools.h"
#include "document/UBDocumentContainer.h"
...
...
@@ -301,7 +302,7 @@ QUuid UBSvgSubsetAdaptor::sceneUuid(UBDocumentProxy* proxy, const int pageIndex)
UBGraphicsScene
*
UBSvgSubsetAdaptor
::
loadScene
(
UBDocumentProxy
*
proxy
,
const
QByteArray
&
pArray
)
{
UBSvgSubsetReader
reader
(
proxy
,
pArray
);
UBSvgSubsetReader
reader
(
proxy
,
UBTextTools
::
cleanHtmlCData
(
QString
(
pArray
)).
toAscii
()
);
return
reader
.
loadScene
();
}
...
...
@@ -2457,7 +2458,8 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::textItemToSvg(UBGraphicsTextItem* it
// Note: don't use mXmlWriter.writeCDATA(htmlString); because it doesn't escape characters sequences correctly.
// Texts copied from other programs like Open-Office can truncate the svg file.
mXmlWriter
.
writeCharacters
(
item
->
toHtml
());
//mXmlWriter.writeCharacters(item->toHtml());
mXmlWriter
.
writeCharacters
(
UBTextTools
::
cleanHtmlCData
(
item
->
toHtml
()));
mXmlWriter
.
writeEndElement
();
//itemTextContent
mXmlWriter
.
writeEndElement
();
//foreignObject
...
...
src/core/core.pri
View file @
81507a3b
...
...
@@ -13,7 +13,8 @@ HEADERS += src/core/UB.h \
src/core/UBApplicationController.h \
src/core/UBDownloadManager.h \
src/core/UBDownloadThread.h \
src/core/UBOpenSankoreImporter.h
src/core/UBOpenSankoreImporter.h \
src/core/UBTextTools.h
SOURCES += src/core/main.cpp \
src/core/UBApplication.cpp \
...
...
@@ -29,6 +30,7 @@ SOURCES += src/core/main.cpp \
src/core/UBApplicationController.cpp \
src/core/UBDownloadManager.cpp \
src/core/UBDownloadThread.cpp \
src/core/UBOpenSankoreImporter.cpp
src/core/UBOpenSankoreImporter.cpp \
src/core/UBTextTools.cpp
src/domain/UBGraphicsScene.cpp
View file @
81507a3b
...
...
@@ -36,6 +36,7 @@
#include "core/UBApplicationController.h"
#include "core/UBDisplayManager.h"
#include "core/UBPersistenceManager.h"
#include "core/UBTextTools.h"
#include "gui/UBMagnifer.h"
#include "gui/UBMainWindow.h"
...
...
@@ -1629,7 +1630,7 @@ UBGraphicsTextItem *UBGraphicsScene::addTextHtml(const QString &pString, const Q
{
UBGraphicsTextItem
*
textItem
=
new
UBGraphicsTextItem
();
textItem
->
setPlainText
(
""
);
textItem
->
setHtml
(
pString
);
textItem
->
setHtml
(
UBTextTools
::
cleanHtml
(
pString
)
);
addItem
(
textItem
);
textItem
->
show
();
...
...
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