Browse Source

Added throwing rfb::UnsupportedPixelFormatExceptions exception in ScaledDIBSectionBuffer class.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2368 3789f03b-4d11-0410-bbf8-ca57d06f2519
tags/v0.0.90
george82 16 years ago
parent
commit
3e43ed5fb3
2 changed files with 3 additions and 2 deletions
  1. 2
    1
      win/rfb_win32/ScaledDIBSectionBuffer.cxx
  2. 1
    1
      win/vncviewer/DesktopWindow.cxx

+ 2
- 1
win/rfb_win32/ScaledDIBSectionBuffer.cxx View File

@@ -41,6 +41,7 @@ ScaledDIBSectionBuffer::~ScaledDIBSectionBuffer() {

void ScaledDIBSectionBuffer::setScale(int scale_) {
if (scale == scale_ || scale_ <= 0) return;
if (!(getPixelFormat().trueColour) && scale_ != 100) throw rfb::UnsupportedPixelFormatException();
ScaledPixelBuffer::setScale(scale_);
if (scale == 100) scaling = false;
else scaling = true;
@@ -50,7 +51,7 @@ void ScaledDIBSectionBuffer::setScale(int scale_) {
void ScaledDIBSectionBuffer::setPF(const PixelFormat &pf_) {
if (memcmp(&(ScaledPixelBuffer::pf), &pf_, sizeof(pf_)) == 0) return;

if (!pf_.trueColour) throw rfb::UnsupportedPixelFormatException();
if (!pf_.trueColour && isScaling()) throw rfb::UnsupportedPixelFormatException();

pf = pf_;
if (scaling) {

+ 1
- 1
win/vncviewer/DesktopWindow.cxx View File

@@ -73,7 +73,7 @@ LRESULT CALLBACK DesktopWindowProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lPa
try {
result = _this->processMessage(msg, wParam, lParam);
} catch (rfb::UnsupportedPixelFormatException &e) {
MsgBox(0, e.str(), MB_OK);
MsgBox(0, e.str(), MB_OK | MB_ICONINFORMATION);
_this->getCallback()->closeWindow();
} catch (rdr::Exception& e) {
vlog.error("untrapped: %s", e.str());

Loading…
Cancel
Save