Kaydet (Commit) c9bfa396 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Block definition for CellTextAttr.

This block will be used to merge the text width and script type vectors
that are currently separate.  Text widths and script types should really
be stored together.

Change-Id: I6783769cc03180b513319e0a98a0773bd20ba941
üst cb706bac
...@@ -141,6 +141,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ ...@@ -141,6 +141,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/core/data/globalx \ sc/source/core/data/globalx \
sc/source/core/data/markarr \ sc/source/core/data/markarr \
sc/source/core/data/markdata \ sc/source/core/data/markdata \
sc/source/core/data/mtvelements \
sc/source/core/data/olinetab \ sc/source/core/data/olinetab \
sc/source/core/data/pagepar \ sc/source/core/data/pagepar \
sc/source/core/data/patattr \ sc/source/core/data/patattr \
......
...@@ -29,10 +29,6 @@ ...@@ -29,10 +29,6 @@
#define USE_MEMPOOL #define USE_MEMPOOL
// in addition to SCRIPTTYPE_... flags from scripttypeitem.hxx:
// set (in nScriptType) if type has not been determined yet
#define SC_SCRIPTTYPE_UNKNOWN 0x08
class ScDocument; class ScDocument;
class EditTextObject; class EditTextObject;
class ScMatrix; class ScMatrix;
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
#define DATE_TIME_FACTOR 86400.0 #define DATE_TIME_FACTOR 86400.0
// in addition to SCRIPTTYPE_... flags from scripttypeitem.hxx:
// set (in nScriptType) if type has not been determined yet
#define SC_SCRIPTTYPE_UNKNOWN 0x08
#endif #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
#ifndef SC_MTVBLOCKFUNC_HXX #ifndef SC_MTVELEMENTS_HXX
#define SC_MTVBLOCKFUNC_HXX #define SC_MTVELEMENTS_HXX
#include "svl/broadcast.hxx" #include "svl/broadcast.hxx"
...@@ -17,13 +17,28 @@ ...@@ -17,13 +17,28 @@
namespace sc { namespace sc {
struct CellTextAttr
{
sal_uInt16 mnTextWidth;
sal_uInt8 mnScriptType;
CellTextAttr();
CellTextAttr(const CellTextAttr& r);
CellTextAttr(sal_uInt16 nTextWidth, sal_uInt8 nScriptType);
};
// Custom element type IDs for multi_type_vector. // Custom element type IDs for multi_type_vector.
const mdds::mtv::element_t element_type_broadcaster = mdds::mtv::element_type_user_start; const mdds::mtv::element_t element_type_broadcaster = mdds::mtv::element_type_user_start;
const mdds::mtv::element_t element_type_celltextattr = mdds::mtv::element_type_user_start + 1;
// Custom element blocks. // Custom element blocks.
typedef mdds::mtv::noncopyable_managed_element_block<element_type_broadcaster, SvtBroadcaster> custom_broadcaster_block; typedef mdds::mtv::noncopyable_managed_element_block<element_type_broadcaster, SvtBroadcaster> custom_broadcaster_block;
typedef mdds::mtv::default_element_block<element_type_celltextattr, CellTextAttr> custom_celltextattr_block;
// This needs to be in the same namespace as CellTextAttr.
MDDS_MTV_DEFINE_ELEMENT_CALLBACKS(CellTextAttr, element_type_celltextattr, CellTextAttr(), custom_celltextattr_block)
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "scrdata.hxx" #include "scrdata.hxx"
#include "poolhelp.hxx" #include "poolhelp.hxx"
#include "attrib.hxx" #include "attrib.hxx"
#include "globalnames.hxx"
using namespace com::sun::star; using namespace com::sun::star;
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "mtvelements.hxx"
#include "globalnames.hxx"
namespace sc {
CellTextAttr::CellTextAttr() :
mnTextWidth(TEXTWIDTH_DIRTY),
mnScriptType(SC_SCRIPTTYPE_UNKNOWN) {}
CellTextAttr::CellTextAttr(const CellTextAttr& r) :
mnTextWidth(r.mnTextWidth),
mnScriptType(r.mnScriptType) {}
CellTextAttr::CellTextAttr(sal_uInt16 nTextWidth, sal_uInt8 nScriptType) :
mnTextWidth(nTextWidth),
mnScriptType(nScriptType) {}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment