Fix build

This commit is contained in:
oleg.korshul@onlyoffice.com
2020-09-04 10:02:10 +03:00
parent 3b25bc5e45
commit f5d5dd00d2
10 changed files with 50 additions and 53 deletions

View File

@ -2,9 +2,9 @@
#include <cctype>
#include <vector>
#include <codecvt>
#include <iostream>
#include "../../../../../DesktopEditor/common/File.h"
namespace NSCSS
{
@ -162,9 +162,7 @@ namespace NSCSS
std::string CCompiledStyle::GetStyle() const
{
std::wstring sStyle = GetStyleW();
std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
return converter.to_bytes(sStyle);
return U_TO_UTF8(sStyle);
}
const size_t& CCompiledStyle::GetSize() const

View File

@ -1938,20 +1938,16 @@ inline static std::wstring ConvertAbsoluteValue(const std::wstring& sAbsoluteVal
return sNewValue;
}
inline static std::wstring DeleteSpace(const std::wstring& sValue)
inline std::wstring DeleteSpace(const std::wstring& sValue)
{
std::wstring sNewValue = sValue;
while (sNewValue.length() > 0 && iswspace(sNewValue[0]))
sNewValue.erase(0, 1);
while (sNewValue.length() > 0 && iswspace(sNewValue[sNewValue.length() - 1]))
sNewValue.erase(sNewValue.length() - 1, 1);
return sNewValue;
size_t start = sValue.find_first_not_of(L" \n\r\t\f\v");
if (std::wstring::npos == start)
return L"";
size_t end = sValue.find_first_not_of(L" \n\r\t\f\v"); // точно >=0
return sValue.substr(start, end - start + 1);
}
inline static std::vector<std::string> GetSelectorsList(const std::wstring& sSelectors)
inline std::vector<std::string> GetSelectorsList(const std::wstring& sSelectors)
{
std::vector<std::string> arSelectors;
@ -2035,7 +2031,7 @@ inline static std::vector<std::string> GetSelectorsList(const std::wstring& sSel
return arSelectors;
}
inline static std::vector<std::string> GetWords(const std::wstring& sLine)
inline std::vector<std::string> GetWords(const std::wstring& sLine)
{
std::vector<std::string> arWords;
std::wstring sTempWord;

View File

@ -1,5 +1,6 @@
#include "CElement.h"
#include <iostream>
#include <algorithm>
CElement::CElement()
{

View File

@ -2,6 +2,7 @@
#define CELEMENT_H
#include <vector>
#include <string>
class CElement
{

View File

@ -2,6 +2,7 @@
#include <algorithm>
#include <vector>
#include <cwctype>
bool IsDigit(std::wstring sValue)

View File

@ -1,6 +1,7 @@
INCLUDEPATH += $$PWD
DEPENDPATH += $$PWD
core_linux:QMAKE_CFLAGS += -std=c99
core_windows:INCLUDEPATH += $$PWD/gumbo-parser/visualc/include
HEADERS += $$files($$PWD/gumbo-parser/src/*.h, true) \

View File

@ -12,7 +12,40 @@
#define HTMLFILE2_DECL_EXPORT Q_DECL_EXPORT
#endif
struct CHtmlParams;
struct CHtmlParams
{
std::wstring m_sGenres; // Жанры
std::wstring m_sAuthors; // Авторы
std::wstring m_sBookTitle; // Название
std::wstring m_sDate; // Дата
std::wstring m_sDescription; // описание
void SetDate(const std::wstring& sDate)
{
m_sDate = sDate;
}
void SetDescription(const std::wstring& sDescription)
{
m_sDescription = sDescription;
}
void SetGenres(const std::wstring& sGenres)
{
m_sGenres = sGenres;
}
void SetAuthors(const std::wstring& sAuthors)
{
m_sAuthors = sAuthors;
}
void SetTitle(const std::wstring& sTitle)
{
m_sBookTitle = sTitle;
}
};
class CHtmlFile2_Private;
class HTMLFILE2_DECL_EXPORT CHtmlFile2
{

View File

@ -24,6 +24,7 @@
#include "../DesktopEditor/raster/BgraFrame.h"
#include "../DesktopEditor/graphics/pro/Fonts.h"
#include "../DesktopEditor/graphics/pro/Graphics.h"
#include "htmlfile2.h"
#ifndef VALUE2STR
#define VALUE_TO_STRING(x) #x
@ -60,40 +61,6 @@ struct CTextSettings
CTextSettings(const CTextSettings& oTS) : bBdo(oTS.bBdo), bPre(oTS.bPre), nLi(oTS.nLi), sRStyle(oTS.sRStyle), sPStyle(oTS.sPStyle) {}
};
struct CHtmlParams
{
std::wstring m_sGenres; // Жанры
std::wstring m_sAuthors; // Авторы
std::wstring m_sBookTitle; // Название
std::wstring m_sDate; // Дата
std::wstring m_sDescription; // описание
void SetDate(const std::wstring& sDate)
{
m_sDate = sDate;
}
void SetDescription(const std::wstring& sDescription)
{
m_sDescription = sDescription;
}
void SetGenres(const std::wstring& sGenres)
{
m_sGenres = sGenres;
}
void SetAuthors(const std::wstring& sAuthors)
{
m_sAuthors = sAuthors;
}
void SetTitle(const std::wstring& sTitle)
{
m_sBookTitle = sTitle;
}
};
class CHtmlFile2_Private
{
public:

View File

@ -2,7 +2,6 @@
#include <vector>
#include "../htmlfile2.h"
#include "../mhtfile.h"
#include "../htmlfile_private.h"
#include "../../DesktopEditor/common/File.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../../OfficeUtils/src/OfficeUtils.h"

View File

@ -17,6 +17,6 @@ include($$CORE_ROOT_DIR/Common/base.pri)
core_linux:include($$CORE_ROOT_DIR/Common/3dParty/icu/icu.pri)
ADD_DEPENDENCY(kernel, HtmlFile2)
ADD_DEPENDENCY(kernel, UnicodeConverter, graphics, HtmlFile2)
DESTDIR = $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX