void PrintOptTest::impl_checkPrint()

in main/svl/qa/complex/ConfigItems/helper/PrintOptTest.cxx [382:731]


void PrintOptTest::impl_checkPrint()
{
	//test SetReduceTransparency() 
	sal_Bool bNewValue = sal_False;
	sal_Bool bOldValue = sal_False;
	bOldValue = PrintOptTest::impl_IsReduceTransparency();
	bNewValue = !bOldValue;
	aPrintOpt.SetReduceTransparency(bNewValue) ;
	bNewValue = impl_IsReduceTransparency();
   // if(bNewValue != bOldValue) // test the old source
	if ( bNewValue == bOldValue ) // test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the SetReduceTransparency() error!"),
			0);
	}
    
	//test IsReduceTransparemcy()
	bNewValue = bOldValue = sal_False;
	bOldValue = impl_IsReduceTransparency();
	bNewValue = !bOldValue;
    impl_SetReduceTransparency(bNewValue);
	bNewValue = aPrintOpt.IsReduceTransparency();
	//if(bNewValue != bOldValue) // test the old source
	if(bNewValue == bOldValue) // test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the IsReduceTransparency() error!"),
			0);
	}

	// test SetReducedTransparencyMode()
	sal_Int16 nOldMode, nNewMode;
	nOldMode = nNewMode = 0;
    nOldMode = impl_GetReducedTransparencyMode();
	nNewMode = nOldMode + 1;
	aPrintOpt.SetReducedTransparencyMode( nNewMode );	
	nNewMode = impl_GetReducedTransparencyMode();
	//if(nNewMode != nOldMode)      // test the old source
	if ( nNewMode == nOldMode ) // test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the SetReducedTransparencyMode() error!"),
			0);
	}

	//test IsReducedTransparencyMode()
	nOldMode = nNewMode = 0;
	nOldMode = impl_GetReducedTransparencyMode();
	nNewMode = nOldMode + 1;
	impl_SetReducedTransparencyMode(nNewMode);
	nNewMode = aPrintOpt.GetReducedTransparencyMode();
	//if(nNewMode != nOldMode)    // test the old source
	if(nNewMode == nOldMode)  // test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the IsReducedTransparencyMode() error!"
			"nOldMode's value is :"),
			0);
	}

	// test the SetReduceGradients()
	bNewValue = bOldValue = sal_False;
	bOldValue = impl_IsReduceGradients();
	bNewValue = !bOldValue;
	aPrintOpt.SetReduceGradients(bNewValue);
	bNewValue = impl_IsReduceGradients();
	//if (bNewValue != bOldValue)   //test the old source 
	if (bNewValue == bOldValue)   //test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the SetReduceGradients() error!"),
			0);

	}

	// test the IsReduceGradients()
	bNewValue = bOldValue = sal_False;
	bOldValue = impl_IsReduceGradients();
	bNewValue = !bOldValue;
	this->impl_SetReduceGradients(bNewValue);
	bNewValue = aPrintOpt.IsReduceGradients();
   // if (bNewValue != bOldValue)   // test the old source
	if (bNewValue == bOldValue) // test the new source
    {
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the IsReduceGradients() error!"),
			0);

    }
    
	//test SetRedecedGradientMode()
	nOldMode = nNewMode = 0;
    nOldMode = this->impl_GetReducedGradientMode();
	nNewMode = nOldMode + 1;
    aPrintOpt.SetReducedGradientMode(nNewMode);
    nNewMode = this->impl_GetReducedGradientMode();
	//if (nNewMode != nOldMode)  // test the old source
	if (nNewMode == nOldMode)// test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the SetRedecedGradientMode() error!"),
			0);
	}

	// test GetReducedGradientMode()
	nOldMode = nNewMode = 0;
    nOldMode = this->impl_GetReducedGradientMode();
	nNewMode = nOldMode + 1;
	this->impl_SetReducedGradientMode(nNewMode);
	nNewMode = aPrintOpt.GetReducedGradientMode();
	//if (nNewMode != nOldMode) // test the old source
	if (nNewMode == nOldMode) // test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the GetReducedGradientMode() error!"),
			0);

	}
	
	//test the SetReducedGradientStepCount()
    sal_Int16 nNewStepCount;
	sal_Int16 nOldStepCount;
	nNewStepCount = nOldStepCount = 0;
	nOldStepCount = this->impl_GetReducedGradientStepCount();
	nNewStepCount = nOldStepCount + 1;
	aPrintOpt.SetReducedGradientStepCount(nNewStepCount);
	nNewStepCount = this->impl_GetReducedGradientStepCount();
   // if (nNewStepCount != nOldStepCount) // test the old source
	if (nNewStepCount == nOldStepCount) // test the new source
    {
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the SetReducedGradientStepCount() error!"),
			0);

    }

	// test the GetReduceGradientStepCount()
    nNewStepCount = nOldStepCount = 0;
	nOldStepCount = this->impl_GetReducedGradientStepCount();
	nNewStepCount = nOldStepCount + 1;
    this->impl_SetReducedGradientStepCount(nNewStepCount);
	nNewStepCount = aPrintOpt.GetReducedGradientStepCount();
   // if (nNewStepCount != nOldStepCount)  //test the old source
	if (nNewStepCount == nOldStepCount)  //test the new source
    {
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the GetReduceGradientStepCount() error!"),
			0);
    }
    
    // test the SetReduceBitmaps()
	bNewValue = bOldValue = sal_False;
	bOldValue = this->impl_IsReduceBitmaps();
	bNewValue = !bOldValue;
	aPrintOpt.SetReduceBitmaps(bNewValue);
	bNewValue = this->impl_IsReduceBitmaps();
	//if (bNewValue != bOldValue) // test the old source
	if (bNewValue == bOldValue) // test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the SetReduceBitmaps() error!"),
			0);
	}

	// test the IsReduceBitmaps()
	bNewValue = bOldValue = sal_False;
	bOldValue = this->impl_IsReduceBitmaps();
	bNewValue = !bOldValue;
	this->impl_SetReduceBitmaps(bNewValue);
	bNewValue = aPrintOpt.IsReduceBitmaps();
	//if (bNewValue != bOldValue)   // test the old source
	if (bNewValue == bOldValue) // test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the IsReduceBitmaps() error!"),
			0);
	}
	
	// test the SetReduceBitmap()
	nNewMode = nOldMode = 0;
	nOldMode = impl_GetReducedBitmapMode();
	nNewMode = nOldMode + 1;
	aPrintOpt.SetReducedBitmapMode(nNewMode);
	nNewMode = impl_GetReducedBitmapMode();
	//if (nNewMode != nOldMode)  // test the old source
	if (nNewMode == nOldMode)// test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the SetReduceBitmap() error!"),
			0);
	}
	
	// test the SetReduceBitmapMode()
	nNewMode = nOldMode = 0;
	nOldMode = this->impl_GetReducedBitmapMode();
	nNewMode = nOldMode + 1;
	aPrintOpt.SetReducedBitmapMode(nNewMode);
	nNewMode = this->impl_GetReducedBitmapMode();
    //if (nNewMode != nOldMode) // test the old source
	if (nNewMode == nOldMode)  // test the new source
    {
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the SetReduceBitmapMode() error!"),
			0);
    }

    // test the GetReduceBitmapMode()
	nNewMode = nOldMode = 0;
	nOldMode = this->impl_GetReducedBitmapMode();
	nNewMode = nOldMode + 1;
	this->impl_SetReducedBitmapMode(nNewMode);
	nNewMode = aPrintOpt.GetReducedBitmapMode();
	//if (nNewMode != nOldMode)  // test the old source
	if (nNewMode == nOldMode)// test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the GetReduceBitmapMode() error!"),
			0);

	}

	// test the SetReducedBitmapResolution()
	sal_Int16 nOldResolution ;
    sal_Int16 nNewResolution ;
	nNewResolution = nOldResolution = 0;
    nOldResolution = impl_GetReducedBitmapResolution();
	nNewResolution = nOldResolution + 1;
	aPrintOpt.SetReducedBitmapResolution(nNewResolution);
    nNewResolution = impl_GetReducedBitmapResolution();
	//if (nNewResolution != nOldResolution)  // test the old source
	if (nNewResolution == nOldResolution)// test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the SetReducedBitmapResolution() error!"),
			0);
	}

	// test the GetReduceBitmapResolution()
    nNewResolution = nOldResolution = 0;
	nOldResolution = impl_GetReducedBitmapResolution();
	nNewResolution = nOldResolution + 1;
	impl_SetReducedBitmapResolution(nNewResolution);
    nNewResolution = impl_GetReducedBitmapResolution();
	//if (nNewResolution != nOldResolution)   // test the old source
	if (nNewResolution == nOldResolution) // test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the GetReduceBitmapResolution() error!"),
			0);
	}

	// test SetReducedBitmapIncludesTransparency()
	bNewValue = bOldValue = sal_False;
    bOldValue = impl_IsReducedBitmapIncludesTransparency();
	bNewValue = !bOldValue;
	aPrintOpt.SetReducedBitmapIncludesTransparency(bNewValue);
	bNewValue = impl_IsReducedBitmapIncludesTransparency();
	//if (bNewValue != bOldValue) // test the new source
	if (bNewValue == bOldValue) // test the old source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the SetReducedBitmapIncludesTransparency() error!"),
			0);
	}

	// test the IsReducedBitmapIncludesTransparency()
	bNewValue = bOldValue = sal_False;
	bOldValue = impl_IsReducedBitmapIncludesTransparency();
	bNewValue = !bOldValue;
	impl_SetReducedBitmapIncludesTransparency(bNewValue);
	bNewValue = aPrintOpt.IsReducedBitmapIncludesTransparency();
	//if (bNewValue != bOldValue)   // test the old source
	if (bNewValue == bOldValue) // test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the IsReducedBitmapIncludesTransparency() error!"),
			0);
	}
	
	// test the SetConvertToGreyscales()
	bNewValue = bOldValue = sal_False;
    bOldValue = this->impl_IsConvertToGreyscales();
	bNewValue = !bOldValue;
	aPrintOpt.SetConvertToGreyscales(bNewValue);
	bNewValue = this->impl_IsConvertToGreyscales();
	//if (bNewValue != bOldValue) // test the old source
	if (bNewValue == bOldValue) // test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the SetConvertToGreyscales() error!"),
			0); 
	}

    // test the IsConvertToGreyscales() 
	bNewValue = bOldValue = sal_False;
	bOldValue = this->impl_IsConvertToGreyscales();
	bNewValue = !bOldValue;
    impl_SetConvertToGreyscales(bNewValue);
	bNewValue = aPrintOpt.IsConvertToGreyscales();
	//if (bNewValue != bOldValue) // test the old source
	if (bNewValue == bOldValue) // test the new source
	{
		throw css::uno::RuntimeException(
			rtl::OUString::createFromAscii(
			"null com.sun.star.configuration."
			"the IsConvertToGreyscales() error!"),
			0);
	}
}