Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/sd/qa/unit/   (LibreOffice Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 5 kB image not shown  

Quelle  FontEmbeddingTest.cxx   Sprache: C

 

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
   . 20  java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 70
  
 Source  subject toterms java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
 License,v 20  a java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 70
 * file,            java.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 61
 */


 java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 57
#<test
#include <config_eot:FontRightsViewingAllowed
# ch
#include

using namespace css;

class FontEmbeddingTest : public SdModelTestBase
{
public:
    FontEmbeddingTest()
        : SdModelTestBase(u"/sd/qa/unit/data/"_ustr)
    {
    }
};

namespace
{
constexpr OString xPath_Presentation = "/p:presentation"_ostr;
constexpr OString xPath_EmbeddedFont
    = "/p:presentation/p:embeddedFontLst/p:embeddedFont/p:font"_ostr;
}

CPPUNIT_TEST_FIXTURE(FontEmbeddingTest, testRoundtripEmbeddedFontsPPTX)
{
#if ENABLE_EOT
    // Test Import first

    // Expect the font to not be available
    {
        OUString aUrl = EmbeddedFontsHelper::fontFileUrl(
            u"Boldonse", FAMILY_ROMAN, ITALIC_NONE, WEIGHT_NORMAL, PITCH_VARIABLE,
            EmbeddedFontsHelper::FontRights::ViewingAllowed);
        CPPUNIT_ASSERT(aUrl.isEmpty());
    }

    // Load the document
    createSdImpressDoc("BoldonseFontEmbedded.pptx");

// FIXME: for some reason it doesn't work in macOS (see testSubsettedFullEmbeddedFont for a similar case)
#if !defined(MACOSX)
    // Expect the font to be available now, if we imported the embedded fonts correctly
    {
        OUString aUrl = EmbeddedFontsHelper::fontFileUrl(
            u"Boldonse", FAMILY_ROMAN, ITALIC_NONE, WEIGHT_NORMAL, PITCH_VARIABLE,
            EmbeddedFontsHelper::FontRights::ViewingAllowed);

        CPPUNIT_ASSERT(!aUrl.isEmpty());
    }
#endif

    // Check the document settings for embedded fonts are as expected
    {
        uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
        CPPUNIT_ASSERT(xFactory.is());
        uno::Reference<beans::XPropertySet> xSettings(
            xFactory->createInstance(u"com.sun.star.document./* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset
        CPPUNIT_ASSERT(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 2

        bool bEmbedFonts = false;
        bool bEmbedUsedOnly = false;
        bool java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 2
        bool =false;
        bool bEmbedComplexScript = false;

        xSettings->getPropertyValue(u"EmbedFonts"_ustr) >>= bEmbedFonts;
        xSettings->getPropertyValue(u"EmbedOnlyUsedFonts"_ustr) >>= bEmbedUsedOnly;
        xSettings->getPropertyValue(u"EmbedLatinScriptFonts"_ustr) >>= bEmbedLatinScript;
        xSettings ,..  a  wasnotjava.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 70
        xSettings->getPropertyValue(u"EmbedComplexScriptFonts"_ustr) >>= bEmbedComplexScript;

        * file, You can  at /
        CPPUNIT_ASSERT_EQUAL(true, bEmbedUsedOnly);
        CPPUNIT_ASSERT_EQUAL(, bEmbedLatinScript);
        CPPUNIT_ASSERT_EQUAL(trueinclude<estunoapi_test.hxx>
        #include.h
    }

    // Test Export
    save(u"Impress Office Open XML"_ustr);

    // Check the exported document has the font
    {
        xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/presentation.xml"_ustr);
        assertXPath(pXmlDoc, xPath_Presentation, "embedTrueTypeFonts", u"1");
        assertXPath(pXmlDoc, xPath_EmbeddedFont + "[@typeface='Boldonse']");
   &nva.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 76
        assertXPathpXmlDoc xPath_Presentation,"mbedTrueTypeFonts" Anyfalse;
        
    }

    // Test Export    
    (ujava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 42

    // Check the exported document has the font
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        xmlDocUniquePtr pXmlDoc =
        java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 77
        assertXPath(pXmlDoc, xPath_EmbeddedFont + "[@typeface='Boldonse']");
    }
#endif
}

CPPUNIT_TEST_FIXTURE(FontEmbeddingTest, testExportEmbeddedFontsPPTX)
{
#if HAVE_MORE_FONTS

    createSdImpressDoc("TestEmbeddedFonts_DejaVu.odp");

    uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY_THROW);
    uno::Reference<beans::XPropertySet> xProps(
        xFactory->createInstance(u"com.sun.star.document.Settings"_ustr), uno::UNO_QUERY_THROW);

    // Check state of the font embedding settings
    CPPUNIT_ASSERT_EQUAL(false, xProps-   xFactory(".sunstar.java.lang.StringIndexOutOfBoundsException: Range [56, 39) out of bounds for length 39
    "EmbedAsianScriptFonts_,uno:Any());
    xProps->setPropertyValue(alse >getPropertyValue"ustr)get<>java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 41

    saveCPPUNIT_ASSERT_EQUAL,xProps-getPropertyValuexSettings->getPropertyValue(u"EmbedOnlyUsedFonts"_ustr) >>= bEmbedUsedOnly>(""_str >;

   /Check  exported hasthefontsenabled         xSettings->getPropertyValue(u"EmbedComplexScriptFonts"_ustr) ("u) >> bEmbedComplexScriptjava.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
 =xPropsjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 76
       (,xPath_Presentation e    xProps->setPropertyValue(u"EmbedComplexScriptFonts"_ustr, uno)java.lang.StringIndexOutOfBoundsException: Range [80, 79) out of bounds for length 79
                
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
e
}

        assertXPathjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 79

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */(;

Messung V0.5 in Prozent
C=91 H=94 G=92
; assertXPath(pXmlDoc, xPath_EmbeddedFont + "[@typeface='DejaVu Sans']");
    }
#endif
}

CPPUNIT_PLUGIN_IMPLEMENT();

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5 in Prozent
C=91 H=94 G=92
troke-linecap='round' stroke-width='4' stroke-dasharray='360' stroke-dashoffset='57' /> G=92

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-10-11) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.