Kaydet (Commit) 8a639d24 authored tarafından Daniel Rentz's avatar Daniel Rentz

#i107170# use current script for default cell style

üst 590cca7e
......@@ -415,7 +415,7 @@ XclExpStringRef lclCreateFormattedString(
nScript = nLastScript;
// construct font from current text portion
SvxFont aFont( XclExpFontBuffer::GetFontFromItemSet( rItemSet, nScript ) );
SvxFont aFont( XclExpFontHelper::GetFontFromItemSet( rRoot, rItemSet, nScript ) );
// Excel start position of this portion
sal_uInt16 nXclPortionStart = xString->Len();
......@@ -529,7 +529,7 @@ XclExpStringRef lclCreateFormattedString(
sal_Int16 nScript = xBreakIt->getScriptType( aXclPortionText, 0 );
if( nScript == ApiScriptType::WEAK )
nScript = nLastScript;
SvxFont aFont( XclExpFontBuffer::GetFontFromItemSet( aItemSet, nScript ) );
SvxFont aFont( XclExpFontHelper::GetFontFromItemSet( rRoot, aItemSet, nScript ) );
nLastScript = nScript;
// add escapement
......
......@@ -139,6 +139,36 @@ const size_t EXC_FONTLIST_NOTFOUND = static_cast< size_t >( -1 );
// ----------------------------------------------------------------------------
/** Static helper functions for font export. */
class XclExpFontHelper
{
public:
/** Returns the script type of the first font item found in the item set and its parents. */
static sal_Int16 GetFirstUsedScript(
const XclExpRoot& rRoot,
const SfxItemSet& rItemSet );
/** Returns a VCL font object filled from the passed item set. */
static Font GetFontFromItemSet(
const XclExpRoot& rRoot,
const SfxItemSet& rItemSet,
sal_Int16 nScript );
/** Returns true, if at least one font related item is set in the passed item set.
@param bDeep true = Searches in parent item sets too. */
static bool CheckItems(
const XclExpRoot& rRoot,
const SfxItemSet& rItemSet,
sal_Int16 nScript,
bool bDeep );
private:
XclExpFontHelper();
~XclExpFontHelper();
};
// ----------------------------------------------------------------------------
/** Stores all data of an Excel font and provides export of FONT records. */
class XclExpFont : public XclExpRecord, protected XclExpRoot
{
......@@ -228,15 +258,6 @@ public:
virtual void Save( XclExpStream& rStrm );
virtual void SaveXml( XclExpXmlStream& rStrm );
/** Returns the script type of the first font item found in the item set and its parents. */
static sal_Int16 GetFirstUsedScript( const SfxItemSet& rItemSet );
/** Returns a VCL font object filled from the passed item set. */
static Font GetFontFromItemSet( const SfxItemSet& rItemSet, sal_Int16 nScript );
/** Returns true, if at least one font related item is set in the passed item set.
@param bDeep true = Searches in parent item sets too. */
static bool CheckItems( const SfxItemSet& rItemSet, sal_Int16 nScript, bool bDeep );
private:
/** Initializes the default fonts for the current BIFF version. */
void InitDefaultFonts();
......
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