mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
cover alignment.cpp
This commit is contained in:
parent
874ea7abeb
commit
60372fb145
|
@ -61,8 +61,8 @@ protected:
|
|||
std::string to_hash_string() const override;
|
||||
|
||||
private:
|
||||
horizontal_alignment horizontal_ = horizontal_alignment::none;
|
||||
vertical_alignment vertical_ = vertical_alignment::none;
|
||||
horizontal_alignment horizontal_ = horizontal_alignment::general;
|
||||
vertical_alignment vertical_ = vertical_alignment::bottom;
|
||||
int text_rotation_ = 0;
|
||||
bool wrap_text_ = false;
|
||||
bool shrink_to_fit_ = false;
|
||||
|
|
33
source/styles/tests/test_alignment.hpp
Normal file
33
source/styles/tests/test_alignment.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <cxxtest/TestSuite.h>
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
class test_alignment : public CxxTest::TestSuite
|
||||
{
|
||||
public:
|
||||
void test_all()
|
||||
{
|
||||
xlnt::alignment alignment;
|
||||
|
||||
TS_ASSERT(alignment.has_horizontal());
|
||||
TS_ASSERT_EQUALS(alignment.get_horizontal(), xlnt::horizontal_alignment::general);
|
||||
alignment.set_horizontal(xlnt::horizontal_alignment::none);
|
||||
TS_ASSERT(!alignment.has_horizontal());
|
||||
|
||||
TS_ASSERT(alignment.has_vertical());
|
||||
TS_ASSERT_EQUALS(alignment.get_vertical(), xlnt::vertical_alignment::bottom);
|
||||
alignment.set_vertical(xlnt::vertical_alignment::none);
|
||||
TS_ASSERT(!alignment.has_vertical());
|
||||
|
||||
TS_ASSERT(!alignment.get_shrink_to_fit());
|
||||
alignment.set_shrink_to_fit(true);
|
||||
TS_ASSERT(alignment.get_shrink_to_fit());
|
||||
|
||||
TS_ASSERT(!alignment.get_wrap_text());
|
||||
alignment.set_wrap_text(true);
|
||||
TS_ASSERT(alignment.get_wrap_text());
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user