summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorIstvan Turi <turipista@freemail.hu>2012-08-16 17:38:03 +0200
committerAndras Timar <atimar@suse.com>2012-08-16 17:45:36 +0200
commit1b0f7ee1e04d7b0fe81f7458ae2116615e0f6889 (patch)
tree655598252c1ae8d147b274bafb917a83b8d235ef /sw
parentcecff561687865359a695f1cf6ecb99300ce121b (diff)
idxexample.odt and html.stw cleanup (fdo#49101, fdo#49098)
idxexample.odt will be localized through the standard l10n framework, i.e. with use of .po files, because now strings are read from resources. html.stw is language independent now, defaults for different scripts are handled in the code. Change-Id: Ie20cafc6191721a959b33e2559b9866e3762a146
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/rcid.hrc5
-rw-r--r--sw/source/filter/html/css1atr.cxx20
-rw-r--r--sw/source/filter/html/htmlfldw.cxx8
-rw-r--r--sw/source/filter/html/htmlgrin.cxx9
-rw-r--r--sw/source/filter/html/htmltab.cxx29
-rw-r--r--sw/source/filter/html/swhtml.cxx155
-rw-r--r--sw/source/filter/html/swhtml.hxx2
-rw-r--r--sw/source/ui/inc/utlui.hrc15
-rw-r--r--sw/source/ui/index/cnttab.cxx1
-rw-r--r--sw/source/ui/utlui/unotools.cxx57
-rw-r--r--sw/source/ui/utlui/utlui.src32
11 files changed, 266 insertions, 67 deletions
diff --git a/sw/inc/rcid.hrc b/sw/inc/rcid.hrc
index 90d795745f63..9dd09611a898 100644
--- a/sw/inc/rcid.hrc
+++ b/sw/inc/rcid.hrc
@@ -68,6 +68,7 @@
#define RC_UNOCORE (RC_BASE + 4050)
#define RC_ANNOTATION (RC_BASE + 4150)
#define RC_PAGEFRM (RC_BASE + 4250)
+#define RC_IDXTXT (RC_BASE + 4350)
/*--------------------------------------------------------------------
Beschreibung: Bereiche ausspannen
@@ -249,4 +250,8 @@
#define RC_UNOCORE_BEGIN RC_UNOCORE
#define RC_UNOCORE_END (RC_UNOCORE + 10)
+//idxexample
+#define RC_IDXTXT_BEGIN RC_IDXTXT
+#define RC_IDXTXT_END (RC_IDXTXT + 10)
+
#endif
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 03584cd28a6d..c9d36f7bbd66 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -1356,14 +1356,11 @@ sal_Bool SwHTMLWriter::HasScriptDependentItems( const SfxItemSet& rItemSet,
const SwCharFmt *pDCCharFmt = pDrop->GetCharFmt();
if( pDCCharFmt )
{
+ //Some items occured twice, and I have no idea why.
SfxItemSet aTstItemSet( *pDCCharFmt->GetAttrSet().GetPool(),
- RES_CHRATR_FONT, RES_CHRATR_FONT,
- RES_CHRATR_POSTURE, RES_CHRATR_POSTURE,
- RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT,
- RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT,
- RES_CHRATR_CJK_POSTURE, RES_CHRATR_CJK_WEIGHT,
- RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONT,
- RES_CHRATR_CTL_POSTURE, RES_CHRATR_CTL_WEIGHT,
+ RES_CHRATR_FONT, RES_CHRATR_POSTURE, RES_CHRATR_WEIGHT,
+ RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_POSTURE, RES_CHRATR_CJK_WEIGHT,
+ RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_POSTURE, RES_CHRATR_CTL_WEIGHT,
0 );
aTstItemSet.Set( pDCCharFmt->GetAttrSet(), sal_True );
return HasScriptDependentItems( aTstItemSet, sal_False );
@@ -1408,8 +1405,13 @@ static sal_Bool OutCSS1Rule( SwHTMLWriter& rHTMLWrt, const String& rSelector,
SfxItemSet aScriptItemSet( *rItemSet.GetPool(),
RES_CHRATR_FONT, RES_CHRATR_FONTSIZE,
RES_CHRATR_LANGUAGE, RES_CHRATR_POSTURE,
- RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT,
- RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_WEIGHT,
+ RES_CHRATR_WEIGHT,
+ RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONTSIZE,
+ RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_POSTURE,
+ RES_CHRATR_CJK_WEIGHT,
+ RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONTSIZE,
+ RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_POSTURE,
+ RES_CHRATR_CTL_WEIGHT,
0 );
aScriptItemSet.Put( rItemSet );
diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx
index a4fe67a21c45..277b0792e958 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -335,9 +335,11 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld,
{
SfxItemSet aScriptItemSet( rWrt.pDoc->GetAttrPool(),
RES_CHRATR_FONT, RES_CHRATR_FONTSIZE,
- RES_CHRATR_POSTURE, RES_CHRATR_POSTURE,
- RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT,
- RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_WEIGHT,
+ RES_CHRATR_POSTURE, RES_CHRATR_WEIGHT,
+ RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONTSIZE,
+ RES_CHRATR_CJK_POSTURE, RES_CHRATR_CJK_WEIGHT,
+ RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONTSIZE,
+ RES_CHRATR_CTL_POSTURE, RES_CHRATR_CTL_WEIGHT,
0 );
rTxtNd.GetAttr( aScriptItemSet, nFldPos, nFldPos+1 );
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 30b994df0d6c..5781084a2965 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -1412,12 +1412,13 @@ void SwHTMLParser::StripTrailingPara()
if( bSetSmallFont )
{
+ //Added default to CJK and CTL
SvxFontHeightItem aFontHeight( 40, 100, RES_CHRATR_FONTSIZE );
pCNd->SetAttr( aFontHeight );
- aFontHeight.SetWhich( RES_CHRATR_CJK_FONTSIZE );
- pCNd->SetAttr( aFontHeight );
- aFontHeight.SetWhich( RES_CHRATR_CTL_FONTSIZE );
- pCNd->SetAttr( aFontHeight );
+ SvxFontHeightItem aFontHeightCJK( 40, 100, RES_CHRATR_CJK_FONTSIZE );
+ pCNd->SetAttr( aFontHeightCJK );
+ SvxFontHeightItem aFontHeightCTL( 40, 100, RES_CHRATR_CTL_FONTSIZE );
+ pCNd->SetAttr( aFontHeightCTL );
}
}
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 1baf89d79988..d23c729bf0c2 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -2874,13 +2874,14 @@ const SwStartNode *SwHTMLParser::InsertTableSection
pTable->IncBoxCount();
}
+ //Added defaults to CJK and CTL
SwCntntNode *pCNd = pDoc->GetNodes()[pStNd->GetIndex()+1] ->GetCntntNode();
SvxFontHeightItem aFontHeight( 40, 100, RES_CHRATR_FONTSIZE );
pCNd->SetAttr( aFontHeight );
- aFontHeight.SetWhich( RES_CHRATR_CJK_FONTSIZE );
- pCNd->SetAttr( aFontHeight );
- aFontHeight.SetWhich( RES_CHRATR_CTL_FONTSIZE );
- pCNd->SetAttr( aFontHeight );
+ SvxFontHeightItem aFontHeightCJK( 40, 100, RES_CHRATR_CJK_FONTSIZE );
+ pCNd->SetAttr( aFontHeightCJK );
+ SvxFontHeightItem aFontHeightCTL( 40, 100, RES_CHRATR_CTL_FONTSIZE );
+ pCNd->SetAttr( aFontHeightCTL );
return pStNd;
}
@@ -3630,6 +3631,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, sal_Bool bReadOptions,
{
if( !pPam->GetPoint()->nContent.GetIndex() )
{
+ //Set default to CJK and CTL
pDoc->SetTxtFmtColl( *pPam,
pCSS1Parser->GetTxtCollFromPool(RES_POOLCOLL_STANDARD) );
SvxFontHeightItem aFontHeight( 40, 100, RES_CHRATR_FONTSIZE );
@@ -3638,12 +3640,14 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, sal_Bool bReadOptions,
new _HTMLAttr( *pPam->GetPoint(), aFontHeight );
aSetAttrTab.push_back( pTmp );
- aFontHeight.SetWhich( RES_CHRATR_CJK_FONTSIZE );
- pTmp = new _HTMLAttr( *pPam->GetPoint(), aFontHeight );
+ SvxFontHeightItem aFontHeightCJK( 40, 100, RES_CHRATR_CJK_FONTSIZE );
+ pTmp =
+ new _HTMLAttr( *pPam->GetPoint(), aFontHeightCJK );
aSetAttrTab.push_back( pTmp );
- aFontHeight.SetWhich( RES_CHRATR_CTL_FONTSIZE );
- pTmp = new _HTMLAttr( *pPam->GetPoint(), aFontHeight );
+ SvxFontHeightItem aFontHeightCTL( 40, 100, RES_CHRATR_CTL_FONTSIZE );
+ pTmp =
+ new _HTMLAttr( *pPam->GetPoint(), aFontHeightCTL );
aSetAttrTab.push_back( pTmp );
pTmp = new _HTMLAttr( *pPam->GetPoint(),
@@ -4153,12 +4157,13 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, sal_Bool bReadOptions,
: RES_POOLCOLL_TABLE ));
const SwEndNode *pEndNd = pStNd->EndOfSectionNode();
SwCntntNode *pCNd = pDoc->GetNodes()[pEndNd->GetIndex()-1] ->GetCntntNode();
+ //Added defaults to CJK and CTL
SvxFontHeightItem aFontHeight( 40, 100, RES_CHRATR_FONTSIZE );
pCNd->SetAttr( aFontHeight );
- aFontHeight.SetWhich( RES_CHRATR_CJK_FONTSIZE );
- pCNd->SetAttr( aFontHeight );
- aFontHeight.SetWhich( RES_CHRATR_CTL_FONTSIZE );
- pCNd->SetAttr( aFontHeight );
+ SvxFontHeightItem aFontHeightCJK( 40, 100, RES_CHRATR_CJK_FONTSIZE );
+ pCNd->SetAttr( aFontHeightCJK );
+ SvxFontHeightItem aFontHeightCTL( 40, 100, RES_CHRATR_CTL_FONTSIZE );
+ pCNd->SetAttr( aFontHeightCTL );
pSaveStruct->AddContents( new HTMLTableCnts(pStNd) );
pSaveStruct->ClearIsInSection();
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 18850d56a637..373919bd6b01 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -157,14 +157,15 @@ HTMLReader::HTMLReader()
String HTMLReader::GetTemplateName() const
{
- String sTemplate(rtl::OUString("internal"));
- sTemplate += INET_PATH_TOKEN;
- sTemplate.AppendAscii( TOOLS_CONSTASCII_STRINGPARAM("html") );
+ String sTemplate(rtl::OUString("html"));
String sTemplateWithoutExt( sTemplate );
// first search for OpenDocument Writer/Web template
sTemplate.AppendAscii( TOOLS_CONSTASCII_STRINGPARAM(".oth") );
+ //Added path for the common HTML template
SvtPathOptions aPathOpt;
+ const String sCommonTemplatePath("share/template/common/internal");
+ aPathOpt.SetTemplatePath(sCommonTemplatePath);
// OpenDocument Writer/Web template (extension .oth)
sal_Bool bSet = aPathOpt.SearchFile( sTemplate, SvtPathOptions::PATH_TEMPLATE );
@@ -337,12 +338,14 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn,
if(bReadNewDoc)
{
+ //CJK has different defaults, so a different object should be used for this
+ //RES_CHARTR_CJK_FONTSIZE is a valid value
SvxFontHeightItem aFontHeight(aFontHeights[2], 100, RES_CHRATR_FONTSIZE);
pDoc->SetDefault( aFontHeight );
- aFontHeight.SetWhich( RES_CHRATR_CJK_FONTSIZE );
- pDoc->SetDefault( aFontHeight );
- aFontHeight.SetWhich( RES_CHRATR_CTL_FONTSIZE );
- pDoc->SetDefault( aFontHeight );
+ SvxFontHeightItem aFontHeightCJK(aFontHeights[2], 100, RES_CHRATR_CJK_FONTSIZE);
+ pDoc->SetDefault( aFontHeightCJK );
+ SvxFontHeightItem aFontHeightCTL(aFontHeights[2], 100, RES_CHRATR_CTL_FONTSIZE);
+ pDoc->SetDefault( aFontHeightCTL );
}
// Waehrend des Imports in den HTML-Modus schalten, damit die
@@ -2293,7 +2296,7 @@ sal_Bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, sal_Bool bUpdateNu
{
// These are the end position of all script depenent hints.
// If we find a hint that starts before the current end position,
- // we have to set it. If we finf a hint that start behind or at
+ // we have to set it. If we find a hint that start behind or at
// that position, we have to take the hint's value into account.
// If it is equal to the style, or in fact the paragarph's value
// for that hint, the hint is removed. Otherwise it's end position
@@ -2306,11 +2309,44 @@ sal_Bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, sal_Bool bUpdateNu
SwTxtAttr *pHt = rHints.GetTextHint( i );
sal_uInt16 nWhich = pHt->Which();
sal_Int16 nIdx = -1;
+ //In 'hintids.hxx', the following five attributes don't follow
+ //each other in the Latin attributes as they do among CJK and
+ //CTL attributes, so the old code just made a mess, IMHO.
+ //E.g. 29-22=7, which should be LANGUAGE, but it's FONT.
+ //Moreover, it should occur between 0 and 4.
+ //Since it would be too risky to change the attribute codes,
+ //I repaired the following source code the 'brute force' way.
+
+ //Old code:
+ /*
if( RES_CHRATR_CJK_FONT <= nWhich &&
nWhich <= RES_CHRATR_CTL_WEIGHT )
{
nIdx = static_cast< sal_uInt16 >(nWhich - RES_CHRATR_CJK_FONT + 5);
}
+ else switch...
+ */
+
+ if( RES_CHRATR_CJK_FONT == nWhich || RES_CHRATR_CTL_FONT == nWhich )
+ {
+ nIdx = static_cast< sal_uInt16 >(0);
+ }
+ else if( RES_CHRATR_CJK_FONTSIZE == nWhich || RES_CHRATR_CTL_FONTSIZE == nWhich )
+ {
+ nIdx = static_cast< sal_uInt16 >(1);
+ }
+ else if( RES_CHRATR_CJK_LANGUAGE == nWhich || RES_CHRATR_CTL_LANGUAGE == nWhich )
+ {
+ nIdx = static_cast< sal_uInt16 >(2);
+ }
+ else if( RES_CHRATR_CJK_POSTURE == nWhich || RES_CHRATR_CTL_POSTURE == nWhich )
+ {
+ nIdx = static_cast< sal_uInt16 >(3);
+ }
+ else if( RES_CHRATR_CJK_WEIGHT == nWhich || RES_CHRATR_CTL_WEIGHT == nWhich )
+ {
+ nIdx = static_cast< sal_uInt16 >(4);
+ }
else switch( nWhich )
{
case RES_CHRATR_FONT: nIdx = 0; break;
@@ -2331,7 +2367,7 @@ sal_Bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, sal_Bool bUpdateNu
: rItem == pHt->GetAttr() )
{
// The hint is the same as set in the paragraph and
- // therfor, it can be deleted
+ // therefore, it can be deleted
// CAUTION!!! This WILL delete the hint and it MAY
// also delete the SwpHints!!! To avoid any trouble
// we leave the loop immediately if this is the last
@@ -2344,7 +2380,7 @@ sal_Bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, sal_Bool bUpdateNu
}
else
{
- // The hint is deifferent. Therfor all hints within that
+ // The hint is different. Therefore all hints within that
// hint have to be ignored.
aEndPos[nIdx] = pHt->GetEnd() ? *pHt->GetEnd() : nStt;
}
@@ -2369,6 +2405,7 @@ sal_Bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, sal_Bool bUpdateNu
void SwHTMLParser::AddParSpace()
{
+ //If it already has ParSpace, return
if( !bNoParSpace )
return;
@@ -2393,8 +2430,50 @@ void SwHTMLParser::AddParSpace()
}
else
{
- pTxtNode->SetAttr(
- SvxULSpaceItem( rULSpace.GetUpper(), HTML_PARSPACE, RES_UL_SPACE ) );
+ //What I do here, is that I examine the attributes, and if
+ //I find out, that it's CJK/CTL, then I set the paragraph space
+ //to the value set in HTML_CJK_PARSPACE/HTML_CTL_PARSPACE.
+
+ sal_Bool bIsCJK = false;
+ sal_Bool bIsCTL = false;
+ SwpHints& rHints = pTxtNode->GetSwpHints();
+ sal_uInt16 nWhich;
+ SwTxtAttr *pHt;
+
+ sal_uInt16 nCntAttr = (pTxtNode && pTxtNode->GetpSwpHints())
+ ? pTxtNode->GetSwpHints().Count() : 0;
+
+ for(sal_uInt16 i = 0; (i < nCntAttr) && !bIsCJK; ++i)
+ {
+ pHt = rHints.GetTextHint(i);
+ nWhich = pHt->Which();
+ if( RES_CHRATR_CJK_FONT == nWhich ||
+ RES_CHRATR_CJK_FONTSIZE == nWhich ||
+ RES_CHRATR_CJK_LANGUAGE == nWhich ||
+ RES_CHRATR_CJK_POSTURE == nWhich ||
+ RES_CHRATR_CJK_WEIGHT == nWhich )
+ bIsCJK = true;
+ if( RES_CHRATR_CTL_FONT == nWhich ||
+ RES_CHRATR_CTL_FONTSIZE == nWhich ||
+ RES_CHRATR_CTL_LANGUAGE == nWhich ||
+ RES_CHRATR_CTL_POSTURE == nWhich ||
+ RES_CHRATR_CTL_WEIGHT == nWhich )
+ bIsCJK = false;
+ }
+
+ if( bIsCTL )
+ {
+ pTxtNode->SetAttr(
+ SvxULSpaceItem( rULSpace.GetUpper(), HTML_CTL_PARSPACE, RES_UL_SPACE ) );
+ }
+ else if( bIsCJK )
+ {
+ pTxtNode->SetAttr(
+ SvxULSpaceItem( rULSpace.GetUpper(), HTML_CJK_PARSPACE, RES_UL_SPACE ) );
+ } else {
+ pTxtNode->SetAttr(
+ SvxULSpaceItem( rULSpace.GetUpper(), HTML_PARSPACE, RES_UL_SPACE ) );
+ }
}
}
}
@@ -3539,12 +3618,16 @@ void SwHTMLParser::NewBasefontAttr()
SfxItemSet aItemSet( pDoc->GetAttrPool(), pCSS1Parser->GetWhichMap() );
SvxCSS1PropertyInfo aPropInfo;
+ //CJK has different defaults
SvxFontHeightItem aFontHeight( aFontHeights[nSize-1], 100, RES_CHRATR_FONTSIZE );
aItemSet.Put( aFontHeight );
- aFontHeight.SetWhich( RES_CHRATR_CJK_FONTSIZE );
- aItemSet.Put( aFontHeight );
- aFontHeight.SetWhich( RES_CHRATR_CTL_FONTSIZE );
- aItemSet.Put( aFontHeight );
+ SvxFontHeightItem aFontHeightCJK( aFontHeights[nSize-1], 100, RES_CHRATR_CJK_FONTSIZE );
+ aItemSet.Put( aFontHeightCJK );
+ //Complex type can contain so many types of letters,
+ //that it's not really worthy to bother, IMO.
+ //Still, I have set a default.
+ SvxFontHeightItem aFontHeightCTL( aFontHeights[nSize-1], 100, RES_CHRATR_CTL_FONTSIZE );
+ aItemSet.Put( aFontHeightCTL );
if( ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo, &aLang, &aDir ) )
DoPositioning( aItemSet, aPropInfo, pCntxt );
@@ -3555,10 +3638,10 @@ void SwHTMLParser::NewBasefontAttr()
{
SvxFontHeightItem aFontHeight( aFontHeights[nSize-1], 100, RES_CHRATR_FONTSIZE );
InsertAttr( &aAttrTab.pFontHeight, aFontHeight, pCntxt );
- aFontHeight.SetWhich( RES_CHRATR_CJK_FONTSIZE );
- InsertAttr( &aAttrTab.pFontHeightCJK, aFontHeight, pCntxt );
- aFontHeight.SetWhich( RES_CHRATR_CTL_FONTSIZE );
- InsertAttr( &aAttrTab.pFontHeightCTL, aFontHeight, pCntxt );
+ SvxFontHeightItem aFontHeightCJK( aFontHeights[nSize-1], 100, RES_CHRATR_CJK_FONTSIZE );
+ InsertAttr( &aAttrTab.pFontHeightCJK, aFontHeightCJK, pCntxt );
+ SvxFontHeightItem aFontHeightCTL( aFontHeights[nSize-1], 100, RES_CHRATR_CTL_FONTSIZE );
+ InsertAttr( &aAttrTab.pFontHeightCJK, aFontHeightCTL, pCntxt );
}
// den Kontext merken
@@ -3743,10 +3826,10 @@ void SwHTMLParser::NewFontAttr( int nToken )
{
SvxFontHeightItem aFontHeight( nFontHeight, 100, RES_CHRATR_FONTSIZE );
aItemSet.Put( aFontHeight );
- aFontHeight.SetWhich( RES_CHRATR_CJK_FONTSIZE );
- aItemSet.Put( aFontHeight );
- aFontHeight.SetWhich( RES_CHRATR_CTL_FONTSIZE );
- aItemSet.Put( aFontHeight );
+ SvxFontHeightItem aFontHeightCJK( nFontHeight, 100, RES_CHRATR_CJK_FONTSIZE );
+ aItemSet.Put( aFontHeightCJK );
+ SvxFontHeightItem aFontHeightCTL( nFontHeight, 100, RES_CHRATR_CTL_FONTSIZE );
+ aItemSet.Put( aFontHeightCTL );
}
if( bColor )
aItemSet.Put( SvxColorItem(aColor, RES_CHRATR_COLOR) );
@@ -3754,10 +3837,10 @@ void SwHTMLParser::NewFontAttr( int nToken )
{
SvxFontItem aFont( eFamily, aFontName, aStyleName, ePitch, eEnc, RES_CHRATR_FONT );
aItemSet.Put( aFont );
- aFont.SetWhich( RES_CHRATR_CJK_FONT );
- aItemSet.Put( aFont );
- aFont.SetWhich( RES_CHRATR_CTL_FONT );
- aItemSet.Put( aFont );
+ SvxFontItem aFontCJK( eFamily, aFontName, aStyleName, ePitch, eEnc, RES_CHRATR_CJK_FONT );
+ aItemSet.Put( aFontCJK );
+ SvxFontItem aFontCTL( eFamily, aFontName, aStyleName, ePitch, eEnc, RES_CHRATR_CTL_FONT );
+ aItemSet.Put( aFontCTL );
}
@@ -3772,10 +3855,10 @@ void SwHTMLParser::NewFontAttr( int nToken )
{
SvxFontHeightItem aFontHeight( nFontHeight, 100, RES_CHRATR_FONTSIZE );
InsertAttr( &aAttrTab.pFontHeight, aFontHeight, pCntxt );
- aFontHeight.SetWhich( RES_CHRATR_CJK_FONTSIZE );
- InsertAttr( &aAttrTab.pFontHeightCJK, aFontHeight, pCntxt );
- aFontHeight.SetWhich( RES_CHRATR_CTL_FONTSIZE );
- InsertAttr( &aAttrTab.pFontHeightCTL, aFontHeight, pCntxt );
+ SvxFontHeightItem aFontHeightCJK( nFontHeight, 100, RES_CHRATR_CJK_FONTSIZE );
+ InsertAttr( &aAttrTab.pFontHeight, aFontHeightCJK, pCntxt );
+ SvxFontHeightItem aFontHeightCTL( nFontHeight, 100, RES_CHRATR_CTL_FONTSIZE );
+ InsertAttr( &aAttrTab.pFontHeight, aFontHeightCTL, pCntxt );
}
if( bColor )
InsertAttr( &aAttrTab.pFontColor, SvxColorItem(aColor, RES_CHRATR_COLOR), pCntxt );
@@ -3783,10 +3866,10 @@ void SwHTMLParser::NewFontAttr( int nToken )
{
SvxFontItem aFont( eFamily, aFontName, aStyleName, ePitch, eEnc, RES_CHRATR_FONT );
InsertAttr( &aAttrTab.pFont, aFont, pCntxt );
- aFont.SetWhich( RES_CHRATR_CJK_FONT );
- InsertAttr( &aAttrTab.pFontCJK, aFont, pCntxt );
- aFont.SetWhich( RES_CHRATR_CTL_FONT );
- InsertAttr( &aAttrTab.pFontCTL, aFont, pCntxt );
+ SvxFontItem aFontCJK( eFamily, aFontName, aStyleName, ePitch, eEnc, RES_CHRATR_CJK_FONT );
+ InsertAttr( &aAttrTab.pFont, aFontCJK, pCntxt );
+ SvxFontItem aFontCTL( eFamily, aFontName, aStyleName, ePitch, eEnc, RES_CHRATR_CTL_FONT );
+ InsertAttr( &aAttrTab.pFont, aFontCTL, pCntxt );
}
}
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 605e78d89efd..efdd279e573b 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -57,6 +57,8 @@ struct SwPendingStack;
class SvxCSS1PropertyInfo;
#define HTML_PARSPACE (MM50)
+#define HTML_CJK_PARSPACE (MM50/2)
+#define HTML_CTL_PARSPACE (MM50/2)
#define HTML_DFLT_IMG_WIDTH (MM50*4)
#define HTML_DFLT_IMG_HEIGHT (MM50*2)
diff --git a/sw/source/ui/inc/utlui.hrc b/sw/source/ui/inc/utlui.hrc
index 8c82933d8ba5..6725cec0b130 100644
--- a/sw/source/ui/inc/utlui.hrc
+++ b/sw/source/ui/inc/utlui.hrc
@@ -168,4 +168,19 @@
#error Resource-Id Ueberlauf in #file, #line
#endif
+#define STR_IDXEXAMPLE_IDXTXT_BEGIN RC_IDXTXT_BEGIN
+#define STR_IDXEXAMPLE_IDXTXT_HEADING1 (STR_IDXEXAMPLE_IDXTXT_BEGIN + 1)
+#define STR_IDXEXAMPLE_IDXTXT_ENTRY1 (STR_IDXEXAMPLE_IDXTXT_BEGIN + 2)
+#define STR_IDXEXAMPLE_IDXTXT_HEADING11 (STR_IDXEXAMPLE_IDXTXT_BEGIN + 3)
+#define STR_IDXEXAMPLE_IDXTXT_ENTRY11 (STR_IDXEXAMPLE_IDXTXT_BEGIN + 4)
+#define STR_IDXEXAMPLE_IDXTXT_HEADING12 (STR_IDXEXAMPLE_IDXTXT_BEGIN + 5)
+#define STR_IDXEXAMPLE_IDXTXT_ENTRY12 (STR_IDXEXAMPLE_IDXTXT_BEGIN + 6)
+#define STR_IDXEXAMPLE_IDXTXT_TABLE1 (STR_IDXEXAMPLE_IDXTXT_BEGIN + 7)
+#define STR_IDXEXAMPLE_IDXTXT_IMAGE1 (STR_IDXEXAMPLE_IDXTXT_BEGIN + 8)
+#define STR_IDXEXAMPLE_IDXTXT_END STR_IDXEXAMPLE_IDXTXT_IMAGE1
+
+#if STR_IDXEXAMPLE_IDXTXT_END > RC_IDXTXT_END
+#error Resource-Id Ueberlauf in #file, #line
+#endif
+
#endif
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 058a23fd57c0..94bf14fd8a0a 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -510,6 +510,7 @@ IMPL_LINK( SwMultiTOXTabDialog, ShowPreviewHdl, CheckBox *, pBox )
sTemplate.AppendAscii( RTL_CONSTASCII_STRINGPARAM(".odt") );
SvtPathOptions aOpt;
+ aOpt.SetTemplatePath(String("share/template/common"));
// 6.0 (extension .sxw)
sal_Bool bExist = aOpt.SearchFile( sTemplate, SvtPathOptions::PATH_TEMPLATE );
diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx
index c5dec257b0a3..6324bddd27a3 100644
--- a/sw/source/ui/utlui/unotools.cxx
+++ b/sw/source/ui/utlui/unotools.cxx
@@ -76,9 +76,7 @@ SwOneExampleFrame::SwOneExampleFrame( Window& rWin,
aTopWindow( rWin.GetParent(), 0, this ),
rWindow(rWin),
aMenuRes(SW_RES(RES_FRMEX_MENU)),
-
pModuleView(SW_MOD()->GetView()),
-
nStyleFlags(nFlags),
bIsInitialized(sal_False),
bServiceAvailable(sal_False)
@@ -268,6 +266,60 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
uno::Reference< text::XTextDocument > xDoc(_xModel, uno::UNO_QUERY);
uno::Reference< text::XText > xText = xDoc->getText();
_xCursor = xText->createTextCursor();
+
+ //From here, a cursor is defined, which goes trough the template,
+ //and overwrites the template words where it is necessary.
+
+ uno::Reference< lang::XUnoTunnel> xTunnel( _xCursor, uno::UNO_QUERY);
+ if( xTunnel.is() )
+ {
+ OTextCursorHelper* pCrsr = reinterpret_cast<OTextCursorHelper*>( xTunnel->getSomething(
+ OTextCursorHelper::getUnoTunnelId() ));
+ if( pCrsr )
+ {
+ SwEditShell* pSh = pCrsr->GetDoc()->GetEditShell();
+
+ do
+ {
+ if (pSh->GetCurWord() == String("HEADING1"))
+ {
+ pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_HEADING1));
+ }
+ else if (pSh->GetCurWord() == String("ENTRY1"))
+ {
+ pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_ENTRY1));
+ }
+ else if (pSh->GetCurWord() == String("HEADING11"))
+ {
+ pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_HEADING11));
+ }
+ else if (pSh->GetCurWord() == String("ENTRY11"))
+ {
+ pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_ENTRY11));
+ }
+ else if (pSh->GetCurWord() == String("HEADING12"))
+ {
+ pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_HEADING12));
+ }
+ else if (pSh->GetCurWord() == String("ENTRY12"))
+ {
+ pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_ENTRY12));
+ }
+ else if (pSh->GetCurWord() == String("TABLE1"))
+ {
+ pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_TABLE1));
+ }
+ else if (pSh->GetCurWord() == String("IMAGE1"))
+ {
+ pSh->Overwrite(SW_RESSTR(STR_IDXEXAMPLE_IDXTXT_IMAGE1));
+ }
+ else
+ {;}
+ }
+ while(pSh->Right(sal_uInt16(1), sal_uInt16(1), sal_True) == sal_True);
+ }
+ }
+
uno::Reference< beans::XPropertySet > xCrsrProp(_xCursor, uno::UNO_QUERY);
uno::Any aPageStyle = xCrsrProp->getPropertyValue(
rtl::OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_PAGE_STYLE_NAME)));
@@ -318,7 +370,6 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
xWin->setVisible( sal_True );
rWindow.Show();
- uno::Reference< lang::XUnoTunnel> xTunnel( _xCursor, uno::UNO_QUERY);
if( xTunnel.is() )
{
OTextCursorHelper* pCrsr = reinterpret_cast<OTextCursorHelper*>( xTunnel->getSomething(
diff --git a/sw/source/ui/utlui/utlui.src b/sw/source/ui/utlui/utlui.src
index 69d9920bd288..bb01ea4225f7 100644
--- a/sw/source/ui/utlui/utlui.src
+++ b/sw/source/ui/utlui/utlui.src
@@ -229,6 +229,38 @@ String STR_CONTENT_TYPE_POSTIT
{
Text [ en-US ] = "Comments" ;
};
+String STR_IDXEXAMPLE_IDXTXT_HEADING1
+{
+ Text [ en-US ] = "Heading 1" ;
+};
+String STR_IDXEXAMPLE_IDXTXT_ENTRY1
+{
+ Text [ en-US ] = "This is the content from the first chapter. This is a user directory entry." ;
+};
+String STR_IDXEXAMPLE_IDXTXT_HEADING11
+{
+ Text [ en-US ] = "Heading 1.1" ;
+};
+String STR_IDXEXAMPLE_IDXTXT_ENTRY11
+{
+ Text [ en-US ] = "This is the content from chapter 1.1. This is the entry for the table of contents." ;
+};
+String STR_IDXEXAMPLE_IDXTXT_HEADING12
+{
+ Text [ en-US ] = "Heading 1.2" ;
+};
+String STR_IDXEXAMPLE_IDXTXT_ENTRY12
+{
+ Text [ en-US ] = "This is the content from chapter 1.2. This keyword is a main entry." ;
+};
+String STR_IDXEXAMPLE_IDXTXT_TABLE1
+{
+ Text [ en-US ] = "Table 1: This is table 1" ;
+};
+String STR_IDXEXAMPLE_IDXTXT_IMAGE1
+{
+ Text [ en-US ] = "Image 1: This is image 1" ;
+};
String STR_CONTENT_TYPE_SINGLE_OUTLINE
{
Text [ en-US ] = "Heading" ;