Compare commits

..

6 Commits

Author SHA1 Message Date
2f2236646d Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  OdfFormatReader - data validation (type dropdown list)
  no squares
  fix previous commit
  font by symbol table
2018-01-26 17:08:57 +03:00
30603d0561 build fixed 2018-01-26 17:08:51 +03:00
933af771b7 OdfFormatReader - data validation (type dropdown list) 2018-01-26 14:45:24 +03:00
c04a537d69 no squares 2018-01-26 13:55:24 +03:00
e49d78db47 fix previous commit 2018-01-26 11:39:56 +03:00
99ec420ee5 font by symbol table 2018-01-26 11:36:19 +03:00
23 changed files with 1051 additions and 620 deletions

View File

@ -288,6 +288,7 @@ SOURCES += \
../src/docx/xlsx_table_state.cpp \
../src/docx/xlsx_textcontext.cpp \
../src/docx/xlsx_pivots_context.cpp \
../src/docx/xlsx_data_validation.cpp \
../src/docx/xlsx_utils.cpp \
../src/docx/xlsx_xf.cpp
}
@ -551,6 +552,7 @@ HEADERS += \
../src/docx/xlsx_table_position.h \
../src/docx/xlsx_table_state.h \
../src/docx/xlsx_textcontext.h \
../src/docx/xlsx_data_validation.h \
../src/docx/xlsx_utils.h \
../src/docx/xlsx_xf.h \
../include/logging.h \

View File

@ -101,3 +101,4 @@
#include "../src/docx/xlsx_utils.cpp"
#include "../src/docx/xlsx_xf.cpp"
#include "../src/docx/xlsx_pivots_context.cpp"
#include "../src/docx/xlsx_data_validation.cpp""

View File

