From 6a4bb556c1c3491173d8fac57b0e0b754950ba42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sun, 3 Feb 2008 19:35:24 +0000 Subject: [PATCH] * HTML now looks ok. * Inlcude headers for clipboard too, one might want the css code also. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23852 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/sudoku/SudokuView.cpp | 49 +++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/src/apps/sudoku/SudokuView.cpp b/src/apps/sudoku/SudokuView.cpp index 7cea5b4374..45020ac7c5 100644 --- a/src/apps/sudoku/SudokuView.cpp +++ b/src/apps/sudoku/SudokuView.cpp @@ -245,15 +245,35 @@ SudokuView::SaveTo(BDataIO &stream, uint32 as) bool netPositiveFriendly = false; text = "\n\n\n" "\n" "\n\n\n"; - if (file) - stream.Write(text.String(), text.Length()); + /*if (file)*/ + stream.Write(text.String(), text.Length()); text = "Size(); x++) { char buff[2]; _SetText(buff, fField->ValueAt(x, y)); + + char border_right = 's'; + char border_bottom = 's'; + if ((x+1) % fField->BlockSize() == 0) + border_right = 'l'; + if ((y+1) % fField->BlockSize() == 0) + border_bottom = 'l'; + if (x == fField->Size() - 1) + border_right = 'n'; + if (y == fField->Size() - 1) + border_bottom = 'n'; + if (fField->ValueAt(x, y) == 0) { - text << "\n"; + text << "\n"; text << " "; } else if (fField->FlagsAt(x, y) & kInitialValue) { - text << "\n"; + text << "\n"; if (netPositiveFriendly) text << ""; text << buff; if (netPositiveFriendly) text << ""; } else { - text << "\n"; + text << "\n"; if (netPositiveFriendly) text << ""; text << buff; @@ -297,8 +332,8 @@ SudokuView::SaveTo(BDataIO &stream, uint32 as) stream.Write(text.String(), text.Length()); text = "\n"; - if (file) - stream.Write(text.String(), text.Length()); + /*if (file)*/ + stream.Write(text.String(), text.Length()); if (file) nodeInfo.SetType("text/html"); return B_OK;