// public
void kpDocumentMetaInfo::printDebug (const QString &prefix) const
{
    const QString usedPrefix = !prefix.isEmpty () ?
                                   prefix + QString::fromLatin1 (":") :
                                   QString::null;

    kdDebug () << usedPrefix << endl;

    kdDebug () << "dotsPerMeter X=" << dotsPerMeterX ()
               << " Y=" << dotsPerMeterY ()
               << " offset=" << offset () << endl;

    QValueList <QImageTextKeyLang> keyList = textList ();
    for (QValueList <QImageTextKeyLang>::const_iterator it = keyList.begin ();
         it != keyList.end ();
         it++)
    {
        kdDebug () << "key=" << (*it).key
                   << " lang=" << (*it).lang
                   << " text=" << text (*it)
                   << endl;
    }

    kdDebug () << usedPrefix << "ENDS" << endl;
}
Example #2
0
String Double::localeDoubleToString(double value,
                                    char format,
                                    int32 precision)
{
    ShortList<char, 512> textList(512);
    char formatStr[14];

    // TODO: Broken due to Windows _snprintf result
    // Generate a format string
    makeFormatStr(formatStr, format, precision);

    textList.uninitializedResize(512);
    uint32 printLen = (uint32)::_snprintf(textList.data(), 512, formatStr, value);

    if (printLen >= 512)
    {
        textList.uninitializedResize(printLen+1);
        ::_snprintf(textList.data(), printLen+1, formatStr, value);
    }

    return String(textList.data(), printLen);
}
Example #3
0
String Double::doubleToString(double value,
                              char format,
                              int32 precision)
{
    ShortList<char, 512> textList(512);
    char formatStr[14];

    // Generate a format string
    makeFormatStr(formatStr, format, precision);

    _locale_t cLocale = ::_create_locale(LC_NUMERIC, "C");

    textList.uninitializedResize(512);
    uint32 printLen = (uint32)::_snprintf_l(textList.data(), 512, formatStr, cLocale, value);

    if (printLen >= 512)
    {
        textList.uninitializedResize(printLen+1);
        ::_snprintf_l(textList.data(), printLen+1, formatStr, cLocale, value);
    }

    ::_free_locale(cLocale);
    return String(textList.data(), printLen);
}
void MarkdownListAction::doExecute()
{
    textList();
}
nsIFrame*
nsComboboxControlFrame::CreateFrameFor(nsIContent*      aContent)
{ 
  NS_PRECONDITION(nsnull != aContent, "null ptr");

  NS_ASSERTION(mDisplayContent, "mDisplayContent can't be null!");

  if (mDisplayContent != aContent) {
    // We only handle the frames for mDisplayContent here
    return nsnull;
  }
  
  // Get PresShell
  nsIPresShell *shell = PresContext()->PresShell();
  nsStyleSet *styleSet = shell->StyleSet();

  // create the style contexts for the anonymous block frame and text frame
  nsRefPtr<nsStyleContext> styleContext;
  styleContext = styleSet->
    ResolvePseudoStyleFor(mContent, 
                          nsCSSAnonBoxes::mozDisplayComboboxControlFrame,
                          mStyleContext);
  if (NS_UNLIKELY(!styleContext)) {
    return nsnull;
  }

  nsRefPtr<nsStyleContext> textStyleContext;
  textStyleContext = styleSet->ResolveStyleForNonElement(mStyleContext);
  if (NS_UNLIKELY(!textStyleContext)) {
    return nsnull;
  }

  // Start by by creating our anonymous block frame
  mDisplayFrame = new (shell) nsComboboxDisplayFrame(styleContext, this);
  if (NS_UNLIKELY(!mDisplayFrame)) {
    return nsnull;
  }

  nsresult rv = mDisplayFrame->Init(mContent, this, nsnull);
  if (NS_FAILED(rv)) {
    mDisplayFrame->Destroy();
    mDisplayFrame = nsnull;
    return nsnull;
  }

  // Create a text frame and put it inside the block frame
  mTextFrame = NS_NewTextFrame(shell, textStyleContext);
  if (NS_UNLIKELY(!mTextFrame)) {
    return nsnull;
  }

  // initialize the text frame
  rv = mTextFrame->Init(aContent, mDisplayFrame, nsnull);
  if (NS_FAILED(rv)) {
    mDisplayFrame->Destroy();
    mDisplayFrame = nsnull;
    mTextFrame->Destroy();
    mTextFrame = nsnull;
    return nsnull;
  }

  nsFrameList textList(mTextFrame);
  mDisplayFrame->SetInitialChildList(nsnull, textList);
  return mDisplayFrame;
}