@ -116,7 +116,7 @@ public:
int priority = 1;
CP_XML_WRITER(_Wostream)
{
for (int i = 0 ; i < conditionalFormattings_.size(); i++)
for (size_t i = 0 ; i < conditionalFormattings_.size(); i++)
{
conditionalFormatting & c = conditionalFormattings_[i];
@ -126,7 +126,7 @@ public:
{
CP_XML_ATTR(L"sqref", c.ref);
for (int j = 0 ; j < c.rules.size(); j++)
for (size_t j = 0 ; j < c.rules.size(); j++)
{
if (c.rules[j].type < 1 || c.rules[j].type > 5) continue;
@ -171,7 +171,7 @@ public:
if (c.rules[j].minLength) CP_XML_ATTR(L"minLength", *c.rules[j].minLength);
if (c.rules[j].maxLength) CP_XML_ATTR(L"maxLength", *c.rules[j].maxLength);
for (int k = 0; k < c.rules[j].cfvo.size(); k++)
for (size_t k = 0; k < c.rules[j].cfvo.size(); k++)
{
c.rules[j].cfvo[k].serialize(CP_XML_STREAM());
}
@ -189,11 +189,11 @@ public:
CP_XML_ATTR(L"type", L"colorScale");
CP_XML_NODE(L"colorScale")
{
for (int k = 0; k < c.rules[j].cfvo.size(); k++)
for (size_t k = 0; k < c.rules[j].cfvo.size(); k++)
{
c.rules[j].cfvo[k].serialize(CP_XML_STREAM());
}
for (int k = 0; k < c.rules[j].color.size(); k++)
for (size_t k = 0; k < c.rules[j].color.size(); k++)
{
CP_XML_NODE(L"color")
{
@ -209,7 +209,7 @@ public:
{
if (c.rules[j].showValue) CP_XML_ATTR(L"showValue", *c.rules[j].showValue);
for (int k = 0; k < c.rules[j].cfvo.size(); k++)
for (size_t k = 0; k < c.rules[j].cfvo.size(); k++)
{
c.rules[j].cfvo[k].serialize(CP_XML_STREAM());
}

View File

@ -0,0 +1,186 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "xlsx_data_validation.h"
#include "xlsx_utils.h"
#include <vector>
#include <map>
#include <cpdoccore/xml/simple_xml_writer.h>
#include <cpdoccore/CPSharedPtr.h>
#include "../formulasconvert/formulasconvert.h"
#include "../../../Common/DocxFormat/Source/XML/Utils.h"
namespace cpdoccore {
namespace oox {
class xlsx_dataValidation
{
public:
xlsx_dataValidation() {}
std::wstring ref;
std::wstring activate_ref;
std::wstring type;
std::wstring formula1;
std::wstring formula2;
};
typedef shared_ptr<xlsx_dataValidation>::Type xlsx_dataValidation_ptr;
class xlsx_dataValidations_context::Impl
{
public:
void serialize(std::wostream & _Wostream)
{
if (mapActivateDataValidations.empty()) return;
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE(L"dataValidations")
{
CP_XML_ATTR(L"count", mapActivateDataValidations.size());
for (std::map<std::wstring, xlsx_dataValidation_ptr>::iterator it = mapActivateDataValidations.begin();
it != mapActivateDataValidations.end(); ++it)
{
CP_XML_NODE(L"dataValidation")
{
CP_XML_ATTR(L"sqref", it->second->activate_ref);
CP_XML_ATTR(L"type", it->second->type);
if (!it->second->formula1.empty())
{
CP_XML_NODE(L"formula1")
{
CP_XML_STREAM() << it->second->formula1;
}
}
if (!it->second->formula2.empty())
{
CP_XML_NODE(L"formula2")
{
CP_XML_STREAM() << it->second->formula2;
}
}
}
}
}
}
mapActivateDataValidations.clear();
}
std::map<std::wstring, xlsx_dataValidation_ptr> mapDataValidations; //for all tables
std::map<std::wstring, xlsx_dataValidation_ptr> mapActivateDataValidations; //in current table
};
xlsx_dataValidations_context::xlsx_dataValidations_context() :
impl_(new xlsx_dataValidations_context::Impl())
{}
xlsx_dataValidations_context::~xlsx_dataValidations_context()
{
}
void xlsx_dataValidations_context::serialize(std::wostream & _Wostream)
{
return impl_->serialize(_Wostream);
}
void xlsx_dataValidations_context::activate(const std::wstring & name, const std::wstring & ref)
{
std::map<std::wstring, xlsx_dataValidation_ptr>::iterator pFindActivate = impl_->mapActivateDataValidations.find(name);
if (pFindActivate != impl_->mapActivateDataValidations.end())
{
pFindActivate->second->activate_ref += L" " + ref;
}
else
{
std::map<std::wstring, xlsx_dataValidation_ptr>::iterator pFind = impl_->mapDataValidations.find(name);
if (pFind != impl_->mapDataValidations.end())
{
pFind->second->activate_ref = ref;
impl_->mapActivateDataValidations.insert(std::make_pair(name, pFind->second));
}
}
}
void xlsx_dataValidations_context::add(const std::wstring & name, const std::wstring &ref)
{
xlsx_dataValidation_ptr _new = xlsx_dataValidation_ptr(new xlsx_dataValidation());
formulasconvert::odf2oox_converter converter;
_new->ref = converter.convert_named_ref(ref, false, L";");
impl_->mapDataValidations.insert(std::make_pair(name, _new));
}
void xlsx_dataValidations_context::add_formula(const std::wstring & name, const std::wstring & f) // todooo пооптимальней
{
std::map<std::wstring, xlsx_dataValidation_ptr>::iterator pFind = impl_->mapDataValidations.find(name);
if (pFind == impl_->mapDataValidations.end()) return;
formulasconvert::odf2oox_converter converter;
int pos = -1;
std::wstring val;
if ( 0 <= (pos = f.find(L"cell-content-is-in-list"))) //oooc: , of:
{
pFind->second->type = L"list";
val = f.substr(24 + pos, f.size() - 25 - pos);
if ( val.substr(0, 1) == L"\"")
{
XmlUtils::replace_all(val, L"\"", L"");
pFind->second->formula1 = converter.convert(val);
if ( std::wstring::npos != val.find(L";") )//convert formula replacing ; on ,
{
pFind->second->formula1 = L"\"" + pFind->second->formula1 + L"\"";
}
}
else
{
pFind->second->formula1 = converter.convert(val);
}
}
}
}
}

View File

@ -0,0 +1,59 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/CPScopedPtr.h>
#include <string>
namespace cpdoccore {
namespace oox {
class xlsx_dataValidations_context
{
public:
xlsx_dataValidations_context();
~xlsx_dataValidations_context();
void add(const std::wstring & name, const std::wstring & ref);
void add_formula(const std::wstring & name, const std::wstring & f);
void activate(const std::wstring & name, const std::wstring & ref);
void serialize(std::wostream & _Wostream);
private:
class Impl;
_CP_SCOPED_PTR(Impl) impl_;
};
}
}

View File

@ -54,6 +54,8 @@ public:
std::wstringstream sort_;
std::wstringstream autofilter_;
std::wstringstream conditionalFormatting_;
std::wstringstream picture_background_;
std::wstringstream dataValidations_;
std::wstringstream ole_objects_;
std::wstringstream page_props_;
@ -138,7 +140,14 @@ std::wostream & xlsx_xml_worksheet::page_properties()
{
return impl_->page_props_;
}
std::wostream & xlsx_xml_worksheet::picture_background()
{
return impl_->picture_background_;
}
std::wostream & xlsx_xml_worksheet::dataValidations()
{
return impl_->dataValidations_;
}
//---------------------------------------------------------------------------------------
rels & xlsx_xml_worksheet::sheet_rels()
{
@ -178,6 +187,7 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
CP_XML_STREAM() << impl_->conditionalFormatting_.str();
CP_XML_STREAM() << impl_->dataValidations_.str();
if (!impl_->hyperlinks_.str().empty())
{
CP_XML_NODE(L"hyperlinks")
@ -207,6 +217,7 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
CP_XML_STREAM() << impl_->ole_objects_.str();
}
}
CP_XML_STREAM() << impl_->picture_background_.str();
//CP_XML_NODE(L"headerFooter){}

View File

@ -61,6 +61,8 @@ public:
std::wostream & comments();
std::wostream & autofilter();
std::wostream & conditionalFormatting();
std::wostream & picture_background();
std::wostream & dataValidations();
std::wostream & sort();
std::wostream & ole_objects();
std::wostream & page_properties();

View File

@ -120,7 +120,7 @@ public:
xlsx_table_metrics & get_table_metrics() { return xlsx_table_metrics_; }
xlsx_drawing_context & get_drawing_context() { return xlsx_drawing_context_; }
xlsx_comments_context & get_comments_context() { return xlsx_comments_context_; }
xlsx_conditionalFormatting_context & get_conditionalFormatting_context() {return xlsx_conditionalFormatting_context_;}
xlsx_conditionalFormatting_context & get_conditionalFormatting_context() { return xlsx_conditionalFormatting_context_;}
void table_column_last_width(double w) { table_column_last_width_ = w; }
double table_column_last_width() const { return table_column_last_width_; };

View File

@ -324,6 +324,10 @@ void xlsx_table_context::serialize_background(std::wostream & _Wostream)
{
return state()->serialize_background(_Wostream);
}
void xlsx_table_context::serialize_data_validation(std::wostream & _Wostream)
{
return xlsx_conversion_context_->get_dataValidations_context().serialize(_Wostream);
}
void xlsx_table_context::serialize_hyperlinks(std::wostream & _Wostream)
{
return state()->serialize_hyperlinks(_Wostream);

View File

@ -91,6 +91,7 @@ public:
void serialize_ole_objects (std::wostream & _Wostream);
void serialize_page_properties (std::wostream & _Wostream);
void serialize_background (std::wostream & _Wostream);
void serialize_data_validation (std::wostream & _Wostream);
xlsx_table_metrics & get_table_metrics();

View File

@ -49,13 +49,6 @@
namespace cpdoccore {
namespace oox {
void removeCharsFromString( std::wstring &str, std::wstring charsToRemove )
{
for ( unsigned int i = 0; i < charsToRemove.length(); ++i )
{
str.erase( std::remove(str.begin(), str.end(), charsToRemove[i]), str.end() );
}
}
class xlsx_text_context::Impl: boost::noncopyable
{

View File

@ -437,6 +437,7 @@ void xlsx_conversion_context::end_table()
get_table_context().serialize_autofilter (current_sheet().autofilter());
get_table_context().serialize_sort (current_sheet().sort());
get_table_context().serialize_merge_cells (current_sheet().mergeCells());
get_table_context().serialize_data_validation (current_sheet().dataValidations());
get_drawing_context().set_odf_packet_path (root()->get_folder());
get_drawing_context().process_objects (get_table_metrics());
@ -717,14 +718,13 @@ void xlsx_conversion_context::end_hyperlink(std::wstring const & href)
xlsx_text_context_.end_span2();
}
}
void xlsx_conversion_context::start_content_validation(const std::wstring & name, const std::wstring & ref)
void xlsx_conversion_context::add_content_validation(const std::wstring & name, const std::wstring & ref)
{
get_dataValidations_context().add(name, ref);
}
void xlsx_conversion_context::set_content_validation_condition(const std::wstring & val)
{
}
void xlsx_conversion_context::end_content_validation()
void xlsx_conversion_context::add_content_validation_condition(const std::wstring & name, const std::wstring & val)
{
get_dataValidations_context().add_formula(name, val);
}
void xlsx_conversion_context::add_pivot_sheet_source (const std::wstring & sheet_name, int index_table_view)

View File

@ -49,6 +49,7 @@
#include "xlsx_defined_names.h"
#include "xlsx_table_metrics.h"
#include "xlsx_pivots_context.h"
#include "xlsx_data_validation.h"
#include "oox_chart_context.h"
#include "mediaitems.h"
@ -136,9 +137,8 @@ public:
void start_hyperlink (const std::wstring & styleName);
void end_hyperlink (std::wstring const & href);
void start_content_validation(const std::wstring & name, const std::wstring & ref);
void set_content_validation_condition(const std::wstring & val);
void end_content_validation();
void add_content_validation(const std::wstring & name, const std::wstring & ref);
void add_content_validation_condition(const std::wstring & name, const std::wstring & val);
//------------------------------------------------------------------------------------
void add_pivot_sheet_source (const std::wstring & sheet_name, int index_table_view);
@ -183,6 +183,7 @@ public:
xlsx_drawing_context_handle & get_drawing_context_handle();
xlsx_comments_context & get_comments_context();
xlsx_comments_context_handle & get_comments_context_handle();
xlsx_dataValidations_context& get_dataValidations_context() { return xlsx_dataValidations_context_;}
mediaitems & get_mediaitems() { return mediaitems_; }
@ -216,6 +217,7 @@ private:
xlsx_pivots_context xlsx_pivots_context_;
xlsx_drawing_context_handle xlsx_drawing_context_handle_;
xlsx_comments_context_handle xlsx_comments_context_handle_;
xlsx_dataValidations_context xlsx_dataValidations_context_;
};
}

View File

@ -92,6 +92,9 @@ void office_spreadsheet::xlsx_convert(oox::xlsx_conversion_context & Context)
if (database_ranges_)
database_ranges_->xlsx_convert(Context);
if (content_validations_)
content_validations_->xlsx_convert(Context);
if (data_pilot_tables_)
data_pilot_tables_->xlsx_convert(Context);

View File

@ -53,7 +53,7 @@ namespace odf_reader {
void removeCharsFromString( std::wstring &str, std::wstring charsToRemove )
{
for ( unsigned int i = 0; i < charsToRemove.length(); ++i )
for ( size_t i = 0; i < charsToRemove.length(); ++i )
{
str.erase( std::remove(str.begin(), str.end(), charsToRemove[i]), str.end() );
}
@ -292,14 +292,14 @@ void text_format_properties_content::pptx_convert_as_list(oox::pptx_conversion_c
w_font = font->name();
//'Arial' глючит
removeCharsFromString(w_font, _T("'"));
removeCharsFromString(w_font, L"'");
}
if (w_font.length()>0)
{
CP_XML_NODE(L"a:buFont")
{
removeCharsFromString(w_font, _T("'"));
removeCharsFromString(w_font, L"'");
CP_XML_ATTR(L"typeface", w_font);
if ((style_font_charset_))
{

View File

@ -733,29 +733,6 @@ void table_shapes::add_child_element( xml::sax * Reader, const std::wstring & Ns
const wchar_t * table_content_validations::ns = L"table";
const wchar_t * table_content_validations::name = L"content-validations";
void table_content_validations::docx_convert(oox::docx_conversion_context & Context)
{
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->docx_convert(Context);
}
}
void table_content_validations::pptx_convert(oox::pptx_conversion_context & Context)
{
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->pptx_convert(Context);
}
}
void table_content_validations::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
}
void table_content_validations::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
@ -765,33 +742,6 @@ void table_content_validations::add_child_element( xml::sax * Reader, const std:
const wchar_t * table_content_validation::ns = L"table";
const wchar_t * table_content_validation::name = L"content-validation";
void table_content_validation::docx_convert(oox::docx_conversion_context & Context)
{
//for (size_t i = 0 ; i < content_.size(); i++)
//{
// content_[i]->docx_convert(Context);
// }
}
void table_content_validation::pptx_convert(oox::pptx_conversion_context & Context)
{
//for (size_t i = 0 ; i < content_.size(); i++)
//{
// content_[i]->pptx_convert(Context);
// }
}
void table_content_validation::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.start_content_validation(table_name_.get_value_or(L""), table_base_cell_address_.get_value_or(L""));
Context.set_content_validation_condition(table_condition_.get_value_or(L""));
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
Context.end_content_validation();
}
void table_content_validation::add_attributes(xml::attributes_wc_ptr const & Attributes)
{
CP_APPLY_ATTR(L"table:name", table_name_);

View File

@ -688,9 +688,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context) ;
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ){}
@ -712,9 +710,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context) ;
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );

View File

@ -840,14 +840,20 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
if (skip_next_cell)break;
// пустые ячейки пропускаем.
// пустые ячейки пропускаем.
if ( is_data_visible || ((cellStyle || defaultColumnCellStyle) && is_style_visible))
{
CP_XML_WRITER(strm)
std::wstring ref = oox::getCellAddress(Context.current_table_column(), Context.current_table_row());
if (attlist_.table_content_validation_name_)
{
Context.get_dataValidations_context().activate(*attlist_.table_content_validation_name_, ref);
}
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"c")
{
CP_XML_ATTR(L"r", oox::getCellAddress(Context.current_table_column(), Context.current_table_row()));
CP_XML_ATTR(L"r", ref);
CP_XML_ATTR(L"t", oox::cellType2Str(t_val));
CP_XML_ATTR(L"s", xfId_last_set);
@ -890,9 +896,6 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
CP_XML_NODE(L"v") { CP_XML_CONTENT((int)(bool_val.get())); }
}
if (attlist_.table_content_validation_name_)
{
}
}
if ( is_data_visible || (cellStyle && is_style_visible && !last_cell_))
{
@ -1185,5 +1188,25 @@ void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Conte
}
}
void table_content_validations::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
}
void table_content_validation::xlsx_convert(oox::xlsx_conversion_context & Context)
{
std::wstring name = table_name_.get_value_or(L"");
Context.add_content_validation(name, table_base_cell_address_.get_value_or(L""));
Context.add_content_validation_condition(name, table_condition_.get_value_or(L""));
//for (size_t i = 0 ; i < content_.size(); i++)
//{
// content_[i]->xlsx_convert(Context);
// }
}
}
}

View File

@ -642,6 +642,14 @@
RelativePath="..\src\docx\xlsx_conditionalFormatting.h"
>
</File>
<File
RelativePath="..\src\docx\xlsx_data_validation.cpp"
>
</File>
<File
RelativePath="..\src\docx\xlsx_data_validation.h"
>
</File>
<File
RelativePath="..\src\docx\xlsx_defined_names.cpp"
>

View File

@ -36,6 +36,7 @@
#include "../graphics/GraphicsRenderer.h"
#include "../common/File.h"
#include "../graphics/Timer.h"
#include "../common/StringBuilder.h"
//#define _GENERATE_FONT_MAP_
@ -47,262 +48,6 @@ using namespace std;
namespace NSCommon
{
void string_replace(std::wstring& text, const std::wstring& replaceFrom, const std::wstring& replaceTo)
{
size_t posn = 0;
while (std::wstring::npos != (posn = text.find(replaceFrom, posn)))
{
text.replace(posn, replaceFrom.length(), replaceTo);
posn += replaceTo.length();
}
}
class CTextItem
{
protected:
wchar_t* m_pData;
size_t m_lSize;
wchar_t* m_pDataCur;
size_t m_lSizeCur;
public:
CTextItem()
{
m_pData = NULL;
m_lSize = 0;
m_pDataCur = m_pData;
m_lSizeCur = m_lSize;
}
CTextItem(const CTextItem& oSrc)
{
m_pData = NULL;
*this = oSrc;
}
CTextItem& operator=(const CTextItem& oSrc)
{
RELEASEMEM(m_pData);
m_lSize = oSrc.m_lSize;
m_lSizeCur = oSrc.m_lSizeCur;
m_pData = (wchar_t*)malloc(m_lSize * sizeof(wchar_t));
memcpy(m_pData, oSrc.m_pData, m_lSizeCur * sizeof(wchar_t));
m_pDataCur = m_pData + m_lSizeCur;
return *this;
}
CTextItem(const size_t& nLen)
{
m_lSize = nLen;
m_pData = (wchar_t*)malloc(m_lSize * sizeof(wchar_t));
m_lSizeCur = 0;
m_pDataCur = m_pData;
}
CTextItem(wchar_t* pData, const size_t& nLen)
{
m_lSize = nLen;
m_pData = (wchar_t*)malloc(m_lSize * sizeof(wchar_t));
memcpy(m_pData, pData, m_lSize * sizeof(wchar_t));
m_lSizeCur = m_lSize;
m_pDataCur = m_pData + m_lSize;
}
CTextItem(wchar_t* pData, BYTE* pUnicodeChecker = NULL)
{
size_t nLen = GetStringLen(pData);
m_lSize = nLen;
m_pData = (wchar_t*)malloc(m_lSize * sizeof(wchar_t));
memcpy(m_pData, pData, m_lSize * sizeof(wchar_t));
m_lSizeCur = m_lSize;
m_pDataCur = m_pData + m_lSize;
if (NULL != pUnicodeChecker)
{
wchar_t* pMemory = m_pData;
while (pMemory < m_pDataCur)
{
if (!pUnicodeChecker[*pMemory])
*pMemory = wchar_t(' ');
++pMemory;
}
}
}
virtual ~CTextItem()
{
RELEASEMEM(m_pData);
}
inline void AddSize(const size_t& nSize)
{
if (NULL == m_pData)
{
m_lSize = 1000;
if (nSize > m_lSize)
m_lSize = nSize;
m_pData = (wchar_t*)malloc(m_lSize * sizeof(wchar_t));
m_lSizeCur = 0;
m_pDataCur = m_pData;
return;
}
if ((m_lSizeCur + nSize) > m_lSize)
{
while ((m_lSizeCur + nSize) > m_lSize)
{
m_lSize *= 2;
}
wchar_t* pRealloc = (wchar_t*)realloc(m_pData, m_lSize * sizeof(wchar_t));
if (NULL != pRealloc)
{
// реаллок сработал
m_pData = pRealloc;
m_pDataCur = m_pData + m_lSizeCur;
}
else
{
wchar_t* pMalloc = (wchar_t*)malloc(m_lSize * sizeof(wchar_t));
memcpy(pMalloc, m_pData, m_lSizeCur * sizeof(wchar_t));
free(m_pData);
m_pData = pMalloc;
m_pDataCur = m_pData + m_lSizeCur;
}
}
}
public:
inline void operator+=(const std::wstring& oTemp)
{
WriteString(oTemp.c_str(), oTemp.length());
}
inline wchar_t operator[](const size_t& nIndex)
{
if (nIndex < m_lSizeCur)
return m_pData[nIndex];
return 0;
}
inline void AddSpace()
{
AddSize(1);
*m_pDataCur = wchar_t(' ');
++m_lSizeCur;
++m_pDataCur;
}
inline void CorrectUnicode(const BYTE* pUnicodeChecker)
{
if (NULL != pUnicodeChecker)
{
wchar_t* pMemory = m_pData;
while (pMemory < m_pDataCur)
{
if (!pUnicodeChecker[*pMemory])
*pMemory = wchar_t(' ');
++pMemory;
}
}
}
inline void RemoveLastSpaces()
{
wchar_t* pMemory = m_pDataCur - 1;
while ((pMemory > m_pData) && (wchar_t(' ') == *pMemory))
{
--pMemory;
--m_lSizeCur;
--m_pDataCur;
}
}
inline bool IsSpace()
{
if (1 != m_lSizeCur)
return false;
return (wchar_t(' ') == *m_pData);
}
public:
inline void WriteString(const wchar_t* pString, const size_t& nLen)
{
AddSize(nLen);
memcpy(m_pDataCur, pString, nLen * sizeof(wchar_t));
m_pDataCur += nLen;
m_lSizeCur += nLen;
}
inline size_t GetCurSize()
{
return m_lSizeCur;
}
inline size_t GetSize()
{
return m_lSize;
}
inline void Clear()
{
RELEASEMEM(m_pData);
m_pData = NULL;
m_lSize = 0;
m_pDataCur = m_pData;
m_lSizeCur = 0;
}
inline void ClearNoAttack()
{
m_pDataCur = m_pData;
m_lSizeCur = 0;
}
inline size_t GetStringLen(wchar_t* pData)
{
wchar_t* s = pData;
for (; *s != 0; ++s);
return (size_t)(s - pData);
}
inline std::wstring GetCString()
{
std::wstring str(m_pData, (int)m_lSizeCur);
return str;
}
inline wchar_t* GetBuffer()
{
return m_pData;
}
};
class CStringWriter : public CTextItem
{
public:
CStringWriter() : CTextItem()
{
}
virtual ~CStringWriter()
{
}
public:
inline void Write(CStringWriter& oWriter)
{
CTextItem::WriteString(oWriter.m_pData, oWriter.m_lSizeCur);
}
};
class CFontInfoJS
{
public:
@ -765,250 +510,11 @@ namespace NSCommon
RELEASEOBJECT(pManager);
}
if (false)
{
DWORD dwTime = NSTimers::GetTickCount();
int nMaxSymbol = 0x10FFFF;
int* arSymbolsAll = new int[nMaxSymbol + 1];
memset(arSymbolsAll, 0, (nMaxSymbol + 1) * sizeof(int));
CSymbolSimpleChecker2 oAllChecker(arSymbolsAll, nMaxSymbol);
std::map<std::wstring, int> mapFontsPriorityStandard;
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Arial", 1));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Times New Roman", 2));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Tahoma", 3));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Cambria", 4));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Calibri", 5));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Verdana", 6));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Georgia", 7));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Open Sans", 8));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Liberation Sans", 9));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Helvetica", 10));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Nimbus Sans L", 11));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"DejaVu Sans", 12));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Liberation Serif", 13));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Trebuchet MS", 14));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Courier New", 15));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Carlito", 16));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Segoe UI", 17));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MS Gothic", 18));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"SimSun", 19));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Nirmala UI", 20));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Batang", 21));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MS Mincho", 22));
CApplicationFontsSymbols oApplicationChecker;
std::vector<CFontPriority> arrFontsPriority;
std::map<std::wstring, int> mapFontsPriority;
for (int index = 0; index < nCountFonts; ++index)
{
std::map<std::wstring, CFontInfoJS>::iterator pPair = mapFonts.find(arrFonts[index]);
CFontInfoJS& info = pPair->second;
std::map<std::wstring, int>::iterator find = mapFontsPriorityStandard.find(arrFonts[index]);
if (find != mapFontsPriorityStandard.end())
{
CFontPriority f;
f.name = arrFonts[index];
f.priority = find->second;
arrFontsPriority.push_back(f);
continue;
}
int nSize = 0;
if (-1 != info.m_lIndexR)
{
NSFile::CFileBinary oFile;
if (oFile.OpenFile(mapFontFiles2[info.m_lIndexR]))
{
int nTmp = oFile.GetFileSize();
if (nTmp > nSize)
nSize = nTmp;
}
}
if (-1 != info.m_lIndexB)
{
NSFile::CFileBinary oFile;
if (oFile.OpenFile(mapFontFiles2[info.m_lIndexB]))
{
int nTmp = oFile.GetFileSize();
if (nTmp > nSize)
nSize = nTmp;
}
}
if (-1 != info.m_lIndexI)
{
NSFile::CFileBinary oFile;
if (oFile.OpenFile(mapFontFiles2[info.m_lIndexI]))
{
int nTmp = oFile.GetFileSize();
if (nTmp > nSize)
nSize = nTmp;
}
}
if (-1 != info.m_lIndexBI)
{
NSFile::CFileBinary oFile;
if (oFile.OpenFile(mapFontFiles2[info.m_lIndexBI]))
{
int nTmp = oFile.GetFileSize();
if (nTmp > nSize)
nSize = nTmp;
}
}
CFontPriority f;
f.name = arrFonts[index];
f.priority = nSize;
arrFontsPriority.push_back(f);
}
std::sort(arrFontsPriority.begin(), arrFontsPriority.end(), CFontPriority::Compare);
int nIndexPriority = 1;
for (std::vector<CFontPriority>::iterator i = arrFontsPriority.begin(); i != arrFontsPriority.end(); i++)
{
CFontPriority& o = *i;
mapFontsPriority.insert(std::pair<std::wstring, int>(o.name, nIndexPriority));
nIndexPriority++;
}
int nSumPriority = (int)(arrFontsPriority.size() + 1);
bool bIsSmallRangesDetect = true;
for (int index = 0; index < nCountFonts; ++index)
{
std::map<std::wstring, CFontInfoJS>::iterator pPair = mapFonts.find(arrFonts[index]);
CFontInfoJS& info = pPair->second;
int nPriority = mapFontsPriority.find(arrFonts[index])->second;
oAllChecker.m_nPriority = nPriority;
int nCounterFonts = 0;
if (-1 != info.m_lIndexR)
nCounterFonts++;
if (-1 != info.m_lIndexB)
nCounterFonts++;
if (-1 != info.m_lIndexI)
nCounterFonts++;
if (-1 != info.m_lIndexBI)
nCounterFonts++;
if (1 == nCounterFonts && !bIsSmallRangesDetect)
{
std::wstring sPathC = L"";
int nFaceIndexC = 0;
if (-1 != info.m_lIndexR)
{
sPathC = mapFontFiles2[info.m_lIndexR];
nFaceIndexC = info.m_lFaceIndexR;
}
else if (-1 != info.m_lIndexB)
{
sPathC = mapFontFiles2[info.m_lIndexB];
nFaceIndexC = info.m_lFaceIndexB;
}
else if (-1 != info.m_lIndexI)
{
sPathC = mapFontFiles2[info.m_lIndexI];
nFaceIndexC = info.m_lFaceIndexI;
}
else if (-1 != info.m_lIndexBI)
{
sPathC = mapFontFiles2[info.m_lIndexBI];
nFaceIndexC = info.m_lFaceIndexBI;
}
CSymbolSimpleChecker checker;
checker.m_nMaxSymbols = nMaxSymbol;
checker.m_pSymbols = arSymbolsAll;
checker.m_nPriority = nPriority;
oApplicationChecker.CheckSymbols(sPathC, nFaceIndexC, &checker);
}
else
{
int nMask = 0;
if (-1 != info.m_lIndexR)
{
oAllChecker.m_nStyle = 1;
nMask |= 1;
oApplicationChecker.CheckSymbols(mapFontFiles2[info.m_lIndexR], info.m_lFaceIndexR, &oAllChecker);
}
if (-1 != info.m_lIndexB)
{
oAllChecker.m_nStyle = 2;
nMask |= 2;
oApplicationChecker.CheckSymbols(mapFontFiles2[info.m_lIndexB], info.m_lFaceIndexB, &oAllChecker);
}
if (-1 != info.m_lIndexI)
{
oAllChecker.m_nStyle = 4;
nMask |= 4;
oApplicationChecker.CheckSymbols(mapFontFiles2[info.m_lIndexI], info.m_lFaceIndexI, &oAllChecker);
}
if (-1 != info.m_lIndexBI)
{
oAllChecker.m_nStyle = 8;
nMask |= 8;
oApplicationChecker.CheckSymbols(mapFontFiles2[info.m_lIndexBI], info.m_lFaceIndexBI, &oAllChecker);
}
if (bIsSmallRangesDetect)
oAllChecker.Apply2(nMask, nSumPriority);
else
oAllChecker.Apply1(nMask);
}
}
dwTime = NSTimers::GetTickCount() - dwTime;
FILE* f = fopen("D:\\FONTS_SYMBOLS.txt", "a+");
fprintf(f, "time: %d\n", (int)dwTime);
int nFontPriority = 0;
int nFontPriorityStart = 0;
int nTopBorder = nMaxSymbol + 1;
for (int i = 0; i < nTopBorder; ++i)
{
int nFontPriorityTestSym = arSymbolsAll[i];
int nFontPriorityTest = (nFontPriorityTestSym > nSumPriority) ? (nFontPriorityTestSym - nSumPriority) : nFontPriorityTestSym;
if (nFontPriority == nFontPriorityTest)
continue;
if (nFontPriority != 0)
{
fprintf(f, "[%d - %d] : ", nFontPriorityStart, i - 1);
std::string sTmp = U_TO_UTF8(arrFontsPriority[nFontPriority - 1].name);
fprintf(f, sTmp.c_str());
fprintf(f, "\n");
}
nFontPriority = nFontPriorityTest;
nFontPriorityStart = i;
}
if (nFontPriority != 0)
{
fprintf(f, "[%d - %d] : ", nFontPriorityStart, nMaxSymbol - 1);
std::string sTmp = U_TO_UTF8(arrFontsPriority[nFontPriority - 1].name);
fprintf(f, sTmp.c_str());
fprintf(f, "\n");
}
fclose(f);
delete[] arSymbolsAll;
}
// и самое главное. Здесь должен скидываться скрипт для работы со всеми шрифтами.
// все объекты, которые позволят не знать о существующих фонтах
if (0 != strFile.length())
{
CStringWriter oWriterJS;
NSStringUtils::CStringBuilder oWriterJS;
// сначала все файлы
size_t nCountFiles = mapFontFiles.size();
@ -1021,8 +527,8 @@ namespace NSCommon
{
std::wstring strFontId = pos->first;
string_replace(strFontId, L"\\\\", L"\\");
string_replace(strFontId, L"/", L"\\");
NSStringUtils::string_replace(strFontId, L"\\\\", L"\\");
NSStringUtils::string_replace(strFontId, L"/", L"\\");
int nStart = strFontId.find_last_of(wchar_t('\\'));
strFontId = strFontId.substr(nStart + 1);
@ -1047,28 +553,284 @@ namespace NSCommon
oWriterJS += L"window[\"__fonts_infos\"] = [\n";
std::map<std::wstring, int> mapFontIndexes;
for (int index = 0; index < nCountFonts; ++index)
{
std::map<std::wstring, CFontInfoJS>::iterator pPair = mapFonts.find(arrFonts[index]);
char buffer[1000];
sprintf(buffer, "\",%d,%d,%d,%d,%d,%d,%d,%d]", pPair->second.m_lIndexR, pPair->second.m_lFaceIndexR,
pPair->second.m_lIndexI, pPair->second.m_lFaceIndexI,
pPair->second.m_lIndexB, pPair->second.m_lFaceIndexB,
pPair->second.m_lIndexBI, pPair->second.m_lFaceIndexBI);
std::string sBuffer(buffer);
mapFontIndexes.insert(std::pair<std::wstring, int>(arrFonts[index], index));
oWriterJS += L"[\"";
oWriterJS += pPair->second.m_sName;
oWriterJS += NSFile::CUtf8Converter::GetUnicodeFromCharPtr(sBuffer);
oWriterJS.AddSize(120);
oWriterJS.AddCharNoCheck('\"');
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lIndexR);
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lFaceIndexR);
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lIndexI);
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lFaceIndexI);
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lIndexB);
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lFaceIndexB);
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lIndexBI);
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lFaceIndexBI);
if (index != (nCountFonts - 1))
oWriterJS += (L",\n");
oWriterJS += (L"],\n");
else
oWriterJS += (L"\n");
oWriterJS += (L"]\n");
}
oWriterJS += (L"];\n\n");
if (true)
{
//DWORD dwTime = NSTimers::GetTickCount();
int nMaxSymbol = 0x10FFFF;
int* arSymbolsAll = new int[nMaxSymbol + 1];
memset(arSymbolsAll, 0, (nMaxSymbol + 1) * sizeof(int));
CSymbolSimpleChecker2 oAllChecker(arSymbolsAll, nMaxSymbol);
std::map<std::wstring, int> mapFontsPriorityStandard;
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Arial", 1));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Times New Roman", 2));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Tahoma", 3));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Cambria", 4));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Calibri", 5));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Verdana", 6));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Georgia", 7));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Open Sans", 8));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Liberation Sans", 9));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Helvetica", 10));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Nimbus Sans L", 11));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"DejaVu Sans", 12));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Liberation Serif", 13));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Trebuchet MS", 14));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Courier New", 15));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Carlito", 16));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Segoe UI", 17));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MS Gothic", 18));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"SimSun", 19));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Nirmala UI", 20));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Batang", 21));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MS Mincho", 22));
CApplicationFontsSymbols oApplicationChecker;
std::vector<CFontPriority> arrFontsPriority;
std::map<std::wstring, int> mapFontsPriority;
for (int index = 0; index < nCountFonts; ++index)
{
std::map<std::wstring, CFontInfoJS>::iterator pPair = mapFonts.find(arrFonts[index]);
CFontInfoJS& info = pPair->second;
std::map<std::wstring, int>::iterator find = mapFontsPriorityStandard.find(arrFonts[index]);
if (find != mapFontsPriorityStandard.end())
{
CFontPriority f;
f.name = arrFonts[index];
f.priority = find->second;
arrFontsPriority.push_back(f);
continue;
}
int nSize = 0;
if (-1 != info.m_lIndexR)
{
NSFile::CFileBinary oFile;
if (oFile.OpenFile(mapFontFiles2[info.m_lIndexR]))
{
int nTmp = oFile.GetFileSize();
if (nTmp > nSize)
nSize = nTmp;
}
}
if (-1 != info.m_lIndexB)
{
NSFile::CFileBinary oFile;
if (oFile.OpenFile(mapFontFiles2[info.m_lIndexB]))
{
int nTmp = oFile.GetFileSize();
if (nTmp > nSize)
nSize = nTmp;
}
}
if (-1 != info.m_lIndexI)
{
NSFile::CFileBinary oFile;
if (oFile.OpenFile(mapFontFiles2[info.m_lIndexI]))
{
int nTmp = oFile.GetFileSize();
if (nTmp > nSize)
nSize = nTmp;
}
}
if (-1 != info.m_lIndexBI)
{
NSFile::CFileBinary oFile;
if (oFile.OpenFile(mapFontFiles2[info.m_lIndexBI]))
{
int nTmp = oFile.GetFileSize();
if (nTmp > nSize)
nSize = nTmp;
}
}
CFontPriority f;
f.name = arrFonts[index];
f.priority = nSize;
arrFontsPriority.push_back(f);
}
std::sort(arrFontsPriority.begin(), arrFontsPriority.end(), CFontPriority::Compare);
int nIndexPriority = 1;
for (std::vector<CFontPriority>::iterator i = arrFontsPriority.begin(); i != arrFontsPriority.end(); i++)
{
CFontPriority& o = *i;
mapFontsPriority.insert(std::pair<std::wstring, int>(o.name, nIndexPriority));
nIndexPriority++;
}
int nSumPriority = (int)(arrFontsPriority.size() + 1);
bool bIsSmallRangesDetect = true;
for (int index = 0; index < nCountFonts; ++index)
{
std::map<std::wstring, CFontInfoJS>::iterator pPair = mapFonts.find(arrFonts[index]);
CFontInfoJS& info = pPair->second;
int nPriority = mapFontsPriority.find(arrFonts[index])->second;
oAllChecker.m_nPriority = nPriority;
int nCounterFonts = 0;
if (-1 != info.m_lIndexR)
nCounterFonts++;
if (-1 != info.m_lIndexB)
nCounterFonts++;
if (-1 != info.m_lIndexI)
nCounterFonts++;
if (-1 != info.m_lIndexBI)
nCounterFonts++;
if (1 == nCounterFonts && !bIsSmallRangesDetect)
{
std::wstring sPathC = L"";
int nFaceIndexC = 0;
if (-1 != info.m_lIndexR)
{
sPathC = mapFontFiles2[info.m_lIndexR];
nFaceIndexC = info.m_lFaceIndexR;
}
else if (-1 != info.m_lIndexB)
{
sPathC = mapFontFiles2[info.m_lIndexB];
nFaceIndexC = info.m_lFaceIndexB;
}
else if (-1 != info.m_lIndexI)
{
sPathC = mapFontFiles2[info.m_lIndexI];
nFaceIndexC = info.m_lFaceIndexI;
}
else if (-1 != info.m_lIndexBI)
{
sPathC = mapFontFiles2[info.m_lIndexBI];
nFaceIndexC = info.m_lFaceIndexBI;
}
CSymbolSimpleChecker checker;
checker.m_nMaxSymbols = nMaxSymbol;
checker.m_pSymbols = arSymbolsAll;
checker.m_nPriority = nPriority;
oApplicationChecker.CheckSymbols(sPathC, nFaceIndexC, &checker);
}
else
{
int nMask = 0;
if (-1 != info.m_lIndexR)
{
oAllChecker.m_nStyle = 1;
nMask |= 1;
oApplicationChecker.CheckSymbols(mapFontFiles2[info.m_lIndexR], info.m_lFaceIndexR, &oAllChecker);
}
if (-1 != info.m_lIndexB)
{
oAllChecker.m_nStyle = 2;
nMask |= 2;
oApplicationChecker.CheckSymbols(mapFontFiles2[info.m_lIndexB], info.m_lFaceIndexB, &oAllChecker);
}
if (-1 != info.m_lIndexI)
{
oAllChecker.m_nStyle = 4;
nMask |= 4;
oApplicationChecker.CheckSymbols(mapFontFiles2[info.m_lIndexI], info.m_lFaceIndexI, &oAllChecker);
}
if (-1 != info.m_lIndexBI)
{
oAllChecker.m_nStyle = 8;
nMask |= 8;
oApplicationChecker.CheckSymbols(mapFontFiles2[info.m_lIndexBI], info.m_lFaceIndexBI, &oAllChecker);
}
if (bIsSmallRangesDetect)
oAllChecker.Apply2(nMask, nSumPriority);
else
oAllChecker.Apply1(nMask);
}
}
//dwTime = NSTimers::GetTickCount() - dwTime;
oWriterJS += L"window[\"__fonts_ranges\"] = [\n";
int nFontPriority = 0;
int nFontPriorityStart = 0;
int nTopBorder = nMaxSymbol + 1;
for (int i = 0; i < nTopBorder; ++i)
{
int nFontPriorityTestSym = arSymbolsAll[i];
int nFontPriorityTest = (nFontPriorityTestSym > nSumPriority) ? (nFontPriorityTestSym - nSumPriority) : nFontPriorityTestSym;
if (nFontPriority == nFontPriorityTest)
continue;
if (nFontPriority != 0)
{
oWriterJS.AddInt(nFontPriorityStart);
oWriterJS.AddCharSafe(',');
oWriterJS.AddInt(i - 1);
oWriterJS.AddCharSafe(',');
oWriterJS.AddInt(mapFontIndexes.find(arrFontsPriority[nFontPriority - 1].name)->second);
oWriterJS.AddCharSafe(',');
}
nFontPriority = nFontPriorityTest;
nFontPriorityStart = i;
}
if (nFontPriority != 0)
{
oWriterJS.AddInt(nFontPriorityStart);
oWriterJS.AddCharSafe(',');
oWriterJS.AddInt(nMaxSymbol - 1);
oWriterJS.AddCharSafe(',');
oWriterJS.AddInt(mapFontIndexes.find(arrFontsPriority[nFontPriority - 1].name)->second);
oWriterJS.AddCharSafe(',');
}
oWriterJS.SetCurSize(oWriterJS.GetCurSize() - 1);
oWriterJS += (L"];\n\n");
delete[] arSymbolsAll;
}
oWriterJS += (L"];\n\n");
if (true)
{
@ -1092,7 +854,7 @@ namespace NSCommon
NSFile::CFileBinary oFile;
oFile.CreateFileW(strFile);
oFile.WriteStringUTF8(oWriterJS.GetCString(), true);
oFile.WriteStringUTF8(oWriterJS.GetData(), true);
oFile.CloseFile();
}

