This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new 7ed02bbb1f Maintenance cleanup
7ed02bbb1f is described below
commit 7ed02bbb1fdafc26a1c6b8509e195439d410cee9
Author: mseidel <[email protected]>
AuthorDate: Sun Jun 25 17:33:48 2023 +0200
Maintenance cleanup
---
.../shlxthandler/propsheets/document_statistic.cxx | 156 ++++++-------
.../shlxthandler/propsheets/document_statistic.hxx | 108 ++++-----
.../shlxthandler/propsheets/listviewbuilder.cxx | 232 +++++++++----------
.../shlxthandler/propsheets/listviewbuilder.hxx | 94 ++++----
.../win32/shlxthandler/propsheets/propsheets.cxx | 252 +++++++++++----------
5 files changed, 426 insertions(+), 416 deletions(-)
diff --git
a/main/shell/source/win32/shlxthandler/propsheets/document_statistic.cxx
b/main/shell/source/win32/shlxthandler/propsheets/document_statistic.cxx
index 0d0845c3ac..4ab505d59b 100644
--- a/main/shell/source/win32/shlxthandler/propsheets/document_statistic.cxx
+++ b/main/shell/source/win32/shlxthandler/propsheets/document_statistic.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -35,132 +35,134 @@
#include "internal/config.hxx"
#include "internal/iso8601_converter.hxx"
-//#####################################
+//#####################################
const bool READONLY = false;
const bool WRITEABLE = true;
-
+
//#####################################
document_statistic_reader_ptr create_document_statistic_reader(const
std::string& document_name, CMetaInfoReader* meta_info_accessor)
{
- File_Type_t file_type = get_file_type(document_name);
-
+ File_Type_t file_type = get_file_type(document_name);
+
if (WRITER == file_type)
- return document_statistic_reader_ptr(new
writer_document_statistic_reader(document_name, meta_info_accessor));
+ return document_statistic_reader_ptr(new
writer_document_statistic_reader(document_name, meta_info_accessor));
else if (CALC == file_type)
- return document_statistic_reader_ptr(new
calc_document_statistic_reader(document_name, meta_info_accessor));
+ return document_statistic_reader_ptr(new
calc_document_statistic_reader(document_name, meta_info_accessor));
else
- return document_statistic_reader_ptr(new
draw_impress_math_document_statistic_reader(document_name,
meta_info_accessor));
+ return document_statistic_reader_ptr(new
draw_impress_math_document_statistic_reader(document_name, meta_info_accessor));
}
//#####################################
document_statistic_reader::document_statistic_reader(const std::string&
document_name, CMetaInfoReader* meta_info_accessor) :
- document_name_(document_name),
- meta_info_accessor_(meta_info_accessor)
+ document_name_(document_name),
+ meta_info_accessor_(meta_info_accessor)
{}
-//#####################################
-document_statistic_reader::~document_statistic_reader()
+//#####################################
+document_statistic_reader::~document_statistic_reader()
{}
//#####################################
void document_statistic_reader::read(statistic_group_list_t* group_list)
{
- group_list->clear();
- fill_description_section(meta_info_accessor_, group_list);
- fill_origin_section(meta_info_accessor_, group_list);
+ group_list->clear();
+ fill_description_section(meta_info_accessor_, group_list);
+ fill_origin_section(meta_info_accessor_, group_list);
}
//#####################################
std::string document_statistic_reader::get_document_name() const
{
- return document_name_;
+ return document_name_;
}
//#####################################
void document_statistic_reader::fill_origin_section(CMetaInfoReader
*meta_info_accessor, statistic_group_list_t* group_list)
{
- statistic_item_list_t il;
-
- il.push_back(statistic_item(GetResString(IDS_AUTHOR),
meta_info_accessor->getTagData( META_INFO_AUTHOR ), READONLY));
-
- il.push_back(statistic_item(GetResString(IDS_MODIFIED),
-
iso8601_date_to_local_date(meta_info_accessor->getTagData(META_INFO_MODIFIED
)), READONLY));
-
- il.push_back(statistic_item(GetResString(IDS_DOCUMENT_NUMBER),
meta_info_accessor->getTagData( META_INFO_DOCUMENT_NUMBER ), READONLY));
-
- il.push_back(statistic_item(GetResString(IDS_EDITING_TIME),
- iso8601_duration_to_local_duration(meta_info_accessor->getTagData(
META_INFO_EDITING_TIME )), READONLY));
-
- group_list->push_back(statistic_group_t(GetResString(IDS_ORIGIN), il));
+ statistic_item_list_t il;
+
+ il.push_back(statistic_item(GetResString(IDS_AUTHOR),
meta_info_accessor->getTagData( META_INFO_AUTHOR ), READONLY));
+
+ il.push_back(statistic_item(GetResString(IDS_MODIFIED),
+
iso8601_date_to_local_date(meta_info_accessor->getTagData(META_INFO_MODIFIED
)), READONLY));
+
+ il.push_back(statistic_item(GetResString(IDS_DOCUMENT_NUMBER),
meta_info_accessor->getTagData( META_INFO_DOCUMENT_NUMBER ), READONLY));
+
+ il.push_back(statistic_item(GetResString(IDS_EDITING_TIME),
+
iso8601_duration_to_local_duration(meta_info_accessor->getTagData(
META_INFO_EDITING_TIME )), READONLY));
+
+ group_list->push_back(statistic_group_t(GetResString(IDS_ORIGIN), il));
}
-
+
//#####################################
writer_document_statistic_reader::writer_document_statistic_reader(const
std::string& document_name, CMetaInfoReader* meta_info_accessor) :
- document_statistic_reader(document_name, meta_info_accessor)
+ document_statistic_reader(document_name, meta_info_accessor)
{}
//#####################################
void
writer_document_statistic_reader::fill_description_section(CMetaInfoReader
*meta_info_accessor, statistic_group_list_t* group_list)
{
- statistic_item_list_t il;
-
- il.push_back(statistic_item(GetResString(IDS_TITLE),
meta_info_accessor->getTagData( META_INFO_TITLE ), READONLY));
- il.push_back(statistic_item(GetResString(IDS_COMMENTS),
meta_info_accessor->getTagData( META_INFO_DESCRIPTION ), READONLY));
- il.push_back(statistic_item(GetResString(IDS_SUBJECT),
meta_info_accessor->getTagData( META_INFO_SUBJECT ), READONLY));
- il.push_back(statistic_item(GetResString(IDS_KEYWORDS),
meta_info_accessor->getTagData(META_INFO_KEYWORDS ), READONLY));
- il.push_back(statistic_item(GetResString(IDS_PAGES),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_PAGES) , READONLY));
- il.push_back(statistic_item(GetResString(IDS_TABLES),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_TABLES) , READONLY));
- il.push_back(statistic_item(GetResString(IDS_GRAPHICS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_DRAWS) , READONLY));
- il.push_back(statistic_item(GetResString(IDS_OLE_OBJECTS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_OBJECTS) , READONLY));
- il.push_back(statistic_item(GetResString(IDS_PARAGRAPHS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_PARAGRAPHS) , READONLY));
- il.push_back(statistic_item(GetResString(IDS_WORDS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_WORDS) , READONLY));
- il.push_back(statistic_item(GetResString(IDS_CHARACTERS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_CHARACTERS) , READONLY));
-
- group_list->push_back(statistic_group_t(GetResString(IDS_DESCRIPTION),
il));
+ statistic_item_list_t il;
+
+ il.push_back(statistic_item(GetResString(IDS_TITLE),
meta_info_accessor->getTagData( META_INFO_TITLE ), READONLY));
+ il.push_back(statistic_item(GetResString(IDS_COMMENTS),
meta_info_accessor->getTagData( META_INFO_DESCRIPTION ), READONLY));
+ il.push_back(statistic_item(GetResString(IDS_SUBJECT),
meta_info_accessor->getTagData( META_INFO_SUBJECT ), READONLY));
+ il.push_back(statistic_item(GetResString(IDS_KEYWORDS),
meta_info_accessor->getTagData(META_INFO_KEYWORDS ), READONLY));
+ il.push_back(statistic_item(GetResString(IDS_PAGES),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_PAGES) , READONLY));
+ il.push_back(statistic_item(GetResString(IDS_TABLES),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_TABLES) , READONLY));
+ il.push_back(statistic_item(GetResString(IDS_GRAPHICS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_DRAWS) , READONLY));
+ il.push_back(statistic_item(GetResString(IDS_OLE_OBJECTS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_OBJECTS) , READONLY));
+ il.push_back(statistic_item(GetResString(IDS_PARAGRAPHS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_PARAGRAPHS) , READONLY));
+ il.push_back(statistic_item(GetResString(IDS_WORDS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_WORDS) , READONLY));
+ il.push_back(statistic_item(GetResString(IDS_CHARACTERS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_CHARACTERS) , READONLY));
+
+ group_list->push_back(statistic_group_t(GetResString(IDS_DESCRIPTION),
il));
}
-
+
//#######################################
calc_document_statistic_reader::calc_document_statistic_reader(
- const std::string& document_name, CMetaInfoReader* meta_info_accessor) :
- document_statistic_reader(document_name, meta_info_accessor)
+ const std::string& document_name, CMetaInfoReader* meta_info_accessor) :
+ document_statistic_reader(document_name, meta_info_accessor)
{}
//#######################################
void calc_document_statistic_reader::fill_description_section(
- CMetaInfoReader *meta_info_accessor,statistic_group_list_t* group_list)
+ CMetaInfoReader *meta_info_accessor,statistic_group_list_t* group_list)
{
- statistic_item_list_t il;
-
- il.push_back(statistic_item(GetResString(IDS_TITLE),
meta_info_accessor->getTagData( META_INFO_TITLE ), READONLY));
- il.push_back(statistic_item(GetResString(IDS_COMMENTS),
meta_info_accessor->getTagData( META_INFO_DESCRIPTION ), READONLY));
- il.push_back(statistic_item(GetResString(IDS_SUBJECT),
meta_info_accessor->getTagData( META_INFO_SUBJECT ), READONLY));
- il.push_back(statistic_item(GetResString(IDS_KEYWORDS),
meta_info_accessor->getTagData(META_INFO_KEYWORDS ), READONLY));
- il.push_back(statistic_item(GetResString(IDS_TABLES),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_TABLES) , READONLY));
- il.push_back(statistic_item(GetResString(IDS_CELLS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_CELLS) , READONLY));
- il.push_back(statistic_item(GetResString(IDS_OLE_OBJECTS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_OBJECTS) , READONLY));
-
- group_list->push_back(statistic_group_t(GetResString(IDS_DESCRIPTION),
il));
+ statistic_item_list_t il;
+
+ il.push_back(statistic_item(GetResString(IDS_TITLE),
meta_info_accessor->getTagData( META_INFO_TITLE ), READONLY));
+ il.push_back(statistic_item(GetResString(IDS_COMMENTS),
meta_info_accessor->getTagData( META_INFO_DESCRIPTION ), READONLY));
+ il.push_back(statistic_item(GetResString(IDS_SUBJECT),
meta_info_accessor->getTagData( META_INFO_SUBJECT ), READONLY));
+ il.push_back(statistic_item(GetResString(IDS_KEYWORDS),
meta_info_accessor->getTagData(META_INFO_KEYWORDS ), READONLY));
+ il.push_back(statistic_item(GetResString(IDS_TABLES),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_TABLES) , READONLY));
+ il.push_back(statistic_item(GetResString(IDS_CELLS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_CELLS) , READONLY));
+ il.push_back(statistic_item(GetResString(IDS_OLE_OBJECTS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_OBJECTS) , READONLY));
+
+ group_list->push_back(statistic_group_t(GetResString(IDS_DESCRIPTION),
il));
}
//#######################################
draw_impress_math_document_statistic_reader::draw_impress_math_document_statistic_reader(
- const std::string& document_name, CMetaInfoReader* meta_info_accessor) :
- document_statistic_reader(document_name, meta_info_accessor)
+ const std::string& document_name, CMetaInfoReader* meta_info_accessor) :
+ document_statistic_reader(document_name, meta_info_accessor)
{}
//#######################################
void draw_impress_math_document_statistic_reader::fill_description_section(
- CMetaInfoReader *meta_info_accessor, statistic_group_list_t* group_list)
+ CMetaInfoReader *meta_info_accessor, statistic_group_list_t* group_list)
{
- statistic_item_list_t il;
-
- il.push_back(statistic_item(GetResString(IDS_TITLE),
meta_info_accessor->getTagData( META_INFO_TITLE ), READONLY));
- il.push_back(statistic_item(GetResString(IDS_COMMENTS),
meta_info_accessor->getTagData( META_INFO_DESCRIPTION ), READONLY));
- il.push_back(statistic_item(GetResString(IDS_SUBJECT),
meta_info_accessor->getTagData( META_INFO_SUBJECT ), READONLY));
- il.push_back(statistic_item(GetResString(IDS_KEYWORDS),
meta_info_accessor->getTagData(META_INFO_KEYWORDS ), READONLY));
- il.push_back(statistic_item(GetResString(IDS_PAGES),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_PAGES) , READONLY));
- il.push_back(statistic_item(GetResString(IDS_OLE_OBJECTS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_OBJECTS) , READONLY));
-
- group_list->push_back(statistic_group_t(GetResString(IDS_DESCRIPTION),
il));
+ statistic_item_list_t il;
+
+ il.push_back(statistic_item(GetResString(IDS_TITLE),
meta_info_accessor->getTagData( META_INFO_TITLE ), READONLY));
+ il.push_back(statistic_item(GetResString(IDS_COMMENTS),
meta_info_accessor->getTagData( META_INFO_DESCRIPTION ), READONLY));
+ il.push_back(statistic_item(GetResString(IDS_SUBJECT),
meta_info_accessor->getTagData( META_INFO_SUBJECT ), READONLY));
+ il.push_back(statistic_item(GetResString(IDS_KEYWORDS),
meta_info_accessor->getTagData(META_INFO_KEYWORDS ), READONLY));
+ il.push_back(statistic_item(GetResString(IDS_PAGES),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_PAGES) , READONLY));
+ il.push_back(statistic_item(GetResString(IDS_OLE_OBJECTS),
meta_info_accessor->getTagAttribute(
META_INFO_DOCUMENT_STATISTIC,META_INFO_OBJECTS) , READONLY));
+
+ group_list->push_back(statistic_group_t(GetResString(IDS_DESCRIPTION),
il));
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git
a/main/shell/source/win32/shlxthandler/propsheets/document_statistic.hxx
b/main/shell/source/win32/shlxthandler/propsheets/document_statistic.hxx
index 1fa94e64c4..b6872d6fe9 100644
--- a/main/shell/source/win32/shlxthandler/propsheets/document_statistic.hxx
+++ b/main/shell/source/win32/shlxthandler/propsheets/document_statistic.hxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -36,20 +36,20 @@
struct statistic_item
{
- statistic_item();
-
- statistic_item(
- const std::wstring& title,
- const std::wstring& value,
- bool editable) :
- title_(title),
- value_(value),
- editable_(editable)
- {}
-
- std::wstring title_;
- std::wstring value_;
- bool editable_;
+ statistic_item();
+
+ statistic_item(
+ const std::wstring& title,
+ const std::wstring& value,
+ bool editable) :
+ title_(title),
+ value_(value),
+ editable_(editable)
+ {}
+
+ std::wstring title_;
+ std::wstring value_;
+ bool editable_;
};
//------------------------------------
@@ -75,26 +75,26 @@ document_statistic_reader_ptr
create_document_statistic_reader(const std::string
class document_statistic_reader
{
-public:
- virtual ~document_statistic_reader();
-
- void read(statistic_group_list_t* group_list);
-
- std::string get_document_name() const;
-
+public:
+ virtual ~document_statistic_reader();
+
+ void read(statistic_group_list_t* group_list);
+
+ std::string get_document_name() const;
+
protected:
- document_statistic_reader(const std::string& document_name,
CMetaInfoReader* meta_info_accessor);
-
- virtual void fill_description_section(CMetaInfoReader
*meta_info_accessor,statistic_group_list_t* group_list) = 0;
-
- virtual void fill_origin_section( CMetaInfoReader
*meta_info_accessor,statistic_group_list_t* group_list);
-
+ document_statistic_reader(const std::string& document_name,
CMetaInfoReader* meta_info_accessor);
+
+ virtual void fill_description_section(CMetaInfoReader
*meta_info_accessor,statistic_group_list_t* group_list) = 0;
+
+ virtual void fill_origin_section( CMetaInfoReader
*meta_info_accessor,statistic_group_list_t* group_list);
+
private:
- std::string document_name_;
+ std::string document_name_;
CMetaInfoReader* meta_info_accessor_;
-
- friend document_statistic_reader_ptr create_document_statistic_reader(
- const std::string& document_name, CMetaInfoReader* meta_info_accessor);
+
+ friend document_statistic_reader_ptr create_document_statistic_reader(
+ const std::string& document_name, CMetaInfoReader*
meta_info_accessor);
};
//------------------------------------
@@ -104,12 +104,12 @@ private:
class writer_document_statistic_reader : public document_statistic_reader
{
protected:
- writer_document_statistic_reader(const std::string& document_name,
CMetaInfoReader* meta_info_accessor);
-
- virtual void fill_description_section(CMetaInfoReader *meta_info_accessor,
statistic_group_list_t* group_list);
-
- friend document_statistic_reader_ptr create_document_statistic_reader(
- const std::string& document_name, CMetaInfoReader* meta_info_accessor);
+ writer_document_statistic_reader(const std::string& document_name,
CMetaInfoReader* meta_info_accessor);
+
+ virtual void fill_description_section(CMetaInfoReader
*meta_info_accessor, statistic_group_list_t* group_list);
+
+ friend document_statistic_reader_ptr create_document_statistic_reader(
+ const std::string& document_name, CMetaInfoReader*
meta_info_accessor);
};
//------------------------------------
@@ -119,12 +119,12 @@ protected:
class calc_document_statistic_reader : public document_statistic_reader
{
protected:
- calc_document_statistic_reader(const std::string& document_name,
CMetaInfoReader* meta_info_accessor);
-
- virtual void fill_description_section( CMetaInfoReader
*meta_info_accessor,statistic_group_list_t* group_list);
-
- friend document_statistic_reader_ptr create_document_statistic_reader(
- const std::string& document_name, CMetaInfoReader* meta_info_accessor);
+ calc_document_statistic_reader(const std::string& document_name,
CMetaInfoReader* meta_info_accessor);
+
+ virtual void fill_description_section( CMetaInfoReader
*meta_info_accessor,statistic_group_list_t* group_list);
+
+ friend document_statistic_reader_ptr create_document_statistic_reader(
+ const std::string& document_name, CMetaInfoReader*
meta_info_accessor);
};
//------------------------------------
@@ -134,12 +134,14 @@ protected:
class draw_impress_math_document_statistic_reader : public
document_statistic_reader
{
protected:
- draw_impress_math_document_statistic_reader(const std::string&
document_name, CMetaInfoReader* meta_info_accessor);
-
- virtual void fill_description_section(CMetaInfoReader *meta_info_accessor,
statistic_group_list_t* group_list);
-
- friend document_statistic_reader_ptr create_document_statistic_reader(
- const std::string& document_name, CMetaInfoReader* meta_info_accessor);
+ draw_impress_math_document_statistic_reader(const std::string&
document_name, CMetaInfoReader* meta_info_accessor);
+
+ virtual void fill_description_section(CMetaInfoReader
*meta_info_accessor, statistic_group_list_t* group_list);
+
+ friend document_statistic_reader_ptr create_document_statistic_reader(
+ const std::string& document_name, CMetaInfoReader*
meta_info_accessor);
};
#endif
+
+/* vim: set noet sw=4 ts=4: */
diff --git
a/main/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx
b/main/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx
index 28682c705b..ea7d0bd9b4 100644
--- a/main/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx
+++ b/main/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -29,7 +29,7 @@
#endif
//------------------------------------
-// include
+// include
//------------------------------------
#include "listviewbuilder.hxx"
#include "document_statistic.hxx"
@@ -42,7 +42,7 @@
#include <commctrl.h>
#if defined _MSC_VER
#pragma warning(pop)
-#endif
+#endif
#include <commctrl.h>
#include <tchar.h>
#include "internal/resource.h"
@@ -52,12 +52,12 @@
//------------------------------------
list_view_builder_ptr create_list_view_builder(
- HWND hwnd_lv, const std::wstring& col1, const std::wstring& col2)
-{
- if (is_windows_xp_or_above())
- return list_view_builder_ptr(new winxp_list_view_builder(hwnd_lv,
col1, col2));
- else
- return list_view_builder_ptr(new list_view_builder(hwnd_lv, col1,
col2));
+ HWND hwnd_lv, const std::wstring& col1, const std::wstring& col2)
+{
+ if (is_windows_xp_or_above())
+ return list_view_builder_ptr(new
winxp_list_view_builder(hwnd_lv, col1, col2));
+ else
+ return list_view_builder_ptr(new list_view_builder(hwnd_lv,
col1, col2));
}
//------------------------------------
@@ -65,13 +65,13 @@ list_view_builder_ptr create_list_view_builder(
//------------------------------------
list_view_builder::list_view_builder(
- HWND hwnd_list_view,
- const std::wstring& column1_title,
- const std::wstring& column2_title) :
- hwnd_list_view_(hwnd_list_view),
- row_index_(-1),
- column1_title_(column1_title),
- column2_title_(column2_title)
+ HWND hwnd_list_view,
+ const std::wstring& column1_title,
+ const std::wstring& column2_title) :
+ hwnd_list_view_(hwnd_list_view),
+ row_index_(-1),
+ column1_title_(column1_title),
+ column2_title_(column2_title)
{
}
@@ -89,22 +89,22 @@ list_view_builder::~list_view_builder()
void list_view_builder::build(statistic_group_list_t& gl)
{
- setup_list_view();
-
- statistic_group_list_t::iterator group_iter = gl.begin();
- statistic_group_list_t::iterator group_iter_end = gl.end();
-
- for (/**/; group_iter != group_iter_end; ++group_iter)
- {
- statistic_item_list_t::iterator item_iter =
group_iter->second.begin();
- statistic_item_list_t::iterator item_iter_end =
group_iter->second.end();
-
- if (item_iter != item_iter_end)
- insert_group(group_iter->first);
-
- for (/**/; item_iter != item_iter_end; ++item_iter)
- insert_item(item_iter->title_, item_iter->value_,
item_iter->editable_);
- }
+ setup_list_view();
+
+ statistic_group_list_t::iterator group_iter = gl.begin();
+ statistic_group_list_t::iterator group_iter_end = gl.end();
+
+ for (/**/; group_iter != group_iter_end; ++group_iter)
+ {
+ statistic_item_list_t::iterator item_iter =
group_iter->second.begin();
+ statistic_item_list_t::iterator item_iter_end =
group_iter->second.end();
+
+ if (item_iter != item_iter_end)
+ insert_group(group_iter->first);
+
+ for (/**/; item_iter != item_iter_end; ++item_iter)
+ insert_item(item_iter->title_, item_iter->value_,
item_iter->editable_);
+ }
}
//------------------------------------
@@ -113,74 +113,74 @@ void list_view_builder::build(statistic_group_list_t& gl)
void list_view_builder::setup_list_view()
{
- HIMAGELIST h_ils = ImageList_Create(16,15,ILC_MASK, 7, 0);
- HBITMAP h_bmp = LoadBitmap(GetModuleHandle(MODULE_NAME),
MAKEINTRESOURCE(IDB_PROPERTY_IMAGES));
- ImageList_AddMasked(h_ils, h_bmp, RGB(255, 0, 255));
-
- ListView_SetImageList(hwnd_list_view_, h_ils, LVSIL_SMALL);
-
+ HIMAGELIST h_ils = ImageList_Create(16,15,ILC_MASK, 7, 0);
+ HBITMAP h_bmp = LoadBitmap(GetModuleHandle(MODULE_NAME),
MAKEINTRESOURCE(IDB_PROPERTY_IMAGES));
+ ImageList_AddMasked(h_ils, h_bmp, RGB(255, 0, 255));
+
+ ListView_SetImageList(hwnd_list_view_, h_ils, LVSIL_SMALL);
+
std::wstring header = GetResString(IDS_PROPERTY);
- LVCOLUMN lvc;
- lvc.mask = LVCF_FMT |
- LVCF_WIDTH |
- LVCF_TEXT |
- LVCF_SUBITEM;
-
+ LVCOLUMN lvc;
+ lvc.mask = LVCF_FMT |
+ LVCF_WIDTH |
+ LVCF_TEXT |
+ LVCF_SUBITEM;
+
lvc.iSubItem = 0;
- lvc.pszText = const_cast<wchar_t*>(header.c_str());
- lvc.cx = 120;
- lvc.fmt = LVCFMT_LEFT;
+ lvc.pszText = const_cast<wchar_t*>(header.c_str());
+ lvc.cx = 120;
+ lvc.fmt = LVCFMT_LEFT;
- ListView_InsertColumn(hwnd_list_view_, 0, &lvc);
+ ListView_InsertColumn(hwnd_list_view_, 0, &lvc);
lvc.iSubItem = 1;
header = GetResString(IDS_PROPERTY_VALUE);
lvc.pszText = const_cast<wchar_t*>(header.c_str());
- ListView_InsertColumn(hwnd_list_view_, 1, &lvc);
+ ListView_InsertColumn(hwnd_list_view_, 1, &lvc);
}
//------------------------------------
//
//------------------------------------
-
+
void list_view_builder::insert_group(const std::wstring& /*title*/)
{
- insert_item(L"", L"", false);
+ insert_item(L"", L"", false);
}
//------------------------------------
//
//------------------------------------
-
+
void list_view_builder::insert_item(const std::wstring& title, const
std::wstring& value, bool is_editable)
{
- LVITEM lvi;
-
+ LVITEM lvi;
+
lvi.iItem = ++row_index_;
lvi.iSubItem = 0;
- lvi.mask = LVIF_TEXT;
- lvi.state = 0;
+ lvi.mask = LVIF_TEXT;
+ lvi.state = 0;
lvi.cchTextMax = title.size() + 1;
- lvi.stateMask = 0;
- lvi.pszText = const_cast<wchar_t*>(title.c_str());
-
+ lvi.stateMask = 0;
+ lvi.pszText = const_cast<wchar_t*>(title.c_str());
+
if (title.length() > 0)
{
lvi.mask |= LVIF_IMAGE;
-
+
if (is_editable)
- lvi.iImage = 4;
+ lvi.iImage = 4;
else
- lvi.iImage = 3;
+ lvi.iImage = 3;
}
-
- ListView_InsertItem(hwnd_list_view_, &lvi);
-
- lvi.mask = LVIF_TEXT;
+
+ ListView_InsertItem(hwnd_list_view_, &lvi);
+
+ lvi.mask = LVIF_TEXT;
lvi.iSubItem = 1;
lvi.pszText = const_cast<wchar_t*>(value.c_str());
-
- ListView_SetItem(hwnd_list_view_, &lvi);
+
+ ListView_SetItem(hwnd_list_view_, &lvi);
}
//------------------------------------
@@ -189,7 +189,7 @@ void list_view_builder::insert_item(const std::wstring&
title, const std::wstrin
HWND list_view_builder::get_list_view() const
{
- return hwnd_list_view_;
+ return hwnd_list_view_;
}
//------------------------------------
@@ -197,12 +197,12 @@ HWND list_view_builder::get_list_view() const
//------------------------------------
winxp_list_view_builder::winxp_list_view_builder(
- HWND hwnd_list_view,
- const std::wstring& column1_title,
- const std::wstring& column2_title) :
- list_view_builder(hwnd_list_view, column1_title, column2_title),
- group_count_(-1),
- row_count_(0)
+ HWND hwnd_list_view,
+ const std::wstring& column1_title,
+ const std::wstring& column2_title) :
+ list_view_builder(hwnd_list_view, column1_title, column2_title),
+ group_count_(-1),
+ row_count_(0)
{
}
@@ -212,30 +212,30 @@ winxp_list_view_builder::winxp_list_view_builder(
void winxp_list_view_builder::setup_list_view()
{
- list_view_builder::setup_list_view();
-
- ListView_EnableGroupView(get_list_view(), TRUE);
+ list_view_builder::setup_list_view();
+
+ ListView_EnableGroupView(get_list_view(), TRUE);
}
//------------------------------------
//
//------------------------------------
-
+
void winxp_list_view_builder::insert_group(const std::wstring& name)
-{
- LVGROUP lvg;
-
- ZeroMemory(&lvg, sizeof(lvg));
-
- lvg.cbSize = sizeof(lvg);
- lvg.mask = LVGF_HEADER | LVGF_STATE | LVGF_GROUPID;
- lvg.pszHeader = const_cast<wchar_t*>(name.c_str());
- lvg.cchHeader = name.size() + 1;
- lvg.iGroupId = ++group_count_;
- lvg.state = LVGS_NORMAL;
- lvg.uAlign = LVGA_HEADER_CENTER;
-
- ListView_InsertGroup(get_list_view(), row_count_++, &lvg);
+{
+ LVGROUP lvg;
+
+ ZeroMemory(&lvg, sizeof(lvg));
+
+ lvg.cbSize = sizeof(lvg);
+ lvg.mask = LVGF_HEADER | LVGF_STATE | LVGF_GROUPID;
+ lvg.pszHeader = const_cast<wchar_t*>(name.c_str());
+ lvg.cchHeader = name.size() + 1;
+ lvg.iGroupId = ++group_count_;
+ lvg.state = LVGS_NORMAL;
+ lvg.uAlign = LVGA_HEADER_CENTER;
+
+ ListView_InsertGroup(get_list_view(), row_count_++, &lvg);
}
//------------------------------------
@@ -243,35 +243,37 @@ void winxp_list_view_builder::insert_group(const
std::wstring& name)
//------------------------------------
void winxp_list_view_builder::insert_item(
- const std::wstring& title, const std::wstring& value, bool is_editable)
-{
- LVITEM lvi;
-
+ const std::wstring& title, const std::wstring& value, bool is_editable)
+{
+ LVITEM lvi;
+
lvi.iItem = ++row_index_;
lvi.iSubItem = 0;
- lvi.mask = LVIF_TEXT | LVIF_GROUPID;
- lvi.state = 0;
- lvi.stateMask = 0;
- lvi.pszText = const_cast<wchar_t*>(title.c_str());
+ lvi.mask = LVIF_TEXT | LVIF_GROUPID;
+ lvi.state = 0;
+ lvi.stateMask = 0;
+ lvi.pszText = const_cast<wchar_t*>(title.c_str());
lvi.iGroupId = group_count_;
-
+
if (title.length() > 0)
{
lvi.mask |= LVIF_IMAGE;
-
+
if (is_editable)
- lvi.iImage = 4;
+ lvi.iImage = 4;
else
- lvi.iImage = 3;
+ lvi.iImage = 3;
}
-
- ListView_InsertItem(get_list_view(), &lvi);
-
+
+ ListView_InsertItem(get_list_view(), &lvi);
+
lvi.mask = LVIF_TEXT;
lvi.iSubItem = 1;
lvi.pszText = const_cast<wchar_t*>(value.c_str());
-
- ListView_SetItem(get_list_view(), &lvi);
-
- row_count_++;
+
+ ListView_SetItem(get_list_view(), &lvi);
+
+ row_count_++;
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git
a/main/shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx
b/main/shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx
index 878139a693..0a47060430 100644
--- a/main/shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx
+++ b/main/shell/source/win32/shlxthandler/propsheets/listviewbuilder.hxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -25,7 +25,7 @@
#define LISTVIEWBUILDER_HXX_INCLUDED
//------------------------------------
-// include
+// include
//------------------------------------
#if defined _MSC_VER
@@ -34,7 +34,7 @@
#include <windows.h>
#if defined _MSC_VER
#pragma warning(pop)
-#endif
+#endif
#include <string>
#include <memory>
@@ -49,40 +49,40 @@ typedef std::auto_ptr<list_view_builder>
list_view_builder_ptr;
// factory method for list_view_builder
list_view_builder_ptr create_list_view_builder(
- HWND hwnd_lv, const std::wstring& col1, const std::wstring& col2);
-
+ HWND hwnd_lv, const std::wstring& col1, const std::wstring& col2);
+
//------------------------------------
//
//------------------------------------
class list_view_builder
-{
-public:
- virtual ~list_view_builder();
-
- void build(statistic_group_list_t& gl);
-
+{
+public:
+ virtual ~list_view_builder();
+
+ void build(statistic_group_list_t& gl);
+
protected:
- list_view_builder(
- HWND hwnd_list_view,
- const std::wstring& column1_title,
- const std::wstring& column2_title);
-
- virtual void setup_list_view();
- virtual void insert_group(const std::wstring& title);
- virtual void insert_item(const std::wstring& title, const std::wstring&
value, bool is_editable);
-
- HWND get_list_view() const;
- int get_current_row() const;
-
- int row_index_;
-
+ list_view_builder(
+ HWND hwnd_list_view,
+ const std::wstring& column1_title,
+ const std::wstring& column2_title);
+
+ virtual void setup_list_view();
+ virtual void insert_group(const std::wstring& title);
+ virtual void insert_item(const std::wstring& title, const std::wstring&
value, bool is_editable);
+
+ HWND get_list_view() const;
+ int get_current_row() const;
+
+ int row_index_;
+
private:
- HWND hwnd_list_view_;
- std::wstring column1_title_;
- std::wstring column2_title_;
-
- friend list_view_builder_ptr create_list_view_builder(HWND hwnd_lv, const
std::wstring& col1, const std::wstring& col2);
+ HWND hwnd_list_view_;
+ std::wstring column1_title_;
+ std::wstring column2_title_;
+
+ friend list_view_builder_ptr create_list_view_builder(HWND hwnd_lv,
const std::wstring& col1, const std::wstring& col2);
};
//------------------------------------
@@ -92,20 +92,22 @@ private:
class winxp_list_view_builder : public list_view_builder
{
protected:
- winxp_list_view_builder(
- HWND hwnd_list_view,
- const std::wstring& column1_title,
- const std::wstring& column2_title);
-
- virtual void setup_list_view();
- virtual void insert_group(const std::wstring& name);
- virtual void insert_item(const std::wstring& title, const std::wstring&
value, bool is_editable);
-
+ winxp_list_view_builder(
+ HWND hwnd_list_view,
+ const std::wstring& column1_title,
+ const std::wstring& column2_title);
+
+ virtual void setup_list_view();
+ virtual void insert_group(const std::wstring& name);
+ virtual void insert_item(const std::wstring& title, const std::wstring&
value, bool is_editable);
+
private:
- int group_count_;
- int row_count_;
-
- friend list_view_builder_ptr create_list_view_builder(HWND hwnd_lv, const
std::wstring& col1, const std::wstring& col2);
+ int group_count_;
+ int row_count_;
+
+ friend list_view_builder_ptr create_list_view_builder(HWND hwnd_lv,
const std::wstring& col1, const std::wstring& col2);
};
#endif
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
b/main/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
index 65c1458ce9..88d10bd25f 100644
--- a/main/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
+++ b/main/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -39,7 +39,7 @@
#include <shellapi.h>
#if defined _MSC_VER
#pragma warning(pop)
-#endif
+#endif
#include <string>
#include <vector>
@@ -50,7 +50,7 @@
/*---------------------------------------------
INFO - INFO - INFO - INFO - INFO - INFO
- See MSDN "Using Windows XP Visual Styles"
+ See MSDN "Using Windows XP Visual Styles"
for hints how to enable the new common
control library for our property sheet.
@@ -61,10 +61,10 @@
//
//-----------------------------
-CPropertySheet::CPropertySheet(long RefCnt) :
+CPropertySheet::CPropertySheet(long RefCnt) :
m_RefCnt(RefCnt)
{
- OutputDebugStringFormat("CPropertySheet::CTor [%d], [%d]", m_RefCnt,
g_DllRefCnt );
+ OutputDebugStringFormat("CPropertySheet::CTor [%d], [%d]", m_RefCnt,
g_DllRefCnt );
InterlockedIncrement(&g_DllRefCnt);
}
@@ -74,7 +74,7 @@ CPropertySheet::CPropertySheet(long RefCnt) :
CPropertySheet::~CPropertySheet()
{
- OutputDebugStringFormat("CPropertySheet::DTor [%d], [%d]", m_RefCnt,
g_DllRefCnt );
+ OutputDebugStringFormat("CPropertySheet::DTor [%d], [%d]", m_RefCnt,
g_DllRefCnt );
InterlockedDecrement(&g_DllRefCnt);
}
@@ -86,7 +86,7 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::QueryInterface(
REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject)
{
*ppvObject = 0;
-
+
IUnknown* pUnk = 0;
if (IID_IUnknown == riid || IID_IShellExtInit == riid)
{
@@ -105,24 +105,24 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::QueryInterface(
return E_NOINTERFACE;
}
-
+
//-----------------------------
//
//-----------------------------
-
+
ULONG STDMETHODCALLTYPE CPropertySheet::AddRef(void)
{
- OutputDebugStringFormat("CPropertySheet::AddRef [%d]", m_RefCnt );
+ OutputDebugStringFormat("CPropertySheet::AddRef [%d]", m_RefCnt );
return InterlockedIncrement(&m_RefCnt);
}
//-----------------------------
//
//-----------------------------
-
+
ULONG STDMETHODCALLTYPE CPropertySheet::Release(void)
{
- OutputDebugStringFormat("CPropertySheet::Release [%d]", m_RefCnt );
+ OutputDebugStringFormat("CPropertySheet::Release [%d]", m_RefCnt );
long refcnt = InterlockedDecrement(&m_RefCnt);
if (0 == refcnt)
@@ -134,52 +134,52 @@ ULONG STDMETHODCALLTYPE CPropertySheet::Release(void)
//-----------------------------
// IShellExtInit
//-----------------------------
-
+
HRESULT STDMETHODCALLTYPE CPropertySheet::Initialize(
LPCITEMIDLIST /*pidlFolder*/, LPDATAOBJECT lpdobj, HKEY /*hkeyProgID*/)
-{
+{
InitCommonControls();
STGMEDIUM medium;
FORMATETC fe = {CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
-
+
HRESULT hr = lpdobj->GetData(&fe, &medium);
-
+
// save the file name
- if (SUCCEEDED(hr) &&
+ if (SUCCEEDED(hr) &&
(1 == DragQueryFileA(
- reinterpret_cast<HDROP>(medium.hGlobal),
- 0xFFFFFFFF,
- NULL,
- 0)))
+ reinterpret_cast<HDROP>(medium.hGlobal),
+ 0xFFFFFFFF,
+ NULL,
+ 0)))
{
- UINT size = DragQueryFile( reinterpret_cast<HDROP>(medium.hGlobal),
0, 0, 0 );
- if ( size != 0 )
- {
- TCHAR * buffer = new TCHAR[ size + 1 ];
- UINT result_size = DragQueryFile(
reinterpret_cast<HDROP>(medium.hGlobal),
- 0, buffer, size + 1 );
- if ( result_size != 0 )
- {
- std::wstring fname = getShortPathName( buffer );
- std::string fnameA = WStringToString( fname );
- ZeroMemory( m_szFileName, sizeof( m_szFileName ) );
- strncpy( m_szFileName, fnameA.c_str(), ( sizeof(
m_szFileName ) - 1 ) );
- hr = S_OK;
- }
- else
- hr = E_INVALIDARG;
- delete [] buffer;
- }
- else
- hr = E_INVALIDARG;
- }
- else
- hr = E_INVALIDARG;
+ UINT size = DragQueryFile(
reinterpret_cast<HDROP>(medium.hGlobal), 0, 0, 0 );
+ if ( size != 0 )
+ {
+ TCHAR * buffer = new TCHAR[ size + 1 ];
+ UINT result_size = DragQueryFile(
reinterpret_cast<HDROP>(medium.hGlobal),
+
0, buffer, size + 1 );
+ if ( result_size != 0 )
+ {
+ std::wstring fname = getShortPathName( buffer );
+ std::string fnameA = WStringToString( fname );
+ ZeroMemory( m_szFileName, sizeof( m_szFileName
) );
+ strncpy( m_szFileName, fnameA.c_str(), (
sizeof( m_szFileName ) - 1 ) );
+ hr = S_OK;
+ }
+ else
+ hr = E_INVALIDARG;
+ delete [] buffer;
+ }
+ else
+ hr = E_INVALIDARG;
+ }
+ else
+ hr = E_INVALIDARG;
ReleaseStgMedium(&medium);
- return hr;
+ return hr;
}
//-----------------------------
@@ -188,13 +188,13 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::Initialize(
HRESULT STDMETHODCALLTYPE CPropertySheet::AddPages(LPFNADDPROPSHEETPAGE
lpfnAddPage, LPARAM lParam)
{
- // Get OS version (we don't need the summary page on Windows Vista or
later)
- OSVERSIONINFO sInfoOS;
+ // Get OS version (we don't need the summary page on Windows Vista or
later)
+ OSVERSIONINFO sInfoOS;
- ZeroMemory( &sInfoOS, sizeof(OSVERSIONINFO) );
- sInfoOS.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
- GetVersionEx( &sInfoOS );
- bool bIsVistaOrLater = (sInfoOS.dwMajorVersion >= 6);
+ ZeroMemory( &sInfoOS, sizeof(OSVERSIONINFO) );
+ sInfoOS.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
+ GetVersionEx( &sInfoOS );
+ bool bIsVistaOrLater = (sInfoOS.dwMajorVersion >= 6);
std::wstring proppage_header;
@@ -202,55 +202,55 @@ HRESULT STDMETHODCALLTYPE
CPropertySheet::AddPages(LPFNADDPROPSHEETPAGE lpfnAddP
ZeroMemory(&psp, sizeof(PROPSHEETPAGEA));
// add the summary property page
- psp.dwSize = sizeof(PROPSHEETPAGE);
- psp.dwFlags = PSP_DEFAULT | PSP_USETITLE | PSP_USECALLBACK;
- psp.hInstance = GetModuleHandle(MODULE_NAME);
- psp.lParam = reinterpret_cast<LPARAM>(this);
+ psp.dwSize = sizeof(PROPSHEETPAGE);
+ psp.dwFlags = PSP_DEFAULT | PSP_USETITLE | PSP_USECALLBACK;
+ psp.hInstance = GetModuleHandle(MODULE_NAME);
+ psp.lParam = reinterpret_cast<LPARAM>(this);
psp.pfnCallback =
reinterpret_cast<LPFNPSPCALLBACK>(CPropertySheet::PropPageSummaryCallback);
- HPROPSHEETPAGE hPage = NULL;
+ HPROPSHEETPAGE hPage = NULL;
if ( !bIsVistaOrLater )
{
- proppage_header = GetResString(IDS_PROPPAGE_SUMMARY_TITLE);
+ proppage_header = GetResString(IDS_PROPPAGE_SUMMARY_TITLE);
- psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_SUMMARY);
- psp.pszTitle = proppage_header.c_str();
- psp.pfnDlgProc =
reinterpret_cast<DLGPROC>(CPropertySheet::PropPageSummaryProc);
+ psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_SUMMARY);
+ psp.pszTitle = proppage_header.c_str();
+ psp.pfnDlgProc =
reinterpret_cast<DLGPROC>(CPropertySheet::PropPageSummaryProc);
- hPage = CreatePropertySheetPage(&psp);
+ hPage = CreatePropertySheetPage(&psp);
- // keep this instance alive, will be released when the
- // the page is about to be destroyed in the callback function
+ // keep this instance alive, will be released when the
+ // the page is about to be destroyed in the callback function
- if (hPage)
- {
- if (lpfnAddPage(hPage, lParam))
- AddRef();
- else
- DestroyPropertySheetPage(hPage);
- }
+ if (hPage)
+ {
+ if (lpfnAddPage(hPage, lParam))
+ AddRef();
+ else
+ DestroyPropertySheetPage(hPage);
+ }
}
// add the statistics property page
proppage_header = GetResString(IDS_PROPPAGE_STATISTICS_TITLE);
- psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_STATISTICS);
- psp.pszTitle = proppage_header.c_str();
- psp.pfnDlgProc =
reinterpret_cast<DLGPROC>(CPropertySheet::PropPageStatisticsProc);
+ psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_STATISTICS);
+ psp.pszTitle = proppage_header.c_str();
+ psp.pfnDlgProc =
reinterpret_cast<DLGPROC>(CPropertySheet::PropPageStatisticsProc);
+
+ hPage = CreatePropertySheetPage(&psp);
- hPage = CreatePropertySheetPage(&psp);
-
- if (hPage)
+ if (hPage)
{
- if (lpfnAddPage(hPage, lParam))
+ if (lpfnAddPage(hPage, lParam))
AddRef();
else
DestroyPropertySheetPage(hPage);
}
// always return success else
- // no property sheet will be
+ // no property sheet will be
// displayed at all
return NOERROR;
}
@@ -272,10 +272,10 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::ReplacePage(
UINT CALLBACK CPropertySheet::PropPageSummaryCallback(
HWND /*hwnd*/, UINT uMsg, LPPROPSHEETPAGE ppsp)
{
- CPropertySheet* pImpl =
+ CPropertySheet* pImpl =
reinterpret_cast<CPropertySheet*>(ppsp->lParam);
- // release this instance, acquired
+ // release this instance, acquired
// in the AddPages method
if (PSPCB_RELEASE == uMsg)
{
@@ -294,12 +294,12 @@ BOOL CALLBACK CPropertySheet::PropPageSummaryProc(HWND
hwnd, UINT uiMsg, WPARAM
{
switch (uiMsg)
{
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
{
LPPROPSHEETPAGE psp =
reinterpret_cast<LPPROPSHEETPAGE>(lParam);
CPropertySheet* pImpl =
reinterpret_cast<CPropertySheet*>(psp->lParam);
pImpl->InitPropPageSummary(hwnd, psp);
- return TRUE;
+ return TRUE;
}
}
@@ -314,12 +314,12 @@ BOOL CALLBACK CPropertySheet::PropPageStatisticsProc(HWND
hwnd, UINT uiMsg, WPAR
{
switch (uiMsg)
{
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
{
LPPROPSHEETPAGE psp =
reinterpret_cast<LPPROPSHEETPAGE>(lParam);
CPropertySheet* pImpl =
reinterpret_cast<CPropertySheet*>(psp->lParam);
pImpl->InitPropPageStatistics(hwnd, psp);
- return TRUE;
+ return TRUE;
}
}
@@ -329,29 +329,29 @@ BOOL CALLBACK CPropertySheet::PropPageStatisticsProc(HWND
hwnd, UINT uiMsg, WPAR
//##################################
void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
{
- try
- {
- CMetaInfoReader metaInfo(m_szFileName);
-
- SetWindowText(GetDlgItem(hwnd,IDC_TITLE), metaInfo.getTagData(
META_INFO_TITLE ).c_str() );
- SetWindowText(GetDlgItem(hwnd,IDC_AUTHOR), metaInfo.getTagData(
META_INFO_AUTHOR ).c_str() );
- SetWindowText(GetDlgItem(hwnd,IDC_SUBJECT), metaInfo.getTagData(
META_INFO_SUBJECT ).c_str() );
- SetWindowText(GetDlgItem(hwnd,IDC_KEYWORDS), metaInfo.getTagData(
META_INFO_KEYWORDS ).c_str() );
-
- // comments read from meta.xml use "\n" for return, but this will not
displayable in Edit control, add
- // "\r" before "\n" to form "\r\n" in order to display return in Edit
control.
- std::wstring tempStr = metaInfo.getTagData( META_INFO_DESCRIPTION
).c_str();
- std::wstring::size_type itor = tempStr.find ( L"\n" , 0 );
- while (itor != std::wstring::npos)
- {
- tempStr.insert(itor, L"\r");
- itor = tempStr.find(L"\n", itor + 2);
- }
- SetWindowText(GetDlgItem(hwnd,IDC_COMMENTS), tempStr.c_str());
- }
- catch (const std::exception&)
- {
- }
+ try
+ {
+ CMetaInfoReader metaInfo(m_szFileName);
+
+ SetWindowText(GetDlgItem(hwnd,IDC_TITLE),
metaInfo.getTagData( META_INFO_TITLE ).c_str() );
+ SetWindowText(GetDlgItem(hwnd,IDC_AUTHOR),
metaInfo.getTagData( META_INFO_AUTHOR ).c_str() );
+ SetWindowText(GetDlgItem(hwnd,IDC_SUBJECT),
metaInfo.getTagData( META_INFO_SUBJECT ).c_str() );
+ SetWindowText(GetDlgItem(hwnd,IDC_KEYWORDS),
metaInfo.getTagData( META_INFO_KEYWORDS ).c_str() );
+
+ // comments read from meta.xml use "\n" for return, but this
will not displayable in Edit control, add
+ // "\r" before "\n" to form "\r\n" in order to display return
in Edit control.
+ std::wstring tempStr = metaInfo.getTagData(
META_INFO_DESCRIPTION ).c_str();
+ std::wstring::size_type itor = tempStr.find ( L"\n" , 0 );
+ while (itor != std::wstring::npos)
+ {
+ tempStr.insert(itor, L"\r");
+ itor = tempStr.find(L"\n", itor + 2);
+ }
+ SetWindowText(GetDlgItem(hwnd,IDC_COMMENTS), tempStr.c_str());
+ }
+ catch (const std::exception&)
+ {
+ }
}
//---------------------------------
@@ -359,23 +359,25 @@ void CPropertySheet::InitPropPageSummary(HWND hwnd,
LPPROPSHEETPAGE /*lppsp*/)
*/
void CPropertySheet::InitPropPageStatistics(HWND hwnd, LPPROPSHEETPAGE
/*lppsp*/)
{
- try
- {
- CMetaInfoReader metaInfo(m_szFileName);
+ try
+ {
+ CMetaInfoReader metaInfo(m_szFileName);
- document_statistic_reader_ptr doc_stat_reader =
create_document_statistic_reader(m_szFileName, &metaInfo);
+ document_statistic_reader_ptr doc_stat_reader =
create_document_statistic_reader(m_szFileName, &metaInfo);
- statistic_group_list_t sgl;
- doc_stat_reader->read(&sgl);
+ statistic_group_list_t sgl;
+ doc_stat_reader->read(&sgl);
- list_view_builder_ptr lv_builder = create_list_view_builder(
- GetDlgItem(hwnd, IDC_STATISTICSLIST),
- GetResString(IDS_PROPERTY),
- GetResString(IDS_PROPERTY_VALUE));
+ list_view_builder_ptr lv_builder = create_list_view_builder(
+ GetDlgItem(hwnd, IDC_STATISTICSLIST),
+ GetResString(IDS_PROPERTY),
+ GetResString(IDS_PROPERTY_VALUE));
- lv_builder->build(sgl);
- }
- catch (const std::exception&)
- {
- }
+ lv_builder->build(sgl);
+ }
+ catch (const std::exception&)
+ {
+ }
}
+
+/* vim: set noet sw=4 ts=4: */