summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorAmelia Wang <amwang@novell.com>2010-09-13 14:40:57 +0200
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-09-13 15:41:18 +0200
commit69f6c005a836515b96fb5ecc006b987a54a6f094 (patch)
tree4dcfbe8c44d374b3dfaaf18995dc21ac4ff34222 /sw
parent8fd87a90a5ebcc9d8c4ddc7ece6d20debd58e801 (diff)
cjk-character-units-ui.diff: add a new unit 'character unit'
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/config/optload.cxx6
-rw-r--r--sw/source/ui/config/optload.hrc1
-rw-r--r--sw/source/ui/config/optload.src12
-rwxr-xr-xsw/source/ui/config/optpage.cxx23
-rw-r--r--sw/source/ui/inc/optload.hxx1
-rw-r--r--sw/source/ui/inc/pggrid.hxx2
-rw-r--r--sw/source/ui/misc/pggrid.cxx3
-rw-r--r--sw/source/ui/misc/pggrid.hrc2
-rw-r--r--sw/source/ui/misc/pggrid.src12
9 files changed, 56 insertions, 6 deletions
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 1319cbfdabe8..2dbe2bfabd48 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -77,6 +77,10 @@
using namespace ::com::sun::star;
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svl/eitem.hxx>
+#endif
+
/* -----------------22.10.98 15:12-------------------
*
* --------------------------------------------------*/
@@ -100,6 +104,7 @@ SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) :
aTabFT ( this, SW_RES( FT_TAB ) ),
aTabMF ( this, SW_RES( MF_TAB ) ),
aUseSquaredPageMode ( this, SW_RES( CB_USE_SQUARE_PAGE_MODE ) ),
+ aUseCharUnit ( this , SW_RES( CB_USE_CHAR_UNIT ) ),
pWrtShell ( NULL ),
bHTMLMode ( FALSE ),
@@ -122,6 +127,7 @@ SwLoadOptPage::SwLoadOptPage( Window* pParent, const SfxItemSet& rSet ) :
case FUNIT_POINT:
case FUNIT_PICA:
case FUNIT_INCH:
+ case FUNIT_CHAR:
{
// nur diese Metriken benutzen
USHORT nPos = aMetricLB.InsertEntry( sMetric );
diff --git a/sw/source/ui/config/optload.hrc b/sw/source/ui/config/optload.hrc
index b396b2d9f9f0..201c83d2af51 100644
--- a/sw/source/ui/config/optload.hrc
+++ b/sw/source/ui/config/optload.hrc
@@ -41,6 +41,7 @@
#define FT_TAB 21
#define MF_TAB 22
#define CB_USE_SQUARE_PAGE_MODE 23
+#define CB_USE_CHAR_UNIT 24
// SwCaptionOptPage -----------------------------
diff --git a/sw/source/ui/config/optload.src b/sw/source/ui/config/optload.src
index febd2a6fc35f..cab9d4831f8c 100644
--- a/sw/source/ui/config/optload.src
+++ b/sw/source/ui/config/optload.src
@@ -139,6 +139,16 @@ TabPage TP_OPTLOAD_PAGE
Text [ en-US ] = "Use square page mode for text grid";
Text [ zh-CN ] = "使用稿纸模式";
};
+
+ CheckBox CB_USE_CHAR_UNIT
+ {
+ Pos = MAP_APPFONT ( 12 , 130) ;
+ Size = MAP_APPFONT ( 109 , 10 ) ;
+ Text [ de ] = "appy char unit" ;
+ Text [ en-US ] = "apply char unit";
+ Text [ x-comment ] = " ";
+ };
+
};
/**************************************************************************/
/* */
@@ -394,6 +404,8 @@ StringArray STR_ARR_METRIC
< "Miles" ; FUNIT_MILE ; > ;
< "Pica" ; FUNIT_PICA ; > ;
< "Point" ; FUNIT_POINT ; > ;
+ < "Char" ; FUNIT_CHAR ; >;
+ < "Line" ; FUNIT_LINE ; >;
};
};
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 921d2a652002..bd99cbd29345 100755
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -176,14 +176,25 @@ SwContentOptPage::SwContentOptPage( Window* pParent,
case FUNIT_POINT:
case FUNIT_PICA:
case FUNIT_INCH:
+ case FUNIT_CHAR: // add two units , 'character' and 'line' , their ticks are not fixed
+ case FUNIT_LINE:
{
// nur diese Metriken benutzen
- USHORT nPos = aMetricLB.InsertEntry( sMetric );
- aMetricLB.SetEntryData( nPos, (void*)(long)eFUnit );
- aVMetric.InsertEntry( sMetric );
- aVMetric.SetEntryData( nPos, (void*)(long)eFUnit );
- aHMetric.InsertEntry( sMetric );
- aHMetric.SetEntryData( nPos, (void*)(long)eFUnit );
+ // a horizontal ruler has not the 'line' unit
+ // there isn't 'line' unit in HTML format
+ if ( eFUnit != FUNIT_LINE )
+ {
+ USHORT nPos = aMetricLB.InsertEntry( sMetric );
+ aMetricLB.SetEntryData( nPos, (void*)(long)eFUnit );
+ aHMetric.InsertEntry( sMetric );
+ aHMetric.SetEntryData( nPos, (void*)(long)eFUnit );
+ }
+ // a vetical ruler has not the 'character' unit
+ if ( eFUnit != FUNIT_CHAR )
+ {
+ USHORT nPos = aVMetric.InsertEntry( sMetric );
+ aVMetric.SetEntryData( nPos, (void*)(long)eFUnit );
+ }
}
default:;//prevent warning
}
diff --git a/sw/source/ui/inc/optload.hxx b/sw/source/ui/inc/optload.hxx
index abe43c00f0a3..18c1175fda72 100644
--- a/sw/source/ui/inc/optload.hxx
+++ b/sw/source/ui/inc/optload.hxx
@@ -68,6 +68,7 @@ private:
FixedText aTabFT;
MetricField aTabMF;
CheckBox aUseSquaredPageMode;
+ CheckBox aUseCharUnit;
SwWrtShell* pWrtShell;
sal_Bool bHTMLMode;
diff --git a/sw/source/ui/inc/pggrid.hxx b/sw/source/ui/inc/pggrid.hxx
index ef8355846a30..26ca0cf1a353 100644
--- a/sw/source/ui/inc/pggrid.hxx
+++ b/sw/source/ui/inc/pggrid.hxx
@@ -54,12 +54,14 @@ class SwTextGridPage: public SfxTabPage
FixedText aLinesPerPageFT;
NumericField aLinesPerPageNF;
+ FixedText aLinesRangeFT;
FixedText aTextSizeFT;
MetricField aTextSizeMF;
FixedText aCharsPerLineFT;
NumericField aCharsPerLineNF;
+ FixedText aCharsRangeFT;
FixedText aCharWidthFT;
MetricField aCharWidthMF;
diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index 777479198157..198964a4e034 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -51,6 +51,7 @@
#include <editeng/ulspitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/frmdiritem.hxx>
+#include <svx/ruler.hxx>
#include <pggrid.hxx>
#include <tgrditem.hxx>
#include <pggrid.hrc>
@@ -74,10 +75,12 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) :
aLayoutFL (this, SW_RES(FL_LAYOUT )),
aLinesPerPageFT (this, SW_RES(FT_LINESPERPAGE )),
aLinesPerPageNF (this, SW_RES(NF_LINESPERPAGE )),
+ aLinesRangeFT (this, SW_RES(FT_LINERANGE )),
aTextSizeFT (this, SW_RES(FT_TEXTSIZE )),
aTextSizeMF (this, SW_RES(MF_TEXTSIZE )),
aCharsPerLineFT (this, SW_RES(FT_CHARSPERLINE )),
aCharsPerLineNF (this, SW_RES(NF_CHARSPERLINE )),
+ aCharsRangeFT (this, SW_RES(FT_CHARRANGE )),
aCharWidthFT (this, SW_RES(FT_CHARWIDTH )),
aCharWidthMF (this, SW_RES(MF_CHARWIDTH )),
aRubySizeFT (this, SW_RES(FT_RUBYSIZE )),
diff --git a/sw/source/ui/misc/pggrid.hrc b/sw/source/ui/misc/pggrid.hrc
index e156792c955d..e736e5040dbb 100644
--- a/sw/source/ui/misc/pggrid.hrc
+++ b/sw/source/ui/misc/pggrid.hrc
@@ -50,3 +50,5 @@
#define CB_SNAPTOCHARS 23
#define FT_CHARWIDTH 24
#define MF_CHARWIDTH 25
+#define FT_LINERANGE 26
+#define FT_CHARRANGE 27
diff --git a/sw/source/ui/misc/pggrid.src b/sw/source/ui/misc/pggrid.src
index b03ec2a687c1..747e1325d3da 100644
--- a/sw/source/ui/misc/pggrid.src
+++ b/sw/source/ui/misc/pggrid.src
@@ -97,6 +97,12 @@ TabPage TP_TEXTGRID_PAGE
Last = 154 ;
SpinSize = 1 ;
};
+ FixedText FT_LINERANGE
+ {
+ Pos = MAP_APPFONT ( 103 , 82 ) ;
+ Size = MAP_APPFONT ( 25 , 8 );
+ Text [ en-US ] = "( 1 - 48 )" ;
+ };
FixedText FT_TEXTSIZE
{
Pos = MAP_APPFONT ( 133 , 82 ) ;
@@ -166,6 +172,12 @@ TabPage TP_TEXTGRID_PAGE
Last = 5600 ;
SpinSize = 5 ;
};
+ FixedText FT_CHARRANGE
+ {
+ Pos = MAP_APPFONT ( 103 , 96 ) ;
+ Size = MAP_APPFONT ( 25 , 8 ) ;
+ Text [ en-US ] = "( 1 - 45 )" ;
+ };
FixedText FT_RUBYSIZE
{
Pos = MAP_APPFONT ( 133 , 98 ) ;