View File

@ -249,7 +249,7 @@ namespace NSStringUtils
public:
inline void SetText(const std::wstring& bsText)
inline void SetText(const std::wstring& bsText)
{
ClearNoAttack();
WriteString(bsText);
@ -261,6 +261,11 @@ namespace NSStringUtils
}
}
inline void operator+=(const std::wstring& oTemp)
{
WriteString(oTemp.c_str(), oTemp.length());
}
inline void WriteStringNoSafe(const wchar_t* pString, size_t nLen)
{
memcpy(m_pDataCur, pString, nLen * sizeof(wchar_t));

View File

@ -152,6 +152,177 @@ namespace NSCommon
return true;
}
};
class CSymbolSimpleChecker : public CApplicationFontsSymbolsChecker
{
public:
int m_nMaxSymbols;
int* m_pSymbols;
int m_nPriority;
public:
CSymbolSimpleChecker()
{
}
virtual void Check(const int& nCode, const unsigned int& nIndex)
{
if (nCode > m_nMaxSymbols)
return;
if (m_pSymbols[nCode] == 0)
m_pSymbols[nCode] = m_nPriority;
else if (m_pSymbols[nCode] > m_nPriority)
m_pSymbols[nCode] = m_nPriority;
}
~CSymbolSimpleChecker()
{
}
};
class CSymbolSimpleChecker2 : public CApplicationFontsSymbolsChecker
{
public:
int m_nMaxSymbols;
int* m_pSymbols;
int m_nPriority;
int m_nStyle;
BYTE* m_pTmpSymbols;
int m_nMin;
int m_nMax;
public:
CSymbolSimpleChecker2(int* pSymbols, int nMax)
{
m_pSymbols = pSymbols;
m_nMaxSymbols = nMax;
m_pTmpSymbols = new BYTE[m_nMaxSymbols + 1];
memset(m_pTmpSymbols, 0, (m_nMaxSymbols + 1) * sizeof(BYTE));
m_nMin = m_nMaxSymbols + 1;
m_nMax = -1;
m_nStyle = 0;
}
void Apply1(int nMask)
{
BYTE* tmp = m_pTmpSymbols + m_nMin;
for (int i = m_nMin; i <= m_nMax; ++i, ++tmp)
{
if (nMask == *tmp)
{
if (m_pSymbols[i] == 0)
m_pSymbols[i] = m_nPriority;
else if (m_pSymbols[i] > m_nPriority)
m_pSymbols[i] = m_nPriority;
}
}
if (m_nMax >= m_nMin)
memset(m_pTmpSymbols, 0, (m_nMax - m_nMin) * sizeof(BYTE));
m_nMin = m_nMaxSymbols + 1;
m_nMax = -1;
}
void Apply2(int nMask, int nSumPriority)
{
int nSmallRangeLen = 10;
int nSmallRangeLenCJK = 30;
BYTE* tmp = m_pTmpSymbols + m_nMin;
BYTE* tmpLast = m_pTmpSymbols + m_nMax + 1;
BYTE* tmpFirst = NULL;
int* pSymbols = NULL;
int* pSymbolsLast = NULL;
int nPriority = 0;
int nFirstOffset = 0;
while (tmp < tmpLast)
{
if (nMask != *tmp)
{
++tmp;
continue;
}
tmpFirst = tmp;
int nCount = 1;
++tmp;
while (nMask == *tmp && tmp < tmpLast)
{
++tmp;
nCount++;
}
nFirstOffset = (int)(tmpFirst - m_pTmpSymbols);
pSymbols = m_pSymbols + nFirstOffset;
pSymbolsLast = pSymbols + nCount + 1;
if (nFirstOffset > 0x4DFF && nFirstOffset < 0x9FFF)
nPriority = (nCount > nSmallRangeLenCJK) ? m_nPriority : (m_nPriority + nSumPriority);
else
nPriority = (nCount > nSmallRangeLen) ? m_nPriority : (m_nPriority + nSumPriority);
while (pSymbols < pSymbolsLast)
{
if (*pSymbols == 0)
*pSymbols = nPriority;
else if (*pSymbols > nPriority)
*pSymbols = nPriority;
++pSymbols;
}
}
if (m_nMax >= m_nMin)
memset(m_pTmpSymbols, 0, (m_nMax - m_nMin) * sizeof(BYTE));
m_nMin = m_nMaxSymbols + 1;
m_nMax = -1;
}
virtual void Check(const int& nCode, const unsigned int& nIndex)
{
if (nCode > m_nMax)
m_nMax = nCode;
if (nCode < m_nMin)
m_nMin = nCode;
m_pTmpSymbols[nCode] |= m_nStyle;
}
~CSymbolSimpleChecker2()
{
RELEASEARRAYOBJECTS(m_pTmpSymbols);
}
};
class CFontPriority
{
public:
std::wstring name;
int priority;
CFontPriority()
{
priority = 0;
}
static bool Compare(const CFontPriority& p1, const CFontPriority& p2)
{
if (p1.priority != p2.priority)
return (p1.priority < p2.priority) ? true : false;
return (p1.name < p2.name) ? true : false;
}
};
static void SaveAllFontsJS(CApplicationFonts& applicationFonts, std::wstring strFile, std::wstring strFolderThumbnails, std::wstring strFontSelectionBin)
{
@ -474,30 +645,286 @@ namespace NSCommon
delete [] pMassFiles;
}
oWriterJS.WriteString(L"window[\"__fonts_infos\"] = [\n");
oWriterJS += L"window[\"__fonts_infos\"] = [\n";
std::map<std::wstring, int> mapFontIndexes;
for (int index = 0; index < nCountFonts; ++index)
{
std::map<std::wstring, CFontInfoJS>::iterator pPair = mapFonts.find(arrFonts[index]);
char buffer[1000];
sprintf(buffer, "\",%d,%d,%d,%d,%d,%d,%d,%d]", pPair->second.m_lIndexR, pPair->second.m_lFaceIndexR,
pPair->second.m_lIndexI, pPair->second.m_lFaceIndexI,
pPair->second.m_lIndexB, pPair->second.m_lFaceIndexB,
pPair->second.m_lIndexBI, pPair->second.m_lFaceIndexBI);
std::string sBuffer(buffer);
oWriterJS.WriteString(L"[\"");
oWriterJS.WriteString(pPair->second.m_sName);
oWriterJS.WriteString(NSFile::CUtf8Converter::GetUnicodeFromCharPtr(sBuffer));
mapFontIndexes.insert(std::pair<std::wstring, int>(arrFonts[index], index));
oWriterJS += L"[\"";
oWriterJS += pPair->second.m_sName;
oWriterJS.AddSize(120);
oWriterJS.AddCharNoCheck('\"');
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lIndexR);
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lFaceIndexR);
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lIndexI);
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lFaceIndexI);
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lIndexB);
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lFaceIndexB);
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lIndexBI);
oWriterJS.AddCharNoCheck(',');
oWriterJS.AddIntNoCheck(pPair->second.m_lFaceIndexBI);
if (index != (nCountFonts - 1))
oWriterJS.WriteString(L",\n");
oWriterJS += (L"],\n");
else
oWriterJS.WriteString(L"\n");
oWriterJS += (L"]\n");
}
oWriterJS += (L"];\n\n");
if (true)
{
//DWORD dwTime = NSTimers::GetTickCount();
int nMaxSymbol = 0x10FFFF;
int* arSymbolsAll = new int[nMaxSymbol + 1];
memset(arSymbolsAll, 0, (nMaxSymbol + 1) * sizeof(int));
CSymbolSimpleChecker2 oAllChecker(arSymbolsAll, nMaxSymbol);
std::map<std::wstring, int> mapFontsPriorityStandard;
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Arial", 1));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Times New Roman", 2));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Tahoma", 3));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Cambria", 4));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Calibri", 5));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Verdana", 6));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Georgia", 7));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Open Sans", 8));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Liberation Sans", 9));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Helvetica", 10));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Nimbus Sans L", 11));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"DejaVu Sans", 12));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Liberation Serif", 13));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Trebuchet MS", 14));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Courier New", 15));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Carlito", 16));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Segoe UI", 17));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MS Gothic", 18));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"SimSun", 19));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Nirmala UI", 20));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Batang", 21));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MS Mincho", 22));
CApplicationFontsSymbols oApplicationChecker;
std::vector<CFontPriority> arrFontsPriority;
std::map<std::wstring, int> mapFontsPriority;
for (int index = 0; index < nCountFonts; ++index)
{
std::map<std::wstring, CFontInfoJS>::iterator pPair = mapFonts.find(arrFonts[index]);
CFontInfoJS& info = pPair->second;
std::map<std::wstring, int>::iterator find = mapFontsPriorityStandard.find(arrFonts[index]);
if (find != mapFontsPriorityStandard.end())
{
CFontPriority f;
f.name = arrFonts[index];
f.priority = find->second;
arrFontsPriority.push_back(f);
continue;
}
int nSize = 0;
if (-1 != info.m_lIndexR)
{
NSFile::CFileBinary oFile;
if (oFile.OpenFile(mapFontFiles2[info.m_lIndexR]))
{
int nTmp = oFile.GetFileSize();
if (nTmp > nSize)
nSize = nTmp;
}
}
if (-1 != info.m_lIndexB)
{
NSFile::CFileBinary oFile;
if (oFile.OpenFile(mapFontFiles2[info.m_lIndexB]))
{
int nTmp = oFile.GetFileSize();
if (nTmp > nSize)
nSize = nTmp;
}
}
if (-1 != info.m_lIndexI)
{
NSFile::CFileBinary oFile;
if (oFile.OpenFile(mapFontFiles2[info.m_lIndexI]))
{
int nTmp = oFile.GetFileSize();
if (nTmp > nSize)
nSize = nTmp;
}
}
if (-1 != info.m_lIndexBI)
{
NSFile::CFileBinary oFile;
if (oFile.OpenFile(mapFontFiles2[info.m_lIndexBI]))
{
int nTmp = oFile.GetFileSize();
if (nTmp > nSize)
nSize = nTmp;
}
}
CFontPriority f;
f.name = arrFonts[index];
f.priority = nSize;
arrFontsPriority.push_back(f);
}
std::sort(arrFontsPriority.begin(), arrFontsPriority.end(), CFontPriority::Compare);
int nIndexPriority = 1;
for (std::vector<CFontPriority>::iterator i = arrFontsPriority.begin(); i != arrFontsPriority.end(); i++)
{
CFontPriority& o = *i;
mapFontsPriority.insert(std::pair<std::wstring, int>(o.name, nIndexPriority));
nIndexPriority++;
}
int nSumPriority = (int)(arrFontsPriority.size() + 1);
bool bIsSmallRangesDetect = true;
for (int index = 0; index < nCountFonts; ++index)
{
std::map<std::wstring, CFontInfoJS>::iterator pPair = mapFonts.find(arrFonts[index]);
CFontInfoJS& info = pPair->second;
int nPriority = mapFontsPriority.find(arrFonts[index])->second;
oAllChecker.m_nPriority = nPriority;
int nCounterFonts = 0;
if (-1 != info.m_lIndexR)
nCounterFonts++;
if (-1 != info.m_lIndexB)
nCounterFonts++;
if (-1 != info.m_lIndexI)
nCounterFonts++;
if (-1 != info.m_lIndexBI)
nCounterFonts++;
if (1 == nCounterFonts && !bIsSmallRangesDetect)
{
std::wstring sPathC = L"";
int nFaceIndexC = 0;
if (-1 != info.m_lIndexR)
{
sPathC = mapFontFiles2[info.m_lIndexR];
nFaceIndexC = info.m_lFaceIndexR;
}
else if (-1 != info.m_lIndexB)
{
sPathC = mapFontFiles2[info.m_lIndexB];
nFaceIndexC = info.m_lFaceIndexB;
}
else if (-1 != info.m_lIndexI)
{
sPathC = mapFontFiles2[info.m_lIndexI];
nFaceIndexC = info.m_lFaceIndexI;
}
else if (-1 != info.m_lIndexBI)
{
sPathC = mapFontFiles2[info.m_lIndexBI];
nFaceIndexC = info.m_lFaceIndexBI;
}
CSymbolSimpleChecker checker;
checker.m_nMaxSymbols = nMaxSymbol;
checker.m_pSymbols = arSymbolsAll;
checker.m_nPriority = nPriority;
oApplicationChecker.CheckSymbols(sPathC, nFaceIndexC, &checker);
}
else
{
int nMask = 0;
if (-1 != info.m_lIndexR)
{
oAllChecker.m_nStyle = 1;
nMask |= 1;
oApplicationChecker.CheckSymbols(mapFontFiles2[info.m_lIndexR], info.m_lFaceIndexR, &oAllChecker);
}
if (-1 != info.m_lIndexB)
{
oAllChecker.m_nStyle = 2;
nMask |= 2;
oApplicationChecker.CheckSymbols(mapFontFiles2[info.m_lIndexB], info.m_lFaceIndexB, &oAllChecker);
}
if (-1 != info.m_lIndexI)
{
oAllChecker.m_nStyle = 4;
nMask |= 4;
oApplicationChecker.CheckSymbols(mapFontFiles2[info.m_lIndexI], info.m_lFaceIndexI, &oAllChecker);
}
if (-1 != info.m_lIndexBI)
{
oAllChecker.m_nStyle = 8;
nMask |= 8;
oApplicationChecker.CheckSymbols(mapFontFiles2[info.m_lIndexBI], info.m_lFaceIndexBI, &oAllChecker);
}
if (bIsSmallRangesDetect)
oAllChecker.Apply2(nMask, nSumPriority);
else
oAllChecker.Apply1(nMask);
}
}
//dwTime = NSTimers::GetTickCount() - dwTime;
oWriterJS += L"window[\"__fonts_ranges\"] = [\n";
int nFontPriority = 0;
int nFontPriorityStart = 0;
int nTopBorder = nMaxSymbol + 1;
for (int i = 0; i < nTopBorder; ++i)
{
int nFontPriorityTestSym = arSymbolsAll[i];
int nFontPriorityTest = (nFontPriorityTestSym > nSumPriority) ? (nFontPriorityTestSym - nSumPriority) : nFontPriorityTestSym;
if (nFontPriority == nFontPriorityTest)
continue;
if (nFontPriority != 0)
{
oWriterJS.AddInt(nFontPriorityStart);
oWriterJS.AddCharSafe(',');
oWriterJS.AddInt(i - 1);
oWriterJS.AddCharSafe(',');
oWriterJS.AddInt(mapFontIndexes.find(arrFontsPriority[nFontPriority - 1].name)->second);
oWriterJS.AddCharSafe(',');
}
nFontPriority = nFontPriorityTest;
nFontPriorityStart = i;
}
if (nFontPriority != 0)
{
oWriterJS.AddInt(nFontPriorityStart);
oWriterJS.AddCharSafe(',');
oWriterJS.AddInt(nMaxSymbol - 1);
oWriterJS.AddCharSafe(',');
oWriterJS.AddInt(mapFontIndexes.find(arrFontsPriority[nFontPriority - 1].name)->second);
oWriterJS.AddCharSafe(',');
}
oWriterJS.SetCurSize(oWriterJS.GetCurSize() - 1);
oWriterJS += (L"];\n\n");
delete[] arSymbolsAll;
}
oWriterJS.WriteString(L"];\n\n");
if (true)
{

View File

@ -158,7 +158,6 @@
17A764F11B0F39370046BC0B /* textops.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17A763D61B0F39370046BC0B /* textops.cpp */; };
17A764F31B0F39370046BC0B /* tiffio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17A763D71B0F39370046BC0B /* tiffio.cpp */; };
17A764F51B0F39370046BC0B /* tiffiostub.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17A763D81B0F39370046BC0B /* tiffiostub.cpp */; };
17A764F91B0F39370046BC0B /* viewfiles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17A763DA1B0F39370046BC0B /* viewfiles.cpp */; };
17A764FB1B0F39370046BC0B /* warper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17A763DB1B0F39370046BC0B /* warper.cpp */; };
17A764FD1B0F39370046BC0B /* watershed.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17A763DC1B0F39370046BC0B /* watershed.cpp */; };
17A764FF1B0F39370046BC0B /* webpio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17A763DE1B0F39370046BC0B /* webpio.cpp */; };
@ -394,7 +393,6 @@
17A763D61B0F39370046BC0B /* textops.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = textops.cpp; sourceTree = "<group>"; };
17A763D71B0F39370046BC0B /* tiffio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tiffio.cpp; sourceTree = "<group>"; };
17A763D81B0F39370046BC0B /* tiffiostub.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tiffiostub.cpp; sourceTree = "<group>"; };
17A763DA1B0F39370046BC0B /* viewfiles.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = viewfiles.cpp; sourceTree = "<group>"; };
17A763DB1B0F39370046BC0B /* warper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = warper.cpp; sourceTree = "<group>"; };
17A763DC1B0F39370046BC0B /* watershed.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = watershed.cpp; sourceTree = "<group>"; };
17A763DD1B0F39370046BC0B /* watershed.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = watershed.h; sourceTree = "<group>"; };
@ -730,7 +728,6 @@
17A763D61B0F39370046BC0B /* textops.cpp */,
17A763D71B0F39370046BC0B /* tiffio.cpp */,
17A763D81B0F39370046BC0B /* tiffiostub.cpp */,
17A763DA1B0F39370046BC0B /* viewfiles.cpp */,
17A763DB1B0F39370046BC0B /* warper.cpp */,
17A763DC1B0F39370046BC0B /* watershed.cpp */,
17A763DD1B0F39370046BC0B /* watershed.h */,
@ -903,7 +900,6 @@
17A7649B1B0F39370046BC0B /* pixcomp.cpp in Sources */,
17A764171B0F39370046BC0B /* colorcontent.cpp in Sources */,
17A764671B0F39370046BC0B /* jpegiostub.cpp in Sources */,
17A764F91B0F39370046BC0B /* viewfiles.cpp in Sources */,
17A764AD1B0F39370046BC0B /* psio1stub.cpp in Sources */,
17A764CD1B0F39370046BC0B /* rotateamlow.cpp in Sources */,
17A763F31B0F39370046BC0B /* bbuffer.cpp in Sources */,