summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/doc/docnew.cxx2
-rw-r--r--sw/source/core/doc/doctxm.cxx4
-rw-r--r--sw/source/core/fields/authfld.cxx7
-rw-r--r--sw/source/core/fields/fldbas.cxx11
-rw-r--r--sw/source/core/tox/tox.cxx2
-rw-r--r--sw/source/core/uibase/index/toxmgr.cxx1
-rw-r--r--sw/source/core/uibase/utlui/initui.cxx1
-rw-r--r--sw/source/core/uibase/utlui/initui.hrc1
-rw-r--r--sw/source/core/uibase/utlui/initui.src6
-rw-r--r--sw/source/core/unocore/unoidx.cxx19
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx11
-rw-r--r--sw/source/filter/ww8/fields.cxx3
-rw-r--r--sw/source/filter/ww8/fields.hxx3
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx8
-rw-r--r--sw/source/ui/index/cnttab.cxx3
-rw-r--r--sw/source/ui/utlui/poolfmt.src4
16 files changed, 78 insertions, 8 deletions
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 48e0951e7b1e..1da16aa7f5cf 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -1062,6 +1062,8 @@ void SwDoc::InitTOXTypes()
mpTOXTypes->push_back( pNew );
pNew = new SwTOXType(TOX_AUTHORITIES, pShellRes->aTOXAuthoritiesName );
mpTOXTypes->push_back( pNew );
+ pNew = new SwTOXType(TOX_CITATION, pShellRes->aTOXCitationName );
+ mpTOXTypes->push_back( pNew );
}
void SwDoc::ReplaceDefaults(const SwDoc& rSource)
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 7fb5b700162e..0896535a6134 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -464,6 +464,7 @@ const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, bool bCreate )
case TOX_ILLUSTRATIONS: prBase = &mpDefTOXBases->pIllBase; break;
case TOX_AUTHORITIES: prBase = &mpDefTOXBases->pAuthBase; break;
case TOX_BIBLIOGRAPHY: prBase = &mpDefTOXBases->pBiblioBase; break;
+ case TOX_CITATION: /** TODO */break;
}
if(!(*prBase) && bCreate)
{
@@ -487,6 +488,7 @@ void SwDoc::SetDefaultTOXBase(const SwTOXBase& rBase)
case TOX_ILLUSTRATIONS: prBase = &mpDefTOXBases->pIllBase; break;
case TOX_AUTHORITIES: prBase = &mpDefTOXBases->pAuthBase; break;
case TOX_BIBLIOGRAPHY: prBase = &mpDefTOXBases->pBiblioBase; break;
+ case TOX_CITATION: /** TODO */break;
}
if(*prBase)
delete (*prBase);
@@ -1092,7 +1094,7 @@ SwTxtFmtColl* SwTOXBaseSection::GetTxtFmtColl( sal_uInt16 nLevel )
case TOX_AUTHORITIES:
case TOX_BIBLIOGRAPHY:
nPoolFmt = RES_POOLCOLL_TOX_AUTHORITIESH; break;
-
+ case TOX_CITATION: /** TODO */break;
case TOX_CONTENT:
// There's a jump in the ContentArea!
if( nLevel < 6 )
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index c83a82fdee05..76fb0f9e12d3 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -540,9 +540,14 @@ SwAuthorityField::~SwAuthorityField()
OUString SwAuthorityField::Expand() const
{
+ return ConditionalExpand(AUTH_FIELD_IDENTIFIER);
+}
+
+OUString SwAuthorityField::ConditionalExpand(ToxAuthorityField eField) const
+{
SwAuthorityFieldType* pAuthType = (SwAuthorityFieldType*)GetTyp();
OUString sRet;
- if(pAuthType->GetPrefix())
+ if(pAuthType->GetPrefix() && eField != AUTH_FIELD_TITLE)
sRet = OUString(pAuthType->GetPrefix());
if( pAuthType->IsSequence() )
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index 1931d821c4ac..8f0abbc0e7d0 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -40,6 +40,7 @@
#include <calc.hxx>
#include <comcore.hrc>
#include <docary.hxx>
+#include <authfld.hxx>
#include <math.h>
@@ -384,13 +385,19 @@ sal_Bool SwField::IsFixed() const
return bRet;
}
-OUString SwField::ExpandField(bool const bCached) const
+OUString SwField::ExpandField(bool const bCached, ToxAuthorityField eField) const
{
if ( m_bUseFieldValueCache )
{
if (!bCached) // #i85766# do not expand fields in clipboard documents
{
- m_Cache = Expand();
+ if (GetTypeId() == TYP_AUTHORITY)
+ {
+ const SwAuthorityField* pAuthorityField = static_cast<const SwAuthorityField*>(this);
+ m_Cache = pAuthorityField->ConditionalExpand(eField);
+ }
+ else
+ m_Cache = Expand();
}
return m_Cache;
}
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index c5a105e91ff8..e4a59643646b 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -281,6 +281,7 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237#
case TOX_OBJECTS : nPoolId = STR_POOLCOLL_TOX_OBJECTH; break;
case TOX_TABLES : nPoolId = STR_POOLCOLL_TOX_TABLESH; break;
case TOX_AUTHORITIES : nPoolId = STR_POOLCOLL_TOX_AUTHORITIESH; break;
+ case TOX_CITATION : nPoolId = STR_POOLCOLL_TOX_CITATION; break;
default:
OSL_ENSURE( !this, "invalid TOXTyp");
return ;
@@ -393,6 +394,7 @@ sal_uInt16 SwForm::GetFormMaxLevel( TOXTypes eTOXType )
case TOX_OBJECTS :
case TOX_TABLES : nRet = 2; break;
case TOX_BIBLIOGRAPHY :
+ case TOX_CITATION:
case TOX_AUTHORITIES : nRet = AUTH_TYPE_END + 1; break;
}
return nRet;
diff --git a/sw/source/core/uibase/index/toxmgr.cxx b/sw/source/core/uibase/index/toxmgr.cxx
index 62875171feaf..c29bd7b402bd 100644
--- a/sw/source/core/uibase/index/toxmgr.cxx
+++ b/sw/source/core/uibase/index/toxmgr.cxx
@@ -363,6 +363,7 @@ sal_Bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
pNewTOX->SetLevelFromChapter(rDesc.IsLevelFromChapter());
}
break;
+ case TOX_CITATION: /** TODO */break;
case TOX_OBJECTS:
case TOX_TABLES:
case TOX_AUTHORITIES:
diff --git a/sw/source/core/uibase/utlui/initui.cxx b/sw/source/core/uibase/utlui/initui.cxx
index 1a745a735392..d59e0bea3f16 100644
--- a/sw/source/core/uibase/utlui/initui.cxx
+++ b/sw/source/core/uibase/utlui/initui.cxx
@@ -204,6 +204,7 @@ ShellResource::ShellResource()
aTOXObjectsName( SW_RES(STR_TOX_OBJ)),
aTOXTablesName( SW_RES(STR_TOX_TBL)),
aTOXAuthoritiesName( SW_RES(STR_TOX_AUTH)),
+ aTOXCitationName( SW_RES(STR_TOX_CITATION)),
aLinkCtrlClick(SW_RESSTR(STR_LINK_CTRL_CLICK)),
aLinkClick(SW_RESSTR(STR_LINK_CLICK)),
pAutoFmtNameLst(0),
diff --git a/sw/source/core/uibase/utlui/initui.hrc b/sw/source/core/uibase/utlui/initui.hrc
index 6df29075cf65..c368dc4e625f 100644
--- a/sw/source/core/uibase/utlui/initui.hrc
+++ b/sw/source/core/uibase/utlui/initui.hrc
@@ -52,6 +52,7 @@
#define STR_LINK_CLICK 29
#define STR_GETREFFLD_REFITEMNOTFOUND 30
#define STR_DURATION_FORMAT 31
+#define STR_TOX_CITATION 32
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/uibase/utlui/initui.src b/sw/source/core/uibase/utlui/initui.src
index 81e47ff75eaa..999b27b79fbf 100644
--- a/sw/source/core/uibase/utlui/initui.src
+++ b/sw/source/core/uibase/utlui/initui.src
@@ -121,6 +121,12 @@ Resource RID_SW_SHELLRES
{
Text [ en-US ] = "Bibliography";
};
+
+ String STR_TOX_CITATION
+ {
+ Text [ en-US ] = "Citation";
+ };
+
String STR_TOX_TBL
{
Text [ en-US ] = "Index of Tables";
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index ddedefff7b54..94b785ad1da3 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -1519,6 +1519,7 @@ lcl_TypeToPropertyMap_Mark(const TOXTypes eType)
{
case TOX_INDEX: return PROPERTY_MAP_INDEX_MARK;
case TOX_CONTENT: return PROPERTY_MAP_CNTIDX_MARK;
+ case TOX_CITATION : return PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY;
//case TOX_USER:
default:
return PROPERTY_MAP_USER_MARK;
@@ -1553,6 +1554,7 @@ public:
OUString m_sPrimaryKeyReading;
OUString m_sSecondaryKeyReading;
OUString m_sUserIndexName;
+ OUString m_sCitaitonText;
Impl( SwXDocumentIndexMark & rThis,
SwDoc *const pDoc,
@@ -1826,6 +1828,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
{
case TOX_INDEX:
case TOX_CONTENT:
+ case TOX_CITATION:
pTOXType = pDoc->GetTOXType( m_pImpl->m_eTOXType, 0 );
break;
case TOX_USER:
@@ -1899,6 +1902,13 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
}
aMark.SetMainEntry(m_pImpl->m_bMainEntry);
break;
+ case TOX_CITATION:
+ if (!m_pImpl->m_sCitaitonText.isEmpty())
+ {
+ aMark.SetCitationKeyReading(m_pImpl->m_sCitaitonText);
+ }
+ aMark.SetMainEntry(m_pImpl->m_bMainEntry);
+ break;
case TOX_USER:
case TOX_CONTENT:
if (USHRT_MAX != m_pImpl->m_nLevel)
@@ -2225,6 +2235,15 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
case WID_MAIN_ENTRY:
m_pImpl->m_bMainEntry = lcl_AnyToBool(rValue);
break;
+ case PROPERTY_MAP_INDEX_OBJECTS:
+ {
+ uno::Sequence<com::sun::star::beans::PropertyValue> aValues(1);
+ com::sun::star::beans::PropertyValue propertyVal;
+ rValue >>= aValues;
+ propertyVal = aValues[0];
+ m_pImpl->m_sCitaitonText = lcl_AnyToString(propertyVal.Value);
+ }
+ break;
}
}
else
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index a4cfd0b7035c..a380dd0c5272 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1043,8 +1043,15 @@ void DocxAttributeOutput::EndField_Impl( FieldInfos& rInfos )
{
// Write the Field latest value
m_pSerializer->startElementNS( XML_w, XML_r, FSEND );
-
- OUString sExpand( rInfos.pField->ExpandField( true ) );
+ OUString sExpand;
+ if(rInfos.eType == ww::eCITATION)
+ {
+ sExpand = rInfos.pField->ExpandField( false , AUTH_FIELD_TITLE);
+ }
+ else
+ {
+ sExpand = rInfos.pField->ExpandField( true );
+ }
// newlines embedded in fields are 0x0B in MSO and 0x0A for us
RunText(sExpand.replace(0x0A, 0x0B));
diff --git a/sw/source/filter/ww8/fields.cxx b/sw/source/filter/ww8/fields.cxx
index baaa4b0100a2..41c3929e0b1b 100644
--- a/sw/source/filter/ww8/fields.cxx
+++ b/sw/source/filter/ww8/fields.cxx
@@ -126,7 +126,8 @@ namespace ww
/*93*/ "ADDRESSBLOCK",
/*94*/ "GREETINGLINE",
/*95*/ "SHAPE",
- /*96*/ "BIBLIOGRAPHY"
+ /*96*/ "BIBLIOGRAPHY",
+ /*97*/ "CITATION"
};
size_t nIndex = static_cast<size_t>(eIndex);
diff --git a/sw/source/filter/ww8/fields.hxx b/sw/source/filter/ww8/fields.hxx
index ce888085c73e..8bb8565deeae 100644
--- a/sw/source/filter/ww8/fields.hxx
+++ b/sw/source/filter/ww8/fields.hxx
@@ -121,7 +121,8 @@ namespace ww
eADDRESSBLOCK = 93,
eGREETINGLINE = 94,
eSHAPE = 95,
- eBIBLIOGRPAHY=96
+ eBIBLIOGRPAHY=96,
+ eCITATION = 97
};
/** Find the English Field Name from a winword index
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 8094d9d27e3f..7eb3134bc9ae 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -116,6 +116,7 @@
#include <flddropdown.hxx>
#include <chpfld.hxx>
#include <fmthdft.hxx>
+#include <authfld.hxx>
#include <filter/msfilter/sprmids.hxx>
@@ -2862,6 +2863,13 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField )
bWriteExpand = true;
}
break;
+ case RES_AUTHORITY:
+ {
+ const OUString sStr = " CITATION "
+ + lcl_GetExpandedField(*pFld);
+ GetExport().OutputField( pFld, ww::eCITATION, sStr );
+ }
+ break;
case RES_POSTITFLD:
//Sadly only possible for word in main document text
if (GetExport().nTxtTyp == TXT_MAINTEXT)
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 28743137aa99..fe1410b8a478 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -958,6 +958,7 @@ static long lcl_TOXTypesToUserData(CurTOXType eType)
case TOX_TABLES : nRet = TO_TABLE; break;
case TOX_AUTHORITIES : nRet = TO_AUTHORITIES; break;
case TOX_BIBLIOGRAPHY : nRet = TO_BIBLIOGRAPHY; break;
+ case TOX_CITATION :break;
}
return nRet;
}
@@ -1195,6 +1196,8 @@ void SwTOXSelectTabPage::FillTOXDescription()
rDesc.SetAuthSequence(m_pSequenceCB->IsChecked());
}
break;
+ case TOX_CITATION :
+ break;
}
rDesc.SetLevelFromChapter( m_pLevelFromChapterCB->IsVisible() &&
diff --git a/sw/source/ui/utlui/poolfmt.src b/sw/source/ui/utlui/poolfmt.src
index fe2865a7df5f..7b4d41c790a4 100644
--- a/sw/source/ui/utlui/poolfmt.src
+++ b/sw/source/ui/utlui/poolfmt.src
@@ -583,6 +583,10 @@ String STR_POOLCOLL_TOX_USER10
{
Text [ en-US ] = "User Index 10" ;
};
+String STR_POOLCOLL_TOX_CITATION
+{
+ Text [ en-US ] = "Citation" ;
+};
String STR_POOLCOLL_TOX_ILLUSH
{
Text [ en-US ] = "Illustration Index Heading";