From cdf25540df17e3fbb706d1c98c447689e8be4fe4 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 21 Aug 2012 18:53:01 -0400 Subject: [PATCH] 64-bit fixes for StyledEdit. --- src/apps/stylededit/StyledEditWindow.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/apps/stylededit/StyledEditWindow.cpp b/src/apps/stylededit/StyledEditWindow.cpp index 0789d3a754..3ba782cd57 100644 --- a/src/apps/stylededit/StyledEditWindow.cpp +++ b/src/apps/stylededit/StyledEditWindow.cpp @@ -1118,7 +1118,7 @@ StyledEditWindow::_InitWindow(uint32 encoding) fontMessage->AddFloat("size", fontSizes[i]); char label[64]; - snprintf(label, sizeof(label), "%ld", fontSizes[i]); + snprintf(label, sizeof(label), "%" B_PRId32, fontSizes[i]); fFontSizeMenu->AddItem(menuItem = new BMenuItem(label, fontMessage)); if (fontSizes[i] == (int32)be_plain_font->Size()) @@ -1451,7 +1451,7 @@ StyledEditWindow::_Search(BString string, bool caseSensitive, bool wrap, if (start != B_ERROR) { finish = start + length; fTextView->Select(start, finish); - + if (scrollToOccurence) fTextView->ScrollToSelection(); return true; @@ -1505,7 +1505,7 @@ StyledEditWindow::_ReplaceAll(BString findThis, BString replaceWith, { bool first = true; fTextView->SetSuppressChanges(true); - + // start from the beginning of text fTextView->Select(0, 0); @@ -1517,11 +1517,11 @@ StyledEditWindow::_ReplaceAll(BString findThis, BString replaceWith, } int32 start; int32 finish; - + fTextView->GetSelection(&start, &finish); fTextView->Delete(start, start + findThis.Length()); fTextView->Insert(start, replaceWith.String(), replaceWith.Length()); - + // advance the caret behind the inserted text start += replaceWith.Length(); fTextView->Select(start, start); @@ -1641,7 +1641,7 @@ StyledEditWindow::_ShowStatistics() BAlert* alert = new BAlert("Statistics", result, B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_INFO_ALERT); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); - + return alert->Go(); }